{"version":3,"file":"default-node_modules_amcharts_amcharts4-geodata_usaLow_js-node_modules_amcharts_amcharts4_cor-f5e0a0.js","mappings":"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A0F,iBAAiB;AACx2D,UAAU,iCAAiC,kwCAAkwC,kBAAkB,8FAA8F,iBAAiB;AAC96C,UAAU,iCAAiC,gkBAAgkB,kBAAkB,wFAAwF;AACrtB;AACA,iEAAe,GAAG,EAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACrDnB;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AAC4C;AACE;AAC0B;AACR;AAClB;AACC;AACF;AACD;AACI;AACA;AACJ;AACmC;AAC/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,IAAI,iDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,CAAC,oDAAQ;AACe;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,oBAAoB;AAC7B,SAAS,sBAAsB;AAC/B;AACA;AACA,IAAI,iDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,sEAAoB;AAChD;AACA;AACA;AACA;AACA;AACA,2BAA2B,uDAAK;AAChC,2BAA2B,0DAAY;AACvC,kCAAkC,0DAAY;AAC9C;AACA;AACA,sBAAsB,4DAAO;AAC7B,uBAAuB,4DAAO;AAC9B;AACA;AACA,wDAAwD,sDAAS;AACjE;AACA;AACA,wCAAwC,4DAAO;AAC/C,yCAAyC,4DAAO;AAChD;AACA;AACA,iEAAiE,sDAAS;AAC1E;AACA,+BAA+B,4DAAO;AACtC,gCAAgC,4DAAO;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,uDAAc;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,sDAAU;AACtB;AACA,aAAa;AACb,mCAAmC,yCAAyC;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,iBAAiB,yDAAyD;AAC1E;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,uCAAuC,0DAAQ;AAC/C;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,uDAAc,oBAAoB,uDAAc;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+DAA+D,qDAAI;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,wDAAwD;AACzE;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC,CAAC,sDAAS;AACM;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,4EAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA,sEAAiB;AACjB,cAAc,kFAA6B;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,sEAAiB;AACjB,cAAc,mFAA8B;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,sEAAiB;AACjB,cAAc,mFAA8B;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,sEAAiB;AACjB,cAAc,oFAA+B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC/aD;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AAC8C;AACF;AACoB;AACK;AACvB;AACC;AACG;AACN;AACqB;AACR;AACW;AACtB;AACF;AACA;AACJ;AACU;AACW;AACkB;AACxB;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,IAAI,iDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,2DAAQ;AACjD,wBAAwB,uDAAc;AACtC;AACA;AACA,iBAAiB;AACjB;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,MAAM,EAAE,KAAK;AAC/D;AACA;AACA,kDAAkD,MAAM,EAAE,KAAK;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,MAAM,EAAE,KAAK;AACzC;AACA;AACA;AACA;AACA;AACA,iBAAiB,uEAAuE;AACxF;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,2DAAQ;AACjD,wBAAwB,uDAAc;AACtC;AACA;AACA,iBAAiB;AACjB;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA,qBAAqB;AACrB;AACA;AACA,qBAAqB;AACrB;AACA,yCAAyC,2DAAQ;AACjD,wBAAwB,uDAAc;AACtC;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,uCAAuC,oDAAQ,sBAAsB,iDAAM;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,2DAAQ;AACnD;AACA;AACA;AACA,qBAAqB;AACrB,0CAA0C,iDAAM;AAChD;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,2DAAQ;AACjD,wBAAwB,uDAAc;AACtC;AACA;AACA,iBAAiB;AACjB;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC,CAAC,oDAAQ;AACgB;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACyB;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,yDAAyD;AAClE,SAAS,qBAAqB;AAC9B,SAAS,uBAAuB;AAChC;AACA;AACA,IAAI,iDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,sDAAS;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,8EAAwB;AAChE,kDAAkD;AAClD;AACA,mCAAmC,0DAAY;AAC/C,kCAAkC,0DAAY;AAC9C;AACA;AACA,8BAA8B,6EAAc;AAC5C,gBAAgB,gEAAc;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wDAAwD,WAAW;AACnE;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,kCAAkC,6EAAiB;AACnD;AACA,yBAAyB,sDAAS;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,4BAA4B,0DAAY;AACxC,kCAAkC,0DAAY;AAC9C;AACA;AACA,2CAA2C,6EAAgB;AAC3D,0BAA0B,4DAAO;AACjC,2BAA2B,4DAAO;AAClC;AACA,gDAAgD;AAChD;AACA;AACA,wBAAwB,uDAAK;AAC7B,uBAAuB,KAAK;AAC5B;AACA;AACA;AACA;AACA,2BAA2B,0DAAY;AACvC,kCAAkC,0DAAY;AAC9C;AACA;AACA;AACA;AACA;AACA,6BAA6B,uDAAK;AAClC;AACA;AACA,+BAA+B;AAC/B;AACA;AACA;AACA;AACA;AACA,gCAAgC,0DAAY;AAC5C,kCAAkC,0DAAY;AAC9C;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,uDAAc;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,oDAAW;AACnB;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,wDAAO;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kGAAkG,iDAAM;AACxG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,wDAAe;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,aAAa,uDAAc;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,wDAAO;AACpD;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,uDAAc;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,4DAAO;AACxC;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,gEAAS;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,kDAAS;AAC3C;AACA;AACA;AACA,gCAAgC,kDAAS;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD;AAChD,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oFAAoF,iDAAM;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,6EAAiB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,CAAC,sDAAS;AACO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA,6EAAoC;AACpC;AACA;AACA;AACA;AACA;AACA;AACA,sEAAiB;AACjB,cAAc,kFAA6B;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,sEAAiB;AACjB,cAAc,mFAA8B;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,sEAAiB;AACjB,cAAc,+EAA0B;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACz1BD;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACiD;AACA;AACF;AACP;AACU;AACI;AACW;AACQ;AACL;AACrB;AACwB;AACpB;AACJ;AACE;AACE;AACF;AACF;AACmC;AAClF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,IAAI,iDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,0DAAQ;AAC7D;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,sDAAa;AAC7B;AACA;AACA;AACA;AACA,oBAAoB,sDAAa;AACjC;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,0DAAQ;AAC7D;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,sDAAa;AAC7B;AACA;AACA;AACA;AACA,oBAAoB,sDAAa;AACjC;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,0DAAQ;AAC7D;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,sDAAa;AAC7B;AACA;AACA;AACA;AACA,oBAAoB,sDAAa;AACjC;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,0DAAQ;AAC7D;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,sDAAa;AAC7B;AACA;AACA;AACA;AACA,oBAAoB,sDAAa;AACjC;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,sDAAS;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,sDAAa;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC,CAAC,oDAAQ;AACc;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA,CAAC,4CAA4C;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,mBAAmB;AAC5B,SAAS,qBAAqB;AAC9B;AACA;AACA,IAAI,iDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,kDAAI;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,6EAAiB;AACnD;AACA,0BAA0B,uDAAK;AAC/B;AACA;AACA;AACA;AACA;AACA,uCAAuC,+DAAkB,gCAAgC,kCAAkC;AAC3H;AACA;AACA,0BAA0B,2DAAO;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,uDAAc;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,uDAAU;AAClB;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,uDAAU;AAClB;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,uDAAU;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,uDAAU;AACtB;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,+DAAa;AAChC,gBAAgB,0DAAQ;AACxB;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,uDAAuD;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C;AAC1C;AACA;AACA;AACA;AACA,yEAAyE;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,uDAAc;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,yDAAgB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,gEAAuB;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,+DAAsB;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,0DAAY;AACnD;AACA,yCAAyC,0DAAY;AACrD;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,sEAAkB;AACzD,2BAA2B,sDAAa;AACxC,iBAAiB;AACjB;AACA,yCAAyC,0DAAY;AACrD;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,iDAAS;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,kDAAI;AACvC;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,uDAAU;AAClB,iDAAiD;AACjD;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,uDAAc;AAC1B;AACA,gBAAgB,+DAAkB;AAClC;AACA;AACA,wBAAwB,uDAAc,gBAAgB,uDAAc;AACpE;AACA;AACA;AACA;AACA;AACA,gCAAgC,uDAAc,gBAAgB,uDAAc;AAC5E;AACA,mDAAmD,2DAAkB,GAAG,kCAAkC,IAAI,sBAAsB;AACpI;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,uDAAU;AAC7B;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oDAAW,CAAC,0DAAa;AACzC,qCAAqC,kDAAS;AAC9C,mCAAmC,kDAAS;AAC5C;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,gBAAgB,uDAAU;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,gHAAgH;AAC7H;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,0DAAQ;AACtC;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,uDAAc,uBAAuB,sDAAa;AAClE,gEAAgE,SAAS;AACzE;AACA;AACA,wBAAwB,uDAAc;AACtC,4BAA4B,uDAAc;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC,CAAC,sDAAS;AACK;AAChB;AACA;AACA;AACA;AACA;AACA;AACA,2EAAkC;AAClC,mFAA0C;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA,sEAAiB;AACjB,cAAc,kFAA6B;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;;;;;;;;;;;;ACp6DD;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACiD;AACgB;AACP;AACb;AACE;AACA;AACwB;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,wBAAwB;AACjC,SAAS,0BAA0B;AACnC;AACA;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,sEAAoB;AAC9C;AACA;AACA;AACA,8BAA8B,kDAAI;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,4EAAiB;AACnD;AACA;AACA,4BAA4B,+DAAS;AACrC;AACA,2BAA2B,wDAAK;AAChC;AACA;AACA;AACA,4BAA4B,+DAAS;AACrC,yBAAyB,wDAAK;AAC9B;AACA;AACA;AACA;AACA,0BAA0B,+DAAS;AACnC,uBAAuB,wDAAK;AAC5B,yBAAyB,wDAAK,aAAa;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC,CAAC,sDAAS;AACU;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,gFAAuC;;;;;;;;;;;;;;;;;;AClWvC;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACiD;AACF;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR,MAAM;AACN;AACA;AACA;AACA;AACA,SAAS,yBAAyB;AAClC,SAAS,2BAA2B;AACpC;AACA;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA,gBAAgB;AAChB,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,CAAC,sDAAS;AACW;AACtB;AACA;AACA;AACA;AACA;AACA;AACA,iFAAwC;;;;;;;;;;;;;;;;;;;;ACnKN;AAClC;AACA;AACA;AACA;AACA;AACA;AAC2C;AACI;AACwB;AACxB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,uBAAuB;AAChC,SAAS,yBAAyB;AAClC;AACA;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,4EAAiB;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,sDAAc,wBAAwB,sDAAc;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,gCAAgC,YAAY;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC,CAAC,gDAAM;AACY;AACpB;AACA;AACA;AACA;AACA;AACA;AACA,+EAAsC;;;;;;;;;;;;;;;;;;AC3KtC;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACkD;AACH;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,wBAAwB;AACjC,SAAS,0BAA0B;AACnC;AACA;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,CAAC,uDAAK;AACc;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,gFAAuC;;;;;;;;;;;;;;;;;;;;ACjGvC;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AAC2C;AACI;AACA;AACwB;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,uBAAuB;AAChC,SAAS,yBAAyB;AAClC;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,4EAAiB;AACnD;AACA;AACA;AACA,qBAAqB,wDAAK;AAC1B;AACA;AACA;AACA,gCAAgC,YAAY;AAC5C;AACA;AACA,CAAC,CAAC,gDAAM;AACY;AACpB;AACA;AACA;AACA;AACA;AACA;AACA,+EAAsC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACrDtC;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACiD;AACgB;AAC3B;AACA;AACA;AACR;AACU;AACF;AAC6B;AACpB;AACI;AACJ;AACA;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,2BAA2B;AACpC,SAAS,6BAA6B;AACtC;AACA;AACA,IAAI,iDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,sEAAoB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,sDAAS;AACvD;AACA;AACA;AACA;AACA,8BAA8B,6DAAO;AACrC,+BAA+B,6DAAO;AACtC;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,+CAA+C,sDAAS;AACxD;AACA;AACA;AACA,+BAA+B,6DAAO;AACtC,gCAAgC,6DAAO;AACvC;AACA,iDAAiD,sDAAS;AAC1D;AACA;AACA;AACA,iCAAiC,6DAAO;AACxC,kCAAkC,6DAAO;AACzC;AACA,uCAAuC,+CAAQ;AAC/C;AACA;AACA,yCAAyC,uCAAI;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,iBAAiB,4HAA4H;AAC7I;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,+CAAY;AACxD,gBAAgB,uDAAc;AAC9B;AACA;AACA,gBAAgB,uDAAc;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA,iBAAiB,yEAAyE;AAC1F;AACA;AACA;AACA;AACA;AACA,sCAAsC,0DAAY;AAClD;AACA;AACA,yCAAyC,0DAAY;AACrD;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,+CAAQ;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,0DAAY;AAC7C;AACA;AACA,yCAAyC,0DAAY;AACrD;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,uCAAI;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,0DAAY;AAC9C,yCAAyC,0DAAY;AACrD;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,+CAAQ;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,0DAAY;AAC/C;AACA;AACA,yCAAyC,0DAAY;AACrD;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,iDAAS;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,iFAAiF;AAClG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,iFAAiF;AAClG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,iFAAiF;AAClG;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,iFAAiF;AAClG;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,CAAC,sDAAS;AACa;AACxB;AACA;AACA;AACA;AACA;AACA;AACA,mFAA0C;;;;;;;;;;;;;;;;;;;;;;;;;;;ACz7B1C;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AAC8C;AACJ;AACgB;AACU;AACrB;AACa;AACb;AACI;AACF;AACF;AACmC;AAClF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,2BAA2B;AACpC,SAAS,6BAA6B;AACtC;AACA;AACA,IAAI,iDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,4DAAO;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,wDAAO;AAC/C,6BAA6B,4DAAO;AACpC;AACA;AACA,YAAY,mDAAW;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,yCAAyC;AAC3F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,sDAAc;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,wDAAgB;AACjC,iBAAiB,wDAAgB;AACjC;AACA;AACA;AACA;AACA,eAAe,4DAAgB;AAC/B;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,wDAAgB;AACvC,qBAAqB,wDAAgB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,eAAe;AAC/D,oBAAoB,wDAAY,GAAG,YAAY,IAAI,wDAAY,GAAG,2BAA2B;AAC7F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,kEAA0B,GAAG,2BAA2B;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,wDAAY,GAAG,YAAY,IAAI,wDAAY,GAAG,qBAAqB;AACvF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,wDAAY,GAAG,YAAY,IAAI,wDAAY,GAAG,0BAA0B;AACjG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,kEAA0B,GAAG,YAAY;AAC7D,4BAA4B,wDAAY,GAAG,YAAY,IAAI,wDAAY,GAAG,YAAY;AACtF,8BAA8B,YAAY;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,+DAAS;AAC3C,gCAAgC,+DAAS;AACzC,iCAAiC,yEAAc;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,kEAA0B,GAAG,sBAAsB;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,mDAAU;AACxC;AACA;AACA;AACA;AACA,kBAAkB,kEAA0B,GAAG,2BAA2B;AAC1E;AACA;AACA;AACA;AACA,CAAC,CAAC,uDAAY;AACW;AACzB;AACA;AACA;AACA;AACA;AACA;AACA,oFAA2C;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sEAAiB;AACjB,cAAc,mFAA8B;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,sEAAiB;AACjB,cAAc,oFAA+B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;ACrcD;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AAC8C;AACY;AACU;AACrB;AACa;AACb;AACI;AACF;AACF;AACmC;AACxC;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,4BAA4B;AACrC,SAAS,8BAA8B;AACvC;AACA;AACA,IAAI,iDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,4DAAO;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,kEAA0B,GAAG,sBAAsB;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,wDAAO;AAChD,8BAA8B,4DAAO;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,yCAAyC;AAC7F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,mDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,wDAAgB;AACjC,iBAAiB,wDAAgB;AACjC;AACA;AACA;AACA;AACA,eAAe,4DAAgB;AAC/B;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,kBAAkB;AACpE,oBAAoB,wDAAY,GAAG,YAAY,IAAI,wDAAY,GAAG,0BAA0B;AAC5F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,mDAAW;AACvB;AACA;AACA;AACA;AACA,kBAAkB,kEAA0B,GAAG,2BAA2B;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,wDAAY,GAAG,YAAY,IAAI,wDAAY,GAAG,qBAAqB;AACvF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,wDAAY,GAAG,YAAY,IAAI,wDAAY,GAAG,0BAA0B;AACjG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,kEAA0B,GAAG,YAAY;AAC7D,4BAA4B,wDAAY,GAAG,YAAY,IAAI,wDAAY,GAAG,YAAY;AACtF,8BAA8B,YAAY;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,sDAAc;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,wDAAgB;AACvC,qBAAqB,wDAAgB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,+DAAS;AAC3C,gCAAgC,+DAAS;AACzC,iCAAiC,yEAAc;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,oDAAU;AACxC;AACA;AACA;AACA;AACA,kBAAkB,kEAA0B,GAAG,2BAA2B;AAC1E;AACA;AACA;AACA;AACA,CAAC,CAAC,uDAAY;AACW;AACzB;AACA;AACA;AACA;AACA;AACA;AACA,oFAA2C;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qEAAiB;AACjB,cAAc,gFAA4B;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,qEAAiB;AACjB,cAAc,iFAA6B;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;;;;;;;AC9eD;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACwC;AACO;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,uBAAuB;AAChC,SAAS,yBAAyB;AAClC;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,CAAC,gDAAI;AACc;AACpB;AACA;AACA;AACA;AACA;AACA;AACA,+EAAsC;;;;;;;;;;;;;;;;;;;;;ACnHtC;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AAC2C;AACI;AACA;AACwB;AACW;AAClF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,mBAAmB;AAC5B,SAAS,qBAAqB;AAC9B;AACA;AACA;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,4EAAiB;AACnD;AACA;AACA;AACA,qBAAqB,wDAAK,IAAI;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,CAAC,gDAAM;AACQ;AAChB;AACA;AACA;AACA;AACA;AACA;AACA,2EAAkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA,qEAAiB;AACjB,cAAc,iFAA6B;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;AC/HD;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AAC4C;AACI;AACU;AACX;AACG;AACH;AACI;AACA;AACJ;AACE;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,IAAI,iDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC,CAAC,+CAAY;AACe;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA,SAAS,wBAAwB;AACjC,SAAS,0BAA0B;AACnC;AACA;AACA;AACA,IAAI,iDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,yEAAyE;AAC1F,iBAAiB,gHAAgH;AACjI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,mDAAW;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,2DAAc;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,oDAAY;AAC5C,qFAAqF;AACrF,wCAAwC,sDAAc;AACtD,6CAA6C,sDAAc;AAC3D;AACA;AACA;AACA;AACA;AACA,6CAA6C,sDAAc;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,gCAAgC,oDAAY;AAC5C,qFAAqF;AACrF,wCAAwC,sDAAc;AACtD;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA,yCAAyC,cAAc;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,sDAAc,cAAc,sDAAc;AACtD;AACA;AACA;AACA;AACA,oCAAoC,4DAAoB;AACxD;AACA,kBAAkB,mDAAW;AAC7B,kBAAkB,mDAAW;AAC7B;AACA;AACA;AACA;AACA,oBAAoB,sDAAc;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,sDAAc,cAAc,sDAAc;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2EAA2E,6BAA6B;AACxG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,kDAAU;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,sDAAU;AAC1B;AACA;AACA,4BAA4B,yDAAiB;AAC7C;AACA;AACA;AACA,2FAA2F,kCAAkC;AAC7H;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,sDAAc;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,sDAAc;AAC1B;AACA;AACA;AACA,gBAAgB,sDAAc,WAAW,sDAAc;AACvD;AACA;AACA;AACA,oBAAoB,8DAAkB;AACtC;AACA;AACA,4BAA4B,sDAAc,gBAAgB,sDAAc;AACxE;AACA;AACA;AACA,gCAAgC,uDAAe,GAAG,kCAAkC,IAAI,0BAA0B,KAAK;AACvH;AACA;AACA;AACA;AACA;AACA,wFAAwF;AACxF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,sDAAc;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,sDAAc,SAAS,sDAAc;AACjD,0CAA0C;AAC1C;AACA;AACA;AACA;AACA;AACA,oBAAoB,8DAAkB;AACtC;AACA;AACA;AACA;AACA,4BAA4B,sDAAc,qBAAqB,sDAAc;AAC7E;AACA;AACA;AACA,gCAAgC,uDAAe,GAAG,4CAA4C,IAAI,sBAAsB;AACxH,kDAAkD,iDAAS;AAC3D,gDAAgD,iDAAS;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA,iBAAiB,sDAAc;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D,YAAY;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D,YAAY;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,yDAAa;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,4DAA4D,IAAI,4DAA4D;AAC3J;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,sDAAc,uBAAuB,sDAAc;AAChE;AACA;AACA;AACA;AACA,wBAAwB,sDAAc;AACtC;AACA;AACA;AACA;AACA,wBAAwB,sDAAc;AACtC;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,uCAAuC,iDAAS;AAChD,uCAAuC,iDAAS;AAChD,+CAA+C,sDAAc;AAC7D;AACA;AACA,+CAA+C,sDAAc;AAC7D;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,gBAAgB,sDAAc;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,sDAAc;AAC1B;AACA;AACA,YAAY,sDAAc;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,sDAAc,UAAU,sDAAc;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,sDAAc;AAC1B;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,sDAAc;AAC9B;AACA;AACA;AACA;AACA;AACA,gBAAgB,sDAAc;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,sDAAc,UAAU,sDAAc;AACnD;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,sEAAsE,sDAAc,SAAS,sDAAc;AAC3G;AACA,yCAAyC,sDAAc,uBAAuB,sDAAc;AAC5F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4D,kDAAU;AACtE,mBAAmB,kDAAU;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,mDAAW;AAC9B;AACA;AACA;AACA;AACA,kBAAkB,mDAAW;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,mDAAW;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,sDAAc;AAC/B;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,4HAA4H;AAC7I;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,sDAAc;AAC/B;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,+DAAa;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,sDAAU;AAClB;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,sDAAc;AAClC,yBAAyB,sDAAc;AACvC;AACA;AACA;AACA;AACA,oBAAoB,sDAAc;AAClC,yBAAyB,sDAAc;AACvC;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,mCAAmC,iDAAS;AAC5C,mCAAmC,iDAAS;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,YAAY,sDAAc;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,sDAAc;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,wDAAgB;AACvC,uBAAuB,wDAAgB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,iDAAS;AACpC,2BAA2B,iDAAS;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,wBAAwB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,sDAAc;AAC3B;AACA;AACA;AACA,aAAa,sDAAc;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,wDAAgB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,sDAAc;AAC3B;AACA;AACA;AACA,aAAa,sDAAc;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,wDAAgB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,sDAAc;AAC3B;AACA;AACA;AACA;AACA,uBAAuB,wDAAgB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sEAAsE;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,mDAAW;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,wBAAwB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,iDAAS;AAChC;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,iDAAS;AAChC;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,gHAAgH;AAC7H;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,gEAAoB;AAClE;AACA,yBAAyB;AACzB,qBAAqB;AACrB;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,sDAAc;AAC/B;AACA;AACA,iBAAiB,sDAAc;AAC/B;AACA;AACA,iBAAiB,sDAAc;AAC/B;AACA;AACA;AACA;AACA,gBAAgB,sDAAc,WAAW,sDAAc;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,WAAW;AACnC,gBAAgB,mDAAW;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,sDAAc,yBAAyB,sDAAc;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,CAAC,uCAAI;AACe;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,gFAAuC;AACvC,wFAA+C;;;;;;;;;;;;;;;;;;ACpoE/C;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACwC;AACO;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,6BAA6B;AACtC,SAAS,+BAA+B;AACxC;AACA;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC,CAAC,iDAAS;AACe;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA,qFAA4C;;;;;;;;;;;;;;;;;;;AChF5C;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACiD;AACF;AACmC;AAClF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,qBAAqB;AAC9B,SAAS,uBAAuB;AAChC;AACA;AACA;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC,CAAC,sDAAS;AACO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA,6EAAoC;AACpC;AACA;AACA;AACA;AACA;AACA;AACA,qEAAiB;AACjB,cAAc,8EAA0B;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACzMD;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACiD;AAC0B;AAC5B;AACS;AACW;AAChB;AACK;AACQ;AACA;AACb;AACJ;AACI;AACqB;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,yBAAyB;AAClC,SAAS,2BAA2B;AACpC;AACA;AACA;AACA,IAAI,iDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,sDAAS;AAC3D;AACA;AACA;AACA,yBAAyB,8EAAgB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,0DAAY;AACxC,kCAAkC,0DAAY;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,8DAAkB;AAC9B;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,sDAAU;AACtB;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,uDAAc;AAC3B,uBAAuB,0DAAO;AAC9B;AACA,aAAa,uDAAc;AAC3B,uBAAuB,0DAAO;AAC9B;AACA;AACA;AACA,iBAAiB,uDAAc,oCAAoC,oDAAK;AACxE;AACA;AACA,iBAAiB,uDAAc,oCAAoC,oDAAK;AACxE;AACA;AACA;AACA,aAAa,uDAAc;AAC3B,uBAAuB,0DAAO;AAC9B;AACA,yBAAyB,uDAAc;AACvC,aAAa,uDAAc;AAC3B;AACA;AACA,yBAAyB,uDAAc;AACvC,aAAa,uDAAc;AAC3B;AACA;AACA,+BAA+B,uDAAc;AAC7C,aAAa,uDAAc;AAC3B;AACA;AACA,+BAA+B,uDAAc;AAC7C,aAAa,uDAAc;AAC3B;AACA;AACA,wBAAwB,0DAAO;AAC/B,wBAAwB,0DAAO;AAC/B;AACA,wBAAwB,sBAAsB;AAC9C;AACA;AACA;AACA;AACA,gCAAgC,4DAAO;AACvC,+BAA+B,4DAAO;AACtC;AACA;AACA,mCAAmC,gFAAc;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,uDAAc,eAAe,uDAAc;AAC/D,6CAA6C,gFAAc;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,oDAAK,CAAC,4DAAmB;AACzD;AACA;AACA;AACA,oBAAoB,uDAAc,eAAe,uDAAc;AAC/D,sCAAsC,oDAAK,CAAC,4DAAmB;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kEAAkE,SAAS;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA,mCAAmC,oDAAK;AACxC,wBAAwB,0DAAO;AAC/B;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA,mCAAmC,oDAAK;AACxC,wBAAwB,0DAAO;AAC/B;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,uDAAc;AACnC;AACA;AACA;AACA,kCAAkC,4DAAO;AACzC;AACA;AACA;AACA,wCAAwC,4DAAO;AAC/C;AACA,oDAAoD,qEAAa;AACjE,6CAA6C,qEAAa;AAC1D;AACA;AACA;AACA;AACA,qBAAqB,uDAAc;AACnC;AACA;AACA;AACA;AACA;AACA,yCAAyC,4DAAO;AAChD,mCAAmC,4DAAO;AAC1C;AACA;AACA,oDAAoD,qEAAa;AACjE,6CAA6C,qEAAa;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA,kDAAkD,6DAAS;AAC3D;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,uDAAc;AAC3B;AACA;AACA;AACA,aAAa,uDAAc;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,uDAAc,mBAAmB,uDAAc;AAC/D,oBAAoB,uDAAc;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,CAAC,sDAAS;AACW;AACtB;AACA;AACA;AACA;AACA;AACA;AACA,iFAAwC;;;;;;;;;;;;;;;;;;;ACzexC;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AAC2C;AACI;AACwB;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,mBAAmB;AAC5B,SAAS,qBAAqB;AAC9B;AACA;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,4EAAiB;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC,CAAC,gDAAM;AACQ;AAChB;AACA;AACA;AACA;AACA;AACA;AACA,2EAAkC;;;;;;;;;;;;;;;;;;;;AC7ElC;AACA;AACA;AAC+C;AACE;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA,2DAA2D,qDAAa,MAAM,qDAAa;AAC3F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,IAAI,mDAAW;AACf,QAAQ,mDAAW;AACnB;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,aAAa;AACb;;;;;;;;;;;;;;;;;;ACjEA;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACoC;AACW;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,wBAAwB;AACjC,SAAS,0BAA0B;AACnC;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,CAAC,6CAAO;AACY;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,gFAAuC;;;;;;;;;;;;;;;;;;;;;;ACjDvC;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACuE;AAC/B;AACO;AACf;AACiB;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,CAAC,iEAAqB;AACY;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA,SAAS,8BAA8B;AACvC,SAAS,gCAAgC;AACzC;AACA;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,2CAAkB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,mDAAW;AAC3B;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,iDAAS;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,cAAc;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC,CAAC,yDAAa;AACY;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA,sFAA6C;AAC7C,8FAAqD;;;;;;;;;;;;;;;;;;;ACpSrD;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACoC;AACkB;AACP;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,qBAAqB;AAC9B,SAAS,uBAAuB;AAChC;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,2DAAO;AAC/B;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC,CAAC,6CAAO;AACS;AAClB;AACA;AACA;AACA;AACA;AACA;AACA,6EAAoC;;;;;;;;;;;;;;;;;;;;ACvEpC;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACuE;AACrC;AACa;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,CAAC,iEAAqB;AACS;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,2BAA2B;AACpC,SAAS,6BAA6B;AACtC;AACA;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,2CAAM;AACzB;AACA;AACA,CAAC,CAAC,yDAAa;AACS;AACxB;AACA;AACA;AACA;AACA;AACA;AACA,mFAA0C;AAC1C,2FAAkD;;;;;;;;;;;;;;;;;;;ACzFlD;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACwC;AACO;AACA;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,uBAAuB;AAChC,SAAS,yBAAyB;AAClC;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,sDAAc;AAC/B;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,sDAAc;AAC/B;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,sDAAc,mBAAmB,sDAAc;AAC3D,iEAAiE,oDAAoD;AACrH;AACA,gEAAgE,6DAA6D;AAC7H;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,kBAAkB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,+BAA+B;AAChD;AACA;AACA,CAAC,CAAC,iDAAS;AACS;AACpB;AACA;AACA;AACA;AACA;AACA;AACA,+EAAsC;;;;;;;;;;;;;;;;;;;;;;;;;;;ACpHtC;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AAC2D;AACrB;AAC6B;AACpB;AACE;AACT;AACS;AACE;AACJ;AACM;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,IAAI,iDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,+BAA+B;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,0DAAQ;AACjD;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,iDAAoB;AACjD;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,iDAAoB;AACjD;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC,CAAC,yDAAiB;AACe;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,6BAA6B;AACtC,SAAS,+BAA+B;AACxC;AACA;AACA;AACA,IAAI,iDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,mBAAmB;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2EAA2E;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,mDAAW;AAC5D;AACA,iCAAiC;AACjC;AACA,mDAAmD;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,iEAAyB;AACzD;AACA;AACA;AACA;AACA,2DAA2D,SAAS;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,sDAAU;AAClB;AACA;AACA;AACA,oBAAoB,sDAAc,uBAAuB,sDAAc;AACvE,0CAA0C;AAC1C;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,+CAAQ;AAC3C,oCAAoC,0DAAY;AAChD,yCAAyC,0DAAY;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,sDAAU;AAClB;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,eAAe,sDAAU;AACzB;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC,CAAC,iDAAS;AACe;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA,qFAA4C;AAC5C,6FAAoD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACpWpD;AACA;AACA;AAC4C;AAC5C;AACA;AACA;AACA;AACA;AACA;AACwC;AACQ;AACV;AACY;AACM;AACW;AACX;AACT;AACA;AACwB;AACX;AACb;AACI;AACrB;AACU;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,sBAAsB;AAC/B,SAAS,wBAAwB;AACjC;AACA;AACA,IAAI,iDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,wDAAK;AACjC;AACA;AACA;AACA,kCAAkC,4EAAiB;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,6DAAQ;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,kCAAkC;AACnD,iBAAiB;AACjB;AACA;AACA;AACA;AACA,iBAAiB,qCAAqC;AACtD,iBAAiB;AACjB;AACA;AACA;AACA;AACA,iBAAiB,yDAAyD;AAC1E;AACA;AACA;AACA;AACA,sDAAsD,qDAAuB;AAC7E,gCAAgC,+DAAiC;AACjE;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,sDAAwB;AACxD,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,2DAAc;AAC5D;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,uDAAc;AAClC;AACA;AACA;AACA,kDAAkD,2DAAc;AAChE;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA,qCAAqC,+CAAQ;AAC7C,mCAAmC,sDAAsD;AACzF;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,gDAAQ,wCAAwC,UAAU;AACxF;AACA;AACA;AACA;AACA,4BAA4B,QAAQ;AACpC;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6DAA6D,SAAS;AACtE;AACA;AACA,2DAA2D,UAAU;AACrE;AACA,2EAA2E,+CAA+C;AAC1H;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,uDAAU;AACtB;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,+BAA+B;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,0DAAY,KAAK,yDAAa;AACtE;AACA,yCAAyC,0DAAY;AACrD;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,yDAAa;AAC1D;AACA;AACA;AACA;AACA;AACA,iDAAiD,6DAAQ;AACzD;AACA;AACA,iCAAiC,6DAAO;AACxC,kCAAkC,6DAAO;AACzC;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,yDAAO;AAClC,gBAAgB,6DAAO;AACvB;AACA,yBAAyB,yDAAO;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,yDAAO;AAClC,gBAAgB,6DAAO;AACvB;AACA,yBAAyB,yDAAO;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC,CAAC,iDAAS;AACQ;AACnB;AACA;AACA;AACA;AACA;AACA;AACA,8EAAqC;;;;;;;;;;;;;;;;;;ACzgBrC;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACiD;AACF;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,4BAA4B;AACrC,SAAS,8BAA8B;AACvC;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,qEAAqE;AACvH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC,CAAC,sDAAS;AACc;AACzB;AACA;AACA;AACA;AACA;AACA;AACA,oFAA2C;;;;;;;;;;;;;;;;;;;;;;;;;;AC/H3C;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AAC2D;AACvB;AAC+B;AACpB;AACP;AACS;AACA;AACE;AACE;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,+BAA+B;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,0DAAQ;AACjD;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,qDAAwB;AACzD;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,eAAe,kCAAkC;AACjD,eAAe;AACf;AACA;AACA;AACA,iBAAiB,yDAAyD;AAC1E;AACA;AACA;AACA;AACA,6BAA6B,8DAAiC;AAC9D,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,kCAAkC;AACnD,iBAAiB;AACjB;AACA;AACA;AACA;AACA,iBAAiB,qCAAqC;AACtD,iBAAiB;AACjB;AACA;AACA;AACA;AACA,iBAAiB,yDAAyD;AAC1E;AACA;AACA;AACA;AACA,6BAA6B,8DAAiC;AAC9D,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC,CAAC,yDAAiB;AACc;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,4BAA4B;AACrC,SAAS,8BAA8B;AACvC;AACA;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,mBAAmB;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,mDAAW;AAC5D;AACA,iCAAiC;AACjC;AACA;AACA;AACA;AACA,mDAAmD;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,iEAAyB;AACzD;AACA;AACA;AACA;AACA,2DAA2D,SAAS;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,0DAAY;AAC/C,yCAAyC,0DAAY;AACrD;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,6CAAO;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,mDAAW;AACvB,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,eAAe,sDAAU;AACzB;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC,CAAC,iDAAS;AACc;AACzB;AACA;AACA;AACA;AACA;AACA;AACA,oFAA2C;AAC3C,4FAAmD;;;;;;;;;;;;;;;;;;;;;ACjZnD;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACiD;AACF;AACA;AACf;AACe;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,wBAAwB;AACjC,SAAS,0BAA0B;AACnC;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,2CAAe;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,mDAAW;AAC7C;AACA;AACA;AACA,kCAAkC,mDAAW;AAC7C;AACA;AACA;AACA,iCAAiC,mDAAW;AAC5C;AACA;AACA;AACA,iCAAiC,mDAAW;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,sDAAc;AAC9B;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,gBAAgB,sDAAc;AAC9B;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,gBAAgB,sDAAc;AAC9B;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,gBAAgB,sDAAc;AAC9B;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,CAAC,sDAAS;AACU;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,gFAAuC;;;;;;;;;;;;;;;;;;;;;;;;;AC3MvC;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACwC;AACc;AACP;AACA;AACwB;AACpC;AACK;AACR;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,yBAAyB;AAClC,SAAS,2BAA2B;AACpC;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,2DAAO;AACjD;AACA;AACA;AACA,kCAAkC,4EAAiB;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,+BAA+B;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,oEAAuC;AACvE,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,8BAA8B;AACtE;AACA,uCAAuC,2CAAa,GAAG,uCAAuC;AAC9F;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,gDAAU;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,sDAAc;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,sDAAc;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sDAAsD,gEAAgE;AACtH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sDAAsD,gEAAgE;AACtH;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC,CAAC,iDAAS;AACW;AACtB;AACA;AACA;AACA;AACA;AACA;AACA,iFAAwC;;;;;;;;;;;;;;;;;;;;;;;;;;ACzXxC;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AAC2D;AACjB;AACyB;AACpB;AACP;AACS;AACA;AACE;AACE;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,+BAA+B;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,0DAAQ;AACjD;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,mCAAmC;AACpD,iBAAiB,kCAAkC;AACnD,iBAAiB,iCAAiC;AAClD,iBAAiB;AACjB;AACA;AACA;AACA;AACA,iBAAiB,yDAAyD;AAC1E;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,kCAAkC;AACrD,mBAAmB,kCAAkC;AACrD,mBAAmB,kCAAkC;AACrD,mBAAmB,kCAAkC;AACrD,mBAAmB;AACnB;AACA;AACA;AACA;AACA,mBAAmB,mCAAmC;AACtD,mBAAmB,mCAAmC;AACtD,mBAAmB,mCAAmC;AACtD,mBAAmB,mCAAmC;AACtD,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA,iBAAiB,yDAAyD;AAC1E;AACA;AACA;AACA;AACA,gCAAgC,oEAAuC;AACvE,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC,CAAC,yDAAiB;AACiB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,+BAA+B;AACxC,SAAS,iCAAiC;AAC1C;AACA;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,mBAAmB;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,mDAAW;AAC5D;AACA,iCAAiC;AACjC;AACA;AACA,mDAAmD;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,iEAAyB;AACzD;AACA;AACA;AACA;AACA,2DAA2D,SAAS;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,mDAAW;AACvB,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,mDAAU;AACpD,sCAAsC,0DAAY;AAClD,yCAAyC,0DAAY;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,eAAe,sDAAU;AACzB;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC,CAAC,iDAAS;AACiB;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA,uFAA8C;AAC9C,+FAAsD;;;;;;;;;;;;;;;;;;;;;;AC3iBtD;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AAC0D;AACX;AACA;AACA;AACf;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,2CAAe;AACxC;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,mDAAW;AACzC;AACA;AACA;AACA,8BAA8B,mDAAW;AACzC;AACA;AACA;AACA,6BAA6B,mDAAW;AACxC;AACA;AACA;AACA,6BAA6B,mDAAW;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,CAAC,0DAAc;AACa;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,wBAAwB;AACjC,SAAS,0BAA0B;AACnC;AACA;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,2BAA2B;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,QAAQ;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,sDAAc;AACzD;AACA;AACA,2CAA2C,sDAAc;AACzD;AACA;AACA,yCAAyC,sDAAc;AACvD;AACA;AACA,yCAAyC,sDAAc;AACvD;AACA;AACA,SAAS;AACT;AACA;AACA,gDAAgD,sDAAc;AAC9D;AACA;AACA,gDAAgD,sDAAc;AAC9D;AACA;AACA,8CAA8C,sDAAc;AAC5D;AACA;AACA,8CAA8C,sDAAc;AAC5D;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,sDAAc;AAC9B;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,gBAAgB,sDAAc;AAC9B;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,gBAAgB,sDAAc;AAC9B;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,gBAAgB,sDAAc;AAC9B;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,sDAAc,uBAAuB,sDAAc;AAC/D;AACA;AACA,gBAAgB,sDAAc;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,0FAA0F;AAC/H;AACA;AACA;AACA,CAAC,CAAC,kDAAM;AACa;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,gFAAuC;AACvC,wFAA+C;;;;;;;;;;;;;;;;;;;ACprB/C;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACoC;AACwB;AACb;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,wBAAwB;AACjC,SAAS,0BAA0B;AACnC;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,iEAAU;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC,CAAC,6CAAO;AACY;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,gFAAuC;;;;;;;;;;;;;;;;;;;;ACvEvC;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACuE;AAC/B;AACO;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,CAAC,iEAAqB;AACY;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,8BAA8B;AACvC,SAAS,gCAAgC;AACzC;AACA;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,iDAAS;AAC5B;AACA;AACA,CAAC,CAAC,yDAAa;AACY;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA,sFAA6C;AAC7C,8FAAqD;;;;;;;;;;;;;;;;;;;;;;;;;;ACxFrD;AACA;AACA;AACiD;AACjB;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,WAAW,kDAAU;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,WAAW,kDAAU;AACrB;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,WAAW,kDAAU;AACrB;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,WAAW,kDAAU;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,WAAW,kDAAU;AACrB,eAAe,kDAAU;AACzB,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,WAAW,kDAAU;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,YAAY,2CAAe;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,WAAW;AACnC;AACA;AACA;AACA;AACA;AACA,0BAA0B,qBAAqB;AAC/C;AACA;AACA,6BAA6B,aAAa;AAC1C;AACA;AACA,qCAAqC,UAAU;AAC/C;AACA;AACA,6BAA6B,aAAa;AAC1C;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;ACzKA;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACiD;AACS;AACb;AACmC;AACjC;AACA;AACwB;AACtB;AACF;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,uBAAuB;AAChC,SAAS,yBAAyB;AAClC;AACA;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,sEAAoB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,4EAAiB;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,sDAAS;AAC3D;AACA;AACA,0CAA0C,+DAAS;AACnD;AACA;AACA;AACA;AACA,yBAAyB,wDAAK,IAAI;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,kDAAI;AACvC;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,kEAA0B;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,+DAAa;AACxD;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,iDAAiD;AACzF,yCAAyC;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,sDAAc,mBAAmB,qDAAa;AAC9D,4DAA4D,SAAS;AACrE;AACA,wBAAwB,sDAAc,YAAY,sDAAc;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,CAAC,sDAAS;AACS;AACpB;AACA;AACA;AACA;AACA;AACA;AACA,+EAAsC;;;;;;;;;;;;;;;;;;;;;;;;;ACvPtC;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACiD;AACG;AACoB;AACQ;AAC3B;AACe;AACjB;AACJ;AACwB;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,0BAA0B;AACnC,SAAS,4BAA4B;AACrC;AACA;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,sEAAoB;AAC/C;AACA;AACA;AACA;AACA;AACA,kCAAkC,4EAAiB;AACnD,2CAA2C,yDAAM;AACjD;AACA;AACA;AACA;AACA,uCAAuC,sDAAS;AAChD;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,yDAAM;AAC7C;AACA;AACA;AACA;AACA;AACA,4CAA4C,yDAAM;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,4DAAO;AACvC;AACA,0BAA0B,4DAAO;AACjC;AACA,+BAA+B,4DAAO;AACtC;AACA,2BAA2B,4DAAO;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,4DAAO;AACxC;AACA,gCAAgC,4DAAO;AACvC;AACA,2BAA2B,4DAAO;AAClC;AACA;AACA;AACA;AACA,4BAA4B,4DAAO;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,+DAAa;AACpD;AACA;AACA,gEAAgE,oCAAoC;AACpG,gBAAgB,6EAAc;AAC9B;AACA;AACA,4BAA4B,gEAAc;AAC1C;AACA;AACA,iCAAiC,gEAAc;AAC/C;AACA;AACA;AACA,iBAAiB;AACjB,+DAA+D,mCAAmC;AAClG;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,6EAAgB;AACnC;AACA;AACA,CAAC,CAAC,sDAAS;AACY;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,kFAAyC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACjTS;AACJ;AACE;AACU;AACE;AACd;AACM;AACQ;AACU;AAChB;AACA;;;;;;;;;;;;;;;;;;;ACVtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,+BAA+B;AAChE;AACA;AACA;AACA;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AAC0C;AACQ;AAClB;AAChC;AACA;AACA;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA,6BAA6B,2CAAe;AAC5C;AACA;AACA;AACA,CAAC,CAAC,mDAAU;AACM;AAClB;AACA;AACA;AACA;AACA;AACA;AACA,6EAAoC;;;;;;;;;;;;;;;;;;;AChEpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,+BAA+B;AAChE;AACA;AACA;AACA;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AAC0C;AACQ;AAClB;AAChC;AACA;AACA;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA,6BAA6B,2CAAkB;AAC/C;AACA;AACA;AACA,CAAC,CAAC,mDAAU;AACS;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,gFAAuC;;;;;;;;;;;;;;;;;;;AChEvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,+BAA+B;AAChE;AACA;AACA;AACA;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AAC0C;AACQ;AAClB;AAChC;AACA;AACA;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA,6BAA6B,2CAA2B;AACxD;AACA;AACA;AACA,CAAC,CAAC,mDAAU;AACkB;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,yFAAgD;;;;;;;;;;;;;;;;;;;AChEhD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,+BAA+B;AAChE;AACA;AACA;AACA;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AAC0C;AACQ;AAClD;AACqD;AACrD;AACA;AACA;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA,6BAA6B,sDAA0B;AACvD;AACA;AACA;AACA,CAAC,CAAC,mDAAU;AACO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA,8EAAqC;;;;;;;;;;;;;;;;;;;ACjErC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,+BAA+B;AAChE;AACA;AACA;AACA;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AAC0C;AACQ;AAClB;AAChC;AACA;AACA;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA,6BAA6B,2CAAmB;AAChD;AACA;AACA;AACA,CAAC,CAAC,mDAAU;AACU;AACtB;AACA;AACA;AACA;AACA;AACA;AACA,iFAAwC;;;;;;;;;;;;;;;;;;;AChExC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,+BAA+B;AAChE;AACA;AACA;AACA;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AAC0C;AACQ;AAClB;AAChC;AACA;AACA;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA,6BAA6B,2CAAiB;AAC9C;AACA;AACA;AACA,CAAC,CAAC,mDAAU;AACQ;AACpB;AACA;AACA;AACA;AACA;AACA;AACA,+EAAsC;;;;;;;;;;;;;;;;;;;AChEtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,+BAA+B;AAChE;AACA;AACA;AACA;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AAC0C;AACQ;AAClD;AACqD;AACrD;AACA;AACA;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA,6BAA6B,sDAAyB;AACtD;AACA;AACA;AACA,CAAC,CAAC,mDAAU;AACM;AAClB;AACA;AACA;AACA;AACA;AACA;AACA,6EAAoC;;;;;;;;;;;;;;;;;;;ACjEpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,+BAA+B;AAChE;AACA;AACA;AACA;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AAC0C;AACQ;AAClB;AAChC;AACA;AACA;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA,6BAA6B,2CAAsB;AACnD;AACA;AACA;AACA,CAAC,CAAC,mDAAU;AACa;AACzB;AACA;AACA;AACA;AACA;AACA;AACA,oFAA2C;;;;;;;;;;;;;;;;;;;AChE3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,+BAA+B;AAChE;AACA;AACA;AACA;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AAC0C;AACQ;AAClB;AAChC;AACA;AACA;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA,6BAA6B,2CAAqB;AAClD;AACA;AACA;AACA,CAAC,CAAC,mDAAU;AACY;AACxB;AACA;AACA;AACA;AACA;AACA;AACA,mFAA0C;;;;;;;;;;;;;;;;;;;;;AChE1C;AACA;AACA;AACkD;AACA;AAClB;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,2CAAwB;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,2CAAa;AACxC;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,oBAAoB,qDAAa,kBAAkB,qDAAa,EAAE;AAChG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,YAAY;AACzC;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,qDAAa;AACxD,uCAAuC,qDAAa;AACpD,kCAAkC,qDAAa;AAC/C,0CAA0C,qDAAa;AACvD,sCAAsC,qDAAa;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,WAAW,qDAAa,mGAAmG,qDAAa;AACzJ;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,qDAAa;AACxD,uCAAuC,qDAAa;AACpD,kCAAkC,qDAAa;AAC/C,0CAA0C,qDAAa;AACvD,sCAAsC,qDAAa;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,WAAW,qDAAa,mGAAmG,qDAAa;AACzJ;AACA;AACA;AACA;AACA,gBAAgB,2CAAoB;AACpC,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,wBAAwB,yBAAyB;AACjD;AACA;AACA,gCAAgC,mBAAmB;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,2CAAiB;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,+BAA+B,sDAAc;AACtE;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,yBAAyB;AACrD;AACA;AACA,oCAAoC,mBAAmB;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,CAAC;AACqB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA,iFAAwC;;;;;;;;;;;;;;;;;;;AC1QxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,+BAA+B;AAChE;AACA;AACA;AACA;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AAC0C;AACQ;AAClB;AAChC;AACA;AACA;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA,6BAA6B,2CAAsB;AACnD;AACA;AACA;AACA,CAAC,CAAC,mDAAU;AACa;AACzB;AACA;AACA;AACA;AACA;AACA;AACA,oFAA2C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AChE3C;AACA;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACiD;AACN;AAC8B;AACI;AAC9B;AACE;AACK;AACV;AACD;AACE;AACE;AACA;AACI;AACJ;AACA;AACE;AACE;AACJ;AACE;AACE;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,IAAI,iDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,8DAAU;AAC9C,yCAAyC,sEAAkB;AAC3D;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC,CAAC,oDAAQ;AACgB;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,qBAAqB;AAC9B,SAAS,uBAAuB;AAChC;AACA;AACA;AACA,IAAI,iDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,mDAAc;AACjD;AACA;AACA;AACA,0BAA0B,8DAAU;AACpC;AACA;AACA;AACA,0BAA0B,8DAAU;AACpC;AACA;AACA;AACA,0BAA0B,8DAAU;AACpC;AACA;AACA;AACA,0BAA0B,8DAAU;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,8DAAU;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,kDAAI;AACnC;AACA,qCAAqC;AACrC,gDAAgD,sDAAS;AACzD;AACA,qDAAqD,gDAAM;AAC3D;AACA;AACA,+DAA+D,sDAAS;AACxE;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,2DAAO;AACnC;AACA;AACA,6CAA6C,sDAAa;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,mEAAwB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,uDAAc;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,EAAE;AACX;AACA;AACA;AACA,iCAAiC,QAAQ;AACzC;AACA;AACA,gBAAgB,uDAAc;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,2BAA2B;AACnD;AACA;AACA,gBAAgB,uDAAc;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC,+BAA+B,kDAAS;AACxC,2BAA2B,kDAAS;AACpC,2BAA2B,kDAAS;AACpC,iBAAiB,uDAAc;AAC/B;AACA;AACA,iBAAiB,uDAAc;AAC/B;AACA;AACA;AACA;AACA,gBAAgB,qDAAY;AAC5B;AACA,wBAAwB,uDAAc;AACtC;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,gBAAgB,qDAAY;AAC5B;AACA,8DAA8D;AAC9D,wBAAwB,uDAAc;AACtC;AACA,6BAA6B,uDAAc;AAC3C;AACA;AACA;AACA;AACA,6BAA6B,uDAAc;AAC3C;AACA;AACA;AACA;AACA,6BAA6B,uDAAc;AAC3C;AACA;AACA;AACA;AACA,6BAA6B,uDAAc;AAC3C;AACA;AACA;AACA;AACA;AACA,6BAA6B,uDAAc;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,uDAAc;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,uDAAc;AAC3C;AACA;AACA,6BAA6B,uDAAc;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,uDAAc;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,uCAAuC,cAAc;AACrD;AACA;AACA;AACA;AACA;AACA,oBAAoB,qDAAY;AAChC;AACA;AACA,4BAA4B,uDAAc;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA,2CAA2C,cAAc;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,qDAAY;AAC5B;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,YAAY,qDAAY;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,oDAAW;AACvB;AACA;AACA,QAAQ,uDAAU;AAClB,oDAAoD;AACpD;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,qBAAqB;AACrD;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA,wDAAwD,mBAAmB;AAC3E;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,oDAAM;AACpD;AACA,kDAAkD,sBAAsB,GAAG,sBAAsB;AACjG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,sDAAS;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,0DAA0D;AAC3E;AACA;AACA;AACA;AACA,oCAAoC,0DAAY,KAAK,oDAAM;AAC3D;AACA;AACA;AACA,yCAAyC,0DAAY;AACrD;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,yDAAgB;AACjD;AACA;AACA,iCAAiC,yDAAgB;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,uEAAuE,MAAM;AAC7E,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,iEAAsB;AACvC;AACA;AACA;AACA;AACA,YAAY,0DAAe;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,uDAAU;AAClB;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf,aAAa;AACb;AACA;AACA;AACA,iBAAiB,mEAAmE;AACpF;AACA;AACA;AACA;AACA;AACA,sCAAsC,kDAAI;AAC1C;AACA;AACA;AACA;AACA;AACA,6BAA6B,uDAAc;AAC3C;AACA;AACA;AACA;AACA,uCAAuC,uDAAc;AACrD,uCAAuC,uDAAc;AACrD,6BAA6B,uDAAc,eAAe,uDAAc;AACxE;AACA;AACA,oCAAoC,uDAAU;AAC9C;AACA,wCAAwC,oDAAW;AACnD;AACA;AACA;AACA;AACA;AACA,yCAAyC;AACzC;AACA,4CAA4C,oDAAW;AACvD,sEAAsE,sDAAS;AAC/E,oDAAoD,uDAAU;AAC9D;AACA;AACA;AACA;AACA;AACA,kFAAkF,sDAAS;AAC3F;AACA;AACA,qDAAqD;AACrD;AACA,6CAA6C;AAC7C;AACA,qCAAqC;AACrC;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA,gCAAgC,oDAAW;AAC3C;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA,oCAAoC,oDAAW;AAC/C,8DAA8D,sDAAS;AACvE,4CAA4C,uDAAU;AACtD;AACA;AACA;AACA;AACA;AACA,0EAA0E,sDAAS;AACnF;AACA;AACA,6CAA6C;AAC7C;AACA,qCAAqC;AACrC;AACA;AACA,yBAAyB;AACzB;AACA,2CAA2C,uDAAc;AACzD,2CAA2C,uDAAc;AACzD;AACA;AACA,sDAAsD,gDAAM;AAC5D;AACA;AACA;AACA;AACA,uDAAuD,uDAAc;AACrE;AACA;AACA;AACA;AACA;AACA,iCAAiC,uDAAc;AAC/C;AACA;AACA,iCAAiC,uDAAc;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,uDAAc,SAAS,uDAAc,SAAS,uDAAc,cAAc,uDAAc,cAAc,uDAAc;AAC5J;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,uDAAc,oBAAoB,uDAAc;AAC5F;AACA;AACA;AACA,4CAA4C,uDAAc;AAC1D;AACA;AACA,gEAAgE,qDAAK;AACrE,uDAAuD,qDAAK,CAAC,4DAAmB;AAChF;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA,iBAAiB;AACjB;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,uDAAc,oBAAoB,sDAAa;AAC/D,6DAA6D,SAAS;AACtE;AACA,yBAAyB,uDAAc;AACvC;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,uDAAc,sBAAsB,sDAAa;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,SAAS;AAC7D;AACA;AACA;AACA,oBAAoB,uDAAc,iBAAiB,uDAAc;AACjE;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,kBAAkB;AAC1D,kDAAkD,kDAAI;AACtD,+DAA+D,uDAAc;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yEAAyE,kDAAI;AAC7E,gFAAgF,uDAAc;AAC9F;AACA;AACA,uEAAuE,uDAAc;AACrF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,uDAAc;AAClC;AACA;AACA,oBAAoB,uDAAc;AAClC;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,CAAC,sDAAS;AACO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA,8EAAoC;AACpC,sFAA4C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACt5C5C;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACiE;AACZ;AACkB;AAC1B;AACF;AACI;AACY;AACA;AACP;AACT;AACE;AACQ;AACN;AACF;AACE;AACE;AACF;AACI;AACJ;AACZ;AACsB;AACW;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,IAAI,iDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,CAAC,6DAAmB;AACO;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,uBAAuB;AAChC,SAAS,yBAAyB;AAClC,SAAS,yDAAyD;AAClE;AACA;AACA,IAAI,iDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,uDAAc;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC;AACA;AACA,+BAA+B,mEAAU;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,oDAAW;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,yDAAgB;AACnC,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,0DAA0D,kFAAkF;AAC5I,wDAAwD,mCAAmC;AAC3F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,8BAA8B,8EAAc;AAC5C;AACA,0BAA0B,uEAAoB;AAC9C;AACA;AACA;AACA,wCAAwC,cAAc;AACtD;AACA;AACA,wCAAwC,eAAe;AACvD;AACA;AACA,wCAAwC,cAAc;AACtD;AACA;AACA,wCAAwC,eAAe;AACvD;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,0BAA0B,8EAAc;AACxC;AACA;AACA;AACA,0DAA0D,yDAAM;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,EAAE;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,kEAAyB;AAChD;AACA;AACA,kCAAkC,qEAA4B;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,8EAAc;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,iEAAoB;AACjD;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,gEAAuB,GAAG,gGAAgG;AACpJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,uDAAc;AACvD;AACA;AACA,uDAAuD,uDAAc;AACrE;AACA;AACA,wCAAwC,uDAAc;AACtD;AACA;AACA,yDAAyD,uDAAc;AACvE;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4D,6EAA6E;AACzI,4CAA4C,uDAAc;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,YAAY;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,uDAAc;AAC3B;AACA;AACA,aAAa,uDAAc;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,kEAAyB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,kEAAyB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,iBAAiB,gFAAgF;AACjG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,4EAA4E;AAC7F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0DAA0D,kEAAe;AACzE;AACA;AACA,6CAA6C,uDAAc;AAC3D;AACA;AACA,6CAA6C,uDAAc;AAC3D;AACA;AACA,2CAA2C,uDAAc;AACzD;AACA;AACA,2CAA2C,uDAAc;AACzD;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,kCAAkC,kEAAe;AACjD;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,8DAA8D,kEAAe;AAC7E;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,gBAAgB,kDAAS;AACzB,gBAAgB,kDAAS;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,kEAAe;AACrD;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,2CAA2C,yDAAuB;AAClE;AACA;AACA;AACA;AACA;AACA,wCAAwC,uDAAc;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,kDAAS;AAC9B,YAAY,oDAAW;AACvB;AACA;AACA;AACA;AACA,YAAY,uDAAU;AACtB;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,gEAAuB;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,gEAAuB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,2BAA2B;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D,QAAQ;AACnE;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,6BAA6B;AACrD;AACA,4BAA4B,yCAAyC;AACrE;AACA,oCAAoC,4CAA4C;AAChF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,uDAAc,sBAAsB,uDAAc;AACzE;AACA;AACA;AACA,oBAAoB,yDAAgB;AACpC;AACA;AACA;AACA,2BAA2B,gEAAuB;AAClD;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,uDAAc;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,mDAAQ;AACzC,gBAAgB,oDAAW;AAC3B;AACA;AACA,yCAAyC,8DAA8D;AACvG;AACA;AACA,wBAAwB,uDAAc;AACtC;AACA;AACA,iCAAiC,uDAAU;AAC3C;AACA;AACA;AACA;AACA;AACA,iBAAiB,uDAAc;AAC/B;AACA;AACA;AACA,8BAA8B,uDAAc;AAC5C;AACA;AACA;AACA;AACA,qCAAqC;AACrC,kCAAkC,mEAA0B;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,oDAAW;AACvB;AACA;AACA,gBAAgB,kDAAS;AACzB,gBAAgB,kDAAS;AACzB;AACA;AACA,6BAA6B,6DAAoB;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,6DAAoB;AACpC;AACA;AACA,qCAAqC,2DAA2D;AAChG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,gEAAuB,GAAG,iDAAiD;AACnG;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oHAAoH,yDAAgB;AACpI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,mDAAQ;AAC3C;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,qDAAS;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,sEAAsE;AACvF;AACA;AACA;AACA,oBAAoB,oDAAW;AAC/B,wDAAwD,qDAAmB;AAC3E;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,sEAAsE;AACvF;AACA;AACA;AACA;AACA,oBAAoB,oDAAW;AAC/B;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,iBAAiB,sEAAsE;AACvF;AACA;AACA;AACA;AACA,oBAAoB,oDAAW;AAC/B;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,uDAAc,uBAAuB,uDAAc;AAC/D;AACA;AACA,gBAAgB,uDAAc;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,uDAAc,0BAA0B,uDAAc;AAClE;AACA;AACA;AACA,YAAY,uDAAc,sBAAsB,uDAAc;AAC9D;AACA;AACA;AACA,YAAY,uDAAc,yBAAyB,uDAAc;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,mEAAgB;AAC3D;AACA;AACA;AACA;AACA,iDAAiD,0DAAQ;AACzD;AACA,iBAAiB;AACjB;AACA,0CAA0C,4EAAiB;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,qEAAyB;AACrC;AACA;AACA;AACA;AACA;AACA,wBAAwB,IAAI,mEAAuB,EAAE;AACrD,gBAAgB,4DAAgB,gBAAgB,GAAG;AACnD;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,CAAC,qDAAW;AACO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA,gFAAsC;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACvrDtC;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACgD;AACmB;AAClB;AACP;AACS;AACE;AACN;AACI;AACJ;AACE;AACI;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,IAAI,iDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,CAAC,iDAAa;AACgB;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,0BAA0B;AACnC,SAAS,4BAA4B;AACrC;AACA;AACA,IAAI,iDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,0DAAQ;AACnC;AACA;AACA,+DAA+D,sDAAS;AACxE;AACA,gCAAgC,4DAAO;AACvC,iCAAiC,4DAAO;AACxC;AACA;AACA;AACA;AACA;AACA,gEAAgE,sDAAS;AACzE;AACA,iCAAiC,4DAAO;AACxC,kCAAkC,4DAAO;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,sDAAc;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,0DAAY;AAC/C;AACA;AACA,yCAAyC,0DAAY;AACrD;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,QAAQ;AACvD;AACA;AACA;AACA;AACA;AACA,iDAAiD,QAAQ;AACzD;AACA;AACA,oBAAoB,qDAAa;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,2DAAQ;AACvC;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,gEAAoB;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,sDAAU;AACtB;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,kDAAM;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC,CAAC,yCAAK;AACgB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,kFAAyC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC7TzC;AACA;AACA;AACkC;AACgB;AAC2B;AACT;AACxB;AACc;AAChB;AACG;AACM;AACb;AACA;AACE;AACE;AACJ;AACtC;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,uBAAuB;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,2DAAoB;AAChD,gBAAgB,0DAAmB;AACnC;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD;AAChD;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,yDAAU;AAC1C;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,yDAAU;AACjD;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,+CAAW;AAC3B;AACA,iBAAiB;AACjB;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,+CAAQ;AACpB;AACA;AACA;AACA,gBAAgB,+CAAW;AAC3B;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,sDAAe;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,6DAAsB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,kDAAc;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,2DAAoB;AACrD;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,6CAAI;AACvC;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,mDAAS;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC;AAChC,eAAe,mDAAS;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,qDAAW;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,2BAA2B,qDAAQ;AACnC;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,2BAA2B,qDAAQ;AACnC;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,uDAAmB;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,kDAAc;AAClC,uBAAuB,kDAAc;AACrC,yBAAyB,kDAAc;AACvC,4BAA4B,kDAAc;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,mDAAO;AAC7C;AACA;AACA;AACA;AACA,2CAA2C,mEAAe;AAC1D;AACA;AACA;AACA;AACA,kDAAkD,kDAAc;AAChE;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,kDAAc;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wDAAwD,kDAAc;AACtE;AACA;AACA,wBAAwB,kDAAc,CAAC,iEAA0B;AACjE,4CAA4C,iEAA0B;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,qDAAY,sBAAsB,kEAAmB,sBAAsB,iEAAkB;AACxI;AACA;AACA;AACA,wBAAwB,iDAAa;AACrC;AACA;AACA;AACA,8CAA8C,qDAAY;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,kDAAc;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,kDAAc;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,gDAAY;AAC5C;AACA,4DAA4D,mDAAO;AACnE;AACA;AACA,iEAAiE,mEAAe;AAChF;AACA;AACA,iEAAiE,iEAAkB;AACnF;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,kDAAc,gBAAgB,kDAAc;AACzF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAiE,6CAAI;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA,gCAAgC,kDAAc;AAC9C,sDAAsD,qDAAY;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,6CAAI;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,iEAAkB;AAC7D;AACA;AACA;AACA;AACA,2CAA2C,yDAAU;AACrD;AACA;AACA;AACA;AACA,2CAA2C,+CAAK,sBAAsB,mDAAO;AAC7E;AACA;AACA;AACA;AACA,yBAAyB,kDAAc,YAAY,kDAAc;AACjE;AACA;AACA,oBAAoB,6DAAyB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,kDAAc;AAC1B;AACA,uBAAuB,uDAAO,CAAC,kDAAc;AAC7C;AACA,iDAAiD,GAAG;AACpD,uBAAuB,mDAAK;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,iDAAa;AACzB,YAAY,+CAAW;AACvB;AACA,aAAa;AACb;AACA,iBAAiB,kDAAc;AAC/B,YAAY,gDAAY;AACxB;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,YAAY,kDAAc;AAC1B,YAAY,gDAAY;AACxB;AACA;AACA;AACA,aAAa;AACb;AACA,iBAAiB,iDAAa;AAC9B,YAAY,+CAAW;AACvB;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,kDAAc;AAC1B;AACA;AACA,YAAY,gDAAY;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,kDAAc,cAAc,kDAAc;AACnE,oBAAoB,6DAAyB;AAC7C;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,kDAAc;AAC1B;AACA;AACA;AACA,YAAY,gDAAY;AACxB;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,+CAAW;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,kDAAc;AAClC;AACA;AACA;AACA;AACA;AACA,6BAA6B,kDAAc,cAAc,kDAAc;AACvE,wBAAwB,6DAAyB;AACjD;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,+CAAW;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,kDAAc;AAC9B;AACA;AACA;AACA;AACA;AACA,yBAAyB,kDAAc,cAAc,kDAAc;AACnE,oBAAoB,6DAAyB;AAC7C;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,iDAAa;AAC1B;AACA;AACA;AACA;AACA;AACA,QAAQ,+CAAW;AACnB,gBAAgB,kDAAc;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,kDAAc,cAAc,kDAAc;AACnE,oBAAoB,6DAAyB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,kDAAc;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,kDAAc,CAAC,iEAA0B;AACrD,uBAAuB,iEAA0B;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,kDAAc;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,kDAAc;AAC1B,gBAAgB,kDAAc,CAAC,iEAA0B;AACzD,uBAAuB,iEAA0B;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC;AACqB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,iDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,mEAAe;AAC3D;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAC2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACnpCM;AAClC;AACA;AACA;AACA;AACA;AACA;AACwC;AACU;AACO;AACT;AACW;AACZ;AACC;AACd;AACI;AACA;AACA;AACE;AACF;AACE;AACE;AACA;AACJ;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,wBAAwB;AACjC,SAAS,0BAA0B;AACnC;AACA;AACA;AACA,IAAI,iDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,6DAA6D;AAC9E;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,iBAAiB,6DAA6D;AAC9E;AACA,kCAAkC,kDAAc;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,6DAA6D;AAC9E;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,6DAA6D;AAC9E,iBAAiB;AACjB;AACA,oCAAoC,kDAAc;AAClD;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,6DAA6D;AAC9E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,6DAA6D;AAC9E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,kEAAmB;AAClD;AACA;AACA,kCAAkC,qDAAY;AAC9C;AACA;AACA;AACA;AACA;AACA,kCAAkC,0DAAa;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,mBAAmB,+CAAQ;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,gDAAY;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA,oBAAoB,kDAAc;AAClC;AACA;AACA;AACA;AACA,2CAA2C,kEAAmB;AAC9D;AACA;AACA,sDAAsD,qDAAY;AAClE;AACA,wCAAwC,WAAW;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,YAAY,gDAAY;AACxB;AACA;AACA,oBAAoB,kDAAc;AAClC;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,gDAAY;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA,oBAAoB,kDAAc;AAClC;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,YAAY,gDAAY;AACxB;AACA;AACA,oBAAoB,kDAAc;AAClC;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,WAAW;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD;AACpD;AACA;AACA;AACA;AACA,gBAAgB,+CAAW;AAC3B;AACA,iBAAiB;AACjB;AACA;AACA,6CAA6C;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,kDAAc;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,kDAAc;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,sEAA+B;AACvC,QAAQ,wDAAmB;AAC3B;AACA,QAAQ,kDAAU;AAClB;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,kDAAU;AAClB;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,+CAAW,CAAC,gEAAyB;AAC7C,QAAQ,wDAAmB;AAC3B;AACA,QAAQ,kDAAU;AAClB;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,+CAAW,CAAC,gEAAyB;AAC7C,QAAQ,wDAAmB;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,iDAAa,CAAC,gEAAyB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,WAAW;AACjD;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,qBAAqB;AAC7C;AACA;AACA;AACA;AACA;AACA,oCAAoC,2BAA2B;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,+CAAW,CAAC,+DAAwB;AAC5C,QAAQ,wDAAmB;AAC3B;AACA,QAAQ,kDAAU;AAClB;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,iDAAa,CAAC,+DAAwB;AAC9C,QAAQ,kDAAU;AAClB;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,gDAAY;AACpB;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,+CAAW;AACnB;AACA,SAAS;AACT;AACA,QAAQ,kDAAU;AAClB;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,2EAAoC;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,kDAAU;AACtB;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD;AACrD;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,sCAAsC;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD;AACpD;AACA,qCAAqC;AACrC;AACA;AACA;AACA;AACA;AACA,oBAAoB,OAAO;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,iCAAiC;AACjC;AACA;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,iDAAa,CAAC,gEAAyB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,kDAAc;AAC3B,8CAA8C,wDAAU;AACxD;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,iBAAiB,wEAAwE;AACzF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,+CAAW;AACnB,qCAAqC,kDAAc;AACnD;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,iDAAa;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,+CAAW;AAC/B,4BAA4B,kDAAc;AAC1C,4BAA4B,gDAAY;AACxC,oCAAoC,kDAAc;AAClD;AACA;AACA,6BAA6B;AAC7B;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,yDAAU;AACjD;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC;AACzC,oCAAoC;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,kDAAc;AAC3B;AACA;AACA,aAAa,kDAAc,YAAY,kDAAc;AACrD,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,8BAA8B,IAAI,0BAA0B;AACnH;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,kDAAc,iBAAiB,kDAAc;AAC1D;AACA;AACA;AACA;AACA,oBAAoB,wBAAwB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,oDAAgB;AACnC,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,kDAAc;AAC/B;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,oDAAgB;AAC/C,0DAA0D;AAC1D;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,kDAAc;AAC/B;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,oDAAgB;AAC7C,sDAAsD;AACtD;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,2EAAoC;AAC5C,QAAQ,iDAAa,CAAC,gEAAyB;AAC/C,QAAQ,iDAAa,CAAC,gEAAyB;AAC/C,QAAQ,iDAAa,CAAC,+DAAwB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,yDAAU;AAC/C;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,YAAY;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,6CAAI;AAC1C;AACA;AACA,yCAAyC,qDAAQ;AACjD;AACA,oBAAoB,kDAAU;AAC9B;AACA,qBAAqB;AACrB,iBAAiB;AACjB;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,yDAAqB,oBAAoB;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,2EAAoC;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,CAAC,iDAAS;AACU;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,2EAAuC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC1xDvC;AACA;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACkC;AACU;AACR;AACa;AACmB;AACT;AACV;AACP;AACJ;AAC8B;AAC1B;AACF;AACF;AACA;AACF;AACF;AACE;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,wBAAwB;AACjC,SAAS,0BAA0B;AACnC;AACA;AACA;AACA,IAAI,iDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,yDAAU;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,iEAAkB;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6DAA6D,0DAAa;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,qCAAqC;AACtF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,uCAAuC;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,mEAA4B;AACpC,QAAQ,yDAAmB;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,+CAAW;AACnB;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,6CAAI;AACzC;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,kDAAU;AACtB;AACA,yBAAyB,kDAAc;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,kDAAc;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,+CAAW;AACnB;AACA;AACA,oBAAoB,kDAAc;AAClC;AACA;AACA,oBAAoB,kDAAc;AAClC;AACA;AACA;AACA,SAAS;AACT,QAAQ,+CAAW;AACnB;AACA;AACA,wBAAwB,kDAAc;AACtC;AACA;AACA,wBAAwB,kDAAc;AACtC;AACA;AACA;AACA;AACA,wBAAwB,kDAAc;AACtC;AACA;AACA,wBAAwB,kDAAc;AACtC;AACA;AACA;AACA;AACA,wBAAwB,kDAAc;AACtC;AACA;AACA,wBAAwB,kDAAc;AACtC;AACA;AACA;AACA;AACA;AACA,oBAAoB,kDAAc;AAClC;AACA;AACA,oBAAoB,kDAAc;AAClC;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,+CAAW,wBAAwB;AAC9D;AACA,yBAAyB;AACzB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,sEAAsE,SAAS;AAC/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,+CAAW;AAC3B;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,0DAAS;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,4EAAiB;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,wEAAiC;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,+CAAW;AACvB;AACA;AACA,oBAAoB,kDAAc;AAClC,+BAA+B,+CAAW;AAC1C,wDAAwD;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,kDAAc;AAClC,gCAAgC,+CAAW;AAC3C,sDAAsD;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,kDAAc;AACtC;AACA;AACA,wBAAwB,kDAAc;AACtC;AACA;AACA;AACA;AACA;AACA,iCAAiC,kDAAc;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,kDAAc;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,kDAAc;AAC1C,8DAA8D;AAC9D;AACA;AACA;AACA;AACA,4BAA4B,kDAAc;AAC1C,gEAAgE;AAChE;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD;AACpD,sDAAsD;AACtD;AACA,yBAAyB,6CAAS;AAClC,0BAA0B,6CAAS;AACnC,kBAAkB;AAClB,mBAAmB;AACnB,iBAAiB;AACjB,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,+CAAW;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,SAAS;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,oDAAgB;AAC3C,2BAA2B,oDAAgB;AAC3C;AACA;AACA;AACA;AACA,uDAAuD;AACvD;AACA,0BAA0B,6CAAS;AACnC,0BAA0B,6CAAS;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,SAAS;AAC5D;AACA;AACA,mCAAmC,gBAAgB;AACnD,mCAAmC,gBAAgB;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD,mDAAO;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD,mDAAO;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,6CAAS;AAClD;AACA;AACA,6BAA6B,kDAAc;AAC3C;AACA;AACA,oCAAoC,6CAAS;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,YAAY,GAAG;AAClD;AACA;AACA;AACA;AACA,+CAA+C,kDAAc;AAC7D;AACA;AACA,6CAA6C,kDAAc;AAC3D;AACA;AACA,2CAA2C,kDAAc;AACzD;AACA;AACA,iDAAiD,kDAAc;AAC/D;AACA;AACA,sDAAsD,kDAAc;AACpE;AACA;AACA,oDAAoD,kDAAc;AAClE;AACA;AACA,kDAAkD,kDAAc;AAChE;AACA;AACA,wDAAwD,kDAAc;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,kDAAc;AAC3B;AACA;AACA;AACA,aAAa,kDAAc;AAC3B;AACA;AACA;AACA,aAAa,kDAAc;AAC3B;AACA;AACA;AACA,aAAa,kDAAc;AAC3B;AACA;AACA;AACA,aAAa,kDAAc;AAC3B;AACA;AACA,aAAa,kDAAc;AAC3B;AACA;AACA,aAAa,kDAAc;AAC3B;AACA;AACA,aAAa,kDAAc;AAC3B;AACA;AACA;AACA;AACA,YAAY,kDAAc;AAC1B;AACA;AACA;AACA;AACA,YAAY,kDAAc;AAC1B;AACA;AACA;AACA;AACA,YAAY,kDAAc;AAC1B;AACA;AACA;AACA,YAAY,kDAAc;AAC1B;AACA;AACA;AACA,YAAY,kDAAc;AAC1B;AACA;AACA;AACA,YAAY,kDAAc;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,kDAAc;AAC9B,gBAAgB,kDAAU;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,gBAAgB,kDAAc;AAC9B,gBAAgB,kDAAU;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,6CAAS;AACjC,yBAAyB,6CAAS;AAClC;AACA;AACA;AACA,wBAAwB,6CAAS;AACjC,yBAAyB,6CAAS;AAClC,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,+CAAW;AACnB;AACA;AACA;AACA;AACA;AACA,0CAA0C,6CAAS;AACnD;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0DAA0D;AAC1D;AACA,QAAQ,kDAAU;AAClB;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,wEAAiC;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,kDAAU;AACtB;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,sBAAsB;AAC7D;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,oBAAoB;AAC3D;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,sBAAsB;AACzD,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,0BAA0B;AAC7D,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,qDAAW;AACxC;AACA;AACA;AACA,YAAY,kDAAU;AACtB;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,YAAY,+CAAW;AACvB;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,0DAAkB;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,YAAY,uDAAmB;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,gBAAgB,2DAAoB;AACpC;AACA,oBAAoB,yDAAmB;AACvC,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,wDAAwD;AACzE;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,+FAA+F,WAAW,0DAAa;AACvH;AACA;AACA;AACA;AACA,gBAAgB,wEAAc;AAC9B,yBAAyB,wEAAc;AACvC;AACA;AACA,iBAAiB;AACjB,iBAAiB;AACjB;AACA,QAAQ,wEAAc;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,mDAAe;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,kDAAc;AAC/B,YAAY,gDAAU;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,gEAAyB;AACrC;AACA;AACA,wBAAwB,IAAI,8DAAuB,EAAE;AACrD,gBAAgB,uDAAgB,gBAAgB,GAAG;AACnD;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,CAAC,2CAAM;AACa;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,2EAAuC;;;;;;;;;;;;;;;;;;;;;;AC1xDvC;AACA;AACA;AACA;AACA;AACA,uBAAuB,SAAS;AAChC;AACA;AACA;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AAC0C;AACA;AACuB;AACzB;AACA;AACxC;AACsC;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,mBAAmB,4BAA4B;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,6EAA6E;AAC9F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,mDAAO;AAC5C;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,+DAAiB;AAC1D;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA,8CAA8C;AAC9C;AACA,YAAY,8CAAW;AACvB;AACA,aAAa;AACb;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,8CAAW;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,8CAAW;AAC3B;AACA,iBAAiB;AACjB;AACA,YAAY,8CAAW;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,8CAAW;AACnB;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,8CAAW;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,YAAY,iDAAc;AAC1B;AACA,YAAY,8CAAW;AACvB;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,iDAAc;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,iDAAc;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,iDAAc;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,iDAAc;AAC1B;AACA;AACA,0DAA0D,iDAAc,oCAAoC;AAC5G;AACA,mDAAmD,0GAA0G;AAC7J;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sEAAsE;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sDAAsD,iDAAc,uCAAuC;AAC3G;AACA,+CAA+C,uGAAuG;AACtJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,+CAAY;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,iDAAc;AAC3B,oBAAoB,mDAAgB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,8CAAW,uBAAuB;AACjE;AACA,QAAQ,wDAAqB;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,EAAE;AACX;AACA;AACA;AACA,+CAA+C;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,8CAAW;AACvB;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,uDAAS;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,SAAS;AACtD;AACA,4BAA4B,iDAAc;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,gDAAa;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,CAAC,mDAAgB;AACE;;;;;;;;;;;;;;;ACn+BpB;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;ACpB0D;AACV;AACV;AACA;AACI;AACF;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,mEAAe;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,6FAA6F;AAC9G;AACA;AACA;AACA;AACA;AACA,iBAAiB,mGAAmG;AACpH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,8CAAW;AAC3B;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA,gBAAgB,8CAAW;AAC3B;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,yDAAU;AAC1C;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,mDAAS;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC;AAChC,eAAe,mDAAS;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,iDAAc;AAC1B;AACA;AACA,8DAA8D,iDAAc;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,8CAAW;AACvB;AACA;AACA,YAAY,8CAAW;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,gDAAa;AACzB;AACA,QAAQ,gDAAa;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,6CAAU;AACtB;AACA;AACA,YAAY,6CAAU;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,gDAAa;AACzB;AACA,QAAQ,gDAAa;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,6CAAU;AACtB;AACA;AACA,YAAY,6CAAU;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,gDAAa;AACzB;AACA,QAAQ,gDAAa;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,6CAAU;AACtB;AACA;AACA,YAAY,6CAAU;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,gDAAa;AACzB;AACA,QAAQ,gDAAa;AACrB;AACA;AACA,CAAC;AACmB;AACpB;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACxWA;AACA;AACA;AACA;AACA;AACA;AAC4C;AAC5C;AACA;AACA;AACA;AACA;AACA;AAC4C;AACW;AACtB;AACS;AACe;AAC+B;AACtC;AAC+B;AAChB;AACf;AACV;AACY;AACc;AACA;AACZ;AACK;AACJ;AACnB;AACE;AACyB;AACJ;AACQ;AACL;AAClB;AACH;AACD;AACF;AACM;AACJ;AACE;AACJ;AACI;AACR;AACiB;AACnD;AACA;AACA;AACO,oKAAoK;AAC3K;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,SAAS,qBAAqB;AAC9B,SAAS,uBAAuB;AAChC;AACA;AACA;AACA;AACA;AACA,IAAI,iDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,gEAAqB;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,iEAAoB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,iEAAoB;AAClD;AACA;AACA;AACA;AACA;AACA,+BAA+B,iEAAoB;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,+CAAW;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,wDAAO;AAClD,2CAA2C,wDAAO;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS,EAAE;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,qDAAQ;AAC1C,YAAY,gDAAY;AACxB;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,kEAAkE;AACnF;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,iBAAiB,2DAA2D;AAC5E;AACA;AACA;AACA,qCAAqC,mDAAO;AAC5C;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,+DAAwB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,uDAAe;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,oEAA4B;AACxC,YAAY,yDAAmB;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,yEAAiC;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,sEAA8B;AAC1C,YAAY,yDAAmB;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,mBAAmB;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,YAAY;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,2EAAmC;AAC/C;AACA;AACA;AACA;AACA;AACA,uCAAuC,0DAA0D;AACjG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,gDAAQ,yCAAyC,UAAU;AAC7F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,QAAQ;AACxC;AACA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA;AACA;AACA;AACA,qFAAqF;AACrF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,kDAAU;AAClB;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,yEAAiC;AACzC,QAAQ,2EAAmC;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0DAA0D;AAC1D,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,yDAAqB;AAC7B,QAAQ,yDAAqB;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0DAA0D,QAAQ;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,gDAAK;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,gDAAK;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,kDAAc;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,mDAAe;AACnC;AACA;AACA,oCAAoC,iDAAS;AAC7C,oBAAoB,kDAAU;AAC9B;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,iBAAiB,kDAAc;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,mDAAe;AACnC;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,yBAAyB,WAAW;AACpC;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,+CAAW;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,+CAAW;AACvB;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sDAAsD,gDAAK;AAC3D;AACA;AACA;AACA;AACA;AACA,0DAA0D,gDAAK;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,yDAAU;AAC1C;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,yDAAU;AACjD;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,+DAAwB;AAC5C;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,+DAAa;AAChC,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,6CAAI;AACxC;AACA;AACA,yCAAyC,qDAAY;AACrD;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,8DAAuB;AACrD;AACA;AACA;AACA;AACA,YAAY,kDAAc;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,gBAAgB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,0CAA0C;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,4DAAoB;AACzC,kCAAkC,UAAU;AAC5C,8BAA8B,wBAAwB,qDAAiB,iBAAiB;AACxF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,iDAAS;AACzC,yCAAyC,SAAS,6CAAS,gCAAgC,6CAAS,uBAAuB;AAC3H,4BAA4B,8DAA0B,GAAG,gCAAgC;AACzF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,UAAU;AAChD,YAAY,kDAAU;AACtB;AACA;AACA,2CAA2C,iCAAiC;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,sCAAsC,4FAA4F;AAClI,8BAA8B,qBAAqB,qDAAiB,iBAAiB;AACrF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,+DAAwB;AACxC;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,6CAAS;AACzC,iCAAiC,6CAAS;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,+CAAW;AAC/B,oBAAoB,+CAAW;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,oEAA6B;AAClE;AACA;AACA;AACA,kCAAkC,YAAY;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,6CAAS;AAChC,wBAAwB,6CAAS;AACjC;AACA,uBAAuB,6CAAS;AAChC,uBAAuB,6CAAS;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,+CAAW;AACtC,4BAA4B,+CAAW;AACvC,0BAA0B,+CAAW;AACrC,6BAA6B,+CAAW;AACxC;AACA,8BAA8B,+CAAW;AACzC,+BAA+B,+CAAW;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA,4IAA4I,kDAAc,sBAAsB,kDAAc;AAC9L;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,oDAAO;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,oDAAO;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,kDAAc;AAC1B;AACA;AACA,kCAAkC,oDAAO;AACzC;AACA;AACA,wBAAwB,+CAAW;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,kDAAc;AAC1B;AACA;AACA,kCAAkC,oDAAO;AACzC;AACA;AACA,wBAAwB,+CAAW;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,kDAAc;AAC9B,2CAA2C,+CAAW;AACtD;AACA,gBAAgB,kDAAc;AAC9B,2CAA2C,+CAAW;AACtD;AACA;AACA,YAAY,kDAAc;AAC1B;AACA;AACA,YAAY,kDAAc;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,iDAAS;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,0DAAa;AAC1D;AACA,uEAAuE;AACvE;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,4CAA4C;AACrF;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,mDAAe;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,gCAAgC,qDAAW;AAC3C;AACA,mCAAmC,iEAAkB;AACrD;AACA;AACA;AACA,yCAAyC,iEAAkB;AAC3D;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8EAA8E,kDAAc,sBAAsB,kDAAc;AAChI;AACA;AACA,6EAA6E,kDAAc,sBAAsB,kDAAc;AAC/H;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,cAAc;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,+DAAiB;AAC1D;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,iBAAiB;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,uDAAS;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,qDAAW;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,kDAAc;AAC3B;AACA;AACA,aAAa,kDAAc;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,gDAAY;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,kDAAU;AACtB;AACA;AACA;AACA,gBAAgB,kDAAU;AAC1B;AACA;AACA,6BAA6B,sDAAc,uDAAuD,6CAA6C;AAC/I;AACA;AACA,wBAAwB,gDAAY;AACpC;AACA;AACA;AACA,wDAAwD,0DAA0D;AAClH;AACA,yBAAyB;AACzB;AACA,iBAAiB;AACjB;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,mDAAe;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,mDAAe;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,mDAAe;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,gBAAgB,mDAAe;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,kDAAc;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,gBAAgB,mDAAe;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,mBAAmB;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,iDAAS;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,yDAAmB;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C;AAC3C;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,yEAAe;AACvD;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,uBAAuB;AACxC;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,qEAAa;AACnD;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,qBAAqB;AACtC;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,6EAAiB;AAC3D;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,yBAAyB;AAC1C;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,sDAAQ;AACnC;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,iDAAS;AAClD;AACA;AACA,iBAAiB;AACjB;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,IAAI;AAC7C;AACA,SAAS,MAAM;AACf;AACA;AACA,QAAQ;AACR,QAAQ;AACR,QAAQ;AACR,QAAQ;AACR,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,kDAAc;AAC1B,qBAAqB,oDAAgB;AACrC,qBAAqB,4EAAgB;AACrC,uCAAuC,IAAI,KAAK;AAChD;AACA;AACA,4BAA4B,iBAAiB;AAC7C,iDAAiD,IAAI,KAAK;AAC1D;AACA,yBAAyB,kDAAc;AACvC;AACA;AACA;AACA;AACA;AACA,qBAAqB,4EAAgB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,aAAa;AACb,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,kDAAc;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,oBAAoB,+CAAW;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,kDAAc,WAAW,kDAAc,WAAW;AACnE;AACA;AACA;AACA;AACA,iBAAiB,kDAAc;AAC/B;AACA;AACA,qBAAqB,kDAAc;AACnC;AACA;AACA,yBAAyB;AACzB;AACA;AACA,qBAAqB,kDAAc;AACnC;AACA;AACA;AACA;AACA,iBAAiB,kDAAc;AAC/B;AACA;AACA;AACA;AACA,aAAa,kDAAc;AAC3B;AACA;AACA;AACA,aAAa,kDAAc;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,SAAS;AACrD;AACA;AACA;AACA;AACA,qBAAqB,kDAAc;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,sDAAkB;AAC5D,4BAA4B,kDAAc;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,kDAAc;AAC1C;AACA;AACA;AACA,wCAAwC,oDAAgB;AACxD;AACA,6BAA6B,gDAAY,eAAe,+CAAW;AACnE;AACA;AACA;AACA;AACA,4BAA4B,kDAAc;AAC1C;AACA;AACA;AACA;AACA;AACA,4CAA4C,sDAAkB;AAC9D,4BAA4B,kDAAc;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,iBAAiB,kDAAc;AAC/B;AACA;AACA,oBAAoB,kDAAc;AAClC;AACA;AACA;AACA,yBAAyB,gDAAY;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,oDAAgB;AACpD;AACA,sCAAsC,mDAAe;AACrD;AACA;AACA,2CAA2C,iDAAa;AACxD;AACA;AACA,2CAA2C,qDAAiB;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,gDAAY;AAChC,4BAA4B,kDAAc;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,kDAAc;AAClD;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,kEAAsB;AAC9C;AACA;AACA;AACA;AACA;AACA,6BAA6B,gDAAK,4BAA4B,gDAAK;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,2DAAuB;AACvC,YAAY,kDAAc;AAC1B,gBAAgB,kDAAc;AAC9B,wBAAwB,+CAAW;AACnC;AACA;AACA;AACA;AACA;AACA,iCAAiC,oDAAO,4BAA4B,oDAAO;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,cAAc;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC;AACzC,YAAY,kDAAc;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,0DAAa,CAAC,8CAAU,CAAC,kDAAc;AAC1D;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,aAAa;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,mBAAmB;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,4CAA4C;AAC/E;AACA;AACA;AACA;AACA;AACA,mCAAmC,8CAA8C;AACjF;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,cAAc;AACjD;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,uBAAuB;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,wBAAwB;AAC3D;AACA;AACA,mCAAmC,yBAAyB;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,2BAA2B;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,mBAAmB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,iCAAiC;AACpE;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,2BAA2B;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,6BAA6B;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,kDAAc;AAC9B;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,gDAAY;AAChC;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,kDAAc;AAC9B;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,gDAAY;AAChC;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,iBAAiB,4DAA4D;AAC7E;AACA;AACA;AACA,oBAAoB,gDAAY;AAChC;AACA;AACA;AACA,2CAA2C,sBAAsB;AACjE,2CAA2C,wBAAwB;AACnE;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,iBAAiB,uDAAuD;AACxE;AACA;AACA;AACA,oBAAoB,mDAAe;AACnC;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,iBAAiB,wDAAwD;AACzE;AACA;AACA;AACA,oBAAoB,mDAAe;AACnC;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,iBAAiB,yDAAyD;AAC1E;AACA;AACA;AACA,oBAAoB,gDAAY;AAChC;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,iBAAiB,yFAAyF;AAC1G;AACA;AACA;AACA,oBAAoB,gDAAY;AAChC;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,iBAAiB,2DAA2D;AAC5E;AACA;AACA;AACA,oBAAoB,gDAAY;AAChC;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,iBAAiB,4DAA4D;AAC7E;AACA;AACA;AACA,oBAAoB,gDAAY;AAChC;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,gDAAY;AAChC;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,gDAAY;AAChC;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,gDAAY;AAChC;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,yEAAc;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,mDAAe;AACnC;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,oBAAoB;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gGAAgG,WAAW,0DAAa;AACxH;AACA;AACA,yBAAyB;AACzB;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA,iBAAiB;AACjB,iBAAiB,gEAAgE;AACjF,iBAAiB,wFAAwF;AACzG;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,kDAAc;AAClC,4DAA4D,kDAAc;AAC1E;AACA,uCAAuC,mBAAmB;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,mDAAe;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gGAAgG,WAAW,0DAAa;AACxH;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,yEAAc;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,yEAAc;AACtB;AACA;AACA;AACA,sBAAsB,QAAQ;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,8EAA8E;AAC5G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,mDAAe;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,qBAAqB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,mDAAe;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gGAAgG,WAAW,0DAAa;AACxH;AACA;AACA,yBAAyB;AACzB;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,6DAAyB;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,mBAAmB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,4DAAoB;AACrD;AACA,aAAa;AACb,iCAAiC,yEAAc;AAC/C;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,mDAAe;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gGAAgG,WAAW,0DAAa;AACxH;AACA;AACA,yBAAyB;AACzB;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,mDAAe;AACnC;AACA;AACA;AACA;AACA;AACA;AACA,gGAAgG,kEAAkE;AAClK;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,mDAAe;AACnC;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2EAA2E,qBAAqB;AAChG;AACA;AACA,2EAA2E,qBAAqB;AAChG;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0DAA0D,qBAAqB;AAC/E;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,qDAAiB;AACrC;AACA;AACA;AACA,2CAA2C,yEAAwB;AACnE;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,gBAAgB,yEAAiC;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,qDAAiB;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,mDAAe;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,mDAAe;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,mDAAe;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gGAAgG,WAAW,0DAAa;AACxH;AACA;AACA,yBAAyB;AACzB;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,gCAAgC,6DAAyB;AACzD,gCAAgC,6DAAyB;AACzD,kCAAkC,qDAAiB;AACnD,mCAAmC,gEAA4B;AAC/D,mCAAmC,gEAA4B;AAC/D;AACA;AACA;AACA,yCAAyC;AACzC,yCAAyC;AACzC,yCAAyC,qDAAiB;AAC1D,sCAAsC,2DAAuB;AAC7D,kCAAkC,oGAAoG;AACtI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,sBAAsB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,yEAAc;AAC1B,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,mDAAe;AACnC;AACA,0CAA0C;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,4DAA4D;AAC7E;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,mDAAM;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kGAAkG;AAClG,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,iDAAa;AACjC;AACA,yBAAyB,kDAAc;AACvC;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,8DAAuB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,aAAa;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,aAAa;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,oDAAgB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,kDAAc;AAC9B,wBAAwB,+CAAW;AACnC;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,kDAAc;AAC9B,wBAAwB,+CAAW;AACnC;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,oDAAgB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,kDAAc;AAC9B,wBAAwB,+CAAW;AACnC;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,kDAAc;AAC9B,wBAAwB,+CAAW;AACnC;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,kDAAc;AAC9B,wBAAwB,+CAAW;AACnC;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,kDAAc;AAC9B,wBAAwB,+CAAW;AACnC;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,kDAAc;AAClC,iBAAiB,kDAAc;AAC/B;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,gDAAY;AAChC;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,gDAAY;AAChC;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,gDAAY;AAChC;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,gDAAY;AAChC;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,kDAAc;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,gBAAgB,kDAAc;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,kDAAc;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,gBAAgB,kDAAc;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,oDAAO;AAC5C;AACA,wBAAwB,kDAAc;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,oDAAO;AAC5C;AACA,wBAAwB,kDAAc;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wDAAwD;AACxD;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,kDAAc;AAC9B;AACA;AACA,qBAAqB,kDAAc;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,+CAAW;AACnC;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,kDAAc;AAC9B;AACA;AACA,qBAAqB,kDAAc;AACnC;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA;AACA;AACA;AACA,wBAAwB,+CAAW;AACnC;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,kDAAc;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,kDAAc;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,kDAAc;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,kDAAc;AAC9B,oCAAoC,YAAY;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,uDAAmB;AACvC;AACA,uCAAuC,uBAAuB;AAC9D;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,kDAAc;AAC3B,oBAAoB,sDAAO;AAC3B;AACA;AACA;AACA,iCAAiC,gDAAK;AACtC;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,gDAAK;AACtC,uCAAuC,0BAA0B;AACjE;AACA,sBAAsB,kDAAc;AACpC;AACA;AACA,sCAAsC,8DAAO,qBAAqB,4EAAc,qBAAqB,4EAAc;AACnH;AACA;AACA,uCAAuC,mBAAmB,qDAAiB,sBAAsB;AACjG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,uDAAmB;AACvC;AACA,uCAAuC,kBAAkB;AACzD;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,kDAAc;AAC3B,oBAAoB,sDAAO;AAC3B;AACA;AACA;AACA,iCAAiC,gDAAK;AACtC;AACA;AACA;AACA;AACA;AACA,iCAAiC,gDAAK;AACtC;AACA;AACA;AACA;AACA,2CAA2C,4BAA4B;AACvE;AACA;AACA,sBAAsB,kDAAc;AACpC;AACA;AACA,sCAAsC,8DAAO,qBAAqB,4EAAc,qBAAqB,4EAAc;AACnH;AACA;AACA,uCAAuC,qBAAqB,qDAAiB,wBAAwB;AACrG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,uDAAmB;AACvC;AACA,uCAAuC,yBAAyB;AAChE;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,mDAAe;AACnC;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,mDAAe;AACnC;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,kDAAc;AAClC;AACA;AACA,qBAAqB,kDAAc;AACnC;AACA;AACA;AACA;AACA,mCAAmC,uBAAuB;AAC1D,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,iBAAiB,mFAAmF;AACpG;AACA;AACA;AACA,oBAAoB,gDAAY;AAChC;AACA,uCAAuC,2BAA2B;AAClE;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,oFAAoF;AACrG;AACA;AACA;AACA,oBAAoB,kDAAc;AAClC;AACA,uCAAuC,4BAA4B;AACnE;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,iBAAiB,0FAA0F;AAC3G;AACA;AACA;AACA;AACA,uCAAuC,yBAAyB;AAChE;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,iBAAiB,0FAA0F;AAC3G;AACA;AACA;AACA;AACA,uCAAuC,0BAA0B;AACjE;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,iBAAiB,kFAAkF;AACnG;AACA;AACA;AACA;AACA,oBAAoB,gDAAY;AAChC;AACA,uCAAuC,0BAA0B;AACjE;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,mDAAe;AACnC;AACA,0CAA0C,oEAA6B;AACvE;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,gBAAgB,kDAAc;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,mDAAe;AACnC;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,kDAAc;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,kDAAc;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B;AACA,aAAa,kDAAc;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,mDAAe;AACnC;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,kDAAc;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,wBAAwB;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,kDAAc;AAClC;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,iBAAiB;AACjB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,iBAAiB;AACjB,iBAAiB;AACjB;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,6DAAyB,CAAC,yEAAc;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,kDAAc,sBAAsB,kDAAc;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,uDAAmB;AAC/C;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,gDAAK;AAC/C,qDAAqD,gCAAgC;AACrF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kEAAkE,gDAAK;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,oDAAK;AACpC;AACA,wCAAwC,gDAAK;AAC7C;AACA;AACA;AACA;AACA,yDAAyD,4BAA4B;AACrF;AACA;AACA;AACA;AACA;AACA,iEAAiE,gDAAK;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,yEAAc;AACtD,4CAA4C,6DAAyB;AACrE,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,2DAAuB;AACrD;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,uDAAmB,UAAU,8EAA8E;AAC3H;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,gDAAY;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,oBAAoB,gDAAY;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,mDAAe;AACnC;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,kDAAc;AAC3B,gBAAgB,wDAAO;AACvB;AACA;AACA,YAAY,kDAAc;AAC1B;AACA;AACA,yBAAyB,oDAAO;AAChC,4GAA4G;AAC5G;AACA,aAAa,kDAAc;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,kDAAc;AAC3B,gBAAgB,wDAAO;AACvB;AACA;AACA,YAAY,kDAAc;AAC1B;AACA;AACA,yBAAyB,oDAAO;AAChC,2GAA2G;AAC3G;AACA,aAAa,kDAAc;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,6DAAsB;AACvC;AACA;AACA;AACA,YAAY,sDAAe;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,kDAAc,+BAA+B,kDAAc;AAC3E;AACA;AACA;AACA,gBAAgB,kDAAc,4BAA4B,kDAAc;AACxE;AACA;AACA,gBAAgB,kDAAc,2BAA2B,kDAAc;AACvE;AACA;AACA,gBAAgB,kDAAc;AAC9B,oBAAoB,kDAAc,oCAAoC,kDAAc;AACpF;AACA;AACA,oBAAoB,kDAAc,oCAAoC,kDAAc;AACpF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,sEAAqB;AAC5C;AACA,uBAAuB,0EAAyB;AAChD;AACA,uBAAuB,yEAAwB;AAC/C;AACA,uBAAuB,kFAAiC;AACxD;AACA,uBAAuB,gFAA+B;AACtD;AACA,uBAAuB,yEAAwB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,mDAAe;AACnC;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,0DAAa;AAChE,wBAAwB,4DAAoB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,mDAAe;AACnC;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,6CAAI;AACxC;AACA;AACA;AACA,iBAAiB;AACjB,yCAAyC,qDAAY;AACrD;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,CAAC,mDAAgB;AACA;AAClB;AACA;AACA;AACA;AACA;AACA;AACA,yEAAoC;;;;;;;;;;;;;;;;;;;;;ACz+QF;AACc;AACkB;AACA;AAC1B;AACE;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,yDAAU;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,gDAAa;AACpC;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,gDAAa;AACpC;AACA,wCAAwC,+DAA4B;AACpE;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,4DAAe;AACtC;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,0DAAa;AACzC;AACA;AACA;AACA,CAAC,CAAC,2EAAuB;AACQ;;;;;;;;;;;;;;;;;;;;;;;;;;AC9KjC;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACoC;AACE;AACI;AACQ;AACV;AACE;AACF;AACF;AACI;AACJ;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,IAAI,iDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,6DAA6D;AAC9E;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,iBAAiB,6DAA6D;AAC9E;AACA,iCAAiC,iDAAc;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA,4BAA4B,6CAAI;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,qDAAY;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,mDAAO;AAC5C;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,iDAAc;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,iDAAc;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,wDAAqB;AACjC,YAAY,wDAAqB;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,+CAAY;AACxB;AACA,aAAa;AACb;AACA;AACA;AACA,gBAAgB,+CAAY;AAC5B;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,YAAY,+CAAY;AACxB;AACA;AACA,aAAa;AACb;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,iDAAc,YAAY,iDAAc;AACpD,YAAY,+CAAY;AACxB,oBAAoB,iDAAc;AAClC;AACA,oDAAoD,uDAAO,CAAC,iDAAc;AAC1E;AACA,yDAAyD,GAAG;AAC5D,oDAAoD,qDAAO;AAC3D;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,CAAC,6CAAU;AACW;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,6EAAyC;;;;;;;;;;;;;;;;;;;;;;ACtVzC;AACA;AACA;AACA;AACA;AACA;AAC0C;AACF;AACG;AACQ;AACX;AACE;AACN;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,2DAAoB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,mEAA4B;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,4DAAqB;AAC7C,gBAAgB,iDAAc,CAAC,4DAAqB;AACpD,kCAAkC,4DAAqB;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,gDAAa;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,gDAAa;AAC7C;AACA;AACA;AACA;AACA;AACA,wBAAwB,gDAAa;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,sEAA+B;AAC9C,4BAA4B,kEAA2B;AACvD;AACA;AACA;AACA;AACA;AACA,oBAAoB,gDAAa,CAAC,+DAAwB;AAC1D;AACA;AACA;AACA;AACA,gBAAgB,gDAAa,CAAC,+DAAwB;AACtD;AACA;AACA;AACA,eAAe,uEAAgC;AAC/C,4BAA4B,mEAA4B;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,gDAAa,CAAC,gEAAyB;AAC3D;AACA;AACA;AACA;AACA,YAAY,gDAAa,CAAC,gEAAyB;AACnD;AACA;AACA,eAAe,uEAAgC;AAC/C,4BAA4B,mEAA4B;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,gDAAa,CAAC,gEAAyB;AAC3D;AACA;AACA;AACA;AACA,YAAY,gDAAa,CAAC,gEAAyB;AACnD;AACA;AACA;AACA;AACA,QAAQ,+CAAY,CAAC,8DAAuB;AAC5C;AACA,SAAS;AACT,QAAQ,+CAAY,CAAC,gEAAyB;AAC9C;AACA,SAAS;AACT;AACA;AACA,QAAQ,+CAAY,CAAC,8DAAuB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,gDAAa;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,gDAAa;AAC7B;AACA,YAAY,8DAAuB,QAAQ,8DAAuB;AAClE,SAAS;AACT,QAAQ,+CAAY,CAAC,8DAAuB;AAC5C;AACA;AACA;AACA,SAAS;AACT,QAAQ,+CAAY,CAAC,4DAAqB;AAC1C;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,QAAQ,8CAAW,CAAC,8CAAW;AAC/B;AACA,SAAS;AACT;AACA,QAAQ,+CAAY,CAAC,8DAAuB;AAC5C;AACA,SAAS;AACT,QAAQ,+CAAY,CAAC,gEAAyB;AAC9C;AACA,SAAS;AACT;AACA,QAAQ,gEAAW;AACnB,QAAQ,+CAAY,CAAC,8DAAuB;AAC5C;AACA,SAAS;AACT,QAAQ,+CAAY,CAAC,gEAAyB;AAC9C;AACA,SAAS;AACT,QAAQ,mEAA4B;AACpC;AACA;AACA;AACA;AACA;AACA,YAAY,+CAAY,CAAC,4DAAqB;AAC9C;AACA;AACA;AACA,aAAa;AACb,YAAY,+CAAY,CAAC,8DAAuB;AAChD;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,wDAAG;AACf;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,iDAAS;AAC1C;AACA;AACA;AACA,oBAAoB,6CAAE;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,gEAAyB;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,gDAAa;AACjC;AACA;AACA;AACA;AACA,gBAAgB,gDAAa;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,8DAAuB;AACpD;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,oBAAoB,gDAAa;AACjC;AACA;AACA;AACA;AACA,gBAAgB,gDAAa;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,2CAAQ;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,CAAC;AACiB;AAClB;AACA;AACA;AACA;AACA;AACA;AACO;;;;;;;;;;;;;;;;;;;AC3cP;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AAC0C;AACH;AACE;AACzC;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,mBAAmB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,8CAAW;AACnB;AACA;AACA,4BAA4B,SAAS;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,iDAAc;AAClC;AACA;AACA;AACA;AACA;AACA,oBAAoB,2BAA2B;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,iBAAiB;AAC7C;AACA,sBAAsB,iDAAc;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,gBAAgB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,CAAC,mDAAU;AACS;;;;;;;;;;;;;;;;;;;;;AC3OrB;AACA;AACA;AACwC;AACE;AACC;AACN;AACI;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,2BAA2B;AACpC;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,mDAAO;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,6CAAU;AACjC;AACA;AACA;AACA,mBAAmB,4CAAS;AAC5B,SAAS;AACT;AACA;AACA;AACA,YAAY,8CAAW;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,uBAAuB,iDAAS;AAChC;AACA;AACA,uBAAuB,mDAAU;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,0DAAiB;AACtC;AACA;AACA,qBAAqB,uDAAe;AACpC;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACqB;AACtB;AACA;AACA;AACO;;;;;;;;;;;;;;;;;;AC3JP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC4D;AACnB;AACF;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,qDAAkB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,iDAAc,2BAA2B,iDAAc;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,iDAAiD,oEAAa;AAC9D;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC;AACqB;;;;;;;;;;;;;;;;;;;;;;;;;;ACxItB;AACA;AACA;AACA;AACA;AACA;AACA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,IAAIW,UAAU;AAAG;AAAe,UAAUC,MAAV,EAAkB;EAC9CZ,iDAAS,CAACW,UAAD,EAAaC,MAAb,CAAT;EACA;AACJ;AACA;;;EACI,SAASD,UAAT,CAAoBE,GAApB,EAAyBC,MAAzB,EAAiC;IAC7B,IAAIC,KAAK,GACT;IACAH,MAAM,CAACI,IAAP,CAAY,IAAZ,KAAqB,IAFrB;IAGA;AACR;AACA;;;IACQD,KAAK,CAACE,OAAN,GAAgB,IAAIZ,mDAAJ,CAAYU,KAAZ,CAAhB;IACA;AACR;AACA;;IACQA,KAAK,CAACG,eAAN,GAAwB,EAAxB;IACA;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;IACQH,KAAK,CAACI,YAAN,GAAqB,KAArB;IACA;AACR;AACA;AACA;;IACQJ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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,iDAAc;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,iDAAc;AAClC;AACA;AACA;AACA;AACA;AACA,gBAAgB,+CAAY;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,8CAA8C,SAAS;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,CAAC,mDAAU;AACU;;;;;;;;;;;;;;;;ACpGtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACuC;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,mDAAK;AAC5B,yBAAyB,mDAAK;AAC9B;AACA;AACA;AACA,CAAC;AACsB;;;;;;;;;;;;;;;;;;;;;;;ACzBvB;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AAC4C;AACY;AACP;AACqC;AACxC;AACA;AACA;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,mBAAmB;AAC5B,SAAS,qBAAqB;AAC9B;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,uDAAO;AAC9B,0BAA0B,uDAAO;AACjC,sCAAsC,sDAAO;AAC7C;AACA,yCAAyC,sDAAO;AAChD;AACA,uCAAuC,2CAAM;AAC7C;AACA;AACA;AACA,qCAAqC,2FAAsB;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,yDAAsB,iBAAiB,qDAAgB;AAC/D,QAAQ,yDAAsB,oBAAoB,qDAAgB;AAClE,QAAQ,yDAAsB,kBAAkB,qDAAgB;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,mDAAY,GAAG,iCAAiC,IAAI,kDAAW,6CAA6C,mDAAY,GAAG,8BAA8B,IAAI,kDAAW,qCAAqC,sDAAe;AAC/O;AACA;AACA,mBAAmB,mDAAY,GAAG,6BAA6B,IAAI,kDAAW,uCAAuC,mDAAY,GAAG,gCAAgC,IAAI,kDAAW,0CAA0C,sDAAe;AAC5O;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC,CAAC,iDAAS;AACK;;;;;;;;;;;;;;;;;;;;;;;;;AC3LhB;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AAC4C;AACN;AACI;AACI;AACY;AACY;AACA;AACA;AAC5B;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,0BAA0B;AACnC,SAAS,4BAA4B;AACrC;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,2CAAM;AAC/C;AACA;AACA;AACA;AACA;AACA,2CAA2C,2CAAM;AACjD;AACA;AACA;AACA;AACA;AACA,yCAAyC,2CAAM;AAC/C;AACA;AACA;AACA;AACA;AACA,0CAA0C,2CAAM;AAChD;AACA;AACA;AACA;AACA;AACA,wCAAwC,2CAAM;AAC9C;AACA;AACA;AACA;AACA;AACA,0CAA0C,2CAAM;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,4CAAS;AAC3B,kBAAkB,4CAAS;AAC3B,kBAAkB;AAClB,kBAAkB;AAClB,kBAAkB;AAClB,kBAAkB;AAClB,mBAAmB;AACnB,mBAAmB;AACnB,mBAAmB;AACnB,mBAAmB;AACnB,8BAA8B,mDAAY,MAAM,mDAAY,MAAM,mDAAY,MAAM,mDAAY,MAAM,sDAAe;AACrH,6BAA6B,mDAAY,OAAO,mDAAY,OAAO,mDAAY,OAAO,mDAAY,OAAO,sDAAe;AACxH,6BAA6B,mDAAY,MAAM,mDAAY,OAAO,mDAAY,OAAO,mDAAY,MAAM,sDAAe;AACtH,8BAA8B,mDAAY,MAAM,mDAAY,OAAO,mDAAY,OAAO,mDAAY,MAAM,sDAAe;AACvH,+BAA+B,mDAAY,MAAM,mDAAY,OAAO,mDAAY,OAAO,mDAAY,MAAM,sDAAe;AACxH,4BAA4B,mDAAY,MAAM,mDAAY,OAAO,mDAAY,OAAO,mDAAY,MAAM,sDAAe;AACrH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,iDAAc;AAC3B,oBAAoB,qDAAO;AAC3B;AACA;AACA,6BAA6B,+CAAK;AAClC;AACA;AACA,kCAAkC,2EAAc,qBAAqB,2EAAc;AACnF;AACA;AACA;AACA,6BAA6B,2EAAa;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,mDAAK;AACtC,iCAAiC,mDAAK;AACtC,kCAAkC,mDAAK;AACvC,gCAAgC,mDAAK;AACrC,mCAAmC,mDAAK;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,CAAC,iDAAS;AACY;;;;;;;;;;;;;;;;;;;;;;;;;AC7MvB;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACiC;AACK;AACI;AACI;AACJ;AACO;AACqB;AACA;AACA;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,sBAAsB;AAC/B,SAAS,wBAAwB;AACjC;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,2CAAM;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,2CAAM;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,2CAAM;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,+CAAK;AAClC;AACA;AACA,kCAAkC,2EAAc,qBAAqB,2EAAc;AACnF;AACA;AACA;AACA,6BAA6B,2EAAa;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,mDAAK;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B,uBAAuB,GAAG,4CAAS,iCAAiC,4CAAS;AAC7E,uBAAuB,GAAG,4CAAS,4BAA4B,4CAAS;AACxE,uBAAuB,GAAG,4CAAS,0BAA0B,4CAAS;AACtE,uBAAuB,GAAG,4CAAS,+BAA+B,4CAAS;AAC3E;AACA;AACA,uBAAuB;AACvB,uBAAuB;AACvB,uBAAuB;AACvB,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA,4BAA4B,WAAW;AACvC;AACA;AACA,gCAAgC,mDAAY;AAC5C,+BAA+B,GAAG,4CAAS,wBAAwB,4CAAS;AAC5E,gCAAgC,mDAAY,GAAG,oCAAoC;AACnF,gCAAgC,uDAAgB,GAAG,sBAAsB;AACzE,gCAAgC,mDAAY;AAC5C,gCAAgC,uDAAgB;AAChD;AACA;AACA;AACA;AACA,gCAAgC,mDAAY;AAC5C,+BAA+B,GAAG,4CAAS,wBAAwB,4CAAS;AAC5E,gCAAgC,uDAAgB;AAChD,gCAAgC,mDAAY,GAAG,sBAAsB;AACrE,gCAAgC,uDAAgB,GAAG,oCAAoC;AACvF,gCAAgC,mDAAY;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,WAAW;AACvC;AACA;AACA,gCAAgC,mDAAY;AAC5C,+BAA+B,GAAG,4CAAS,6BAA6B,4CAAS;AACjF,gCAAgC,mDAAY,GAAG,oCAAoC;AACnF,gCAAgC,uDAAgB,GAAG,sBAAsB;AACzE,gCAAgC,mDAAY;AAC5C,gCAAgC,uDAAgB;AAChD;AACA;AACA;AACA;AACA,gCAAgC,mDAAY;AAC5C,+BAA+B,GAAG,4CAAS,6BAA6B,4CAAS;AACjF,gCAAgC,uDAAgB;AAChD,gCAAgC,mDAAY,GAAG,sBAAsB;AACrE,gCAAgC,uDAAgB,GAAG,oCAAoC;AACvF,gCAAgC,mDAAY;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B,+BAA+B;AAC/B,+BAA+B;AAC/B,+BAA+B;AAC/B;AACA;AACA,+BAA+B;AAC/B,+BAA+B;AAC/B,+BAA+B;AAC/B,+BAA+B;AAC/B;AACA,8BAA8B,mDAAY,OAAO,mDAAY,OAAO,mDAAY,OAAO,mDAAY,OAAO,sDAAe;AACzH,8BAA8B,mDAAY,OAAO,mDAAY,OAAO,mDAAY,OAAO,mDAAY,OAAO,sDAAe;AACzH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,iDAAc;AAC/B;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,iDAAc;AAC/B;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,CAAC,yCAAK;AACY;;;;;;;;;;;;;;;;;;;;;;AC7UnB;AACA;AACA;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACyC;AAC8B;AAC7B;AACH;AAC4B;AACM;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,2BAA2B;AACpC,SAAS,6BAA6B;AACtC;AACA;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,mDAAK;AAC1B,gBAAgB,4EAAiB;AACjC,qBAAqB,mDAAK;AAC1B;AACA,4BAA4B,2EAAc;AAC1C;AACA;AACA,2BAA2B,mDAAK;AAChC;AACA;AACA,kCAAkC,mDAAU;AAC5C;AACA;AACA,yBAAyB,sBAAsB,IAAI,sBAAsB,IAAI,uBAAuB,IAAI,uBAAuB,IAAI,uBAAuB,IAAI,uBAAuB,IAAI,uBAAuB;AAChN;AACA;AACA;AACA,mBAAmB,mDAAK;AACxB,kCAAkC,mDAAU;AAC5C;AACA;AACA,yBAAyB,sBAAsB,IAAI,sBAAsB,IAAI,sBAAsB,IAAI,uBAAuB,IAAI,uBAAuB,IAAI,uBAAuB;AACpL;AACA;AACA;AACA;AACA;AACA,mCAAmC,iFAAgB;AACnD;AACA,wCAAwC,iFAAgB;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,CAAC,iDAAS;AACa;;;;;;;;;;;;;;;;;;;;;AC5FxB;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACyC;AACT;AACgC;AACO;AAChC;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,qBAAqB;AAC9B,SAAS,uBAAuB;AAChC;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,4EAAiB;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,yCAAK;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,wEAAgB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,CAAC,iDAAS;AACO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA,wEAAoC;;;;;;;;;;;;;;;;;;;;;AChMpC;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACmC;AACQ;AACJ;AACE;AACF;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,qBAAqB;AAC9B,SAAS,uBAAuB;AAChC;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,uDAAO;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,uBAAuB;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,yDAAsB,cAAc,4CAAS;AAChE,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,CAAC,2CAAM;AACU;AAClB;AACA;AACA;AACA;AACA;AACA;AACA,wEAAoC;;;;;;;;;;;;;;;;;;;;;;;AC3GpC;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACkC;AACC;AACI;AACgC;AAC5B;AACI;AACiB;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,0BAA0B;AACnC,SAAS,4BAA4B;AACrC;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,4EAAiB;AACnD,gCAAgC,6EAAwB;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,2CAAM;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,mDAAY,GAAG,sBAAsB;AACxD,gBAAgB,mDAAY,GAAG,oBAAoB;AACnD,gBAAgB,mDAAY,GAAG,qBAAqB;AACpD,gBAAgB,mDAAY,GAAG,qBAAqB;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,sDAAc;AAC3B;AACA;AACA;AACA;AACA,CAAC,CAAC,2CAAM;AACe;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,6EAAyC;;;;;;;;;;;;;;;;;;AClGzC;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACkC;AACK;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,sBAAsB;AAC/B,SAAS,wBAAwB;AACjC;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,mBAAmB;AAC/C,4BAA4B,oBAAoB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC,CAAC,2CAAM;AACW;AACnB;AACA;AACA;AACA;AACA;AACA;AACA,yEAAqC;;;;;;;;;;;;;;;;;;;;;;AC/FrC;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACkC;AACC;AACoC;AAChC;AACI;AACA;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,mBAAmB;AAC5B,SAAS,qBAAqB;AAC9B;AACA;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,4EAAiB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,2CAAM;AAC7B;AACA,mBAAmB,mDAAY,GAAG,aAAa;AAC/C,gBAAgB,mDAAY,GAAG,YAAY;AAC3C,gBAAgB,mDAAY,GAAG,cAAc;AAC7C,gBAAgB,mDAAY,GAAG,cAAc;AAC7C,gBAAgB,mDAAY,GAAG,aAAa;AAC5C,gBAAgB,mDAAY,GAAG,aAAa;AAC5C,gBAAgB,mDAAY,GAAG,aAAa;AAC5C,gBAAgB,mDAAY,GAAG,YAAY;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,uDAAO;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,uDAAO;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,uDAAO;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,uDAAO;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,uDAAO;AAC5C;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC,CAAC,2CAAM;AACQ;AAChB;AACA;AACA;AACA;AACA;AACA;AACA,sEAAkC;;;;;;;;;;;;;;;;;;;;AClMlC;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACmC;AACI;AACF;AACE;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,oBAAoB;AAC7B,SAAS,sBAAsB;AAC/B;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,iDAAc;AAC9B;AACA;AACA;AACA,gBAAgB,iDAAc;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,gCAAgC,6CAAU;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC,CAAC,2CAAM;AACS;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,uEAAmC;;;;;;;;;;;;;;;;;;;;;;;;;;ACvJnC;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACyC;AACF;AACwB;AACb;AACqB;AAChC;AACE;AACF;AACF;AACqC;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,MAAM;AACtC;AACA;AACA;AACA,gCAAgC,MAAM;AACtC;AACA;AACA,0CAA0C,MAAM;AAChD;AACA;AACA;AACA;AACA;AACA,SAAS,oBAAoB;AAC7B,SAAS,sBAAsB;AAC/B,SAAS,gFAAgF;AACzF;AACA;AACA;AACA;AACA,IAAI,iDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,4EAAiB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,2DAAoB;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,oDAAiB;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,iDAAc;AAC1B;AACA;AACA;AACA,YAAY,iDAAc;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,4CAAS;AAChC,wBAAwB,4CAAS;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,iDAAc;AAC3B,gCAAgC,iBAAiB;AACjD;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,kBAAkB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4D,2EAAgB;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,2EAAgB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,gCAAgC,mBAAmB;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,2EAAgB;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wFAAwF;AACxF;AACA,8CAA8C,4CAAS;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8FAA8F,QAAQ;AACtG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sDAAsD,4CAAS;AAC/D;AACA;AACA;AACA,2DAA2D,4CAAS;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0DAA0D,8DAA2B;AACrF;AACA;AACA;AACA,8DAA8D,8DAA2B;AACzF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,4CAAS;AAChE;AACA;AACA;AACA;AACA,yDAAyD,8DAA2B;AACpF;AACA;AACA;AACA,yDAAyD,8DAA2B;AACpF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mEAAmE,2EAAgB,WAAW,8CAAW;AACzG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,iDAAc;AAC1D;AACA;AACA;AACA;AACA,mHAAmH,EAAE;AACrH;AACA;AACA;AACA,4DAA4D,mBAAmB;AAC/E;AACA;AACA;AACA;AACA;AACA,8FAA8F,EAAE;AAChG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,8CAAW;AACjD,6BAA6B;AAC7B;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,+CAAY;AACxC,4BAA4B,+CAAY;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,8CAAW,CAAC,4CAAS;AACvD,mCAAmC,8CAAW,CAAC,4CAAS;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,kCAAkC,4CAAS;AAC3C,mCAAmC,4CAAS;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,iBAAiB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,iBAAiB;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,8CAAW;AACnB,QAAQ,8CAAW;AACnB,QAAQ,8CAAW;AACnB,QAAQ,8CAAW;AACnB;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,QAAQ;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,iDAAc;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,YAAY,iDAAc;AAC1B;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,2BAA2B,sBAAsB;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,iDAAc;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,kDAAe;AACnC;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,iDAAc;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,kBAAkB;AAClD;AACA;AACA,wCAAwC,mBAAmB;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,YAAY;AACpD,wCAAwC,+BAA+B;AACvE;AACA;AACA,4CAA4C,6CAAU;AACtD;AACA,4CAA4C,eAAe;AAC3D;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,oCAAoC;AAChF;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,iDAAc;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,0DAAa;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,iDAAc;AACjC,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,iDAAc;AACjC,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,mDAAgB,CAAC,oDAAiB;AAC9E;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,+CAAY;AAChC;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC,CAAC,iDAAS;AACM;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,uEAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA,gEAAiB;AACjB,cAAc,6EAA8B;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;;;;;;;;;;;ACn5CD;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACmC;AACI;AAC4B;AAC5B;AACA;AACA;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,mBAAmB;AAC5B,SAAS,qBAAqB;AAC9B;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,mDAAK,IAAI;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,iDAAc;AAC/B;AACA;AACA;AACA,4DAA4D,2EAAc;AAC1E;AACA;AACA;AACA,gCAAgC,qBAAqB;AACrD,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,iDAAc;AAC/B;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,iDAAc;AAC/B;AACA;AACA;AACA,gCAAgC,aAAa;AAC7C,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,iDAAc;AAC/B;AACA;AACA;AACA,4DAA4D,2EAAc;AAC1E;AACA;AACA;AACA,gCAAgC,qBAAqB;AACrD,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,iDAAc;AAC/B;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,iDAAc;AAC/B;AACA;AACA;AACA,gCAAgC,aAAa;AAC7C,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB,uBAAuB;AACvB,oBAAoB,oDAAiB;AACrC,oBAAoB,iDAAc;AAClC,iBAAiB;AACjB;AACA;AACA,CAAC,CAAC,2CAAM;AACQ;AAChB;AACA;AACA;AACA;AACA;AACA;AACA,sEAAkC;;;;;;;;;;;;;;;;;;AC3LlC;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACgC;AACW;AAC3C;AACA;AACA;AACA,SAAS,oEAAoE;AAC7E;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,mDAAO;AACnC;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,CAAC,yCAAK;AACU;;;;;;;;;;;;;;;;;;;;;;ACnCjB;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACkC;AACoB;AACf;AACgC;AACjC;AACS;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,yBAAyB;AAClC,SAAS,2BAA2B;AACpC;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,4EAAiB;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,+CAAQ;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,+DAAgB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,sDAAc;AAC3B;AACA;AACA;AACA;AACA,CAAC,CAAC,2CAAM;AACc;AACtB;AACA;AACA;AACA;AACA;AACA;AACA,4EAAwC;;;;;;;;;;;;;;;;;;ACjGxC;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AAC8C;AACP;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,+BAA+B;AACxC,SAAS,iCAAiC;AAC1C;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,4CAAS;AACjC,uBAAuB,mDAAgB;AACvC,uBAAuB,mDAAgB;AACvC,uBAAuB,mDAAgB;AACvC,uBAAuB,mDAAgB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,mDAAgB;AAC5C,oBAAoB,mDAAgB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,mDAAgB;AAC5C,oBAAoB,mDAAgB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,mDAAgB;AAC5C,oBAAoB,mDAAgB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,mDAAgB;AAC5C,oBAAoB,mDAAgB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC,CAAC,uDAAY;AACc;;;;;;;;;;;;;;;;;;AC7I5B;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACmC;AACI;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,2BAA2B;AACpC,SAAS,6BAA6B;AACtC;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,iDAAc;AAC3B;AACA;AACA,aAAa,iDAAc;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC,CAAC,2CAAM;AACgB;;;;;;;;;;;;;;;;;;;;ACjIxB;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACsC;AACC;AACQ;AACI;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,sBAAsB;AAC/B,SAAS,wBAAwB;AACjC;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,SAAS;AAC5D;AACA;AACA;AACA;AACA,4BAA4B,wDAAY;AACxC,oCAAoC,mBAAmB;AACvD;AACA;AACA,yCAAyC,yDAAiB;AAC1D;AACA;AACA,qCAAqC,sDAAc;AACnD,+GAA+G,iDAAS;AACxH,+GAA+G,iDAAS;AACxH,8CAA8C;AAC9C,gHAAgH,iDAAS;AACzH,gHAAgH,iDAAS;AACzH,8CAA8C;AAC9C,gCAAgC,8DAAkB;AAClD;AACA;AACA;AACA;AACA,8CAA8C,kBAAkB;AAChE,4CAA4C,kEAA0B;AACtE;AACA,kDAAkD,yDAAiB;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC,CAAC,+CAAQ;AACS;AACnB;AACA;AACA;AACA;AACA;AACA;AACA,yEAAqC;;;;;;;;;;;;;;;;;;;;;AC7IrC;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACmC;AACQ;AACJ;AACI;AACJ;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,sBAAsB;AAC/B,SAAS,wBAAwB;AACjC;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,qBAAqB;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,sBAAsB;AACtE;AACA,gDAAgD,8BAA8B;AAC9E;AACA;AACA;AACA;AACA;AACA;AACA,6EAA6E,QAAQ;AACrF;AACA,wDAAwD,8BAA8B;AACtF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,SAAS;AAC1D;AACA;AACA;AACA;AACA;AACA,4BAA4B,mDAAY;AACxC,oCAAoC,oBAAoB;AACxD;AACA,gCAAgC,mDAAY;AAC5C,6BAA6B,iDAAc;AAC3C;AACA;AACA,6BAA6B,iDAAc;AAC3C;AACA;AACA,6BAA6B,iDAAc;AAC3C;AACA;AACA,6BAA6B,iDAAc;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,mDAAY;AACxC,wDAAwD,UAAU;AAClE;AACA,gCAAgC,mDAAY;AAC5C;AACA;AACA;AACA;AACA,wBAAwB,sDAAe;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,mDAAO;AAC3C;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC,CAAC,2CAAM;AACW;AACnB;AACA;AACA;AACA;AACA;AACA;AACA,yEAAqC;;;;;;;;;;;;;;;;;;;;;AChPrC;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACmC;AACI;AACA;AACI;AACJ;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,uBAAuB;AAChC,SAAS,yBAAyB;AAClC;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,mDAAK;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,SAAS;AAC5D;AACA;AACA,4BAA4B,mDAAY;AACxC,oCAAoC,mBAAmB;AACvD;AACA,gCAAgC,mDAAY;AAC5C,0CAA0C,oDAAiB;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,qBAAqB;AACjD;AACA;AACA,oCAAoC,mBAAmB;AACvD;AACA;AACA;AACA,qCAAqC,oDAAiB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,oDAAiB;AAChD,yBAAyB,kDAAkD,iDAAc;AACzF;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC,CAAC,2CAAM;AACY;AACpB;AACA;AACA;AACA;AACA;AACA;AACA,0EAAsC;;;;;;;;;;;;;;;;;;;;;ACjLtC;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACsC;AACC;AACQ;AACA;AACI;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,yBAAyB;AAClC,SAAS,2BAA2B;AACpC;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,SAAS;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,mDAAW,gBAAgB,mDAAW,YAAY,mDAAW,aAAa,mDAAW;AAC7G;AACA;AACA,4BAA4B,wDAAY;AACxC,oCAAoC,uBAAuB;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,mEAA2B;AACvE,4CAA4C,mEAA2B;AACvE,gCAAgC,8DAAkB;AAClD;AACA,kDAAkD,mEAA2B;AAC7E;AACA;AACA;AACA,oDAAoD;AACpD;AACA,4CAA4C,gBAAgB;AAC5D,4CAA4C,kEAA0B;AACtE;AACA;AACA;AACA;AACA,4CAA4C,mDAAW,CAAC,sDAAc;AACtE,wDAAwD,sCAAsC;AAC9F,kDAAkD,yDAAiB;AACnE,+EAA+E;AAC/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,wBAAwB;AAC9D;AACA;AACA;AACA;AACA;AACA,gDAAgD,sBAAsB;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,mBAAmB;AAC/C,+BAA+B,yDAAiB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,sDAAc;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,mBAAmB,sDAAc;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,mBAAmB,sDAAc,OAAO,YAAY;AACjF;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA,CAAC,CAAC,+CAAQ;AACY;AACtB;AACA;AACA;AACA;AACA;AACA;AACA,4EAAwC;;;;;;;;;;;;;;;;;;;;;;;;;ACxRxC;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACkC;AACS;AACA;AACiB;AACf;AACK;AACL;AACN;AACI;AAC3C;AACA;AACA;AACA,SAAS,oEAAoE;AAC7E;AACA;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,mDAAO;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,mBAAmB;AACnD;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,gBAAgB,wEAAc;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,iDAAc;AAC3B;AACA;AACA,iBAAiB,iDAAc;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,wEAAc;AAC1C,2BAA2B,wEAAc;AACzC;AACA;AACA;AACA;AACA;AACA,0BAA0B,wEAAc;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,wEAAc;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,kDAAQ,CAAC,yDAAa;AACvD,YAAY,+CAAY;AACxB;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,wEAAc;AAClC,4BAA4B,2DAAc;AAC1C;AACA;AACA,qBAAqB;AACrB;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,yCAAyC,0DAAa;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,iDAAc;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,CAAC,mDAAgB;AACD;;;;;;;;;;;;;;;;;;;ACn7BwB;AACQ;AACkB;AACJ;AAC/D,gBAAgB,yDAAU;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAAe,oCAAU;AACzB;AACA;AACA;AACA,iBAAiB,uEAAiB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,0DAAa;AACxC,gBAAgB,iDAAS;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,gBAAgB,iDAAS;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,gBAAgB,iDAAS;AACzB;AACA;AACA;AACA;AACA,aAAa;AACb,gBAAgB,iDAAS;AACzB;AACA;AACA;AACA,aAAa;AACb,gBAAgB,iDAAS;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,gBAAgB,iDAAS;AACzB;AACA,aAAa;AACb,gBAAgB,iDAAS;AACzB;AACA;AACA;AACA;AACA;AACA,+EAA+E,cAAc;AAC7F;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,mBAAmB,4DAAe;AAClC;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;;;;;;;;;;;;;;;;;;;;;;AC5FA;AACA;AACA;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACyC;AAC8B;AACvC;AACA;AACO;AACY;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,wBAAwB;AACjC,SAAS,0BAA0B;AACnC;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,4DAAO;AAC7B,uBAAuB,4DAAO;AAC9B,kCAAkC,4EAAiB;AACnD;AACA,+CAA+C,iDAAS;AACxD;AACA;AACA,yDAAyD,yCAAK;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,yCAAK;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,yCAAK;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,2DAAoB;AACpC;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC,CAAC,iDAAS;AACU;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,2EAAuC;;;;;;;;;;;;;;;;;;;AC5MvC;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACmC;AACI;AACA;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,wBAAwB;AACjC,SAAS,0BAA0B;AACnC;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,8CAAW;AAC3B,gBAAgB,8CAAW;AAC3B;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC,CAAC,2CAAM;AACa;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,2EAAuC;;;;;;;;;;;;;;;;;;;;;ACnGvC;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACkC;AACC;AACoC;AAChC;AACI;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,2BAA2B;AACpC,SAAS,6BAA6B;AACtC;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,2CAAM;AAC7B;AACA,mBAAmB,mDAAY,GAAG,cAAc;AAChD,gBAAgB,mDAAY,GAAG,aAAa;AAC5C,gBAAgB,mDAAY,GAAG,aAAa;AAC5C,gBAAgB,mDAAY,GAAG,YAAY;AAC3C;AACA;AACA;AACA,0BAA0B,4EAAiB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC,CAAC,2CAAM;AACgB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA,8EAA0C;;;;;;;;;;;;;;;;;;;;;ACjG1C;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACmC;AACI;AACA;AACA;AACE;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,+BAA+B;AACxC,SAAS,iCAAiC;AAC1C;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,iDAAc,OAAO,iDAAc;AAC/C,0BAA0B,4CAAS;AACnC,sCAAsC,yDAAsB;AAC5D,uCAAuC,yDAAsB;AAC7D,0CAA0C,yDAAsB;AAChE,yCAAyC,yDAAsB;AAC/D,wBAAwB,4CAAS;AACjC,uBAAuB,mDAAgB;AACvC,uBAAuB,mDAAgB;AACvC,uBAAuB,mDAAgB;AACvC,uBAAuB,mDAAgB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC,CAAC,2CAAM;AACoB;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA,kFAA8C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC7M9C;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACyC;AACe;AACZ;AACgB;AACJ;AACQ;AACzB;AACM;AAC0B;AACnB;AACb;AACA;AACA;AACE;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,wBAAwB;AACjC,SAAS,0BAA0B;AACnC;AACA;AACA,IAAI,iDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,kDAAc;AAC9C;AACA,kCAAkC,4EAAiB;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,gEAAY;AAC1C,4BAA4B,gEAAY;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,gCAAgC,sBAAsB;AACtD,gCAAgC,wBAAwB;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,kDAAc;AAC/B;AACA;AACA,iBAAiB,kDAAc;AAC/B;AACA;AACA,iBAAiB,kDAAc;AAC/B;AACA;AACA,iBAAiB,kDAAc;AAC/B;AACA;AACA;AACA;AACA;AACA,iBAAiB,kDAAc;AAC/B;AACA;AACA,iBAAiB,kDAAc;AAC/B;AACA;AACA,iBAAiB,kDAAc;AAC/B;AACA;AACA,iBAAiB,kDAAc;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,8DAA0B;AAC1C;AACA;AACA;AACA,qBAAqB,oDAAgB;AACrC,mDAAmD,2BAA2B;AAC9E;AACA;AACA;AACA,qBAAqB,oDAAgB;AACrC,mDAAmD,2BAA2B;AAC9E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,uBAAuB,+BAA+B;AACrF,6BAA6B,0CAA0C;AACvE;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,2CAA2C;AAC1E,6BAA6B,uBAAuB;AACpD;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,kDAAc;AACnC,gDAAgD,mDAAO;AACvD,qCAAqC,uDAAO;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,kDAAc;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,kDAAc;AACnC,iDAAiD,mDAAO;AACxD,sCAAsC,uDAAO;AAC7C;AACA;AACA;AACA,oBAAoB,kDAAc;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,+CAAW,iCAAiC,+CAAW;AAClF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oDAAgB,CAAC,+CAAW;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,iFAAiC;AACtF,mDAAmD,iFAAiC;AACpF;AACA;AACA;AACA;AACA,kIAAkI;AAClI;AACA;AACA;AACA,qDAAqD,+EAA+B;AACpF,mDAAmD,+EAA+B;AAClF;AACA;AACA;AACA;AACA,+HAA+H;AAC/H;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,oDAAM;AACtC;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,qEAAqB;AAC7D,wCAAwC,yEAAyB;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,wEAAc;AACnD,wBAAwB,2DAAc;AACtC;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,mCAAmC,IAAI,+BAA+B;AAClH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,wEAAgB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,CAAC,iDAAS;AACU;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,2EAAuC;;;;;;;;;;;;;;;;;;;;;;;;;ACp7BvC;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACyC;AACN;AACI;AACA;AACI;AACJ;AACE;AACE;AACwB;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,oBAAoB;AAC7B,SAAS,sBAAsB;AAC/B;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,2CAAM;AAC9C;AACA;AACA,8BAA8B,4BAA4B;AAC1D,8BAA8B,2BAA2B;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,gDAAS;AACnC;AACA;AACA,qCAAqC,2EAAc;AACnD;AACA;AACA,uCAAuC,2EAAc;AACrD;AACA;AACA;AACA;AACA,gCAAgC,mCAAmC;AACnE,gCAAgC,kBAAkB;AAClD;AACA;AACA,gCAAgC,qBAAqB;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,mDAAgB;AAChD,gCAAgC,mDAAgB;AAChD,uBAAuB,2DAAwB;AAC/C;AACA;AACA,yBAAyB;AACzB;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,uDAAoB;AACpE,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,iDAAc;AAC/B;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,iDAAc;AAC/B;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,iDAAc;AAC/B;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,mBAAmB,yDAAsB;AACzC,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,4CAAS;AAC5B,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,4CAAS;AAC5B,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,iDAAc;AAC1B;AACA;AACA;AACA,6BAA6B,mDAAO;AACpC;AACA;AACA,0BAA0B,yDAAsB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,iDAAc;AAC1B;AACA;AACA;AACA,6BAA6B,mDAAO;AACpC;AACA;AACA,0BAA0B,yDAAsB;AAChD;AACA;AACA;AACA,CAAC,CAAC,iDAAS;AACM;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,uEAAmC;;;;;;;;;;;;;;;;;;ACrXnC;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AAC0D;AACnB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,qBAAqB;AAC9B,SAAS,uBAAuB;AAChC;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC,CAAC,+DAAS;AACO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA,wEAAoC;;;;;;;;;;;;;;;;;;;;;;;ACrGpC;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACyC;AACT;AACY;AAC2B;AACnB;AACD;AACZ;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,2BAA2B;AACpC,SAAS,6BAA6B;AACtC;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,4EAAiB;AACnD;AACA,4BAA4B,yCAAK;AACjC;AACA;AACA;AACA;AACA;AACA,yBAAyB,oDAAM;AAC/B,yBAAyB,yDAAM;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,4DAAO;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,6BAA6B,yCAAK;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,CAAC,iDAAS;AACa;AACxB;AACA;AACA;AACA;AACA;AACA;AACA,8EAA0C;;;;;;;;;;;;;;;;;;;;ACzN1C;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACkD;AACc;AACO;AAChC;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,uBAAuB;AAChC,SAAS,yBAAyB;AAClC;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,4EAAiB;AACnD;AACA;AACA;AACA;AACA;AACA,gCAAgC,6EAAwB;AACxD;AACA;AACA;AACA;AACA,CAAC,CAAC,uDAAK;AACa;AACpB;AACA;AACA;AACA;AACA;AACA;AACA,0EAAsC;;;;;;;;;;;;;;;;;;;;;;;;;;ACtDtC;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACyC;AACM;AACO;AACZ;AACK;AACR;AACkC;AAClC;AACA;AACE;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,sBAAsB;AAC/B,SAAS,wBAAwB;AACjC;AACA;AACA,IAAI,iDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC;AAChC;AACA;AACA;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,mDAAK;AACjC;AACA;AACA;AACA,6BAA6B,iFAAgB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,kDAAK;AAC3C;AACA;AACA;AACA;AACA;AACA,qBAAqB,mDAAK;AAC1B;AACA;AACA,gCAAgC;AAChC;AACA;AACA;AACA,gCAAgC,iDAAc;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,+DAAgB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,+DAA4B,GAAG,sCAAsC;AACjF,qBAAqB,+DAA4B,GAAG,iFAAiF;AACrI;AACA;AACA,YAAY,8CAAW;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,mDAAgB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,mDAAgB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,mDAAgB;AAClD,kCAAkC,mDAAgB;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,gEAAoB;AACpD;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,uDAAS,UAAU,+CAA+C,IAAI,+CAA+C;AAC/J;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,yDAAsB;AACzC;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,CAAC,iDAAS;AACQ;AACnB;AACA;AACA;AACA;AACA;AACA;AACA,8EAAqC;;;;;;;;;;;;;;;;;;;;;;ACrqBrC;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACmC;AACgB;AACZ;AACE;AACF;AACI;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,wBAAwB;AACjC,SAAS,0BAA0B;AACnC;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,4DAAO;AAC/B,2BAA2B,4DAAO;AAClC,yBAAyB,4DAAO;AAChC,0BAA0B,4DAAO;AACjC,kCAAkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,yDAAsB;AACvC,iBAAiB,yDAAsB;AACvC,iBAAiB,yDAAsB;AACvC,iBAAiB,yDAAsB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,iDAAc;AAC1B;AACA,iBAAiB,mDAAY,GAAG,gCAAgC;AAChE,iBAAiB,mDAAY,GAAG,gCAAgC;AAChE;AACA,YAAY,iDAAc;AAC1B;AACA,iBAAiB,mDAAY,GAAG,gCAAgC;AAChE,iBAAiB,mDAAY,GAAG,gCAAgC;AAChE;AACA,mBAAmB,mDAAY,GAAG,cAAc;AAChD;AACA,cAAc,mDAAY,GAAG,cAAc;AAC3C;AACA,cAAc,mDAAY,GAAG,cAAc;AAC3C;AACA,cAAc,mDAAY,GAAG,cAAc;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC,CAAC,2CAAM;AACa;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,2EAAuC;;;;;;;;;;;;;;;;;;;AC1NvC;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACmC;AACI;AACI;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,uBAAuB;AAChC,SAAS,yBAAyB;AAClC;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,mDAAY,GAAG,YAAY;AAClD,sBAAsB,mDAAY,GAAG,gBAAgB;AACrD,sBAAsB,mDAAY,GAAG,YAAY;AACjD,sBAAsB,sDAAe;AACrC;AACA;AACA,uBAAuB,mDAAY,GAAG,YAAY;AAClD,sBAAsB,mDAAY,GAAG,gBAAgB;AACrD,sBAAsB,mDAAY,GAAG,YAAY;AACjD,sBAAsB,sDAAe;AACrC;AACA;AACA,uBAAuB,mDAAY,GAAG,YAAY;AAClD,sBAAsB,mDAAY,GAAG,YAAY;AACjD,sBAAsB,mDAAY,GAAG,gBAAgB;AACrD,sBAAsB,sDAAe;AACrC;AACA;AACA,uBAAuB,mDAAY,GAAG,gBAAgB;AACtD,sBAAsB,mDAAY,GAAG,YAAY;AACjD,sBAAsB,mDAAY,GAAG,YAAY;AACjD,sBAAsB,sDAAe;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC,CAAC,2CAAM;AACY;AACpB;AACA;AACA;AACA;AACA;AACA;AACA,0EAAsC;;;;;;;;;;;;;;;;;;;;;;ACzGtC;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACkC;AACK;AACI;AACJ;AACE;AACoB;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,0BAA0B;AACnC,SAAS,4BAA4B;AACrC;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,mDAAY,kBAAkB,8DAAkB;AACnE;AACA;AACA;AACA;AACA;AACA,oBAAoB,mDAAY,kBAAkB,8DAAkB;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,YAAY;AACpC;AACA;AACA,0BAA0B,+BAA+B,4CAAS,yCAAyC,4CAAS,UAAU;AAC9H,0BAA0B,+BAA+B,4CAAS,yCAAyC,4CAAS,UAAU;AAC9H;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,yDAAsB,mBAAmB,4CAAS;AACrE,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC,CAAC,2CAAM;AACe;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,6EAAyC;;;;;;;;;;;;;;;;;;;;AC5LzC;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AAC8B;AACS;AACY;AACR;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,wBAAwB;AACjC,SAAS,0BAA0B;AACnC;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,mDAAK;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB,mBAAmB;AACnB,oBAAoB,mDAAY,OAAO,+DAAS;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC,CAAC,uCAAI;AACe;;;;;;;;;;;;;;;;;;;ACpHrB;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACwC;AACW;AACR;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,6BAA6B;AACtC,SAAS,+BAA+B;AACxC;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB,uBAAuB;AACvB,uBAAuB;AACvB,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,+DAAS;AAC9B;AACA;AACA,qBAAqB,+DAAS;AAC9B;AACA;AACA,qBAAqB,+DAAS;AAC9B;AACA;AACA,qBAAqB,+DAAS;AAC9B;AACA,wBAAwB,mDAAY,YAAY,mDAAY,YAAY,mDAAY,YAAY,mDAAY;AAC5G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC,CAAC,iDAAS;AACe;;;;;;;;;;;;;;;;;;;;;;AC/O1B;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACkC;AACC;AACI;AACgC;AAC5B;AACI;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,4BAA4B;AACrC,SAAS,8BAA8B;AACvC;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,4EAAiB;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,2CAAM;AAC7B;AACA,mBAAmB,mDAAY,GAAG,YAAY;AAC9C,gBAAgB,mDAAY,GAAG,aAAa;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,sDAAc;AAC3B;AACA;AACA;AACA;AACA,CAAC,CAAC,2CAAM;AACiB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA,+EAA2C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACnF3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;CAEA;;AACA,IAAI8G,cAAJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,SAASC,QAAT,GAAoB;EAChB,OAAOtB,iDAAS,CAAC,IAAD,EAAO,KAAK,CAAZ,EAAe,KAAK,CAApB,EAAuB,YAAY;IAC/C,IAAIuB,CAAJ,EAAOC,OAAP,EAAgBC,SAAhB,EAA2BC,MAA3B;IACA,OAAOzB,mDAAW,CAAC,IAAD,EAAO,UAAU0B,EAAV,EAAc;MACnC,QAAQA,EAAE,CAACC,KAAX;QACI,KAAK,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;AACA;AACA;AACA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,IAAIS,MAAM;AAAG;AAAe,UAAU5K,MAAV,EAAkB;EAC1CZ,iDAAS,CAACwL,MAAD,EAAS5K,MAAT,CAAT;EACA;AACJ;AACA;;;EACI,SAAS4K,MAAT,CAAgBC,SAAhB,EAA2B;IACvB,IAAI1K,KAAK,GAAGH,MAAM,CAACI,IAAP,CAAY,IAAZ,KAAqB,IAAjC;IACA;AACR;AACA;;;IACQD,KAAK,CAACE,OAAN,GAAgB,IAAIZ,mDAAJ,CAAYU,KAAZ,CAAhB;IACA;AACR;AACA;AACA;AACA;;IACQA,KAAK,CAAC2K,cAAN,GAAuB,IAAIvF,yDAAJ,EAAvB;IACA;AACR;AACA;;IACQpF,KAAK,CAAC4K,aAAN,GAAsB,EAAtB;IACA;AACR;AACA;AACA;;IACQ5K,KAAK,CAAC6K,gBAAN,GAAyB,EAAzB;IACA;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;IACQ7K,KAAK,CAAC8K,eAAN,GAAwB,EAAxB;IACA;AACR;AACA;AACA;;IACQ9K,KAAK,CAAC+K,kBAAN,GAA2B,IAA3B;IACA;AACR;AACA;AACA;AACA;AACA;AACA;;IACQ/K,KAAK,CAACgL,eAAN,GAAwB,IAAI7F,6CAAJ,EAAxB;IACA;AACR;AACA;AACA;;IACQnF,KAAK,CAACiL,cAAN,GAAuB,EAAvB;IACA;AACR;AACA;;IACQjL,KAAK,CAACkL,qBAAN,GAA8B,KAA9B;IACA;AACR;AACA;AACA;AACA;;IACQlL,KAAK,CAACmL,WAAN,GAAoB,UAApB;IACA;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;IACQnL,KAAK,CAACoL,WAAN,GAAoB,IAAp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Cb,gBAAgB,iDAAS;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,gBAAgB,iDAAS;AACzB;AACA,aAAa;AACb,gBAAgB,iDAAS;AACzB;AACA;AACA,aAAa;AACb,gBAAgB,iDAAS;AACzB;AACA;AACA;AACA;AACA,aAAa;AACb,gBAAgB,iDAAS;AACzB;AACA;AACA;AACA;AACA,aAAa;AACb,gBAAgB,iDAAS;AACzB;AACA;AACA;AACA;AACA,aAAa;AACb,gBAAgB,iDAAS;AACzB;AACA;AACA,aAAa;AACb,gBAAgB,iDAAS;AACzB;AACA;AACA,aAAa;AACb,gBAAgB,iDAAS;AACzB;AACA,aAAa;AACb,gBAAgB,iDAAS;AACzB;AACA,aAAa;AACb,gBAAgB,iDAAS;AACzB;AACA,aAAa;AACb,gBAAgB,iDAAS;AACzB;AACA;AACA;AACA;AACA,aAAa;AACb,gBAAgB,iDAAS;AACzB;AACA;AACA;AACA,aAAa;AACb,gBAAgB,iDAAS;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,gBAAgB,iDAAS;AACzB;AACA,aAAa;AACb,gBAAgB,iDAAS;AACzB;AACA,aAAa;AACb;AACA,mBAAmB,4DAAe;AAClC;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC3JA;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACoC;AACO;AACN;AACuB;AACH;AACZ;AACM;AACN;AACJ;AACE;AACN;AACE;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,iDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,mDAAO;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,iEAAoB;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,+BAA+B;AAC7D,8BAA8B,+BAA+B;AAC7D,8BAA8B,+BAA+B;AAC7D,8BAA8B;AAC9B;AACA,qBAAqB;AACrB;AACA;AACA,8BAA8B,iCAAiC;AAC/D,8BAA8B,+BAA+B;AAC7D,8BAA8B,iCAAiC;AAC/D,8BAA8B,iCAAiC;AAC/D,8BAA8B;AAC9B;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,kDAAc;AACtB;AACA;AACA;AACA,SAAS;AACT,4CAA4C,SAAS;AACrD;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,6BAA6B,wEAAc;AAC3C;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,6BAA6B,wEAAc;AAC3C,sBAAsB,iEAAoB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,6CAAI;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,wEAAc;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,oBAAoB,2DAAc;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,2DAAc;AACtC;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,sDAAsD,SAAS;AAC/D,qCAAqC,6CAAI;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,kDAAc;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,mDAAgB;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,mDAAS,CAAC,sDAAkB;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,qDAAQ;AACvC;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sDAAsD,QAAQ;AAC9D;AACA,oBAAoB,oDAAgB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,iDAAa;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,iDAAU,CAAC,mDAAY,CAAC,sDAAe;AACnD;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,QAAQ,iDAAU;AAClB;AACA;AACA;AACA;AACA,YAAY,iDAAa;AACzB,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,oDAAgB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,iDAAU;AACtB;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC,CAAC,2DAAW;AACS;;;;;;;;;;;;;;;;;;;;;;;;ACvuCtB;AACA;AACA;AACkC;AACW;AACR;AAC0B;AACxB;AACM;AACJ;AACF;AACA;AACvC;AACA;AACA;AACA,SAAS,kFAAkF;AAC3F;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,aAAa,kFAAkF;AAC/F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,qDAAQ;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,iDAAc;AAC1B;AACA;AACA;AACA;AACA,mBAAmB,mDAAgB;AACnC;AACA;AACA,YAAY,iDAAc;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,qDAAkB;AACvC;AACA;AACA;AACA,gBAAgB,iDAAc;AAC9B;AACA;AACA,qBAAqB,iDAAc;AACnC,uBAAuB,oDAAiB;AACxC;AACA;AACA,iBAAiB,iDAAc;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,EAAE;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,iDAAc;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,2EAAgB;AACrC,wBAAwB,mBAAmB;AAC3C;AACA;AACA;AACA,mDAAmD,iDAAc;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,oBAAoB;AACxD;AACA,oEAAoE,uDAAoB;AACxF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,SAAS;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,iDAAc;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,mDAAgB;AAC5C;AACA;AACA;AACA;AACA;AACA,4BAA4B,mDAAgB,CAAC,iDAAc;AAC3D;AACA;AACA,4BAA4B,iDAAc;AAC1C;AACA;AACA,4BAA4B,sDAAmB;AAC/C;AACA;AACA,4BAA4B,mDAAgB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,mDAAgB,CAAC,oDAAiB;AAC9D;AACA;AACA,4BAA4B,oDAAiB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,mDAAgB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,mDAAgB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,oDAAiB;AAC7C;AACA;AACA,4BAA4B,mDAAgB,CAAC,oDAAiB;AAC9D;AACA;AACA;AACA;AACA;AACA,4BAA4B,mDAAgB;AAC5C;AACA;AACA,4BAA4B,oDAAiB;AAC7C;AACA;AACA,4BAA4B,mDAAgB,CAAC,oDAAiB;AAC9D;AACA;AACA;AACA;AACA;AACA,4BAA4B,mDAAgB;AAC5C;AACA;AACA;AACA;AACA;AACA,4BAA4B,mDAAgB;AAC5C;AACA;AACA;AACA;AACA;AACA,4BAA4B,mDAAgB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,mDAAgB;AAC5C;AACA;AACA,4BAA4B,qDAAkB;AAC9C;AACA;AACA,4BAA4B,qDAAkB;AAC9C;AACA;AACA,4BAA4B,qDAAkB;AAC9C;AACA;AACA,4BAA4B,qDAAkB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,mDAAgB,iBAAiB,mDAAgB;AAClF;AACA;AACA;AACA,iCAAiC,mDAAgB,WAAW,mDAAgB;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,uDAAoB;AAClD;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,gGAAgG;AAC7G;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,iDAAc;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,qDAAQ;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,qDAAkB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA;AACA,mCAAmC,EAAE;AACrC;AACA;AACA;AACA;AACA,mCAAmC,EAAE;AACrC;AACA;AACA;AACA;AACA,mCAAmC,EAAE;AACrC;AACA;AACA;AACA;AACA,mCAAmC,EAAE;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,EAAE,OAAO,EAAE;AAC9C;AACA;AACA;AACA;AACA,mCAAmC,EAAE,OAAO,EAAE;AAC9C;AACA;AACA;AACA;AACA,mCAAmC,EAAE,OAAO,EAAE;AAC9C;AACA;AACA;AACA;AACA;AACA,mCAAmC,EAAE,OAAO,EAAE,OAAO,EAAE;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,EAAE,OAAO,EAAE;AAC9C;AACA;AACA;AACA;AACA,mCAAmC,EAAE,OAAO,EAAE;AAC9C;AACA;AACA;AACA;AACA,mCAAmC,EAAE,OAAO,EAAE;AAC9C;AACA;AACA;AACA;AACA,mCAAmC,EAAE,OAAO,EAAE;AAC9C;AACA;AACA;AACA;AACA,mCAAmC,EAAE,OAAO,EAAE;AAC9C;AACA;AACA;AACA;AACA,mCAAmC,EAAE,OAAO,EAAE;AAC9C;AACA;AACA;AACA;AACA;AACA,mCAAmC,EAAE,OAAO,EAAE,OAAO,EAAE;AACvD;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,EAAE,OAAO,EAAE,OAAO,EAAE;AACvD;AACA;AACA;AACA,mCAAmC,GAAG;AACtC;AACA;AACA;AACA,2CAA2C,EAAE,OAAO,EAAE;AACtD;AACA;AACA;AACA,0CAA0C,EAAE,MAAM,EAAE;AACpD;AACA;AACA;AACA,mCAAmC,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,IAAI,kBAAkB,EAAE,QAAQ,EAAE;AAC9I;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,wDAAqB;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,iDAAc;AAC/C,kCAAkC,iDAAc;AAChD,gCAAgC,iDAAc;AAC9C,iCAAiC,iDAAc;AAC/C,mCAAmC,iDAAc;AACjD,mCAAmC,iDAAc;AACjD,wCAAwC,iDAAc;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,EAAE,UAAU,EAAE;AAC7D;AACA,wBAAwB,iDAAc,4BAA4B,EAAE,UAAU,EAAE;AAChF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,iBAAiB;AACzC;AACA;AACA,yBAAyB,uDAAoB;AAC7C;AACA;AACA,yBAAyB,uDAAoB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,2DAAwB;AAC/D;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC,CAAC,6CAAU;AACa;AACzB;AACA;AACA;AACA;AACA;AACA;AACA,+EAA2C;;;;;;;;;;;;;;;;;;;;;;;;;AC5qC3C;AACA;AACA;AACkC;AACW;AACR;AAC0B;AACxB;AACM;AACF;AACF;AACF;AACA;AACvC;AACA;AACA;AACA;AACA;AACA,SAAS,iFAAiF;AAC1F;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,iFAAiF;AAC9F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,qDAAQ;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,iDAAc;AAC9B;AACA;AACA;AACA,wCAAwC,iDAAc;AACtD;AACA;AACA;AACA,iBAAiB,qDAAkB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uEAAuE;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,iDAAc;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,wDAAqB;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,+CAAY;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,2EAAgB;AACzC,4BAA4B,mBAAmB;AAC/C;AACA;AACA,gDAAgD,wDAAqB;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,oBAAoB;AAC5D;AACA,iCAAiC,iDAAc;AAC/C;AACA;AACA;AACA,wEAAwE,uDAAoB;AAC5F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,SAAS;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,uDAAoB,EAAE,mDAAgB;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,iDAAc;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,iDAAc;AAC1B;AACA;AACA,4CAA4C,4CAAS;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,uDAAoB;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,iBAAiB,iFAAiF;AAClG;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC,CAAC,6CAAU;AACiB;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA,mFAA+C;;;;;;;;;;;;;;;;;;;;;;;;;AC9kB/C;AACA;AACA;AACkC;AACW;AACR;AAC0B;AACxB;AACM;AACF;AACF;AACF;AACA;AACvC;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,qDAAQ;AACjD;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,iDAAc;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,iDAAc;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,qDAAkB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,iDAAc;AAC9B,0BAA0B,gDAAa;AACvC;AACA;AACA;AACA,+CAA+C,uDAAoB;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,iDAAc;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,wDAAqB;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,+CAAY;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,iDAAc;AAC3C;AACA;AACA,yBAAyB,2EAAgB;AACzC,4BAA4B,mBAAmB;AAC/C;AACA;AACA,gDAAgD,wDAAqB;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uEAAuE,EAAE,cAAc,EAAE;AACzF;AACA;AACA,wEAAwE,EAAE,cAAc,EAAE;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8DAA8D,iDAAc;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+EAA+E,uDAAoB;AACnG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,4CAAS;AAC9B;AACA;AACA;AACA;AACA;AACA,qBAAqB,4CAAS;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,wDAAqB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,UAAU;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC;AAChC;AACA;AACA;AACA;AACA;AACA,+CAA+C,SAAS;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,4CAAS;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,iBAAiB,gFAAgF;AACjG;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,iBAAiB,gFAAgF;AACjG;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,iBAAiB,iDAAc;AAC/B;AACA,sBAAsB,2EAA2E;AACjG,sBAAsB,2EAA2E;AACjG,sBAAsB,2EAA2E;AACjG,sBAAsB,6EAA6E;AACnG,sBAAsB,6EAA6E;AACnG,sBAAsB,6EAA6E;AACnG,sBAAsB,6EAA6E;AACnG,sBAAsB;AACtB;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,+BAA+B;AAC9C,eAAe,+BAA+B;AAC9C,eAAe,+BAA+B;AAC9C,eAAe,gCAAgC;AAC/C,eAAe,gCAAgC;AAC/C,eAAe,gCAAgC;AAC/C,eAAe,gCAAgC;AAC/C,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA,iBAAiB,gFAAgF;AACjG;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,iBAAiB,iDAAc;AAC/B;AACA,sBAAsB,+EAA+E;AACrG,sBAAsB,+EAA+E;AACrG,sBAAsB,+EAA+E;AACrG,sBAAsB,+EAA+E;AACrG,sBAAsB,+EAA+E;AACrG,sBAAsB,6EAA6E;AACnG,sBAAsB,6EAA6E;AACnG,sBAAsB;AACtB;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gCAAgC;AAC/C,eAAe,gCAAgC;AAC/C,eAAe,gCAAgC;AAC/C,eAAe,gCAAgC;AAC/C,eAAe,gCAAgC;AAC/C,eAAe,+BAA+B;AAC9C,eAAe,+BAA+B;AAC9C,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA,iBAAiB,gFAAgF;AACjG;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,iBAAiB,iDAAc;AAC/B;AACA,sBAAsB,gEAAgE;AACtF,sBAAsB,oEAAoE;AAC1F,sBAAsB,uEAAuE;AAC7F,sBAAsB,0EAA0E;AAChG,sBAAsB,6EAA6E;AACnG,sBAAsB;AACtB;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA,iBAAiB,gFAAgF;AACjG;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,wDAAqB;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,wDAAqB;AACjD;AACA;AACA,CAAC,CAAC,6CAAU;AACe;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA,iFAA6C;;;;;;;;;;;;;;;;;;;;;;;ACjxB7C;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACqC;AACc;AACR;AACJ;AACM;AACN;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,mDAAO;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,iDAAc;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,SAAS;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,8DAAuB;AACpD,4BAA4B,EAAE,gBAAgB,8DAAuB;AACrE,6BAA6B,8DAAuB;AACpD,uBAAuB,EAAE,IAAI,8DAAuB;AACpD,uBAAuB,EAAE,IAAI,8DAAuB;AACpD,6BAA6B,8DAAuB;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,8DAAuB;AACtD,+BAA+B,8DAAuB;AACtD,+BAA+B,8DAAuB,gBAAgB;AACtE,+BAA+B,8DAAuB,gBAAgB;AACtE,+BAA+B,8DAAuB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,EAAE,MAAM;AAC/B,uBAAuB,EAAE,MAAM;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,2DAAS;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,wDAAiB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,cAAc;AAC1C;AACA;AACA;AACA;AACA,8CAA8C,gBAAgB,IAAI;AAClE;AACA;AACA;AACA;AACA;AACA,wBAAwB,cAAc;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B,QAAQ,wDAAiB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC;AACvC,uCAAuC;AACvC;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,mBAAmB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,uDAAoB;AACzE;AACA;AACA,iCAAiC,qBAAqB;AACtD;AACA;AACA,mCAAmC,uDAAoB;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,qBAAqB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,CAAC,6CAAU;AACa;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+EAA2C;;;;;;;;;;;;;;;;;;;;ACna3C;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACqC;AACU;AACQ;AAChB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,+DAAiB;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,iDAAc;AAC9B;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,iDAAc;AAC9B;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,oBAAoB,kBAAkB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,4DAAc;AAC1B;AACA;AACA;AACA;AACA;AACA,CAAC,CAAC,6CAAU;AACO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC1InB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AAC2C;AACN;AACU;AACG;AACM;AACgB;AACvB;AACb;AACY;AACH;AACR;AACE;AACA;AACA;AACE;AACJ;AACM;AACJ;AACA;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,0BAA0B;AAClC;AACA;AACA,IAAI,iDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA;AACA,gCAAgC,6CAAI;AACpC;AACA;AACA;AACA,gCAAgC,6CAAI;AACpC;AACA;AACA;AACA,mCAAmC,6CAAI;AACvC;AACA;AACA;AACA,uCAAuC,6CAAI;AAC3C;AACA;AACA;AACA,6BAA6B,yDAAU;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,yDAAU;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,iBAAiB,kDAAc;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,kDAAc;AACpC,SAAS;AACT;AACA;AACA;AACA;AACA,sBAAsB,kDAAc;AACpC,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,4DAAgB,4DAA4D,oCAAoC;AACrJ,qCAAqC,4DAAgB,4DAA4D,oCAAoC;AACrJ,qCAAqC,4DAAgB,0DAA0D,kCAAkC;AACjJ,qCAAqC,4DAAgB,8DAA8D,wCAAwC;AAC3J,qCAAqC,4DAAgB;AACrD,yBAAyB,kDAAc;AACvC;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,qCAAqC,4DAAgB,yCAAyC,mCAAmC;AACjI,qCAAqC,4DAAgB,wCAAwC,kCAAkC;AAC/H,qCAAqC,4DAAgB,uCAAuC,iCAAiC;AAC7H;AACA,iCAAiC,4DAAgB,sCAAsC,gCAAgC;AACvH,iCAAiC,4DAAgB,oCAAoC,8BAA8B;AACnH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gEAAgE,4DAAgB;AAChF;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0DAA0D,0DAAa;AACvE,oBAAoB,4DAAgB,4DAA4D,uCAAuC;AACvI,oBAAoB,4DAAgB,6DAA6D,wCAAwC;AACzI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0DAA0D,0DAAa;AACvE,oBAAoB,4DAAgB,uDAAuD,uCAAuC,6BAA6B,iBAAiB;AAChL;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0DAA0D,0DAAa;AACvE,oBAAoB,4DAAgB,qCAAqC,kCAAkC;AAC3G,oBAAoB,4DAAgB,oCAAoC,iCAAiC;AACzG,oBAAoB,4DAAgB,6DAA6D,sCAAsC;AACvI,oBAAoB,4DAAgB,0CAA0C,sCAAsC,6BAA6B,iBAAiB;AAClK;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8DAA8D,0DAAa;AAC3E,wBAAwB,4DAAgB,6DAA6D,wCAAwC;AAC7I,wBAAwB,4DAAgB,0CAA0C,sCAAsC,6BAA6B,iBAAiB;AACtK;AACA;AACA;AACA,0DAA0D,4DAAgB,6DAA6D,wCAAwC;AAC/K;AACA;AACA,0DAA0D,4DAAgB,0CAA0C,sCAAsC,6BAA6B,iBAAiB;AACxM;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,qDAAe;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,4CAAS;AACzB;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,qDAAe;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,2DAAc;AAC9B;AACA,gBAAgB,4CAAS;AACzB;AACA,qDAAqD,2DAAc;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,iFAAyB;AACtD;AACA,wBAAwB,iEAAoB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,2DAAc;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,qDAAe;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,qDAAe;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC;AACA;AACA;AACA,4CAA4C,qDAAe;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,8BAA8B;AACtD;AACA;AACA;AACA;AACA;AACA,mDAAmD,qDAAe;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,8BAA8B;AACtD;AACA;AACA;AACA,iFAAiF,qDAAe;AAChG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,8BAA8B;AACtD;AACA;AACA;AACA,gDAAgD,qDAAe;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,8BAA8B;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,iDAAa;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,qDAAe;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0DAA0D,qDAAe;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,qDAAe;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,qDAAe;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B,gCAAgC;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,iDAAa;AAChD,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,iDAAa;AAChD;AACA;AACA,yBAAyB;AACzB,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mEAAmE,qDAAe;AAClF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,4CAAS;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,qDAAe;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,QAAQ,+CAAW;AACnB;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,kDAAU;AAClB;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,qDAAe;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,kDAAc;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,kDAAU;AAClB;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,sEAA+B,iBAAiB,sEAA+B;AAC9F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,mDAAgB;AAC3C,YAAY,kDAAU;AACtB;AACA;AACA;AACA;AACA;AACA,6BAA6B,gDAAa;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,QAAQ,kDAAU;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,QAAQ,kDAAU;AAClB;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC;AACA;AACA;AACA;AACA;AACA,6CAA6C,qDAAe;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,qDAAe;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sDAAsD,qDAAe;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,qDAAe;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,qDAAe;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,qDAAqD,qDAAe;AACpE;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,sDAAsD,qDAAe;AACrE;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,mDAAmD,qDAAe;AAClE;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,qDAAqD,qDAAe;AACpE;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,6CAAO;AACjC;AACA,8CAA8C,iDAAa;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA,4BAA4B,uDAAS;AACrC;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,4BAA4B;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,qDAAe;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,qDAAe;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,qDAAe;AAC7D;AACA;AACA;AACA;AACA,uBAAuB,kDAAc;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,qDAAe;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,qDAAe;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,kDAAc;AAC1B;AACA;AACA,iBAAiB,kDAAc;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,iDAAa;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sFAAsF,kDAAc;AACpG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,kDAAc;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,iDAAa;AACzC,+BAA+B;AAC/B,0BAA0B;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,iDAAa;AACtC;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2GAA2G,iBAAiB;AAC5H;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,kDAAc;AAC1B;AACA;AACA,mBAAmB,+CAAY;AAC/B;AACA;AACA,kCAAkC,gDAAa;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,kBAAkB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,kBAAkB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,kDAAc;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,qBAAqB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,iDAAa;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,iDAAa;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,kDAAc;AAC3B;AACA;AACA;AACA,wBAAwB,8BAA8B;AACtD,YAAY,gDAAa;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,kDAAc;AAC/D;AACA,4BAA4B,sBAAsB;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,kDAAc;AAC/D;AACA,4BAA4B,sBAAsB;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,iDAAa;AACnC,wBAAwB,mBAAmB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,iDAAa;AACnC,wBAAwB,mBAAmB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,kCAAkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,kCAAkC;AAClC,eAAe,iDAAa;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,0BAA0B;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,iEAAiB;AACpC;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,kDAAc;AAC1B;AACA;AACA;AACA,QAAQ,gDAAa;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,kDAAU;AAClB;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,8BAA8B;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,kDAAc;AAC9B;AACA;AACA,qBAAqB,kDAAc;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,iDAAa;AAClC,4BAA4B,eAAe;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4D;AAC5D;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC,CAAC,mDAAgB;AACK;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;ACrwFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC+C;AACZ;AACM;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,4DAAc;AACtB,QAAQ,2DAAsB;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,4DAAc,mDAAmD,4DAAc,gEAAgE,4DAAc;AACjL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,4DAAc,oCAAoC,YAAY;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,4DAAc;AAC1B,YAAY,gDAAa,CAAC,sDAAiB;AAC3C;AACA;AACA;AACA,CAAC;AACoC;;;;;;;;;;;;;;;;;;;;;;;ACjHrC;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AAC6E;AAClC;AACN;AACgC;AACtB;AACR;AACvC;AACA;AACA;AAC4C;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,sFAAgC;AACrE;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,yDAAU;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,yDAAU;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,yDAAU;AAC9C;AACA;AACA;AACA;AACA;AACA,6BAA6B,yDAAU;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,kCAAkC,iEAAkB;AACpD,kCAAkC,iEAAkB;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,4DAAc;AAClC;AACA;AACA;AACA,oBAAoB,4DAAc;AAClC;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,yCAAyC,6CAAI;AAC7C;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,4DAAc;AAClC;AACA;AACA,oBAAoB,4DAAc;AAClC;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,yCAAyC,6CAAI;AAC7C;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,4DAAc;AAClC;AACA;AACA,oBAAoB,4DAAc;AAClC;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,4DAAc;AAClC;AACA;AACA,oBAAoB,4DAAc;AAClC;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,4DAAc;AAC9B;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,4DAAc;AAC9B;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,4DAAc;AAC9B;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,4DAAc;AAC9B;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,4DAAc;AAC9B;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,4DAAc;AAC9B;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,4DAAc;AAC9B;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,4DAAc;AAC9B;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,4DAAc;AAC9B;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,mBAAmB,wDAAqB;AACxC,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,4DAAc;AAC9B;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C;AAC/C,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,mBAAmB,wDAAqB;AACxC,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,mBAAmB,wDAAqB;AACxC,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,4DAAc;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,4DAAc;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,CAAC,mDAAgB;AACW;;;;;;;;;;;;;;;;;;AC12BK;AACiC;AACA;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,4DAAe;AACvD;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,0DAAa;AACzC;AACA;AACA;AACA,CAAC,CAAC,2EAAuB;AACmB;;;;;;;;;;;;;;;AC/G5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,CAAC;AAC2B;;;;;;;;;;;;;;;;;;AClF5B;AACA;AACA;AACqC;AACM;AACJ;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,6CAAU;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,+CAAY;AACpB,iBAAiB,iDAAc;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,+CAAY;AACpB,iBAAiB,iDAAc;AAC/B;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,gDAAa;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,mDAAgB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACoB;;;;;;;;;;;;;;;;;ACtda;AAClC;AACA;AACA;AACA;AACA;AACA;AACwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,kEAAkE;AAC3E;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,wBAAwB,iCAAiC;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,CAAC,iDAAS;AACM;;;;;;;;;;;;;;;;;;;;ACpIjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACwC;AACR;AACc;AACT;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,6CAAU;AACrD;AACA,2BAA2B,6CAAU,WAAW,6CAAU;AAC1D,2BAA2B,6CAAU,iBAAiB,6CAAU;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,6CAAU;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,iDAAS;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,yCAAK;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,iDAAS;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACgB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,uDAAY;AAChD;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AChJA;AACA;AACA;AACuC;AACA;AACY;AACd;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA,sBAAsB;AACtB,kBAAkB,6DAAuB;AACzC,SAAS,iDAAc;AACvB;AACA;AACA,yCAAyC,SAAS;AAClD;AACA,YAAY,oDAAiB;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,kBAAkB,8CAAW,qBAAqB,8CAAW;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,kBAAkB,8CAAW,qBAAqB,8CAAW;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,kBAAkB,8CAAW;AAC7B,gBAAgB,8CAAW,4BAA4B,8CAAW;AAClE,gBAAgB,8CAAW;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,kBAAkB,8CAAW;AAC7B,gBAAgB,8CAAW,6BAA6B,8CAAW;AACnE,gBAAgB,8CAAW,6BAA6B,8CAAW;AACnE,gBAAgB,8CAAW;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA,SAAS,iDAAc;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,4CAAS;AACvB,cAAc,4CAAS;AACvB;AACA;AACA;AACA,iBAAiB,8CAAW,CAAC,4CAAS;AACtC,iBAAiB,8CAAW,CAAC,4CAAS;AACtC,wBAAwB,cAAc;AACtC;AACA,oBAAoB,cAAc;AAClC;AACA,iBAAiB,8CAAW,CAAC,4CAAS;AACtC,iBAAiB,8CAAW,CAAC,4CAAS;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA,SAAS,iDAAc;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,iDAAc;AAC1B;AACA;AACA;AACA,UAAU,4CAAS;AACnB;AACA;AACA;AACA;AACA;AACA,gBAAgB,4CAAS,CAAC,4CAAS;AACnC,cAAc,iDAAc;AAC5B;AACA,wBAAwB,iDAAc;AACtC;AACA;AACA;AACA,mBAAmB,mDAAgB;AACnC,oBAAoB,mDAAgB;AACpC,wBAAwB,mDAAgB;AACxC,yBAAyB,mDAAgB;AACzC,mBAAmB,8CAAW,CAAC,mDAAgB;AAC/C,oBAAoB,8CAAW,CAAC,mDAAgB;AAChD,wBAAwB,8CAAW,CAAC,mDAAgB;AACpD,yBAAyB,8CAAW,CAAC,mDAAgB;AACrD,yDAAyD,gDAAa;AACtE,4DAA4D,gDAAa;AACzE;AACA;AACA;AACA;AACA;AACA;AACA,wEAAwE,gDAAa;AACrF,2EAA2E,gDAAa;AACxF,SAAS,iDAAc;AACvB;AACA;AACA,SAAS,iDAAc;AACvB;AACA;AACA;AACA,mBAAmB,GAAG,8CAAW,CAAC,4CAAS,oCAAoC,4CAAS;AACxF,eAAe,GAAG,4CAAS,qDAAqD,4CAAS;AACzF,eAAe,GAAG,4CAAS,2CAA2C,4CAAS;AAC/E,eAAe,GAAG,4CAAS,yCAAyC,4CAAS;AAC7E,eAAe,GAAG,4CAAS,mDAAmD,4CAAS;AACvF,eAAe,GAAG,4CAAS,oCAAoC,4CAAS;AACxE,eAAe,GAAG,4CAAS,4CAA4C,4CAAS;AAChF;AACA,6CAA6C,4CAAS;AACtD,+CAA+C,4CAAS;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,iDAAc;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC;AACrC,2CAA2C;AAC3C,8GAA8G,8CAAW,mBAAmB,8CAAW;AACvJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,SAAS,iDAAc;AACvB;AACA;AACA,SAAS,iDAAc;AACvB;AACA;AACA,oBAAoB,YAAY,aAAa,oBAAoB,aAAa,6BAA6B,aAAa,qBAAqB;AAC7I;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,gBAAgB,+DAAa;AAC7B;AACA;AACA;AACA;AACA;AACA,wBAAwB,gBAAgB;AACxC;AACA,4BAA4B,wBAAwB;AACpD;AACA;AACA;AACA;AACA;AACO;AACP,SAAS,iDAAc;AACvB;AACA;AACA,SAAS,iDAAc;AACvB;AACA;AACA;AACA,6BAA6B,gDAAa;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,gDAAa;AACjC;AACA;AACA,8BAA8B,gDAAa;AAC3C,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA,wBAAwB,mBAAmB;AAC3C;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;AC5YA;AACA;AACA;AAC0C;AACA;AACiB;AAClB;AACJ;AACI;AACF;AACc;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,wDAAqB;AACtD;AACA,aAAa;AACb,iCAAiC,wDAAqB;AACtD;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,6DAAY;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,+CAAY;AAChC,qBAAqB,gDAAa;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,uDAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,gDAAa;AACzB;AACA,QAAQ,8CAAW;AACnB;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,aAAa;AAC9B;AACA;AACA;AACA,iBAAiB,iDAAc;AAC/B;AACA,kCAAkC,kDAAK;AACvC;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,aAAa;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,iDAAc;AAC/B;AACA,wCAAwC,kDAAK;AAC7C;AACA;AACA,mCAAmC,qDAAY;AAC/C;AACA,yCAAyC,qDAAY;AACrD;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,iDAAc;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,iDAAc;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACuB;;;;;;;;;;;;;;;;;;;;;;;;;;AClYU;AAClC;AACA;AACA;AACA;AACA;AACA;AACuC;AACP;AACS;AACA;AACF;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,OAAO;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,2CAAc;AACjC;AACA;AACA;AACA;AACA,YAAY,8CAAW,gBAAgB,8CAAW,YAAY,8CAAW,aAAa,8CAAW;AACjG;AACA;AACA;AACA;AACA,iDAAiD,SAAS;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,8DAA2B;AAC3D,gCAAgC,8DAA2B;AAC3D,oBAAoB,+CAAkB;AACtC;AACA;AACA;AACA;AACA,CAAC;AACkB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA,mBAAmB,oDAAiB;AACpC;AACA;AACA;AACA,YAAY,wDAAiB,CAAC,mDAAgB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,yCAAY;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,oBAAoB;AACpD;AACA;AACA;AACA,kCAAkC,YAAY;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,wDAAiB,CAAC,mDAAgB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,+CAAkB,GAAG,cAAc,IAAI,6BAA6B,IAAI,6BAA6B;AACxH;AACA;AACA,mBAAmB,+CAAkB,GAAG,cAAc,IAAI,6BAA6B,IAAI,6BAA6B;AACxH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,8CAAW;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,yCAAY,GAAG,YAAY;AACjE;AACA;AACA,sCAAsC,yCAAY,GAAG,YAAY;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,8BAA8B,yCAAY,GAAG,cAAc;AAC3D;AACA;AACA,8BAA8B,yCAAY,GAAG,cAAc;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,4CAAe;AACrC;AACA;AACA;AACA;AACA,CAAC;AACmB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA,CAAC;AACoB;AACrB;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA,CAAC;AACoB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,+CAAkB;AACxC;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,yCAAY,GAAG,YAAY;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,yCAAY,GAAG,oDAAoD;AACrG;AACA;AACA;AACA,kCAAkC,yCAAY,GAAG,4CAA4C;AAC7F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,8CAAW;AACnB;AACA;AACA;AACA,8BAA8B,yCAAY,GAAG,cAAc;AAC3D,8BAA8B,4CAAe;AAC7C;AACA;AACA,8BAA8B,yCAAY,GAAG,4CAA4C;AACzF,8BAA8B,yCAAY,GAAG,4CAA4C;AACzF,8BAA8B,4CAAe;AAC7C;AACA;AACA,gCAAgC,cAAc;AAC9C,gCAAgC,cAAc;AAC9C,gCAAgC,cAAc;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,yCAAY,GAAG,cAAc;AAC3D;AACA;AACA,sBAAsB,4CAAe;AACrC;AACA;AACA;AACA;AACA,CAAC;AACgB;;;;;;;;;;;;;;;;;;AC7XjB;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACoC;AACM;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,+DAA+D;AAC/F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC,CAAC,6CAAO;AACgB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA,+EAA2C;;;;;;;;;;;;;;;;;;ACxET;AAClC;AACA;AACA;AACA;AACA;AACA;AACwC;AACE;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,CAAC,6CAAU;AACa;AACzB;AACA;AACA;AACA;AACA;AACA;AACA,+EAA2C;;;;;;;;;;;;;;;;;;;;AClDT;AAClC;AACA;AACA;AACA;AACA;AACA;AACgD;AACN;AACA;AACA;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,4CAAS;AAC7B;AACA;AACA,oBAAoB,4CAAS;AAC7B;AACA;AACA,oBAAoB,4CAAS;AAC7B;AACA;AACA;AACA;AACA,wBAAwB,WAAW;AACnC;AACA;AACA;AACA,kCAAkC,iDAAc;AAChD;AACA;AACA,oCAAoC,iDAAc;AAClD;AACA;AACA;AACA,qCAAqC,iDAAc;AACnD;AACA;AACA;AACA;AACA,gBAAgB,iDAAc;AAC9B;AACA;AACA,qBAAqB,iDAAc;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,CAAC,yDAAa;AACa;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA,kFAA8C;;;;;;;;;;;;;;;;;;;ACpNZ;AAClC;AACA;AACA;AACA;AACA;AACA;AACoC;AACM;AACI;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,mDAAY,GAAG,iBAAiB,IAAI,mDAAY,GAAG,oBAAoB;AAClG;AACA;AACA;AACA;AACA,2BAA2B,mDAAY,GAAG,YAAY,IAAI,mDAAY,GAAG,YAAY;AACrF;AACA;AACA;AACA;AACA;AACA,yCAAyC,iBAAiB;AAC1D;AACA,gCAAgC,mDAAY,GAAG,4BAA4B,IAAI,mDAAY,GAAG,+BAA+B;AAC7H;AACA;AACA;AACA;AACA,gCAAgC,mDAAY,GAAG,oBAAoB,IAAI,mDAAY,GAAG,uBAAuB;AAC7G;AACA;AACA;AACA,8BAA8B,WAAW;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC,CAAC,6CAAO;AACc;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,6EAAyC;;;;;;;;;;;;;;;;;;;;;;;ACzGzC;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACwC;AACA;AACC;AACC;AACI;AACJ;AACA;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,6CAAI;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,2DAAoB;AACrD,6BAA6B,gBAAgB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,gDAAa;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,wCAAwC;AACvE,QAAQ,iDAAU,CAAC,oDAAa;AAChC;AACA;AACA;AACA,iBAAiB,iDAAc;AAC/B;AACA;AACA;AACA,gBAAgB,iDAAc;AAC9B,oCAAoC,qCAAqC;AACzE;AACA,gBAAgB,iDAAc;AAC9B,oCAAoC,8BAA8B;AAClE;AACA,gBAAgB,iDAAc;AAC9B,oCAAoC,kBAAkB;AACtD;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD,wEAAwE;AACxE;AACA;AACA,2BAA2B,gDAAgD;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,qDAAa;AAChC,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,qDAAqD;AACvF;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,sBAAsB;AACtD,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC,CAAC,6CAAU;AACc;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA,gFAA4C;;;;;;;;;;;;;;;;;;;ACrMV;AAClC;AACA;AACA;AACA;AACA;AACA;AACkD;AACI;AACZ;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,2DAAc;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,CAAC,+DAAgB;AACgB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA,wFAAoD;;;;;;;;;;;;;;;;;;;;;;;;;AC5EpD;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACwC;AACC;AACa;AACe;AAC3B;AACwB;AACpB;AACA;AACJ;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,6CAAI;AAClC;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,uEAAiB;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,2DAAoB;AACpD,6BAA6B,gBAAgB;AAC7C;AACA;AACA,kCAAkC,qDAAY;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,8MAA8M;AAC5O;AACA,kCAAkC,uVAAuV;AACzX,YAAY,iDAAU;AACtB;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,uDAAS;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,qDAAa;AAChC,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,+CAAY;AACpB;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,+DAAiB;AAC1D;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,iBAAiB,mFAAmF;AACpG;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,iDAAc,qBAAqB,gDAAa;AAChE,8DAA8D,SAAS;AACvE;AACA,wBAAwB,iDAAc;AACtC;AACA,8CAA8C,6CAAU;AACxD;AACA;AACA,wCAAwC,iDAAc;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,CAAC,6CAAU;AACO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA,yEAAqC;;;;;;;;;;;;;;;;;;;;;;;ACzgBrC;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACwC;AACA;AACC;AACC;AACI;AACJ;AACI;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,6CAAI;AAC/B;AACA,iCAAiC,2DAAoB;AACrD,6BAA6B,gBAAgB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,iDAAc;AAC1B;AACA,iCAAiC,mDAAO;AACxC;AACA;AACA,mCAAmC,aAAa;AAChD;AACA,YAAY,iDAAc;AAC1B;AACA,iCAAiC,mDAAO;AACxC;AACA;AACA,mCAAmC,aAAa;AAChD;AACA;AACA;AACA,iCAAiC,mDAAO;AACxC;AACA;AACA,mCAAmC,aAAa;AAChD;AACA;AACA;AACA,iCAAiC,mDAAO;AACxC;AACA;AACA,mCAAmC,aAAa;AAChD;AACA;AACA,QAAQ,iDAAU,CAAC,oDAAa;AAChC;AACA;AACA;AACA,iBAAiB,iDAAc;AAC/B;AACA;AACA;AACA,gBAAgB,iDAAc;AAC9B,oCAAoC,qCAAqC;AACzE;AACA,gBAAgB,iDAAc;AAC9B,oCAAoC,8BAA8B;AAClE;AACA,gBAAgB,iDAAc;AAC9B,oCAAoC,kBAAkB;AACtD;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD,wEAAwE;AACxE;AACA;AACA,2BAA2B,gDAAgD;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,qDAAa;AAChC,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,CAAC,6CAAU;AACc;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA,gFAA4C;;;;;;;;;;;;;;;;;;;AC9OV;AAClC;AACA;AACA;AACA;AACA;AACA;AACkD;AACI;AACZ;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,2DAAc;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,CAAC,+DAAgB;AACgB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA,wFAAoD;;;;;;;;;;;;;;;;;;AC5EpD;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACoC;AACM;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,sIAAsI;AACpK;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC,CAAC,6CAAO;AACc;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,6EAAyC;;;;;;;;;;;;;;;;;;AC7FzC;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACkC;AACQ;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,4CAA4C;AAChF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,oCAAoC;AAC3E,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC,CAAC,2CAAM;AACc;AACtB;AACA;AACA;AACA;AACA;AACA;AACA,4EAAwC;;;;;;;;;;;;;;;;;;AC3ExC;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACkC;AACQ;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,kBAAkB;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,mGAAmG;AACrI;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC,CAAC,2CAAM;AACkB;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA,gFAA4C;;;;;;;;;;;;;;;;;;AC9H5C;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACkC;AACQ;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,oBAAoB;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,4BAA4B;AAClE,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC,CAAC,2CAAM;AACoB;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA,kFAA8C;;;;;;;;;;;;;;;;;;;AC1E9C;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACkC;AACQ;AACA;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,mDAAK;AAC3B;AACA,oCAAoC,4CAA4C;AAChF;AACA;AACA,8BAA8B,wBAAwB;AACtD;AACA;AACA,6BAA6B,4BAA4B;AACzD;AACA;AACA,iCAAiC,qCAAqC;AACtE;AACA;AACA;AACA,gEAAgE,uBAAuB;AACvF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,sBAAsB;AAC1D;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,wBAAwB;AACxD,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,0BAA0B;AAC3D,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,0BAA0B;AAC3D,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,oCAAoC;AAC3E,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,CAAC,2CAAM;AACoB;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA,kFAA8C;;;;;;;;;;;;;;;;;;;;;;AClL9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACwC;AACC;AAC4B;AAC7B;AACM;AACA;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,6CAAI;AACzC;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,iDAAU;AAClB;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,uDAAS;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,+CAAY;AACpB;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,qDAAa;AAChC,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,+DAAiB;AAC1D;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,CAAC,6CAAU;AACM;;;;;;;;;;;;;;;;;;ACpUlB;AACA;AACA;AACkC;AACA;AACgC;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,gEAAgE;AACzE,SAAS,wFAAwF;AACjG;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,mBAAmB,uEAAiB,mDAAmD;AACpH;AACA;AACA,kCAAkC,gFAAgF;AAClH;AACA;AACA,mCAAmC,yGAAyG;AAC5I;AACA;AACA,iCAAiC,iEAAiE;AAClG;AACA;AACA,6BAA6B,wDAAwD;AACrF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,sBAAsB;AACtD,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,iBAAiB;AACtD,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,iEAAiE;AACvG,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,CAAC,CAAC,2CAAM;AACe;;;;;;;;;;;;;;;;;;AChIvB;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACkC;AACQ;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,kBAAkB;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,wEAAwE;AAC9G,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC,CAAC,2CAAM;AACiB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA,+EAA2C;;;;;;;;;;;;;;;;;;;;;;;;AC3E3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC0C;AACN;AACF;AACS;AACF;AACF;AACI;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,mDAAU;AACxC,mBAAmB,sCAAS,CAAC,0CAAa,iCAAiC,0CAAa;AACxF,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,eAAe,6CAAU,wCAAwC,iDAAiD;AAClH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,YAAY;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACwB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA,IAAI,kGAAkG;AACtG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8DAA8D;AAC9D;AACA,8BAA8B,mDAAU;AACxC,mBAAmB,sCAAS,CAAC,0CAAa,iCAAiC,0CAAa;AACxF,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC;AACnC,eAAe,qDAAc;AAC7B;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,8CAAW,CAAC,oDAAa;AACjC;AACA,sCAAsC,iDAAc;AACpD;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA;AACA,eAAe,6CAAU,wCAAwC,uBAAuB;AACxF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,iDAAc;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,cAAc;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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5L,KAAV,EAAiB;IAC9C,OAAOA,KAAK,IAAI,QAAT,IAAqBvjB,MAAM,CAACc,SAAP,CAAiByc,IAAjB,CAAsBnd,IAAtB,CAA2B,IAA3B,EAAiCmjB,KAAjC,CAA5B;EACH,CAFD;;EAGA,OAAO4I,SAAP;AACH,CA9c8B,CA8c7B3sB,mDA9c6B,CAA/B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC9HgC;AACA;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA,oBAAoB,YAAY;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA,oBAAoB,YAAY;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA,oBAAoB,YAAY;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA,oBAAoB,YAAY;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA,oBAAoB,YAAY;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA,wBAAwB,YAAY;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA,YAAY,6CAAgB;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA,oBAAoB,YAAY;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA,SAAS,2CAAc;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,2CAAc;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA,oBAAoB,YAAY;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,0BAA0B;AAC1B;AACA,wBAAwB,SAAS;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA,oBAAoB,YAAY;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;ACtdA;AACA;AACA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI4vB,YAAY,GAAG,KAAnB;AACA,IAAIC,SAAS,GAAG,EAAhB;AACA,IAAIC,SAAS,GAAG,EAAhB;AACA,IAAIC,UAAU,GAAG,EAAjB;AACA,IAAIC,SAAS,GAAG,EAAhB;AACA,IAAIC,GAAG,GAAG,OAAO,EAAjB;AACA;AACA;AACA;AACA;AACA;AACA;;AACO,IAAIC,GAAG,GAAI,OAAOC,qBAAP,KAAiC,UAAjC,GACZ,UAAUC,EAAV,EAAc;EACZD,qBAAqB,CAACC,EAAD,CAArB;AACH,CAHa,GAIZ,UAAUA,EAAV,EAAc;EACZjsB,UAAU,CAACisB,EAAD,EAAKH,GAAL,CAAV;AACH,CANE;AAOP;AACA;AACA;AACA;AACA;AACA;;AACA,SAASI,SAAT,GAAqB;EACjB,IAAI/E,GAAG,GAAGzoB,IAAI,CAACyoB,GAAL,EAAV;EACA,IAAIhoB,MAAM,GAAGusB,SAAS,CAACvsB,MAAvB;;EACA,KAAK,IAAI8G,CAAC,GAAG,CAAb,EAAgBA,CAAC,GAAG9G,MAApB,EAA4B,EAAE8G,CAA9B,EAAiC;IAC7BylB,SAAS,CAACzlB,CAAD,CAAT,CAAakhB,GAAb;EACH;;EACD3kB,6CAAA,CAAiBkpB,SAAjB,EAA4BvsB,MAA5B;;EACA,KAAK,IAAI8G,CAAC,GAAG,CAAb,EAAgBA,CAAC,GAAG0lB,SAAS,CAACxsB,MAA9B,EAAsC,EAAE8G,CAAxC,EAA2C;IACvC0lB,SAAS,CAAC1lB,CAAD,CAAT,CAAakhB,GAAb;EACH;;EACDwE,SAAS,CAACxsB,MAAV,GAAmB,CAAnB;;EACA,KAAK,IAAI8G,CAAC,GAAG,CAAb,EAAgBA,CAAC,GAAG2lB,UAAU,CAACzsB,MAA/B,EAAuC,EAAE8G,CAAzC,EAA4C;IACxC2lB,UAAU,CAAC3lB,CAAD,CAAV,CAAckhB,GAAd;EACH;;EACDyE,UAAU,CAACzsB,MAAX,GAAoB,CAApB;;EACA,IAAIusB,SAAS,CAACvsB,MAAV,KAAqB,CAArB,IAA0BwsB,SAAS,CAACxsB,MAAV,KAAqB,CAAnD,EAAsD;IAClDssB,YAAY,GAAG,KAAf;EACH,CAFD,MAGK;IACDM,GAAG,CAACG,SAAD,CAAH;EACH;AACJ;AACD;AACA;AACA;AACA;AACA;AACA;;;AACA,SAASE,SAAT,GAAqB;EACjB,IAAI,CAACX,YAAL,EAAmB;IACfA,YAAY,GAAG,IAAf;IACAM,GAAG,CAACG,SAAD,CAAH;EACH;AACJ;AACD;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAAS5E,SAAT,CAAmB2E,EAAnB,EAAuB;EAC1BP,SAAS,CAACzqB,IAAV,CAAegrB,EAAf;EACAG,SAAS;AACZ;AACD;AACA;AACA;AACA;AACA;AACA;AACA;;AACO,SAASC,SAAT,CAAmBJ,EAAnB,EAAuB;EAC1BN,SAAS,CAAC1qB,IAAV,CAAegrB,EAAf;EACAG,SAAS;AACZ;AACD;AACA;AACA;AACA;AACA;AACA;AACA;;AACO,SAASE,UAAT,CAAoBL,EAApB,EAAwB;EAC3BL,UAAU,CAAC3qB,IAAX,CAAgBgrB,EAAhB;EACAG,SAAS;AACZ;AACD;AACA;AACA;AACA;AACA;AACA;AACA;;AACO,SAASG,QAAT,CAAkBN,EAAlB,EAAsB;EACzBJ,SAAS,CAAC5qB,IAAV,CAAegrB,EAAf;AACH;AACD;AACA;AACA;AACA;AACA;AACA;AACA;;AACO,SAASO,WAAT,GAAuB;EAC1B,IAAIrF,GAAG,GAAGzoB,IAAI,CAACyoB,GAAL,EAAV;EACA,IAAIhoB,MAAM,GAAG0sB,SAAS,CAAC1sB,MAAvB;;EACA,KAAK,IAAI8G,CAAC,GAAG,CAAb,EAAgBA,CAAC,GAAG9G,MAApB,EAA4B,EAAE8G,CAA9B,EAAiC;IAC7B4lB,SAAS,CAACrK,KAAV,GAAkB2F,GAAlB;EACH;AACJ;;;;;;;;;;;;;;;AC7HD;AACO;AACP;AACA;AACO;AACP;AACA;;;;;;;;;;;;;;;;;;ACNA;AACA;AACA;AACA;AACA;AACA;AAC0C;AACV;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,mDAAU;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+EAA+E,WAAW,mDAAU,KAAK;AACzG;AACA;AACA;AACA,mBAAmB,2CAAc;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACgB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;;;;;;;;;;;;;;;;;;;;;;AClHP;AACA;AACA;AACuC;AACH;AACJ;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,oBAAoB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,oBAAoB;AACvC;AACA;AACA;AACA,SAAS,yDAAyD;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,6CAAgB;AACjD,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,8CAAiB;AAClD,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,wBAAwB;AACvE;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,kBAAkB;AAChE;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,4CAAe;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,6CAAgB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,6CAAgB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,4CAAe;AACtC;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC;AACgB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,SAAS,2CAAc;AACvB;AACA;AACA;AACA;AACA,qBAAqB,wDAAiB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,kBAAkB,wCAAW;AAC7B,QAAQ,wDAAiB;AACzB;AACA;AACA;AACA;AACA,YAAY,2CAAc;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,QAAQ,2CAAc;AACtB;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;ACnSA;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACqC;AACE;AACA;AACH;AACJ;AACE;AACF;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,yDAAyD;AAClE;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,yCAAK;AACnC;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,sCAAS;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,6CAAgB,CAAC,2CAAc;AACjD,sBAAsB,2CAAc;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,YAAY;AACjD,0BAA0B,6CAAgB,CAAC,2CAAc;AACzD;AACA;AACA;AACA,qCAAqC,YAAY;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,wBAAwB,WAAW;AACnC;AACA;AACA,sBAAsB,6CAAgB,CAAC,2CAAc;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,6CAAK,CAAC,6CAAgB;AAC1C;AACA;AACA;AACA;AACA,+BAA+B,qDAAwB;AACvD;AACA;AACA,+BAA+B,6CAAgB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,qDAAwB;AACtD;AACA;AACA,8BAA8B,6CAAgB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,qDAAwB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,6CAAgB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,2CAAc,iBAAiB,0CAAa;AAC5D,0DAA0D,SAAS;AACnE,oDAAoD,yCAAK;AACzD,yCAAyC,6CAAK;AAC9C;AACA;AACA;AACA,gBAAgB,2CAAc,oDAAoD,yCAAK;AACvF,mCAAmC,6CAAK;AACxC;AACA;AACA;AACA;AACA;AACA,CAAC,CAAC,6CAAU;AACQ;AACpB;AACA;AACA;AACA;AACA;AACA;AACA,0EAAsC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACjctC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACgC;AACA;AAChC;AACA;AACA;AACA;AACA,iBAAiB,wBAAwB;AACzC,oBAAoB,wBAAwB;AAC5C,YAAY,sBAAsB;AAClC,kBAAkB,wBAAwB;AAC1C,aAAa,wBAAwB;AACrC,aAAa,wBAAwB;AACrC,cAAc,wBAAwB;AACtC,aAAa,kBAAkB;AAC/B,sBAAsB,wBAAwB;AAC9C,YAAY,oBAAoB;AAChC,kBAAkB,uBAAuB;AACzC,aAAa,sBAAsB;AACnC,iBAAiB,wBAAwB;AACzC,iBAAiB,uBAAuB;AACxC,kBAAkB,sBAAsB;AACxC,iBAAiB,uBAAuB;AACxC,aAAa,uBAAuB;AACpC,sBAAsB,wBAAwB;AAC9C,gBAAgB,wBAAwB;AACxC,eAAe,sBAAsB;AACrC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ACrC,aAAa,wBAAwB;AACrC,kBAAkB,wBAAwB;AAC1C,cAAc,sBAAsB;AACpC,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA,YAAY,MAAM;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,QAAQ,2CAAc;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA,KAAK;AACL,8BAA8B,EAAE,UAAU,EAAE,UAAU,EAAE;AACxD;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA,KAAK;AACL,8BAA8B,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE;AACpE;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,QAAQ,2CAAc;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,cAAc,6CAAgB;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC1qBA;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACsC;AACiB;AAClB;AACD;AACF;AACF;AAChC;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA,eAAe,+CAAQ;AACvB;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,QAAQ,2CAAc;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,IAAI,wCAAW;AACf;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,IAAI,wDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,yDAAU;AAC1B;AACA,iBAAiB;AACjB;AACA;AACA,gBAAgB,yDAAU;AAC1B;AACA,iBAAiB;AACjB;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,2CAAc;AAC3B;AACA;AACA;AACA,gBAAgB,mDAAa;AAC7B,wCAAwC,mDAAa;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,mDAAa;AACzB,oCAAoC,mDAAa;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,2CAAc;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,QAAQ,yCAAY;AACpB;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,CAAC,+CAAQ;AACW;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,2CAAc;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACqB;AACf;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA,kBAAkB,0CAAa;AAC/B;AACA;AACA,wBAAwB,oBAAoB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;AC5pBuD;AACvD;AACA;AACA;AACA;AACA;AACA;AACsC;AACc;AAChB;AACA;AACA;AACpC;AACA;AACA;AACA;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,YAAY,2CAAU;AACtB;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA,CAAC,CAAC,+CAAQ;AACoB;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,6DAAe;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,2CAAc;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,2CAAc;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,2CAAc;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,2CAAc;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,2CAAc;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,yCAAY;AACxB;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,2CAAU;AAClB;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,4CAAe;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,kDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,2CAAc;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,QAAQ,2CAAU;AAClB,qBAAqB,6CAAM;AAC3B;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,2CAAU,oCAAoC,OAAO,0CAAa,eAAe;AAChG;AACA;AACA,CAAC;AACqB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,2CAAU;AAClB;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wDAAwD,gCAAgC;AACxF;AACA;AACA,CAAC;AAC6B;;;;;;;;;;;;;;;;;;;;;ACjYI;AAClC;AACA;AACA;AACA;AACA;AACA;AACkC;AACF;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACmB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA,YAAY,wCAAW;AACvB;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,CAAC;AACwB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA,gBAAgB,2CAAc;AAC9B;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,2CAAc;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAC+B;AAChC;AACA;AACA;AACA;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC;AAC0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACrJ3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACuC;AACA;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,+BAA+B;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA,gFAAyC;AACzC;AACA;AACA;AACO;AACP;AACA;AACA,gFAAyC;AACzC;AACA;AACA;AACO;AACP;AACA;AACA,iFAA0C;AAC1C;AACA;AACA;AACO;AACP;AACA;AACA;AACA,mFAA4C;AAC5C;AACA;AACA;AACO;AACP;AACA;AACA,gFAAyC;AACzC;AACA;AACA;AACO;AACP;AACA;AACA,iFAA0C;AAC1C;AACA;AACA;AACO;AACP;AACA;AACA;AACA,mFAA4C;AAC5C;AACA;AACA;AACO;AACP;AACA;AACA,iFAA0C;AAC1C;AACA;AACA;AACO;AACP;AACA;AACA,kFAA2C;AAC3C;AACA;AACA;AACO;AACP;AACA;AACA,oFAA6C;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA,+EAAwC;AACxC;AACA;AACA;AACO;AACP;AACA;AACA,gFAAyC;AACzC;AACA;AACA;AACO;AACP;AACA;AACA;AACA,kFAA2C;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,4BAA4B,+CAAY;AACxC;AACA,+EAAwC;AACxC;AACA;AACA;AACO;AACP,wBAAwB,+CAAY;AACpC;AACA,gFAAyC;AACzC;AACA;AACA;AACO;AACP,yBAAyB,2CAAQ;AACjC;AACA,kFAA2C;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA,iFAA0C;AAC1C;AACA;AACA;AACO;AACP;AACA;AACA,kFAA2C;AAC3C;AACA;AACA;AACO;AACP;AACA;AACA;AACA,oFAA6C;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA,kFAA2C;AAC3C;AACA;AACA;AACO;AACP;AACA;AACA,mFAA4C;AAC5C;AACA;AACA;AACO;AACP;AACA;AACA;AACA,qFAA8C;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA,kFAA2C;AAC3C;AACA;AACA;AACO;AACP;AACA;AACA;AACA,mFAA4C;AAC5C;AACA;AACA;AACO;AACP;AACA;AACA;AACA,qFAA8C;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA,mFAA4C;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA,oFAA6C;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA,sFAA+C;;;;;;;;;;;;;;;;;;;;;ACvT/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA;AACA;AACA;AACA;AACA;;AACA,IAAIsF,eAAe;AA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AACA,oBAAoB,6DAAsB;AAC1C,kCAAkC,2CAAa,CAAC,6DAAsB,IAAI,6DAAsB,GAAG,6DAAsB,IAAI,6DAAsB;AACnJ,oCAAoC,oBAAoB;AACxD;AACA,uCAAuC,mDAAqB,iCAAiC,4BAA4B;AACzH,uCAAuC,mDAAqB,iCAAiC,4BAA4B;AACzH;AACA;AACA,mCAAmC,2DAAa;AAChD;AACA;AACA;AACA,qBAAqB,oDAAa;AAClC;AACA;AACA;AACA,iBAAiB,oDAAa;AAC9B;AACA;AACA;AACA;AACA;AACA,QAAQ,+CAAU;AAClB;AACA;AACA;AACA;AACA;AACA;AACO;AACP,WAAW,kEAA2B;AACtC,QAAQ,+DAAwB;AAChC;AACA;AACO;AACP,QAAQ,6DAAsB;AAC9B;AACA;AACA;AACA,YAAY,4DAAqB;AACjC,YAAY,2DAAoB;AAChC;AACA,aAAa;AACb,YAAY,wDAAmB;AAC/B;AACA,+BAA+B,sDAAQ;AACvC;AACA,SAAS;AACT,QAAQ,0DAAmB;AAC3B;AACA;AACO;AACP,gBAAgB,6DAAsB;AACtC;AACA,QAAQ,4DAAqB,CAAC,6DAAsB;AACpD,yBAAyB,qDAAc;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,6BAA6B,sDAAwB,uBAAuB,6DAAsB;AAClG;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,0BAA0B,iDAAS;AACnC;AACA;AACA;AACA;AACA;AACA,0BAA0B,iDAAS;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA,QAAQ,4CAAc;AACtB,YAAY,4CAAc,CAAC,iEAA0B;AACrD,wBAAwB,iEAA0B;AAClD;AACA;AACA,wBAAwB,2EAAuC;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,KAAK;AAC7C;AACA;AACA,wCAAwC,KAAK;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA,SAAS,4CAAc;AACvB;AACA;AACA;AACA;AACA,SAAS,4CAAc;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,4CAAc,eAAe,4CAAc,CAAC,iEAA0B;AAC9E,oBAAoB,iEAA0B;AAC9C;AACA;AACA,oBAAoB,iDAAS;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA,SAAS,mGAAmG;AAC5G;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA,qBAAqB,uBAAuB;AAC5C;AACA;AACA;AACA,QAAQ,6DAAsB;AAC9B;AACA;AACA;AACA;AACA,SAAS;AACT,YAAY,+DAAwB;AACpC;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,eAAe,2DAAoB;AACnC;AACA,2DAA2D,gDAAQ;AACnE;AACA;AACA,YAAY,8DAAuB;AACnC,gBAAgB,4DAAqB;AACrC,gDAAgD,4DAAqB;AACrE;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,QAAQ,8DAAuB;AAC/B,QAAQ,2DAAoB;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,IAAI,2CAAa,CAAC,sDAAe;AACjC;AACA;AACA;AACA;AACA;AACO;AACP,IAAI,sDAAe;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,IAAI,4DAAqB;AACzB;;;;;;;;;;;;;;;;;;;AC/lBA;AACA;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACqC;AACE;AACP;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,yDAAyD;AAClE;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,6CAAK;AACzB,kBAAkB,6CAAK;AACvB,2BAA2B,6CAAK;AAChC,gCAAgC,6CAAK;AACrC,+BAA+B,6CAAK;AACpC,iCAAiC,6CAAK;AACtC,+BAA+B,6CAAK;AACpC,iCAAiC,6CAAK;AACtC,6BAA6B,6CAAK;AAClC,kCAAkC,6CAAK;AACvC,iCAAiC,6CAAK;AACtC,mCAAmC,6CAAK;AACxC,iCAAiC,6CAAK;AACtC,mCAAmC,6CAAK;AACxC,kBAAkB,6CAAK;AACvB,wBAAwB,6CAAK;AAC7B,mCAAmC,6CAAK;AACxC,kBAAkB,6CAAK;AACvB,6BAA6B,6CAAK;AAClC,gCAAgC,6CAAK;AACrC,sBAAsB,6CAAK;AAC3B,sBAAsB,6CAAK;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,CAAC,6CAAU;AACiB;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA,mFAA+C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC5Gb;AAClC;AACA;AACA;AACA;AACO;AACP;AACA;AACA,wBAAwB,YAAY;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,6BAA6B,+BAA+B,yBAAyB;AACrF;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACO;AACP;AACA,qBAAqB,uBAAuB;AAC5C;AACA;AACA;AACA;AACA,uCAAuC;AACvC;AACA,wBAAwB,YAAY;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA,uCAAuC;AACvC;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA,gCAAgC,gCAAgC;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,gCAAgC;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,6CAAgB;AACpC;AACA;AACA;AACA,YAAY,0CAAa;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,0CAAa;AAC5B;AACA;AACA;AACA;AACA;AACA,YAAY,0CAAa;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACuB;;;;;;;;;;;;;;;;;ACzXxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACgC;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,2CAAc;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACmB;AACpB;AACA;AACA;AACA;AACA;AACA;AACO;;;;;;;;;;;;;;;;;;;;;;AC7JP;AACA;AACA;AACA;AACA;AACA;AACoD;AACpD;AACA;AACA;AACA;AACA;AACA;AAC2C;AACP;AACF;AACF;AACE;AACG;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,yBAAyB;AAClC;AACA;AACA;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,6CAAO;AACnC;AACA;AACA;AACA,wBAAwB,6CAAE;AAC1B;AACA;AACA;AACA;AACA,+BAA+B,6CAAE;AACjC;AACA;AACA,YAAY,2CAAc,CAAC,2DAAqB;AAChD,2BAA2B,2DAAqB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,uBAAuB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,2CAAc;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,+CAAQ;AACtD;AACA;AACA;AACA,+CAA+C,SAAS;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,uBAAuB;AAChD;AACA;AACA,0CAA0C,+CAAQ;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,uBAAuB;AAChD;AACA;AACA,qDAAqD,+CAAQ;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,uCAAU,sBAAsB,oCAAoC;AACvF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC,CAAC,mDAAgB;AACE;;;;;;;;;;;;;;;;;;;;;;;;AC7R2B;AACM;AACD;AAClB;AACE;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,gBAAgB;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,iBAAiB;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAC0B;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,mDAAkB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,2CAAU;AAClB;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,kDAAqB;AAC1C;AACA;AACA;AACA;AACA,gBAAgB,+CAAkB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,+CAAkB;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,0CAAa;AACzB;AACA;AACA,yBAAyB,kDAAqB;AAC9C;AACA,oBAAoB,+CAAkB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8CAAa,CAAC,0CAAS,CAAC,gDAAe;AACtD,mBAAmB,gDAAe;AAClC,SAAS;AACT;AACA;AACA,CAAC,CAAC,oDAAa;AACQ;AACvB;AACA;AACA;AACA;AACA;AACA,IAAI,gDAAS;AACb;AACA,0CAA0C;AAC1C;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,gBAAgB,2CAAU;AAC1B;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA;AACA,gBAAgB,2CAAU;AAC1B;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA;AACA,CAAC,CAAC,+CAAQ;AACc;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC;AAClC;AACA;AACA;AACA,0BAA0B,6DAAe;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,2CAAc;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,+CAAkB;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA,cAAc;AACd;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,+CAAkB;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,+CAAkB;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,+CAAkB;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,wCAAW;AACnB;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,wCAAW;AAClC;AACA,QAAQ,wCAAW;AACnB;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,YAAY,wCAAW;AACvB;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA,YAAY,wCAAW;AACvB;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gDAAe;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,kDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,wCAAW;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACe;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,2CAAU;AAClB;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,YAAY;AACpC;AACA;AACA;AACA;AACA;AACA,CAAC;AACuB;;;;;;;;;;;;;;;;;;AC30BiB;AACJ;AACrC;AACA;AACA;AACO;AACP;AACA,qBAAqB,uBAAuB;AAC5C;AACA;AACA,QAAQ,qDAAe;AACvB;AACA,uCAAuC,+CAAQ;AAC/C;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA,qBAAqB,uBAAuB;AAC5C;AACA;AACA,SAAS,8DAAwB;AACjC;AACA,wCAAwC,+CAAQ;AAChD;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC7BA;AACA;AACA;AACA;AACA;AACgC;AAChC;AACA;AACA;AACA;AACA;AACA;AACO;AACA;AACA;AACA;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,QAAQ,2CAAc;AACtB,gBAAgB,2CAAc;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,SAAS,2CAAc;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,SAAS,2CAAc;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,QAAQ,2CAAc;AACtB,YAAY,2CAAc;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,2CAAc;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACO;AACP,QAAQ,2CAAc;AACtB,YAAY,2CAAc;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,2CAAc;AAC3B;AACA;AACA;AACA;AACA;AACA;AACO;AACP,QAAQ,2CAAc;AACtB,YAAY,2CAAc;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,2CAAc;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,iBAAiB,2CAAc;AAC/B,iBAAiB,2CAAc;AAC/B,eAAe,2CAAc;AAC7B,eAAe,2CAAc;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,gBAAgB,2CAAc;AAC9B,cAAc,2CAAc;AAC5B,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,iBAAiB,2CAAc;AAC/B,iBAAiB,2CAAc;AAC/B,eAAe,2CAAc;AAC7B,eAAe,2CAAc;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,oDAAoD,UAAU;AAC9D;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,UAAU;AAC9D;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,UAAU;AAC9D;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,UAAU;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA,wBAAwB,gBAAgB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,SAAS,2CAAc;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,cAAc;AAC1C;AACA,qBAAqB,2CAAc;AACnC;AACA;AACA,qBAAqB,2CAAc;AACnC;AACA;AACA,qBAAqB,2CAAc;AACnC;AACA;AACA,qBAAqB,2CAAc;AACnC;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,YAAY;AACpC;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA,SAAS,2CAAc;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,kBAAkB;AAClD;AACA;AACA;AACA;AACA,oBAAoB,oBAAoB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,2DAA2D;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACO;AACP,cAAc,4CAA4C;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACO;AACP;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA,aAAa;AACb;;;;;;;;;;;;;;;;;;;;;AC3rBA;AACA;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACqC;AAC6B;AAC3B;AACA;AACA;AACvC;AACA;AACA;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,4BAA4B,iDAAc;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,iDAAc;AAC/B;AACA;AACA,iBAAiB,iDAAc;AAC/B;AACA;AACA;AACA;AACA;AACA,gCAAgC,uDAAS,SAAS,2CAA2C;AAC7F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,SAAS;AACvD;AACA;AACA,wBAAwB,iDAAc,CAAC,gDAAa;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,wBAAwB,IAAI,wBAAwB;AACvF;AACA;AACA;AACA;AACA;AACA,gCAAgC,0BAA0B;AAC1D,sCAAsC,oDAAiB;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,wBAAwB,IAAI,wBAAwB;AAC3F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,iDAAc,CAAC,gDAAa;AACpD,wBAAwB,iDAAc,CAAC,gDAAa;AACpD;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,6CAA6C,SAAS;AACtD;AACA;AACA,4BAA4B,iDAAc,CAAC,gDAAa;AACxD;AACA;AACA,eAAe,2DAAwB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,iDAAc;AAC3B;AACA;AACA,aAAa,iDAAc;AAC3B;AACA;AACA;AACA,6CAA6C,SAAS;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,iDAAc,CAAC,gDAAa,eAAe;AACtE;AACA,2BAA2B,iDAAc;AACzC;AACA;AACA;AACA;AACA,qBAAqB,iDAAc;AACnC;AACA;AACA;AACA;AACA,iCAAiC,iDAAc,GAAG,wBAAwB;AAC1E;AACA;AACA;AACA;AACA;AACA,2CAA2C;AAC3C;AACA,gCAAgC,WAAW;AAC3C;AACA,0CAA0C,0BAA0B,4CAAS,uCAAuC,4CAAS;AAC7H;AACA;AACA;AACA,0DAA0D,YAAY;AACtE,wCAAwC,wBAAwB;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,uDAAS,SAAS,2CAA2C;AACzF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,SAAS;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,uBAAuB;AACnD;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,mBAAmB;AAC9D;AACA,iCAAiC,gCAAgC;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,iDAAc;AAC3B;AACA;AACA,aAAa,iDAAc;AAC3B;AACA;AACA;AACA;AACA,6CAA6C,SAAS;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC;AAChC;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,iDAAc;AACnC;AACA;AACA,qBAAqB,iDAAc;AACnC;AACA;AACA,8BAA8B,YAAY,IAAI,wBAAwB,IAAI,qCAAqC,IAAI,yBAAyB;AAC5I;AACA;AACA;AACA,mDAAmD,SAAS;AAC5D,wCAAwC,sCAAsC;AAC9E;AACA;AACA;AACA;AACA;AACA,0DAA0D,YAAY;AACtE,wCAAwC,wBAAwB;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,uDAAS,SAAS,2CAA2C;AACzF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6DAA6D,SAAS;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yEAAyE,YAAY;AACrF;AACA;AACA,qDAAqD;AACrD;AACA;AACA;AACA;AACA;AACA;AACA,sEAAsE,YAAY;AAClF;AACA;AACA,qDAAqD;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,iDAAc;AAC3B;AACA;AACA,aAAa,iDAAc;AAC3B;AACA;AACA,4BAA4B,uDAAS,SAAS,2CAA2C;AACzF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,+DAAiB;AAC1D;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC,CAAC,6CAAU;AACO;;;;;;;;;;;;;;;;;AC5bnB;AACA;AACA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACO,SAASxsB,IAAT,CAAc3D,GAAd,EAAmB0B,MAAnB,EAA2BC,OAA3B,EAAoC;EACvC,OAAO,IAAIkF,OAAJ,CAAY,UAAU4B,OAAV,EAAmBC,KAAnB,EAA0B;IACzC;IACA,IAAI6pB,MAAM,GAAG3yB,2CAAA,CAAe+B,OAAf,KAA2BA,OAAO,CAAC6O,YAAR,IAAwB,MAAhE,CAFyC,CAGzC;;IACA,IAAIgiB,GAAG,GAAG,IAAIC,cAAJ,EAAV;;IACAD,GAAG,CAAC1qB,MAAJ,GAAa,YAAY;MACrB,IAAI0qB,GAAG,CAACE,MAAJ,KAAe,GAAnB,EAAwB;QACpB,IAAI3pB,QAAQ,GAAG,KAAK,CAApB;QACA,IAAIyb,MAAJ;;QACA,IAAI+N,MAAJ,EAAY;UACR/N,MAAM,GAAGgO,GAAG,CAACzpB,QAAb;UACA4pB,QAAQ,CAACnO,MAAD,CAAR,CAAiB9T,IAAjB,CAAsB,UAAU3H,QAAV,EAAoB;YACtC,IAAI6pB,MAAM,GAAG;cACTJ,GAAG,EAAEA,GADI;cAET9pB,KAAK,EAAE,KAFE;cAGTK,QAAQ,EAAEA,QAHD;cAITtB,IAAI,EAAE+c,MAJG;cAKTljB,IAAI,EAAEkxB,GAAG,CAACK,iBAAJ,CAAsB,cAAtB,CALG;cAMTnxB,MAAM,EAAEA;YANC,CAAb;YAQA+G,OAAO,CAACmqB,MAAD,CAAP;UACH,CAVD;UAWA;QACH,CAdD,MAeK;UACD7pB,QAAQ,GAAGypB,GAAG,CAACM,YAAJ,IAAoBN,GAAG,CAACzpB,QAAnC;QACH;;QACD,IAAI6pB,MAAM,GAAG;UACTJ,GAAG,EAAEA,GADI;UAET9pB,KAAK,EAAE,KAFE;UAGTK,QAAQ,EAAEA,QAHD;UAITtB,IAAI,EAAE+c,MAJG;UAKTljB,IAAI,EAAEkxB,GAAG,CAACK,iBAAJ,CAAsB,cAAtB,CALG;UAMTnxB,MAAM,EAAEA;QANC,CAAb;QAQA+G,OAAO,CAACmqB,MAAD,CAAP;MACH,CA9BD,MA+BK;QACDlqB,KAAK,CAAC;UACF8pB,GAAG,EAAEA,GADH;UAEF9pB,KAAK,EAAE,IAFL;UAGFpH,IAAI,EAAEkxB,GAAG,CAACK,iBAAJ,CAAsB,cAAtB,CAHJ;UAIFnxB,MAAM,EAAEA;QAJN,CAAD,CAAL;MAMH;IACJ,CAxCD;;IAyCA8wB,GAAG,CAACvqB,OAAJ,GAAc,YAAY;MACtBS,KAAK,CAAC;QACF8pB,GAAG,EAAEA,GADH;QAEF9pB,KAAK,EAAE,IAFL;QAGFpH,IAAI,EAAEkxB,GAAG,CAACK,iBAAJ,CAAsB,cAAtB,CAHJ;QAIFnxB,MAAM,EAAEA;MAJN,CAAD,CAAL;IAMH,CAPD,CA9CyC,CAsDzC;;;IACA8wB,GAAG,CAAC1M,IAAJ,CAAS,KAAT,EAAgB9lB,GAAhB,EAAqB,IAArB;;IACA,IAAI2B,OAAO,IAAIA,OAAO,CAACoxB,eAAvB,EAAwC;MACpCP,GAAG,CAACO,eAAJ,GAAsB,IAAtB;IACH,CA1DwC,CA2DzC;;;IACA,IAAInzB,2CAAA,CAAe+B,OAAf,CAAJ,EAA6B;MACzB,IAAI/B,2CAAA,CAAe+B,OAAO,CAACqxB,cAAvB,CAAJ,EAA4C;QACxC,KAAK,IAAIrpB,CAAC,GAAG,CAAb,EAAgBA,CAAC,GAAGhI,OAAO,CAACqxB,cAAR,CAAuBnwB,MAA3C,EAAmD8G,CAAC,EAApD,EAAwD;UACpD,IAAIspB,MAAM,GAAGtxB,OAAO,CAACqxB,cAAR,CAAuBrpB,CAAvB,CAAb;UACA6oB,GAAG,CAACU,gBAAJ,CAAqBD,MAAM,CAACvuB,GAA5B,EAAiCuuB,MAAM,CAAChwB,KAAxC;QACH;MACJ;;MACD,IAAIrD,2CAAA,CAAe+B,OAAO,CAAC6O,YAAvB,CAAJ,EAA0C;QACtCgiB,GAAG,CAAChiB,YAAJ,GAAmB7O,OAAO,CAAC6O,YAA3B;MACH;IACJ,CAtEwC,CAuEzC;;;IACAgiB,GAAG,CAACW,IAAJ;EACH,CAzEM,CAAP;AA0EH;AACD;AACA;AACA;AACA;AACA;AACA;;AACO,SAASR,QAAT,CAAkBlrB,IAAlB,EAAwB;EAC3B,OAAO,IAAIZ,OAAJ,CAAY,UAAU4B,OAAV,EAAmBC,KAAnB,EAA0B;IACzC,IAAI0qB,MAAM,GAAG,IAAIvrB,UAAJ,EAAb;;IACAurB,MAAM,CAACtrB,MAAP,GAAgB,UAAUgqB,KAAV,EAAiB;MAC7BrpB,OAAO,CAAC2qB,MAAM,CAACprB,MAAR,CAAP;IACH,CAFD;;IAGAorB,MAAM,CAACnrB,OAAP,GAAiB,UAAUF,CAAV,EAAa;MAC1BW,KAAK,CAACX,CAAD,CAAL;IACH,CAFD;;IAGAqrB,MAAM,CAACC,UAAP,CAAkB5rB,IAAlB;EACH,CATM,CAAP;AAUH;;;;;;;;;;;;;;ACvID;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACxBA;AACA;AACA;AACA;AACA;AACA;AACkC;AACF;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,IAAI,wCAAW;AACf;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,IAAI,wCAAW;AACf,YAAY,2CAAc;AAC1B;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,IAAI,wCAAW;AACf,YAAY,2CAAc,mBAAmB,2CAAc;AAC3D;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,IAAI,wCAAW;AACf;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;;;;;;;;;;;;;;;;AC9MA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;ACrCA;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACqC;AACL;AACwB;AACK;AACA;AACI;AAC1B;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,yDAAyD;AAClE;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,yCAAK;AACnC;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,kCAAkC,iEAAiB;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,qEAAW;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,qEAAW;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,yEAAa;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,WAAW;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,SAAS;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,CAAC,6CAAU;AACU;AACtB;AACA;AACA;AACA;AACA;AACA;AACA,4EAAwC;;;;;;;;;;;;;;;;;AC1RxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C;AAC/C;AACA;AACA;AACA;AACA,+CAA+C;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C;AAC/C;AACA;AACA;AACA;AACA,+CAA+C;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,CAAC;AACkB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;;;;;;;;;;;;;;;AC/HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACiB;;;;;;;;;;;;;;;;;ACnEgB;AACJ;AAC9B;AACA;AACA;AACA;AACA;AACA,YAAY,wCAAW;AACvB,gBAAgB,wCAAW;AAC3B;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT;AACA;AACA,yCAAyC,oBAAoB;AAC7D,6BAA6B,oCAAoC;AACjE;AACA;AACA;AACA,QAAQ,0CAAa;AACrB;AACA,SAAS;AACT;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,wCAAW;AAC/B;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,gDAAgD;AAC7E;AACA;AACA,QAAQ,0CAAa;AACrB;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,sCAAS;AACjB;AACA;AACA,CAAC;AACuB;;;;;;;;;;;;;;;;;;;;;;;;;;AC/GxB;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AAC2C;AACN;AACM;AACJ;AACI;AACF;AACF;AACI;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,yBAAyB;AAClC,SAAS,2BAA2B;AACpC;AACA;AACA;AACA;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,6CAAI;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,mDAAO;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wDAAwD,qBAAqB;AAC7E,uDAAuD,qBAAqB;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,iDAAc,wDAAwD,qBAAqB;AACtI,2CAA2C,iDAAc;AACzD;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,6CAAI;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,iDAAc;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,iDAAc;AACtC;AACA,QAAQ,iDAAU;AAClB;AACA;AACA,0BAA0B,2DAAoB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,iDAAc;AACvC;AACA,cAAc,iDAAc;AAC5B;AACA;AACA;AACA;AACA,YAAY,iDAAU;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,iDAAc;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,iDAAc;AACtD;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,aAAa;AACb;AACA,gBAAgB,iDAAc;AAC9B;AACA;AACA,gBAAgB,gDAAa;AAC7B;AACA;AACA;AACA;AACA,YAAY,iDAAU;AACtB;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,iDAAc;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,+CAAY;AACpB,iBAAiB,iDAAc;AAC/B;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,iDAAc,WAAW,iDAAc;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,CAAC,mDAAgB;AACI;AACtB;AACA;AACA;AACA;AACA;AACO,uBAAuB,6CAAI;AAClC;AACA,qBAAqB,2DAAoB;AACzC,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACgC;;;;;;;;;;;;;;;;;;;;;;;ACrkBc;AAC/C;AACA;AACA;AACA;AACA;AACA;AACoD;AAClB;AACE;AACJ;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,6DAAe;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,2CAAc;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,+CAAkB;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,+CAAkB;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,SAAS;AACT,QAAQ,wCAAW;AACnB;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC;AACA;AACA;AACA;AACA;AACA,QAAQ,mDAAkB;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,2CAAc;AACnC;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,2CAAc;AACnC;AACA;AACA;AACA;AACA;AACA,qBAAqB,2CAAc;AACnC;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gDAAe;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,kDAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,QAAQ,wCAAW;AACnB;AACA;AACA,CAAC;AACsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,kDAAqB;AACzC,QAAQ,+CAAkB;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,kDAAqB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,2CAAc;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,+CAAkB;AAClC;AACA;AACA;AACA;AACA;AACA,CAAC;AACqB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,2CAAU;AAClB;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAC8B;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,2CAAU;AAClB;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAC6B;;;;;;;;;;;;;;;;;AChgB9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA,oBAAoB,WAAW;AAC/B;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;ACzDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACO;AACP;AACA;AACA;AACO;AACP;AACA;AACA;AACO;AACP;AACA;AACA;AACO;AACP;AACA;AACA;AACO;AACP;AACA;AACA;AACO;;;;;;;;;;;;;;;;;;;;;;;;;;AChCgC;AACvC;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,SAAS,iDAAc;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,qCAAqC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,mCAAmC;AACnC,SAAS,iDAAc;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,iDAAc;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,oDAAoD,oBAAoB;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACxXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC+C;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,+CAA+C,mDAAS;AACxD;AACA;AACA;AACA,eAAe,iDAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA,iCAAiC,OAAO;AACxC;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC3YA;AACA;AACA;AACoC;AACC;AACE;AACA;AACH;AACE;AACF;AACF;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,IAAI,yCAAY;AAChB;AACA,YAAY,iDAAc;AAC1B;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACA,QAAQ,kDAAQ;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,IAAI,yCAAY;AAChB;AACA,YAAY,iDAAc,aAAa,iDAAc;AACrD;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,IAAI,yCAAY;AAChB;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,WAAW,iDAAc;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,QAAQ,iDAAc;AACtB;AACA;AACA,gCAAgC,iDAAc,mBAAmB,iDAAc;AAC/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA,QAAQ,iDAAc;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,iDAAc;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,yBAAyB,6CAAO;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,iCAAiC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C;AAC1C,wCAAwC,qBAAqB,iDAAoB,UAAU,iDAAoB;AAC/G,kCAAkC,iDAAoB;AACtD;AACA,wBAAwB,kBAAkB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,kBAAkB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,mBAAmB;AACxE;AACA;AACA;AACA,wCAAwC,kBAAkB;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,mBAAmB;AAChE;AACA;AACA,gCAAgC,kBAAkB;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,0BAA0B;AAC1B,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA,eAAe,4CAAe;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,4CAAe;AAClC,eAAe,4CAAe;AAC9B;AACA,mBAAmB,0CAAa;AAChC,eAAe,0CAAa;AAC5B;AACA,mBAAmB,8CAAiB;AACpC,eAAe,8CAAiB;AAChC;AACA;AACA;AACA,eAAe,4CAAe;AAC9B;AACA;AACA;AACA,eAAe,0CAAa;AAC5B;AACA;AACA,WAAW,4CAAe;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA,QAAQ,8CAAW;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,iDAAc;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,2CAAc;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,2CAAc;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,QAAQ,+CAAY;AACpB;AACA;AACA;AACA,aAAa,iDAAc;AAC3B;AACA;AACA;AACA;AACA;AACA,aAAa,iDAAc;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,QAAQ,+CAAY;AACpB;AACA;AACA,aAAa,iDAAc;AAC3B;AACA;AACA,aAAa,iDAAc;AAC3B;AACA;AACA,aAAa,iDAAc;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,0BAA0B;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,0BAA0B;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,0BAA0B;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,8BAA8B;AAC9B,0BAA0B;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,iDAAc;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,2BAA2B;AAC3B,8BAA8B;AAC9B,0BAA0B;AAC1B;AACA;AACA;AACA;AACA,2CAA2C,uCAAuC;AAClF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA,eAAe,iDAAc;AAC7B;AACA;AACA;AACA;AACA,wBAAwB,oBAAoB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,4CAAS,uBAAuB,4CAAS;AAC1D,iBAAiB,4CAAS,uBAAuB,4CAAS;AAC1D;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA,eAAe,iDAAc;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,4CAAS,cAAc,4CAAS;AAClF,kDAAkD,4CAAS,cAAc,4CAAS;AAClF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA,gCAAgC,iDAAiD;AACjF,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA,gCAAgC,iDAAiD;AACjF,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA,aAAa,iDAAc;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA,iDAAiD,iDAAc;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA,4CAA4C,iDAAc;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,2CAAc;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;;;;;;;;;;;;;;;;;;AC3lCA;AACA;AACA;AACA;AACkC;AAClC;AACA;AACA;AACA;AACA;AACA;AAC2C;AACJ;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,gDAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,yDAAkB;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,CAAC,mDAAgB;AACK;;;;;;;;;;;;;;;;AChEe;AACtC;AACA,QAAQ,kDAAE;AACV;AACA;AACA,QAAQ,kDAAE;AACV;AACA;AACA;AACA,YAAY,kDAAE;AACd;AACA;AACA,YAAY,kDAAE;AACd;AACA;AACA;AACA,QAAQ,kDAAE;AACV;AACA;AACA;AACA,QAAQ,kDAAE;AACV;AACA;AACA;AACA;AACA,QAAQ,kDAAE;AACV;AACA;AACA,QAAQ,kDAAE;AACV;AACA;AACA;AACA;AACA;AACA,QAAQ,kDAAE;AACV;AACA;AACA,QAAQ,kDAAE;AACV;AACA;AACA,QAAQ,kDAAE;AACV;AACA;AACA;AACA;AACA,QAAQ,kDAAE;AACV;AACA;AACA;AACA;AACA,QAAQ,kDAAE;AACV;AACA;AACA,QAAQ,kDAAE;AACV;AACA;AACA;AACA;AACA,QAAQ,kDAAE;AACV;AACA;AACA;AACA,iEAAe,KAAK,EAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC9DrB;AACA;AACA;AACA;AACA;AACA;AACA;AACyD;AACY;AACd;AACA;AACF;AACJ;AACqB;AACX;AACQ;AAChB;AACnD;AACA;AACA;AAC4D;AACc;AACZ;AACA;AACA;AACE;AAChE;AACA;AACA;AAC0D;AACA;AACE;AACJ;AACA;AACF;AACE;AACA;AACsB;AACR;AACV;AACA;AACE;AACI;AACF;AACA;AACM;AACF;AACE;AACQ;AACd;AACN;AACF;AACM;AACF;AACI;AACF;AACM;AACJ;AACU;AACF;AACN;AAClE;AACA;AACA;AACyD;AACc;AACR;AAC/D;AACA;AACA;AACwD;AACQ;AAChE;AACA;AACA;AAC0E;AACQ;AACJ;AACc;AAC5F;AACA;AACA;AAC+D;AACwB;AACY;AAChB;AACqB;AAClC;AACtE;AACA;AACA;AACiE;AACR;AACA;AACa;AACC;AACvE;AACA;AACA;AAC+E;AACE;AACgB;AACA;AACtB;AACI;AACZ;AACc;AACN;AAC3E;AACA;AACA;AACmF;AACI;AACA;AACZ;AACR;AACU;AACI;AACjF;AACA;AACA;AACuF;AACjB;AACwC;AAClD;AACoB;AACrB;AACI;AACc;AAC0B;AACU;AACgE;AAC/E;AACnB;AACV;AACV;AACkD;AACpD;AACE;AACkB;AACtB;AAC6C;AACiB;AACN;AACyD;AACvG;AACjE;AACA;AACA;AACwD;AACxC;AAChB;AACA;AACA;AACwD;AACtC;AACkC;AACpC;AACoC;AACpC;AACsC;AACrC;AACuC;AACtC;AACsC;AACtC;AACsC;AACtC;AACkC;AACpC;AACsC;AACrC;AACuC;AACxC;AACoC;AACpC;AACkC;AACnC;AAC+G;AAC3B;;;;;;;;;;;;;;;ACnLnG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,EAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC3XF;AACA;AACA;AACmF;AACf;AACpE;AACA;AACA;AAC+E;AACC;AACnB;AACE;AACJ;AACF;AACY;AACR;AACN;AACM;AACwC;AACT;AACM;AACH;AACN;AACS;AACkH;AACnJ;AACN;AAC3D;AACA;AACA;AAC2E;AACT;AAC3C;AAC2B;AACnC;AACiB;AACf;;;;;;;;;;;;;;;;ACpCsC;;;;;;;;;;;;;;;;ACAvD;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,uBAAuB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,6BAAe,oCAAS;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;AC3DA;AACA;AACA;AACA;AACA;;AAEe;AACf;AACA;;;;;;;;;;;;;;;ACRA,6BAAe,oCAAS;AACxB;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;;;;;;;;;;;;;;;;;ACZmD;AACsB;;AAElE;AACP,eAAe,4CAAM,IAAI,6CAAG;AAC5B,oCAAoC,UAAU,6CAAG,UAAU,6CAAO,EAAE;AACpE,0BAA0B,6CAAG,kBAAkB,6CAAG;AAClD;AACA,MAAM,8CAAI,KAAK,wCAAE;AACjB;AACA,kBAAkB,6CAAG;AACrB;AACA;AACA;;AAEA;AACA,cAAc,4CAAM;AACpB,UAAU,8CAAI;AACd;AACA,qBAAqB,6CAAG;AACxB,IAAI,8CAAI,MAAM,6CAAG;AACjB;AACA;;AAEA,6BAAe,sCAAW;AAC1B,SAAS,+CAAU;AACnB;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC3BO;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC;AACtC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;;;;;;;;;;;;;;;;;AC/DmD;AACU;;AAEtD;AACP,yBAAyB,6CAAG,CAAC,6CAAG,CAAC,+CAAS;AAC1C;;AAEA;AACA,mBAAmB,8CAAI,CAAC,6CAAG,qBAAqB,wCAAE;AAClD;;AAEA,6BAAe,sCAAW;AAC1B,SAAS,+CAAU;AACnB;AACA;;;;;;;;;;;;;;;;;;;;;ACd+B;AACoC;AACtC;AACI;;AAE1B,sBAAsB,2CAAK;;AAElC;;AAEA,kBAAkB,2CAAK;AACvB;AACA;AACA;AACA;AACA;;AAEO;AACP,SAAS,6CAAI;AACb,aAAa,6CAAI;AACjB,WAAW,6CAAI;AACf;AACA,sBAAsB,2CAAK;AAC3B;AACA;AACA,GAAG;AACH;AACA;AACA,+BAA+B,yCAAG;AAClC,iDAAiD,6CAAI;AACrD,GAAG;AACH;AACA,gBAAgB,yCAAG;AACnB;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAY,6CAAO,SAAS,6CAAO;AACnC,8BAA8B,6CAAG,iBAAiB,+CAAS,aAAa,6CAAG;AAC3E;;AAEA;AACA,YAAY,6CAAO,SAAS,6CAAO;AACnC,kBAAkB,+CAAS,EAAE;;AAE7B;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,6CAAG;AAClB,eAAe,6CAAG;AAClB;AACA,iCAAiC,6CAAG;AACpC,yBAAyB,6CAAG;AAC5B,kBAAkB,+CAAK;;AAEvB;AACA;AACA;;AAEA,6BAAe,oCAAS;AACxB,gBAAgB,2CAAK;AACrB,EAAE,mDAAM;AACR;AACA;;;;;;;;;;;;;;;;;;;;AC3E+B;AACmB;AAC6C;AACtC;AACxB;;AAEjC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,2CAAK;AACxB,IAAI,6DAAuB;AAC3B,GAAG;AACH;AACA,IAAI,2DAAqB;AACzB;AACA;AACA;AACA,QAAQ,iDAAW;AACnB,wBAAwB,6CAAO;AAC/B,yBAAyB,6CAAO;AAChC;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,UAAU,wDAAS,WAAW,6CAAO,QAAQ,6CAAO;AACpD;AACA,iBAAiB,6DAAc;AAC/B;AACA,qBAAqB,6DAAc;AACnC,IAAI,wEAAyB;AAC7B,iBAAiB,wDAAS;AAC1B;AACA;AACA,kCAAkC,6CAAO;AACzC;AACA,uBAAuB,6CAAG;AAC1B;AACA,6BAA6B,6CAAO;AACpC;AACA,MAAM;AACN,8BAA8B,6CAAO;AACrC;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA,MAAM;AACN;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,iBAAiB,6CAAG;AACpB,IAAI;AACJ;AACA;AACA,EAAE,sDAAgB;AAClB;AACA;;AAEA;AACA,EAAE,0DAAoB;AACtB;;AAEA;AACA;AACA,EAAE,wDAAkB;AACpB,MAAM,6CAAG,aAAa,6CAAO;AAC7B;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,6BAAe,oCAAS;AACxB;;AAEA;AACA;AACA,EAAE,mDAAM;;AAER;AACA;AACA;;AAEA;AACA,6CAA6C,OAAO;AACpD;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;;AAEA;AACA;AACA,4EAA4E,QAAQ;AACpF;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;AClLsD;;AAE/C;AACP,UAAU,+CAAK,8BAA8B,8CAAI;AACjD;;AAEO;AACP,0DAA0D,6CAAG;AAC7D,mBAAmB,6CAAG,mBAAmB,6CAAG,UAAU,6CAAG;AACzD;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEA;AACO;AACP;AACA;;AAEO;AACP;AACA;;AAEA;AACO;AACP,UAAU,8CAAI;AACd;AACA;;;;;;;;;;;;;;;;;;;AChC+B;AACmE;AACrE;AACI;;AAEjC;AACA;AACA;AACA;AACA;AACA,gBAAgB;;AAEhB;AACA,UAAU,6CAAI;AACd;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,YAAY,6CAAO,SAAS,6CAAO;AACnC,eAAe,6CAAG;AAClB,kCAAkC,6CAAG,mBAAmB,6CAAG,UAAU,6CAAG;AACxE;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,YAAY,6CAAO,SAAS,6CAAO;AACnC,eAAe,6CAAG;AAClB,gBAAgB,6CAAG;AACnB,gBAAgB,6CAAG;AACnB,OAAO,6CAAG;AACV;AACA;AACA;;AAEA;AACA,YAAY,6CAAO,SAAS,6CAAO;AACnC,eAAe,6CAAG;AAClB,mBAAmB,6CAAG;AACtB,mBAAmB,6CAAG;AACtB,UAAU,6CAAG;AACb,UAAU,+CAAK,CAAC,8CAAI;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,YAAY,6CAAO,SAAS,6CAAO;AACnC;AACA,eAAe,6CAAG;AAClB,gBAAgB,6CAAG;AACnB,gBAAgB,6CAAG;AACnB,OAAO,6CAAG;AACV;AACA;;AAEA;AACA,YAAY,6CAAO,SAAS,6CAAO;AACnC,eAAe,6CAAG;AAClB,mBAAmB,6CAAG;AACtB,mBAAmB,6CAAG;AACtB,UAAU,6CAAG;AACb;AACA;AACA;AACA,UAAU,+CAAK;AACf,UAAU,8CAAI;AACd,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,6BAAe,oCAAS;AACxB;AACA;AACA;AACA,WAAW,2CAAK;AAChB,WAAW,2CAAK;AAChB,WAAW,2CAAK;AAChB,EAAE,mDAAM;;AAER;AACA;AACA;AACA,UAAU,+CAAK;;AAEf;AACA,UAAU,8CAAQ;AAClB;AACA;AACA,aAAa,6CAAO;AACpB,QAAQ,+CAAK;AACb;AACA,YAAY,8CAAQ;AACpB;;AAEA,UAAU,+CAAK,SAAS,6CAAO,EAAE,8CAAI,UAAU,6CAAO;AACtD;;;;;;;;;;;;;;;;;;;;AC9I+E;AAC1C;AACoC;AAC7B;;AAE5C;AACO;AACP;AACA,kBAAkB,6CAAG;AACrB,kBAAkB,6CAAG;AACrB;AACA;AACA,8BAA8B,yCAAG;AACjC;AACA,IAAI;AACJ;AACA;AACA,6DAA6D,yCAAG;AAChE;AACA,0BAA0B,iCAAiC;AAC3D,YAAY,wDAAS,0BAA0B,6CAAG,kBAAkB,6CAAG;AACvE;AACA;AACA;;AAEA;AACA;AACA,UAAU,wDAAS;AACnB,EAAE,wEAAyB;AAC3B,eAAe,8CAAI;AACnB,+CAA+C,yCAAG,GAAG,6CAAO,IAAI,yCAAG;AACnE;;AAEA,6BAAe,sCAAW;AAC1B,eAAe,qDAAQ;AACvB,eAAe,qDAAQ;AACvB,kBAAkB,qDAAQ;AAC1B;AACA;AACA,gBAAgB;;AAEhB;AACA;AACA,YAAY,6CAAO,UAAU,6CAAO;AACpC;;AAEA;AACA;AACA,4CAA4C,6CAAO;AACnD,+CAA+C,6CAAO;AACtD;AACA,aAAa,2DAAa,SAAS,6CAAO,UAAU,6CAAO;AAC3D;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA,sEAAsE,qDAAQ;AAC9E;;AAEA;AACA,sEAAsE,qDAAQ;AAC9E;;AAEA;AACA,yEAAyE,qDAAQ;AACjF;;AAEA;AACA;;;;;;;;;;;;;;;;;ACvE8B;AACsC;;AAEpE,iEAAe,kDAAI;AACnB,eAAe,cAAc;AAC7B;AACA;AACA,IAAI,wCAAE,GAAG,4CAAM;AACf,CAAC,EAAC;;AAEF;AACA,wCAAwC,sBAAsB;AAC9D;AACA;AACA;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,gCAAgC,wCAAE,IAAI,wCAAE;AACxC,kBAAkB,6CAAG;AACrB,UAAU,6CAAG,SAAS,wCAAE,IAAI,6CAAO,IAAI;AACvC,6DAA6D,4CAAM,IAAI,4CAAM;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,qCAAqC,wCAAE,IAAI;AACnD,YAAY,6CAAG,oBAAoB,6CAAO,qBAAqB,6CAAO,EAAE;AACxE,YAAY,6CAAG,oBAAoB,6CAAO,qBAAqB,6CAAO;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA,wBAAwB;AACxB;AACA;AACA;;AAEA;AACA;AACA;AACA,0BAA0B,6CAAG;AAC7B,SAAS,6CAAG,sBAAsB,6CAAO;AACzC,QAAQ,8CAAI,EAAE,6CAAG,oBAAoB,6CAAG,UAAU,6CAAG;AACrD,YAAY,6CAAG,oBAAoB,6CAAG,UAAU,6CAAG;AACnD;AACA;AACA;;AAEA;AACA;AACA;AACA,sBAAsB,4CAAM;AAC5B,kBAAkB,wCAAE;AACpB;AACA,iBAAiB,wCAAE;AACnB,iBAAiB,wCAAE;AACnB,iBAAiB,wCAAE;AACnB;AACA,kBAAkB,wCAAE;AACpB,kBAAkB,wCAAE;AACpB,kBAAkB,wCAAE;AACpB,IAAI,SAAS,6CAAG,oBAAoB,6CAAO;AAC3C,mCAAmC,wCAAE,IAAI,wCAAE;AAC3C;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;;;;;;;;;;;;;;;;AC3F8B;;AAE9B,6BAAe,sCAAW;AAC1B;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL,aAAa,6CAAI;AACjB;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;ACvBwH;AAC9E;AACsB;AACtB;AACZ;;AAE9B,6BAAe,oCAAS;AACxB,WAAW,6CAAG;AACd,kBAAkB,6CAAO;AACzB;AACA,sBAAsB,6CAAG,OAAO,6CAAO,EAAE;;AAEzC;AACA,IAAI,wDAAY;AAChB;;AAEA;AACA,WAAW,6CAAG,WAAW,6CAAG;AAC5B;;AAEA;AACA,mEAAmE;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,wCAAE,IAAI,wCAAE;AACxD;AACA;AACA;AACA,yBAAyB,uDAAU,oBAAoB,uDAAU;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,uDAAU;AACxC;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,wDAAS;AACtB,aAAa,wDAAS;;AAEtB;AACA;AACA;AACA,aAAa,6DAAc;AAC3B,eAAe,2DAAY;AAC3B;AACA;;AAEA;AACA;;AAEA;AACA;AACA,gBAAgB,6DAAc;AAC9B,YAAY,6DAAc;AAC1B,YAAY,6DAAc;AAC1B,IAAI,kEAAmB;;AAEvB;AACA;AACA,YAAY,2DAAY;AACxB,aAAa,2DAAY;AACzB,2BAA2B,2DAAY;;AAEvC;;AAEA,YAAY,8CAAI;AAChB,YAAY,6DAAc;AAC1B,IAAI,kEAAmB;AACvB,QAAQ,wDAAS;;AAEjB;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,gBAAgB,6CAAG,SAAS,wCAAE,IAAI,6CAAO;AACzC,oCAAoC,6CAAO;;AAE3C;;AAEA;AACA;AACA;AACA,sCAAsC,6CAAG,mBAAmB,6CAAO;AACnE;AACA,kBAAkB,wCAAE;AACpB,eAAe,6DAAc;AAC7B,MAAM,kEAAmB;AACzB,iBAAiB,wDAAS;AAC1B;AACA;;AAEA;AACA;AACA;AACA,mCAAmC,wCAAE;AACrC;AACA,gCAAgC;AAChC,oCAAoC;AACpC,6BAA6B;AAC7B,iCAAiC;AACjC;AACA;;AAEA,SAAS,kDAAI,gEAAgE,wCAAE,WAAW,wCAAE;AAC5F;;;;;;;;;;;;;;;;AChL2C;;AAE3C,6BAAe,sCAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,+DAA+D,sDAAa;AAC5E,KAAK;AACL;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;ACnBqC;AACA;AACM;AACS;AACrB;;AAE/B,6BAAe,oCAAS;AACxB;AACA;AACA,qBAAqB,mDAAU;AAC/B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,mBAAmB,iDAAK;AACxB,0BAA0B,4DAAe;AACzC;AACA;AACA,UAAU,mDAAU;AACpB,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,OAAO;AAC7B;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,oCAAoC,4CAAM,GAAG,6CAAO,GAAG,4CAAM;AAC7D,oCAAoC,4CAAM,GAAG,6CAAO,GAAG,4CAAM;AAC7D;;;;;;;;;;;;;;;AClIA,6BAAe,oCAAS;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;AC1DwC;AACH;AACJ;AACI;AACN;;AAE/B;;AAEA;AACA;;AAEe;;AAEf;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA,WAAW,6CAAG,cAAc,6CAAO;AACnC,UAAU,6CAAG,cAAc,6CAAO;AAClC,UAAU,6CAAG,cAAc,6CAAO;AAClC,iCAAiC;AACjC;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,uBAAuB,mDAAU;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,0CAA0C,OAAO;AACjD,mHAAmH,OAAO;AAC1H;AACA,0BAA0B;AAC1B,iBAAiB;AACjB;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,gCAAgC,iDAAK;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU,mDAAU;AACpB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA,cAAc,iDAAQ;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;;;;;;;;;;;;;;;ACvK0C;AACP;;AAEnC;AACA;AACA;AACA,kBAAkB;AAClB,kBAAkB;AAClB,kBAAkB;AAClB,0BAA0B;AAC1B;;AAEA;AACA;AACA;AACA,6BAAe,oCAAS;AACxB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,QAAQ,uDAAU;AAClB;AACA;AACA,oBAAoB,OAAO;AAC3B;AACA;AACA;AACA;AACA,mBAAmB,6CAAO;AAC1B;;AAEA;AACA;AACA;AACA;AACA,GAAG;;AAEH;;AAEA;AACA;AACA;;AAEA,+BAA+B,OAAO;AACtC;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,OAAO;AAChD,UAAU;AACV;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA,sCAAsC,QAAQ;AAC9C,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;ACtGA,6BAAe,oCAAS;;AAExB;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;;;;;;;;;;;;;;ACXA,6BAAe,oCAAS;AACxB;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;ACJgE;AACd;AACN;;AAE5C;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,SAAS,qDAAQ;AACjB;;AAEA;AACA;AACA,0CAA0C,OAAO;AACjD,SAAS,qDAAQ;AACjB;AACA;AACA,WAAW,qDAAQ;AACnB;AACA;AACA;AACA;AACA,6DAA6D,8CAAQ;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,WAAW,4DAAe;AAC1B;;AAEA;AACA;AACA;;AAEA;AACA,qBAAqB,6CAAO,aAAa,6CAAO;AAChD;;AAEA,6BAAe,oCAAS;AACxB;AACA;AACA;AACA;;;;;;;;;;;;;;;;AChGiC;;AAEjC;AACA,cAAc;;AAEd,6BAAe,oCAAS;AACxB;AACA;AACA,SAAS,mDAAM;AACf;;;;;;;;;;;;;;;;;;ACT+B;AACc;;AAE7C;AACA,UAAU,iDAAK,UAAU,6CAAO;AAChC,uBAAuB,2BAA2B,gBAAgB;AAClE;;AAEA;AACA,UAAU,iDAAK,UAAU,6CAAO;AAChC,uBAAuB,2BAA2B,gBAAgB;AAClE;;AAEe;AACf;AACA;AACA;AACA;AACA;;AAEA;AACA,YAAY;AACZ;;AAEA;AACA,WAAW,iDAAK,C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AsB,2CAAK;AAC3B,GAAG;AACH;AACA;AACA,kBAAkB,2CAAK;AACvB;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,iEAAe,UAAU,EAAC;;;;;;;;;;;;;;;;ACjDI;;AAE9B;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,6CAAI;AACjB,WAAW,6CAAI;AACf,gBAAgB,6CAAI;AACpB,cAAc,6CAAI;AAClB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,iEAAe,YAAY,EAAC;;;;;;;;;;;;;;;;AC3BI;;AAEhC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,oCAAoC,8CAAI;AACxC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,UAAU,8CAAI;;AAEd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,iEAAe,cAAc,EAAC;;;;;;;;;;;;;;;;;ACnGC;AACD;;AAEf;AACf;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,yCAAG;AACpD;AACA;AACA;AACA,GAAG;AACH,UAAU,6CAAI;AACd;;;;;;;;;;;;;;;;;;;;;;;AC5CsC;AACJ;AACD;AACI;AACI;AACF;AACA;AACF;;AAErC,6BAAe,oCAAS;AACxB;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAM,mDAAM;AACZ;AACA;AACA;;AAEA;AACA,IAAI,mDAAM,0BAA0B,6CAAQ;AAC5C,WAAW,oDAAe;AAC1B;;AAEA;AACA,IAAI,mDAAM,0BAA0B,gDAAW;AAC/C,WAAW,uDAAkB;AAC7B;;AAEA;AACA,IAAI,mDAAM,0BAA0B,+CAAU;AAC9C,WAAW,sDAAiB;AAC5B;;AAEA;AACA,IAAI,mDAAM,0BAA0B,iDAAY;AAChD,WAAW,wDAAmB;AAC9B;;AAEA;AACA,kFAAkF,iDAAQ;AAC1F;;AAEA;AACA;AACA,qDAAqD,+CAAU,QAAQ,gDAAW;AAClF;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;;;;;;;;;;;AC5D+B;AACC;AACF;;AAE9B,oBAAoB,2CAAK;AACzB;AACA;AACA;AACA;AACA;;AAEA;AACA,SAAS,6CAAI;AACb;AACA;AACA,GAAG;AACH;AACA;AACA,yBAAyB,6CAAI;AAC7B,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;AACA,oBAAoB,2CAAK;AACzB;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,gBAAgB,8CAAI;AACpB;AACA;;AAEA,iEAAe,YAAY,EAAC;;;;;;;;;;;;;;;AC5Cb;AACf;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;AC1DuC;;AAEvC,6BAAe,oCAAS;AACxB,SAAS,6CAAG,gBAAgB,6C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CK;AACX;;AAE7B;AACP,WAAW,6CAAG,SAAS,6CAAG;AAC1B,eAAe,6CAAG,SAAS,6CAAG;AAC9B;;AAEA,qBAAqB,8DAAe,CAAC,0CAAI;;AAEzC,6BAAe,sCAAW;AAC1B,SAAS,kDAAU;AACnB;AACA;AACA;;;;;;;;;;;;;;;;;;;;ACfiD;AACX;AACM;AACqB;AACX;;AAEtD,6BAAe,sCAAW;AAC1B;AACA;AACA;AACA;AACA,kBAAkB,0DAAW;AAC7B;AACA;AACA;AACA;AACA,OAAO;AACP,iBAAiB,iDAAQ;AACzB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iFAAiF,iDAAQ,IAAI,2DAAa;AAC1G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,6CAAO,OAAO,6CAAG,cAAc,6CAAG,4BAA4B,6CAAO;AACtH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,kDAAS;AACpB;AACA;AACA,WAAW,gDAAO;AAClB;AACA;AACA,WAAW,iDAAQ;AACnB;AACA;AACA,WAAW,kDAAS;AACpB;;AAEA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;ACpFuD;AACZ;AACM;AACb;AACE;AACsB;AACf;AACD;AACqB;AAC5B;;AAErC,uBAAuB,0DAAW;AAClC;AACA,0BAA0B,6CAAO,MAAM,6CAAO;AAC9C;AACA,CAAC;;AAED;AACA,SAAS,0DAAW;AACpB;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,iBAAiB,6CAAG;AACpB,iBAAiB,6CAAG;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;;AAEe;AACf,wCAAwC,iBAAiB;AACzD;;AAEO;AACP;AACA;AA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6BAA6B,6CAAO,oBAAoB,6CAAO;AAC/D;;AAEA;AACA;;;;;;;;;;;;;;;AC3EA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,6BAAe,oCAAS;AACxB;AACA;AACA,IAAI;AACJ;AACA;AACA;;;;;;;;;;;;;;;;ACpEA,6BAAe,oCAAS;AACxB;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,0BAA0B,0BAA0B;AACpD,uBAAuB,uBAAuB;AAC9C,0BAA0B,0BAA0B;AACpD,wBAAwB,wBAAwB;AAChD,6BAA6B,6BAA6B;AAC1D,2BAA2B;AAC3B;;;;;;;;;;;ACzBa;;AAEb,YAAY,mBAAO,CAAC,sBAAW;;AAE/B,0CAA0C;;AAE1C;AACA,sBAAsB;;AAEtB;AACA;;AAEA;AACA;AACA,oBAAoB,uBAAuB;AAC3C;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,uBAAuB,UAAU;AACjC,2BAA2B,UAAU;AACrC;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,gBAAgB;AAChB,gBAAgB;AAChB,gBAAgB;AAChB,gDAAgD;AAChD,6CAA6C;AAC7C;;AAEA;AACA;AACA;AACA;;AAEA,oBAAoB,oBAAoB;AACxC;;AAEA,wDAAwD,SAAS;AACjE;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,sDAAsD,SAAS;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA,UAAU;AACV;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;;;;;;;;;;AClKe;AACf;AACA;AACA;AACA;;AAEA;AACA,iDAAiD,QAAQ;AACzD;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,eAAe,eAAe;AAC9B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,eAAe,eAAe;AAC9B;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA","sources":["./node_modules/@amcharts/amcharts4-geodata/usaLow.js","./node_modules/@amcharts/amcharts4/.internal/charts/Chart.js","./node_modules/@amcharts/amcharts4/.internal/charts/Legend.js","./node_modules/@amcharts/amcharts4/.internal/charts/axes/Axis.js","./node_modules/@amcharts/amcharts4/.internal/charts/axes/AxisBreak.js","./node_modules/@amcharts/amcharts4/.internal/charts/axes/AxisBullet.js","./node_modules/@amcharts/amcharts4/.internal/charts/axes/AxisFill.js","./node_modules/@amcharts/amcharts4/.internal/charts/axes/AxisLabel.js","./node_modules/@amcharts/amcharts4/.internal/charts/axes/AxisLine.js","./node_modules/@amcharts/amcharts4/.internal/charts/axes/AxisRenderer.js","./node_modules/@amcharts/amcharts4/.internal/charts/axes/AxisRendererX.js","./node_modules/@amcharts/amcharts4/.internal/charts/axes/AxisRendererY.js","./node_modules/@amcharts/amcharts4/.internal/charts/axes/AxisTick.js","./node_modules/@amcharts/amcharts4/.internal/charts/axes/Grid.js","./node_modules/@amcharts/amcharts4/.internal/charts/axes/ValueAxis.js","./node_modules/@amcharts/amcharts4/.internal/charts/axes/ValueAxisBreak.js","./node_modules/@amcharts/amcharts4/.internal/charts/elements/Bullet.js","./node_modules/@amcharts/amcharts4/.internal/charts/elements/HeatLegend.js","./node_modules/@amcharts/amcharts4/.internal/charts/elements/Tick.js","./node_modules/@amcharts/amcharts4/.internal/charts/map/Geo.js","./node_modules/@amcharts/amcharts4/.internal/charts/map/Graticule.js","./node_modules/@amcharts/amcharts4/.internal/charts/map/GraticuleSeries.js","./node_modules/@amcharts/amcharts4/.internal/charts/map/MapArc.js","./node_modules/@amcharts/amcharts4/.internal/charts/map/MapArcSeries.js","./node_modules/@amcharts/amcharts4/.internal/charts/map/MapImage.js","./node_modules/@amcharts/amcharts4/.internal/charts/map/MapImageSeries.js","./node_modules/@amcharts/amcharts4/.internal/charts/map/MapLine.js","./node_modules/@amcharts/amcharts4/.internal/charts/map/MapLineObject.js","./node_modules/@amcharts/amcharts4/.internal/charts/map/MapLineSeries.js","./node_modules/@amcharts/amcharts4/.internal/charts/map/MapObject.js","./node_modules/@amcharts/amcharts4/.internal/charts/map/MapPolygon.js","./node_modules/@amcharts/amcharts4/.internal/charts/map/MapPolygonSeries.js","./node_modules/@amcharts/amcharts4/.internal/charts/map/MapSeries.js","./node_modules/@amcharts/amcharts4/.internal/charts/map/MapSpline.js","./node_modules/@amcharts/amcharts4/.internal/charts/map/MapSplineSeries.js","./node_modules/@amcharts/amcharts4/.internal/charts/map/MapUtils.js","./node_modules/@amcharts/amcharts4/.internal/charts/map/SmallMap.js","./node_modules/@amcharts/amcharts4/.internal/charts/map/ZoomControl.js","./node_modules/@amcharts/amcharts4/.internal/charts/map/projections.js","./node_modules/@amcharts/amcharts4/.internal/charts/map/projections/Albers.js","./node_modules/@amcharts/amcharts4/.internal/charts/map/projections/AlbersUsa.js","./node_modules/@amcharts/amcharts4/.internal/charts/map/projections/AzimuthalEqualArea.js","./node_modules/@amcharts/amcharts4/.internal/charts/map/projections/Eckert6.js","./node_modules/@amcharts/amcharts4/.internal/charts/map/projections/EqualEarth.js","./node_modules/@amcharts/amcharts4/.internal/charts/map/projections/Mercator.js","./node_modules/@amcharts/amcharts4/.internal/charts/map/projections/Miller.js","./node_modules/@amcharts/amcharts4/.internal/charts/map/projections/NaturalEarth1.js","./node_modules/@amcharts/amcharts4/.internal/charts/map/projections/Orthographic.js","./node_modules/@amcharts/amcharts4/.internal/charts/map/projections/Projection.js","./node_modules/@amcharts/amcharts4/.internal/charts/map/projections/Stereographic.js","./node_modules/@amcharts/amcharts4/.internal/charts/series/Series.js","./node_modules/@amcharts/amcharts4/.internal/charts/types/MapChart.js","./node_modules/@amcharts/amcharts4/.internal/charts/types/SerialChart.js","./node_modules/@amcharts/amcharts4/.internal/core/Base.js","./node_modules/@amcharts/amcharts4/.internal/core/Component.js","./node_modules/@amcharts/amcharts4/.internal/core/Container.js","./node_modules/@amcharts/amcharts4/.internal/core/DataItem.js","./node_modules/@amcharts/amcharts4/.internal/core/Options.js","./node_modules/@amcharts/amcharts4/.internal/core/Registry.js","./node_modules/@amcharts/amcharts4/.internal/core/Sprite.js","./node_modules/@amcharts/amcharts4/.internal/core/SpriteEvents.js","./node_modules/@amcharts/amcharts4/.internal/core/SpriteState.js","./node_modules/@amcharts/amcharts4/.internal/core/System.js","./node_modules/@amcharts/amcharts4/.internal/core/data/CSVParser.js","./node_modules/@amcharts/amcharts4/.internal/core/data/DataLoader.js","./node_modules/@amcharts/amcharts4/.internal/core/data/DataParser.js","./node_modules/@amcharts/amcharts4/.internal/core/data/DataSource.js","./node_modules/@amcharts/amcharts4/.internal/core/data/JSONParser.js","./node_modules/@amcharts/amcharts4/.internal/core/defs/SVGDefaults.js","./node_modules/@amcharts/amcharts4/.internal/core/elements/3d/Cone.js","./node_modules/@amcharts/amcharts4/.internal/core/elements/3d/Rectangle3D.js","./node_modules/@amcharts/amcharts4/.internal/core/elements/3d/Slice3D.js","./node_modules/@amcharts/amcharts4/.internal/core/elements/AmChartsLogo.js","./node_modules/@amcharts/amcharts4/.internal/core/elements/Button.js","./node_modules/@amcharts/amcharts4/.internal/core/elements/Circle.js","./node_modules/@amcharts/amcharts4/.internal/core/elements/CloseButton.js","./node_modules/@amcharts/amcharts4/.internal/core/elements/Ellipse.js","./node_modules/@amcharts/amcharts4/.internal/core/elements/Grip.js","./node_modules/@amcharts/amcharts4/.internal/core/elements/Image.js","./node_modules/@amcharts/amcharts4/.internal/core/elements/Label.js","./node_modules/@amcharts/amcharts4/.internal/core/elements/Line.js","./node_modules/@amcharts/amcharts4/.internal/core/elements/Modal.js","./node_modules/@amcharts/amcharts4/.internal/core/elements/PlayButton.js","./node_modules/@amcharts/amcharts4/.internal/core/elements/PointedRectangle.js","./node_modules/@amcharts/amcharts4/.internal/core/elements/PointedShape.js","./node_modules/@amcharts/amcharts4/.internal/core/elements/Polyarc.js","./node_modules/@amcharts/amcharts4/.internal/core/elements/Polygon.js","./node_modules/@amcharts/amcharts4/.internal/core/elements/Polyline.js","./node_modules/@amcharts/amcharts4/.internal/core/elements/Polyspline.js","./node_modules/@amcharts/amcharts4/.internal/core/elements/Popup.js","./node_modules/@amcharts/amcharts4/.internal/core/elements/PopupCSS.js","./node_modules/@amcharts/amcharts4/.internal/core/elements/Preloader.js","./node_modules/@amcharts/amcharts4/.internal/core/elements/Rectangle.js","./node_modules/@amcharts/amcharts4/.internal/core/elements/ResizeButton.js","./node_modules/@amcharts/amcharts4/.internal/core/elements/RoundedRectangle.js","./node_modules/@amcharts/amcharts4/.internal/core/elements/Scrollbar.js","./node_modules/@amcharts/amcharts4/.internal/core/elements/Slice.js","./node_modules/@amcharts/amcharts4/.internal/core/elements/Slider.js","./node_modules/@amcharts/amcharts4/.internal/core/elements/SwitchButton.js","./node_modules/@amcharts/amcharts4/.internal/core/elements/TextLink.js","./node_modules/@amcharts/amcharts4/.internal/core/elements/Tooltip.js","./node_modules/@amcharts/amcharts4/.internal/core/elements/Trapezoid.js","./node_modules/@amcharts/amcharts4/.internal/core/elements/Triangle.js","./node_modules/@amcharts/amcharts4/.internal/core/elements/WavedCircle.js","./node_modules/@amcharts/amcharts4/.internal/core/elements/WavedLine.js","./node_modules/@amcharts/amcharts4/.internal/core/elements/WavedRectangle.js","./node_modules/@amcharts/amcharts4/.internal/core/elements/ZoomOutButton.js","./node_modules/@amcharts/amcharts4/.internal/core/export/Export.js","./node_modules/@amcharts/amcharts4/.internal/core/export/ExportCSS.js","./node_modules/@amcharts/amcharts4/.internal/core/export/ExportMenu.js","./node_modules/@amcharts/amcharts4/.internal/core/formatters/DateFormatter.js","./node_modules/@amcharts/amcharts4/.internal/core/formatters/DurationFormatter.js","./node_modules/@amcharts/amcharts4/.internal/core/formatters/NumberFormatter.js","./node_modules/@amcharts/amcharts4/.internal/core/formatters/TextFormatter.js","./node_modules/@amcharts/amcharts4/.internal/core/interaction/Inertia.js","./node_modules/@amcharts/amcharts4/.internal/core/interaction/Interaction.js","./node_modules/@amcharts/amcharts4/.internal/core/interaction/InteractionKeyboardObject.js","./node_modules/@amcharts/amcharts4/.internal/core/interaction/InteractionObject.js","./node_modules/@amcharts/amcharts4/.internal/core/interaction/InteractionObjectEvents.js","./node_modules/@amcharts/amcharts4/.internal/core/interaction/Mouse.js","./node_modules/@amcharts/amcharts4/.internal/core/rendering/AMElement.js","./node_modules/@amcharts/amcharts4/.internal/core/rendering/Group.js","./node_modules/@amcharts/amcharts4/.internal/core/rendering/Paper.js","./node_modules/@amcharts/amcharts4/.internal/core/rendering/Path.js","./node_modules/@amcharts/amcharts4/.internal/core/rendering/SVGContainer.js","./node_modules/@amcharts/amcharts4/.internal/core/rendering/Smoothing.js","./node_modules/@amcharts/amcharts4/.internal/core/rendering/fills/CirclePattern.js","./node_modules/@amcharts/amcharts4/.internal/core/rendering/fills/ColorModifier.js","./node_modules/@amcharts/amcharts4/.internal/core/rendering/fills/GradientModifier.js","./node_modules/@amcharts/amcharts4/.internal/core/rendering/fills/LinePattern.js","./node_modules/@amcharts/amcharts4/.internal/core/rendering/fills/LinearGradient.js","./node_modules/@amcharts/amcharts4/.internal/core/rendering/fills/LinearGradientModifier.js","./node_modules/@amcharts/amcharts4/.internal/core/rendering/fills/Pattern.js","./node_modules/@amcharts/amcharts4/.internal/core/rendering/fills/RadialGradient.js","./node_modules/@amcharts/amcharts4/.internal/core/rendering/fills/RadialGradientModifier.js","./node_modules/@amcharts/amcharts4/.internal/core/rendering/fills/RectPattern.js","./node_modules/@amcharts/amcharts4/.internal/core/rendering/filters/BlurFilter.js","./node_modules/@amcharts/amcharts4/.internal/core/rendering/filters/ColorizeFilter.js","./node_modules/@amcharts/amcharts4/.internal/core/rendering/filters/DesaturateFilter.js","./node_modules/@amcharts/amcharts4/.internal/core/rendering/filters/DropShadowFilter.js","./node_modules/@amcharts/amcharts4/.internal/core/rendering/filters/Filter.js","./node_modules/@amcharts/amcharts4/.internal/core/rendering/filters/FocusFilter.js","./node_modules/@amcharts/amcharts4/.internal/core/rendering/filters/LightenFilter.js","./node_modules/@amcharts/amcharts4/.internal/core/utils/Adapter.js","./node_modules/@amcharts/amcharts4/.internal/core/utils/Animation.js","./node_modules/@amcharts/amcharts4/.internal/core/utils/Array.js","./node_modules/@amcharts/amcharts4/.internal/core/utils/AsyncPending.js","./node_modules/@amcharts/amcharts4/.internal/core/utils/Browser.js","./node_modules/@amcharts/amcharts4/.internal/core/utils/Cache.js","./node_modules/@amcharts/amcharts4/.internal/core/utils/Color.js","./node_modules/@amcharts/amcharts4/.internal/core/utils/ColorSet.js","./node_modules/@amcharts/amcharts4/.internal/core/utils/Colors.js","./node_modules/@amcharts/amcharts4/.internal/core/utils/DOM.js","./node_modules/@amcharts/amcharts4/.internal/core/utils/Dictionary.js","./node_modules/@amcharts/amcharts4/.internal/core/utils/Disposer.js","./node_modules/@amcharts/amcharts4/.internal/core/utils/Ease.js","./node_modules/@amcharts/amcharts4/.internal/core/utils/EventDispatcher.js","./node_modules/@amcharts/amcharts4/.internal/core/utils/Instance.js","./node_modules/@amcharts/amcharts4/.internal/core/utils/InterfaceColorSet.js","./node_modules/@amcharts/amcharts4/.internal/core/utils/Iterator.js","./node_modules/@amcharts/amcharts4/.internal/core/utils/Keyboard.js","./node_modules/@amcharts/amcharts4/.internal/core/utils/Language.js","./node_modules/@amcharts/amcharts4/.internal/core/utils/List.js","./node_modules/@amcharts/amcharts4/.internal/core/utils/Log.js","./node_modules/@amcharts/amcharts4/.internal/core/utils/Math.js","./node_modules/@amcharts/amcharts4/.internal/core/utils/Morpher.js","./node_modules/@amcharts/amcharts4/.internal/core/utils/Net.js","./node_modules/@amcharts/amcharts4/.internal/core/utils/Number.js","./node_modules/@amcharts/amcharts4/.internal/core/utils/Object.js","./node_modules/@amcharts/amcharts4/.internal/core/utils/Order.js","./node_modules/@amcharts/amcharts4/.internal/core/utils/PatternSet.js","./node_modules/@amcharts/amcharts4/.internal/core/utils/Percent.js","./node_modules/@amcharts/amcharts4/.internal/core/utils/Plugin.js","./node_modules/@amcharts/amcharts4/.internal/core/utils/ResizeSensor.js","./node_modules/@amcharts/amcharts4/.internal/core/utils/Responsive.js","./node_modules/@amcharts/amcharts4/.internal/core/utils/SortedList.js","./node_modules/@amcharts/amcharts4/.internal/core/utils/String.js","./node_modules/@amcharts/amcharts4/.internal/core/utils/Strings.js","./node_modules/@amcharts/amcharts4/.internal/core/utils/Time.js","./node_modules/@amcharts/amcharts4/.internal/core/utils/Type.js","./node_modules/@amcharts/amcharts4/.internal/core/utils/Utils.js","./node_modules/@amcharts/amcharts4/.internal/core/utils/Validatable.js","./node_modules/@amcharts/amcharts4/.internal/themes/animated.js","./node_modules/@amcharts/amcharts4/core.js","./node_modules/@amcharts/amcharts4/lang/en.js","./node_modules/@amcharts/amcharts4/maps.js","./node_modules/@amcharts/amcharts4/themes/animated.js","./node_modules/d3-array/src/fsum.js","./node_modules/d3-array/src/merge.js","./node_modules/d3-array/src/range.js","./node_modules/d3-geo-projection/src/eckert6.js","./node_modules/d3-geo-projection/src/math.js","./node_modules/d3-geo-projection/src/miller.js","./node_modules/d3-geo/src/area.js","./node_modules/d3-geo/src/bounds.js","./node_modules/d3-geo/src/cartesian.js","./node_modules/d3-geo/src/centroid.js","./node_modules/d3-geo/src/circle.js","./node_modules/d3-geo/src/clip/antimeridian.js","./node_modules/d3-geo/src/clip/buffer.js","./node_modules/d3-geo/src/clip/circle.js","./node_modules/d3-geo/src/clip/extent.js","./node_modules/d3-geo/src/clip/index.js","./node_modules/d3-geo/src/clip/line.js","./node_modules/d3-geo/src/clip/rectangle.js","./node_modules/d3-geo/src/clip/rejoin.js","./node_modules/d3-geo/src/compose.js","./node_modules/d3-geo/src/constant.js","./node_modules/d3-geo/src/contains.js","./node_modules/d3-geo/src/distance.js","./node_modules/d3-geo/src/graticule.js","./node_modules/d3-geo/src/identity.js","./node_modules/d3-geo/src/index.js","./node_modules/d3-geo/src/interpolate.js","./node_modules/d3-geo/src/length.js","./node_modules/d3-geo/src/math.js","./node_modules/d3-geo/src/noop.js","./node_modules/d3-geo/src/path/area.js","./node_modules/d3-geo/src/path/bounds.js","./node_modules/d3-geo/src/path/centroid.js","./node_modules/d3-geo/src/path/context.js","./node_modules/d3-geo/src/path/index.js","./node_modules/d3-geo/src/path/measure.js","./node_modules/d3-geo/src/path/string.js","./node_modules/d3-geo/src/pointEqual.js","./node_modules/d3-geo/src/polygonContains.js","./node_modules/d3-geo/src/projection/albers.js","./node_modules/d3-geo/src/projection/albersUsa.js","./node_modules/d3-geo/src/projection/azimuthal.js","./node_modules/d3-geo/src/projection/azimuthalEqualArea.js","./node_modules/d3-geo/src/projection/azimuthalEquidistant.js","./node_modules/d3-geo/src/projection/conic.js","./node_modules/d3-geo/src/projection/conicConformal.js","./node_modules/d3-geo/src/projection/conicEqualArea.js","./node_modules/d3-geo/src/projection/conicEquidistant.js","./node_modules/d3-geo/src/projection/cylindricalEqualArea.js","./node_modules/d3-geo/src/projection/equalEarth.js","./node_modules/d3-geo/src/projection/equirectangular.js","./node_modules/d3-geo/src/projection/fit.js","./node_modules/d3-geo/src/projection/gnomonic.js","./node_modules/d3-geo/src/projection/identity.js","./node_modules/d3-geo/src/projection/index.js","./node_modules/d3-geo/src/projection/mercator.js","./node_modules/d3-geo/src/projection/naturalEarth1.js","./node_modules/d3-geo/src/projection/orthographic.js","./node_modules/d3-geo/src/projection/resample.js","./node_modules/d3-geo/src/projection/stereographic.js","./node_modules/d3-geo/src/projection/transverseMercator.js","./node_modules/d3-geo/src/rotation.js","./node_modules/d3-geo/src/stream.js","./node_modules/d3-geo/src/transform.js","./node_modules/polylabel/polylabel.js","./node_modules/tinyqueue/index.js"],"sourcesContent":["var map = { \"type\": \"FeatureCollection\", \"features\": [\r\n { \"type\": \"Feature\", \"geometry\": { \"type\": \"MultiPolygon\", \"coordinates\": [[[[-134.6803, 58.1617], [-134.2401, 58.1441], [-134.3069, 58.0344], [-134.2671, 57.8845], [-133.937, 57.5816], [-133.9737, 57.4513], [-133.9253, 57.3368], [-134.1, 57.3001], [-134.2602, 57.1468], [-134.4353, 57.057], [-134.5915, 57.0919], [-134.4868, 57.482], [-134.6599, 57.6381], [-134.8369, 58.3201], [-134.6803, 58.1617]]], [[[-174.6774, 52.035], [-175.1176, 52.047], [-174.3061, 52.2161], [-174.4355, 52.3172], [-174.1689, 52.4202], [-174.0184, 52.3318], [-174.1206, 52.1352], [-174.3435, 52.0778], [-174.6774, 52.035]]], [[[-172.7422, 60.4575], [-172.5261, 60.3918], [-172.6358, 60.3288], [-173.074, 60.4932], [-172.8602, 60.5057], [-172.7422, 60.4575]]], [[[-176.5933, 51.8667], [-176.4373, 51.7543], [-176.7709, 51.6299], [-176.8744, 51.7905], [-176.7364, 51.84], [-176.6984, 51.986], [-176.5499, 51.9441], [-176.5933, 51.8667]]], [[[-165.8416, 54.0707], [-166.0364, 54.0472], [-166.0877, 54.1691], [-165.8928, 54.207], [-165.7042, 54.1199], [-165.8416, 54.0707]]], [[[-171.463, 63.64], [-171.0349, 63.5855], [-170.4304, 63.6988], [-170.1218, 63.6175], [-170.0174, 63.4917], [-169.6242, 63.4305], [-169.4276, 63.3483], [-168.996, 63.3473], [-168.716, 63.3106], [-168.8524, 63.1712], [-169.3647, 63.1711], [-169.6763, 62.9561], [-169.7778, 63.0938], [-170.1896, 63.1963], [-170.2727, 63.2843], [-170.5271, 63.3793], [-170.8484, 63.4444], [-171.0613, 63.4459], [-171.4012, 63.3392], [-171.6318, 63.3512], [-171.791, 63.4247], [-171.7464, 63.7031], [-171.463, 63.64]]], [[[-147.6583, 60.4505], [-147.7321, 60.222], [-147.8714, 60.2297], [-147.7945, 60.4599], [-147.6583, 60.4505]]], [[[-152.4169, 58.3602], [-152.3163, 58.4135], [-151.9825, 58.2443], [-152.1091, 58.1612], [-152.5377, 58.101], [-152.7815, 58.016], [-152.9826, 57.9971], [-153.3813, 58.0872], [-152.9762, 58.2969], [-152.7719, 58.2786], [-152.8411, 58.4164], [-152.6747, 58.4505], [-152.4169, 58.3602]]], [[[-134.9697, 57.3515], [-134.8232, 57.1565], [-134.6207, 56.7183], [-134.6571, 56.5233], [-134.6301, 56.3025], [-134.7503, 56.2408], [-134.9806, 56.5189], [-135.0178, 56.6601], [-135.159, 56.7254], [-135.1631, 56.8241], [-135.3306, 56.8218], [-135.3151, 56.9318], [-135.1996, 57.0273], [-135.3413, 57.0816], [-135.3753, 57.1885], [-135.5019, 57.2438], [-135.6089, 57.0715], [-135.7677, 57.1004], [-135.7871, 57.3172], [-135.5805, 57.39], [-135.4872, 57.5164], [-135.3463, 57.5332], [-134.9697, 57.3515]]], [[[-159.873, 55.1287], [-160.0384, 55.0445], [-160.1721, 55.1231], [-159.8983, 55.2213], [-159.873, 55.1287]]], [[[-141.0022, 69.6508], [-141.0022, 68.7742], [-141.0022, 68.1897], [-141.0022, 67.3132], [-141.0022, 66.1443], [-141.0022, 65.5599], [-141.0022, 64.3911], [-141.0022, 63.2223], [-141.0022, 62.0535], [-141.0022, 61.1768], [-141.0022, 60.3002], [-140.5254, 60.2183], [-140.4529, 60.2998], [-139.9733, 60.1832], [-139.6763, 60.3283], [-139.0793, 60.3436], [-139.1852, 60.0835], [-139.0434, 59.9933], [-138.7054, 59.9013], [-138.6323, 59.7783], [-137.5933, 59.2262], [-137.4386, 58.9032], [-137.2776, 58.9882], [-136.8133, 59.15], [-136.5788, 59.1523], [-136.4667, 59.28], [-136.4664, 59.4591], [-136.2472, 59.533], [-136.3218, 59.6048], [-135.9347, 59.6627], [-135.4759, 59.7932], [-135.051, 59.5786], [-135.0713, 59.4414], [-134.9437, 59.2882], [-134.4407, 59.0854], [-134.2185, 58.8498], [-133.8207, 58.705], [-133.4011, 58.4109], [-133.4226, 58.337], [-133.2753, 58.2229], [-132.5505, 57.4999], [-132.2322, 57.1986], [-132.3379, 57.0794], [-132.0315, 57.0265], [-132.1043, 56.8568], [-131.8662, 56.7929], [-131.8243, 56.5899], [-131.5751, 56.5988], [-131.0829, 56.4048], [-130.7416, 56.3408], [-130.6491, 56.2637], [-130.4771, 56.2306], [-130.4132, 56.1225], [-130.0229, 56.0145], [-130.0251, 55.8883], [-130.1465, 55.6545], [-130.0365, 55.2979], [-130.2141, 55.0259], [-130.4932, 54.8342], [-130.6158, 54.7909], [-130.8496, 54.8076], [-131.0478, 55.1577], [-130.856, 55.3551], [-130.9185, 55.736], [-131.1277, 55.9601], [-131.2876, 56.0121], [-131.7842, 55.8765], [-131.8694, 55.6472], [-131.9834, 55.535], [-132.119, 55.5697], [-132.2234, 55.7211], [-132.0058, 55.9301], [-131.8438, 56.16], [-132.0219, 56.3801], [-132.182, 56.4206], [-132.3577, 56.6258], [-132.476, 56.6497], [-132.4871, 56.7664], [-132.6395, 56.7964], [-132.8022, 56.8951], [-132.8143, 57.0406], [-133.4658, 57.1721], [-133.4367, 57.3368], [-133.539, 57.5542], [-133.6487, 57.6423], [-133.5542, 57.6951], [-133.1171, 57.5662], [-133.6573, 57.841], [-133.7441, 57.8546], [-134.0311, 58.0722], [-134.0633, 58.2111], [-134.2088, 58.2329], [-134.4854, 58.3672], [-134.6636, 58.3847], [-134.7761, 58.4538], [-134.9425, 58.6463], [-134.9648, 58.7422], [-135.1319, 58.8428], [-135.2174, 59.0766], [-135.3303, 59.2391], [-135.5023, 59.2024], [-135.3862, 59.0876], [-135.334, 58.9096], [-135.0497, 58.3068], [-135.1415, 58.2335], [-135.3025, 58.2559], [-135.5718, 58.412], [-135.8735, 58.3942], [-135.8617, 58.5771], [-136.0455, 58.7891], [-136.2258, 58.7655], [-136.4511, 58.8463], [-136.5662, 58.9409], [-136.831, 58.9838], [-136.8791, 58.8815], [-136.5682, 58.7863], [-136.4101, 58.7006], [-136.4838, 58.6177], [-136.2246, 58.6023], [-136.1029, 58.5063], [-136.1296, 58.3504], [-136.4624, 58.3279], [-136.5826, 58.2453], [-137.072, 58.3951], [-137.544, 58.5812], [-137.75, 58.7071], [-138.0269, 58.9414], [-138.3525, 59.0873], [-139.3409, 59.3757], [-139.7991, 59.5463], [-139.6116, 59.6103], [-139.5056, 59.7263], [-139.5822, 59.8484], [-139.5189, 60.0172], [-139.8502, 59.8307], [-140.2167, 59.7266], [-140.4199, 59.7107], [-140.8432, 59.7488], [-141.4083, 59.9028], [-141.2946, 59.98], [-141.3295, 60.0828], [-141.6702, 59.9698], [-142.5486, 60.0861], [-142.9457, 60.097], [-143.5061, 60.055], [-143.805, 60.0129], [-144.1472, 60.0163], [-144.0885, 60.0843], [-144.3326, 60.191], [-144.643, 60.2246], [-144.9013, 60.3351], [-144.8245, 60.5336], [-144.984, 60.537], [-145.2483, 60.3801], [-145.8989, 60.4782], [-145.6749, 60.6511], [-146.1491, 60.6607], [-146.251, 60.7491], [-146.6385, 60.8973], [-146.5828, 61.1278], [-146.874, 61.0048], [-147.255, 60.9782], [-147.321, 60.9255], [-147.5926, 60.9795], [-147.6557, 60.9095], [-147.8911, 60.8899], [-148.0052, 60.9686], [-147.8448, 61.1864], [-148.2086, 61.0299], [-148.3444, 60.8536], [-148.5574, 60.8029], [-148.2679, 60.6997], [-148.2964, 60.532], [-148.0507, 60.5671], [-147.9641, 60.4849], [-148.1817, 60.393], [-148.1976, 60.1678], [-148.3331, 60.122], [-148.4307, 59.9892], [-148.8427, 59.9512], [-149.1216, 60.0335], [-149.4323, 60.0011], [-149.5491, 59.8943], [-149.7948, 59.8559], [-149.7825, 59.7503], [-150.198, 59.5666], [-150.5815, 59.5645], [-150.6775, 59.427], [-150.9608, 59.2439], [-151.3664, 59.2456], [-151.7382, 59.1885], [-151.9641, 59.2852], [-151.8499, 59.4064], [-151.3996, 59.5164], [-151.1894, 59.6377], [-151.7638, 59.7], [-151.8532, 59.7821], [-151.7345, 59.9884], [-151.4515, 60.2027], [-151.3127, 60.4665], [-151.3218, 60.7429], [-150.9538, 60.8413], [-150.4413, 61.0236], [-149.9975, 60.9352], [-149.6325, 60.9519], [-149.1728, 60.8805], [-149.1422, 60.9357], [-149.5925, 60.9939], [-149.9677, 61.1218], [-149.9452, 61.2943], [-150.4718, 61.26], [-150.6123, 61.3012], [-150.9455, 61.1982], [-151.1502, 61.0859], [-151.5935, 60.9796], [-151.734, 60.9108], [-151.7504, 60.7549], [-151.9962, 60.6822], [-152.2707, 60.5281], [-152.2603, 60.4095], [-152.3689, 60.3364], [-152.6539, 60.2385], [-152.6286, 60.0411], [-152.7595, 59.9209], [-153.106, 59.8751], [-153.0482, 59.73], [-153.364, 59.6598], [-153.4144, 59.7402], [-153.8141, 59.4737], [-154.0883, 59.3634], [-154.1783, 59.1556], [-154.1298, 59.1198], [-153.6564, 59.0386], [-153.4183, 58.9599], [-153.3344, 58.8579], [-153.6173, 58.6547], [-153.8619, 58.5878], [-154.0199, 58.4929], [-154.0859, 58.3658], [-154.2081, 58.2887], [-154.247, 58.1594], [-154.5706, 58.118], [-154.5849, 58.0556], [-155.0069, 58.0161], [-155.0993, 57.9133], [-155.3128, 57.8071], [-155.5903, 57.7336], [-155.7779, 57.5683], [-156.0002, 57.545], [-156.0554, 57.4476], [-156.2422, 57.4493], [-156.4784, 57.3279], [-156.3976, 57.2406], [-156.4751, 57.1052], [-156.629, 57.0099], [-156.7799, 57.0057], [-157.2058, 56.812], [-157.3902, 56.8099], [-157.5784, 56.6345], [-157.8691, 56.6452], [-157.9783, 56.5432], [-158.4144, 56.4358], [-158.5374, 56.3354], [-158.3861, 56.3015], [-158.2757, 56.1962], [-158.5233, 56.0724], [-158.6267, 56.1547], [-158.7898, 55.987], [-159.5232, 55.81], [-159.743, 55.8438], [-159.9623, 55.7949], [-160.4627, 55.5578], [-160.8967, 55.5136], [-161.0995, 55.4057], [-161.3819, 55.3713], [-161.4767, 55.465], [-161.3727, 55.5563], [-161.4588, 55.6291], [-161.6836, 55.53], [-161.7416, 55.3912], [-162.074, 55.1393], [-162.3329, 55.0503], [-162.5419, 55.2427], [-162.6441, 55.218], [-162.6143, 55.0714], [-162.6744, 54.9965], [-162.865, 54.9546], [-163.1196, 55.0647], [-163.1311, 54.9166], [-163.2887, 54.8376], [-163.2788, 55.1219], [-163.1145, 55.194], [-162.962, 55.1839], [-162.5133, 55.45], [-162.1571, 55.7195], [-161.6973, 55.9072], [-161.2156, 56.0214], [-160.8513, 55.7718], [-160.7584, 55.8547], [-160.3085, 55.8645], [-160.5391, 56.0063], [-160.302, 56.3142], [-159.7851, 56.5617], [-159.2831, 56.6886], [-158.9904, 56.86], [-158.6752, 56.7949], [-158.6608, 57.0394], [-158.3209, 57.2979], [-158.0457, 57.4095], [-157.8944, 57.5114], [-157.6076, 57.6015], [-157.684, 57.7439], [-157.6109, 58.0508], [-157.4427, 58.1722], [-157.5236, 58.4213], [-157.4609, 58.503], [-157.2288, 58.6409], [-156.9747, 58.7363], [-157.142, 58.8777], [-157.6657, 58.7485], [-158.0219, 58.6402], [-158.3026, 58.6418], [-158.5032, 58.8504], [-158.4256, 58.9993], [-158.5144, 59.0728], [-158.7606, 58.9501], [-158.8614, 58.7187], [-158.7721, 58.5203], [-158.7886, 58.4409], [-158.9507, 58.4046], [-159.0827, 58.4697], [-159.3583, 58.7213], [-159.6702, 58.9111], [-159.9202, 58.8199], [-160.1526, 58.9059], [-160.3631, 59.0511], [-160.8171, 58.8718], [-161.2159, 58.801], [-161.3613, 58.6695], [-161.7555, 58.6121], [-162.1449, 58.6443], [-161.8564, 58.7171], [-161.7244, 58.7943], [-161.7805, 58.8974], [-161.7945, 59.1094], [-161.9811, 59.1461], [-162.0233, 59.284], [-161.9201, 59.3654], [-161.8287, 59.5886], [-162.1382, 59.98], [-162.2425, 60.1783], [-162.4213, 60.284], [-162.1389, 60.6143], [-162.2651, 60.5953], [-162.5996, 60.297], [-162.5005, 60.1266], [-162.5707, 59.9897], [-162.7326, 59.9937], [-162.8779, 59.9228], [-163.2194, 59.8456], [-163.6804, 59.8015], [-163.9069, 59.8068], [-164.1428, 59.8968], [-164.1316, 59.9943], [-164.4705, 60.1493], [-164.6623, 60.3039], [-164.7999, 60.3073], [-165.0611, 60.4125], [-165.0265, 60.5006], [-165.3538, 60.5412], [-165.016, 60.7401], [-164.8051, 60.892], [-164.37, 60.7959], [-164.2656, 60.7247], [-163.8949, 60.7451], [-163.73, 60.5899], [-163.5287, 60.6645], [-163.421, 60.7575], [-163.6554, 60.8775], [-163.749, 60.9697], [-163.9946, 60.8647], [-164.4415, 60.8699], [-164.754, 60.9313], [-165.0657, 60.9207], [-165.1755, 60.9656], [-165.0771, 61.0942], [-165.3921, 61.2123], [-165.3808, 61.1063], [-165.5659, 61.1023], [-165.6914, 61.2999], [-165.9063, 61.4037], [-165.7971, 61.4912], [-166.1005, 61.6451], [-165.8346, 61.6793], [-166.0788, 61.8031], [-165.6128, 61.8693], [-165.7439, 62.0117], [-165.7073, 62.1005], [-165.1946, 62.4735], [-164.7927, 62.6232], [-164.8454, 62.801], [-164.6775, 63.0205], [-164.409, 63.2151], [-164.1076, 63.2617], [-163.7363, 63.1928], [-163.3588, 63.0458], [-163.0622, 63.0797], [-162.6215, 63.2658], [-162.2828, 63.5292], [-162.1125, 63.5342], [-161.974, 63.453], [-161.5054, 63.4682], [-161.0997, 63.5579], [-160.8265, 63.7293], [-160.7786, 63.8189], [-160.9876, 64.2513], [-161.2201, 64.3966], [-161.3857, 64.44], [-160.932, 64.5791], [-160.836, 64.6819], [-160.887, 64.7955], [-161.1869, 64.9241], [-161.4663, 64.7948], [-161.7594, 64.8162], [-161.8684, 64.7427], [-162.1722, 64.6781], [-162.807, 64.3742], [-162.8764, 64.5164], [-163.0517, 64.5197], [-163.1444, 64.4238], [-163.4862, 64.5498], [-163.7131, 64.5883], [-164.3039, 64.5839], [-164.8995, 64.4607], [-166.1428, 64.5828], [-166.3251, 64.6257], [-166.4814, 64.7281], [-166.4152, 64.9265], [-166.5509, 64.953], [-166.8269, 65.0961], [-166.531, 65.1547], [-166.4516, 65.2473], [-166.6654, 65.3383], [-167.404, 65.4221], [-167.9873, 65.5678], [-168.0884, 65.6578], [-167.58, 65.7583], [-167.4053, 65.8593], [-167.0742, 65.8771], [-166.7477, 66.0518], [-166.2146, 66.1703], [-165.7237, 66.1125], [-165.5602, 66.1671], [-165.8403, 66.245], [-165.7762, 66.319], [-165.4494, 66.4099], [-165.0639, 66.4378], [-164.6741, 66.555], [-164.0583, 66.6108], [-163.7755, 66.5311], [-163.9029, 66.3784], [-163.894, 66.2869], [-164.0337, 66.2156], [-163.6954, 66.0839], [-163.1715, 66.0754], [-162.8865, 66.0992], [-162.5868, 66.0509], [-162.2143, 66.071], [-161.8163, 66.0536], [-161.5569, 66.2505], [-161.2011, 66.2193], [-161.1203, 66.3343], [-161.5444, 66.4071], [-161.8281, 66.3709], [-161.8876, 66.4931], [-162.1912, 66.6932], [-162.4675, 66.7357], [-162.6075, 66.8944], [-162.3617, 66.9473], [-162.1314, 66.8014], [-161.9096, 66.5596], [-161.591, 66.4595], [-161.3359, 66.4964], [-161.0481, 66.4742], [-160.6505, 66.3731], [-160.2317, 66.4203], [-160.2625, 66.5724], [-160.6438, 66.605], [-160.864, 66.6709], [-161.398, 66.5519], [-161.8566, 66.7004], [-161.8787, 66.804], [-161.6222, 66.9793], [-161.9655, 67.0495], [-162.3915, 67.0199], [-163.0017, 67.0273], [-163.5318, 67.1025], [-163.7206, 67.1955], [-163.9427, 67.4776], [-164.1252, 67.6067], [-165.386, 68.0456], [-165.9596, 68.1559], [-166.236, 68.278], [-166.5745, 68.3203], [-166.3805, 68.4251], [-166.182, 68.7972], [-166.2091, 68.8853], [-165.5095, 68.8676], [-165.0439, 68.8825], [-164.3024, 68.9365], [-163.868, 69.0367], [-163.5356, 69.1701], [-163.1615, 69.388], [-163.0936, 69.6107], [-162.9521, 69.7581], [-161.881, 70.3318], [-161.639, 70.2346], [-160.9963, 70.3046], [-160.6341, 70.4464], [-160.1172, 70.5912], [-159.9632, 70.5682], [-160.095, 70.3333], [-159.8552, 70.3242], [-159.7463, 70.5305], [-159.9618, 70.6341], [-159.6809, 70.7868], [-159.3145, 70.8785], [-158.9963, 70.8016], [-158.4844, 70.8411], [-157.9985, 70.8453], [-157.6056, 70.9412], [-157.1953, 71.0933], [-156.7833, 71.3189], [-155.8112, 71.1885], [-155.5795, 71.1211], [-155.8043, 70.9955], [-156.1466, 70.9279], [-155.8722, 70.8346], [-155.5794, 70.8943], [-155.1669, 71.0993], [-154.9438, 71.0831], [-154.6737, 70.9871], [-154.7852, 70.8943], [-154.1953, 70.8011], [-153.9182, 70.8773], [-153.2329, 70.9326], [-152.7849, 70.876], [-152.4912, 70.881], [-152.2329, 70.8103], [-152.4705, 70.6536], [-152.1729, 70.5567], [-151.769, 70.5602], [-151.9447, 70.4521], [-151.2248, 70.4188], [-150.6627, 70.5099], [-150.4032, 70.4439], [-150.1525, 70.4437], [-149.8701, 70.5096], [-149.2695, 70.5008], [-148.6884, 70.4163], [-148.4793, 70.3179], [-148.2487, 70.3567], [-147.8695, 70.3033], [-147.7054, 70.2172], [-147.0629, 70.1704], [-146.7449, 70.1917], [-145.8232, 70.16], [-145.1974, 70.0087], [-144.6192, 69.9821], [-144.4169, 70.039], [-143.7465, 70.102], [-143.2183, 70.1162], [-142.7079, 70.0338], [-142.2969, 69.8699], [-141.6992, 69.7704], [-141.4079, 69.6534], [-141.0022, 69.6508]]], [[[-134.3127, 58.2289], [-134.594, 58.2431], [-134.52, 58.3326], [-134.3127, 58.2289]]], [[[-132.8623, 54.8944], [-132.6173, 54.8925], [-132.6469, 54.7562], [-132.8073, 54.7091], [-133.1227, 54.9698], [-133.2511, 55.1751], [-133.418, 55.2107], [-133.2966, 55.3258], [-133.0974, 55.2137], [-132.8623, 54.8944]]], [[[-160.919, 58.5771], [-161.0703, 58.5691], [-161.1315, 58.6681], [-160.9863, 58.7364], [-160.7151, 58.7953], [-160.919, 58.5771]]], [[[-167.9644, 53.345], [-168.2707, 53.2381], [-168.446, 53.0844], [-168.6986, 52.9634], [-169.0659, 52.834], [-168.7959, 53.0449], [-168.7596, 53.175], [-168.639, 53.2558], [-168.4367, 53.2569], [-168.3572, 53.4576], [-168.1931, 53.5333], [-167.9857, 53.5581], [-167.8047, 53.4849], [-167.9644, 53.345]]], [[[-166.1354, 60.3835], [-166.0436, 60.3339], [-165.7297, 60.3142], [-165.7123, 60.0694], [-165.5918, 59.9131], [-165.9467, 59.89], [-166.1876, 59.7738], [-166.343, 59.8345], [-166.6276, 59.8647], [-167.1389, 60.0085], [-167.4364, 60.2067], [-167.2517, 60.2335], [-166.8363, 60.2169], [-166.7844, 60.2965], [-166.4757, 60.3827], [-166.1354, 60.3835]]], [[[-177.1482, 51.7167], [-177.5776, 51.6942], [-177.2098, 51.8414], [-177.1482, 51.7167]]], [[[-146.394, 60.4496], [-146.1283, 60.3926], [-146.6184, 60.2737], [-146.7026, 60.4085], [-146.5603, 60.4805], [-146.394, 60.4496]]], [[[-147.7358, 59.8132], [-147.8143, 59.902], [-147.4658, 60.097], [-147.12, 60.3631], [-146.9867, 60.2544], [-147.3184, 60.0753], [-147.4993, 59.8902], [-147.7358, 59.8132]]], [[[-177.8791, 51.6497], [-178.0589, 51.6726], [-177.9864, 51.7643], [-178.1945, 51.8822], [-177.9538, 51.9184], [-177.7706, 51.7779], [-177.8791, 51.6497]]], [[[-135.7304, 58.2443], [-135.5875, 58.1468], [-135.6133, 57.9919], [-135.3466, 58.124], [-135.0021, 58.0511], [-134.928, 57.9528], [-134.9706, 57.8173], [-135.2312, 57.8158], [-135.2495, 57.7326], [-134.9789, 57.7243], [-134.8731, 57.5893], [-134.9315, 57.4811], [-135.0848, 57.511], [-135.4979, 57.6623], [-135.6086, 57.6507], [-135.6178, 57.4804], [-135.692, 57.4199], [-135.9108, 57.4465], [-136.0766, 57.6745], [-136.4599, 57.8731], [-136.5686, 57.9722], [-136.5123, 58.0959], [-136.1424, 58.1539], [-135.7871, 58.2684], [-135.7304, 58.2443]]], [[[-166.6153, 53.9009], [-166.4975, 53.8835], [-166.3724, 53.999], [-166.2309, 53.9326], [-166.4887, 53.7855], [-166.5492, 53.701], [-166.4442, 53.6518], [-166.7704, 53.476], [-167.1537, 53.4078], [-167.5225, 53.2762], [-167.6695, 53.2599], [-167.8088, 53.3238], [-167.5302, 53.3937], [-167.1361, 53.5265], [-167.0157, 53.6984], [-167.1182, 53.8726], [-166.9781, 53.9629], [-166.6274, 53.9957], [-166.6153, 53.9009]]], [[[-131.3398, 55.0798], [-131.232, 54.9037], [-131.4062, 54.8943], [-131.4314, 54.9965], [-131.5951, 55.0908], [-131.5778, 55.2009], [-131.4046, 55.2133], [-131.3398, 55.0798]]], [[[-152.898, 57.8239], [-152.5115, 57.8514], [-152.4115, 57.6462], [-152.2163, 57.5771], [-152.4122, 57.4547], [-152.7814, 57.4534], [-152.679, 57.3452], [-152.879, 57.3208], [-153.0516, 57.2377], [-153.2744, 57.2263], [-153.5036, 57.138], [-153.6465, 57.0295], [-153.7572, 56.8584], [-153.9727, 56.7742], [-154.0709, 56.8207], [-153.7932, 56.9895], [-153.9994, 57.05], [-154.0653, 57.1336], [-154.3244, 57.1318], [-154.1843, 57.0053], [-154.3389, 56.9209], [-154.4988, 57.0365], [-154.5693, 57.2059], [-154.706, 57.3353], [-154.6732, 57.4461], [-154.5353, 57.5595], [-154.2814, 57.6381], [-154.0298, 57.6307], [-153.8054, 57.3582], [-153.8184, 57.5956], [-153.6931, 57.6634], [-153.9044, 57.8199], [-153.6627, 57.8579], [-153.5245, 57.731], [-153.2003, 57.82], [-153.1605, 57.972], [-152.8504, 57.8968], [-152.898, 57.8239]]], [[[-163.4761, 54.9808], [-163.3581, 54.7356], [-163.583, 54.6256], [-164.0733, 54.621], [-164.2346, 54.5713], [-164.4635, 54.4273], [-164.8234, 54.4191], [-164.8877, 54.6078], [-164.7062, 54.692], [-164.5298, 54.8808], [-164.2737, 54.9], [-163.868, 55.0392], [-163.6075, 55.0508], [-163.4761, 54.9808]]], [[[-133.9896, 56.845], [-133.8309, 56.7813], [-133.7384, 56.6505], [-133.8553, 56.5822], [-133.8846, 56.2921], [-133.9497, 56.1277], [-134.1896, 56.0769], [-134.245, 56.2032], [-134.1955, 56.4134], [-134.0844, 56.4564], [-134.2902, 56.58], [-134.3844, 56.724], [-134.3737, 56.8387], [-134.1433, 56.9323], [-133.9896, 56.845]]], [[[-133.5661, 56.3393], [-133.203, 56.3198], [-133.0818, 56.1942], [-133.0966, 56.09], [-132.7576, 55.9949], [-132.5977, 55.8951], [-132.4302, 55.687], [-132.5916, 55.4644], [-132.4178, 55.4829], [-132.2153, 55.3835], [-132.2066, 55.2244], [-131.9764, 55.2085], [-132.0004, 55.0338], [-131.9809, 54.8048], [-132.1343, 54.7126], [-132.3413, 54.9073], [-132.5494, 54.9525], [-132.5885, 55.0524], [-132.7823, 55.0485], [-133.103, 55.3602], [-132.9589, 55.3956], [-133.0824, 55.504], [-133.0896, 55.6126], [-133.2983, 55.6069], [-133.369, 55.689], [-133.5533, 55.6912], [-133.6802, 55.7851], [-133.4469, 55.7971], [-133.2415, 55.9209], [-133.3712, 56.0359], [-133.6842, 55.9428], [-133.7552, 55.9995], [-133.5308, 56.1456], [-133.5944, 56.2164], [-133.5661, 56.3393]]], [[[-133.3051, 55.5438], [-133.2817, 55.4979], [-133.6502, 55.2693], [-133.6342, 55.5393], [-133.3051, 55.5438]]], [[[-132.7799, 56.2472], [-133.0351, 56.3409], [-132.9021, 56.4537], [-132.7061, 56.4485], [-132.6694, 56.2873], [-132.7799, 56.2472]]], [[[-153.007, 57.1248], [-153.3746, 57.0519], [-153.2852, 57.185], [-153.007, 57.1248]]], [[[-133.3662, 57.0035], [-133.0708, 56.9743], [-132.9541, 56.8803], [-132.954, 56.713], [-133.1442, 56.5669], [-133.2126, 56.4646], [-133.6028, 56.464], [-133.6493, 56.5168], [-133.681, 56.7975], [-133.9794, 57.0096], [-133.866, 57.0687], [-133.3662, 57.0035]]], [[[-130.9791, 55.4892], [-131.0828, 55.2668], [-131.1879, 55.2063], [-131.4207, 55.2759], [-131.4745, 55.3735], [-131.811, 55.2231], [-131.8461, 55.4163], [-131.6476, 55.5855], [-131.625, 55.8316], [-131.2692, 55.9554], [-131.1207, 55.8566], [-130.966, 55.6695], [-130.9791, 55.4892]]], [[[-160.6849, 55.3148], [-160.5832, 55.3077], [-160.4875, 55.1848], [-160.8255, 55.174], [-160.8465, 55.3114], [-160.6849, 55.3148]]], [[[-132.1123, 56.1094], [-132.1329, 55.9432], [-132.2873, 55.9294], [-132.4511, 56.0564], [-132.6599, 56.0782], [-132.6991, 56.1982], [-132.5987, 56.2416], [-132.3798, 56.4987], [-132.3165, 56.4875], [-132.0669, 56.2442], [-132.1123, 56.1094]]], [[[-132.7468, 56.5257], [-132.9308, 56.5245], [-132.8425, 56.7948], [-132.6559, 56.6847], [-132.568, 56.5758], [-132.7468, 56.5257]]]] }, \"properties\": { \"name\": \"Alaska\", \"id\": \"US-AK\", \"CNTRY\": \"United States of America\", \"TYPE\": \"State\" }, \"id\": \"US-AK\" },\r\n { \"type\": \"Feature\", \"geometry\": { \"type\": \"Polygon\", \"coordinates\": [[[-85.6235, 35.0009], [-85.3859, 33.8507], [-85.2009, 32.9562], [-85.1565, 32.8042], [-85.0151, 32.5261], [-84.986, 32.3609], [-84.9297, 32.2466], [-85.0346, 32.1474], [-85.1241, 31.8804], [-85.1248, 31.7768], [-85.0549, 31.5726], [-85.0926, 31.2957], [-85.0675, 31.1176], [-85.0073, 31.0016], [-85.9769, 31.0009], [-86.6236, 31.0009], [-87.5937, 31.0008], [-87.6011, 30.8605], [-87.4216, 30.6716], [-87.4294, 30.4778], [-87.4896, 30.3777], [-87.6222, 30.2647], [-87.7903, 30.2919], [-87.9243, 30.4496], [-87.9489, 30.627], [-88.0325, 30.6812], [-88.1355, 30.3666], [-88.3996, 30.3709], [-88.4443, 31.1397], [-88.4862, 31.8904], [-88.3397, 32.9988], [-88.1688, 34.292], [-88.0847, 34.9331], [-88.1733, 34.999], [-88.1905, 35.0249], [-86.9071, 35.0129], [-85.6235, 35.0009]]] }, \"properties\": { \"name\": \"Alabama\", \"id\": \"US-AL\", \"CNTRY\": \"United States of America\", \"TYPE\": \"State\" }, \"id\": \"US-AL\" },\r\n { \"type\": \"Feature\", \"geometry\": { \"type\": \"Polygon\", \"coordinates\": [[[-89.7047, 36.0015], [-89.7037, 35.9069], [-89.7796, 35.8057], [-89.9436, 35.6791], [-89.9674, 35.5033], [-90.066, 35.4141], [-90.0929, 35.2036], [-90.1423, 35.1142], [-90.2938, 35.0012], [-90.3198, 34.8992], [-90.5392, 34.7281], [-90.5841, 34.5037], [-90.718, 34.3917], [-90.8172, 34.2522], [-90.9097, 34.1888], [-90.9431, 34.0297], [-91.0702, 33.9743], [-91.0528, 33.8276], [-91.2076, 33.6756], [-91.2146, 33.5834], [-91.1411, 33.4386], [-91.1633, 33.2944], [-91.1068, 33.2179], [-91.15, 33.0159], [-92.4243, 33.0139], [-93.3227, 33.0128], [-94.0413, 33.012], [-94.0472, 33.5544], [-94.2947, 33.5875], [-94.3778, 33.5661], [-94.4841, 33.6485], [-94.4616, 34.5178], [-94.4391, 35.3872], [-94.6184, 36.5009], [-93.7829, 36.5009], [-92.3904, 36.5009], [-91.5548, 36.5009], [-90.1623, 36.5009], [-90.0744, 36.3719], [-90.0758, 36.2967], [-90.303, 36.0993], [-90.3811, 35.9927], [-89.7047, 36.0015]]] }, \"properties\": { \"name\": \"Arkansas\", \"id\": \"US-AR\", \"CNTRY\": \"United States of America\", \"TYPE\": \"State\" }, \"id\": \"US-AR\" },\r\n { \"type\": \"Feature\", \"geometry\": { \"type\": \"Polygon\", \"coordinates\": [[[-109.0467, 37.0009], [-109.0468, 36.2918], [-109.0469, 35.5829], [-109.0469, 34.5194], [-109.0472, 33.4558], [-109.0473, 32.3922], [-109.0478, 31.328], [-110.3351, 31.3255], [-111.0421, 31.3243], [-111.9905, 31.6202], [-112.939, 31.9162], [-113.8875, 32.2123], [-114.836, 32.5083], [-114.7248, 32.7154], [-114.5822, 32.7347], [-114.4775, 32.8419], [-114.4908, 32.9836], [-114.6481, 33.0718], [-114.7045, 33.1698], [-114.7017, 33.4179], [-114.6026, 33.47], [-114.4992, 33.6858], [-114.5091, 33.904], [-114.3293, 34.142], [-114.1255, 34.2865], [-114.1589, 34.3552], [-114.371, 34.4885], [-114.398, 34.5897], [-114.5575, 34.7946], [-114.6105, 34.9912], [-114.5909, 35.3528], [-114.6485, 35.4759], [-114.6452, 35.6305], [-114.6871, 35.9173], [-114.7414, 36.0136], [-114.6691, 36.1218], [-114.4061, 36.1484], [-114.1833, 36.0303], [-114.0429, 36.1817], [-114.0402, 37.0042], [-113.104, 37.0035], [-111.8556, 37.0026], [-111.2313, 37.0022], [-109.9829, 37.0014], [-109.0467, 37.0009]]] }, \"properties\": { \"name\": \"Arizona\", \"id\": \"US-AZ\", \"CNTRY\": \"United States of America\", \"TYPE\": \"State\" }, \"id\": \"US-AZ\" },\r\n { \"type\": \"Feature\", \"geometry\": { \"type\": \"MultiPolygon\", \"coordinates\": [[[[-120.0008, 42.0005], [-120.0006, 40.6879], [-120.0001, 39.5627], [-120.0001, 39.0002], [-119.2974, 38.5098], [-118.5948, 38.0193], [-118.1262, 37.6924], [-117.2097, 37.0033], [-116.6596, 36.5899], [-115.8978, 35.9955], [-115.3901, 35.5991], [-114.6105, 34.9912], [-114.5575, 34.7946], [-114.398, 34.5897], [-114.371, 34.4885], [-114.1589, 34.3552], [-114.1255, 34.2865], [-114.3293, 34.142], [-114.5091, 33.904], [-114.4992, 33.6858], [-114.6026, 33.47], [-114.7017, 33.4179], [-114.7045, 33.1698], [-114.6481, 33.0718], [-114.4908, 32.9836], [-114.4775, 32.8419], [-114.5822, 32.7347], [-114.7248, 32.7154], [-115.6975, 32.6404], [-117.1282, 32.5334], [-117.1374, 32.6491], [-117.2436, 32.6641], [-117.2629, 32.9389], [-117.3188, 33.1], [-117.4675, 33.2955], [-117.7885, 33.5385], [-117.9521, 33.6196], [-118.0806, 33.7221], [-118.2644, 33.7586], [-118.4105, 33.7439], [-118.3929, 33.8583], [-118.5062, 34.0175], [-118.832, 34.0245], [-119.1437, 34.112], [-119.2358, 34.1641], [-119.2676, 34.2575], [-119.606, 34.418], [-119.8533, 34.412], [-120.0529, 34.4692], [-120.4812, 34.4716], [-120.6446, 34.58], [-120.6249, 34.812], [-120.663, 34.9494], [-120.6336, 35.0765], [-120.707, 35.1577], [-120.8574, 35.2096], [-120.8603, 35.3654], [-121.0228, 35.4809], [-121.138, 35.6071], [-121.2839, 35.6764], [-121.3438, 35.7923], [-121.6644, 36.154], [-121.8775, 36.331], [-121.9186, 36.5724], [-121.79, 36.7322], [-121.8074, 36.8513], [-121.8806, 36.9389], [-122.1642, 36.991], [-122.3948, 37.2075], [-122.4084, 37.3731], [-122.4993, 37.5426], [-122.5142, 37.772], [-122.3842, 37.7886], [-122.3698, 37.6559], [-122.2287, 37.5639], [-122.2222, 37.7321], [-122.296, 37.7904], [-122.3854, 37.9606], [-122.217, 38.0407], [-121.7168, 38.0341], [-122.0315, 38.1235], [-122.1538, 38.0655], [-122.3933, 38.1447], [-122.4839, 38.1088], [-122.4669, 37.8381], [-122.7604, 37.9456], [-122.9682, 38.097], [-122.9865, 38.2771], [-123.1212, 38.4493], [-123.2897, 38.5359], [-123.4248, 38.6757], [-123.7011, 38.9073], [-123.7195, 39.111], [-123.8202, 39.3684], [-123.7835, 39.6187], [-123.8845, 39.8608], [-124.1085, 40.0945], [-124.324, 40.2519], [-124.3717, 40.4912], [-124.2837, 40.7106], [-124.1331, 40.9697], [-124.14, 41.1558], [-124.0685, 41.3841], [-124.1177, 41.6218], [-124.2446, 41.7879], [-124.2284, 42.0008], [-123.4283, 42.0005], [-122.3737, 42.0005], [-121.0554, 42.0005], [-120.0008, 42.0005]]], [[[-119.8824, 34.0797], [-119.5622, 34.0065], [-119.8095, 33.9677], [-119.8824, 34.0797]]], [[[-120.0436, 33.9188], [-120.1672, 33.9181], [-120.2519, 34.0138], [-120.0719, 34.0265], [-120.0436, 33.9188]]]] }, \"properties\": { \"name\": \"California\", \"id\": \"US-CA\", \"CNTRY\": \"United States of America\", \"TYPE\": \"State\" }, \"id\": \"US-CA\" },\r\n { \"type\": \"Feature\", \"geometry\": { \"type\": \"Polygon\", \"coordinates\": [[[-102.0245, 40.0011], [-102.0209, 39.0636], [-102.018, 38.3135], [-102.0128, 37.0009], [-103.0008, 37.0009], [-103.7566, 37.0009], [-104.8901, 37.0009], [-106.0238, 37.0009], [-106.7795, 37.0009], [-107.9131, 37.0009], [-109.0467, 37.0009], [-109.0465, 38.0009], [-109.0465, 39.2509], [-109.0465, 40.0008], [-109.0464, 41.0009], [-108.1044, 41.0009], [-107.1622, 41.0009], [-105.906, 41.0009], [-104.9638, 41.0009], [-104.0217, 41.0009], [-103.273, 41.0007], [-102.025, 41.0006], [-102.0245, 40.0011]]] }, \"properties\": { \"name\": \"Colorado\", \"id\": \"US-CO\", \"CNTRY\": \"United States of America\", \"TYPE\": \"State\" }, \"id\": \"US-CO\" },\r\n { \"type\": \"Feature\", \"geometry\": { \"type\": \"Polygon\", \"coordinates\": [[[-71.8009, 42.0119], [-71.7958, 41.5199], [-71.8423, 41.3354], [-72.2653, 41.2917], [-72.8471, 41.2659], [-73.1823, 41.1758], [-73.6305, 40.9918], [-73.7231, 41.1045], [-73.4841, 41.2189], [-73.5447, 41.296], [-73.4806, 42.0556], [-72.8078, 42.0341], [-71.8017, 42.0227], [-71.8009, 42.0119]]] }, \"properties\": { \"name\": \"Connecticut\", \"id\": \"US-CT\", \"CNTRY\": \"United States of America\", \"TYPE\": \"State\" }, \"id\": \"US-CT\" },\r\n { \"type\": \"Feature\", \"geometry\": { \"type\": \"Polygon\", \"coordinates\": [[[-77.0303, 38.8893], [-77.1221, 38.9435], [-77.0421, 39.0118], [-76.9312, 38.8882], [-77.0303, 38.8893]]] }, \"properties\": { \"name\": \"District of Columbia\", \"id\": \"US-DC\", \"CNTRY\": \"United States of America\", \"TYPE\": \"Federal District\" }, \"id\": \"US-DC\" },\r\n { \"type\": \"Feature\", \"geometry\": { \"type\": \"Polygon\", \"coordinates\": [[[-75.4211, 39.8154], [-75.5877, 39.6407], [-75.5738, 39.477], [-75.4127, 39.2813], [-75.3921, 39.0927], [-75.1851, 38.8194], [-75.0887, 38.7776], [-75.1284, 38.6325], [-75.0377, 38.4556], [-75.7071, 38.455], [-75.7847, 39.7223], [-75.6346, 39.8394], [-75.4211, 39.8154]]] }, \"properties\": { \"name\": \"Delaware\", \"id\": \"US-DE\", \"CNTRY\": \"United States of America\", \"TYPE\": \"State\" }, \"id\": \"US-DE\" },\r\n { \"type\": \"Feature\", \"geometry\": { \"type\": \"Polygon\", \"coordinates\": [[[-81.504, 30.7313], [-81.4572, 30.6407], [-81.3858, 30.2699], [-81.2495, 29.7938], [-81.1045, 29.4569], [-80.8999, 29.0498], [-80.5241, 28.4861], [-80.6229, 28.3203], [-80.7317, 28.4629], [-80.6885, 28.5785], [-80.766, 28.6328], [-80.7487, 28.3809], [-80.6501, 28.1809], [-80.2261, 27.207], [-80.1257, 27.0829], [-80.05, 26.8077], [-80.0413, 26.5686], [-80.1107, 26.1316], [-80.1264, 25.8335], [-80.3008, 25.6186], [-80.3669, 25.3312], [-80.4846, 25.2299], [-80.5577, 25.2325], [-80.7366, 25.1564], [-80.8622, 25.1761], [-81.1104, 25.138], [-81.1675, 25.2285], [-81.0977, 25.3191], [-81.2272, 25.5834], [-81.3452, 25.7319], [-81.3649, 25.831], [-81.5683, 25.8916], [-81.7155, 25.9832], [-81.8114, 26.1461], [-81.8665, 26.435], [-82.0396, 26.5521], [-82.0778, 26.7043], [-82.067, 26.8915], [-82.1807, 26.8401], [-82.2901, 26.8708], [-82.4413, 27.0596], [-82.6204, 27.4011], [-82.6359, 27.5246], [-82.4006, 27.8353], [-82.5206, 27.8778], [-82.6609, 27.7185], [-82.7429, 27.7094], [-82.8435, 27.846], [-82.7485, 28.2368], [-82.6607, 28.4858], [-82.6515, 28.8875], [-82.7693, 29.0515], [-83.2905, 29.4519], [-83.6944, 29.926], [-84.0443, 30.1037], [-84.3098, 30.0648], [-84.3828, 29.9074], [-84.55, 29.8979], [-84.8005, 29.7731], [-85.0292, 29.7212], [-85.3188, 29.6802], [-85.3069, 29.7978], [-85.3537, 29.8757], [-85.6758, 30.1218], [-85.6035, 30.2868], [-85.7408, 30.2444], [-85.7557, 30.167], [-86.1752, 30.3325], [-86.2574, 30.493], [-86.4479, 30.4956], [-86.6796, 30.4028], [-87.2011, 30.3393], [-86.9858, 30.4308], [-87.1705, 30.5388], [-87.1847, 30.4537], [-87.2811, 30.3393], [-87.4758, 30.2942], [-87.4896, 30.3777], [-87.4294, 30.4778], [-87.4216, 30.6716], [-87.6011, 30.8605], [-87.5937, 31.0008], [-86.6236, 31.0009], [-85.9769, 31.0009], [-85.0073, 31.0016], [-84.8839, 30.7209], [-84.1528, 30.6777], [-82.8775, 30.603], [-82.2399, 30.5657], [-82.1942, 30.3935], [-82.0618, 30.4046], [-82.0219, 30.5598], [-82.0382, 30.7319], [-81.9356, 30.8195], [-81.6733, 30.7403], [-81.504, 30.7313]]] }, \"properties\": { \"name\": \"Florida\", \"id\": \"US-FL\", \"CNTRY\": \"United States of America\", \"TYPE\": \"State\" }, \"id\": \"US-FL\" },\r\n { \"type\": \"Feature\", \"geometry\": { \"type\": \"Polygon\", \"coordinates\": [[[-80.8724, 32.0295], [-80.9234, 31.9449], [-81.1133, 31.8787], [-81.065, 31.8135], [-81.1979, 31.7042], [-81.1754, 31.5313], [-81.295, 31.3712], [-81.2885, 31.2639], [-81.4532, 31.0883], [-81.5204, 30.8746], [-81.504, 30.7313], [-81.6733, 30.7403], [-81.9356, 30.8195], [-82.0382, 30.7319], [-82.0219, 30.5598], [-82.0618, 30.4046], [-82.1942, 30.3935], [-82.2399, 30.5657], [-82.8775, 30.603], [-84.1528, 30.6777], [-84.8839, 30.7209], [-85.0073, 31.0016], [-85.0675, 31.1176], [-85.0926, 31.2957], [-85.0549, 31.5726], [-85.1248, 31.7768], [-85.1241, 31.8804], [-85.0346, 32.1474], [-84.9297, 32.2466], [-84.986, 32.3609], [-85.0151, 32.5261], [-85.1565, 32.8042], [-85.2009, 32.9562], [-85.3859, 33.8507], [-85.6235, 35.0009], [-84.3247, 34.988], [-83.1149, 35.0015], [-83.3167, 34.8057], [-83.3557, 34.7083], [-83.0528, 34.5109], [-82.8478, 34.4369], [-82.8187, 34.3661], [-82.5894, 34.0176], [-82.2566, 33.7493], [-82.2084, 33.6636], [-82.0057, 33.5229], [-81.9329, 33.3899], [-81.6994, 33.1267], [-81.5783, 33.0686], [-81.4897, 32.9356], [-81.377, 32.6075], [-81.2903, 32.5573], [-81.1714, 32.3801], [-81.1351, 32.1818], [-81.0748, 32.1097], [-80.8724, 32.0295]]] }, \"properties\": { \"name\": \"Georgia\", \"id\": \"US-GA\", \"CNTRY\": \"United States of America\", \"TYPE\": \"State\" }, \"id\": \"US-GA\" },\r\n { \"type\": \"Feature\", \"geometry\": { \"type\": \"MultiPolygon\", \"coordinates\": [[[[-156.4868, 20.9326], [-156.2775, 20.9514], [-156.1484, 20.8855], [-155.9899, 20.7572], [-156.1072, 20.6448], [-156.31, 20.5988], [-156.4383, 20.6179], [-156.4801, 20.8012], [-156.6155, 20.8218], [-156.6897, 20.9014], [-156.6568, 21.0244], [-156.5855, 21.0343], [-156.4868, 20.9326]]], [[[-157.2136, 21.2155], [-156.7423, 21.1635], [-156.8599, 21.0563], [-157.0209, 21.0978], [-157.2903, 21.1126], [-157.2136, 21.2155]]], [[[-156.8496, 20.7727], [-156.9734, 20.7575], [-157.0506, 20.9126], [-156.9418, 20.9301], [-156.8094, 20.8311], [-156.8496, 20.7727]]], [[[-155.5813, 19.012], [-155.6808, 18.9676], [-155.8813, 19.0704], [-155.9056, 19.1258], [-155.8907, 19.3825], [-155.9659, 19.5908], [-156.0487, 19.7499], [-155.8203, 20.0143], [-155.8928, 20.1674], [-155.8316, 20.2758], [-155.6221, 20.1633], [-155.1988, 19.9944], [-155.0861, 19.8756], [-155.0659, 19.7481], [-154.8042, 19.5245], [-154.8503, 19.4541], [-155.0535, 19.3192], [-155.3097, 19.2601], [-155.5352, 19.109], [-155.5813, 19.012]]], [[[-160.1801, 21.841], [-160.2209, 21.8972], [-160.1006, 22.0153], [-160.08, 21.9075], [-160.1801, 21.841]]], [[[-157.7993, 21.4567], [-157.6355, 21.3076], [-157.7988, 21.2687], [-157.9018, 21.3405], [-158.1104, 21.3186], [-158.2391, 21.4893], [-158.2732, 21.5851], [-158.1231, 21.6002], [-157.9625, 21.7014], [-157.7993, 21.4567]]], [[[-159.3728, 21.9323], [-159.4607, 21.8761], [-159.6089, 21.9094], [-159.7892, 22.0419], [-159.7267, 22.1402], [-159.5792, 22.2232], [-159.3521, 22.2196], [-159.3007, 22.1052], [-159.3728, 21.9323]]]] }, \"properties\": { \"name\": \"Hawaii\", \"id\": \"US-HI\", \"CNTRY\": \"United States of America\", \"TYPE\": \"State\" }, \"id\": \"US-HI\" },\r\n { \"type\": \"Feature\", \"geometry\": { \"type\": \"Polygon\", \"coordinates\": [[[-90.6506, 42.5129], [-90.4848, 42.3833], [-90.3466, 42.2148], [-90.1675, 42.1003], [-90.1524, 41.9816], [-90.2177, 41.813], [-90.4367, 41.5603], [-90.7541, 41.4498], [-90.9387, 41.4255], [-91.0482, 41.369], [-91.0665, 41.2059], [-90.9638, 41.0825], [-91.0001, 40.9047], [-91.1021, 40.7498], [-91.2151, 40.6496], [-91.3391, 40.604], [-91.4419, 40.3794], [-91.682, 40.5519], [-91.7315, 40.6246], [-93.2451, 40.616], [-94.5063, 40.6087], [-95.765, 40.6018], [-95.859, 40.7451], [-95.8341, 40.8895], [-95.8836, 41.2876], [-95.9329, 41.4254], [-96.0586, 41.5458], [-96.0688, 41.7343], [-96.1543, 41.9652], [-96.2954, 42.1329], [-96.3837, 42.4177], [-96.4809, 42.5113], [-96.5388, 42.6587], [-96.6218, 42.7296], [-96.4627, 43.0992], [-96.5555, 43.2317], [-96.5416, 43.3735], [-96.5985, 43.4976], [-96.4536, 43.5012], [-95.478, 43.5013], [-94.5023, 43.5014], [-93.5267, 43.5016], [-92.2258, 43.5018], [-91.2453, 43.5024], [-91.2187, 43.3953], [-91.1172, 43.3311], [-91.1614, 43.1023], [-91.0695, 42.7885], [-90.9599, 42.7204], [-90.7887, 42.6769], [-90.6879, 42.6104], [-90.6506, 42.5129]]] }, \"properties\": { \"name\": \"Iowa\", \"id\": \"US-IA\", \"CNTRY\": \"United States of America\", \"TYPE\": \"State\" }, \"id\": \"US-IA\" },\r\n { \"type\": \"Feature\", \"geometry\": { \"type\": \"Polygon\", \"coordinates\": [[[-111.0514, 44.4989], [-111.051, 43.7182], [-111.0508, 43.0938], [-111.0503, 42.0009], [-111.9855, 42.0009], [-112.7333, 42.001], [-114.0426, 42.001], [-115.1578, 42.0009], [-115.9014, 42.0008], [-117.0166, 42.0005], [-117.019, 43.1165], [-117.0205, 43.8132], [-116.9113, 44.1574], [-116.9531, 44.2453], [-117.1398, 44.2903], [-117.2017, 44.4362], [-117.1189, 44.5783], [-116.9489, 44.7701], [-116.8396, 44.9851], [-116.5492, 45.4567], [-116.4771, 45.6411], [-116.6168, 45.7992], [-116.7647, 45.873], [-116.8965, 46.0021], [-116.943, 46.2321], [-117.025, 46.4291], [-117.0317, 47.7115], [-117.039, 48.993], [-116.0485, 48.993], [-116.0491, 48.0047], [-115.7337, 47.7064], [-115.6697, 47.4979], [-115.7024, 47.4377], [-115.3495, 47.2612], [-114.9357, 46.9229], [-114.7537, 46.7345], [-114.6015, 46.6603], [-114.3368, 46.6592], [-114.3459, 46.5506], [-114.4853, 46.1582], [-114.4784, 46.0356], [-114.4051, 45.8742], [-114.5338, 45.7819], [-114.4958, 45.6859], [-114.5292, 45.5757], [-114.2976, 45.4875], [-113.9426, 45.6815], [-113.8023, 45.601], [-113.697, 45.305], [-113.4711, 45.0729], [-113.4693, 44.93], [-113.3389, 44.8081], [-113.1872, 44.7986], [-113.0933, 44.7154], [-112.9998, 44.4803], [-112.8156, 44.406], [-112.7159, 44.498], [-112.3929, 44.468], [-112.2313, 44.5607], [-111.7972, 44.5399], [-111.4998, 44.5448], [-111.4481, 44.7111], [-111.3374, 44.7449], [-111.1976, 44.5906], [-111.0514, 44.4989]]] }, \"properties\": { \"name\": \"Idaho\", \"id\": \"US-ID\", \"CNTRY\": \"United States of America\", \"TYPE\": \"State\" }, \"id\": \"US-ID\" },\r\n { \"type\": \"Feature\", \"geometry\": { \"type\": \"Polygon\", \"coordinates\": [[[-87.8121, 42.4971], [-87.7975, 42.2114], [-87.6946, 42.0844], [-87.5212, 41.7277], [-87.5254, 40.8615], [-87.5283, 40.2619], [-87.533, 39.3749], [-87.611, 39.2914], [-87.6472, 39.1688], [-87.5304, 38.9089], [-87.5295, 38.7423], [-87.6359, 38.5427], [-87.784, 38.4191], [-87.8271, 38.3356], [-87.9805, 38.2492], [-88.0425, 37.9366], [-88.0953, 37.8756], [-88.042, 37.7888], [-88.1289, 37.6995], [-88.1075, 37.5343], [-88.1906, 37.4646], [-88.4947, 37.3642], [-88.4533, 37.1782], [-88.4717, 37.0883], [-88.8726, 37.1856], [-89.0462, 37.183], [-89.1345, 37.1025], [-89.1543, 36.9921], [-89.2725, 37.08], [-89.414, 37.1023], [-89.503, 37.3005], [-89.462, 37.4342], [-89.5234, 37.6445], [-89.6233, 37.7472], [-89.823, 37.8841], [-90.1737, 38.069], [-90.299, 38.1739], [-90.374, 38.3097], [-90.3165, 38.4578], [-90.1268, 38.8325], [-90.2201, 38.8977], [-90.4781, 38.9481], [-90.5771, 38.9096], [-90.6635, 38.9875], [-90.7372, 39.1818], [-90.9195, 39.3869], [-91.2099, 39.6029], [-91.3787, 39.7493], [-91.4669, 39.9428], [-91.4998, 40.226], [-91.4419, 40.3794], [-91.3391, 40.604], [-91.2151, 40.6496], [-91.1021, 40.7498], [-91.0001, 40.9047], [-90.9638, 41.0825], [-91.0665, 41.2059], [-91.0482, 41.369], [-90.9387, 41.4255], [-90.7541, 41.4498], [-90.4367, 41.5603], [-90.2177, 41.813], [-90.1524, 41.9816], [-90.1675, 42.1003], [-90.3466, 42.2148], [-90.4848, 42.3833], [-90.6506, 42.5129], [-89.2905, 42.5052], [-87.8121, 42.4971]]] }, \"properties\": { \"name\": \"Illinois\", \"id\": \"US-IL\", \"CNTRY\": \"United States of America\", \"TYPE\": \"State\" }, \"id\": \"US-IL\" },\r\n { \"type\": \"Feature\", \"geometry\": { \"type\": \"Polygon\", \"coordinates\": [[[-84.7961, 41.7014], [-84.803, 41.0506], [-84.8133, 40.0745], [-84.8216, 39.092], [-84.8541, 38.9129], [-84.8007, 38.8194], [-85.1699, 38.6903], [-85.3068, 38.7372], [-85.4447, 38.6831], [-85.4248, 38.5966], [-85.6464, 38.3473], [-85.8549, 38.2151], [-85.9611, 38.0139], [-86.1035, 37.9918], [-86.2838, 38.1298], [-86.4297, 38.1397], [-86.5487, 37.9171], [-86.6731, 37.889], [-86.7703, 37.9598], [-86.9694, 37.938], [-87.1411, 37.8052], [-87.3724, 37.9234], [-87.5995, 37.9465], [-87.7145, 37.8997], [-87.9059, 37.9019], [-87.9125, 37.8177], [-88.042, 37.7888], [-88.0953, 37.8756], [-88.0425, 37.9366], [-87.9805, 38.2492], [-87.8271, 38.3356], [-87.784, 38.4191], [-87.6359, 38.5427], [-87.5295, 38.7423], [-87.5304, 38.9089], [-87.6472, 39.1688], [-87.611, 39.2914], [-87.533, 39.3749], [-87.5283, 40.2619], [-87.5254, 40.8615], [-87.5212, 41.7277], [-87.4124, 41.6564], [-87.2532, 41.6377], [-87.0726, 41.6695], [-86.8627, 41.7607], [-85.4026, 41.76], [-84.7964, 41.7597], [-84.7961, 41.7014]]] }, \"properties\": { \"name\": \"Indiana\", \"id\": \"US-IN\", \"CNTRY\": \"United States of America\", \"TYPE\": \"State\" }, \"id\": \"US-IN\" },\r\n { \"type\": \"Feature\", \"geometry\": { \"type\": \"Polygon\", \"coordinates\": [[[-94.6181, 37.0009], [-95.5424, 37.0009], [-96.4668, 37.0009], [-97.1601, 37.0009], [-98.0844, 37.0009], [-99.0086, 37.0009], [-99.9329, 37.0009], [-101.0885, 37.0009], [-102.0128, 37.0009], [-102.018, 38.3135], [-102.0209, 39.0636], [-102.0245, 40.0011], [-100.7669, 40.0011], [-99.2997, 40.0011], [-97.8325, 40.0011], [-96.7845, 40.0011], [-95.3466, 40.0015], [-95.1162, 39.8721], [-94.9841, 39.8911], [-94.8933, 39.7818], [-95.0754, 39.5974], [-95.058, 39.509], [-94.9525, 39.4264], [-94.7778, 39.194], [-94.6225, 39.1245], [-94.623, 38.5647], [-94.62, 37.6525], [-94.6181, 37.0009]]] }, \"properties\": { \"name\": \"Kansas\", \"id\": \"US-KS\", \"CNTRY\": \"United States of America\", \"TYPE\": \"State\" }, \"id\": \"US-KS\" },\r\n { \"type\": \"Feature\", \"geometry\": { \"type\": \"Polygon\", \"coordinates\": [[[-82.6129, 38.4482], [-82.5784, 38.272], [-82.5887, 38.0998], [-82.2802, 37.6872], [-82.1035, 37.5706], [-81.9652, 37.5396], [-82.3431, 37.2969], [-82.6816, 37.1381], [-82.7319, 37.048], [-82.8945, 36.9064], [-83.1502, 36.7624], [-83.6676, 36.605], [-83.7304, 36.5868], [-84.4247, 36.6062], [-85.8133, 36.6453], [-86.5076, 36.6648], [-87.8392, 36.6439], [-88.0964, 36.693], [-88.0591, 36.4997], [-89.4503, 36.5], [-89.3974, 36.5878], [-89.203, 36.6256], [-89.1225, 36.9116], [-89.1543, 36.9921], [-89.1345, 37.1025], [-89.0462, 37.183], [-88.8726, 37.1856], [-88.4717, 37.0883], [-88.4533, 37.1782], [-88.4947, 37.3642], [-88.1906, 37.4646], [-88.1075, 37.5343], [-88.1289, 37.6995], [-88.042, 37.7888], [-87.9125, 37.8177], [-87.9059, 37.9019], [-87.7145, 37.8997], [-87.5995, 37.9465], [-87.3724, 37.9234], [-87.1411, 37.8052], [-86.9694, 37.938], [-86.7703, 37.9598], [-86.6731, 37.889], [-86.5487, 37.9171], [-86.4297, 38.1397], [-86.2838, 38.1298], [-86.1035, 37.9918], [-85.9611, 38.0139], [-85.8549, 38.2151], [-85.6464, 38.3473], [-85.4248, 38.5966], [-85.4447, 38.6831], [-85.3068, 38.7372], [-85.1699, 38.6903], [-84.8007, 38.8194], [-84.8541, 38.9129], [-84.8216, 39.092], [-84.7069, 39.1289], [-84.5946, 39.0858], [-84.43, 39.0909], [-84.2904, 38.9747], [-84.2272, 38.8652], [-84.1133, 38.7984], [-83.9484, 38.7743], [-83.6898, 38.6495], [-83.5384, 38.6998], [-83.357, 38.6274], [-83.2035, 38.6389], [-83.0001, 38.7141], [-82.8805, 38.7102], [-82.7582, 38.5412], [-82.6129, 38.4482]]] }, \"properties\": { \"name\": \"Kentucky\", \"id\": \"US-KY\", \"CNTRY\": \"United States of America\", \"TYPE\": \"State\" }, \"id\": \"US-KY\" },\r\n { \"type\": \"Feature\", \"geometry\": { \"type\": \"MultiPolygon\", \"coordinates\": [[[[-91.7938, 29.5007], [-91.9963, 29.5731], [-91.8754, 29.6409], [-91.7677, 29.5847], [-91.7938, 29.5007]]], [[[-89.521, 30.1926], [-89.5884, 30.166], [-89.9543, 30.2688], [-90.0452, 30.3514], [-90.2252, 30.3794], [-90.332, 30.2776], [-90.4131, 30.1403], [-90.1753, 30.0291], [-89.9942, 30.0593], [-89.8941, 30.1258], [-89.7373, 30.172], [-89.6651, 30.117], [-89.8152, 30.0073], [-89.7438, 29.9299], [-89.5895, 29.9151], [-89.4945, 30.0582], [-89.3578, 29.9211], [-89.3545, 29.8202], [-89.5307, 29.7722], [-89.7209, 29.6193], [-89.6748, 29.5387], [-89.5137, 29.42], [-89.2456, 29.3331], [-89.0158, 29.2028], [-89.1555, 29.0166], [-89.2362, 29.0811], [-89.3535, 29.0702], [-89.4431, 29.1942], [-89.6202, 29.3024], [-89.7923, 29.3331], [-89.8772, 29.458], [-90.0523, 29.4314], [-90.1013, 29.1817], [-90.2129, 29.1049], [-90.3016, 29.2558], [-90.3792, 29.2951], [-90.5863, 29.2715], [-90.6775, 29.1506], [-90.7511, 29.1309], [-91.0027, 29.1935], [-91.2901, 29.289], [-91.1555, 29.3507], [-91.331, 29.5136], [-91.5142, 29.5554], [-91.6724, 29.7461], [-91.8243, 29.7506], [-91.8932, 29.8361], [-92.0173, 29.8003], [-92.1355, 29.6995], [-92.0841, 29.5928], [-92.2608, 29.5569], [-92.6712, 29.5971], [-92.9525, 29.7142], [-93.1757, 29.7789], [-93.6948, 29.7698], [-93.8265, 29.7251], [-93.8839, 29.81], [-93.7731, 29.9141], [-93.794, 29.9772], [-93.7106, 30.1128], [-93.7504, 30.3448], [-93.7202, 30.5583], [-93.5792, 30.8238], [-93.5306, 31.0462], [-93.5577, 31.1804], [-93.6659, 31.3226], [-93.7376, 31.5138], [-93.8206, 31.604], [-93.8269, 31.7503], [-93.905, 31.877], [-94.0434, 31.9992], [-94.0413, 33.012], [-93.3227, 33.0128], [-92.4243, 33.0139], [-91.15, 33.0159], [-91.0961, 32.9376], [-91.1424, 32.6611], [-91.1038, 32.4905], [-90.9447, 32.3307], [-90.9477, 32.2401], [-91.0887, 32.1042], [-91.1566, 31.9707], [-91.2864, 31.884], [-91.3725, 31.7736], [-91.4146, 31.6399], [-91.529, 31.4488], [-91.529, 31.3451], [-91.6307, 31.2176], [-91.5963, 31.1099], [-91.6565, 31.0018], [-91.1769, 31.0012], [-89.7353, 31.0011], [-89.8354, 30.7308], [-89.82, 30.6112], [-89.6858, 30.4627], [-89.5917, 30.223], [-89.521, 30.1926]]]] }, \"properties\": { \"name\": \"Louisiana\", \"id\": \"US-LA\", \"CNTRY\": \"United States of America\", \"TYPE\": \"State\" }, \"id\": \"US-LA\" },\r\n { \"type\": \"Feature\", \"geometry\": { \"type\": \"MultiPolygon\", \"coordinates\": [[[[-70.5099, 41.3763], [-70.7854, 41.3275], [-70.6737, 41.4486], [-70.5099, 41.3763]]], [[[-70.8062, 42.8767], [-70.8291, 42.8254], [-70.7357, 42.6692], [-71.0462, 42.3311], [-70.7383, 42.2289], [-70.5488, 41.9386], [-70.5147, 41.8033], [-70.2954, 41.729], [-70.0014, 41.8262], [-69.9486, 41.6772], [-70.4047, 41.6268], [-70.657, 41.5343], [-70.7012, 41.7149], [-70.9742, 41.5485], [-71.1885, 41.5164], [-71.2338, 41.7065], [-71.3407, 41.7978], [-71.3871, 42.0169], [-71.8009, 42.0119], [-71.8017, 42.0227], [-72.8078, 42.0341], [-73.4806, 42.0556], [-73.5072, 42.08], [-73.2533, 42.7522], [-72.4669, 42.7303], [-71.3296, 42.7024], [-70.974, 42.8716], [-70.8062, 42.8767]]]] }, \"properties\": { \"name\": \"Massachusetts\", \"id\": \"US-MA\", \"CNTRY\": \"United States of America\", \"TYPE\": \"State\" }, \"id\": \"US-MA\" },\r\n { \"type\": \"Feature\", \"geometry\": { \"type\": \"Polygon\", \"coordinates\": [[[-75.7847, 39.7223], [-75.7071, 38.455], [-75.0377, 38.4556], [-75.1342, 38.3843], [-75.376, 38.025], [-75.62, 37.9993], [-75.6592, 37.954], [-75.8508, 37.9716], [-75.7953, 38.0866], [-75.928, 38.1693], [-75.864, 38.2613], [-76.0513, 38.2795], [-76.2116, 38.3613], [-76.2948, 38.4947], [-76.2641, 38.6], [-76.0569, 38.6212], [-76.3003, 38.8183], [-76.1682, 38.8527], [-76.2357, 39.1917], [-76.1532, 39.3151], [-75.9547, 39.4596], [-75.959, 39.5851], [-76.0629, 39.5611], [-76.0972, 39.433], [-76.2764, 39.3228], [-76.4056, 39.3038], [-76.4208, 39.225], [-76.5739, 39.2543], [-76.42, 39.0739], [-76.5196, 38.8982], [-76.5368, 38.7426], [-76.5013, 38.5321], [-76.4164, 38.4202], [-76.4388, 38.3615], [-76.3329, 38.1408], [-76.5936, 38.2282], [-76.8896, 38.2921], [-77.0767, 38.4417], [-77.2326, 38.4077], [-77.2416, 38.4948], [-77.0183, 38.7777], [-77.0303, 38.8893], [-76.9312, 38.8882], [-77.0421, 39.0118], [-77.1221, 38.9435], [-77.3012, 39.0533], [-77.4809, 39.113], [-77.4789, 39.2209], [-77.7266, 39.3465], [-77.7981, 39.5172], [-77.8832, 39.6107], [-78.1812, 39.6857], [-78.4068, 39.6279], [-78.4956, 39.5334], [-78.8148, 39.5701], [-78.9714, 39.4537], [-79.0752, 39.4761], [-79.2935, 39.3115], [-79.488, 39.2109], [-79.4776, 39.7227], [-78.0926, 39.7226], [-76.708, 39.7225], [-75.7847, 39.7223]]] }, \"properties\": { \"name\": \"Maryland\", \"id\": \"US-MD\", \"CNTRY\": \"United States of America\", \"TYPE\": \"State\" }, \"id\": \"US-MD\" },\r\n { \"type\": \"Feature\", \"geometry\": { \"type\": \"MultiPolygon\", \"coordinates\": [[[[-68.1872, 44.3325], [-68.4118, 44.2944], [-68.2995, 44.4565], [-68.1872, 44.3325]]], [[[-70.7331, 43.07], [-70.829, 43.2391], [-70.9557, 43.3894], [-71.0314, 44.5297], [-71.0846, 45.294], [-70.8369, 45.3106], [-70.7992, 45.4048], [-70.6898, 45.4283], [-70.7023, 45.5514], [-70.421, 45.7383], [-70.2962, 45.9061], [-70.3045, 46.0574], [-70.2483, 46.2509], [-70.0673, 46.4411], [-70.0076, 46.7089], [-69.2429, 47.4629], [-69.0502, 47.4267], [-69.0486, 47.2737], [-68.8286, 47.2033], [-68.4805, 47.2857], [-68.3109, 47.3544], [-68.0968, 47.2749], [-67.8068, 47.0828], [-67.7958, 46.4984], [-67.7846, 45.7017], [-67.5958, 45.6208], [-67.4326, 45.6031], [-67.4936, 45.4741], [-67.4279, 45.378], [-67.4726, 45.2759], [-67.3669, 45.1738], [-67.1249, 45.1694], [-67.0805, 44.9891], [-67.1066, 44.885], [-66.9871, 44.8277], [-67.1912, 44.6756], [-67.364, 44.6969], [-67.556, 44.6448], [-67.6529, 44.5623], [-67.8392, 44.5763], [-67.907, 44.4536], [-68.0566, 44.3842], [-68.1174, 44.4906], [-68.2774, 44.5074], [-68.6121, 44.3105], [-68.7939, 44.3818], [-68.8473, 44.485], [-68.9615, 44.4339], [-68.9562, 44.3482], [-69.0635, 44.1724], [-69.0685, 44.0975], [-69.2261, 43.9864], [-69.3446, 44.001], [-69.4809, 43.9051], [-69.7298, 43.8521], [-69.7916, 43.8053], [-69.9652, 43.8551], [-70.1789, 43.7663], [-70.2692, 43.6719], [-70.2026, 43.6262], [-70.5207, 43.3488], [-70.6423, 43.1344], [-70.7331, 43.07]]]] }, \"properties\": { \"name\": \"Maine\", \"id\": \"US-ME\", \"CNTRY\": \"United States of America\", \"TYPE\": \"State\" }, \"id\": \"US-ME\" },\r\n { \"type\": \"Feature\", \"geometry\": { \"type\": \"MultiPolygon\", \"coordinates\": [[[[-88.9552, 47.926], [-89.1568, 47.8408], [-89.1466, 47.9526], [-88.5883, 48.1585], [-88.6247, 48.042], [-88.9552, 47.926]]], [[[-88.2219, 47.2106], [-88.2368, 47.1589], [-88.4341, 47.1223], [-88.6158, 47.1741], [-88.5619, 47.2722], [-88.3944, 47.3887], [-88.1102, 47.4725], [-88.0155, 47.3208], [-88.2219, 47.2106]]], [[[-84.1329, 46.3622], [-84.2741, 46.4875], [-84.1423, 46.5309], [-84.1329, 46.3622]]], [[[-87.6059, 45.1085], [-87.721, 45.2427], [-87.6964, 45.3829], [-87.8653, 45.3678], [-87.8152, 45.5059], [-87.8091, 45.6861], [-87.9225, 45.76], [-88.1161, 45.8158], [-88.1518, 45.9454], [-88.4931, 46.0135], [-88.8374, 46.0365], [-89.1193, 46.1491], [-90.1185, 46.3416], [-90.2304, 46.5098], [-90.4077, 46.593], [-90.1536, 46.6546], [-89.8605, 46.7928], [-89.6951, 46.8386], [-89.355, 46.8819], [-89.1548, 46.9886], [-88.9482, 47.043], [-88.8297, 47.1459], [-88.6327, 47.167], [-88.5154, 47.0955], [-88.4558, 46.9628], [-88.4761, 46.8367], [-88.2162, 46.9516], [-87.7776, 46.8878], [-87.6374, 46.8265], [-87.3581, 46.5244], [-87.0341, 46.5432], [-86.8515, 46.4703], [-86.6375, 46.453], [-86.531, 46.5244], [-86.2313, 46.6563], [-85.9467, 46.7021], [-85.6161, 46.6906], [-85.0146, 46.7835], [-85.0343, 46.5058], [-84.7789, 46.4683], [-84.6973, 46.4907], [-84.5283, 46.436], [-84.3274, 46.4915], [-84.229, 46.3658], [-84.2036, 46.247], [-84.0409, 46.0881], [-83.9787, 45.9615], [-84.3409, 45.9998], [-84.5212, 45.9946], [-84.6314, 46.0526], [-84.8019, 45.8743], [-85.1007, 46.0461], [-85.3859, 46.1087], [-85.5551, 46.0782], [-85.7079, 45.9876], [-85.9593, 45.9407], [-86.1229, 45.9689], [-86.2717, 45.9367], [-86.3995, 45.8007], [-86.5594, 45.8063], [-86.5634, 45.8824], [-86.7985, 45.8317], [-86.9378, 45.7003], [-87.0848, 45.7298], [-87.2165, 45.6074], [-87.3989, 45.3646], [-87.6022, 45.157], [-87.6059, 45.1085]]], [[[-83.5035, 46.0131], [-83.518, 45.9578], [-83.7307, 45.9429], [-83.8658, 45.9791], [-83.6082, 46.0965], [-83.5035, 46.0131]]], [[[-83.4542, 41.7456], [-83.4643, 41.7394], [-84.7961, 41.7014], [-84.7964, 41.7597], [-85.4026, 41.76], [-86.8627, 41.7607], [-86.6325, 41.9114], [-86.4073, 42.2237], [-86.2995, 42.4176], [-86.2328, 42.65], [-86.2215, 42.9004], [-86.3292, 43.2242], [-86.5421, 43.6373], [-86.4405, 43.7943], [-86.4486, 43.924], [-86.5192, 44.0738], [-86.296, 44.3306], [-86.2422, 44.5514], [-86.237, 44.7202], [-86.1259, 44.7477], [-86.0577, 44.9164], [-85.8579, 44.9615], [-85.6893, 45.1281], [-85.5877, 45.1613], [-85.6472, 44.8376], [-85.4846, 44.8403], [-85.389, 45.0328], [-85.3756, 45.277], [-85.2229, 45.3561], [-84.9671, 45.3926], [-85.0877, 45.5068], [-85.0878, 45.6053], [-84.9515, 45.7753], [-84.772, 45.7948], [-84.4414, 45.6763], [-84.1892, 45.6112], [-84.1278, 45.5325], [-83.4785, 45.3389], [-83.3201, 45.1389], [-83.4482, 45.0246], [-83.3278, 44.8692], [-83.2944, 44.6834], [-83.3306, 44.3752], [-83.5125, 44.2707], [-83.614, 44.0583], [-83.8789, 43.9626], [-83.9395, 43.782], [-83.9157, 43.7005], [-83.7352, 43.6266], [-83.6217, 43.6365], [-83.4689, 43.7308], [-83.3382, 43.929], [-82.9946, 44.0612], [-82.8782, 44.0477], [-82.7161, 43.939], [-82.5968, 43.6344], [-82.4612, 43.081], [-82.4173, 43.0174], [-82.4884, 42.7394], [-82.5453, 42.6247], [-82.8678, 42.3853], [-83.1047, 42.2864], [-83.2619, 41.9463], [-83.3621, 41.8798], [-83.4542, 41.7456]]]] }, \"properties\": { \"name\": \"Michigan\", \"id\": \"US-MI\", \"CNTRY\": \"United States of America\", \"TYPE\": \"State\" }, \"id\": \"US-MI\" },\r\n { \"type\": \"Feature\", \"geometry\": { \"type\": \"Polygon\", \"coordinates\": [[[-93.3778, 48.6165], [-93.0517, 48.6199], [-92.8367, 48.5678], [-92.5005, 48.4354], [-92.4147, 48.2766], [-92.1718, 48.3384], [-92.0052, 48.3018], [-91.8584, 48.1976], [-91.5183, 48.0583], [-91.2207, 48.1046], [-91.0434, 48.1938], [-90.8402, 48.2005], [-90.7444, 48.1046], [-90.3201, 48.0991], [-90.0918, 48.1181], [-89.9936, 48.0152], [-89.6338, 47.9937], [-89.8288, 47.9009], [-90.1972, 47.7864], [-90.5975, 47.6878], [-90.957, 47.5236], [-91.3862, 47.2147], [-91.6451, 47.05], [-92.0644, 46.8188], [-92.107, 46.7623], [-92.2917, 46.6607], [-92.2926, 46.0843], [-92.6938, 45.909], [-92.8747, 45.7061], [-92.8924, 45.5947], [-92.7071, 45.4937], [-92.6857, 45.3806], [-92.7661, 45.2364], [-92.7931, 45.0713], [-92.7634, 44.9342], [-92.7991, 44.79], [-92.6435, 44.6453], [-92.3669, 44.5522], [-92.2404, 44.4621], [-92.0551, 44.3999], [-91.8409, 44.1942], [-91.3827, 43.9908], [-91.2785, 43.7975], [-91.2453, 43.5024], [-92.2258, 43.5018], [-93.5267, 43.5016], [-94.5023, 43.5014], [-95.478, 43.5013], [-96.4536, 43.5012], [-96.4536, 44.1747], [-96.4536, 45.2973], [-96.5298, 45.3715], [-96.696, 45.4317], [-96.8455, 45.5958], [-96.8137, 45.6592], [-96.6146, 45.8], [-96.5563, 45.9428], [-96.5608, 46.1383], [-96.6175, 46.3271], [-96.7309, 46.4727], [-96.7867, 46.6483], [-96.7702, 46.9196], [-96.8183, 46.9742], [-96.8588, 47.5884], [-96.988, 47.8204], [-97.0074, 47.9255], [-97.1259, 48.1735], [-97.1439, 48.5367], [-97.1281, 48.6811], [-97.2257, 48.9932], [-95.8242, 48.9932], [-95.162, 48.9918], [-95.1553, 49.3697], [-94.8543, 49.3046], [-94.8425, 49.1192], [-94.7052, 48.8085], [-94.6208, 48.7425], [-94.0552, 48.659], [-93.8517, 48.6073], [-93.7077, 48.5255], [-93.4636, 48.5612], [-93.3778, 48.6165]]] }, \"properties\": { \"name\": \"Minnesota\", \"id\": \"US-MN\", \"CNTRY\": \"United States of America\", \"TYPE\": \"State\" }, \"id\": \"US-MN\" },\r\n { \"type\": \"Feature\", \"geometry\": { \"type\": \"Polygon\", \"coordinates\": [[[-91.4419, 40.3794], [-91.4998, 40.226], [-91.4669, 39.9428], [-91.3787, 39.7493], [-91.2099, 39.6029], [-90.9195, 39.3869], [-90.7372, 39.1818], [-90.6635, 38.9875], [-90.5771, 38.9096], [-90.4781, 38.9481], [-90.2201, 38.8977], [-90.1268, 38.8325], [-90.3165, 38.4578], [-90.374, 38.3097], [-90.299, 38.1739], [-90.1737, 38.069], [-89.823, 37.8841], [-89.6233, 37.7472], [-89.5234, 37.6445], [-89.462, 37.4342], [-89.503, 37.3005], [-89.414, 37.1023], [-89.2725, 37.08], [-89.1543, 36.9921], [-89.1225, 36.9116], [-89.203, 36.6256], [-89.3974, 36.5878], [-89.4503, 36.5], [-89.4872, 36.5031], [-89.5573, 36.5011], [-89.5946, 36.2594], [-89.6745, 36.2206], [-89.6419, 36.1045], [-89.7047, 36.0015], [-90.3811, 35.9927], [-90.303, 36.0993], [-90.0758, 36.2967], [-90.0744, 36.3719], [-90.1623, 36.5009], [-91.5548, 36.5009], [-92.3904, 36.5009], [-93.7829, 36.5009], [-94.6184, 36.5009], [-94.6181, 37.0009], [-94.62, 37.6525], [-94.623, 38.5647], [-94.6225, 39.1245], [-94.7778, 39.194], [-94.9525, 39.4264], [-95.058, 39.509], [-95.0754, 39.5974], [-94.8933, 39.7818], [-94.9841, 39.8911], [-95.1162, 39.8721], [-95.3466, 40.0015], [-95.4637, 40.1981], [-95.6071, 40.2955], [-95.765, 40.6018], [-94.5063, 40.6087], [-93.2451, 40.616], [-91.7315, 40.6246], [-91.682, 40.5519], [-91.4419, 40.3794]]] }, \"properties\": { \"name\": \"Missouri\", \"id\": \"US-MO\", \"CNTRY\": \"United States of America\", \"TYPE\": \"State\" }, \"id\": \"US-MO\" },\r\n { \"type\": \"Feature\", \"geometry\": { \"type\": \"Polygon\", \"coordinates\": [[[-88.1733, 34.999], [-88.0847, 34.9331], [-88.1688, 34.292], [-88.3397, 32.9988], [-88.4862, 31.8904], [-88.4443, 31.1397], [-88.3996, 30.3709], [-88.6921, 30.3554], [-88.9051, 30.4151], [-89.2237, 30.3323], [-89.3206, 30.3453], [-89.521, 30.1926], [-89.5917, 30.223], [-89.6858, 30.4627], [-89.82, 30.6112], [-89.8354, 30.7308], [-89.7353, 31.0011], [-91.1769, 31.0012], [-91.6565, 31.0018], [-91.5963, 31.1099], [-91.6307, 31.2176], [-91.529, 31.3451], [-91.529, 31.4488], [-91.4146, 31.6399], [-91.3725, 31.7736], [-91.2864, 31.884], [-91.1566, 31.9707], [-91.0887, 32.1042], [-90.9477, 32.2401], [-90.9447, 32.3307], [-91.1038, 32.4905], [-91.1424, 32.6611], [-91.0961, 32.9376], [-91.15, 33.0159], [-91.1068, 33.2179], [-91.1633, 33.2944], [-91.1411, 33.4386], [-91.2146, 33.5834], [-91.2076, 33.6756], [-91.0528, 33.8276], [-91.0702, 33.9743], [-90.9431, 34.0297], [-90.9097, 34.1888], [-90.8172, 34.2522], [-90.718, 34.3917], [-90.5841, 34.5037], [-90.5392, 34.7281], [-90.3198, 34.8992], [-90.2938, 35.0012], [-89.2418, 35], [-88.1733, 34.999]]] }, \"properties\": { \"name\": \"Mississippi\", \"id\": \"US-MS\", \"CNTRY\": \"United States of America\", \"TYPE\": \"State\" }, \"id\": \"US-MS\" },\r\n { \"type\": \"Feature\", \"geometry\": { \"type\": \"Polygon\", \"coordinates\": [[[-104.0111, 45.943], [-104.0055, 45.001], [-104.0372, 45.0011], [-105.133, 45.0011], [-106.0098, 45.001], [-106.8864, 45.001], [-107.9824, 45.001], [-109.0783, 45.001], [-109.7358, 45.001], [-111.0508, 45.001], [-111.0514, 44.4989], [-111.1976, 44.5906], [-111.3374, 44.7449], [-111.4481, 44.7111], [-111.4998, 44.5448], [-111.7972, 44.5399], [-112.2313, 44.5607], [-112.3929, 44.468], [-112.7159, 44.498], [-112.8156, 44.406], [-112.9998, 44.4803], [-113.0933, 44.7154], [-113.1872, 44.7986], [-113.3389, 44.8081], [-113.4693, 44.93], [-113.4711, 45.0729], [-113.697, 45.305], [-113.8023, 45.601], [-113.9426, 45.6815], [-114.2976, 45.4875], [-114.5292, 45.5757], [-114.4958, 45.6859], [-114.5338, 45.7819], [-114.4051, 45.8742], [-114.4784, 46.0356], [-114.4853, 46.1582], [-114.3459, 46.5506], [-114.3368, 46.6592], [-114.6015, 46.6603], [-114.7537, 46.7345], [-114.9357, 46.9229], [-115.3495, 47.2612], [-115.7024, 47.4377], [-115.6697, 47.4979], [-115.7337, 47.7064], [-116.0491, 48.0047], [-116.0485, 48.993], [-115.4379, 48.993], [-114.1587, 48.993], [-113.306, 48.993], [-112.0269, 48.993], [-110.3213, 48.993], [-109.4684, 48.993], [-107.7631, 48.9932], [-106.0575, 48.9932], [-105.2048, 48.9932], [-104.034, 48.9932], [-104.025, 47.8499], [-104.0195, 47.0872], [-104.0111, 45.943]]] }, \"properties\": { \"name\": \"Montana\", \"id\": \"US-MT\", \"CNTRY\": \"United States of America\", \"TYPE\": \"State\" }, \"id\": \"US-MT\" },\r\n { \"type\": \"Feature\", \"geometry\": { \"type\": \"Polygon\", \"coordinates\": [[[-75.9664, 36.5514], [-75.9927, 36.4738], [-75.8666, 36.2679], [-75.883, 36.1757], [-76.1478, 36.2793], [-76.15, 36.1458], [-76.3837, 36.1336], [-76.4788, 36.0281], [-76.6789, 36.0753], [-76.7262, 35.9576], [-76.3583, 35.9528], [-76.2065, 35.9912], [-76.0698, 35.9704], [-76.0835, 35.6905], [-76.0012, 35.7222], [-75.979, 35.8959], [-75.8538, 35.9601], [-75.7722, 35.8999], [-75.7447, 35.7655], [-75.774, 35.6469], [-76.1739, 35.3542], [-76.4895, 35.3971], [-76.5326, 35.5084], [-76.7414, 35.4315], [-76.513, 35.2704], [-76.628, 35.0733], [-76.7791, 34.9902], [-76.745, 34.9409], [-76.4568, 34.9894], [-76.3621, 34.9365], [-76.5168, 34.7773], [-76.7071, 34.7521], [-76.7332, 34.7069], [-77.1339, 34.7079], [-77.2518, 34.6156], [-77.3583, 34.6203], [-77.3797, 34.5266], [-77.7508, 34.285], [-77.926, 34.0732], [-78.0134, 33.9118], [-78.4058, 33.9175], [-78.5643, 33.8767], [-78.9784, 34.2261], [-79.6535, 34.7968], [-80.7841, 34.8286], [-80.793, 34.9628], [-80.9337, 35.1136], [-81.0451, 35.0657], [-81.0874, 35.1556], [-82.356, 35.2015], [-83.1149, 35.0015], [-84.3247, 34.988], [-84.287, 35.2009], [-84.2324, 35.2605], [-84.0623, 35.286], [-84.0038, 35.4141], [-83.8712, 35.5149], [-83.5112, 35.5841], [-83.1204, 35.7746], [-82.9902, 35.8004], [-82.8878, 35.9517], [-82.8128, 35.9473], [-82.6111, 36.0474], [-82.5211, 35.9812], [-82.3682, 36.0996], [-82.1826, 36.1539], [-82.0513, 36.1229], [-81.9082, 36.3065], [-81.7342, 36.3554], [-81.6589, 36.6106], [-81.6416, 36.5951], [-80.1944, 36.5837], [-79.471, 36.5781], [-78.3855, 36.5697], [-76.9385, 36.5585], [-75.9664, 36.5514]]] }, \"properties\": { \"name\": \"North Carolina\", \"id\": \"US-NC\", \"CNTRY\": \"United States of America\", \"TYPE\": \"State\" }, \"id\": \"US-NC\" },\r\n { \"type\": \"Feature\", \"geometry\": { \"type\": \"Polygon\", \"coordinates\": [[[-96.5563, 45.9428], [-98.1871, 45.9428], [-99.8179, 45.9429], [-100.7496, 45.9429], [-101.9144, 45.9429], [-103.3122, 45.943], [-104.0111, 45.943], [-104.0195, 47.0872], [-104.025, 47.8499], [-104.034, 48.9932], [-103.0728, 48.9932], [-102.22, 48.9932], [-100.5145, 48.9932], [-99.2354, 48.9932], [-97.9562, 48.9932], [-97.2257, 48.9932], [-97.1281, 48.6811], [-97.1439, 48.5367], [-97.1259, 48.1735], [-97.0074, 47.9255], [-96.988, 47.8204], [-96.8588, 47.5884], [-96.8183, 46.9742], [-96.7702, 46.9196], [-96.7867, 46.6483], [-96.7309, 46.4727], [-96.6175, 46.3271], [-96.5608, 46.1383], [-96.5563, 45.9428]]] }, \"properties\": { \"name\": \"North Dakota\", \"id\": \"US-ND\", \"CNTRY\": \"United States of America\", \"TYPE\": \"State\" }, \"id\": \"US-ND\" },\r\n { \"type\": \"Feature\", \"geometry\": { \"type\": \"Polygon\", \"coordinates\": [[[-96.4809, 42.5113], [-96.3837, 42.4177], [-96.2954, 42.1329], [-96.1543, 41.9652], [-96.0688, 41.7343], [-96.0586, 41.5458], [-95.9329, 41.4254], [-95.8836, 41.2876], [-95.8341, 40.8895], [-95.859, 40.7451], [-95.765, 40.6018], [-95.6071, 40.2955], [-95.4637, 40.1981], [-95.3466, 40.0015], [-96.7845, 40.0011], [-97.8325, 40.0011], [-99.2997, 40.0011], [-100.7669, 40.0011], [-102.0245, 40.0011], [-102.025, 41.0006], [-103.273, 41.0007], [-104.0217, 41.0009], [-104.0252, 42.0012], [-104.0288, 43.0013], [-103.3366, 43.0013], [-101.9522, 43.0013], [-100.9139, 43.0013], [-99.5294, 43.0012], [-98.4417, 43.0011], [-98.1432, 42.8523], [-97.965, 42.8058], [-97.6981, 42.8746], [-97.4166, 42.8811], [-97.2388, 42.8605], [-97.0198, 42.7601], [-96.8045, 42.7015], [-96.6328, 42.5686], [-96.4809, 42.5113]]] }, \"properties\": { \"name\": \"Nebraska\", \"id\": \"US-NE\", \"CNTRY\": \"United States of America\", \"TYPE\": \"State\" }, \"id\": \"US-NE\" },\r\n { \"type\": \"Feature\", \"geometry\": { \"type\": \"Polygon\", \"coordinates\": [[[-70.7331, 43.07], [-70.8062, 42.8767], [-70.974, 42.8716], [-71.3296, 42.7024], [-72.4669, 42.7303], [-72.5499, 42.8867], [-72.4736, 43.0385], [-72.4071, 43.3319], [-72.385, 43.5293], [-72.2967, 43.7149], [-72.1149, 43.9655], [-72.0313, 44.3007], [-71.683, 44.4503], [-71.5685, 44.6076], [-71.6206, 44.7719], [-71.5102, 44.9083], [-71.5175, 45.0076], [-71.419, 45.2004], [-71.3273, 45.2901], [-71.2017, 45.2603], [-71.0846, 45.294], [-71.0314, 44.5297], [-70.9557, 43.3894], [-70.829, 43.2391], [-70.7331, 43.07]]] }, \"properties\": { \"name\": \"New Hampshire\", \"id\": \"US-NH\", \"CNTRY\": \"United States of America\", \"TYPE\": \"State\" }, \"id\": \"US-NH\" },\r\n { \"type\": \"Feature\", \"geometry\": { \"type\": \"Polygon\", \"coordinates\": [[[-73.9101, 40.9922], [-74.0256, 40.7564], [-74.2267, 40.608], [-74.2415, 40.4563], [-74.0498, 40.4299], [-73.9576, 40.3284], [-74.0283, 40.073], [-74.1177, 39.9382], [-74.1761, 39.7266], [-74.3899, 39.4869], [-74.4288, 39.3872], [-74.603, 39.2926], [-74.7944, 39.0019], [-74.9543, 38.9499], [-74.8971, 39.1455], [-75.1361, 39.2078], [-75.3535, 39.3399], [-75.5243, 39.4902], [-75.5235, 39.6019], [-75.4219, 39.7897], [-75.1538, 39.8706], [-75.0741, 39.9834], [-74.7349, 40.1545], [-75.0975, 40.5431], [-75.1889, 40.5958], [-75.1748, 40.7756], [-75.075, 40.8844], [-75.123, 40.9991], [-74.9123, 41.1553], [-74.8414, 41.2687], [-74.699, 41.3572], [-73.9101, 40.9922]]] }, \"properties\": { \"name\": \"New Jersey\", \"id\": \"US-NJ\", \"CNTRY\": \"United States of America\", \"TYPE\": \"State\" }, \"id\": \"US-NJ\" },\r\n { \"type\": \"Feature\", \"geometry\": { \"type\": \"Polygon\", \"coordinates\": [[[-103.0002, 36.5012], [-103.0422, 36.5006], [-103.048, 35.3761], [-103.0539, 34.2517], [-103.0582, 33.4084], [-103.0613, 32.8461], [-103.0656, 32.0027], [-103.9648, 32.0023], [-105.0886, 32.0019], [-105.9879, 32.0015], [-106.6683, 32.001], [-106.5664, 31.8196], [-106.4454, 31.7684], [-107.3326, 31.7747], [-108.2119, 31.7794], [-108.2145, 31.3295], [-109.0478, 31.328], [-109.0473, 32.3922], [-109.0472, 33.4558], [-109.0469, 34.5194], [-109.0469, 35.5829], [-109.0468, 36.2918], [-109.0467, 37.0009], [-107.9131, 37.0009], [-106.7795, 37.0009], [-106.0238, 37.0009], [-104.8901, 37.0009], [-103.7566, 37.0009], [-103.0008, 37.0009], [-103.0002, 36.5012]]] }, \"properties\": { \"name\": \"New Mexico\", \"id\": \"US-NM\", \"CNTRY\": \"United States of America\", \"TYPE\": \"State\" }, \"id\": \"US-NM\" },\r\n { \"type\": \"Feature\", \"geometry\": { \"type\": \"Polygon\", \"coordinates\": [[[-114.0402, 37.0042], [-114.0429, 36.1817], [-114.1833, 36.0303], [-114.4061, 36.1484], [-114.6691, 36.1218], [-114.7414, 36.0136], [-114.6871, 35.9173], [-114.6452, 35.6305], [-114.6485, 35.4759], [-114.5909, 35.3528], [-114.6105, 34.9912], [-115.3901, 35.5991], [-115.8978, 35.9955], [-116.6596, 36.5899], [-117.2097, 37.0033], [-118.1262, 37.6924], [-118.5948, 38.0193], [-119.2974, 38.5098], [-120.0001, 39.0002], [-120.0001, 39.5627], [-120.0006, 40.6879], [-120.0008, 42.0005], [-119.2547, 42.0005], [-118.1357, 42.0005], [-117.0166, 42.0005], [-115.9014, 42.0008], [-115.1578, 42.0009], [-114.0426, 42.001], [-114.042, 40.908], [-114.0418, 40.1273], [-114.0412, 39.1903], [-114.0408, 37.9411], [-114.0402, 37.0042]]] }, \"properties\": { \"name\": \"Nevada\", \"id\": \"US-NV\", \"CNTRY\": \"United States of America\", \"TYPE\": \"State\" }, \"id\": \"US-NV\" },\r\n { \"type\": \"Feature\", \"geometry\": { \"type\": \"MultiPolygon\", \"coordinates\": [[[[-72.5098, 40.9861], [-72.2874, 41.024], [-72.339, 40.8942], [-73.1943, 40.6542], [-73.2655, 40.6635], [-73.6209, 40.5999], [-73.7667, 40.5926], [-73.8228, 40.656], [-74.032, 40.6387], [-73.8793, 40.7916], [-73.5739, 40.9195], [-73.3727, 40.9438], [-73.1858, 40.9298], [-73.0338, 40.966], [-72.5098, 40.9861]]], [[[-73.2533, 42.7522], [-73.5072, 42.08], [-73.4806, 42.0556], [-73.5447, 41.296], [-73.4841, 41.2189], [-73.7231, 41.1045], [-73.6305, 40.9918], [-73.8513, 40.8314], [-73.9485, 40.8388], [-73.9101, 40.9922], [-74.699, 41.3572], [-74.7566, 41.4239], [-74.9354, 41.4743], [-75.0227, 41.5529], [-75.0537, 41.765], [-75.1219, 41.8534], [-75.2388, 41.8922], [-75.3513, 41.9984], [-76.4541, 41.999], [-77.9707, 41.9998], [-78.66, 42.0002], [-79.763, 42.0009], [-79.763, 42.2757], [-79.2092, 42.5551], [-78.8778, 42.7991], [-78.9197, 42.9481], [-78.9082, 43.0703], [-79.0661, 43.1061], [-79.0532, 43.285], [-78.6895, 43.3614], [-78.1749, 43.3946], [-77.8381, 43.3572], [-77.529, 43.2674], [-77.2708, 43.2945], [-76.9764, 43.2775], [-76.6929, 43.3609], [-76.4728, 43.5073], [-76.2027, 43.5745], [-76.1984, 43.8745], [-76.0987, 43.967], [-76.2378, 44.1832], [-75.8322, 44.3972], [-75.792, 44.4971], [-75.4012, 44.7723], [-75.1795, 44.8994], [-74.8565, 45.0039], [-73.3522, 45.0054], [-73.372, 44.5973], [-73.3098, 44.4596], [-73.3209, 44.2689], [-73.425, 44.0383], [-73.3757, 43.7622], [-73.4133, 43.6279], [-73.2471, 43.553], [-73.2666, 42.8648], [-73.2533, 42.7522]]]] }, \"properties\": { \"name\": \"New York\", \"id\": \"US-NY\", \"CNTRY\": \"United States of America\", \"TYPE\": \"State\" }, \"id\": \"US-NY\" },\r\n { \"type\": \"Feature\", \"geometry\": { \"type\": \"Polygon\", \"coordinates\": [[[-80.519, 40.647], [-80.6591, 40.5629], [-80.6018, 40.3639], [-80.6683, 40.1853], [-80.8722, 39.7355], [-80.9633, 39.5711], [-81.3334, 39.3628], [-81.4396, 39.3926], [-81.6571, 39.272], [-81.8026, 39.0861], [-81.7778, 38.9728], [-82.0722, 38.9629], [-82.2034, 38.7682], [-82.18, 38.6376], [-82.387, 38.4339], [-82.6129, 38.4482], [-82.7582, 38.5412], [-82.8805, 38.7102], [-83.0001, 38.7141], [-83.2035, 38.6389], [-83.357, 38.6274], [-83.5384, 38.6998], [-83.6898, 38.6495], [-83.9484, 38.7743], [-84.1133, 38.7984], [-84.2272, 38.8652], [-84.2904, 38.9747], [-84.43, 39.0909], [-84.5946, 39.0858], [-84.7069, 39.1289], [-84.8216, 39.092], [-84.8133, 40.0745], [-84.803, 41.0506], [-84.7961, 41.7014], [-83.4643, 41.7394], [-83.4542, 41.7456], [-82.9108, 41.5382], [-82.8308, 41.5797], [-82.5243, 41.407], [-82.1213, 41.493], [-81.7232, 41.511], [-81.4471, 41.6714], [-81.2286, 41.7704], [-80.8692, 41.8933], [-80.5202, 41.9895], [-80.5202, 41.2769], [-80.519, 40.647]]] }, \"properties\": { \"name\": \"Ohio\", \"id\": \"US-OH\", \"CNTRY\": \"United States of America\", \"TYPE\": \"State\" }, \"id\": \"US-OH\" },\r\n { \"type\": \"Feature\", \"geometry\": { \"type\": \"Polygon\", \"coordinates\": [[[-94.6184, 36.5009], [-94.4391, 35.3872], [-94.4616, 34.5178], [-94.4841, 33.6485], [-94.7091, 33.6994], [-94.9624, 33.8433], [-95.238, 33.9565], [-95.3739, 33.8743], [-95.6228, 33.9303], [-95.7839, 33.8645], [-95.9416, 33.8828], [-96.2785, 33.7576], [-96.4111, 33.7752], [-96.5917, 33.8492], [-96.7464, 33.8542], [-96.9777, 33.938], [-97.1724, 33.7568], [-97.2149, 33.8971], [-97.4302, 33.8385], [-97.6604, 33.9901], [-97.8424, 33.8757], [-98.0695, 34.0404], [-98.0987, 34.145], [-98.3559, 34.1414], [-98.4938, 34.0888], [-98.6085, 34.1612], [-98.7989, 34.1547], [-98.9688, 34.2086], [-99.1866, 34.2355], [-99.1999, 34.3183], [-99.3603, 34.4561], [-99.405, 34.392], [-99.6321, 34.3885], [-99.867, 34.5434], [-99.9995, 34.5867], [-100.0005, 35.3045], [-100.0023, 36.5009], [-101.314, 36.5011], [-102.0636, 36.5012], [-103.0002, 36.5012], [-103.0008, 37.0009], [-102.0128, 37.0009], [-101.0885, 37.0009], [-99.9329, 37.0009], [-99.0086, 37.0009], [-98.0844, 37.0009], [-97.1601, 37.0009], [-96.4668, 37.0009], [-95.5424, 37.0009], [-94.6181, 37.0009], [-94.6184, 36.5009]]] }, \"properties\": { \"name\": \"Oklahoma\", \"id\": \"US-OK\", \"CNTRY\": \"United States of America\", \"TYPE\": \"State\" }, \"id\": \"US-OK\" },\r\n { \"type\": \"Feature\", \"geometry\": { \"type\": \"Polygon\", \"coordinates\": [[[-123.2206, 46.1537], [-123.1209, 46.1787], [-122.942, 46.1148], [-122.8434, 45.9781], [-122.7259, 45.6737], [-122.6498, 45.6275], [-122.2026, 45.591], [-122.0851, 45.6026], [-121.882, 45.6895], [-121.6625, 45.7182], [-121.4021, 45.7118], [-121.1843, 45.6437], [-121.0451, 45.639], [-120.3514, 45.7251], [-119.9343, 45.8379], [-119.4292, 45.9343], [-119.1773, 45.9451], [-119.0197, 46.0003], [-118.2062, 46.0013], [-116.8965, 46.0021], [-116.7647, 45.873], [-116.6168, 45.7992], [-116.4771, 45.6411], [-116.5492, 45.4567], [-116.8396, 44.9851], [-116.9489, 44.7701], [-117.1189, 44.5783], [-117.2017, 44.4362], [-117.1398, 44.2903], [-116.9531, 44.2453], [-116.9113, 44.1574], [-117.0205, 43.8132], [-117.019, 43.1165], [-117.0166, 42.0005], [-118.1357, 42.0005], [-119.2547, 42.0005], [-120.0008, 42.0005], [-121.0554, 42.0005], [-122.3737, 42.0005], [-123.4283, 42.0005], [-124.2284, 42.0008], [-124.3553, 42.1228], [-124.4205, 42.381], [-124.4062, 42.5837], [-124.5396, 42.8128], [-124.4544, 43.0123], [-124.3466, 43.3415], [-124.288, 43.4097], [-124.1487, 43.6918], [-124.0991, 44.3338], [-124.0474, 44.4255], [-124.0592, 44.7778], [-123.9486, 45.4008], [-123.9294, 45.5771], [-123.9612, 45.8429], [-123.9471, 46.1406], [-123.9117, 46.1822], [-123.6737, 46.1826], [-123.5217, 46.2226], [-123.4023, 46.155], [-123.2206, 46.1537]]] }, \"properties\": { \"name\": \"Oregon\", \"id\": \"US-OR\", \"CNTRY\": \"United States of America\", \"TYPE\": \"State\" }, \"id\": \"US-OR\" },\r\n { \"type\": \"Feature\", \"geometry\": { \"type\": \"Polygon\", \"coordinates\": [[[-74.699, 41.3572], [-74.8414, 41.2687], [-74.9123, 41.1553], [-75.123, 40.9991], [-75.075, 40.8844], [-75.1748, 40.7756], [-75.1889, 40.5958], [-75.0975, 40.5431], [-74.7349, 40.1545], [-75.0741, 39.9834], [-75.1729, 39.8948], [-75.4211, 39.8154], [-75.6346, 39.8394], [-75.7847, 39.7223], [-76.708, 39.7225], [-78.0926, 39.7226], [-79.4776, 39.7227], [-80.5194, 39.7226], [-80.519, 40.647], [-80.5202, 41.2769], [-80.5202, 41.9895], [-80.3344, 42.0408], [-79.763, 42.2757], [-79.763, 42.0009], [-78.66, 42.0002], [-77.9707, 41.9998], [-76.4541, 41.999], [-75.3513, 41.9984], [-75.2388, 41.8922], [-75.1219, 41.8534], [-75.0537, 41.765], [-75.0227, 41.5529], [-74.9354, 41.4743], [-74.7566, 41.4239], [-74.699, 41.3572]]] }, \"properties\": { \"name\": \"Pennsylvania\", \"id\": \"US-PA\", \"CNTRY\": \"United States of America\", \"TYPE\": \"State\" }, \"id\": \"US-PA\" },\r\n { \"type\": \"Feature\", \"geometry\": { \"type\": \"Polygon\", \"coordinates\": [[[-71.2338, 41.7065], [-71.3306, 41.7622], [-71.4265, 41.6333], [-71.4437, 41.4536], [-71.5229, 41.3789], [-71.8423, 41.3354], [-71.7958, 41.5199], [-71.8009, 42.0119], [-71.3871, 42.0169], [-71.3407, 41.7978], [-71.2338, 41.7065]]] }, \"properties\": { \"name\": \"Rhode Island\", \"id\": \"US-RI\", \"CNTRY\": \"United States of America\", \"TYPE\": \"State\" }, \"id\": \"US-RI\" },\r\n { \"type\": \"Feature\", \"geometry\": { \"type\": \"Polygon\", \"coordinates\": [[[-78.5643, 33.8767], [-78.8414, 33.724], [-79.1382, 33.4059], [-79.1937, 33.2441], [-79.276, 33.1354], [-79.42, 33.0425], [-79.5871, 33.0009], [-79.615, 32.9093], [-79.8936, 32.7287], [-80.0217, 32.6199], [-80.2297, 32.5765], [-80.4743, 32.4228], [-80.4857, 32.3517], [-80.6083, 32.2928], [-80.6472, 32.3959], [-80.7653, 32.2984], [-80.6942, 32.2157], [-80.8492, 32.114], [-80.8724, 32.0295], [-81.0748, 32.1097], [-81.1351, 32.1818], [-81.1714, 32.3801], [-81.2903, 32.5573], [-81.377, 32.6075], [-81.4897, 32.9356], [-81.5783, 33.0686], [-81.6994, 33.1267], [-81.9329, 33.3899], [-82.0057, 33.5229], [-82.2084, 33.6636], [-82.2566, 33.7493], [-82.5894, 34.0176], [-82.8187, 34.3661], [-82.8478, 34.4369], [-83.0528, 34.5109], [-83.3557, 34.7083], [-83.3167, 34.8057], [-83.1149, 35.0015], [-82.356, 35.2015], [-81.0874, 35.1556], [-81.0451, 35.0657], [-80.9337, 35.1136], [-80.793, 34.9628], [-80.7841, 34.8286], [-79.6535, 34.7968], [-78.9784, 34.2261], [-78.5643, 33.8767]]] }, \"properties\": { \"name\": \"South Carolina\", \"id\": \"US-SC\", \"CNTRY\": \"United States of America\", \"TYPE\": \"State\" }, \"id\": \"US-SC\" },\r\n { \"type\": \"Feature\", \"geometry\": { \"type\": \"Polygon\", \"coordinates\": [[[-96.5563, 45.9428], [-96.6146, 45.8], [-96.8137, 45.6592], [-96.8455, 45.5958], [-96.696, 45.4317], [-96.5298, 45.3715], [-96.4536, 45.2973], [-96.4536, 44.1747], [-96.4536, 43.5012], [-96.5985, 43.4976], [-96.5416, 43.3735], [-96.5555, 43.2317], [-96.4627, 43.0992], [-96.6218, 42.7296], [-96.5388, 42.6587], [-96.4809, 42.5113], [-96.6328, 42.5686], [-96.8045, 42.7015], [-97.0198, 42.7601], [-97.2388, 42.8605], [-97.4166, 42.8811], [-97.6981, 42.8746], [-97.965, 42.8058], [-98.1432, 42.8523], [-98.4417, 43.0011], [-99.5294, 43.0012], [-100.9139, 43.0013], [-101.9522, 43.0013], [-103.3366, 43.0013], [-104.0288, 43.0013], [-104.031, 43.5013], [-104.0351, 44.5012], [-104.0372, 45.0011], [-104.0055, 45.001], [-104.0111, 45.943], [-103.3122, 45.943], [-101.9144, 45.9429], [-100.7496, 45.9429], [-99.8179, 45.9429], [-98.1871, 45.9428], [-96.5563, 45.9428]]] }, \"properties\": { \"name\": \"South Dakota\", \"id\": \"US-SD\", \"CNTRY\": \"United States of America\", \"TYPE\": \"State\" }, \"id\": \"US-SD\" },\r\n { \"type\": \"Feature\", \"geometry\": { \"type\": \"Polygon\", \"coordinates\": [[[-83.6676, 36.605], [-82.9558, 36.6021], [-81.9525, 36.598], [-81.6589, 36.6106], [-81.7342, 36.3554], [-81.9082, 36.3065], [-82.0513, 36.1229], [-82.1826, 36.1539], [-82.3682, 36.0996], [-82.5211, 35.9812], [-82.6111, 36.0474], [-82.8128, 35.9473], [-82.8878, 35.9517], [-82.9902, 35.8004], [-83.1204, 35.7746], [-83.5112, 35.5841], [-83.8712, 35.5149], [-84.0038, 35.4141], [-84.0623, 35.286], [-84.2324, 35.2605], [-84.287, 35.2009], [-84.3247, 34.988], [-85.6235, 35.0009], [-86.9071, 35.0129], [-88.1905, 35.0249], [-88.1733, 34.999], [-89.2418, 35], [-90.2938, 35.0012], [-90.1423, 35.1142], [-90.0929, 35.2036], [-90.066, 35.4141], [-89.9674, 35.5033], [-89.9436, 35.6791], [-89.7796, 35.8057], [-89.7037, 35.9069], [-89.7047, 36.0015], [-89.6419, 36.1045], [-89.6745, 36.2206], [-89.5946, 36.2594], [-89.5573, 36.5011], [-89.4872, 36.5031], [-89.4503, 36.5], [-88.0591, 36.4997], [-88.0964, 36.693], [-87.8392, 36.6439], [-86.5076, 36.6648], [-85.8133, 36.6453], [-84.4247, 36.6062], [-83.7304, 36.5868], [-83.6676, 36.605]]] }, \"properties\": { \"name\": \"Tennessee\", \"id\": \"US-TN\", \"CNTRY\": \"United States of America\", \"TYPE\": \"State\" }, \"id\": \"US-TN\" },\r\n { \"type\": \"Feature\", \"geometry\": { \"type\": \"MultiPolygon\", \"coordinates\": [[[[-97.1708, 26.1594], [-97.2673, 26.3299], [-97.4021, 26.8205], [-97.3512, 26.8014], [-97.1708, 26.1594]]], [[[-97.0144, 27.9017], [-96.8992, 28.1174], [-96.8397, 28.0889], [-97.0144, 27.9017]]], [[[-94.4841, 33.6485], [-94.3778, 33.5661], [-94.2947, 33.5875], [-94.0472, 33.5544], [-94.0413, 33.012], [-94.0434, 31.9992], [-93.905, 31.877], [-93.8269, 31.7503], [-93.8206, 31.604], [-93.7376, 31.5138], [-93.6659, 31.3226], [-93.5577, 31.1804], [-93.5306, 31.0462], [-93.5792, 30.8238], [-93.7202, 30.5583], [-93.7504, 30.3448], [-93.7106, 30.1128], [-93.794, 29.9772], [-93.8414, 29.9798], [-93.9462, 29.815], [-93.8905, 29.6894], [-94.0996, 29.6704], [-94.7501, 29.418], [-94.6053, 29.5677], [-94.7782, 29.5478], [-94.7243, 29.6552], [-94.7419, 29.75], [-94.8323, 29.7526], [-94.8899, 29.6769], [-95.0229, 29.7024], [-94.9928, 29.531], [-94.8883, 29.3705], [-95.139, 29.1679], [-95.1522, 29.0792], [-95.2735, 28.9638], [-95.8534, 28.6404], [-96.0204, 28.5869], [-96.2753, 28.6552], [-96.4488, 28.5944], [-96.5756, 28.7156], [-96.6401, 28.7088], [-96.5246, 28.4887], [-96.5618, 28.3671], [-96.6764, 28.3413], [-96.7736, 28.4217], [-96.8068, 28.2202], [-96.8916, 28.1576], [-96.9667, 28.1895], [-97.1565, 28.1444], [-97.0731, 27.9862], [-97.1714, 27.8796], [-97.3741, 27.87], [-97.4316, 27.8372], [-97.2888, 27.6706], [-97.3804, 27.4194], [-97.4391, 27.3282], [-97.5238, 27.314], [-97.6821, 27.3949], [-97.6924, 27.2872], [-97.4852, 27.2373], [-97.4757, 27.1179], [-97.5547, 26.9673], [-97.4658, 26.6917], [-97.4024, 26.3965], [-97.1462, 25.9614], [-97.2818, 25.9417], [-97.3582, 25.8705], [-97.5872, 25.9843], [-97.8015, 26.042], [-98.0828, 26.0645], [-98.275, 26.1113], [-98.4859, 26.2245], [-98.5983, 26.2378], [-98.7652, 26.3404], [-99.0153, 26.399], [-99.1077, 26.4468], [-99.1721, 26.5641], [-99.2299, 26.7619], [-99.3025, 26.8848], [-99.4436, 27.0366], [-99.4403, 27.1701], [-99.5101, 27.3403], [-99.5053, 27.5483], [-99.7543, 27.73], [-99.8896, 27.8673], [-100.0014, 28.0479], [-100.1119, 28.1729], [-100.296, 28.3277], [-100.3317, 28.5026], [-100.5497, 28.8214], [-100.6586, 29.0686], [-100.7546, 29.1825], [-101.0164, 29.4007], [-101.039, 29.4605], [-101.3035, 29.6341], [-101.4405, 29.7768], [-101.9909, 29.7958], [-102.269, 29.8712], [-102.4763, 29.769], [-102.6149, 29.7523], [-102.7342, 29.644], [-102.834, 29.444], [-102.8919, 29.2164], [-103.0227, 29.1322], [-103.0901, 29.0419], [-103.2576, 29.0011], [-103.423, 29.0707], [-103.664, 29.207], [-104.1107, 29.3862], [-104.3122, 29.5425], [-104.4007, 29.5738], [-104.5041, 29.6777], [-104.6223, 29.8543], [-104.6812, 29.9905], [-104.6812, 30.1343], [-104.8359, 30.4476], [-104.9788, 30.6459], [-105.2758, 30.8073], [-105.514, 30.9808], [-105.8126, 31.241], [-106.0241, 31.3978], [-106.148, 31.4508], [-106.2558, 31.5446], [-106.4454, 31.7684], [-106.5664, 31.8196], [-106.6683, 32.001], [-105.9879, 32.0015], [-105.0886, 32.0019], [-103.9648, 32.0023], [-103.0656, 32.0027], [-103.0613, 32.8461], [-103.0582, 33.4084], [-103.0539, 34.2517], [-103.048, 35.3761], [-103.0422, 36.5006], [-103.0002, 36.5012], [-102.0636, 36.5012], [-101.314, 36.5011], [-100.0023, 36.5009], [-100.0005, 35.3045], [-99.9995, 34.5867], [-99.867, 34.5434], [-99.6321, 34.3885], [-99.405, 34.392], [-99.3603, 34.4561], [-99.1999, 34.3183], [-99.1866, 34.2355], [-98.9688, 34.2086], [-98.7989, 34.1547], [-98.6085, 34.1612], [-98.4938, 34.0888], [-98.3559, 34.1414], [-98.0987, 34.145], [-98.0695, 34.0404], [-97.8424, 33.8757], [-97.6604, 33.9901], [-97.4302, 33.8385], [-97.2149, 33.8971], [-97.1724, 33.7568], [-96.9777, 33.938], [-96.7464, 33.8542], [-96.5917, 33.8492], [-96.4111, 33.7752], [-96.2785, 33.7576], [-95.9416, 33.8828], [-95.7839, 33.8645], [-95.6228, 33.9303], [-95.3739, 33.8743], [-95.238, 33.9565], [-94.9624, 33.8433], [-94.7091, 33.6994], [-94.4841, 33.6485]]]] }, \"properties\": { \"name\": \"Texas\", \"id\": \"US-TX\", \"CNTRY\": \"United States of America\", \"TYPE\": \"State\" }, \"id\": \"US-TX\" },\r\n { \"type\": \"Feature\", \"geometry\": { \"type\": \"Polygon\", \"coordinates\": [[[-111.0503, 42.0009], [-111.05, 41.0009], [-109.7978, 41.0009], [-109.0464, 41.0009], [-109.0465, 40.0008], [-109.0465, 39.2509], [-109.0465, 38.0009], [-109.0467, 37.0009], [-109.9829, 37.0014], [-111.2313, 37.0022], [-111.8556, 37.0026], [-113.104, 37.0035], [-114.0402, 37.0042], [-114.0408, 37.9411], [-114.0412, 39.1903], [-114.0418, 40.1273], [-114.042, 40.908], [-114.0426, 42.001], [-112.7333, 42.001], [-111.9855, 42.0009], [-111.0503, 42.0009]]] }, \"properties\": { \"name\": \"Utah\", \"id\": \"US-UT\", \"CNTRY\": \"United States of America\", \"TYPE\": \"State\" }, \"id\": \"US-UT\" },\r\n { \"type\": \"Feature\", \"geometry\": { \"type\": \"MultiPolygon\", \"coordinates\": [[[[-77.7266, 39.3465], [-77.4789, 39.2209], [-77.4809, 39.113], [-77.3012, 39.0533], [-77.1221, 38.9435], [-77.0303, 38.8893], [-77.0456, 38.7758], [-77.2603, 38.6], [-77.3136, 38.3966], [-77.2319, 38.34], [-77.0468, 38.3566], [-76.9062, 38.197], [-76.5496, 38.0946], [-76.4717, 38.0112], [-76.2642, 37.8935], [-76.3056, 37.7216], [-76.484, 37.6289], [-76.3055, 37.5714], [-76.2635, 37.357], [-76.4009, 37.3862], [-76.4011, 37.2127], [-76.2833, 37.0527], [-76.4008, 36.9913], [-76.6719, 37.173], [-76.6339, 37.0475], [-76.3996, 36.8899], [-76.2442, 36.9526], [-75.9994, 36.9126], [-75.8575, 36.5506], [-75.8891, 36.5504], [-75.9664, 36.5514], [-76.9385, 36.5585], [-78.3855, 36.5697], [-79.471, 36.5781], [-80.1944, 36.5837], [-81.6416, 36.5951], [-81.6589, 36.6106], [-81.9525, 36.598], [-82.9558, 36.6021], [-83.6676, 36.605], [-83.1502, 36.7624], [-82.8945, 36.9064], [-82.7319, 37.048], [-82.6816, 37.1381], [-82.3431, 37.2969], [-81.9652, 37.5396], [-81.913, 37.369], [-81.8293, 37.2986], [-81.5648, 37.2097], [-81.35, 37.3337], [-81.2272, 37.2633], [-80.9437, 37.3018], [-80.8211, 37.4231], [-80.7199, 37.401], [-80.3161, 37.5097], [-80.2459, 37.6208], [-80.2853, 37.677], [-80.1881, 37.8241], [-79.9717, 38.0461], [-79.9028, 38.1807], [-79.7153, 38.404], [-79.6687, 38.5443], [-79.5977, 38.5771], [-79.3958, 38.4545], [-79.2402, 38.4766], [-79.0412, 38.7896], [-78.8687, 38.8179], [-78.5815, 38.999], [-78.4352, 39.1608], [-78.3223, 39.4519], [-77.8358, 39.1452], [-77.7266, 39.3465]]], [[[-75.6592, 37.954], [-75.62, 37.9993], [-75.376, 38.025], [-75.5963, 37.6312], [-75.5871, 37.5587], [-75.812, 37.4251], [-75.9343, 37.152], [-75.9974, 37.2639], [-75.975, 37.3985], [-75.8882, 37.6191], [-75.7193, 37.8214], [-75.6592, 37.954]]]] }, \"properties\": { \"name\": \"Virginia\", \"id\": \"US-VA\", \"CNTRY\": \"United States of America\", \"TYPE\": \"State\" }, \"id\": \"US-VA\" },\r\n { \"type\": \"Feature\", \"geometry\": { \"type\": \"Polygon\", \"coordinates\": [[[-72.4669, 42.7303], [-73.2533, 42.7522], [-73.2666, 42.8648], [-73.2471, 43.553], [-73.4133, 43.6279], [-73.3757, 43.7622], [-73.425, 44.0383], [-73.3209, 44.2689], [-73.3098, 44.4596], [-73.372, 44.5973], [-73.3522, 45.0054], [-72.766, 45.0061], [-71.5175, 45.0076], [-71.5102, 44.9083], [-71.6206, 44.7719], [-71.5685, 44.6076], [-71.683, 44.4503], [-72.0313, 44.3007], [-72.1149, 43.9655], [-72.2967, 43.7149], [-72.385, 43.5293], [-72.4071, 43.3319], [-72.4736, 43.0385], [-72.5499, 42.8867], [-72.4669, 42.7303]]] }, \"properties\": { \"name\": \"Vermont\", \"id\": \"US-VT\", \"CNTRY\": \"United States of America\", \"TYPE\": \"State\" }, \"id\": \"US-VT\" },\r\n { \"type\": \"Feature\", \"geometry\": { \"type\": \"MultiPolygon\", \"coordinates\": [[[[-116.8965, 46.0021], [-118.2062, 46.0013], [-119.0197, 46.0003], [-119.1773, 45.9451], [-119.4292, 45.9343], [-119.9343, 45.8379], [-120.3514, 45.7251], [-121.0451, 45.639], [-121.1843, 45.6437], [-121.4021, 45.7118], [-121.6625, 45.7182], [-121.882, 45.6895], [-122.0851, 45.6026], [-122.2026, 45.591], [-122.6498, 45.6275], [-122.7259, 45.6737], [-122.8434, 45.9781], [-122.942, 46.1148], [-123.1209, 46.1787], [-123.2206, 46.1537], [-123.4649, 46.2712], [-123.6884, 46.2998], [-123.8957, 46.2677], [-124.0727, 46.2795], [-124.0502, 46.4906], [-123.9461, 46.4326], [-123.8891, 46.66], [-124.0717, 46.7448], [-124.1126, 46.8627], [-123.8429, 46.9632], [-124.0422, 47.0297], [-124.1635, 47.0153], [-124.1989, 47.2085], [-124.3093, 47.4046], [-124.376, 47.6587], [-124.46, 47.7843], [-124.6211, 47.9042], [-124.7017, 48.1517], [-124.6326, 48.375], [-123.9758, 48.1685], [-123.2944, 48.1196], [-123.1244, 48.151], [-123.0242, 48.0816], [-122.8609, 48.0901], [-122.7398, 48.0133], [-122.6567, 47.8811], [-122.8214, 47.7931], [-122.7571, 47.7005], [-122.5879, 47.8559], [-122.5239, 47.7694], [-122.6184, 47.7129], [-122.5536, 47.4049], [-122.5779, 47.2931], [-122.8125, 47.3289], [-122.9195, 47.2897], [-122.9876, 47.1726], [-122.7019, 47.1109], [-122.5422, 47.2756], [-122.3538, 47.3716], [-122.3684, 47.6039], [-122.4105, 47.6527], [-122.3928, 47.8205], [-122.242, 48.0108], [-122.353, 48.1138], [-122.494, 48.1304], [-122.5203, 48.2291], [-122.4086, 48.2939], [-122.669, 48.4653], [-122.4967, 48.5056], [-122.562, 48.778], [-122.653, 48.7639], [-122.7888, 48.993], [-121.4072, 48.993], [-119.7018, 48.993], [-117.9962, 48.993], [-117.039, 48.993], [-117.0317, 47.7115], [-117.025, 46.4291], [-116.943, 46.2321], [-116.8965, 46.0021]]], [[[-122.5728, 48.1567], [-122.3667, 47.9855], [-122.5575, 47.9925], [-122.5728, 48.1567]]]] }, \"properties\": { \"name\": \"Washington\", \"id\": \"US-WA\", \"CNTRY\": \"United States of America\", \"TYPE\": \"State\" }, \"id\": \"US-WA\" },\r\n { \"type\": \"Feature\", \"geometry\": { \"type\": \"MultiPolygon\", \"coordinates\": [[[[-90.4077, 46.593], [-90.2304, 46.5098], [-90.1185, 46.3416], [-89.1193, 46.1491], [-88.8374, 46.0365], [-88.4931, 46.0135], [-88.1518, 45.9454], [-88.1161, 45.8158], [-87.9225, 45.76], [-87.8091, 45.6861], [-87.8152, 45.5059], [-87.8653, 45.3678], [-87.6964, 45.3829], [-87.721, 45.2427], [-87.6059, 45.1085], [-87.627, 45.0323], [-87.8302, 44.9424], [-88.0282, 44.6179], [-87.929, 44.5595], [-87.741, 44.6921], [-87.6044, 44.8469], [-87.4197, 44.8657], [-87.3374, 44.7758], [-87.4866, 44.5086], [-87.5275, 44.3857], [-87.5349, 44.1743], [-87.6584, 44.059], [-87.7238, 43.9073], [-87.6997, 43.7237], [-87.774, 43.5989], [-87.9017, 43.2449], [-87.8935, 43.0411], [-87.787, 42.8092], [-87.8121, 42.4971], [-89.2905, 42.5052], [-90.6506, 42.5129], [-90.6879, 42.6104], [-90.7887, 42.6769], [-90.9599, 42.7204], [-91.0695, 42.7885], [-91.1614, 43.1023], [-91.1172, 43.3311], [-91.2187, 43.3953], [-91.2453, 43.5024], [-91.2785, 43.7975], [-91.3827, 43.9908], [-91.8409, 44.1942], [-92.0551, 44.3999], [-92.2404, 44.4621], [-92.3669, 44.5522], [-92.6435, 44.6453], [-92.7991, 44.79], [-92.7634, 44.9342], [-92.7931, 45.0713], [-92.7661, 45.2364], [-92.6857, 45.3806], [-92.7071, 45.4937], [-92.8924, 45.5947], [-92.8747, 45.7061], [-92.6938, 45.909], [-92.2926, 46.0843], [-92.2917, 46.6607], [-92.107, 46.7623], [-91.9874, 46.699], [-91.8356, 46.7021], [-91.4991, 46.7662], [-91.2177, 46.8856], [-91.1272, 46.8676], [-90.9461, 46.9538], [-90.7684, 46.908], [-90.923, 46.6031], [-90.7368, 46.6888], [-90.5361, 46.5994], [-90.4077, 46.593]]], [[[-86.9919, 45.241], [-87.0589, 45.1025], [-87.2804, 44.8349], [-87.3965, 44.9541], [-87.2587, 45.138], [-87.122, 45.2245], [-86.9919, 45.241]]]] }, \"properties\": { \"name\": \"Wisconsin\", \"id\": \"US-WI\", \"CNTRY\": \"United States of America\", \"TYPE\": \"State\" }, \"id\": \"US-WI\" },\r\n { \"type\": \"Feature\", \"geometry\": { \"type\": \"Polygon\", \"coordinates\": [[[-79.4776, 39.7227], [-79.488, 39.2109], [-79.2935, 39.3115], [-79.0752, 39.4761], [-78.9714, 39.4537], [-78.8148, 39.5701], [-78.4956, 39.5334], [-78.4068, 39.6279], [-78.1812, 39.6857], [-77.8832, 39.6107], [-77.7981, 39.5172], [-77.7266, 39.3465], [-77.8358, 39.1452], [-78.3223, 39.4519], [-78.4352, 39.1608], [-78.5815, 38.999], [-78.8687, 38.8179], [-79.0412, 38.7896], [-79.2402, 38.4766], [-79.3958, 38.4545], [-79.5977, 38.5771], [-79.6687, 38.5443], [-79.7153, 38.404], [-79.9028, 38.1807], [-79.9717, 38.0461], [-80.1881, 37.8241], [-80.2853, 37.677], [-80.2459, 37.6208], [-80.3161, 37.5097], [-80.7199, 37.401], [-80.8211, 37.4231], [-80.9437, 37.3018], [-81.2272, 37.2633], [-81.35, 37.3337], [-81.5648, 37.2097], [-81.8293, 37.2986], [-81.913, 37.369], [-81.9652, 37.5396], [-82.1035, 37.5706], [-82.2802, 37.6872], [-82.5887, 38.0998], [-82.5784, 38.272], [-82.6129, 38.4482], [-82.387, 38.4339], [-82.18, 38.6376], [-82.2034, 38.7682], [-82.0722, 38.9629], [-81.7778, 38.9728], [-81.8026, 39.0861], [-81.6571, 39.272], [-81.4396, 39.3926], [-81.3334, 39.3628], [-80.9633, 39.5711], [-80.8722, 39.7355], [-80.6683, 40.1853], [-80.6018, 40.3639], [-80.6591, 40.5629], [-80.519, 40.647], [-80.5194, 39.7226], [-79.4776, 39.7227]]] }, \"properties\": { \"name\": \"West Virginia\", \"id\": \"US-WV\", \"CNTRY\": \"United States of America\", \"TYPE\": \"State\" }, \"id\": \"US-WV\" },\r\n { \"type\": \"Feature\", \"geometry\": { \"type\": \"Polygon\", \"coordinates\": [[[-104.0288, 43.0013], [-104.0252, 42.0012], [-104.0217, 41.0009], [-104.9638, 41.0009], [-105.906, 41.0009], [-107.1622, 41.0009], [-108.1044, 41.0009], [-109.0464, 41.0009], [-109.7978, 41.0009], [-111.05, 41.0009], [-111.0503, 42.0009], [-111.0508, 43.0938], [-111.051, 43.7182], [-111.0514, 44.4989], [-111.0508, 45.001], [-109.7358, 45.001], [-109.0783, 45.001], [-107.9824, 45.001], [-106.8864, 45.001], [-106.0098, 45.001], [-105.133, 45.0011], [-104.0372, 45.0011], [-104.0351, 44.5012], [-104.031, 43.5013], [-104.0288, 43.0013]]] }, \"properties\": { \"name\": \"Wyoming\", \"id\": \"US-WY\", \"CNTRY\": \"United States of America\", \"TYPE\": \"State\" }, \"id\": \"US-WY\" }\r\n ] };\r\nexport default map;\r\n","/**\r\n * [[Chart]] class provides base functionality for all chart types to inherit.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { registry } from \"../core/Registry\";\r\nimport { Component } from \"../core/Component\";\r\nimport { MutableValueDisposer, Disposer } from \"../core/utils/Disposer\";\r\nimport { ListTemplate, ListDisposer } from \"../core/utils/List\";\r\nimport { Container } from \"../core/Container\";\r\nimport { Label } from \"../core/elements/Label\";\r\nimport { Grip } from \"../core/elements/Grip\";\r\nimport { DataItem } from \"../core/DataItem\";\r\nimport { percent } from \"../core/utils/Percent\";\r\nimport * as $iter from \"../core/utils/Iterator\";\r\nimport * as $type from \"../core/utils/Type\";\r\nimport { defaultRules, ResponsiveBreakpoints } from \"../core/utils/Responsive\";\r\n/**\r\n * ============================================================================\r\n * DATA ITEM\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Defines a [[DataItem]] for [[Chart]].\r\n *\r\n * @see {@link DataItem}\r\n */\r\nvar ChartDataItem = /** @class */ (function (_super) {\r\n __extends(ChartDataItem, _super);\r\n /**\r\n * Constructor\r\n */\r\n function ChartDataItem() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"ChartDataItem\";\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n return ChartDataItem;\r\n}(DataItem));\r\nexport { ChartDataItem };\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * A base class for all Charts.\r\n *\r\n * @see {@link IChartEvents} for a list of available Events\r\n * @see {@link IChartAdapters} for a list of available Adapters\r\n */\r\nvar Chart = /** @class */ (function (_super) {\r\n __extends(Chart, _super);\r\n /**\r\n * Constructor\r\n */\r\n function Chart() {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n /**\r\n * A reference to chart's [[Legend]].\r\n * @ignore\r\n */\r\n _this._legend = new MutableValueDisposer();\r\n if (_this.constructor === Chart) {\r\n throw new Error(\"'Chart' cannot be instantiated directly. Please use a specific chart type.\");\r\n }\r\n _this.className = \"Chart\";\r\n // Create a list of titles\r\n var template = new Label();\r\n _this.titles = new ListTemplate(template);\r\n _this._disposers.push(new ListDisposer(_this.titles));\r\n _this._disposers.push(template);\r\n // Chart component is also a container. it holds _chartAndLegendCont and titles\r\n _this.width = percent(100);\r\n _this.height = percent(100);\r\n _this.layout = \"vertical\";\r\n // Chart and legend\r\n var chartAndLegendContainer = _this.createChild(Container);\r\n chartAndLegendContainer.shouldClone = false;\r\n chartAndLegendContainer.layout = \"vertical\";\r\n chartAndLegendContainer.width = percent(100);\r\n chartAndLegendContainer.height = percent(100);\r\n _this.chartAndLegendContainer = chartAndLegendContainer;\r\n // Chart container holds all the elements of a chart, extept titles and legend\r\n var chartContainer = chartAndLegendContainer.createChild(Container);\r\n chartContainer.shouldClone = false;\r\n chartContainer.width = percent(100);\r\n chartContainer.height = percent(100);\r\n _this.chartContainer = chartContainer;\r\n _this.showOnInit = true;\r\n _this._disposers.push(_this._legend);\r\n // Add title list events to apply certain formatting options and to make\r\n // the chart reference them as accessible screen reader labels\r\n _this.titles.events.on(\"inserted\", function (label) {\r\n _this.processTitle(label);\r\n _this.updateReaderTitleReferences();\r\n }, _this, false);\r\n _this.titles.events.on(\"removed\", function (label) {\r\n _this.updateReaderTitleReferences();\r\n }, _this, false);\r\n // Accessibility\r\n // It seems we can't set focusable on the whole chart because it seems to\r\n // mess up the whole focus event system - getting a focus on an inside\r\n // object also trigger focus on parent\r\n //this.focusable = true;\r\n _this.role = \"region\";\r\n _this.defaultState.transitionDuration = 1;\r\n // Apply theme\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Sets defaults that instantiate some objects that rely on parent, so they\r\n * cannot be set in constructor.\r\n */\r\n Chart.prototype.applyInternalDefaults = function () {\r\n _super.prototype.applyInternalDefaults.call(this);\r\n if (!$type.hasValue(this.readerTitle)) {\r\n this.readerTitle = this.language.translate(\"Chart\");\r\n }\r\n };\r\n /**\r\n * Initiates drawing of the chart.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Chart.prototype.draw = function () {\r\n this.fixLayout();\r\n _super.prototype.draw.call(this);\r\n };\r\n /**\r\n * Updates legend's hierarchy based on the position.\r\n */\r\n Chart.prototype.fixLayout = function () {\r\n var legend = this.legend;\r\n if (legend) {\r\n var chartAndLegendContainer = this.chartAndLegendContainer;\r\n var chartContainer = this.chartContainer;\r\n chartContainer.x = undefined;\r\n chartContainer.y = undefined;\r\n legend.x = undefined;\r\n legend.y = undefined;\r\n switch (legend.position) {\r\n case \"left\":\r\n chartAndLegendContainer.layout = \"horizontal\";\r\n legend.toBack();\r\n break;\r\n case \"right\":\r\n chartAndLegendContainer.layout = \"horizontal\";\r\n legend.toFront();\r\n break;\r\n case \"top\":\r\n chartAndLegendContainer.layout = \"vertical\";\r\n legend.toBack();\r\n break;\r\n case \"bottom\":\r\n chartAndLegendContainer.layout = \"vertical\";\r\n legend.toFront();\r\n }\r\n }\r\n };\r\n /**\r\n * Setups the legend to use the chart's data.\r\n */\r\n Chart.prototype.feedLegend = function () {\r\n // Nothing here. This method is provided only as a \"placeholder\" for\r\n // extending classes to override\r\n };\r\n /**\r\n * Adds a new title to the chart when it is inserted into chart's titles\r\n * list.\r\n * @param event An event object which is triggered when inserting into titles list\r\n * @return Label object\r\n */\r\n Chart.prototype.processTitle = function (event) {\r\n var title = event.newValue;\r\n title.parent = this;\r\n title.toBack();\r\n title.shouldClone = false;\r\n title.align = \"center\";\r\n // Need to explicitly apply the `id` attribute so it can be referenced by\r\n // `aria-labelledby`\r\n title.uidAttr();\r\n return title;\r\n };\r\n /**\r\n * Checks if chart has any title elements. If it does, we will use them in an\r\n * `aria-labelledby` attribute so that screen readers can use them to properly\r\n * describe the chart when it is focused or hovered.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Chart.prototype.updateReaderTitleReferences = function () {\r\n if (this.titles.length) {\r\n var titleIds_1 = [];\r\n $iter.each(this.titles.iterator(), function (title) {\r\n titleIds_1.push(title.uid);\r\n });\r\n this.setSVGAttribute({ \"aria-labelledby\": titleIds_1.join(\" \") });\r\n }\r\n else {\r\n this.removeSVGAttribute(\"aria-labelledby\");\r\n }\r\n };\r\n Object.defineProperty(Chart.prototype, \"legend\", {\r\n /**\r\n * @return Legend\r\n */\r\n get: function () {\r\n return this._legend.get();\r\n },\r\n /**\r\n * Holds the instance of chart's [[Leged]].\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/legend/} for more information about legends\r\n * @param Legend\r\n */\r\n set: function (legend) {\r\n this.setLegend(legend);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Prepares the legend instance for use in this chart.\r\n *\r\n * @param legend Legend\r\n */\r\n Chart.prototype.setLegend = function (legend) {\r\n var _this = this;\r\n if (this._legend.get() !== legend) {\r\n if (legend) {\r\n // Set legend options\r\n legend.parent = this.chartAndLegendContainer;\r\n this._legend.set(legend, legend.events.on(\"propertychanged\", function (event) {\r\n if (event.property == \"position\") {\r\n _this.fixLayout();\r\n }\r\n }, undefined, false));\r\n legend.addDisposer(new Disposer(function () {\r\n _this.legend = undefined;\r\n }));\r\n }\r\n else {\r\n this._legend.reset();\r\n }\r\n this.feedLegend();\r\n }\r\n };\r\n /**\r\n * Destroys this object and all related data.\r\n */\r\n Chart.prototype.dispose = function () {\r\n // otherwise there might be some errors when disposing chart which was just inited\r\n if (this.legend) {\r\n this.legend.dispose();\r\n }\r\n _super.prototype.dispose.call(this);\r\n };\r\n /**\r\n * Processes JSON-based config before it is applied to the object.\r\n *\r\n * @ignore Exclude from docs\r\n * @param config Config\r\n */\r\n Chart.prototype.processConfig = function (config) {\r\n if (config) {\r\n // Set up legend\r\n if ($type.hasValue(config.legend) && !$type.hasValue(config.legend.type)) {\r\n config.legend.type = \"Legend\";\r\n }\r\n }\r\n _super.prototype.processConfig.call(this, config);\r\n };\r\n /**\r\n * Copies all properties from another instance of [[Series]].\r\n *\r\n * @param source Source series\r\n */\r\n Chart.prototype.copyFrom = function (source) {\r\n this.titles.copyFrom(source.titles);\r\n this.chartContainer.copyFrom(source.chartContainer);\r\n if (source.legend) {\r\n this.legend = source.legend.clone();\r\n this.legend.removeChildren();\r\n }\r\n _super.prototype.copyFrom.call(this, source);\r\n };\r\n Object.defineProperty(Chart.prototype, \"dragGrip\", {\r\n /**\r\n * @return Grip\r\n */\r\n get: function () {\r\n var _this = this;\r\n if (!this._dragGrip) {\r\n var grip_1 = this.tooltipContainer.createChild(Grip);\r\n grip_1.align = \"right\";\r\n grip_1.valign = \"middle\";\r\n grip_1.hide(0);\r\n grip_1.events.on(\"down\", function (ev) {\r\n if (ev.touch) {\r\n _this.interactionsEnabled = false;\r\n }\r\n });\r\n grip_1.events.on(\"up\", function (ev) {\r\n _this.interactionsEnabled = true;\r\n });\r\n this.events.on(\"down\", function (ev) {\r\n if (ev.touch) {\r\n grip_1.show();\r\n }\r\n });\r\n this._dragGrip = grip_1;\r\n }\r\n return this._dragGrip;\r\n },\r\n /**\r\n * An instance of [[Grip]] which serves as a grip point which appears on\r\n * touch and allows scrolling whole page even if chart is occupying the\r\n * whole of the screen and would otherwise prevent scrolling.\r\n *\r\n * @since 4.4.0\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/touch/} For more information.\r\n * @param value Grip\r\n */\r\n set: function (value) {\r\n this._dragGrip = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Chart.prototype, \"focusable\", {\r\n get: function () {\r\n return this.parent.focusable;\r\n },\r\n set: function (value) {\r\n this.parent.focusable = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return Chart;\r\n}(Component));\r\nexport { Chart };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Chart\"] = Chart;\r\n/**\r\n * Add default responsive rules\r\n */\r\n/**\r\n * Reduce horizontal margins\r\n */\r\ndefaultRules.push({\r\n relevant: ResponsiveBreakpoints.widthXS,\r\n state: function (target, stateId) {\r\n if (target instanceof Chart) {\r\n var state = target.states.create(stateId);\r\n if (target.pixelPaddingLeft > 10) {\r\n state.properties.paddingLeft = 10;\r\n }\r\n if (target.pixelPaddingRight > 10) {\r\n state.properties.paddingRight = 10;\r\n }\r\n return state;\r\n }\r\n return null;\r\n }\r\n});\r\n/**\r\n * Reduce vertical margins\r\n */\r\ndefaultRules.push({\r\n relevant: ResponsiveBreakpoints.heightXS,\r\n state: function (target, stateId) {\r\n if (target instanceof Chart) {\r\n var state = target.states.create(stateId);\r\n if (target.pixelPaddingTop > 10) {\r\n state.properties.paddingTop = 10;\r\n }\r\n if (target.pixelPaddingBottom > 10) {\r\n state.properties.paddingBottom = 10;\r\n }\r\n return state;\r\n }\r\n return null;\r\n }\r\n});\r\n/**\r\n * Remove horizontal padding\r\n */\r\ndefaultRules.push({\r\n relevant: ResponsiveBreakpoints.widthXXS,\r\n state: function (target, stateId) {\r\n if (target instanceof Chart) {\r\n var state = target.states.create(stateId);\r\n state.properties.paddingLeft = 0;\r\n state.properties.paddingRight = 0;\r\n return state;\r\n }\r\n return null;\r\n }\r\n});\r\n/**\r\n * Remove vertical padding\r\n */\r\ndefaultRules.push({\r\n relevant: ResponsiveBreakpoints.heightXXS,\r\n state: function (target, stateId) {\r\n if (target instanceof Chart) {\r\n var state = target.states.create(stateId);\r\n state.properties.paddingTop = 0;\r\n state.properties.paddingBottom = 0;\r\n return state;\r\n }\r\n return null;\r\n }\r\n});\r\n","/**\r\n * Legend-related functionality.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Component } from \"../core/Component\";\r\nimport { DataItem } from \"../core/DataItem\";\r\nimport { ListTemplate, ListDisposer } from \"../core/utils/List\";\r\nimport { RoundedRectangle } from \"../core/elements/RoundedRectangle\";\r\nimport { Container } from \"../core/Container\";\r\nimport { Label } from \"../core/elements/Label\";\r\nimport { keyboard } from \"../core/utils/Keyboard\";\r\nimport { registry } from \"../core/Registry\";\r\nimport { getInteraction } from \"../core/interaction/Interaction\";\r\nimport { percent, Percent } from \"../core/utils/Percent\";\r\nimport { InterfaceColorSet } from \"../core/utils/InterfaceColorSet\";\r\nimport * as $utils from \"../core/utils/Utils\";\r\nimport * as $type from \"../core/utils/Type\";\r\nimport * as $math from \"../core/utils/Math\";\r\nimport { Sprite } from \"../core/Sprite\";\r\nimport { Disposer } from \"../core/utils/Disposer\";\r\nimport { MouseCursorStyle } from \"../core/interaction/Mouse\";\r\nimport { defaultRules, ResponsiveBreakpoints } from \"../core/utils/Responsive\";\r\nimport { Scrollbar } from \"../core/elements/Scrollbar\";\r\n/**\r\n * ============================================================================\r\n * DATA ITEM\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Defines a [[DataItem]] for [[Legend]].\r\n *\r\n * @see {@link DataItem}\r\n */\r\nvar LegendDataItem = /** @class */ (function (_super) {\r\n __extends(LegendDataItem, _super);\r\n /**\r\n * Constructor\r\n */\r\n function LegendDataItem() {\r\n var _this = _super.call(this) || this;\r\n /**\r\n * @ignore\r\n */\r\n _this.childrenCreated = false;\r\n _this.className = \"LegendDataItem\";\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n Object.defineProperty(LegendDataItem.prototype, \"label\", {\r\n /**\r\n * A legend item's [[Label]] element.\r\n *\r\n * @return Label\r\n */\r\n get: function () {\r\n var _this = this;\r\n if (!this._label) {\r\n var label_1 = this.component.labels.create();\r\n this._label = label_1;\r\n this.addSprite(label_1);\r\n this._disposers.push(label_1);\r\n label_1.parent = this.itemContainer;\r\n this._disposers.push(new Disposer(function () {\r\n if ($type.hasValue(_this.component)) {\r\n _this.component.labels.removeValue(label_1);\r\n }\r\n }));\r\n }\r\n return this._label;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(LegendDataItem.prototype, \"color\", {\r\n /**\r\n * @return Main color\r\n */\r\n get: function () {\r\n return this.properties.color;\r\n },\r\n /**\r\n * Main color of legend data item.\r\n *\r\n * This is set by the target element this legend item represents, like\r\n * a Series or a Slice.\r\n *\r\n * It can be used to derive a color in legend's sub-items, like label:\r\n *\r\n * ```TypeScript\r\n * chart.legend.labels.template.text = \"[{color}]{name}[/]\";\r\n * ```\r\n * ```JavaScript\r\n * chart.legend.labels.template.text = \"[{color}]{name}[/]\";\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"legend\": {\r\n * // ...\r\n * \"labels\": {\r\n * \"text\": \"[{color}]{name}[/]\"\r\n * }\r\n * }\r\n * }\r\n * ```\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/legend/#Legend_labels} For more information about configuring legend labels.\r\n * @param value Main color\r\n */\r\n set: function (value) {\r\n this.setProperty(\"color\", value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(LegendDataItem.prototype, \"valueLabel\", {\r\n /**\r\n * A legend item's [[Label]] element for \"value label\".\r\n *\r\n * @return Label\r\n */\r\n get: function () {\r\n var _this = this;\r\n if (!this._valueLabel) {\r\n var valueLabel_1 = this.component.valueLabels.create();\r\n this._valueLabel = valueLabel_1;\r\n this.addSprite(valueLabel_1);\r\n this._disposers.push(valueLabel_1);\r\n valueLabel_1.parent = this.itemContainer;\r\n this._disposers.push(new Disposer(function () {\r\n if ($type.hasValue(_this.component)) {\r\n _this.component.valueLabels.removeValue(valueLabel_1);\r\n }\r\n }));\r\n }\r\n return this._valueLabel;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(LegendDataItem.prototype, \"itemContainer\", {\r\n /**\r\n * A reference to the main [[Container]] that holds legend item's elements:\r\n * marker and labels.\r\n *\r\n * @return Item container\r\n */\r\n get: function () {\r\n var _this = this;\r\n if (!this._itemContainer) {\r\n var component_1 = this.component;\r\n var itemContainer_1 = component_1.itemContainers.create();\r\n itemContainer_1.parent = component_1;\r\n this._itemContainer = itemContainer_1;\r\n this.addSprite(itemContainer_1);\r\n this._disposers.push(itemContainer_1);\r\n // Add click/tap event to toggle item\r\n if (itemContainer_1.togglable) {\r\n itemContainer_1.events.on(\"toggled\", function (ev) {\r\n component_1.toggleDataItem(ev.target.dataItem);\r\n }, undefined, false);\r\n }\r\n // Add focus event so that we can track which object is currently in focus\r\n // for keyboard toggling\r\n if (itemContainer_1.focusable) {\r\n itemContainer_1.events.on(\"hit\", function (ev) {\r\n // We need this here in order to reset focused item when it is clicked\r\n // normally so that it is not toggled by ENTER afterwards\r\n component_1.focusedItem = undefined;\r\n }, undefined, false);\r\n itemContainer_1.events.on(\"focus\", function (ev) {\r\n component_1.focusedItem = ev.target.dataItem;\r\n }, undefined, false);\r\n itemContainer_1.events.on(\"blur\", function (ev) {\r\n component_1.focusedItem = undefined;\r\n }, undefined, false);\r\n }\r\n this._disposers.push(new Disposer(function () {\r\n if ($type.hasValue(_this.component)) {\r\n _this.component.itemContainers.removeValue(itemContainer_1);\r\n }\r\n }));\r\n if (this.dataContext.uidAttr) {\r\n itemContainer_1.readerControls = this.dataContext.uidAttr();\r\n itemContainer_1.readerLabelledBy = this.dataContext.uidAttr();\r\n }\r\n var sprite = this.dataContext;\r\n if ((sprite instanceof DataItem || sprite instanceof Sprite) && !sprite.isDisposed()) {\r\n var visibilitychanged = function (ev) {\r\n itemContainer_1.readerChecked = ev.visible;\r\n itemContainer_1.events.disableType(\"toggled\");\r\n itemContainer_1.isActive = !ev.visible;\r\n itemContainer_1.events.enableType(\"toggled\");\r\n };\r\n sprite.addDisposer(new Disposer(function () {\r\n if (_this.component) {\r\n _this.component.dataItems.remove(_this);\r\n }\r\n }));\r\n if (sprite instanceof Sprite) {\r\n itemContainer_1.addDisposer(sprite.events.on(\"visibilitychanged\", visibilitychanged, undefined, false));\r\n itemContainer_1.addDisposer(sprite.events.on(\"hidden\", function (ev) {\r\n itemContainer_1.readerChecked = false;\r\n itemContainer_1.events.disableType(\"toggled\");\r\n itemContainer_1.isActive = true;\r\n itemContainer_1.events.enableType(\"toggled\");\r\n }, undefined, false));\r\n itemContainer_1.addDisposer(sprite.events.on(\"shown\", function (ev) {\r\n itemContainer_1.readerChecked = true;\r\n itemContainer_1.events.disableType(\"toggled\");\r\n itemContainer_1.isActive = false;\r\n itemContainer_1.events.enableType(\"toggled\");\r\n }, undefined, false));\r\n }\r\n else {\r\n itemContainer_1.addDisposer(sprite.events.on(\"visibilitychanged\", visibilitychanged, undefined, false));\r\n }\r\n }\r\n }\r\n return this._itemContainer;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(LegendDataItem.prototype, \"marker\", {\r\n /**\r\n * A [[Container]] that holds legend item's marker element.\r\n *\r\n * @return Marker\r\n */\r\n get: function () {\r\n var _this = this;\r\n if (!this._marker) {\r\n var marker_1 = this.component.markers.create();\r\n this._marker = marker_1;\r\n marker_1.parent = this.itemContainer;\r\n this.addSprite(marker_1);\r\n this._disposers.push(marker_1);\r\n this._disposers.push(new Disposer(function () {\r\n if ($type.hasValue(_this.component)) {\r\n _this.component.markers.removeValue(marker_1);\r\n }\r\n }));\r\n }\r\n return this._marker;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return LegendDataItem;\r\n}(DataItem));\r\nexport { LegendDataItem };\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Defines a class that carries legend settings.\r\n *\r\n * A legend might change its settings dynamically. Legend can also be shared\r\n * by several elements, requiring different settings.\r\n *\r\n * Having legend's settings in a separate object is a good way to \"hot swap\"\r\n * a set of settings for the legend.\r\n */\r\nvar LegendSettings = /** @class */ (function () {\r\n function LegendSettings() {\r\n /**\r\n * Should marker be created for each legend item.\r\n */\r\n this.createMarker = true;\r\n }\r\n return LegendSettings;\r\n}());\r\nexport { LegendSettings };\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * [[Legend]] class is used to create legend for the chart.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/legend/} for Legend documentation\r\n * @see {@link ILegendEvents} for a list of available events\r\n * @see {@link ILegendAdapters} for a list of available Adapters\r\n */\r\nvar Legend = /** @class */ (function (_super) {\r\n __extends(Legend, _super);\r\n /**\r\n * Constructor\r\n */\r\n function Legend() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"Legend\";\r\n // Set defaults\r\n _this.layout = \"grid\";\r\n _this.setPropertyValue(\"useDefaultMarker\", false);\r\n _this.setPropertyValue(\"scrollable\", false);\r\n _this.setPropertyValue(\"contentAlign\", \"center\");\r\n // Create a template container and list for legend items\r\n var itemContainer = new Container();\r\n itemContainer.applyOnClones = true;\r\n itemContainer.padding(8, 0, 8, 0);\r\n itemContainer.margin(0, 10, 0, 10);\r\n itemContainer.layout = \"horizontal\";\r\n itemContainer.clickable = true;\r\n itemContainer.focusable = true;\r\n itemContainer.role = \"switch\";\r\n itemContainer.togglable = true;\r\n itemContainer.cursorOverStyle = MouseCursorStyle.pointer;\r\n itemContainer.background.fillOpacity = 0; // creates hit area\r\n // Create container list using item template we just created\r\n _this.itemContainers = new ListTemplate(itemContainer);\r\n _this._disposers.push(new ListDisposer(_this.itemContainers));\r\n _this._disposers.push(_this.itemContainers.template);\r\n // Set up global keyboard events for toggling elements\r\n _this._disposers.push(getInteraction().body.events.on(\"keyup\", function (ev) {\r\n if (keyboard.isKey(ev.event, \"enter\") && _this.focusedItem) {\r\n var focusedItem = _this.focusedItem;\r\n var target = focusedItem.itemContainer;\r\n if (target.togglable) {\r\n _this.toggleDataItem(focusedItem);\r\n }\r\n else if (target.clickable && target.events.isEnabled(\"hit\")) {\r\n target.dispatchImmediately(\"hit\", { event: ev });\r\n // We need this here because \"hit\" event resets `this.focusedItem`\r\n // And we need it here\r\n _this.focusedItem = focusedItem;\r\n }\r\n }\r\n }, _this));\r\n var interfaceColors = new InterfaceColorSet();\r\n // Create a template container and list for the a marker\r\n var marker = new Container();\r\n marker.width = 23;\r\n marker.height = 23;\r\n marker.interactionsEnabled = false;\r\n marker.applyOnClones = true;\r\n marker.setStateOnChildren = true;\r\n marker.background.fillOpacity = 0;\r\n marker.background.strokeOpacity = 0;\r\n marker.propertyFields.fill = \"fill\";\r\n marker.valign = \"middle\";\r\n var disabledColor = interfaceColors.getFor(\"disabledBackground\");\r\n marker.events.on(\"childadded\", function (event) {\r\n var child = event.newValue;\r\n var activeState = child.states.create(\"active\");\r\n activeState.properties.stroke = disabledColor;\r\n activeState.properties.fill = disabledColor;\r\n });\r\n _this.markers = new ListTemplate(marker);\r\n _this._disposers.push(new ListDisposer(_this.markers));\r\n _this._disposers.push(_this.markers.template);\r\n // Create a legend background element\r\n var rectangle = marker.createChild(RoundedRectangle);\r\n rectangle.width = percent(100);\r\n rectangle.height = percent(100);\r\n rectangle.applyOnClones = true;\r\n rectangle.propertyFields.fill = \"fill\"; //othrwise old edge doesn't like as the same pattern is set both on parent and child https://codepen.io/team/amcharts/pen/72d7a98f3fb811d3118795220ff63182\r\n rectangle.strokeOpacity = 0;\r\n // Create a template container and list for item labels\r\n var label = new Label();\r\n label.text = \"{name}\";\r\n label.margin(0, 5, 0, 5);\r\n label.valign = \"middle\";\r\n label.applyOnClones = true;\r\n label.states.create(\"active\").properties.fill = interfaceColors.getFor(\"disabledBackground\");\r\n _this.labels = new ListTemplate(label);\r\n _this._disposers.push(new ListDisposer(_this.labels));\r\n _this._disposers.push(_this.labels.template);\r\n label.interactionsEnabled = false;\r\n label.truncate = true;\r\n label.fullWords = false;\r\n // Create a template container and list for item value labels\r\n var valueLabel = new Label();\r\n valueLabel.margin(0, 5, 0, 0);\r\n valueLabel.valign = \"middle\";\r\n valueLabel.width = 50; // to avoid rearranging legend entries when value changes.\r\n valueLabel.align = \"right\";\r\n valueLabel.textAlign = \"end\";\r\n valueLabel.applyOnClones = true;\r\n valueLabel.states.create(\"active\").properties.fill = interfaceColors.getFor(\"disabledBackground\");\r\n valueLabel.interactionsEnabled = false;\r\n _this.valueLabels = new ListTemplate(valueLabel);\r\n _this._disposers.push(new ListDisposer(_this.valueLabels));\r\n _this._disposers.push(_this.valueLabels.template);\r\n _this.position = \"bottom\"; // don't use setPropertyValue here!\r\n // Create a state for disabled legend items\r\n itemContainer.states.create(\"active\");\r\n itemContainer.setStateOnChildren = true;\r\n // Apply accessibility settings\r\n _this.role = \"group\";\r\n _this.events.on(\"layoutvalidated\", _this.handleScrollbar, _this, false);\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Sets defaults that instantiate some objects that rely on parent, so they\r\n * cannot be set in constructor.\r\n */\r\n Legend.prototype.applyInternalDefaults = function () {\r\n _super.prototype.applyInternalDefaults.call(this);\r\n if (!$type.hasValue(this.readerTitle)) {\r\n this.readerTitle = this.language.translate(\"Legend\");\r\n }\r\n };\r\n /**\r\n * Returns a new/empty DataItem of the type appropriate for this object.\r\n *\r\n * @see {@link DataItem}\r\n * @return Data Item\r\n */\r\n Legend.prototype.createDataItem = function () {\r\n return new LegendDataItem();\r\n };\r\n /**\r\n * [validateDataElements description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\n Legend.prototype.validateDataElements = function () {\r\n if (this.scrollbar) {\r\n this.scrollbar.start = 0;\r\n this.scrollbar.end = 1;\r\n }\r\n _super.prototype.validateDataElements.call(this);\r\n };\r\n /**\r\n * [validateDataElement description]\r\n *\r\n * @ignore Exclude from docs\r\n * @param dataItem Data item\r\n * @todo Description\r\n * @todo Figure out how to update appearance of legend item without losing focus\r\n * @todo Update legend marker appearance as apperance of related series changes\r\n */\r\n Legend.prototype.validateDataElement = function (dataItem) {\r\n _super.prototype.validateDataElement.call(this, dataItem);\r\n // Get data item (legend item's) container\r\n var container = dataItem.itemContainer;\r\n var marker = dataItem.marker;\r\n $utils.used(dataItem.label);\r\n var valueLabel = dataItem.valueLabel;\r\n // Set parent and update current state\r\n container.readerChecked = dataItem.dataContext.visible;\r\n // Tell series its legend data item\r\n dataItem.dataContext.legendDataItem = dataItem;\r\n var tempMaxWidth = dataItem.label.maxWidth;\r\n if (!(dataItem.label.width instanceof Percent)) {\r\n dataItem.label.width = undefined;\r\n }\r\n if (tempMaxWidth > 0) {\r\n dataItem.label.maxWidth = tempMaxWidth;\r\n }\r\n if (valueLabel.align == \"right\") {\r\n valueLabel.width = undefined;\r\n }\r\n var legendSettings = dataItem.dataContext.legendSettings;\r\n // If we are not using default markers, create a unique legend marker based\r\n // on the data item type\r\n var dataContext = dataItem.dataContext;\r\n if (dataContext.createLegendMarker && (!this.useDefaultMarker || !(dataContext instanceof Sprite))) {\r\n if (!dataItem.childrenCreated) {\r\n dataContext.createLegendMarker(marker);\r\n dataItem.childrenCreated = true;\r\n }\r\n }\r\n else {\r\n this.markers.template.propertyFields.fill = undefined;\r\n }\r\n if (dataContext.updateLegendValue) {\r\n dataContext.updateLegendValue(); // this solves issue with external legend, as legend is created after chart updates legend values\r\n }\r\n if (dataContext.component && dataContext.component.updateLegendValue) {\r\n dataContext.component.updateLegendValue(dataContext);\r\n }\r\n if (valueLabel.invalid) {\r\n valueLabel.validate();\r\n }\r\n if (valueLabel.text == \"\" || valueLabel.text == undefined) {\r\n valueLabel.__disabled = true;\r\n }\r\n else {\r\n valueLabel.__disabled = false;\r\n }\r\n if (legendSettings && (legendSettings.itemValueText != undefined || legendSettings.valueText != undefined)) {\r\n valueLabel.__disabled = false;\r\n }\r\n var visible = dataItem.dataContext.visible;\r\n if (visible === undefined) {\r\n visible = true;\r\n }\r\n visible = $type.toBoolean(visible);\r\n dataItem.dataContext.visible = visible;\r\n container.events.disableType(\"toggled\");\r\n container.isActive = !visible;\r\n if (container.isActive) {\r\n container.setState(\"active\", 0);\r\n }\r\n else {\r\n container.setState(\"default\", 0);\r\n }\r\n container.events.enableType(\"toggled\");\r\n };\r\n Legend.prototype.afterDraw = function () {\r\n var _this = this;\r\n var maxWidth = this.getPropertyValue(\"maxWidth\");\r\n var maxLabelWidth = 0;\r\n this.labels.each(function (label) {\r\n if (label.invalid) {\r\n label.maxWidth = undefined;\r\n label.validate();\r\n }\r\n if (label.measuredWidth + label.pixelMarginLeft + label.pixelMarginRight > maxLabelWidth) {\r\n maxLabelWidth = label.measuredWidth + label.pixelMarginLeft + label.pixelMarginRight;\r\n }\r\n });\r\n var maxValueLabelWidth = 0;\r\n this.valueLabels.each(function (label) {\r\n if (label.invalid) {\r\n label.validate();\r\n }\r\n if (label.measuredWidth + label.pixelMarginLeft + label.pixelMarginRight > maxValueLabelWidth) {\r\n maxValueLabelWidth = label.measuredWidth + label.pixelMarginLeft + label.pixelMarginRight;\r\n }\r\n });\r\n var maxMarkerWidth = 0;\r\n this.markers.each(function (marker) {\r\n if (marker.invalid) {\r\n marker.validate();\r\n }\r\n if (marker.measuredWidth + marker.pixelMarginLeft + marker.pixelMarginRight > maxMarkerWidth) {\r\n maxMarkerWidth = marker.measuredWidth + marker.pixelMarginLeft + marker.pixelMarginRight;\r\n }\r\n });\r\n var itemContainer = this.itemContainers.template;\r\n var margin = itemContainer.pixelMarginRight + itemContainer.pixelMarginLeft;\r\n var maxAdjustedLabelWidth;\r\n var trueMaxWidth = maxLabelWidth + maxValueLabelWidth + maxMarkerWidth;\r\n if (!$type.isNumber(maxWidth)) {\r\n maxAdjustedLabelWidth = maxLabelWidth;\r\n }\r\n else {\r\n maxWidth = maxWidth - margin;\r\n if (maxWidth > trueMaxWidth) {\r\n maxWidth = trueMaxWidth;\r\n }\r\n maxAdjustedLabelWidth = maxWidth - maxMarkerWidth - maxValueLabelWidth;\r\n }\r\n this.labels.each(function (label) {\r\n if (_this.valueLabels.template.align == \"right\" || label.measuredWidth > maxAdjustedLabelWidth) {\r\n if (!(label.width instanceof Percent)) {\r\n label.width = Math.min(label.maxWidth, maxAdjustedLabelWidth - label.pixelMarginLeft - label.pixelMarginRight);\r\n }\r\n }\r\n });\r\n if (this.valueLabels.template.align == \"right\") {\r\n this.valueLabels.each(function (valueLabel) {\r\n valueLabel.width = maxValueLabelWidth - valueLabel.pixelMarginRight - valueLabel.pixelMarginLeft;\r\n });\r\n }\r\n _super.prototype.afterDraw.call(this);\r\n };\r\n Legend.prototype.handleScrollbar = function () {\r\n var scrollbar = this.scrollbar;\r\n if (this.scrollable && scrollbar) {\r\n scrollbar.height = this.measuredHeight;\r\n scrollbar.x = this.measuredWidth - scrollbar.pixelWidth - scrollbar.pixelMarginLeft;\r\n if (this.contentHeight > this.measuredHeight) {\r\n scrollbar.visible = true;\r\n scrollbar.thumb.height = scrollbar.height * this.measuredHeight / this.contentHeight;\r\n this.paddingRight = scrollbar.pixelWidth + scrollbar.pixelMarginLeft + +scrollbar.pixelMarginRight;\r\n }\r\n else {\r\n scrollbar.visible = false;\r\n }\r\n this.updateMasks();\r\n }\r\n };\r\n Object.defineProperty(Legend.prototype, \"position\", {\r\n /**\r\n * @return Position\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"position\");\r\n },\r\n /**\r\n * Position of the legend.\r\n *\r\n * Options: \"left\", \"right\", \"top\", \"bottom\" (default), or \"absolute\".\r\n *\r\n * IMPORTANT: [[MapChart]] will ignore this setting, as it is using different\r\n * layout structure than other charts.\r\n *\r\n * To position legend in [[MapChart]] set legend's `align` (`\"left\"` or\r\n * `\"right\"`) and `valign` (`\"top\"` or `\"bottom\"`) properties instead.\r\n *\r\n * @default \"bottom\"\r\n * @param value Position\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"position\", value)) {\r\n if (value == \"left\" || value == \"right\") {\r\n this.margin(10, 5, 10, 10);\r\n this.valign = \"middle\";\r\n this.contentAlign = \"none\";\r\n this.valueLabels.template.align = \"right\";\r\n if (!$type.isNumber(this.maxColumns)) {\r\n this.maxColumns = 1;\r\n }\r\n this.width = undefined;\r\n this.maxWidth = 220;\r\n }\r\n else {\r\n this.maxColumns = undefined;\r\n this.width = percent(100);\r\n this.valueLabels.template.align = \"left\";\r\n }\r\n this.invalidate();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Legend.prototype, \"useDefaultMarker\", {\r\n /**\r\n * @return Use default marker?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"useDefaultMarker\");\r\n },\r\n /**\r\n * Should legend try to mirror the look of the related item when building\r\n * the marker for legend item?\r\n *\r\n * If set to `false` it will try to make the marker look like its related\r\n * item.\r\n *\r\n * E.g. if an item is for a Line Series, it will display a line of the\r\n * same thickness, color, and will use the same bullets if series have them.\r\n *\r\n * If set to `true`, all markers will be shown as squares, regardless of te\r\n * series type.\r\n *\r\n * @default false\r\n * @param value Use default marker?\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"useDefaultMarker\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Legend.prototype, \"scrollable\", {\r\n /**\r\n * @return Legend Scrollable?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"scrollable\");\r\n },\r\n /**\r\n * If set to `true` the Legend will display a scrollbar if its contents do\r\n * not fit into its `maxHeight`.\r\n *\r\n * Please note that `maxHeight` is automatically set for Legend when its\r\n * `position` is set to `\"left\"` or `\"right\"`.\r\n *\r\n * @default false\r\n * @since 4.8.0\r\n * @param value Legend Scrollable?\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"scrollable\", value, true)) {\r\n if (value) {\r\n var scrollbar = this.createChild(Scrollbar);\r\n this.scrollbar = scrollbar;\r\n scrollbar.isMeasured = false;\r\n scrollbar.orientation = \"vertical\";\r\n scrollbar.endGrip.__disabled = true;\r\n scrollbar.startGrip.__disabled = true;\r\n scrollbar.visible = false;\r\n scrollbar.marginLeft = 5;\r\n this._mouseWheelDisposer = this.events.on(\"wheel\", this.handleWheel, this, false);\r\n this._disposers.push(this._mouseWheelDisposer);\r\n this._disposers.push(scrollbar.events.on(\"rangechanged\", this.updateMasks, this, false));\r\n }\r\n else {\r\n if (this._mouseWheelDisposer) {\r\n this._mouseWheelDisposer.dispose();\r\n if (this.scrollbar) {\r\n this.scrollbar.dispose();\r\n this.scrollbar = undefined;\r\n }\r\n }\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Handles mouse wheel scrolling of legend.\r\n *\r\n * @param event Event\r\n */\r\n Legend.prototype.handleWheel = function (event) {\r\n var shift = event.shift.y;\r\n var scrollbar = this.scrollbar;\r\n if (scrollbar) {\r\n var ds = (shift / 1000 * this.measuredHeight / this.contentHeight);\r\n var delta = scrollbar.end - scrollbar.start;\r\n if (shift > 0) {\r\n scrollbar.start = $math.max(0, scrollbar.start - ds);\r\n scrollbar.end = scrollbar.start + delta;\r\n }\r\n else {\r\n scrollbar.end = $math.min(1, scrollbar.end - ds);\r\n scrollbar.start = scrollbar.end - delta;\r\n }\r\n }\r\n };\r\n /**\r\n * @ignore\r\n */\r\n Legend.prototype.updateMasks = function () {\r\n var _this = this;\r\n if (this.scrollbar) {\r\n this.itemContainers.each(function (itemContainer) {\r\n itemContainer.dy = -_this.scrollbar.thumb.pixelY * _this.contentHeight / _this.measuredHeight;\r\n itemContainer.maskRectangle = { x: 0, y: -itemContainer.dy, width: _this.measuredWidth, height: _this.measuredHeight };\r\n });\r\n }\r\n };\r\n /**\r\n * Toggles a legend item.\r\n *\r\n * @ignore Exclude from docs\r\n * @param item Legend item\r\n * @todo Maybe do it with togglable instead\r\n */\r\n Legend.prototype.toggleDataItem = function (item) {\r\n var dataContext = item.dataContext;\r\n if (!dataContext.visible || dataContext.isHiding || (dataContext instanceof Sprite && dataContext.isHidden)) {\r\n item.color = item.colorOrig;\r\n item.itemContainer.isActive = false;\r\n if (dataContext.hidden === true) {\r\n dataContext.hidden = false;\r\n }\r\n if (dataContext.show) {\r\n dataContext.show();\r\n }\r\n else {\r\n dataContext.visible = true;\r\n }\r\n this.svgContainer.readerAlert(this.language.translate(\"%1 shown\", this.language.locale, item.label.readerTitle));\r\n }\r\n else {\r\n item.itemContainer.isActive = true;\r\n if (dataContext.hide) {\r\n dataContext.hide();\r\n }\r\n else {\r\n dataContext.visible = false;\r\n }\r\n this.svgContainer.readerAlert(this.language.translate(\"%1 hidden\", this.language.locale, item.label.readerTitle));\r\n item.color = new InterfaceColorSet().getFor(\"disabledBackground\");\r\n }\r\n };\r\n Object.defineProperty(Legend.prototype, \"preloader\", {\r\n /**\r\n * Override preloader method so that legend does not accidentally show its\r\n * own preloader.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Always `undefined`\r\n */\r\n get: function () {\r\n return;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * [handleDataItemPropertyChange description]\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Legend.prototype.handleDataItemPropertyChange = function (dataItem, name) {\r\n dataItem.valueLabel.invalidate();\r\n dataItem.label.invalidate();\r\n };\r\n return Legend;\r\n}(Component));\r\nexport { Legend };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Legend\"] = Legend;\r\n/**\r\n * Add default responsive rules\r\n */\r\n/**\r\n * Move legend to below the chart if chart is narrow\r\n */\r\ndefaultRules.push({\r\n relevant: ResponsiveBreakpoints.widthXS,\r\n state: function (target, stateId) {\r\n if (target instanceof Legend && (target.position == \"left\" || target.position == \"right\")) {\r\n var state = target.states.create(stateId);\r\n state.properties.position = \"bottom\";\r\n return state;\r\n }\r\n return null;\r\n }\r\n});\r\n/**\r\n * Move legend to the right if chart is very short\r\n */\r\ndefaultRules.push({\r\n relevant: ResponsiveBreakpoints.heightXS,\r\n state: function (target, stateId) {\r\n if (target instanceof Legend && (target.position == \"top\" || target.position == \"bottom\")) {\r\n var state = target.states.create(stateId);\r\n state.properties.position = \"right\";\r\n return state;\r\n }\r\n return null;\r\n }\r\n});\r\n/**\r\n * Disable legend altogether on small charts\r\n */\r\ndefaultRules.push({\r\n relevant: ResponsiveBreakpoints.isXS,\r\n state: function (target, stateId) {\r\n if (target instanceof Legend) {\r\n var state = target.states.create(stateId);\r\n state.properties.disabled = true;\r\n return state;\r\n }\r\n return null;\r\n }\r\n});\r\n","/**\r\n * Base class for all Axis\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Component } from \"../../core/Component\";\r\nimport { Container } from \"../../core/Container\";\r\nimport { DataItem } from \"../../core/DataItem\";\r\nimport { AxisBreak } from \"./AxisBreak\";\r\nimport { Label } from \"../../core/elements/Label\";\r\nimport { Tooltip } from \"../../core/elements/Tooltip\";\r\nimport { SortedListTemplate } from \"../../core/utils/SortedList\";\r\nimport { List, ListTemplate, ListDisposer } from \"../../core/utils/List\";\r\nimport { Disposer, MultiDisposer } from \"../../core/utils/Disposer\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport { InterfaceColorSet } from \"../../core/utils/InterfaceColorSet\";\r\nimport * as $iter from \"../../core/utils/Iterator\";\r\nimport * as $math from \"../../core/utils/Math\";\r\nimport * as $utils from \"../../core/utils/Utils\";\r\nimport * as $number from \"../../core/utils/Number\";\r\nimport * as $array from \"../../core/utils/Array\";\r\nimport * as $type from \"../../core/utils/Type\";\r\nimport { defaultRules, ResponsiveBreakpoints } from \"../../core/utils/Responsive\";\r\n/**\r\n * ============================================================================\r\n * DATA ITEM\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Defines a [[DataItem]] for [[Axis]].\r\n *\r\n * @see {@link DataItem}\r\n */\r\nvar AxisDataItem = /** @class */ (function (_super) {\r\n __extends(AxisDataItem, _super);\r\n /**\r\n * Constructor\r\n */\r\n function AxisDataItem() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"AxisDataItem\";\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n Object.defineProperty(AxisDataItem.prototype, \"grid\", {\r\n /**\r\n * @return Grid element\r\n */\r\n get: function () {\r\n if (!this._grid) {\r\n var component_1 = this.component;\r\n if (component_1) {\r\n var template = void 0;\r\n var grid_1;\r\n if (this.isRange) {\r\n template = component_1.axisRanges.template.grid;\r\n if (template.disabled) {\r\n return;\r\n }\r\n else {\r\n grid_1 = template.clone();\r\n }\r\n }\r\n else {\r\n template = component_1.renderer.grid.template;\r\n if (template.disabled) {\r\n return;\r\n }\r\n else {\r\n grid_1 = component_1.renderer.grid.create();\r\n this._disposers.push(new Disposer(function () {\r\n component_1.renderer.grid.removeValue(grid_1);\r\n }));\r\n }\r\n }\r\n this.grid = grid_1;\r\n grid_1.shouldClone = false;\r\n this._disposers.push(grid_1);\r\n grid_1.axis = this.component;\r\n }\r\n }\r\n return this._grid;\r\n },\r\n /**\r\n * A [[Grid]] element associated with this data item.\r\n *\r\n * If there is no grid element associated with data item, a new one is\r\n * created and returned.\r\n *\r\n * @param grid Grid element\r\n */\r\n set: function (grid) {\r\n if (this._grid && this._grid != grid) {\r\n $array.remove(this.sprites, this._grid);\r\n this._grid.dataItem = undefined;\r\n }\r\n if (grid) {\r\n if (grid.dataItem && grid.dataItem != this) {\r\n $array.remove(grid.dataItem.sprites, grid);\r\n grid.dataItem.grid = undefined;\r\n }\r\n this.addSprite(grid);\r\n }\r\n this._grid = grid;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(AxisDataItem.prototype, \"tick\", {\r\n /**\r\n * @return Tick element\r\n */\r\n get: function () {\r\n if (!this._tick) {\r\n var component_2 = this.component;\r\n if (component_2) {\r\n var template = void 0;\r\n var tick_1;\r\n if (this.isRange) {\r\n template = component_2.axisRanges.template.tick;\r\n if (template.disabled) {\r\n return;\r\n }\r\n else {\r\n tick_1 = template.clone();\r\n }\r\n }\r\n else {\r\n template = component_2.renderer.ticks.template;\r\n if (template.disabled) {\r\n return;\r\n }\r\n else {\r\n tick_1 = component_2.renderer.ticks.create();\r\n this._disposers.push(new Disposer(function () {\r\n component_2.renderer.ticks.removeValue(tick_1);\r\n }));\r\n }\r\n }\r\n this.tick = tick_1;\r\n tick_1.axis = this.component;\r\n tick_1.shouldClone = false;\r\n this._disposers.push(tick_1);\r\n }\r\n }\r\n return this._tick;\r\n },\r\n /**\r\n * An [[AxisTick]] element associated with this data item.\r\n *\r\n * If there is no tick element associated with data item, a new one is\r\n * created and returned.\r\n *\r\n * @param tick Tick element\r\n */\r\n set: function (tick) {\r\n if (this._tick && this._tick != tick) {\r\n $array.remove(this.sprites, this._tick);\r\n this._tick.dataItem = undefined;\r\n }\r\n if (tick) {\r\n if (tick.dataItem && tick.dataItem != this) {\r\n $array.remove(tick.dataItem.sprites, tick);\r\n tick.dataItem.tick = undefined;\r\n }\r\n this.addSprite(tick);\r\n }\r\n this._tick = tick;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(AxisDataItem.prototype, \"label\", {\r\n /**\r\n * @return Label element\r\n */\r\n get: function () {\r\n if (!this._label) {\r\n var component_3 = this.component;\r\n if (component_3) {\r\n var template = void 0;\r\n var label_1;\r\n if (this.isRange) {\r\n template = component_3.axisRanges.template.label;\r\n if (template.disabled) {\r\n return;\r\n }\r\n else {\r\n label_1 = template.clone();\r\n }\r\n }\r\n else {\r\n template = component_3.renderer.labels.template;\r\n if (template.disabled) {\r\n return;\r\n }\r\n else {\r\n label_1 = component_3.renderer.labels.create();\r\n this._disposers.push(new Disposer(function () {\r\n component_3.renderer.labels.removeValue(label_1);\r\n }));\r\n }\r\n }\r\n this._disposers.push(label_1);\r\n this.label = label_1;\r\n label_1.shouldClone = false;\r\n label_1.axis = this.component;\r\n label_1.virtualParent = component_3;\r\n }\r\n }\r\n return this._label;\r\n },\r\n /**\r\n * An [[AxisLabel]] element associated with this data item.\r\n *\r\n * If there is no label element associated with data item, a new one is\r\n * created and returned.\r\n *\r\n * @param label Label element\r\n */\r\n set: function (label) {\r\n if (this._label && this._label != label) {\r\n $array.remove(this.sprites, this._label);\r\n this._label.dataItem = undefined;\r\n }\r\n if (label) {\r\n if (label.dataItem && label.dataItem != this) {\r\n $array.remove(label.dataItem.sprites, label);\r\n label.dataItem.label = undefined;\r\n }\r\n this.addSprite(label);\r\n }\r\n this._label = label;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(AxisDataItem.prototype, \"axisFill\", {\r\n /**\r\n * @return Label element\r\n */\r\n get: function () {\r\n if (!this._axisFill) {\r\n var component_4 = this.component;\r\n if (component_4) {\r\n var template = void 0;\r\n var axisFill_1;\r\n if (this.isRange) {\r\n template = component_4.axisRanges.template.axisFill;\r\n if (!this.isTemplate && template.disabled) {\r\n return;\r\n }\r\n else {\r\n axisFill_1 = template.clone();\r\n }\r\n }\r\n else {\r\n template = component_4.renderer.axisFills.template;\r\n if (template.disabled) {\r\n return;\r\n }\r\n else {\r\n axisFill_1 = component_4.renderer.axisFills.create();\r\n this._disposers.push(new Disposer(function () {\r\n component_4.renderer.axisFills.removeValue(axisFill_1);\r\n }));\r\n }\r\n }\r\n this.axisFill = axisFill_1;\r\n axisFill_1.shouldClone = false;\r\n this._disposers.push(axisFill_1);\r\n }\r\n }\r\n return this._axisFill;\r\n },\r\n /**\r\n * An [[AxisFill]] associated element with this data item.\r\n *\r\n * If there is no fill element associated with data item, a new one is\r\n * created and returned.\r\n *\r\n * @param label Label element\r\n */\r\n set: function (axisFill) {\r\n if (this._axisFill && this._axisFill != axisFill) {\r\n $array.remove(this.sprites, this._axisFill);\r\n this._axisFill.dataItem = undefined;\r\n }\r\n if (axisFill) {\r\n if (axisFill.dataItem && axisFill.dataItem != this) {\r\n $array.remove(axisFill.dataItem.sprites, axisFill);\r\n axisFill.dataItem.axisFill = undefined;\r\n }\r\n axisFill.axis = this.component;\r\n this.addSprite(axisFill);\r\n }\r\n this._axisFill = axisFill;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(AxisDataItem.prototype, \"text\", {\r\n /**\r\n * @return Text label\r\n */\r\n get: function () {\r\n return this._text;\r\n },\r\n /**\r\n * Text to be used as data item's label.\r\n *\r\n * @param text Text label\r\n */\r\n set: function (text) {\r\n this._text = text;\r\n if (this._label) { // do not use getter, it will create unwanted instances!\r\n this._label.text = text;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(AxisDataItem.prototype, \"mask\", {\r\n /**\r\n * Data item's mask.\r\n *\r\n * @return Mask\r\n */\r\n get: function () {\r\n return this._mask;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(AxisDataItem.prototype, \"contents\", {\r\n /**\r\n * Returns a [[Container]] to place all visual elements, related to data item\r\n * in.\r\n *\r\n * If there is no Container, a new one is created.\r\n *\r\n * @return Contents container\r\n */\r\n get: function () {\r\n if (!this._contents) {\r\n var contents = new Container();\r\n this.addSprite(contents);\r\n contents.isMeasured = false;\r\n this._contents = contents;\r\n var component = this.component;\r\n if (component) {\r\n var mask = component.renderer.createFill(this.component);\r\n mask.disabled = false;\r\n mask.axis = component;\r\n this.addSprite(mask);\r\n this._mask = mask;\r\n contents.mask = mask;\r\n }\r\n }\r\n return this._contents;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(AxisDataItem.prototype, \"axisBreak\", {\r\n /**\r\n * @return Axis break\r\n */\r\n get: function () {\r\n return this._axisBreak;\r\n },\r\n /**\r\n * An [[AxisBreak]] this data item falls within.\r\n *\r\n * @param axisBreak Axis break\r\n */\r\n set: function (axisBreak) {\r\n if (this._axisBreak) {\r\n this._axisBreak.dataItems.removeValue(this);\r\n }\r\n if (axisBreak) {\r\n axisBreak.dataItems.push(this);\r\n }\r\n this._axisBreak = axisBreak;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Re-draws the element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n AxisDataItem.prototype.validate = function () {\r\n if (this.component) {\r\n this.component.validateDataElement(this);\r\n }\r\n };\r\n /**\r\n * Appends data item's elements to the parent [[Container]].\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n AxisDataItem.prototype.appendChildren = function () {\r\n if (this.component) {\r\n this.component.appendDataItem(this);\r\n }\r\n };\r\n /**\r\n * Checks if data item has particular property set.\r\n *\r\n * @param prop Property name\r\n * @return Property set?\r\n */\r\n AxisDataItem.prototype.hasProperty = function (prop) {\r\n return prop == \"component\" ? true : _super.prototype.hasProperty.call(this, prop);\r\n };\r\n /**\r\n * Copies all parameters from another [[AxisDataItem]].\r\n *\r\n * @param source Source AxisDataItem\r\n */\r\n AxisDataItem.prototype.copyFrom = function (source) {\r\n _super.prototype.copyFrom.call(this, source);\r\n this.text = source.text;\r\n if (source.bullet) {\r\n this.bullet = source.bullet.clone();\r\n }\r\n this.minPosition = source.minPosition;\r\n this.maxPosition = source.maxPosition;\r\n };\r\n /**\r\n * Sets visibility of the Data Item.\r\n *\r\n * @param value Data Item\r\n */\r\n AxisDataItem.prototype.setVisibility = function (value, noChangeValues) {\r\n _super.prototype.setVisibility.call(this, value, noChangeValues);\r\n if (this._contents) {\r\n this._contents.visible = value;\r\n }\r\n };\r\n Object.defineProperty(AxisDataItem.prototype, \"bullet\", {\r\n /**\r\n * @return Bullet\r\n */\r\n get: function () {\r\n return this._bullet;\r\n },\r\n /**\r\n * Set it to an instance of any [[Sprite]]. It will be displayed as an axis\r\n * bullet in the middle of the cell, or specific value.\r\n *\r\n * If you need position bullet relatively to the cell, use [[AxisBullet]]\r\n * instead. It has a `location` property which can be used to indicate\r\n * precise relative location within cell/range.\r\n *\r\n * Also, [[AxisBullet]] is a [[Container]] so you can push any other element\r\n * into it.\r\n *\r\n * NOTE: `location` is relative to the parent axis range's scope, i.e.\r\n * between its `date` and `endDate` for [[DateAxis]], or `value`/`endValue`\r\n * ([[ValueAxis]]), or `category`/`endCategory` ([[categoryAxis]]).\r\n *\r\n * ```TypeScript\r\n * let range = dateAxis.axisRanges.create();\r\n * range.date = new Date(2018, 0, 5);\r\n *\r\n * let flag = new am4plugins_bullets.FlagBullet();\r\n * flag.label.text = \"Hello\";\r\n *\r\n * range.bullet = flag;\r\n * ```\r\n * ```JavaScript\r\n * var range = dateAxis.axisRanges.create();\r\n * range.date = new Date(2018, 0, 5);\r\n *\r\n * var flag = new am4plugins_bullets.FlagBullet();\r\n * flag.label.text = \"Hello\";\r\n *\r\n * range.bullet = flag;\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"xAxes\": [{\r\n * \"type\": \"DateAxis\",\r\n * // ...\r\n * \"axisRanges\": [{\r\n * \"date\": new Date(2018, 0, 5),\r\n * \"bullet: {\r\n * \"type\": \"FlagBullet\",\r\n * \"label\": {\r\n * \"text\": \"Hello\"\r\n * }\r\n * }\r\n * }]\r\n * }]\r\n * }\r\n * ```\r\n *\r\n * @since 4.5.9\r\n * @param value Bullet\r\n */\r\n set: function (value) {\r\n if (this._bullet && this._bullet != value) {\r\n $array.remove(this.sprites, this._bullet);\r\n this._bullet.dataItem = undefined;\r\n }\r\n this._bullet = value;\r\n if (value) {\r\n this.addSprite(value);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return AxisDataItem;\r\n}(DataItem));\r\nexport { AxisDataItem };\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Defines named positions for data item's location within [[Axis]].\r\n */\r\nexport var AxisItemLocation;\r\n(function (AxisItemLocation) {\r\n AxisItemLocation[AxisItemLocation[\"Start\"] = 0] = \"Start\";\r\n AxisItemLocation[AxisItemLocation[\"Middle\"] = 0.5] = \"Middle\";\r\n AxisItemLocation[AxisItemLocation[\"End\"] = 1] = \"End\";\r\n})(AxisItemLocation || (AxisItemLocation = {}));\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * A base class for all Axis elements.\r\n *\r\n * @see {@link IAxisEvents} for a list of available Events\r\n * @see {@link IAxisAdapters} for a list of available Adapters\r\n */\r\nvar Axis = /** @class */ (function (_super) {\r\n __extends(Axis, _super);\r\n /**\r\n * Constructor\r\n */\r\n function Axis() {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n /**\r\n * Number of Grid elements on the axis.\r\n */\r\n _this._gridCount = 10;\r\n /**\r\n * A list of [[XYSeries]] that are using this Axis.\r\n */\r\n _this._series = new List();\r\n /**\r\n * Specifies if axis should be automatically disposed when removing from\r\n * chart's axis list.\r\n *\r\n * @default true\r\n */\r\n _this.autoDispose = true;\r\n /**\r\n * @ignore\r\n */\r\n _this._axisItemCount = 0;\r\n if (_this.constructor === Axis) {\r\n throw new Error(\"'Axis' cannot be instantiated directly. Please use a specific axis type.\");\r\n }\r\n _this.hideTooltipWhileZooming = true;\r\n _this.minWidth = 0.0001;\r\n _this.minHeight = 0.0001;\r\n _this.className = \"Axis\";\r\n _this.shouldClone = false;\r\n _this.setPropertyValue(\"cursorTooltipEnabled\", true);\r\n _this.toggleZoomOutButton = true;\r\n _this.zoomable = true;\r\n var interfaceColors = new InterfaceColorSet();\r\n // Create title\r\n _this.title = new Label();\r\n _this.title.shouldClone = false;\r\n _this._disposers.push(_this.title);\r\n _this.setPropertyValue(\"startLocation\", 0);\r\n _this.setPropertyValue(\"endLocation\", 1);\r\n // Data item iterator\r\n _this._dataItemsIterator = new $iter.ListIterator(_this.dataItems, function () { return _this.dataItems.create(); });\r\n _this._dataItemsIterator.createNewItems = true;\r\n // Create tooltip\r\n var tooltip = new Tooltip();\r\n _this._disposers.push(tooltip);\r\n tooltip.label.padding(5, 10, 5, 10);\r\n tooltip.background.pointerLength = 5;\r\n tooltip.fitPointerToBounds = true;\r\n tooltip.background.filters.clear();\r\n // Set virtual parentfor the tooltip so that it can properly inheirt\r\n // formatters from the axis.\r\n tooltip.virtualParent = _this;\r\n // Create background element for the tooltip\r\n var background = tooltip.background;\r\n background.cornerRadius = 0;\r\n background.fill = interfaceColors.getFor(\"alternativeBackground\");\r\n background.stroke = background.fill;\r\n background.strokeWidth = 1;\r\n background.fillOpacity = 1;\r\n tooltip.label.fill = interfaceColors.getFor(\"alternativeText\");\r\n _this.tooltip = tooltip;\r\n // Accessibility\r\n _this.readerHidden = true;\r\n _this.events.on(\"rangechangestarted\", function () {\r\n _this.series.each(function (series) {\r\n if (series.hideTooltipWhileZooming) {\r\n series.tooltip.hide();\r\n series.tooltip.preventShow = true;\r\n }\r\n });\r\n if (_this.hideTooltipWhileZooming) {\r\n _this.tooltip.hide();\r\n _this.tooltip.preventShow = true;\r\n }\r\n }, undefined, false);\r\n _this.events.on(\"rangechangeended\", function () {\r\n _this.series.each(function (series) {\r\n if (series.hideTooltipWhileZooming) {\r\n series.tooltip.hide();\r\n series.tooltip.preventShow = false;\r\n }\r\n });\r\n if (_this.hideTooltipWhileZooming) {\r\n _this.tooltip.hide();\r\n _this.tooltip.preventShow = false;\r\n }\r\n }, undefined, false);\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Holds reference to a function that accepts a DataItem and its index as\r\n * parameters.\r\n *\r\n * It can either return a fill opacity for a fill, or manipulate data item\r\n * directly, to create various highlighting scenarios.\r\n *\r\n * For example, you can set it up to highlight only weekends on a\r\n * [[DateAxis]].\r\n */\r\n Axis.prototype.fillRule = function (dataItem, index) {\r\n if (!$type.isNumber(index)) {\r\n index = dataItem.index;\r\n }\r\n if (index / 2 == Math.round(index / 2)) {\r\n dataItem.axisFill.__disabled = true;\r\n dataItem.axisFill.opacity = 0;\r\n }\r\n else {\r\n dataItem.axisFill.opacity = 1;\r\n dataItem.axisFill.__disabled = false;\r\n }\r\n };\r\n /**\r\n * Returns a new/empty DataItem of the type appropriate for this object.\r\n *\r\n * @see {@link DataItem}\r\n * @return Data Item\r\n */\r\n Axis.prototype.createDataItem = function () {\r\n return new AxisDataItem();\r\n };\r\n /**\r\n * Invalidates layout.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Axis.prototype.invalidateLayout = function () {\r\n _super.prototype.invalidateLayout.call(this);\r\n // this puts series after axis in invalidation order also makes series update it's data items in case widht/height of a series is not 100%\r\n $iter.each(this.series.iterator(), function (series) {\r\n series.invalidateLayout();\r\n });\r\n };\r\n /**\r\n * Invalidates series of this axis.\r\n */\r\n Axis.prototype.invalidateSeries = function () {\r\n // this puts series after axis in invalidation order also makes series update it's data items in case widht/height of a series is not 100%\r\n $iter.each(this.series.iterator(), function (series) {\r\n series.invalidate();\r\n });\r\n };\r\n /**\r\n * Override to cancel super call for data element validation.\r\n * @ignore\r\n */\r\n Axis.prototype.validateDataElements = function () {\r\n this._axisItemCount = 0;\r\n if (this.ghostLabel) {\r\n this.renderer.updateLabelElement(this.ghostLabel, this.start, this.end);\r\n this.ghostLabel.validate();\r\n }\r\n };\r\n /**\r\n * Recalculates the number of grid items on the axis.\r\n */\r\n Axis.prototype.updateGridCount = function () {\r\n if (this.renderer) {\r\n var gridCount = this.axisLength / this.renderer.minGridDistance;\r\n if (gridCount != this._gridCount) {\r\n this._gridCount = gridCount;\r\n this.clearCache();\r\n }\r\n }\r\n };\r\n /**\r\n * Redraws the element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Axis.prototype.validateLayout = function () {\r\n this.axisFullLength = this.axisLength / (this.end - this.start);\r\n _super.prototype.validateLayout.call(this);\r\n this.updateGridCount();\r\n var renderer = this.renderer;\r\n if (renderer) {\r\n renderer.updateAxisLine();\r\n renderer.updateTooltip();\r\n renderer.updateBaseGridElement();\r\n }\r\n if (this._prevLength != this.axisLength) {\r\n this.dispatchImmediately(\"lengthchanged\");\r\n this._prevLength = this.axisLength;\r\n }\r\n };\r\n /**\r\n * Initializes Axis' renderer.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Axis.prototype.initRenderer = function () {\r\n };\r\n /**\r\n * Adds a data item to the Axis.\r\n *\r\n * @param dataItem Data item\r\n */\r\n Axis.prototype.appendDataItem = function (dataItem) {\r\n var renderer = this.renderer;\r\n var tick = dataItem.tick;\r\n if (tick) {\r\n if (tick.above) {\r\n tick.parent = renderer.bulletsContainer;\r\n }\r\n else {\r\n tick.parent = renderer.gridContainer;\r\n }\r\n }\r\n if (dataItem.label) {\r\n dataItem.label.parent = renderer;\r\n }\r\n var axisFill = dataItem.axisFill;\r\n if (axisFill) {\r\n if (axisFill.above) {\r\n axisFill.parent = renderer.bulletsContainer;\r\n }\r\n else {\r\n axisFill.parent = renderer.gridContainer;\r\n }\r\n }\r\n var grid = dataItem.grid;\r\n if (grid) {\r\n if (grid.above) {\r\n grid.parent = renderer.bulletsContainer;\r\n }\r\n else {\r\n grid.parent = renderer.gridContainer;\r\n }\r\n }\r\n if (dataItem.bullet) {\r\n dataItem.bullet.parent = renderer.bulletsContainer;\r\n }\r\n };\r\n /**\r\n * Redraws Axis' related items.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Axis.prototype.validate = function () {\r\n _super.prototype.validate.call(this);\r\n this.validateLayout();\r\n this.renderer.updateGridContainer();\r\n };\r\n /**\r\n * Redars Axis ranges.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Axis.prototype.validateAxisRanges = function () {\r\n var _this = this;\r\n $iter.each(this.axisRanges.iterator(), function (axisRange) {\r\n _this.appendDataItem(axisRange);\r\n _this.validateDataElement(axisRange);\r\n if (axisRange.grid) {\r\n axisRange.grid.validate();\r\n }\r\n if (axisRange.tick) {\r\n axisRange.tick.validate();\r\n }\r\n if (axisRange.axisFill) {\r\n axisRange.axisFill.validate();\r\n }\r\n if (axisRange.label) {\r\n axisRange.label.validate();\r\n }\r\n });\r\n };\r\n /**\r\n * Invalidates all axis breaks, so they are redrawn.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Axis.prototype.validateBreaks = function () {\r\n if (this._axisBreaks) {\r\n $iter.each(this._axisBreaks.iterator(), function (axisBreak) {\r\n axisBreak.invalidate();\r\n });\r\n }\r\n };\r\n /**\r\n * Associates an Axis break with this Axis, after it is inserted into\r\n * `axisBreaks`.\r\n *\r\n * @ignore Exclude from docs\r\n * @param event Event\r\n */\r\n Axis.prototype.processBreak = function (event) {\r\n var axisBreak = event.newValue;\r\n axisBreak.parent = this.renderer.breakContainer;\r\n axisBreak.axis = this;\r\n };\r\n /**\r\n * Registers a [[XYSeries]] element with this Axis.\r\n *\r\n * Returns a [[Disposer]] for all events, added to Series for watching\r\n * changes in Axis, and vice versa.\r\n * @ignore\r\n * @param series Series\r\n * @return Event disposer\r\n */\r\n Axis.prototype.registerSeries = function (series) {\r\n var _this = this;\r\n this.series.moveValue(series);\r\n return new MultiDisposer([\r\n new Disposer(function () {\r\n _this.series.removeValue(series);\r\n }),\r\n this.events.on(\"lengthchanged\", series.invalidate, series, false),\r\n this.events.on(\"lengthchanged\", series.createMask, series, false),\r\n this.events.on(\"startchanged\", series.invalidate, series, false),\r\n this.events.on(\"endchanged\", series.invalidate, series, false),\r\n ]);\r\n };\r\n Object.defineProperty(Axis.prototype, \"renderer\", {\r\n /**\r\n * @return Renderer\r\n */\r\n get: function () {\r\n return this._renderer;\r\n },\r\n /**\r\n * An [[AxisRenderer]] to be used to render this Axis.\r\n *\r\n * Please note that most of the settings, related to Axis' appearance are set\r\n * via its renderer. Not directly on the Axis.\r\n *\r\n * E.g.:\r\n *\r\n * ```TypeScript\r\n * axis.renderer.inside = true;\r\n * axis.renderer.minLabelPosition = 0.1;\r\n * axis.renderer.maxLabelPosition = 0.9;\r\n * ```\r\n * ```JavaScript\r\n * axis.renderer.inside = true;\r\n * axis.renderer.minLabelPosition = 0.1;\r\n * axis.renderer.maxLabelPosition = 0.9;\r\n * ```\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/axes/} for more info\r\n * @param renderer Renderer\r\n */\r\n set: function (renderer) {\r\n if (renderer != this._renderer) {\r\n this._renderer = renderer;\r\n renderer.chart = this.chart;\r\n renderer.axis = this;\r\n renderer.parent = this;\r\n this.title.parent = this; // we add title to axis and set layout in renderer to avoid one extra container, as otherwise axis container would be used for holding renderer only\r\n this.initRenderer();\r\n this._disposers.push(renderer.gridContainer.events.on(\"maxsizechanged\", this.invalidate, this, false));\r\n var ghostLabel_1 = this.renderer.labels.create();\r\n this._disposers.push(ghostLabel_1);\r\n ghostLabel_1.dataItem = this.dataItems.template.clone(); // just for the adapters not to fail\r\n ghostLabel_1.text = \"L\";\r\n ghostLabel_1.parent = this.renderer;\r\n ghostLabel_1.shouldClone = false;\r\n ghostLabel_1.fillOpacity = 0;\r\n ghostLabel_1.opacity = 0;\r\n ghostLabel_1.strokeOpacity = 0;\r\n ghostLabel_1.interactionsEnabled = false;\r\n ghostLabel_1.validate();\r\n this.ghostLabel = ghostLabel_1;\r\n this.events.on(\"beforedatavalidated\", function () {\r\n ghostLabel_1.text = \"L\";\r\n }, undefined, false);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Converts a relative position to angle. (for circular axes)\r\n *\r\n * @param position Position (0-1)\r\n * @return Angle\r\n */\r\n Axis.prototype.positionToAngle = function (position) {\r\n return this.renderer.positionToAngle(position);\r\n };\r\n /**\r\n * Converts pixel coordinates to a relative position. (0-1)\r\n *\r\n * @param point Coorinates (px)\r\n * @return Position (0-1)\r\n */\r\n Axis.prototype.pointToPosition = function (point) {\r\n return this.renderer.pointToPosition(point);\r\n };\r\n /**\r\n * Converts relative position to coordinate.\r\n *\r\n * @since 4.7.15\r\n * @param position (0-1)\r\n * @return coordinate (px)\r\n */\r\n Axis.prototype.positionToCoordinate = function (position) {\r\n return this.renderer.positionToCoordinate(position);\r\n };\r\n /**\r\n * [getAnyRangePath description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param start [description]\r\n * @param end [description]\r\n * @return [description]\r\n */\r\n Axis.prototype.getAnyRangePath = function (start, end) {\r\n return this.renderer.getPositionRangePath(start, end);\r\n };\r\n /**\r\n * Converts any positional parameter to a relative position on axis.\r\n *\r\n * @todo Description (review)\r\n * @param value Pisition\r\n * @return Position (0-1)\r\n */\r\n Axis.prototype.anyToPosition = function (value) {\r\n return 0;\r\n };\r\n /**\r\n * Converts any positional parameter to a relative position on axis.\r\n *\r\n * @todo Description (review)\r\n * @param value Pisition\r\n * @return Orientation point\r\n */\r\n Axis.prototype.anyToPoint = function (value) {\r\n return { x: 0, y: 0, angle: 0 };\r\n };\r\n /**\r\n * [getPositionRangePath description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param startPosition [description]\r\n * @param endPosition [description]\r\n * @return [description]\r\n */\r\n Axis.prototype.getPositionRangePath = function (startPosition, endPosition) {\r\n if (this.renderer) {\r\n return this.renderer.getPositionRangePath(startPosition, endPosition);\r\n }\r\n return \"\";\r\n };\r\n Object.defineProperty(Axis.prototype, \"axisLength\", {\r\n /**\r\n * Actual axis length in pixels.\r\n *\r\n * @return Axis length (px)\r\n */\r\n get: function () {\r\n if (this.renderer) {\r\n return this.renderer.axisLength;\r\n }\r\n return 0;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Axis.prototype, \"cursorTooltipEnabled\", {\r\n /**\r\n * @return Display tooltip?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"cursorTooltipEnabled\");\r\n },\r\n /**\r\n * Indicates if axis should display a tooltip for chart's cursor.\r\n *\r\n * @param value Display tooltip?\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"cursorTooltipEnabled\", value)) {\r\n if (value && this.renderer) {\r\n this.renderer.updateTooltip();\r\n }\r\n else if (this.tooltip) {\r\n this.tooltip.hide(0);\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Axis.prototype, \"toggleZoomOutButton\", {\r\n /**\r\n * @return Toggle zoom out button?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"toggleZoomOutButton\");\r\n },\r\n /**\r\n * Normally, when axis is zoomed in, a zoom out button is shown by a chart,\r\n * and vice versa: when axis is zoomed out completely, zoom out button is\r\n * hidden.\r\n *\r\n * Setting this to `false` will disable this behavior. Zooming in our out\r\n * this axis will not reveal or hide zoom out button.\r\n *\r\n * @default true\r\n * @since 4.6.2\r\n * @param value Toggle zoom out button?\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"toggleZoomOutButton\", value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Hides element's [[Tooltip]].\r\n *\r\n * @see {@link Tooltip}\r\n */\r\n Axis.prototype.hideTooltip = function (duration) {\r\n _super.prototype.hideTooltip.call(this, duration);\r\n this._tooltipPosition = undefined;\r\n };\r\n /**\r\n * Shows Axis tooltip at specific relative position within Axis. (0-1)\r\n *\r\n * @param position Position (0-1)\r\n * @param local or global position\r\n */\r\n Axis.prototype.showTooltipAtPosition = function (position, local) {\r\n var tooltip = this._tooltip;\r\n if (!tooltip || this.dataItems.length <= 0) {\r\n this._tooltipPosition = undefined;\r\n }\r\n else {\r\n if (!local) {\r\n position = this.toAxisPosition(position);\r\n }\r\n if (!$type.isNumber(position) || position < this.start || position > this.end) {\r\n tooltip.hide(0);\r\n this._tooltipPosition = undefined;\r\n return;\r\n }\r\n var renderer = this.renderer;\r\n //@todo: think of how to solve this better\r\n if (!tooltip.parent) {\r\n tooltip.parent = this.tooltipContainer;\r\n }\r\n var tooltipLocation = renderer.tooltipLocation;\r\n var startPosition = this.getCellStartPosition(position);\r\n var endPosition = this.getCellEndPosition(position);\r\n if (this.tooltipPosition == \"fixed\") {\r\n position = startPosition + (endPosition - startPosition) * tooltipLocation;\r\n }\r\n position = $math.fitToRange(position, this.start, this.end);\r\n if (this._tooltipPosition != position) {\r\n this._tooltipPosition = position;\r\n var tooltipLocation2 = renderer.tooltipLocation2;\r\n var startPoint = renderer.positionToPoint(startPosition, tooltipLocation2);\r\n var endPoint = renderer.positionToPoint(endPosition, tooltipLocation2);\r\n // save values so cursor could use them\r\n this.currentItemStartPoint = startPoint;\r\n this.currentItemEndPoint = endPoint;\r\n if (renderer.fullWidthTooltip) {\r\n tooltip.width = endPoint.x - startPoint.x;\r\n tooltip.height = endPoint.y - startPoint.y;\r\n }\r\n var point = renderer.positionToPoint(position, tooltipLocation2);\r\n var globalPoint = $utils.spritePointToSvg(point, this.renderer.line);\r\n tooltip.text = this.getTooltipText(position);\r\n if (tooltip.text) {\r\n tooltip.delayedPointTo(globalPoint);\r\n tooltip.show();\r\n }\r\n }\r\n if (!this.cursorTooltipEnabled || this.tooltip.disabled) {\r\n tooltip.hide(0);\r\n }\r\n }\r\n };\r\n /**\r\n * Converts relative position (0-1) to Axis position with zoom level and\r\n * inversed taken into account.\r\n *\r\n * @param position Global position (0-1)\r\n * @return Position within Axis (0-1)\r\n */\r\n Axis.prototype.toAxisPosition = function (position) {\r\n position = this.renderer.toAxisPosition(position);\r\n if (position == undefined) {\r\n return;\r\n }\r\n position = position * (this.end - this.start);\r\n if (this.renderer.inversed) {\r\n position = this.end - position;\r\n }\r\n else {\r\n position = this.start + position;\r\n }\r\n return position;\r\n };\r\n /**\r\n * Converts position on the axis with zoom level and\r\n * inversed taken into account to global position.\r\n *\r\n * @param position Axis position (0-1)\r\n * @return Global position (0-1)\r\n */\r\n Axis.prototype.toGlobalPosition = function (position) {\r\n if (this.renderer.inversed) {\r\n position = this.end - position;\r\n }\r\n else {\r\n position = position - this.start;\r\n }\r\n return position / (this.end - this.start);\r\n };\r\n /**\r\n * Returns text to be used for cursor's Axis tooltip.\r\n *\r\n * This is a placeholder to override for extending classes.\r\n *\r\n * @ignore Exclude from docs\r\n * @param position Position coordinate (px)\r\n * @return Label text\r\n */\r\n Axis.prototype.getTooltipText = function (position) {\r\n return;\r\n };\r\n /**\r\n * Updates Axis' tooltip's position and possibly size, and pointer (stem)\r\n * place.\r\n *\r\n * @ignore Exclude from docs\r\n * @param pointerOrientation Pointer (stem) orientation\r\n * @param boundingRectangle A rectangle for tooltip to fit within\r\n */\r\n Axis.prototype.updateTooltip = function (pointerOrientation, boundingRectangle) {\r\n var tooltip = this._tooltip;\r\n if (tooltip) {\r\n tooltip.fixDoc = false;\r\n tooltip.pointerOrientation = pointerOrientation;\r\n tooltip.setBounds($utils.spriteRectToSvg(boundingRectangle, this.renderer.line));\r\n }\r\n };\r\n /**\r\n * [roundPosition description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param position Relative position\r\n * @param location Location on axis\r\n * @return Rounded position\r\n */\r\n Axis.prototype.roundPosition = function (position, location, axisLocation) {\r\n return position;\r\n };\r\n /**\r\n * [getCellStartPosition description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param position [description]\r\n * @return [description]\r\n */\r\n Axis.prototype.getCellStartPosition = function (position) {\r\n return position;\r\n };\r\n /**\r\n * [getCellEndPosition description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param position [description]\r\n * @return [description]\r\n */\r\n Axis.prototype.getCellEndPosition = function (position) {\r\n return position;\r\n };\r\n Object.defineProperty(Axis.prototype, \"axisRanges\", {\r\n /**\r\n * A list of axis ranges for this Axis.\r\n *\r\n * @return Axis ranges\r\n */\r\n get: function () {\r\n if (!this._axisRanges) {\r\n var dataItem = this.createDataItem();\r\n dataItem.isRange = true;\r\n dataItem.axisFill = this.renderer.axisFills.template.clone();\r\n dataItem.grid = this.renderer.grid.template.clone();\r\n dataItem.tick = this.renderer.ticks.template.clone();\r\n dataItem.label = this.renderer.labels.template.clone();\r\n dataItem.isTemplate = true;\r\n dataItem.component = this;\r\n dataItem.axisFill.disabled = false;\r\n dataItem.tick.disabled = false;\r\n dataItem.grid.disabled = false;\r\n dataItem.label.disabled = false;\r\n this._axisRanges = new ListTemplate(dataItem);\r\n this._axisRanges.events.on(\"inserted\", this.processAxisRange, this, false);\r\n this._disposers.push(new ListDisposer(this._axisRanges));\r\n this._disposers.push(this._axisRanges.template);\r\n }\r\n return this._axisRanges;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Decorates an axis range after it has been added to the axis range list.\r\n *\r\n * @param event Event\r\n */\r\n Axis.prototype.processAxisRange = function (event) {\r\n var axisRange = event.newValue;\r\n axisRange.component = this;\r\n axisRange.isRange = true;\r\n };\r\n Object.defineProperty(Axis.prototype, \"axisBreaks\", {\r\n /**\r\n * A list of axis breaks on this Axis.\r\n *\r\n * @return Axis breaks.\r\n */\r\n get: function () {\r\n if (!this._axisBreaks) {\r\n this._axisBreaks = new SortedListTemplate(this.createAxisBreak(), function (a, b) {\r\n return $number.order(a.adjustedStartValue, b.adjustedStartValue);\r\n });\r\n this._axisBreaks.events.on(\"inserted\", this.processBreak, this, false);\r\n this._disposers.push(new ListDisposer(this._axisBreaks));\r\n this._disposers.push(this._axisBreaks.template);\r\n }\r\n return this._axisBreaks;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Creates a new axis break.\r\n *\r\n * @return Axis break\r\n */\r\n Axis.prototype.createAxisBreak = function () {\r\n return new AxisBreak();\r\n };\r\n Object.defineProperty(Axis.prototype, \"series\", {\r\n /**\r\n * A list of Series currently associated with this Axis.\r\n *\r\n * @return Series\r\n */\r\n get: function () {\r\n if (!this._series) {\r\n this._series = new List();\r\n }\r\n return this._series;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Processes Series' data items.\r\n *\r\n * This is a placeholder to override for extending classes.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Axis.prototype.processSeriesDataItems = function () {\r\n };\r\n /**\r\n * Processes Series' single data item.\r\n *\r\n * This is a placeholder to override for extending classes.\r\n *\r\n * @ignore Exclude from docs\r\n * @param dataItem Data item\r\n */\r\n Axis.prototype.processSeriesDataItem = function (dataItem, axisLetter) {\r\n };\r\n /**\r\n * Post-processes Serie's data items.\r\n *\r\n * This is a placeholder to override for extending classes.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Axis.prototype.postProcessSeriesDataItems = function (series) {\r\n };\r\n /**\r\n * Post-processes Serie's single data item.\r\n *\r\n * This is a placeholder to override for extending classes.\r\n *\r\n * @ignore Exclude from docs\r\n * @param dataItem Data item\r\n */\r\n Axis.prototype.postProcessSeriesDataItem = function (dataItem) {\r\n };\r\n //\r\n /**\r\n * Updates Axis based on all Series that might influence it.\r\n *\r\n * Called by Series after Series data is validated.\r\n *\r\n * This is a placeholder to override for extending classes.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Axis.prototype.updateAxisBySeries = function () {\r\n };\r\n /**\r\n * Hides unused data items.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Axis.prototype.hideUnusedDataItems = function () {\r\n var _this = this;\r\n // hide all unused\r\n var dataItemsIterator = this._dataItemsIterator;\r\n dataItemsIterator.createNewItems = false;\r\n $iter.each(dataItemsIterator.iterator(), function (dataItem) {\r\n _this.validateDataElement(dataItem); // solves shrinking\r\n dataItem.__disabled = true;\r\n });\r\n dataItemsIterator.clear();\r\n dataItemsIterator.createNewItems = true;\r\n };\r\n /**\r\n * Returns a Series' data item that corresponds to specific position on Axis.\r\n *\r\n * This is a placeholder to override for extending classes.\r\n *\r\n * @ignore Exclude from docs\r\n * @param series Series\r\n * @param position Position (0-1)\r\n * @param findNearest Should axis try to find nearest tooltip if there is no data item at exact position\r\n * @return Data item\r\n */\r\n Axis.prototype.getSeriesDataItem = function (series, position, findNearest) {\r\n return;\r\n };\r\n /**\r\n * Returns an angle that corresponds to specific position on axis.\r\n *\r\n * This is a placeholder to override for extending classes.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description (review)\r\n * @param dataItem Data item\r\n * @param key ???\r\n * @param location Location\r\n * @param stackKey ???\r\n * @return Angle\r\n */\r\n Axis.prototype.getAngle = function (dataItem, key, location, stackKey, range) {\r\n return;\r\n };\r\n /**\r\n * [getX description]\r\n *\r\n * This is a placeholder to override for extending classes.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description (review)\r\n * @param dataItem [description]\r\n * @param key [description]\r\n * @param location [description]\r\n * @param stackKey [description]\r\n * @return [description]\r\n */\r\n Axis.prototype.getX = function (dataItem, key, location, stackKey, range) {\r\n return;\r\n };\r\n /**\r\n * [getX description]\r\n *\r\n * This is a placeholder to override for extending classes.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description (review)\r\n * @param dataItem [description]\r\n * @param key [description]\r\n * @param location [description]\r\n * @param stackKey [description]\r\n * @return [description]\r\n */\r\n Axis.prototype.getPositionX = function (dataItem, key, location, stackKey, range) {\r\n return;\r\n };\r\n /**\r\n * [getY description]\r\n *\r\n * This is a placeholder to override for extending classes.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description (review)\r\n * @param dataItem [description]\r\n * @param key [description]\r\n * @param location [description]\r\n * @param stackKey [description]\r\n * @return [description]\r\n */\r\n Axis.prototype.getY = function (dataItem, key, location, stackKey, range) {\r\n return;\r\n };\r\n /**\r\n * [getY description]\r\n *\r\n * This is a placeholder to override for extending classes.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description (review)\r\n * @param dataItem [description]\r\n * @param key [description]\r\n * @param location [description]\r\n * @param stackKey [description]\r\n * @return [description]\r\n */\r\n Axis.prototype.getPositionY = function (dataItem, key, location, stackKey, range) {\r\n return;\r\n };\r\n Object.defineProperty(Axis.prototype, \"basePoint\", {\r\n /**\r\n * Coordinates of the actual axis start.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Base point coordinates\r\n */\r\n get: function () {\r\n return { x: 0, y: 0 };\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * [dataChangeUpdate description]\r\n *\r\n * This is a placeholder to override for extending classes.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\n Axis.prototype.dataChangeUpdate = function () {\r\n };\r\n /**\r\n * [dataChangeUpdate description]\r\n *\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\n Axis.prototype.seriesDataChangeUpdate = function (series) {\r\n };\r\n /**\r\n * Removes axis breaks that fall between `min` and `max` (???)\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description (review)\r\n * @param min Start value\r\n * @param max End value\r\n * @return Spread o\r\n */\r\n Axis.prototype.adjustDifference = function (min, max) {\r\n var difference = max - min;\r\n if ($type.isNumber(difference)) {\r\n if (this._axisBreaks) {\r\n $iter.eachContinue(this._axisBreaks.iterator(), function (axisBreak) {\r\n var startValue = axisBreak.adjustedStartValue;\r\n var endValue = axisBreak.adjustedEndValue;\r\n if ($type.isNumber(startValue) && $type.isNumber(endValue)) {\r\n // breaks are sorted, we don't need go further anymore\r\n if (startValue > max) {\r\n return false;\r\n }\r\n if (endValue >= min) {\r\n if ($type.isNumber(startValue) && $type.isNumber(endValue)) {\r\n var breakSize = axisBreak.breakSize;\r\n var intersection = $math.intersection({ start: startValue, end: endValue }, { start: min, end: max });\r\n if (intersection) {\r\n difference -= (intersection.end - intersection.start) * (1 - breakSize);\r\n }\r\n }\r\n }\r\n return true;\r\n }\r\n });\r\n }\r\n return difference;\r\n }\r\n };\r\n /**\r\n * Checks if specific value falls within a break.\r\n *\r\n * Returns [[AxisBreak]] the value falls into.\r\n *\r\n * @param value Value to check\r\n * @return Axis break\r\n */\r\n Axis.prototype.isInBreak = function (value) {\r\n if (this._axisBreaks) {\r\n return $iter.find(this._axisBreaks.iterator(), function (axisBreak) {\r\n return value >= axisBreak.adjustedStartValue &&\r\n value <= axisBreak.adjustedEndValue;\r\n });\r\n }\r\n };\r\n /**\r\n * [fixAxisBreaks description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\n Axis.prototype.fixAxisBreaks = function () {\r\n var _this = this;\r\n if (this._axisBreaks) {\r\n var axisBreaks = this._axisBreaks;\r\n if (axisBreaks.length > 0) {\r\n // first make sure that startValue is <= end value\r\n // This needs to make a copy of axisBreaks because it mutates the list while traversing\r\n // TODO very inefficient\r\n $array.each($iter.toArray(axisBreaks.iterator()), function (axisBreak) {\r\n var startValue = $math.min(axisBreak.startValue, axisBreak.endValue);\r\n var endValue = $math.max(axisBreak.startValue, axisBreak.endValue);\r\n axisBreak.adjustedStartValue = startValue;\r\n axisBreak.adjustedEndValue = endValue;\r\n _this._axisBreaks.update(axisBreak);\r\n });\r\n var firstAxisBreak = axisBreaks.first;\r\n var previousEndValue_1 = Math.min(firstAxisBreak.startValue, firstAxisBreak.endValue);\r\n // process breaks\r\n // TODO does this need to call axisBreaks.update ?\r\n $iter.each(axisBreaks.iterator(), function (axisBreak) {\r\n var startValue = axisBreak.adjustedStartValue;\r\n var endValue = axisBreak.adjustedEndValue;\r\n // breaks can't overlap\r\n // if break starts before previous break ends\r\n if (startValue < previousEndValue_1) {\r\n startValue = previousEndValue_1;\r\n if (endValue < previousEndValue_1) {\r\n endValue = previousEndValue_1;\r\n }\r\n }\r\n axisBreak.adjustedStartValue = startValue;\r\n axisBreak.adjustedEndValue = endValue;\r\n });\r\n }\r\n }\r\n };\r\n Object.defineProperty(Axis.prototype, \"startIndex\", {\r\n /**\r\n * @ignore Exclude from docs\r\n * @return [description]\r\n */\r\n get: function () {\r\n return 0;\r\n },\r\n /**\r\n * We need start/end indexes of axes to be 0 - `dataItems.length`.\r\n *\r\n * Yes, also for category axis, this helps to avoid jumping of categories\r\n * while scrolling and does not do a lot of extra work as we use\r\n * protected `_startIndex` and `_endIndex` when working with items.\r\n *\r\n * @hidden\r\n */\r\n /**\r\n * [startIndex description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param value [description]\r\n */\r\n set: function (value) {\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Axis.prototype, \"endIndex\", {\r\n /**\r\n * @ignore Exclude from docs\r\n * @return [description]\r\n */\r\n get: function () {\r\n return this.dataItems.length;\r\n },\r\n /**\r\n * [endIndex description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param value [description]\r\n */\r\n set: function (value) {\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Returns a formatted label based on position.\r\n *\r\n * Individual axis types should override this method to generate a label\r\n * that is relevant to axis type.\r\n *\r\n * Please note that `position` represents position within axis which may be\r\n * zoomed and not correspond to Cursor's `position`.\r\n *\r\n * To convert Cursor's `position` to Axis' `position` use `toAxisPosition()` method.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/tutorials/tracking-cursors-position-via-api/#Tracking_Cursor_s_position} For more information about cursor tracking.\r\n * @param position Relative position on axis (0-1)\r\n * @return Position label\r\n */\r\n Axis.prototype.getPositionLabel = function (position) {\r\n return Math.round(position * 100) + \"%x\";\r\n };\r\n Object.defineProperty(Axis.prototype, \"chart\", {\r\n /**\r\n * @return Chart\r\n */\r\n get: function () {\r\n return this._chart;\r\n },\r\n /**\r\n * A Chart this Axis belongs to.\r\n *\r\n * @param value Chart\r\n */\r\n set: function (value) {\r\n this._chart = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Creates a data item for a Series range.\r\n *\r\n * @param series Target Series\r\n * @return Range data item\r\n */\r\n Axis.prototype.createSeriesRange = function (series) {\r\n var range = this.axisRanges.create();\r\n range.component = this;\r\n range.axisFill = this.renderer.axisFills.template.clone();\r\n range.axisFill.disabled = false;\r\n range.axisFill.fillOpacity = 0;\r\n range.grid = this.renderer.grid.template.clone();\r\n range.grid.disabled = true;\r\n range.tick = this.renderer.ticks.template.clone();\r\n range.tick.disabled = true;\r\n range.label = this.renderer.labels.template.clone();\r\n range.label.disabled = true;\r\n range.addDisposer(new Disposer(function () {\r\n series.axisRanges.removeValue(range);\r\n }));\r\n series.axisRanges.push(range);\r\n return range;\r\n };\r\n /**\r\n * Copies all properties and related data from a different instance of Axis.\r\n *\r\n * @param source Source Axis\r\n */\r\n Axis.prototype.copyFrom = function (source) {\r\n _super.prototype.copyFrom.call(this, source);\r\n if (this.renderer) {\r\n this.renderer.copyFrom(source.renderer);\r\n }\r\n else {\r\n if (source.renderer) {\r\n this.renderer = source.renderer.clone();\r\n this._disposers.push(this.renderer);\r\n }\r\n }\r\n if (source.title) {\r\n if (!this.title) {\r\n this.title = source.title.clone();\r\n this.title.parent = this;\r\n }\r\n else {\r\n this.title.copyFrom(source.title);\r\n }\r\n this._disposers.push(this.title);\r\n }\r\n };\r\n /**\r\n * Resets internal iterator.\r\n */\r\n Axis.prototype.resetIterators = function () {\r\n this._dataItemsIterator.reset();\r\n };\r\n /**\r\n * Processes JSON-based config before it is applied to the object.\r\n *\r\n * @ignore Exclude from docs\r\n * @param config Config\r\n */\r\n Axis.prototype.processConfig = function (config) {\r\n if (config) {\r\n // Set up axis ranges\r\n if ($type.hasValue(config.axisRanges) && $type.isArray(config.axisRanges)) {\r\n for (var i = 0, len = config.axisRanges.length; i < len; i++) {\r\n var range = config.axisRanges[i];\r\n // If `series` is set, we know it's a series range\r\n if ($type.hasValue(range[\"series\"])) {\r\n if ($type.isString(range[\"series\"])) {\r\n if (this.map.hasKey(range[\"series\"])) {\r\n //range[\"series\"] = this.map.getKey(range[\"series\"]);\r\n config.axisRanges[i] = this.createSeriesRange(this.map.getKey(range[\"series\"]));\r\n delete (range[\"series\"]);\r\n config.axisRanges[i].config = range;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n _super.prototype.processConfig.call(this, config);\r\n };\r\n /**\r\n * Ordering function used in JSON setup.\r\n *\r\n * @param a Item A\r\n * @param b Item B\r\n * @return Order\r\n */\r\n Axis.prototype.configOrder = function (a, b) {\r\n if (a == b) {\r\n return 0;\r\n }\r\n // last\r\n else if (a == \"title\") {\r\n return 1;\r\n }\r\n else if (b == \"title\") {\r\n return -1;\r\n }\r\n // first\r\n else if (a == \"component\") {\r\n return -1;\r\n }\r\n else if (b == \"component\") {\r\n return 1;\r\n }\r\n else {\r\n return _super.prototype.configOrder.call(this, a, b);\r\n }\r\n };\r\n Object.defineProperty(Axis.prototype, \"startLocation\", {\r\n /**\r\n * @return Location (0-1)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"startLocation\");\r\n },\r\n /**\r\n * Axis start location. Works on Date/Category axis, doesn't work on Value axis.\r\n *\r\n * * 0 - Full first cell is shown.\r\n * * 0.5 - Half of first cell is shown.\r\n * * 1 - None of the first cell is visible. (you probably don't want that)\r\n *\r\n * @param value Location (0-1)\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"startLocation\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Axis.prototype, \"endLocation\", {\r\n /**\r\n * @return Location (0-1)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"endLocation\");\r\n },\r\n /**\r\n * Axis end location. Works on Date/Category axis, doesn't work on Value axis.\r\n *\r\n * * 0 - None of the last cell is shown. (don't do that)\r\n * * 0.5 - Half of the last cell is shown.\r\n * * 1 - Full last cell is shown.\r\n *\r\n * @param value Location (0-1)\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"endLocation\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Axis.prototype.setDisabled = function (value) {\r\n var changed = _super.prototype.setDisabled.call(this, value);\r\n if (this.renderer) {\r\n this.renderer.gridContainer.disabled = value;\r\n }\r\n return changed;\r\n };\r\n Object.defineProperty(Axis.prototype, \"title\", {\r\n /**\r\n * @return Title label\r\n */\r\n get: function () {\r\n return this._title;\r\n },\r\n /**\r\n * A reference to a [[Label]] element which serves as a title to the axis.\r\n *\r\n * When axis is created it aleready has an element, so you can just modify\r\n * it.\r\n *\r\n * Or you can replace it with your own instance of `Label`.\r\n *\r\n * @param value Title label\r\n */\r\n set: function (value) {\r\n if (this._title && this._title != value) {\r\n this._title.dispose();\r\n }\r\n if (value) {\r\n this._title = value;\r\n value.parent = this;\r\n value.shouldClone = false;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Axis.prototype, \"hideTooltipWhileZooming\", {\r\n /**\r\n * @return Hide tooltip while zooming?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"hideTooltipWhileZooming\");\r\n },\r\n /**\r\n * Indicates if axis' tooltip should be hidden while axis range is animating\r\n * (zooming)\r\n *\r\n * @default true\r\n * @since 4.7.16\r\n * @param value Hide tooltip while zooming?\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"hideTooltipWhileZooming\", value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Axis.prototype, \"zoomable\", {\r\n /**\r\n * @return Zoomable?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"zoomable\");\r\n },\r\n /**\r\n * Should the axis be zoomed with scrollbar/cursor?\r\n *\r\n * @default true\r\n * @since 4.9.28\r\n * @param value Zoomable?\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"zoomable\", value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return Axis;\r\n}(Component));\r\nexport { Axis };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Axis\"] = Axis;\r\nregistry.registeredClasses[\"AxisDataItem\"] = AxisDataItem;\r\n/**\r\n * Add default responsive rules\r\n */\r\n/**\r\n * Disable axis tooltips.\r\n */\r\ndefaultRules.push({\r\n relevant: ResponsiveBreakpoints.maybeXS,\r\n state: function (target, stateId) {\r\n if (target instanceof Axis && target.tooltip) {\r\n var state = target.states.create(stateId);\r\n state.properties.cursorTooltipEnabled = false;\r\n return state;\r\n }\r\n return null;\r\n }\r\n});\r\n","/**\r\n * Axis break module\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Container } from \"../../core/Container\";\r\nimport { MutableValueDisposer } from \"../../core/utils/Disposer\";\r\nimport { WavedLine } from \"../../core/elements/WavedLine\";\r\nimport { List } from \"../../core/utils/List\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport { color } from \"../../core/utils/Color\";\r\nimport { InterfaceColorSet } from \"../../core/utils/InterfaceColorSet\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Base class to define \"breaks\" on axes.\r\n *\r\n * @see {@link IAxisBreakEvents} for a list of available events\r\n * @see {@link IAxisBreakAdapters} for a list of available Adapters\r\n * @important\r\n */\r\nvar AxisBreak = /** @class */ (function (_super) {\r\n __extends(AxisBreak, _super);\r\n /**\r\n * Constructor\r\n */\r\n function AxisBreak() {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n /**\r\n * Reference to parent Axis.\r\n */\r\n _this._axis = new MutableValueDisposer();\r\n /**\r\n * A list of axis data items which fall within this break.\r\n */\r\n _this.dataItems = new List();\r\n _this.className = \"AxisBreak\";\r\n // Set defaults\r\n _this.breakSize = 0.01;\r\n _this.marginLeft = -5;\r\n _this.marginRight = -5;\r\n _this.marginTop = -5;\r\n _this.marginBottom = -5;\r\n var interfaceColors = new InterfaceColorSet();\r\n // Create elements\r\n // (these won't be used actually, just for setting properties)\r\n var fillShape = new WavedLine();\r\n fillShape.fill = interfaceColors.getFor(\"background\");\r\n fillShape.stroke = color();\r\n fillShape.fillOpacity = 0.9;\r\n fillShape.zIndex = 0;\r\n _this._fillShape = fillShape;\r\n var startLine = new WavedLine();\r\n startLine.fill = color();\r\n startLine.stroke = interfaceColors.getFor(\"grid\");\r\n startLine.strokeOpacity = 0.3;\r\n startLine.zIndex = 1;\r\n _this._startLine = startLine;\r\n var endLine = new WavedLine();\r\n endLine.fill = color();\r\n endLine.stroke = color(\"#000000\"); // interfaceColors.getFor(\"grid\");\r\n endLine.strokeOpacity = 0.3;\r\n endLine.zIndex = 2;\r\n _this._endLine = endLine;\r\n _this._disposers.push(_this._axis);\r\n // Apply theme\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n AxisBreak.prototype.dispose = function () {\r\n _super.prototype.dispose.call(this);\r\n if (this._fillShape) {\r\n this._fillShape.dispose();\r\n }\r\n if (this._startLine) {\r\n this._startLine.dispose();\r\n }\r\n if (this._endLine) {\r\n this._endLine.dispose();\r\n }\r\n };\r\n Object.defineProperty(AxisBreak.prototype, \"startLine\", {\r\n /**\r\n * @return Element\r\n */\r\n get: function () {\r\n return this._startLine;\r\n },\r\n /**\r\n * An element used for the starting line of the break.\r\n *\r\n * @param sprite Element\r\n */\r\n set: function (sprite) {\r\n if (this._startLine) {\r\n this._startLine.dispose();\r\n }\r\n this._startLine = sprite;\r\n this.addBreakSprite(sprite);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(AxisBreak.prototype, \"endLine\", {\r\n /**\r\n * @return Element\r\n */\r\n get: function () {\r\n return this._endLine;\r\n },\r\n /**\r\n * An element used for the end line of the break.\r\n *\r\n * @param sprite Element\r\n */\r\n set: function (sprite) {\r\n if (this._endLine) {\r\n this._endLine.dispose();\r\n }\r\n this._endLine = sprite;\r\n this.addBreakSprite(sprite);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(AxisBreak.prototype, \"fillShape\", {\r\n /**\r\n * @return Element\r\n */\r\n get: function () {\r\n return this._fillShape;\r\n },\r\n /**\r\n * An element used for fill of the break.\r\n *\r\n * @param sprite Element\r\n */\r\n set: function (sprite) {\r\n if (this._fillShape) {\r\n this._fillShape.dispose();\r\n }\r\n this._fillShape = sprite;\r\n this.addBreakSprite(sprite);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Adds a break element (e.g. lines, fill) to the break, which is\r\n * [[Container]].\r\n *\r\n * @ignore Exclude from docs\r\n * @param sprite Element to add\r\n */\r\n AxisBreak.prototype.addBreakSprite = function (sprite) {\r\n sprite.parent = this;\r\n sprite.isMeasured = false;\r\n this._disposers.push(sprite);\r\n };\r\n Object.defineProperty(AxisBreak.prototype, \"axis\", {\r\n /**\r\n * @return Axis\r\n */\r\n get: function () {\r\n return this._axis.get();\r\n },\r\n /**\r\n * An Axis this Break is associated with.\r\n *\r\n * @param axis Axis\r\n */\r\n set: function (axis) {\r\n if (this._axis.get() !== axis) {\r\n this._axis.set(axis, axis.renderer.gridContainer.events.on(\"transformed\", this.invalidate, this, false));\r\n axis.renderer.createBreakSprites(this);\r\n // this can't go to copyFrom, as axis is set later\r\n var breakTemplate = axis.axisBreaks.template;\r\n this.startLine.copyFrom(breakTemplate.startLine);\r\n this.endLine.copyFrom(breakTemplate.endLine);\r\n this.fillShape.copyFrom(breakTemplate.fillShape);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(AxisBreak.prototype, \"breakSize\", {\r\n /**\r\n * @return Relative axis break\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"breakSize\");\r\n },\r\n /**\r\n * A size of the break relative to the actual size of the scope break spans.\r\n *\r\n * For example, if `breakSize = 0.1` and unbroken scope of values it spans\r\n * would be 100 pixels, the break would be 10 pixels wide.\r\n *\r\n * 0 means the break will completely collapse and hide the values.\r\n * 1 means break would be not collapse at all, which would make it\r\n * effectively useless.\r\n *\r\n * @default 0.01\r\n * @param value Relative axis break\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"breakSize\", value)) {\r\n if (this.axis) {\r\n this.axis.invalidate();\r\n this.axis.invalidateSeries();\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(AxisBreak.prototype, \"startPoint\", {\r\n /**\r\n * Returns pixel coordinates of axis break's start.\r\n *\r\n * @return Start point\r\n */\r\n get: function () {\r\n var renderer = this.axis.renderer;\r\n if (renderer) {\r\n return renderer.positionToPoint(this.startPosition);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(AxisBreak.prototype, \"endPoint\", {\r\n /**\r\n * Returns pixel coordinates of axis break's end.\r\n *\r\n * @return End point\r\n */\r\n get: function () {\r\n var renderer = this.axis.renderer;\r\n if (renderer) {\r\n return renderer.positionToPoint(this.endPosition);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(AxisBreak.prototype, \"startPosition\", {\r\n /**\r\n * Returns a relative position at which axis break starts.\r\n *\r\n * This is a calculated position, meaning it shows relative position of the\r\n * break after break is applied.\r\n *\r\n * @return Start position\r\n */\r\n get: function () {\r\n return;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(AxisBreak.prototype, \"endPosition\", {\r\n /**\r\n * Returns a relative position at which axis break ends.\r\n *\r\n * This is a calculated position, meaning it shows relative position of the\r\n * break after break is applied.\r\n *\r\n * @return End position\r\n */\r\n get: function () {\r\n return;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Draws the axis break.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n AxisBreak.prototype.draw = function () {\r\n _super.prototype.draw.call(this);\r\n if (this.axis) {\r\n var renderer = this.axis.renderer;\r\n renderer.updateBreakElement(this);\r\n }\r\n };\r\n Object.defineProperty(AxisBreak.prototype, \"startValue\", {\r\n /**\r\n * @return Starting value\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"startValue\");\r\n },\r\n /**\r\n * A starting value for the break.\r\n *\r\n * @param value Starting value\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"startValue\", value)) {\r\n if (this.axis) {\r\n this.axis.invalidate();\r\n this.axis.invalidateSeries();\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(AxisBreak.prototype, \"endValue\", {\r\n /**\r\n * @return End value\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"endValue\");\r\n },\r\n /**\r\n * An end value for the break.\r\n *\r\n * @param value End value\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"endValue\", value)) {\r\n if (this.axis) {\r\n this.axis.invalidate();\r\n this.axis.invalidateSeries();\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return AxisBreak;\r\n}(Container));\r\nexport { AxisBreak };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"AxisBreak\"] = AxisBreak;\r\n","/**\r\n * Axis Bullet module.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Container } from \"../../core/Container\";\r\nimport { registry } from \"../../core/Registry\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Used to draw a positioned bullet (element) on an Axis.\r\n *\r\n * ```TypeScript\r\n * let range = dateAxis.axisRanges.create();\r\n * range.date = new Date(2018, 0, 5);\r\n *\r\n * let flag = new am4plugins_bullets.FlagBullet();\r\n * flag.label.text = \"Hello\";\r\n *\r\n * range.bullet = flag;\r\n * ```\r\n * ```JavaScript\r\n * var range = dateAxis.axisRanges.create();\r\n * range.date = new Date(2018, 0, 5);\r\n *\r\n * var flag = new am4plugins_bullets.FlagBullet();\r\n * flag.label.text = \"Hello\";\r\n *\r\n * range.bullet = flag;\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"xAxes\": [{\r\n * \"type\": \"DateAxis\",\r\n * // ...\r\n * \"axisRanges\": [{\r\n * \"date\": new Date(2018, 0, 5),\r\n * \"bullet: {\r\n * \"type\": \"FlagBullet\",\r\n * \"label\": {\r\n * \"text\": \"Hello\"\r\n * }\r\n * }\r\n * }]\r\n * }]\r\n * }\r\n * ```\r\n *\r\n * @since 4.5.9\r\n * @see {@link IAxisBulletEvents} for a list of available events\r\n * @see {@link IAxisBulletAdapters} for a list of available Adapters\r\n * @important\r\n */\r\nvar AxisBullet = /** @class */ (function (_super) {\r\n __extends(AxisBullet, _super);\r\n function AxisBullet() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"AxisBullet\";\r\n _this.location = 0.5;\r\n _this.isMeasured = false;\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n Object.defineProperty(AxisBullet.prototype, \"location\", {\r\n /**\r\n * @return Location (0-1)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"location\");\r\n },\r\n /**\r\n * Relative position within cell/range.\r\n *\r\n * Value range is from from `0` (beginning) to `1` (end).\r\n *\r\n * NOTE: `location` is relative to the parent axis range's scope, i.e.\r\n * between its `date` and `endDate` for [[DateAxis]], or `value`/`endValue`\r\n * ([[ValueAxis]]), or `category`/`endCategory` ([[categoryAxis]]).\r\n *\r\n * ```TypeScript\r\n * let range = dateAxis.axisRanges.create();\r\n * range.date = new Date(2018, 0, 5);\r\n * range.endDate = new Date(2018, 0, 6);\r\n *\r\n * let bullet = new am4charts.AxisBullet();\r\n * bullet.location = 1;\r\n *\r\n * let flag = bullet.createChild(am4plugins_bullets.FlagBullet);\r\n * flag.label.text = \"Hello\";\r\n * ```\r\n * ```JavaScript\r\n * var range = dateAxis.axisRanges.create();\r\n * range.date = new Date(2018, 0, 5);\r\n * range.endDate = new Date(2018, 0, 6);\r\n *\r\n * var bullet = new am4charts.AxisBullet();\r\n * bullet.location = 1;\r\n *\r\n * var flag = bullet.createChild(am4plugins_bullets.FlagBullet);\r\n * flag.label.text = \"Hello\";\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"xAxes\": [{\r\n * \"type\": \"DateAxis\",\r\n * // ...\r\n * \"axisRanges\": [{\r\n * \"date\": new Date(2018, 0, 5),\r\n * \"endDate\": new Date(2018, 0, 6),\r\n * \"bullet: {\r\n * \"type\": \"AxisBullet\",\r\n * \"location\": 1,\r\n * \"children\": [{\r\n * \"type\": \"FlagBullet\",\r\n * \"label\": {\r\n * \"text\": \"Hello\"\r\n * }\r\n * }]\r\n * }\r\n * }]\r\n * }]\r\n * }\r\n * ```\r\n *\r\n * @default 0.5\r\n * @param value Location (0-1)\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"location\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * @ignore\r\n */\r\n AxisBullet.prototype.setDisabled = function (value) {\r\n var changed = _super.prototype.setDisabled.call(this, value);\r\n if (this.axis) {\r\n this.axis.invalidateDataItems();\r\n }\r\n return changed;\r\n };\r\n return AxisBullet;\r\n}(Container));\r\nexport { AxisBullet };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"AxisBullet\"] = AxisBullet;\r\n","import { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Sprite } from \"../../core/Sprite\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport { InterfaceColorSet } from \"../../core/utils/InterfaceColorSet\";\r\nimport * as $type from \"../../core/utils/Type\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * AxisFill is a base class used to defines fill shapes for various\r\n * type-specific Axes.\r\n *\r\n * Axis fills are used to add fills to specific ranges of those axes.\r\n *\r\n * @see {@link IAxisFillEvents} for a list of available events\r\n * @see {@link IAxisFillAdapters} for a list of available Adapters\r\n * @important\r\n */\r\nvar AxisFill = /** @class */ (function (_super) {\r\n __extends(AxisFill, _super);\r\n /**\r\n * Constructor.\r\n *\r\n * @param axis Axis\r\n */\r\n function AxisFill(axis) {\r\n var _this = _super.call(this) || this;\r\n _this.axis = axis;\r\n _this.element = _this.paper.add(\"path\");\r\n _this.className = \"AxisFill\";\r\n _this.isMeasured = false;\r\n _this.location = 0;\r\n _this.above = false;\r\n var interfaceColors = new InterfaceColorSet();\r\n _this.fill = interfaceColors.getFor(\"alternativeBackground\");\r\n _this.fillOpacity = 0;\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * @ignore\r\n */\r\n AxisFill.prototype.setDisabled = function (value) {\r\n var changed = _super.prototype.setDisabled.call(this, value);\r\n if (this.axis) {\r\n this.axis.invalidateDataItems();\r\n }\r\n return changed;\r\n };\r\n /**\r\n * Draws the fill element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n AxisFill.prototype.draw = function () {\r\n _super.prototype.draw.call(this);\r\n if (this.__disabled || this.disabled) {\r\n return;\r\n }\r\n if (this.axis && $type.isNumber(this.startPosition) && $type.isNumber(this.endPosition)) {\r\n this.fillPath = this.axis.getPositionRangePath(this.startPosition, this.endPosition);\r\n this.path = this.fillPath;\r\n if (this.isMeasured) {\r\n this.measure();\r\n }\r\n }\r\n };\r\n Object.defineProperty(AxisFill.prototype, \"startPosition\", {\r\n /**\r\n * @return Start position\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"startPosition\");\r\n },\r\n /**\r\n * An actual starting position of the fill.\r\n *\r\n * @param value Starting position\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"startPosition\", value);\r\n this.invalidate(); // this is needed as relative position might not change when zooming\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(AxisFill.prototype, \"endPosition\", {\r\n /**\r\n * @return End position\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"endPosition\");\r\n },\r\n /**\r\n * An actual end position of the fill.\r\n *\r\n * @param value End position\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"endPosition\", value);\r\n this.invalidate(); // this is needed as relative position might not change when zooming\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(AxisFill.prototype, \"location\", {\r\n /**\r\n * @return Location (0-1)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"location\");\r\n },\r\n /**\r\n * Relative location of the fill. (0-1)\r\n *\r\n * @param value Location (0-1)\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"location\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * @ignore\r\n */\r\n AxisFill.prototype.setPath = function (value) {\r\n if (this.setPropertyValue(\"path\", value)) {\r\n this.element.attr({ \"d\": value });\r\n return true;\r\n }\r\n return false;\r\n };\r\n Object.defineProperty(AxisFill.prototype, \"above\", {\r\n /**\r\n * @return Draw above series?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"above\");\r\n },\r\n /**\r\n * Normally fill goes below series. Set this to `true` to go above.\r\n *\r\n * @default false\r\n * @since 4.5.9\r\n * @param value Draw above series?\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"above\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return AxisFill;\r\n}(Sprite));\r\nexport { AxisFill };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"AxisFill\"] = AxisFill;\r\n","/**\r\n * Axis Label module\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Label } from \"../../core/elements/Label\";\r\nimport { registry } from \"../../core/Registry\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Use to create labels on Axis.\r\n *\r\n * @see {@link IAxisLabelEvents} for a list of available events\r\n * @see {@link IAxisLabelAdapters} for a list of available Adapters\r\n * @important\r\n */\r\nvar AxisLabel = /** @class */ (function (_super) {\r\n __extends(AxisLabel, _super);\r\n /**\r\n * Constructor\r\n */\r\n function AxisLabel() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"AxisLabel\";\r\n _this.isMeasured = false;\r\n _this.padding(10, 10, 10, 10);\r\n _this.location = 0.5;\r\n //this.nonScaling = true; // not good for perf\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n Object.defineProperty(AxisLabel.prototype, \"location\", {\r\n /**\r\n * @return Location (0-1)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"location\");\r\n },\r\n /**\r\n * Relative location of the label. (0-1)\r\n *\r\n * @param value Location (0-1)\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"location\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(AxisLabel.prototype, \"inside\", {\r\n /**\r\n * Returns if label is set to be drawn inside axis.\r\n *\r\n * @return Inside?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"inside\");\r\n },\r\n /**\r\n * Sets if label should be drawn inside axis.\r\n *\r\n * @param value Inside?\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"inside\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * @ignore\r\n */\r\n AxisLabel.prototype.setDisabled = function (value) {\r\n var changed = _super.prototype.setDisabled.call(this, value);\r\n if (this.axis) {\r\n this.axis.invalidateDataItems();\r\n }\r\n return changed;\r\n };\r\n return AxisLabel;\r\n}(Label));\r\nexport { AxisLabel };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"AxisLabel\"] = AxisLabel;\r\n","/**\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Sprite } from \"../../core/Sprite\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport { color } from \"../../core/utils/Color\";\r\nimport { InterfaceColorSet } from \"../../core/utils/InterfaceColorSet\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Used to draw Axis line.\r\n *\r\n * @see {@link IAxisLineEvents} for a list of available events\r\n * @see {@link IAxisLineAdapters} for a list of available Adapters\r\n */\r\nvar AxisLine = /** @class */ (function (_super) {\r\n __extends(AxisLine, _super);\r\n /**\r\n * Constructor\r\n */\r\n function AxisLine() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"AxisLine\";\r\n _this.element = _this.paper.add(\"path\");\r\n var interfaceColors = new InterfaceColorSet();\r\n _this.stroke = interfaceColors.getFor(\"grid\");\r\n _this.strokeOpacity = 0.15;\r\n _this.pixelPerfect = true;\r\n _this.fill = color();\r\n _this.applyTheme();\r\n _this.interactionsEnabled = false;\r\n return _this;\r\n //this.element.moveTo({ x: 0, y: 0 });\r\n }\r\n return AxisLine;\r\n}(Sprite));\r\nexport { AxisLine };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"AxisLine\"] = AxisLine;\r\n","/**\r\n * Module, defining base Axis Renderer.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Container } from \"../../core/Container\";\r\nimport { MutableValueDisposer } from \"../../core/utils/Disposer\";\r\nimport { AxisDataItem } from \"./Axis\";\r\nimport { AxisLine } from \"./AxisLine\";\r\nimport { AxisFill } from \"./AxisFill\";\r\nimport { Grid } from \"./Grid\";\r\nimport { AxisLabel } from \"./AxisLabel\";\r\nimport { AxisTick } from \"./AxisTick\";\r\nimport { ListTemplate, ListDisposer } from \"../../core/utils/List\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport { percent } from \"../../core/utils/Percent\";\r\nimport * as $math from \"../../core/utils/Math\";\r\nimport * as $type from \"../../core/utils/Type\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * A base class for all axis renderers.\r\n *\r\n * @see {@link IAxisRendererEvents} for a list of available events\r\n * @see {@link IAxisRendererAdapters} for a list of available Adapters\r\n */\r\nvar AxisRenderer = /** @class */ (function (_super) {\r\n __extends(AxisRenderer, _super);\r\n /**\r\n * Constructor.\r\n *\r\n * @param axis Related axis\r\n */\r\n function AxisRenderer() {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n /**\r\n * A related chart.\r\n */\r\n _this._chart = new MutableValueDisposer();\r\n _this.className = \"AxisRenderer\";\r\n // Set defaults\r\n _this.minGridDistance = 50;\r\n _this.inside = false;\r\n _this.inversed = false;\r\n _this.tooltipLocation = 0.5;\r\n _this.fullWidthTooltip = false;\r\n _this.cellStartLocation = 0;\r\n _this.cellEndLocation = 1;\r\n _this.minLabelPosition = 0;\r\n _this.maxLabelPosition = 1;\r\n _this.shouldClone = false;\r\n var gridContainer = _this.createChild(Container);\r\n gridContainer.shouldClone = false;\r\n gridContainer.layout = \"none\";\r\n //\tgridContainer.isMeasured = false;\r\n gridContainer.virtualParent = _this;\r\n gridContainer.width = percent(100);\r\n gridContainer.height = percent(100);\r\n _this.gridContainer = gridContainer;\r\n // not good without this\r\n gridContainer.events.on(\"maxsizechanged\", function () {\r\n if (_this.inited) {\r\n _this.invalidateAxisItems();\r\n }\r\n }, _this, false);\r\n var breakContainer = _this.createChild(Container);\r\n breakContainer.shouldClone = false;\r\n breakContainer.isMeasured = false;\r\n breakContainer.layout = \"none\";\r\n breakContainer.width = percent(100);\r\n breakContainer.height = percent(100);\r\n _this.breakContainer = breakContainer;\r\n var bulletsContainer = _this.createChild(Container);\r\n bulletsContainer.shouldClone = false;\r\n bulletsContainer.isMeasured = false;\r\n bulletsContainer.layout = \"none\";\r\n bulletsContainer.width = percent(100);\r\n bulletsContainer.height = percent(100);\r\n _this.bulletsContainer = bulletsContainer;\r\n _this.line = _this.createChild(AxisLine);\r\n _this.line.shouldClone = false;\r\n _this.line.strokeOpacity = 0;\r\n var baseGrid = _this.createChild(Grid);\r\n baseGrid.shouldClone = false;\r\n _this.baseGrid = baseGrid;\r\n // Make elements disposable\r\n var disposers = _this._disposers;\r\n disposers.push(baseGrid);\r\n disposers.push(_this.line);\r\n disposers.push(gridContainer);\r\n disposers.push(breakContainer);\r\n disposers.push(bulletsContainer);\r\n disposers.push(_this._chart);\r\n _this.ticks.template.disabled = true;\r\n _this.axisFills.template.disabled = true;\r\n _this.axisFills.template.interactionsEnabled = false;\r\n // Apply theme\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n Object.defineProperty(AxisRenderer.prototype, \"axis\", {\r\n /**\r\n * Axis of a renderer\r\n * @return axis Axis\r\n */\r\n get: function () {\r\n return this._axis;\r\n },\r\n /**\r\n * Axis of a renderer\r\n * @param axis Axis\r\n */\r\n set: function (axis) {\r\n this.setAxis(axis);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * @ignore\r\n */\r\n AxisRenderer.prototype.setAxis = function (axis) {\r\n this._axis = axis;\r\n this.baseGrid.parent = axis;\r\n this.line.parent = axis;\r\n this.gridContainer.bind(\"opacity\", axis);\r\n };\r\n /**\r\n * Called when rendered is attached to an Axis, as well as a property of\r\n * Axis that might affect the appearance is updated.\r\n *\r\n * E.g. `axis.opposite`, `axis.inside`, etc.\r\n *\r\n * This method is called **before** draw, so that any related setting\r\n * changed in this method can be changed.\r\n *\r\n * @todo Description (review)\r\n * @ignore Exclude from docs\r\n */\r\n AxisRenderer.prototype.processRenderer = function () {\r\n this.events.on(\"sizechanged\", this.updateTooltip, this, false);\r\n this.events.on(\"positionchanged\", this.updateTooltip, this, false);\r\n this.labels.template.inside = this.inside;\r\n this.ticks.template.inside = this.inside;\r\n };\r\n /**\r\n * Updates Axis' tooltip.\r\n *\r\n * @todo Description (review)\r\n * @ignore Exclude from docs\r\n */\r\n AxisRenderer.prototype.updateTooltip = function () {\r\n // This is a placeholder method for extending classes to override.\r\n };\r\n Object.defineProperty(AxisRenderer.prototype, \"axisLength\", {\r\n /**\r\n * Returns actual length of the Axis, in pixels.\r\n *\r\n * @return Length (px)\r\n */\r\n get: function () {\r\n // This is a placeholder method for extending classes to override.\r\n return 0;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Re-positions an element to new coordinates.\r\n *\r\n * @ignore Exclude from docs\r\n * @param item A target element\r\n * @param point New coordinates\r\n */\r\n AxisRenderer.prototype.positionItem = function (item, point) {\r\n if (item) {\r\n item.moveTo(point);\r\n }\r\n };\r\n /**\r\n * Converts relative position on axis to point coordinates.\r\n *\r\n * @param position Position (0-1)\r\n * @return Point\r\n */\r\n AxisRenderer.prototype.positionToPoint = function (position, position2) {\r\n // This is a placeholder method for extending classes to override.\r\n return { x: 0, y: 0 };\r\n };\r\n /**\r\n * Converts relative position on axis to angle.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description (review / units)\r\n * @param position Position (0-1)\r\n * @return Angle\r\n */\r\n AxisRenderer.prototype.positionToAngle = function (position) {\r\n // This is a placeholder method for extending classes to override.\r\n return 0;\r\n };\r\n /**\r\n * Converts relative position (0-1) on axis to a pixel coordinate.\r\n *\r\n * @param position Position (0-1)\r\n * @return Coordinate (px)\r\n */\r\n AxisRenderer.prototype.positionToCoordinate = function (position) {\r\n var coordinate;\r\n var axis = this.axis;\r\n var axisFullLength = axis.axisFullLength;\r\n if (axis.renderer.inversed) {\r\n coordinate = (axis.end - position) * axisFullLength;\r\n }\r\n else {\r\n coordinate = (position - axis.start) * axisFullLength;\r\n }\r\n return coordinate;\r\n };\r\n AxisRenderer.prototype.updateGridContainer = function () {\r\n };\r\n AxisRenderer.prototype.getHeight = function () {\r\n var gridContainer = this.gridContainer;\r\n if (gridContainer.parent) {\r\n return gridContainer.parent.pixelHeight;\r\n }\r\n return this.gridContainer.pixelHeight || 0;\r\n };\r\n AxisRenderer.prototype.getWidth = function () {\r\n var gridContainer = this.gridContainer;\r\n if (gridContainer.parent) {\r\n return gridContainer.parent.pixelWidth;\r\n }\r\n return this.gridContainer.pixelWidth || 0;\r\n };\r\n /**\r\n * Converts a coordinate in pixels to a relative position. (0-1)\r\n *\r\n * @param coordinate Coordinate (px)\r\n * @param coordinate2 Coordinate of a second axis, only needed for complex axes systems, like timeline (px)\r\n * @return Position (0-1)\r\n */\r\n AxisRenderer.prototype.coordinateToPosition = function (coordinate, coordinate2) {\r\n var position;\r\n var axis = this.axis;\r\n var axisFullLength = axis.axisFullLength;\r\n if (axis.renderer.inversed) {\r\n position = axis.end - coordinate / axisFullLength;\r\n }\r\n else {\r\n position = coordinate / axisFullLength + axis.start;\r\n }\r\n return $math.round(position, 5);\r\n };\r\n /**\r\n * Converts a point at specific coordinates to a relative position (0-1)\r\n * on the axis.\r\n *\r\n * @ignore Exclude from docs\r\n * @param point Point\r\n * @return Position (0-1)\r\n */\r\n AxisRenderer.prototype.pointToPosition = function (point) {\r\n // This is a placeholder method for extending classes to override.\r\n return 0;\r\n };\r\n /**\r\n * [getPositionRangePath description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param startPosition Starting position\r\n * @param endPosition End position\r\n * @return SVG path\r\n */\r\n AxisRenderer.prototype.getPositionRangePath = function (startPosition, endPosition) {\r\n return \"\";\r\n };\r\n /**\r\n * Invalidates all axis data items, effectively causing them re-evaluated.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description (review)\r\n */\r\n AxisRenderer.prototype.invalidateAxisItems = function () {\r\n var axis = this.axis;\r\n if (axis) {\r\n axis.invalidateDataItems();\r\n }\r\n };\r\n /**\r\n * Updates and positions a grid element.\r\n *\r\n * @ignore Exclude from docs\r\n * @param grid Grid element\r\n * @param position Starting position\r\n * @param endPosition End position\r\n */\r\n AxisRenderer.prototype.updateGridElement = function (grid, position, endPosition) {\r\n // This is a placeholder method for extending classes to override.\r\n };\r\n /**\r\n * Updates and positions a tick element.\r\n *\r\n * @ignore Exclude from docs\r\n * @param tick Tick element\r\n * @param position Starting position\r\n * @param endPosition End position\r\n */\r\n AxisRenderer.prototype.updateTickElement = function (tick, position, endPosition) {\r\n // This is a placeholder method for extending classes to override.\r\n };\r\n /**\r\n * Updates and positions axis bullet.\r\n *\r\n * @ignore Exclude from docs\r\n * @param bullet AxisBullet element\r\n * @param position Starting position\r\n * @param endPosition End position\r\n */\r\n AxisRenderer.prototype.updateBullet = function (bullet, position, endPosition) {\r\n // This is a placeholder method for extending classes to override.\r\n };\r\n /**\r\n * Updates and positions a label element.\r\n *\r\n * @ignore Exclude from docs\r\n * @param label Label element\r\n * @param position Starting position\r\n * @param endPosition Ending position\r\n */\r\n AxisRenderer.prototype.updateLabelElement = function (label, position, endPosition, location) {\r\n // This is a placeholder method for extending classes to override.\r\n };\r\n /**\r\n * Updates and positions the axis fill element.\r\n *\r\n * @ignore Exclude from docs\r\n * @param fill Fill element\r\n * @param position Starting position\r\n * @param endPosition Ending position\r\n */\r\n AxisRenderer.prototype.updateFillElement = function (fill, position, endPosition) {\r\n fill.startPosition = position;\r\n fill.endPosition = endPosition;\r\n };\r\n /**\r\n * Updates and positions the axis line element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n AxisRenderer.prototype.updateAxisLine = function () {\r\n // This is a placeholder method for extending classes to override.\r\n };\r\n /**\r\n * Updates and positions the base grid element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n AxisRenderer.prototype.updateBaseGridElement = function () {\r\n // This is a placeholder method for extending classes to override.\r\n };\r\n /**\r\n * Updates and positions an axis break element.\r\n *\r\n * @ignore Exclude from docs\r\n * @param axisBreak Break element\r\n */\r\n AxisRenderer.prototype.updateBreakElement = function (axisBreak) {\r\n this.positionItem(axisBreak.startLine, axisBreak.startPoint);\r\n this.toggleVisibility(axisBreak.startLine, axisBreak.startPosition, 0, 1);\r\n this.positionItem(axisBreak.endLine, axisBreak.endPoint);\r\n this.toggleVisibility(axisBreak.endLine, axisBreak.endPosition, 0, 1);\r\n };\r\n Object.defineProperty(AxisRenderer.prototype, \"minGridDistance\", {\r\n /**\r\n * @return Min distance (px)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"minGridDistance\");\r\n },\r\n /**\r\n * Minimum distance in pixels between grid elements.\r\n *\r\n * Use it to control density of the grid/labels on the axis.element.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/axes/positioning-axis-elements/#Setting_the_density_of_the_the_grid_labels} for more info\r\n * @param value Min distance (px)\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"minGridDistance\", value)) {\r\n if (this.axis) {\r\n this.axis.invalidateDataItems();\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(AxisRenderer.prototype, \"chart\", {\r\n /**\r\n * @ignore Exclude from docs\r\n * @return Chart\r\n */\r\n get: function () {\r\n return this._chart.get();\r\n },\r\n /**\r\n * A chart, associated with the Axis.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Chart\r\n */\r\n set: function (value) {\r\n this._chart.set(value, null);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Toggles visibility of an element, based on its current position and\r\n * min/max position settings.\r\n *\r\n * E.g. labels based on `minLabelPosition` and `maxLabelPosition`.\r\n *\r\n * @ignore Exclude from docs\r\n * @param sprite An element to toggle\r\n * @param position Elements current position\r\n * @param minPosition Min position setting\r\n * @param maxPosition Max position setting\r\n */\r\n AxisRenderer.prototype.toggleVisibility = function (sprite, position, minPosition, maxPosition) {\r\n var axis = this.axis;\r\n var dataItem = sprite.dataItem;\r\n if (dataItem && dataItem instanceof AxisDataItem) {\r\n if ($type.isNumber(dataItem.minPosition)) {\r\n minPosition = dataItem.minPosition;\r\n }\r\n if ($type.isNumber(dataItem.maxPosition)) {\r\n maxPosition = dataItem.maxPosition;\r\n }\r\n }\r\n var updatedStart = axis.start + (axis.end - axis.start) * (minPosition - 0.0001);\r\n var updatedEnd = axis.start + (axis.end - axis.start) * (maxPosition + 0.0001);\r\n if (!sprite.disabled) {\r\n if (position < updatedStart || position > updatedEnd) {\r\n sprite.__disabled = true;\r\n }\r\n else {\r\n sprite.__disabled = false;\r\n }\r\n }\r\n };\r\n /**\r\n * Creates visual elements for and axis break.\r\n *\r\n * @ignore Exclude from docs\r\n * @param axisBreak Axis break\r\n */\r\n AxisRenderer.prototype.createBreakSprites = function (axisBreak) {\r\n // This is a placeholder method for extending classes to override.\r\n };\r\n Object.defineProperty(AxisRenderer.prototype, \"axisFills\", {\r\n /**\r\n * A list of Axis' Fill elements.\r\n *\r\n * Those are fill elements that cover the space between every second set\r\n * of grid lines, and can be configured to create striped charts.\r\n *\r\n * Please note that these are disabled by default. To enable them, set\r\n * template to true.\r\n *\r\n * ```TypeScript\r\n * categoryAxis.renderer.axisFills.template.disabled = false;\r\n * ```\r\n * ```JavaScript\r\n * categoryAxis.renderer.axisFills.template.disabled = false;\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"xAxes\": [{\r\n * // ...\r\n * \"renderer\": {\r\n * \"axisFills\": {\r\n * \"disabled\": false\r\n * }\r\n * }\r\n * }]\r\n * }\r\n * ```\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/tutorials/alternated-axis-fills/} this tutorial for more info.\r\n * @return Fill elements\r\n */\r\n get: function () {\r\n if (!this._axisFills) {\r\n var fill = this.createFill(this.axis);\r\n this._axisFills = new ListTemplate(fill);\r\n fill.applyOnClones = true;\r\n fill.events.on(\"enabled\", this.invalidateAxisItems, this, false);\r\n this._disposers.push(new ListDisposer(this._axisFills));\r\n this._disposers.push(this._axisFills.template);\r\n }\r\n return this._axisFills;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Returns a new fill element, suitable for this Axis Renderer type.\r\n *\r\n * @return Fill element\r\n */\r\n AxisRenderer.prototype.createFill = function (axis) {\r\n return new AxisFill(axis);\r\n };\r\n Object.defineProperty(AxisRenderer.prototype, \"grid\", {\r\n /**\r\n * A list of Axis' Grid elements.\r\n *\r\n * @return Grid elements\r\n */\r\n get: function () {\r\n if (!this._grid) {\r\n var grid = this.createGrid();\r\n this._grid = new ListTemplate(grid);\r\n grid.applyOnClones = true;\r\n grid.events.on(\"enabled\", this.invalidateAxisItems, this, false);\r\n this._disposers.push(new ListDisposer(this._grid));\r\n this._disposers.push(this._grid.template);\r\n }\r\n return this._grid;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Returns a new grid element, suitable for this Axis Renderer type.\r\n *\r\n * @return Grid element\r\n */\r\n AxisRenderer.prototype.createGrid = function () {\r\n return new Grid();\r\n };\r\n Object.defineProperty(AxisRenderer.prototype, \"ticks\", {\r\n /**\r\n * A list of Axis' Tick elements.\r\n *\r\n * Please note that these are disabled by default. To enable ticks, you'll\r\n * need to set `disabled` and `strokeOpacity` properties of the tick template.\r\n *\r\n * ```TypeScript\r\n * categoryAxis.renderer.ticks.template.disabled = false;\r\n * categoryAxis.renderer.ticks.template.strokeOpacty = 0.5;\r\n * ```\r\n * ```JavaScript\r\n * categoryAxis.renderer.ticks.template.disabled = false;\r\n * categoryAxis.renderer.ticks.template.strokeOpacty = 0.5;\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"xAxes\": [{\r\n * // ...\r\n * \"renderer\": {\r\n * \"ticks\": {\r\n * \"disabled\": false,\r\n * \"strokeOpacty\": 0.5\r\n * }\r\n * }\r\n * }]\r\n * }\r\n * ```\r\n *\r\n * @return Tick elements\r\n */\r\n get: function () {\r\n if (!this._ticks) {\r\n var tick = this.createTick();\r\n tick.applyOnClones = true;\r\n tick.isMeasured = false;\r\n tick.events.on(\"enabled\", this.invalidateAxisItems, this, false);\r\n this._ticks = new ListTemplate(tick);\r\n this._disposers.push(new ListDisposer(this._ticks));\r\n this._disposers.push(this._ticks.template);\r\n }\r\n return this._ticks;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Returns a new tick element, suitable for this Axis Renderer type.\r\n *\r\n * @return Tick element\r\n */\r\n AxisRenderer.prototype.createTick = function () {\r\n return new AxisTick();\r\n };\r\n Object.defineProperty(AxisRenderer.prototype, \"labels\", {\r\n /**\r\n * A list of Axis' Label elements.\r\n *\r\n * @return Label elements\r\n */\r\n get: function () {\r\n if (!this._labels) {\r\n var label = this.createLabel();\r\n this._labels = new ListTemplate(label);\r\n label.applyOnClones = true;\r\n label.events.on(\"enabled\", this.invalidateAxisItems, this, false);\r\n this._disposers.push(new ListDisposer(this._labels));\r\n this._disposers.push(this._labels.template);\r\n }\r\n return this._labels;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Returns a new label element, suitable for this Axis Renderer type.\r\n *\r\n * @return Label element\r\n */\r\n AxisRenderer.prototype.createLabel = function () {\r\n return new AxisLabel();\r\n };\r\n Object.defineProperty(AxisRenderer.prototype, \"inside\", {\r\n /**\r\n * @return Labels inside?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"inside\");\r\n },\r\n /**\r\n * Indicates whether Axis' labels and ticks should be drawn inside Plot area.\r\n *\r\n * Does not work with all renderers, like AxisRendererRadial.\r\n *\r\n * @param value Labels inside?\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"inside\", value)) {\r\n if (this.axis) {\r\n this.axis.invalidate();\r\n }\r\n }\r\n if (value) {\r\n this.width = 0;\r\n this.height = 0;\r\n }\r\n else {\r\n this.width = undefined;\r\n this.height = undefined;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(AxisRenderer.prototype, \"opposite\", {\r\n /**\r\n * @return Draw axis on opposite side?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"opposite\");\r\n },\r\n /**\r\n * Indicates whether Axis should be drawn on the opposite side of the plot\r\n * area than it would normally be drawn based on chart's settings.\r\n *\r\n * Does not work with all renderers, like [[AxisRendererRadial]] and\r\n * [[AxisRenderer Circular].\r\n *\r\n * @param value Draw axis on opposite side?\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"opposite\", value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(AxisRenderer.prototype, \"fullWidthTooltip\", {\r\n /**\r\n * @return Full width tooltip?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"fullWidthTooltip\");\r\n },\r\n /**\r\n * Indicates if Axis tooltip should take the whole width of the axis cell.\r\n * (between two grid lines)\r\n *\r\n * NOTE: this setting is ignored on circular axis types.\r\n *\r\n * @param value Full width tooltip?\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"fullWidthTooltip\", value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(AxisRenderer.prototype, \"tooltipLocation\", {\r\n /**\r\n * @return Tooltip location\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"tooltipLocation\");\r\n },\r\n /**\r\n * Location within axis cell to show tooltip on. (0-1)\r\n *\r\n * 0 - show at the start\r\n * 0.5 - show right in the middle\r\n * 1 - show at the end\r\n *\r\n * @param value Tooltip location\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"tooltipLocation\", value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(AxisRenderer.prototype, \"tooltipLocation2\", {\r\n /**\r\n * @return Tooltip location\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"tooltipLocation2\");\r\n },\r\n /**\r\n * Location within secondary axis cell to show tooltip on. (0-1)\r\n *\r\n * 0 - show at the start\r\n * 0.5 - show right in the middle\r\n * 1 - show at the end\r\n *\r\n * @param value Tooltip location\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"tooltipLocation2\", value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(AxisRenderer.prototype, \"cellStartLocation\", {\r\n /**\r\n * @return Cell start (0-1)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"cellStartLocation\");\r\n },\r\n /**\r\n * Location for the cell start.\r\n *\r\n * Normally a \"cell\" is the whole available width in a category.\r\n *\r\n * If there are several clustered column-like series available, the whole\r\n * space is divided between each clustered column, or column stacks.\r\n *\r\n * `cellStartLocation` identifies where, within available space, the actual\r\n * cell starts.\r\n *\r\n * This, together with column series' `width` will affect actual width of\r\n * columns, and thus gaps between them.\r\n *\r\n * This will affect category-like axes only, like [[DateAxis]], or\r\n * [[CategoryAxis]].\r\n *\r\n * This is used to limit a space occupied by series like column.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/axes/positioning-axis-elements/} for more info.\r\n * @param value Cell start (0-1)\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"cellStartLocation\", value)) {\r\n if (this.axis) {\r\n this.axis.invalidateSeries();\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(AxisRenderer.prototype, \"cellEndLocation\", {\r\n /**\r\n * @return Cell end (0-1)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"cellEndLocation\");\r\n },\r\n /**\r\n * Location for the cell end.\r\n *\r\n * Normally a \"cell\" is the whole available width in a category.\r\n *\r\n * If there are several clustered column-like series available, the whole\r\n * space is divided between each clustered column, or column stacks.\r\n *\r\n * `cellEndLocation` identifies where, within available space, the actual\r\n * cell ends.\r\n *\r\n * This, together with column series' `width` will affect actual width of\r\n * columns, and thus gaps between them.\r\n *\r\n * This will affect category-like axes only, like [[DateAxis]], or\r\n * [[CategoryAxis]].\r\n *\r\n * This is used to limit a space occupied by series like column.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/axes/positioning-axis-elements/} for more info.\r\n * @param value Cell end (0-1)\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"cellEndLocation\", value)) {\r\n if (this.axis) {\r\n this.axis.invalidateSeries();\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(AxisRenderer.prototype, \"inversed\", {\r\n /**\r\n * @return Flip axis?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"inversed\");\r\n },\r\n /**\r\n * Indicates if the scale of the axis should be flipped.\r\n *\r\n * @param value Flip axis?\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"inversed\", value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(AxisRenderer.prototype, \"minLabelPosition\", {\r\n /**\r\n * @return Min label position (0-1)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"minLabelPosition\");\r\n },\r\n /**\r\n * Minimum position along the Axis, for labels.\r\n *\r\n * Labels, which have their position closer to the start of the Axis, will be\r\n * automatically hidden.\r\n *\r\n * E.g., setting this to 0.05 (5% of total axis length) would hide labels,\r\n * that would otherwise be drawn very near start of the Axis.\r\n *\r\n * This is especially usefull with `inside = true`, or if the chart hasn't\r\n * got any extra margins.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/axes/positioning-axis-elements/} for more info.\r\n * @param value Min label position (0-1)\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"minLabelPosition\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(AxisRenderer.prototype, \"maxLabelPosition\", {\r\n /**\r\n * @return Max label position (0-1)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"maxLabelPosition\");\r\n },\r\n /**\r\n * Maximum position along the Axis, for labels.\r\n *\r\n * Labels, which have their position closer to the and of the Axis, will be\r\n * automatically hidden.\r\n *\r\n * E.g., setting this to 0.95 (95% of total axis length) would hide labels,\r\n * that would otherwise be drawn very near end of the Axis.\r\n *\r\n * This is especially usefull with `inside = true`, or if the chart hasn't\r\n * got any extra margins.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/axes/positioning-axis-elements/} for more info.\r\n * @param value Max label position (0-1)\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"maxLabelPosition\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Copies all settings and related items from another object of the same\r\n * type.\r\n *\r\n * @param source Source object\r\n */\r\n AxisRenderer.prototype.copyFrom = function (source) {\r\n _super.prototype.copyFrom.call(this, source);\r\n this.grid.template.copyFrom(source.grid.template);\r\n this.ticks.template.copyFrom(source.ticks.template);\r\n this.labels.template.copyFrom(source.labels.template);\r\n this.axisFills.template.copyFrom(source.axisFills.template);\r\n this.line.copyFrom(source.line);\r\n this.baseGrid.copyFrom(source.baseGrid);\r\n };\r\n /**\r\n * @ignore\r\n */\r\n AxisRenderer.prototype.toAxisPosition = function (value) {\r\n return value;\r\n };\r\n /**\r\n * Sets `visibility` property:\r\n *\r\n * * `true` - visible\r\n * * `false` - hidden\r\n *\r\n * @param value true - visible, false - hidden\r\n * @return Current visibility\r\n */\r\n AxisRenderer.prototype.setVisibility = function (value) {\r\n _super.prototype.setVisibility.call(this, value);\r\n this.bulletsContainer.visible = value;\r\n };\r\n return AxisRenderer;\r\n}(Container));\r\nexport { AxisRenderer };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"AxisRenderer\"] = AxisRenderer;\r\n","/**\r\n * Module, defining Axis Renderer for vertical axes.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { AxisRenderer } from \"./AxisRenderer\";\r\nimport { AxisBullet } from \"./AxisBullet\";\r\nimport { WavedLine } from \"../../core/elements/WavedLine\";\r\nimport { WavedRectangle } from \"../../core/elements/WavedRectangle\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport { percent, Percent } from \"../../core/utils/Percent\";\r\nimport * as $math from \"../../core/utils/Math\";\r\nimport * as $path from \"../../core/rendering/Path\";\r\nimport * as $utils from \"../../core/utils/Utils\";\r\nimport * as $type from \"../../core/utils/Type\";\r\nimport { defaultRules, ResponsiveBreakpoints } from \"../../core/utils/Responsive\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * A renderer for horizontal axis.\r\n *\r\n * @see {@link IAxisRendererEvents} for a list of available events\r\n * @see {@link IAxisRendererAdapters} for a list of available Adapters\r\n */\r\nvar AxisRendererX = /** @class */ (function (_super) {\r\n __extends(AxisRendererX, _super);\r\n /**\r\n * Constructor.\r\n *\r\n * @param axis Related axis\r\n */\r\n function AxisRendererX() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"AxisRendererX\";\r\n _this.minGridDistance = 120;\r\n _this.opposite = false;\r\n _this.rotation = 0;\r\n _this.width = percent(100);\r\n _this.labels.template.horizontalCenter = \"middle\";\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * @ignore\r\n */\r\n AxisRendererX.prototype.setAxis = function (axis) {\r\n _super.prototype.setAxis.call(this, axis);\r\n axis.layout = \"vertical\";\r\n };\r\n /**\r\n * @ignore\r\n */\r\n AxisRendererX.prototype.updateGridContainer = function () {\r\n var axis = this.axis;\r\n if (axis) {\r\n var gridContainer = this.gridContainer;\r\n gridContainer.x = axis.pixelX;\r\n gridContainer.width = axis.axisLength;\r\n }\r\n };\r\n /**\r\n * Called when rendered is attached to an Axis, as well as a property of\r\n * Axis that might affect the appearance is updated.\r\n *\r\n * E.g. `axis.opposite`, `axis.inside`, etc.\r\n *\r\n * This method is called **before** draw, so that any related setting\r\n * changed in this method can be changed.\r\n *\r\n * @todo Description (review)\r\n * @ignore Exclude from docs\r\n */\r\n AxisRendererX.prototype.processRenderer = function () {\r\n _super.prototype.processRenderer.call(this);\r\n // can not do this in init, as axis is set later\r\n var axis = this.axis;\r\n if (axis) {\r\n if (!(axis.width instanceof Percent)) {\r\n axis.width = percent(100);\r\n }\r\n // @todo Is thi sneeded?\r\n $utils.used(this.line);\r\n var title = axis.title;\r\n title.rotation = 0;\r\n title.align = \"center\";\r\n if (this.opposite) {\r\n this.line.toFront();\r\n title.toBack();\r\n }\r\n else {\r\n title.toFront();\r\n this.toBack();\r\n this.line.toBack();\r\n }\r\n }\r\n };\r\n /**\r\n * Updates some of the Axis tooltip's visual properties, related to\r\n * rendering of the Axis.\r\n *\r\n * @todo Description (review)\r\n * @ignore Exclude from docs\r\n */\r\n AxisRendererX.prototype.updateTooltip = function () {\r\n var axis = this.axis;\r\n if (axis) {\r\n var bigNum = 1000;\r\n var bbx = this.line.pixelX;\r\n var bby = this.line.pixelY;\r\n var bbw = this.axisLength;\r\n var bbh = bigNum;\r\n // top\r\n if (this.opposite) {\r\n if (!this.inside) {\r\n bby = -bigNum;\r\n bbh = bigNum;\r\n }\r\n }\r\n // bottom\r\n else {\r\n if (this.inside) {\r\n bby = -bigNum;\r\n bbh = bigNum;\r\n }\r\n }\r\n this.axis.updateTooltip(\"vertical\", { x: bbx, y: bby, width: bbw, height: bbh });\r\n }\r\n };\r\n /**\r\n * Updates and positions a label element.\r\n *\r\n * @ignore Exclude from docs\r\n * @param label Label element\r\n * @param position Starting position\r\n * @param endPosition Ending position\r\n */\r\n AxisRendererX.prototype.updateLabelElement = function (label, position, endPosition, location) {\r\n if (!$type.hasValue(location)) {\r\n location = label.location;\r\n }\r\n position = position + (endPosition - position) * location;\r\n var point = this.positionToPoint(position);\r\n label.isMeasured = !label.inside;\r\n var deltaY = 0;\r\n var verticalCenter;\r\n var maxHeight = this.gridContainer.maxHeight;\r\n if (this.opposite) {\r\n if (label.inside) {\r\n verticalCenter = \"top\";\r\n if (label.valign == \"bottom\") {\r\n deltaY = maxHeight;\r\n verticalCenter = \"bottom\";\r\n }\r\n if (label.valign == \"middle\") {\r\n deltaY = maxHeight / 2;\r\n verticalCenter = \"middle\";\r\n }\r\n }\r\n else {\r\n verticalCenter = \"bottom\";\r\n }\r\n point.y = deltaY;\r\n }\r\n else {\r\n if (label.inside) {\r\n verticalCenter = \"bottom\";\r\n if (label.valign == \"top\") {\r\n deltaY = -maxHeight;\r\n verticalCenter = \"top\";\r\n }\r\n if (label.valign == \"middle\") {\r\n deltaY = -maxHeight / 2;\r\n verticalCenter = \"middle\";\r\n }\r\n }\r\n else {\r\n verticalCenter = \"top\";\r\n }\r\n point.y += deltaY;\r\n }\r\n if (label.rotation == 0) {\r\n // Apply fuzzy logic to verticalCenter only if labels are not rotated\r\n label.verticalCenter = verticalCenter;\r\n }\r\n this.positionItem(label, point);\r\n this.toggleVisibility(label, position, this.minLabelPosition, this.maxLabelPosition);\r\n };\r\n Object.defineProperty(AxisRendererX.prototype, \"axisLength\", {\r\n /**\r\n * Returns actual length of the Axis, in pixels.\r\n *\r\n * @return Length (px)\r\n */\r\n get: function () {\r\n var axis = this.axis;\r\n return (axis.measuredWidth - axis.pixelPaddingRight - axis.pixelPaddingLeft) || 0;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Converts relative position on axis to point coordinates.\r\n *\r\n * @param position Position (0-1)\r\n * @param position2 Position (0-1) Position on the second axis\r\n * @return Point\r\n */\r\n AxisRendererX.prototype.positionToPoint = function (position, position2) {\r\n return { x: this.positionToCoordinate(position), y: 0 };\r\n };\r\n /**\r\n * Converts a point at specific coordinates to a relative position (0-1)\r\n * on the axis.\r\n *\r\n * @param point Point\r\n * @return Position (0-1)\r\n */\r\n AxisRendererX.prototype.pointToPosition = function (point) {\r\n return this.coordinateToPosition(point.x, point.y);\r\n };\r\n /**\r\n * [getPositionRangePath description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param startPosition Starting position\r\n * @param endPosition End position\r\n * @return SVG path\r\n */\r\n AxisRendererX.prototype.getPositionRangePath = function (startPosition, endPosition) {\r\n var x1 = $math.fitToRange(this.positionToCoordinate(startPosition), 0, this.axisLength);\r\n var x2 = $math.fitToRange(this.positionToCoordinate(endPosition), 0, this.axisLength);\r\n var w = Math.abs(x2 - x1);\r\n var h = this.getHeight();\r\n var x = Math.min(x1, x2);\r\n var y = 0;\r\n return $path.rectToPath({\r\n x: x,\r\n y: y,\r\n width: w,\r\n height: h\r\n }, true);\r\n };\r\n /**\r\n * Updates and positions an axis break element.\r\n *\r\n * @ignore Exclude from docs\r\n * @param axisBreak Break element\r\n */\r\n AxisRendererX.prototype.updateBreakElement = function (axisBreak) {\r\n _super.prototype.updateBreakElement.call(this, axisBreak);\r\n var startLine = axisBreak.startLine;\r\n var endLine = axisBreak.endLine;\r\n var fillShape = axisBreak.fillShape;\r\n var startPoint = axisBreak.startPoint;\r\n var endPoint = axisBreak.endPoint;\r\n var y1 = axisBreak.pixelMarginLeft;\r\n var y2 = this.getHeight() - axisBreak.pixelMarginTop - axisBreak.pixelMarginBottom;\r\n startPoint.x = $math.fitToRange(startPoint.x, -1, this.axisLength + 1);\r\n endPoint.x = $math.fitToRange(endPoint.x, -1, this.axisLength + 1);\r\n if (startPoint.x == endPoint.x && (startPoint.x < 0 || startPoint.x > this.axisLength)) {\r\n axisBreak.fillShape.__disabled = true;\r\n }\r\n else {\r\n axisBreak.fillShape.__disabled = false;\r\n }\r\n startLine.y = y1;\r\n startLine.width = 0;\r\n startLine.height = y2;\r\n endLine.y = y1;\r\n endLine.width = 0;\r\n endLine.height = y2;\r\n fillShape.height = y2;\r\n fillShape.width = Math.abs(endPoint.x - startPoint.x);\r\n fillShape.y = y1;\r\n fillShape.x = startPoint.x;\r\n };\r\n /**\r\n * Updates and positions a grid element.\r\n *\r\n * @ignore Exclude from docs\r\n * @param grid Grid element\r\n * @param position Starting position\r\n * @param endPosition End position\r\n */\r\n AxisRendererX.prototype.updateGridElement = function (grid, position, endPosition) {\r\n position = position + (endPosition - position) * grid.location;\r\n var point = this.positionToPoint(position);\r\n //point.x = $utils.spritePointToSprite({x:point.x, y:0}, this, this.gridContainer).x;\r\n grid.path = $path.moveTo({ x: 0, y: 0 }) + $path.lineTo({ x: 0, y: this.getHeight() });\r\n this.positionItem(grid, point);\r\n this.toggleVisibility(grid, position, 0, 1);\r\n };\r\n /**\r\n * Updates and positions a tick element.\r\n *\r\n * @ignore Exclude from docs\r\n * @param tick Tick element\r\n * @param position Starting position\r\n * @param endPosition End position\r\n */\r\n AxisRendererX.prototype.updateTickElement = function (tick, position, endPosition) {\r\n position = position + (endPosition - position) * tick.location;\r\n var point = this.positionToPoint(position);\r\n var tickLength = tick.length;\r\n point.y = $utils.spritePointToSprite({ x: 0, y: this.line.pixelY }, this.line.parent, this.gridContainer).y;\r\n if (this.opposite) {\r\n tickLength *= (tick.inside ? 1 : -1);\r\n }\r\n else {\r\n tickLength *= (tick.inside ? -1 : 1);\r\n }\r\n tick.path = $path.moveTo({ x: 0, y: 0 }) + $path.lineTo({ x: 0, y: tickLength });\r\n this.positionItem(tick, point);\r\n this.toggleVisibility(tick, position, 0, 1);\r\n };\r\n /**\r\n * Updates and positions the axis line element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n AxisRendererX.prototype.updateAxisLine = function () {\r\n this.line.path = $path.moveTo({ x: 0, y: 0 }) + $path.lineTo({ x: this.axisLength, y: 0 });\r\n };\r\n /**\r\n * Updates and positions the base grid element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n AxisRendererX.prototype.updateBaseGridElement = function () {\r\n _super.prototype.updateBaseGridElement.call(this);\r\n var axis = this.axis;\r\n var h = this.getHeight();\r\n var w = this.axisLength;\r\n var baseGrid = this.baseGrid;\r\n var x = axis.basePoint.x;\r\n if (x < -0.2 || x > w + 0.2) {\r\n baseGrid.hide(0);\r\n }\r\n else {\r\n var y = $utils.spritePointToSprite({ x: 0, y: 0 }, this.gridContainer, baseGrid.parent).y;\r\n baseGrid.path = $path.moveTo({ x: 0, y: 0 }) + $path.lineTo({ x: 0, y: h });\r\n baseGrid.moveTo({ x: x, y: y });\r\n baseGrid.show(0);\r\n }\r\n };\r\n /**\r\n * Creates visual elements for and axis break.\r\n *\r\n * @ignore Exclude from docs\r\n * @param axisBreak Axis break\r\n */\r\n AxisRendererX.prototype.createBreakSprites = function (axisBreak) {\r\n axisBreak.startLine = new WavedLine();\r\n axisBreak.endLine = new WavedLine();\r\n var wavedRectangle = new WavedRectangle();\r\n wavedRectangle.setWavedSides(false, true, false, true);\r\n axisBreak.fillShape = wavedRectangle;\r\n };\r\n /**\r\n * @ignore\r\n */\r\n AxisRendererX.prototype.toAxisPosition = function (value) {\r\n var inversedPosition = value;\r\n var axis = this.axis;\r\n if (axis) {\r\n var relativePositionSprite = axis.relativePositionSprite;\r\n var x = axis.pixelX;\r\n if (relativePositionSprite) {\r\n x = $utils.spritePointToSprite({ x: this.pixelX, y: 0 }, this.parent, relativePositionSprite).x;\r\n }\r\n else {\r\n relativePositionSprite = axis.parent;\r\n }\r\n if (relativePositionSprite) {\r\n var relativeX = x / relativePositionSprite.innerWidth;\r\n var relativeWidth = axis.axisLength / relativePositionSprite.innerWidth;\r\n return (inversedPosition - relativeX) / relativeWidth;\r\n }\r\n }\r\n return value;\r\n };\r\n /**\r\n * Updates and positions axis bullets.\r\n *\r\n * @ignore Exclude from docs\r\n * @param bullet AxisBullet element\r\n * @param position Starting position\r\n * @param endPosition End position\r\n */\r\n AxisRendererX.prototype.updateBullet = function (bullet, position, endPosition) {\r\n var location = 0.5;\r\n if (bullet instanceof AxisBullet) {\r\n location = bullet.location;\r\n }\r\n position = position + (endPosition - position) * location;\r\n var point = this.positionToPoint(position);\r\n point.y = $utils.spritePointToSprite({ x: 0, y: this.line.pixelY }, this.line.parent, this.gridContainer).y;\r\n this.positionItem(bullet, point);\r\n this.toggleVisibility(bullet, position, 0, 1);\r\n };\r\n return AxisRendererX;\r\n}(AxisRenderer));\r\nexport { AxisRendererX };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"AxisRendererX\"] = AxisRendererX;\r\n/**\r\n * Add default responsive rules\r\n */\r\n/**\r\n * Put labels inside plot area.\r\n * Disable first and last labels.\r\n */\r\ndefaultRules.push({\r\n relevant: ResponsiveBreakpoints.heightXS,\r\n state: function (target, stateId) {\r\n if (target instanceof AxisRendererX) {\r\n var state = target.states.create(stateId);\r\n state.properties.inside = true;\r\n state.properties.maxLabelPosition = 0.9;\r\n state.properties.minLabelPosition = 0.1;\r\n return state;\r\n }\r\n return null;\r\n }\r\n});\r\n/**\r\n * Disable labels altogather on very small charts\r\n */\r\ndefaultRules.push({\r\n relevant: ResponsiveBreakpoints.heightXXS,\r\n state: function (target, stateId) {\r\n if (target instanceof AxisRendererX) {\r\n var state = target.states.create(stateId);\r\n state.properties.disabled = true;\r\n return state;\r\n }\r\n return null;\r\n }\r\n});\r\n","/**\r\n * Module, defining Axis Renderer for vertical axes.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { AxisRenderer } from \"./AxisRenderer\";\r\nimport { WavedLine } from \"../../core/elements/WavedLine\";\r\nimport { WavedRectangle } from \"../../core/elements/WavedRectangle\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport { percent, Percent } from \"../../core/utils/Percent\";\r\nimport * as $math from \"../../core/utils/Math\";\r\nimport * as $path from \"../../core/rendering/Path\";\r\nimport * as $utils from \"../../core/utils/Utils\";\r\nimport * as $type from \"../../core/utils/Type\";\r\nimport { defaultRules, ResponsiveBreakpoints } from \"../../core/utils/Responsive\";\r\nimport { AxisBullet } from \"./AxisBullet\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * A renderer for vertical axis.\r\n *\r\n * @see {@link IAxisRendererYEvents} for a list of available events\r\n * @see {@link IAxisRendererYAdapters} for a list of available Adapters\r\n */\r\nvar AxisRendererY = /** @class */ (function (_super) {\r\n __extends(AxisRendererY, _super);\r\n /**\r\n * Constructor.\r\n *\r\n * @param axis Related axis\r\n */\r\n function AxisRendererY() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"AxisRendererY\";\r\n _this.minGridDistance = 40;\r\n _this.opposite = false;\r\n _this.height = percent(100);\r\n _this.labels.template.verticalCenter = \"middle\";\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * @ignore\r\n */\r\n AxisRendererY.prototype.setAxis = function (axis) {\r\n _super.prototype.setAxis.call(this, axis);\r\n axis.layout = \"horizontal\";\r\n };\r\n /**\r\n * @ignore\r\n */\r\n AxisRendererY.prototype.updateGridContainer = function () {\r\n var axis = this.axis;\r\n if (axis) {\r\n var gridContainer = this.gridContainer;\r\n gridContainer.y = axis.pixelY;\r\n gridContainer.height = axis.axisLength;\r\n }\r\n };\r\n /**\r\n * @ignore\r\n */\r\n AxisRendererY.prototype.toAxisPosition = function (value) {\r\n var axis = this.axis;\r\n if (axis) {\r\n var inversedPosition = 1 - value;\r\n var relativePositionSprite = axis.relativePositionSprite;\r\n var y = axis.pixelY;\r\n if (relativePositionSprite) {\r\n y = $utils.spritePointToSprite({ x: 0, y: this.pixelY }, this.parent, relativePositionSprite).y;\r\n }\r\n else {\r\n relativePositionSprite = axis.parent;\r\n }\r\n if (relativePositionSprite) {\r\n var relativeY = y / relativePositionSprite.innerHeight;\r\n var relativeHeight = axis.axisLength / relativePositionSprite.innerHeight;\r\n return 1 - (inversedPosition - relativeY) / relativeHeight;\r\n }\r\n }\r\n return value;\r\n };\r\n /**\r\n * Called when rendered is attached to an Axis, as well as a property of\r\n * Axis that might affect the appearance is updated.\r\n *\r\n * E.g. `axis.opposite`, `axis.inside`, etc.\r\n *\r\n * This method is called **before** draw, so that any related setting\r\n * changed in this method can be changed.\r\n *\r\n * @todo Description (review)\r\n * @ignore Exclude from docs\r\n */\r\n AxisRendererY.prototype.processRenderer = function () {\r\n _super.prototype.processRenderer.call(this);\r\n var axis = this.axis;\r\n if (axis) {\r\n var title = axis.title;\r\n title.valign = \"middle\";\r\n if (!(axis.height instanceof Percent)) {\r\n axis.height = percent(100);\r\n }\r\n if (this.opposite) {\r\n title.rotation = 90;\r\n this.line.toBack();\r\n title.toFront();\r\n }\r\n else {\r\n title.rotation = -90;\r\n title.toBack();\r\n this.line.toFront();\r\n }\r\n }\r\n };\r\n /**\r\n * Updates some of the Axis tooltip's visual properties, related to\r\n * rendering of the Axis.\r\n *\r\n * @todo Description (review)\r\n * @ignore Exclude from docs\r\n */\r\n AxisRendererY.prototype.updateTooltip = function () {\r\n var axis = this.axis;\r\n if (axis) {\r\n var bigNum = 2000;\r\n var bbx = 0;\r\n var bby = 0;\r\n var bbw = bigNum;\r\n var bbh = this.axisLength;\r\n // right\r\n if (this.opposite) {\r\n if (this.inside) {\r\n bbx = -bigNum;\r\n bbw = bigNum;\r\n }\r\n }\r\n // left\r\n else {\r\n if (!this.inside) {\r\n bbx = -bigNum;\r\n bbw = bigNum;\r\n }\r\n }\r\n this.axis.updateTooltip(\"horizontal\", { x: bbx, y: bby, width: bbw, height: bbh });\r\n }\r\n };\r\n Object.defineProperty(AxisRendererY.prototype, \"axisLength\", {\r\n /**\r\n * Returns actual length of the Axis, in pixels.\r\n *\r\n * @return Length (px)\r\n */\r\n get: function () {\r\n var axis = this.axis;\r\n return (axis.measuredHeight - axis.pixelPaddingTop - axis.pixelPaddingBottom) || 0;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Converts relative position on axis to point coordinates.\r\n *\r\n * @param position Position (0-1)\r\n * @param position2 Position (0-1) Position on the second axis\r\n * @return Point\r\n */\r\n AxisRendererY.prototype.positionToPoint = function (position, position2) {\r\n return { x: 0, y: this.positionToCoordinate(position) };\r\n };\r\n /**\r\n * Converts a point at specific coordinates to a relative position (0-1)\r\n * on the axis.\r\n *\r\n * @param point Point\r\n * @return Position (0-1)\r\n */\r\n AxisRendererY.prototype.pointToPosition = function (point) {\r\n return this.coordinateToPosition(point.y, point.x);\r\n };\r\n /**\r\n * Converts a coordinate in pixels to a relative position. (0-1)\r\n *\r\n * @param coordinate Coordinate (px)\r\n * @param coordinate2 Coordinate of a second axis, only needed for complex axes systems, like timeline (px)\r\n * @return Position (0-1)\r\n */\r\n AxisRendererY.prototype.coordinateToPosition = function (coordinate, coordinate2) {\r\n var position;\r\n var axis = this.axis;\r\n var axisFullLength = axis.axisFullLength;\r\n if (axis.renderer.inversed) {\r\n position = (1 - axis.start) - coordinate / axisFullLength;\r\n }\r\n else {\r\n position = coordinate / axisFullLength + (1 - axis.end);\r\n }\r\n return $math.round(position, 5);\r\n };\r\n /**\r\n * [getPositionRangePath description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param startPosition Starting position\r\n * @param endPosition End position\r\n * @return SVG path\r\n */\r\n AxisRendererY.prototype.getPositionRangePath = function (startPosition, endPosition) {\r\n var y1 = $math.fitToRange(this.positionToCoordinate(startPosition), 0, this.axisLength);\r\n var y2 = $math.fitToRange(this.positionToCoordinate(endPosition), 0, this.axisLength);\r\n var h = Math.abs(y2 - y1);\r\n var w = this.getWidth();\r\n var y = Math.min(y1, y2);\r\n var x = 0;\r\n return $path.rectToPath({\r\n x: x,\r\n y: y,\r\n width: w,\r\n height: h\r\n }, true);\r\n };\r\n /**\r\n * Updates and positions a grid element.\r\n *\r\n * @ignore Exclude from docs\r\n * @param grid Grid element\r\n * @param position Starting position\r\n * @param endPosition End position\r\n */\r\n AxisRendererY.prototype.updateGridElement = function (grid, position, endPosition) {\r\n position = position + (endPosition - position) * grid.location;\r\n var point = this.positionToPoint(position);\r\n //\tpoint.y = $utils.spritePointToSprite({ x: 0, y: point.y }, this, this.gridContainer).y;\r\n grid.path = $path.moveTo({ x: 0, y: 0 }) + $path.lineTo({ x: this.getWidth(), y: 0 });\r\n this.positionItem(grid, point);\r\n this.toggleVisibility(grid, position, 0, 1);\r\n };\r\n /**\r\n * Updates and positions a tick element.\r\n *\r\n * @ignore Exclude from docs\r\n * @param tick Tick element\r\n * @param position Starting position\r\n * @param endPosition End position\r\n */\r\n AxisRendererY.prototype.updateTickElement = function (tick, position, endPosition) {\r\n position = position + (endPosition - position) * tick.location;\r\n var point = this.positionToPoint(position);\r\n var tickLength = tick.length;\r\n try {\r\n $utils.used(this.axis.title.measuredWidth);\r\n }\r\n catch (_a) {\r\n // void\r\n }\r\n point.x = $utils.spritePointToSprite({ x: this.line.pixelX, y: 0 }, this.line.parent, this.gridContainer).x;\r\n if (!this.opposite) {\r\n tickLength *= (tick.inside ? 1 : -1);\r\n }\r\n else {\r\n tickLength *= (tick.inside ? -1 : 1);\r\n }\r\n tick.path = $path.moveTo({ x: 0, y: 0 }) + $path.lineTo({ x: tickLength, y: 0 });\r\n this.positionItem(tick, point);\r\n this.toggleVisibility(tick, position, 0, 1);\r\n };\r\n /**\r\n * Updates and positions the axis line element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n AxisRendererY.prototype.updateAxisLine = function () {\r\n this.line.path = $path.moveTo({ x: 0, y: 0 }) + $path.lineTo({ x: 0, y: this.axisLength });\r\n };\r\n /**\r\n * Updates and positions the base grid element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n AxisRendererY.prototype.updateBaseGridElement = function () {\r\n _super.prototype.updateBaseGridElement.call(this);\r\n var axis = this.axis;\r\n var w = this.getWidth();\r\n var h = this.axisLength;\r\n var y = axis.basePoint.y;\r\n var baseGrid = this.baseGrid;\r\n if (y < -0.2 || y > h + 0.2) {\r\n baseGrid.hide(0);\r\n }\r\n else {\r\n var x = $utils.spritePointToSprite({ x: 0, y: 0 }, this.gridContainer, baseGrid.parent).x;\r\n baseGrid.path = $path.moveTo({ x: 0, y: 0 }) + $path.lineTo({ x: w, y: 0 });\r\n baseGrid.moveTo({ x: x, y: y });\r\n baseGrid.show(0);\r\n }\r\n };\r\n /**\r\n * Updates and positions a label element.\r\n *\r\n * @ignore Exclude from docs\r\n * @param label Label element\r\n * @param position Starting position\r\n * @param endPosition Ending position\r\n */\r\n AxisRendererY.prototype.updateLabelElement = function (label, position, endPosition, location) {\r\n if (!$type.hasValue(location)) {\r\n location = label.location;\r\n }\r\n position = position + (endPosition - position) * location;\r\n label.isMeasured = !label.inside;\r\n var point = this.positionToPoint(position);\r\n var horizontalCenter;\r\n var deltaX = 0;\r\n var maxWidth = this.gridContainer.maxWidth;\r\n if (this.opposite) {\r\n if (label.inside) {\r\n horizontalCenter = \"right\";\r\n if (label.align == \"left\") {\r\n deltaX = -maxWidth;\r\n horizontalCenter = \"left\";\r\n }\r\n if (label.align == \"center\") {\r\n deltaX = -maxWidth / 2;\r\n horizontalCenter = \"middle\";\r\n }\r\n }\r\n else {\r\n horizontalCenter = \"left\";\r\n }\r\n point.x = 0 + deltaX;\r\n }\r\n else {\r\n if (label.inside) {\r\n horizontalCenter = \"left\";\r\n if (label.align == \"right\") {\r\n deltaX = maxWidth;\r\n horizontalCenter = \"right\";\r\n }\r\n if (label.align == \"center\") {\r\n deltaX = maxWidth / 2;\r\n horizontalCenter = \"middle\";\r\n }\r\n }\r\n else {\r\n horizontalCenter = \"right\";\r\n }\r\n point.x = this.measuredWidth + deltaX;\r\n }\r\n if (label.rotation == 0) {\r\n // Apply fuzzy logic to verticalCenter only if labels are not rotated\r\n label.horizontalCenter = horizontalCenter;\r\n }\r\n this.positionItem(label, point);\r\n this.toggleVisibility(label, position, this.minLabelPosition, this.maxLabelPosition);\r\n };\r\n /**\r\n * Updates and positions an axis break element.\r\n *\r\n * @ignore Exclude from docs\r\n * @param axisBreak Break element\r\n */\r\n AxisRendererY.prototype.updateBreakElement = function (axisBreak) {\r\n _super.prototype.updateBreakElement.call(this, axisBreak);\r\n var startLine = axisBreak.startLine;\r\n var endLine = axisBreak.endLine;\r\n var fillShape = axisBreak.fillShape;\r\n var startPoint = axisBreak.startPoint;\r\n var endPoint = axisBreak.endPoint;\r\n var x1 = axisBreak.pixelMarginLeft;\r\n var x2 = this.getWidth() - axisBreak.pixelMarginLeft - axisBreak.pixelMarginRight;\r\n startPoint.y = $math.fitToRange(startPoint.y, -1, this.axisLength + 1);\r\n endPoint.y = $math.fitToRange(endPoint.y, -1, this.axisLength + 1);\r\n if (startPoint.y == endPoint.y && (startPoint.y < 0 || startPoint.y > this.axisLength)) {\r\n axisBreak.fillShape.__disabled = true;\r\n }\r\n else {\r\n axisBreak.fillShape.__disabled = false;\r\n }\r\n var w = Math.abs(x2 - x1);\r\n startLine.x = x1;\r\n startLine.height = 0;\r\n startLine.width = w;\r\n endLine.x = x1;\r\n endLine.height = 0;\r\n endLine.width = w;\r\n fillShape.width = w;\r\n fillShape.height = Math.abs(endPoint.y - startPoint.y);\r\n fillShape.x = x1;\r\n fillShape.y = endPoint.y;\r\n };\r\n /**\r\n * Creates visual elements for and axis break.\r\n *\r\n * @ignore Exclude from docs\r\n * @param axisBreak Axis break\r\n */\r\n AxisRendererY.prototype.createBreakSprites = function (axisBreak) {\r\n axisBreak.startLine = new WavedLine();\r\n axisBreak.endLine = new WavedLine();\r\n var wavedRectangle = new WavedRectangle();\r\n wavedRectangle.setWavedSides(true, false, true, false);\r\n axisBreak.fillShape = wavedRectangle;\r\n };\r\n /**\r\n * Converts a position on the axis to a coordinate in pixels.\r\n *\r\n * @ignore Exclude from docs\r\n * @param position Position (0-1)\r\n * @return Coordinate (px)\r\n */\r\n AxisRendererY.prototype.positionToCoordinate = function (position) {\r\n var coordinate;\r\n var axis = this.axis;\r\n var axisFullLength = axis.axisFullLength;\r\n if (!axis.renderer.inversed) {\r\n coordinate = (axis.end - position) * axisFullLength;\r\n }\r\n else {\r\n coordinate = (position - axis.start) * axisFullLength;\r\n }\r\n return coordinate;\r\n };\r\n /**\r\n * Updates and positions axis bullets.\r\n *\r\n * @ignore Exclude from docs\r\n * @param bullet AxisBullet element\r\n * @param position Starting position\r\n * @param endPosition End position\r\n */\r\n AxisRendererY.prototype.updateBullet = function (bullet, position, endPosition) {\r\n var location = 0.5;\r\n if (bullet instanceof AxisBullet) {\r\n location = bullet.location;\r\n }\r\n position = position + (endPosition - position) * location;\r\n var point = this.positionToPoint(position);\r\n point.x = $utils.spritePointToSprite({ x: this.line.pixelX, y: 0 }, this.line.parent, this.gridContainer).x;\r\n this.positionItem(bullet, point);\r\n this.toggleVisibility(bullet, position, 0, 1);\r\n };\r\n return AxisRendererY;\r\n}(AxisRenderer));\r\nexport { AxisRendererY };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"AxisRendererY\"] = AxisRendererY;\r\n/**\r\n * Add default responsive rules\r\n */\r\n/**\r\n * Put labels inside plot area.\r\n * Disable first and last labels.\r\n */\r\ndefaultRules.push({\r\n relevant: ResponsiveBreakpoints.widthS,\r\n state: function (target, stateId) {\r\n if (target instanceof AxisRendererY) {\r\n var state = target.states.create(stateId);\r\n state.properties.inside = true;\r\n state.properties.maxLabelPosition = 0.9;\r\n state.properties.minLabelPosition = 0.1;\r\n return state;\r\n }\r\n return null;\r\n }\r\n});\r\n/**\r\n * Disable labels altogather on very small charts\r\n */\r\ndefaultRules.push({\r\n relevant: ResponsiveBreakpoints.widthXS,\r\n state: function (target, stateId) {\r\n if (target instanceof AxisRendererY) {\r\n var state = target.states.create(stateId);\r\n state.properties.disabled = true;\r\n return state;\r\n }\r\n return null;\r\n }\r\n});\r\n","/**\r\n * Axis Tick module\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Tick } from \"../elements/Tick\";\r\nimport { registry } from \"../../core/Registry\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Draws an axis tick\r\n * @see {@link IAxisTickEvents} for a list of available events\r\n * @see {@link IAxisTickAdapters} for a list of available Adapters\r\n */\r\nvar AxisTick = /** @class */ (function (_super) {\r\n __extends(AxisTick, _super);\r\n function AxisTick() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"AxisTick\";\r\n _this.element = _this.paper.add(\"path\");\r\n _this.location = 0.5;\r\n _this.above = false;\r\n _this.isMeasured = false;\r\n _this.pixelPerfect = true;\r\n _this.strokeOpacity = 0;\r\n _this.length = 5;\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n Object.defineProperty(AxisTick.prototype, \"location\", {\r\n /**\r\n * @return Location (0-1)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"location\");\r\n },\r\n /**\r\n * Relative location of the tick. (0-1)\r\n *\r\n * @param value Location (0-1)\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"location\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(AxisTick.prototype, \"inside\", {\r\n /**\r\n * Returns if label is set to be drawn inside axis.\r\n *\r\n * @return Inside?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"inside\");\r\n },\r\n /**\r\n * Sets if tick should be drawn inside axis.\r\n *\r\n * @param value Inside?\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"inside\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(AxisTick.prototype, \"above\", {\r\n /**\r\n * @return Draw above series?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"above\");\r\n },\r\n /**\r\n * Normally tick goes below series. Set this to `true` to go above.\r\n *\r\n * @default false\r\n * @since 4.5.9\r\n * @param value Draw above series?\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"above\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * @ignore\r\n */\r\n AxisTick.prototype.setDisabled = function (value) {\r\n var changed = _super.prototype.setDisabled.call(this, value);\r\n if (this.axis) {\r\n this.axis.invalidateDataItems();\r\n }\r\n return changed;\r\n };\r\n return AxisTick;\r\n}(Tick));\r\nexport { AxisTick };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"AxisTick\"] = AxisTick;\r\n","/**\r\n * A module defining functionality for axis grid elements.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Sprite } from \"../../core/Sprite\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport { color } from \"../../core/utils/Color\";\r\nimport { InterfaceColorSet } from \"../../core/utils/InterfaceColorSet\";\r\nimport { defaultRules, ResponsiveBreakpoints } from \"../../core/utils/Responsive\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Displays an axis grid line.\r\n *\r\n * @see {@link IGridEvents} for a list of available events\r\n * @see {@link IGridAdapters} for a list of available Adapters\r\n * @todo Review: container is better, as we'll be able to attach something to the grid, also with 3d charts we might need some additional elements\r\n * @important\r\n */\r\nvar Grid = /** @class */ (function (_super) {\r\n __extends(Grid, _super);\r\n /**\r\n * Constructor\r\n */\r\n function Grid() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"Grid\";\r\n _this.element = _this.paper.add(\"path\");\r\n _this.location = 0.5;\r\n _this.isMeasured = false;\r\n _this.above = false;\r\n var interfaceColors = new InterfaceColorSet();\r\n _this.stroke = interfaceColors.getFor(\"grid\");\r\n _this.pixelPerfect = true;\r\n _this.strokeOpacity = 0.15;\r\n _this.fill = color(); // \"none\";\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n Object.defineProperty(Grid.prototype, \"location\", {\r\n /**\r\n * @return Location (0-1)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"location\");\r\n },\r\n /**\r\n * Location within axis cell to place grid line on.\r\n *\r\n * * 0 - start\r\n * * 0.5 - middle\r\n * * 1 - end\r\n *\r\n * @param value Location (0-1)\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"location\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Grid.prototype, \"above\", {\r\n /**\r\n * @return Draw above series?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"above\");\r\n },\r\n /**\r\n * Normally fill goes below series. Set this to `true` to go above.\r\n *\r\n * @default false\r\n * @since 4.5.9\r\n * @param value Draw above series?\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"above\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * @ignore\r\n */\r\n Grid.prototype.setDisabled = function (value) {\r\n var changed = _super.prototype.setDisabled.call(this, value);\r\n if (this.axis) {\r\n this.axis.invalidateDataItems();\r\n }\r\n return changed;\r\n };\r\n return Grid;\r\n}(Sprite));\r\nexport { Grid };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Grid\"] = Grid;\r\n/**\r\n * Add default responsive rules\r\n */\r\n/**\r\n * Disable grid on smaller charts\r\n */\r\ndefaultRules.push({\r\n relevant: ResponsiveBreakpoints.maybeXS,\r\n state: function (target, stateId) {\r\n if (target instanceof Grid) {\r\n var state = target.states.create(stateId);\r\n state.properties.disabled = true;\r\n return state;\r\n }\r\n return null;\r\n }\r\n});\r\n","/**\r\n * Value Axis module\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Axis, AxisDataItem } from \"./Axis\";\r\nimport { AxisRendererY } from \"./AxisRendererY\";\r\nimport { MultiDisposer } from \"../../core/utils/Disposer\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport { ValueAxisBreak } from \"./ValueAxisBreak\";\r\nimport * as $math from \"../../core/utils/Math\";\r\nimport * as $iter from \"../../core/utils/Iterator\";\r\nimport * as $object from \"../../core/utils/Object\";\r\nimport * as $type from \"../../core/utils/Type\";\r\nimport * as $utils from \"../../core/utils/Utils\";\r\n/**\r\n * ============================================================================\r\n * DATA ITEM\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Defines a [[DataItem]] for [[ValueAxis]].\r\n *\r\n * @see {@link DataItem}\r\n */\r\nvar ValueAxisDataItem = /** @class */ (function (_super) {\r\n __extends(ValueAxisDataItem, _super);\r\n /**\r\n * Constructor\r\n */\r\n function ValueAxisDataItem() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"ValueAxisDataItem\";\r\n _this.values.value = {};\r\n _this.values.endValue = {};\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n Object.defineProperty(ValueAxisDataItem.prototype, \"value\", {\r\n /**\r\n * @return Value\r\n */\r\n get: function () {\r\n return this.values[\"value\"].value;\r\n },\r\n /**\r\n * A data point's numeric value.\r\n *\r\n * @param value Value\r\n */\r\n set: function (value) {\r\n this.setValue(\"value\", value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ValueAxisDataItem.prototype, \"endValue\", {\r\n /**\r\n * @return Value\r\n */\r\n get: function () {\r\n return this.values[\"endValue\"].value;\r\n },\r\n /**\r\n * Data point's numeric end value.\r\n *\r\n * @param value End value\r\n */\r\n set: function (value) {\r\n this.setValue(\"endValue\", value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return ValueAxisDataItem;\r\n}(AxisDataItem));\r\nexport { ValueAxisDataItem };\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Used to create a value axis for the chart.\r\n *\r\n * ```TypeScript\r\n * // Create the axis\r\n * let valueAxis = chart.yAxes.push(new am4charts.ValueAxis());\r\n *\r\n * // Set settings\r\n * valueAxis.title.text = \"Monthly Sales\";\r\n * ```\r\n * ```JavaScript\r\n * // Create the axis\r\n * var valueAxis = chart.yAxes.push(new am4charts.ValueAxis());\r\n *\r\n * // Set settings\r\n * valueAxis.title.text = \"Monthly Sales\";\r\n * ```\r\n * ```JSON\r\n * \"yAxes\": [{\r\n * \"type\": \"ValueAxis\",\r\n * \"title\": {\r\n * \"text\": \"Monthly Sales\"\r\n * }\r\n * }]\r\n * ```\r\n *\r\n * @see {@link IValueAxisEvents} for a list of available Events\r\n * @see {@link IValueAxisAdapters} for a list of available Adapters\r\n * @important\r\n */\r\nvar ValueAxis = /** @class */ (function (_super) {\r\n __extends(ValueAxis, _super);\r\n /**\r\n * Constructor\r\n */\r\n function ValueAxis() {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n /**\r\n * [_stepDecimalPlaces description]\r\n *\r\n * @todo Description\r\n */\r\n _this._stepDecimalPlaces = 0;\r\n _this._prevStepDecimalPlaces = 0;\r\n _this._adjustLabelPrecision = true;\r\n /**\r\n * Base value for the axis.\r\n */\r\n _this._baseValue = 0;\r\n /**\r\n * Adjusted start in case we have breaks.\r\n *\r\n * @todo Description\r\n */\r\n _this._adjustedStart = 0;\r\n /**\r\n * Adjusted end in case we have breaks.\r\n *\r\n * @todo Description\r\n */\r\n _this._adjustedEnd = 1;\r\n _this._extremesChanged = false;\r\n _this._deltaMinMax = 1;\r\n _this._dsc = false;\r\n /**\r\n * As calculating totals is expensive operation and not often needed, we\r\n * don't do it by default.\r\n *\r\n * In case you use `totalPercent` or `total` in your charts, this must be set\r\n * to `true`.\r\n *\r\n * @default false\r\n * @see {@link https://www.amcharts.com/docs/v4/chart-types/xy-chart/#100_stacks} For using `calculateTotals` for 100% stacked series.\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/formatters/formatting-strings/#Placeholders_for_numeric_values} For using `calculateTotals` in labels.\r\n */\r\n _this.calculateTotals = false;\r\n _this.className = \"ValueAxis\";\r\n // Set field name\r\n _this.axisFieldName = \"value\";\r\n // Set defaults\r\n _this.setPropertyValue(\"maxZoomFactor\", 1000);\r\n _this.setPropertyValue(\"extraMin\", 0);\r\n _this.setPropertyValue(\"extraMax\", 0);\r\n _this.setPropertyValue(\"strictMinMax\", false);\r\n _this.setPropertyValue(\"maxPrecision\", Number.MAX_VALUE);\r\n _this.setPropertyValue(\"adjustLabelPrecision\", true);\r\n _this.setPropertyValue(\"extraTooltipPrecision\", 0);\r\n _this.keepSelection = false;\r\n _this.includeRangesInMinMax = false;\r\n // Apply theme\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Holds reference to a function that accepts a DataItem as parameter.\r\n *\r\n * It can either return a fill opacity for a fill, or manipulate data item\r\n * directly, to create various highlighting scenarios.\r\n */\r\n ValueAxis.prototype.fillRule = function (dataItem) {\r\n var value = dataItem.value;\r\n var axis = dataItem.component;\r\n if (!dataItem.axisFill.disabled) {\r\n // rounding in left to solve floating point number\r\n if ($math.round(value / axis.step / 2, 5) == Math.round(value / axis.step / 2)) {\r\n dataItem.axisFill.__disabled = true;\r\n }\r\n else {\r\n dataItem.axisFill.__disabled = false;\r\n }\r\n }\r\n };\r\n /**\r\n * Returns a new/empty [[DataItem]] of the type appropriate for this object.\r\n *\r\n * @see {@link DataItem}\r\n * @return Data Item\r\n */\r\n ValueAxis.prototype.createDataItem = function () {\r\n return new ValueAxisDataItem();\r\n };\r\n /**\r\n * Returns a new/empty [[AxisBreak]] of the appropriate type.\r\n *\r\n * @return Axis break\r\n */\r\n ValueAxis.prototype.createAxisBreak = function () {\r\n return new ValueAxisBreak();\r\n };\r\n /**\r\n * [dataChangeUpdate description]\r\n *\r\n * This is a placeholder to override for extending classes.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\n ValueAxis.prototype.dataChangeUpdate = function () {\r\n this.clearCache();\r\n if (!this.keepSelection) {\r\n if (this._start != 0 || this._end != 1) {\r\n this._start = 0;\r\n this._end = 1;\r\n this.dispatchImmediately(\"startendchanged\");\r\n }\r\n }\r\n else {\r\n if (this._start != 0) {\r\n this.dispatchImmediately(\"startchanged\");\r\n }\r\n if (this._end != 1) {\r\n this.dispatchImmediately(\"endchanged\");\r\n }\r\n if (this._start != 0 || this._end != 1) {\r\n this.dispatchImmediately(\"startendchanged\");\r\n }\r\n }\r\n this._maxZoomed = this._maxDefined;\r\n this._minZoomed = this._minDefined;\r\n this._maxAdjusted = this._maxDefined;\r\n this._minAdjusted = this._minDefined;\r\n };\r\n /**\r\n * Processes data items of the related Series.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n ValueAxis.prototype.processSeriesDataItems = function () {\r\n // @todo: add some boolean (maybe autodedect) if we need these calculations or not. this place uses a lot of cpu\r\n if (this.calculateTotals) {\r\n var series = this.series.getIndex(0);\r\n var startIndex = series.startIndex;\r\n if (series.dataItems.length > 0) {\r\n if (startIndex > 0) {\r\n startIndex--;\r\n }\r\n var endIndex = series.endIndex;\r\n if (endIndex < series.dataItems.length) {\r\n endIndex++;\r\n }\r\n var _loop_1 = function (i) {\r\n // This has to be `var` in order to avoid garbage collection\r\n var total = {};\r\n var sum = {};\r\n this_1.series.each(function (series) {\r\n if (!series.excludeFromTotal) {\r\n var dataItem_1 = series.dataItems.getIndex(i);\r\n if (dataItem_1) {\r\n $object.each(dataItem_1.values, function (key) {\r\n var value = dataItem_1.values[key].workingValue; // can not use getWorkingValue here!\r\n if ($type.isNumber(value)) {\r\n if (!$type.isNumber(total[key])) {\r\n total[key] = Math.abs(value);\r\n }\r\n else {\r\n total[key] += Math.abs(value);\r\n }\r\n if (!$type.isNumber(sum[key])) {\r\n sum[key] = value;\r\n }\r\n else {\r\n sum[key] += value;\r\n }\r\n }\r\n });\r\n }\r\n }\r\n });\r\n this_1.series.each(function (series) {\r\n if (!series.excludeFromTotal) {\r\n var dataItem_2 = series.dataItems.getIndex(i);\r\n if (dataItem_2) {\r\n $object.each(dataItem_2.values, function (key) {\r\n var value = dataItem_2.values[key].workingValue; // can not use getWorkingValue here!\r\n if ($type.isNumber(value)) {\r\n dataItem_2.setCalculatedValue(key, total[key], \"total\");\r\n dataItem_2.setCalculatedValue(key, 100 * value / total[key], \"totalPercent\");\r\n dataItem_2.setCalculatedValue(key, sum[key], \"sum\");\r\n }\r\n });\r\n }\r\n }\r\n });\r\n };\r\n var this_1 = this;\r\n // This has to be `var` in order to avoid garbage collection\r\n for (var i = startIndex; i < endIndex; ++i) {\r\n _loop_1(i);\r\n }\r\n }\r\n }\r\n };\r\n /**\r\n * Validates the whole axis. Causes it to redraw.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description (review)\r\n */\r\n ValueAxis.prototype.validate = function () {\r\n if (this.axisLength <= 0) {\r\n return;\r\n }\r\n _super.prototype.validate.call(this);\r\n this.getMinMax();\r\n this.fixAxisBreaks();\r\n this.calculateZoom();\r\n this.validateAxisElements();\r\n this.validateAxisRanges();\r\n this.validateBreaks();\r\n this.hideUnusedDataItems();\r\n this.renderer.invalidateLayout();\r\n // hide too close\r\n //this.hideTooCloseDataItems();\r\n };\r\n /**\r\n * Calculates all positions, related to axis as per current zoom.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n ValueAxis.prototype.calculateZoom = function () {\r\n if ($type.isNumber(this.min) && $type.isNumber(this.max)) {\r\n var min = this.positionToValue(this.start);\r\n var max = this.positionToValue(this.end);\r\n var differece = this.adjustDifference(min, max);\r\n var minMaxStep = this.adjustMinMax(min, max, differece, this._gridCount, true);\r\n var stepDecimalPlaces = $utils.decimalPlaces(minMaxStep.step);\r\n this._stepDecimalPlaces = stepDecimalPlaces;\r\n min = $math.round(min, stepDecimalPlaces);\r\n max = $math.round(max, stepDecimalPlaces);\r\n minMaxStep = this.adjustMinMax(min, max, differece, this._gridCount, true);\r\n var step = minMaxStep.step;\r\n if (this.syncWithAxis) {\r\n var calculated = this.getCache(min + \"-\" + max);\r\n if ($type.isNumber(calculated)) {\r\n step = calculated;\r\n }\r\n }\r\n else {\r\n min = minMaxStep.min;\r\n max = minMaxStep.max;\r\n }\r\n if (this._minZoomed != min || this._maxZoomed != max || this._step != step || this._dsc) {\r\n this._dsc = false;\r\n this._minZoomed = min;\r\n this._maxZoomed = max;\r\n this._step = step;\r\n this.dispatchImmediately(\"selectionextremeschanged\");\r\n }\r\n }\r\n };\r\n ValueAxis.prototype.fixSmallStep = function (step) {\r\n if (1 + step == 1) {\r\n step *= 2;\r\n return this.fixSmallStep(step);\r\n }\r\n return step;\r\n };\r\n /**\r\n * Validates Axis elements.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\n ValueAxis.prototype.validateAxisElements = function () {\r\n var _this = this;\r\n if ($type.isNumber(this.max) && $type.isNumber(this.min)) {\r\n // first regular items\r\n var value_1 = this.minZoomed - this._step * 2;\r\n if (!this.logarithmic) {\r\n value_1 = Math.floor(value_1 / this._step) * this._step;\r\n }\r\n else {\r\n var differencePower = Math.log(this.max) * Math.LOG10E - Math.log(this.min) * Math.LOG10E;\r\n if (differencePower > 1) {\r\n value_1 = Math.pow(10, Math.log(this.min) * Math.LOG10E);\r\n }\r\n else {\r\n value_1 = Math.floor(this.minZoomed / this._step) * this._step;\r\n if (value_1 == 0) {\r\n value_1 = this.minZoomed;\r\n }\r\n }\r\n }\r\n var maxZoomed = this._maxZoomed + this._step;\r\n this.resetIterators();\r\n var dataItemsIterator_1 = this._dataItemsIterator;\r\n if (this._step == 0) {\r\n return;\r\n }\r\n this._step = this.fixSmallStep(this._step);\r\n var i = 0;\r\n var precisionChanged = this._prevStepDecimalPlaces != this._stepDecimalPlaces;\r\n this._prevStepDecimalPlaces = this._stepDecimalPlaces;\r\n while (value_1 <= maxZoomed) {\r\n var axisBreak = this.isInBreak(value_1);\r\n if (!axisBreak) {\r\n var dataItem = dataItemsIterator_1.find(function (x) { return x.value === value_1; });\r\n if (dataItem.__disabled) {\r\n dataItem.__disabled = false;\r\n }\r\n //this.processDataItem(dataItem);\r\n this.appendDataItem(dataItem);\r\n dataItem.axisBreak = undefined;\r\n if (dataItem.value != value_1 || precisionChanged) {\r\n dataItem.value = value_1;\r\n dataItem.text = this.formatLabel(value_1);\r\n if (dataItem.label && dataItem.label.invalid) {\r\n dataItem.label.validate();\r\n }\r\n if (dataItem.value >= this.min && dataItem.value <= this.max) {\r\n if (dataItem.label) {\r\n if ((this.axisLetter == \"Y\" && dataItem.label.measuredWidth > this.ghostLabel.measuredWidth) || (this.axisLetter == \"X\" && dataItem.label.measuredHeight > this.ghostLabel.measuredHeight)) {\r\n this.ghostLabel.text = dataItem.label.currentText;\r\n this.ghostLabel.validate();\r\n }\r\n }\r\n }\r\n }\r\n this.validateDataElement(dataItem);\r\n }\r\n i++;\r\n var oldValue = value_1;\r\n if (!this.logarithmic) {\r\n value_1 += this._step;\r\n }\r\n else {\r\n var differencePower = Math.log(this.max) * Math.LOG10E - Math.log(this.min) * Math.LOG10E;\r\n if (differencePower > 1) {\r\n value_1 = Math.pow(10, Math.log(this.min) * Math.LOG10E + i);\r\n }\r\n else {\r\n value_1 += this._step;\r\n }\r\n }\r\n var stepPower = Math.pow(10, Math.floor(Math.log(Math.abs(this._step)) * Math.LOG10E));\r\n if (stepPower < 1) {\r\n // exponent is less then 1 too. Count decimals of exponent\r\n var decCount = Math.round(Math.abs(Math.log(Math.abs(stepPower)) * Math.LOG10E)) + 2;\r\n decCount = Math.min(13, decCount);\r\n // round value to avoid floating point issues\r\n value_1 = $math.ceil(value_1, decCount);\r\n if (oldValue == value_1) {\r\n value_1 = maxZoomed;\r\n break;\r\n }\r\n }\r\n }\r\n var axisBreaks = this._axisBreaks;\r\n if (axisBreaks) {\r\n // breaks later\r\n var renderer_1 = this.renderer;\r\n $iter.each(axisBreaks.iterator(), function (axisBreak) {\r\n if (axisBreak.breakSize > 0) {\r\n // only add grid if gap is bigger then minGridDistance\r\n if ($math.getDistance(axisBreak.startPoint, axisBreak.endPoint) > renderer_1.minGridDistance) {\r\n var breakValue_1 = axisBreak.adjustedMin;\r\n while (breakValue_1 <= axisBreak.adjustedMax) {\r\n if (breakValue_1 >= axisBreak.adjustedStartValue && breakValue_1 <= axisBreak.adjustedEndValue) {\r\n var dataItem = dataItemsIterator_1.find(function (x) { return x.value === breakValue_1; });\r\n if (dataItem.__disabled) {\r\n dataItem.__disabled = false;\r\n }\r\n //this.processDataItem(dataItem);\r\n _this.appendDataItem(dataItem);\r\n dataItem.axisBreak = axisBreak;\r\n if (dataItem.value != breakValue_1) {\r\n dataItem.value = breakValue_1;\r\n dataItem.text = _this.formatLabel(breakValue_1);\r\n if (dataItem.label && dataItem.label.invalid) {\r\n dataItem.label.validate();\r\n }\r\n }\r\n _this.validateDataElement(dataItem);\r\n }\r\n breakValue_1 += axisBreak.adjustedStep;\r\n }\r\n }\r\n }\r\n });\r\n }\r\n }\r\n };\r\n /**\r\n * Validates axis data item.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param dataItem Data item\r\n */\r\n ValueAxis.prototype.validateDataElement = function (dataItem) {\r\n _super.prototype.validateDataElement.call(this, dataItem);\r\n //dataItem.__disabled = false;\r\n dataItem.itemIndex = this._axisItemCount;\r\n this._axisItemCount++;\r\n var renderer = this.renderer;\r\n var value = dataItem.value;\r\n var endValue = dataItem.endValue;\r\n var position = this.valueToPosition(value);\r\n dataItem.position = position;\r\n var endPosition = position;\r\n var fillEndPosition = this.valueToPosition(value + this._step);\r\n if ($type.isNumber(endValue)) {\r\n endPosition = this.valueToPosition(endValue);\r\n fillEndPosition = endPosition;\r\n }\r\n // this point is needed to calculate distance to satisfy minGridDistance\r\n dataItem.point = renderer.positionToPoint(position);\r\n var tick = dataItem.tick;\r\n if (tick && !tick.disabled) {\r\n renderer.updateTickElement(tick, position, endPosition);\r\n }\r\n var grid = dataItem.grid;\r\n if (grid && !grid.disabled) {\r\n renderer.updateGridElement(grid, position, endPosition);\r\n }\r\n var label = dataItem.label;\r\n if (label && !label.disabled) {\r\n renderer.updateLabelElement(label, position, endPosition);\r\n }\r\n var fill = dataItem.axisFill;\r\n if (fill && !fill.disabled) {\r\n renderer.updateFillElement(fill, position, fillEndPosition);\r\n if (!dataItem.isRange) {\r\n this.fillRule(dataItem);\r\n }\r\n }\r\n if (dataItem.bullet) {\r\n renderer.updateBullet(dataItem.bullet, position, endPosition);\r\n }\r\n var mask = dataItem.mask;\r\n if (mask) {\r\n renderer.updateFillElement(mask, position, fillEndPosition);\r\n }\r\n };\r\n /**\r\n * Formats the value according to axis' own [[NumberFormatter]].\r\n *\r\n * @param value Source value\r\n * @return Formatted value\r\n */\r\n ValueAxis.prototype.formatLabel = function (value) {\r\n if (this.adjustLabelPrecision && value != 0) {\r\n return this.numberFormatter.format(value, undefined, this._stepDecimalPlaces);\r\n }\r\n else {\r\n return this.numberFormatter.format(value);\r\n }\r\n };\r\n Object.defineProperty(ValueAxis.prototype, \"basePoint\", {\r\n /**\r\n * Coordinates of the actual axis start.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Base point\r\n */\r\n get: function () {\r\n var baseValue = this.baseValue;\r\n var position = this.valueToPosition(baseValue);\r\n var basePoint = this.renderer.positionToPoint(position);\r\n return basePoint;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ValueAxis.prototype, \"baseValue\", {\r\n /**\r\n * @return base value\r\n */\r\n get: function () {\r\n var baseValue = this._baseValue;\r\n if (this.logarithmic) {\r\n baseValue = this.min;\r\n }\r\n if (!this._adapterO) {\r\n return baseValue;\r\n }\r\n else {\r\n return this._adapterO.apply(\"baseValue\", baseValue);\r\n }\r\n },\r\n /**\r\n * A base value.\r\n *\r\n * This is a threshold value that will divide \"positive\" and \"negative\"\r\n * value ranges.\r\n *\r\n * Other scale-related functionality also depend on base value. E.g. stacks,\r\n * value-dependent coloring, etc.\r\n *\r\n * @param value Base value\r\n */\r\n set: function (value) {\r\n this._baseValue = value;\r\n this.invalidateLayout();\r\n this.invalidateSeries();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Converts a numeric value to relative position on axis\r\n *\r\n * An alias to `valueToPosition()`.\r\n *\r\n * @param value Value\r\n * @return Position\r\n */\r\n ValueAxis.prototype.anyToPosition = function (value) {\r\n return this.valueToPosition(value);\r\n };\r\n /**\r\n * Converts a numeric value to orientation point (x, y, angle) on axis\r\n *\r\n * @param value Value\r\n * @return Orientation point\r\n */\r\n ValueAxis.prototype.valueToPoint = function (value) {\r\n var position = this.valueToPosition(value);\r\n var point = this.renderer.positionToPoint(position);\r\n var angle = this.renderer.positionToAngle(position);\r\n return { x: point.x, y: point.y, angle: angle };\r\n };\r\n /**\r\n * Converts a numeric value to orientation (x, y, angle) point on axis\r\n *\r\n * @param value Value\r\n * @return Orientation point\r\n */\r\n ValueAxis.prototype.anyToPoint = function (value) {\r\n return this.valueToPoint(value);\r\n };\r\n /**\r\n * Converts a numeric value to relative position on axis.\r\n *\r\n * @param value Value\r\n * @return relative position\r\n */\r\n ValueAxis.prototype.valueToPosition = function (value) {\r\n if ($type.isNumber(value)) {\r\n // todo: think if possible to take previous value and do not go through all previous breaks\r\n var min_1 = this.min;\r\n var max_1 = this.max;\r\n if ($type.isNumber(min_1) && $type.isNumber(max_1)) {\r\n var difference = this._difference;\r\n var axisBreaks = this._axisBreaks;\r\n if (axisBreaks && axisBreaks.length > 0) {\r\n $iter.eachContinue(axisBreaks.iterator(), function (axisBreak) {\r\n var startValue = axisBreak.adjustedStartValue;\r\n var endValue = axisBreak.adjustedEndValue;\r\n if ($type.isNumber(startValue) && $type.isNumber(endValue)) {\r\n if (value < startValue) {\r\n return false;\r\n }\r\n if ($math.intersect({ start: startValue, end: endValue }, { start: min_1, end: max_1 })) { // todo: check this once and set some flag in axisBreak\r\n startValue = Math.max(startValue, min_1);\r\n endValue = Math.min(endValue, max_1);\r\n var breakSize = axisBreak.breakSize;\r\n // value to the right of break end\r\n if (value > endValue) {\r\n min_1 += (endValue - startValue) * (1 - breakSize); // todo: maybe this can be done differently?\r\n }\r\n // value to the left of break start\r\n else if (value < startValue) {\r\n }\r\n // value within break\r\n else {\r\n value = startValue + (value - startValue) * breakSize;\r\n }\r\n }\r\n }\r\n return true;\r\n });\r\n }\r\n var position = void 0;\r\n if (!this.logarithmic) {\r\n position = (value - min_1) / difference;\r\n }\r\n else {\r\n var treatZeroAs = this.treatZeroAs;\r\n if ($type.isNumber(treatZeroAs)) {\r\n if (value <= treatZeroAs) {\r\n value = treatZeroAs;\r\n }\r\n }\r\n position = (Math.log(value) * Math.LOG10E - Math.log(this.min) * Math.LOG10E) / ((Math.log(this.max) * Math.LOG10E - Math.log(this.min) * Math.LOG10E));\r\n }\r\n //position = $math.round(position, 10);\r\n return position;\r\n }\r\n }\r\n return 0;\r\n };\r\n /**\r\n * When fontSize of fontFamily changes we need to hard-invalidate all Labels of this container to position them properly.\r\n */\r\n ValueAxis.prototype.invalidateLabels = function () {\r\n _super.prototype.invalidateLabels.call(this);\r\n if (this.dataItems) {\r\n this.dataItems.each(function (dataItem) {\r\n dataItem.value = undefined;\r\n });\r\n this.invalidate();\r\n }\r\n };\r\n /**\r\n * Converts an relative position to a corresponding value within\r\n * axis' scale.\r\n *\r\n * @param position Position (px)\r\n * @return Value\r\n */\r\n ValueAxis.prototype.positionToValue = function (position) {\r\n var min = this.min;\r\n var max = this.max;\r\n if ($type.isNumber(min) && $type.isNumber(max)) {\r\n var difference_1 = max - min; //no need to adjust!\r\n var value_2 = null;\r\n var axisBreaks = this._axisBreaks;\r\n if (axisBreaks) {\r\n // in case we have some axis breaks\r\n if (axisBreaks.length > 0) {\r\n $iter.eachContinue(axisBreaks.iterator(), function (axisBreak) {\r\n var breakStartPosition = axisBreak.startPosition;\r\n var breakEndPosition = axisBreak.endPosition;\r\n var breakStartValue = axisBreak.adjustedStartValue;\r\n var breakEndValue = axisBreak.adjustedEndValue;\r\n if ($type.isNumber(breakStartValue) && $type.isNumber(breakEndValue)) {\r\n if (breakStartValue > max) {\r\n return false;\r\n }\r\n if ($math.intersect({ start: breakStartValue, end: breakEndValue }, { start: min, end: max })) {\r\n breakStartValue = $math.max(breakStartValue, min);\r\n breakEndValue = $math.min(breakEndValue, max);\r\n var breakSize = axisBreak.breakSize;\r\n difference_1 -= (breakEndValue - breakStartValue) * (1 - breakSize);\r\n // position to the right of break end\r\n if (position > breakEndPosition) {\r\n min += (breakEndValue - breakStartValue) * (1 - breakSize);\r\n }\r\n // position to the left of break start\r\n else if (position < breakStartPosition) {\r\n }\r\n // value within break\r\n else {\r\n var breakPosition = (position - breakStartPosition) / (breakEndPosition - breakStartPosition);\r\n value_2 = breakStartValue + breakPosition * (breakEndValue - breakStartValue);\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n });\r\n }\r\n }\r\n if (!$type.isNumber(value_2)) {\r\n if (this.logarithmic) {\r\n value_2 = Math.pow(Math.E, (position * ((Math.log(this.max) * Math.LOG10E - Math.log(this.min) * Math.LOG10E)) + Math.log(this.min) * Math.LOG10E) / Math.LOG10E);\r\n }\r\n else {\r\n value_2 = position * difference_1 + min;\r\n }\r\n }\r\n return value_2;\r\n }\r\n //}\r\n };\r\n /**\r\n * Converts an X coordinate to a relative value in axis' scale.\r\n *\r\n * @param x X (px)\r\n * @return Value\r\n */\r\n ValueAxis.prototype.xToValue = function (x) {\r\n return this.positionToValue(this.pointToPosition({ x: x, y: 0 }));\r\n };\r\n /**\r\n * Converts an Y coordinate to a relative value in axis' scale.\r\n *\r\n * @param y Y (px)\r\n * @return Value\r\n */\r\n ValueAxis.prototype.yToValue = function (y) {\r\n return this.positionToValue(this.pointToPosition({ x: 0, y: y }));\r\n };\r\n /**\r\n * Converts pixel coordinates to a relative position. (0-1)\r\n *\r\n * @param point Coorinates (px)\r\n * @return Position (0-1)\r\n */\r\n ValueAxis.prototype.pointToPosition = function (point) {\r\n if (this.renderer instanceof AxisRendererY) {\r\n return 1 - this.renderer.pointToPosition(point);\r\n }\r\n else {\r\n return this.renderer.pointToPosition(point);\r\n }\r\n };\r\n /**\r\n * @ignore\r\n */\r\n ValueAxis.prototype.animateMinMax = function (min, max) {\r\n return this.animate([{ property: \"_minAdjusted\", from: this._minAdjusted, to: min }, { property: \"_maxAdjusted\", from: this._maxAdjusted, to: max }], this.rangeChangeDuration, this.rangeChangeEasing);\r\n };\r\n /**\r\n * Calculates smallest and biggest value for the axis scale.\r\n * @ignore\r\n * @todo Description (review)\r\n */\r\n ValueAxis.prototype.getMinMax = function () {\r\n var _this = this;\r\n this.updateGridCount();\r\n var min = Number.POSITIVE_INFINITY;\r\n var max = Number.NEGATIVE_INFINITY;\r\n // only if min and max are not set from outside, we go through min and max influencers\r\n if (!$type.isNumber(this._minDefined) || !$type.isNumber(this._maxDefined)) {\r\n this.series.each(function (series) {\r\n if (!series.ignoreMinMax) {\r\n // check min\r\n var seriesMin = series.min(_this);\r\n if ($type.isNumber(seriesMin) && (seriesMin < min)) {\r\n min = seriesMin;\r\n }\r\n // check max\r\n var seriesMax = series.max(_this);\r\n if ($type.isNumber(seriesMax) && (seriesMax > max)) {\r\n max = seriesMax;\r\n }\r\n }\r\n });\r\n if (this.includeRangesInMinMax) {\r\n this.axisRanges.each(function (range) {\r\n if (!range.ignoreMinMax) {\r\n var minValue = $math.min(range.value, range.endValue);\r\n var maxValue = $math.max(range.value, range.endValue);\r\n if (minValue < min || !$type.isNumber(min)) {\r\n min = minValue;\r\n }\r\n if (maxValue > max || !$type.isNumber(max)) {\r\n max = maxValue;\r\n }\r\n }\r\n });\r\n }\r\n }\r\n if (this.logarithmic) {\r\n var treatZeroAs = this.treatZeroAs;\r\n if ($type.isNumber(treatZeroAs)) {\r\n if (min <= 0) {\r\n min = treatZeroAs;\r\n }\r\n }\r\n if (min <= 0) {\r\n this.raiseCriticalError(new Error(\"Logarithmic value axis can not have values <= 0.\"), true);\r\n }\r\n }\r\n if (min == 0 && max == 0) {\r\n max = 0.9;\r\n min = -0.9;\r\n }\r\n // if defined from outside\r\n if ($type.isNumber(this._minDefined)) {\r\n min = this._minDefined;\r\n }\r\n if ($type.isNumber(this._maxDefined)) {\r\n max = this._maxDefined;\r\n }\r\n if (this._adapterO) {\r\n min = this._adapterO.apply(\"min\", min);\r\n }\r\n if (this._adapterO) {\r\n max = this._adapterO.apply(\"max\", max);\r\n }\r\n if (!$type.isNumber(min) || !$type.isNumber(max)) {\r\n return;\r\n }\r\n this._minReal = min;\r\n this._maxReal = max;\r\n if (min == Number.POSITIVE_INFINITY) {\r\n min = undefined;\r\n }\r\n if (max == Number.NEGATIVE_INFINITY) {\r\n max = undefined;\r\n }\r\n var dif = this.adjustDifference(min, max); // previously it was max-min, but not worked well\r\n min = this.fixMin(min);\r\n max = this.fixMax(max);\r\n // this happens if starLocation and endLocation are 0.5 and DateAxis has only one date\r\n if (max - min <= 1 / Math.pow(10, 15)) {\r\n if (max - min != 0) {\r\n this._deltaMinMax = (max - min) / 2;\r\n }\r\n else {\r\n // the number by which we need to raise 10 to get difference\r\n var exponent = Math.log(Math.abs(max)) * Math.LOG10E;\r\n // here we find a number which is power of 10 and has the same count of numbers as difference has\r\n var power = Math.pow(10, Math.floor(exponent));\r\n // reduce this number by 10 times\r\n power = power / 10;\r\n this._deltaMinMax = power;\r\n }\r\n min -= this._deltaMinMax;\r\n max += this._deltaMinMax;\r\n }\r\n min -= (max - min) * this.extraMin;\r\n max += (max - min) * this.extraMax;\r\n var strict = this.strictMinMax;\r\n if ($type.isNumber(this._maxDefined)) {\r\n strict = true;\r\n }\r\n var minMaxStep = this.adjustMinMax(min, max, dif, this._gridCount, strict);\r\n min = minMaxStep.min;\r\n max = minMaxStep.max;\r\n dif = max - min; //new\r\n // do it for the second time (importat!)\r\n minMaxStep = this.adjustMinMax(min, max, max - min, this._gridCount, true);\r\n min = minMaxStep.min;\r\n max = minMaxStep.max;\r\n // return min max if strict\r\n if (this.strictMinMax) {\r\n if ($type.isNumber(this._minDefined)) {\r\n min = this._minDefined;\r\n }\r\n else {\r\n min = this._minReal;\r\n }\r\n if ($type.isNumber(this._maxDefined)) {\r\n max = this._maxDefined;\r\n }\r\n else {\r\n max = this._maxReal;\r\n }\r\n if (max - min <= 0.00000001) {\r\n min -= this._deltaMinMax;\r\n max += this._deltaMinMax;\r\n }\r\n min -= (max - min) * this.extraMin;\r\n max += (max - min) * this.extraMax;\r\n }\r\n if (this._adapterO) {\r\n min = this._adapterO.apply(\"min\", min);\r\n }\r\n if (this._adapterO) {\r\n max = this._adapterO.apply(\"max\", max);\r\n }\r\n this._step = minMaxStep.step;\r\n if (!$type.isNumber(min) && !$type.isNumber(max)) {\r\n this.start = 0;\r\n this.end = 1;\r\n this.renderer.labels.each(function (label) {\r\n label.dataItem.text = \"\";\r\n });\r\n }\r\n // checking isNumber is good when all series are hidden\r\n if ((this._minAdjusted != min || this._maxAdjusted != max) && $type.isNumber(min) && $type.isNumber(max)) {\r\n var animation = this._minMaxAnimation;\r\n if (this._extremesChanged && $type.isNumber(this._minAdjusted) && $type.isNumber(this._maxAdjusted) && this.inited) {\r\n if ((animation && !animation.isFinished()) && this._finalMax == max && this._finalMin == min) {\r\n return;\r\n }\r\n else {\r\n this._finalMin = min;\r\n this._finalMax = max;\r\n animation = this.animateMinMax(min, max);\r\n if (animation && !animation.isFinished()) {\r\n animation.events.on(\"animationprogress\", this.validateDataItems, this);\r\n animation.events.on(\"animationended\", function () {\r\n //this.validateDataItems();\r\n _this.series.each(function (series) {\r\n series.validate();\r\n });\r\n _this.validateDataItems();\r\n _this.handleSelectionExtremesChange();\r\n });\r\n this._minMaxAnimation = animation;\r\n }\r\n else {\r\n this.series.each(function (series) {\r\n series.invalidate();\r\n });\r\n }\r\n this.validateDataItems();\r\n this.dispatchImmediately(\"extremeschanged\");\r\n this.handleSelectionExtremesChange();\r\n }\r\n }\r\n else {\r\n if ((animation && !animation.isFinished()) && this._finalMax == max && this._finalMin == min) {\r\n return;\r\n }\r\n else {\r\n this._minAdjusted = min;\r\n this._maxAdjusted = max;\r\n this._finalMin = min;\r\n this._finalMax = max;\r\n this.invalidateDataItems();\r\n this.dispatchImmediately(\"extremeschanged\");\r\n }\r\n }\r\n }\r\n this._extremesChanged = false;\r\n this._difference = this.adjustDifference(min, max);\r\n };\r\n /**\r\n * Adjusts the minimum value.\r\n *\r\n * This is a placeholder method for extending classes to override.\r\n *\r\n * For numeric values this does nothing, however for more complex types, like\r\n * dates, it may be necessary to adjust.\r\n *\r\n * @param value Value\r\n * @return Adjusted value\r\n */\r\n ValueAxis.prototype.fixMin = function (value) {\r\n return value;\r\n };\r\n /**\r\n * Adjusts the maximum value.\r\n *\r\n * This is a placeholder method for extending classes to override.\r\n *\r\n * For numeric values this does nothing, however for more complex types, like\r\n * dates, it may be necessary to adjust.\r\n *\r\n * @param value Value\r\n * @return Adjusted value\r\n */\r\n ValueAxis.prototype.fixMax = function (value) {\r\n return value;\r\n };\r\n /**\r\n * Adjusts actual min and max scale values so that the axis starts and ends\r\n * at \"nice\" values, unless `strictMinMax` is set.\r\n *\r\n * The `difference` can be something else than `max - min`, because of the\r\n * axis breaks.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param min [description]\r\n * @param max [description]\r\n * @param difference [description]\r\n * @param gridCount [description]\r\n * @param strictMode [description]\r\n * @return [description]\r\n */\r\n ValueAxis.prototype.adjustMinMax = function (min, max, difference, gridCount, strictMode) {\r\n // will fail if 0\r\n if (gridCount <= 1) {\r\n gridCount = 1;\r\n }\r\n gridCount = Math.round(gridCount);\r\n var initialMin = min;\r\n var initialMax = max;\r\n // in case min and max is the same, use max\r\n if (difference === 0) {\r\n difference = Math.abs(max);\r\n }\r\n // the number by which we need to raise 10 to get difference\r\n var exponent = Math.log(Math.abs(difference)) * Math.LOG10E;\r\n // here we find a number which is power of 10 and has the same count of numbers as difference has\r\n var power = Math.pow(10, Math.floor(exponent));\r\n // reduce this number by 10 times\r\n power = power / 10;\r\n var extra = power;\r\n if (strictMode) {\r\n extra = 0;\r\n }\r\n if (!this.logarithmic) {\r\n // round down min\r\n if (strictMode) {\r\n min = Math.floor(min / power) * power;\r\n // round up max\r\n max = Math.ceil(max / power) * power;\r\n }\r\n else {\r\n min = Math.ceil(min / power) * power - extra;\r\n // round up max\r\n max = Math.floor(max / power) * power + extra;\r\n }\r\n // don't let min go below 0 if real min is >= 0\r\n if (min < 0 && initialMin >= 0) {\r\n min = 0;\r\n }\r\n // don't let max go above 0 if real max is <= 0\r\n if (max > 0 && initialMax <= 0) {\r\n max = 0;\r\n }\r\n }\r\n else {\r\n if (min <= 0) {\r\n //throw Error(\"Logarithmic value axis can not have values <= 0.\");\r\n min = this.baseValue;\r\n }\r\n // @todo: think of a better way or to restrict zooming when no series are selected\r\n if (min == Infinity) {\r\n min = 1;\r\n }\r\n if (max == -Infinity) {\r\n max = 10;\r\n }\r\n if (this.strictMinMax) {\r\n if (this._minDefined > 0) {\r\n min = this._minDefined;\r\n }\r\n else {\r\n min = min;\r\n }\r\n if (this._maxDefined > 0) {\r\n max = max;\r\n }\r\n }\r\n else {\r\n min = Math.pow(10, Math.floor(Math.log(Math.abs(min)) * Math.LOG10E));\r\n max = Math.pow(10, Math.ceil(Math.log(Math.abs(max)) * Math.LOG10E));\r\n }\r\n }\r\n // repeat diff, exponent and power again with rounded values\r\n //difference = this.adjustDifference(min, max);\r\n /*\r\n\r\n if(min > initialMin){\r\n min = initialMin;\r\n }\r\n\r\n if(max < initialMax){\r\n max = initialMax;\r\n }\r\n */\r\n exponent = Math.log(Math.abs(difference)) * Math.LOG10E;\r\n power = Math.pow(10, Math.floor(exponent));\r\n power = power / 10;\r\n // approximate difference between two grid lines\r\n var step = Math.ceil((difference / gridCount) / power) * power;\r\n var stepPower = Math.pow(10, Math.floor(Math.log(Math.abs(step)) * Math.LOG10E));\r\n // TODO: in v3 I had fixStepE here, ommiting it for a while, need to think about other solution\r\n // the step should divide by 2, 5, and 10.\r\n var stepDivisor = Math.ceil(step / stepPower); // number 0 - 10\r\n if (stepDivisor > 5) {\r\n stepDivisor = 10;\r\n }\r\n else if (stepDivisor <= 5 && stepDivisor > 2) {\r\n stepDivisor = 5;\r\n }\r\n // now get real step\r\n step = Math.ceil(step / (stepPower * stepDivisor)) * stepPower * stepDivisor;\r\n if (this.maxPrecision < Number.MAX_VALUE && step != $math.ceil(step, this.maxPrecision)) {\r\n step = $math.ceil(step, this.maxPrecision);\r\n }\r\n var decCount = 0;\r\n // in case numbers are smaller than 1\r\n if (stepPower < 1) {\r\n // exponent is less then 1 too. Count decimals of exponent\r\n decCount = Math.round(Math.abs(Math.log(Math.abs(stepPower)) * Math.LOG10E)) + 1;\r\n // round step\r\n step = $math.round(step, decCount);\r\n }\r\n if (!this.logarithmic) {\r\n // final min and max\r\n var minCount = Math.floor(min / step);\r\n min = $math.round(step * minCount, decCount);\r\n var maxCount = void 0;\r\n if (!strictMode) {\r\n maxCount = Math.ceil(max / step);\r\n }\r\n else {\r\n maxCount = Math.floor(max / step);\r\n }\r\n if (maxCount == minCount) {\r\n maxCount++;\r\n }\r\n max = $math.round(step * maxCount, decCount);\r\n if (max < initialMax) {\r\n max = max + step;\r\n }\r\n if (min > initialMin) {\r\n min = min - step;\r\n }\r\n }\r\n return { min: min, max: max, step: step };\r\n };\r\n Object.defineProperty(ValueAxis.prototype, \"min\", {\r\n /**\r\n * @return Min value\r\n */\r\n get: function () {\r\n var min = this._minAdjusted;\r\n if (!$type.isNumber(min)) {\r\n min = this._minDefined;\r\n }\r\n return min;\r\n },\r\n /**\r\n * A minimum value for the axis scale.\r\n *\r\n * This value might be auto-adjusted by the Axis in order to accomodate the\r\n * grid nicely, i.e. plot area is divided by grid in nice equal cells.\r\n *\r\n * The above might be overridden by `strictMinMax` which will force exact\r\n * user-defined min and max values to be used for scale.\r\n *\r\n * @param value Min value\r\n */\r\n set: function (value) {\r\n if (this._minDefined != value) {\r\n this._minDefined = value;\r\n this.invalidate();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ValueAxis.prototype, \"minDefined\", {\r\n /**\r\n * Min value as defined by user's code, not auto-calculated.\r\n *\r\n * @readonly\r\n * @return Min value\r\n */\r\n get: function () {\r\n return this._minDefined;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ValueAxis.prototype, \"maxDefined\", {\r\n /**\r\n * Max value as defined by user's code, not auto-calculated.\r\n *\r\n * @readonly\r\n * @return Man value\r\n */\r\n get: function () {\r\n return this._maxDefined;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ValueAxis.prototype, \"extraMin\", {\r\n /**\r\n * @return {number}\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"extraMin\");\r\n },\r\n /**\r\n * Allows relatively adjusting minimum value of the axis' scale.\r\n *\r\n * The value is relative to the actual range of values currently displayed\r\n * on the axis.\r\n *\r\n * E.g.: 0.5 will mean half of the current range. If we have axis displaying\r\n * from 100 to 200, we will now have axis displaying from 50 to 200 because\r\n * we asked to expand minimum value by 50% (0.5).\r\n *\r\n * @param {number}\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"extraMin\", value)) {\r\n this.invalidateDataItems();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ValueAxis.prototype, \"extraMax\", {\r\n /**\r\n * @return Min multiplier\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"extraMax\");\r\n },\r\n /**\r\n * Allows relatively adjusting maximum value of the axis' scale.\r\n *\r\n * The value is relative to the actual range of values currently displayed\r\n * on the axis.\r\n *\r\n * E.g.: 0.5 will mean half of the current range. If we have axis displaying\r\n * from 100 to 200, we will now have axis displaying from 100 to 250 because\r\n * we asked to expand maximum value by 50% (0.5).\r\n *\r\n * @param {number}\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"extraMax\", value)) {\r\n this.invalidateDataItems();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ValueAxis.prototype, \"step\", {\r\n /**\r\n * Current calculated delta in values between two adjacent grid lines (step).\r\n *\r\n * This is a read-only value and cannot be used to set actual step.\r\n *\r\n * @readonly\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/axes/positioning-axis-elements/#Setting_the_density_of_the_the_grid_labels} For more information about modifying density of labels\r\n * @return [description]\r\n */\r\n get: function () {\r\n return this._step;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ValueAxis.prototype, \"max\", {\r\n /**\r\n * @return Max value\r\n */\r\n get: function () {\r\n var max = this._maxAdjusted;\r\n if (!$type.isNumber(max)) {\r\n max = this._maxDefined;\r\n }\r\n return max;\r\n },\r\n /**\r\n * A maximum value for the axis scale.\r\n *\r\n * This value might be auto-adjusted by the Axis in order to accomodate the\r\n * grid nicely, i.e. plot area is divided by grid in nice equal cells.\r\n *\r\n * The above might be overridden by `strictMinMax` which will force exact\r\n * user-defined min and max values to be used for scale.\r\n *\r\n * @param value Max value\r\n */\r\n set: function (value) {\r\n if (this._maxDefined != value) {\r\n this._maxDefined = value;\r\n this.invalidate();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ValueAxis.prototype, \"adjustLabelPrecision\", {\r\n /**\r\n * @return Adjust precision\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"adjustLabelPrecision\");\r\n },\r\n /**\r\n * By default the axis will adjust precision of all numbers to match number\r\n * of decimals in all its labels, e.g.: `1.0`, `1.5`, `2.0`.\r\n *\r\n * To disable set `adjustLabelPrecision` to `false`, to use whatever other\r\n * precision or number format settings are set.\r\n *\r\n * IMPORTANT: This setting will be ignored if your number format uses\r\n * modifiers, e.g. `\"#a\"`.\r\n *\r\n * @default true\r\n * @since 4.9.14\r\n * @param value Adjust precision\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"adjustLabelPrecision\", value)) {\r\n this.invalidate();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Used for the Series to register itself as the user of this Axis.\r\n *\r\n * This will also decorate both the Series and Axis with event handlers, used\r\n * to redraw on Axis position/zoom change.\r\n *\r\n * A disposer for those events is returned, so that they can be disposed\r\n * together with Series.\r\n *\r\n * @ignore Exclude from docs\r\n * @param series Series\r\n * @return Disposer for events\r\n */\r\n ValueAxis.prototype.registerSeries = function (series) {\r\n return new MultiDisposer([\r\n _super.prototype.registerSeries.call(this, series),\r\n series.events.on(\"extremeschanged\", this.handleExtremesChange, this, false),\r\n series.events.on(\"selectionextremeschanged\", this.handleSelectionExtremesChange, this, false),\r\n this.events.on(\"extremeschanged\", series.invalidate, series, false)\r\n ]);\r\n };\r\n /**\r\n * Perform tasks after Axis zoom.\r\n */\r\n ValueAxis.prototype.handleSelectionExtremesChange = function () {\r\n var _this = this;\r\n var selectionMin;\r\n var selectionMax;\r\n var allHidden = true;\r\n $iter.each(this.series.iterator(), function (series) {\r\n if (!series.ignoreMinMax && !series.isHidden && !series.outOfRange) {\r\n if (series.visible && !series.isHiding) {\r\n allHidden = false;\r\n }\r\n var seriesSelectionMin = series.selectionMin(_this);\r\n var seriesSelectionMax = series.selectionMax(_this);\r\n if ($type.isNumber(seriesSelectionMin)) {\r\n if (!$type.isNumber(selectionMin) || (seriesSelectionMin < selectionMin)) {\r\n selectionMin = seriesSelectionMin;\r\n }\r\n }\r\n // check max\r\n if ($type.isNumber(seriesSelectionMax)) {\r\n if (!$type.isNumber(selectionMax) || (seriesSelectionMax > selectionMax)) {\r\n selectionMax = seriesSelectionMax;\r\n }\r\n }\r\n }\r\n });\r\n if (this.includeRangesInMinMax) {\r\n this.axisRanges.each(function (range) {\r\n if (!range.ignoreMinMax) {\r\n var minValue = $math.min(range.value, range.endValue);\r\n var maxValue = $math.max(range.value, range.endValue);\r\n if (minValue < selectionMin) {\r\n selectionMin = minValue;\r\n }\r\n if (maxValue > selectionMax) {\r\n selectionMax = maxValue;\r\n }\r\n }\r\n });\r\n }\r\n // this is not good, as if date axis is initially zoomed, selection of y axis is reset to 0, 1 at the end of this method\r\n //$iter.each(this.series.iterator(), (series) => {\r\n //\tif (!series.appeared) {\r\n //\t\tallHidden = true;\r\n //\t}\r\n //})\r\n if ($type.isNumber(this._minDefined)) {\r\n if (this.strictMinMax) {\r\n selectionMin = this._minDefined;\r\n }\r\n else {\r\n selectionMin = this.min;\r\n }\r\n }\r\n else if (this.strictMinMax) {\r\n selectionMin = this._minReal;\r\n }\r\n if ($type.isNumber(this._maxDefined)) {\r\n if (this.strictMinMax) {\r\n selectionMax = this._maxDefined;\r\n }\r\n else {\r\n selectionMax = this.max;\r\n }\r\n }\r\n else if (this.strictMinMax) {\r\n selectionMax = this._maxReal;\r\n }\r\n if (selectionMin == selectionMax) {\r\n selectionMin -= this._deltaMinMax;\r\n selectionMax += this._deltaMinMax;\r\n var minMaxStep2 = this.adjustMinMax(selectionMin, selectionMax, 0, this._gridCount, this.strictMinMax);\r\n selectionMin = minMaxStep2.min;\r\n selectionMax = minMaxStep2.max;\r\n }\r\n var dif = this.adjustDifference(selectionMin, selectionMax);\r\n var minMaxStep = this.adjustMinMax(selectionMin, selectionMax, dif, this._gridCount);\r\n selectionMin = minMaxStep.min;\r\n selectionMax = minMaxStep.max;\r\n selectionMin -= (selectionMax - selectionMin) * this.extraMin;\r\n selectionMax += (selectionMax - selectionMin) * this.extraMax;\r\n selectionMin = $math.fitToRange(selectionMin, this.min, this.max);\r\n selectionMax = $math.fitToRange(selectionMax, this.min, this.max);\r\n // do it for the second time !important\r\n dif = this.adjustDifference(selectionMin, selectionMax);\r\n minMaxStep = this.adjustMinMax(selectionMin, selectionMax, dif, this._gridCount, true);\r\n selectionMin = minMaxStep.min;\r\n selectionMax = minMaxStep.max;\r\n if (this.strictMinMax) {\r\n selectionMin = $math.max(selectionMin, this._minDefined);\r\n selectionMax = $math.min(selectionMax, this._maxDefined);\r\n }\r\n var step = minMaxStep.step;\r\n if (this.syncWithAxis) {\r\n minMaxStep = this.syncAxes(selectionMin, selectionMax, step);\r\n selectionMin = minMaxStep.min;\r\n selectionMax = minMaxStep.max;\r\n this.invalidate();\r\n }\r\n step = minMaxStep.step;\r\n // needed because of grouping\r\n this._difference = this.adjustDifference(this.min, this.max);\r\n var start = this.valueToPosition(selectionMin);\r\n var end = this.valueToPosition(selectionMax);\r\n // in case all series are hidden or hiding, full zoomout\r\n if (allHidden && !this.syncWithAxis) {\r\n start = 0;\r\n end = 1;\r\n }\r\n var declination = 0;\r\n if (this.syncWithAxis) {\r\n declination = 5;\r\n this.setCache(selectionMin + \"-\" + selectionMax, step);\r\n }\r\n else {\r\n if (this._step != step || this._minZoomed != selectionMin || this._maxZoomed != selectionMax) {\r\n this._dsc = true;\r\n }\r\n this._step = step;\r\n this._minZoomed = selectionMin;\r\n this._maxZoomed = selectionMax;\r\n }\r\n if (!this.keepSelection) {\r\n this.zoom({ start: start, end: end }, false, false, declination);\r\n }\r\n };\r\n Object.defineProperty(ValueAxis.prototype, \"strictMinMax\", {\r\n /**\r\n * @return Use exact values?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"strictMinMax\");\r\n },\r\n /**\r\n * Indicates whether to blindly use exact `min` and `max` values set by user\r\n * when generating Axis scale.\r\n *\r\n * If not set, the Axis might slightly adjust those values to accomodate a\r\n * better looking grid.\r\n *\r\n * NOTE: if `min` and `max` are not set, setting `strictMinMax` to `true`\r\n * will result in fixing the scale of the axis to actual lowest and highest\r\n * values in the series within currently selected scope.\r\n *\r\n * @default false\r\n * @param value Use exact values?\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"strictMinMax\", value)) {\r\n this.invalidate();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ValueAxis.prototype, \"logarithmic\", {\r\n /**\r\n * @return Logarithmic scale?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"logarithmic\");\r\n },\r\n /**\r\n * Indicates if this axis should use a logarithmic scale.\r\n *\r\n * Please note that logarithmic axis can **only** accommodate values bigger\r\n * than zero.\r\n *\r\n * Having zero or negative values will result in error and failure of the\r\n * whole chart.\r\n *\r\n * @param value Logarithmic scale?\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"logarithmic\", value)) {\r\n this.invalidate();\r\n this.series.each(function (series) {\r\n series.invalidateDataItems();\r\n });\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ValueAxis.prototype, \"keepSelection\", {\r\n /**\r\n * @return Preseve zoom after data update?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"keepSelection\");\r\n },\r\n /**\r\n * Indicates if a current selection (zoom) should be kept across data updates.\r\n *\r\n * If your axis is zoomed while chart's data is updated, the axis will try\r\n * to retain the same start and end values.\r\n *\r\n * You can also use this to initially pre-zoom axis:\r\n *\r\n * ```TypeScript\r\n * axis.keepSelection = true;\r\n * axis.start = 0.5;\r\n * axis.end = 0.7;\r\n * ```\r\n * ```JavaScript\r\n * axis.keepSelection = true;\r\n * axis.start = 0.5;\r\n * axis.end = 0.7;\r\n * ```\r\n * ```JSON\r\n * {\r\n * \"xAxes\": [{\r\n * // ...\r\n * \"keepSelection\": true,\r\n * \"start\": 0.5,\r\n * \"end\": 0.7\r\n * }]\r\n * }\r\n * ```\r\n *\r\n * The above will start the chart zoomed from the middle of the actual scope\r\n * to 70%.\r\n *\r\n * @since 4.1.1\r\n * @default false\r\n * @param value Preseve zoom after data update?\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"keepSelection\", value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ValueAxis.prototype, \"includeRangesInMinMax\", {\r\n /**\r\n * @return Include ranges?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"includeRangesInMinMax\");\r\n },\r\n /**\r\n * If set to `true`, values of axis ranges will be included when calculating\r\n * range of values / scale of the [[ValueAxis]].\r\n *\r\n * @default false\r\n * @since 4.4.9\r\n * @param value Include ranges?\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"includeRangesInMinMax\", value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ValueAxis.prototype, \"maxPrecision\", {\r\n /**\r\n * @return max precision\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"maxPrecision\");\r\n },\r\n /**\r\n * Maximum number of decimals to allow when placing grid lines and labels\r\n * on axis.\r\n *\r\n * Set it to `0` (zero) to force integer-only axis labels.\r\n *\r\n * @param {number}\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"maxPrecision\", value)) {\r\n this.invalidate();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ValueAxis.prototype, \"extraTooltipPrecision\", {\r\n /**\r\n * @return Extra decimals\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"extraTooltipPrecision\");\r\n },\r\n /**\r\n * This setting allows using bigger precision for numbers displayed in axis\r\n * tooltip.\r\n *\r\n * Please note that this setting indicates additional decimal places to\r\n * automatically-calculated axis number precision.\r\n *\r\n * So if your axis displays numbers like 0.1, 0.2, etc. (one decimal place),\r\n * and you set `extraTooltipPrecision = 1`, tooltips will display numbers\r\n * like 0.12, 0.25, etc. (two decimal places).\r\n *\r\n * @default 0\r\n * @since 4.8.3\r\n * @param value Extra decimals\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"extraTooltipPrecision\", value)) {\r\n this.invalidate();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Invalidates axis data items when series extremes change\r\n */\r\n ValueAxis.prototype.handleExtremesChange = function () {\r\n var _this = this;\r\n this._extremesChanged = true;\r\n this.getMinMax();\r\n if (this.ghostLabel) {\r\n var mw_1 = 0;\r\n this.dataItems.each(function (dataItem) {\r\n if (dataItem.label && dataItem.label.pixelWidth > mw_1) {\r\n _this.ghostLabel.text = dataItem.label.currentText;\r\n }\r\n });\r\n }\r\n };\r\n /**\r\n * Returns relative position on axis for series' data item's value.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description (review)\r\n * @param dataItem Data item\r\n * @param key Data field to get value from\r\n * @param location Location (0-1)\r\n * @param stackKey ?\r\n * @return X coordinate (px)\r\n */\r\n ValueAxis.prototype.getX = function (dataItem, key, location, stackKey, range) {\r\n return this.renderer.positionToPoint(this.getPositionX(dataItem, key, location, stackKey, range)).x;\r\n };\r\n /**\r\n * Returns the X coordinate for series' data item's value.\r\n *\r\n * @since 4.5.14\r\n * @param dataItem Data item\r\n * @param key Data field to get value from\r\n * @param location Location (0-1)\r\n * @param stackKey ?\r\n * @return Relative position\r\n */\r\n ValueAxis.prototype.getPositionX = function (dataItem, key, location, stackKey, range) {\r\n var value = dataItem.getWorkingValue(key);\r\n if (!$type.hasValue(stackKey)) {\r\n stackKey = \"valueX\";\r\n }\r\n var stack = dataItem.getValue(stackKey, \"stack\");\r\n if (!$type.isNumber(value)) {\r\n value = this.baseValue;\r\n if (this.logarithmic) {\r\n if (stack > 0) {\r\n value = 0;\r\n }\r\n }\r\n }\r\n var position = this.valueToPosition(value + stack);\r\n if (range) {\r\n position = $math.fitToRange(position, range.start, range.end);\r\n }\r\n return position;\r\n };\r\n /**\r\n * Returns the Y coordinate for series' data item's value.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description (review)\r\n * @param dataItem Data item\r\n * @param key Data field to get value from\r\n * @param location Location (0-1)\r\n * @param stackKey Stack ID\r\n * @return Y coordinate (px)\r\n */\r\n ValueAxis.prototype.getY = function (dataItem, key, location, stackKey, range) {\r\n return this.renderer.positionToPoint(this.getPositionY(dataItem, key, location, stackKey, range)).y;\r\n };\r\n /**\r\n * Returns relative position on axis for series' data item's value.\r\n *\r\n * @since 4.5.14\r\n * @param dataItem Data item\r\n * @param key Data field to get value from\r\n * @param location Location (0-1)\r\n * @param stackKey Stack ID\r\n * @return Relative position\r\n */\r\n ValueAxis.prototype.getPositionY = function (dataItem, key, location, stackKey, range) {\r\n var value = dataItem.getWorkingValue(key);\r\n if (!$type.hasValue(stackKey)) {\r\n stackKey = \"valueY\";\r\n }\r\n var stack = dataItem.getValue(stackKey, \"stack\");\r\n if (!$type.isNumber(value)) {\r\n value = this.baseValue;\r\n if (this.logarithmic) {\r\n if (stack > 0) {\r\n value = 0;\r\n }\r\n }\r\n }\r\n var position = this.valueToPosition(value + stack);\r\n if (range) {\r\n position = $math.fitToRange(position, range.start, range.end);\r\n }\r\n return position;\r\n };\r\n /**\r\n * Returns an angle for series data item.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description (review)\r\n * @param dataItem Data item\r\n * @param key Data field to get value from\r\n * @param location Location (0-1)\r\n * @param stackKey Stack ID\r\n * @param range Range to fit in\r\n * @return Angle\r\n */\r\n ValueAxis.prototype.getAngle = function (dataItem, key, location, stackKey, range) {\r\n var value = dataItem.getWorkingValue(key);\r\n var stack = dataItem.getValue(stackKey, \"stack\");\r\n if (!$type.isNumber(value)) {\r\n value = this.baseValue;\r\n }\r\n var position = this.valueToPosition(value + stack);\r\n if (range) {\r\n position = $math.fitToRange(position, range.start, range.end);\r\n }\r\n return this.positionToAngle(position);\r\n };\r\n /**\r\n * [getAnyRangePath description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param start [description]\r\n * @param end [description]\r\n * @param location [description]\r\n * @return [description]\r\n */\r\n ValueAxis.prototype.getAnyRangePath = function (start, end, location) {\r\n var startPosition = this.valueToPosition(start);\r\n var endPosition = this.valueToPosition(end);\r\n return this.getPositionRangePath(startPosition, endPosition); // Base class (Axis) gets range shape from AxisRenderer\r\n };\r\n /**\r\n * Returns text to show in a axis tooltip, based on specific position within\r\n * axis.\r\n *\r\n * The label will be formatted as per [[NumberFormatter]] set for the whole\r\n * chart, or explicitly for this Axis.\r\n *\r\n * @ignore Exclude from docs\r\n * @param position Position (px)\r\n * @return Label (numeric value)\r\n */\r\n ValueAxis.prototype.getTooltipText = function (position) {\r\n var value = $math.round(this.positionToValue(position), this._stepDecimalPlaces + this.extraTooltipPrecision);\r\n var valueStr = this.tooltip.numberFormatter.format(value);\r\n if (!this._adapterO) {\r\n return valueStr;\r\n }\r\n else {\r\n return this._adapterO.apply(\"getTooltipText\", valueStr);\r\n }\r\n };\r\n /**\r\n * Zooms axis to specific values.\r\n *\r\n * @param startValue Start value\r\n * @param endValue End value\r\n * @param skipRangeEvent Do not invoke events\r\n * @param instantly Do not play zoom animations\r\n */\r\n ValueAxis.prototype.zoomToValues = function (startValue, endValue, skipRangeEvent, instantly) {\r\n var start = (startValue - this.min) / (this.max - this.min);\r\n var end = (endValue - this.min) / (this.max - this.min);\r\n this.zoom({ start: start, end: end }, skipRangeEvent, instantly);\r\n };\r\n Object.defineProperty(ValueAxis.prototype, \"minZoomed\", {\r\n /**\r\n * A smallest value in axis scale within current zoom.\r\n *\r\n * @return Min zoom value\r\n */\r\n get: function () {\r\n if (!this.syncWithAxis) {\r\n return $math.max(this.min, this._minZoomed);\r\n }\r\n else {\r\n return this._minZoomed;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ValueAxis.prototype, \"maxZoomed\", {\r\n /**\r\n * A biggest value in axis scale within current zoom.\r\n * @return [description]\r\n */\r\n get: function () {\r\n if (!this.syncWithAxis) {\r\n return $math.min(this.max, this._maxZoomed);\r\n }\r\n else {\r\n return this._maxZoomed;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Updates positioning of Axis breaks after something changes.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n ValueAxis.prototype.fixAxisBreaks = function () {\r\n var _this = this;\r\n _super.prototype.fixAxisBreaks.call(this);\r\n var axisBreaks = this._axisBreaks;\r\n if (axisBreaks && axisBreaks.length > 0) {\r\n // process breaks\r\n axisBreaks.each(function (axisBreak) {\r\n var startValue = axisBreak.adjustedStartValue;\r\n var endValue = axisBreak.adjustedEndValue;\r\n // break difference\r\n var axisBreakDif = endValue - startValue;\r\n var axisBreakGridCount = Math.ceil(axisBreakDif * axisBreak.breakSize) * _this._gridCount / (_this.max - _this.min);\r\n // calculate min, max and step for axis break\r\n var breakMinMaxStep = _this.adjustMinMax(startValue, endValue, axisBreakDif, axisBreakGridCount, true);\r\n axisBreak.adjustedStep = breakMinMaxStep.step;\r\n axisBreak.adjustedMin = breakMinMaxStep.min;\r\n axisBreak.adjustedMax = breakMinMaxStep.max;\r\n });\r\n }\r\n this._difference = this.adjustDifference(this.min, this.max);\r\n };\r\n /**\r\n * Returns value based on position.\r\n *\r\n * Please note that `position` represents position within axis which may be\r\n * zoomed and not correspond to Cursor's `position`.\r\n *\r\n * To convert Cursor's `position` to Axis' `position` use `toAxisPosition()` method.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/tutorials/tracking-cursors-position-via-api/#Tracking_Cursor_s_position} For more information about cursor tracking.\r\n * @param position Relative position on axis (0-1)\r\n * @return Position label\r\n */\r\n ValueAxis.prototype.getPositionLabel = function (position) {\r\n var value = this.positionToValue(position);\r\n return this.numberFormatter.format(value);\r\n };\r\n /**\r\n * Shows Axis tooltip at specific value\r\n *\r\n * @param value Value\r\n */\r\n ValueAxis.prototype.showTooltipAt = function (value) {\r\n this.showTooltipAtPosition(this.valueToPosition(value));\r\n };\r\n /**\r\n * Copies all properties and related data from a different instance of Axis.\r\n *\r\n * @param source Source Axis\r\n */\r\n ValueAxis.prototype.copyFrom = function (source) {\r\n _super.prototype.copyFrom.call(this, source);\r\n this.min = source.min;\r\n this.max = source.max;\r\n this.calculateTotals = source.calculateTotals;\r\n this._baseValue = source.baseValue;\r\n };\r\n Object.defineProperty(ValueAxis.prototype, \"syncWithAxis\", {\r\n /**\r\n * @return Target axis\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"syncWithAxis\");\r\n },\r\n /**\r\n * Enables syncing of grid with another axis.\r\n *\r\n * To enable, set to a reference of the other `ValueAxis`. This axis will try\r\n * to maintain its scale in such way that its grid matches target axis grid.\r\n *\r\n * IMPORTANT #1: At this stage it's an experimental feature. Use it at your\r\n * own risk, as it may not work in 100% of the scenarios.\r\n *\r\n * IMPORTANT #2: `syncWithAxis` is not compatible with `strictMinMax` and\r\n * `sequencedInterpolation` settings.\r\n *\r\n * IMPORTANT #3: `syncWithAxis` is not compatible with scrollbars. Make sure\r\n * you do not add a scrollbar in the same direction as synced axes. For\r\n * example, if you have vertical synced axes, do not add `scrollbarY` on\r\n * your chart. It will create anomalies when used.\r\n *\r\n * IMPORTANT #4: `syncWithAxis` is not compatible with `XYCursor` if it has\r\n * its `behavior` set to either `zoomY` or `zoomXY`.\r\n *\r\n * @since 4.8.1\r\n * @param axis Target axis\r\n */\r\n set: function (axis) {\r\n var _this = this;\r\n if (this.setPropertyValue(\"syncWithAxis\", axis, true)) {\r\n if (axis) {\r\n this._disposers.push(axis.events.on(\"extremeschanged\", this.handleSelectionExtremesChange, this, false));\r\n this._disposers.push(axis.events.on(\"selectionextremeschanged\", this.handleSelectionExtremesChange, this, false));\r\n this._disposers.push(axis.events.on(\"startendchanged\", this.handleSelectionExtremesChange, this, false));\r\n this.events.on(\"shown\", this.handleSelectionExtremesChange, this, false);\r\n this.events.on(\"maxsizechanged\", function () {\r\n _this.clearCache();\r\n _this._disposers.push(registry.events.once(\"exitframe\", function () {\r\n _this.handleSelectionExtremesChange();\r\n }));\r\n }, this, false);\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ValueAxis.prototype, \"treatZeroAs\", {\r\n /**\r\n * @return Zero replacement value\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"treatZeroAs\");\r\n },\r\n /**\r\n * If set, zero values will be treated as this value.\r\n *\r\n * It is useful if you need to use data with zero-values on a logarithmic\r\n * axis scale.\r\n *\r\n * @since 4.9.34\r\n * @param value Zero replacement value\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"treatZeroAs\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Syncs with a target axis.\r\n *\r\n * @param min Min\r\n * @param max Max\r\n * @param step Step\r\n */\r\n ValueAxis.prototype.syncAxes = function (min, max, step) {\r\n var axis = this.syncWithAxis;\r\n if (axis) {\r\n if (!$type.isNumber(min)) {\r\n min = this.min;\r\n }\r\n if (!$type.isNumber(max)) {\r\n max = this.max;\r\n }\r\n if (!$type.isNumber(step)) {\r\n step = this._step;\r\n }\r\n var count = Math.round((axis.maxZoomed - axis.minZoomed) / axis.step);\r\n var currentCount = Math.round((max - min) / step);\r\n if ($type.isNumber(count) && $type.isNumber(currentCount)) {\r\n var synced = false;\r\n var c = 0;\r\n var diff = (max - min) * 0.01;\r\n var omin = min;\r\n var omax = max;\r\n var ostep = step;\r\n while (synced != true) {\r\n synced = this.checkSync(omin, omax, ostep, count);\r\n c++;\r\n if (c > 1000) {\r\n synced = true;\r\n }\r\n if (!synced) {\r\n //omin = min - diff * c;\r\n if (c / 3 == Math.round(c / 3)) {\r\n omin = min - diff * c;\r\n if (min >= 0 && omin < 0) {\r\n omin = 0;\r\n }\r\n }\r\n else {\r\n omax = max + diff * c;\r\n if (omax <= 0 && omax > 0) {\r\n omax = 0;\r\n }\r\n }\r\n var minMaxStep = this.adjustMinMax(omin, omax, omax - omin, this._gridCount, true);\r\n omin = minMaxStep.min;\r\n omax = minMaxStep.max;\r\n ostep = minMaxStep.step;\r\n }\r\n else {\r\n min = omin;\r\n max = omax;\r\n step = ostep;\r\n }\r\n }\r\n }\r\n }\r\n return { min: min, max: max, step: step };\r\n };\r\n /**\r\n * Returns `true` if axis needs to be resunced with some other axis.\r\n */\r\n ValueAxis.prototype.checkSync = function (min, max, step, count) {\r\n var currentCount = (max - min) / step;\r\n for (var i = 1; i < count; i++) {\r\n if ($math.round(currentCount / i, 1) == count || currentCount * i == count) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n };\r\n /**\r\n * Processes JSON-based config before it is applied to the object.\r\n *\r\n * @ignore Exclude from docs\r\n * @param config Config\r\n */\r\n ValueAxis.prototype.processConfig = function (config) {\r\n if (config) {\r\n // Set up axes\r\n if ($type.hasValue(config.syncWithAxis) && $type.isString(config.syncWithAxis)) {\r\n if (this.map.hasKey(config.syncWithAxis)) {\r\n config.syncWithAxis = this.map.getKey(config.syncWithAxis);\r\n }\r\n else {\r\n this.processingErrors.push(\"[ValueAxis] No axis with id \\\"\" + config.syncWithAxis + \"\\\" found for `syncWithAxis`\");\r\n delete config.xAxis;\r\n }\r\n }\r\n }\r\n _super.prototype.processConfig.call(this, config);\r\n };\r\n return ValueAxis;\r\n}(Axis));\r\nexport { ValueAxis };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"ValueAxis\"] = ValueAxis;\r\nregistry.registeredClasses[\"ValueAxisDataItem\"] = ValueAxisDataItem;\r\n","/**\r\n * A module which defines functionality related to Value Axis Break.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { AxisBreak } from \"./AxisBreak\";\r\nimport { registry } from \"../../core/Registry\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Base class to define \"breaks\" on value axis.\r\n *\r\n * A \"break\" can be used to \"cut out\" specific ranges of the axis scale, e.g.\r\n * when comparing columns with relatively similar values, it would make sense\r\n * to cut out their mid section, so that their tip differences are more\r\n * prominent.\r\n *\r\n * @see {@link IValueAxisBreakEvents} for a list of available events\r\n * @see {@link IValueAxisBreakAdapters} for a list of available Adapters\r\n * @important\r\n */\r\nvar ValueAxisBreak = /** @class */ (function (_super) {\r\n __extends(ValueAxisBreak, _super);\r\n /**\r\n * Constructor\r\n */\r\n function ValueAxisBreak() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"ValueAxisBreak\";\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n Object.defineProperty(ValueAxisBreak.prototype, \"startPosition\", {\r\n /**\r\n * Pixel position of the break's start.\r\n *\r\n * @return Position (px)\r\n * @readonly\r\n */\r\n get: function () {\r\n if (this.axis) {\r\n return this.axis.valueToPosition(this.adjustedStartValue);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ValueAxisBreak.prototype, \"endPosition\", {\r\n /**\r\n * Pixel position of the break's end.\r\n *\r\n * @return Position (px)\r\n * @readonly\r\n */\r\n get: function () {\r\n if (this.axis) {\r\n return this.axis.valueToPosition(this.adjustedEndValue);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return ValueAxisBreak;\r\n}(AxisBreak));\r\nexport { ValueAxisBreak };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"ValueAxisBreak\"] = ValueAxisBreak;\r\n","/**\r\n * Module that defines everything related to building bullets.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Container } from \"../../core/Container\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport { defaultRules, ResponsiveBreakpoints } from \"../../core/utils/Responsive\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Class used to creates bullets.\r\n *\r\n * @see {@link IBulletEvents} for a list of available events\r\n * @see {@link IBulletAdapters} for a list of available Adapters\r\n * @todo Usage example\r\n * @important\r\n */\r\nvar Bullet = /** @class */ (function (_super) {\r\n __extends(Bullet, _super);\r\n /**\r\n * Constructor\r\n */\r\n function Bullet() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"Bullet\";\r\n _this.isMeasured = false;\r\n _this.tooltipX = 0;\r\n _this.tooltipY = 0;\r\n _this.layout = \"none\";\r\n _this.applyOnClones = true;\r\n _this.copyToLegendMarker = true;\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n Object.defineProperty(Bullet.prototype, \"locationX\", {\r\n /**\r\n * @return Location (0-1)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"locationX\");\r\n },\r\n /**\r\n * Relative horizontal location within cell. (0-1)\r\n *\r\n * @param value Location (0-1)\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"locationX\", value)) {\r\n var dataItem = this.dataItem;\r\n if (dataItem && dataItem.component) {\r\n dataItem.component.invalidate();\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Bullet.prototype, \"locationY\", {\r\n /**\r\n * @return Location (0-1)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"locationY\");\r\n },\r\n /**\r\n * Relative vertical location within cell. (0-1)\r\n *\r\n * @param value Location (0-1)\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"locationY\", value)) {\r\n var dataItem = this.dataItem;\r\n if (dataItem && dataItem.component) {\r\n dataItem.component.invalidate();\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Bullet.prototype, \"xField\", {\r\n /**\r\n * @return [description]\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"xField\");\r\n },\r\n /**\r\n * [xField description]\r\n *\r\n * @todo Description\r\n * @param value [description]\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"xField\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Bullet.prototype, \"yField\", {\r\n /**\r\n * @return [description]\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"yField\");\r\n },\r\n /**\r\n * [yField description]\r\n *\r\n * Description\r\n * @param value [description]\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"yField\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Bullet.prototype, \"isDynamic\", {\r\n /**\r\n * @return Redraw on data change?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"isDynamic\");\r\n },\r\n /**\r\n * Indicates if the bullet is \"dynamic\".\r\n *\r\n * In most cases the bullets remain the same, even if the underlying data\r\n * changes.\r\n *\r\n * However, in cases where bullet also displays a label, or its size depends\r\n * on data, it also needs to be redrawn when the underlying data changes.\r\n *\r\n * Only those bullets that have set `isDynamic = true` will be redrawn each\r\n * time data changes. Regular bullets will be reused as they are.\r\n *\r\n * @default false\r\n * @param value Redraw on data change?\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"isDynamic\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Bullet.prototype, \"copyToLegendMarker\", {\r\n /**\r\n * @return Redraw on data change?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"copyToLegendMarker\");\r\n },\r\n /**\r\n * Indicates if the bullet should be copied to legend marker\r\n *\r\n * @default false\r\n * @param value Redraw on data change?\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"copyToLegendMarker\", value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return Bullet;\r\n}(Container));\r\nexport { Bullet };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Bullet\"] = Bullet;\r\n/**\r\n * Add default responsive rules\r\n */\r\n/**\r\n * Hide bullets\r\n */\r\ndefaultRules.push({\r\n relevant: ResponsiveBreakpoints.isXS,\r\n state: function (target, stateId) {\r\n if (target instanceof Bullet) {\r\n var state = target.states.create(stateId);\r\n state.properties.disabled = true;\r\n return state;\r\n }\r\n return null;\r\n }\r\n});\r\n","/**\r\n * HeatLegend module\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Container } from \"../../core/Container\";\r\nimport { LinearGradient } from \"../../core/rendering/fills/LinearGradient\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport { toColor, Color } from \"../../core/utils/Color\";\r\nimport { ListTemplate, ListDisposer } from \"../../core/utils/List\";\r\nimport { percent } from \"../../core/utils/Percent\";\r\nimport { ValueAxis } from \"../../charts/axes/ValueAxis\";\r\nimport { AxisRendererX } from \"../../charts/axes/AxisRendererX\";\r\nimport { AxisRendererY } from \"../../charts/axes/AxisRendererY\";\r\nimport * as $iter from \"../../core/utils/Iterator\";\r\nimport * as $type from \"../../core/utils/Type\";\r\nimport * as $colors from \"../../core/utils/Colors\";\r\nimport { RoundedRectangle } from \"../../core/elements/RoundedRectangle\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * This class creates a link (waved color-filled line) between two nodes in a\r\n * Sankey Diagram.\r\n *\r\n * @see {@link IHeatLegendEvents} for a list of available events\r\n * @see {@link IHeatLegendAdapters} for a list of available Adapters\r\n * @important\r\n */\r\nvar HeatLegend = /** @class */ (function (_super) {\r\n __extends(HeatLegend, _super);\r\n /**\r\n * Constructor\r\n */\r\n function HeatLegend() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"HeatLegend\";\r\n _this.markerContainer = _this.createChild(Container);\r\n _this.markerContainer.shouldClone = false;\r\n _this.markerCount = 1;\r\n // Create a template container and list for the a marker\r\n var marker = new RoundedRectangle();\r\n marker.minHeight = 20;\r\n marker.minWidth = 20;\r\n marker.interactionsEnabled = false;\r\n marker.fillOpacity = 1;\r\n marker.cornerRadius(0, 0, 0, 0);\r\n _this.markerContainer.minHeight = 20;\r\n _this.markerContainer.minWidth = 20;\r\n _this.orientation = \"horizontal\";\r\n _this.markers = new ListTemplate(marker);\r\n _this._disposers.push(new ListDisposer(_this.markers));\r\n _this._disposers.push(_this.markers.template);\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n HeatLegend.prototype.getMinFromRules = function (property) {\r\n var series = this.series;\r\n if (series) {\r\n var minValue_1;\r\n $iter.eachContinue(series.heatRules.iterator(), function (heatRule) {\r\n if (heatRule.property == property) {\r\n minValue_1 = heatRule.min;\r\n return false;\r\n }\r\n return true;\r\n });\r\n return minValue_1;\r\n }\r\n };\r\n HeatLegend.prototype.getMaxFromRules = function (property) {\r\n var series = this.series;\r\n if (series) {\r\n var maxValue_1;\r\n $iter.each(series.heatRules.iterator(), function (heatRule) {\r\n if (heatRule.property == property) {\r\n maxValue_1 = heatRule.max;\r\n return false;\r\n }\r\n return true;\r\n });\r\n return maxValue_1;\r\n }\r\n };\r\n /**\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n HeatLegend.prototype.validate = function () {\r\n _super.prototype.validate.call(this);\r\n this.valueAxis.renderer.inversed = this.reverseOrder;\r\n var series = this.series;\r\n var minColor = this.minColor;\r\n var maxColor = this.maxColor;\r\n if (!$type.hasValue(minColor)) {\r\n minColor = toColor(this.getMinFromRules(\"fill\"));\r\n }\r\n if (!$type.hasValue(maxColor)) {\r\n maxColor = toColor(this.getMaxFromRules(\"fill\"));\r\n }\r\n if (series) {\r\n var seriesFill = series.fill;\r\n if (!$type.hasValue(minColor) && seriesFill instanceof Color) {\r\n minColor = seriesFill;\r\n }\r\n if (!$type.hasValue(maxColor) && seriesFill instanceof Color) {\r\n maxColor = seriesFill;\r\n }\r\n }\r\n if (!$type.hasValue(maxColor)) {\r\n maxColor = toColor(this.getMaxFromRules(\"fill\"));\r\n }\r\n var minOpacity = $type.toNumber(this.getMinFromRules(\"fillOpacity\"));\r\n if (!$type.isNumber(minOpacity)) {\r\n minOpacity = 1;\r\n }\r\n var maxOpacity = $type.toNumber(this.getMaxFromRules(\"fillOpacity\"));\r\n if (!$type.isNumber(maxOpacity)) {\r\n maxOpacity = 1;\r\n }\r\n var minStrokeOpacity = $type.toNumber(this.getMinFromRules(\"strokeOpacity\"));\r\n if (!$type.isNumber(minStrokeOpacity)) {\r\n minStrokeOpacity = 1;\r\n }\r\n var maxStrokeOpacity = $type.toNumber(this.getMaxFromRules(\"strokeOpacity\"));\r\n if (!$type.isNumber(maxStrokeOpacity)) {\r\n maxStrokeOpacity = 1;\r\n }\r\n var minStroke = toColor(this.getMinFromRules(\"stroke\"));\r\n var maxStroke = toColor(this.getMaxFromRules(\"stroke\"));\r\n //if (series) {\r\n for (var i = 0; i < this.markerCount; i++) {\r\n var marker = this.markers.getIndex(i);\r\n if (!marker) {\r\n marker = this.markers.create();\r\n marker.parent = this.markerContainer;\r\n marker.height = percent(100);\r\n marker.width = percent(100);\r\n }\r\n if (this.markerCount == 1) {\r\n var gradient = new LinearGradient();\r\n if (this.reverseOrder) {\r\n gradient.addColor(maxColor, maxOpacity);\r\n gradient.addColor(minColor, minOpacity);\r\n }\r\n else {\r\n gradient.addColor(minColor, minOpacity);\r\n gradient.addColor(maxColor, maxOpacity);\r\n }\r\n if (this.orientation == \"vertical\") {\r\n gradient.rotation = -90;\r\n }\r\n marker.fill = gradient;\r\n if ($type.hasValue(minStroke) && $type.hasValue(maxStroke)) {\r\n var strokeGradient = new LinearGradient();\r\n if (this.reverseOrder) {\r\n strokeGradient.addColor(maxStroke, maxStrokeOpacity);\r\n strokeGradient.addColor(minStroke, minStrokeOpacity);\r\n }\r\n else {\r\n strokeGradient.addColor(minStroke, minStrokeOpacity);\r\n strokeGradient.addColor(maxStroke, maxStrokeOpacity);\r\n }\r\n if (this.orientation == \"vertical\") {\r\n strokeGradient.rotation = -90;\r\n }\r\n marker.stroke = strokeGradient;\r\n }\r\n }\r\n else {\r\n var c = i;\r\n if (this.reverseOrder) {\r\n c = this.markerCount - i - 1;\r\n }\r\n var color = new Color($colors.interpolate(minColor.rgb, maxColor.rgb, c / this.markerCount));\r\n marker.fill = color;\r\n var opacity = minOpacity + (maxOpacity - minOpacity) * c / this.markerCount;\r\n marker.fillOpacity = opacity;\r\n if ($type.hasValue(minStroke) && $type.hasValue(maxStroke)) {\r\n var color_1 = new Color($colors.interpolate(minStroke.rgb, maxStroke.rgb, c / this.markerCount));\r\n marker.stroke = color_1;\r\n var opacity_1 = minStrokeOpacity + (maxStrokeOpacity - minStrokeOpacity) * c / this.markerCount;\r\n marker.strokeOpacity = opacity_1;\r\n }\r\n }\r\n }\r\n var renderer = this.valueAxis.renderer;\r\n if (this.markerCount > 1) {\r\n if (this.orientation == \"horizontal\") {\r\n renderer.minGridDistance = this.measuredWidth / this.markerCount;\r\n }\r\n else {\r\n renderer.minGridDistance = this.measuredHeight / this.markerCount;\r\n }\r\n }\r\n this.valueAxis.invalidate();\r\n for (var i = this.markerCount, len = this.markers.length; i < len; i++) {\r\n this.markers.getIndex(i).parent = undefined;\r\n }\r\n };\r\n Object.defineProperty(HeatLegend.prototype, \"minColor\", {\r\n /**\r\n * Returns minColor value\r\n * @return {Color}\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"minColor\");\r\n },\r\n /**\r\n * Min color of a heat legend. If a series is set for the legend, minColor is taken from series.\r\n *\r\n * @param {Color}\r\n */\r\n set: function (value) {\r\n if (!(value instanceof Color)) {\r\n value = toColor(value);\r\n }\r\n this.setColorProperty(\"minColor\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(HeatLegend.prototype, \"maxColor\", {\r\n /**\r\n * Returns maxColor value\r\n * @return {Color}\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"maxColor\");\r\n },\r\n /**\r\n * Max color of a heat legend. If a series is set for the legend, maxColor is taken from series.\r\n *\r\n * @param {Color}\r\n */\r\n set: function (value) {\r\n if (!(value instanceof Color)) {\r\n value = toColor(value);\r\n }\r\n this.setColorProperty(\"maxColor\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(HeatLegend.prototype, \"markerCount\", {\r\n /**\r\n * Returns number of color squares (markers).\r\n * @return {number}\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"markerCount\");\r\n },\r\n /**\r\n * Number of color squares (markers) in the heat legend. If only 1 marker is used, it will be filled with gradient.\r\n *\r\n * @param {number}\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"markerCount\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(HeatLegend.prototype, \"minValue\", {\r\n /**\r\n * Returns minimum value of heat legend.\r\n * @return {number}\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"minValue\");\r\n },\r\n /**\r\n * Minimum value of heat legend's value axis. If a series is set for the legend, min is taken from series.\r\n *\r\n * @param {number}\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"minValue\", value);\r\n this.valueAxis.min = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(HeatLegend.prototype, \"maxValue\", {\r\n /**\r\n * Returns maximum value of heat legend.\r\n * @return {number}\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"maxValue\");\r\n },\r\n /**\r\n * Maximum value of heat legend's value axis. If a series is set for the legend, max is taken from series.\r\n *\r\n * @param {number}\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"maxValue\", value);\r\n this.valueAxis.max = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(HeatLegend.prototype, \"orientation\", {\r\n /**\r\n * Returns orientation value.\r\n *\r\n * @return {\"horizontal\" | \"vertical\"}\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"orientation\");\r\n },\r\n /**\r\n * Heat legend orientation. Note, if you change orientation of a heat legend, you must set value axis renderer properties after that, as with orientation renderer changes.\r\n *\r\n * @param {\"horizontal\" | \"vertical\"}\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"orientation\", value, true);\r\n var markerContainer = this.markerContainer;\r\n var valueAxis = this.valueAxis;\r\n // HORIZONTAL\r\n if (value == \"horizontal\") {\r\n if (!$type.hasValue(this.width)) {\r\n this.width = 200;\r\n }\r\n this.height = undefined;\r\n valueAxis.width = percent(100);\r\n valueAxis.height = undefined;\r\n valueAxis.tooltip.pointerOrientation = \"vertical\";\r\n this.layout = \"vertical\";\r\n markerContainer.width = percent(100);\r\n markerContainer.height = undefined;\r\n if (!(valueAxis.renderer instanceof AxisRendererX)) {\r\n valueAxis.renderer = new AxisRendererX();\r\n }\r\n }\r\n // VERTICAL\r\n else {\r\n if (!$type.hasValue(this.height)) {\r\n this.height = 200;\r\n }\r\n this.width = undefined;\r\n this.layout = \"horizontal\";\r\n markerContainer.width = undefined;\r\n markerContainer.height = percent(100);\r\n valueAxis.height = percent(100);\r\n valueAxis.width = undefined;\r\n valueAxis.tooltip.pointerOrientation = \"horizontal\";\r\n if (!(valueAxis.renderer instanceof AxisRendererY)) {\r\n valueAxis.renderer = new AxisRendererY();\r\n }\r\n valueAxis.renderer.inside = true;\r\n valueAxis.renderer.labels.template.inside = true;\r\n this.markerContainer.reverseOrder = true;\r\n }\r\n var renderer = valueAxis.renderer;\r\n renderer.grid.template.disabled = true;\r\n renderer.axisFills.template.disabled = true;\r\n renderer.baseGrid.disabled = true;\r\n renderer.labels.template.padding(2, 3, 2, 3);\r\n renderer.minHeight = undefined;\r\n renderer.minWidth = undefined;\r\n this.markerContainer.layout = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(HeatLegend.prototype, \"valueAxis\", {\r\n /**\r\n * Returns valueAxis value.\r\n * @return {ValueAxis}\r\n */\r\n get: function () {\r\n if (!this._valueAxis) {\r\n this.valueAxis = this.createChild(ValueAxis);\r\n this.valueAxis.shouldClone = false;\r\n }\r\n return this._valueAxis;\r\n },\r\n /**\r\n * Sets a value axis of heat legend. Value axis for heat legend is created automatically.\r\n * @param {ValueAxis}\r\n */\r\n set: function (valueAxis) {\r\n this._valueAxis = valueAxis;\r\n valueAxis.parent = this;\r\n valueAxis.strictMinMax = true;\r\n this.orientation = this.orientation;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(HeatLegend.prototype, \"series\", {\r\n /**\r\n * Returns series value.\r\n * @return {Series}\r\n */\r\n get: function () {\r\n return this._series;\r\n },\r\n /**\r\n * You can set series for heat legend. It will take min, max, minColor and maxColor values from this series.\r\n * @param series\r\n */\r\n set: function (series) {\r\n var _this = this;\r\n this._series = series;\r\n var dataField = \"value\";\r\n try {\r\n var dataFieldDefined = series.heatRules.getIndex(0).dataField;\r\n if (dataFieldDefined) {\r\n dataField = dataFieldDefined;\r\n }\r\n }\r\n catch (err) {\r\n }\r\n this.updateMinMax(series.dataItem.values[dataField].low, series.dataItem.values[dataField].high);\r\n series.dataItem.events.on(\"calculatedvaluechanged\", function (event) {\r\n _this.updateMinMax(series.dataItem.values[dataField].low, series.dataItem.values[dataField].high);\r\n }, undefined, false);\r\n series.heatRules.events.on(\"inserted\", this.invalidate, this, false);\r\n series.heatRules.events.on(\"removed\", this.invalidate, this, false);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Updates min/max of value axis.\r\n * @ignore\r\n */\r\n HeatLegend.prototype.updateMinMax = function (min, max) {\r\n var valueAxis = this.valueAxis;\r\n if (!$type.isNumber(this.minValue)) {\r\n valueAxis.min = min;\r\n valueAxis.invalidate();\r\n }\r\n if (!$type.isNumber(this.maxValue)) {\r\n valueAxis.max = max;\r\n valueAxis.invalidate();\r\n }\r\n };\r\n /**\r\n * Processes JSON-based config before it is applied to the object.\r\n *\r\n * @ignore Exclude from docs\r\n * @param config Config\r\n */\r\n HeatLegend.prototype.processConfig = function (config) {\r\n if (config) {\r\n // Set up series\r\n if ($type.hasValue(config.series) && $type.isString(config.series)) {\r\n if ($type.isString(config.series)) {\r\n if (this.map.hasKey(config.series)) {\r\n config.series = this.map.getKey(config.series);\r\n }\r\n else {\r\n var seriesId_1 = config.series;\r\n var disposer_1 = this.map.events.on(\"insertKey\", function (ev) {\r\n if (ev.key == seriesId_1) {\r\n this.series = ev.newValue;\r\n disposer_1.dispose();\r\n }\r\n }, this);\r\n this._disposers.push(disposer_1);\r\n delete config.series;\r\n }\r\n }\r\n }\r\n }\r\n _super.prototype.processConfig.call(this, config);\r\n };\r\n return HeatLegend;\r\n}(Container));\r\nexport { HeatLegend };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"HeatLegend\"] = HeatLegend;\r\n","/**\r\n * Tick module\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Sprite } from \"../../core/Sprite\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport { InterfaceColorSet } from \"../../core/utils/InterfaceColorSet\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * A basic Tick class.\r\n *\r\n * A tick is a short dash, mainly connecting an object like axis or slice to\r\n * it's textual label.\r\n *\r\n * @see {@link ITickEvents} for a list of available events\r\n * @see {@link ITickAdapters} for a list of available Adapters\r\n * @important\r\n */\r\nvar Tick = /** @class */ (function (_super) {\r\n __extends(Tick, _super);\r\n /**\r\n * Constructor\r\n */\r\n function Tick() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"Tick\";\r\n var interfaceColors = new InterfaceColorSet();\r\n _this.fillOpacity = 0;\r\n _this.length = 6;\r\n _this.strokeOpacity = 0.2;\r\n _this.stroke = interfaceColors.getFor(\"grid\");\r\n _this.isMeasured = false;\r\n _this.nonScalingStroke = true;\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n Object.defineProperty(Tick.prototype, \"length\", {\r\n /**\r\n * @return Length (px)\r\n */\r\n get: function () {\r\n if (this.disabled) {\r\n return 0;\r\n }\r\n return this.getPropertyValue(\"length\");\r\n },\r\n /**\r\n * Length of the tick in pixels.\r\n *\r\n * @param value Length (px)\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"length\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return Tick;\r\n}(Sprite));\r\nexport { Tick };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Tick\"] = Tick;\r\n","/**\r\n * A collection of GeoJSON format-related utility functions.\r\n */\r\nimport * as $math from \"../../core/utils/Math\";\r\nimport * as $array from \"../../core/utils/Array\";\r\n/**\r\n * Normalizes a geo-point.\r\n *\r\n * @ignore Exclude from docs\r\n * @param geoPoint Source geo-point\r\n * @return Normalized geo-point\r\n */\r\nexport function normalizePoint(geoPoint) {\r\n var longitude = wrapAngleTo180(geoPoint.longitude);\r\n var latitude = Math.asin(Math.sin((geoPoint.latitude * $math.RADIANS))) * $math.DEGREES;\r\n var latitude180 = wrapAngleTo180(geoPoint.latitude);\r\n if (Math.abs(latitude180) > 90) {\r\n longitude = wrapAngleTo180(longitude + 180);\r\n }\r\n geoPoint.longitude = longitude;\r\n geoPoint.latitude = latitude;\r\n return geoPoint;\r\n}\r\n/**\r\n * Normalizes all points of a geo-line.\r\n *\r\n * @ignore Exclude from docs\r\n * @param multiline Source geo-line\r\n * @return Normalized geo-line\r\n */\r\nexport function normalizeMultiline(multiline) {\r\n $array.each(multiline, function (segment) {\r\n $array.each(segment, function (point) {\r\n normalizePoint(point);\r\n });\r\n });\r\n return multiline;\r\n}\r\n/**\r\n * [wrapAngleTo180 description]\r\n *\r\n * @todo Description\r\n * @ignore Exclude from docs\r\n * @param angle Angle\r\n * @return Angle\r\n */\r\nexport function wrapAngleTo180(angle) {\r\n angle = angle % 360;\r\n if (angle > 180) {\r\n angle -= 360;\r\n }\r\n if (angle < -180) {\r\n angle += 360;\r\n }\r\n return angle;\r\n}\r\n/**\r\n * Converts a geo point to a regular point object.\r\n *\r\n * @ignore Exclude from docs\r\n * @param geoPoint Source geo point\r\n * @return Point\r\n */\r\nexport function geoToPoint(geoPoint) {\r\n return { x: geoPoint.longitude, y: geoPoint.latitude };\r\n}\r\n","/**\r\n * Graticule (map grid line).\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { MapLine } from \"./MapLine\";\r\nimport { registry } from \"../../core/Registry\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Graticule is a map line spanning from the poles or around the globe.\r\n *\r\n * @since 4.3.0\r\n * @see {@link IGraticuleEvents} for a list of available events\r\n * @see {@link IGraticuleAdapters} for a list of available Adapters\r\n */\r\nvar Graticule = /** @class */ (function (_super) {\r\n __extends(Graticule, _super);\r\n /**\r\n * Constructor\r\n */\r\n function Graticule() {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n _this.className = \"Graticule\";\r\n // Apply theme\r\n _this.applyTheme();\r\n _this.shortestDistance = true;\r\n return _this;\r\n }\r\n return Graticule;\r\n}(MapLine));\r\nexport { Graticule };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Graticule\"] = Graticule;\r\n","/**\r\n * Graticule (map grid) series functionality.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { MapLineSeries, MapLineSeriesDataItem } from \"./MapLineSeries\";\r\nimport { Graticule } from \"./Graticule\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport * as d3geo from \"d3-geo\";\r\nimport * as $array from \"../../core/utils/Array\";\r\n/**\r\n * ============================================================================\r\n * DATA ITEM\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Defines a [[DataItem]] for [[GraticuleSeries]].\r\n *\r\n * @see {@link DataItem}\r\n */\r\nvar GraticuleSeriesDataItem = /** @class */ (function (_super) {\r\n __extends(GraticuleSeriesDataItem, _super);\r\n /**\r\n * Constructor\r\n */\r\n function GraticuleSeriesDataItem() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"GraticuleSeriesDataItem\";\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n return GraticuleSeriesDataItem;\r\n}(MapLineSeriesDataItem));\r\nexport { GraticuleSeriesDataItem };\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * This class is used to create a set of graticules (map grid).\r\n *\r\n * To enable, create like you would create any regular map series:\r\n *\r\n * ```TypeScript\r\n * let graticule = chart.series.push(new am4maps.GraticuleSeries())\r\n * graticule.mapLines.template.line.stroke = am4core.color(\"#000000\");\r\n * graticule.mapLines.template.line.strokeOpacity = 0.1;\r\n * ```\r\n * ```JavaScript\r\n * var graticule = chart.series.push(new am4maps.GraticuleSeries())\r\n * graticule.mapLines.template.line.stroke = am4core.color(\"#000000\");\r\n * graticule.mapLines.template.line.strokeOpacity = 0.1;\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"series\": [{\r\n * \"type\": \"GraticuleSeries\",\r\n * \"mapLines\": {\r\n * \"line\": {\r\n * \"stroke\": \"#000000\",\r\n * \"strokeOpacity\": 0.1\r\n * }\r\n * }\r\n * }]\r\n * }\r\n * ```\r\n *\r\n * @since 4.3.0\r\n * @see {@link IGraticuleSeriesEvents} for a list of available Events\r\n * @see {@link IGraticuleSeriesAdapters} for a list of available Adapters\r\n * @important\r\n */\r\nvar GraticuleSeries = /** @class */ (function (_super) {\r\n __extends(GraticuleSeries, _super);\r\n /**\r\n * Constructor\r\n */\r\n function GraticuleSeries() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"GraticuleSeries\";\r\n _this.longitudeStep = 10;\r\n _this.latitudeStep = 10;\r\n _this.north = 90;\r\n _this.south = -90;\r\n _this.east = -180;\r\n _this.west = 180;\r\n //this.majorLatitudeStep = 90;\r\n //this.majorLongitudeStep = 360;\r\n _this.fitExtent = true;\r\n _this.singleSprite = true;\r\n _this.events.disableType(\"geoBoundsChanged\");\r\n _this.mapLines.template.line.strokeOpacity = 0.08;\r\n _this.ignoreBounds = false;\r\n _this.hiddenInLegend = true;\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Returns a new/empty DataItem of the type appropriate for this object.\r\n *\r\n * @see {@link DataItem}\r\n * @return Data Item\r\n */\r\n GraticuleSeries.prototype.createDataItem = function () {\r\n return new GraticuleSeriesDataItem();\r\n };\r\n GraticuleSeries.prototype.validateData = function () {\r\n var _this = this;\r\n _super.prototype.validateData.call(this);\r\n this.mapLines.clear();\r\n var graticule = d3geo.geoGraticule();\r\n if (graticule) {\r\n graticule.stepMinor([this.longitudeStep, this.latitudeStep]);\r\n graticule.stepMajor([360, 360]);\r\n var chart = this.chart;\r\n if (this.fitExtent) {\r\n graticule.extent([[chart.east, chart.north], [chart.west, chart.south]]);\r\n }\r\n else {\r\n graticule.extent([[this.east, this.north], [this.west, this.south]]);\r\n }\r\n if (this.singleSprite) {\r\n var mapLine = this.mapLines.create();\r\n mapLine.multiLine = graticule().coordinates;\r\n }\r\n else {\r\n var lineStrings = graticule.lines();\r\n $array.each(lineStrings, function (lineString) {\r\n var mapLine = _this.mapLines.create();\r\n mapLine.multiLine = [lineString.coordinates];\r\n });\r\n }\r\n }\r\n };\r\n /**\r\n * Returns a new line instance of suitable type.\r\n *\r\n * @return New line\r\n */\r\n GraticuleSeries.prototype.createLine = function () {\r\n return new Graticule();\r\n };\r\n Object.defineProperty(GraticuleSeries.prototype, \"latitudeStep\", {\r\n /**\r\n * @return Step\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"latitudeStep\");\r\n },\r\n /**\r\n * Draw a graticule (grid) every X degrees of latitude.\r\n *\r\n * @default 10\r\n * @param value Step\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"latitudeStep\", value)) {\r\n this.invalidateData();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(GraticuleSeries.prototype, \"longitudeStep\", {\r\n /**\r\n * @return Step\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"longitudeStep\");\r\n },\r\n /**\r\n * Draw a graticule (grid) every X degrees of longitude.\r\n *\r\n * @default 10\r\n * @param value Step\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"longitudeStep\", value)) {\r\n this.invalidateData();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(GraticuleSeries.prototype, \"fitExtent\", {\r\n /**\r\n * @return Fit?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"fitExtent\");\r\n },\r\n /**\r\n * Draw a thicker (major) graticule every X degrees of latitude.\r\n *\r\n * @default 90\r\n * @param value Step\r\n */\r\n // public set majorLatitudeStep(value: number) {\r\n // \tif (this.setPropertyValue(\"majorLatitudeStep\", value)) {\r\n // \t\tthis.invalidateData();\r\n // \t}\r\n // }\r\n /**\r\n * @return Step\r\n */\r\n // public get majorLatitudeStep(): number {\r\n // \treturn this.getPropertyValue(\"majorLatitudeStep\");\r\n // }\r\n /**\r\n * Draw a thicker (major) graticule every X degrees of longitude.\r\n *\r\n * @default 360\r\n * @param value Step\r\n */\r\n // public set majorLongitudeStep(value: number) {\r\n // \tif (this.setPropertyValue(\"majorLongitudeStep\", value)) {\r\n // \t\tthis.invalidateData();\r\n // \t}\r\n // }\r\n /**\r\n * @return Step\r\n */\r\n // public get majorLongitudeStep(): number {\r\n // \treturn this.getPropertyValue(\"majorLongitudeStep\");\r\n // }\r\n /**\r\n * Whether to cap graticules (grid) to actual span of the map (`true`), e.g.\r\n * where there are polygons, or draw full-world grid (`false`).\r\n *\r\n * For world maps, using `false` makes sense. For smaller maps - not so much.\r\n *\r\n * If set to `false`, the grid will be drawn from this series `east` to\r\n * `west`, and from `south` to `north` (default values: `east = -180`;\r\n * `west = 180`; `south =-90`; `north =90`).\r\n *\r\n * These can be overridden by setting `GraticuleSeries`' respective\r\n * properties.\r\n *\r\n * @default true\r\n * @param value Fit?\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"fitExtent\", value)) {\r\n this.invalidateData();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(GraticuleSeries.prototype, \"singleSprite\", {\r\n /**\r\n * @return Use single sprite?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"singleSprite\");\r\n },\r\n /**\r\n * Whether to draw all the grid as a single element or as separate lines.\r\n *\r\n * Setting `true` (default) will result in better performance, whereas\r\n * `false` allows setting visual properties of each line individually.\r\n *\r\n * @default true\r\n * @param value Use single sprite?\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"singleSprite\", value)) {\r\n this.invalidateData();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return GraticuleSeries;\r\n}(MapLineSeries));\r\nexport { GraticuleSeries };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"GraticuleSeries\"] = GraticuleSeries;\r\nregistry.registeredClasses[\"GraticuleSeriesDataItem\"] = GraticuleSeriesDataItem;\r\n","/**\r\n * Map arched line module\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { MapLine } from \"./MapLine\";\r\nimport { Polyarc } from \"../../core/elements/Polyarc\";\r\nimport { registry } from \"../../core/Registry\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Used to draw an arched line on the map.\r\n *\r\n * @see {@link IMapArcEvents} for a list of available events\r\n * @see {@link IMapArcAdapters} for a list of available Adapters\r\n */\r\nvar MapArc = /** @class */ (function (_super) {\r\n __extends(MapArc, _super);\r\n /**\r\n * Constructor\r\n */\r\n function MapArc() {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n _this.className = \"MapArc\";\r\n // Apply theme\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * @ignore\r\n */\r\n MapArc.prototype.createLine = function () {\r\n this.line = new Polyarc();\r\n };\r\n Object.defineProperty(MapArc.prototype, \"shortestDistance\", {\r\n get: function () {\r\n return false;\r\n },\r\n /**\r\n * `shortestDistance = true` is not supported by `MapArc`.\r\n *\r\n * Only [[MapLine]] supports it.\r\n *\r\n * @default false\r\n * @param value\r\n */\r\n set: function (value) {\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return MapArc;\r\n}(MapLine));\r\nexport { MapArc };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"MapArc\"] = MapArc;\r\n","/**\r\n * Map arc series module.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { MapLineSeries, MapLineSeriesDataItem } from \"./MapLineSeries\";\r\nimport { MapArc } from \"./MapArc\";\r\nimport { registry } from \"../../core/Registry\";\r\n/**\r\n * ============================================================================\r\n * DATA ITEM\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Defines a [[DataItem]] for [[MapArcSeries]].\r\n *\r\n * @see {@link DataItem}\r\n */\r\nvar MapArcSeriesDataItem = /** @class */ (function (_super) {\r\n __extends(MapArcSeriesDataItem, _super);\r\n /**\r\n * Constructor\r\n */\r\n function MapArcSeriesDataItem() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"MapArcSeriesDataItem\";\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n return MapArcSeriesDataItem;\r\n}(MapLineSeriesDataItem));\r\nexport { MapArcSeriesDataItem };\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * A series of arc elements. (curved lines)\r\n *\r\n * @see {@link IMapArcSeriesEvents} for a list of available Events\r\n * @see {@link IMapArcSeriesAdapters} for a list of available Adapters\r\n * @important\r\n */\r\nvar MapArcSeries = /** @class */ (function (_super) {\r\n __extends(MapArcSeries, _super);\r\n /**\r\n * Constructor\r\n */\r\n function MapArcSeries() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"MapArcSeries\";\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Returns a new/empty DataItem of the type appropriate for this object.\r\n *\r\n * @see {@link DataItem}\r\n * @return Data Item\r\n */\r\n MapArcSeries.prototype.createDataItem = function () {\r\n return new MapArcSeriesDataItem();\r\n };\r\n /**\r\n * Returns a new line instance of suitable type.\r\n *\r\n * @return New line\r\n */\r\n MapArcSeries.prototype.createLine = function () {\r\n return new MapArc();\r\n };\r\n return MapArcSeries;\r\n}(MapLineSeries));\r\nexport { MapArcSeries };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"MapArcSeries\"] = MapArcSeries;\r\nregistry.registeredClasses[\"MapArcSeriesDataItem\"] = MapArcSeriesDataItem;\r\n","/**\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { MapObject } from \"./MapObject\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport * as $type from \"../../core/utils/Type\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Used to place an image on the map.\r\n *\r\n * @see {@link IMapImageEvents} for a list of available events\r\n * @see {@link IMapImageAdapters} for a list of available Adapters\r\n */\r\nvar MapImage = /** @class */ (function (_super) {\r\n __extends(MapImage, _super);\r\n /**\r\n * Constructor\r\n */\r\n function MapImage() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"MapImage\";\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n Object.defineProperty(MapImage.prototype, \"latitude\", {\r\n /**\r\n * @return Latitude\r\n */\r\n get: function () {\r\n var latitude = this.getPropertyValue(\"latitude\");\r\n if (!$type.isNumber(latitude) && this.dataItem && this.dataItem.geoPoint) {\r\n latitude = this.dataItem.geoPoint.latitude;\r\n }\r\n return latitude;\r\n },\r\n /**\r\n * Latitude image is placed at.\r\n *\r\n * @param value Latitude\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"latitude\", value, false, true);\r\n this.updateExtremes();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapImage.prototype, \"longitude\", {\r\n /**\r\n * @return Longitude\r\n */\r\n get: function () {\r\n var longitude = this.getPropertyValue(\"longitude\");\r\n if (!$type.isNumber(longitude) && this.dataItem && this.dataItem.geoPoint) {\r\n longitude = this.dataItem.geoPoint.longitude;\r\n }\r\n return longitude;\r\n },\r\n /**\r\n * Longitude image is placed on.\r\n *\r\n * @param value Longitude\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"longitude\", value, false, true);\r\n this.updateExtremes();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Repositions the image to it's current position.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n MapImage.prototype.validatePosition = function () {\r\n if ($type.isNumber(this.latitude) && $type.isNumber(this.longitude)) {\r\n //this.moveTo(this.series.chart.projection.convert({ latitude: this.latitude, longitude: this.longitude }));\r\n var p = this.series.chart.projection.d3Projection([this.longitude, this.latitude]);\r\n var visible = this.series.chart.projection.d3Path({ type: 'Point', coordinates: [this.longitude, this.latitude] });\r\n if (!visible) {\r\n this.__disabled = true;\r\n }\r\n else {\r\n this.__disabled = false;\r\n }\r\n this.moveTo({ x: p[0], y: p[1] });\r\n }\r\n _super.prototype.validatePosition.call(this);\r\n };\r\n /**\r\n * @ignore\r\n */\r\n MapImage.prototype.getFeature = function () {\r\n return { \"type\": \"Feature\", geometry: { type: \"Point\", coordinates: [this.longitude, this.latitude] } };\r\n };\r\n return MapImage;\r\n}(MapObject));\r\nexport { MapImage };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"MapImage\"] = MapImage;\r\n","/**\r\n * Map image series module\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { MapSeries, MapSeriesDataItem } from \"./MapSeries\";\r\nimport { MapImage } from \"./MapImage\";\r\nimport { ListTemplate, ListDisposer } from \"../../core/utils/List\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport * as $array from \"../../core/utils/Array\";\r\nimport * as $mapUtils from \"./MapUtils\";\r\nimport * as $utils from \"../../core/utils/Utils\";\r\nimport * as $iter from \"../../core/utils/Iterator\";\r\nimport * as $type from \"../../core/utils/Type\";\r\nimport { Disposer } from \"../../core/utils/Disposer\";\r\n/**\r\n * ============================================================================\r\n * DATA ITEM\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Defines a [[DataItem]] for [[MapImageSeries]]\r\n * @see {@link DataItem}\r\n */\r\nvar MapImageSeriesDataItem = /** @class */ (function (_super) {\r\n __extends(MapImageSeriesDataItem, _super);\r\n /**\r\n * Constructor\r\n */\r\n function MapImageSeriesDataItem() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"MapImageSeriesDataItem\";\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * @ignore\r\n */\r\n MapImageSeriesDataItem.prototype.getFeature = function () {\r\n return { \"type\": \"Feature\", geometry: { type: \"Point\", coordinates: this.point } };\r\n };\r\n Object.defineProperty(MapImageSeriesDataItem.prototype, \"mapImage\", {\r\n /**\r\n * A [[MapImage]] element related to this data item.\r\n *\r\n * @return Element\r\n */\r\n get: function () {\r\n var _this = this;\r\n if (!this._mapImage) {\r\n var mapImage_1 = this.component.mapImages.create();\r\n this.addSprite(mapImage_1);\r\n this._mapImage = mapImage_1;\r\n this._disposers.push(mapImage_1);\r\n this._disposers.push(new Disposer(function () {\r\n if (_this.component) {\r\n _this.component.mapImages.removeValue(mapImage_1);\r\n }\r\n }));\r\n this.mapObject = mapImage_1;\r\n }\r\n return this._mapImage;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapImageSeriesDataItem.prototype, \"point\", {\r\n /**\r\n * @return [description]\r\n */\r\n get: function () {\r\n return this._point;\r\n },\r\n /**\r\n * [point description]\r\n *\r\n * @todo Description\r\n * @param point [description]\r\n */\r\n set: function (point) {\r\n this._point = point;\r\n this._geoPoint = $mapUtils.pointToGeo(point);\r\n this.updateExtremes();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapImageSeriesDataItem.prototype, \"multiPoint\", {\r\n /**\r\n * @return [description]\r\n */\r\n get: function () {\r\n return [this._point];\r\n },\r\n /**\r\n * [point description]\r\n *\r\n * @todo Description\r\n * @param point [description]\r\n */\r\n set: function (multiPoint) {\r\n this._point = multiPoint[0];\r\n this._geoPoint = $mapUtils.pointToGeo(this._point);\r\n this.updateExtremes();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapImageSeriesDataItem.prototype, \"geoPoint\", {\r\n /**\r\n * @return Image coordinates\r\n */\r\n get: function () {\r\n return this._geoPoint;\r\n },\r\n /**\r\n * Geographical coordinates (lat/long) image is placed at.\r\n *\r\n * @param geoPoint Image coordinates\r\n */\r\n set: function (geoPoint) {\r\n this._geoPoint = geoPoint;\r\n this.point = [geoPoint.longitude, geoPoint.latitude];\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return MapImageSeriesDataItem;\r\n}(MapSeriesDataItem));\r\nexport { MapImageSeriesDataItem };\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * A series of map image (marker) elements.\r\n *\r\n * @see {@link IMapImageSeriesEvents} for a list of available Events\r\n * @see {@link IMapImageSeriesAdapters} for a list of available Adapters\r\n * @important\r\n */\r\nvar MapImageSeries = /** @class */ (function (_super) {\r\n __extends(MapImageSeries, _super);\r\n /**\r\n * Constructor\r\n */\r\n function MapImageSeries() {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n _this.className = \"MapImageSeries\";\r\n // Set data fields\r\n _this.dataFields.multiPoint = \"multiPoint\";\r\n _this.dataFields.point = \"point\";\r\n _this.dataFields.geoPoint = \"geoPoint\";\r\n _this.dataFields.multiGeoPoint = \"multiGeoPoint\";\r\n _this.ignoreBounds = true;\r\n // Apply theme\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Returns a new/empty DataItem of the type appropriate for this object.\r\n *\r\n * @see {@link DataItem}\r\n * @return Data Item\r\n */\r\n MapImageSeries.prototype.createDataItem = function () {\r\n return new MapImageSeriesDataItem();\r\n };\r\n /**\r\n * (Re)validates the data of the sries, effectively forcing it to redraw\r\n * all of its elements.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n MapImageSeries.prototype.validateData = function () {\r\n var _this = this;\r\n if (this.data.length > 0 && this._parseDataFrom == 0) {\r\n this.mapImages.clear();\r\n }\r\n // process geoJSON and created map objects\r\n if (this.useGeodata) {\r\n if (this.useGeodata || this.geodata) {\r\n var geoJSON = this.chart.geodata;\r\n var features = void 0;\r\n if (geoJSON.type == \"FeatureCollection\") {\r\n features = geoJSON.features;\r\n }\r\n else if (geoJSON.type == \"Feature\") {\r\n features = [geoJSON];\r\n }\r\n else if ([\"Point\", \"LineString\", \"Polygon\", \"MultiPoint\", \"MultiLineString\", \"MultiPolygon\"].indexOf(geoJSON.type) != -1) {\r\n features = [{ geometry: geoJSON }];\r\n }\r\n else {\r\n console.log(\"nothing found in geoJSON\");\r\n }\r\n if (features) {\r\n var _loop_1 = function (i, len) {\r\n var feature = features[i];\r\n var geometry = feature.geometry;\r\n if (geometry) {\r\n var type = geometry.type;\r\n var id_1 = feature.id;\r\n if (type == \"Point\" || type == \"MultiPoint\") { // todo: we don't support multipoints at the moment actually\r\n if (!this_1.checkInclude(this_1.include, this_1.exclude, id_1)) {\r\n return \"continue\";\r\n }\r\n var coordinates = geometry.coordinates;\r\n // make the same as MultiPoint\r\n if (type == \"Point\") {\r\n coordinates = [coordinates];\r\n }\r\n var dataObject = $array.find(this_1.data, function (value, i) {\r\n return value.id == id_1;\r\n });\r\n if (!dataObject) {\r\n dataObject = { multiPoint: coordinates, id: id_1, madeFromGeoData: true };\r\n this_1.data.push(dataObject);\r\n }\r\n else {\r\n if (!dataObject.multiPoint) {\r\n dataObject.multiPoint = coordinates;\r\n }\r\n }\r\n // copy properties data to datacontext\r\n $utils.softCopyProperties(feature.properties, dataObject);\r\n }\r\n }\r\n };\r\n var this_1 = this;\r\n for (var i = 0, len = features.length; i < len; i++) {\r\n _loop_1(i, len);\r\n }\r\n }\r\n }\r\n }\r\n _super.prototype.validateData.call(this);\r\n // important! this should go after super.validateData\r\n // if data is parsed in chunks, images list is corrupted, fix it here\r\n $iter.each(this.dataItems.iterator(), function (dataItem) {\r\n var mapImage = dataItem.mapImage;\r\n if (!mapImage.isDisposed()) {\r\n _this.mapImages.moveValue(mapImage);\r\n if ($type.isNumber(mapImage.latitude) && $type.isNumber(mapImage.latitude)) {\r\n dataItem.geoPoint = { latitude: mapImage.latitude, longitude: mapImage.longitude };\r\n }\r\n }\r\n });\r\n };\r\n Object.defineProperty(MapImageSeries.prototype, \"mapImages\", {\r\n /**\r\n * A list of map images in the series.\r\n *\r\n * @return Map images\r\n */\r\n get: function () {\r\n if (!this._mapImages) {\r\n var template = new MapImage();\r\n var mapImages = new ListTemplate(template);\r\n this._disposers.push(new ListDisposer(mapImages));\r\n this._disposers.push(mapImages.template);\r\n mapImages.template.focusable = true;\r\n mapImages.events.on(\"inserted\", this.handleObjectAdded, this, false);\r\n this._mapImages = mapImages;\r\n this._mapObjects = mapImages;\r\n }\r\n return this._mapImages;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * (Re)validates data element, effectively triggering its redrawal.\r\n *\r\n * @ignore Exclude from docs\r\n * @param dataItem Data item\r\n */\r\n MapImageSeries.prototype.validateDataElement = function (dataItem) {\r\n _super.prototype.validateDataElement.call(this, dataItem);\r\n dataItem.mapImage.invalidate();\r\n };\r\n /**\r\n * (Re)validates the series\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n MapImageSeries.prototype.validate = function () {\r\n _super.prototype.validate.call(this);\r\n $iter.each(this.mapImages.iterator(), function (mapImage) {\r\n mapImage.validatePosition();\r\n });\r\n };\r\n /**\r\n * Copies all properties from another instance of [[Series]].\r\n *\r\n * @param source Source series\r\n */\r\n MapImageSeries.prototype.copyFrom = function (source) {\r\n this.mapImages.template.copyFrom(source.mapImages.template);\r\n _super.prototype.copyFrom.call(this, source);\r\n };\r\n /**\r\n * @ignore\r\n */\r\n MapImageSeries.prototype.getFeatures = function () {\r\n var _this = this;\r\n var features = [];\r\n this.dataItems.each(function (dataItem) {\r\n var feature = dataItem.getFeature();\r\n if (feature) {\r\n features.push(feature);\r\n }\r\n });\r\n this.mapImages.each(function (mapImage) {\r\n if (_this.dataItems.indexOf(mapImage._dataItem) == -1) {\r\n var feature = mapImage.getFeature();\r\n if (feature) {\r\n features.push(feature);\r\n }\r\n }\r\n });\r\n return features;\r\n };\r\n /**\r\n * returns MapImage by id\r\n * @param image id\r\n * @return {MapImage}\r\n */\r\n MapImageSeries.prototype.getImageById = function (id) {\r\n return $iter.find(this.mapImages.iterator(), function (mapImage) {\r\n var dataContext = mapImage.dataItem.dataContext;\r\n if (mapImage.id == id || (dataContext && dataContext.id == id)) {\r\n return true;\r\n }\r\n });\r\n };\r\n return MapImageSeries;\r\n}(MapSeries));\r\nexport { MapImageSeries };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"MapImageSeries\"] = MapImageSeries;\r\nregistry.registeredClasses[\"MapImageSeriesDataItem\"] = MapImageSeriesDataItem;\r\n","/**\r\n * Map line module\r\n */\r\nimport { __extends, __values } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { MapObject } from \"./MapObject\";\r\nimport { MapLineObject } from \"./MapLineObject\";\r\nimport { MapImage } from \"./MapImage\";\r\nimport { MapImageSeries } from \"./MapImageSeries\";\r\nimport { Triangle } from \"../../core/elements/Triangle\";\r\nimport { ListTemplate, ListDisposer } from \"../../core/utils/List\";\r\nimport { Polyline } from \"../../core/elements/Polyline\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport { color } from \"../../core/utils/Color\";\r\nimport { InterfaceColorSet } from \"../../core/utils/InterfaceColorSet\";\r\nimport { percent, Percent } from \"../../core/utils/Percent\";\r\nimport * as $type from \"../../core/utils/Type\";\r\nimport * as $iter from \"../../core/utils/Iterator\";\r\nimport * as $geo from \"./Geo\";\r\nimport * as $mapUtils from \"./MapUtils\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Used to draw a line on the map.\r\n *\r\n * @see {@link IMapLineEvents} for a list of available events\r\n * @see {@link IMapLineAdapters} for a list of available Adapters\r\n */\r\nvar MapLine = /** @class */ (function (_super) {\r\n __extends(MapLine, _super);\r\n /**\r\n * Constructor\r\n */\r\n function MapLine() {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n /**\r\n * A list of event disposers for images.\r\n */\r\n _this._imageListeners = {};\r\n _this.className = \"MapLine\";\r\n _this.createLine();\r\n _this.line.stroke = color();\r\n _this.line.parent = _this;\r\n _this.strokeOpacity = 1;\r\n _this.setPropertyValue(\"precision\", 0.1);\r\n var interfaceColors = new InterfaceColorSet();\r\n _this.stroke = interfaceColors.getFor(\"grid\");\r\n _this.shortestDistance = true;\r\n // Apply theme\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * @ignore\r\n */\r\n MapLine.prototype.createLine = function () {\r\n this.line = new Polyline();\r\n };\r\n /**\r\n * Converts a position within the line (0-1) to a physical point\r\n * coordinates.\r\n *\r\n * 0 indicates start of the line, 0.5 - middle, while 1 indicates the end.\r\n *\r\n * @param position Position (0-1)\r\n * @return Coordinates\r\n */\r\n MapLine.prototype.positionToPoint = function (position) {\r\n if (this.shortestDistance) {\r\n return this.series.chart.projection.positionToPoint(this.multiGeoLine, position);\r\n }\r\n else {\r\n if (this.line) {\r\n return this.line.positionToPoint(position);\r\n }\r\n }\r\n return { x: 0, y: 0, angle: 0 };\r\n };\r\n Object.defineProperty(MapLine.prototype, \"multiGeoLine\", {\r\n /**\r\n * @return Coordinates\r\n */\r\n get: function () {\r\n var multiGeoLine = this.getPropertyValue(\"multiGeoLine\");\r\n if (!multiGeoLine && this.dataItem && this.dataItem.multiGeoLine) {\r\n multiGeoLine = this.dataItem.multiGeoLine;\r\n }\r\n return multiGeoLine;\r\n },\r\n /**\r\n * A collection of X/Y coordinates for a multi-segment line. E.g.:\r\n *\r\n * ```JSON\r\n * [\r\n * // Segment 1\r\n * [\r\n * { longitude: 3.121, latitude: 0.58 },\r\n * { longitude: -5.199, latitude: 21.223 }\r\n * ],\r\n *\r\n * // Segment 2\r\n * [\r\n * { longitude: -5.199, latitude: 21.223 },\r\n * { longitude: -12.9, latitude: 25.85 }\r\n * ]\r\n * ]\r\n * ```\r\n *\r\n * @see {@link https://tools.ietf.org/html/rfc7946#section-3.1.5} GeoJSON MultiLineString reference\r\n * @param multiGeoLine Coordinates\r\n */\r\n set: function (multiGeoLine) {\r\n if (multiGeoLine && multiGeoLine.length > 0) {\r\n this.setPropertyValue(\"multiGeoLine\", $geo.normalizeMultiline(multiGeoLine), true);\r\n var multiLine = $mapUtils.multiGeoLineToMultiLine(multiGeoLine);\r\n this.setPropertyValue(\"multiLine\", multiLine);\r\n this.updateExtremes();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapLine.prototype, \"multiLine\", {\r\n /**\r\n * @return Coordinates\r\n */\r\n get: function () {\r\n var multiLine = this.getPropertyValue(\"multiLine\");\r\n if (!multiLine && this.dataItem && this.dataItem.multiLine) {\r\n multiLine = this.dataItem.multiLine;\r\n }\r\n return multiLine;\r\n },\r\n /**\r\n * A collection of X/Y coordinates for a multi-segment line. E.g.:\r\n *\r\n * ```JSON\r\n * [\r\n * // Segment 1\r\n * [\r\n * [ 100, 150 ],\r\n * [ 120, 200 ]\r\n * ],\r\n *\r\n * // Segment 2\r\n * [\r\n * [ 120, 200 ],\r\n * [ 150, 100 ]\r\n * ]\r\n * ]\r\n * ```\r\n *\r\n * @param multiLine Coordinates\r\n */\r\n set: function (multiLine) {\r\n this.setPropertyValue(\"multiLine\", multiLine);\r\n this.multiGeoLine = $mapUtils.multiLineToGeo(multiLine);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapLine.prototype, \"imagesToConnect\", {\r\n /**\r\n * @return {MapImages[]}\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"imagesToConnect\");\r\n },\r\n /**\r\n * Instead of setting longitudes/latitudes you can set an array of images\r\n * which will be connected by the line.\r\n *\r\n * Parameter is an array that can hold string `id`'s to of the images, or\r\n * references to actual [[MapImage]] objects.\r\n *\r\n * @param images Images\r\n */\r\n set: function (images) {\r\n var _this = this;\r\n this.setPropertyValue(\"imagesToConnect\", images, true);\r\n this.handleImagesToConnect();\r\n if (this.series) {\r\n var chart = this.series.chart;\r\n if (chart) {\r\n chart.series.each(function (series) {\r\n if (series instanceof MapImageSeries) {\r\n if (!series.isReady()) {\r\n _this._disposers.push(series.events.on(\"ready\", _this.handleImagesToConnect, _this, false));\r\n }\r\n }\r\n });\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n MapLine.prototype.handleImagesToConnect = function () {\r\n var e_1, _a;\r\n var _this = this;\r\n if (this.imagesToConnect) {\r\n var segment = [];\r\n var multiGeoLine = [segment];\r\n var _loop_1 = function (image) {\r\n if ($type.isString(image)) {\r\n var chart = this_1.series.chart;\r\n if (chart) {\r\n chart.series.each(function (series) {\r\n if (series instanceof MapImageSeries) {\r\n var img = series.getImageById(image);\r\n if (img) {\r\n image = img;\r\n }\r\n }\r\n });\r\n }\r\n }\r\n if (image instanceof MapImage) {\r\n segment.push({ longitude: image.longitude, latitude: image.latitude });\r\n if (!this_1._imageListeners[image.uid]) {\r\n var disposer = image.events.on(\"propertychanged\", function (event) {\r\n if (event.property == \"longitude\" || event.property == \"latitude\") {\r\n _this.handleImagesToConnect();\r\n _this.invalidate();\r\n }\r\n }, this_1, false);\r\n this_1._imageListeners[image.uid] = disposer;\r\n this_1._disposers.push(disposer);\r\n }\r\n }\r\n };\r\n var this_1 = this;\r\n try {\r\n for (var _b = __values(this.imagesToConnect), _c = _b.next(); !_c.done; _c = _b.next()) {\r\n var image = _c.value;\r\n _loop_1(image);\r\n }\r\n }\r\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\r\n finally {\r\n try {\r\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\r\n }\r\n finally { if (e_1) throw e_1.error; }\r\n }\r\n this.multiGeoLine = multiGeoLine;\r\n }\r\n };\r\n /**\r\n * (Re)validates the line, effectively forcing it to redraw.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n MapLine.prototype.validate = function () {\r\n var chart = this.series.chart;\r\n if (this.multiLine) {\r\n if (!this.shortestDistance) {\r\n var convertedPoints = [];\r\n for (var i = 0, len = this.multiLine.length; i < len; i++) {\r\n var segment = this.multiLine[i];\r\n var convertedSegmentPoints = [];\r\n for (var s = 0, slen = segment.length; s < slen; s++) {\r\n var geoPoint = segment[s];\r\n var point = this.series.chart.projection.convert({ longitude: geoPoint[0], latitude: geoPoint[1] });\r\n convertedSegmentPoints.push(point);\r\n }\r\n convertedPoints.push(convertedSegmentPoints);\r\n }\r\n this.line.segments = convertedPoints;\r\n }\r\n else {\r\n chart.projection.d3Projection.precision(this.precision);\r\n this.line.path = chart.projection.d3Path(this.getFeature());\r\n }\r\n if (this._arrow) {\r\n this._arrow.validatePosition();\r\n }\r\n $iter.each(this.lineObjects.iterator(), function (x) {\r\n x.validatePosition();\r\n });\r\n this.handleGlobalScale();\r\n }\r\n else if (this.imagesToConnect) {\r\n this.handleImagesToConnect();\r\n }\r\n _super.prototype.validate.call(this);\r\n };\r\n /**\r\n * @ignore\r\n */\r\n MapLine.prototype.getFeature = function () {\r\n if (this.multiLine && this.multiLine.length > 0 && this.multiLine[0] && this.multiLine[0].length > 0) {\r\n return { \"type\": \"Feature\", geometry: { type: \"MultiLineString\", coordinates: this.multiLine } };\r\n }\r\n };\r\n /**\r\n * @ignore Exclude from docs\r\n */\r\n MapLine.prototype.measureElement = function () {\r\n // Overriding, just to avoid extra measure\r\n };\r\n Object.defineProperty(MapLine.prototype, \"shortestDistance\", {\r\n /**\r\n * @return Real path?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"shortestDistance\");\r\n },\r\n /**\r\n * The line should take the shortest path over the globe.\r\n *\r\n * Enabling this will make the line look differently in different\r\n * projections. Only `MapLine` supports this setting, `MapArc` and\r\n * `MapSplice` don't.\r\n *\r\n * @default true\r\n * @param value Real path?\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"shortestDistance\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapLine.prototype, \"lineObjects\", {\r\n /**\r\n * List of separate line objects the line consists of.\r\n *\r\n * @readonly\r\n * @return List of line objects\r\n */\r\n get: function () {\r\n if (!this._lineObjects) {\r\n this._lineObjects = new ListTemplate(new MapLineObject());\r\n this._lineObjects.events.on(\"inserted\", this.handleLineObjectAdded, this, false);\r\n this._disposers.push(new ListDisposer(this._lineObjects));\r\n this._disposers.push(this._lineObjects.template);\r\n }\r\n return this._lineObjects;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Decorate a [[LineObject]] when it is added to the line.\r\n *\r\n * @param event Event\r\n */\r\n MapLine.prototype.handleLineObjectAdded = function (event) {\r\n var mapLineObject = event.newValue;\r\n mapLineObject.mapLine = this;\r\n mapLineObject.shouldClone = false;\r\n mapLineObject.parent = this;\r\n };\r\n Object.defineProperty(MapLine.prototype, \"arrow\", {\r\n /**\r\n * @return Arrow element\r\n */\r\n get: function () {\r\n if (!this._arrow) {\r\n var arrow = this.createChild(MapLineObject);\r\n arrow.shouldClone = false;\r\n arrow.width = 8;\r\n arrow.height = 10;\r\n arrow.mapLine = this;\r\n arrow.position = 0.5;\r\n var triangle = arrow.createChild(Triangle);\r\n //triangle.shouldClone = false;\r\n triangle.fillOpacity = 1;\r\n triangle.width = percent(100);\r\n triangle.height = percent(100);\r\n triangle.rotation = 90;\r\n triangle.horizontalCenter = \"middle\";\r\n triangle.verticalCenter = \"middle\";\r\n this._arrow = arrow;\r\n }\r\n return this._arrow;\r\n },\r\n /**\r\n * A [[MapLineObject]] to use as an option arrowhead on the line.\r\n *\r\n * Just accessing this property will create a default arrowhead on the line\r\n * automatically.\r\n *\r\n * @param arrow Arrow element\r\n */\r\n set: function (arrow) {\r\n this._arrow = arrow;\r\n arrow.mapLine = this;\r\n arrow.parent = this;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Copies line properties and other attributes, like arrow, from another\r\n * instance of [[MapLine]].\r\n *\r\n * @param source Source map line\r\n */\r\n MapLine.prototype.copyFrom = function (source) {\r\n _super.prototype.copyFrom.call(this, source);\r\n this.line.copyFrom(source.line);\r\n this.lineObjects.copyFrom(source.lineObjects);\r\n if (source._arrow) {\r\n this.arrow = source.arrow.clone();\r\n }\r\n };\r\n Object.defineProperty(MapLine.prototype, \"latitude\", {\r\n /**\r\n * Latitude of the line center.\r\n *\r\n * @readonly\r\n * @return Latitude\r\n */\r\n get: function () {\r\n return this.north + (this.south - this.north) / 2;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapLine.prototype, \"longitude\", {\r\n /**\r\n * Longitude of the line center.\r\n *\r\n * @readonly\r\n * @return Latitude\r\n */\r\n get: function () {\r\n return this.east + (this.west - this.east) / 2;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * X coordinate for the slice tooltip.\r\n *\r\n * @ignore\r\n * @return X\r\n */\r\n MapLine.prototype.getTooltipX = function () {\r\n var x = this.getPropertyValue(\"tooltipX\");\r\n if (!(x instanceof Percent)) {\r\n x = percent(50);\r\n }\r\n if (x instanceof Percent) {\r\n return this.positionToPoint(x.value).x;\r\n }\r\n else {\r\n return 0;\r\n }\r\n };\r\n /**\r\n * Y coordinate for the slice tooltip.\r\n *\r\n * @ignore\r\n * @return Y\r\n */\r\n MapLine.prototype.getTooltipY = function () {\r\n var y = this.getPropertyValue(\"tooltipY\");\r\n if (!(y instanceof Percent)) {\r\n y = percent(50);\r\n }\r\n if (y instanceof Percent) {\r\n return this.positionToPoint(y.value).y;\r\n }\r\n else {\r\n return 0;\r\n }\r\n };\r\n Object.defineProperty(MapLine.prototype, \"precision\", {\r\n /**\r\n * @return Precision\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"precision\");\r\n },\r\n /**\r\n * When line is plotted, if its `shortestDistance` is set to `true` it is\r\n * bent according to the used projection, to depict the shortest distance how\r\n * it would go on the actual land.\r\n *\r\n * `precision` introduces a setting which can control when such bending\r\n * occurs.\r\n *\r\n * If the distance (in degrees) between line start and end points\r\n * is less than `precision`, no bending will take place and the line will be\r\n * straight.\r\n *\r\n * Set to large number (e.g. 10000) for perfectly straight line.\r\n *\r\n * @since 4.9.1\r\n * @default 0.1\r\n * @param value Precision\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"precision\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return MapLine;\r\n}(MapObject));\r\nexport { MapLine };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"MapLine\"] = MapLine;\r\n","/**\r\n * Map line module\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Container } from \"../../core/Container\";\r\nimport { registry } from \"../../core/Registry\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Draws a line on the map.\r\n *\r\n * @see {@link IMapLineObjectEvents} for a list of available events\r\n * @see {@link IMapLineObjectAdapters} for a list of available Adapters\r\n */\r\nvar MapLineObject = /** @class */ (function (_super) {\r\n __extends(MapLineObject, _super);\r\n /**\r\n * Constructor\r\n */\r\n function MapLineObject() {\r\n var _this = _super.call(this) || this;\r\n _this.adjustRotation = true;\r\n _this.className = \"MapLineObject\";\r\n _this.isMeasured = false;\r\n _this.layout = \"none\";\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * (Re)validates element's position.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n MapLineObject.prototype.validatePosition = function () {\r\n var mapLine = this.mapLine;\r\n if (mapLine) {\r\n var point = mapLine.positionToPoint(this.position);\r\n this.x = point.x;\r\n this.y = point.y;\r\n if (this.adjustRotation) {\r\n this.rotation = point.angle;\r\n }\r\n var dataItem = this.mapLine.dataItem;\r\n if (dataItem) {\r\n var series = this.mapLine.dataItem.component;\r\n this.scale = 1 / series.scale;\r\n }\r\n // hide out of bounds\r\n if (mapLine.shortestDistance) {\r\n var projection = this.mapLine.series.chart.projection;\r\n var geoPoint = projection.positionToGeoPoint(mapLine.multiGeoLine, this.position);\r\n var visible = projection.d3Path({ type: 'Point', coordinates: [geoPoint.longitude, geoPoint.latitude] });\r\n if (!visible) {\r\n this.__disabled = true;\r\n }\r\n else {\r\n this.__disabled = false;\r\n }\r\n }\r\n }\r\n _super.prototype.validatePosition.call(this);\r\n };\r\n Object.defineProperty(MapLineObject.prototype, \"position\", {\r\n /**\r\n * @return Position within the line\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"position\");\r\n },\r\n /**\r\n * Sets object's relative position (0-1) within the line.\r\n *\r\n * `0` will place the object at the beginning of the line. `1` - at the end.\r\n *\r\n * Any intermediate number will place the object at some point within the\r\n * line.\r\n *\r\n * @param value Position within the line (0-1)\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"position\", value, false, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapLineObject.prototype, \"adjustRotation\", {\r\n /**\r\n * @return Auto-rotate\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"adjustRotation\");\r\n },\r\n /**\r\n * If set to `true`, the object will be automatically rotated to face the\r\n * direction of the line at the specific position.\r\n *\r\n * This allows creating images that has its \"front\" always facing the logical\r\n * direction of the line.\r\n *\r\n * @default false\r\n * @param value Auto-rotate\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"adjustRotation\", value, false, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return MapLineObject;\r\n}(Container));\r\nexport { MapLineObject };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"MapLineObject\"] = MapLineObject;\r\n","/**\r\n * Map line series module\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { MapSeries, MapSeriesDataItem } from \"./MapSeries\";\r\nimport { MapLine } from \"./MapLine\";\r\nimport { ListTemplate, ListDisposer } from \"../../core/utils/List\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport * as $mapUtils from \"./MapUtils\";\r\nimport * as $array from \"../../core/utils/Array\";\r\nimport * as $utils from \"../../core/utils/Utils\";\r\nimport * as $iter from \"../../core/utils/Iterator\";\r\nimport { Disposer } from \"../../core/utils/Disposer\";\r\n/**\r\n * ============================================================================\r\n * DATA ITEM\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Defines a [[DataItem]] for [[MapLineSeries]]\r\n * @see {@link DataItem}\r\n */\r\nvar MapLineSeriesDataItem = /** @class */ (function (_super) {\r\n __extends(MapLineSeriesDataItem, _super);\r\n /**\r\n * Constructor\r\n */\r\n function MapLineSeriesDataItem() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"MapLineSeriesDataItem\";\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n MapLineSeriesDataItem.prototype.getFeature = function () {\r\n if (this.multiLine && this.multiLine.length > 0) {\r\n return { \"type\": \"Feature\", geometry: { type: \"MultiLineString\", coordinates: this.multiLine } };\r\n }\r\n };\r\n Object.defineProperty(MapLineSeriesDataItem.prototype, \"mapLine\", {\r\n /**\r\n * A [[MapLine]] element related to this data item.\r\n *\r\n * @readonly\r\n * @return Element\r\n */\r\n get: function () {\r\n var _this = this;\r\n if (!this._mapLine) {\r\n var mapLine_1 = this.component.mapLines.create();\r\n this._mapLine = mapLine_1;\r\n this.addSprite(mapLine_1);\r\n this._disposers.push(mapLine_1);\r\n this._disposers.push(new Disposer(function () {\r\n if (_this.component) {\r\n _this.component.mapLines.removeValue(mapLine_1);\r\n }\r\n }));\r\n this.mapObject = mapLine_1;\r\n }\r\n return this._mapLine;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapLineSeriesDataItem.prototype, \"line\", {\r\n /**\r\n * @return Coordinates\r\n */\r\n get: function () {\r\n return this._line;\r\n },\r\n /**\r\n * A collection of X/Y coordinates for a single-segment line. E.g.:\r\n *\r\n * ```JSON\r\n * [\r\n * [ 100, 150 ],\r\n * [ 120, 200 ]\r\n * ]\r\n * ```\r\n *\r\n * @param line Coordinates\r\n */\r\n set: function (line) {\r\n this._line = line;\r\n this.multiLine = [line];\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapLineSeriesDataItem.prototype, \"multiLine\", {\r\n /**\r\n * @return Coordinates\r\n */\r\n get: function () {\r\n return this._multiLine;\r\n },\r\n /**\r\n * A collection of X/Y coordinates for a multi-segment line. E.g.:\r\n *\r\n * ```JSON\r\n * [\r\n * // Segment 1\r\n * [\r\n * [ 100, 150 ],\r\n * [ 120, 200 ]\r\n * ],\r\n *\r\n * // Segment 2\r\n * [\r\n * [ 120, 200 ],\r\n * [ 150, 100 ]\r\n * ]\r\n * ]\r\n * ```\r\n *\r\n * @param multiLine Coordinates\r\n */\r\n set: function (multiLine) {\r\n this._multiLine = multiLine;\r\n this._multiGeoLine = $mapUtils.multiLineToGeo(multiLine);\r\n this.updateExtremes();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapLineSeriesDataItem.prototype, \"geoLine\", {\r\n /**\r\n * @return Coordinates\r\n */\r\n get: function () {\r\n return this._geoLine;\r\n },\r\n /**\r\n * A collection of lat/long coordinates for a single-segment line. E.g.:\r\n *\r\n * ```JSON\r\n * [\r\n * { longitude: 3.121, latitude: 0.58 },\r\n * { longitude: -5.199, latitude: 21.223 }\r\n * ]\r\n * ```\r\n *\r\n * @see {@link https://tools.ietf.org/html/rfc7946#section-3.1.4} GeoJSON LineString reference\r\n * @param geoLine Coordinates\r\n */\r\n set: function (geoLine) {\r\n this._geoLine = geoLine;\r\n this.multiLine = $mapUtils.multiGeoLineToMultiLine([geoLine]);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapLineSeriesDataItem.prototype, \"multiGeoLine\", {\r\n /**\r\n * @return Coordinates\r\n */\r\n get: function () {\r\n return this._multiGeoLine;\r\n },\r\n /**\r\n * A collection of X/Y coordinates for a multi-segment line. E.g.:\r\n *\r\n * ```JSON\r\n * [\r\n * // Segment 1\r\n * [\r\n * { longitude: 3.121, latitude: 0.58 },\r\n * { longitude: -5.199, latitude: 21.223 }\r\n * ],\r\n *\r\n * // Segment 2\r\n * [\r\n * { longitude: -5.199, latitude: 21.223 },\r\n * { longitude: -12.9, latitude: 25.85 }\r\n * ]\r\n * ]\r\n * ```\r\n *\r\n * @see {@link https://tools.ietf.org/html/rfc7946#section-3.1.5} GeoJSON MultiLineString reference\r\n * @param multiGeoLine Coordinates\r\n */\r\n set: function (multiGeoLine) {\r\n this._multiGeoLine = multiGeoLine;\r\n this.multiLine = $mapUtils.multiGeoLineToMultiLine(multiGeoLine);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return MapLineSeriesDataItem;\r\n}(MapSeriesDataItem));\r\nexport { MapLineSeriesDataItem };\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * A series of map line series.\r\n *\r\n * @see {@link IMapLineSeriesEvents} for a list of available Events\r\n * @see {@link IMapLineSeriesAdapters} for a list of available Adapters\r\n * @important\r\n */\r\nvar MapLineSeries = /** @class */ (function (_super) {\r\n __extends(MapLineSeries, _super);\r\n /**\r\n * Constructor\r\n */\r\n function MapLineSeries() {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n _this.className = \"MapLineSeries\";\r\n // Set data fields\r\n _this.dataFields.multiLine = \"multiLine\";\r\n _this.dataFields.line = \"line\";\r\n _this.dataFields.geoLine = \"geoLine\";\r\n _this.dataFields.multiGeoLine = \"multiGeoLine\";\r\n _this.ignoreBounds = true;\r\n // Apply theme\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Returns a new/empty DataItem of the type appropriate for this object.\r\n *\r\n * @see {@link DataItem}\r\n * @return Data Item\r\n */\r\n MapLineSeries.prototype.createDataItem = function () {\r\n return new MapLineSeriesDataItem();\r\n };\r\n /**\r\n * (Re)validates series data, effectively causing the whole series to be\r\n * redrawn.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n MapLineSeries.prototype.validateData = function () {\r\n // process geoJSON and created map objects\r\n if (this.useGeodata || this.geodata) {\r\n var geoJSON = this.chart.geodata;\r\n if (geoJSON) {\r\n var features = void 0;\r\n if (geoJSON.type == \"FeatureCollection\") {\r\n features = geoJSON.features;\r\n }\r\n else if (geoJSON.type == \"Feature\") {\r\n features = [geoJSON];\r\n }\r\n else if ([\"Point\", \"LineString\", \"Polygon\", \"MultiPoint\", \"MultiLineString\", \"MultiPolygon\"].indexOf(geoJSON.type) != -1) {\r\n features = [{ geometry: geoJSON }];\r\n }\r\n else {\r\n console.log(\"nothing found in geoJSON\");\r\n }\r\n if (features) {\r\n var _loop_1 = function (i, len) {\r\n var feature = features[i];\r\n var geometry = feature.geometry;\r\n if (geometry) {\r\n var type = geometry.type;\r\n var id_1 = feature.id;\r\n if (type == \"LineString\" || type == \"MultiLineString\") {\r\n if (!this_1.checkInclude(this_1.include, this_1.exclude, id_1)) {\r\n return \"continue\";\r\n }\r\n var coordinates = geometry.coordinates;\r\n var dataObject = $array.find(this_1.data, function (value, i) {\r\n return value.id == id_1;\r\n });\r\n if (type == \"LineString\") {\r\n coordinates = [coordinates];\r\n }\r\n if (!dataObject) {\r\n dataObject = { multiLine: coordinates, id: id_1, madeFromGeoData: true };\r\n this_1.data.push(dataObject);\r\n }\r\n else {\r\n if (!dataObject.multiLine) {\r\n dataObject.multiLine = coordinates;\r\n }\r\n }\r\n // copy properties data to datacontext\r\n $utils.softCopyProperties(feature.properties, dataObject);\r\n }\r\n }\r\n };\r\n var this_1 = this;\r\n for (var i = 0, len = features.length; i < len; i++) {\r\n _loop_1(i, len);\r\n }\r\n }\r\n }\r\n }\r\n _super.prototype.validateData.call(this);\r\n };\r\n Object.defineProperty(MapLineSeries.prototype, \"mapLines\", {\r\n /**\r\n * A list of lines in the series.\r\n *\r\n * @return Lines\r\n */\r\n get: function () {\r\n if (!this._mapLines) {\r\n var lineTemplate = this.createLine();\r\n var mapLines = new ListTemplate(lineTemplate);\r\n this._disposers.push(new ListDisposer(mapLines));\r\n this._disposers.push(mapLines.template);\r\n mapLines.events.on(\"inserted\", this.handleObjectAdded, this, false);\r\n this._mapLines = mapLines;\r\n this._mapObjects = mapLines;\r\n }\r\n return this._mapLines;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Returns a new line instance of suitable type.\r\n *\r\n * @return New line\r\n */\r\n MapLineSeries.prototype.createLine = function () {\r\n return new MapLine();\r\n };\r\n /**\r\n * (Re)validates the series\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n MapLineSeries.prototype.validate = function () {\r\n this.dataItems.each(function (dataItem) {\r\n $utils.used(dataItem.mapLine);\r\n });\r\n _super.prototype.validate.call(this);\r\n this.mapLines.each(function (mapLine) {\r\n mapLine.validate();\r\n });\r\n };\r\n /**\r\n * Copies all properties from another instance of [[Series]].\r\n *\r\n * @param source Source series\r\n */\r\n MapLineSeries.prototype.copyFrom = function (source) {\r\n this.mapLines.template.copyFrom(source.mapLines.template);\r\n _super.prototype.copyFrom.call(this, source);\r\n };\r\n /**\r\n * @ignore\r\n */\r\n MapLineSeries.prototype.getFeatures = function () {\r\n var _this = this;\r\n var features = [];\r\n this.dataItems.each(function (dataItem) {\r\n var feature = dataItem.getFeature();\r\n if (feature) {\r\n features.push(feature);\r\n }\r\n });\r\n this.mapLines.each(function (mapLine) {\r\n if (_this.dataItems.indexOf(mapLine._dataItem) == -1) {\r\n var feature = mapLine.getFeature();\r\n if (feature) {\r\n features.push(feature);\r\n }\r\n }\r\n });\r\n return features;\r\n };\r\n /**\r\n * returns MapLine by id\r\n * @param line id\r\n * @return {MapLine}\r\n */\r\n MapLineSeries.prototype.getLineById = function (id) {\r\n return $iter.find(this.mapLines.iterator(), function (mapLine) {\r\n var dataContext = mapLine.dataItem.dataContext;\r\n return dataContext.id == id;\r\n });\r\n };\r\n return MapLineSeries;\r\n}(MapSeries));\r\nexport { MapLineSeries };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"MapLineSeries\"] = MapLineSeries;\r\nregistry.registeredClasses[\"MapLineSeriesDataItem\"] = MapLineSeriesDataItem;\r\n","/**\r\n * Map object module\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Container } from \"../../core/Container\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport * as $math from \"../../core/utils/Math\";\r\nimport * as d3geo from \"d3-geo\";\r\nimport * as $type from \"../../core/utils/Type\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * A base class for all map objects: lines, images, etc.\r\n *\r\n * @see {@link IMapObjectEvents} for a list of available events\r\n * @see {@link IMapObjectAdapters} for a list of available Adapters\r\n */\r\nvar MapObject = /** @class */ (function (_super) {\r\n __extends(MapObject, _super);\r\n /**\r\n * Constructor\r\n */\r\n function MapObject() {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n _this.className = \"MapObject\";\r\n // Set defaults\r\n _this.isMeasured = false;\r\n _this.layout = \"none\";\r\n _this.clickable = true;\r\n // Apply theme\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * (Re)validates this object, forcing it to redraw.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n MapObject.prototype.validate = function () {\r\n if (this.series && this.series.itemReaderText) {\r\n this.readerTitle = this.series.itemReaderText;\r\n }\r\n _super.prototype.validate.call(this);\r\n };\r\n /**\r\n * Updates the item's bounding coordinates: coordinates of the East, West,\r\n * North, and South-most points.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n MapObject.prototype.updateExtremes = function () {\r\n var feature = this.getFeature();\r\n if (feature) {\r\n var geometry = feature.geometry;\r\n if (geometry) {\r\n var bounds = d3geo.geoBounds(geometry);\r\n var west = bounds[0][0];\r\n var south = bounds[0][1];\r\n var north = bounds[1][1];\r\n var east = bounds[1][0];\r\n var changed = false;\r\n if (north != this.north) {\r\n this._north = $math.round(north, 8);\r\n changed = true;\r\n }\r\n if (south != this.south) {\r\n this._south = $math.round(south);\r\n changed = true;\r\n }\r\n if (east != this.east) {\r\n this._east = $math.round(east);\r\n changed = true;\r\n }\r\n if (west != this.west) {\r\n this._west = $math.round(west);\r\n changed = true;\r\n }\r\n if (changed) {\r\n this.dispatch(\"geoBoundsChanged\");\r\n if (this.series) {\r\n this.series.invalidateDataItems();\r\n }\r\n }\r\n }\r\n }\r\n };\r\n /**\r\n * @ignore\r\n */\r\n MapObject.prototype.getFeature = function () {\r\n return {};\r\n };\r\n Object.defineProperty(MapObject.prototype, \"east\", {\r\n /**\r\n * Longitude of the East-most point of the element.\r\n */\r\n get: function () {\r\n if ($type.isNumber(this._east)) {\r\n return this._east;\r\n }\r\n else if (this.dataItem) {\r\n return this.dataItem.east;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapObject.prototype, \"west\", {\r\n /**\r\n * Longitude of the West-most point of the element.\r\n */\r\n get: function () {\r\n if ($type.isNumber(this._west)) {\r\n return this._west;\r\n }\r\n else if (this.dataItem) {\r\n return this.dataItem.west;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapObject.prototype, \"south\", {\r\n /**\r\n * Latitude of the South-most point of the element.\r\n */\r\n get: function () {\r\n if ($type.isNumber(this._south)) {\r\n return this._south;\r\n }\r\n else if (this.dataItem) {\r\n return this.dataItem.south;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapObject.prototype, \"north\", {\r\n /**\r\n * Latitude of the North-most point of the element.\r\n */\r\n get: function () {\r\n if ($type.isNumber(this._north)) {\r\n return this._north;\r\n }\r\n else if (this.dataItem) {\r\n return this.dataItem.north;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Shows the element's [[Tooltip]].\r\n *\r\n * A tooltip will be populated using text templates in either `tooltipHTML` or\r\n * `tooltipText` as well as data in `tooltipDataItem`.\r\n *\r\n * @see {@link Tooltip}\r\n * @param optional point (sprite-related) to which tooltip must point.\r\n * @return returns true if the tooltip was shown and false if it wasn't (no text was found)\r\n */\r\n MapObject.prototype.showTooltip = function (point) {\r\n var res = _super.prototype.showTooltip.call(this, point);\r\n if (res && this.showTooltipOn == \"always\" && !this.series.chart.events.has(\"mappositionchanged\", this.handleTooltipMove, this)) {\r\n this.addDisposer(this.series.chart.events.on(\"mappositionchanged\", this.handleTooltipMove, this));\r\n }\r\n return res;\r\n };\r\n MapObject.prototype.handleTooltipMove = function (ev) {\r\n if (!this.tooltip.isHidden) {\r\n this.showTooltip();\r\n }\r\n };\r\n /**\r\n * Sets a [[DataItem]].\r\n * @param dataItem DataItem\r\n */\r\n MapObject.prototype.setDataItem = function (dataItem) {\r\n _super.prototype.setDataItem.call(this, dataItem);\r\n this.applyAccessibility();\r\n };\r\n return MapObject;\r\n}(Container));\r\nexport { MapObject };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"MapObject\"] = MapObject;\r\n","/**\r\n * Map polygon module\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { MapObject } from \"./MapObject\";\r\nimport { Polygon } from \"../../core/elements/Polygon\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport * as $type from \"../../core/utils/Type\";\r\nimport { InterfaceColorSet } from \"../../core/utils/InterfaceColorSet\";\r\nimport $polylabel from \"polylabel\";\r\nimport * as $mapUtils from \"./MapUtils\";\r\nimport * as d3geo from \"d3-geo\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Used to draw a polygon on the map.\r\n *\r\n * @see {@link IMapPolygonEvents} for a list of available events\r\n * @see {@link IMapPolygonAdapters} for a list of available Adapters\r\n */\r\nvar MapPolygon = /** @class */ (function (_super) {\r\n __extends(MapPolygon, _super);\r\n /**\r\n * Constructor\r\n */\r\n function MapPolygon() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"MapPolygon\";\r\n _this.polygon = _this.createChild(Polygon);\r\n _this.polygon.shouldClone = false;\r\n _this.polygon.applyOnClones = true;\r\n _this.setPropertyValue(\"precision\", 0.5);\r\n var interfaceColors = new InterfaceColorSet();\r\n _this.fill = interfaceColors.getFor(\"secondaryButton\");\r\n _this.stroke = interfaceColors.getFor(\"secondaryButtonStroke\");\r\n _this.strokeOpacity = 1;\r\n _this.tooltipPosition = \"pointer\";\r\n _this.nonScalingStroke = true;\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * @ignore\r\n */\r\n MapPolygon.prototype.getFeature = function () {\r\n if (this.multiPolygon && this.multiPolygon.length > 0) {\r\n return { \"type\": \"Feature\", geometry: { type: \"MultiPolygon\", coordinates: this.multiPolygon } };\r\n }\r\n };\r\n Object.defineProperty(MapPolygon.prototype, \"multiGeoPolygon\", {\r\n /**\r\n * @return Polygon coordinates\r\n */\r\n get: function () {\r\n var multiGeoPolygon = this.getPropertyValue(\"multiGeoPolygon\");\r\n if (!multiGeoPolygon && this.dataItem) {\r\n multiGeoPolygon = this.dataItem.multiGeoPolygon;\r\n }\r\n return multiGeoPolygon;\r\n },\r\n /**\r\n * Set of coordinates for the polygon.\r\n *\r\n * @param multiGeoPolygon Polygon coordinates\r\n */\r\n set: function (multiGeoPolygon) {\r\n this.setPropertyValue(\"multiGeoPolygon\", multiGeoPolygon, true);\r\n this.multiPolygon = $mapUtils.multiGeoPolygonToMultipolygon(multiGeoPolygon);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapPolygon.prototype, \"multiPolygon\", {\r\n /**\r\n * @return Coordinates\r\n */\r\n get: function () {\r\n var multiPolygon = this.getPropertyValue(\"multiPolygon\");\r\n if (!multiPolygon && this.dataItem) {\r\n multiPolygon = this.dataItem.multiPolygon;\r\n }\r\n return multiPolygon;\r\n },\r\n /**\r\n * A collection of X/Y coordinates for a multi-part polygon. E.g.:\r\n *\r\n * ```JSON\r\n * [\r\n * // Part 1\r\n * [\r\n * [\r\n * [ 100, 150 ],\r\n * [ 120, 200 ],\r\n * [ 150, 220 ],\r\n * [ 170, 240 ],\r\n * [ 100, 150 ]\r\n * ]\r\n * ],\r\n *\r\n * // Part 2\r\n * [\r\n * [\r\n * [ 300, 350 ],\r\n * [ 320, 400 ],\r\n * [ 350, 420 ],\r\n * [ 370, 440 ],\r\n * [ 300, 350 ]\r\n * ]\r\n * ]\r\n * ]\r\n * ```\r\n *\r\n * @param multiPolygon Coordinates\r\n */\r\n set: function (multiPolygon) {\r\n if (this.setPropertyValue(\"multiPolygon\", multiPolygon)) {\r\n this.updateExtremes();\r\n this.invalidate();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * (Re)validates the polygon, effectively redrawing it.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n MapPolygon.prototype.validate = function () {\r\n if (this.series) {\r\n var projection = this.series.chart.projection;\r\n var pathGenerator = projection.d3Path;\r\n if (this.multiPolygon) {\r\n if (this.series) {\r\n var feature = { type: \"MultiPolygon\", coordinates: this.multiPolygon };\r\n projection.d3Projection.precision(this.precision);\r\n this.polygon.path = pathGenerator(feature);\r\n }\r\n if (this.series.calculateVisualCenter) {\r\n var biggestArea = 0;\r\n var biggestPolygon = this.multiPolygon[0];\r\n if (this.multiPolygon.length > 1) {\r\n for (var i = 0; i < this.multiPolygon.length; i++) {\r\n var polygon = this.multiPolygon[i];\r\n var area = d3geo.geoArea({ type: \"Polygon\", coordinates: polygon });\r\n if (area > biggestArea) {\r\n biggestPolygon = polygon;\r\n biggestArea = area;\r\n }\r\n }\r\n }\r\n var center = $polylabel(biggestPolygon);\r\n this._visualLongitude = center[0];\r\n this._visualLatitude = center[1];\r\n }\r\n else {\r\n this._visualLongitude = this.longitude;\r\n this._visualLatitude = this.latitude;\r\n }\r\n }\r\n }\r\n _super.prototype.validate.call(this);\r\n };\r\n /**\r\n * @ignore Exclude from docs\r\n */\r\n MapPolygon.prototype.measureElement = function () {\r\n // Overriding, just to avoid extra measure\r\n };\r\n Object.defineProperty(MapPolygon.prototype, \"latitude\", {\r\n /**\r\n * Latitude of the geometrical center of the polygon.\r\n *\r\n * @readonly\r\n * @return Center latitude\r\n */\r\n get: function () {\r\n return this.north + (this.south - this.north) / 2;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapPolygon.prototype, \"longitude\", {\r\n /**\r\n * Longitude of the geometrical center of the polygon.\r\n *\r\n * @readonly\r\n * @return Center longitude\r\n */\r\n get: function () {\r\n return this.east + (this.west - this.east) / 2;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapPolygon.prototype, \"visualLatitude\", {\r\n /**\r\n * @return Latitude\r\n */\r\n get: function () {\r\n var latitude = this.getPropertyValue(\"visualLatitude\");\r\n if ($type.isNumber(latitude)) {\r\n return (latitude);\r\n }\r\n if (!this._adapterO) {\r\n return this._visualLatitude;\r\n }\r\n else {\r\n return this._adapterO.apply(\"visualLatitude\", this._visualLatitude);\r\n }\r\n },\r\n /**\r\n * Latitude of the visual center of the polygon.\r\n *\r\n * It may (and probably won't) coincide with geometrical center.\r\n *\r\n * @since 4.3.0\r\n * @param value Latitude\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"visualLatitude\", value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapPolygon.prototype, \"visualLongitude\", {\r\n /**\r\n * @return Longitude\r\n */\r\n get: function () {\r\n var longitude = this.getPropertyValue(\"visualLongitude\");\r\n if ($type.isNumber(longitude)) {\r\n return (longitude);\r\n }\r\n if (!this._adapterO) {\r\n return this._visualLongitude;\r\n }\r\n else {\r\n return this._adapterO.apply(\"visualLongitude\", this._visualLongitude);\r\n }\r\n },\r\n /**\r\n * Longitude of the visual center of the polygon.\r\n *\r\n * It may (and probably won't) coincide with geometrical center.\r\n *\r\n * @since 4.3.0\r\n * @param value Longitude\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"visualLongitude\", value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapPolygon.prototype, \"pixelWidth\", {\r\n /**\r\n * Not 100% sure about this, as if we add something to MapPolygon this\r\n * won't be true, but otherwise we will get all 0 and the tooltip won't\r\n * be positioned properly\r\n * @hidden\r\n */\r\n /**\r\n * Element's width in pixels.\r\n *\r\n * @readonly\r\n * @return Width (px)\r\n */\r\n get: function () {\r\n return this.polygon.pixelWidth;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapPolygon.prototype, \"pixelHeight\", {\r\n /**\r\n * Element's height in pixels.\r\n *\r\n * @readonly\r\n * @return Width (px)\r\n */\r\n get: function () {\r\n return this.polygon.pixelHeight;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Copies all properties from another instance of [[MapPolygon]].\r\n *\r\n * @param source Source series\r\n */\r\n MapPolygon.prototype.copyFrom = function (source) {\r\n _super.prototype.copyFrom.call(this, source);\r\n this.polygon.copyFrom(source.polygon);\r\n };\r\n /**\r\n * @ignore\r\n */\r\n MapPolygon.prototype.updateExtremes = function () {\r\n _super.prototype.updateExtremes.call(this);\r\n };\r\n Object.defineProperty(MapPolygon.prototype, \"boxArea\", {\r\n /**\r\n * @ignore\r\n * used to sorth polygons from big to small\r\n */\r\n get: function () {\r\n return (this.north - this.south) * (this.east - this.west);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * X coordinate for the slice tooltip.\r\n *\r\n * @ignore\r\n * @return X\r\n */\r\n MapPolygon.prototype.getTooltipX = function () {\r\n return this.series.chart.projection.convert({ longitude: this.visualLongitude, latitude: this.visualLatitude }).x;\r\n };\r\n /**\r\n * Y coordinate for the slice tooltip.\r\n *\r\n * @ignore\r\n * @return Y\r\n */\r\n MapPolygon.prototype.getTooltipY = function () {\r\n return this.series.chart.projection.convert({ longitude: this.visualLongitude, latitude: this.visualLatitude }).y;\r\n };\r\n Object.defineProperty(MapPolygon.prototype, \"precision\", {\r\n get: function () {\r\n return this.getPropertyValue(\"precision\");\r\n },\r\n /**\r\n * When polygon's sides are plotted, they are bent according to the used\r\n * projection.\r\n *\r\n * `precision` introduces a setting which can control when such bending\r\n * occurs.\r\n *\r\n * If the distance (in degrees) between two points of polygon's side is less\r\n * than `precision`, no bending will take place and the line will be straight.\r\n *\r\n * Set to large number (e.g. 10000) for perfectly straight lines on all\r\n * polygon's sides.\r\n *\r\n * @since 4.9.1\r\n * @default 0.5\r\n * @param value Precision\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"precision\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return MapPolygon;\r\n}(MapObject));\r\nexport { MapPolygon };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"MapPolygon\"] = MapPolygon;\r\n","/**\r\n * Map polygon series module\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { MapSeries, MapSeriesDataItem } from \"./MapSeries\";\r\nimport { MapPolygon } from \"./MapPolygon\";\r\nimport { ListTemplate, ListDisposer } from \"../../core/utils/List\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport * as $mapUtils from \"./MapUtils\";\r\nimport * as $array from \"../../core/utils/Array\";\r\nimport * as $utils from \"../../core/utils/Utils\";\r\nimport * as $iter from \"../../core/utils/Iterator\";\r\nimport { Disposer } from \"../../core/utils/Disposer\";\r\n/**\r\n * ============================================================================\r\n * DATA ITEM\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Defines a [[DataItem]] for [[MapPolygonSeries]]\r\n * @see {@link DataItem}\r\n */\r\nvar MapPolygonSeriesDataItem = /** @class */ (function (_super) {\r\n __extends(MapPolygonSeriesDataItem, _super);\r\n /**\r\n * Constructor\r\n */\r\n function MapPolygonSeriesDataItem() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"MapPolygonSeriesDataItem\";\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * @ignore\r\n */\r\n MapPolygonSeriesDataItem.prototype.getFeature = function () {\r\n if (this.multiPolygon && this.multiPolygon.length > 0) {\r\n return { \"type\": \"Feature\", geometry: { type: \"MultiPolygon\", coordinates: this.multiPolygon } };\r\n }\r\n };\r\n Object.defineProperty(MapPolygonSeriesDataItem.prototype, \"mapPolygon\", {\r\n /**\r\n * A [[MapPolygon]] element related to this data item.\r\n *\r\n * @readonly\r\n * @return Element\r\n */\r\n get: function () {\r\n var _this = this;\r\n if (!this._mapPolygon) {\r\n var mapPolygon_1 = this.component.mapPolygons.create();\r\n this._mapPolygon = mapPolygon_1;\r\n this.addSprite(mapPolygon_1);\r\n this._disposers.push(new Disposer(function () {\r\n if (_this.component) {\r\n _this.component.mapPolygons.removeValue(mapPolygon_1);\r\n }\r\n }));\r\n this.mapObject = mapPolygon_1;\r\n }\r\n return this._mapPolygon;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapPolygonSeriesDataItem.prototype, \"polygon\", {\r\n /**\r\n * @return Coordinates\r\n */\r\n get: function () {\r\n return this._polygon;\r\n },\r\n /**\r\n * A collection of X/Y coordinates for a single polygon. E.g.:\r\n *\r\n * ```JSON\r\n * [\r\n * [\r\n * [ 100, 150 ],\r\n * [ 120, 200 ],\r\n * [ 150, 200 ],\r\n * [ 170, 240 ],\r\n * [ 100, 150 ]\r\n * ]\r\n * ]\r\n * ```\r\n *\r\n * @param polygon Coordinates\r\n */\r\n set: function (polygon) {\r\n this._polygon = polygon;\r\n this.multiPolygon = [polygon];\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapPolygonSeriesDataItem.prototype, \"multiPolygon\", {\r\n /**\r\n * @return Coordinates\r\n */\r\n get: function () {\r\n return this._multiPolygon;\r\n },\r\n /**\r\n * A collection of X/Y coordinates for a multi-part polygon. E.g.:\r\n *\r\n * ```JSON\r\n * [\r\n * // Part 1\r\n * [\r\n * [\r\n * [ 100, 150 ],\r\n * [ 120, 200 ],\r\n * [ 150, 220 ],\r\n * [ 170, 240 ],\r\n * [ 100, 150 ]\r\n * ]\r\n * ],\r\n *\r\n * // Part 2\r\n * [\r\n * [\r\n * [ 300, 350 ],\r\n * [ 320, 400 ],\r\n * [ 350, 420 ],\r\n * [ 370, 440 ],\r\n * [ 300, 350 ]\r\n * ]\r\n * ]\r\n * ]\r\n * ```\r\n *\r\n * @param multiPolygon Coordinates\r\n */\r\n set: function (multiPolygon) {\r\n this._multiPolygon = multiPolygon;\r\n this.updateExtremes();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapPolygonSeriesDataItem.prototype, \"geoPolygon\", {\r\n /**\r\n * @return Coordinates\r\n */\r\n get: function () {\r\n return this._geoPolygon;\r\n },\r\n /**\r\n * A collection of lat/long coordinates for a single polygon. E.g.:\r\n *\r\n * ```JSON\r\n * [\r\n * [\r\n * { latitude: -10.0, longitude: -10.0 },\r\n * { latitude: 10.0, longitude: -10.0 },\r\n * { latitude: 10.0, longitude: 10.0 },\r\n * { latitude: -10.0, longitude: -10.0 }\r\n * ]\r\n * ]\r\n * ```\r\n *\r\n * @see {@link https://tools.ietf.org/html/rfc7946#section-3.1.6} GeoJSON Polygon reference\r\n * @param geoPolygon Coordinates\r\n */\r\n set: function (geoPolygon) {\r\n this._geoPolygon = geoPolygon;\r\n this.multiGeoPolygon = [geoPolygon];\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapPolygonSeriesDataItem.prototype, \"multiGeoPolygon\", {\r\n /**\r\n * @return Coordinates\r\n */\r\n get: function () {\r\n return this._multiGeoPolygon;\r\n },\r\n /**\r\n * A collection of lat/long coordinates for a multi-part polygon. E.g.:\r\n *\r\n * ```JSON\r\n * [\r\n * [\r\n * [\r\n * { longitude: 180.0, latitude: 40.0 },\r\n * { longitude: 180.0, latitude: 50.0 },\r\n * { longitude: 170.0, latitude: 50.0 },\r\n * { longitude: 170.0, latitude: 40.0 },\r\n * { longitude: 180.0, latitude: 40.0 }\r\n * ]\r\n * ],\r\n * [\r\n * [\r\n * { longitude: -170.0, latitude: 40.0 },\r\n * { longitude: -170.0, latitude: 50.0 },\r\n * { longitude: -180.0, latitude: 50.0 },\r\n * { longitude: -180.0, latitude: 40.0 },\r\n * { longitude: -170.0, latitude: 40.0 }\r\n * ]\r\n * ]\r\n * ]\r\n * ```\r\n *\r\n * @see {@link https://tools.ietf.org/html/rfc7946#section-3.1.7} GeoJSON MultiPolygon reference\r\n * @param multiGeoPolygon Coordinates\r\n */\r\n set: function (multiGeoPolygon) {\r\n this._multiGeoPolygon = multiGeoPolygon;\r\n this.multiPolygon = $mapUtils.multiGeoPolygonToMultipolygon(multiGeoPolygon);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return MapPolygonSeriesDataItem;\r\n}(MapSeriesDataItem));\r\nexport { MapPolygonSeriesDataItem };\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * A series of map polygon elements.\r\n *\r\n * @see {@link IMapPolygonSeriesEvents} for a list of available Events\r\n * @see {@link IMapPolygonSeriesAdapters} for a list of available Adapters\r\n * @important\r\n */\r\nvar MapPolygonSeries = /** @class */ (function (_super) {\r\n __extends(MapPolygonSeries, _super);\r\n /**\r\n * Constructor\r\n */\r\n function MapPolygonSeries() {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n /**\r\n * Indicates if series should automatically calculate visual center of the\r\n * polygons (accessible via `visualLongitude` and `visualLatitude` properties\r\n * of the [[MapPolygon]]).\r\n *\r\n * @default false\r\n * @since 4.3.0\r\n */\r\n _this.calculateVisualCenter = false;\r\n _this.className = \"MapPolygonSeries\";\r\n // Set data fields\r\n _this.dataFields.multiPolygon = \"multiPolygon\";\r\n _this.dataFields.polygon = \"polygon\";\r\n _this.dataFields.geoPolygon = \"geoPolygon\";\r\n _this.dataFields.multiGeoPolygon = \"multiGeoPolygon\";\r\n _this.setPropertyValue(\"sortPolygonsBy\", \"area\");\r\n _this.setPropertyValue(\"sortPolygonsReversed\", false);\r\n // Apply theme\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Returns a new/empty DataItem of the type appropriate for this object.\r\n *\r\n * @see {@link DataItem}\r\n * @return Data Item\r\n */\r\n MapPolygonSeries.prototype.createDataItem = function () {\r\n return new MapPolygonSeriesDataItem();\r\n };\r\n /**\r\n * @ignore\r\n */\r\n MapPolygonSeries.prototype.processIncExc = function () {\r\n this.mapPolygons.clear();\r\n _super.prototype.processIncExc.call(this);\r\n };\r\n /**\r\n * (Re)validates series data, effectively causing the whole series to be\r\n * redrawn.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n MapPolygonSeries.prototype.validateData = function () {\r\n // process geoJSON and created map objects\r\n if (this.useGeodata || this.geodata) {\r\n var geoJSON = !this._dataSources[\"geodata\"] ? this.chart.geodata : undefined;\r\n if (this.geodata) {\r\n geoJSON = this.geodata;\r\n }\r\n if (geoJSON) {\r\n var features = void 0;\r\n if (geoJSON.type == \"FeatureCollection\") {\r\n features = geoJSON.features;\r\n }\r\n else if (geoJSON.type == \"Feature\") {\r\n features = [geoJSON];\r\n }\r\n else if ([\"Point\", \"LineString\", \"Polygon\", \"MultiPoint\", \"MultiLineString\", \"MultiPolygon\"].indexOf(geoJSON.type) != -1) {\r\n features = [{ geometry: geoJSON }];\r\n }\r\n else {\r\n console.log(\"nothing found in geoJSON\");\r\n }\r\n if (features) {\r\n var _loop_1 = function (i, len) {\r\n var feature = features[i];\r\n var geometry = feature.geometry;\r\n if (geometry) {\r\n var type = geometry.type;\r\n var id_1 = feature.id;\r\n if (this_1.chart.geodataNames && this_1.chart.geodataNames[id_1]) {\r\n feature.properties.name = this_1.chart.geodataNames[id_1];\r\n }\r\n if (type == \"Polygon\" || type == \"MultiPolygon\") {\r\n if (!this_1.checkInclude(this_1.include, this_1.exclude, id_1)) {\r\n return \"continue\";\r\n }\r\n var coordinates = geometry.coordinates;\r\n if (coordinates) {\r\n // make the same as MultiPolygon\r\n if (type == \"Polygon\") {\r\n coordinates = [coordinates];\r\n }\r\n }\r\n // find data object in user-provided data\r\n var dataObject = $array.find(this_1.data, function (value, i) {\r\n return value.id == id_1;\r\n });\r\n // create one if not found\r\n if (!dataObject) {\r\n dataObject = { multiPolygon: coordinates, id: id_1, madeFromGeoData: true };\r\n this_1.data.push(dataObject);\r\n }\r\n // in case found\r\n else {\r\n // if user-provided object doesn't have points data provided in any way:\r\n if (!dataObject.multiPolygon) {\r\n dataObject.multiPolygon = coordinates;\r\n }\r\n }\r\n // copy properties data to datacontext\r\n $utils.softCopyProperties(feature.properties, dataObject);\r\n }\r\n }\r\n };\r\n var this_1 = this;\r\n for (var i = 0, len = features.length; i < len; i++) {\r\n _loop_1(i, len);\r\n }\r\n }\r\n }\r\n }\r\n _super.prototype.validateData.call(this);\r\n };\r\n /**\r\n * (Re)validates the series\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n MapPolygonSeries.prototype.validate = function () {\r\n _super.prototype.validate.call(this);\r\n this.dataItems.each(function (dataItem) {\r\n $utils.used(dataItem.mapPolygon);\r\n });\r\n if (this.sortPolygonsBy != \"none\") {\r\n var sortBy_1 = this.sortPolygonsBy;\r\n var reversed_1 = this.sortPolygonsReversed;\r\n this.mapPolygons.sort(function (a, b) {\r\n var valA = \"\";\r\n var valB = \"\";\r\n var dirA = -1;\r\n var dirB = 1;\r\n switch (sortBy_1) {\r\n case \"area\":\r\n valA = a.boxArea;\r\n valB = b.boxArea;\r\n dirA = -1;\r\n dirB = 1;\r\n break;\r\n case \"name\":\r\n valA = a.dataItem.dataContext.name || \"\";\r\n valB = b.dataItem.dataContext.name || \"\";\r\n dirA = 1;\r\n dirB = -1;\r\n break;\r\n case \"id\":\r\n valA = a.dataItem.dataContext.id || \"\";\r\n valB = b.dataItem.dataContext.id || \"\";\r\n dirA = 1;\r\n dirB = -1;\r\n break;\r\n case \"latitude\":\r\n valA = reversed_1 ? a.south : a.north;\r\n valB = reversed_1 ? b.south : b.north;\r\n dirA = -1;\r\n dirB = 1;\r\n break;\r\n case \"longitude\":\r\n valA = reversed_1 ? a.east : a.west;\r\n valB = reversed_1 ? b.east : b.west;\r\n dirA = 1;\r\n dirB = -1;\r\n break;\r\n }\r\n if (valA < valB) {\r\n return reversed_1 ? dirB : dirA;\r\n }\r\n if (valA > valB) {\r\n return reversed_1 ? dirA : dirB;\r\n }\r\n return 0;\r\n });\r\n this.mapPolygons.each(function (mapPolygon, index) {\r\n mapPolygon.validate();\r\n // makes small go first to avoid hover problems with IE\r\n if (!mapPolygon.zIndex && !mapPolygon.propertyFields.zIndex) {\r\n mapPolygon.zIndex = 1000000 - index;\r\n }\r\n });\r\n }\r\n };\r\n Object.defineProperty(MapPolygonSeries.prototype, \"mapPolygons\", {\r\n /**\r\n * List of polygon elements in the series.\r\n *\r\n * @return Polygon list\r\n */\r\n get: function () {\r\n if (!this._mapPolygons) {\r\n var polygonTemplate = new MapPolygon();\r\n var mapPolygons = new ListTemplate(polygonTemplate);\r\n this._disposers.push(new ListDisposer(mapPolygons));\r\n this._disposers.push(mapPolygons.template);\r\n mapPolygons.template.focusable = true;\r\n mapPolygons.events.on(\"inserted\", this.handleObjectAdded, this, false);\r\n this._mapPolygons = mapPolygons;\r\n this._mapObjects = mapPolygons;\r\n }\r\n return this._mapPolygons;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * returns MapPolygon by id in geoJSON file\r\n * @param polygon id\r\n * @return {MapPolygon}\r\n */\r\n MapPolygonSeries.prototype.getPolygonById = function (id) {\r\n return $iter.find(this.mapPolygons.iterator(), function (mapPolygon) {\r\n var dataContext = mapPolygon.dataItem.dataContext;\r\n return dataContext.id == id;\r\n });\r\n };\r\n /**\r\n * Copies all properties from another instance of [[Series]].\r\n *\r\n * @param source Source series\r\n */\r\n MapPolygonSeries.prototype.copyFrom = function (source) {\r\n this.mapPolygons.template.copyFrom(source.mapPolygons.template);\r\n _super.prototype.copyFrom.call(this, source);\r\n };\r\n /**\r\n * @ignore\r\n */\r\n MapPolygonSeries.prototype.getFeatures = function () {\r\n var _this = this;\r\n var features = [];\r\n this.dataItems.each(function (dataItem) {\r\n var feature = dataItem.getFeature();\r\n if (feature) {\r\n features.push(feature);\r\n }\r\n });\r\n this.mapPolygons.each(function (mapPolygon) {\r\n if (_this.dataItems.indexOf(mapPolygon._dataItem) == -1) {\r\n var feature = mapPolygon.getFeature();\r\n if (feature) {\r\n features.push(feature);\r\n }\r\n }\r\n });\r\n return features;\r\n };\r\n Object.defineProperty(MapPolygonSeries.prototype, \"sortPolygonsBy\", {\r\n /**\r\n * @return How to sort map polygons\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"sortPolygonsBy\");\r\n },\r\n /**\r\n * How to order polygons in actual SVG document. Affects selection order\r\n * using TAB key.\r\n *\r\n * Available options: `\"area\"` (default), `\"name\"`, `\"longitude\"`,\r\n * `\"latitude\"`, `\"id\"`, and `\"none\"`.\r\n *\r\n * @default area\r\n * @since 4.9.36\r\n * @param value How to sort map polygons\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"sortPolygonsBy\", value)) {\r\n this.invalidateData();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapPolygonSeries.prototype, \"sortPolygonsReversed\", {\r\n /**\r\n * @return Reverse polygon sort direction\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"sortPolygonsReversed\");\r\n },\r\n /**\r\n * If `sortPolygonsBy` is set to something other than `\"none\"`, polygons\r\n * will be sorted by the given parameter, using natural sort direction.\r\n *\r\n * Setting `sortPolygonsReversed = true` will reverse this direction.\r\n *\r\n * @default false\r\n * @since 4.9.36\r\n * @param value Reverse polygon sort direction\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"sortPolygonsReversed\", value)) {\r\n this.invalidateData();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return MapPolygonSeries;\r\n}(MapSeries));\r\nexport { MapPolygonSeries };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"MapPolygonSeries\"] = MapPolygonSeries;\r\nregistry.registeredClasses[\"MapPolygonSeriesDataItem\"] = MapPolygonSeriesDataItem;\r\n","/**\r\n * Map series module\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Series, SeriesDataItem } from \"../series/Series\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport * as $type from \"../../core/utils/Type\";\r\nimport * as $math from \"../../core/utils/Math\";\r\nimport * as d3geo from \"d3-geo\";\r\n/**\r\n * ============================================================================\r\n * DATA ITEM\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Defines a [[DataItem]] for [[MapSeries]].\r\n *\r\n * @see {@link DataItem}\r\n */\r\nvar MapSeriesDataItem = /** @class */ (function (_super) {\r\n __extends(MapSeriesDataItem, _super);\r\n /**\r\n * Constructor\r\n */\r\n function MapSeriesDataItem() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"MapSeriesDataItem\";\r\n _this.values.value = {};\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n Object.defineProperty(MapSeriesDataItem.prototype, \"value\", {\r\n /**\r\n * @return Value\r\n */\r\n get: function () {\r\n return this.values.value.value;\r\n },\r\n /**\r\n * Numeric value of the data item.\r\n *\r\n * Value may be used in heat-map calculations.\r\n *\r\n * @param value Value\r\n */\r\n set: function (value) {\r\n this.setValue(\"value\", value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapSeriesDataItem.prototype, \"zoomLevel\", {\r\n /**\r\n * @return Zoom level\r\n */\r\n get: function () {\r\n return this.properties[\"zoomLevel\"];\r\n },\r\n /**\r\n * When `zoomToMapObject()` is called the map will either calculate suitable\r\n * zoom level itself or use object's `zoomLevel` if set.\r\n *\r\n * @param value Zoom level\r\n */\r\n set: function (value) {\r\n this.setProperty(\"zoomLevel\", value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapSeriesDataItem.prototype, \"zoomGeoPoint\", {\r\n /**\r\n * @return Zoom geo point\r\n */\r\n get: function () {\r\n return this.properties[\"zoomGeoPoint\"];\r\n },\r\n /**\r\n * When `zoomToMapObject()` is called the map will either calculate suitable\r\n * center position itself or use object's `zoomGeoPoint` if set.\r\n *\r\n * @param value Zoom geo point\r\n */\r\n set: function (value) {\r\n this.setProperty(\"zoomGeoPoint\", value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapSeriesDataItem.prototype, \"east\", {\r\n /**\r\n * Longitude of the East-most point of the element.\r\n */\r\n get: function () {\r\n return this._east;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapSeriesDataItem.prototype, \"west\", {\r\n /**\r\n * Longitude of the West-most point of the element.\r\n */\r\n get: function () {\r\n return this._west;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapSeriesDataItem.prototype, \"south\", {\r\n /**\r\n * Latitude of the South-most point of the element.\r\n */\r\n get: function () {\r\n return this._south;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapSeriesDataItem.prototype, \"north\", {\r\n /**\r\n * Latitude of the North-most point of the element.\r\n */\r\n get: function () {\r\n return this._north;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Updates the item's bounding coordinates: coordinates of the East, West,\r\n * North, and South-most points.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n MapSeriesDataItem.prototype.updateExtremes = function () {\r\n var geometry = this.getFeature().geometry;\r\n if (geometry) {\r\n var bounds = d3geo.geoBounds(geometry);\r\n var west = bounds[0][0];\r\n var south = bounds[0][1];\r\n var north = bounds[1][1];\r\n var east = bounds[1][0];\r\n var changed = false;\r\n if (north != this.north) {\r\n this._north = $math.round(north, 6);\r\n changed = true;\r\n }\r\n if (south != this.south) {\r\n this._south = $math.round(south, 6);\r\n changed = true;\r\n }\r\n if (east != this.east) {\r\n this._east = $math.round(east, 6);\r\n changed = true;\r\n }\r\n if (west != this.west) {\r\n this._west = $math.round(west, 6);\r\n changed = true;\r\n }\r\n // solves single russia prob\r\n if (this._east < this._west) {\r\n this._east = 180;\r\n this._west = -180;\r\n }\r\n if (changed) {\r\n this.component.invalidateDataItems();\r\n }\r\n }\r\n };\r\n MapSeriesDataItem.prototype.getFeature = function () {\r\n return {};\r\n };\r\n return MapSeriesDataItem;\r\n}(SeriesDataItem));\r\nexport { MapSeriesDataItem };\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * A base class for series of map objects.\r\n *\r\n * @see {@link IMapSeriesEvents} for a list of available Events\r\n * @see {@link IMapSeriesAdapters} for a list of available Adapters\r\n * @important\r\n */\r\nvar MapSeries = /** @class */ (function (_super) {\r\n __extends(MapSeries, _super);\r\n /**\r\n * Constructor\r\n */\r\n function MapSeries() {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n _this.className = \"MapSeries\";\r\n // Set defaults\r\n _this.isMeasured = false;\r\n _this.nonScalingStroke = true;\r\n // Set data fields\r\n _this.dataFields.value = \"value\";\r\n _this.ignoreBounds = false;\r\n if (_this.tooltip) {\r\n _this.tooltip.showInViewport = true;\r\n }\r\n // Apply theme\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Returns a new/empty DataItem of the type appropriate for this object.\r\n *\r\n * @see {@link DataItem}\r\n * @return Data Item\r\n */\r\n MapSeries.prototype.createDataItem = function () {\r\n return new MapSeriesDataItem();\r\n };\r\n /**\r\n * Checks whether object should be included in series.\r\n *\r\n * @param includes A list of explicitly included ids\r\n * @param excludes A list of explicitly excluded ids\r\n * @param id Id of the object\r\n * @return Include?\r\n */\r\n MapSeries.prototype.checkInclude = function (includes, excludes, id) {\r\n if (includes) {\r\n if (includes.length == 0) {\r\n return false;\r\n }\r\n else {\r\n if (includes.indexOf(id) == -1) {\r\n return false;\r\n }\r\n }\r\n }\r\n if (excludes && excludes.length > 0) {\r\n if (excludes.indexOf(id) != -1) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n };\r\n Object.defineProperty(MapSeries.prototype, \"useGeodata\", {\r\n /**\r\n * @return Use GeoJSON data?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"useGeodata\");\r\n },\r\n /**\r\n * Should the map extract all the data about element from the GeoJSON?\r\n *\r\n * This is especially relevant for [[MapPolygonSeries]]. If not set to `true`\r\n * polygon series will need to contain geographical data in itself in order\r\n * to be drawn.\r\n *\r\n * If this is set to `true`, series will try to extract data for its objects\r\n * from either chart-level `geodata` or from series' `geodata` which holds\r\n * map infor in GeoJSON format.\r\n *\r\n * @default false\r\n * @param value Use GeoJSON data?\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"useGeodata\", value)) {\r\n this.invalidateData();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapSeries.prototype, \"include\", {\r\n /**\r\n * @return Included objects\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"include\");\r\n },\r\n /**\r\n * A list of object ids that should be explictly included in the series.\r\n *\r\n * If this is not set, the series will automatically include all of the\r\n * objects, available in the GeoJSON map. (minus the ones listed in\r\n * `exclude`)\r\n *\r\n * If you need to display only specific objects, use `include`. E.g.:\r\n *\r\n * `include = [\"FR\", \"ES\", \"DE\"];`\r\n *\r\n * The above will show only France, Spain, and Germany out of the whole map.\r\n *\r\n * @param value Included objects\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"include\", value)) {\r\n this.processIncExc();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * @ignore\r\n */\r\n MapSeries.prototype.processIncExc = function () {\r\n //this.data = [];\r\n this.invalidateData();\r\n };\r\n Object.defineProperty(MapSeries.prototype, \"ignoreBounds\", {\r\n /**\r\n * @return Ignore bounds?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"ignoreBounds\");\r\n },\r\n /**\r\n * Should this series be included when calculating bounds of the map?\r\n *\r\n * This affects initial zoom as well as limits for zoom/pan.\r\n *\r\n * By default, `MapPolygonSeries` included (true), while `MapImageSeries` and\r\n * `MapLineSeries` are not (`false`).\r\n *\r\n * @since 4.3.0\r\n * @param value Ignore bounds?\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"ignoreBounds\", value)) {\r\n if (this.chart) {\r\n this.chart.updateExtremes();\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapSeries.prototype, \"exclude\", {\r\n /**\r\n * @return Excluded ids\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"exclude\");\r\n },\r\n /**\r\n * A list of object ids that should be excluded from the series.\r\n *\r\n * E.g. you want to include all of the areas from a GeoJSON map, except\r\n * Antarctica.\r\n *\r\n * You'd leave `include` empty, and set `exclude = [\"AQ\"]`.\r\n *\r\n * @param value Excluded ids\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"exclude\", value)) {\r\n this.processIncExc();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Decorates a newly added object.\r\n *\r\n * @param event [description]\r\n */\r\n MapSeries.prototype.handleObjectAdded = function (event) {\r\n var mapObject = event.newValue;\r\n mapObject.parent = this;\r\n mapObject.series = this;\r\n mapObject.strokeWidth = mapObject.strokeWidth;\r\n };\r\n Object.defineProperty(MapSeries.prototype, \"geodata\", {\r\n /**\r\n * @return GeoJSON data\r\n */\r\n get: function () {\r\n return this._geodata;\r\n },\r\n /**\r\n * Map data in GeoJSON format.\r\n *\r\n * The series supports the following GeoJSON objects: `Point`, `LineString`,\r\n * `Polygon`, `MultiPoint`, `MultiLineString`, and `MultiPolygon`.\r\n *\r\n * @see {@link http://geojson.org/} Official GeoJSON format specification\r\n * @param geoJSON GeoJSON data\r\n */\r\n set: function (geodata) {\r\n if (geodata != this._geodata) {\r\n this._geodata = geodata;\r\n if (this.reverseGeodata) {\r\n this.chart.processReverseGeodata(this._geodata);\r\n }\r\n for (var i = this.data.length - 1; i >= 0; i--) {\r\n if (this.data[i].madeFromGeoData == true) {\r\n this.data.splice(i, 1);\r\n }\r\n }\r\n this.disposeData();\r\n this.invalidateData();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapSeries.prototype, \"reverseGeodata\", {\r\n /**\r\n * @returns Reverse the order of geodata coordinates?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"reverseGeodata\");\r\n },\r\n /**\r\n * Indicates whether GeoJSON geodata supplied to the chart uses\r\n * ESRI (clockwise) or non-ESRI (counter-clockwise) order of the polygon\r\n * coordinates.\r\n *\r\n * `MapChart` supports only ESRI standard, so if your custom maps appears\r\n * garbled, try setting `reverseGeodata = true`.\r\n *\r\n * @default false\r\n * @since 4.10.11\r\n * @param value Reverse the order of geodata coordinates?\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"reverseGeodata\", value) && this._geodata) {\r\n this.chart.processReverseGeodata(this._geodata);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapSeries.prototype, \"geodataSource\", {\r\n /**\r\n * Returns a [[DataSource]] specifically for loading Component's data.\r\n *\r\n * @return Data source\r\n */\r\n get: function () {\r\n if (!this._dataSources[\"geodata\"]) {\r\n this.getDataSource(\"geodata\");\r\n }\r\n return this._dataSources[\"geodata\"];\r\n },\r\n /**\r\n * Sets a [[DataSource]] to be used for loading Component's data.\r\n *\r\n * @param value Data source\r\n */\r\n set: function (value) {\r\n var _this = this;\r\n if (this._dataSources[\"geodata\"]) {\r\n this.removeDispose(this._dataSources[\"geodata\"]);\r\n }\r\n this._dataSources[\"geodata\"] = value;\r\n this._dataSources[\"geodata\"].component = this;\r\n this.events.on(\"inited\", function () {\r\n _this.loadData(\"geodata\");\r\n }, undefined, false);\r\n this.setDataSourceEvents(value, \"geodata\");\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * @ignore\r\n */\r\n MapSeries.prototype.getFeatures = function () {\r\n return;\r\n };\r\n /**\r\n * @ignore\r\n */\r\n MapSeries.prototype.validateDataItems = function () {\r\n _super.prototype.validateDataItems.call(this);\r\n this.updateExtremes();\r\n };\r\n /**\r\n * @ignore\r\n */\r\n MapSeries.prototype.updateExtremes = function () {\r\n var north;\r\n var south;\r\n var east;\r\n var west;\r\n this.dataItems.each(function (dataItem) {\r\n if (dataItem.north > north || !$type.isNumber(north)) {\r\n north = dataItem.north;\r\n }\r\n if (dataItem.south < south || !$type.isNumber(south)) {\r\n south = dataItem.south;\r\n }\r\n if (dataItem.west < west || !$type.isNumber(west)) {\r\n west = dataItem.west;\r\n }\r\n if (dataItem.east > east || !$type.isNumber(east)) {\r\n east = dataItem.east;\r\n }\r\n });\r\n if (this._mapObjects) {\r\n this._mapObjects.each(function (mapObject) {\r\n if (mapObject.north > north || !$type.isNumber(north)) {\r\n north = mapObject.north;\r\n }\r\n if (mapObject.south < south || !$type.isNumber(south)) {\r\n south = mapObject.south;\r\n }\r\n if (mapObject.west < west || !$type.isNumber(west)) {\r\n west = mapObject.west;\r\n }\r\n if (mapObject.east > east || !$type.isNumber(east)) {\r\n east = mapObject.east;\r\n }\r\n });\r\n }\r\n if (this.north != north || this.east != east || this.south != south || this.west != west) {\r\n this._north = north;\r\n this._east = east;\r\n this._west = west;\r\n this._south = south;\r\n this.dispatch(\"geoBoundsChanged\");\r\n if (!this.ignoreBounds) {\r\n this.chart.updateExtremes();\r\n }\r\n }\r\n };\r\n Object.defineProperty(MapSeries.prototype, \"north\", {\r\n /**\r\n * @return Latitude\r\n */\r\n get: function () {\r\n if ($type.isNumber(this._northDefined)) {\r\n return this._northDefined;\r\n }\r\n return this._north;\r\n },\r\n /**\r\n * North-most latitude of the series.\r\n *\r\n * By default, this holds auto-calculated latitude of the extremity.\r\n *\r\n * It can be overridden manually.\r\n *\r\n * @param value Latitude\r\n */\r\n set: function (value) {\r\n this._northDefined = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapSeries.prototype, \"south\", {\r\n /**\r\n * @return Latitude\r\n */\r\n get: function () {\r\n if ($type.isNumber(this._southDefined)) {\r\n return this._southDefined;\r\n }\r\n return this._south;\r\n },\r\n /**\r\n * South-most latitude of the series.\r\n *\r\n * By default, this holds auto-calculated latitude of the extremity.\r\n *\r\n * It can be overridden manually.\r\n *\r\n * @param value Latitude\r\n */\r\n set: function (value) {\r\n this._southDefined = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapSeries.prototype, \"west\", {\r\n /**\r\n * @return Longitude\r\n */\r\n get: function () {\r\n if ($type.isNumber(this._westDefined)) {\r\n return this._westDefined;\r\n }\r\n return this._west;\r\n },\r\n /**\r\n * West-most longitude of the series.\r\n *\r\n * By default, this holds auto-calculated longitude of the extremity.\r\n *\r\n * It can be overridden manually.\r\n *\r\n * @param value Longitude\r\n */\r\n set: function (value) {\r\n this._westDefined = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapSeries.prototype, \"east\", {\r\n /**\r\n * @return Longitude\r\n */\r\n get: function () {\r\n if ($type.isNumber(this._eastDefined)) {\r\n return this._eastDefined;\r\n }\r\n return this._east;\r\n },\r\n /**\r\n * East-most longitude of the series.\r\n *\r\n * By default, this holds auto-calculated longitude of the extremity.\r\n *\r\n * It can be overridden manually.\r\n *\r\n * @param value Longitude\r\n */\r\n set: function (value) {\r\n this._eastDefined = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Processes JSON-based config before it is applied to the object.\r\n *\r\n * @ignore Exclude from docs\r\n * @param config Config\r\n */\r\n MapSeries.prototype.processConfig = function (config) {\r\n if ($type.hasValue(config[\"geodata\"]) && $type.isString(config[\"geodata\"])) {\r\n var name_1 = config[\"geodata\"];\r\n // Check if there's a map loaded by such name\r\n if ($type.hasValue(window[\"am4geodata_\" + config[\"geodata\"]])) {\r\n config[\"geodata\"] = window[\"am4geodata_\" + config[\"geodata\"]];\r\n }\r\n // Nope. Let's try maybe we got JSON as string?\r\n else {\r\n try {\r\n config[\"geodata\"] = JSON.parse(config[\"geodata\"]);\r\n }\r\n catch (e) {\r\n // No go again. Error out.\r\n throw Error(\"MapChart error: Geodata `\" + name_1 + \"` is not loaded or is incorrect.\");\r\n }\r\n }\r\n }\r\n _super.prototype.processConfig.call(this, config);\r\n };\r\n /**\r\n * Adds `projection` to \"as is\" fields.\r\n *\r\n * @param field Field name\r\n * @return Assign as is?\r\n */\r\n MapSeries.prototype.asIs = function (field) {\r\n return field == \"geodata\" || _super.prototype.asIs.call(this, field);\r\n };\r\n /**\r\n * @ignore\r\n */\r\n MapSeries.prototype.updateTooltipBounds = function () {\r\n if (this.tooltip && this.topParent) {\r\n this.tooltip.setBounds({ x: 10, y: 10, width: this.topParent.maxWidth - 20, height: this.topParent.maxHeight - 20 });\r\n }\r\n };\r\n return MapSeries;\r\n}(Series));\r\nexport { MapSeries };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"MapSeries\"] = MapSeries;\r\nregistry.registeredClasses[\"MapSeriesDataItem\"] = MapSeriesDataItem;\r\n","/**\r\n * Map spline module\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { MapLine } from \"./MapLine\";\r\nimport { Polyspline } from \"../../core/elements/Polyspline\";\r\nimport { registry } from \"../../core/Registry\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Used to draw a spline on the map.\r\n *\r\n * @see {@link IMapSplineEvents} for a list of available events\r\n * @see {@link IMapSplineAdapters} for a list of available Adapters\r\n */\r\nvar MapSpline = /** @class */ (function (_super) {\r\n __extends(MapSpline, _super);\r\n /**\r\n * Constructor\r\n */\r\n function MapSpline() {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n _this.className = \"MapSpline\";\r\n // Apply theme\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * @ignore\r\n */\r\n MapSpline.prototype.createLine = function () {\r\n this.line = new Polyspline();\r\n this.line.tensionX = 0.8;\r\n this.line.tensionY = 0.8;\r\n };\r\n Object.defineProperty(MapSpline.prototype, \"shortestDistance\", {\r\n /**\r\n * ShortestDistance = true is not supported by MapSpline, only MapLine does support it\r\n * @default false\r\n * @param value\r\n * @todo: review description\r\n */\r\n get: function () {\r\n return false;\r\n },\r\n set: function (value) {\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return MapSpline;\r\n}(MapLine));\r\nexport { MapSpline };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"MapSpline\"] = MapSpline;\r\n","/**\r\n * Map spline series module\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { MapLineSeries, MapLineSeriesDataItem } from \"./MapLineSeries\";\r\nimport { MapSpline } from \"./MapSpline\";\r\nimport { registry } from \"../../core/Registry\";\r\n/**\r\n * ============================================================================\r\n * DATA ITEM\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Defines a [[DataItem]] for [[MapSplineSeries]]\r\n * @see {@link DataItem}\r\n */\r\nvar MapSplineSeriesDataItem = /** @class */ (function (_super) {\r\n __extends(MapSplineSeriesDataItem, _super);\r\n /**\r\n * Constructor\r\n */\r\n function MapSplineSeriesDataItem() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"MapSplineSeriesDataItem\";\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n return MapSplineSeriesDataItem;\r\n}(MapLineSeriesDataItem));\r\nexport { MapSplineSeriesDataItem };\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * A series of map spline elements.\r\n *\r\n * @see {@link IMapSplineSeriesEvents} for a list of available Events\r\n * @see {@link IMapSplineSeriesAdapters} for a list of available Adapters\r\n * @important\r\n */\r\nvar MapSplineSeries = /** @class */ (function (_super) {\r\n __extends(MapSplineSeries, _super);\r\n /**\r\n * Constructor\r\n */\r\n function MapSplineSeries() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"MapSplineSeries\";\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Returns a new/empty DataItem of the type appropriate for this object.\r\n *\r\n * @see {@link DataItem}\r\n * @return Data Item\r\n */\r\n MapSplineSeries.prototype.createDataItem = function () {\r\n return new MapSplineSeriesDataItem();\r\n };\r\n /**\r\n * Returns a new line instance of suitable type.\r\n *\r\n * @return New line\r\n */\r\n MapSplineSeries.prototype.createLine = function () {\r\n return new MapSpline();\r\n };\r\n return MapSplineSeries;\r\n}(MapLineSeries));\r\nexport { MapSplineSeries };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"MapSplineSeries\"] = MapSplineSeries;\r\nregistry.registeredClasses[\"MapSplineSeriesDataItem\"] = MapSplineSeriesDataItem;\r\n","/**\r\n * A collection of Map-related utility functions.\r\n */\r\nimport * as $array from \"../../core/utils/Array\";\r\nimport * as d3geo from \"d3-geo\";\r\n/**\r\n * Converts a multi-part polygon in X/Y coordinates to a geo-multipolygon in\r\n * geo-points (lat/long).\r\n *\r\n * @param multiPolygon Source multi-polygon\r\n * @return Geo-multipolygon\r\n */\r\nexport function multiPolygonToGeo(multiPolygon) {\r\n return $array.map(multiPolygon, function (polygon) {\r\n var surface = polygon[0];\r\n var hole = polygon[1];\r\n //let holePoints: Array = [];\r\n var geoArea = [];\r\n if (surface) {\r\n geoArea.push(multiPointToGeo(surface));\r\n }\r\n if (hole) {\r\n geoArea.push(multiPointToGeo(hole));\r\n }\r\n return geoArea;\r\n });\r\n}\r\n/**\r\n * Converts a multiline in X/Y coordinates to a geo-multiline in geo-points\r\n * (lat/long).\r\n *\r\n * @param multiLine Source multiline\r\n * @return Geo-multiline\r\n */\r\nexport function multiLineToGeo(multiLine) {\r\n return $array.map(multiLine, function (multiLine) {\r\n return multiPointToGeo(multiLine);\r\n });\r\n}\r\n/**\r\n * Converts multiple X/Y points into a lat/long geo-points.\r\n *\r\n * @param points Source points\r\n * @return Geo-points\r\n */\r\nexport function multiPointToGeo(points) {\r\n return $array.map(points, function (point) {\r\n return pointToGeo(point);\r\n });\r\n}\r\n/**\r\n * Converts multiple X/Y points into a lat/long geo-points.\r\n *\r\n * @param points Source points\r\n * @return Geo-points\r\n */\r\nexport function multiGeoToPoint(geoPoints) {\r\n return $array.map(geoPoints, geoToPoint);\r\n}\r\n/**\r\n * Converts X/Y point into a lat/long geo-point.\r\n *\r\n * @param point Source point\r\n * @return Geo-point\r\n */\r\nexport function pointToGeo(point) {\r\n return { longitude: point[0], latitude: point[1] };\r\n}\r\n/**\r\n * Converts lat/long geo-point into a X/Y point.\r\n *\r\n * @param point Source geo-point\r\n * @return X/Y point\r\n */\r\nexport function geoToPoint(geoPoint) {\r\n return [geoPoint.longitude, geoPoint.latitude];\r\n}\r\n/**\r\n * Converts geo line (collection of lat/long coordinates) to screen line (x/y).\r\n *\r\n * @param multiGeoLine Source geo line\r\n * @return Screen line\r\n */\r\nexport function multiGeoLineToMultiLine(multiGeoLine) {\r\n return $array.map(multiGeoLine, function (segment) {\r\n return $array.map(segment, geoToPoint);\r\n });\r\n}\r\n/**\r\n * Converts a geo polygon (collection of lat/long coordinates) to screen\r\n * polygon (x/y).\r\n *\r\n * @param multiGeoPolygon Source polygon\r\n * @return Screen polygon\r\n */\r\nexport function multiGeoPolygonToMultipolygon(multiGeoPolygon) {\r\n return $array.map(multiGeoPolygon, function (geoPolygon) {\r\n var surface = geoPolygon[0];\r\n var hole = geoPolygon[1];\r\n var multiPolygon = [];\r\n if (surface) {\r\n multiPolygon.push(multiGeoToPoint(surface));\r\n }\r\n if (hole) {\r\n multiPolygon.push(multiGeoToPoint(hole));\r\n }\r\n return multiPolygon;\r\n });\r\n}\r\n/**\r\n * Returns a set of geographical coordinates for the circle with a center\r\n * at specific lat/long coordinates and radius (in degrees).\r\n *\r\n * @since 4.3.0\r\n * @param longitude Center longitude\r\n * @param latitude Center latitude\r\n * @param radius Radius (degrees)\r\n * @return Circle coordinates\r\n */\r\nexport function getCircle(longitude, latitude, radius) {\r\n return [d3geo.geoCircle().center([longitude, latitude]).radius(radius)().coordinates];\r\n}\r\n/**\r\n * Returns a set of screen coordinates that represents a \"background\" area\r\n * between provided extremities.\r\n *\r\n * @since 4.3.0\r\n * @param north North latitude\r\n * @param east East longitude\r\n * @param south South latitude\r\n * @param west West longitude\r\n * @return Polygon\r\n */\r\nexport function getBackground(north, east, south, west) {\r\n var multiPolygon = [];\r\n if (west == -180) {\r\n west = -179.9999;\r\n }\r\n if (south == -90) {\r\n south = -89.9999;\r\n }\r\n if (north == 90) {\r\n north = 89.9999;\r\n }\r\n if (east == 180) {\r\n east = 179.9999;\r\n }\r\n var stepLong = Math.min(90, (east - west) / Math.ceil((east - west) / 90));\r\n var stepLat = (north - south) / Math.ceil((north - south) / 90);\r\n for (var ln = west; ln < east; ln = ln + stepLong) {\r\n var surface = [];\r\n multiPolygon.push([surface]);\r\n if (ln + stepLong > east) {\r\n stepLong = east - ln;\r\n }\r\n for (var ll = ln; ll <= ln + stepLong; ll = ll + 5) {\r\n surface.push([ll, north]);\r\n }\r\n for (var lt = north; lt >= south; lt = lt - stepLat) {\r\n surface.push([ln + stepLong, lt]);\r\n }\r\n for (var ll = ln + stepLong; ll >= ln; ll = ll - 5) {\r\n surface.push([ll, south]);\r\n }\r\n for (var lt = south; lt <= north; lt = lt + stepLat) {\r\n surface.push([ln, lt]);\r\n }\r\n }\r\n return multiPolygon;\r\n}\r\n","/**\r\n * A module for the mini-map control.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Container } from \"../../core/Container\";\r\nimport { Rectangle } from \"../../core/elements/Rectangle\";\r\nimport { List } from \"../../core/utils/List\";\r\nimport { MutableValueDisposer, MultiDisposer } from \"../../core/utils/Disposer\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport { color } from \"../../core/utils/Color\";\r\nimport { InterfaceColorSet } from \"../../core/utils/InterfaceColorSet\";\r\nimport * as $utils from \"../../core/utils/Utils\";\r\nimport * as $type from \"../../core/utils/Type\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Creates a \"bird's eye\" view of the whole map.\r\n *\r\n * This control creates a mini-map with the whole of the map, highlighting\r\n * the area which is in the current viewport of the map map.\r\n *\r\n * @see {@link ISmallMapEvents} for a list of available events\r\n * @see {@link ISmallMapAdapters} for a list of available Adapters\r\n * @important\r\n */\r\nvar SmallMap = /** @class */ (function (_super) {\r\n __extends(SmallMap, _super);\r\n /**\r\n * Constructor\r\n */\r\n function SmallMap() {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n /**\r\n * A target map.\r\n */\r\n _this._chart = new MutableValueDisposer();\r\n _this.className = \"SmallMap\";\r\n // Set defaults\r\n _this.align = \"left\";\r\n _this.valign = \"bottom\";\r\n _this.percentHeight = 20;\r\n _this.percentWidth = 20;\r\n _this.margin(5, 5, 5, 5);\r\n var interfaceColors = new InterfaceColorSet();\r\n // Set background defailts\r\n _this.background.fillOpacity = 0.9;\r\n _this.background.fill = interfaceColors.getFor(\"background\");\r\n // Set up events\r\n _this.events.on(\"hit\", _this.moveToPosition, _this, false);\r\n _this.events.on(\"maxsizechanged\", _this.updateMapSize, _this, false);\r\n // Create a container\r\n _this.seriesContainer = _this.createChild(Container);\r\n _this.seriesContainer.shouldClone = false;\r\n // Create an outline rectangle\r\n var rectangle = _this.createChild(Rectangle);\r\n rectangle.shouldClone = false;\r\n rectangle.stroke = interfaceColors.getFor(\"alternativeBackground\");\r\n rectangle.strokeWidth = 1;\r\n rectangle.strokeOpacity = 0.5;\r\n rectangle.fill = color(); //\"none\";\r\n rectangle.verticalCenter = \"middle\";\r\n rectangle.horizontalCenter = \"middle\";\r\n rectangle.isMeasured = false;\r\n rectangle.visible = false;\r\n _this.rectangle = rectangle;\r\n _this._disposers.push(_this._chart);\r\n // Apply theme\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n Object.defineProperty(SmallMap.prototype, \"series\", {\r\n /**\r\n * A list of map series used to draw the mini-map.\r\n *\r\n * @readonly\r\n * @return Series\r\n */\r\n get: function () {\r\n if (!this._series) {\r\n this._series = new List();\r\n this._series.events.on(\"inserted\", this.handleSeriesAdded, this, false);\r\n this._series.events.on(\"removed\", this.handleSeriesRemoved, this, false);\r\n }\r\n return this._series;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Decorates a new series when they are pushed into a `series` list.\r\n *\r\n * @param event Event\r\n */\r\n SmallMap.prototype.handleSeriesAdded = function (event) {\r\n var series = event.newValue;\r\n if (this.chart.series.contains(series)) {\r\n var newSeries = series.clone();\r\n this._series.removeValue(series);\r\n this._series.push(newSeries);\r\n series = newSeries;\r\n this.chart.dataUsers.push(newSeries);\r\n }\r\n series.chart = this.chart;\r\n series.parent = this.seriesContainer;\r\n series.interactionsEnabled = false;\r\n series.events.on(\"inited\", this.updateMapSize, this, false);\r\n series.hidden = false;\r\n };\r\n /**\r\n * Cleans up after series are removed from Scrollbar.\r\n *\r\n * @param event Event\r\n */\r\n SmallMap.prototype.handleSeriesRemoved = function (event) {\r\n //let sourceSeries: MapSeries = event.oldValue;\r\n this.invalidate();\r\n };\r\n /**\r\n * Moves main map pan position after click on the small map.\r\n *\r\n * @ignore Exclude from docs\r\n * @param event Event\r\n */\r\n SmallMap.prototype.moveToPosition = function (event) {\r\n var rectPoint = $utils.spritePointToSprite(event.spritePoint, this, this.seriesContainer);\r\n var geoPoint = this.chart.seriesPointToGeo(rectPoint);\r\n this.chart.zoomToGeoPoint(geoPoint, this.chart.zoomLevel, true);\r\n };\r\n Object.defineProperty(SmallMap.prototype, \"chart\", {\r\n /**\r\n * @return Chart/map\r\n */\r\n get: function () {\r\n return this._chart.get();\r\n },\r\n /**\r\n * A chart/map that this control is meant for.\r\n *\r\n * @param chart Chart/map\r\n */\r\n set: function (chart) {\r\n if (this.chart != chart) {\r\n this._chart.set(chart, new MultiDisposer([\r\n //chart.events.on(\"zoomlevelchanged\", this.updateRectangle, this, false),\r\n chart.events.on(\"mappositionchanged\", this.updateRectangle, this, false),\r\n chart.events.on(\"scaleratiochanged\", this.updateMapSize, this, false)\r\n ]));\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Updates the viewport recangle as per current map zoom/pan position.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n SmallMap.prototype.updateRectangle = function () {\r\n var chart = this.chart;\r\n var zoomLevel = chart.zoomLevel;\r\n var rectangle = this.rectangle;\r\n rectangle.width = this.pixelWidth / zoomLevel;\r\n rectangle.height = this.pixelHeight / zoomLevel;\r\n var scale = Math.min(this.percentWidth, this.percentHeight) / 100;\r\n var seriesContainer = chart.seriesContainer;\r\n rectangle.x = Math.ceil((-seriesContainer.pixelX) * scale / zoomLevel) + this.seriesContainer.pixelX;\r\n rectangle.y = Math.ceil((-seriesContainer.pixelY) * scale / zoomLevel) + this.seriesContainer.pixelY;\r\n rectangle.validate();\r\n };\r\n /**\r\n * Update map size so that internal elements can redraw themselves after\r\n * the size of the small map changes.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n SmallMap.prototype.updateMapSize = function () {\r\n if (this.chart) {\r\n var scale = this.chart.scaleRatio * Math.min(this.percentWidth, this.percentHeight) / 100;\r\n this.seriesContainer.scale = scale;\r\n var bbox = {\r\n width: 0,\r\n height: 0,\r\n x: 0,\r\n y: 0\r\n };\r\n try { // Add exception catching to tame FF\r\n bbox = this.seriesContainer.group.node.getBBox();\r\n }\r\n catch (err) { }\r\n if (bbox.width > 0) {\r\n this.rectangle.visible = true;\r\n }\r\n this.seriesContainer.x = this.pixelWidth / 2 - bbox.x * scale - bbox.width / 2 * scale;\r\n this.seriesContainer.y = this.pixelHeight / 2 - bbox.y * scale - bbox.height / 2 * scale;\r\n this.updateRectangle();\r\n this.afterDraw();\r\n }\r\n };\r\n /**\r\n * Update elements after drawing the small map.\r\n */\r\n SmallMap.prototype.afterDraw = function () {\r\n _super.prototype.afterDraw.call(this);\r\n //this.seriesContainer.moveTo({ x: this.pixelWidth / 2, y: this.pixelHeight / 2 });\r\n this.rectangle.maskRectangle = { x: -1, y: -1, width: Math.ceil(this.pixelWidth + 2), height: Math.ceil(this.pixelHeight + 2) };\r\n };\r\n /**\r\n * Processes JSON-based config before it is applied to the object.\r\n *\r\n * @ignore Exclude from docs\r\n * @param config Config\r\n */\r\n SmallMap.prototype.processConfig = function (config) {\r\n if (config) {\r\n // Set up series\r\n if ($type.hasValue(config.series) && $type.isArray(config.series)) {\r\n for (var i = 0, len = config.series.length; i < len; i++) {\r\n var series = config.series[i];\r\n if ($type.hasValue(series) && $type.isString(series) && this.map.hasKey(series)) {\r\n config.series[i] = this.map.getKey(series);\r\n }\r\n }\r\n }\r\n }\r\n _super.prototype.processConfig.call(this, config);\r\n };\r\n return SmallMap;\r\n}(Container));\r\nexport { SmallMap };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"SmallMap\"] = SmallMap;\r\n","/**\r\n * Zoom control module\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Container } from \"../../core/Container\";\r\nimport { Button } from \"../../core/elements/Button\";\r\nimport { RoundedRectangle } from \"../../core/elements/RoundedRectangle\";\r\nimport { MutableValueDisposer, MultiDisposer } from \"../../core/utils/Disposer\";\r\nimport { keyboard } from \"../../core/utils/Keyboard\";\r\nimport { getInteraction } from \"../../core/interaction/Interaction\";\r\nimport { percent } from \"../../core/utils/Percent\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport { InterfaceColorSet } from \"../../core/utils/InterfaceColorSet\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Creates a control for zooming the map.\r\n *\r\n * @see {@link IZoomControlEvents} for a list of available events\r\n * @see {@link IZoomControlAdapters} for a list of available Adapters\r\n * @important\r\n */\r\nvar ZoomControl = /** @class */ (function (_super) {\r\n __extends(ZoomControl, _super);\r\n /**\r\n * Constructor\r\n */\r\n function ZoomControl() {\r\n var _this = _super.call(this) || this;\r\n /**\r\n * A target map.\r\n */\r\n _this._chart = new MutableValueDisposer();\r\n _this.className = \"ZoomControl\";\r\n _this.align = \"right\";\r\n _this.valign = \"bottom\";\r\n _this.layout = \"vertical\";\r\n _this.padding(5, 5, 5, 5);\r\n var interfaceColors = new InterfaceColorSet();\r\n var plusButton = _this.createChild(Button);\r\n plusButton.shouldClone = false;\r\n plusButton.label.text = \"+\";\r\n //plusButton.fontFamily = \"Verdana\";\r\n _this.plusButton = plusButton;\r\n var slider = _this.createChild(Container);\r\n slider.shouldClone = false;\r\n slider.background.fill = interfaceColors.getFor(\"alternativeBackground\");\r\n slider.background.fillOpacity = 0.05;\r\n slider.background.events.on(\"hit\", _this.handleBackgroundClick, _this, false);\r\n slider.events.on(\"sizechanged\", _this.updateThumbSize, _this, false);\r\n _this.slider = slider;\r\n var thumb = slider.createChild(Button);\r\n thumb.shouldClone = false;\r\n thumb.padding(0, 0, 0, 0);\r\n thumb.draggable = true;\r\n thumb.events.on(\"drag\", _this.handleThumbDrag, _this, false);\r\n _this.thumb = thumb;\r\n var minusButton = _this.createChild(Button);\r\n minusButton.shouldClone = false;\r\n minusButton.label.text = \"-\";\r\n //minusButton.fontFamily = \"Verdana\";\r\n _this.minusButton = minusButton;\r\n // Set roles\r\n _this.thumb.role = \"slider\";\r\n _this.thumb.readerLive = \"polite\";\r\n // Set reader text\r\n _this.thumb.readerTitle = _this.language.translate(\"Use arrow keys to zoom in and out\");\r\n _this.minusButton.readerTitle = _this.language.translate(\"Press ENTER to zoom in\");\r\n _this.plusButton.readerTitle = _this.language.translate(\"Press ENTER to zoom out\");\r\n _this.applyTheme();\r\n _this.events.on(\"propertychanged\", function (event) {\r\n if (event.property == \"layout\") {\r\n _this.fixLayout();\r\n }\r\n }, undefined, false);\r\n _this._disposers.push(_this._chart);\r\n _this.fixLayout();\r\n return _this;\r\n }\r\n /**\r\n * @ignore\r\n */\r\n ZoomControl.prototype.fixLayout = function () {\r\n var plusButton = this.plusButton;\r\n var minusButton = this.minusButton;\r\n var thumb = this.thumb;\r\n var slider = this.slider;\r\n plusButton.x = undefined;\r\n plusButton.y = undefined;\r\n minusButton.x = undefined;\r\n minusButton.y = undefined;\r\n thumb.x = undefined;\r\n thumb.y = undefined;\r\n slider.x = undefined;\r\n slider.y = undefined;\r\n plusButton.padding(6, 10, 6, 10);\r\n minusButton.padding(6, 10, 6, 10);\r\n minusButton.label.align = \"center\";\r\n minusButton.label.valign = \"middle\";\r\n plusButton.label.align = \"center\";\r\n plusButton.label.valign = \"middle\";\r\n if (this.layout == \"vertical\") {\r\n this.width = 40;\r\n this.height = undefined;\r\n minusButton.width = percent(100);\r\n minusButton.height = undefined;\r\n thumb.width = percent(100);\r\n thumb.height = undefined;\r\n plusButton.width = percent(100);\r\n plusButton.height = undefined;\r\n slider.width = percent(100);\r\n minusButton.marginTop = 1;\r\n plusButton.marginBottom = 2;\r\n slider.height = 0;\r\n minusButton.toFront();\r\n plusButton.toBack();\r\n thumb.minX = 0;\r\n thumb.maxX = 0;\r\n thumb.minY = 0;\r\n }\r\n else if (this.layout == \"horizontal\") {\r\n this.height = 40;\r\n this.width = undefined;\r\n minusButton.height = percent(100);\r\n minusButton.width = undefined;\r\n plusButton.height = percent(100);\r\n plusButton.width = undefined;\r\n thumb.height = percent(100);\r\n thumb.width = undefined;\r\n thumb.minX = 0;\r\n thumb.minY = 0;\r\n thumb.maxY = 0;\r\n slider.height = percent(100);\r\n slider.width = 0;\r\n minusButton.toBack();\r\n plusButton.toFront();\r\n }\r\n };\r\n /**\r\n * Handles zoom operation after clicking on the slider background.\r\n *\r\n * @ignore Exclude from docs\r\n * @param event Event\r\n */\r\n ZoomControl.prototype.handleBackgroundClick = function (event) {\r\n var sprite = event.target;\r\n var y = event.spritePoint.y;\r\n var chart = this.chart;\r\n var maxPower = Math.log(chart.maxZoomLevel) / Math.LN2;\r\n var minPower = Math.log(chart.minZoomLevel) / Math.LN2;\r\n var power = (sprite.pixelHeight - y) / sprite.pixelHeight * (minPower + (maxPower - minPower));\r\n var zoomLevel = Math.pow(2, power);\r\n chart.zoomToGeoPoint(chart.zoomGeoPoint, zoomLevel);\r\n };\r\n Object.defineProperty(ZoomControl.prototype, \"chart\", {\r\n /**\r\n * @return Map/chart\r\n */\r\n get: function () {\r\n return this._chart.get();\r\n },\r\n /**\r\n * A main chart/map that this zoom control is for.\r\n *\r\n * @param chart Map/chart\r\n */\r\n set: function (chart) {\r\n var _this = this;\r\n this._chart.set(chart, new MultiDisposer([\r\n chart.events.on(\"maxsizechanged\", this.updateThumbSize, this, false),\r\n chart.events.on(\"zoomlevelchanged\", this.updateThumb, this, false),\r\n this.minusButton.events.on(\"hit\", function () { chart.zoomOut(chart.zoomGeoPoint); }, chart, false),\r\n getInteraction().body.events.on(\"keyup\", function (ev) {\r\n if (_this.topParent.hasFocused) {\r\n // ENTER is now handled globally\r\n if (keyboard.isKey(ev.event, \"plus\")) {\r\n chart.zoomIn();\r\n }\r\n else if (keyboard.isKey(ev.event, \"minus\")) {\r\n chart.zoomOut();\r\n }\r\n }\r\n }, chart),\r\n this.plusButton.events.on(\"hit\", function () { chart.zoomIn(chart.zoomGeoPoint); }, chart, false)\r\n ]));\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Updates the slider's thumb size based on the available zoom space.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n ZoomControl.prototype.updateThumbSize = function () {\r\n var chart = this.chart;\r\n if (chart) {\r\n var slider = this.slider;\r\n var thumb = this.thumb;\r\n if (this.layout == \"vertical\") {\r\n thumb.minHeight = Math.min(this.slider.pixelHeight, 20);\r\n thumb.height = slider.pixelHeight / this.stepCount;\r\n thumb.maxY = slider.pixelHeight - thumb.pixelHeight;\r\n if (thumb.pixelHeight <= 1) {\r\n thumb.visible = false;\r\n }\r\n else {\r\n thumb.visible = true;\r\n }\r\n }\r\n else {\r\n thumb.minWidth = Math.min(this.slider.pixelWidth, 20);\r\n thumb.width = slider.pixelWidth / this.stepCount;\r\n thumb.maxX = slider.pixelWidth - thumb.pixelWidth;\r\n if (thumb.pixelWidth <= 1) {\r\n thumb.visible = false;\r\n }\r\n else {\r\n thumb.visible = true;\r\n }\r\n }\r\n }\r\n };\r\n /**\r\n * Updates thumb according to current zoom position from map.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n ZoomControl.prototype.updateThumb = function () {\r\n var slider = this.slider;\r\n var chart = this.chart;\r\n var thumb = this.thumb;\r\n if (!thumb.isDown) {\r\n var step = (Math.log(chart.zoomLevel) - Math.log(this.chart.minZoomLevel)) / Math.LN2;\r\n if (this.layout == \"vertical\") {\r\n thumb.y = slider.pixelHeight - (slider.pixelHeight - thumb.pixelHeight) * step / this.stepCount - thumb.pixelHeight;\r\n }\r\n else {\r\n thumb.x = slider.pixelWidth * step / this.stepCount;\r\n }\r\n }\r\n };\r\n /**\r\n * Zooms the actual map when slider position changes.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n ZoomControl.prototype.handleThumbDrag = function () {\r\n var slider = this.slider;\r\n var chart = this.chart;\r\n var thumb = this.thumb;\r\n var step;\r\n var minStep = Math.log(this.chart.minZoomLevel) / Math.LN2;\r\n if (this.layout == \"vertical\") {\r\n step = this.stepCount * (slider.pixelHeight - thumb.pixelY - thumb.pixelHeight) / (slider.pixelHeight - thumb.pixelHeight);\r\n }\r\n else {\r\n step = this.stepCount * thumb.pixelX / slider.pixelWidth;\r\n }\r\n step = minStep + step;\r\n var zoomLevel = Math.pow(2, step);\r\n chart.zoomToGeoPoint(undefined, zoomLevel, false, 0);\r\n };\r\n Object.defineProperty(ZoomControl.prototype, \"stepCount\", {\r\n /**\r\n * Returns the step countfor the slider grid according to map's min and max\r\n * zoom level settings.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Step count\r\n */\r\n get: function () {\r\n return Math.log(this.chart.maxZoomLevel) / Math.LN2 - Math.log(this.chart.minZoomLevel) / Math.LN2;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Creates a background element for slider control.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Background\r\n */\r\n ZoomControl.prototype.createBackground = function () {\r\n return new RoundedRectangle();\r\n };\r\n return ZoomControl;\r\n}(Container));\r\nexport { ZoomControl };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"ZoomControl\"] = ZoomControl;\r\n","export { Mercator } from \"./projections/Mercator\";\r\nexport { Miller } from \"./projections/Miller\";\r\nexport { Eckert6 } from \"./projections/Eckert6\";\r\nexport { Orthographic } from \"./projections/Orthographic\";\r\nexport { Stereographic } from \"./projections/Stereographic\";\r\nexport { Albers } from \"./projections/Albers\";\r\nexport { AlbersUsa } from \"./projections/AlbersUsa\";\r\nexport { NaturalEarth1 } from \"./projections/NaturalEarth1\";\r\nexport { AzimuthalEqualArea } from \"./projections/AzimuthalEqualArea\";\r\nexport { EqualEarth } from \"./projections/EqualEarth\";\r\nexport { Projection } from \"./projections/Projection\";\r\n","/**\r\n * Functionality for Mercator projection\r\n *\r\n * The function(s) below are from D3.js library (https://d3js.org/)\r\n *\r\n * ```\r\n * Copyright 2017 Mike Bostock\r\n *\r\n * Redistribution and use in source and binary forms, with or without\r\n * modification, are permitted provided that the following conditions are met:\r\n *\r\n * 1. Redistributions of source code must retain the above copyright notice,\r\n * this list of conditions and the following disclaimer.\r\n *\r\n * 2. Redistributions in binary form must reproduce the above copyright notice,\r\n * this list of conditions and the following disclaimer in the documentation\r\n * and/or other materials provided with the distribution.\r\n *\r\n * 3. Neither the name of the copyright holder nor the names of its\r\n * contributors may be used to endorse or promote products derived from this\r\n * software without specific prior written permission.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\r\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\r\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\r\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\r\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n * ```\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Projection } from \"./Projection\";\r\nimport { registry } from \"../../../core/Registry\";\r\nimport * as d3geo from \"d3-geo\";\r\n/**\r\n * Orthographic projection.\r\n */\r\nvar Albers = /** @class */ (function (_super) {\r\n __extends(Albers, _super);\r\n function Albers() {\r\n var _this = _super.call(this) || this;\r\n _this.d3Projection = d3geo.geoAlbers();\r\n return _this;\r\n }\r\n return Albers;\r\n}(Projection));\r\nexport { Albers };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Albers\"] = Albers;\r\n","/**\r\n * Functionality for Mercator projection\r\n *\r\n * The function(s) below are from D3.js library (https://d3js.org/)\r\n *\r\n * ```\r\n * Copyright 2017 Mike Bostock\r\n *\r\n * Redistribution and use in source and binary forms, with or without\r\n * modification, are permitted provided that the following conditions are met:\r\n *\r\n * 1. Redistributions of source code must retain the above copyright notice,\r\n * this list of conditions and the following disclaimer.\r\n *\r\n * 2. Redistributions in binary form must reproduce the above copyright notice,\r\n * this list of conditions and the following disclaimer in the documentation\r\n * and/or other materials provided with the distribution.\r\n *\r\n * 3. Neither the name of the copyright holder nor the names of its\r\n * contributors may be used to endorse or promote products derived from this\r\n * software without specific prior written permission.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\r\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\r\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\r\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\r\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n * ```\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Projection } from \"./Projection\";\r\nimport { registry } from \"../../../core/Registry\";\r\nimport * as d3geo from \"d3-geo\";\r\n/**\r\n * Orthographic projection.\r\n */\r\nvar AlbersUsa = /** @class */ (function (_super) {\r\n __extends(AlbersUsa, _super);\r\n function AlbersUsa() {\r\n var _this = _super.call(this) || this;\r\n _this.d3Projection = d3geo.geoAlbersUsa();\r\n return _this;\r\n }\r\n return AlbersUsa;\r\n}(Projection));\r\nexport { AlbersUsa };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"AlbersUsa\"] = AlbersUsa;\r\n","/**\r\n * Functionality for Mercator projection\r\n *\r\n * The function(s) below are from D3.js library (https://d3js.org/)\r\n *\r\n * ```\r\n * Copyright 2017 Mike Bostock\r\n *\r\n * Redistribution and use in source and binary forms, with or without\r\n * modification, are permitted provided that the following conditions are met:\r\n *\r\n * 1. Redistributions of source code must retain the above copyright notice,\r\n * this list of conditions and the following disclaimer.\r\n *\r\n * 2. Redistributions in binary form must reproduce the above copyright notice,\r\n * this list of conditions and the following disclaimer in the documentation\r\n * and/or other materials provided with the distribution.\r\n *\r\n * 3. Neither the name of the copyright holder nor the names of its\r\n * contributors may be used to endorse or promote products derived from this\r\n * software without specific prior written permission.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\r\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\r\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\r\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\r\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n * ```\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Projection } from \"./Projection\";\r\nimport { registry } from \"../../../core/Registry\";\r\nimport * as d3geo from \"d3-geo\";\r\n/**\r\n * Orthographic projection.\r\n */\r\nvar AzimuthalEqualArea = /** @class */ (function (_super) {\r\n __extends(AzimuthalEqualArea, _super);\r\n function AzimuthalEqualArea() {\r\n var _this = _super.call(this) || this;\r\n _this.d3Projection = d3geo.geoAzimuthalEqualArea();\r\n return _this;\r\n }\r\n return AzimuthalEqualArea;\r\n}(Projection));\r\nexport { AzimuthalEqualArea };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"AzimuthalEqualArea\"] = AzimuthalEqualArea;\r\n","/**\r\n * Functionality for Eckert6 projection\r\n *\r\n * The function(s) below are from D3.js library (https://d3js.org/)\r\n *\r\n * ```\r\n * Copyright 2017 Mike Bostock\r\n *\r\n * Redistribution and use in source and binary forms, with or without\r\n * modification, are permitted provided that the following conditions are met:\r\n *\r\n * 1. Redistributions of source code must retain the above copyright notice,\r\n * this list of conditions and the following disclaimer.\r\n *\r\n * 2. Redistributions in binary form must reproduce the above copyright notice,\r\n * this list of conditions and the following disclaimer in the documentation\r\n * and/or other materials provided with the distribution.\r\n *\r\n * 3. Neither the name of the copyright holder nor the names of its\r\n * contributors may be used to endorse or promote products derived from this\r\n * software without specific prior written permission.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\r\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\r\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\r\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\r\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n * ```\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Projection } from \"./Projection\";\r\nimport { registry } from \"../../../core/Registry\";\r\n// @ts-ignore\r\nimport * as d3geoprojection from \"d3-geo-projection\";\r\n/**\r\n * Eckert6 projection.\r\n */\r\nvar Eckert6 = /** @class */ (function (_super) {\r\n __extends(Eckert6, _super);\r\n function Eckert6() {\r\n var _this = _super.call(this) || this;\r\n _this.d3Projection = d3geoprojection.geoEckert6();\r\n return _this;\r\n }\r\n return Eckert6;\r\n}(Projection));\r\nexport { Eckert6 };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Eckert6\"] = Eckert6;\r\n","/**\r\n * Functionality for Mercator projection\r\n *\r\n * The function(s) below are from D3.js library (https://d3js.org/)\r\n *\r\n * ```\r\n * Copyright 2017 Mike Bostock\r\n *\r\n * Redistribution and use in source and binary forms, with or without\r\n * modification, are permitted provided that the following conditions are met:\r\n *\r\n * 1. Redistributions of source code must retain the above copyright notice,\r\n * this list of conditions and the following disclaimer.\r\n *\r\n * 2. Redistributions in binary form must reproduce the above copyright notice,\r\n * this list of conditions and the following disclaimer in the documentation\r\n * and/or other materials provided with the distribution.\r\n *\r\n * 3. Neither the name of the copyright holder nor the names of its\r\n * contributors may be used to endorse or promote products derived from this\r\n * software without specific prior written permission.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\r\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\r\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\r\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\r\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n * ```\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Projection } from \"./Projection\";\r\nimport { registry } from \"../../../core/Registry\";\r\nimport * as d3geo from \"d3-geo\";\r\n/**\r\n * Orthographic projection.\r\n */\r\nvar EqualEarth = /** @class */ (function (_super) {\r\n __extends(EqualEarth, _super);\r\n function EqualEarth() {\r\n var _this = _super.call(this) || this;\r\n _this.d3Projection = d3geo.geoEqualEarth();\r\n return _this;\r\n }\r\n return EqualEarth;\r\n}(Projection));\r\nexport { EqualEarth };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"EqualEarth\"] = EqualEarth;\r\n","/**\r\n * Functionality for Mercator projection\r\n *\r\n * The function(s) below are from D3.js library (https://d3js.org/)\r\n *\r\n * ```\r\n * Copyright 2017 Mike Bostock\r\n *\r\n * Redistribution and use in source and binary forms, with or without\r\n * modification, are permitted provided that the following conditions are met:\r\n *\r\n * 1. Redistributions of source code must retain the above copyright notice,\r\n * this list of conditions and the following disclaimer.\r\n *\r\n * 2. Redistributions in binary form must reproduce the above copyright notice,\r\n * this list of conditions and the following disclaimer in the documentation\r\n * and/or other materials provided with the distribution.\r\n *\r\n * 3. Neither the name of the copyright holder nor the names of its\r\n * contributors may be used to endorse or promote products derived from this\r\n * software without specific prior written permission.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\r\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\r\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\r\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\r\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n * ```\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Projection } from \"./Projection\";\r\nimport { registry } from \"../../../core/Registry\";\r\nimport * as d3geo from \"d3-geo\";\r\n/**\r\n * Mercator projection.\r\n */\r\nvar Mercator = /** @class */ (function (_super) {\r\n __extends(Mercator, _super);\r\n function Mercator() {\r\n var _this = _super.call(this) || this;\r\n _this.d3Projection = d3geo.geoMercator();\r\n return _this;\r\n }\r\n return Mercator;\r\n}(Projection));\r\nexport { Mercator };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Mercator\"] = Mercator;\r\n","/**\r\n * Functionality for Miller projection\r\n *\r\n * The function(s) below are from D3.js library (https://d3js.org/)\r\n *\r\n * ```\r\n * Copyright 2017 Mike Bostock\r\n *\r\n * Redistribution and use in source and binary forms, with or without\r\n * modification, are permitted provided that the following conditions are met:\r\n *\r\n * 1. Redistributions of source code must retain the above copyright notice,\r\n * this list of conditions and the following disclaimer.\r\n *\r\n * 2. Redistributions in binary form must reproduce the above copyright notice,\r\n * this list of conditions and the following disclaimer in the documentation\r\n * and/or other materials provided with the distribution.\r\n *\r\n * 3. Neither the name of the copyright holder nor the names of its\r\n * contributors may be used to endorse or promote products derived from this\r\n * software without specific prior written permission.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\r\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\r\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\r\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\r\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n * ```\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Projection } from \"./Projection\";\r\nimport { registry } from \"../../../core/Registry\";\r\n// @ts-ignore\r\nimport * as d3geoprojection from \"d3-geo-projection\";\r\n/**\r\n * Miller projection.\r\n */\r\nvar Miller = /** @class */ (function (_super) {\r\n __extends(Miller, _super);\r\n function Miller() {\r\n var _this = _super.call(this) || this;\r\n _this.d3Projection = d3geoprojection.geoMiller();\r\n return _this;\r\n }\r\n return Miller;\r\n}(Projection));\r\nexport { Miller };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Miller\"] = Miller;\r\n","/**\r\n * Functionality for Mercator projection\r\n *\r\n * The function(s) below are from D3.js library (https://d3js.org/)\r\n *\r\n * ```\r\n * Copyright 2017 Mike Bostock\r\n *\r\n * Redistribution and use in source and binary forms, with or without\r\n * modification, are permitted provided that the following conditions are met:\r\n *\r\n * 1. Redistributions of source code must retain the above copyright notice,\r\n * this list of conditions and the following disclaimer.\r\n *\r\n * 2. Redistributions in binary form must reproduce the above copyright notice,\r\n * this list of conditions and the following disclaimer in the documentation\r\n * and/or other materials provided with the distribution.\r\n *\r\n * 3. Neither the name of the copyright holder nor the names of its\r\n * contributors may be used to endorse or promote products derived from this\r\n * software without specific prior written permission.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\r\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\r\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\r\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\r\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n * ```\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Projection } from \"./Projection\";\r\nimport { registry } from \"../../../core/Registry\";\r\nimport * as d3geo from \"d3-geo\";\r\n/**\r\n * Orthographic projection.\r\n */\r\nvar NaturalEarth1 = /** @class */ (function (_super) {\r\n __extends(NaturalEarth1, _super);\r\n function NaturalEarth1() {\r\n var _this = _super.call(this) || this;\r\n _this.d3Projection = d3geo.geoNaturalEarth1();\r\n return _this;\r\n }\r\n return NaturalEarth1;\r\n}(Projection));\r\nexport { NaturalEarth1 };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"NaturalEarth1\"] = NaturalEarth1;\r\n","/**\r\n * Functionality for Mercator projection\r\n *\r\n * The function(s) below are from D3.js library (https://d3js.org/)\r\n *\r\n * ```\r\n * Copyright 2017 Mike Bostock\r\n *\r\n * Redistribution and use in source and binary forms, with or without\r\n * modification, are permitted provided that the following conditions are met:\r\n *\r\n * 1. Redistributions of source code must retain the above copyright notice,\r\n * this list of conditions and the following disclaimer.\r\n *\r\n * 2. Redistributions in binary form must reproduce the above copyright notice,\r\n * this list of conditions and the following disclaimer in the documentation\r\n * and/or other materials provided with the distribution.\r\n *\r\n * 3. Neither the name of the copyright holder nor the names of its\r\n * contributors may be used to endorse or promote products derived from this\r\n * software without specific prior written permission.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\r\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\r\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\r\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\r\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n * ```\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Projection } from \"./Projection\";\r\nimport { registry } from \"../../../core/Registry\";\r\nimport * as d3geo from \"d3-geo\";\r\n/**\r\n * Orthographic projection.\r\n */\r\nvar Orthographic = /** @class */ (function (_super) {\r\n __extends(Orthographic, _super);\r\n function Orthographic() {\r\n var _this = _super.call(this) || this;\r\n _this.d3Projection = d3geo.geoOrthographic();\r\n return _this;\r\n }\r\n return Orthographic;\r\n}(Projection));\r\nexport { Orthographic };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Orthographic\"] = Orthographic;\r\n","/**\r\n * This module contains funcitonality related to geographical projections\r\n */\r\nimport { registry } from \"../../../core/Registry\";\r\nimport * as $math from \"../../../core/utils/Math\";\r\nimport * as d3geo from \"d3-geo\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * This is a base class for a geographical projection.\r\n */\r\nvar Projection = /** @class */ (function () {\r\n function Projection() {\r\n this.d3Projection = d3geo.geoEquirectangular();\r\n }\r\n Object.defineProperty(Projection.prototype, \"d3Projection\", {\r\n /**\r\n * d3 projection\r\n */\r\n get: function () {\r\n return this._d3Projection;\r\n },\r\n /**\r\n * d3 projection\r\n */\r\n set: function (projection) {\r\n this._d3Projection = projection;\r\n projection.precision(0.1);\r\n this._d3Path = d3geo.geoPath().projection(projection);\r\n if (this.chart) {\r\n this.chart.invalidateProjection();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Projection.prototype, \"d3Path\", {\r\n /**\r\n * d3 path generator method\r\n * @ignore\r\n */\r\n get: function () {\r\n return this._d3Path;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Projection.prototype, \"scale\", {\r\n /**\r\n * @ignore\r\n */\r\n get: function () {\r\n return this.d3Projection.scale() / 100;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Converts a geographical point (lat/long) to a screen point (x/y)\r\n * @param geoPoint Geo point (lat/long)\r\n * @return Screen point (x/y)\r\n */\r\n Projection.prototype.convert = function (geoPoint) {\r\n /*\r\n geoPoint = $geo.normalizePoint(geoPoint);\r\n geoPoint = this.rotate(geoPoint, this.deltaLongitude, this.deltaLatitude, this.deltaGama);\r\n let pointInRadians: IPoint = this.project(geoPoint.longitude * $math.RADIANS, geoPoint.latitude * $math.RADIANS);\r\n return {\r\n x: $math.round(pointInRadians.x * $math.DEGREES - this.centerPoint.x, 4) * this.scale,\r\n y: $math.round(-pointInRadians.y * $math.DEGREES - this.centerPoint.y, 4) * this.scale\r\n };*/\r\n var p = this.d3Projection([geoPoint.longitude, geoPoint.latitude]);\r\n if (p) {\r\n return { x: p[0], y: p[1] };\r\n }\r\n };\r\n /**\r\n * Converts a screen point (x/y) to a geographical point (lat/long)\r\n * @param point Screen point (x/y)\r\n * @return Geo point (lat/long)\r\n */\r\n Projection.prototype.invert = function (point) {\r\n /*\r\n let pointInRadians: IGeoPoint = this.unproject((point.x / this.scale + this.centerPoint.x) * $math.RADIANS, (-point.y / this.scale - this.centerPoint.y) * $math.RADIANS);\r\n\r\n let geoPoint = { longitude: pointInRadians.longitude * $math.DEGREES, latitude: pointInRadians.latitude * $math.DEGREES };\r\n\r\n geoPoint = this.unrotate(geoPoint, this.deltaLongitude, this.deltaLatitude, this.deltaGama);\r\n */\r\n var p = this.d3Projection.invert([point.x, point.y]);\r\n if (p) {\r\n return { longitude: p[0], latitude: p[1] };\r\n }\r\n };\r\n /**\r\n * Returns X/Y coordinates.\r\n * Individual projections will override this method to apply their own\r\n * projection logic.\r\n * @deprecated\r\n * @param lambda [description]\r\n * @param phi [description]\r\n * @return X/Y coordinates\r\n * @todo Needs description\r\n */\r\n Projection.prototype.project = function (lambda, phi) {\r\n return this.convert({ longitude: lambda * $math.DEGREES, latitude: phi * $math.DEGREES });\r\n };\r\n /**\r\n * Returns geographical coordinates (lat/long).\r\n * Individual projections will override this method to apply their own\r\n * projection logic.\r\n * @deprecated\r\n * @param x X coordinate\r\n * @param y Y coordinate\r\n * @return Geographical point\r\n * @todo Needs description\r\n */\r\n Projection.prototype.unproject = function (x, y) {\r\n return this.invert({ x: x, y: y });\r\n };\r\n /**\r\n * @ignore\r\n * @deprecated\r\n */\r\n Projection.prototype.rotate = function (geoPoint, deltaLongitude, deltaLatitude, deltaGamma) {\r\n var deltaLambda = deltaLongitude * $math.RADIANS;\r\n var deltaPhi = deltaLatitude * $math.RADIANS;\r\n deltaGamma = deltaGamma * $math.RADIANS;\r\n var lambda = geoPoint.longitude * $math.RADIANS + deltaLambda;\r\n var phi = geoPoint.latitude * $math.RADIANS;\r\n var cosDeltaPhi = Math.cos(deltaPhi);\r\n var sinDeltaPhi = Math.sin(deltaPhi);\r\n var cosDeltaGamma = Math.cos(deltaGamma);\r\n var sinDeltaGamma = Math.sin(deltaGamma);\r\n var cosPhi = Math.cos(phi);\r\n var x = Math.cos(lambda) * cosPhi;\r\n var y = Math.sin(lambda) * cosPhi;\r\n var z = Math.sin(phi);\r\n var k = z * cosDeltaPhi + x * sinDeltaPhi;\r\n return { longitude: $math.DEGREES * Math.atan2(y * cosDeltaGamma - k * sinDeltaGamma, x * cosDeltaPhi - z * sinDeltaPhi), latitude: $math.DEGREES * Math.asin(k * cosDeltaGamma + y * sinDeltaGamma) };\r\n };\r\n /**\r\n * @ignore\r\n * @deprecated\r\n */\r\n Projection.prototype.unrotate = function (geoPoint, deltaLongitude, deltaLatitude, deltaGamma) {\r\n var deltaLambda = deltaLongitude * $math.RADIANS;\r\n var deltaPhi = deltaLatitude * $math.RADIANS;\r\n deltaGamma = deltaGamma * $math.RADIANS;\r\n var lambda = geoPoint.longitude * $math.RADIANS - deltaLambda;\r\n var phi = geoPoint.latitude * $math.RADIANS;\r\n var cosDeltaPhi = Math.cos(deltaPhi);\r\n var sinDeltaPhi = Math.sin(deltaPhi);\r\n var cosDeltaGamma = Math.cos(deltaGamma);\r\n var sinDeltaGamma = Math.sin(deltaGamma);\r\n var cosPhi = Math.cos(phi);\r\n var x = Math.cos(lambda) * cosPhi;\r\n var y = Math.sin(lambda) * cosPhi;\r\n var z = Math.sin(phi);\r\n var k = z * cosDeltaGamma - y * sinDeltaGamma;\r\n return { longitude: $math.DEGREES * Math.atan2(y * cosDeltaGamma + z * sinDeltaGamma, x * cosDeltaPhi + k * sinDeltaPhi), latitude: $math.DEGREES * Math.asin(k * cosDeltaPhi - x * sinDeltaPhi) };\r\n };\r\n //@todo: move to some utils?\r\n //@todo: add credits to: https://www.movable-type.co.uk/scripts/latlong.html\r\n Projection.prototype.intermediatePoint = function (pointA, pointB, position) {\r\n var p = d3geo.geoInterpolate([pointA.longitude, pointA.latitude], [pointB.longitude, pointB.latitude])(position);\r\n return { longitude: p[0], latitude: p[1] };\r\n };\r\n ;\r\n // returns radians\r\n Projection.prototype.multiDistance = function (multiGeoLine) {\r\n var distance = 0;\r\n for (var s = 0; s < multiGeoLine.length; s++) {\r\n var points = multiGeoLine[s];\r\n if (points.length > 1) {\r\n for (var p = 1; p < points.length; p++) {\r\n var pointA = points[p - 1];\r\n var pointB = points[p];\r\n distance += this.distance(pointA, pointB);\r\n }\r\n }\r\n }\r\n return distance;\r\n };\r\n // returns radians\r\n Projection.prototype.distance = function (pointA, pointB) {\r\n return d3geo.geoDistance([pointA.longitude, pointA.latitude], [pointB.longitude, pointB.latitude]);\r\n };\r\n /**\r\n * Converts relative position along the line (0-1) into pixel coordinates.\r\n *\r\n * @param position Position (0-1)\r\n * @return Coordinates\r\n */\r\n Projection.prototype.positionToPoint = function (multiGeoLine, position) {\r\n if (multiGeoLine) {\r\n var intermediatePoint = this.positionToGeoPoint(multiGeoLine, position);\r\n var intermediatePointA = this.positionToGeoPoint(multiGeoLine, position - 0.01);\r\n var intermediatePointB = this.positionToGeoPoint(multiGeoLine, position + 0.01);\r\n if (intermediatePointA && intermediatePointB) {\r\n var point = this.convert(intermediatePoint);\r\n var pa = this.convert(intermediatePointA);\r\n var pb = this.convert(intermediatePointB);\r\n return { x: point.x, y: point.y, angle: $math.getAngle(pa, pb) };\r\n }\r\n }\r\n return { x: 0, y: 0, angle: 0 };\r\n };\r\n /**\r\n * Converts relative position along the line (0-1) into pixel coordinates.\r\n *\r\n * @param position Position (0-1)\r\n * @return Coordinates\r\n */\r\n Projection.prototype.positionToGeoPoint = function (multiGeoLine, position) {\r\n if (multiGeoLine) {\r\n var totalDistance = this.multiDistance(multiGeoLine);\r\n var currentDistance = 0;\r\n var distanceAB = void 0;\r\n var positionA = 0;\r\n var positionB = 0;\r\n var pointA = void 0;\r\n var pointB = void 0;\r\n for (var s = 0; s < multiGeoLine.length; s++) {\r\n var points = multiGeoLine[s];\r\n if (points.length > 1) {\r\n for (var p = 1; p < points.length; p++) {\r\n pointA = points[p - 1];\r\n pointB = points[p];\r\n positionA = currentDistance / totalDistance;\r\n distanceAB = this.distance(pointA, pointB);\r\n currentDistance += distanceAB;\r\n positionB = currentDistance / totalDistance;\r\n if (positionA <= position && positionB > position) {\r\n s = multiGeoLine.length;\r\n break;\r\n }\r\n }\r\n }\r\n else if (points.length == 1) {\r\n pointA = points[0];\r\n pointB = points[0];\r\n positionA = 0;\r\n positionB = 1;\r\n }\r\n }\r\n if (pointA && pointB) {\r\n var positionAB = (position - positionA) / (positionB - positionA);\r\n return this.intermediatePoint(pointA, pointB, positionAB);\r\n }\r\n }\r\n return { longitude: 0, latitude: 0 };\r\n };\r\n return Projection;\r\n}());\r\nexport { Projection };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Projection\"] = Projection;\r\n","/**\r\n * Functionality for Mercator projection\r\n *\r\n * The function(s) below are from D3.js library (https://d3js.org/)\r\n *\r\n * ```\r\n * Copyright 2017 Mike Bostock\r\n *\r\n * Redistribution and use in source and binary forms, with or without\r\n * modification, are permitted provided that the following conditions are met:\r\n *\r\n * 1. Redistributions of source code must retain the above copyright notice,\r\n * this list of conditions and the following disclaimer.\r\n *\r\n * 2. Redistributions in binary form must reproduce the above copyright notice,\r\n * this list of conditions and the following disclaimer in the documentation\r\n * and/or other materials provided with the distribution.\r\n *\r\n * 3. Neither the name of the copyright holder nor the names of its\r\n * contributors may be used to endorse or promote products derived from this\r\n * software without specific prior written permission.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\r\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\r\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\r\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\r\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n * ```\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Projection } from \"./Projection\";\r\nimport { registry } from \"../../../core/Registry\";\r\nimport * as d3geo from \"d3-geo\";\r\n/**\r\n * Orthographic projection.\r\n */\r\nvar Stereographic = /** @class */ (function (_super) {\r\n __extends(Stereographic, _super);\r\n function Stereographic() {\r\n var _this = _super.call(this) || this;\r\n _this.d3Projection = d3geo.geoStereographic();\r\n return _this;\r\n }\r\n return Stereographic;\r\n}(Projection));\r\nexport { Stereographic };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Stereographic\"] = Stereographic;\r\n","/**\r\n * Functionality for any series-based elements, like Line Series (graphs),\r\n * Pie slice lists, etc.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Component } from \"../../core/Component\";\r\nimport { Sprite } from \"../../core/Sprite\";\r\nimport { List, ListTemplate, ListDisposer } from \"../../core/utils/List\";\r\nimport { Dictionary, DictionaryDisposer } from \"../../core/utils/Dictionary\";\r\nimport { DataItem } from \"../../core/DataItem\";\r\nimport { Container } from \"../../core/Container\";\r\nimport { Tooltip } from \"../../core/elements/Tooltip\";\r\nimport { Bullet } from \"../elements/Bullet\";\r\nimport { LegendSettings } from \"../Legend\";\r\nimport { options } from \"../../core/Options\";\r\nimport { Color } from \"../../core/utils/Color\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport * as $iter from \"../../core/utils/Iterator\";\r\nimport * as $math from \"../../core/utils/Math\";\r\nimport * as $ease from \"../../core/utils/Ease\";\r\nimport * as $utils from \"../../core/utils/Utils\";\r\nimport * as $object from \"../../core/utils/Object\";\r\nimport * as $type from \"../../core/utils/Type\";\r\nimport * as $array from \"../../core/utils/Array\";\r\nimport * as $colors from \"../../core/utils/Colors\";\r\n/**\r\n * ============================================================================\r\n * DATA ITEM\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Defines a [[DataItem]] for [[Series]].\r\n *\r\n * @see {@link DataItem}\r\n */\r\nvar SeriesDataItem = /** @class */ (function (_super) {\r\n __extends(SeriesDataItem, _super);\r\n /**\r\n * Constructor\r\n */\r\n function SeriesDataItem() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"SeriesDataItem\";\r\n //@todo Should we make `bullets` list disposable?\r\n //this._disposers.push(new DictionaryDisposer(this.bullets));\r\n _this.values.value = {};\r\n _this.values.value = {};\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n Object.defineProperty(SeriesDataItem.prototype, \"bullets\", {\r\n /**\r\n * A dictionary of data items bullets, where key is uid of a bullet template.\r\n */\r\n get: function () {\r\n if (!this._bullets) {\r\n this._bullets = new Dictionary();\r\n this._disposers.push(new DictionaryDisposer(this._bullets));\r\n }\r\n return this._bullets;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Destroys this object and all related data.\r\n */\r\n SeriesDataItem.prototype.dispose = function () {\r\n this.bullets.clear();\r\n _super.prototype.dispose.call(this);\r\n };\r\n Object.defineProperty(SeriesDataItem.prototype, \"value\", {\r\n /**\r\n * @return Value\r\n */\r\n get: function () {\r\n return this.values.value.value;\r\n },\r\n /**\r\n * data items's numeric value.\r\n *\r\n * @param value Value\r\n */\r\n set: function (value) {\r\n this.setValue(\"value\", value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return SeriesDataItem;\r\n}(DataItem));\r\nexport { SeriesDataItem };\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Defines base class for any kind of serial data.\r\n *\r\n * @see {@link ISeriesEvents} for a list of available Events\r\n * @see {@link ISeriesAdapters} for a list of available Adapters\r\n * @todo Separate axis-related stuff to some other class so that MapSeries would not have unrelated stuff\r\n */\r\nvar Series = /** @class */ (function (_super) {\r\n __extends(Series, _super);\r\n /**\r\n * Constructor\r\n */\r\n function Series() {\r\n var _this = _super.call(this) || this;\r\n /**\r\n * Should this series excluded from the axis scale calculations?\r\n *\r\n * @default false\r\n */\r\n _this._ignoreMinMax = false;\r\n /**\r\n * Should series' bullets?\r\n *\r\n * @default true\r\n */\r\n _this._showBullets = true;\r\n /**\r\n * Settings for the appearance of the related legend items.\r\n */\r\n _this.legendSettings = new LegendSettings();\r\n /**\r\n * Lowest overal values by type.\r\n */\r\n _this._tmin = new Dictionary();\r\n /**\r\n * Highest overal values by type.\r\n */\r\n _this._tmax = new Dictionary();\r\n /**\r\n * Lowest values in current selection by type.\r\n */\r\n _this._smin = new Dictionary();\r\n /**\r\n * Highest values in current selection by type.\r\n */\r\n _this._smax = new Dictionary();\r\n /**\r\n * [dataItemsByAxis description]\r\n *\r\n * Both by category and date.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\n _this.dataItemsByAxis = new Dictionary();\r\n /**\r\n * Normally series items are focusable using keyboard, so that people can\r\n * select them with a TAB key. However, if there are a lot of data points on\r\n * screen it might be long and useless to tab through all o fthem.\r\n *\r\n * This is where `skipFocusThreshold` comes in. If there are more items than\r\n * the value set here, we will not make those focusable and rather let screen\r\n * reader software rely on the series summary, or authors provide alternative\r\n * detailed information display, such as HTML table.\r\n *\r\n * Different series might have different threshold defaults.\r\n */\r\n _this.skipFocusThreshold = 20;\r\n /**\r\n * Used to indicate if `itemReaderText` was changed \"from the outside\".\r\n */\r\n _this._itemReaderTextChanged = false;\r\n /**\r\n * Most of the series use absolute values. However sometimes various\r\n * calculated percent values are need, e.g. item's percent representation\r\n * across all values in series, etc.\r\n *\r\n * It's a resource-intensive operation, so it is disabled by default.\r\n *\r\n * If you need percents to be calculated, e.g. for showing them in tooltips,\r\n * or creating 100% stacks, this setting needs to be set to `true`.\r\n *\r\n * NOTE: `PieChart`, which relies on slice percentages, has this\r\n * automatically set to `true`.\r\n *\r\n * @default false\r\n */\r\n _this.calculatePercent = false;\r\n /**\r\n * When `calculatePercent` is enabled and data item's percent value is\r\n * calculated, last item's real value is used instead of its working value.\r\n *\r\n * This is done for the animations when last item in series (e.g. slice in\r\n * a `PieSeries`) is hidden or shown. (if we would use real value, the\r\n * calculated percent would always be 100%).\r\n *\r\n * Sometimes there is a need (e.g. for drill-down Sunburst) to disable this\r\n * hack by setting `usePercentHack` to `false`.\r\n *\r\n * @since 4.9.13\r\n * @default true\r\n */\r\n _this.usePercentHack = true;\r\n /**\r\n * Specifies if series should be automatically disposed when removing from\r\n * chart's `series` list.\r\n *\r\n * @default true\r\n */\r\n _this.autoDispose = true;\r\n /**\r\n * When chart/series' data is processed, all kinds of derivative values are\r\n * calculated. E.g. sum, min, max, change, etc. This is a potentially\r\n * time-consuming operation, especially prominent in data-heavy charts.\r\n *\r\n * If your chart does not need those values, and you have a lot of data,\r\n * setting this to `true` might give a dramatic increase in initial chart\r\n * load speed.\r\n *\r\n * Please note, regular column and line series usage scenarios do not\r\n * require derivative values. Those come into play only when you do advanced\r\n * functionality like coloring segments of charts in different colors\r\n * depending on change between open and close values, have stacked series, or\r\n * display any of the derived values, like percent, in tooltips or bullets.\r\n *\r\n * @default false\r\n */\r\n _this.simplifiedProcessing = false;\r\n if (_this.constructor === Series) {\r\n throw new Error(\"'Series' cannot be instantiated directly. Please use a specific series type.\");\r\n }\r\n _this.className = \"Series\";\r\n _this.isMeasured = false;\r\n _this.layout = \"none\";\r\n _this.shouldClone = false;\r\n _this.setPropertyValue(\"hidden\", false);\r\n _this.axisRanges = new List();\r\n _this.axisRanges.events.on(\"inserted\", _this.processAxisRange, _this, false);\r\n _this.minBulletDistance = 0; // otherwise we'll have a lot of cases when people won't see bullets and think it's a bug\r\n _this.mainContainer = _this.createChild(Container);\r\n _this.mainContainer.shouldClone = false;\r\n _this.mainContainer.mask = _this.createChild(Sprite);\r\n _this._disposers.push(_this.mainContainer);\r\n // all bullets should go on top of lines/fills. So we add a separate container for bullets and later set it's parent to chart.bulletsContainer\r\n var bulletsContainer = _this.mainContainer.createChild(Container);\r\n _this._shouldBeReady.push(bulletsContainer);\r\n bulletsContainer.shouldClone = false;\r\n bulletsContainer.layout = \"none\";\r\n bulletsContainer.virtualParent = _this;\r\n _this._disposers.push(bulletsContainer);\r\n _this.bulletsContainer = bulletsContainer;\r\n _this.tooltip = new Tooltip();\r\n _this.tooltip.virtualParent = _this;\r\n _this._disposers.push(_this.tooltip);\r\n _this.hiddenState.transitionEasing = $ease.cubicIn;\r\n // this data item holds sums, averages, etc\r\n _this.dataItem = _this.createDataItem();\r\n _this._disposers.push(_this.dataItem);\r\n _this.dataItem.component = _this;\r\n // Apply accessibility\r\n _this.role = \"group\";\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * We need this here so that class names can be applied to bullets container.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Series.prototype.applyTheme = function () {\r\n _super.prototype.applyTheme.call(this);\r\n if (options.autoSetClassName && this.bulletsContainer) {\r\n this.bulletsContainer.className = this.className + \"-bullets\";\r\n this.bulletsContainer.setClassName();\r\n }\r\n };\r\n /**\r\n * Sets defaults that instantiate some objects that rely on parent, so they\r\n * cannot be set in constructor.\r\n */\r\n Series.prototype.applyInternalDefaults = function () {\r\n _super.prototype.applyInternalDefaults.call(this);\r\n if (!$type.hasValue(this.readerTitle)) {\r\n this.readerTitle = this.language.translate(\"Series\");\r\n }\r\n };\r\n /**\r\n * Returns a new/empty DataItem of the type appropriate for this object.\r\n *\r\n * @see {@link DataItem}\r\n * @return Data Item\r\n */\r\n Series.prototype.createDataItem = function () {\r\n return new SeriesDataItem();\r\n };\r\n Object.defineProperty(Series.prototype, \"chart\", {\r\n /**\r\n * @return Chart\r\n */\r\n get: function () {\r\n return this._chart;\r\n },\r\n /**\r\n * Chart series is used on.\r\n *\r\n * @param value Chart\r\n */\r\n set: function (value) {\r\n this._chart = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Positions bullet.\r\n *\r\n * @param bullet Sprite\r\n */\r\n Series.prototype.positionBullet = function (bullet) {\r\n // Placeholder method for extending classes to override.\r\n };\r\n /**\r\n * Decorates newly created bullet after it has been instert into the list.\r\n *\r\n * @param event List event\r\n * @todo investigate why itemReaderText is undefined\r\n */\r\n Series.prototype.processBullet = function (event) {\r\n var _this = this;\r\n var bullet = event.newValue;\r\n bullet.isTemplate = true;\r\n // Add accessibility options to bullet\r\n // If there are relatively few bullets, make them focusable\r\n this.events.once(\"datavalidated\", function (ev) {\r\n if (_this.itemsFocusable()) {\r\n bullet.focusable = true;\r\n }\r\n });\r\n this.invalidate();\r\n };\r\n /**\r\n * removes bullets\r\n *\r\n * @param event List event\r\n */\r\n Series.prototype.removeBullet = function (event) {\r\n var bullet = event.oldValue;\r\n this.dataItems.each(function (dataItem) {\r\n var eachBullet = dataItem.bullets.getKey(bullet.uid);\r\n if (eachBullet) {\r\n eachBullet.dispose();\r\n }\r\n });\r\n this.invalidate();\r\n };\r\n /**\r\n * Validates data items.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Series.prototype.validateDataItems = function () {\r\n _super.prototype.validateDataItems.call(this);\r\n this.processValues(false);\r\n };\r\n /**\r\n * Returns first value for the specific key in the series.\r\n *\r\n * @param key Key\r\n * @return Value\r\n * @todo Description\r\n * @todo Convert to propert object property iterator\r\n */\r\n Series.prototype.getFirstValue = function (key, startIndex) {\r\n // find first\r\n /*\r\n return $iter.findMap(this.dataItems.iterator(), (dataItem) => {\r\n for (let key in dataItem.values) {\r\n if ($object.hasKey(dataItem.values, key)) {\r\n let value: number = dataItem.values[key].workingValue;\r\n if ($type.isNumber(value)) {\r\n return value;\r\n }\r\n }\r\n }\r\n\r\n return null;\r\n });*/\r\n //if (startIndex > 0 && startIndex < this.dataItems.length - 1) {\r\n //startIndex++;\r\n //}\r\n for (var i = startIndex; i >= 0; i--) {\r\n var dataItem = this.dataItems.getIndex(i);\r\n var value = dataItem.getActualWorkingValue(key);\r\n if ($type.isNumber(value)) {\r\n return value;\r\n }\r\n }\r\n return null;\r\n };\r\n /**\r\n * Returns first value for the specific key in the series.\r\n *\r\n * @param key Key\r\n * @return Value\r\n * @todo Description\r\n * @todo Convert to propert object property iterator\r\n */\r\n Series.prototype.getAbsoluteFirstValue = function (key) {\r\n for (var i = 0; i < this.dataItems.length; i++) {\r\n var dataItem = this.dataItems.getIndex(i);\r\n var value = dataItem.values[key].value;\r\n if ($type.isNumber(value)) {\r\n return value;\r\n }\r\n }\r\n return null;\r\n };\r\n /**\r\n * [rangeChangeUpdate description]\r\n *\r\n * @todo Description\r\n */\r\n Series.prototype.rangeChangeUpdate = function () {\r\n _super.prototype.rangeChangeUpdate.call(this);\r\n this.processValues(true);\r\n };\r\n /**\r\n * [processValues description]\r\n *\r\n * @todo Description\r\n * @todo Convert to propert object property iterator\r\n * @param dataItems [description]\r\n */\r\n Series.prototype.processValues = function (working) {\r\n var _this = this;\r\n if (!this.simplifiedProcessing) {\r\n var dataItems = this.dataItems;\r\n var count_1 = {};\r\n var sum_1 = {};\r\n var absoluteSum_1 = {};\r\n var low_1 = {};\r\n var high_1 = {};\r\n var open_1 = {};\r\n var close_1 = {};\r\n var previous_1 = {};\r\n var first_1 = {};\r\n var absoluteFirst_1 = {};\r\n //let duration: number = 0; // todo: check if series uses selection.change or selection.change.percent and set duration to interpolationduration\r\n var startIndex_1 = $math.max(0, this.startIndex);\r\n startIndex_1 = $math.min(startIndex_1, this.dataItems.length);\r\n var endIndex = $math.min(this.endIndex, this.dataItems.length);\r\n if (!$type.isNumber(startIndex_1)) {\r\n startIndex_1 = 0;\r\n }\r\n if (!$type.isNumber(endIndex)) {\r\n endIndex = this.dataItems.length;\r\n }\r\n if (startIndex_1 > 0) {\r\n var dataItem_1 = dataItems.getIndex(startIndex_1 - 1);\r\n $object.each(dataItem_1.values, function (key, values) {\r\n var value = dataItem_1.getActualWorkingValue(key);\r\n if ($type.isNumber(value)) {\r\n // save previous\r\n previous_1[key] = value;\r\n }\r\n });\r\n }\r\n var _loop_1 = function (i) {\r\n var dataItem_2 = dataItems.getIndex(i);\r\n $object.each(dataItem_2.values, function (key, values) {\r\n var value = dataItem_2.getActualWorkingValue(key);\r\n //if (i >= startIndex && i <= endIndex) { // do not add to count, sum etc if it is not within start/end index\r\n if ($type.isNumber(value)) {\r\n // count values\r\n if (!$type.isNumber(count_1[key])) {\r\n count_1[key] = 0;\r\n }\r\n count_1[key]++;\r\n // sum values\r\n if (!$type.isNumber(sum_1[key])) {\r\n sum_1[key] = 0;\r\n }\r\n sum_1[key] += value;\r\n // absolute sum values\r\n if (!$type.isNumber(absoluteSum_1[key])) {\r\n absoluteSum_1[key] = 0;\r\n }\r\n absoluteSum_1[key] += Math.abs(value);\r\n // open\r\n if (!$type.isNumber(open_1[key])) {\r\n open_1[key] = value;\r\n }\r\n // close\r\n close_1[key] = value;\r\n // low\r\n if (!$type.isNumber(low_1[key])) {\r\n low_1[key] = value;\r\n }\r\n else {\r\n if (low_1[key] > value) {\r\n low_1[key] = value;\r\n }\r\n }\r\n // high\r\n if (!$type.isNumber(high_1[key])) {\r\n high_1[key] = value;\r\n }\r\n else {\r\n if (high_1[key] < value) {\r\n high_1[key] = value;\r\n }\r\n }\r\n if (!$type.isNumber(first_1[key])) {\r\n first_1[key] = _this.getFirstValue(key, startIndex_1);\r\n }\r\n if (!$type.isNumber(absoluteFirst_1[key])) {\r\n absoluteFirst_1[key] = _this.getAbsoluteFirstValue(key);\r\n }\r\n // change\r\n dataItem_2.setCalculatedValue(key, value - first_1[key], \"change\");\r\n // change from start percent\r\n // will fail if first value is 0\r\n dataItem_2.setCalculatedValue(key, (value - first_1[key]) / first_1[key] * 100, \"changePercent\");\r\n dataItem_2.setCalculatedValue(key, (value - absoluteFirst_1[key]), \"startChange\");\r\n dataItem_2.setCalculatedValue(key, (value - absoluteFirst_1[key]) / absoluteFirst_1[key] * 100, \"startChangePercent\");\r\n // previous change\r\n var prevValue = previous_1[key];\r\n if (!$type.isNumber(prevValue)) {\r\n prevValue = value;\r\n }\r\n dataItem_2.setCalculatedValue(key, value - prevValue, \"previousChange\");\r\n // previous change percent\r\n dataItem_2.setCalculatedValue(key, (value - prevValue) / prevValue * 100, \"previousChangePercent\");\r\n // save previous\r\n previous_1[key] = value;\r\n }\r\n });\r\n };\r\n for (var i = startIndex_1; i < endIndex; i++) {\r\n _loop_1(i);\r\n }\r\n if (this.calculatePercent) {\r\n var _loop_2 = function (i) {\r\n var dataItem_3 = dataItems.getIndex(i);\r\n $object.each(dataItem_3.values, function (key) {\r\n var ksum = absoluteSum_1[key];\r\n var value = dataItem_3.getActualWorkingValue(key);\r\n if ($type.isNumber(value)) {\r\n if (ksum > 0) {\r\n if (_this.usePercentHack) {\r\n // this hack is made in order to make it possible to animate single slice to 0\r\n // if there is only one slice left, percent value is always 100%, so it won't animate\r\n // so we use real value of a slice instead of current value\r\n if (value == ksum) {\r\n ksum = dataItem_3.values[key].value;\r\n }\r\n }\r\n var percent = value / ksum * 100;\r\n dataItem_3.setCalculatedValue(key, percent, \"percent\");\r\n }\r\n else {\r\n dataItem_3.setCalculatedValue(key, 0, \"percent\");\r\n }\r\n }\r\n });\r\n };\r\n for (var i = startIndex_1; i < endIndex; i++) {\r\n _loop_2(i);\r\n }\r\n }\r\n // calculate one before first (cant do that in cycle, as we don't know open yet\r\n // when drawing line chart we should draw line to the invisible data point to the left, otherwise the line will always look like it starts from the selected point\r\n // so we do startIndex - 1\r\n if (startIndex_1 > 0) {\r\n var zeroItem_1 = dataItems.getIndex(startIndex_1 - 1);\r\n $object.each(zeroItem_1.values, function (key) {\r\n var value = zeroItem_1.values[key].value;\r\n // change\r\n zeroItem_1.setCalculatedValue(key, value - open_1[key], \"change\");\r\n // change percent\r\n zeroItem_1.setCalculatedValue(key, (value - open_1[key]) / open_1[key] * 100, \"changePercent\");\r\n });\r\n }\r\n // we save various data like sum, average to dataPoint of the series\r\n var dataItem_4 = this.dataItem;\r\n $object.each(dataItem_4.values, function (key) {\r\n dataItem_4.setCalculatedValue(key, sum_1[key], \"sum\");\r\n dataItem_4.setCalculatedValue(key, absoluteSum_1[key], \"absoluteSum\");\r\n dataItem_4.setCalculatedValue(key, sum_1[key] / count_1[key], \"average\");\r\n dataItem_4.setCalculatedValue(key, open_1[key], \"open\");\r\n dataItem_4.setCalculatedValue(key, close_1[key], \"close\");\r\n dataItem_4.setCalculatedValue(key, low_1[key], \"low\");\r\n dataItem_4.setCalculatedValue(key, high_1[key], \"high\");\r\n dataItem_4.setCalculatedValue(key, count_1[key], \"count\");\r\n });\r\n }\r\n };\r\n /**\r\n * (Re)validates the whole series, effectively causing it to redraw.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Series.prototype.validate = function () {\r\n if ($utils.isIE()) {\r\n this.filters.clear();\r\n }\r\n $iter.each(this.axisRanges.iterator(), function (axisRange) {\r\n //axisRange.contents.disposeChildren(); // not good for columns, as they are reused\r\n //\t\t\taxisRange.appendChildren();\r\n axisRange.validate();\r\n });\r\n _super.prototype.validate.call(this);\r\n var bulletsContainer = this.bulletsContainer;\r\n bulletsContainer.fill = this.fill;\r\n bulletsContainer.stroke = this.stroke;\r\n bulletsContainer.x = this.pixelX;\r\n bulletsContainer.y = this.pixelY;\r\n if (this.bulletsContainer.children.length > 0) {\r\n if (this._showBullets) {\r\n for (var i = 0; i < this.startIndex; i++) {\r\n var dataItem = this.dataItems.getIndex(i);\r\n if (dataItem) {\r\n dataItem.bullets.each(function (key, bullet) {\r\n bullet.__disabled = true;\r\n });\r\n }\r\n }\r\n for (var i = this.dataItems.length - 1; i > this.endIndex; i--) {\r\n var dataItem = this.dataItems.getIndex(i);\r\n if (dataItem) {\r\n dataItem.bullets.each(function (key, bullet) {\r\n bullet.__disabled = true;\r\n });\r\n }\r\n }\r\n }\r\n else {\r\n this.bulletsContainer.children.each(function (bullet) {\r\n bullet.__disabled = true;\r\n });\r\n }\r\n }\r\n this.updateTooltipBounds();\r\n };\r\n /**\r\n * @ignore\r\n */\r\n Series.prototype.updateTooltipBounds = function () {\r\n if (this.topParent) {\r\n var x = 0;\r\n var y = 0;\r\n var w = this.topParent.maxWidth;\r\n var h = this.topParent.maxHeight;\r\n var rect = { x: x, y: y, width: w, height: h };\r\n this.tooltip.setBounds(rect);\r\n }\r\n };\r\n Series.prototype.shouldCreateBullet = function (dataItem, bulletTemplate) {\r\n return true;\r\n };\r\n /**\r\n * Validates data item's element, effectively redrawing it.\r\n *\r\n * @ignore Exclude from docs\r\n * @param dataItem Data item\r\n */\r\n Series.prototype.validateDataElement = function (dataItem) {\r\n var _this = this;\r\n _super.prototype.validateDataElement.call(this, dataItem);\r\n if (this._showBullets) {\r\n if (!this.isHidden) {\r\n this.bulletsContainer.visible = true;\r\n }\r\n this.bullets.each(function (bulletTemplate) {\r\n // always better to use the same, this helps to avoid redrawing\r\n var bullet = dataItem.bullets.getKey(bulletTemplate.uid);\r\n if (_this.shouldCreateBullet(dataItem, bulletTemplate)) {\r\n if (!bullet) {\r\n var disabledField = bulletTemplate.propertyFields.disabled;\r\n var dataContext = dataItem.dataContext;\r\n if (disabledField && dataContext && dataContext[disabledField] === false) {\r\n bulletTemplate.applyOnClones = false;\r\n bulletTemplate.disabled = false;\r\n bullet = bulletTemplate.clone();\r\n bulletTemplate.disabled = true;\r\n bulletTemplate.applyOnClones = true;\r\n }\r\n else {\r\n bullet = bulletTemplate.clone();\r\n }\r\n bullet.shouldClone = false;\r\n dataItem.addSprite(bullet);\r\n if (!_this.visible || _this.isHiding) {\r\n bullet.hide(0);\r\n }\r\n }\r\n var currentDataItem = bullet.dataItem;\r\n if (currentDataItem != dataItem) {\r\n // set to undefined in order not to reuse\r\n if (currentDataItem) {\r\n currentDataItem.bullets.setKey(bulletTemplate.uid, undefined);\r\n }\r\n var readerText_1 = _this.itemReaderText;\r\n if (bullet instanceof Bullet) {\r\n if (!readerText_1) {\r\n readerText_1 = (\"{\" + bullet.xField + \"}: {\" + bullet.yField + \"}\");\r\n }\r\n if (bullet.isDynamic) {\r\n dataItem.events.on(\"workingvaluechanged\", bullet.deepInvalidate, bullet, false);\r\n //dataItem.events.on(\"calculatedvaluechanged\", bullet.deepInvalidate, bullet, false);\r\n _this.dataItem.events.on(\"workingvaluechanged\", bullet.deepInvalidate, bullet, false);\r\n }\r\n bullet.deepInvalidate();\r\n }\r\n // Add accessibility to bullet\r\n if (bullet.focusable) {\r\n bullet.events.on(\"focus\", function (ev) {\r\n bullet.readerTitle = _this.populateString(readerText_1, bullet.dataItem);\r\n }, undefined, false);\r\n bullet.events.on(\"blur\", function (ev) {\r\n bullet.readerTitle = \"\";\r\n }, undefined, false);\r\n }\r\n if (bullet.hoverable) {\r\n bullet.events.on(\"over\", function (ev) {\r\n bullet.readerTitle = _this.populateString(readerText_1, bullet.dataItem);\r\n }, undefined, false);\r\n bullet.events.on(\"out\", function (ev) {\r\n bullet.readerTitle = \"\";\r\n }, undefined, false);\r\n }\r\n }\r\n bullet.parent = _this.bulletsContainer;\r\n dataItem.bullets.setKey(bulletTemplate.uid, bullet);\r\n // pass max w/h so we'd know if we should show/hide somethings\r\n bullet.maxWidth = dataItem.itemWidth;\r\n bullet.maxHeight = dataItem.itemHeight;\r\n bullet.__disabled = false;\r\n _this.positionBullet(bullet);\r\n }\r\n else {\r\n if (bullet) {\r\n bullet.__disabled = true;\r\n }\r\n }\r\n });\r\n }\r\n else {\r\n this.bulletsContainer.visible = false;\r\n }\r\n };\r\n /**\r\n * [handleDataItemWorkingValueChange description]\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Series.prototype.handleDataItemWorkingValueChange = function (dataItem, name) {\r\n if (!this.dataRangeInvalid) {\r\n this.invalidateProcessedData();\r\n }\r\n };\r\n Object.defineProperty(Series.prototype, \"ignoreMinMax\", {\r\n /**\r\n * @return Exclude from calculations?\r\n */\r\n get: function () {\r\n return this._ignoreMinMax;\r\n },\r\n /**\r\n * Should this series excluded from the axis scale calculations?\r\n *\r\n * @default false\r\n * @param value Exclude from calculations?\r\n */\r\n set: function (value) {\r\n this._ignoreMinMax = value;\r\n this.invalidateDataItems();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Create a mask for the series.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Series.prototype.createMask = function () {\r\n // A placeholder method for extending classes to override.\r\n };\r\n /**\r\n * Process axis range after it has been added to the list.\r\n *\r\n * @param event Event\r\n */\r\n Series.prototype.processAxisRange = function (event) {\r\n // create container if not existing\r\n if (!this.rangesContainer) {\r\n this.rangesContainer = this.createChild(Container);\r\n this.rangesContainer.shouldClone = false;\r\n this.rangesContainer.isMeasured = false;\r\n }\r\n var axisRange = event.newValue;\r\n if (axisRange) {\r\n axisRange.contents.parent = this.rangesContainer;\r\n axisRange.isRange = true;\r\n axisRange.events.on(\"valuechanged\", this.invalidateDataItems, this, false);\r\n }\r\n };\r\n /**\r\n * [getAxisField description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param axis [description]\r\n * @return [description]\r\n */\r\n Series.prototype.getAxisField = function (axis) {\r\n return;\r\n };\r\n /**\r\n * Shows the tooltip at specific position.\r\n *\r\n * @ignore Exclude from docs\r\n * @param xPosition X\r\n * @param yPosition Y\r\n */\r\n Series.prototype.showTooltipAtPosition = function (xPosition, yPosition) {\r\n // Placeholder method for extending classes to override.\r\n };\r\n Object.defineProperty(Series.prototype, \"minBulletDistance\", {\r\n /**\r\n * @return Distance (px)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"minBulletDistance\");\r\n },\r\n /**\r\n * Minimal distance between data points in pixels.\r\n *\r\n * If distance gets smaller than this, bullets are turned off to avoid\r\n * overlapping.\r\n *\r\n * `0` (zero) disables this behavior.\r\n *\r\n * IMPORTANT: This setting will work only when Series' base axis\r\n * is [[CategoryAxis]] or [[DateAxis]]. If base axis is [[ValueAxis]] the\r\n * setting will be ignored, because it would be a huge overhead to measure\r\n * distance between each and every bullet.\r\n *\r\n * @default 0\r\n * @param value Distance (px)\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"minBulletDistance\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Series.prototype, \"bullets\", {\r\n /**\r\n * A list of bullets that will be added to each and every items in the\r\n * series.\r\n *\r\n * You can push any object that is a descendant of a [[Sprite]] here. All\r\n * items added to this list will be copied and used as a bullet on all data\r\n * items, including their properties, events, etc.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/bullets/} for more info about the concept of Bullets\r\n * @return List of bullets.\r\n */\r\n get: function () {\r\n if (!this._bullets) {\r\n this._bullets = new ListTemplate(new Bullet());\r\n this._bullets.template.virtualParent = this;\r\n this._bullets.events.on(\"inserted\", this.processBullet, this, false);\r\n this._bullets.events.on(\"removed\", this.removeBullet, this, false);\r\n this._disposers.push(new ListDisposer(this._bullets));\r\n this._disposers.push(this._bullets.template);\r\n }\r\n return this._bullets;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Binds related legend data item's visual settings to this series' visual\r\n * settings.\r\n *\r\n * @ignore Exclude from docs\r\n * @param marker Legend item container\r\n */\r\n Series.prototype.createLegendMarker = function (marker) {\r\n // This is a placeholder method for extending classes to override.\r\n };\r\n Object.defineProperty(Series.prototype, \"hiddenInLegend\", {\r\n /**\r\n * @return Hidden in legend?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"hiddenInLegend\");\r\n },\r\n /**\r\n * Should the series be hidden in legend?\r\n *\r\n * @param value Hidden in legend?\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"hiddenInLegend\", value)) {\r\n if (this.chart) {\r\n this.chart.feedLegend();\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Series.prototype, \"name\", {\r\n /**\r\n * @return Name\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"name\");\r\n },\r\n /**\r\n * Series' name.\r\n *\r\n * @param value Name\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"name\", value);\r\n var legendDataItem = this.legendDataItem;\r\n if (legendDataItem) {\r\n legendDataItem.component.invalidate();\r\n legendDataItem.component.invalidateRawData();\r\n }\r\n this.readerTitle = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Series.prototype, \"itemReaderText\", {\r\n /**\r\n * @return Screen reader text template\r\n */\r\n get: function () {\r\n // Get explicitly set reader text\r\n var readerText = this._itemReaderText;\r\n // Not set? Let's try something else\r\n if (!readerText) {\r\n // Tooltip text?\r\n if (this.tooltipText) {\r\n readerText = $utils.plainText(this.tooltipText);\r\n }\r\n else if (this.tooltipHTML) {\r\n readerText = $utils.plainText(this.tooltipHTML);\r\n }\r\n }\r\n if (!this._adapterO) {\r\n return readerText;\r\n }\r\n else {\r\n return this._adapterO.apply(\"itemReaderText\", readerText);\r\n }\r\n },\r\n /**\r\n * Screen reader text to be applied to each individual data item, such\r\n * as bullets, columns or slices.\r\n *\r\n * The template can contain field reference meta codes, i.e. `{dateX}`,\r\n * `{valueY}`, etc.\r\n *\r\n * Any text formatting options, e.g. `[bold]` will be ignored.\r\n *\r\n * @param value Screen reader text template\r\n */\r\n set: function (value) {\r\n this._itemReaderText = value;\r\n this._itemReaderTextChanged = true;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Returns if number of data items in the series are beyond non-focusable\r\n * count and should not be available for TAB-through.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Items focusable?\r\n */\r\n Series.prototype.itemsFocusable = function () {\r\n return this.dataItems.length >= this.skipFocusThreshold ? false : true;\r\n };\r\n Object.defineProperty(Series.prototype, \"legendDataItem\", {\r\n /**\r\n * @return Data item\r\n */\r\n get: function () {\r\n return this._legendDataItem;\r\n },\r\n /**\r\n * Legend data item that corresponds to this series.\r\n *\r\n * @param value Data item\r\n */\r\n set: function (value) {\r\n this._legendDataItem = value;\r\n this._legendDataItem.itemContainer.deepInvalidate();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Updates corresponding legend data item with current values.\r\n *\r\n * @ignore Exclude from docs\r\n * @param dataItem Data item\r\n */\r\n Series.prototype.updateLegendValue = function (dataItem, notRange) {\r\n // if this series has legend item\r\n if (this.legendDataItem) {\r\n var legendSettings = this.legendSettings;\r\n var legendDataItem = this.legendDataItem;\r\n var label = legendDataItem.label;\r\n var valueLabel = legendDataItem.valueLabel;\r\n // update legend\r\n if ((dataItem && !dataItem.isDisposed()) || notRange) {\r\n if (valueLabel) {\r\n if (legendSettings.itemValueText) {\r\n valueLabel.text = legendSettings.itemValueText;\r\n }\r\n valueLabel.dataItem = dataItem;\r\n }\r\n if (label) {\r\n if (legendSettings.itemLabelText) {\r\n label.text = legendSettings.itemLabelText;\r\n }\r\n label.dataItem = dataItem;\r\n }\r\n }\r\n else {\r\n if (label) {\r\n // if itemLabelText is set, means we have to reset label even if labelText is not set\r\n if (legendSettings.labelText || legendSettings.itemLabelText != undefined) {\r\n label.text = legendSettings.labelText;\r\n }\r\n label.dataItem = this.dataItem;\r\n }\r\n if (valueLabel) {\r\n if (legendSettings.valueText || legendSettings.itemValueText != undefined) {\r\n valueLabel.text = legendSettings.valueText;\r\n }\r\n valueLabel.dataItem = this.dataItem;\r\n }\r\n }\r\n }\r\n };\r\n /**\r\n * Copies all properties from another instance of [[Series]].\r\n *\r\n * @param source Source series\r\n */\r\n Series.prototype.copyFrom = function (source) {\r\n this.bullets.copyFrom(source.bullets);\r\n this.bulletsContainer.copyFrom(source.bulletsContainer);\r\n this.calculatePercent = source.calculatePercent;\r\n this.usePercentHack = source.usePercentHack;\r\n this.simplifiedProcessing = source.simplifiedProcessing;\r\n _super.prototype.copyFrom.call(this, source);\r\n };\r\n /**\r\n * Displays a modal or console message with error, and halts any further\r\n * processing of this element.\r\n *\r\n * @param e Error\r\n */\r\n Series.prototype.raiseCriticalError = function (e) {\r\n if (this._chart && this._chart.modal) {\r\n this._chart.modal.content = this._chart.adapter.apply(\"criticalError\", e).message;\r\n this._chart.modal.closable = false;\r\n if (!options.suppressErrors) {\r\n this._chart.modal.open();\r\n }\r\n this._chart.disabled = true;\r\n }\r\n if (options.verbose) {\r\n console.log(e);\r\n }\r\n };\r\n /**\r\n * Applies filters to the element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Series.prototype.applyFilters = function () {\r\n var _this = this;\r\n _super.prototype.applyFilters.call(this);\r\n this.bulletsContainer.filters.clear();\r\n // copyFrom of a list copies, does not clone\r\n $iter.each(this.filters.iterator(), function (filter) {\r\n _this.bulletsContainer.filters.push(filter.clone());\r\n });\r\n };\r\n Object.defineProperty(Series.prototype, \"heatRules\", {\r\n /**\r\n * A list of heat rules to apply to series' elements based on the value\r\n * of the data item.\r\n *\r\n * Heat rules can be any \"numeric\" (including `Color`) property, and can also\r\n * be applied to child objects of series, like columns, bullets, etc.\r\n *\r\n * E.g.:\r\n *\r\n * ```TypeScript\r\n * series.heatRules.push({\r\n * \"target\": series.columns.template,\r\n * \"property\": \"fill\",\r\n * \"min\": am4core.color(\"#F5DBCB\"),\r\n * \"max\": am4core.color(\"#ED7B84\"),\r\n * \"dataField\": \"valueY\"\r\n *});\r\n *```\r\n * ```Javacript\r\n * series.heatRules.push({\r\n * \"target\": series.columns.template,\r\n * \"property\": \"fill\",\r\n * \"min\": am4core.color(\"#F5DBCB\"),\r\n * \"max\": am4core.color(\"#ED7B84\"),\r\n * \"dataField\": \"valueY\"\r\n *});\r\n *```\r\n *```JSON\r\n *{\r\n * // ...\r\n * \"series\": [{\r\n * \"type\": \"ColumnSeries\",\r\n * \"heatRules\": [{\r\n * \"target\": \"columns.template\",\r\n * \"property\": \"fill\",\r\n * \"min\": \"#F5DBCB\",\r\n * \"max\": \"#ED7B84\",\r\n * \"dataField\": \"valueY\"\r\n * }]\r\n * }]\r\n *}\r\n *```\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/series/#Heat_maps} for more about heat rules\r\n * @return Heat rules\r\n */\r\n get: function () {\r\n var _this = this;\r\n if (!this._heatRules) {\r\n this._heatRules = new List();\r\n this._heatRules.events.on(\"inserted\", function (event) {\r\n var heatRule = event.newValue;\r\n var target = heatRule.target;\r\n if (target) {\r\n var dataField_1 = heatRule.dataField;\r\n if (!$type.hasValue(dataField_1)) {\r\n dataField_1 = \"value\";\r\n }\r\n var seriesDataItem_1 = _this.dataItem;\r\n var property_1 = heatRule.property;\r\n var minValue = $type.toNumber(heatRule.minValue);\r\n var maxValue = $type.toNumber(heatRule.maxValue);\r\n if (!$type.isNumber(minValue) && !$type.isNumber(maxValue)) {\r\n _this.dataItem.events.on(\"calculatedvaluechanged\", function (event) {\r\n if (event.property == dataField_1) {\r\n $iter.each(_this.dataItems.iterator(), function (dataItem) {\r\n var foundSprite = false;\r\n $array.each(dataItem.sprites, function (sprite) {\r\n if (sprite.clonedFrom == target) {\r\n var anySprite = sprite;\r\n anySprite[property_1] = anySprite[property_1];\r\n foundSprite = true;\r\n }\r\n });\r\n if (!foundSprite) {\r\n $array.each(dataItem.sprites, function (sprite) {\r\n if (sprite instanceof Container) {\r\n $iter.each(sprite.children.iterator(), function (child) {\r\n if (child.className == target.className) {\r\n var anyChild = child;\r\n anyChild[property_1] = anyChild[property_1];\r\n }\r\n // giveup here\r\n else if (child instanceof Container) {\r\n child.deepInvalidate();\r\n }\r\n });\r\n }\r\n });\r\n }\r\n });\r\n }\r\n });\r\n }\r\n _this.dataItems.template.events.on(\"workingvaluechanged\", function (event) {\r\n if (event.property == dataField_1) {\r\n var dataItem = event.target;\r\n var foundSprite_1 = false;\r\n $array.each(dataItem.sprites, function (sprite) {\r\n if (sprite.clonedFrom == target) {\r\n var anySprite = sprite;\r\n anySprite[property_1] = anySprite[property_1];\r\n foundSprite_1 = true;\r\n }\r\n });\r\n if (!foundSprite_1) {\r\n $array.each(dataItem.sprites, function (sprite) {\r\n if (sprite instanceof Container) {\r\n $iter.each(sprite.children.iterator(), function (child) {\r\n if (child.className == target.className) {\r\n var anyChild = child;\r\n anyChild[property_1] = anyChild[property_1];\r\n }\r\n // givup here\r\n else if (child instanceof Container) {\r\n child.deepInvalidate();\r\n }\r\n });\r\n }\r\n });\r\n }\r\n }\r\n });\r\n target.adapter.add(property_1, function (value, ruleTarget, property) {\r\n var minValue = $type.toNumber(heatRule.minValue);\r\n var maxValue = $type.toNumber(heatRule.maxValue);\r\n var min = heatRule.min;\r\n var max = heatRule.max;\r\n if (ruleTarget instanceof Sprite) {\r\n var anySprite = ruleTarget;\r\n var propertyField = anySprite.propertyFields[property];\r\n if (propertyField && ruleTarget.dataItem) {\r\n var dataContext = ruleTarget.dataItem.dataContext;\r\n if (dataContext && $type.hasValue(dataContext[propertyField])) {\r\n return value;\r\n }\r\n }\r\n }\r\n var dataItem = ruleTarget.dataItem;\r\n if (!$type.isNumber(minValue)) {\r\n minValue = seriesDataItem_1.values[dataField_1].low;\r\n }\r\n if (!$type.isNumber(maxValue)) {\r\n maxValue = seriesDataItem_1.values[dataField_1].high;\r\n }\r\n if (dataItem) {\r\n var fieldValues = dataItem.values[dataField_1];\r\n if (fieldValues) {\r\n var workingValue = dataItem.getActualWorkingValue(dataField_1);\r\n if ($type.hasValue(min) && $type.hasValue(max) && $type.isNumber(minValue) && $type.isNumber(maxValue) && $type.isNumber(workingValue)) {\r\n var percent = void 0;\r\n if (heatRule.logarithmic) {\r\n percent = (Math.log(workingValue) * Math.LOG10E - Math.log(minValue) * Math.LOG10E) / ((Math.log(maxValue) * Math.LOG10E - Math.log(minValue) * Math.LOG10E));\r\n }\r\n else {\r\n percent = (workingValue - minValue) / (maxValue - minValue);\r\n }\r\n if ($type.isNumber(workingValue) && (!$type.isNumber(percent) || Math.abs(percent) == Infinity)) {\r\n percent = 0.5;\r\n }\r\n // fixes problems if all values are the same\r\n if ($type.isNumber(min)) {\r\n return min + (max - min) * percent;\r\n }\r\n else if (min instanceof Color) {\r\n return new Color($colors.interpolate(min.rgb, max.rgb, percent));\r\n }\r\n }\r\n }\r\n }\r\n return value;\r\n });\r\n }\r\n });\r\n }\r\n return this._heatRules;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Processes JSON-based config before it is applied to the object.\r\n *\r\n * @ignore Exclude from docs\r\n * @param config Config\r\n */\r\n Series.prototype.processConfig = function (config) {\r\n var heatRules;\r\n if (config) {\r\n // Set up bullets\r\n if ($type.hasValue(config.bullets) && $type.isArray(config.bullets)) {\r\n for (var i = 0, len = config.bullets.length; i < len; i++) {\r\n var bullets = config.bullets[i];\r\n if (!$type.hasValue(bullets.type)) {\r\n bullets.type = \"Bullet\";\r\n }\r\n }\r\n }\r\n // Let's take heatRules out of the config, so that we can process\r\n // them later, when bullets are already there\r\n if ($type.hasValue(config.heatRules) && $type.isArray(config.heatRules)) {\r\n heatRules = config.heatRules;\r\n delete config.heatRules;\r\n }\r\n }\r\n _super.prototype.processConfig.call(this, config);\r\n // Process heat rules again, when all other elements are ready\r\n if (heatRules) {\r\n for (var i = 0, len = heatRules.length; i < len; i++) {\r\n var rule = heatRules[i];\r\n // Resolve target\r\n var target = this;\r\n if ($type.hasValue(rule.target) && $type.isString(rule.target)) {\r\n // Check if we can find this element by id\r\n if (this.map.hasKey(rule.target)) {\r\n target = this.map.getKey(rule.target);\r\n }\r\n else {\r\n var parts = rule.target.split(\".\");\r\n for (var x = 0; x < parts.length; x++) {\r\n if (target instanceof List) {\r\n var listitem = target.getIndex($type.toNumber(parts[x]));\r\n if (!listitem) {\r\n target = target[parts[x]];\r\n }\r\n else {\r\n target = listitem;\r\n }\r\n }\r\n else {\r\n var maybeIndex = parts[x].match(/^(.*)\\[([0-9]+)\\]/);\r\n if (maybeIndex) {\r\n if (target[maybeIndex[1]] instanceof List) {\r\n target = target[maybeIndex[1]].getIndex($type.toNumber(maybeIndex[2]));\r\n }\r\n else {\r\n target = target[maybeIndex[1]][$type.toNumber(maybeIndex[2])];\r\n }\r\n }\r\n else {\r\n target = target[parts[x]];\r\n }\r\n }\r\n }\r\n }\r\n }\r\n rule.target = target;\r\n // Resolve colors and percents\r\n if ($type.hasValue(rule.min)) {\r\n rule.min = this.maybeColorOrPercent(rule.min);\r\n }\r\n if ($type.hasValue(rule.max)) {\r\n rule.max = this.maybeColorOrPercent(rule.max);\r\n }\r\n }\r\n _super.prototype.processConfig.call(this, {\r\n heatRules: heatRules\r\n });\r\n }\r\n };\r\n /**\r\n * Returns visibility value\r\n * @ignore\r\n */\r\n /*\r\n protected getVisibility(): boolean {\r\n let hidden = this.getPropertyValue(\"hidden\");\r\n if (hidden) {\r\n return false;\r\n }\r\n else {\r\n return super.getVisibility();\r\n }\r\n }*/\r\n /**\r\n * This function is used to sort element's JSON config properties, so that\r\n * some properties that absolutely need to be processed last, can be put at\r\n * the end.\r\n *\r\n * @ignore Exclude from docs\r\n * @param a Element 1\r\n * @param b Element 2\r\n * @return Sorting number\r\n */\r\n Series.prototype.configOrder = function (a, b) {\r\n if (a == b) {\r\n return 0;\r\n }\r\n // Must come last\r\n else if (a == \"heatRules\") {\r\n return 1;\r\n }\r\n else if (b == \"heatRules\") {\r\n return -1;\r\n }\r\n else {\r\n return _super.prototype.configOrder.call(this, a, b);\r\n }\r\n };\r\n /**\r\n * Sets `visibility` property:\r\n *\r\n * * `true` - visible\r\n * * `false` - hidden\r\n *\r\n * @param value true - visible, false - hidden\r\n * @return Current visibility\r\n */\r\n Series.prototype.setVisibility = function (value) {\r\n _super.prototype.setVisibility.call(this, value);\r\n this.bulletsContainer.visible = value;\r\n };\r\n return Series;\r\n}(Component));\r\nexport { Series };\r\n/**\r\n * Register class, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Series\"] = Series;\r\nregistry.registeredClasses[\"SeriesDataItem\"] = SeriesDataItem;\r\n","/**\r\n * Map module.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { SerialChart, SerialChartDataItem } from \"./SerialChart\";\r\nimport { Disposer } from \"../../core/utils/Disposer\";\r\nimport { InterfaceColorSet } from \"../../core/utils/InterfaceColorSet\";\r\nimport { MapSeries } from \"../map/MapSeries\";\r\nimport { MapImage } from \"../map/MapImage\";\r\nimport { MapPolygon } from \"../map/MapPolygon\";\r\nimport { MapPolygonSeries } from \"../map/MapPolygonSeries\";\r\nimport { Projection } from \"../map/projections/Projection\";\r\nimport { Circle } from \"../../core/elements/Circle\";\r\nimport { SmallMap } from \"../map/SmallMap\";\r\nimport * as $mapUtils from \"../map/MapUtils\";\r\nimport { keyboard } from \"../../core/utils/Keyboard\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport { options } from \"../../core/Options\";\r\nimport * as $math from \"../../core/utils/Math\";\r\nimport * as $utils from \"../../core/utils/Utils\";\r\nimport * as $ease from \"../../core/utils/Ease\";\r\nimport * as $iter from \"../../core/utils/Iterator\";\r\nimport * as $type from \"../../core/utils/Type\";\r\nimport * as $geo from \"../map/Geo\";\r\nimport { GraticuleSeries } from \"../map/GraticuleSeries\";\r\nimport { getInteraction } from \"../../core/interaction/Interaction\";\r\n/**\r\n * ============================================================================\r\n * DATA ITEM\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Defines a [[DataItem]] for [[MapChart]].\r\n *\r\n * @see {@link DataItem}\r\n */\r\nvar MapChartDataItem = /** @class */ (function (_super) {\r\n __extends(MapChartDataItem, _super);\r\n /**\r\n * Constructor\r\n */\r\n function MapChartDataItem() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"MapChartDataItem\";\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n return MapChartDataItem;\r\n}(SerialChartDataItem));\r\nexport { MapChartDataItem };\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Creates a map.\r\n *\r\n * @see {@link IMapChartEvents} for a list of available Events\r\n * @see {@link IMapChartAdapters} for a list of available Adapters\r\n * @see {@link https://www.amcharts.com/docs/v4/chart-types/map/} for documentation\r\n */\r\nvar MapChart = /** @class */ (function (_super) {\r\n __extends(MapChart, _super);\r\n /**\r\n * Constructor\r\n */\r\n function MapChart() {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n /**\r\n * A ratio to be used when scaling the map shapes.\r\n *\r\n * @readonly\r\n */\r\n _this.scaleRatio = 1;\r\n /**\r\n * Default duration of zoom animations (ms).\r\n */\r\n _this.zoomDuration = 1000;\r\n /**\r\n * Default zooming animation easing function.\r\n */\r\n _this.zoomEasing = $ease.cubicOut;\r\n /**\r\n * Smallest available zoom level. The map will not allow to zoom out past\r\n * this setting.\r\n *\r\n * NOTE: Should be power of 2.\r\n *\r\n * @default 1\r\n */\r\n _this.minZoomLevel = 1;\r\n /**\r\n * Biggest available zoom level. The map will not allow to zoom in past\r\n * this setting.\r\n *\r\n * NOTE: Should be power of 2.\r\n *\r\n * @default 32\r\n */\r\n _this.maxZoomLevel = 32;\r\n /**\r\n * [_prevZoomGeoPoint description]\r\n *\r\n * @todo Description\r\n */\r\n _this._prevZoomGeoPoint = { latitude: 0, longitude: 0 };\r\n _this.className = \"MapChart\";\r\n // Set default projection\r\n _this.projection = new Projection();\r\n _this.setPropertyValue(\"deltaLatitude\", 0);\r\n _this.setPropertyValue(\"deltaLongitude\", 0);\r\n _this.setPropertyValue(\"deltaGamma\", 0);\r\n _this.maxPanOut = 0.7;\r\n _this.homeZoomLevel = 1;\r\n _this.zoomStep = 2;\r\n _this.layout = \"absolute\";\r\n _this.centerMapOnZoomOut = true;\r\n // Set padding\r\n _this.padding(0, 0, 0, 0);\r\n $utils.used(_this.backgroundSeries);\r\n // so that the map would render in a hidden div too\r\n _this.minWidth = 10;\r\n _this.minHeight = 10;\r\n _this.events.once(\"inited\", _this.handleAllInited, _this, false);\r\n // Create a container for map series\r\n var seriesContainer = _this.seriesContainer;\r\n seriesContainer.visible = false;\r\n seriesContainer.inert = true;\r\n seriesContainer.resizable = true;\r\n seriesContainer.events.on(\"transformed\", _this.handleMapTransform, _this, false);\r\n seriesContainer.events.on(\"doublehit\", _this.handleDoubleHit, _this, false);\r\n seriesContainer.events.on(\"dragged\", _this.handleDrag, _this, false);\r\n seriesContainer.zIndex = 0;\r\n seriesContainer.dragWhileResize = true;\r\n //seriesContainer.background.fillOpacity = 0;\r\n seriesContainer.adapter.add(\"scale\", function (scale, target) {\r\n return $math.fitToRange(scale, _this.minZoomLevel, _this.maxZoomLevel);\r\n });\r\n // Set up events\r\n //this.events.on(\"validated\", this.updateExtremes, this);\r\n //this.events.on(\"datavalidated\", this.handleAllValidated, this, false);\r\n //this.events.on(\"datavalidated\", this.updateExtremes, this, false);\r\n _this.events.on(\"maxsizechanged\", function (event) {\r\n if (event.previousWidth == 0 || event.previousHeight == 0) {\r\n _this.updateExtremes();\r\n _this.updateCenterGeoPoint();\r\n }\r\n }, undefined, false);\r\n // Set up main chart container, e.g. set backgrounds and events to monitor\r\n // size changes, etc.\r\n var chartContainer = _this.chartContainer;\r\n chartContainer.parent = _this;\r\n chartContainer.zIndex = -1;\r\n _this._disposers.push(_this.events.on(\"maxsizechanged\", function () {\r\n if (_this.inited) {\r\n if (_this._mapAnimation) {\r\n _this._mapAnimation.stop();\r\n }\r\n var allInited_1 = true;\r\n _this.series.each(function (series) {\r\n series.updateTooltipBounds();\r\n if (!series.inited || series.dataInvalid) {\r\n allInited_1 = false;\r\n }\r\n });\r\n if (allInited_1) {\r\n _this.updateScaleRatio();\r\n }\r\n _this.zoomToGeoPoint(_this._zoomGeoPointReal, _this.zoomLevel, true, 0);\r\n }\r\n }, undefined, false));\r\n var chartContainerBg = chartContainer.background;\r\n chartContainerBg.fillOpacity = 0;\r\n chartContainerBg.events.on(\"down\", function (e) { _this.seriesContainer.dragStart(e.target.interactions.downPointers.getIndex(0)); }, _this);\r\n chartContainerBg.events.on(\"up\", function (e) { _this.seriesContainer.dragStop(); }, _this);\r\n chartContainerBg.events.on(\"doublehit\", _this.handleDoubleHit, _this);\r\n chartContainerBg.focusable = true;\r\n chartContainer.events.on(\"down\", _this.handleMapDown, _this, false);\r\n _this.addDisposer(seriesContainer.events.on(\"down\", function () {\r\n // Cancel any move inertia if there is one\r\n var inertia = _this.seriesContainer.interactions.inertias.getKey(\"move\");\r\n if (inertia) {\r\n inertia.done();\r\n }\r\n }));\r\n // Add description to background\r\n _this.background.fillOpacity = 0;\r\n // Add keyboard events for panning\r\n _this._disposers.push(getInteraction().body.events.on(\"keyup\", function (ev) {\r\n if (_this.topParent.hasFocused) {\r\n var key = keyboard.getEventKey(ev.event);\r\n if (!_this._zoomControl || !_this._zoomControl.thumb.isFocused) {\r\n switch (key) {\r\n case \"up\":\r\n _this.pan({ x: 0, y: 0.1 });\r\n break;\r\n case \"down\":\r\n _this.pan({ x: 0, y: -0.1 });\r\n break;\r\n case \"left\":\r\n _this.pan({ x: 0.1, y: 0 });\r\n break;\r\n case \"right\":\r\n _this.pan({ x: -0.1, y: 0 });\r\n break;\r\n }\r\n }\r\n }\r\n }, _this));\r\n _this.mouseWheelBehavior = \"zoom\";\r\n var interaction = getInteraction();\r\n _this._disposers.push(interaction.body.events.on(\"down\", _this.handlePanDown, _this));\r\n _this._disposers.push(interaction.body.events.on(\"up\", _this.handlePanUp, _this));\r\n //this._disposers.push(interaction.body.events.on(\"track\", this.handlePanMove, this));\r\n var panSprite = _this.seriesContainer.createChild(Circle);\r\n panSprite.radius = 10;\r\n panSprite.inert = true;\r\n panSprite.isMeasured = false;\r\n panSprite.events.on(\"transformed\", _this.handlePanMove, _this, false);\r\n panSprite.interactionsEnabled = false;\r\n panSprite.opacity = 0;\r\n panSprite.x = 0;\r\n panSprite.y = 0;\r\n _this.panSprite = panSprite;\r\n _this.panBehavior = \"move\";\r\n /*\r\n this.panSprite.inertiaOptions.setKey(\"move\", {\r\n \"time\": 100,\r\n \"duration\": 1000,\r\n \"factor\": 3,\r\n \"easing\": $ease.sinOut\r\n });*/\r\n // Apply theme\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * @ignore\r\n */\r\n MapChart.prototype.handlePanDown = function (event) {\r\n var svgPoint = $utils.documentPointToSvg(event.pointer.point, this.htmlContainer);\r\n if (svgPoint.x > 0 && svgPoint.y > 0 && svgPoint.x < this.svgContainer.width && svgPoint.y < this.svgContainer.height) {\r\n // Get local point\r\n this._downPointOrig = $utils.documentPointToSprite(event.pointer.point, this.seriesContainer);\r\n this.panSprite.moveTo(this._downPointOrig);\r\n this.panSprite.dragStart(event.pointer);\r\n this._downDeltaLongitude = this.deltaLongitude;\r\n this._downDeltaLatitude = this.deltaLatitude;\r\n }\r\n };\r\n /**\r\n * @ignore\r\n */\r\n MapChart.prototype.handlePanUp = function (event) {\r\n if (this._downPointOrig) {\r\n this.panSprite.dragStop(event.pointer, true);\r\n }\r\n this._downPointOrig = undefined;\r\n };\r\n /**\r\n * @ignore\r\n */\r\n MapChart.prototype.handlePanMove = function () {\r\n if (!this.seriesContainer.isResized) {\r\n if (getInteraction().areTransformed([this.panSprite.interactions, this.seriesContainer.interactions])) {\r\n return;\r\n }\r\n var d3Projection = this.projection.d3Projection;\r\n var panBehavior = this.panBehavior;\r\n if (panBehavior != \"move\" && panBehavior != \"none\" && this._downPointOrig && d3Projection.rotate) {\r\n var rotation = d3Projection.rotate();\r\n var dln = rotation[0];\r\n var dlt = rotation[1];\r\n var dlg = rotation[2];\r\n d3Projection.rotate([0, 0, 0]);\r\n var downGeoLocal = this.projection.invert(this._downPointOrig);\r\n var local = { x: this.panSprite.pixelX, y: this.panSprite.pixelY };\r\n var geoLocal = void 0;\r\n if (local) {\r\n geoLocal = this.projection.invert(local);\r\n }\r\n d3Projection.rotate([dln, dlt, dlg]);\r\n if (geoLocal) {\r\n if (panBehavior == \"rotateLat\" || panBehavior == \"rotateLongLat\") {\r\n this.deltaLatitude = this._downDeltaLatitude + geoLocal.latitude - downGeoLocal.latitude;\r\n }\r\n if (panBehavior == \"rotateLong\" || panBehavior == \"rotateLongLat\") {\r\n this.deltaLongitude = this._downDeltaLongitude + geoLocal.longitude - downGeoLocal.longitude;\r\n }\r\n }\r\n }\r\n }\r\n };\r\n /**\r\n * @ignore\r\n */\r\n MapChart.prototype.handleAllInited = function () {\r\n var _this = this;\r\n var inited = true;\r\n this.seriesContainer.visible = true;\r\n this.series.each(function (series) {\r\n if (!series.inited || series.dataInvalid) {\r\n inited = false;\r\n }\r\n });\r\n if (inited) {\r\n this.updateCenterGeoPoint();\r\n this.updateScaleRatio();\r\n this.goHome(0);\r\n }\r\n else {\r\n // TODO verify that this is correct\r\n var disposer_1 = registry.events.once(\"exitframe\", function () {\r\n _this.removeDispose(disposer_1);\r\n _this.handleAllInited();\r\n }, this, false);\r\n this.addDisposer(disposer_1);\r\n }\r\n };\r\n /**\r\n * @ignore\r\n */\r\n MapChart.prototype.updateZoomGeoPoint = function () {\r\n var seriesPoint = $utils.svgPointToSprite({ x: this.innerWidth / 2 + this.pixelPaddingLeft, y: this.innerHeight / 2 + this.pixelPaddingTop }, this.series.getIndex(0));\r\n var geoPoint = this.projection.invert(seriesPoint);\r\n this._zoomGeoPointReal = geoPoint;\r\n };\r\n /**\r\n * @ignore\r\n */\r\n MapChart.prototype.updateCenterGeoPoint = function () {\r\n var maxLeft;\r\n var maxRight;\r\n var maxTop;\r\n var maxBottom;\r\n if (this.backgroundSeries) {\r\n var features = this.backgroundSeries.getFeatures();\r\n if (features.length > 0) {\r\n var bounds = this.projection.d3Path.bounds(features[0].geometry);\r\n maxLeft = bounds[0][0];\r\n maxTop = bounds[0][1];\r\n maxRight = bounds[1][0];\r\n maxBottom = bounds[1][1];\r\n }\r\n }\r\n else {\r\n this.series.each(function (series) {\r\n var bbox = series.group.node.getBBox();\r\n if (maxLeft > bbox.x || !$type.isNumber(maxLeft)) {\r\n maxLeft = bbox.x;\r\n }\r\n if (maxRight < bbox.x + bbox.width || !$type.isNumber(maxRight)) {\r\n maxRight = bbox.x + bbox.width;\r\n }\r\n if (maxTop > bbox.y || !$type.isNumber(maxTop)) {\r\n maxTop = bbox.y;\r\n }\r\n if (maxBottom < bbox.y + bbox.height || !$type.isNumber(maxBottom)) {\r\n maxBottom = bbox.y + bbox.height;\r\n }\r\n });\r\n }\r\n this.seriesMaxLeft = maxLeft;\r\n this.seriesMaxRight = maxRight;\r\n this.seriesMaxTop = maxTop;\r\n this.seriesMaxBottom = maxBottom;\r\n this.seriesWidth = maxRight - maxLeft;\r\n this.seriesHeight = maxBottom - maxTop;\r\n if (this.seriesWidth > 0 && this.seriesHeight > 0) {\r\n this.chartContainer.visible = true;\r\n this._centerGeoPoint = this.projection.invert({ x: maxLeft + (maxRight - maxLeft) / 2, y: maxTop + (maxBottom - maxTop) / 2 });\r\n if (!this._zoomGeoPointReal || !$type.isNumber(this._zoomGeoPointReal.latitude)) {\r\n this._zoomGeoPointReal = this._centerGeoPoint;\r\n }\r\n }\r\n else {\r\n this.chartContainer.visible = false;\r\n }\r\n };\r\n /**\r\n * Prevents map to be dragged out of the container area\r\n * @ignore\r\n */\r\n MapChart.prototype.handleDrag = function () {\r\n var d = this.zoomLevel * this.scaleRatio;\r\n var ww = this.seriesWidth * d;\r\n var hh = this.seriesHeight * d;\r\n var seriesContainer = this.seriesContainer;\r\n var maxLeft = this.seriesMaxLeft * d;\r\n var maxRight = this.seriesMaxRight * d;\r\n var maxTop = this.seriesMaxTop * d;\r\n var maxBottom = this.seriesMaxBottom * d;\r\n var x = seriesContainer.pixelX;\r\n var y = seriesContainer.pixelY;\r\n var maxPanOut = this.maxPanOut;\r\n var minX = Math.min(this.maxWidth * (1 - maxPanOut) - ww - maxLeft, -maxLeft);\r\n if (x < minX) {\r\n x = minX;\r\n }\r\n var maxX = Math.max(this.maxWidth * maxPanOut - maxLeft, this.maxWidth - maxRight);\r\n if (x > maxX) {\r\n x = maxX;\r\n }\r\n var minY = Math.min(this.maxHeight * (1 - maxPanOut) - hh - maxTop, -maxTop);\r\n if (y < minY) {\r\n y = minY;\r\n }\r\n var maxY = Math.max(this.maxHeight * maxPanOut - maxTop, this.maxHeight - maxBottom);\r\n if (y > maxY) {\r\n y = maxY;\r\n }\r\n seriesContainer.moveTo({ x: x, y: y }, undefined, undefined, true);\r\n this._zoomGeoPointReal = this.zoomGeoPoint;\r\n };\r\n /**\r\n * Sets defaults that instantiate some objects that rely on parent, so they\r\n * cannot be set in constructor.\r\n */\r\n MapChart.prototype.applyInternalDefaults = function () {\r\n _super.prototype.applyInternalDefaults.call(this);\r\n // Add a default screen reader title for accessibility\r\n // This will be overridden in screen reader if there are any `titles` set\r\n if (!$type.hasValue(this.readerTitle)) {\r\n this.readerTitle = this.language.translate(\"Map\");\r\n }\r\n if (!$type.hasValue(this.background.readerTitle)) {\r\n this.background.readerTitle = this.language.translate(\"Use plus and minus keys on your keyboard to zoom in and out\");\r\n }\r\n };\r\n /**\r\n * Handles event when a pointer presses down on the map, e.g. user presses\r\n * down mouse or touches the map on a screen.\r\n *\r\n * Stops all animations currently going on.\r\n */\r\n MapChart.prototype.handleMapDown = function () {\r\n if (this._mapAnimation) {\r\n this._mapAnimation.stop();\r\n }\r\n };\r\n /**\r\n * Handles the event when user doubleclicks or dooubletaps the map: zooms\r\n * in on the reference point.\r\n *\r\n * @param event Original event\r\n */\r\n MapChart.prototype.handleDoubleHit = function (event) {\r\n var svgPoint = $utils.documentPointToSvg(event.point, this.htmlContainer, this.svgContainer.cssScale);\r\n var geoPoint = this.svgPointToGeo(svgPoint);\r\n this.zoomIn(geoPoint);\r\n };\r\n /**\r\n * Handles mouse wheel event, e.g. user rotates mouse wheel while over the\r\n * map: zooms in or out depending on the direction of the wheel turn.\r\n *\r\n * @param event Original event\r\n */\r\n MapChart.prototype.handleWheel = function (event) {\r\n // Cancel any move inertia if there is one\r\n var inertia = this.seriesContainer.interactions.inertias.getKey(\"move\");\r\n if (inertia) {\r\n inertia.done();\r\n }\r\n var svgPoint = $utils.documentPointToSvg(event.point, this.htmlContainer, this.svgContainer.cssScale);\r\n var geoPoint = this.svgPointToGeo(svgPoint);\r\n if (event.shift.y < 0) {\r\n this.zoomIn(geoPoint, undefined, this.interactions.mouseOptions.sensitivity);\r\n }\r\n else {\r\n this.zoomOut(geoPoint, undefined, this.interactions.mouseOptions.sensitivity);\r\n }\r\n };\r\n Object.defineProperty(MapChart.prototype, \"mouseWheelBehavior\", {\r\n /**\r\n * @return mouse wheel behavior\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"mouseWheelBehavior\");\r\n },\r\n /**\r\n * Specifies what should chart do if when mouse wheel is rotated.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/reference/sprite/#mouseOptions_property} More information about `mouseOptions`\r\n * @param mouse wheel behavior\r\n * @default zoomX\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"mouseWheelBehavior\", value)) {\r\n if (value != \"none\") {\r\n this._mouseWheelDisposer = this.chartContainer.events.on(\"wheel\", this.handleWheel, this, false);\r\n this._disposers.push(this._mouseWheelDisposer);\r\n }\r\n else {\r\n if (this._mouseWheelDisposer) {\r\n this._mouseWheelDisposer.dispose();\r\n }\r\n this.chartContainer.wheelable = false;\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapChart.prototype, \"panBehavior\", {\r\n /**\r\n * @returns Behavior\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"panBehavior\");\r\n },\r\n /**\r\n * What \"dragging\" map does.\r\n *\r\n * Available values:\r\n * * `\"move\"` (default): changes position of the map.\r\n * * `\"rotateLat\"`: changes `deltaLatitude` (rotates the globe vertically).\r\n * * `\"rotateLong\"`: changes `deltaLongitude` (rotates the globe horizontally).\r\n * * `\"rotateLongLat\"`: changes both `deltaLongitude` and `deltaLatitude` (rotates the globe in any direction).\r\n *\r\n * @default \"move\"\r\n * @since 4.3.0\r\n * @param value Behavior\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"panBehavior\", value)) {\r\n var seriesContainer = this.seriesContainer;\r\n this.panSprite.draggable = false;\r\n seriesContainer.draggable = false;\r\n switch (value) {\r\n case \"move\":\r\n seriesContainer.draggable = true;\r\n break;\r\n default:\r\n this.panSprite.draggable = true;\r\n break;\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapChart.prototype, \"centerMapOnZoomOut\", {\r\n /**\r\n * @returns If the map should be centered when zooming out.\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"centerMapOnZoomOut\");\r\n },\r\n /**\r\n * Specifies if the map should be centered when zooming out\r\n * @default true\r\n * @since 4.7.12\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"centerMapOnZoomOut\", value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapChart.prototype, \"projection\", {\r\n /**\r\n * @return Projection\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"projection\");\r\n },\r\n /**\r\n * Projection to use for the map.\r\n *\r\n * Available projections:\r\n * * Albers\r\n * * AlbersUSA\r\n * * AzimuthalEqualArea\r\n * * Eckert6\r\n * * EqualEarth\r\n * * Mercator\r\n * * Miller\r\n * * NaturalEarth\r\n * * Orthographic\r\n * * Stereographic\r\n *\r\n * ```TypeScript\r\n * map.projection = new am4maps.projections.Mercator();\r\n * ```\r\n * ```JavaScript\r\n * map.projection = new am4maps.projections.Mercator();\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"projection\": \"Mercator\"\r\n * // ...\r\n * }\r\n * ```\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/chart-types/map/#Setting_projection} More about projections\r\n * @param projection Projection\r\n */\r\n set: function (projection) {\r\n var _this = this;\r\n if (this.setPropertyValue(\"projection\", projection)) {\r\n this.invalidateProjection();\r\n projection.chart = this;\r\n if (this._backgroundSeries) {\r\n this._backgroundSeries.invalidate();\r\n }\r\n if (this.inited) {\r\n this.updateExtremes();\r\n }\r\n this.series.each(function (series) {\r\n series.events.once(\"validated\", function () {\r\n _this.updateCenterGeoPoint();\r\n _this.updateScaleRatio();\r\n _this.goHome(0);\r\n });\r\n });\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Validates (processes) data items.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n MapChart.prototype.validateDataItems = function () {\r\n _super.prototype.validateDataItems.call(this);\r\n this.updateExtremes();\r\n };\r\n /**\r\n * Calculates the longitudes and latitudes of the most distant points from\r\n * the center in all four directions: West, East, North, and South.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n MapChart.prototype.updateExtremes = function () {\r\n var east;\r\n var north;\r\n var west;\r\n var south;\r\n this.series.each(function (series) {\r\n if (series.ignoreBounds || (series instanceof GraticuleSeries && series.fitExtent)) {\r\n }\r\n else {\r\n if (series.north > north || !$type.isNumber(north)) {\r\n north = series.north;\r\n }\r\n if (series.south < south || !$type.isNumber(south)) {\r\n south = series.south;\r\n }\r\n if (series.west < west || !$type.isNumber(west)) {\r\n west = series.west;\r\n }\r\n if (series.east > east || !$type.isNumber(east)) {\r\n east = series.east;\r\n }\r\n }\r\n });\r\n var features = [];\r\n var foundGraticule = false;\r\n // if we gave graticule, get features of these series only for faster fitSize\r\n this.series.each(function (series) {\r\n if (series instanceof GraticuleSeries && !series.fitExtent) {\r\n features = series.getFeatures();\r\n foundGraticule = true;\r\n }\r\n });\r\n if (!foundGraticule) {\r\n this.series.each(function (series) {\r\n if (series.ignoreBounds || (series instanceof GraticuleSeries && series.fitExtent)) {\r\n }\r\n else {\r\n features = features.concat(series.getFeatures());\r\n }\r\n });\r\n }\r\n var w = $math.max(50, this.innerWidth);\r\n var h = $math.max(50, this.innerHeight);\r\n var d3Projection = this.projection.d3Projection;\r\n if (features.length > 0 && d3Projection && (this.east != east || this.west != west || this.north != north || this.south != south)) {\r\n this.east = east;\r\n this.west = west;\r\n this.north = north;\r\n this.south = south;\r\n if (d3Projection.rotate) {\r\n var rotation = d3Projection.rotate();\r\n var deltaLong = rotation[0];\r\n var deltaLat = rotation[1];\r\n var deltaGamma = rotation[2];\r\n this.deltaLongitude = deltaLong;\r\n this.deltaLatitude = deltaLat;\r\n this.deltaGamma = deltaGamma;\r\n }\r\n var geoJSON = { \"type\": \"FeatureCollection\", features: features };\r\n var initialScale = d3Projection.scale();\r\n d3Projection.fitSize([w, h], geoJSON);\r\n if (d3Projection.scale() != initialScale) {\r\n this.invalidateDataUsers();\r\n }\r\n this.series.each(function (series) {\r\n if (series instanceof GraticuleSeries) {\r\n series.invalidateData();\r\n }\r\n });\r\n if (this._backgroundSeries) {\r\n var polygon = this._backgroundSeries.mapPolygons.getIndex(0);\r\n if (polygon) {\r\n polygon.multiPolygon = $mapUtils.getBackground(this.north, this.east, this.south, this.west);\r\n }\r\n }\r\n this._fitWidth = w;\r\n this._fitHeight = h;\r\n }\r\n if (!this._zoomGeoPointReal || !$type.isNumber(this._zoomGeoPointReal.latitude)) {\r\n this.goHome(0);\r\n }\r\n };\r\n /**\r\n * (Re)calculates a ratio which should be used to scale the actual map so\r\n * that it fits perfectly into available space. Helps to avoid redrawing of all the map if container size changes\r\n * @ignore\r\n */\r\n MapChart.prototype.updateScaleRatio = function () {\r\n var scaleRatio;\r\n this.updateCenterGeoPoint();\r\n var hScale = this.innerWidth / this.seriesWidth;\r\n var vScale = this.innerHeight / this.seriesHeight;\r\n scaleRatio = $math.min(hScale, vScale);\r\n if ($type.isNaN(scaleRatio) || scaleRatio == Infinity) {\r\n scaleRatio = 1;\r\n }\r\n if (scaleRatio != this.scaleRatio) {\r\n this.scaleRatio = scaleRatio;\r\n $iter.each(this.series.iterator(), function (series) {\r\n series.scale = scaleRatio;\r\n series.updateTooltipBounds();\r\n });\r\n this.backgroundSeries.scale = scaleRatio;\r\n this.dispatch(\"scaleratiochanged\");\r\n }\r\n };\r\n /**\r\n * Converts a point within map container to geographical (lat/long)\r\n * coordinates.\r\n *\r\n * @param point Source point\r\n * @return Geo-point\r\n */\r\n MapChart.prototype.svgPointToGeo = function (point) {\r\n var series = this.series.getIndex(0);\r\n if (series) {\r\n var seriesPoint = $utils.svgPointToSprite(point, series);\r\n return this.seriesPointToGeo(seriesPoint);\r\n }\r\n };\r\n /**\r\n * Converts geographical (lat/long) coordinates to an X/Y point within map's\r\n * container.\r\n *\r\n * @param point Source geo-point\r\n * @return Point\r\n */\r\n MapChart.prototype.geoPointToSVG = function (point) {\r\n var series = this.series.getIndex(0);\r\n if (series) {\r\n var seriesPoint = this.geoPointToSeries(point);\r\n return $utils.spritePointToSvg(seriesPoint, series);\r\n }\r\n };\r\n /**\r\n * Converts a point (X/Y) within actual objects of the map to geographical\r\n * (lat/long) coordinates.\r\n *\r\n * @param point Source point\r\n * @return Geo-point\r\n */\r\n MapChart.prototype.seriesPointToGeo = function (point) {\r\n return this.projection.invert(point);\r\n };\r\n /**\r\n * Converts geographical (lat/long) coordinates to an X/Y point within\r\n * actual elements/objects of the maps.\r\n *\r\n * @param point Source geo-point\r\n * @return Point\r\n */\r\n MapChart.prototype.geoPointToSeries = function (point) {\r\n return this.projection.convert(point);\r\n };\r\n Object.defineProperty(MapChart.prototype, \"geodata\", {\r\n /**\r\n * @return GeoJSON data\r\n */\r\n get: function () {\r\n return this._geodata;\r\n },\r\n /**\r\n * Map data in GeoJSON format.\r\n *\r\n * The Map supports the following GeoJSON objects: `Point`, `LineString`,\r\n * `Polygon`, `MultiPoint`, `MultiLineString`, and `MultiPolygon`.\r\n *\r\n * @see {@link http://geojson.org/} Official GeoJSON format specification\r\n * @param geoJSON GeoJSON data\r\n */\r\n set: function (geodata) {\r\n if (geodata != this._geodata) {\r\n this._geodata = geodata;\r\n if (this.reverseGeodata) {\r\n this.processReverseGeodata(this._geodata);\r\n }\r\n this.invalidateData();\r\n this.dataUsers.each(function (dataUser) {\r\n for (var i = dataUser.data.length - 1; i >= 0; i--) {\r\n if (dataUser.data[i].madeFromGeoData == true) {\r\n dataUser.data.splice(i, 1);\r\n }\r\n }\r\n dataUser.disposeData();\r\n dataUser.invalidateData();\r\n });\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapChart.prototype, \"reverseGeodata\", {\r\n /**\r\n * @returns Reverse the order of geodata coordinates?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"reverseGeodata\");\r\n },\r\n /**\r\n * Indicates whether GeoJSON geodata supplied to the chart uses\r\n * ESRI (clockwise) or non-ESRI (counter-clockwise) order of the polygon\r\n * coordinates.\r\n *\r\n * `MapChart` supports only ESRI standard, so if your custom maps appears\r\n * garbled, try setting `reverseGeodata = true`.\r\n *\r\n * @default false\r\n * @since 4.10.11\r\n * @param value Reverse the order of geodata coordinates?\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"reverseGeodata\", value) && this._geodata) {\r\n this.processReverseGeodata(this._geodata);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Reverses the order of polygons on a GeoJSON data.\r\n *\r\n * @since 4.10.11\r\n * @param geodata Source geodata\r\n */\r\n MapChart.prototype.processReverseGeodata = function (geodata) {\r\n for (var i = 0; i < geodata.features.length; i++) {\r\n var feature = geodata.features[i];\r\n for (var x = 0; x < feature.geometry.coordinates.length; x++) {\r\n if (feature.geometry.type == \"MultiPolygon\") {\r\n for (var y = 0; y < feature.geometry.coordinates[x].length; y++) {\r\n feature.geometry.coordinates[x][y].reverse();\r\n }\r\n }\r\n else {\r\n feature.geometry.coordinates[x].reverse();\r\n }\r\n }\r\n }\r\n };\r\n /**\r\n * Zooms the map to particular zoom level and centers on a latitude/longitude\r\n * coordinate.\r\n *\r\n * @param point Center coordinate\r\n * @param zoomLevel Zoom level\r\n * @param center Center on the given coordinate?\r\n * @param duration Duration for zoom animation (ms)\r\n * @return Zoom animation\r\n */\r\n MapChart.prototype.zoomToGeoPoint = function (point, zoomLevel, center, duration, mapObject) {\r\n var _this = this;\r\n if (!point) {\r\n var hasData_1 = false;\r\n this.series.each(function (series) {\r\n if (series.dataItems.length > 0) {\r\n hasData_1 = true;\r\n }\r\n });\r\n if (hasData_1) {\r\n point = this.zoomGeoPoint;\r\n }\r\n else {\r\n return;\r\n }\r\n }\r\n if (!point || !$type.isNumber(point.longitude) || !$type.isNumber(point.latitude)) {\r\n return;\r\n }\r\n this._zoomGeoPointReal = point;\r\n zoomLevel = $math.fitToRange(zoomLevel, this.minZoomLevel, this.maxZoomLevel);\r\n var seriesPoint = this.projection.convert(point);\r\n if (seriesPoint) {\r\n var svgPoint = this.geoPointToSVG(point);\r\n var mapPoint = $utils.svgPointToSprite(svgPoint, this);\r\n if (center) {\r\n mapPoint = {\r\n x: this.innerWidth / 2,\r\n y: this.innerHeight / 2\r\n };\r\n }\r\n if (!$type.isNumber(duration)) {\r\n duration = this.zoomDuration;\r\n }\r\n var x = mapPoint.x - seriesPoint.x * zoomLevel * this.scaleRatio;\r\n var y = mapPoint.y - seriesPoint.y * zoomLevel * this.scaleRatio;\r\n if (!mapObject && zoomLevel < this.zoomLevel && this.centerMapOnZoomOut && zoomLevel < 1.5) {\r\n x = this.innerWidth / 2 - (this.seriesMaxLeft + (this.seriesMaxRight - this.seriesMaxLeft) / 2) * zoomLevel * this.scaleRatio;\r\n y = this.innerHeight / 2 - (this.seriesMaxTop + (this.seriesMaxBottom - this.seriesMaxTop) / 2) * zoomLevel * this.scaleRatio;\r\n }\r\n this._mapAnimation = this.seriesContainer.animate([{\r\n property: \"scale\",\r\n to: zoomLevel\r\n }, {\r\n property: \"x\", from: this.seriesContainer.pixelX,\r\n to: x\r\n }, {\r\n property: \"y\", from: this.seriesContainer.pixelY,\r\n to: y\r\n }], duration, this.zoomEasing);\r\n this._disposers.push(this._mapAnimation.events.on(\"animationended\", function () {\r\n _this._zoomGeoPointReal = _this.zoomGeoPoint;\r\n }));\r\n this.seriesContainer.validatePosition();\r\n return this._mapAnimation;\r\n }\r\n };\r\n /**\r\n * Zooms the map to a particular map object.\r\n *\r\n * @param mapObject Target map object\r\n * @param zoomLevel Zoom level\r\n * @param center Center on the given coordinate?\r\n * @param duration Duration for zoom animation (ms)\r\n * @return Zoom animation\r\n */\r\n MapChart.prototype.zoomToMapObject = function (mapObject, zoomLevel, center, duration) {\r\n if (center == undefined) {\r\n center = true;\r\n }\r\n var inertia = this.seriesContainer.interactions.inertias.getKey(\"move\");\r\n if (inertia) {\r\n inertia.done();\r\n }\r\n if (mapObject instanceof MapImage) {\r\n if ($type.isNaN(zoomLevel)) {\r\n zoomLevel = 5;\r\n }\r\n return this.zoomToGeoPoint({ latitude: mapObject.latitude, longitude: mapObject.longitude }, zoomLevel, center, duration, true);\r\n }\r\n var dataItem = mapObject.dataItem;\r\n if (dataItem && $type.isNumber(dataItem.zoomLevel)) {\r\n zoomLevel = dataItem.zoomLevel;\r\n }\r\n if (mapObject instanceof MapPolygon) {\r\n var dataItem_1 = mapObject.dataItem;\r\n var bbox = mapObject.polygon.bbox;\r\n if (bbox.width == 0 || bbox.height == 0) {\r\n bbox = mapObject.polygon.group.getBBox();\r\n }\r\n if (!$type.isNumber(zoomLevel)) {\r\n zoomLevel = Math.min(this.seriesWidth / bbox.width, this.seriesHeight / bbox.height);\r\n }\r\n var geoPoint = void 0;\r\n if (dataItem_1 && $type.hasValue(dataItem_1.zoomGeoPoint)) {\r\n geoPoint = dataItem_1.zoomGeoPoint;\r\n }\r\n else {\r\n // this is more accurate\r\n var polygonPoint = { x: bbox.x + bbox.width / 2, y: bbox.y + bbox.height / 2 };\r\n var seriesPoint = $utils.spritePointToSprite(polygonPoint, mapObject.polygon, mapObject.series);\r\n geoPoint = this.seriesPointToGeo(seriesPoint);\r\n }\r\n return this.zoomToGeoPoint(geoPoint, zoomLevel, true, duration, true);\r\n }\r\n };\r\n /**\r\n * Zooms the map to a particular viewport.\r\n *\r\n * The `north`, `east`, `south`, and `west` define boundaries of the\r\n * imaginary viewort we want to zoom the map to.\r\n *\r\n * `level` is not actual zoom level. The map will determine the zoom level\r\n * required to accommodated such zoom, and will adjust it by `level` if set.\r\n *\r\n * @param north Latitude of the North-most boundary\r\n * @param east Longitude of the East-most boundary\r\n * @param south Latitude of the South-most boundary\r\n * @param west Longitude of the West-most boundary\r\n * @param level Adjust zoom level\r\n * @param center Center on the given coordinate?\r\n * @param duration Duration for zoom animation (ms)\r\n * @return Zoom animation\r\n */\r\n MapChart.prototype.zoomToRectangle = function (north, east, south, west, level, center, duration) {\r\n if ($type.isNaN(level)) {\r\n level = 1;\r\n }\r\n var w = $math.min(west, east);\r\n var e = $math.max(west, east);\r\n west = w;\r\n east = e;\r\n var splitLongitude = $math.normalizeAngle(180 - this.deltaLongitude);\r\n if (splitLongitude > 180) {\r\n splitLongitude -= 360;\r\n }\r\n var newLong = west + (east - west) / 2;\r\n var d = (west - east);\r\n if (west < splitLongitude && east > splitLongitude) {\r\n newLong += 180;\r\n d = $math.normalizeAngle(east - west - 360);\r\n }\r\n var zoomLevel = level * Math.min((this.south - this.north) / (south - north), Math.abs((this.west - this.east) / d));\r\n return this.zoomToGeoPoint({ latitude: north + (south - north) / 2, longitude: newLong }, zoomLevel, center, duration, true);\r\n };\r\n /**\r\n * Zooms in the map, optionally centering on particular latitude/longitude\r\n * point.\r\n *\r\n * @param geoPoint Optional center point\r\n * @param duration Duration for zoom animation (ms)\r\n * @return Zoom animation\r\n */\r\n MapChart.prototype.zoomIn = function (geoPoint, duration, sensitivity) {\r\n if (sensitivity === void 0) { sensitivity = 1; }\r\n var step = 1 + (this.zoomStep - 1) * sensitivity;\r\n if (step < 1) {\r\n step = 1;\r\n }\r\n return this.zoomToGeoPoint(geoPoint, this.zoomLevel * step, false, duration);\r\n };\r\n /**\r\n * Zooms out the map, optionally centering on particular latitude/longitude\r\n * point.\r\n *\r\n * @param geoPoint Optional center point\r\n * @param duration Duration for zoom animation (ms)\r\n * @return Zoom animation\r\n */\r\n MapChart.prototype.zoomOut = function (geoPoint, duration, sensitivity) {\r\n if (sensitivity === void 0) { sensitivity = 1; }\r\n var step = 1 + (this.zoomStep - 1) * sensitivity;\r\n if (step < 1) {\r\n step = 1;\r\n }\r\n return this.zoomToGeoPoint(geoPoint, this.zoomLevel / step, false, duration);\r\n };\r\n /**\r\n * Pans the maps using relative coordinates. E.g.:\r\n *\r\n * ```JSON\r\n * {\r\n * x: 0.1,\r\n * y: -0.1\r\n * }\r\n * ```\r\n *\r\n * The above will move the map by 10% to the right, and by 10% upwards.\r\n *\r\n * @param shift Vertical and horizontal shift\r\n * @param duration Pan animation duration (ms)\r\n */\r\n MapChart.prototype.pan = function (shift, duration) {\r\n var point = this.geoPointToSVG(this.zoomGeoPoint);\r\n point.x += this.pixelWidth * shift.x;\r\n point.y += this.pixelHeight * shift.y;\r\n this.zoomToGeoPoint(this.svgPointToGeo(point), this.zoomLevel, true, duration, true);\r\n };\r\n Object.defineProperty(MapChart.prototype, \"zoomGeoPoint\", {\r\n /**\r\n * Current lat/long coordinates for the center of the viewport. (default\r\n * zoom reference point)\r\n *\r\n * @readonly\r\n * @return Coordinates\r\n */\r\n get: function () {\r\n var point = $utils.spritePointToSvg({ x: this.pixelWidth / 2, y: this.pixelHeight / 2 }, this);\r\n return this.svgPointToGeo(point);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapChart.prototype, \"zoomLevel\", {\r\n /**\r\n * @return Zoom level\r\n */\r\n get: function () {\r\n return this.seriesContainer.scale;\r\n },\r\n /**\r\n * Current zoom level.\r\n *\r\n * @readonly\r\n * @return Zoom level\r\n */\r\n set: function (value) {\r\n this.seriesContainer.scale = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Dispatches events after some map transformation, like pan or zoom.\r\n *\r\n * @ignore\r\n */\r\n MapChart.prototype.handleMapTransform = function () {\r\n if (this.zoomLevel != this._prevZoomLevel) {\r\n this.dispatch(\"zoomlevelchanged\");\r\n this._prevZoomLevel = this.zoomLevel;\r\n this.svgContainer.readerAlert(this.language.translate(\"Zoom level changed to %1\", this.language.locale, $type.castString(this.zoomLevel)));\r\n }\r\n if (this.zoomGeoPoint && (this._prevZoomGeoPoint.latitude != this.zoomGeoPoint.latitude || this._prevZoomGeoPoint.longitude != this.zoomGeoPoint.longitude)) {\r\n this.dispatch(\"mappositionchanged\");\r\n }\r\n };\r\n Object.defineProperty(MapChart.prototype, \"smallMap\", {\r\n /**\r\n * @return Small map\r\n */\r\n get: function () {\r\n if (!this._smallMap) {\r\n var smallMap = new SmallMap();\r\n this.smallMap = smallMap;\r\n }\r\n return this._smallMap;\r\n },\r\n /**\r\n * A [[SmallMap]] to be used on the map.\r\n *\r\n * Please note, that accessing this property will NOT create a small map\r\n * if it has not yet been created. (except in JSON)\r\n *\r\n * ```TypeScript\r\n * // Create a small map\r\n * map.smallMap = new am4maps.SmallMap();\r\n * ```\r\n * ```JavaScript\r\n * // Create a small map\r\n * map.smallMap = new am4maps.SmallMap();\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"smallMap\": {}\r\n * // ...\r\n * }\r\n * ```\r\n *\r\n * @param smallMap Small map\r\n */\r\n set: function (smallMap) {\r\n if (this._smallMap) {\r\n this.removeDispose(this._smallMap);\r\n }\r\n this._smallMap = smallMap;\r\n this._smallMap.chart = this;\r\n smallMap.parent = this.chartContainer;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapChart.prototype, \"zoomControl\", {\r\n /**\r\n * @return Zoom control\r\n */\r\n get: function () {\r\n return this._zoomControl;\r\n },\r\n /**\r\n * A [[ZoomControl]] to be used on the map.\r\n *\r\n * Please note, that accessing this property will NOT create a zoom control\r\n * if it has not yet been created. (except in JSON)\r\n *\r\n * ```TypeScript\r\n * // Create a zoom control\r\n * map.zoomControl = new am4maps.ZoomControl();\r\n * ```\r\n * ```JavaScript\r\n * // Create a zoom control\r\n * map.zoomControl = new am4maps.ZoomControl();\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"zoomControl\": {}\r\n * // ...\r\n * }\r\n * ```\r\n *\r\n * @param zoomControl Zoom control\r\n */\r\n set: function (zoomControl) {\r\n if (this._zoomControl) {\r\n this.removeDispose(this._zoomControl);\r\n }\r\n this._zoomControl = zoomControl;\r\n zoomControl.chart = this;\r\n zoomControl.parent = this.chartContainer;\r\n zoomControl.plusButton.exportable = false;\r\n zoomControl.minusButton.exportable = false;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Creates and returns a map series of appropriate type.\r\n *\r\n * @return Map series\r\n */\r\n MapChart.prototype.createSeries = function () {\r\n return new MapSeries();\r\n };\r\n Object.defineProperty(MapChart.prototype, \"deltaLongitude\", {\r\n /**\r\n * @return Rotation\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"deltaLongitude\");\r\n },\r\n /**\r\n * Degrees to rotate the map around vertical axis (Y).\r\n *\r\n * E.g. if set to -160, the longitude 20 will become a new center, creating\r\n * a Pacific-centered map.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/chart-types/map/#Map_rotation} For more info on map rotation.\r\n * @param value Rotation\r\n */\r\n set: function (value) {\r\n value = $math.round(value, 3);\r\n if (this.setPropertyValue(\"deltaLongitude\", $geo.wrapAngleTo180(value))) {\r\n this.rotateMap();\r\n this.updateZoomGeoPoint();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapChart.prototype, \"deltaLatitude\", {\r\n /**\r\n * @return Rotation\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"deltaLatitude\");\r\n },\r\n /**\r\n * Degrees to rotate the map around horizontal axis (X).\r\n *\r\n * E.g. setting this to 90 will put Antarctica directly in the center of\r\n * the map.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/chart-types/map/#Map_rotation} For more info on map rotation.\r\n * @since 4.3.0\r\n * @param value Rotation\r\n */\r\n set: function (value) {\r\n value = $math.round(value, 3);\r\n if (this.setPropertyValue(\"deltaLatitude\", value)) {\r\n this.rotateMap();\r\n this.updateZoomGeoPoint();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapChart.prototype, \"deltaGamma\", {\r\n /**\r\n * @return Rotation\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"deltaGamma\");\r\n },\r\n /**\r\n * Degrees to rotate the map around \"Z\" axis. This is the axis that pierces\r\n * the globe directly from the viewer's point of view.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/chart-types/map/#Map_rotation} For more info on map rotation.\r\n * @since 4.3.0\r\n * @param value Rotation\r\n */\r\n set: function (value) {\r\n value = $math.round(value, 3);\r\n if (this.setPropertyValue(\"deltaGamma\", value)) {\r\n this.rotateMap();\r\n this.updateZoomGeoPoint();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * @ignore\r\n */\r\n MapChart.prototype.rotateMap = function () {\r\n if (this.projection.d3Projection) {\r\n if (this.projection.d3Projection.rotate) {\r\n this.projection.d3Projection.rotate([this.deltaLongitude, this.deltaLatitude, this.deltaGamma]);\r\n this.invalidateProjection();\r\n //this.updateExtremes(); // removal fixes #3292\r\n }\r\n }\r\n };\r\n Object.defineProperty(MapChart.prototype, \"maxPanOut\", {\r\n /**\r\n * @return Max pan out\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"maxPanOut\");\r\n },\r\n /**\r\n * Maximum portion of the map's width/height to allow panning \"off screen\".\r\n *\r\n * A value of 0 (zero) will prevent any portion of the the map to be panned\r\n * outside the viewport.\r\n *\r\n * 0.5 will allow half of the map to be outside viewable area.\r\n *\r\n * @default 0.7\r\n * @param value Max pan out\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"maxPanOut\", value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapChart.prototype, \"homeGeoPoint\", {\r\n /**\r\n * @return Home geo point\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"homeGeoPoint\");\r\n },\r\n /**\r\n * The geographical point to center map on when it is first loaded.\r\n *\r\n * The map will also be centered to this point when you call `goHome()`\r\n * method.\r\n *\r\n * @param value Home geo point\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"homeGeoPoint\", value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapChart.prototype, \"homeZoomLevel\", {\r\n /**\r\n * @return Home zoom level\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"homeZoomLevel\");\r\n },\r\n /**\r\n * The zoom level to put the map in when it is first loaded.\r\n *\r\n * The map will also be set to this zoom level when you call `goHome()`\r\n * method.\r\n *\r\n * @param value Home zoom level\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"homeZoomLevel\", value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(MapChart.prototype, \"zoomStep\", {\r\n /**\r\n * @return Zoom factor\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"zoomStep\");\r\n },\r\n /**\r\n * When user zooms in or out current zoom level is multiplied or divided\r\n * by value of this setting.\r\n *\r\n * @default 2\r\n * @param value Zoom factor\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"zoomStep\", value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Invalidates projection, causing all series to be redrawn.\r\n *\r\n * Call this after changing projection or its settings.\r\n */\r\n MapChart.prototype.invalidateProjection = function () {\r\n this.east = undefined;\r\n this.invalidateDataUsers();\r\n this.updateCenterGeoPoint();\r\n };\r\n Object.defineProperty(MapChart.prototype, \"geodataSource\", {\r\n /**\r\n * Returns a [[DataSource]] specifically for loading Component's data.\r\n *\r\n * @return Data source\r\n */\r\n get: function () {\r\n if (!this._dataSources[\"geodata\"]) {\r\n this.getDataSource(\"geodata\");\r\n }\r\n return this._dataSources[\"geodata\"];\r\n },\r\n /**\r\n * Sets a [[DataSource]] to be used for loading Component's data.\r\n *\r\n * @param value Data source\r\n */\r\n set: function (value) {\r\n var _this = this;\r\n if (this._dataSources[\"geodata\"]) {\r\n this.removeDispose(this._dataSources[\"geodata\"]);\r\n }\r\n this._dataSources[\"geodata\"] = value;\r\n this._dataSources[\"geodata\"].component = this;\r\n this.events.on(\"inited\", function () {\r\n _this.loadData(\"geodata\");\r\n }, this, false);\r\n this.setDataSourceEvents(value, \"geodata\");\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Processes JSON-based config before it is applied to the object.\r\n *\r\n * @ignore Exclude from docs\r\n * @param config Config\r\n */\r\n MapChart.prototype.processConfig = function (config) {\r\n if ($type.hasValue(config[\"geodata\"]) && $type.isString(config[\"geodata\"])) {\r\n var name_1 = config[\"geodata\"];\r\n // Check if there's a map loaded by such name\r\n if ($type.hasValue(window[\"am4geodata_\" + config[\"geodata\"]])) {\r\n config[\"geodata\"] = window[\"am4geodata_\" + config[\"geodata\"]];\r\n }\r\n // Nope. Let's try maybe we got JSON as string?\r\n else {\r\n try {\r\n config[\"geodata\"] = JSON.parse(config[\"geodata\"]);\r\n }\r\n catch (e) {\r\n // No go again. Error out.\r\n this.raiseCriticalError(Error(\"MapChart error: Geodata `\" + name_1 + \"` is not loaded or is incorrect.\"), true);\r\n }\r\n }\r\n }\r\n // Instantiate projection\r\n if ($type.hasValue(config[\"projection\"]) && $type.isString(config[\"projection\"])) {\r\n config[\"projection\"] = this.createClassInstance(config[\"projection\"]);\r\n }\r\n // Set up small map\r\n if ($type.hasValue(config.smallMap) && !$type.hasValue(config.smallMap.type)) {\r\n config.smallMap.type = \"SmallMap\";\r\n }\r\n // Set up zoom control\r\n if ($type.hasValue(config.zoomControl) && !$type.hasValue(config.zoomControl.type)) {\r\n config.zoomControl.type = \"ZoomControl\";\r\n }\r\n _super.prototype.processConfig.call(this, config);\r\n };\r\n /**\r\n * Decorates a new [[Series]] object with required parameters when it is\r\n * added to the chart.\r\n *\r\n * @ignore Exclude from docs\r\n * @param event Event\r\n */\r\n MapChart.prototype.handleSeriesAdded = function (event) {\r\n _super.prototype.handleSeriesAdded.call(this, event);\r\n var series = event.newValue;\r\n series.scale = this.scaleRatio;\r\n series.events.on(\"validated\", this.updateCenterGeoPoint, this, false);\r\n };\r\n /**\r\n * This function is used to sort element's JSON config properties, so that\r\n * some properties that absolutely need to be processed last, can be put at\r\n * the end.\r\n *\r\n * @ignore Exclude from docs\r\n * @param a Element 1\r\n * @param b Element 2\r\n * @return Sorting number\r\n */\r\n MapChart.prototype.configOrder = function (a, b) {\r\n if (a == b) {\r\n return 0;\r\n }\r\n // Must come last\r\n else if (a == \"smallMap\") {\r\n return 1;\r\n }\r\n else if (b == \"smallMap\") {\r\n return -1;\r\n }\r\n else if (a == \"series\") {\r\n return 1;\r\n }\r\n else if (b == \"series\") {\r\n return -1;\r\n }\r\n else {\r\n return _super.prototype.configOrder.call(this, a, b);\r\n }\r\n };\r\n /**\r\n * Adds `projection` to \"as is\" fields.\r\n *\r\n * @param field Field name\r\n * @return Assign as is?\r\n */\r\n MapChart.prototype.asIs = function (field) {\r\n return field == \"projection\" || field == \"geodata\" || _super.prototype.asIs.call(this, field);\r\n };\r\n Object.defineProperty(MapChart.prototype, \"centerGeoPoint\", {\r\n /**\r\n * Geo point of map center\r\n *\r\n * @readonly\r\n */\r\n get: function () {\r\n return this._centerGeoPoint;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Resets the map to its original position and zoom level.\r\n *\r\n * Use the only parameter to set number of milliseconds for the zoom\r\n * animation to play.\r\n *\r\n * @param duration Duration (ms)\r\n */\r\n MapChart.prototype.goHome = function (duration) {\r\n var homeGeoPoint = this.homeGeoPoint;\r\n if (!homeGeoPoint) {\r\n homeGeoPoint = this.centerGeoPoint;\r\n }\r\n if (homeGeoPoint) {\r\n this.zoomToGeoPoint(homeGeoPoint, this.homeZoomLevel, true, duration, true);\r\n }\r\n };\r\n /**\r\n * Sets [[Paper]] instance to use to draw elements.\r\n *\r\n * @ignore\r\n * @param paper Paper\r\n * @return true if paper was changed, false, if it's the same\r\n */\r\n MapChart.prototype.setPaper = function (paper) {\r\n if (this.svgContainer) {\r\n this.svgContainer.hideOverflow = true;\r\n }\r\n return _super.prototype.setPaper.call(this, paper);\r\n };\r\n Object.defineProperty(MapChart.prototype, \"backgroundSeries\", {\r\n /**\r\n * Background series will create polygons that will fill all the map area\r\n * with some color (or other fill).\r\n *\r\n * This might be useful with non-rectangular projections, like Orthographic,\r\n * Albers, etc.\r\n *\r\n * To change background color/opacity access polygon template.\r\n *\r\n * ```TypeScript\r\n * chart.backgroundSeries.mapPolygons.template.polygon.fill = am4core.color(\"#fff\");\r\n * chart.backgroundSeries.mapPolygons.template.polygon.fillOpacity = 0.1;\r\n * ```\r\n * ```JavaScript\r\n * chart.backgroundSeries.mapPolygons.template.polygon.fill = am4core.color(\"#fff\");\r\n * chart.backgroundSeries.mapPolygons.template.polygon.fillOpacity = 0.1;\r\n * ```\r\n * ```JSON\r\n * {\r\n * \"backgroundSeries\": {\r\n * \"mapPolygons\": {\r\n * \"polygon\": {\r\n * \"fill\": \"#fff\",\r\n * \"fillOpacity\": 0.1\r\n * }\r\n * }\r\n * }\r\n * }\r\n * ```\r\n *\r\n * @since 4.3.0\r\n */\r\n get: function () {\r\n var _this = this;\r\n if (!this._backgroundSeries) {\r\n var backgroundSeries = new MapPolygonSeries();\r\n backgroundSeries.parent = this.seriesContainer;\r\n backgroundSeries.chart = this;\r\n backgroundSeries.hiddenInLegend = true;\r\n backgroundSeries.mapPolygons.template.focusable = false;\r\n backgroundSeries.addDisposer(new Disposer(function () {\r\n _this._backgroundSeries = undefined;\r\n }));\r\n this._disposers.push(backgroundSeries);\r\n var interfaceColors = new InterfaceColorSet();\r\n var color = interfaceColors.getFor(\"background\");\r\n var polygonTemplate = backgroundSeries.mapPolygons.template.polygon;\r\n polygonTemplate.stroke = color;\r\n polygonTemplate.fill = color;\r\n polygonTemplate.fillOpacity = 0;\r\n polygonTemplate.strokeOpacity = 0;\r\n //polygonTemplate.focusable = false;\r\n backgroundSeries.mapPolygons.create();\r\n this._backgroundSeries = backgroundSeries;\r\n }\r\n return this._backgroundSeries;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Prepares the legend instance for use in this chart.\r\n *\r\n * @param legend Legend\r\n */\r\n MapChart.prototype.setLegend = function (legend) {\r\n _super.prototype.setLegend.call(this, legend);\r\n if (legend) {\r\n legend.parent = this;\r\n }\r\n };\r\n /**\r\n * @param value Tap to activate?\r\n */\r\n MapChart.prototype.setTapToActivate = function (value) {\r\n _super.prototype.setTapToActivate.call(this, value);\r\n // setup other containers\r\n this.seriesContainer.interactions.isTouchProtected = true;\r\n this.panSprite.interactions.isTouchProtected = true;\r\n };\r\n MapChart.prototype.handleTapToActivate = function () {\r\n _super.prototype.handleTapToActivate.call(this);\r\n this.seriesContainer.interactions.isTouchProtected = false;\r\n this.panSprite.interactions.isTouchProtected = false;\r\n };\r\n MapChart.prototype.handleTapToActivateDeactivation = function () {\r\n _super.prototype.handleTapToActivateDeactivation.call(this);\r\n this.seriesContainer.interactions.isTouchProtected = true;\r\n this.panSprite.interactions.isTouchProtected = true;\r\n };\r\n /**\r\n * Adds easing functions to \"function\" fields.\r\n *\r\n * @param field Field name\r\n * @return Assign as function?\r\n */\r\n MapChart.prototype.asFunction = function (field) {\r\n return field == \"zoomEasing\" || _super.prototype.asIs.call(this, field);\r\n };\r\n /**\r\n * @ignore\r\n * @return Has license?\r\n */\r\n MapChart.prototype.hasLicense = function () {\r\n if (options.commercialLicense) {\r\n return true;\r\n }\r\n if (!_super.prototype.hasLicense.call(this)) {\r\n return false;\r\n }\r\n for (var i = 0; i < options.licenses.length; i++) {\r\n if (options.licenses[i].match(/^MP.{5,}/i)) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n };\r\n return MapChart;\r\n}(SerialChart));\r\nexport { MapChart };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"MapChart\"] = MapChart;\r\n","/**\r\n * Serial chart module.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Chart, ChartDataItem } from \"../Chart\";\r\nimport { ListTemplate, ListDisposer } from \"../../core/utils/List\";\r\nimport { Container } from \"../../core/Container\";\r\nimport { Series } from \"../series/Series\";\r\nimport { percent } from \"../../core/utils/Percent\";\r\nimport { ColorSet } from \"../../core/utils/ColorSet\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport * as $iter from \"../../core/utils/Iterator\";\r\nimport * as $type from \"../../core/utils/Type\";\r\nimport * as $array from \"../../core/utils/Array\";\r\nimport { Disposer } from \"../../core/utils/Disposer\";\r\n/**\r\n * ============================================================================\r\n * DATA ITEM\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Defines a [[DataItem]] for [[SerialChart]].\r\n *\r\n * @see {@link DataItem}\r\n */\r\nvar SerialChartDataItem = /** @class */ (function (_super) {\r\n __extends(SerialChartDataItem, _super);\r\n /**\r\n * Constructor\r\n */\r\n function SerialChartDataItem() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"SerialChartDataItem\";\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n return SerialChartDataItem;\r\n}(ChartDataItem));\r\nexport { SerialChartDataItem };\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * A base class for all series-based charts, like XY, Pie, etc.\r\n *\r\n * Is not useful on its own.\r\n *\r\n * @see {@link ISerialChartEvents} for a list of available Events\r\n * @see {@link ISerialChartAdapters} for a list of available Adapters\r\n */\r\nvar SerialChart = /** @class */ (function (_super) {\r\n __extends(SerialChart, _super);\r\n /**\r\n * Constructor\r\n */\r\n function SerialChart() {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n _this.className = \"SerialChart\";\r\n _this.colors = new ColorSet();\r\n _this._usesData = false;\r\n // Create a container for series\r\n var seriesContainer = _this.chartContainer.createChild(Container);\r\n seriesContainer.shouldClone = false;\r\n seriesContainer.width = percent(100);\r\n seriesContainer.height = percent(100);\r\n seriesContainer.isMeasured = false;\r\n seriesContainer.layout = \"none\";\r\n seriesContainer.zIndex = 2;\r\n _this.seriesContainer = seriesContainer;\r\n // Create a container for bullets\r\n var bulletsContainer = _this.chartContainer.createChild(Container);\r\n bulletsContainer.shouldClone = false;\r\n bulletsContainer.width = percent(100);\r\n bulletsContainer.height = percent(100);\r\n bulletsContainer.isMeasured = false;\r\n bulletsContainer.zIndex = 3;\r\n bulletsContainer.layout = \"none\";\r\n _this.bulletsContainer = bulletsContainer;\r\n // Apply theme\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n SerialChart.prototype.dispose = function () {\r\n _super.prototype.dispose.call(this);\r\n if (this.colors) {\r\n this.colors.dispose();\r\n }\r\n if (this.patterns) {\r\n this.patterns.dispose();\r\n }\r\n };\r\n /**\r\n * Sets defaults that instantiate some objects that rely on parent, so they\r\n * cannot be set in constructor\r\n */\r\n SerialChart.prototype.applyInternalDefaults = function () {\r\n _super.prototype.applyInternalDefaults.call(this);\r\n // Add a default screen reader title for accessibility\r\n // This will be overridden in screen reader if there are any `titles` set\r\n if (!$type.hasValue(this.readerTitle)) {\r\n this.readerTitle = this.language.translate(\"Serial chart\");\r\n }\r\n };\r\n Object.defineProperty(SerialChart.prototype, \"series\", {\r\n /**\r\n * A list of chart's series.\r\n *\r\n * @return Chart's series\r\n */\r\n get: function () {\r\n if (!this._series) {\r\n this._series = new ListTemplate(this.createSeries());\r\n this._series.events.on(\"inserted\", this.handleSeriesAdded, this, false);\r\n this._series.events.on(\"removed\", this.handleSeriesRemoved, this, false);\r\n this._disposers.push(new ListDisposer(this._series, false));\r\n this._disposers.push(this._series.template);\r\n }\r\n return this._series;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n SerialChart.prototype.handleSeriesRemoved = function (event) {\r\n var series = event.oldValue;\r\n this.dataUsers.removeValue(series);\r\n this.dataUsers.each(function (dataUser) {\r\n dataUser.invalidateDataItems();\r\n });\r\n if (series.autoDispose) {\r\n series.dispose();\r\n }\r\n else {\r\n series.parent = undefined;\r\n series.bulletsContainer.parent = undefined;\r\n }\r\n //this.feedLegend();\r\n var legend = this.legend;\r\n if (legend) {\r\n var dataItems = this.legend.dataItems;\r\n for (var i = dataItems.length - 1; i >= 0; i--) {\r\n var dataItem = dataItems.getIndex(i);\r\n if (dataItem && dataItem.dataContext == series) {\r\n legend.dataItems.remove(dataItem);\r\n }\r\n }\r\n for (var i = legend.data.length - 1; i >= 0; i--) {\r\n var di = legend.data[i];\r\n if (di && di == series) {\r\n $array.remove(legend.data, di);\r\n }\r\n }\r\n }\r\n };\r\n /**\r\n * Decorates a new [[Series]] object with required parameters when it is\r\n * added to the chart.\r\n *\r\n * @ignore Exclude from docs\r\n * @param event Event\r\n */\r\n SerialChart.prototype.handleSeriesAdded = function (event) {\r\n var _this = this;\r\n var series = event.newValue;\r\n if (series.isDisposed()) {\r\n return;\r\n }\r\n series.chart = this;\r\n series.parent = this.seriesContainer;\r\n series.bulletsContainer.parent = this.bulletsContainer;\r\n this._dataUsers.moveValue(series);\r\n series.addDisposer(new Disposer(function () {\r\n _this.dataUsers.removeValue(series);\r\n }));\r\n this.handleSeriesAdded2(series);\r\n this.handleLegendSeriesAdded(series);\r\n };\r\n SerialChart.prototype.handleLegendSeriesAdded = function (series) {\r\n if (!series.hiddenInLegend) {\r\n if (this.legend) {\r\n this.legend.addData(series);\r\n }\r\n }\r\n };\r\n SerialChart.prototype.handleSeriesAdded2 = function (series) {\r\n var _this = this;\r\n if (!this.dataInvalid) {\r\n this._disposers.push(\r\n // on exit only as data is usually passed after push\r\n registry.events.once(\"exitframe\", function () {\r\n if (!series.data || series.data.length == 0) {\r\n series.data = _this.data;\r\n if (series.showOnInit) {\r\n series.reinit();\r\n series.setPropertyValue(\"showOnInit\", false);\r\n series.showOnInit = true;\r\n }\r\n series.events.once(\"datavalidated\", function () {\r\n if (series.data == _this.data) {\r\n series._data = [];\r\n }\r\n });\r\n }\r\n }));\r\n }\r\n };\r\n /**\r\n * Setups the legend to use the chart's data.\r\n * @ignore\r\n */\r\n SerialChart.prototype.feedLegend = function () {\r\n var legend = this.legend;\r\n if (legend) {\r\n var legendData_1 = [];\r\n $iter.each(this.series.iterator(), function (series) {\r\n if (!series.hiddenInLegend) {\r\n legendData_1.push(series);\r\n }\r\n });\r\n legend.dataFields.name = \"name\";\r\n legend.data = legendData_1;\r\n }\r\n };\r\n /**\r\n * Creates and returns a new Series, suitable for this chart type.\r\n *\r\n * @return New series\r\n */\r\n SerialChart.prototype.createSeries = function () {\r\n return new Series();\r\n };\r\n Object.defineProperty(SerialChart.prototype, \"colors\", {\r\n /**\r\n * @return Color list\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"colors\");\r\n },\r\n /**\r\n * Chart's color list.\r\n *\r\n * This list can be used by a number of serial items, like applying a new\r\n * color for each Series added. Or, applying a new color for each slice\r\n * of a Pie chart.\r\n *\r\n * Please see [[ColorSet]] for information on how you can set up to generate\r\n * unique colors.\r\n *\r\n * A theme you are using may override default pre-defined colors.\r\n *\r\n * @param value Color list\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"colors\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(SerialChart.prototype, \"patterns\", {\r\n /**\r\n * @return Pattern set\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"patterns\");\r\n },\r\n /**\r\n * A [[PatternSet]] to use when creating patterned fills for slices.\r\n *\r\n * @since 4.7.5\r\n * @param value Pattern set\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"patterns\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Copies all parameters from another [[SerialChart]].\r\n *\r\n * @param source Source SerialChart\r\n */\r\n SerialChart.prototype.copyFrom = function (source) {\r\n _super.prototype.copyFrom.call(this, source);\r\n this.series.copyFrom(source.series);\r\n };\r\n /**\r\n * Hides the chart instantly and then shows it. If defaultState.transitionDuration > 0, this will result an animation in which properties of hidden state will animate to properties of visible state.\r\n */\r\n SerialChart.prototype.appear = function () {\r\n _super.prototype.appear.call(this);\r\n this.series.each(function (series) {\r\n if (series.showOnInit && series.inited) {\r\n series.appear();\r\n }\r\n });\r\n };\r\n return SerialChart;\r\n}(Chart));\r\nexport { SerialChart };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"SerialChart\"] = SerialChart;\r\n","/**\r\n * Base functionality\r\n*/\r\nimport { __extends } from \"tslib\";\r\nimport { List, ListTemplate } from \"./utils/List\";\r\nimport { OrderedListTemplate, SortedListTemplate } from \"./utils/SortedList\";\r\nimport { Dictionary, DictionaryTemplate } from \"./utils/Dictionary\";\r\nimport { Disposer } from \"./utils/Disposer\";\r\nimport { EventDispatcher } from \"./utils/EventDispatcher\";\r\nimport { Adapter } from \"./utils/Adapter\";\r\nimport { Color, color } from \"./utils/Color\";\r\nimport { Percent, percent } from \"./utils/Percent\";\r\nimport { registry } from \"./Registry\";\r\nimport { cache } from \"./utils/Cache\";\r\nimport * as $array from \"./utils/Array\";\r\nimport * as $object from \"./utils/Object\";\r\nimport * as $type from \"./utils/Type\";\r\n//import * as $debug from \"./utils/Debug\";\r\n/**\r\n * Provides base functionality for all derivative objects, like generating ids,\r\n * handling cache, etc.\r\n */\r\nvar BaseObject = /** @class */ (function () {\r\n //protected _classes: { [index: string]: any } = {};\r\n /**\r\n * Constructor\r\n * * Sets class name\r\n */\r\n function BaseObject() {\r\n /**\r\n * Indicates if this object has already been deleted. Any\r\n * destruction/disposal code should take this into account when deciding\r\n * wheter to run potentially costly disposal operations if they already have\r\n * been run.\r\n */\r\n this._disposed = false;\r\n /**\r\n * List of IDisposer which will be disposed when the BaseObject is disposed.\r\n */\r\n this._disposers = [];\r\n this.className = \"BaseObject\";\r\n //this.debug();\r\n }\r\n BaseObject.prototype.debug = function () {\r\n //$debug.debug(this);\r\n };\r\n Object.defineProperty(BaseObject.prototype, \"uid\", {\r\n /**\r\n * Returns object's internal unique ID.\r\n *\r\n * @return Unique ID\r\n */\r\n get: function () {\r\n if (!this._uid) {\r\n this._uid = registry.getUniqueId();\r\n registry.map.setKey(this._uid, this);\r\n }\r\n return this._uid;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(BaseObject.prototype, \"id\", {\r\n /**\r\n * @return Id\r\n */\r\n get: function () {\r\n return this._id;\r\n },\r\n /**\r\n * Sets the user-defined id of the element.\r\n *\r\n * @param value Id\r\n */\r\n set: function (value) {\r\n //registry.map.setKey(value, this); // registry.map only stores by uid\r\n this._id = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(BaseObject.prototype, \"map\", {\r\n /**\r\n * Returns a universal collection for mapping ids with objects.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Map collection\r\n */\r\n get: function () {\r\n if (!this._map) {\r\n this._map = new Dictionary();\r\n }\r\n return this._map;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(BaseObject.prototype, \"delayedMap\", {\r\n /**\r\n * Returns mapping for objects referenced by id in JSON config that are not yet\r\n * available at processing time.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Map collection\r\n */\r\n get: function () {\r\n if (!this._delayedMap) {\r\n this._delayedMap = new Dictionary();\r\n }\r\n return this._delayedMap;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Logs an id and property of the target element that is not yet available\r\n * for later assignment.\r\n *\r\n * @ignore\r\n * @param property Property to set\r\n * @param id ID of the target element\r\n */\r\n BaseObject.prototype.addDelayedMap = function (property, id) {\r\n var map = this.delayedMap;\r\n if (!map.hasKey(id)) {\r\n map.setKey(id, []);\r\n }\r\n var list = map.getKey(id);\r\n list.push({\r\n property: property,\r\n target: this\r\n });\r\n };\r\n /**\r\n * Processes delayed JSON config items.\r\n *\r\n * @ignore\r\n */\r\n BaseObject.prototype.processDelayedMap = function () {\r\n var _this = this;\r\n this.delayedMap.each(function (id, list) {\r\n if (_this.map.hasKey(id)) {\r\n var target_1 = _this.map.getKey(id);\r\n $array.each(list, function (item) {\r\n item.target[item.property] = target_1;\r\n });\r\n _this.delayedMap.removeKey(id);\r\n }\r\n });\r\n };\r\n /**\r\n * Applies properties from all assigned themes.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n BaseObject.prototype.applyTheme = function () {\r\n var _this = this;\r\n // TODO is this needed ?\r\n if (registry) {\r\n var themes = this.getCurrentThemes();\r\n // TODO is this needed ?\r\n if (themes) {\r\n $array.each(themes, function (theme, index) {\r\n theme(_this);\r\n });\r\n }\r\n }\r\n };\r\n Object.defineProperty(BaseObject.prototype, \"themes\", {\r\n /**\r\n * @ignore Exclude from docs\r\n * @return An array of themes\r\n */\r\n get: function () {\r\n return this._themes;\r\n },\r\n /**\r\n * A list of themes to be used for this element.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value An array of themes\r\n */\r\n set: function (value) {\r\n this._themes = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Returns a list of themes that should be applied to this element. It could\r\n * either be a list of themes set explicitly on this element, or system-wide.\r\n *\r\n * @return List of themes\r\n */\r\n BaseObject.prototype.getCurrentThemes = function () {\r\n return this.themes || registry.themes;\r\n };\r\n /**\r\n * Returns if this object has been already been disposed.\r\n *\r\n * @return Is disposed?\r\n */\r\n BaseObject.prototype.isDisposed = function () {\r\n return this._disposed;\r\n };\r\n /**\r\n * Destroys this object and all related data.\r\n */\r\n BaseObject.prototype.dispose = function () {\r\n if (!this._disposed) {\r\n this._disposed = true;\r\n var a = this._disposers;\r\n this._disposers = null;\r\n while (a.length !== 0) {\r\n var disposer = a.shift();\r\n disposer.dispose();\r\n }\r\n // Clear cache\r\n this.clearCache();\r\n // remove from clones list\r\n if (this.clonedFrom) {\r\n this.clonedFrom.clones.removeValue(this);\r\n }\r\n var uid = this._uid;\r\n if (uid != null) {\r\n registry.map.removeKey(uid);\r\n }\r\n }\r\n };\r\n /**\r\n * Adds an IDisposer, which will be disposed when this object is disposed.\r\n *\r\n * @param target Object to dispose\r\n * @ignore Exclude from docs\r\n */\r\n BaseObject.prototype.addDisposer = function (target) {\r\n this._disposers.push(target);\r\n };\r\n /**\r\n * Disposes disposable object and removes it from `_disposers`.\r\n *\r\n * @param target Object to dispose\r\n * @ignore Exclude from docs\r\n */\r\n BaseObject.prototype.removeDispose = function (target) {\r\n //if(target){\r\n if (!this._disposed) {\r\n var index = $array.indexOf(this._disposers, target);\r\n if (index > -1) {\r\n this._disposers.splice(index, 1);\r\n }\r\n }\r\n target.dispose();\r\n //}\r\n };\r\n /**\r\n * Makes a copy of this object and returns the clone. Try to avoid cloning complex objects like chart, create new instances if you need them.\r\n *\r\n * @param cloneId An id to use for clone (if not set a unique id will be generated)\r\n * @returns Clone\r\n */\r\n BaseObject.prototype.clone = function (cloneId) {\r\n if (!cloneId) {\r\n cloneId = \"clone-\" + registry.getUniqueId();\r\n }\r\n var newObject = new this.constructor();\r\n newObject.cloneId = cloneId;\r\n newObject.copyFrom(this);\r\n // add to clones list\r\n // this.clones.push(newObject); // moved this to copyFrom\r\n return newObject;\r\n };\r\n Object.defineProperty(BaseObject.prototype, \"clones\", {\r\n /**\r\n * Returns a collection of object's clones.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Clones\r\n */\r\n get: function () {\r\n if (!this._clones) {\r\n this._clones = new List();\r\n }\r\n return this._clones;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Copies all properties and related data from different element.\r\n *\r\n * @param object Source element\r\n */\r\n BaseObject.prototype.copyFrom = function (object) {\r\n object.clones.push(this); // do not moveValue, as it is expensive! even if there will be several items in clones list, it's not that bad.\r\n this.clonedFrom = object;\r\n };\r\n Object.defineProperty(BaseObject.prototype, \"className\", {\r\n /**\r\n * @ignore Exclude from docs\r\n * @return Class name\r\n */\r\n get: function () {\r\n return this._className;\r\n },\r\n /**\r\n * Element's class name. (a class that was used to instantiate the element)\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Class name\r\n */\r\n set: function (value) {\r\n this._className = value;\r\n /*if (registry) {\r\n registry.registeredClasses[value] = typeof this;\r\n }*/\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Caches value in object's cache.\r\n *\r\n * @ignore Exclude from docs\r\n * @param key Key\r\n * @param value Value\r\n * @param ttl TTL in seconds\r\n */\r\n BaseObject.prototype.setCache = function (key, value, ttl) {\r\n cache.set(this.uid, key, value, ttl);\r\n };\r\n /**\r\n * Retrieves cached value.\r\n *\r\n * If optional second padarameter is specified, it will return that value\r\n * if cache is not available or is expired.\r\n *\r\n * @ignore Exclude from docs\r\n * @param key Key\r\n * @param value Value to return if cache is not available\r\n * @return Value\r\n */\r\n BaseObject.prototype.getCache = function (key, value) {\r\n if (value === void 0) { value = undefined; }\r\n return cache.get(this.uid, key, value);\r\n };\r\n /**\r\n * Clears object's local cache.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n BaseObject.prototype.clearCache = function () {\r\n cache.clear(this.uid);\r\n };\r\n /**\r\n * Creates [[Disposer]] for `setTimeout` function call. This ensures that all\r\n * timeouts created by the object will be cleared when object itself is\r\n * disposed.\r\n *\r\n * @ignore Exclude from docs\r\n * @param fn Callback function\r\n * @param delay Timeout (ms)\r\n * @return Disposer for timeout\r\n */\r\n BaseObject.prototype.setTimeout = function (fn, delay) {\r\n var _this = this;\r\n var id = setTimeout(function () {\r\n _this.removeDispose(disposer);\r\n fn();\r\n }, delay);\r\n var disposer = new Disposer(function () {\r\n clearTimeout(id);\r\n });\r\n this._disposers.push(disposer);\r\n return disposer;\r\n };\r\n /**\r\n * Creates [[Disposer]] for `setInterval` function call. This ensures that all\r\n * timeouts created by the object will be cleared when object itself is\r\n * disposed.\r\n *\r\n * @ignore Exclude from docs\r\n * @param fn Callback function\r\n * @param delay Timeout (ms)\r\n * @return Disposer for timeout\r\n */\r\n BaseObject.prototype.setInterval = function (fn, delay) {\r\n var _this = this;\r\n var id = setInterval(function () {\r\n _this.removeDispose(disposer);\r\n fn();\r\n }, delay);\r\n var disposer = new Disposer(function () {\r\n clearTimeout(id);\r\n });\r\n this._disposers.push(disposer);\r\n return disposer;\r\n };\r\n Object.defineProperty(BaseObject.prototype, \"config\", {\r\n /**\r\n * ==========================================================================\r\n * JSON-BASED CONFIG PROCESSING\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Use this property to set JSON-based config. When set, triggers processing\r\n * routine, which will go through all properties, and try to apply values,\r\n * create instances, etc.\r\n *\r\n * Use this with caution, as it is a time-consuming process. It's used for\r\n * initialchart setup only, not routine operations.\r\n *\r\n * @param json JSON config\r\n */\r\n set: function (config) {\r\n try {\r\n this.processConfig(config);\r\n }\r\n catch (e) {\r\n /*if (this instanceof Sprite) {\r\n this.raiseCriticalError(e);\r\n }*/\r\n this.raiseCriticalError(e);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Processes the JSON config.\r\n *\r\n * @param json JSON config\r\n * @ignore Exclude from docs\r\n */\r\n BaseObject.prototype.processConfig = function (config) {\r\n var _this = this;\r\n if (!config) {\r\n return;\r\n }\r\n // Get target\r\n var target = this;\r\n // Iterate through all of the items\r\n $object.eachOrdered(config, function (configKey, value) {\r\n var configValue = value;\r\n // Is this a callback?\r\n if (configKey == \"callback\" && typeof value == \"function\") {\r\n value.call(target);\r\n }\r\n // Check if there's a property in target\r\n if (_this.hasProperty(configKey)) {\r\n var item_1;\r\n // Do we have instructions to create an object?\r\n // We create a new object if \"type\" key is set, but only if the\r\n // target object is of different type.\r\n if ($type.isObject(configValue)\r\n && $type.hasValue(configValue[\"type\"])\r\n && (!$type.isObject(target[configKey])\r\n || !$type.hasValue(target[configKey].className)\r\n || configValue[\"forceCreate\"]\r\n || target[configKey].className != configValue[\"type\"])\r\n && !_this.asIs(configKey)) {\r\n item_1 = _this.createClassInstance(configValue[\"type\"]);\r\n // Create new instance\r\n if (item_1) {\r\n target[configKey] = item_1;\r\n }\r\n else {\r\n item_1 = target[configKey];\r\n }\r\n }\r\n else {\r\n // Get item from the object\r\n item_1 = target[configKey];\r\n }\r\n /**\r\n * It is...\r\n * --------------------------------------------------------------------\r\n */\r\n if (item_1 instanceof Adapter) {\r\n // ... an Adapter, try to add handlers to it\r\n // ------------------------------------------------------------------\r\n _this.processAdapters(item_1, configValue);\r\n }\r\n else if (item_1 instanceof EventDispatcher) {\r\n // ... an EventDispatcher, try to add handlers to it\r\n // ------------------------------------------------------------------\r\n _this.processEvents(item_1, configValue);\r\n }\r\n else if (configKey == \"locale\" && $type.isString(configValue)) {\r\n // ... a locale specified as string, e.g. \"fr_FR\"\r\n // ------------------------------------------------------------------\r\n if (window[\"am4lang_\" + configValue]) {\r\n target[configKey] = window[\"am4lang_\" + configValue];\r\n }\r\n }\r\n else if (configKey == \"parent\" && $type.isString(configValue)) {\r\n // ... a parent referred via its it\r\n // ------------------------------------------------------------------\r\n var parent_1 = _this.map.getKey(configValue);\r\n if (parent_1) {\r\n target[configKey] = parent_1;\r\n }\r\n else {\r\n _this.addDelayedMap(\"parent\", configValue);\r\n }\r\n }\r\n else if (_this.asIs(configKey)) {\r\n // ... a special field, just set it to new value\r\n // ------------------------------------------------------------------\r\n // (no need to add each indvidual item)\r\n target[configKey] = configValue;\r\n }\r\n else if (_this.asFunction(configKey) && $type.isString(configValue)) {\r\n // ... a field indicating function name to look for in registry\r\n // ------------------------------------------------------------------\r\n if ($type.hasValue(registry.registeredClasses[configValue])) {\r\n target[configKey] = registry.registeredClasses[configValue];\r\n }\r\n else {\r\n throw Error(\"Invalid easing function: \" + configValue);\r\n }\r\n }\r\n else if (configValue instanceof BaseObject) {\r\n // ... a BaseObject object, we just going to use it as it is\r\n // ------------------------------------------------------------------\r\n target[configKey] = configValue;\r\n }\r\n else if (item_1 instanceof BaseObject) {\r\n // ... another child BaseObject\r\n // ------------------------------------------------------------------\r\n // Let's just pass in config part in and let itself deal with it\r\n item_1.config = configValue;\r\n }\r\n else if (item_1 instanceof ListTemplate || item_1 instanceof OrderedListTemplate || item_1 instanceof SortedListTemplate) {\r\n // ... a list with template\r\n // ------------------------------------------------------------------\r\n // Let's see what we can do with it\r\n if ($type.isArray(configValue)) {\r\n // It's an array.\r\n // Create a list item for entry, or try to apply properties to an\r\n // existing entry if possible and it is present.\r\n if (item_1 instanceof ListTemplate) {\r\n _this.processListTemplate(configValue, item_1);\r\n }\r\n else {\r\n _this.processOrderedTemplate(configValue, item_1);\r\n }\r\n }\r\n else if ($type.isObject(configValue)) {\r\n // It's a single oject.\r\n // Treat it as a template.\r\n if (configValue instanceof BaseObject) {\r\n // Item is already a BaseObject, no need to process it further\r\n item_1.template = configValue;\r\n }\r\n else {\r\n // Now let's find out if the whole object if a template, or we\r\n // need to get it from `template` key\r\n var templateValue = void 0;\r\n if ($type.hasValue(configValue.template)) {\r\n templateValue = configValue.template;\r\n }\r\n else {\r\n templateValue = configValue;\r\n }\r\n if (item_1.template instanceof BaseObject) {\r\n // Template is a BaseObject so we will just let its config\r\n // deal with the configuration\r\n item_1.template.config = templateValue;\r\n }\r\n else {\r\n $object.each(templateValue, function (entryKey, entryValue) {\r\n var listItem = item_1.template[entryKey];\r\n if (listItem instanceof Adapter) {\r\n _this.processAdapters(listItem, entryValue);\r\n }\r\n else if (listItem instanceof EventDispatcher) {\r\n _this.processEvents(listItem, entryValue);\r\n }\r\n else if (listItem instanceof DictionaryTemplate) {\r\n _this.processDictionaryTemplate(listItem, entryValue);\r\n }\r\n else if (item_1.template[entryKey] instanceof BaseObject) {\r\n // Template is a BaseObject. Let it deal with its own config.\r\n item_1.template[entryKey].config = entryValue;\r\n }\r\n else if ($type.isObject(entryValue) && $type.hasValue(entryValue[\"type\"])) {\r\n listItem = _this.createClassInstance(entryValue[\"type\"]);\r\n if (listItem) {\r\n if (listItem instanceof BaseObject) {\r\n listItem.config = entryValue;\r\n }\r\n item_1.template[entryKey] = listItem;\r\n }\r\n else {\r\n item_1.template[entryKey] = entryValue;\r\n }\r\n }\r\n else if (listItem instanceof List) {\r\n // It's List, process it\r\n _this.processList(entryValue, listItem);\r\n }\r\n else {\r\n // Aything else. Just assing and be done with it.\r\n item_1.template[entryKey] = _this.maybeColorOrPercent(entryValue);\r\n }\r\n });\r\n }\r\n // Check maybe there are `values` to insert\r\n if ($type.hasValue(configValue.values)) {\r\n if (item_1 instanceof ListTemplate) {\r\n _this.processListTemplate(configValue.values, item_1);\r\n }\r\n else {\r\n _this.processOrderedTemplate(configValue.values, item_1);\r\n }\r\n }\r\n }\r\n }\r\n else {\r\n // Something else?\r\n // Not sure what to do with it on a list - ignore\r\n }\r\n }\r\n else if (item_1 instanceof List) {\r\n // ... a list\r\n // ------------------------------------------------------------------\r\n if (configKey == \"children\") {\r\n _this.processList(configValue, item_1, _this);\r\n }\r\n else {\r\n _this.processList(configValue, item_1);\r\n }\r\n }\r\n else if (item_1 instanceof DictionaryTemplate) {\r\n // ... a dictionary with template\r\n // ------------------------------------------------------------------\r\n _this.processDictionaryTemplate(item_1, configValue);\r\n }\r\n else if (item_1 instanceof Dictionary) {\r\n // ... a dictionary\r\n // ------------------------------------------------------------------\r\n _this.processDictionary(item_1, configValue);\r\n }\r\n else if (item_1 instanceof Color || item_1 instanceof Percent) {\r\n // ... it's a Color or Percent\r\n // ------------------------------------------------------------------\r\n target[configKey] = _this.maybeColorOrPercent(configValue);\r\n }\r\n else if ($type.isObject(item_1) && $type.isObject(configValue)) {\r\n // ... a regular object\r\n // ------------------------------------------------------------------\r\n $object.copyAllProperties(configValue, item_1);\r\n }\r\n else {\r\n // ... something else - probably a simple property or object\r\n // ------------------------------------------------------------------\r\n // Maybe convert to `Percent` or `Color`?\r\n configValue = _this.maybeColorOrPercent(configValue);\r\n // Assign\r\n target[configKey] = configValue;\r\n }\r\n }\r\n else if (!_this.isReserved(configKey)) {\r\n // Doesn't have property set. But we're going to assume JSON config\r\n // creator knows what he/she is doing and set it anyway.\r\n target[configKey] = configValue;\r\n }\r\n }, this.configOrder);\r\n // Any errors?\r\n if (this.processingErrors.length) {\r\n var errors = this.processingErrors.join(\"\\n\");\r\n this._processingErrors = [];\r\n throw Error(errors);\r\n }\r\n };\r\n /**\r\n * Tries to detect if value is color or percent and converts to proper object\r\n * if necessary.\r\n *\r\n * Returns the same source value if no color/percent detected\r\n *\r\n * @param value Source value\r\n * @return Converted value\r\n */\r\n BaseObject.prototype.maybeColorOrPercent = function (value) {\r\n if ($type.isString(value)) {\r\n if (value.match(/^[\\-]?[0-9.]+\\%$/)) {\r\n return percent($type.toNumber(value));\r\n }\r\n else if (value.match(/^\\#[0-9abcdef]{3,}$/i)) {\r\n return color(value);\r\n }\r\n }\r\n return value;\r\n };\r\n BaseObject.prototype.processAdapters = function (item, config) {\r\n var _this = this;\r\n if ($type.isArray(config)) {\r\n $array.each(config, function (entry, index) {\r\n item.add(entry.key, entry.callback, entry.priority || 0, _this);\r\n });\r\n }\r\n else if ($type.isObject(config)) {\r\n $object.each(config, function (key, entry) {\r\n if (!item.has(key, entry)) {\r\n item.add(key, entry);\r\n }\r\n });\r\n }\r\n };\r\n BaseObject.prototype.processEvents = function (item, config) {\r\n var _this = this;\r\n if ($type.isObject(config)) {\r\n $object.each(config, function (key, entry) {\r\n if (!item.has(key, entry)) {\r\n item.on(key, entry);\r\n }\r\n });\r\n }\r\n else if ($type.isArray(config)) {\r\n $array.each(config, function (entry, index) {\r\n item.on(entry.type, entry.callback, _this);\r\n });\r\n }\r\n };\r\n /**\r\n * Processes JSON config for a [[DictionaryTemplate]] item.\r\n *\r\n * @todo Description\r\n * @param item Item\r\n * @param config Config\r\n */\r\n BaseObject.prototype.processDictionaryTemplate = function (item, config) {\r\n // We can only process object\r\n // Not sure what to do with other types - ignore\r\n if ($type.isObject(config)) {\r\n // Create an entry for each item, or override properties for\r\n // existing one.\r\n $object.each(config, function (entryKey, entryValue) {\r\n var listItem;\r\n // Get existing one, or create a new one\r\n if (entryKey == \"template\") {\r\n listItem = item.template;\r\n }\r\n else if (item.hasKey(entryKey)) {\r\n listItem = item.getKey(entryKey);\r\n }\r\n else {\r\n listItem = item.create(entryKey);\r\n }\r\n // Set data\r\n if (listItem instanceof BaseObject) {\r\n listItem.config = entryValue;\r\n }\r\n else if ($type.isObject(listItem) && $type.isObject(entryValue)) {\r\n $object.copyAllProperties(entryValue, listItem);\r\n }\r\n else {\r\n listItem.setKey(entryKey, entryValue);\r\n }\r\n });\r\n }\r\n };\r\n /**\r\n * Processes JSON config for a [[Dictionary]] item.\r\n *\r\n * @todo Description\r\n * @param item Item\r\n * @param config Config\r\n */\r\n BaseObject.prototype.processDictionary = function (item, config) {\r\n // We can only process object\r\n // Not sure what to do with other types - ignore\r\n if ($type.isObject(config)) {\r\n // Create an entry for each item, or override properties for\r\n // existing one.\r\n // @todo support for non-basic types\r\n $object.each(config, function (entryKey, entryValue) {\r\n item.setKey(entryKey, entryValue);\r\n });\r\n }\r\n };\r\n /**\r\n * Processes [[ListTemplate]].\r\n *\r\n * @param configValue Config value\r\n * @param item Item\r\n */\r\n BaseObject.prototype.processListTemplate = function (configValue, item) {\r\n var _this = this;\r\n $array.each(configValue, function (entry, index) {\r\n var type = _this.getConfigEntryType(entry);\r\n var listItem;\r\n if (item.hasIndex(index) && !entry[\"forceCreate\"]) {\r\n listItem = item.getIndex(index);\r\n }\r\n else if (entry instanceof BaseObject) {\r\n // Item is already a BaseObject, no need to process it further\r\n item.push(entry);\r\n return;\r\n }\r\n else if (type) {\r\n listItem = item.create(type);\r\n }\r\n else {\r\n listItem = item.create();\r\n }\r\n if (entry === listItem) {\r\n // It's already the same item, do nothing\r\n }\r\n else {\r\n if ($type.isObject(entry)) {\r\n // If the list item is BaseObject, we just need to let it\r\n // deal if its own config\r\n if (listItem instanceof BaseObject) {\r\n listItem.config = entry;\r\n }\r\n else if ($type.isObject(listItem) && $type.isObject(entry)) {\r\n $object.copyAllProperties(entry, listItem);\r\n }\r\n else {\r\n item.setIndex(item.indexOf(listItem), entry);\r\n }\r\n }\r\n }\r\n });\r\n // Truncate the list if it contains less items than the config\r\n // array\r\n while (configValue.length > item.length) {\r\n item.pop();\r\n }\r\n };\r\n /**\r\n * Processes [[OrdererListTemplate]] or [[SortedListTemplate]].\r\n *\r\n * @param configValue Config value\r\n * @param item Item\r\n */\r\n BaseObject.prototype.processOrderedTemplate = function (configValue, item) {\r\n var _this = this;\r\n $array.each(configValue, function (entry, index) {\r\n var type = _this.getConfigEntryType(entry);\r\n var listItem;\r\n if (type) {\r\n listItem = item.create(type);\r\n }\r\n else {\r\n listItem = item.create();\r\n }\r\n if ($type.isObject(entry)) {\r\n // If the list item is BaseObject, we just need to let it\r\n // deal if its own config\r\n if (listItem instanceof BaseObject) {\r\n listItem.config = entry;\r\n }\r\n else if ($type.isObject(listItem) && $type.isObject(entry)) {\r\n $object.copyAllProperties(entry, listItem);\r\n }\r\n else {\r\n item.insert(entry);\r\n }\r\n }\r\n });\r\n };\r\n /**\r\n * Processes [[List]].\r\n *\r\n * @param configValue Config value\r\n * @param item Item\r\n */\r\n BaseObject.prototype.processList = function (configValue, item, parent) {\r\n var _this = this;\r\n // Convert to array if necessary\r\n if (!$type.isArray(configValue)) {\r\n configValue = [configValue];\r\n }\r\n // It's an array\r\n // Create a list item for entry\r\n var itemCount = item.length;\r\n $array.each(configValue, function (entry, index) {\r\n if ($type.isObject(entry)) {\r\n // An object.\r\n //\r\n // Let's see if we can instantiate a class out of it, or we need\r\n // to push it into list as it is.\r\n //\r\n // If there are items already at the specified index in the list,\r\n // apply properties rather than create a new one.\r\n var listItem = void 0;\r\n if ((index < itemCount) && !entry[\"forceCreate\"]) {\r\n listItem = item.getIndex(index);\r\n }\r\n else if (entry instanceof BaseObject) {\r\n // Item is already a BaseObject, no need to process it further\r\n item.push(entry);\r\n return;\r\n }\r\n else {\r\n listItem = _this.createEntryInstance(entry);\r\n if (parent) {\r\n listItem.parent = parent;\r\n }\r\n else {\r\n item.push(listItem);\r\n }\r\n }\r\n // If the list item is BaseObject, we just need to let it\r\n // deal if its own config\r\n if (listItem instanceof BaseObject) {\r\n listItem.config = entry;\r\n }\r\n else if ($type.isObject(listItem) && $type.isObject(entry)) {\r\n $object.copyAllProperties(entry, listItem);\r\n }\r\n }\r\n else {\r\n // Basic value.\r\n // Just push it into list, or override existing value\r\n if (item.hasIndex(index)) {\r\n item.setIndex(index, entry);\r\n }\r\n else {\r\n item.push(entry);\r\n }\r\n }\r\n });\r\n // Truncate the list if it contains less items than the config\r\n // array\r\n while (configValue.length > item.length) {\r\n item.pop();\r\n }\r\n };\r\n /**\r\n * This function is used to sort element's JSON config properties, so that\r\n * some properties that absolutely need to be processed last, can be put at\r\n * the end.\r\n *\r\n * @ignore Exclude from docs\r\n * @param a Element 1\r\n * @param b Element 2\r\n * @return Sorting number\r\n */\r\n BaseObject.prototype.configOrder = function (a, b) {\r\n if (a == b) {\r\n return 0;\r\n }\r\n // Language must come first, so it's all set up when the rest of the\r\n // elements are being instantiated\r\n else if (a == \"language\") {\r\n return -1;\r\n }\r\n else if (b == \"language\") {\r\n return 1;\r\n }\r\n else {\r\n return 0;\r\n }\r\n };\r\n /**\r\n * Checks if field should be just assigned as is, without any checking when\r\n * processing JSON config.\r\n *\r\n * Extending functions can override this function to do their own checks.\r\n *\r\n * @param field Field name\r\n * @return Assign as is?\r\n */\r\n BaseObject.prototype.asIs = function (field) {\r\n return $array.indexOf([\"locale\"], field) != -1;\r\n };\r\n /**\r\n * Checks if field needs to be converted to function, if it is specified\r\n * as string.\r\n *\r\n * @param field Field name\r\n * @return Assign as function?\r\n */\r\n BaseObject.prototype.asFunction = function (field) {\r\n return false;\r\n };\r\n /**\r\n * Creates a relevant class instance if such class definition exists.\r\n *\r\n * @ignore Exclude from docs\r\n * @param className Class name\r\n * @return Instance\r\n */\r\n BaseObject.prototype.createClassInstance = function (className) {\r\n if ($type.hasValue(registry.registeredClasses[className])) {\r\n return new registry.registeredClasses[className]();\r\n }\r\n else {\r\n throw Error(\"Invalid type: \\\"\" + className + \"\\\".\");\r\n }\r\n };\r\n /**\r\n * Creates a class instance for a config entry using it's type. (as set in\r\n * `type` property)\r\n *\r\n * @ignore Exclude from docs\r\n * @param config Config part\r\n * @return Instance\r\n */\r\n BaseObject.prototype.createEntryInstance = function (config) {\r\n var res;\r\n if ($type.hasValue(config[\"type\"])) {\r\n res = this.createClassInstance(config[\"type\"]);\r\n }\r\n if (!res) {\r\n return config;\r\n }\r\n return res;\r\n };\r\n /**\r\n * Determines config object type.\r\n *\r\n * @ignore Exclude from docs\r\n * @param config Config part\r\n * @return Type\r\n */\r\n BaseObject.prototype.getConfigEntryType = function (config) {\r\n if ($type.hasValue(config[\"type\"])) {\r\n if ($type.hasValue(registry.registeredClasses[config[\"type\"]])) {\r\n return registry.registeredClasses[config[\"type\"]];\r\n }\r\n else {\r\n throw Error(\"Invalid type: \\\"\" + config[\"type\"] + \"\\\".\");\r\n }\r\n }\r\n return;\r\n };\r\n /**\r\n * Checks if this element has a property.\r\n *\r\n * @ignore Exclude from docs\r\n * @param prop Property name\r\n * @return Has property?\r\n */\r\n BaseObject.prototype.hasProperty = function (prop) {\r\n return prop in this ? true : false;\r\n };\r\n /**\r\n * Checkes whether JSON key is a reserved keyword.\r\n *\r\n * @param key Key\r\n * @return Reserved\r\n */\r\n BaseObject.prototype.isReserved = function (key) {\r\n return [\"type\", \"forceCreate\"].indexOf(key) !== -1;\r\n };\r\n Object.defineProperty(BaseObject.prototype, \"processingErrors\", {\r\n /**\r\n * A list of errors that happened during JSON processing.\r\n *\r\n * @return Errors\r\n */\r\n get: function () {\r\n if (!this._processingErrors) {\r\n this._processingErrors = [];\r\n }\r\n return this._processingErrors;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return BaseObject;\r\n}());\r\nexport { BaseObject };\r\n;\r\n/**\r\n * A version of [[BaseObject]] with events properties and methods.\r\n * Classes that use [[EventDispatcher]] should extend this instead of\r\n * [[BaseObject]] directly.\r\n */\r\nvar BaseObjectEvents = /** @class */ (function (_super) {\r\n __extends(BaseObjectEvents, _super);\r\n /**\r\n * Constructor\r\n */\r\n function BaseObjectEvents() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"BaseObjectEvents\";\r\n return _this;\r\n }\r\n Object.defineProperty(BaseObjectEvents.prototype, \"events\", {\r\n /**\r\n * An [[EventDispatcher]] instance\r\n */\r\n get: function () {\r\n if (!this._eventDispatcher) {\r\n this._eventDispatcher = new EventDispatcher();\r\n this._disposers.push(this._eventDispatcher);\r\n }\r\n return this._eventDispatcher;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n //public set events(value:EventDispatcher>){\r\n //\tthis._eventDispatcher = value;\r\n //}\r\n /**\r\n * Dispatches an event using own event dispatcher. Will automatically\r\n * populate event data object with event type and target (this element).\r\n * It also checks if there are any handlers registered for this sepecific\r\n * event.\r\n *\r\n * @param eventType Event type (name)\r\n * @param data Data to pass into event handler(s)\r\n */\r\n BaseObjectEvents.prototype.dispatch = function (eventType, data) {\r\n // @todo Implement proper type check\r\n if (this._eventDispatcher) {\r\n if (this.events.isEnabled(eventType)) {\r\n if (data) {\r\n data.type = eventType;\r\n data.target = data.target || this;\r\n this.events.dispatch(eventType, {\r\n type: eventType,\r\n target: this\r\n });\r\n }\r\n else {\r\n this.events.dispatch(eventType, {\r\n type: eventType,\r\n target: this\r\n });\r\n }\r\n }\r\n }\r\n };\r\n /**\r\n * Works like `dispatch`, except event is triggered immediately, without\r\n * waiting for the next frame cycle.\r\n *\r\n * @param eventType Event type (name)\r\n * @param data Data to pass into event handler(s)\r\n */\r\n BaseObjectEvents.prototype.dispatchImmediately = function (eventType, data) {\r\n // @todo Implement proper type check\r\n if (this._eventDispatcher) {\r\n if (this.events.isEnabled(eventType)) {\r\n if (data) {\r\n data.type = eventType;\r\n data.target = data.target || this;\r\n this.events.dispatchImmediately(eventType, data);\r\n }\r\n else {\r\n this.events.dispatchImmediately(eventType, {\r\n type: eventType,\r\n target: this\r\n });\r\n }\r\n }\r\n }\r\n };\r\n /**\r\n * Copies all parameters from another [[Sprite]].\r\n *\r\n * @param source Source object\r\n */\r\n BaseObjectEvents.prototype.copyFrom = function (source) {\r\n _super.prototype.copyFrom.call(this, source);\r\n if (source._eventDispatcher) {\r\n this.events.copyFrom(source._eventDispatcher);\r\n }\r\n };\r\n return BaseObjectEvents;\r\n}(BaseObject));\r\nexport { BaseObjectEvents };\r\n","import { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Container } from \"./Container\";\r\nimport { List, ListDisposer } from \"./utils/List\";\r\nimport { OrderedListTemplate } from \"./utils/SortedList\";\r\nimport { Dictionary } from \"./utils/Dictionary\";\r\nimport { Disposer, MultiDisposer } from \"./utils/Disposer\";\r\nimport { DataSource } from \"./data/DataSource\";\r\nimport { Responsive } from \"./utils/Responsive\";\r\nimport { system } from \"./System\";\r\nimport { DataItem } from \"./DataItem\";\r\nimport { registry } from \"./Registry\";\r\nimport * as $math from \"./utils/Math\";\r\nimport * as $array from \"./utils/Array\";\r\nimport * as $ease from \"./utils/Ease\";\r\nimport * as $utils from \"./utils/Utils\";\r\nimport * as $iter from \"./utils/Iterator\";\r\nimport * as $object from \"./utils/Object\";\r\nimport * as $type from \"./utils/Type\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * A Component represents an independent functional element or control, that\r\n * can have it's own behavior, children, data, etc.\r\n *\r\n * A few examples of a Component: [[Legend]], [[Series]], [[Scrollbar]].\r\n *\r\n * @see {@link IComponentEvents} for a list of available events\r\n * @see {@link IComponentAdapters} for a list of available Adapters\r\n * @important\r\n */\r\nvar Component = /** @class */ (function (_super) {\r\n __extends(Component, _super);\r\n /**\r\n * Constructor\r\n */\r\n function Component() {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n /**\r\n * Holds data field names.\r\n *\r\n * Data fields define connection beween [[DataItem]] and actual properties\r\n * in raw data.\r\n */\r\n _this.dataFields = {};\r\n /**\r\n * A list of [[DataSource]] definitions of external data source.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this._dataSources = {};\r\n /**\r\n * This is used when only new data is invalidated (if added using `addData`\r\n * method).\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this._parseDataFrom = 0;\r\n /**\r\n * Holds the disposers for the dataItems and dataUsers\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this._dataDisposers = [];\r\n /**\r\n * Currently selected \"data set\".\r\n *\r\n * If it's set to `\"\"`, main data set (unaggregated data) is used.\r\n */\r\n _this._currentDataSetId = \"\";\r\n /**\r\n * [_start description]\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this._start = 0;\r\n /**\r\n * [_end description]\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this._end = 1;\r\n /**\r\n * If set to `true`, changing data range in element will not trigger\r\n * `daterangechanged` event.\r\n */\r\n _this.skipRangeEvent = false;\r\n /**\r\n * Whenever selected scope changes (chart is zoomed or panned), for example\r\n * by interaction from a Scrollbar, or API, a chart needs to reposition\r\n * its contents.\r\n *\r\n * `rangeChangeDuration` influences how this is performed.\r\n *\r\n * If set to zero (0), the change will happen instantenously.\r\n *\r\n * If set to non-zero value, the chart will gradually animate into new\r\n * position for the set amount of milliseconds.\r\n *\r\n * @default 0\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/animations/} for more info about animations\r\n */\r\n _this.rangeChangeDuration = 0;\r\n /**\r\n * An easing function to use for range change animation.\r\n *\r\n * @see {@link Ease}\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/animations/} for more info about animations\r\n */\r\n _this.rangeChangeEasing = $ease.cubicOut;\r\n /**\r\n * A duration (ms) of each data parsing step. A Component parses its data in\r\n * chunks in order to avoid completely freezing the machine when large data\r\n * sets are used. This setting will control how many milliseconds should pass\r\n * when parsing data until parser stops for a brief moment to let other\r\n * processes catch up.\r\n */\r\n _this.parsingStepDuration = 50;\r\n /**\r\n * [dataInvalid description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\n _this.dataInvalid = false;\r\n /**\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this.rawDataInvalid = false;\r\n /**\r\n * [dataRangeInvalid description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\n _this.dataRangeInvalid = false;\r\n /**\r\n * [dataItemsInvalid description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\n _this.dataItemsInvalid = false;\r\n /**\r\n * If set to a non-zero number the element will \"animate\" data values of its\r\n * children.\r\n *\r\n * This will happen on first load and whenever data values change.\r\n *\r\n * Enabling interpolation will mean that elements will transit smoothly into\r\n * new values rather than updating instantly.\r\n *\r\n * @default 0\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/animations/} for more info about animations\r\n */\r\n _this.interpolationDuration = 0;\r\n /**\r\n * An easing function to use for interpolating values when transiting from\r\n * one source value to another.\r\n *\r\n * @default cubicOut\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/animations/} for more info about animations\r\n * @see {@link Ease}\r\n */\r\n _this.interpolationEasing = $ease.cubicOut;\r\n /**\r\n * Indicates whether transition between data item's values should start and\r\n * play out all at once, or with a small delay (as defined by\r\n * `sequencedInterpolationDelay`) for each subsequent data item.\r\n *\r\n * @default true\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/animations/} for more info about animations\r\n */\r\n _this.sequencedInterpolation = true;\r\n /**\r\n * A delay (ms) to wait between animating each subsequent data item's\r\n * interpolation animation.\r\n *\r\n * Relative only if `sequencedInterpolation = true`.\r\n *\r\n * @default 0\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/animations/} for more info about animations\r\n */\r\n _this.sequencedInterpolationDelay = 0;\r\n /**\r\n * A progress (0-1) for the data validation process.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this.dataValidationProgress = 0;\r\n _this._addAllDataItems = true;\r\n _this._usesData = true;\r\n _this.className = \"Component\";\r\n _this.minZoomCount = 1;\r\n _this.maxZoomCount = 0;\r\n _this._dataItems = new OrderedListTemplate(_this.createDataItem());\r\n _this._dataItems.events.on(\"inserted\", _this.handleDataItemAdded, _this, false);\r\n _this._dataItems.events.on(\"removed\", _this.handleDataItemRemoved, _this, false);\r\n _this._disposers.push(new ListDisposer(_this._dataItems));\r\n _this._disposers.push(_this._dataItems.template);\r\n _this.invalidateData();\r\n // TODO what about remove ?\r\n _this.dataUsers.events.on(\"inserted\", _this.handleDataUserAdded, _this, false);\r\n // Set up disposers\r\n _this._disposers.push(new MultiDisposer(_this._dataDisposers));\r\n _this._start = 0;\r\n _this._end = 1;\r\n _this.maxZoomDeclination = 1;\r\n // Apply theme\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Returns a new/empty DataItem of the type appropriate for this object.\r\n *\r\n * @see {@link DataItem}\r\n * @return Data Item\r\n */\r\n Component.prototype.createDataItem = function () {\r\n return new DataItem();\r\n };\r\n /**\r\n * [handleDataUserAdded description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param event Event object\r\n */\r\n Component.prototype.handleDataUserAdded = function (event) {\r\n var dataUser = event.newValue;\r\n dataUser.dataProvider = this;\r\n };\r\n /**\r\n * [handleDataItemValueChange description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\n Component.prototype.handleDataItemValueChange = function (dataItem, name) {\r\n if (!this.dataItemsInvalid) {\r\n this.invalidateDataItems();\r\n }\r\n };\r\n /**\r\n * [handleDataItemWorkingValueChange description]\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Component.prototype.handleDataItemWorkingValueChange = function (dataItem, name) {\r\n };\r\n /**\r\n * [handleDataItemWorkingLocationChange description]\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Component.prototype.handleDataItemWorkingLocationChange = function (dataItem, name) {\r\n };\r\n /**\r\n * [handleDataItemCalculatedValueChange description]\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Component.prototype.handleDataItemCalculatedValueChange = function (dataItem, name) {\r\n };\r\n /**\r\n * [handleDataItemPropertyChange description]\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Component.prototype.handleDataItemPropertyChange = function (dataItem, name) {\r\n };\r\n /**\r\n * Populates a [[DataItem]] width data from data source.\r\n *\r\n * Loops through all the fields and if such a field is found in raw data\r\n * object, a corresponding value on passed in `dataItem` is set.\r\n *\r\n * @ignore Exclude from docs\r\n * @param item\r\n */\r\n Component.prototype.processDataItem = function (dataItem, dataContext) {\r\n var _this = this;\r\n if (dataItem) {\r\n if (!dataContext) {\r\n dataContext = {};\r\n }\r\n // store reference to original data item\r\n dataItem.dataContext = dataContext;\r\n var hasSomeValues_1 = false;\r\n $object.each(this.dataFields, function (key, fieldValue) {\r\n var fieldName = key;\r\n var value = dataContext[fieldValue];\r\n // Apply adapters to a retrieved value\r\n if (_this._adapterO) {\r\n if (_this._adapterO.isEnabled(\"dataContextValue\")) {\r\n value = _this._adapterO.apply(\"dataContextValue\", {\r\n field: fieldName,\r\n value: value,\r\n dataItem: dataItem\r\n }).value;\r\n }\r\n }\r\n if ($type.hasValue(value)) {\r\n hasSomeValues_1 = true;\r\n if (dataItem.hasChildren[fieldName]) {\r\n var template = _this.createDataItem();\r\n template.copyFrom(_this.mainDataSet.template);\r\n var children = new OrderedListTemplate(template);\r\n children.events.on(\"inserted\", _this.handleDataItemAdded, _this, false);\r\n children.events.on(\"removed\", _this.handleDataItemRemoved, _this, false);\r\n _this._dataDisposers.push(new ListDisposer(children));\r\n var count = value.length;\r\n for (var i = 0; i < count; i++) {\r\n var rawDataItem = value[i];\r\n var childDataItem = children.create();\r\n childDataItem.parent = dataItem;\r\n _this.processDataItem(childDataItem, rawDataItem);\r\n }\r\n var anyDataItem = dataItem;\r\n anyDataItem[fieldName] = children;\r\n }\r\n else {\r\n // data is converted to numbers/dates in each dataItem\r\n dataItem[fieldName] = value;\r\n }\r\n }\r\n });\r\n $object.each(this.propertyFields, function (key, fieldValue) {\r\n var f = key;\r\n var value = dataContext[fieldValue];\r\n if ($type.hasValue(value)) {\r\n hasSomeValues_1 = true;\r\n dataItem.setProperty(f, value);\r\n }\r\n });\r\n // @todo we might need some flag which would tell whether we should create empty data items or not.\r\n if (!this._addAllDataItems && !hasSomeValues_1) {\r\n this.mainDataSet.remove(dataItem);\r\n }\r\n }\r\n };\r\n /**\r\n *\r\n * When validating raw data, instead of processing data item, we update it\r\n *\r\n * @ignore Exclude from docs\r\n * @param item\r\n */\r\n Component.prototype.updateDataItem = function (dataItem) {\r\n var _this = this;\r\n if (dataItem) {\r\n var dataContext_1 = dataItem.dataContext;\r\n $object.each(this.dataFields, function (key, fieldValue) {\r\n var fieldName = key;\r\n var value = dataContext_1[fieldValue];\r\n // Apply adapters to a retrieved value\r\n if (_this._adapterO) {\r\n value = _this._adapterO.apply(\"dataContextValue\", {\r\n field: fieldName,\r\n value: value,\r\n dataItem: dataItem\r\n }).value;\r\n }\r\n if ($type.hasValue(value)) {\r\n if (dataItem.hasChildren[fieldName]) {\r\n var anyDataItem = dataItem;\r\n var children = (anyDataItem[fieldName]);\r\n children.each(function (child) {\r\n _this.updateDataItem(child);\r\n });\r\n }\r\n else {\r\n // data is converted to numbers/dates in each dataItem\t\t\t\t\t\r\n dataItem[fieldName] = value;\r\n }\r\n }\r\n });\r\n $object.each(this.propertyFields, function (key, fieldValue) {\r\n var f = key;\r\n var value = dataContext_1[fieldValue];\r\n if ($type.hasValue(value)) {\r\n dataItem.setProperty(f, value);\r\n }\r\n });\r\n }\r\n };\r\n /**\r\n * [validateDataElements description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\n Component.prototype.validateDataElements = function () {\r\n var count = this.endIndex;\r\n for (var i = this.startIndex; i < count; i++) {\r\n var dataItem = this.dataItems.getIndex(i);\r\n // TODO is this correct\r\n if (dataItem) {\r\n this.validateDataElement(dataItem);\r\n }\r\n }\r\n };\r\n /**\r\n * Validates this element and its related elements.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Component.prototype.validate = function () {\r\n this.validateDataElements();\r\n _super.prototype.validate.call(this);\r\n };\r\n /**\r\n * [validateDataElement description]\r\n *\r\n * @ignore Exclude from docs\r\n * @param dataItem [description]\r\n */\r\n Component.prototype.validateDataElement = function (dataItem) {\r\n };\r\n /**\r\n * Adds one or several (array) of data items to the existing data.\r\n *\r\n * @param rawDataItem One or many raw data item objects\r\n */\r\n Component.prototype.addData = function (rawDataItem, removeCount, skipRaw) {\r\n var _this = this;\r\n // need to check if data is invalid, as addData might be called multiple times\r\n if (!this.dataInvalid && this.inited) {\r\n this._parseDataFrom = this.data.length; // save length of parsed data\r\n }\r\n if (!skipRaw) {\r\n if (rawDataItem instanceof Array) {\r\n // can't use concat because new array is returned\r\n $array.each(rawDataItem, function (dataItem) {\r\n _this.data.push(dataItem);\r\n });\r\n }\r\n else {\r\n this.data.push(rawDataItem); // add to raw data array\r\n }\r\n }\r\n if (this.inited) {\r\n this.removeData(removeCount, skipRaw);\r\n }\r\n else {\r\n if ($type.isNumber(removeCount)) {\r\n while (removeCount > 0) {\r\n this.data.shift();\r\n removeCount--;\r\n }\r\n }\r\n }\r\n this.invalidateData();\r\n };\r\n /**\r\n * Removes elements from the beginning of data\r\n *\r\n * @param count number of elements to remove\r\n */\r\n Component.prototype.removeData = function (count, skipRaw) {\r\n if ($type.isNumber(count) && count > 0) {\r\n while (count > 0) {\r\n var dataItem = this.mainDataSet.getIndex(0);\r\n if (dataItem) {\r\n this.mainDataSet.remove(dataItem);\r\n }\r\n this.dataUsers.each(function (dataUser) {\r\n if (!dataUser.data || dataUser.data.length == 0) {\r\n var dataItem_1 = dataUser.mainDataSet.getIndex(0);\r\n if (dataItem_1) {\r\n dataUser.mainDataSet.remove(dataItem_1);\r\n }\r\n }\r\n });\r\n if (!skipRaw) {\r\n this.data.shift();\r\n }\r\n if (this._parseDataFrom > 0) {\r\n this._parseDataFrom--;\r\n }\r\n count--;\r\n }\r\n // changed from invalidateData since 4.7.19 to solve #51551\r\n this.invalidateDataItems();\r\n }\r\n };\r\n /**\r\n * Triggers a data (re)parsing.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Component.prototype.invalidateData = function () {\r\n if (this.disabled || this.isTemplate) {\r\n return;\r\n }\r\n //if(!this.dataInvalid){\r\n registry.addToInvalidComponents(this);\r\n system.requestFrame();\r\n this.dataInvalid = true;\r\n $iter.each(this.dataUsers.iterator(), function (x) {\r\n x.invalidateDataItems();\r\n });\r\n //}\r\n };\r\n /**\r\n * [invalidateDataUsers description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\n Component.prototype.invalidateDataUsers = function () {\r\n $iter.each(this.dataUsers.iterator(), function (x) {\r\n x.invalidate();\r\n });\r\n };\r\n /**\r\n * Invalidates data values. When data array is not changed, but values within\r\n * it changes, we invalidate data so that component would process changes.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Component.prototype.invalidateDataItems = function () {\r\n if (this.disabled || this.isTemplate) {\r\n return;\r\n }\r\n //if(!this.dataItemsInvalid){\r\n $array.move(registry.invalidDataItems, this);\r\n system.requestFrame();\r\n this.dataItemsInvalid = true;\r\n $iter.each(this.dataUsers.iterator(), function (x) {\r\n x.invalidateDataItems();\r\n });\r\n //}\r\n };\r\n /**\r\n * Invalidates data range. This is done when data which must be shown\r\n * changes (chart is zoomed for example).\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Component.prototype.invalidateDataRange = function () {\r\n if (this.disabled || this.isTemplate) {\r\n return;\r\n }\r\n //if(!this.dataRangeInvalid){\r\n this.dataRangeInvalid = true;\r\n $array.move(registry.invalidDataRange, this);\r\n system.requestFrame();\r\n //}\r\n };\r\n /**\r\n * Processes data range.\r\n *\r\n * @todo Description\r\n * @ignore Exclude from docs\r\n */\r\n Component.prototype.validateDataRange = function () {\r\n $array.remove(registry.invalidDataRange, this);\r\n this.dataRangeInvalid = false;\r\n if (this.startIndex != this._prevStartIndex || this.endIndex != this._prevEndIndex) {\r\n this.rangeChangeUpdate();\r\n this.appendDataItems();\r\n this.invalidate();\r\n this.dispatchImmediately(\"datarangechanged\");\r\n }\r\n };\r\n /**\r\n * [sliceData description]\r\n *\r\n * @todo Description\r\n * @ignore Exclude from docs\r\n */\r\n Component.prototype.sliceData = function () {\r\n this._workingStartIndex = this.startIndex;\r\n this._workingEndIndex = this.endIndex;\r\n };\r\n /**\r\n * [rangeChangeUpdate description]\r\n *\r\n * @todo Description\r\n * @ignore Exclude from docs\r\n */\r\n Component.prototype.rangeChangeUpdate = function () {\r\n this.sliceData();\r\n this._prevStartIndex = this.startIndex;\r\n this._prevEndIndex = this.endIndex;\r\n };\r\n /**\r\n * [appendDataItems description]\r\n *\r\n * @todo Description\r\n * @ignore Exclude from docs\r\n */\r\n Component.prototype.appendDataItems = function () {\r\n // TODO use an iterator instead\r\n var count = this.endIndex;\r\n for (var i = this.startIndex; i < count; i++) {\r\n // data item\r\n var dataItem = this.dataItems.getIndex(i);\r\n if (dataItem) {\r\n dataItem.__disabled = false;\r\n }\r\n }\r\n for (var i = 0; i < this.startIndex; i++) {\r\n var dataItem = this.dataItems.getIndex(i);\r\n if (dataItem) {\r\n dataItem.__disabled = true;\r\n }\r\n }\r\n for (var i = this.endIndex; i < this.dataItems.length; i++) {\r\n var dataItem = this.dataItems.getIndex(i);\r\n if (dataItem) {\r\n dataItem.__disabled = true;\r\n }\r\n }\r\n };\r\n /**\r\n * If you want to have a smooth transition from one data values to another, you change your raw data and then you must call this method.\r\n * then instead of redrawing everything, the chart will check raw data and smoothly transit from previous to new data\r\n */\r\n Component.prototype.invalidateRawData = function () {\r\n if (this.disabled || this.isTemplate) {\r\n return;\r\n }\r\n //if(!this.rawDataInvalid){\r\n $array.move(registry.invalidRawDatas, this);\r\n system.requestFrame();\r\n this.rawDataInvalid = true;\r\n $iter.each(this.dataUsers.iterator(), function (x) {\r\n x.invalidateRawData();\r\n });\r\n //}\r\n };\r\n /**\r\n * @ignore\r\n */\r\n Component.prototype.validateRawData = function () {\r\n var _this = this;\r\n $array.remove(registry.invalidRawDatas, this);\r\n $iter.each(this.mainDataSet.iterator(), function (dataItem) {\r\n if (dataItem) {\r\n _this.updateDataItem(dataItem);\r\n }\r\n });\r\n };\r\n /**\r\n * Destroys this object and all related data.\r\n */\r\n Component.prototype.dispose = function () {\r\n var _this = this;\r\n this.mainDataSet.template.clones.clear();\r\n $object.each(this._dataSources, function (key, source) {\r\n _this.removeDispose(source);\r\n });\r\n _super.prototype.dispose.call(this);\r\n };\r\n /**\r\n * @ignore\r\n */\r\n Component.prototype.disposeData = function () {\r\n this.mainDataSet.template.clones.clear();\r\n $array.each(this._dataDisposers, function (x) {\r\n x.dispose();\r\n });\r\n // and for all components\r\n $iter.each(this.dataUsers.iterator(), function (dataUser) {\r\n dataUser.disposeData();\r\n });\r\n this._dataDisposers.length = 0;\r\n this._startIndex = undefined;\r\n this._endIndex = undefined;\r\n // dispose old\r\n this.mainDataSet.clear();\r\n this.mainDataSet.template.clones.clear();\r\n if (this._dataSets) {\r\n this._dataSets.clear();\r\n }\r\n };\r\n Component.prototype.getDataItem = function (dataContext) {\r\n return this.mainDataSet.create();\r\n };\r\n /**\r\n * Validates (processes) data.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Component.prototype.validateData = function () {\r\n this.dispatchImmediately(\"beforedatavalidated\");\r\n this.dataInvalid = false;\r\n registry.removeFromInvalidComponents(this);\r\n if (this.__disabled) {\r\n return;\r\n }\r\n this.dataValidationProgress = 0;\r\n // need this to slice new data\r\n this._prevStartIndex = undefined;\r\n this._prevEndIndex = undefined;\r\n // todo: this needs some overthinking, maybe some extra settings like zoomOotonDataupdate like in v3 or so. some charts like pie chart probably should act like this always\r\n this._startIndex = undefined;\r\n this._endIndex = undefined;\r\n if (this.dataFields.data && this.dataItem) {\r\n var dataContext = this.dataItem.dataContext;\r\n this._data = dataContext[this.dataFields.data];\r\n }\r\n // data items array is reset only if all data is validated, if _parseDataFrom is not 0, we append new data only\r\n // check heatmap demo if uncommented\r\n // fixed both issues by adding && this.data.length > 0\r\n // check adding series example if changed\r\n if (this._parseDataFrom === 0 && this.data.length > 0) {\r\n this.disposeData();\r\n }\r\n if (this.data.length > 0) {\r\n var preloader = this.preloader;\r\n // and for all components\r\n $iter.each(this.dataUsers.iterator(), function (dataUser) {\r\n // todo: this needs some overthinking, maybe some extra settings like zoomOUtonDataupdate like in v3 or so. some charts like pie chart probably should act like this always\r\n dataUser._startIndex = undefined;\r\n dataUser._endIndex = undefined;\r\n });\r\n var counter = 0;\r\n var startTime = Date.now();\r\n // parse data\r\n var i = this._parseDataFrom;\r\n var n = this.data.length;\r\n var _loop_1 = function () {\r\n var rawDataItem = this_1.data[i];\r\n if (this_1._usesData) {\r\n var dataItem = this_1.getDataItem(rawDataItem);\r\n this_1.processDataItem(dataItem, rawDataItem);\r\n }\r\n this_1.dataUsers.each(function (dataUser) {\r\n if (dataUser.data.length == 0) { // checking if data is not set directly\r\n var dataUserDataItem = dataUser.getDataItem(rawDataItem);\r\n dataUser.processDataItem(dataUserDataItem, rawDataItem);\r\n }\r\n });\r\n counter++;\r\n // show preloader if this takes too many time\r\n if (counter == 100) { // no need to check it on each data item\r\n counter = 0;\r\n var elapsed = Date.now() - startTime;\r\n if (elapsed > this_1.parsingStepDuration) {\r\n if (i < this_1.data.length - 10) {\r\n this_1._parseDataFrom = i + 1;\r\n // update preloader\r\n if (preloader) {\r\n if (i / this_1.data.length > 0.5 && !preloader.visible) {\r\n // do not start showing\r\n }\r\n else {\r\n preloader.progress = i / this_1.data.length;\r\n }\r\n }\r\n this_1.dataValidationProgress = i / this_1.data.length;\r\n i = this_1.data.length; // stops cycle\r\n this_1.invalidateData();\r\n return { value: void 0 };\r\n }\r\n }\r\n }\r\n };\r\n var this_1 = this;\r\n for (i; i < n; i++) {\r\n var state_1 = _loop_1();\r\n if (typeof state_1 === \"object\")\r\n return state_1.value;\r\n }\r\n if (preloader) {\r\n preloader.progress = 1;\r\n }\r\n this.dataUsers.each(function (dataUser) {\r\n if (dataUser.hidden) {\r\n dataUser.hide(0);\r\n }\r\n });\r\n }\r\n this.dataValidationProgress = 1;\r\n this._parseDataFrom = 0; // reset this index, it is set to dataItems.length if addData() method was used.\r\n this.invalidateDataItems();\r\n if (!this._internalDefaultsApplied) {\r\n this.applyInternalDefaults();\r\n }\r\n this.dispatch(\"datavalidated\"); // can't zoom chart if dispatched immediately\r\n };\r\n /**\r\n * Validates (processes) data items.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Component.prototype.validateDataItems = function () {\r\n $array.remove(registry.invalidDataItems, this);\r\n this.dataItemsInvalid = false;\r\n this.invalidateDataRange();\r\n this.invalidate();\r\n this.dispatch(\"dataitemsvalidated\");\r\n };\r\n Object.defineProperty(Component.prototype, \"data\", {\r\n /**\r\n * Returns element's source (raw) data.\r\n *\r\n * @return Data\r\n */\r\n get: function () {\r\n if (!this._data) {\r\n this._data = [];\r\n }\r\n if (!this._adapterO) {\r\n return this._data;\r\n }\r\n else {\r\n return this._adapterO.apply(\"data\", this._data);\r\n }\r\n },\r\n /**\r\n * Sets source (raw) data for the element. The \"data\" is always an `Array`\r\n * of objects.\r\n *\r\n * IMPORTANT: The order of data items in `data` array is important as it\r\n * might affect chart look and behavior. [More details](https://www.amcharts.com/docs/v4/concepts/data/#Order_of_data_items).\r\n *\r\n * @param value Data\r\n */\r\n set: function (value) {\r\n this.setData(value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Component.prototype.setData = function (value) {\r\n // array might be the same, but there might be items added\r\n // todo: check if array changed, toString maybe?\r\n //if (this._data != value) {\r\n this._parseDataFrom = 0;\r\n this.disposeData();\r\n this._data = value;\r\n if (value && value.length > 0) {\r\n this.invalidateData();\r\n }\r\n else {\r\n this.dispatchImmediately(\"beforedatavalidated\");\r\n this.dispatch(\"datavalidated\");\r\n }\r\n //}\r\n };\r\n /**\r\n * Returns (creates if necessary) a [[DataSource]] bound to any specific\r\n * property.\r\n *\r\n * For example if I want to bind `data` to an external JSON file, I'd create\r\n * a DataSource for it.\r\n *\r\n * @param property Property to bind external data to\r\n * @return A DataSource for property\r\n */\r\n Component.prototype.getDataSource = function (property) {\r\n var _this = this;\r\n if (!$type.hasValue(this._dataSources[property])) {\r\n this._dataSources[property] = new DataSource();\r\n this._dataSources[property].component = this;\r\n this.setDataSourceEvents(this._dataSources[property], property);\r\n this._dataSources[property].adapter.add(\"dateFields\", function (val) {\r\n return _this.dataSourceDateFields(val);\r\n });\r\n this._dataSources[property].adapter.add(\"numberFields\", function (val) {\r\n return _this.dataSourceNumberFields(val);\r\n });\r\n this.events.on(\"inited\", function () {\r\n _this.loadData(property);\r\n }, this, false);\r\n }\r\n return this._dataSources[property];\r\n };\r\n Object.defineProperty(Component.prototype, \"dataSource\", {\r\n /**\r\n * @return Data source\r\n */\r\n get: function () {\r\n if (!this._dataSources[\"data\"]) {\r\n this.getDataSource(\"data\");\r\n }\r\n return this._dataSources[\"data\"];\r\n },\r\n /**\r\n *A [[DataSource]] to be used for loading Component's data.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/loading-external-data/} for more on loading external data\r\n * @param value Data source\r\n */\r\n set: function (value) {\r\n var _this = this;\r\n if (this._dataSources[\"data\"]) {\r\n this.removeDispose(this._dataSources[\"data\"]);\r\n }\r\n this._dataSources[\"data\"] = value;\r\n this._dataSources[\"data\"].component = this;\r\n this.events.on(\"inited\", function () {\r\n _this.loadData(\"data\");\r\n }, this, false);\r\n this.setDataSourceEvents(value, \"data\");\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Initiates loading of the external data via [[DataSource]].\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Component.prototype.loadData = function (property) {\r\n this._dataSources[property].load();\r\n };\r\n /**\r\n * This function is called by the [[DataSource]]'s `dateFields` adapater\r\n * so that particular chart types can popuplate this setting with their\r\n * own type-specific data fields so they are parsed properly.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Array of date fields\r\n * @return Array of date fields populated with chart's date fields\r\n */\r\n Component.prototype.dataSourceDateFields = function (value) {\r\n return value;\r\n };\r\n /**\r\n * This function is called by the [[DataSource]]'s `numberFields` adapater\r\n * so that particular chart types can popuplate this setting with their\r\n * own type-specific data fields so they are parsed properly.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Array of number fields\r\n * @return Array of number fields populated with chart's number fields\r\n */\r\n Component.prototype.dataSourceNumberFields = function (value) {\r\n return value;\r\n };\r\n /**\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param list [description]\r\n * @param dataFields [description]\r\n * @param targetList [description]\r\n * @return [description]\r\n */\r\n Component.prototype.populateDataSourceFields = function (list, dataFields, targetList) {\r\n $array.each(targetList, function (value) {\r\n if (dataFields[value] && $array.indexOf(list, dataFields[value]) === -1) {\r\n list.push(dataFields[value]);\r\n }\r\n });\r\n return list;\r\n };\r\n /**\r\n * Sets events on a [[DataSource]].\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Component.prototype.setDataSourceEvents = function (ds, property) {\r\n var _this = this;\r\n ds.events.on(\"started\", function (ev) {\r\n var preloader = _this.preloader;\r\n if (preloader) {\r\n preloader.progress = 0;\r\n //preloader.label.text = this.language.translate(\"Loading\");\r\n }\r\n }, undefined, false);\r\n ds.events.on(\"loadstarted\", function (ev) {\r\n var preloader = _this.preloader;\r\n if (preloader) {\r\n preloader.progress = 0.25;\r\n }\r\n }, undefined, false);\r\n ds.events.on(\"loadended\", function (ev) {\r\n var preloader = _this.preloader;\r\n if (preloader) {\r\n preloader.progress = 0.5;\r\n }\r\n }, undefined, false);\r\n ds.events.on(\"parseended\", function (ev) {\r\n var preloader = _this.preloader;\r\n if (preloader) {\r\n preloader.progress = 0.75;\r\n }\r\n }, undefined, false);\r\n ds.events.on(\"ended\", function (ev) {\r\n var preloader = _this.preloader;\r\n if (preloader) {\r\n preloader.progress = 1;\r\n }\r\n }, undefined, false);\r\n ds.events.on(\"error\", function (ev) {\r\n var preloader = _this.preloader;\r\n if (preloader) {\r\n preloader.progress = 1;\r\n }\r\n _this.openModal(ev.message);\r\n }, undefined, false);\r\n if (property) {\r\n ds.events.on(\"done\", function (ev) {\r\n var preloader = _this.preloader;\r\n if (preloader) {\r\n preloader.progress = 1;\r\n }\r\n if (property == \"data\" && !$type.isArray(ev.data)) {\r\n ev.data = [ev.data];\r\n }\r\n if (ds.incremental && property == \"data\" && _this.data.length) {\r\n _this.addData(ev.data, ds.keepCount ? ev.data.length : 0);\r\n }\r\n else if (ds.updateCurrentData && property == \"data\" && _this.data.length) {\r\n // cycle through existing data items\r\n $array.each(_this.data, function (item, index) {\r\n if ($type.hasValue(ev.data[index])) {\r\n $object.each(item, function (key, val) {\r\n if ($type.hasValue(ev.data[index][key])) {\r\n item[key] = ev.data[index][key];\r\n }\r\n });\r\n }\r\n });\r\n _this.invalidateRawData();\r\n }\r\n else {\r\n _this[property] = ev.data;\r\n }\r\n });\r\n }\r\n };\r\n Object.defineProperty(Component.prototype, \"responsive\", {\r\n /**\r\n * @return Responsive rules handler\r\n */\r\n get: function () {\r\n if (!this._responsive) {\r\n this._responsive = new Responsive();\r\n this._responsive.component = this;\r\n }\r\n return this._responsive;\r\n },\r\n /**\r\n * A [[Responsive]] instance to be used when applying conditional\r\n * property values.\r\n *\r\n * NOTE: Responsive features are currently in development and may not work\r\n * as expected, if at all.\r\n *\r\n * @param value Responsive rules handler\r\n */\r\n set: function (value) {\r\n this._responsive = value;\r\n this._responsive.component = this;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Sets current zoom.\r\n *\r\n * The range uses relative values from 0 to 1, with 0 marking beginning and 1\r\n * marking end of the available data range.\r\n *\r\n * This method will not have any effect when called on a chart object.\r\n * Since the chart can have a number of axes and series, each with its own\r\n * data, the meaning of \"range\" is very ambiguous.\r\n *\r\n * To zoom the chart use `zoom*` methods on its respective axes.\r\n *\r\n * @param range Range\r\n * @param skipRangeEvent Should rangechanged event not be triggered?\r\n * @param instantly Do not animate?\r\n * @return Actual modidied range (taking `maxZoomFactor` into account)\r\n */\r\n Component.prototype.zoom = function (range, skipRangeEvent, instantly, declination) {\r\n var _this = this;\r\n if (skipRangeEvent === void 0) { skipRangeEvent = false; }\r\n if (instantly === void 0) { instantly = false; }\r\n var start = range.start;\r\n var end = range.end;\r\n var priority = range.priority;\r\n if (range.start == range.end) {\r\n range.start = range.start - 0.5 / this.maxZoomFactor;\r\n range.end = range.end + 0.5 / this.maxZoomFactor;\r\n }\r\n if (priority == \"end\" && end == 1 && start != 0) {\r\n if (start < this.start) {\r\n priority = \"start\";\r\n }\r\n }\r\n if (priority == \"start\" && start == 0) {\r\n if (end > this.end) {\r\n priority = \"end\";\r\n }\r\n }\r\n if (!$type.isNumber(declination)) {\r\n declination = this.maxZoomDeclination;\r\n }\r\n if (!$type.isNumber(start) || !$type.isNumber(end)) {\r\n return { start: this.start, end: this.end };\r\n }\r\n if (this._finalStart != start || this._finalEnd != end) {\r\n var maxZoomFactor = this.maxZoomFactor / this.minZoomCount;\r\n var minZoomFactor = this.maxZoomFactor / this.maxZoomCount;\r\n // most likely we are dragging left scrollbar grip here, so we tend to modify end\r\n if (priority == \"start\") {\r\n if (this.maxZoomCount > 0) {\r\n // add to the end\r\n if (1 / (end - start) < minZoomFactor) {\r\n end = start + 1 / minZoomFactor;\r\n }\r\n }\r\n // add to the end\r\n if (1 / (end - start) > maxZoomFactor) {\r\n end = start + 1 / maxZoomFactor;\r\n }\r\n //unless end is > 0\r\n if (end > 1 && end - start < 1 / maxZoomFactor) {\r\n //end = 1;\r\n start = end - 1 / maxZoomFactor;\r\n }\r\n }\r\n // most likely we are dragging right, so we modify left\r\n else {\r\n if (this.maxZoomCount > 0) {\r\n // add to the end\r\n if (1 / (end - start) < minZoomFactor) {\r\n start = end - 1 / minZoomFactor;\r\n }\r\n }\r\n // remove from start\r\n if (1 / (end - start) > maxZoomFactor) {\r\n start = end - 1 / maxZoomFactor;\r\n }\r\n if (start < 0 && end - start < 1 / maxZoomFactor) {\r\n //start = 0;\r\n end = start + 1 / maxZoomFactor;\r\n }\r\n }\r\n if (start < -declination) {\r\n start = -declination;\r\n }\r\n if (1 / (end - start) > maxZoomFactor) {\r\n end = start + 1 / maxZoomFactor;\r\n }\r\n if (end > 1 + declination) {\r\n end = 1 + declination;\r\n }\r\n if (1 / (end - start) > maxZoomFactor) {\r\n start = end - 1 / maxZoomFactor;\r\n }\r\n this._finalEnd = end;\r\n this._finalStart = start;\r\n this.skipRangeEvent = skipRangeEvent;\r\n this.dispatchImmediately(\"rangechangestarted\");\r\n if (this.rangeChangeDuration > 0 && !instantly) {\r\n // todo: maybe move this to Animation\r\n var rangeChangeAnimation = this.rangeChangeAnimation;\r\n if (rangeChangeAnimation && rangeChangeAnimation.progress < 1) {\r\n var options = rangeChangeAnimation.animationOptions;\r\n if (options.length > 1) {\r\n if (options[0].to == start && options[1].to == end) {\r\n return { start: start, end: end };\r\n }\r\n else {\r\n if (!rangeChangeAnimation.isDisposed()) {\r\n rangeChangeAnimation.stop();\r\n }\r\n }\r\n }\r\n }\r\n if (this.rangeChangeAnimation) {\r\n this.rangeChangeAnimation.kill();\r\n }\r\n rangeChangeAnimation = this.animate([{ property: \"start\", to: start }, { property: \"end\", to: end }], this.rangeChangeDuration, this.rangeChangeEasing);\r\n this.rangeChangeAnimation = rangeChangeAnimation;\r\n if (rangeChangeAnimation && !rangeChangeAnimation.isFinished()) {\r\n rangeChangeAnimation.events.on(\"animationended\", function () {\r\n _this.dispatchImmediately(\"rangechangeended\");\r\n });\r\n }\r\n else {\r\n this.dispatchImmediately(\"rangechangeended\");\r\n }\r\n }\r\n else {\r\n this.start = start;\r\n this.end = end;\r\n this.dispatch(\"rangechangeended\");\r\n }\r\n }\r\n return { start: start, end: end };\r\n };\r\n /**\r\n * Zooms to specific data items using their index in data.\r\n *\r\n * This method will not have any effect when called on a chart object.\r\n * Since the chart can have a number of axes and series, each with its own\r\n * data, the meaning of \"index\" is very ambiguous.\r\n *\r\n * To zoom the chart use `zoom*` methods on its respective axes.\r\n *\r\n * @param startIndex Index of the starting data item\r\n * @param endIndex Index of the ending data item\r\n * @param skipRangeEvent Should rangechanged event not be triggered?\r\n * @param instantly Do not animate?\r\n */\r\n Component.prototype.zoomToIndexes = function (startIndex, endIndex, skipRangeEvent, instantly) {\r\n if (!$type.isNumber(startIndex) || !$type.isNumber(endIndex)) {\r\n return;\r\n }\r\n var start = startIndex / this.dataItems.length;\r\n var end = endIndex / this.dataItems.length;\r\n this.zoom({ start: start, end: end }, skipRangeEvent, instantly);\r\n };\r\n Object.defineProperty(Component.prototype, \"zoomFactor\", {\r\n /**\r\n * A current zoom factor (0-1). 1 meaning fully zoomed out. (showing all of\r\n * the available data)\r\n *\r\n * @return Zoom factor\r\n */\r\n get: function () {\r\n return $math.fitToRange(1 / (this.end - this.start), 1, this.maxZoomFactor);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Component.prototype, \"maxZoomFactor\", {\r\n /**\r\n * @return Maximum zoomFactor\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"maxZoomFactor\");\r\n },\r\n /**\r\n * Max available `zoomFactor`.\r\n *\r\n * The element will not allow zoom to occur beyond this factor.\r\n *\r\n * [[DateAxis]] and [[CategoryAxis]] calculate this atutomatically so that\r\n * category axis could be zoomed to one category and date axis allows to be\r\n * zoomed up to one base interval.\r\n *\r\n * In case you want to restrict category or date axis to be zoomed to more\r\n * than one category or more than one base interval, use `minZoomCount`\r\n * property (set it to `> 1`).\r\n *\r\n * Default value of [[ValueAxis]]'s `maxZoomFactor` is `1000`.\r\n *\r\n * Feel free to modify it to allow bigger zoom or to restrict zooming.\r\n *\r\n * @param value Maximum zoomFactor\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"maxZoomFactor\", value)) {\r\n if (value == 1) {\r\n this.maxZoomDeclination = 0;\r\n }\r\n this.invalidateDataRange();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Component.prototype, \"maxZoomDeclination\", {\r\n /**\r\n * @ignore\r\n * @return Maximum zoom declination\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"maxZoomDeclination\");\r\n },\r\n /**\r\n * Max zoom declination.\r\n *\r\n * @ignore\r\n * @default 1\r\n * @param value Maximum zoom declination\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"maxZoomDeclination\", value)) {\r\n this.invalidateDataRange();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Component.prototype, \"startIndex\", {\r\n /**\r\n * Current starting index.\r\n *\r\n * @return Start index\r\n */\r\n get: function () {\r\n if (!$type.isNumber(this._startIndex)) {\r\n this._startIndex = 0;\r\n }\r\n return this._startIndex;\r\n },\r\n /**\r\n * Sets current starting index.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Start index\r\n */\r\n set: function (value) {\r\n this._startIndex = $math.fitToRange(Math.round(value), 0, this.dataItems.length);\r\n //this._workingStartIndex = this._startIndex; // not good, breaks adjusted working start index of line series\r\n this.start = this.indexToPosition(this._startIndex);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * @ignore\r\n * @todo:review description\r\n * returns item's relative position by the index of the item\r\n * @param index\r\n */\r\n Component.prototype.indexToPosition = function (index) {\r\n return index / this.dataItems.length;\r\n };\r\n Object.defineProperty(Component.prototype, \"endIndex\", {\r\n /**\r\n * Current ending index.\r\n *\r\n * @return End index\r\n */\r\n get: function () {\r\n var count = this.dataItems.length;\r\n if (!$type.isNumber(this._endIndex) || this._endIndex > count) {\r\n this._endIndex = count;\r\n }\r\n return this._endIndex;\r\n },\r\n /**\r\n * Sets current ending index.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value End index\r\n */\r\n set: function (value) {\r\n this._endIndex = $math.fitToRange(Math.round(value), 0, this.dataItems.length);\r\n //this._workingEndIndex = this._endIndex; // not good, breaks adjusted workingend index of line series\r\n this.end = this.indexToPosition(this._endIndex);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Component.prototype, \"start\", {\r\n /**\r\n * @return Start (0-1)\r\n */\r\n get: function () {\r\n if (!this._adapterO) {\r\n return this._start;\r\n }\r\n else {\r\n return this._adapterO.apply(\"start\", this._start);\r\n }\r\n },\r\n /**\r\n * Start of the current data range (zoom).\r\n *\r\n * These are relative values from 0 (beginning) to 1 (end).\r\n *\r\n * @param value Start (0-1)\r\n */\r\n set: function (value) {\r\n // value = $math.round(value, 10); not good\r\n //if (1 / (this.end - value) > this.maxZoomFactor) {\r\n //\tvalue = this.end - 1 / this.maxZoomFactor;\r\n //}\r\n if (this._start != value) {\r\n this._start = value;\r\n var startIndex = Math.max(0, Math.floor(this.dataItems.length * value) || 0);\r\n this._startIndex = Math.min(startIndex, this.dataItems.length);\r\n this.invalidateDataRange();\r\n this.invalidate();\r\n this.dispatchImmediately(\"startchanged\");\r\n this.dispatch(\"startendchanged\");\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Component.prototype, \"end\", {\r\n /**\r\n * @return End (0-1)\r\n */\r\n get: function () {\r\n if (!this._adapterO) {\r\n return this._end;\r\n }\r\n else {\r\n return this._adapterO.apply(\"end\", this._end);\r\n }\r\n },\r\n /**\r\n * End of the current data range (zoom).\r\n *\r\n * These are relative values from 0 (beginning) to 1 (end).\r\n *\r\n * @param value End (0-1)\r\n */\r\n set: function (value) {\r\n // value = $math.round(value, 10); // not good\r\n //if (1 / (value - this.start) > this.maxZoomFactor) {\r\n //\tvalue = 1 / this.maxZoomFactor + this.start;\r\n //}\r\n if (this._end != value) {\r\n this._end = value;\r\n this._endIndex = Math.min(this.dataItems.length, Math.ceil(this.dataItems.length * value) || 0);\r\n this.invalidateDataRange();\r\n this.invalidate();\r\n this.dispatchImmediately(\"endchanged\");\r\n this.dispatch(\"startendchanged\");\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * [removeFromInvalids description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\n Component.prototype.removeFromInvalids = function () {\r\n _super.prototype.removeFromInvalids.call(this);\r\n registry.removeFromInvalidComponents(this);\r\n $array.remove(registry.invalidDataItems, this);\r\n $array.remove(registry.invalidDataRange, this);\r\n $array.remove(registry.invalidRawDatas, this);\r\n };\r\n Object.defineProperty(Component.prototype, \"dataItems\", {\r\n /**\r\n * Returns a list of source [[DataItem]] objects currently used in the chart.\r\n *\r\n * @return List of data items\r\n */\r\n get: function () {\r\n if (this._currentDataSetId != \"\") {\r\n var dataItems = this.dataSets.getKey(this._currentDataSetId);\r\n if (dataItems) {\r\n return dataItems;\r\n }\r\n }\r\n return this._dataItems;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Component.prototype, \"dataSets\", {\r\n /**\r\n * Holds data items for data sets (usually aggregated data).\r\n *\r\n * @ignore\r\n * @since 4.7.0\r\n * @return Data sets\r\n */\r\n get: function () {\r\n if (!this._dataSets) {\r\n this._dataSets = new Dictionary();\r\n }\r\n return this._dataSets;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Makes the chart use particular data set.\r\n *\r\n * If `id` is not provided or there is no such data set, main data will be\r\n * used.\r\n *\r\n * @ignore\r\n * @since 4.7.0\r\n * @param id Data set id\r\n */\r\n Component.prototype.setDataSet = function (id) {\r\n if (this._currentDataSetId != id) {\r\n var dataSet = this.dataSets.getKey(id);\r\n if (!dataSet) {\r\n if (this._currentDataSetId != \"\") {\r\n this.dataItems.each(function (dataItem) {\r\n dataItem.__disabled = true;\r\n });\r\n this._currentDataSetId = \"\";\r\n this.invalidateDataRange();\r\n this._prevStartIndex = undefined;\r\n this.dataItems.each(function (dataItem) {\r\n dataItem.__disabled = false;\r\n });\r\n return true;\r\n }\r\n }\r\n else {\r\n this.dataItems.each(function (dataItem) {\r\n dataItem.__disabled = true;\r\n });\r\n this._currentDataSetId = id;\r\n this.invalidateDataRange();\r\n this._prevStartIndex = undefined;\r\n this.dataItems.each(function (dataItem) {\r\n dataItem.__disabled = false;\r\n });\r\n return true;\r\n }\r\n }\r\n return false;\r\n };\r\n Object.defineProperty(Component.prototype, \"currentDataSetId\", {\r\n /**\r\n * Returns id of the currently used data set, or `undefined` if main data set\r\n * is in use.\r\n *\r\n * @since 4.7.0\r\n * @return Current data set id\r\n */\r\n get: function () {\r\n return this._currentDataSetId;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Component.prototype, \"mainDataSet\", {\r\n /**\r\n * Returns reference to \"main\" data set (unaggregated data as it was supplied\r\n * in `data`).\r\n *\r\n * @since 4.7.0\r\n * @return Main data set\r\n */\r\n get: function () {\r\n return this._dataItems;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Updates the indexes for the dataItems\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Component.prototype._updateDataItemIndexes = function (startIndex) {\r\n var dataItems = this.mainDataSet.values;\r\n var length = dataItems.length;\r\n for (var i = startIndex; i < length; ++i) {\r\n dataItems[i]._index = i;\r\n }\r\n };\r\n /**\r\n * Processes newly added [[DataItem]] as well as triggers data re-validation.\r\n *\r\n * @ignore Exclude from docs\r\n * @param event [description]\r\n */\r\n Component.prototype.handleDataItemAdded = function (event) {\r\n event.newValue.component = this;\r\n this._updateDataItemIndexes(event.index);\r\n if (!this.dataItemsInvalid) {\r\n this.invalidateDataItems();\r\n }\r\n };\r\n /**\r\n * removes [[DataItem]] as well as triggers data re-validation.\r\n *\r\n * @ignore Exclude from docs\r\n * @param event [description]\r\n */\r\n Component.prototype.handleDataItemRemoved = function (event) {\r\n //\t\tevent.oldValue.component = undefined; // not good, as some items might be not removed from component lists\r\n this._updateDataItemIndexes(event.index);\r\n if (!this.dataItemsInvalid) {\r\n this.invalidateDataItems();\r\n }\r\n };\r\n /**\r\n * Binds a data element's field to a specific field in raw data.\r\n * For example, for the very basic column chart you'd want to bind a `value`\r\n * field to a field in data, such as `price`.\r\n *\r\n * Some more advanced Components, like [[CandlestickSeries]] need several\r\n * data fields bound to data, such as ones for open, high, low and close\r\n * values.\r\n *\r\n * @todo Example\r\n * @param field Field name\r\n * @param value Field name in data\r\n */\r\n Component.prototype.bindDataField = function (field, value) {\r\n this.dataFields[field] = value;\r\n this.invalidateDataRange();\r\n };\r\n /**\r\n * Invalidates processed data.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Component.prototype.invalidateProcessedData = function () {\r\n this.resetProcessedRange();\r\n this.invalidateDataRange();\r\n };\r\n /**\r\n * [resetProcessedRange description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\n Component.prototype.resetProcessedRange = function () {\r\n this._prevEndIndex = null;\r\n this._prevStartIndex = null;\r\n };\r\n Object.defineProperty(Component.prototype, \"dataUsers\", {\r\n /**\r\n * Returns all other [[Component]] objects that are using this element's\r\n * data.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description (review)\r\n * @return [description]\r\n */\r\n get: function () {\r\n var _this = this;\r\n if (!this._dataUsers) {\r\n this._dataUsers = new List();\r\n //this._disposers.push(new ListDisposer(this._dataUsers));\r\n // TODO better way of handling this? e.g. move into another module ?\r\n this._disposers.push(new Disposer(function () {\r\n // TODO clear the list ?\r\n $iter.each(_this._dataUsers.iterator(), function (x) {\r\n x.dispose();\r\n });\r\n }));\r\n }\r\n return this._dataUsers;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Returns a clone of this element.\r\n *\r\n * @return Clone\r\n */\r\n Component.prototype.clone = function () {\r\n var component = _super.prototype.clone.call(this);\r\n component.dataFields = $utils.copyProperties(this.dataFields, {});\r\n return component;\r\n };\r\n /**\r\n * Copies all parameters from another [[Component]].\r\n *\r\n * @param source Source Component\r\n */\r\n Component.prototype.copyFrom = function (source) {\r\n _super.prototype.copyFrom.call(this, source);\r\n this.data = source.data;\r\n this.sequencedInterpolation = source.sequencedInterpolation;\r\n this.sequencedInterpolationDelay = source.sequencedInterpolationDelay;\r\n this.interpolationDuration = source.interpolationDuration;\r\n this.interpolationEasing = source.interpolationEasing;\r\n };\r\n /**\r\n * Invalidates the whole element, including all its children, causing\r\n * complete re-parsing of data and redraw.\r\n *\r\n * Use sparingly!\r\n */\r\n Component.prototype.reinit = function () {\r\n this._inited = false;\r\n this.deepInvalidate();\r\n };\r\n /**\r\n * Add an adapter for data.\r\n *\r\n * @return Exporting\r\n */\r\n Component.prototype.getExporting = function () {\r\n var _export = _super.prototype.getExporting.call(this);\r\n if (!_export.adapter.has(\"data\", this._exportData, -1, this)) {\r\n _export.adapter.add(\"data\", this._exportData, -1, this);\r\n this.events.on(\"datavalidated\", function (ev) {\r\n _export.handleDataUpdated();\r\n });\r\n }\r\n return _export;\r\n };\r\n Component.prototype._exportData = function (arg) {\r\n arg.data = this.data;\r\n return arg;\r\n };\r\n Component.prototype.setDisabled = function (value) {\r\n var changed = _super.prototype.setDisabled.call(this, value);\r\n if (changed) {\r\n this.invalidateData();\r\n }\r\n return changed;\r\n };\r\n /**\r\n * @ignore\r\n */\r\n Component.prototype.setShowOnInit = function (value) {\r\n if (value != this.getPropertyValue(\"showOnInit\")) {\r\n if (value && !this.inited && !this.hidden) {\r\n this._showOnInitDisposer2 = this.events.once(\"dataitemsvalidated\", this.hideInitially, this, false);\r\n this._disposers.push(this._showOnInitDisposer2);\r\n }\r\n else {\r\n if (this._showOnInitDisposer2) {\r\n this.removeDispose(this._showOnInitDisposer2);\r\n }\r\n }\r\n }\r\n // important order here\r\n _super.prototype.setShowOnInit.call(this, value);\r\n };\r\n Component.prototype.setBaseId = function (value) {\r\n if (value != this._baseId) {\r\n if (this.dataInvalid) {\r\n this.dataInvalid = false;\r\n registry.removeFromInvalidComponents(this);\r\n this._baseId = value;\r\n this.invalidateData();\r\n }\r\n }\r\n _super.prototype.setBaseId.call(this, value);\r\n };\r\n Object.defineProperty(Component.prototype, \"minZoomCount\", {\r\n /**\r\n * @return Min zoom count\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"minZoomCount\");\r\n },\r\n /**\r\n * Use this for [[CategoryAxis]] or [[DateAxis]].\r\n *\r\n * Allows restricting zoom in beyond certain number of categories or base\r\n * intervals.\r\n *\r\n * @default 1\r\n * @param value Min zoom count\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"minZoomCount\", value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Component.prototype, \"maxZoomCount\", {\r\n /**\r\n * @return Max zoom count\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"maxZoomCount\");\r\n },\r\n /**\r\n * Use this for [[CategoryAxis]] or [[DateAxis]].\r\n *\r\n * Limits how many categories or base intervals can be shown at the same\r\n * time.\r\n *\r\n * If there are more items in the chart, the chart will auto-zoom.\r\n *\r\n * @default 0 (no limit)\r\n * @since 4.6.2\r\n * @param value Max zoom count\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"maxZoomCount\", value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Called during the System.update method\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Component.prototype._systemCheckIfValidate = function () {\r\n if (this.dataInvalid || (this.dataProvider && this.dataProvider.dataInvalid)) {\r\n return false;\r\n }\r\n else {\r\n return true;\r\n }\r\n };\r\n /**\r\n * Adds easing functions to \"function\" fields.\r\n *\r\n * @param field Field name\r\n * @return Assign as function?\r\n */\r\n Component.prototype.asFunction = function (field) {\r\n return field == \"interpolationEasing\" || field == \"rangeChangeEasing\" || _super.prototype.asIs.call(this, field);\r\n };\r\n return Component;\r\n}(Container));\r\nexport { Component };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Component\"] = Component;\r\n","/**\r\n * Container module\r\n * @todo Needs description\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Sprite } from \"./Sprite\";\r\nimport { SpriteState } from \"./SpriteState\";\r\nimport { List } from \"./utils/List\";\r\nimport { MultiDisposer } from \"./utils/Disposer\";\r\nimport { Dictionary, DictionaryDisposer } from \"./utils/Dictionary\";\r\nimport { getInteraction } from \"./interaction/Interaction\";\r\nimport { Rectangle } from \"./elements/Rectangle\";\r\nimport { Percent } from \"./utils/Percent\";\r\nimport { registry } from \"./Registry\";\r\nimport { InterfaceColorSet } from \"../core/utils/InterfaceColorSet\";\r\nimport * as $iter from \"./utils/Iterator\";\r\nimport * as $array from \"./utils/Array\";\r\nimport * as $math from \"./utils/Math\";\r\nimport * as $type from \"./utils/Type\";\r\nimport * as $dom from \"./utils/DOM\";\r\nimport { system } from \"./System\";\r\nimport { options } from \"./Options\";\r\n;\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Container can contain multiple sprites and arrange them in various layouts.\r\n *\r\n * @see {@link IContainerEvents} for a list of available events\r\n * @see {@link IContainerAdapters} for a list of available Adapters\r\n * @important\r\n */\r\nvar Container = /** @class */ (function (_super) {\r\n __extends(Container, _super);\r\n /**\r\n * Constructor\r\n */\r\n function Container() {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n /**\r\n * Container children. (sorted by layout)\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this._childrenByLayout = [];\r\n /**\r\n * Container's disposers for its child elements.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this._childrenDisposers = new Dictionary();\r\n /**\r\n * Indicates if this container contains any focused elements, including\r\n * itself.\r\n */\r\n _this.hasFocused = false;\r\n /**\r\n * An array of references to elements the state should be set, when it is set\r\n * on this element.\r\n */\r\n _this.setStateOnSprites = [];\r\n /*\r\n * @ignore\r\n */\r\n _this.layoutInvalid = false;\r\n _this._absoluteWidth = 0;\r\n _this._absoluteHeight = 0;\r\n /**\r\n * An array of child Sprites that should be ready before this object can\r\n * fire a \"ready\" event.\r\n */\r\n _this._shouldBeReady = [];\r\n /**\r\n * Enables touch tap protection.\r\n */\r\n _this._tapToActivate = false;\r\n /**\r\n * If `tapToActivate` is used, this setting will determine how long the chart\r\n * will stay in \"active\" mode.\r\n *\r\n * @default 3000\r\n * @since 4.4.0\r\n */\r\n _this.tapTimeout = 3000;\r\n _this.className = \"Container\";\r\n _this._element = _this.paper.addGroup(\"g\");\r\n _this.group.add(_this.element);\r\n _this.setPropertyValue(\"pixelPerfect\", false);\r\n _this.setPropertyValue(\"layout\", \"absolute\");\r\n _this.setPropertyValue(\"fixedWidthGrid\", false);\r\n _this.setPropertyValue(\"verticalCenter\", \"none\");\r\n _this.setPropertyValue(\"horizontalCenter\", \"none\");\r\n _this._positionPrecision = 4;\r\n _this._disposers.push(new DictionaryDisposer(_this._childrenDisposers));\r\n _this.children.events.on(\"inserted\", _this.handleChildAdded, _this);\r\n _this.children.events.on(\"removed\", _this.handleChildRemoved, _this);\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Handles adding of a new child into `children`. Adding new children might\r\n * affect the whole layout so it needs to be revalidated.\r\n *\r\n * @ignore Exclude from docs\r\n * @param event Event object\r\n * @todo Throw an exception on adding a disposed object. Of course it's better NOT TO add disposed objects, so that what we should focus on.\r\n */\r\n Container.prototype.handleChildAdded = function (event) {\r\n this.processChild(event.newValue);\r\n };\r\n /**\r\n * @ignore\r\n */\r\n Container.prototype.processChild = function (child) {\r\n // try solves the problem when somedy adds child directly to children\r\n try {\r\n this._childrenDisposers.insertKey(child.uid, new MultiDisposer([\r\n // it's not enough to listen to POSITION_CHANGED only, as some extra redrawals will happen.\r\n child.events.on(\"transformed\", this.handleChildTransform, this),\r\n child.events.on(\"zIndexChanged\", this.sortAndAdd, this)\r\n ]));\r\n }\r\n catch (err) {\r\n // void\r\n }\r\n if (this.element) {\r\n var group = this.element;\r\n group.add(child.group);\r\n }\r\n child.parent = this;\r\n child.paper = this.paper;\r\n this.dispatchImmediately(\"childadded\", { type: \"childadded\", newValue: child });\r\n this.invalidate();\r\n };\r\n /**\r\n * @ignore\r\n */\r\n Container.prototype.sortAndAdd = function () {\r\n this.sortChildren();\r\n this.addChildren();\r\n };\r\n /**\r\n * Handles child removal. Changing size of the child may change the\r\n * whole layout of the Container, hence layout needs to be invalidated.\r\n *\r\n * @ignore Exclude from docs\r\n * @param event Event object\r\n */\r\n Container.prototype.handleChildRemoved = function (event) {\r\n var child = event.oldValue;\r\n // TODO figure out why the key sometimes doesn't exist\r\n this._childrenDisposers.removeKey(child.uid);\r\n if (this.element) {\r\n var group = this.element;\r\n group.removeElement(child.group);\r\n }\r\n if (child.isMeasured) {\r\n this.invalidateLayout();\r\n }\r\n this.dispatchImmediately(\"childremoved\", { type: \"childremoved\", oldValue: child });\r\n };\r\n /**\r\n * Handles child transformation. Changing size of the child may change the\r\n * whole layout of the Container, hence layout needs to be invalidated.\r\n *\r\n * @ignore Exclude from docs\r\n * @param event Event object\r\n */\r\n Container.prototype.handleChildTransform = function (event) {\r\n var child = event.target;\r\n if (child.isMeasured) { // && this.layout != \"none\" && this.layout != \"absolute\") {\r\n this.invalidateLayout();\r\n }\r\n };\r\n /**\r\n * Invalidates Container's layout, causing it to be re-evaluated again.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Container.prototype.invalidateLayout = function () {\r\n if (this.layoutInvalid || this.disabled || this.isTemplate || this.layout == \"none\" || this.__disabled) {\r\n return;\r\n }\r\n this.layoutInvalid = true;\r\n registry.addToInvalidLayouts(this);\r\n system.requestFrame();\r\n };\r\n /**\r\n * Invalidates element.\r\n *\r\n * Object will be redrawn during the next update cycle.\r\n *\r\n * Please note that in most cases elements will auto-invalidate when needed. If\r\n * everything works, DO NOT use this method. Use it only if some changes do\r\n * not take otherwise.\r\n */\r\n Container.prototype.invalidate = function () {\r\n _super.prototype.invalidate.call(this);\r\n this.invalidateLayout();\r\n };\r\n /**\r\n * Invalidates the whole element, including layout AND all its child\r\n * elements.\r\n *\r\n * As this will essentially force all elements to redraw, use only if\r\n * absolutely necessary.\r\n */\r\n Container.prototype.deepInvalidate = function () {\r\n _super.prototype.invalidate.call(this);\r\n //this.sortChildren();\r\n $array.each(this._childrenByLayout, function (child) {\r\n if (child instanceof Container) {\r\n child.deepInvalidate();\r\n }\r\n else {\r\n child.invalidate();\r\n }\r\n });\r\n this.invalidateLayout();\r\n };\r\n Object.defineProperty(Container.prototype, \"children\", {\r\n /**\r\n * Returns a list of the child [[Sprite]] elements contained in this\r\n * Container.\r\n *\r\n * @return List of child elements (Sprites)\r\n */\r\n get: function () {\r\n // @todo Review if we can add all children to disposers\r\n if (!this._children) {\r\n this._children = new List();\r\n //this._disposers.push(new ListDisposer(this._children));\r\n }\r\n return this._children;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Container.prototype, \"minWidth\", {\r\n /**\r\n * @return Width (px)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"minWidth\");\r\n },\r\n /**\r\n * Minimum width (px) for the Container. A container will not\r\n * auto-shrink beyond this value, even if child elements are smaller.\r\n *\r\n * @param value Width (px)\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"minWidth\", value)) {\r\n this.invalidateLayout();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Container.prototype, \"minHeight\", {\r\n /**\r\n * @return Height (px)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"minHeight\");\r\n },\r\n /**\r\n * Minimum height (px) for the Container. A container will not\r\n * auto-shrink beyond this value, even if child elements are smaller.\r\n *\r\n * @param value Height (px)\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"minHeight\", value)) {\r\n this.invalidateLayout();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Overrides the original `removeElement` so that Container's actual element\r\n * is not removed. We do not need to remove element of a Container.\r\n *\r\n * We do this because remove element each time will fail the `getBBox`.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Container.prototype.removeElement = function () {\r\n };\r\n /**\r\n * Sorts Container's children: the ones with variable width and height are\r\n * put at the end of the list (depending on layout type), so that fixed-width\r\n * ones can be drawn first.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Container.prototype.sortChildren = function () {\r\n var _this = this;\r\n this._childrenByLayout = [];\r\n if (this.layout == \"none\" || this.layout == \"absolute\" || !this.layout) {\r\n //$iter.each(this.children.iterator(), (child) => {\r\n //\tthis._childrenByLayout.push(child);\r\n //});\r\n this._childrenByLayout = this.children.values;\r\n }\r\n else {\r\n // Assemble fixed-size and relative lists\r\n var fixed_1 = [];\r\n var relative_1 = [];\r\n $iter.each(this.children.iterator(), function (child) {\r\n if (_this.layout == \"horizontal\" || _this.layout == \"grid\") {\r\n if (!$type.isNumber(child.percentWidth)) {\r\n fixed_1.push(child);\r\n }\r\n else {\r\n relative_1.push(child);\r\n }\r\n }\r\n else if (_this.layout == \"vertical\") {\r\n if (!$type.isNumber(child.percentHeight)) {\r\n fixed_1.push(child);\r\n }\r\n else {\r\n relative_1.push(child);\r\n }\r\n }\r\n else {\r\n fixed_1.push(child);\r\n }\r\n });\r\n // Concat everything into list\r\n this._childrenByLayout = fixed_1.concat(relative_1);\r\n }\r\n this.calculateRelativeSize();\r\n };\r\n /**\r\n * Calculates relative sizes for all Container's children.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Make it protected?\r\n */\r\n Container.prototype.calculateRelativeSize = function () {\r\n var _this = this;\r\n var totalRelativeWidth = 0;\r\n var totalRelativeHeight = 0;\r\n $array.each(this._childrenByLayout, function (child) {\r\n // if child is not measured, we do not care about it at all.\r\n if (child.isMeasured) {\r\n if ($type.isNumber(child.percentWidth)) {\r\n totalRelativeWidth += child.percentWidth;\r\n }\r\n if ($type.isNumber(child.percentHeight)) {\r\n totalRelativeHeight += child.percentHeight;\r\n }\r\n }\r\n });\r\n $array.each(this._childrenByLayout, function (child) {\r\n if (child.isMeasured) {\r\n if (_this.layout == \"horizontal\") {\r\n if ($type.isNumber(child.percentWidth)) {\r\n child.relativeWidth = child.percentWidth / totalRelativeWidth;\r\n }\r\n if ($type.isNumber(child.percentHeight)) {\r\n child.relativeHeight = child.percentHeight / 100;\r\n }\r\n }\r\n if (_this.layout == \"vertical\") {\r\n if ($type.isNumber(child.percentHeight)) {\r\n child.relativeHeight = child.percentHeight / totalRelativeHeight;\r\n }\r\n if ($type.isNumber(child.percentWidth)) {\r\n child.relativeWidth = child.percentWidth / 100;\r\n }\r\n }\r\n if (_this.layout == \"grid\") {\r\n if ($type.isNumber(child.percentHeight)) {\r\n child.relativeHeight = child.percentHeight / 100;\r\n }\r\n if ($type.isNumber(child.percentWidth)) {\r\n child.relativeWidth = child.percentWidth / 100;\r\n }\r\n }\r\n }\r\n if (_this.layout == \"absolute\" || !child.isMeasured) {\r\n if ($type.isNumber(child.percentWidth)) {\r\n child.relativeWidth = child.percentWidth / 100;\r\n }\r\n if ($type.isNumber(child.percentHeight)) {\r\n child.relativeHeight = child.percentHeight / 100;\r\n }\r\n }\r\n });\r\n };\r\n /**\r\n * Adds all children to Container's SVG element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Container.prototype.addChildren = function () {\r\n /*\r\n Need this check because a child might be assigned to parent even before element is created, for example a theme\r\n access scrollbar.thumb\r\n */\r\n if (this.element) {\r\n var zindexed = $array.copy(this.children.values); // not children by layout!\r\n var sortArray = zindexed.map(function (data, idx) {\r\n return { idx: idx, data: data };\r\n });\r\n sortArray.sort(function (a, b) {\r\n var ai = (a.data.zIndex || 0);\r\n var bi = (b.data.zIndex || 0);\r\n if (ai < bi) {\r\n return -1;\r\n }\r\n if (ai > bi) {\r\n return 1;\r\n }\r\n return a.idx - b.idx;\r\n });\r\n zindexed = sortArray.map(function (val) {\r\n return val.data;\r\n });\r\n var group_1 = this.element;\r\n // check, maybe the order is good already\r\n var isCorrect = true;\r\n if (group_1.node && group_1.node.childNodes) {\r\n for (var i = 0, len = group_1.node.childNodes.length; i < len; i++) {\r\n if (group_1.node.childNodes[i] != zindexed[i].group.node) {\r\n isCorrect = false;\r\n break;\r\n }\r\n }\r\n }\r\n if (!isCorrect) {\r\n $array.each(zindexed, function (child) {\r\n if (child.group) {\r\n group_1.add(child.group);\r\n }\r\n });\r\n if (this._background) {\r\n this.group.addToBack(this._background.group);\r\n }\r\n this.invalidateLayout();\r\n }\r\n }\r\n };\r\n /**\r\n * Creates a new element of specific type and assigns as a child to the\r\n * Container.\r\n *\r\n * @param Class type for the new element\r\n * @return New element\r\n */\r\n Container.prototype.createChild = function (classType) {\r\n var sprite = new classType();\r\n sprite.parent = this;\r\n return sprite;\r\n };\r\n /**\r\n * Removes all Container's children without actually destroying them.\r\n *\r\n * To destroy children use `disposeChildren()` instead.\r\n */\r\n Container.prototype.removeChildren = function () {\r\n // remove all children\r\n // TODO use iteration instead\r\n while (this.children.length > 0) {\r\n var child = this.children.getIndex(0);\r\n child.parent = undefined;\r\n this.children.removeValue(child);\r\n }\r\n };\r\n /**\r\n * Removes and destroys all Container's children.\r\n *\r\n * To remove children from Container without destroying them, use\r\n * `removeChildren()`.\r\n */\r\n Container.prototype.disposeChildren = function () {\r\n // TODO use iteration instead\r\n while (this.children.length > 0) {\r\n var child = this.children.getIndex(0);\r\n child.dispose();\r\n this.children.removeValue(child);\r\n }\r\n };\r\n Object.defineProperty(Container.prototype, \"background\", {\r\n /**\r\n * @return Background element\r\n */\r\n get: function () {\r\n if (!this._background) {\r\n this._background = this.createBackground();\r\n this.processBackground();\r\n }\r\n return this._background;\r\n },\r\n /**\r\n * An element to use as container background.\r\n *\r\n * @param background Background element\r\n */\r\n set: function (background) {\r\n if (this._background && this.background != background) {\r\n this.removeDispose(this._background);\r\n }\r\n if (background) {\r\n this._background = background;\r\n this._disposers.push(background);\r\n this.processBackground();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Handles the situation where parent element is resized.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Container.prototype.handleGlobalScale = function () {\r\n _super.prototype.handleGlobalScale.call(this);\r\n this.children.each(function (child) {\r\n child.handleGlobalScale();\r\n });\r\n };\r\n /**\r\n * Creates and returns a [[Rectangle]] to use as a background for Container.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Background Rectangle element\r\n */\r\n Container.prototype.createBackground = function () {\r\n return new Rectangle();\r\n };\r\n /**\r\n * Decorates background element with required properties.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Container.prototype.processBackground = function () {\r\n var background = this._background;\r\n if (background) {\r\n background.isMeasured = false;\r\n this._background.fill = new InterfaceColorSet().getFor(\"background\");\r\n background.parent = this;\r\n background.isMeasured = false;\r\n this.children.removeValue(background);\r\n this._disposers.push(background);\r\n this.group.addToBack(this._background.group);\r\n }\r\n };\r\n /**\r\n * Measures the size of container and informs its children of how much size\r\n * they can occupy, by setting their relative `maxWidth` and `maxHeight`\r\n * properties.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Container.prototype.validateLayout = function () {\r\n var _this = this;\r\n registry.removeFromInvalidLayouts(this);\r\n this.layoutInvalid = false;\r\n // prevents from drawing if topparent is 0x0\r\n /*\r\n let topParent = this.topParent;\r\n if (topParent) {\r\n if (!topParent.maxWidth || !topParent.maxHeight) {\r\n this._disposers.push(topParent.events.once(\"maxsizechanged\", this.invalidateLayout, this));\r\n }\r\n }*/\r\n this._availableWidth = this.innerWidth;\r\n this._availableHeight = this.innerHeight;\r\n var measuredWidth = 0;\r\n var measuredHeight = 0;\r\n var allValid = true;\r\n if (this.children) {\r\n this.sortChildren();\r\n // we itterate through list of children, sorted by layout priority. sprites which width non-relative width/height will go first, so we will reduce available width before proceeding to sprites with relative width/height\r\n $array.each(this._childrenByLayout, function (child) {\r\n var maxWidth;\r\n var maxHeight;\r\n if ($type.isNumber(child.relativeWidth)) {\r\n maxWidth = $math.round(_this._availableWidth * child.relativeWidth, 2);\r\n if (_this.layout == \"horizontal\") { // || this.layout == \"absolute\") {\r\n maxWidth -= child.pixelMarginRight + child.pixelMarginLeft;\r\n }\r\n }\r\n else {\r\n if (_this.layout == \"horizontal\") {\r\n if (child.invalid) {\r\n child.validate();\r\n }\r\n }\r\n }\r\n if ($type.isNumber(child.relativeHeight)) {\r\n maxHeight = $math.round(_this._availableHeight * child.relativeHeight, 2);\r\n if (_this.layout == \"vertical\") { // || this.layout == \"absolute\") {\r\n maxHeight -= child.pixelMarginTop + child.pixelMarginBottom;\r\n }\r\n }\r\n else {\r\n if (_this.layout == \"vertical\") {\r\n if (child.invalid) {\r\n child.validate();\r\n }\r\n }\r\n }\r\n // if child is valid\r\n if (child.invalid == false) {\r\n if ($type.isNumber(child.relativeWidth)) {\r\n child.maxWidth = maxWidth;\r\n }\r\n if ($type.isNumber(child.relativeHeight)) {\r\n child.maxHeight = maxHeight;\r\n }\r\n if (child.isMeasured) {\r\n // reduce available width if this is horizontal layout\r\n if (_this.layout == \"horizontal\") {\r\n if (!$type.isNumber(child.percentWidth)) {\r\n if (child.measuredWidth > 0) {\r\n _this._availableWidth -= child.measuredWidth + child.pixelMarginLeft + child.pixelMarginRight;\r\n }\r\n }\r\n }\r\n // reduce available height if this is vertical layout\r\n if (_this.layout == \"vertical\") {\r\n if (!$type.isNumber(child.percentHeight)) {\r\n if (child.measuredHeight > 0) {\r\n _this._availableHeight -= child.measuredHeight + child.pixelMarginTop + child.pixelMarginBottom;\r\n }\r\n }\r\n }\r\n var childMeasuredWidth = child.measuredWidth;\r\n var childMeasuredHeight = child.measuredHeight;\r\n if (child.align != \"none\") {\r\n childMeasuredWidth += child.pixelMarginLeft + child.pixelMarginRight;\r\n }\r\n if (child.valign != \"none\") {\r\n childMeasuredHeight += child.pixelMarginTop + child.pixelMarginBottom;\r\n }\r\n measuredWidth = Math.max(measuredWidth, childMeasuredWidth);\r\n measuredHeight = Math.max(measuredHeight, childMeasuredHeight);\r\n }\r\n }\r\n // if child is not valid\r\n else {\r\n // tell child what maximum width/ height it can occupy\r\n if (child.isMeasured) {\r\n if ($type.isNumber(child.relativeWidth)) {\r\n if (child.maxWidth != maxWidth) { // need to check this because of allValid\r\n child.maxWidth = maxWidth;\r\n allValid = false;\r\n }\r\n }\r\n if ($type.isNumber(child.relativeHeight)) {\r\n if (child.maxHeight != maxHeight) { // need to check this because of allValid\r\n child.maxHeight = maxHeight;\r\n allValid = false;\r\n }\r\n }\r\n }\r\n }\r\n });\r\n }\r\n this._absoluteWidth = measuredWidth;\r\n this._absoluteHeight = measuredHeight;\r\n // arrange after measuring, only if all children are valid already\r\n if (allValid) {\r\n this.arrange();\r\n }\r\n };\r\n /**\r\n * Arranges children according to layout specs and available space / child\r\n * sizes.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Container.prototype.arrange = function () {\r\n var _this = this;\r\n var children = this.children;\r\n /*\r\n in this method we not only arrange children but also find out the size of the container\r\n it might seem it would be easier to get container size using sprite's measure method,\r\n however it would return only actual size of the bbox. However as each child meight have\r\n margins set, we need to check each child - we do it here.\r\n\r\n This method doesn't do anything with DOM, so it's not expensive\r\n */\r\n var measuredWidth = 0;\r\n var measuredHeight = 0;\r\n //let innerWidth: number = this.innerWidth; //$math.max(this.innerWidth, this._measuredWidth - paddingLeft - paddingRight);\r\n //let innerHeight: number = this.innerHeight; //$math.max(this.innerHeight, this._measuredHeight - paddingTop - paddingBottom);\r\n // above is wrong, as if a w/h is not specified, it is 0 and alignment doesn't work at all.\r\n var innerWidth = $math.max(this.innerWidth, this._absoluteWidth);\r\n var innerHeight = $math.max(this.innerHeight, this._absoluteHeight);\r\n var left; // = 0;\r\n var right; // = innerWidth;\r\n var top; // = 0;\r\n var bottom; // = innerHeight;\r\n var paddingLeft = this.pixelPaddingLeft;\r\n var paddingRight = this.pixelPaddingRight;\r\n var paddingTop = this.pixelPaddingTop;\r\n var paddingBottom = this.pixelPaddingBottom;\r\n var nextX = 0;\r\n var nextY = 0;\r\n var row = 0;\r\n var column = 0;\r\n var columnWidth = [];\r\n var rowHeight = [];\r\n var maxCellWidth;\r\n var minCellWidth;\r\n var columnCount;\r\n var maxWidth = this.maxWidth;\r\n var maxHeight = this.maxHeight;\r\n var minWidth = this.minWidth;\r\n var minHeight = this.minHeight;\r\n var childrenCopy = $array.copy(children.values);\r\n if (this.reverseOrder) {\r\n childrenCopy.reverse();\r\n }\r\n // GRID PRECALCULATIONS\r\n if (this.layout == \"grid\") {\r\n minCellWidth = maxWidth;\r\n maxCellWidth = 1;\r\n for (var i = 0, len = childrenCopy.length; i < len; i++) {\r\n var child = childrenCopy[i];\r\n if (child.isMeasured && !child.disabled && !child.__disabled) {\r\n var childMeasuredWidth = child.measuredWidth;\r\n if (childMeasuredWidth < minCellWidth) {\r\n minCellWidth = childMeasuredWidth;\r\n }\r\n if (childMeasuredWidth > maxCellWidth) {\r\n maxCellWidth = childMeasuredWidth;\r\n }\r\n }\r\n }\r\n minCellWidth = $math.fitToRange(minCellWidth, 1, maxWidth);\r\n maxCellWidth = $math.fitToRange(maxCellWidth, 1, maxWidth);\r\n if (this.fixedWidthGrid) {\r\n columnCount = maxWidth / maxCellWidth;\r\n }\r\n else {\r\n columnCount = maxWidth / minCellWidth; // predicted number of columns, yes it is usually much more than real number, but we fix that later\r\n }\r\n columnCount = $math.max(1, Math.floor(columnCount));\r\n columnCount = $math.min(this.maxColumns, columnCount);\r\n columnWidth = this.getColumnWidth(childrenCopy, columnCount, maxCellWidth);\r\n }\r\n var contentLeft;\r\n var contentRight;\r\n var contentTop;\r\n var contentBottom;\r\n // we itterate through array of children\r\n // TODO use iterator instead\r\n for (var i = 0, len = childrenCopy.length; i < len; i++) {\r\n var child = childrenCopy[i];\r\n if (child.isMeasured && !child.disabled && !child.__disabled) {\r\n var x = undefined; //child.pixelX; // must reset\r\n var y = undefined; //child.pixelY; // must reset\r\n var childMarginLeft = child.pixelMarginLeft;\r\n var childMarginRight = child.pixelMarginRight;\r\n var childMarginTop = child.pixelMarginTop;\r\n var childMarginBottom = child.pixelMarginBottom;\r\n var childWidth = child.measuredWidth;\r\n var childHeight = child.measuredHeight;\r\n var childLeft = void 0;\r\n var childRight = void 0;\r\n var childTop = void 0;\r\n var childBottom = void 0;\r\n switch (this.layout) {\r\n case \"none\":\r\n break;\r\n // absolute layout\r\n case \"absolute\":\r\n // horizontal alignment\r\n switch (child.align) {\r\n case \"left\":\r\n x = childMarginLeft - child.maxLeft;\r\n break;\r\n case \"center\":\r\n x = (innerWidth - childWidth) / 2 - child.maxLeft;\r\n break;\r\n case \"right\":\r\n x = innerWidth - childMarginRight - child.maxRight;\r\n break;\r\n default:\r\n if (!(child.x instanceof Percent)) {\r\n x = child.pixelX;\r\n }\r\n break;\r\n }\r\n // vertical alignment\r\n switch (child.valign) {\r\n case \"top\":\r\n y = childMarginTop - child.maxTop;\r\n break;\r\n case \"middle\":\r\n y = (innerHeight - childHeight) / 2 - child.maxTop;\r\n break;\r\n case \"bottom\":\r\n y = innerHeight - childMarginBottom - child.maxBottom;\r\n break;\r\n default:\r\n if (!(child.y instanceof Percent)) {\r\n y = child.pixelY;\r\n }\r\n break;\r\n }\r\n break;\r\n // vertical layout\r\n case \"vertical\":\r\n //if ($type.isNumber(child.relativeHeight)) {\r\n //\tchildHeight = child.maxHeight;\r\n //}\r\n switch (child.align) {\r\n case \"left\":\r\n x = childMarginLeft - child.maxLeft;\r\n break;\r\n case \"center\":\r\n x = (innerWidth - childWidth) / 2 - child.maxLeft;\r\n break;\r\n case \"right\":\r\n x = innerWidth - childMarginRight - child.maxRight;\r\n break;\r\n default:\r\n x = child.pixelX;\r\n break;\r\n }\r\n y = nextY + childMarginTop - child.maxTop;\r\n nextY = y + child.maxBottom + childMarginBottom;\r\n break;\r\n // horizontal layout\r\n case \"horizontal\":\r\n //if ($type.isNumber(child.relativeHeight)) {\r\n //\tchildHeight = child.maxHeight;\r\n //}\r\n switch (child.valign) {\r\n case \"top\":\r\n y = childMarginTop - child.maxTop;\r\n break;\r\n case \"middle\":\r\n y = (innerHeight - childHeight) / 2 - child.maxTop;\r\n break;\r\n case \"bottom\":\r\n y = innerHeight - childMarginBottom - child.maxBottom;\r\n break;\r\n default:\r\n y = child.pixelY;\r\n break;\r\n }\r\n x = nextX + childMarginLeft - child.maxLeft;\r\n nextX = x + child.maxRight + childMarginRight;\r\n break;\r\n case \"grid\":\r\n x = nextX + childMarginLeft - child.maxLeft;\r\n switch (child.valign) {\r\n case \"top\":\r\n y = nextY + childMarginTop - child.maxTop;\r\n break;\r\n case \"middle\":\r\n y = nextY + (innerHeight - childHeight) / 2 - child.maxTop;\r\n break;\r\n case \"bottom\":\r\n y = nextY + innerHeight - childMarginBottom - child.maxBottom;\r\n break;\r\n default:\r\n y = nextY - child.maxTop;\r\n break;\r\n }\r\n nextX += columnWidth[column];\r\n rowHeight[row] = $math.max(rowHeight[row], childHeight);\r\n column++;\r\n var nextColumnWidth = columnWidth[column];\r\n if (!$type.isNumber(nextColumnWidth)) {\r\n nextColumnWidth = maxCellWidth;\r\n }\r\n if (nextX > $math.min(this.innerWidth, maxWidth) - nextColumnWidth + 1 && column < columnCount) {\r\n columnCount = column;\r\n nextX = 0;\r\n nextY = 0;\r\n row = 0;\r\n column = 0;\r\n columnWidth = this.getColumnWidth(childrenCopy, columnCount, maxCellWidth);\r\n rowHeight = [];\r\n i = -1;\r\n continue;\r\n }\r\n if (column >= columnCount) {\r\n column = 0;\r\n nextY += rowHeight[row];\r\n row++;\r\n nextX = 0;\r\n }\r\n break;\r\n }\r\n if (this.layout !== \"none\") {\r\n child.moveTo({ x: x, y: y }); // must use moveTo, otherwise x/y set in percent won't work\r\n childLeft = x + child.maxLeft - childMarginLeft;\r\n childRight = x + child.maxRight + childMarginRight;\r\n childTop = y + child.maxTop - childMarginTop;\r\n childBottom = y + child.maxBottom + childMarginBottom;\r\n if (childRight > right || !$type.isNumber(right)) {\r\n right = childRight;\r\n }\r\n if (childLeft < left || !$type.isNumber(left)) {\r\n left = childLeft;\r\n }\r\n if (childTop < top || !$type.isNumber(top)) {\r\n top = childTop;\r\n }\r\n if (childBottom > bottom || !$type.isNumber(bottom)) {\r\n bottom = childBottom;\r\n }\r\n if (childRight > contentRight || !$type.isNumber(contentRight)) {\r\n contentRight = childRight;\r\n }\r\n if (childLeft < contentLeft || !$type.isNumber(contentLeft)) {\r\n contentLeft = childLeft;\r\n }\r\n if (childTop < contentTop || !$type.isNumber(contentTop)) {\r\n contentTop = childTop;\r\n }\r\n if (childBottom > contentBottom || !$type.isNumber(contentBottom)) {\r\n contentBottom = contentBottom;\r\n }\r\n }\r\n }\r\n else {\r\n child.validatePosition();\r\n }\r\n }\r\n if (this.layout == \"none\") {\r\n var noneBBox = this.bbox;\r\n left = noneBBox.x;\r\n right = noneBBox.x + noneBBox.width;\r\n top = noneBBox.y;\r\n bottom = noneBBox.y + noneBBox.height;\r\n }\r\n if (!$type.isNumber(left)) {\r\n left = 0;\r\n contentLeft = 0;\r\n }\r\n if (!$type.isNumber(right)) {\r\n right = this._availableWidth;\r\n contentRight = right;\r\n }\r\n if (!$type.isNumber(top)) {\r\n top = 0;\r\n contentTop = 0;\r\n }\r\n if (!$type.isNumber(bottom)) {\r\n bottom = this._availableHeight;\r\n contentBottom = bottom;\r\n }\r\n if (!$type.isNumber(contentTop)) {\r\n contentTop = 0;\r\n }\r\n if (!$type.isNumber(contentBottom)) {\r\n contentBottom = contentTop;\r\n }\r\n if (!$type.isNumber(contentLeft)) {\r\n contentLeft = 0;\r\n }\r\n if (!$type.isNumber(contentRight)) {\r\n contentRight = contentLeft;\r\n }\r\n measuredWidth = right - left;\r\n measuredHeight = bottom - top;\r\n if ($type.isNumber(this.relativeWidth)) {\r\n measuredWidth = maxWidth - paddingLeft - paddingRight;\r\n left = 0;\r\n right = measuredWidth;\r\n }\r\n if ($type.isNumber(this.relativeHeight)) {\r\n measuredHeight = maxHeight - paddingTop - paddingBottom;\r\n top = 0;\r\n bottom = measuredHeight;\r\n }\r\n if ($type.isNumber(this._pixelWidth)) {\r\n left = 0;\r\n measuredWidth = this._pixelWidth - paddingLeft - paddingRight;\r\n }\r\n if ($type.isNumber(minWidth) && measuredWidth < minWidth) {\r\n left = 0;\r\n measuredWidth = this.minWidth - paddingLeft - paddingRight;\r\n }\r\n if ($type.isNumber(this._pixelHeight)) {\r\n top = 0;\r\n measuredHeight = this._pixelHeight - paddingTop - paddingBottom;\r\n }\r\n if ($type.isNumber(minHeight) && measuredHeight < minHeight) {\r\n top = 0;\r\n measuredHeight = minHeight - paddingTop - paddingBottom;\r\n }\r\n var measuredContentWidth = contentRight - contentLeft;\r\n var measuredContentHeight = contentBottom - contentTop;\r\n /// handle content alignment\r\n if (this.layout != \"none\" && (this.contentAlign || this.contentValign) && children.length > 0) {\r\n var dx_1;\r\n var dy_1;\r\n var mwa = measuredWidth;\r\n var mha = measuredHeight;\r\n if (mwa < measuredContentWidth) {\r\n mwa = measuredContentWidth;\r\n }\r\n if (mha < measuredContentHeight) {\r\n mha = measuredContentHeight;\r\n }\r\n if (this.contentAlign == \"center\") {\r\n dx_1 = (mwa - measuredContentWidth) / 2;\r\n }\r\n if (this.contentAlign == \"right\") {\r\n dx_1 = mwa - measuredContentWidth;\r\n }\r\n if (this.contentValign == \"middle\") {\r\n dy_1 = (mha - measuredContentHeight) / 2;\r\n }\r\n if (this.contentValign == \"bottom\") {\r\n dy_1 = mha - measuredContentHeight;\r\n }\r\n if ($type.isNumber(dx_1)) {\r\n $iter.each(children.iterator(), function (child) {\r\n var childLeft = child.maxLeft;\r\n var ddx = dx_1;\r\n if (_this.layout == \"horizontal\") {\r\n child.x = child.pixelX + ddx;\r\n }\r\n // individual grid elements can not be aligned vertically, that's why it's different from horizontal\r\n if (_this.layout == \"grid\") {\r\n child.x = child.pixelX + ddx;\r\n }\r\n if (_this.layout == \"vertical\") {\r\n ddx += child.pixelMarginLeft;\r\n if (child.align == \"none\") {\r\n child.x = ddx - childLeft;\r\n }\r\n }\r\n if (_this.layout == \"absolute\") {\r\n ddx += child.pixelMarginLeft;\r\n if (child.align == \"none\") {\r\n child.x = ddx - childLeft;\r\n }\r\n }\r\n });\r\n }\r\n if ($type.isNumber(dy_1)) {\r\n $iter.each(children.iterator(), function (child) {\r\n var childTop = child.maxTop;\r\n var ddy = dy_1;\r\n if (_this.layout == \"horizontal\") {\r\n ddy += child.pixelMarginTop;\r\n if (child.valign == \"none\") {\r\n child.y = ddy - childTop;\r\n }\r\n }\r\n // individual grid elements can not be aligned vertically, that's why it's different from horizontal\r\n if (_this.layout == \"grid\") {\r\n ddy += child.pixelMarginTop;\r\n child.y = ddy - childTop;\r\n }\r\n if (_this.layout == \"vertical\") {\r\n child.y = child.pixelY + ddy;\r\n }\r\n if (_this.layout == \"absolute\") {\r\n ddy += child.pixelMarginTop;\r\n if (child.valign == \"none\") {\r\n child.y = ddy - childTop;\r\n }\r\n }\r\n });\r\n }\r\n }\r\n var oldBBox = this.bbox;\r\n // this will mess up maxw/maxh set by container layout, we need a separate min/maxwidth for users\r\n // this prevents invalidating layout in such cases as scrolling category axis, when labels go outside bounds and results transformed event\r\n // todo: need to check if this doesn't cause other problems.\r\n //if (this.maxWidth > 0) {\r\n //measuredWidth = $math.min(measuredWidth, this.maxWidth);\r\n //measuredWidth = $math.max(measuredWidth, this.minWidth);\r\n //}\r\n //if (this.maxHeight > 0) {\r\n //measuredHeight = $math.min(measuredHeight, this.maxHeight);\r\n //measuredHeight = $math.max(measuredHeight, this.minHeight);\r\n //}\r\n measuredWidth = $math.max(measuredWidth, minWidth);\r\n measuredHeight = $math.max(measuredHeight, minHeight);\r\n this.contentWidth = measuredWidth;\r\n this.contentHeight = measuredHeight;\r\n // new\r\n measuredWidth = $math.min(measuredWidth, maxWidth);\r\n measuredHeight = $math.min(measuredHeight, maxHeight);\r\n this._bbox = { x: left, y: top, width: measuredWidth, height: measuredHeight };\r\n var prevLeft = this.maxLeft;\r\n var prevTop = this.maxTop;\r\n var prevBotttom = this.maxBottom;\r\n var prevRight = this.maxRight;\r\n this.measure();\r\n if (prevLeft != this.maxLeft || prevRight != this.maxRight || prevTop != this.maxTop || prevBotttom != this.maxBottom) {\r\n if (this.events.isEnabled(\"transformed\")) {\r\n var event_1 = {\r\n type: \"transformed\",\r\n target: this\r\n };\r\n if (oldBBox) {\r\n event_1.dummyData = oldBBox.width + \" \" + measuredWidth + \" \" + oldBBox.height + \" \" + measuredHeight;\r\n }\r\n this.events.dispatchImmediately(\"transformed\", event_1);\r\n }\r\n }\r\n this.dispatchImmediately(\"layoutvalidated\");\r\n };\r\n /**\r\n * Positions element according its center settings.\r\n *\r\n * @todo Description (review)\r\n * @ignore Exclude from docs\r\n */\r\n Container.prototype.updateCenter = function () {\r\n _super.prototype.updateCenter.call(this);\r\n this.updateBackground();\r\n };\r\n /**\r\n * Update the background to fit into specific dimensions.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Make it protected?\r\n */\r\n Container.prototype.updateBackground = function () {\r\n var background = this._background; // accessing protected, as getter creates instance if it doesn't exist\r\n if (background) {\r\n background.x = this.maxLeft;\r\n background.y = this.maxTop;\r\n background.width = this.maxRight - this.maxLeft;\r\n background.height = this.maxBottom - this.maxTop;\r\n }\r\n };\r\n /**\r\n * Returns widths of all columns in a horizontal Container layout.\r\n *\r\n * @ignore Exclude from docs\r\n * @param columnCount Number of columns\r\n * @param maxCellWidth Maximum width of one grid cell\r\n * @return An array of column widths\r\n */\r\n Container.prototype.getColumnWidth = function (children, columnCount, maxCellWidth) {\r\n var _this = this;\r\n var columnWidth = [];\r\n var column = 0;\r\n $array.each(children, function (child) {\r\n if (child.isMeasured && !child.disabled && !child.__disabled) {\r\n if (_this.fixedWidthGrid) {\r\n columnWidth[column] = maxCellWidth;\r\n }\r\n else {\r\n columnWidth[column] = $math.max(columnWidth[column], child.measuredWidth + child.pixelMarginRight + child.pixelMarginLeft);\r\n }\r\n column++;\r\n if (column == columnCount) {\r\n column = 0;\r\n }\r\n }\r\n });\r\n return columnWidth;\r\n };\r\n Object.defineProperty(Container.prototype, \"layout\", {\r\n /**\r\n * @return Layout\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"layout\");\r\n },\r\n /**\r\n * Container layout.\r\n *\r\n * Options: \"absolute\" (default), \"vertical\", \"horizontal\", \"grid\", \"none\". \"none\" is quite the same as \"absolute\" - the objects will\r\n * be positioned at their x, y coordinates, the difference is that with \"absolute\" you can still use align/valign for children and with \"none\" you can not.\r\n * Use \"none\" as much as you can as it's most cpu-saving layout.\r\n *\r\n * @default \"absolute\"\r\n * @param value Layout\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"layout\", value)) {\r\n this.invalidateLayout();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Container.prototype, \"contentValign\", {\r\n /**\r\n * @return Vertical alignment\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"contentValign\");\r\n },\r\n /**\r\n * Vertical alignment of the elements for the vertical Container.\r\n *\r\n * This is used when Container is larger than the height of all its children.\r\n *\r\n * @param value vertical alignment\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"contentValign\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Container.prototype, \"contentAlign\", {\r\n /**\r\n * @return Horizontal alignment\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"contentAlign\");\r\n },\r\n /**\r\n * Horizontal alignment of the elements for the horizontal Container.\r\n *\r\n * This is used when Container is larger than the height of all its children.\r\n *\r\n * @param value Horizontal alignment\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"contentAlign\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Container.prototype, \"fixedWidthGrid\", {\r\n /**\r\n * @return Should use fixed width grid?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"fixedWidthGrid\");\r\n },\r\n /**\r\n * Controls if the grid of the Container should use fixed width. Fixed width\r\n * grid will divide available space to all its columns/rows equally, without\r\n * adapting to actual child sizes or size requirements.\r\n *\r\n * @default false\r\n * @param value Should use fixed width grid?\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"fixedWidthGrid\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Container.prototype, \"maxColumns\", {\r\n /**\r\n * @return Should use fixed width grid?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"maxColumns\");\r\n },\r\n /**\r\n * Maximum number of columns (when using `\"grid\"` layout).\r\n *\r\n * @param value Should use fixed width grid?\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"maxColumns\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Container.prototype, \"reverseOrder\", {\r\n /**\r\n * @return Reverse children?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"reverseOrder\");\r\n },\r\n /**\r\n * If set to `true`, the children of the container will be drawn in reverse\r\n * order.\r\n *\r\n * @default false\r\n * @param value Reverse children?\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"reverseOrder\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Container.prototype, \"setStateOnChildren\", {\r\n /**\r\n * @return Set state on children\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"setStateOnChildren\");\r\n },\r\n /**\r\n * Specifies if, when state is applied on this container, the same state\r\n * should be applied to container's children as well as `background`.\r\n *\r\n * @default false\r\n * @param value Set state on children\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"setStateOnChildren\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Checks if point is within bounds of a container.\r\n *\r\n * @param point A coordinate to check\r\n * @return `true` if it fits within container\r\n */\r\n Container.prototype.fitsToBounds = function (point) {\r\n var x = point.x;\r\n var y = point.y;\r\n var deviation = 0.5; // sometimes coordinates are rounded to numbers like .999 so we add deviation here\r\n if (x >= -deviation && x <= this.pixelWidth + deviation && y >= -deviation && y <= this.pixelHeight + deviation) {\r\n return true;\r\n }\r\n else {\r\n return false;\r\n }\r\n };\r\n /**\r\n * Copies all properties from different Container, including background\r\n * clone.\r\n *\r\n * @param source Source Container to copy from\r\n */\r\n Container.prototype.copyFrom = function (source) {\r\n var _this = this;\r\n _super.prototype.copyFrom.call(this, source);\r\n this.layout = source.layout;\r\n this.setStateOnChildren = source.setStateOnChildren;\r\n if (source._background) {\r\n this.background = source._background.clone();\r\n this.background.copyFrom(source._background); // won't work without this\r\n }\r\n $iter.each(source.children.iterator(), function (child) {\r\n if (child.shouldClone) {\r\n var clonedChild = child.clone();\r\n clonedChild.parent = _this;\r\n }\r\n });\r\n };\r\n Object.defineProperty(Container.prototype, \"preloader\", {\r\n /**\r\n * @return Preloader instance\r\n */\r\n get: function () {\r\n var preloader = this._preloader;\r\n if (preloader) {\r\n return preloader;\r\n }\r\n else if (this.parent) {\r\n return this.parent.preloader;\r\n }\r\n },\r\n /**\r\n * A [[Preloader]] instance to be used when Container is busy.\r\n *\r\n * @param preloader Preloader instance\r\n */\r\n set: function (preloader) {\r\n if (this._preloader) {\r\n this.removeDispose(this._preloader);\r\n }\r\n this._preloader = preloader;\r\n if (preloader) {\r\n preloader.parent = this.tooltipContainer;\r\n this._disposers.push(preloader);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Sets [[Paper]] instance to use to draw elements.\r\n * @ignore\r\n * @param paper Paper\r\n * @return true if paper was changed, false, if it's the same\r\n */\r\n Container.prototype.setPaper = function (paper) {\r\n var _this = this;\r\n var changed = _super.prototype.setPaper.call(this, paper);\r\n if (changed) {\r\n if (this._background) {\r\n this._background.paper = paper;\r\n this._background.topParent = this.topParent;\r\n }\r\n this.children.each(function (child) {\r\n child.setPaper(paper);\r\n child.topParent = _this.topParent;\r\n });\r\n }\r\n return changed;\r\n };\r\n /**\r\n * Removes Container from the system-wide list of invalid Containers.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Container.prototype.removeFromInvalids = function () {\r\n _super.prototype.removeFromInvalids.call(this);\r\n registry.removeFromInvalidLayouts(this);\r\n };\r\n /**\r\n * Sets a [[DataItem]] to be used as data for the Container.\r\n *\r\n * @todo Description\r\n * @param dataItem DataItem\r\n */\r\n Container.prototype.setDataItem = function (dataItem) {\r\n // this place is potentially dangerous, as if we set datItem for some dummy container, all children dataItems will be overriden\r\n // the main reason for doing this is that we need a setDataItem code to be called for each sprite, otherwise property fields won't be\r\n // applied. Also, getting dataItem from parent all the time is more expensive than saving value.\r\n if (this._dataItem != dataItem) {\r\n $iter.each(this.children.iterator(), function (child) {\r\n child.dataItem = dataItem;\r\n });\r\n if (this._background) {\r\n this._background.dataItem = dataItem;\r\n }\r\n }\r\n _super.prototype.setDataItem.call(this, dataItem);\r\n };\r\n /**\r\n * Measures the element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Container.prototype.measureElement = function () {\r\n if (this.disabled || this.isTemplate || this.layout == \"none\" || this.__disabled) {\r\n // void\r\n }\r\n else {\r\n this.validateLayout();\r\n }\r\n };\r\n Object.defineProperty(Container.prototype, \"fontFamily\", {\r\n /**\r\n * @return Font family\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"fontFamily\");\r\n },\r\n /**\r\n * Font family to be used for the text.\r\n *\r\n * Parts of the text may override this setting using in-line formatting.\r\n *\r\n * @param value Font family value\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"fontFamily\", value, true)) {\r\n this.setSVGAttribute({ \"font-family\": value });\r\n this.invalidateLabels();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Container.prototype, \"fontSize\", {\r\n /**\r\n * @return Font size\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"fontSize\");\r\n },\r\n /**\r\n * Font size to be used for the text. The size can either be numeric, in\r\n * pixels, or other measurements.\r\n *\r\n * Parts of the text may override this setting using in-line formatting.\r\n *\r\n * @param value Font size value\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"fontSize\", value, true)) {\r\n this.setSVGAttribute({ \"font-size\": value });\r\n this.invalidateLabels();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * When fontSize of fontFamily changes we need to hard-invalidate all Labels of this container to position them properly.\r\n */\r\n Container.prototype.invalidateLabels = function () {\r\n this.children.each(function (child) {\r\n // can't import Label because of Circular dependencies\r\n if (child[\"hardInvalidate\"]) {\r\n child[\"hardInvalidate\"]();\r\n // this fixes firefox and viewport issue\r\n child.events.once(\"validated\", child.handleValidate, child, false);\r\n }\r\n else if (child instanceof Container) {\r\n child.invalidateLabels();\r\n }\r\n });\r\n };\r\n Object.defineProperty(Container.prototype, \"fontWeight\", {\r\n /**\r\n * @return Font weight\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"fontWeight\");\r\n },\r\n /**\r\n * Font weight to use for text.\r\n *\r\n * Parts of the text may override this setting using in-line formatting.\r\n *\r\n * @param value Font weight\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"fontWeight\", value);\r\n this.setSVGAttribute({ \"font-weight\": value });\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Container.prototype, \"textDecoration\", {\r\n /**\r\n * @return Decoration\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"textDecoration\");\r\n },\r\n /**\r\n * A text decoration to use for text.\r\n *\r\n * Parts of the text may override this setting using in-line formatting.\r\n *\r\n * @param value Decoration\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"textDecoration\", value);\r\n this.setSVGAttribute({ \"text-decoration\": value });\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Disposes (destroys) the element and all its children.\r\n */\r\n Container.prototype.dispose = function () {\r\n if (this._background) {\r\n this._background.dispose();\r\n }\r\n this._shouldBeReady = [];\r\n this.disposeChildren();\r\n _super.prototype.dispose.call(this);\r\n };\r\n /**\r\n * Applies a [[SpriteState]] on this element.\r\n *\r\n * The first parameter can either be a name of the state or a [[SpriteState]]\r\n * instance.\r\n *\r\n * When run, this method will apply SVG properties defined in a\r\n * [[SpriteState]], but only those that are relevant to this particular\r\n * element, that is are listed in its respective `properties` array.\r\n *\r\n * @see {@link SpriteState}\r\n * @param value A state - name key or instance\r\n * @param transitionDuration Duration of the transition between current and new state\r\n * @param easing An easing function\r\n */\r\n Container.prototype.setState = function (value, transitionDuration, easing) {\r\n var stateName = value;\r\n if (value instanceof SpriteState) {\r\n stateName = value.name;\r\n }\r\n if (this.setStateOnChildren) {\r\n $iter.each(this.children.iterator(), function (child) {\r\n child.setState(stateName, transitionDuration, easing);\r\n // not good to set it in child setState\r\n if (stateName != \"active\") {\r\n child.isActive = false;\r\n }\r\n });\r\n }\r\n if (this._background) {\r\n this._background.setState(stateName);\r\n }\r\n if (this.setStateOnSprites.length) {\r\n $array.each(this.setStateOnSprites, function (item) {\r\n item.setState(stateName, transitionDuration, easing);\r\n });\r\n }\r\n return _super.prototype.setState.call(this, value, transitionDuration, easing);\r\n };\r\n // otherwise isActive won't work properly with background\r\n Container.prototype.setActive = function (value) {\r\n _super.prototype.setActive.call(this, value);\r\n if (this._background) {\r\n this._background.isActive = value;\r\n }\r\n };\r\n /**\r\n * Dispatches ready event. Dispatches when all children are ready.\r\n */\r\n Container.prototype.dispatchReady = function () {\r\n var _this = this;\r\n if (!this.isReady() && !this.isDisposed()) {\r\n var allReady_1 = true;\r\n $iter.eachContinue(this.children.iterator(), function (sprite) {\r\n if (!sprite.__disabled && !sprite.disabled && !sprite.isReady()) {\r\n allReady_1 = false;\r\n return false;\r\n }\r\n else {\r\n return true;\r\n }\r\n });\r\n $array.eachContinue(this._shouldBeReady, function (sprite) {\r\n if (!sprite.__disabled && !sprite.disabled && !sprite.isReady()) {\r\n allReady_1 = false;\r\n return false;\r\n }\r\n else {\r\n return true;\r\n }\r\n });\r\n if (allReady_1) {\r\n _super.prototype.dispatchReady.call(this);\r\n }\r\n else {\r\n registry.events.once(\"exitframe\", function () {\r\n _this.dispatchReady();\r\n system.requestFrame();\r\n }, undefined, false);\r\n }\r\n }\r\n };\r\n /**\r\n * Called during the System.update method\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Container.prototype._systemUpdate = function (skippedSprites) {\r\n this.children.each(function (child) {\r\n if (child.invalid) {\r\n if (!child._systemCheckIfValidate()) {\r\n skippedSprites.push(child);\r\n }\r\n else if (child.dataItem && child.dataItem.component && child.dataItem.component.dataInvalid) {\r\n skippedSprites.push(child);\r\n }\r\n else {\r\n child.validate();\r\n }\r\n }\r\n });\r\n _super.prototype._systemUpdate.call(this, skippedSprites);\r\n };\r\n /**\r\n * Called during the System.validatePositions method\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Container.prototype._systemValidatePositions = function () {\r\n this.children.each(function (sprite) {\r\n if (sprite.positionInvalid) {\r\n sprite.validatePosition();\r\n }\r\n });\r\n _super.prototype._systemValidatePositions.call(this);\r\n };\r\n /**\r\n * Called during the System.validateLayouts method\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Container.prototype._systemValidateLayouts = function () {\r\n if (this.layoutInvalid && !this.isDisposed()) {\r\n this.validateLayout();\r\n }\r\n };\r\n Object.defineProperty(Container.prototype, \"tapToActivate\", {\r\n /**\r\n * @return Enable touch protection?\r\n */\r\n get: function () {\r\n return this._tapToActivate;\r\n },\r\n /**\r\n * If set to `true` the chart's regular touch functionality will be suspended\r\n * so that the whole page it is located in remains scrollable, even when\r\n * swiping over the chart's body.\r\n *\r\n * User will need to tap the chart in order to activate its regular touch\r\n * functionality.\r\n *\r\n * The chart will remain \"active\" as long as user keeps interacting with the\r\n * chart. After `tapTimeout` milliseconds the chart will return to its\r\n * \"protected\" mode.\r\n *\r\n * @default false\r\n * @since 4.4.0\r\n * @param value Enable touch protection?\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/touch/} For more information.\r\n */\r\n set: function (value) {\r\n if (this._tapToActivate != value) {\r\n this.setTapToActivate(value);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Container.prototype.setTapToActivate = function (value) {\r\n var _this = this;\r\n this._tapToActivate = value;\r\n this.interactions.isTouchProtected = value;\r\n // setEventDisposer will also remove listeners if value == false\r\n if (value) {\r\n this.interactions.setEventDisposer(\"container-tapToActivate\", value, function () { return new MultiDisposer([\r\n _this.events.on(\"hit\", _this.handleTapToActivate, _this, false),\r\n _this.events.on(\"down\", _this.initTapTimeout, _this, false),\r\n _this.events.on(\"track\", _this.initTapTimeout, _this, false),\r\n //this.events.on(\"drag\", this.initTapTimeout, this, false),\r\n getInteraction().body.events.on(\"down\", function (ev) {\r\n if (!getInteraction().isLocalElement(ev.pointer, _this.paper.svg, _this.uid)) {\r\n _this.handleTapToActivateDeactivation();\r\n }\r\n }, _this, false)\r\n ]); });\r\n }\r\n getInteraction();\r\n };\r\n /**\r\n * @todo Ignore on non-touch events\r\n */\r\n Container.prototype.handleTapToActivate = function () {\r\n this.interactions.isTouchProtected = false;\r\n this.initTapTimeout();\r\n };\r\n Container.prototype.handleTapToActivateDeactivation = function () {\r\n this.interactions.isTouchProtected = true;\r\n };\r\n Container.prototype.initTapTimeout = function () {\r\n var _this = this;\r\n if (this._tapToActivateTimeout) {\r\n this._tapToActivateTimeout.dispose();\r\n }\r\n if (this.tapToActivate && !this.interactions.isTouchProtected && this.tapTimeout) {\r\n this._tapToActivateTimeout = this.setTimeout(function () {\r\n _this.handleTapToActivateDeactivation();\r\n }, this.tapTimeout);\r\n }\r\n };\r\n /**\r\n * Moves the whole chart to other HTML container.\r\n *\r\n * `htmlElement` can either be a reference to a DOM element, or an id of\r\n * such element.\r\n *\r\n * @since 4.9.24\r\n * @param htmlElement Target element\r\n */\r\n Container.prototype.moveHtmlContainer = function (htmlElement) {\r\n var newContainer = $dom.getElement(htmlElement);\r\n if (newContainer) {\r\n this.htmlContainer = newContainer;\r\n var svgDiv = this.svgContainer;\r\n svgDiv.htmlElement = newContainer;\r\n svgDiv.htmlElement.appendChild(svgDiv.SVGContainer);\r\n svgDiv.initSensor();\r\n svgDiv.measure();\r\n }\r\n else if ($type.isString(htmlElement) && htmlElement != \"\") {\r\n system.log(\"html container '\" + htmlElement + \"' not found\");\r\n //throw new Error(\"html container not found\");\r\n }\r\n };\r\n /**\r\n * @ignore\r\n * @return Has license?\r\n */\r\n Container.prototype.hasLicense = function () {\r\n if (options.commercialLicense) {\r\n return true;\r\n }\r\n for (var i = 0; i < options.licenses.length; i++) {\r\n if (options.licenses[i].match(/^CH.{5,}/i)) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n };\r\n return Container;\r\n}(Sprite));\r\nexport { Container };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Container\"] = Container;\r\n","/**\r\n * Defines functionality for \"Data Item\"\r\n *\r\n * A Data Item can be any object that can hold data. For example [[LineSeries]]\r\n * holds a number of values, that comprise a line graph. Each of those values\r\n * (data points) is a {DataItem}.\r\n *\r\n * Furthermore the [[LineSeries]] itself can be represented as a entry in the\r\n * legend. Since legend needs access to Line Series' value, a DataItem is\r\n * created for the series.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { BaseObjectEvents } from \"./Base\";\r\nimport { Adapter } from \"./utils/Adapter\";\r\nimport { Animation, AnimationDisposer } from \"./utils/Animation\";\r\nimport * as $utils from \"./utils/Utils\";\r\nimport * as $array from \"./utils/Array\";\r\n//import * as $object from \"./utils/Object\";\r\nimport * as $type from \"./utils/Type\";\r\n/**\r\n * ============================================================================\r\n * DATA ITEM\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * DataItem represents single element in data, for example a data point in a\r\n * Serial Chart Series, e.g. a column.\r\n *\r\n * DataItem defines relationship between structured data, required for specific\r\n * chart type or task, and raw source data.\r\n *\r\n * It also implements required calculations, updates related visual elements,\r\n * etc.\r\n *\r\n * @todo Description\r\n * @important\r\n */\r\nvar DataItem = /** @class */ (function (_super) {\r\n __extends(DataItem, _super);\r\n /**\r\n * Constructor\r\n * @todo Adding events to disposers produces errors in some cases, which means that chart is using disposed Data Items which is not right\r\n */\r\n function DataItem() {\r\n var _this = _super.call(this) || this;\r\n /**\r\n * This Data Item is currently disabled.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this._disabled = false;\r\n /**\r\n * Indicates whether Data Item has any properties set.\r\n *\r\n * If it does not have any, the code can use this property to check whether\r\n * they need to apply costly operation of re-applying properties, whenever\r\n * Data Item-related element is redrawn, e.g. series.\r\n */\r\n _this.hasProperties = false;\r\n /**\r\n * An object containing calculated values.\r\n */\r\n _this.values = {};\r\n /**\r\n * An object container current working values.\r\n */\r\n //public readonly workingValues: { [index: string]: { [index: string]: number } } = {};\r\n /**\r\n * An object containing categories.\r\n */\r\n _this.categories = {};\r\n /**\r\n * An object containing dates.\r\n */\r\n _this.dates = {};\r\n /**\r\n * An object containing locations for the Data Item.\r\n *\r\n * A location is a position within date or category, or, in some other cases,\r\n * where there is no single point but rather some period.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/series/#Data_item_locations} for info how data item locations work\r\n */\r\n _this.locations = {};\r\n /**\r\n * Current working locations.\r\n */\r\n _this.workingLocations = {};\r\n /**\r\n * An object containing Data Item specific appearance properties in key-value\r\n * pairs.\r\n *\r\n * Sometimes a single Data Item needs to apply different properties than the\r\n * rest of the data [[Series]] it is part of. E.g. a single column,\r\n * represented by a Data Item needs to be filled with a different color than\r\n * the reset of the [[ColumnSeries]] it belongs to.\r\n *\r\n * That's where Data Item's `properties` come into play.\r\n *\r\n * Please note that you should set Data Item-specific properties using\r\n * `setProperty()` method, rather than access `properties` object directly.\r\n */\r\n _this.properties = {};\r\n /**\r\n * A list of [[Sprite]] elements that are associated with this Data Item.\r\n *\r\n * E.g. an [[Axis]] Data Item has several separate elements associated with\r\n * it, like [[AxisTick]], [[AxisLabel]], and [[Grid]].\r\n *\r\n * Data Item keeps track of all of them, so it can toggle all related visual\r\n * elements when it itself is toggled.\r\n */\r\n _this.sprites = [];\r\n /**\r\n * Identifies if this object is a \"template\" and should not be treated as\r\n * real object that is drawn or actually used in the chart.\r\n */\r\n _this.isTemplate = false;\r\n /**\r\n * The current index within the dataItems\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this._index = null;\r\n /**\r\n * Is Data Item currently visible?\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this._visible = true;\r\n /**\r\n * Is Data Item currently hidden?\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this._hidden = false;\r\n /**\r\n * Should this Data Item be used when calculating data ranges and scales?\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this._ignoreMinMax = false;\r\n /**\r\n * Some of the Data Item's data fields may contain an array of children. This\r\n * property contains an object indicating which fields hold an array, so that\r\n * they can be processed properly.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this.hasChildren = {};\r\n /**\r\n * Indicates whether Data Item is currently animiting from visible to hidden\r\n * state.\r\n */\r\n _this.isHiding = false;\r\n /**\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this._valueAnimations = {};\r\n /**\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this._locationAnimations = {};\r\n _this.className = \"DataItem\";\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n Object.defineProperty(DataItem.prototype, \"adapter\", {\r\n /**\r\n * Holds Adapter.\r\n */\r\n get: function () {\r\n if (!this._adapterO) {\r\n this._adapterO = new Adapter(this);\r\n }\r\n return this._adapterO;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DataItem.prototype, \"index\", {\r\n /**\r\n * Data Item's position index in Component's data.\r\n *\r\n * @return Index\r\n */\r\n get: function () {\r\n if (this.component) {\r\n if (this._index != null) {\r\n return this._index;\r\n }\r\n else {\r\n return -1;\r\n }\r\n }\r\n else {\r\n return -1;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DataItem.prototype, \"animations\", {\r\n /**\r\n * A list of [[Animations]] objects currently mutating Data Item's values.\r\n *\r\n * @return [description]\r\n */\r\n get: function () {\r\n if (!this._animations) {\r\n this._animations = [];\r\n this._disposers.push(new AnimationDisposer(this._animations));\r\n }\r\n return this._animations;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DataItem.prototype, \"visible\", {\r\n /**\r\n * Returns `true` if this Data Item is currently visible.\r\n *\r\n * @return Visible?\r\n */\r\n get: function () {\r\n if (this._hidden) {\r\n return false;\r\n }\r\n return this._visible;\r\n },\r\n /**\r\n * Sets visibility of the Data Item.\r\n *\r\n * @param value Visible?\r\n */\r\n set: function (value) {\r\n if (value) {\r\n this.hidden = false;\r\n }\r\n if (this._visible != value) {\r\n this.setVisibility(value);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DataItem.prototype, \"hidden\", {\r\n /**\r\n * Returns `true` if this Data Item is currently hidden.\r\n *\r\n * @return Hidden?\r\n */\r\n get: function () {\r\n return this._hidden;\r\n },\r\n /**\r\n * Sets hidden flag for data item. Mostly used to initially hide data item.\r\n *\r\n * @param value Hidden?\r\n */\r\n set: function (value) {\r\n if (this._hidden != value) {\r\n this._hidden = value;\r\n if (value) {\r\n this.setVisibility(false);\r\n }\r\n else {\r\n this.setVisibility(true, true);\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DataItem.prototype, \"__disabled\", {\r\n /**\r\n * Is this Data Item currently disabled?\r\n *\r\n * @ignore Exclude from docs\r\n * @param {boolean}\r\n */\r\n get: function () {\r\n return this._disabled;\r\n },\r\n /**\r\n * Disables all Sprites associated with this Data Item.\r\n *\r\n * @ignore Exclude from docs\r\n * @param {boolean}\r\n */\r\n set: function (value) {\r\n //\tif (this._disabled != value) { // not good\r\n this._disabled = value;\r\n $array.each(this.sprites, function (sprite) {\r\n sprite.__disabled = value;\r\n });\r\n //\t}\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Sets visibility of the Data Item.\r\n *\r\n * @param value Data Item\r\n */\r\n DataItem.prototype.setVisibility = function (value, noChangeValues) {\r\n $array.each(this.sprites, function (sprite) {\r\n if (value) {\r\n sprite.visible = sprite.defaultState.properties.visible;\r\n }\r\n else {\r\n if (sprite.hiddenState) {\r\n sprite.visible = sprite.hiddenState.properties.visible;\r\n }\r\n else {\r\n sprite.visible = false;\r\n }\r\n }\r\n });\r\n this._visible = value;\r\n if (this._eventDispatcher && !this.__disabled) {\r\n if (this.events.isEnabled(\"visibilitychanged\")) {\r\n var event_1 = {\r\n type: \"visibilitychanged\",\r\n target: this,\r\n visible: value\r\n };\r\n this.events.dispatchImmediately(\"visibilitychanged\", event_1);\r\n }\r\n }\r\n };\r\n /**\r\n * Shows the Data Item and related visual elements.\r\n *\r\n * @param duration Animation duration (ms)\r\n * @param delay Delay animation (ms)\r\n * @param fields A list of fields to set values of\r\n */\r\n DataItem.prototype.show = function (duration, delay, fields) {\r\n var _this = this;\r\n if (!this.hidden) {\r\n this.setVisibility(true, true);\r\n this.isHiding = false;\r\n if (this._hideDisposer) {\r\n this.removeDispose(this._hideDisposer);\r\n }\r\n var animation_1;\r\n if (fields) {\r\n $array.each(fields, function (field) {\r\n animation_1 = _this.setWorkingValue(field, _this.values[field].value, duration, delay);\r\n });\r\n }\r\n $array.each(this.sprites, function (sprite) {\r\n var animation = sprite.show(duration);\r\n if (animation != null && !animation.isFinished()) {\r\n _this._disposers.push(animation);\r\n if (delay != null && delay > 0) {\r\n animation.delay(delay);\r\n }\r\n }\r\n });\r\n return animation_1;\r\n }\r\n };\r\n /**\r\n * Destroys this object and all related data.\r\n */\r\n DataItem.prototype.dispose = function () {\r\n _super.prototype.dispose.call(this);\r\n $array.each(this.sprites, function (sprite) {\r\n sprite.dispose();\r\n });\r\n this.sprites = [];\r\n };\r\n /**\r\n * Hides the Data Item and related visual elements.\r\n *\r\n * @param duration Animation duration (ms)\r\n * @param delay Delay animation (ms)\r\n * @param toValue A value to set to `fields` when hiding\r\n * @param fields A list of data fields to set value to `toValue`\r\n */\r\n DataItem.prototype.hide = function (duration, delay, toValue, fields) {\r\n var _this = this;\r\n this.isHiding = true;\r\n $array.each(this.sprites, function (sprite) {\r\n var animation = sprite.hide(duration);\r\n if (animation != null && !animation.isFinished()) {\r\n _this._disposers.push(animation);\r\n if (delay != null && delay > 0) {\r\n animation.delay(delay);\r\n }\r\n }\r\n });\r\n if ($type.isNumber(toValue) && fields) {\r\n var animation_2;\r\n $array.each(fields, function (field) {\r\n var anim = _this.setWorkingValue(field, toValue, duration, delay);\r\n if (anim) {\r\n animation_2 = anim;\r\n }\r\n });\r\n if (animation_2 && !animation_2.isFinished()) {\r\n this._hideDisposer = animation_2.events.on(\"animationended\", function () {\r\n _this.setVisibility(false, true);\r\n _this.isHiding = false;\r\n });\r\n this._disposers.push(this._hideDisposer);\r\n return animation_2;\r\n }\r\n else {\r\n this.isHiding = false;\r\n this.setVisibility(false, true);\r\n }\r\n }\r\n else {\r\n this.isHiding = false;\r\n this.setVisibility(false);\r\n }\r\n };\r\n /**\r\n * Returns a duration (ms) the Data Item should take to animate from one\r\n * value to another.\r\n *\r\n * If the duration is not specified via parameter, this method will try to\r\n * request a default duration from the related `Component`.\r\n *\r\n * @param duration Default duration (ms)\r\n * @return Duration (ms)\r\n */\r\n DataItem.prototype.getDuration = function (duration) {\r\n if (!$type.isNumber(duration)) {\r\n var component = this.component;\r\n if (component) {\r\n duration = component.interpolationDuration;\r\n }\r\n }\r\n if (duration != null) {\r\n if (!this._adapterO) {\r\n return duration;\r\n }\r\n else {\r\n return this._adapterO.apply(\"duration\", duration);\r\n }\r\n }\r\n };\r\n /**\r\n * Returns a numeric value for specific data field.\r\n *\r\n * If `calculated` is not set, it will return a raw value, as it is in\r\n * source data.\r\n *\r\n * If `calculated` is set, it will return a pre-calculated specific value.\r\n *\r\n * @param name Data field name\r\n * @param calculated A calculated value name\r\n * @return Value\r\n */\r\n DataItem.prototype.getValue = function (name, calculated) {\r\n if (name && this.component) {\r\n if (!calculated) {\r\n calculated = this.component.dataFields[name + \"Show\"];\r\n if (!calculated) {\r\n calculated = \"value\";\r\n }\r\n }\r\n var value = this.values[name][calculated];\r\n if (this._adapterO && this._adapterO.isEnabled(\"value\")) {\r\n return this._adapterO.apply(\"value\", {\r\n value: value,\r\n field: name\r\n }).value;\r\n }\r\n else {\r\n return value;\r\n }\r\n }\r\n };\r\n /**\r\n * Returns a current working value for a specific data field.\r\n *\r\n * The actual value may differ from the one returned by `getValue()`. The\r\n * latter returns static values from the data source.\r\n *\r\n * `getWorkingValue()` returns current value, which is usually different if\r\n * Data Item is animating from one state to another.\r\n *\r\n * @param name Data field name\r\n * @return Value\r\n */\r\n DataItem.prototype.getWorkingValue = function (name) {\r\n if (name && this.component) {\r\n var realName = this.component.dataFields[name + \"Show\"];\r\n if (!realName) {\r\n realName = \"workingValue\";\r\n }\r\n if (this._adapterO) {\r\n return this._adapterO.apply(\"workingValue\", {\r\n workingValue: this.values[name][realName],\r\n field: name\r\n }).workingValue;\r\n }\r\n else {\r\n return this.values[name][realName];\r\n }\r\n }\r\n };\r\n /**\r\n * @ignore\r\n * @return Value\r\n */\r\n DataItem.prototype.getActualWorkingValue = function (name) {\r\n return this.values[name].workingValue;\r\n };\r\n /**\r\n * Sets a numeric value for specific data field.\r\n *\r\n * @param name Data field name\r\n * @param value Value\r\n * @param calculated Calculated data field name\r\n * @param duration Duration (ms) to animate to new value to\r\n * @param delay Delay animation (ms)\r\n */\r\n DataItem.prototype.setValue = function (name, value, duration, delay) {\r\n var currentValue = this.values[name].value;\r\n var newDuration = this.getDuration(duration);\r\n value = $type.toNumber(value);\r\n if (currentValue !== value) {\r\n this.values[name].value = value;\r\n if (this._eventDispatcher && !this.__disabled) {\r\n if (this.events.isEnabled(\"valuechanged\")) {\r\n var event_2 = {\r\n type: \"valuechanged\",\r\n target: this,\r\n property: name\r\n };\r\n this.events.dispatchImmediately(\"valuechanged\", event_2);\r\n }\r\n }\r\n if (this.component) {\r\n this.component.handleDataItemValueChange(this, name);\r\n }\r\n }\r\n this.setWorkingValue(name, value, newDuration, delay);\r\n };\r\n DataItem.prototype.setCalculatedValue = function (name, value, calculated) {\r\n var currentValue = this.values[name][calculated];\r\n if (currentValue !== value && $type.isNumber(value)) {\r\n this.values[name][calculated] = value;\r\n if (this._eventDispatcher && !this.__disabled) {\r\n if (this.events.isEnabled(\"calculatedvaluechanged\")) {\r\n var event_3 = {\r\n type: \"calculatedvaluechanged\",\r\n target: this,\r\n property: name\r\n };\r\n this.events.dispatchImmediately(\"calculatedvaluechanged\", event_3);\r\n }\r\n }\r\n if (this.component) {\r\n this.component.handleDataItemCalculatedValueChange(this, name);\r\n }\r\n }\r\n };\r\n /**\r\n * Set current working numeric value for a specific data field.\r\n *\r\n * @param name Data field name\r\n * @param value Value\r\n * @param calculated Calculated data field name\r\n * @param duration Duration (ms) to animate to new value to\r\n * @param delay Delay animation (ms)\r\n * @return An [[Animation]] object used for transition to new values\r\n */\r\n DataItem.prototype.setWorkingValue = function (name, value, duration, delay) {\r\n if ($type.isNumber(this.values[name].value)) {\r\n var newDuration = this.getDuration(duration);\r\n var workingValue = this.values[name].workingValue;\r\n if (newDuration != null && newDuration > 0 && $type.isNumber(workingValue) && this.component) { // sometimes NaN is passed, so only change this to != null if all cases of NaN are handled, otherwise animation won't stop\r\n if (workingValue != value) {\r\n var animation = this.animate({ childObject: this.values[name], property: \"workingValue\", from: workingValue, to: value, dummyData: name }, newDuration, this.component.interpolationEasing);\r\n if (delay != null) {\r\n animation.delay(delay);\r\n }\r\n animation.events.on(\"animationstarted\", this.handleInterpolationProgress, this);\r\n animation.events.on(\"animationprogress\", this.handleInterpolationProgress, this);\r\n animation.events.on(\"animationended\", this.handleInterpolationProgress, this);\r\n this._valueAnimations[name] = animation;\r\n return animation;\r\n }\r\n else {\r\n var valueAnimation = this._valueAnimations[name];\r\n if (valueAnimation) {\r\n valueAnimation.stop();\r\n }\r\n this.values[name].workingValue = value;\r\n }\r\n }\r\n else {\r\n var valueAnimation = this._valueAnimations[name];\r\n if (valueAnimation) {\r\n valueAnimation.stop();\r\n }\r\n this.values[name].workingValue = value;\r\n if (this._eventDispatcher && !this.__disabled) {\r\n if (this.events.isEnabled(\"workingvaluechanged\")) {\r\n var event_4 = {\r\n type: \"workingvaluechanged\",\r\n target: this,\r\n property: name\r\n };\r\n this.events.dispatchImmediately(\"workingvaluechanged\", event_4);\r\n }\r\n }\r\n if (this.component) {\r\n this.component.handleDataItemWorkingValueChange(this, name);\r\n }\r\n }\r\n }\r\n };\r\n /**\r\n * Sets a relative location for a data field.\r\n *\r\n * A location is always relative on a 0 to 1 scale, with 0 being beginning,\r\n * 0.5 middle and 1 end.\r\n *\r\n * @todo Rewiew description\r\n * @param name Data field name\r\n * @param value Location (0-1)\r\n * @param duration Duration (ms) to animate to new value to\r\n * @param delay Delay animation (ms)\r\n */\r\n DataItem.prototype.setLocation = function (name, value, duration, delay) {\r\n var currentLocation = this.locations[name];\r\n if (currentLocation !== value) {\r\n this.locations[name] = value;\r\n if (this._eventDispatcher && !this.__disabled) {\r\n if (this.events.isEnabled(\"locationchanged\")) {\r\n var event_5 = {\r\n type: \"locationchanged\",\r\n target: this,\r\n property: name\r\n };\r\n this.events.dispatchImmediately(\"locationchanged\", event_5);\r\n }\r\n }\r\n if (this.component) {\r\n this.component.handleDataItemValueChange(this, name); // correct\r\n }\r\n this.setWorkingLocation(name, value, duration, delay);\r\n }\r\n };\r\n /**\r\n * Sets a current working location for a data field.\r\n *\r\n * @todo Rewiew description\r\n * @param name Data field name\r\n * @param value Location (0-1)\r\n * @param duration Duration (ms) to animate to new value to\r\n * @param delay Delay animation (ms)\r\n */\r\n DataItem.prototype.setWorkingLocation = function (name, value, duration, delay) {\r\n var newDuration = this.getDuration(duration);\r\n var workingLocation = this.workingLocations[name];\r\n if (newDuration != null && newDuration > 0 && $type.isNumber(workingLocation) && this.component) { // sometimes NaN is passed, so only change this to != null if all cases of NaN are handled, otherwise animation won't stop\r\n if (workingLocation != value) {\r\n var animation = this.animate({ childObject: this.workingLocations, property: name, from: workingLocation, to: value, dummyData: name }, newDuration, this.component.interpolationEasing);\r\n if (delay != null) {\r\n animation.delay(delay);\r\n }\r\n animation.events.on(\"animationstarted\", this.handleInterpolationProgress, this);\r\n animation.events.on(\"animationprogress\", this.handleInterpolationProgress, this);\r\n animation.events.on(\"animationended\", this.handleInterpolationProgress, this);\r\n this._locationAnimations[name] = animation;\r\n return animation;\r\n }\r\n else {\r\n var locationAnimation = this._locationAnimations[name];\r\n if (locationAnimation) {\r\n locationAnimation.stop();\r\n }\r\n this.workingLocations[name] = value;\r\n }\r\n }\r\n else {\r\n var locationAnimation = this._locationAnimations[name];\r\n if (locationAnimation) {\r\n locationAnimation.stop();\r\n }\r\n this.workingLocations[name] = value;\r\n if (this._eventDispatcher && !this.__disabled) {\r\n if (this.events.isEnabled(\"workinglocationchanged\")) {\r\n var event_6 = {\r\n type: \"workinglocationchanged\",\r\n target: this,\r\n property: name\r\n };\r\n this.events.dispatchImmediately(\"workinglocationchanged\", event_6);\r\n }\r\n }\r\n if (this.component) {\r\n this.component.handleDataItemWorkingLocationChange(this, name);\r\n }\r\n }\r\n };\r\n /**\r\n * Sets Date value to a data field.\r\n *\r\n * @param name Data field name\r\n * @param date Date object\r\n * @param duration Duration (ms) to animate to new value to\r\n */\r\n DataItem.prototype.setDate = function (name, date, duration) {\r\n if (!$type.isDate(date) && this.component) {\r\n date = this.component.dateFormatter.parse(date);\r\n }\r\n var currentDate = this.dates[name];\r\n if (currentDate !== date) {\r\n this.dates[name] = date;\r\n this.setValue(name, date.getTime(), duration);\r\n }\r\n };\r\n /**\r\n * Returns a Date value of the data field.\r\n *\r\n * @param name Data field name\r\n * @return Date object\r\n */\r\n DataItem.prototype.getDate = function (name) {\r\n if (this._adapterO) {\r\n return this._adapterO.apply(\"date\", {\r\n date: this.dates[name],\r\n field: name\r\n }).date;\r\n }\r\n else {\r\n return this.dates[name];\r\n }\r\n };\r\n /**\r\n * Sets a Data Item-specific visual properties to apply to related elements.\r\n *\r\n * @param name Property name\r\n * @param value Property value\r\n */\r\n DataItem.prototype.setProperty = function (name, value) {\r\n if (this.properties[name] !== value) {\r\n this.hasProperties = true;\r\n this.properties[name] = value;\r\n if (this._eventDispatcher && !this.__disabled) {\r\n if (this.events.isEnabled(\"propertychanged\")) {\r\n var event_7 = {\r\n type: \"propertychanged\",\r\n target: this,\r\n property: name,\r\n value: value\r\n };\r\n this.events.dispatchImmediately(\"propertychanged\", event_7);\r\n }\r\n }\r\n if (this.component) {\r\n this.component.handleDataItemPropertyChange(this, name);\r\n }\r\n }\r\n };\r\n /**\r\n * Sets a related category for this Data Item.\r\n *\r\n * @todo Review description\r\n * @param name Data field name\r\n * @param value Category\r\n */\r\n DataItem.prototype.setCategory = function (name, value) {\r\n if (!$type.isString(value)) {\r\n value = $type.castString(value);\r\n }\r\n if (this.categories[name] !== value) {\r\n this.categories[name] = value;\r\n }\r\n };\r\n /**\r\n * Clones the Data Item, including all related data.\r\n *\r\n * @return New Data Item clone\r\n */\r\n //public clone(cloneId?: string): this {\r\n //\tlet dataItem: this = super.clone(cloneId);\r\n //\tdataItem.copyFrom(this);\r\n //\treturn dataItem;\r\n //}\r\n /**\r\n * Copies all properties and related data from different data item.\r\n *\r\n * @param object Source data item\r\n */\r\n DataItem.prototype.copyFrom = function (source) {\r\n _super.prototype.copyFrom.call(this, source);\r\n if (source.dataContext) {\r\n this.dataContext = $utils.copy(source.dataContext, {});\r\n }\r\n $utils.copyProperties(source.locations, this.locations);\r\n /*\r\n $utils.copyProperties(source.properties, this.properties);\r\n $utils.copyProperties(source.categories, this.categories);\r\n $utils.copyProperties(source.values, this.values);\r\n $utils.copyProperties(source.dates, this.dates);\r\n\r\n $object.each(source.values, (name, value) => {\r\n this.values[name] = $object.copy(value);\r\n });*/\r\n if (source._adapterO) {\r\n this.adapter.copyFrom(source._adapterO);\r\n }\r\n //this.events.copyFrom(source.events); // because copied in Base\r\n this.component = source.component;\r\n };\r\n Object.defineProperty(DataItem.prototype, \"opacity\", {\r\n /**\r\n * Sets opacity for all Data Item's related elements (Sprites).\r\n *\r\n * @param value Opacity (0-1)\r\n */\r\n set: function (value) {\r\n $array.each(this.sprites, function (sprite) {\r\n sprite.opacity = value;\r\n });\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DataItem.prototype, \"ignoreMinMax\", {\r\n /**\r\n * Exclude from min/max calculations?\r\n * @return Exclude from min/max calculations?\r\n */\r\n get: function () {\r\n return this._ignoreMinMax;\r\n },\r\n /**\r\n * Sets whether this data point should not be included in the scale and\r\n * minimum/maximum calculations.\r\n *\r\n * E.g. some we may want to exclude a particular data point from influencing\r\n * [[ValueAxis]] scale.\r\n *\r\n * @param value Exclude from min/max calculations?\r\n */\r\n set: function (value) {\r\n this._ignoreMinMax = value;\r\n if (this._eventDispatcher && !this.__disabled) {\r\n if (this.events.isEnabled(\"propertychanged\")) {\r\n var event_8 = {\r\n type: \"propertychanged\",\r\n target: this,\r\n property: \"ignoreMinMax\",\r\n value: value\r\n };\r\n this.events.dispatchImmediately(\"propertychanged\", event_8);\r\n }\r\n }\r\n if (this.component) {\r\n this.component.handleDataItemPropertyChange(this, \"ignoreMinMax\");\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Creates and starts an [[Animation]] to interpolate (morph) Data Item's\r\n * properties and/or values.\r\n *\r\n * @see {@link Animation}\r\n * @param animationOptions Animation options\r\n * @param duration Animation duration (ms)\r\n * @param easing Easing function\r\n * @return Animation\r\n */\r\n DataItem.prototype.animate = function (animationOptions, duration, easing) {\r\n return new Animation(this, animationOptions, duration, easing).start();\r\n };\r\n /**\r\n * Handles intermediate steps when Data Item is interpolating (morphing) from\r\n * one value to another.\r\n *\r\n * @ignore Exclude from docs\r\n * @param event Event object\r\n */\r\n DataItem.prototype.handleInterpolationProgress = function (event) {\r\n var animation = event.target;\r\n // it's always only one options, no need cycle\r\n var animationOptions = animation.animationOptions[0];\r\n if (animationOptions) {\r\n if (this._eventDispatcher && !this.__disabled) {\r\n if (this.events.isEnabled(\"workingvaluechanged\")) {\r\n var event_9 = {\r\n type: \"workingvaluechanged\",\r\n target: this,\r\n property: animationOptions.dummyData\r\n };\r\n this.events.dispatchImmediately(\"workingvaluechanged\", event_9);\r\n }\r\n }\r\n if (this.component) {\r\n this.component.handleDataItemWorkingValueChange(this, animationOptions.dummyData);\r\n }\r\n }\r\n };\r\n /**\r\n * Checks whether Data Item has values set for all of the data fields,\r\n * supplied via argument.\r\n *\r\n * @ignore Exclude from docs\r\n * @param fields Field list to check\r\n * @return Has values for all fields?\r\n */\r\n DataItem.prototype.hasValue = function (fields) {\r\n // todo: what about categories?\r\n for (var i = 0, len = fields.length; i < len; i++) {\r\n var values = this.values[fields[i]];\r\n if (!values || !$type.hasValue(values.value)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n };\r\n Object.defineProperty(DataItem.prototype, \"depth\", {\r\n /**\r\n * Depth of the Data Item.\r\n *\r\n * In nested data structures, like TreeMap, this indicates the level this\r\n * data point is at, in relation to the parent Data Item.\r\n *\r\n * @return Depth\r\n */\r\n get: function () {\r\n if (!this.parent) {\r\n return 0;\r\n }\r\n else {\r\n return this.parent.depth + 1;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DataItem.prototype, \"dataContext\", {\r\n /**\r\n * Sets to a reference to an original object from Component's data.\r\n *\r\n * @return [description]\r\n */\r\n get: function () {\r\n return this._dataContext;\r\n },\r\n /**\r\n * A reference to an original object in Component's data, that this Data Item\r\n * is derived from.\r\n *\r\n * @param value Original data object\r\n */\r\n set: function (value) {\r\n this._dataContext = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * adds a sprite to dataItem.sprites array\r\n * @ignore\r\n */\r\n DataItem.prototype.addSprite = function (sprite) {\r\n if (sprite.dataItem && sprite.dataItem != this) {\r\n $array.remove(sprite.dataItem.sprites, sprite);\r\n }\r\n if (!this.visible) {\r\n sprite.hide(0);\r\n }\r\n if (this.isHiding) {\r\n sprite.hide();\r\n }\r\n this.sprites.push(sprite);\r\n sprite.dataItem = this;\r\n };\r\n return DataItem;\r\n}(BaseObjectEvents));\r\nexport { DataItem };\r\n","/**\r\n * Global options.\r\n */\r\nexport var options = {\r\n verbose: true,\r\n commercialLicense: false,\r\n classNamePrefix: \"amcharts-\",\r\n autoSetClassName: false,\r\n minPolylineStep: 0.5,\r\n onlyShowOnViewport: false,\r\n queue: false,\r\n autoDispose: false,\r\n licenses: [],\r\n suppressErrors: false,\r\n suppressWarnings: false,\r\n animationsEnabled: true,\r\n nonce: \"\",\r\n deferredDelay: 100,\r\n disableHoverOnTransform: \"never\",\r\n pixelPerfectPrecision: 0\r\n};\r\n","import { EventDispatcher } from \"./utils/EventDispatcher\";\r\nimport { Dictionary } from \"./utils/Dictionary\";\r\nimport { cache } from \"./utils/Cache\";\r\nimport * as $type from \"./utils/Type\";\r\nimport * as $string from \"./utils/String\";\r\nimport * as $array from \"./utils/Array\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Registry is used to store miscellaneous system-wide information, like ids,\r\n * maps, themes, and registered classes.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\nvar Registry = /** @class */ (function () {\r\n function Registry() {\r\n var _this = this;\r\n /**\r\n * Event dispacther.\r\n */\r\n this.events = new EventDispatcher();\r\n /**\r\n * All currently applied themes. All new chart instances created will\r\n * automatically inherit and retain System's themes.\r\n */\r\n this.themes = [];\r\n /**\r\n * List of all loaded available themes.\r\n *\r\n * Whenever a theme loads, it registers itself in System's `loadedThemes`\r\n * collection.\r\n */\r\n this.loadedThemes = {};\r\n /**\r\n * An indeternal counter used to generate unique IDs.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n this._uidCount = 0;\r\n /**\r\n * Keeps register of class references so that they can be instnatiated using\r\n * string key.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n this.registeredClasses = {};\r\n /**\r\n * Holds all generated placeholders.\r\n */\r\n this._placeholders = {};\r\n /**\r\n * A list of invalid(ated) [[Sprite]] objects that need to be re-validated\r\n * during next cycle.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n this.invalidSprites = {};\r\n /**\r\n * Components are added to this list when their data provider changes to\r\n * a new one or data is added/removed from their data provider.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n this.invalidDatas = {};\r\n /**\r\n * Components are added to this list when values of their raw data change.\r\n * Used when we want a smooth animation from one set of values to another.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n this.invalidRawDatas = [];\r\n /**\r\n * Components are added to this list when values of their data changes\r\n * (but not data provider itself).\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n this.invalidDataItems = [];\r\n /**\r\n * Components are added to this list when their data range (selection) is\r\n * changed, e.g. zoomed.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n this.invalidDataRange = [];\r\n /**\r\n * A list of [[Sprite]] objects that have invalid(ated) positions, that need\r\n * to be recalculated.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n this.invalidPositions = {};\r\n /**\r\n * A list of [[Container]] objects with invalid(ated) layouts.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n this.invalidLayouts = {};\r\n /**\r\n * An array holding all active (non-disposed) top level elemens.\r\n *\r\n * When, for example, a new chart is created, its instance will be added to\r\n * this array, and will be removed when the chart is disposed.\r\n */\r\n this.baseSprites = [];\r\n /**\r\n * An UID-based map of base sprites (top-level charts).\r\n */\r\n this.baseSpritesByUid = {};\r\n /**\r\n * Queued charts (waiting for their turn) to initialize.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/performance/#Daisy_chaining_multiple_charts} for more information\r\n */\r\n this.queue = [];\r\n /**\r\n * An array of deferred charts that haven't been created yet.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/performance/#Deferred_daisy_chained_instantiation} for more information\r\n * @since 4.10.0\r\n */\r\n this.deferred = [];\r\n this.uid = this.getUniqueId();\r\n this.invalidSprites.noBase = [];\r\n this.invalidDatas.noBase = [];\r\n this.invalidLayouts.noBase = [];\r\n this.invalidPositions.noBase = [];\r\n // This is needed for Angular Universal SSR\r\n if (typeof addEventListener !== \"undefined\") {\r\n // This is needed to prevent charts from being cut off when printing\r\n addEventListener(\"beforeprint\", function () {\r\n $array.each(_this.baseSprites, function (sprite) {\r\n var svg = sprite.paper.svg;\r\n svg.setAttribute(\"viewBox\", \"0 0 \" + svg.clientWidth + \" \" + svg.clientHeight);\r\n });\r\n });\r\n addEventListener(\"afterprint\", function () {\r\n $array.each(_this.baseSprites, function (sprite) {\r\n var svg = sprite.paper.svg;\r\n svg.removeAttribute(\"viewBox\");\r\n });\r\n });\r\n }\r\n }\r\n /**\r\n * Generates a unique chart system-wide ID.\r\n *\r\n * @return Generated ID\r\n */\r\n Registry.prototype.getUniqueId = function () {\r\n var uid = this._uidCount;\r\n this._uidCount += 1;\r\n return \"id-\" + uid;\r\n };\r\n Object.defineProperty(Registry.prototype, \"map\", {\r\n /**\r\n * Returns a universal collection for mapping ids with objects.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Map collection\r\n */\r\n get: function () {\r\n if (!this._map) {\r\n this._map = new Dictionary();\r\n }\r\n return this._map;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Caches value in object's cache.\r\n *\r\n * @ignore Exclude from docs\r\n * @param key Key\r\n * @param value Value\r\n * @param ttl TTL in seconds\r\n */\r\n Registry.prototype.setCache = function (key, value, ttl) {\r\n cache.set(this.uid, key, value, ttl);\r\n };\r\n /**\r\n * Retrieves cached value.\r\n *\r\n * @ignore Exclude from docs\r\n * @param key Key\r\n * @param value Value to return if cache is not available\r\n * @return Value\r\n */\r\n Registry.prototype.getCache = function (key, value) {\r\n if (value === void 0) { value = undefined; }\r\n return cache.get(this.uid, key, value);\r\n };\r\n /**\r\n * Dispatches an event using own event dispatcher. Will automatically\r\n * populate event data object with event type and target (this element).\r\n * It also checks if there are any handlers registered for this sepecific\r\n * event.\r\n *\r\n * @param eventType Event type (name)\r\n * @param data Data to pass into event handler(s)\r\n */\r\n Registry.prototype.dispatch = function (eventType, data) {\r\n // @todo Implement proper type check\r\n if (this.events.isEnabled(eventType)) {\r\n if (data) {\r\n data.type = eventType;\r\n data.target = data.target || this;\r\n this.events.dispatch(eventType, {\r\n type: eventType,\r\n target: this\r\n });\r\n }\r\n else {\r\n this.events.dispatch(eventType, {\r\n type: eventType,\r\n target: this\r\n });\r\n }\r\n }\r\n };\r\n /**\r\n * Works like `dispatch`, except event is triggered immediately, without\r\n * waiting for the next frame cycle.\r\n *\r\n * @param eventType Event type (name)\r\n * @param data Data to pass into event handler(s)\r\n */\r\n Registry.prototype.dispatchImmediately = function (eventType, data) {\r\n // @todo Implement proper type check\r\n if (this.events.isEnabled(eventType)) {\r\n if (data) {\r\n data.type = eventType;\r\n data.target = data.target || this;\r\n this.events.dispatchImmediately(eventType, data);\r\n }\r\n else {\r\n this.events.dispatchImmediately(eventType, {\r\n type: eventType,\r\n target: this\r\n });\r\n }\r\n }\r\n };\r\n /**\r\n * Returns a unique placeholder suitable for the key.\r\n *\r\n * @param key Key\r\n * @return Random string to be used as placeholder\r\n */\r\n Registry.prototype.getPlaceholder = function (key) {\r\n if ($type.hasValue(this._placeholders[key])) {\r\n return this._placeholders[key];\r\n }\r\n this._placeholders[key] = \"__amcharts_\" + key + \"_\" + $string.random(8) + \"__\";\r\n return this._placeholders[key];\r\n };\r\n /**\r\n * @ignore\r\n */\r\n Registry.prototype.addToInvalidComponents = function (component) {\r\n if (component.baseId) {\r\n $array.move(this.invalidDatas[component.baseId], component);\r\n }\r\n else {\r\n $array.move(this.invalidDatas[\"noBase\"], component);\r\n }\r\n };\r\n /**\r\n * @ignore\r\n */\r\n Registry.prototype.removeFromInvalidComponents = function (component) {\r\n if (component.baseId) {\r\n $array.remove(this.invalidDatas[component.baseId], component);\r\n }\r\n $array.remove(this.invalidDatas[\"noBase\"], component);\r\n };\r\n /**\r\n * @ignore\r\n */\r\n Registry.prototype.addToInvalidSprites = function (sprite) {\r\n if (sprite.baseId) {\r\n $array.add(this.invalidSprites[sprite.baseId], sprite);\r\n }\r\n else {\r\n $array.add(this.invalidSprites[\"noBase\"], sprite);\r\n }\r\n };\r\n /**\r\n * @ignore\r\n */\r\n Registry.prototype.removeFromInvalidSprites = function (sprite) {\r\n if (sprite.baseId) {\r\n $array.remove(this.invalidSprites[sprite.baseId], sprite);\r\n }\r\n $array.remove(this.invalidSprites[\"noBase\"], sprite);\r\n };\r\n /**\r\n * @ignore\r\n */\r\n Registry.prototype.addToInvalidPositions = function (sprite) {\r\n if (sprite.baseId) {\r\n $array.add(this.invalidPositions[sprite.baseId], sprite);\r\n }\r\n else {\r\n $array.add(this.invalidPositions[\"noBase\"], sprite);\r\n }\r\n };\r\n /**\r\n * @ignore\r\n */\r\n Registry.prototype.removeFromInvalidPositions = function (sprite) {\r\n if (sprite.baseId) {\r\n $array.remove(this.invalidPositions[sprite.baseId], sprite);\r\n }\r\n $array.remove(this.invalidPositions[\"noBase\"], sprite);\r\n };\r\n /**\r\n * @ignore\r\n */\r\n Registry.prototype.addToInvalidLayouts = function (sprite) {\r\n if (sprite.baseId) {\r\n $array.add(this.invalidLayouts[sprite.baseId], sprite);\r\n }\r\n else {\r\n $array.add(this.invalidLayouts[\"noBase\"], sprite);\r\n }\r\n };\r\n /**\r\n * @ignore\r\n */\r\n Registry.prototype.removeFromInvalidLayouts = function (sprite) {\r\n if (sprite.baseId) {\r\n $array.remove(this.invalidLayouts[sprite.baseId], sprite);\r\n }\r\n $array.remove(this.invalidLayouts[\"noBase\"], sprite);\r\n };\r\n return Registry;\r\n}());\r\nexport { Registry };\r\n/**\r\n * A singleton global instance of [[Registry]].\r\n *\r\n * @ignore Exclude from docs\r\n */\r\nexport var registry = new Registry();\r\n/**\r\n * Returns `true` if object is an instance of the class. It's the same as `instanceof` except it doesn't need to import the class.\r\n *\r\n * @param object Object\r\n * @param name Class name\r\n * @return Is instance of class\r\n */\r\nexport function is(object, name) {\r\n var x = registry.registeredClasses[name];\r\n return x != null && object instanceof x;\r\n}\r\n","/**\r\n * This is the main class that encapsulates every object on the chart.\r\n *\r\n * If it's an element that is to be displayed on the screen at some point, its\r\n * class must extend [[Sprite]] class.\r\n */\r\nimport { __extends, __values } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { SpriteState } from \"./SpriteState\";\r\nimport { SpriteEventDispatcher } from \"./SpriteEvents\";\r\nexport { SpriteEventDispatcher };\r\nimport { BaseObjectEvents } from \"./Base\";\r\nimport { Adapter, globalAdapter } from \"./utils/Adapter\";\r\nimport { Dictionary, DictionaryTemplate, DictionaryDisposer } from \"./utils/Dictionary\";\r\nimport { ListDisposer, List } from \"./utils/List\";\r\nimport { MultiDisposer, Disposer, MutableValueDisposer } from \"./utils/Disposer\";\r\nimport { Animation, AnimationDisposer } from \"./utils/Animation\";\r\nimport { getGhostPaper } from \"./rendering/Paper\";\r\nimport { Container } from \"./Container\";\r\nimport { Pattern } from \"./rendering/fills/Pattern\";\r\nimport { LinearGradient } from \"./rendering/fills/LinearGradient\";\r\nimport { RadialGradient } from \"./rendering/fills/RadialGradient\";\r\nimport { Color, color, toColor } from \"./utils/Color\";\r\nimport { getInteraction } from \"./interaction/Interaction\";\r\nimport { MouseCursorStyle } from \"./interaction/Mouse\";\r\nimport { options } from \"./Options\";\r\nimport { registry } from \"./Registry\";\r\nimport { NumberFormatter } from \"./formatters/NumberFormatter\";\r\nimport { DateFormatter } from \"./formatters/DateFormatter\";\r\nimport { DurationFormatter } from \"./formatters/DurationFormatter\";\r\nimport { getTextFormatter } from \"./formatters/TextFormatter\";\r\nimport { Language } from \"./utils/Language\";\r\nimport { Export } from \"./export/Export\";\r\nimport * as $utils from \"./utils/Utils\";\r\nimport * as $math from \"./utils/Math\";\r\nimport * as $strings from \"./utils/Strings\";\r\nimport * as $array from \"./utils/Array\";\r\nimport * as $object from \"./utils/Object\";\r\nimport * as $type from \"./utils/Type\";\r\nimport * as $iter from \"./utils/Iterator\";\r\nimport { system } from \"./System\";\r\nimport { Percent, percent } from \"./utils/Percent\";\r\n/**\r\n * Defines list ofvisual properties\r\n */\r\nexport var visualProperties = [\"fill\", \"fillOpacity\", \"stroke\", \"strokeOpacity\", \"strokeWidth\", \"strokeDasharray\", \"strokeDashoffset\", \"strokeLinecap\", \"strokeLinejoin\"]; // do not add opacity here, as it is used for showing/hiding\r\n;\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Sprite represents any displayable element.\r\n *\r\n * This is the main class that encapsulates every object on the chart.\r\n *\r\n * If it's an element that is to be displayed on the screen at some point, its\r\n * class must extend [[Sprite]] class.\r\n *\r\n * [[Sprite]] class represents the a hierarchical structure. Every object that\r\n * extends [[Sprite]] can have children, that would inherit their properties,\r\n * such as language, formatters, etc.\r\n *\r\n * @see {@link SpriteState}\r\n * @see {@link ISpriteEvents} for a list of available events\r\n * @see {@link ISpriteAdapters} for a list of available Adapters\r\n *\r\n * @todo Review child elements that need to go into `_disposers`\r\n * @important\r\n */\r\nvar Sprite = /** @class */ (function (_super) {\r\n __extends(Sprite, _super);\r\n /**\r\n * Constructor:\r\n * * Creates initial node\r\n * * Sets default properties\r\n * * Creates required default states\r\n * * Inits accessibility\r\n */\r\n function Sprite() {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n /**\r\n * Holds values for Sprite's properties.\r\n */\r\n _this.properties = {};\r\n /**\r\n * @ignore\r\n */\r\n _this._eventDispatcher = new SpriteEventDispatcher(_this);\r\n /**\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\n _this._bindings = {};\r\n /**\r\n * Holds indicator if this Sprite is a \"template\" to be used for creating\r\n * other Sprites from and should not be treated as full-fledged element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this._isTemplate = false;\r\n _this._isPath = false;\r\n /**\r\n * Holds indicator whether this sprite was already initialized.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this._inited = false;\r\n /**\r\n * Holds indicator whether this sprite was already initialized and ready.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this._ready = false;\r\n /**\r\n * If `sprite.hide()` is called and we have \"hidden\" state and\r\n * `transitionDuration > 0`, we set `isHiding` flag to `true` in order to\r\n * avoid restarting animations in case `hide()` method is called multiple\r\n * times.\r\n */\r\n _this.isHiding = false;\r\n /**\r\n * If `sprite.hide()` is called, we set isHidden to true when sprite is hidden.\r\n * This was added becaus hidden state might have visibility set to true and so\r\n * there would not be possible to find out if a sprite is technically hidden or not.\r\n */\r\n _this._isHidden = false;\r\n /**\r\n * This property indicates if Sprite is currently being revealed from hidden\r\n * state. This is used to prevent multiple calls to `sprite.show()` to\r\n * restart reveal animation. (if enabled)\r\n */\r\n _this.isShowing = false;\r\n /**\r\n * Indicates if this element is a standalone instance. A \"standalone\r\n * instance\" means this is a autonomous object which maintains its own\r\n * set of controls like Preloader, Export, etc.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this.isStandaloneInstance = false;\r\n /**\r\n * Indicates if togglable Sprite is currently active (toggled on).\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this._isActive = false;\r\n /**\r\n * A Sprite element to use as a mask for this Sprite.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this._mask = new MutableValueDisposer();\r\n /**\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\n _this._positionPrecision = 3;\r\n /**\r\n * An instance of [[Language]].\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this._language = new MutableValueDisposer();\r\n /**\r\n * Holds [[Export]] object.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this._exporting = new MutableValueDisposer();\r\n /**\r\n * Should this Sprite be included when exporting?\r\n */\r\n _this._exportable = true;\r\n /**\r\n * Defines bounding box (square) for this element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this._bbox = { x: 0, y: 0, width: 0, height: 0 };\r\n /**\r\n * Indicates if this element is invalid and should be re-validated (redrawn).\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this.invalid = false;\r\n /**\r\n * Indicates if this elements position is invalid and should be repositioned\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this.positionInvalid = false;\r\n /**\r\n * A collection of key/value pairs that can be used to bind specific Sprite\r\n * properties to [[DataItem]].\r\n *\r\n * For example: `fill` property can be bound to `myCustomColor` field in\r\n * DataItem. The Sprite will automatically get the value for `fill` from its\r\n * DataItem.\r\n *\r\n * Can be set for each [[SpriteState]] individually to override default\r\n * bindings.\r\n *\r\n * @see {@link SpriteState}\r\n */\r\n _this.propertyFields = {};\r\n /**\r\n * Specifies if property changes on this object should be propagated to the\r\n * objects cloned from this object.\r\n *\r\n * This setting affects property changes *after* cloning, since at the moment\r\n * of cloning all of properties from source object are copied to the clone\r\n * anyway.\r\n *\r\n * @default false\r\n */\r\n _this.applyOnClones = false;\r\n // unrotated unscaled\r\n _this._measuredWidthSelf = 0;\r\n _this._measuredHeightSelf = 0;\r\n // read only, sprite extreme coordinates\r\n /**\r\n * @ignore\r\n */\r\n _this.maxLeft = 0;\r\n /**\r\n * @ignore\r\n */\r\n _this.maxRight = 0;\r\n /**\r\n * @ignore\r\n */\r\n _this.maxTop = 0;\r\n /**\r\n * @ignore\r\n */\r\n _this.maxBottom = 0;\r\n // not rotated and not scaled\r\n /**\r\n * @ignore\r\n */\r\n _this.maxLeftSelf = 0;\r\n /**\r\n * @ignore\r\n */\r\n _this.maxRightSelf = 0;\r\n /**\r\n * @ignore\r\n */\r\n _this.maxTopSelf = 0;\r\n /**\r\n * @ignore\r\n */\r\n _this.maxBottomSelf = 0;\r\n _this._isDragged = false;\r\n _this._isResized = false;\r\n /**\r\n * @deprecated Moved to [[SpriteProperties]]\r\n */\r\n _this._disabled = false;\r\n _this._internalDisabled = false;\r\n _this._updateDisabled = false;\r\n _this._internalDefaultsApplied = false;\r\n /**\r\n * Time in milliseconds after which rollout event happens when user rolls-out of the sprite. This helps to avoid flickering in some cases.\r\n */\r\n _this.rollOutDelay = 0;\r\n /**\r\n * This flag is set to `true` for the initial sprite you create and place\r\n * to the div so that we could clear all additional\r\n * sprites/containers when this sprite is disposed.\r\n *\r\n * @ignore\r\n */\r\n _this.isBaseSprite = false;\r\n /**\r\n * Indicates whether this sprite should be cloned when cloning its parent\r\n * container. We set this to `false` in those cases when a sprite is created\r\n * by the class, so that when cloning a duplicate sprite would not appear.\r\n */\r\n _this.shouldClone = true;\r\n /**\r\n * A read-only flag which indicates if a sprite has completed its initial\r\n * animation (if `showOnInit = true`).\r\n *\r\n * In case `showOnInit = false`, `appeared` is set to `true` on init.\r\n *\r\n * @readonly\r\n */\r\n _this.appeared = false;\r\n /**\r\n * [ex description]\r\n *\r\n * @todo Description\r\n * @ignore\r\n */\r\n _this.ex = 0;\r\n /**\r\n * [ey description]\r\n *\r\n * @todo Description\r\n * @ignore\r\n */\r\n _this.ey = 0;\r\n /**\r\n * Indicates if the sprite can be moved around when resizing it with two fingers (will only work if draggable = false)\r\n * @ignore\r\n */\r\n _this.dragWhileResize = false;\r\n /**\r\n * @ignore\r\n */\r\n _this.measureFailed = false;\r\n /**\r\n * If this flag is set to true, calling show() will not reveal the sprite.\r\n *\r\n * @ignore\r\n */\r\n _this.preventShow = false;\r\n /**\r\n * When cloning a sprite, if the template has it's own tooltip assigned, this tooltip is also cloned by default.\r\n * This is not good for cpu and sometimes you might only need one single tooltip for all clones. Set this to false in order not to clone tooltip.\r\n */\r\n _this.cloneTooltip = true;\r\n _this.className = \"Sprite\";\r\n _this._disposers.push(_this._eventDispatcher);\r\n // Generate a unique ID\r\n $utils.used(_this.uid);\r\n // Create SVG group to hold everything in\r\n _this.group = _this.paper.addGroup(\"g\");\r\n // Set defaults\r\n // it is better to set defauls like this in order to save invaliation calls and events\r\n _this.setPropertyValue(\"scale\", 1);\r\n _this.setPropertyValue(\"rotation\", 0);\r\n _this.setPropertyValue(\"align\", \"none\");\r\n _this.setPropertyValue(\"valign\", \"none\");\r\n _this.setPropertyValue(\"pixelPerfect\", false);\r\n _this.setPropertyValue(\"visible\", true);\r\n _this.setPropertyValue(\"tooltipPosition\", \"fixed\");\r\n _this.setPropertyValue(\"verticalCenter\", \"none\");\r\n _this.setPropertyValue(\"horizontalCenter\", \"none\");\r\n _this.setPropertyValue(\"tooltipX\", percent(50));\r\n _this.setPropertyValue(\"tooltipX\", percent(50));\r\n _this.setPropertyValue(\"marginTop\", 0);\r\n _this.setPropertyValue(\"marginBottom\", 0);\r\n _this.setPropertyValue(\"marginLeft\", 0);\r\n _this.setPropertyValue(\"marginRight\", 0);\r\n _this.setPropertyValue(\"dx\", 0);\r\n _this.setPropertyValue(\"dy\", 0);\r\n _this.setPropertyValue(\"paddingTop\", 0);\r\n _this.setPropertyValue(\"paddingBottom\", 0);\r\n _this.setPropertyValue(\"paddingRight\", 0);\r\n _this.setPropertyValue(\"paddingLeft\", 0);\r\n _this.setPropertyValue(\"togglable\", false);\r\n _this.setPropertyValue(\"hidden\", false);\r\n _this.setPropertyValue(\"urlTarget\", \"_self\");\r\n _this.setPropertyValue(\"alwaysShowTooltip\", false);\r\n _this.setPropertyValue(\"showTooltipOn\", \"hover\");\r\n _this._prevMeasuredWidth = 0;\r\n _this._prevMeasuredHeight = 0;\r\n _this._measuredWidth = 0;\r\n _this._measuredHeight = 0;\r\n _this._isMeasured = true;\r\n // Invalidate the Sprite so that renderer knows it needs to be drawn\r\n _this.invalidate();\r\n //this.states.create(\"default\").properties.opacity = 1;\r\n // Apply the theme\r\n _this.applyTheme();\r\n //this._disposers.push(this._clickable);\r\n // Decorate adapter with events so that we can apply its settings whenever\r\n // it is modified\r\n // @todo Think what to do here. We can't just apply the adapter value to\r\n // property since not all of those are for properties. Commented out for\r\n // now.\r\n /*this.adapter.events.on(\"inserted\", (ev: any) => {\r\n (this)[ev.newValue.key] = (this)[ev.newValue.key];\r\n });\r\n this.adapter.events.on(\"removed\", (ev: any) => {\r\n (this)[ev.newValue.key] = (this)[ev.newValue.key];\r\n });*/\r\n // Add disposable dependencies to `_disposers` so they are automatically\r\n // disposed of when this object is disposed\r\n _this._disposers.push(_this.events);\r\n _this._disposers.push(_this.group);\r\n _this._disposers.push(_this._mask);\r\n _this._disposers.push(_this._language);\r\n _this._disposers.push(_this._exporting);\r\n //this._disposers.push(this._parent);\r\n //this._disposers.push(this._modal);\r\n _this._disposers.push(new Disposer(function () {\r\n $object.each(_this._bindings, function (key, value) {\r\n value.dispose();\r\n });\r\n }));\r\n _this.setPropertyValue(\"interactionsEnabled\", true);\r\n return _this;\r\n }\r\n Object.defineProperty(Sprite.prototype, \"events\", {\r\n /**\r\n * Event dispatcher.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/event-listeners/} for more info about Events\r\n */\r\n get: function () {\r\n return this._eventDispatcher;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"adapter\", {\r\n /**\r\n * Holds Adapter.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/adapters/} for more info about Adapters\r\n */\r\n get: function () {\r\n if (!this._adapterO) {\r\n this._adapterO = new Adapter(this);\r\n }\r\n return this._adapterO;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * ==========================================================================\r\n * ELEMENT VALIDATION, INIT, AND DRAWING STUFF\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Applies properties from all assigned themes.\r\n *\r\n * We do this here so that we can apply class names as well.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Sprite.prototype.applyTheme = function () {\r\n _super.prototype.applyTheme.call(this);\r\n if (options.autoSetClassName) {\r\n this.setClassName();\r\n }\r\n };\r\n /**\r\n * Returns theme(s) used by this object either set explicitly on this\r\n * element, inherited from parent, or inherited from [[System]].\r\n *\r\n * @return An array of theme references\r\n */\r\n Sprite.prototype.getCurrentThemes = function () {\r\n var themes = this._themes;\r\n if (themes) {\r\n return themes;\r\n }\r\n else {\r\n var parent_1 = this._parent;\r\n if (parent_1) {\r\n return parent_1.getCurrentThemes();\r\n }\r\n else {\r\n return registry.themes;\r\n }\r\n }\r\n };\r\n /**\r\n * Called just before element's validation, this function allows setting\r\n * defaults.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Sprite.prototype.applyInternalDefaults = function () {\r\n // Nothing here, but extending classes might override this function\r\n // so that they can set their defaults\r\n this._internalDefaultsApplied = true;\r\n };\r\n /**\r\n * Invalidates element.\r\n *\r\n * Object will be redrawn during the next update cycle.\r\n *\r\n * Please note that in most cases elements will auto-invalidate when needed. If\r\n * everything works, DO NOT use this method. Use it only if some changes do\r\n * not take otherwise.\r\n */\r\n Sprite.prototype.invalidate = function () {\r\n if (this.disabled || this._isTemplate || this.__disabled) {\r\n return;\r\n }\r\n // We no longer reset this on each invalidate, so that they are applied\r\n // only once, and do not overwrite user-defined settings\r\n //this._internalDefaultsApplied = false;\r\n if (!this.invalid) {\r\n this.invalid = true;\r\n registry.addToInvalidSprites(this);\r\n system.requestFrame();\r\n }\r\n };\r\n /**\r\n * Validates element:\r\n * * Triggers events\r\n * * Redraws the element\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Sprite.prototype.validate = function () {\r\n this.dispatchImmediately(\"beforevalidated\");\r\n // prevents from drawing if topparent is 0x0\r\n /*\r\n let topParent = this.topParent;\r\n\r\n if (topParent) {\r\n if (!topParent.maxWidth || !topParent.maxHeight) {\r\n this._disposers.push(topParent.events.once(\"maxsizechanged\", this.invalidate, this));\r\n }\r\n }*/\r\n // Set internal defaults\r\n if (!this._internalDefaultsApplied) {\r\n this.applyInternalDefaults();\r\n }\r\n this.beforeDraw();\r\n this.draw();\r\n this.invalid = false;\r\n registry.removeFromInvalidSprites(this);\r\n this.afterDraw();\r\n };\r\n /**\r\n * Invalidates element's position.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Sprite.prototype.invalidatePosition = function () {\r\n if (this.disabled || this._isTemplate) {\r\n return;\r\n }\r\n if (!this.positionInvalid) {\r\n this.positionInvalid = true;\r\n registry.addToInvalidPositions(this);\r\n system.requestFrame();\r\n }\r\n };\r\n /**\r\n * Transforms the element.\r\n *\r\n * @todo Description (review)\r\n * @ignore Exclude from docs\r\n */\r\n Sprite.prototype.validatePosition = function () {\r\n var pixelX = this.pixelX;\r\n var pixelY = this.pixelY;\r\n var dx = this.dx;\r\n var dy = this.dy;\r\n var x = pixelX + dx;\r\n var y = pixelY + dy;\r\n if (this._updateDisabled) {\r\n if (this._internalDisabled) {\r\n this.group.attr({ \"display\": \"none\" });\r\n }\r\n else {\r\n if (!this.disabled) {\r\n this.removeSVGAttribute(\"display\");\r\n }\r\n }\r\n this._updateDisabled = false;\r\n }\r\n var sizeChanged = this.measure();\r\n //if (!this.invalid) {\r\n var prevGroupTransform = this.group.transformString;\r\n this.group.moveTo({ x: x, y: y });\r\n this.group.rotation = this.rotation;\r\n if (this.nonScaling) {\r\n this.group.scale = this.scale / this.globalScale;\r\n }\r\n else {\r\n this.group.scale = this.scale;\r\n }\r\n if (prevGroupTransform != this.group.transformString || sizeChanged) {\r\n // not yet sure, this is to avoid many transforms=>container layout invalidation on initial buid\r\n if (prevGroupTransform == null) {\r\n this.dispatch(\"transformed\");\r\n }\r\n else {\r\n this.dispatchImmediately(\"transformed\");\r\n }\r\n // TODO clear existing positionchanged dispatches ?\r\n this.dispatch(\"positionchanged\");\r\n if (this.showTooltipOn == \"hit\" || this.showTooltipOn == \"always\") {\r\n this.updateTooltipPosition();\r\n }\r\n }\r\n //}\r\n // it might happen that x and y changed again, so we only remove if they didn't\r\n if (pixelX + dx == x && pixelY + dy == y) {\r\n registry.removeFromInvalidPositions(this);\r\n this.positionInvalid = false;\r\n }\r\n var maskRectangle = this._maskRectangle;\r\n // todo: verify this\r\n if (maskRectangle) {\r\n this._clipElement.moveTo({ x: maskRectangle.x - pixelX, y: maskRectangle.y - pixelY });\r\n }\r\n };\r\n /**\r\n * A placeholder method that is called **before** element begins to be drawn.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Sprite.prototype.beforeDraw = function () {\r\n };\r\n /**\r\n * A placeholder method that draws the element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Sprite.prototype.draw = function () {\r\n };\r\n /**\r\n * A placeholder method that is called **after** element finishes drawing\r\n * itself.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Sprite.prototype.afterDraw = function () {\r\n var e_1, _a;\r\n if (this.isMeasured || this.horizontalCenter !== \"none\" || this.verticalCenter !== \"none\") {\r\n this.measureElement();\r\n }\r\n //this.applyMask();\r\n if (!this._inited) {\r\n if (this._adapterO) {\r\n try {\r\n // used to be applySVGAttrbutes here, this is more efficient\r\n for (var _b = __values(this._adapterO.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {\r\n var key = _c.value;\r\n switch (key) {\r\n case \"mask\":\r\n case \"fill\":\r\n case \"opacity\":\r\n case \"fillOpacity\":\r\n case \"stroke\":\r\n case \"strokeOpacity\":\r\n case \"strokeWidth\":\r\n case \"shapeRendering\":\r\n case \"strokeDasharray\":\r\n case \"strokeDashoffset\":\r\n case \"strokeLinecap\":\r\n case \"strokeLinejoin\":\r\n case \"textDecoration\":\r\n case \"fontSize\":\r\n case \"fontFamily\":\r\n case \"fontWeight\":\r\n //case \"focusable\":\r\n //case \"tabindex\":\r\n //case \"role\":\r\n this[key] = this[key];\r\n break;\r\n }\r\n }\r\n }\r\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\r\n finally {\r\n try {\r\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\r\n }\r\n finally { if (e_1) throw e_1.error; }\r\n }\r\n }\r\n this.applyFilters();\r\n this.visible = this.visible;\r\n this.interactionsEnabled = this.getPropertyValue(\"interactionsEnabled\"); // can't use .interactionsEnabled as it get's parent's\r\n this._inited = true;\r\n if (!this.showOnInit) {\r\n this.appeared = true;\r\n }\r\n if (this.hidden) {\r\n this.hide(0);\r\n }\r\n this.applyMask();\r\n this.dispatch(\"validated\");\r\n this.dispatch(\"inited\");\r\n this.dispatchReady();\r\n }\r\n else {\r\n this.dispatch(\"validated\");\r\n }\r\n if (this.showTooltipOn == \"always\") {\r\n if (this.visible && !this.disabled && !this.__disabled) {\r\n this.showTooltip();\r\n }\r\n else {\r\n this.hideTooltip(0);\r\n }\r\n }\r\n };\r\n /**\r\n * Dispatches `\"ready\"` event. Sprite dispatches it right after `\"inited\"` event.\r\n *\r\n * @ignore\r\n */\r\n Sprite.prototype.dispatchReady = function () {\r\n if (!this.isReady()) {\r\n this._ready = true;\r\n this.dispatch(\"ready\");\r\n }\r\n };\r\n /**\r\n * Triggers a re-initialization of this element.\r\n *\r\n * Will result in complete redrawing of the element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Sprite.prototype.reinit = function () {\r\n this._inited = false;\r\n this.setState(this.defaultState);\r\n this.invalidate();\r\n };\r\n /**\r\n * Handles the situation where parent element is resized.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Sprite.prototype.handleGlobalScale = function () {\r\n this.dispatch(\"globalscalechanged\");\r\n if (this.nonScalingStroke) {\r\n this.strokeWidth = this.strokeWidth;\r\n }\r\n if (this.nonScaling) {\r\n this.validatePosition();\r\n }\r\n this.updateFilterScale();\r\n };\r\n /**\r\n * Updates filter properties which might depend on scale\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Sprite.prototype.updateFilterScale = function () {\r\n var _this = this;\r\n $iter.each(this.filters.iterator(), function (filter) {\r\n filter.scale = _this.globalScale;\r\n });\r\n };\r\n /**\r\n * Removes itself from system's invalid lists.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Sprite.prototype.removeFromInvalids = function () {\r\n registry.removeFromInvalidSprites(this);\r\n registry.removeFromInvalidPositions(this);\r\n };\r\n /**\r\n * Copies all parameters from another [[Sprite]].\r\n *\r\n * @param source Source Sprite\r\n */\r\n Sprite.prototype.copyFrom = function (source) {\r\n var _this = this;\r\n _super.prototype.copyFrom.call(this, source);\r\n this.isMeasured = source.isMeasured;\r\n this.states.copyFrom(source.states);\r\n if (source.filters.length > 0) {\r\n source.filters.each(function (filter) {\r\n _this.filters.push(filter.clone());\r\n });\r\n }\r\n if (source._adapterO) {\r\n this.adapter.copyFrom(source._adapterO);\r\n }\r\n //helps to avoid calling getter which creates instance\r\n if (source[\"_interaction\"]) {\r\n this.interactions.copyFrom(source.interactions);\r\n }\r\n if (source[\"_plugins\"]) {\r\n this.plugins.copyFrom(source.plugins);\r\n }\r\n this.configField = source.configField;\r\n this.applyOnClones = source.applyOnClones;\r\n // this.numberFormatter = source.numberFormatter; // todo: this creates loose number formatter and copies it to all clones. somehow we need to know if source had numberFormatter explicitly created and not just because a getter was called.\r\n //this.mask = source.mask; need to think about this, generally this causes a lot of problems\r\n this.disabled = source.disabled;\r\n this.virtualParent = source.virtualParent;\r\n this.exportable = source.exportable;\r\n //@todo: create tooltip if it's on source but not on this?\r\n //const tooltip = this._tooltip;\r\n //if (tooltip) {\r\n //\ttooltip.copyFrom(source.tooltip);\r\n //}\r\n if (source._tooltip) {\r\n if (this._tooltip) {\r\n this._tooltip.copyFrom(source.tooltip);\r\n }\r\n else {\r\n if (source.cloneTooltip) {\r\n this.tooltip = source.tooltip.clone();\r\n }\r\n else {\r\n this._tooltip = source.tooltip;\r\n }\r\n }\r\n }\r\n //if ((source)[\"_tooltip\"] && !this._tooltip) {\r\n //\tthis._tooltip = (source)[\"_tooltip\"];\r\n //}\r\n this._showSystemTooltip = source.showSystemTooltip;\r\n $utils.copyProperties(source.propertyFields, this.propertyFields);\r\n $utils.copyProperties(source.properties, this);\r\n if (source.fillModifier) {\r\n this.fillModifier = source.fillModifier.clone();\r\n }\r\n if (source.strokeModifier) {\r\n this.strokeModifier = source.strokeModifier.clone();\r\n }\r\n };\r\n /**\r\n * Destroys this object and all related data.\r\n */\r\n Sprite.prototype.dispose = function () {\r\n if (!this.isDisposed()) {\r\n if (this.showTooltipOn == \"always\" && this.tooltip) {\r\n this.tooltip.hide();\r\n }\r\n this.dispatchImmediately(\"beforedisposed\");\r\n if (this.isBaseSprite) {\r\n if (this.htmlContainer) {\r\n while (this.htmlContainer.childNodes.length > 0) {\r\n this.htmlContainer.removeChild(this.htmlContainer.firstChild);\r\n }\r\n }\r\n this.isBaseSprite = false;\r\n }\r\n _super.prototype.dispose.call(this);\r\n // Clear adapters\r\n if (this._adapterO) {\r\n this._adapterO.clear();\r\n }\r\n if (this.applyOnClones) {\r\n if (this._clones) {\r\n for (var i = this._clones.length - 1; i >= 0; i--) {\r\n var clone = this._clones.getIndex(i);\r\n clone.dispose();\r\n }\r\n }\r\n }\r\n if (this._svgContainer) {\r\n this._svgContainer.dispose();\r\n }\r\n if (this._interactionDisposer) {\r\n this._interactionDisposer.dispose();\r\n this._interactionDisposer = undefined;\r\n }\r\n if (this._urlDisposer) {\r\n this._urlDisposer.dispose();\r\n }\r\n this.removeFromInvalids();\r\n if (this.element) {\r\n this.element.dispose();\r\n }\r\n if (this.group) {\r\n this.group.dispose();\r\n }\r\n if (this._numberFormatter) {\r\n this._numberFormatter.dispose();\r\n }\r\n if (this._focusFilter) {\r\n this._focusFilter.dispose();\r\n }\r\n var stroke = this.stroke;\r\n if (stroke && !(stroke instanceof Color) && stroke.dispose) {\r\n if (this.clonedFrom && this.clonedFrom.stroke == stroke) {\r\n // do nothing\r\n }\r\n else {\r\n stroke.dispose();\r\n }\r\n }\r\n // TODO a bit hacky\r\n var fill = this.fill;\r\n if (fill && !(fill instanceof Color) && fill.dispose) {\r\n if (this.clonedFrom && this.clonedFrom.fill == fill) {\r\n // do nothing\r\n }\r\n else {\r\n fill.dispose();\r\n }\r\n }\r\n // remove from map\r\n if ($type.hasValue(this.id)) {\r\n this.map.removeKey(this.id);\r\n }\r\n this.parent = undefined;\r\n if (this._filters) {\r\n while (this._filters.length > 0) {\r\n var filter = this._filters.getIndex(0);\r\n filter.dispose();\r\n this._filters.removeValue(filter);\r\n }\r\n }\r\n this._alwaysShowDisposers = undefined;\r\n }\r\n };\r\n Object.defineProperty(Sprite.prototype, \"isTemplate\", {\r\n /**\r\n * @ignore Exclude from docs\r\n * @return Is template?\r\n */\r\n get: function () {\r\n return this._isTemplate;\r\n },\r\n /**\r\n * Indicates if this element is a \"template\".\r\n *\r\n * Template Sprites act only as a holders for config for other \"real\"\r\n * elements to be cloned from.\r\n *\r\n * Templates are treated differently, as they are not validated, redrawn, or\r\n * otherwise are processed.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Is template?\r\n */\r\n set: function (value) {\r\n value = $type.toBoolean(value);\r\n if (this._isTemplate != value) {\r\n this._isTemplate = value;\r\n if (this instanceof Container) {\r\n $iter.each(this.children.iterator(), function (child) {\r\n child.isTemplate = value;\r\n });\r\n }\r\n if (value) {\r\n this.parent = this._parent;\r\n this.removeFromInvalids();\r\n }\r\n else {\r\n this.invalidate();\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"showSystemTooltip\", {\r\n /**\r\n * @return Show system tooltip?\r\n */\r\n get: function () {\r\n if (!$type.hasValue(this._showSystemTooltip)) {\r\n if (this.virtualParent) {\r\n return this.virtualParent.showSystemTooltip;\r\n }\r\n else if (this._parent) {\r\n return this._parent.showSystemTooltip;\r\n }\r\n else {\r\n return false;\r\n }\r\n }\r\n return this._showSystemTooltip;\r\n },\r\n /**\r\n * Indicates whether the element should attempt to construct itself in a way\r\n * so that system tooltip is shown if its `readerTitle` is set.\r\n *\r\n * @param value Show system tooltip?\r\n */\r\n set: function (value) {\r\n value = $type.toBoolean(value);\r\n if (this._showSystemTooltip != value) {\r\n this._showSystemTooltip = value;\r\n this.applyAccessibility();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"topParent\", {\r\n /**\r\n * ==========================================================================\r\n * HIERARCHY AND STRUCTURE RELATED STUFF\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Sprites's top-level [[Container]].\r\n *\r\n * Please note that in most cases it won't be the chart element.\r\n *\r\n * To access base chart element, use `baseSprite` instead.\r\n *\r\n * @return Top-level ascendant\r\n */\r\n get: function () {\r\n if (this._topParent) {\r\n return this._topParent;\r\n }\r\n else {\r\n if (this._parent) {\r\n return this._parent.topParent;\r\n }\r\n }\r\n },\r\n /**\r\n * @ignore\r\n * @param value {Container} top parent of a sprite\r\n */\r\n set: function (value) {\r\n this._topParent = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"parent\", {\r\n /**\r\n * @return Parent container\r\n */\r\n get: function () {\r\n return this._parent;\r\n },\r\n /**\r\n * Elements' parent [[Container]].\r\n *\r\n * @param parent Parent container\r\n */\r\n set: function (parent) {\r\n if (this._isTemplate) {\r\n return;\r\n }\r\n // TODO is this needed ?\r\n $utils.used(this.paper);\r\n var oldParent = this._parent;\r\n if (oldParent != parent) {\r\n if (oldParent) {\r\n oldParent.children.removeValue(this);\r\n }\r\n this._parent = parent;\r\n if (parent) {\r\n this.topParent = parent.topParent;\r\n if (parent.isTemplate) {\r\n this.isTemplate = true;\r\n }\r\n this.baseId = parent.baseId;\r\n parent.children.push(this);\r\n // insert handler at Container invalidates + invalidatesLayout + adds to group\r\n if (this._tooltip && !this._tooltipContainer) {\r\n this._tooltip.parent = parent.tooltipContainer;\r\n }\r\n if (!this._dataItem) {\r\n this.dataItem = parent.dataItem;\r\n }\r\n this.handleAlwaysShowTooltip();\r\n if (this.dataItem) {\r\n // No need to apply accessibility if there's no data item\r\n // The whole reason of applying it here is to populate data\r\n // placesholders, and if tehre's no data item, it won't work anyway\r\n this.applyAccessibility();\r\n }\r\n this.dispatchImmediately(\"parentset\");\r\n }\r\n else {\r\n this.topParent = undefined;\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * @ignore\r\n */\r\n Sprite.prototype.handleAlwaysShow = function () {\r\n this.showTooltip();\r\n };\r\n /**\r\n * @ignore\r\n */\r\n Sprite.prototype.handleAlwaysShowTooltip = function () {\r\n var sprite = this;\r\n var oldDisposers = this._alwaysShowDisposers;\r\n if (oldDisposers) {\r\n $array.each(oldDisposers, function (oldDisposer) {\r\n oldDisposer.dispose();\r\n });\r\n }\r\n this._alwaysShowDisposers = [];\r\n if (this.showTooltipOn == \"always\") {\r\n while (sprite != undefined) {\r\n var disposer = sprite.events.on(\"visibilitychanged\", this.handleAlwaysShow, this, false);\r\n this.addDisposer(disposer);\r\n this._alwaysShowDisposers.push(disposer);\r\n sprite = sprite.parent;\r\n }\r\n }\r\n };\r\n Object.defineProperty(Sprite.prototype, \"virtualParent\", {\r\n /**\r\n * @return Virtual parent\r\n */\r\n get: function () {\r\n return this._virtualParent;\r\n },\r\n /**\r\n * Element's \"virtual\" parent.\r\n *\r\n * This is required in ordere to maintain proper inheritance (like\r\n * formatters).\r\n *\r\n * Sometimes an element is a \"logical\" parent, even though it's not a direct\r\n * ascendant.\r\n *\r\n * Example: a bullet is not a child of the axis, but it would make sense\r\n * for it to inherit series' formatters.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Virtual parent\r\n */\r\n set: function (value) {\r\n this._virtualParent = value;\r\n if (this.dataItem) {\r\n // No need to apply accessibility if there's no data item\r\n // The whole reason of applying it here is to populate data\r\n // placesholders, and if tehre's no data item, it won't work anyway\r\n this.applyAccessibility();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Moves `` to correct place in DOM.\r\n *\r\n * Some elements are initially created in \"ghost\" container. When moving\r\n * those into proper place in DOM, their respective `` need to be moved\r\n * as well.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Sprite.prototype.appendDefs = function () {\r\n if (this.filterElement) {\r\n this.paper.appendDef(this.filterElement);\r\n }\r\n var fill = this.fill;\r\n if (fill && fill.element) {\r\n this.paper.appendDef(fill.element);\r\n }\r\n var stroke = this.stroke;\r\n if (stroke && stroke.element) {\r\n this.paper.appendDef(stroke.element);\r\n }\r\n if (this.fillModifier && this.fill instanceof Color) {\r\n var fill_1 = this.fillModifier.modify(this.fill);\r\n if (fill_1 && fill_1.element) {\r\n this.paper.appendDef(fill_1.element);\r\n }\r\n }\r\n if (this.strokeModifier && this.stroke instanceof Color) {\r\n var stroke_1 = this.strokeModifier.modify(this.stroke);\r\n if (stroke_1 && stroke_1.element) {\r\n this.paper.appendDef(stroke_1.element);\r\n }\r\n }\r\n if (this._clipPath) {\r\n this.paper.appendDef(this._clipPath);\r\n }\r\n if (this._exportable === false) {\r\n this.exportable = false;\r\n }\r\n };\r\n Object.defineProperty(Sprite.prototype, \"map\", {\r\n /**\r\n * Returns a [[Dictionary]] which maps object ids with their respective\r\n * objects.\r\n *\r\n * Can be used to retrieve any object by id, e.g.:\r\n *\r\n * ```TypeScript\r\n * console.log(mySprite.map.getKey(\"myid\"));\r\n * ```\r\n * ```JavaScript\r\n * console.log(mySprite.map.getKey(\"myid\"));\r\n * ```\r\n *\r\n * @return Map collection\r\n */\r\n get: function () {\r\n var top = this.topParent;\r\n if (top) {\r\n return top.map;\r\n }\r\n else if (!this._map) {\r\n this._map = new Dictionary();\r\n }\r\n return this._map;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"delayedMap\", {\r\n /**\r\n * @ignore\r\n * @return Map collection\r\n */\r\n get: function () {\r\n var top = this.topParent;\r\n if (top) {\r\n return top.delayedMap;\r\n }\r\n else if (!this._delayedMap) {\r\n this._delayedMap = new Dictionary();\r\n }\r\n return this._delayedMap;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"id\", {\r\n /**\r\n * @return ID\r\n */\r\n get: function () {\r\n return this._id;\r\n },\r\n /**\r\n * Element's user-defined ID.\r\n *\r\n * Will throw an Error if there already is an object with the same ID.\r\n *\r\n * Please note that above check will be performed withing the scope of the\r\n * current chart instance. It will not do checks across other chart instances\r\n * or in globally in DOM.\r\n *\r\n * Make sure the IDs are unique.\r\n *\r\n * @param value ID\r\n */\r\n set: function (value) {\r\n if (this._id != value) {\r\n this._id = value;\r\n if (this.map.hasKey(value)) {\r\n throw Error(\"Duplicate id (\" + value + \") used on multiple objects.\");\r\n }\r\n else {\r\n this.map.setKey(value, this);\r\n }\r\n if (options.autoSetClassName) {\r\n this.setClassName();\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"dom\", {\r\n /**\r\n * ==========================================================================\r\n * ELEMENT AND DOM TREE MANIPULATION AND MEASURING\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Returns DOM element reference associated with this element.\r\n *\r\n * @readonly\r\n * @return DOM element\r\n */\r\n get: function () {\r\n return this.group.node;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"paper\", {\r\n /**\r\n * @ignore Exclude from docs\r\n * @return Paper\r\n */\r\n get: function () {\r\n if (this._paper) {\r\n return this._paper;\r\n }\r\n else {\r\n var parent_2 = this._parent;\r\n if (parent_2) {\r\n return parent_2.paper;\r\n }\r\n }\r\n return getGhostPaper();\r\n },\r\n /**\r\n * A [[Paper]] instance to place elements on.\r\n *\r\n * If there's no Paper set for this element, it goes up the ascendant tree\r\n * until it finds one.\r\n *\r\n * This method is used by important `addChild()` method, so it's essential\r\n * to have a [[Paper]] instance.\r\n *\r\n * If this element has a separate `htmlContainer` set, it will have a\r\n * [[Paper]] instance itself.\r\n *\r\n * @ignore Exclude from docs\r\n * @param paper Paper\r\n */\r\n set: function (paper) {\r\n this.setPaper(paper);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Sets [[Paper]] instance to use to draw elements.\r\n * @ignore\r\n * @param paper Paper\r\n * @return true if paper was changed, false, if it's the same\r\n */\r\n Sprite.prototype.setPaper = function (paper) {\r\n var oldPaper = this._paper;\r\n if (oldPaper != paper) {\r\n this._paper = paper;\r\n this.appendDefs();\r\n return true;\r\n }\r\n return false;\r\n };\r\n Object.defineProperty(Sprite.prototype, \"htmlContainer\", {\r\n /**\r\n * @return HTML element\r\n */\r\n get: function () {\r\n if (this._htmlContainer) {\r\n return this._htmlContainer;\r\n }\r\n else {\r\n var parent_3 = this._parent;\r\n if (parent_3) {\r\n return parent_3.htmlContainer;\r\n }\r\n }\r\n },\r\n /**\r\n * An HTML element to be used when placing wrapper element (`
`)\r\n * for the whole chart.\r\n *\r\n * This is the same for **all** elements within the same chart.\r\n *\r\n * @param htmlContainer HTML element\r\n */\r\n set: function (htmlContainer) {\r\n this._htmlContainer = htmlContainer;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"titleElement\", {\r\n /**\r\n * Creates (if not yet created) and returns element's `` element.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Title element\r\n */\r\n get: function () {\r\n if (!this._titleElement) {\r\n this._titleElement = this.paper.add(\"title\");\r\n this.group.add(this._titleElement);\r\n }\r\n return this._titleElement;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"descriptionElement\", {\r\n /**\r\n * Creates (if not yet created) and returns element's `<desc>` element.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Desc element\r\n */\r\n get: function () {\r\n if (!this._descriptionElement) {\r\n this._descriptionElement = this.paper.add(\"desc\");\r\n this.group.add(this._descriptionElement);\r\n }\r\n return this._descriptionElement;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"filters\", {\r\n /**\r\n * Returns list of SVG filters (effects) applied to element. If the filter\r\n * list is not yet initilized, creates and returns an empty one.\r\n * Note, not all filters combine well with one another. We recommend using one filter per sprite.\r\n *\r\n * @return List of filters\r\n */\r\n get: function () {\r\n if (!this._filters) {\r\n this._filters = new List();\r\n // TODO only add certain events ?\r\n this._disposers.push(this._filters.events.onAll(this.applyFilters, this));\r\n this._disposers.push(new ListDisposer(this._filters));\r\n }\r\n return this._filters;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Sets required SVG attributes. Must be called every time an element is\r\n * redrawn so that attributes are (re)applied.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Sprite.prototype.setSVGAttributes = function () {\r\n this.fill = this.fill;\r\n this.opacity = this.opacity;\r\n this.fillOpacity = this.fillOpacity;\r\n this.stroke = this.stroke;\r\n this.strokeOpacity = this.strokeOpacity;\r\n this.shapeRendering = this.shapeRendering;\r\n this.strokeDasharray = this.strokeDasharray;\r\n this.strokeDashoffset = this.strokeDashoffset;\r\n this.strokeLinecap = this.strokeLinecap;\r\n this.strokeLinejoin = this.strokeLinejoin;\r\n this.focusable = this.focusable;\r\n this.tabindex = this.tabindex;\r\n this.role = this.role;\r\n };\r\n /**\r\n * Sets an attribute directly on an SVG element.\r\n *\r\n * @ignore Exclude from docs\r\n * @param attribute Attribute object\r\n */\r\n Sprite.prototype.setSVGAttribute = function (attribute) {\r\n this.group.attr(attribute);\r\n };\r\n /**\r\n * Removes an attribute directly from SVG element.\r\n *\r\n * @param attribute Attribute key to remove\r\n */\r\n Sprite.prototype.removeSVGAttribute = function (attribute) {\r\n this.group.removeAttr(attribute);\r\n };\r\n /**\r\n * Sets `class` attribute of the elements SVG node.\r\n *\r\n * Uses `am4core.options.classNamePrefix`.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Sprite.prototype.setClassName = function () {\r\n var className = this.className;\r\n var classNamePrefix = options.classNamePrefix;\r\n if (this.element) {\r\n this.element.addClass(classNamePrefix + className);\r\n }\r\n this.group.addClass(classNamePrefix + className + \"-group\");\r\n if ($type.hasValue(this.id)) {\r\n this.group.addClass(classNamePrefix + this.id);\r\n }\r\n if (this.userClassName) {\r\n this.group.addClass(this.userClassName);\r\n }\r\n };\r\n /**\r\n * Adds an `id` attribute the the element and returns the id.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Element's ID\r\n */\r\n Sprite.prototype.uidAttr = function () {\r\n this.setSVGAttribute({ \"id\": this.uid });\r\n return this.uid;\r\n };\r\n /**\r\n * [updateClipPath description]\r\n *\r\n * @todo Description\r\n */\r\n Sprite.prototype.updateClipPath = function () {\r\n var element = this._clipElement;\r\n if (element) {\r\n element.moveTo({ x: this.mask.pixelX, y: this.mask.pixelY });\r\n }\r\n };\r\n /**\r\n * @ignore\r\n */\r\n Sprite.prototype.createClipPath = function () {\r\n if (!this._clipPath) {\r\n this._clipPath = this.paper.addGroup(\"clipPath\");\r\n this.paper.appendDef(this._clipPath);\r\n this._disposers.push(this._clipPath);\r\n var id = registry.getUniqueId();\r\n this._clipPath.attr({ \"id\": id });\r\n this.group.attr({ \"clip-path\": \"url(\\\"\" + $utils.getBaseURI() + id + \"\\\")\" });\r\n }\r\n };\r\n /**\r\n * Applies the mask Sprite.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Sprite.prototype.applyMask = function () {\r\n var mask = this.mask;\r\n if (this._clipPath && mask) {\r\n // Container\r\n if (mask instanceof Container) {\r\n this._clipElement.attr({ \"width\": $math.max(0, mask.pixelWidth), \"height\": $math.max(0, mask.pixelHeight) });\r\n var point = $utils.spritePointToSprite({ x: mask.pixelX, y: mask.pixelY }, mask.parent, this);\r\n this._clipPath.x = point.x;\r\n this._clipPath.y = point.y;\r\n }\r\n // Sprite\r\n else {\r\n if (mask.element && mask.element != this._clipElement) {\r\n this._clipElement = mask.element;\r\n this._clipPath.add(this._clipElement);\r\n }\r\n this._clipPath.scale = mask.scale;\r\n this._clipPath.x = mask.pixelX;\r\n this._clipPath.y = mask.pixelY;\r\n this._clipPath.rotation = mask.rotation;\r\n }\r\n }\r\n };\r\n /**\r\n * Applies filters to the element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Sprite.prototype.applyFilters = function () {\r\n var _this = this;\r\n // we create a separate filter for each sprite as otherwise it would be impossible to animate filter.\r\n // svg doesn't support multiple filters applied to one element, so we put all the primitives to one filterElement of a sprite.\r\n if (this._filters && this._filters.length > 0) {\r\n var width_1 = 100;\r\n var height_1 = 100;\r\n if (!this.filterElement) {\r\n this.filterElement = this.paper.addGroup(\"filter\");\r\n this._disposers.push(this.filterElement);\r\n }\r\n else {\r\n this.filterElement.removeChildNodes();\r\n }\r\n this.paper.appendDef(this.filterElement);\r\n var id = \"filter-\" + this.uid;\r\n this.filterElement.attr({ \"id\": id });\r\n $iter.each(this.filters.iterator(), function (filter) {\r\n filter.sprite = _this;\r\n filter.paper = _this.paper;\r\n _this.filterElement.attr({ filterUnits: filter.filterUnits });\r\n filter.appendPrimitives(_this.filterElement);\r\n if (filter.width > width_1) {\r\n width_1 = filter.width;\r\n }\r\n if (filter.height > height_1) {\r\n height_1 = filter.height;\r\n }\r\n filter.scale = _this.globalScale;\r\n });\r\n var w = width_1 + \"%\";\r\n var h = height_1 + \"%\";\r\n /* temporarily removed as it is breaking tooltips on Safari @todo come back to this\r\n if (this._measuredHeight <= 1) {\r\n h = height + \"\";\r\n }\r\n\r\n if (this._measuredWidth <= 1) {\r\n h = width + \"\";\r\n }*/\r\n this.filterElement.attr({ \"width\": w, \"height\": h, \"x\": -(width_1 - 100) / 2 + \"%\", \"y\": -(height_1 - 100) / 2 + \"%\" });\r\n this.group.attr({ \"filter\": \"url(\\\"\" + $utils.getBaseURI() + id + \"\\\")\" });\r\n }\r\n else if (this.filterElement) {\r\n this.group.removeAttr(\"filter\");\r\n this.filterElement.removeChildNodes();\r\n }\r\n };\r\n /**\r\n * [removeClipPath description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\n Sprite.prototype.removeClipPath = function () {\r\n if (this._clipPath) {\r\n //this._clipPath.dispose();\r\n this.removeDispose(this._clipPath);\r\n this._clipPath = undefined;\r\n }\r\n };\r\n /**\r\n * [setElement description]\r\n *\r\n * @ignore\r\n * @todo Description\r\n * @param element [description]\r\n */\r\n Sprite.prototype.setElement = function (element) {\r\n this.element = element;\r\n this.setSVGAttributes();\r\n this.applyAccessibility();\r\n };\r\n Object.defineProperty(Sprite.prototype, \"element\", {\r\n /**\r\n * @return Element\r\n */\r\n get: function () {\r\n return this._element;\r\n },\r\n /**\r\n * The main element for this Sprite, usually an SVG `<g>`.\r\n *\r\n * All other sub-elements are created in it.\r\n *\r\n * @param element Element\r\n */\r\n set: function (element) {\r\n // Destroy previous element if there was one before\r\n this.removeElement();\r\n // Set new element\r\n this._element = element;\r\n // Add element to group\r\n // Since we are adding Element to group, which is already in the\r\n // `.disposers` it will be removed automatically when Sprite is disposed\r\n // of\r\n this.group.add(element);\r\n if (element.node instanceof SVGPathElement) {\r\n this._isPath = true;\r\n }\r\n // This is needed if someone is setting element not in draw method but\r\n // from outside\r\n if (!this.invalid) {\r\n this.validate();\r\n }\r\n if (options.autoSetClassName) {\r\n this.setClassName();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"svgContainer\", {\r\n /**\r\n * HTML container (`<div>`) which is used to place chart's `<svg>` element\r\n * in.\r\n *\r\n * @return Container for chart elements\r\n */\r\n get: function () {\r\n if (this._svgContainer) {\r\n return this._svgContainer;\r\n }\r\n else if (this._parent) {\r\n return this._parent.svgContainer;\r\n }\r\n },\r\n /**\r\n * Sets HTML container to add SVG and other chart elements to.\r\n *\r\n * @param svgContainer Container for chart elements\r\n */\r\n set: function (svgContainer) {\r\n this._svgContainer = svgContainer;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Measures main element.\r\n *\r\n * Saves measurements into private `_bbox` property.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Sprite.prototype.measureElement = function () {\r\n if (this.element) {\r\n if (this.definedBBox) {\r\n this._bbox = this.definedBBox;\r\n }\r\n else {\r\n var svgBBox = this.element.getBBox();\r\n this._bbox = { x: svgBBox.x, y: svgBBox.y, width: svgBBox.width, height: svgBBox.height };\r\n }\r\n }\r\n };\r\n /**\r\n * Positions element according its center settings.\r\n *\r\n * @todo Description (review)\r\n * @ignore Exclude from docs\r\n */\r\n Sprite.prototype.updateCenter = function () {\r\n if (this.element) {\r\n var prevElementTransform = this.element.transformString;\r\n var bbox = this.bbox;\r\n var ex = 0;\r\n var ey = 0;\r\n var elementX = bbox.x;\r\n var elementY = bbox.y;\r\n var elementWidth = bbox.width;\r\n var elementHeigth = bbox.height;\r\n var pixelPaddingLeft = this.pixelPaddingLeft;\r\n var pixelPaddingRight = this.pixelPaddingRight;\r\n var pixelPaddingTop = this.pixelPaddingTop;\r\n var pixelPaddingBottom = this.pixelPaddingBottom;\r\n // add padding to the measured size\r\n var measuredWidth = $math.max(elementWidth + pixelPaddingLeft + pixelPaddingRight, this.pixelWidth);\r\n var measuredHeight = $math.max(elementHeigth + pixelPaddingTop + pixelPaddingBottom, this.pixelHeight);\r\n // extremes\r\n var left = bbox.x;\r\n var right = bbox.x + measuredWidth;\r\n var top_1 = bbox.y;\r\n var bottom = bbox.y + measuredHeight;\r\n var horizontalCenter = this.horizontalCenter;\r\n var verticalCenter = this.verticalCenter;\r\n switch (horizontalCenter) {\r\n case \"none\":\r\n ex = elementX + pixelPaddingLeft;\r\n break;\r\n case \"left\":\r\n ex = pixelPaddingLeft;\r\n break;\r\n case \"middle\":\r\n ex = pixelPaddingLeft - (elementWidth + pixelPaddingRight + pixelPaddingLeft) / 2;\r\n break;\r\n case \"right\":\r\n ex = -pixelPaddingRight - elementWidth;\r\n break;\r\n }\r\n switch (verticalCenter) {\r\n case \"none\":\r\n ey = elementY + pixelPaddingTop;\r\n break;\r\n case \"top\":\r\n ey = pixelPaddingTop;\r\n break;\r\n case \"middle\":\r\n ey = pixelPaddingTop - (elementHeigth + pixelPaddingBottom + pixelPaddingTop) / 2;\r\n break;\r\n case \"bottom\":\r\n ey = -pixelPaddingBottom - elementHeigth;\r\n break;\r\n }\r\n this._measuredHeight = measuredHeight;\r\n this._measuredWidth = measuredWidth;\r\n var x = $math.round(ex - elementX, this._positionPrecision, true);\r\n var y = $math.round(ey - elementY, this._positionPrecision, true);\r\n this.ex = x - pixelPaddingLeft;\r\n this.ey = y - pixelPaddingTop;\r\n this.maxLeft = left + x - pixelPaddingLeft;\r\n this.maxRight = right + x - pixelPaddingLeft;\r\n this.maxTop = top_1 + y - pixelPaddingTop;\r\n this.maxBottom = bottom + y - pixelPaddingTop;\r\n if (this.pixelPerfect && options.pixelPerfectPrecision == 0) {\r\n x -= 0.5;\r\n y -= 0.5;\r\n }\r\n this.element.moveTo({ x: x, y: y });\r\n if (prevElementTransform != this.element.transformString) {\r\n this.dispatchImmediately(\"transformed\");\r\n }\r\n }\r\n };\r\n /**\r\n * Measures the whole element.\r\n *\r\n * Returns `true` if the size has changed from the last measurement.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Did the size changed from the last measurement?\r\n */\r\n Sprite.prototype.measure = function () {\r\n this.updateCenter();\r\n var measuredWidth = this._measuredWidth;\r\n var measuredHeight = this._measuredHeight;\r\n // extremes\r\n var left = this.maxLeft;\r\n var right = this.maxRight;\r\n var top = this.maxTop;\r\n var bottom = this.maxBottom;\r\n // non-parent wise size\r\n this._measuredWidthSelf = measuredWidth;\r\n this._measuredHeightSelf = measuredHeight;\r\n var positionPrecision = this._positionPrecision;\r\n this.maxLeftSelf = this.maxLeft;\r\n this.maxRightSelf = this.maxRight;\r\n this.maxTopSelf = this.maxTop;\r\n this.maxBottomSelf = this.maxBottom;\r\n // if a sprite is rotated or scaled, calculate measured size after transformations\r\n if (this.rotation !== 0 || this.scale !== 1 || this.nonScaling) {\r\n // not good to handleGlobalScale here.\r\n if (this.nonScalingStroke) {\r\n this.strokeWidth = this.strokeWidth;\r\n }\r\n var svg = this.paper.svg;\r\n var matrix = svg.createSVGMatrix();\r\n var rotation = this.rotation;\r\n var scale = this.scale;\r\n if (this.nonScaling) {\r\n scale = this.scale / this.globalScale;\r\n }\r\n matrix.a = $math.cos(rotation) * scale;\r\n matrix.c = -$math.sin(rotation) * scale;\r\n matrix.e = 0;\r\n matrix.b = $math.sin(rotation) * scale;\r\n matrix.d = $math.cos(rotation) * scale;\r\n matrix.f = 0;\r\n var p1 = svg.createSVGPoint();\r\n p1.x = left;\r\n p1.y = top;\r\n var p2 = svg.createSVGPoint();\r\n p2.x = right;\r\n p2.y = top;\r\n var p3 = svg.createSVGPoint();\r\n p3.x = right;\r\n p3.y = bottom;\r\n var p4 = svg.createSVGPoint();\r\n p4.x = left;\r\n p4.y = bottom;\r\n var pt1 = p1.matrixTransform(matrix);\r\n var pt2 = p2.matrixTransform(matrix);\r\n var pt3 = p3.matrixTransform(matrix);\r\n var pt4 = p4.matrixTransform(matrix);\r\n left = Math.min(pt1.x, pt2.x, pt3.x, pt4.x);\r\n right = Math.max(pt1.x, pt2.x, pt3.x, pt4.x);\r\n top = Math.min(pt1.y, pt2.y, pt3.y, pt4.y);\r\n bottom = Math.max(pt1.y, pt2.y, pt3.y, pt4.y);\r\n measuredWidth = right - left;\r\n measuredHeight = bottom - top;\r\n this.maxLeft = $math.round(left, positionPrecision, true);\r\n this.maxRight = $math.round(right, positionPrecision, true);\r\n this.maxTop = $math.round(top, positionPrecision, true);\r\n this.maxBottom = $math.round(bottom, positionPrecision, true);\r\n }\r\n this._measuredWidth = $math.round(measuredWidth, positionPrecision, true);\r\n this._measuredHeight = $math.round(measuredHeight, positionPrecision, true);\r\n // dispatch event\r\n if (this._measuredWidth != this._prevMeasuredWidth || this._measuredHeight != this._prevMeasuredHeight) {\r\n this._prevMeasuredHeight = this._measuredHeight;\r\n this._prevMeasuredWidth = this._measuredWidth;\r\n // TODO clear existing sizechanged dispatches ?\r\n this.dispatch(\"sizechanged\");\r\n if ((this.isHover || this.showTooltipOn == \"hit\" || this.showTooltipOn == \"always\") && this.tooltip && this.tooltip.visible && ($type.hasValue(this.tooltipText) || $type.hasValue(this.tooltipHTML))) {\r\n this.updateTooltipPosition();\r\n }\r\n return true;\r\n }\r\n return false;\r\n };\r\n /**\r\n * Insert this element before sibling element.\r\n *\r\n * @param sprite Target element\r\n * @return This element\r\n */\r\n Sprite.prototype.insertBefore = function (sprite) {\r\n var parent = this._parent;\r\n if (parent) {\r\n var index = parent.children.indexOf(sprite);\r\n if (index !== -1) {\r\n parent.children.moveValue(this, index);\r\n parent.sortChildren();\r\n }\r\n }\r\n return this;\r\n };\r\n /**\r\n * Insert this element after sibling element.\r\n *\r\n * @param sprite Target element\r\n * @return This element\r\n */\r\n Sprite.prototype.insertAfter = function (sprite) {\r\n var parent = this._parent;\r\n if (parent) {\r\n var index = parent.children.indexOf(sprite);\r\n if (index !== -1) {\r\n parent.children.moveValue(this, index + 1);\r\n parent.sortChildren();\r\n }\r\n }\r\n return this;\r\n };\r\n /**\r\n * Removes the main SVG element.\r\n *\r\n * This does not destroy the whole Sprite element. To do that use\r\n * `dispose()` instead.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Sprite.prototype.removeElement = function () {\r\n // remove visual element\r\n if (this._element) {\r\n this.removeDispose(this._element);\r\n this._element = undefined;\r\n }\r\n };\r\n /**\r\n * Returns relative (percent) value of the X coordindate within this element.\r\n *\r\n * A relative value is a hundredth of a percent. So 100% would result in a 1\r\n * as relative value.\r\n *\r\n * @param value Absolute or relative X coordinate\r\n * @return Relative value\r\n */\r\n Sprite.prototype.getRelativeX = function (value) {\r\n if (value instanceof Percent) {\r\n return value.value;\r\n }\r\n else if (this._parent) {\r\n return value / this._parent.innerWidth;\r\n }\r\n return 0;\r\n };\r\n /**\r\n * Returns relative (percent) value of the Y coordindate within this element.\r\n *\r\n * A relative value is a hundredth of a percent. So 100% would result in a 1\r\n * as relative value.\r\n *\r\n * @param value Absolute or relative Y coordinate\r\n * @return Relative value\r\n */\r\n Sprite.prototype.getRelativeY = function (value) {\r\n if (value instanceof Percent) {\r\n return value.value;\r\n }\r\n else if (this._parent) {\r\n return value / this._parent.innerHeight;\r\n }\r\n return 0;\r\n };\r\n /**\r\n * Returns an X coordinate in pixel within the element.\r\n *\r\n * If number is passed in as parameter, the same number will be returned\r\n * back.\r\n *\r\n * If [[Percent]] is passed in, it will be recalculated to pixels.\r\n *\r\n * @param value Absolute or relative X coordinate\r\n * @return X coordinate in pixels\r\n */\r\n Sprite.prototype.getPixelX = function (value) {\r\n // we don't use $utils.valueToRelative as this would mean that we should access parent.innerWidth\r\n // all the time and this would result chain of the same actions and will slow down the system a lot\r\n var pixel = 0;\r\n if ($type.isNumber(value)) {\r\n pixel = value;\r\n }\r\n else if (value instanceof Percent) {\r\n var relative = value.value;\r\n if (this._parent) {\r\n pixel = $math.round(this._parent.innerWidth * relative, this._positionPrecision, true);\r\n }\r\n }\r\n return pixel;\r\n };\r\n /**\r\n * Returns an Y coordinate in pixel within the element.\r\n *\r\n * If number is passed in as parameter, the same number will be returned\r\n * back.\r\n *\r\n * If [[Percent]] is passed in, it will be recalculated to pixels.\r\n *\r\n * @param value Absolute or relative Y coordinate\r\n * @return Y coordinate in pixels\r\n */\r\n Sprite.prototype.getPixelY = function (value) {\r\n // we don't use $utils.valueToRelative as this would mean that we should access parent.innerWidth\r\n // all the time and this would result chain of the same actions and will slow down the system a lot\r\n var pixel = 0;\r\n if ($type.isNumber(value)) {\r\n pixel = value;\r\n }\r\n else if (value instanceof Percent) {\r\n var relative = value.value;\r\n if (this._parent) {\r\n pixel = $math.round(this._parent.innerHeight * relative, this._positionPrecision, true);\r\n }\r\n }\r\n return pixel;\r\n };\r\n /**\r\n * Moves the element to a specified coordinates.\r\n *\r\n * Using this method is preferred method of moving element, as it saves some\r\n * CPU processing power over setting `x` and `y` properties separately.\r\n *\r\n * The method respects element's center settings. The element will be\r\n * positioned so that `point` coordinates come in whatever \"center\" of the\r\n * element is, as set in `horizontalCenter` and `verticalCenter`.\r\n *\r\n * Besides moving the element, you can also at the same time scale and\r\n * rotate the element.\r\n *\r\n * @param point New coordinates\r\n * @param rotation New rotation\r\n * @param scale New Scale\r\n */\r\n Sprite.prototype.moveTo = function (point, rotation, scale, isDragged) {\r\n if (this.isDragged && !isDragged) {\r\n return;\r\n }\r\n if (point) {\r\n if ($type.isNumber(point.x)) {\r\n this.setPropertyValue(\"x\", $math.round(point.x, this._positionPrecision, true));\r\n }\r\n if ($type.isNumber(point.y)) {\r\n this.setPropertyValue(\"y\", $math.round(point.y, this._positionPrecision, true));\r\n }\r\n }\r\n if ($type.isNumber(rotation)) {\r\n this.rotation = rotation;\r\n }\r\n if ($type.isNumber(scale)) {\r\n this.scale = scale;\r\n }\r\n // must leave this\r\n this.invalidatePosition();\r\n };\r\n Object.defineProperty(Sprite.prototype, \"mask\", {\r\n /**\r\n * Returns [[Sprite]] element currently used as mask for this element.\r\n *\r\n * @ignore Exclude from docs\r\n * @return A [[Sprite]] to use as mask\r\n */\r\n get: function () {\r\n if (!this._adapterO) {\r\n return this._mask.get();\r\n }\r\n else {\r\n return this._adapterO.apply(\"mask\", this._mask.get());\r\n }\r\n },\r\n /**\r\n * Sets another [[Sprite]] element as this elements mask.\r\n *\r\n * @ignore Exclude from docs\r\n * @param mask A [[Sprite]] to use as mask\r\n */\r\n set: function (mask) {\r\n var _this = this;\r\n if (this._mask.get() !== mask) {\r\n // this is good\r\n if (mask) {\r\n this.createClipPath();\r\n if (!(mask instanceof Container)) {\r\n mask.isMeasured = false;\r\n if (mask.element) {\r\n this._clipElement = mask.element;\r\n }\r\n }\r\n else {\r\n this._clipElement = this.paper.add(\"rect\");\r\n }\r\n if (this._clipElement) {\r\n this._clipPath.add(this._clipElement);\r\n }\r\n this._mask.set(mask, new MultiDisposer([\r\n //mask.addEventListener(SpriteEvent.TRANSFORMED, this.applyMask, false, this);\r\n mask.events.on(\"maxsizechanged\", function () { if (_this.inited) {\r\n _this.applyMask();\r\n } }, undefined, false),\r\n mask.events.on(\"validated\", this.applyMask, this, false),\r\n mask.events.on(\"positionchanged\", this.applyMask, this, false)\r\n ]));\r\n this.applyMask();\r\n }\r\n else {\r\n this._mask.reset();\r\n this.group.removeAttr(\"clip-path\");\r\n this.removeClipPath();\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"maskRectangle\", {\r\n /**\r\n * @ignore Exclude from docs\r\n * @return Mask Rectangle\r\n */\r\n get: function () {\r\n return this._maskRectangle;\r\n },\r\n // you can set IRectangle as a mask instead o a sprite. Note, the changes of the object won't be monitored\r\n /**\r\n * Instead of creating a [[Sprite]] for mask, you can just use a\r\n * [[Rectangle]] by setting this accessor.\r\n *\r\n * Please note that the element will not monitor any changes to the mask\r\n * rectangle.\r\n *\r\n * @ignore Exclude from docs\r\n * @param rect Mask Rectangle\r\n */\r\n set: function (rect) {\r\n if (rect) {\r\n this.createClipPath();\r\n if (!this._clipElement) {\r\n this._clipElement = this.paper.add(\"rect\");\r\n this._clipPath.add(this._clipElement);\r\n }\r\n this._clipElement.attr({ \"width\": rect.width, \"height\": rect.height });\r\n }\r\n else {\r\n this.removeClipPath();\r\n this._clipElement = undefined;\r\n }\r\n this._maskRectangle = rect;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"isMeasured\", {\r\n /**\r\n * @ignore Exclude from docs\r\n * @return Was element already measured?\r\n */\r\n get: function () {\r\n return this._isMeasured;\r\n },\r\n /**\r\n * Indicates if this element was already measured.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Was element already measured?\r\n */\r\n set: function (value) {\r\n value = $type.toBoolean(value);\r\n if (!value) {\r\n this._measuredWidth = 0;\r\n this._measuredHeight = 0;\r\n //this._pixelHeight = 0;\r\n //this._pixelWidth = 0;\r\n }\r\n if (this._isMeasured != value) {\r\n this._isMeasured = value;\r\n this.invalidatePosition();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Checks if the this element has any of its parts overlapping with another\r\n * element.\r\n *\r\n * @todo Description (review)\r\n * @param sprite Second element to test again\r\n * @return Overlapping?\r\n */\r\n Sprite.prototype.hitTest = function (sprite) {\r\n // validate, otherwise we will not know measuredWidth and measuredHeight\r\n if (this.invalid) {\r\n this.validate();\r\n }\r\n if (sprite.invalid) {\r\n sprite.validate();\r\n }\r\n var ax1 = this.pixelX + this.maxLeft;\r\n var ay1 = this.pixelY + this.maxTop;\r\n var ax2 = ax1 + this.maxRight;\r\n var ay2 = ay1 + this.maxBottom;\r\n var bx1 = sprite.pixelX + sprite.maxLeft;\r\n var by1 = sprite.pixelY + sprite.maxTop;\r\n var bx2 = bx1 + sprite.maxRight;\r\n var by2 = by1 + sprite.maxBottom;\r\n return !(bx1 > ax2 || bx2 < ax1 || by1 > ay2 || by2 < ay1);\r\n };\r\n Object.defineProperty(Sprite.prototype, \"inited\", {\r\n /**\r\n * ==========================================================================\r\n * STATE-RELATED\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Returns `true` if Sprite has already finished initializing.\r\n *\r\n * @return Initialized?\r\n */\r\n get: function () {\r\n return this._inited;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Returns `true` if Sprite has already finished initializing and is ready.\r\n *\r\n * If this object is a [[Container]] it will wait for all of its children\r\n * are ready before becoming ready itself and firing a `\"ready\"` event.\r\n *\r\n * @return is ready?\r\n */\r\n Sprite.prototype.isReady = function () {\r\n return this._ready;\r\n };\r\n Object.defineProperty(Sprite.prototype, \"states\", {\r\n /**\r\n * Returns a collection of element's available [[SpriteState]] entries.\r\n *\r\n * @see {@link SpriteState}\r\n * @return States\r\n */\r\n get: function () {\r\n if (!this._states) {\r\n var state = new SpriteState();\r\n // works\r\n this._states = new DictionaryTemplate(state);\r\n // TODO what about removeKey ?\r\n this._disposers.push(this._states.events.on(\"insertKey\", this.processState, this, false));\r\n this._disposers.push(this._states.events.on(\"setKey\", this.processState, this, false));\r\n this._disposers.push(new DictionaryDisposer(this._states));\r\n this._disposers.push(state);\r\n }\r\n return this._states;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"hiddenState\", {\r\n /**\r\n * Returns a [[SpriteState]] object for \"hidden\" state.\r\n *\r\n * This is a shortcut to `this.states.getKey(\"hidden\")`.\r\n *\r\n * @return Hidden state\r\n */\r\n get: function () {\r\n if (!this.states.getKey(\"hidden\")) {\r\n var hiddenState = this.states.create(\"hidden\");\r\n hiddenState.properties.opacity = 0;\r\n hiddenState.properties.visible = false;\r\n }\r\n return this.states.getKey(\"hidden\");\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"defaultState\", {\r\n /**\r\n * Returns a [[SpriteState]] object for \"default\" state.\r\n *\r\n * This is a shortcut to `this.states.getKey(\"default\")`.\r\n *\r\n * @return Hidden state\r\n */\r\n get: function () {\r\n if (!this.states.getKey(\"default\")) {\r\n var defaultState = this.states.create(\"default\");\r\n defaultState.properties.opacity = 1;\r\n }\r\n return this.states.getKey(\"default\");\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Checks if some key states are defined and updates Sprite properties\r\n * accordingly.\r\n *\r\n * For example if there's a state \"down\" defined for Sprite, we automatically\r\n * make it \"clickable\".\r\n *\r\n * @ignore Exclude from docs\r\n * @param event An event which caused state list update\r\n */\r\n Sprite.prototype.processState = function (event) {\r\n var state = event.newValue;\r\n state.sprite = this;\r\n state.name = event.key;\r\n if (this.states.hasKey(\"hover\") || (this.showTooltipOn == \"hover\" && ($type.hasValue(this.tooltipHTML) || $type.hasValue(this.tooltipText)))) {\r\n this.hoverable = true;\r\n }\r\n if (this.states.hasKey(\"down\") || (this.showTooltipOn == \"hover\" && ($type.hasValue(this.tooltipHTML) || $type.hasValue(this.tooltipText)))) {\r\n this.clickable = true;\r\n }\r\n if (this.states.hasKey(\"focus\")) {\r\n this.focusable = true;\r\n }\r\n // Propagate the new state to clones\r\n if (this.applyOnClones) {\r\n var clones = this.clones.values;\r\n var length_1 = clones.length;\r\n for (var i = 0; i < length_1; ++i) {\r\n var clone = clones[i];\r\n if (!clone.isDisposed()) {\r\n clone.states.setKey(state.name, state);\r\n }\r\n }\r\n }\r\n };\r\n Object.defineProperty(Sprite.prototype, \"animations\", {\r\n /**\r\n * Returns a list elements's animations currently being played.\r\n *\r\n * If the list has not been initialized it is created.\r\n *\r\n * @return List of animations\r\n */\r\n get: function () {\r\n if (!this._animations) {\r\n this._animations = [];\r\n this._disposers.push(new AnimationDisposer(this._animations));\r\n }\r\n return this._animations;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Converts element's local coordinates to the coordinates within the main\r\n * chart container.\r\n *\r\n * @param point Local point\r\n * @return Global point\r\n */\r\n Sprite.prototype.getSvgPoint = function (point) {\r\n try {\r\n // Calculate SVG point\r\n var bbox = this.htmlContainer.getBoundingClientRect();\r\n return {\r\n \"x\": point.x - bbox.left,\r\n \"y\": point.y - bbox.top\r\n };\r\n }\r\n catch (e) {\r\n return point;\r\n }\r\n };\r\n /**\r\n * Creates and starts an [[Animation]] with given `animationOptions`.\r\n *\r\n * @see {@link Animation} for additional information about available options\r\n * @param animationOptions Animation options\r\n * @param duration Duration in milliseconds\r\n * @param easing Easing function\r\n * @return Animation instance\r\n */\r\n Sprite.prototype.animate = function (animationOptions, duration, easing) {\r\n return new Animation(this, animationOptions, duration, easing).start();\r\n };\r\n /**\r\n * Applies a [[SpriteState]] on this element.\r\n *\r\n * The first parameter can either be a name state or a [[SpriteState]]\r\n * instance.\r\n *\r\n * When run, this method will apply SVG properties defined in a\r\n * [[SpriteState]], but only those that are relevant to this particular\r\n * element, i.e. are in the `properties` array.\r\n *\r\n * @see {@link SpriteState}\r\n * @param value A state - name key or instance\r\n * @param transitionDuration Duration of the transition between current and new state\r\n * @param easing An easing function\r\n */\r\n Sprite.prototype.setState = function (value, transitionDuration, easing) {\r\n var state;\r\n if (value instanceof SpriteState) {\r\n this.states.setKey(value.name, value);\r\n state = value;\r\n }\r\n else {\r\n state = this.states.getKey(value);\r\n if (!state) {\r\n return;\r\n }\r\n }\r\n // stop previous transition\r\n // not good - foe expample, we are animating to some \"active\" state and in them middle \"hover\" state happens. then \"active\" stat won't be applied\r\n //if (this._transition) {\r\n //this._transition.stop();\r\n //}\r\n if (state.name == \"hover\") {\r\n if (this.isHidden) {\r\n return;\r\n }\r\n this.isHover = true;\r\n }\r\n if (state.name == \"hidden\") {\r\n this.isHiding = true;\r\n }\r\n else {\r\n if (!this.visible) {\r\n this.setVisibility(state.properties.visible || this.defaultState.properties.visible);\r\n }\r\n }\r\n if (state.name == \"active\") {\r\n this.isActive = true;\r\n }\r\n // we do not set isActive = false here if it's not active, but container does that if setStateOnChildren = true\r\n if (!$type.isNumber(transitionDuration)) {\r\n transitionDuration = state.transitionDuration;\r\n }\r\n if (!$type.hasValue(easing)) {\r\n easing = state.transitionEasing;\r\n }\r\n return this.transitTo(state, transitionDuration, easing);\r\n };\r\n /**\r\n * Applies proper state based on the condition of the element. A condition is\r\n * deducted in this order:\r\n * * \"hover\" if Sprite has currently any pointers over it\r\n * * \"down\" if Sprite has any pointers (touch or mouse) currently pressed over it\r\n * * \"focus\" if Sprite has currently got focus (accessibility)\r\n * * \"hidden\" if Sprite is currently hidden\r\n *\r\n * Returns an [[Animation]] object, which is handling gradual transition from\r\n * current values of properties, to the new target state(s).\r\n *\r\n * @param duration Duration for the animation (ms)\r\n * @return [[Animation]] object which is handling the transition\r\n */\r\n Sprite.prototype.applyCurrentState = function (duration) {\r\n //if (!this.isHidden) { // this was done for hover state not to take effect if \"hidden\" is actually visible, need to think about it.\r\n var animation = this.setState(this.defaultState, duration);\r\n if (this.isHover) {\r\n animation = this.setState(\"hover\", duration);\r\n }\r\n if (this.isDown && this.interactions.downPointers.length) {\r\n animation = this.setState(\"down\", duration);\r\n }\r\n this.isFocused = this.isFocused;\r\n if (this.isActive) {\r\n animation = this.setState(\"active\", duration);\r\n if (this.isHover && this.states.hasKey(\"hoverActive\")) {\r\n animation = this.setState(\"hoverActive\", duration);\r\n }\r\n }\r\n return animation;\r\n //}\r\n };\r\n /**\r\n * Starts an [[Animation]] of the properties to specific values as they are\r\n * set in `state`.\r\n *\r\n * @ignore Exclude from docs\r\n * @param state Target State\r\n * @param duration Duration in milliseconds\r\n * @param easing Easing function\r\n * @return Transition Animation\r\n */\r\n Sprite.prototype.transitTo = function (state, duration, easing) {\r\n var _this = this;\r\n // Init\r\n var options = [], propValues = state.allValues, transition;\r\n // todo: do this for numeric/color properties only?\r\n // @todo use state.getPropertyValue instead\r\n $object.each(propValues, function (propertyName, finalValue) {\r\n var currentValue = _this[propertyName];\r\n // save current value to default state. this solves a big problem where values must be set both on sprite and default state\r\n if (finalValue != currentValue && _this.defaultState.properties[propertyName] == undefined) {\r\n _this.defaultState.properties[propertyName] = currentValue;\r\n }\r\n //if (finalValue != currentValue && $type.hasValue(finalValue)) {\r\n if (finalValue != \"__unset\") {\r\n var option = { from: currentValue, to: finalValue, property: propertyName };\r\n options.push(option);\r\n }\r\n });\r\n if (options.length > 0) {\r\n transition = this.animate(options, duration, easing);\r\n if (transition && !transition.isFinished()) {\r\n // TODO should this use events.once ?\r\n // TODO push onto _disposers array ?\r\n this._disposers.push(transition.events.on(\"animationended\", function () {\r\n _this.dispatchImmediately(\"transitionended\");\r\n }));\r\n }\r\n else {\r\n this.dispatchImmediately(\"transitionended\");\r\n }\r\n }\r\n // apply filters if set\r\n if (state.filters.length > 0) {\r\n var newFilters_1 = [];\r\n // check for the same filters\r\n $iter.each(state.filters.iterator(), function (stateFilter) {\r\n var newFilter = stateFilter.clone();\r\n newFilters_1.push(newFilter);\r\n var animationOptions = [];\r\n $iter.each(_this.filters.iterator(), function (currentFilter) {\r\n // if we have the same filters\r\n if (currentFilter.className == newFilter.className) {\r\n if (!$iter.contains(_this.defaultState.filters.iterator(), function (x) { return x.className === newFilter.className; })) {\r\n _this.defaultState.filters.push(currentFilter);\r\n }\r\n $object.each(newFilter.properties, function (propertyName, newValue) {\r\n var currentValue = currentFilter.properties[propertyName];\r\n // if values are not the same, push to animation options array\r\n if (currentValue != newValue) {\r\n animationOptions.push({ property: propertyName, from: currentValue, to: newValue });\r\n }\r\n });\r\n }\r\n });\r\n // animate to new value\r\n newFilter.animate(animationOptions, duration, easing);\r\n });\r\n this.filters.clear();\r\n this.filters.pushAll(newFilters_1);\r\n }\r\n return transition;\r\n };\r\n /**\r\n * Returns `true` if Sprite is currently transiting from one state/value to\r\n * another.\r\n *\r\n * @return Is in transition?\r\n */\r\n Sprite.prototype.isInTransition = function () {\r\n return this.animations.length > 0;\r\n };\r\n Object.defineProperty(Sprite.prototype, \"isHover\", {\r\n /**\r\n * @return Is hovered?\r\n */\r\n get: function () {\r\n if (this.isInteractive()) {\r\n return this.interactions.isHover;\r\n }\r\n return false;\r\n },\r\n /**\r\n * Indicates if this element has a mouse pointer currently hovering\r\n * over it, or if it has any touch pointers pressed on it.\r\n *\r\n * You can force element to be \"hovered\" manually, by setting this property\r\n * to `true`.\r\n *\r\n * @param value Is hovered?\r\n */\r\n set: function (value) {\r\n value = $type.toBoolean(value);\r\n if (value !== this.isHover) {\r\n if (this.isInteractive()) {\r\n this.interactions.isHover = value;\r\n if (value) {\r\n this.handleOver();\r\n }\r\n else {\r\n this.interactions.isRealHover = false;\r\n this.handleOut();\r\n }\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"isDragged\", {\r\n /**\r\n * Returns indicator if this element is being dragged at the moment.\r\n *\r\n * @return Is dragged?\r\n */\r\n get: function () {\r\n return this._isDragged;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"isResized\", {\r\n /**\r\n * Returns indicator if this element is being resized at the moment.\r\n *\r\n * @return Is resized?\r\n */\r\n get: function () {\r\n return this._isResized;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"isDown\", {\r\n /**\r\n * @return Is down?\r\n */\r\n get: function () {\r\n if (this.isInteractive()) {\r\n return this.interactions.isDown;\r\n }\r\n return false;\r\n },\r\n /**\r\n * Indicates if this element has any pointers (mouse or touch) pressing down\r\n * on it.\r\n *\r\n * @param value Is down?\r\n */\r\n set: function (value) {\r\n value = $type.toBoolean(value);\r\n if (this.isInteractive() && this.isDown != value) {\r\n this.interactions.isDown = value;\r\n if (value) {\r\n this.handleDown();\r\n }\r\n else {\r\n this.handleUp();\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"isFocused\", {\r\n /**\r\n * @return Is focused?\r\n */\r\n get: function () {\r\n if (this.isInteractive()) {\r\n return this.interactions.isFocused;\r\n }\r\n return false;\r\n },\r\n /**\r\n * Indicates if this element is focused (possibly by tab navigation).\r\n *\r\n * @param value Is focused?\r\n */\r\n set: function (value) {\r\n value = $type.toBoolean(value);\r\n if (this.focusable && this.isFocused != value) {\r\n if (this.isInteractive()) {\r\n this.interactions.isFocused = value;\r\n if (value === true) {\r\n this.handleFocus();\r\n }\r\n else {\r\n this.handleBlur();\r\n }\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"isActive\", {\r\n /**\r\n * @return Is active?\r\n */\r\n get: function () {\r\n return this._isActive;\r\n },\r\n /**\r\n * Indicates if this element is currently active (toggled on) or not\r\n * (toggled off).\r\n *\r\n * @param value Is active?\r\n */\r\n set: function (value) {\r\n this.setActive(value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Sprite.prototype.setActive = function (value) {\r\n value = $type.toBoolean(value);\r\n if (this._isActive !== value) {\r\n this._isActive = value;\r\n if (value && this.states.hasKey(\"active\")) {\r\n this.setState(\"active\");\r\n if (this.isHover && this.states.hasKey(\"hoverActive\")) {\r\n this.setState(\"hoverActive\");\r\n }\r\n }\r\n else {\r\n this.applyCurrentState();\r\n }\r\n this.dispatchImmediately(\"toggled\");\r\n }\r\n };\r\n Object.defineProperty(Sprite.prototype, \"disabled\", {\r\n /**\r\n * @return Disabled?\r\n */\r\n get: function () {\r\n //if(this._internalDisabled){\r\n //\treturn true;\r\n //}\r\n var current = this.getPropertyValue(\"disabled\");\r\n if ($type.hasValue(current)) {\r\n return current;\r\n }\r\n else {\r\n if (this.virtualParent) {\r\n return this.virtualParent.disabled;\r\n }\r\n if (this._parent) {\r\n return this._parent.disabled;\r\n }\r\n }\r\n return false;\r\n },\r\n /**\r\n * Controls if element is disabled.\r\n *\r\n * A disabled element is hidden, and is removed from any processing, layout\r\n * calculations, and generally treated as if it does not exist.\r\n *\r\n * The element itself is not destroyed, though. Setting this back to `false`,\r\n * will \"resurrect\" the element.\r\n *\r\n * @param value Disabled?\r\n */\r\n set: function (value) {\r\n this.setDisabled(value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Sprite.prototype.setDisabled = function (value) {\r\n value = $type.toBoolean(value);\r\n var current = this.getPropertyValue(\"disabled\");\r\n if (current != value) {\r\n this.setPropertyValue(\"disabled\", value, true);\r\n if (value) {\r\n this.parent = this._parent;\r\n this.removeFromInvalids();\r\n this.group.attr({ \"display\": \"none\" });\r\n this.dispatch(\"disabled\");\r\n }\r\n else {\r\n if (this._parent) {\r\n var group = this._parent.element;\r\n if (!group.hasChild(this.group)) {\r\n group.add(this.group);\r\n }\r\n }\r\n if (this instanceof Container) {\r\n this.deepInvalidate();\r\n if (this._background) {\r\n this._background.invalidate();\r\n }\r\n }\r\n else {\r\n this.invalidate();\r\n }\r\n if (!this.__disabled) {\r\n this.removeSVGAttribute(\"display\");\r\n }\r\n this.dispatch(\"enabled\");\r\n }\r\n this.dispatch(\"transformed\");\r\n system.requestFrame();\r\n return true;\r\n }\r\n return false;\r\n };\r\n Object.defineProperty(Sprite.prototype, \"__disabled\", {\r\n /**\r\n * @ignore\r\n * @return Disabled?\r\n */\r\n get: function () {\r\n return this._internalDisabled;\r\n },\r\n /**\r\n * Internal disable method.\r\n *\r\n * Do not use it for disabling elements. Use `disabled` accessor instead.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Disabled?\r\n */\r\n set: function (value) {\r\n if (this._internalDisabled != value) {\r\n this._internalDisabled = value;\r\n this._updateDisabled = true;\r\n this.invalidatePosition(); // better use this instead of invalidate()\r\n if (!value) {\r\n this.invalidate();\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"numberFormatter\", {\r\n /**\r\n * @return A [[NumberFormatter]] instance to be used\r\n */\r\n get: function () {\r\n if (this._numberFormatter) {\r\n return this._numberFormatter;\r\n }\r\n else if (this.virtualParent) {\r\n return this.virtualParent.numberFormatter;\r\n }\r\n else if (this._parent) {\r\n return this._parent.numberFormatter;\r\n }\r\n this._numberFormatter = new NumberFormatter();\r\n this._numberFormatter.language = this.language;\r\n return this.numberFormatter;\r\n },\r\n /**\r\n * ==========================================================================\r\n * FORMATTERS AND OTHER EXTERNAL HELPERS\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * A [[NumberFormatter]] instance.\r\n *\r\n * This is used to format numbers.\r\n *\r\n * ```TypeScript\r\n * chart.numberFormatter.numberFormat = \"#,###.#####\";\r\n * ```\r\n * ```JavaScript\r\n * chart.numberFormatter.numberFormat = \"#,###.#####\";\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"numberFormatter\": {\r\n * \"numberFormat\": \"#,###.#####\"\r\n * }\r\n * }\r\n * ```\r\n *\r\n * You can set a separate instance of formatter for each\r\n * individual element. However that would be unnecessary overhead as\r\n * all elements would automatically inherit formatter from their parents,\r\n * all the way up to the chart itself.\r\n *\r\n *\r\n * @see {@link NumberFormatter} for more info on formatting numbers\r\n * @param value An instance of NumberFormatter\r\n */\r\n set: function (value) {\r\n this._numberFormatter = value;\r\n this._numberFormatter.language = this.language;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"dateFormatter\", {\r\n /**\r\n * @return An instance of DateFormatter\r\n */\r\n get: function () {\r\n if (this._dateFormatter) {\r\n return this._dateFormatter;\r\n }\r\n else if (this.virtualParent) {\r\n return this.virtualParent.dateFormatter;\r\n }\r\n else if (this._parent) {\r\n return this._parent.dateFormatter;\r\n }\r\n this._dateFormatter = new DateFormatter();\r\n this._dateFormatter.language = this.language;\r\n return this.dateFormatter;\r\n },\r\n /**\r\n * A [[DateFormatter]] instance.\r\n *\r\n * This is used to format dates, e.g. on a date axes, balloons, etc.\r\n *\r\n * ```TypeScript\r\n * chart.dateFormatter.dateFormat = \"yyyy-MM-dd\";\r\n * ```\r\n * ```JavaScript\r\n * chart.dateFormatter.dateFormat = \"yyyy-MM-dd\";\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"dateFormatter\": {\r\n * \"dateFormat\": \"yyyy-MM-dd\"\r\n * }\r\n * }\r\n * ```\r\n *\r\n * You can set a separate instance of formatter for each\r\n * individual element. However that would be unnecessary overhead as\r\n * all elements would automatically inherit formatter from their parents,\r\n * all the way up to the chart itself.\r\n *\r\n * @see {@link DateFormatter} for more info on dates formatting\r\n * @param value An instance of DateFormatter\r\n */\r\n set: function (value) {\r\n this._dateFormatter = value;\r\n this._dateFormatter.language = this.language;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"durationFormatter\", {\r\n /**\r\n * @return An instance of DurationFormatter\r\n */\r\n get: function () {\r\n if (this._durationFormatter) {\r\n return this._durationFormatter;\r\n }\r\n else if (this.virtualParent) {\r\n return this.virtualParent.durationFormatter;\r\n }\r\n else if (this._parent) {\r\n return this._parent.durationFormatter;\r\n }\r\n this._durationFormatter = new DurationFormatter();\r\n this._durationFormatter.language = this.language;\r\n return this.durationFormatter;\r\n },\r\n /**\r\n * A [[DurationFormatter]] instance.\r\n *\r\n * This is used to format numbers as durations, e.g. on a value axes.\r\n *\r\n * You can set a separate instance of formatter for each\r\n * individual element. However that would be unnecessary overhead as\r\n * all elements would automatically inherit formatter from their parents,\r\n * all the way up to the chart itself.\r\n *\r\n * @see {@link DurationFormatter} for more info on durations\r\n * @param value An instance of DurationFormatter\r\n */\r\n set: function (value) {\r\n this._durationFormatter = value;\r\n this._durationFormatter.language = this.language;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"language\", {\r\n /**\r\n * @return An instance of Language\r\n */\r\n get: function () {\r\n var language = this._language.get();\r\n if (language) {\r\n return language;\r\n }\r\n else if (this.virtualParent) {\r\n return this.virtualParent.language;\r\n }\r\n else if (this._parent) {\r\n return this._parent.language;\r\n }\r\n language = new Language();\r\n this.language = language;\r\n return language;\r\n },\r\n /**\r\n * A [[Language]] instance to use for translations.\r\n *\r\n * Normally it is enough to set language for the top-most element - chart.\r\n *\r\n * All other element child elements will automatically re-use that language\r\n * object.\r\n *\r\n * @param value An instance of Language\r\n */\r\n set: function (value) {\r\n var _this = this;\r\n if (this._language.get() !== value) {\r\n this._language.set(value, value.events.on(\"localechanged\", function (ev) {\r\n if (_this._numberFormatter) {\r\n _this._numberFormatter.language = _this.language;\r\n }\r\n if (_this._dateFormatter) {\r\n _this._dateFormatter.language = _this.language;\r\n }\r\n if (_this._durationFormatter) {\r\n _this._durationFormatter.language = _this.language;\r\n }\r\n if (_this._exporting.get()) {\r\n var exporting = _this._exporting.get();\r\n exporting.numberFormatter.language = _this.language;\r\n exporting.dateFormatter.language = _this.language;\r\n exporting.durationFormatter.language = _this.language;\r\n exporting.language = _this.language;\r\n }\r\n if (_this instanceof Container) {\r\n _this.deepInvalidate();\r\n }\r\n }));\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * ==========================================================================\r\n * DATA-RELATED STUFF\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Parses the string for meta tags `{tag}` and replaces them with a real\r\n * value. Supports straight up tags referring to the field in data, i.e.\r\n * `{value}` or tags with additional formatting info. E.g.:\r\n *\r\n * ```Text\r\n * {myfield.formatDate(\"yyyy-MM-dd\")}\r\n * {myfield.formatDate()}\r\n * {myfield.formatNumber(\"#,####.00\")}\r\n * {myfield.formatNumber()}\r\n * {myField.formatDuration(\"mm:ss\")}\r\n * ```\r\n *\r\n * Etc.\r\n *\r\n * This method Will automatically detect and use proper formatter for the\r\n * value.\r\n *\r\n * The source value will be looked up in various places: (in order)\r\n * * Sprite's own `dataItem`\r\n * * Sprite's properties\r\n * * Parent's `dataItem`\r\n * * Parent's properties\r\n *\r\n * @ignore Exclude from docs\r\n * @param string A string to format\r\n * @param dataItem DataItem\r\n * @return Formatted string\r\n */\r\n Sprite.prototype.populateString = function (string, dataItem) {\r\n if ($type.hasValue(string)) {\r\n string = $type.castString(string);\r\n string = getTextFormatter().escape(string);\r\n var tags = string.match(/\\{([^}]+)\\}/g);\r\n var i = void 0;\r\n if (tags) {\r\n for (i = 0; i < tags.length; i++) {\r\n var tag = tags[i].replace(/\\{([^}]+)\\}/, \"$1\");\r\n var value = this.getTagValue(tag, \"\", dataItem);\r\n if (!$type.hasValue(value)) {\r\n value = \"\";\r\n }\r\n string = string.split(tags[i]).join(value);\r\n }\r\n }\r\n string = getTextFormatter().unescape(string);\r\n }\r\n else {\r\n string = \"\";\r\n }\r\n if (!this._adapterO) {\r\n return string;\r\n }\r\n else {\r\n return this._adapterO.apply(\"populateString\", string);\r\n }\r\n };\r\n /**\r\n * Gets the value from data item and formats it according to specified format.\r\n *\r\n * If `format` is specified, it will use its contents to choose formatter for\r\n * the value. Otherwise it will select formatter accordingly to actual value\r\n * type.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Ability to force certain formatter on known numeric and date values\r\n * @see {@link NumberFormatter}\r\n * @see {@link DateFormatter}\r\n * @see {@link DurationFormatter}\r\n * @param tagName Tag name to replace\r\n * @param format Format to use\r\n * @param dataItem DataItem\r\n * @return Formatted value\r\n */\r\n Sprite.prototype.getTagValue = function (tagName, format, dataItem) {\r\n var value;\r\n if (!$type.hasValue(dataItem)) {\r\n dataItem = this.dataItem;\r\n }\r\n // Parse parts\r\n var parts = [];\r\n var reg = /([^.]+)\\(([^)]*)\\)|([^.]+)/g;\r\n ;\r\n var matches;\r\n while (true) {\r\n matches = reg.exec(tagName);\r\n if (matches === null) {\r\n break;\r\n }\r\n if (matches[3]) {\r\n // Simple property\r\n parts.push({\r\n prop: matches[3]\r\n });\r\n }\r\n else {\r\n // Method\r\n // Parse parameters\r\n var params = [];\r\n if ($utils.trim(matches[2]) != \"\") {\r\n var reg2 = /'([^']*)'|\"([^\"]*)\"|([0-9\\-]+)/g;\r\n var matches2 = void 0;\r\n while (true) {\r\n matches2 = reg2.exec(matches[2]);\r\n if (matches2 === null) {\r\n break;\r\n }\r\n params.push(matches2[1] || matches2[2] || matches2[3]);\r\n }\r\n }\r\n parts.push({\r\n method: matches[1],\r\n params: params\r\n });\r\n }\r\n }\r\n // Check if we can retrieve the value from data item\r\n if (dataItem) {\r\n // Check values\r\n value = this.getTagValueFromObject(parts, dataItem.values);\r\n // Check properties\r\n if (!$type.hasValue(value) || $type.isObject(value)) { // isObject helps to solve problem with date axis, as for example dateX will get dateX from values object and won't get to the dateX date.\r\n value = this.getTagValueFromObject(parts, dataItem);\r\n }\r\n // Check data context\r\n var dataContext = dataItem.dataContext;\r\n if (!$type.hasValue(value) && dataContext) {\r\n value = this.getTagValueFromObject(parts, dataItem.dataContext);\r\n // Maybe it's a literal dot-separated name of the key in dataContext?\r\n if (!$type.hasValue(value)) {\r\n value = this.getTagValueFromObject([{\r\n prop: tagName\r\n }], dataContext);\r\n }\r\n // scond data context level sometimes exist (tree map)\r\n if (!$type.hasValue(value) && dataContext.dataContext) {\r\n value = this.getTagValueFromObject(parts, dataContext.dataContext);\r\n }\r\n }\r\n // Check component's data item\r\n if (!$type.hasValue(value) && dataItem.component && dataItem.component.dataItem !== dataItem) {\r\n value = dataItem.component.getTagValue(tagName, format);\r\n }\r\n }\r\n // Check sprite's properties\r\n if (!$type.hasValue(value)) {\r\n value = this.getTagValueFromObject(parts, this.populateStringFrom || this);\r\n }\r\n // Finally, check the parent\r\n if (!$type.hasValue(value) && this._parent) {\r\n value = this._parent.getTagValue(tagName, format);\r\n }\r\n return value;\r\n };\r\n /**\r\n * Tries to retrieve values from properties of any object, then applies\r\n * proper formatting to it.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description (improve)\r\n * @param parts Properties ant methods to access\r\n * @param object Source object\r\n * @param format A specific format to apply\r\n * @return Formatted value\r\n */\r\n Sprite.prototype.getTagValueFromObject = function (parts, object, format) {\r\n var current = object;\r\n var formatApplied = false;\r\n for (var i = 0, len = parts.length; i < len; i++) {\r\n var part = parts[i];\r\n if (part.prop) {\r\n // Regular property\r\n current = current[part.prop];\r\n if (!$type.hasValue(current)) {\r\n // Not set, return undefined\r\n return;\r\n }\r\n }\r\n else {\r\n // Method\r\n switch (part.method) {\r\n case \"formatNumber\":\r\n var numberValue = $utils.anyToNumber(current);\r\n if ($type.hasValue(numberValue)) {\r\n current = this.numberFormatter.format(numberValue, format || part.params[0] || undefined);\r\n formatApplied = true;\r\n }\r\n break;\r\n case \"formatDate\":\r\n var dateValue = void 0;\r\n if ($type.isString(current)) {\r\n dateValue = this.dateFormatter.parse(current);\r\n }\r\n else {\r\n dateValue = $utils.anyToDate(current);\r\n }\r\n if (!$type.isDate(dateValue) || $type.isNaN(dateValue.getTime())) {\r\n // Was not able to get date out of value, quitting and letting\r\n // calling method try another value\r\n return;\r\n }\r\n if ($type.hasValue(dateValue)) {\r\n current = this.dateFormatter.format(dateValue, format || part.params[0] || undefined);\r\n formatApplied = true;\r\n }\r\n break;\r\n case \"formatDuration\":\r\n var durationValue = $utils.anyToNumber(current);\r\n if ($type.hasValue(durationValue)) {\r\n current = this.durationFormatter.format(durationValue, format || part.params[0] || undefined, part.params[1] || undefined);\r\n formatApplied = true;\r\n }\r\n break;\r\n case \"urlEncode\":\r\n case \"encodeURIComponent\":\r\n current = encodeURIComponent(current);\r\n break;\r\n default:\r\n if (current[part.method]) {\r\n current[part.method].apply(this, part.params);\r\n }\r\n break;\r\n }\r\n }\r\n }\r\n // Apply default format if it wasn't applied explicitly\r\n if (!formatApplied) {\r\n var formatParts = [{\r\n method: \"\",\r\n params: format\r\n }];\r\n if (!$type.hasValue(format)) {\r\n // Format is not set\r\n // Determine from the type of the value\r\n if ($type.isNumber(current)) {\r\n formatParts[0].method = \"formatNumber\";\r\n formatParts[0].params = \"\";\r\n }\r\n else if ($type.isDate(current)) {\r\n formatParts[0].method = \"formatDate\";\r\n formatParts[0].params = \"\";\r\n }\r\n }\r\n else {\r\n // Format set\r\n // Try to determine formatter based on the format\r\n var formatterType = $utils.getFormat(format);\r\n // format\r\n if (formatterType === $strings.NUMBER) {\r\n formatParts[0].method = \"formatNumber\";\r\n }\r\n else if (formatterType === $strings.DATE) {\r\n formatParts[0].method = \"formatDate\";\r\n }\r\n else if (formatterType === $strings.DURATION) {\r\n formatParts[0].method = \"formatDuration\";\r\n }\r\n }\r\n // Apply format\r\n if (formatParts[0].method) {\r\n current = this.getTagValueFromObject(formatParts, current);\r\n }\r\n }\r\n return current;\r\n };\r\n Object.defineProperty(Sprite.prototype, \"dataItem\", {\r\n /**\r\n * @return [[DataItem]]\r\n */\r\n get: function () {\r\n if (!this._dataItem) {\r\n if (this.virtualParent) {\r\n return this.virtualParent.dataItem;\r\n }\r\n if (this._parent) {\r\n return this._parent.dataItem;\r\n }\r\n }\r\n return this._dataItem;\r\n },\r\n /**\r\n * A [[DataItem]] to use as element's data source.\r\n *\r\n * @todo Review type\r\n * @param dataItem DataItem\r\n */\r\n set: function (dataItem) {\r\n //an not use this[\"_dataItem\"] here, as we return parent data item if this sprite doesn't have one.\r\n // @todo:think about it\r\n this.setDataItem(dataItem);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Sets currently used [[DataItem]].\r\n *\r\n * If the element has also `configField` set, it will also look for any\r\n * config in DataItem's data context to apply to this element.\r\n *\r\n * @param dataItem DataItem\r\n */\r\n Sprite.prototype.setDataItem = function (dataItem) {\r\n var _this = this;\r\n if (this._dataItem != dataItem) {\r\n this._dataItem = dataItem;\r\n if (dataItem) {\r\n if (this.configField) {\r\n var dataContext_1 = dataItem.dataContext;\r\n if (dataContext_1) {\r\n this.config = dataContext_1[this.configField];\r\n if (!this.config && dataContext_1.dataContext) {\r\n this.config = dataContext_1.dataContext[this.configField];\r\n }\r\n }\r\n }\r\n var dataContext_2 = dataItem.dataContext;\r\n if (dataContext_2) {\r\n var dataContext2_1 = dataContext_2.dataContext;\r\n $object.each(this.propertyFields, function (propertyName, fieldValue) {\r\n if ($type.hasValue(dataContext_2[fieldValue])) {\r\n var anyThis = _this;\r\n anyThis[propertyName] = dataContext_2[fieldValue];\r\n }\r\n else {\r\n if (dataContext2_1) {\r\n var value = dataContext2_1[fieldValue];\r\n if ($type.hasValue(value)) {\r\n var anyThis = _this;\r\n anyThis[propertyName] = value;\r\n }\r\n }\r\n }\r\n });\r\n }\r\n }\r\n this.invalidate();\r\n }\r\n };\r\n /**\r\n * ==========================================================================\r\n * PROPERTY UTILITIES\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Returns element's property value.\r\n *\r\n * Will check if there are any bindings with [[DataItem]].\r\n *\r\n * Will also apply any adapters bound to `propertyName`.\r\n *\r\n * @param propertyName Property name\r\n * @return Property value\r\n */\r\n Sprite.prototype.getPropertyValue = function (propertyName) {\r\n var propValue = this.properties[propertyName];\r\n // Apply adapter\r\n if (!this._isTemplate) {\r\n if (this._adapterO) {\r\n propValue = this._adapterO.apply(propertyName, propValue);\r\n }\r\n propValue = globalAdapter.applyAll(this, propertyName, propValue);\r\n }\r\n return propValue;\r\n };\r\n Sprite.prototype.setColorProperty = function (property, value, invalidate) {\r\n var currentValue = this.properties[property];\r\n if (value instanceof Color && currentValue instanceof Color && value.toString() == currentValue.toString()) {\r\n return false;\r\n }\r\n else {\r\n return this.setPropertyValue(property, value, invalidate);\r\n }\r\n };\r\n Sprite.prototype.setPercentProperty = function (property, value, invalidate, transform, precision, floor) {\r\n value = $type.toNumberOrPercent(value);\r\n if ($type.isNumber(value)) {\r\n if ($type.isNumber(precision)) {\r\n value = $math.round(value, precision, floor);\r\n }\r\n return this.setPropertyValue(property, value, invalidate, transform);\r\n }\r\n else {\r\n var currentValue = this.properties[property];\r\n if (value instanceof Percent && currentValue instanceof Percent && value.value == currentValue.value) {\r\n return false;\r\n }\r\n else {\r\n return this.setPropertyValue(property, value, invalidate, transform);\r\n }\r\n }\r\n };\r\n /**\r\n * Sets elements's property value. Will also propagate the same property value\r\n * on all element's clones.\r\n *\r\n * @param property Property\r\n * @param value Value\r\n * @param invalidate Should the sprite be invalidated, cause it's re-rendering\r\n * @param transform Re-apply positioning of the element\r\n * @return Did the value change? It will return `true` if the new value and the old value of the property are not the same\r\n * @todo Review propagation to clones. Right now we simply check if clone is disposed before setting the same property on it. It's better to remove from clone list altogether.\r\n */\r\n Sprite.prototype.setPropertyValue = function (property, value, invalidate, transform) {\r\n if (this.properties[property] !== value && !this.isDisposed()) {\r\n this.properties[property] = value;\r\n if (this.events.isEnabled(\"propertychanged\")) {\r\n var event_1 = {\r\n type: \"propertychanged\",\r\n target: this,\r\n property: property\r\n };\r\n this.events.dispatchImmediately(\"propertychanged\", event_1);\r\n }\r\n if (invalidate) {\r\n this.invalidate();\r\n }\r\n if (transform) {\r\n this.invalidatePosition();\r\n }\r\n if (this.applyOnClones) {\r\n var clones = this.clones.values;\r\n var length_2 = clones.length;\r\n for (var i = 0; i < length_2; ++i) {\r\n var clone = clones[i];\r\n if (!clone.isDisposed()) {\r\n //(<Sprite>clone).setPropertyValue(<any>property, value, invalidate, transform);\r\n clone[property] = value;\r\n }\r\n }\r\n }\r\n return true;\r\n }\r\n return false;\r\n };\r\n Sprite.prototype.bind = function (property, source, bindToProperty, modifier) {\r\n var _this = this;\r\n if (bindToProperty === void 0) { bindToProperty = property; }\r\n if ($type.hasValue(this._bindings[property])) {\r\n this._bindings[property].dispose();\r\n }\r\n // set current value\r\n this[property] = source[bindToProperty];\r\n //source.addEventListener(AMEvent.PROPERTY_CHANGED, this.handleBindings, false, this);\r\n this._bindings[property] = source.events.on(\"propertychanged\", function (event) {\r\n if (event.property === bindToProperty) {\r\n var value = source[bindToProperty];\r\n if (modifier) {\r\n value = modifier(value);\r\n }\r\n // TODO clonesById\r\n _this[property] = value;\r\n }\r\n });\r\n };\r\n /**\r\n * Sets up and obeserver function to monitor changes in particular property\r\n * or properties.\r\n *\r\n * @ignore Exclude from docs\r\n * @param property Element's property name\r\n * @param listener Handler function\r\n * @param context Context for handler function\r\n * @returns Event Disposer\r\n */\r\n Sprite.prototype.observe = function (property, listener, context, shouldClone) {\r\n var _this = this;\r\n return new MultiDisposer($array.map($array.toArray(property), function (prop) {\r\n return _this.events.on(\"propertychanged\", function (e) {\r\n if (e.property === prop) {\r\n listener.call(context, e);\r\n }\r\n }, context, shouldClone);\r\n }));\r\n };\r\n /**\r\n * ==========================================================================\r\n * ACCESSIBILITY-RELATED PROPERTIES\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Applies accessibility to the SVG element.\r\n *\r\n * Adds `<title>` and `<description>` elements as well as `aria-labelledby`\r\n * and `role` properties.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Sprite.prototype.applyAccessibility = function () {\r\n // Check if we need to add label and description\r\n var title = this.readerTitle, description = this.readerDescription, role = this.role, hidden = this.readerHidden, checked = this.readerChecked, controls = this.readerControls, live = this.readerLive, orientation = this.readerOrientation, valueNow = this.readerValueNow, valueText = this.readerValueText;\r\n // Init label/describe ids\r\n var labelledByIds = [];\r\n var describedByIds = [];\r\n var labelledBy = this.readerLabelledBy;\r\n if (labelledBy) {\r\n labelledByIds.push(labelledBy);\r\n }\r\n var describedBy = this.readerDescribedBy;\r\n if (describedBy) {\r\n describedByIds.push(describedBy);\r\n }\r\n // Add arial-label attribute if present\r\n // If not readerTitle and labelledBy is set we will use <title> element\r\n // instead of aria-label\r\n // TODO: should we check agains this.showSystemTooltip?\r\n if (title) {\r\n if (labelledByIds.length || this.showSystemTooltip) {\r\n var titleElement = this.titleElement;\r\n var titleId = this.uid + \"-title\";\r\n if (titleElement.node.textContent != title) {\r\n titleElement.node.textContent = title;\r\n titleElement.attr({ id: titleId });\r\n }\r\n labelledByIds.push(titleId);\r\n }\r\n else {\r\n if (this._titleElement) {\r\n this.group.removeElement(this._titleElement);\r\n this._titleElement = undefined;\r\n }\r\n this.setSVGAttribute({\r\n \"aria-label\": title\r\n });\r\n }\r\n }\r\n else {\r\n this.removeSVGAttribute(\"aria-label\");\r\n if (this._titleElement) {\r\n this.group.removeElement(this._titleElement);\r\n this._titleElement = undefined;\r\n }\r\n }\r\n // Add description\r\n if (description) {\r\n var descriptionElement = this.descriptionElement;\r\n var descriptionId = this.uid + \"-description\";\r\n if (descriptionElement.node.textContent != description) {\r\n descriptionElement.node.textContent = description;\r\n descriptionElement.attr({ id: descriptionId });\r\n }\r\n describedByIds.push(descriptionId);\r\n }\r\n else if (this._descriptionElement) {\r\n this.group.removeElement(this._descriptionElement);\r\n this._descriptionElement = undefined;\r\n }\r\n // Add label and described properties\r\n if (labelledByIds.length) {\r\n this.setSVGAttribute({ \"aria-labelledby\": labelledByIds.join(\" \") });\r\n }\r\n else {\r\n this.removeSVGAttribute(\"aria-labelledby\");\r\n }\r\n if (describedByIds.length) {\r\n this.setSVGAttribute({ \"aria-describedby\": describedByIds.join(\" \") });\r\n }\r\n else {\r\n this.removeSVGAttribute(\"aria-describedby\");\r\n }\r\n // Apply role\r\n if (role) {\r\n this.setSVGAttribute({ \"role\": role });\r\n }\r\n else {\r\n this.removeSVGAttribute(\"role\");\r\n }\r\n // Apply aria-hidden\r\n if (hidden) {\r\n this.setSVGAttribute({ \"aria-hidden\": \"true\" });\r\n }\r\n else {\r\n this.removeSVGAttribute(\"aria-hidden\");\r\n }\r\n // Apply aria-checked\r\n if (checked) {\r\n this.setSVGAttribute({ \"aria-checked\": \"true\" });\r\n }\r\n else if (checked === false) {\r\n this.setSVGAttribute({ \"aria-checked\": \"false\" });\r\n }\r\n else {\r\n this.removeSVGAttribute(\"aria-checked\");\r\n }\r\n // Apply aria-controls\r\n if (controls) {\r\n this.setSVGAttribute({ \"aria-controls\": controls });\r\n }\r\n else {\r\n this.removeSVGAttribute(\"aria-controls\");\r\n }\r\n // Apply aria-live\r\n if (live) {\r\n this.setSVGAttribute({ \"aria-live\": live });\r\n }\r\n else {\r\n this.removeSVGAttribute(\"aria-live\");\r\n }\r\n // Apply aria-orientation\r\n if (orientation) {\r\n this.setSVGAttribute({ \"aria-orientation\": orientation });\r\n }\r\n else {\r\n this.removeSVGAttribute(\"aria-orientation\");\r\n }\r\n // Apply aria-valuenow\r\n if (valueNow) {\r\n this.setSVGAttribute({ \"aria-valuenow\": valueNow });\r\n }\r\n else {\r\n this.removeSVGAttribute(\"aria-valuenow\");\r\n }\r\n // Apply aria-valuetext\r\n if (valueText) {\r\n this.setSVGAttribute({ \"aria-valuetext\": valueText });\r\n }\r\n else {\r\n this.removeSVGAttribute(\"aria-valuetext\");\r\n }\r\n };\r\n Object.defineProperty(Sprite.prototype, \"readerTitle\", {\r\n /**\r\n * @return Title\r\n */\r\n get: function () {\r\n var title = this.getPropertyValue(\"readerTitle\");\r\n if ($type.hasValue(title) && this.dataItem) {\r\n return this.populateString(title);\r\n }\r\n return title;\r\n },\r\n /**\r\n * Screen reader title of the element.\r\n *\r\n * @param value Title\r\n */\r\n set: function (value) {\r\n value = $type.toText(value);\r\n if (this.setPropertyValue(\"readerTitle\", value)) {\r\n this.applyAccessibility();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"readerDescription\", {\r\n /**\r\n * @return Description\r\n */\r\n get: function () {\r\n var description = this.getPropertyValue(\"readerDescription\");\r\n if ($type.hasValue(description) && this.dataItem) {\r\n return this.populateString(description);\r\n }\r\n return this.getPropertyValue(\"readerDescription\");\r\n },\r\n /**\r\n * Screen reader description of the element.\r\n *\r\n * @param value Description\r\n */\r\n set: function (value) {\r\n value = $type.toText(value);\r\n if (this.setPropertyValue(\"readerDescription\", value)) {\r\n this.applyAccessibility();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"role\", {\r\n /**\r\n * @return Role\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"role\");\r\n },\r\n /**\r\n * A WAI-ARIA role for the element.\r\n *\r\n * @see {@link https://www.w3.org/TR/wai-aria-1.1/#role_definitions} for more information on WAI-ARIA roles\r\n * @param value Role\r\n */\r\n set: function (value) {\r\n value = $type.toText(value);\r\n if (this.setPropertyValue(\"role\", value)) {\r\n this.applyAccessibility();\r\n if (value == \"slider\") {\r\n this.setSVGAttribute({ \"aria-valuemin\": \"0\" });\r\n this.setSVGAttribute({ \"aria-valuemax\": \"100\" });\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"readerHidden\", {\r\n /**\r\n * @return Hidden?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"readerHidden\");\r\n },\r\n /**\r\n * Controls if element should be hidden from screen readers.\r\n *\r\n * @see {@link https://www.w3.org/TR/wai-aria-1.1/#aria-hidden} for more information\r\n * @param value Hidden?\r\n */\r\n set: function (value) {\r\n value = $type.toBoolean(value);\r\n if (this.setPropertyValue(\"readerHidden\", value)) {\r\n this.applyAccessibility();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"readerChecked\", {\r\n /**\r\n * @ignore Exclude from docs\r\n * @return Checked?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"readerChecked\");\r\n },\r\n /**\r\n * Controls if element is currently marked as \"checked\".\r\n *\r\n * @ignore Exclude from docs\r\n * @see {@link https://www.w3.org/TR/wai-aria-1.1/#aria-checked} for more information\r\n * @param value Checked?\r\n */\r\n set: function (value) {\r\n value = $type.toBoolean(value);\r\n if (this.setPropertyValue(\"readerChecked\", value)) {\r\n this.applyAccessibility();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"readerControls\", {\r\n /**\r\n * @ignore Exclude from docs\r\n * @return Setting value\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"readerControls\");\r\n },\r\n /**\r\n * A `uid` of an element this element controls.\r\n *\r\n * @ignore Exclude from docs\r\n * @see {@link https://www.w3.org/TR/wai-aria-1.1/#aria-controls} for more information\r\n * @param value Setting value\r\n */\r\n set: function (value) {\r\n value = $type.toText(value);\r\n if (this.setPropertyValue(\"readerControls\", value)) {\r\n this.applyAccessibility();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"readerLive\", {\r\n /**\r\n * @ignore Exclude from docs\r\n * @return Setting value\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"readerLive\");\r\n },\r\n /**\r\n * Controls accessibility setting \"aria-live\" for the element.\r\n *\r\n * @ignore Exclude from docs\r\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Live_Regions} for more information\r\n * @param value Setting value\r\n */\r\n set: function (value) {\r\n value = $type.toText(value);\r\n if (this.setPropertyValue(\"readerLive\", value)) {\r\n this.applyAccessibility();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"readerLabelledBy\", {\r\n /**\r\n * @ignore Exclude from docs\r\n * @return Target element\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"readerLabelledBy\");\r\n },\r\n /**\r\n * A `uid` of an element that describes this element.\r\n *\r\n * @ignore Exclude from docs\r\n * @see {@link https://www.w3.org/TR/wai-aria-1.1/#aria-labelledby} for more information\r\n * @param value Target element\r\n */\r\n set: function (value) {\r\n value = $type.toText(value);\r\n if (this.setPropertyValue(\"readerLabelledBy\", value)) {\r\n this.applyAccessibility();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"readerDescribedBy\", {\r\n /**\r\n * @ignore Exclude from docs\r\n * @return Target element\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"readerDescribedBy\");\r\n },\r\n /**\r\n * A `uid` of an element that describes this element.\r\n *\r\n * @ignore Exclude from docs\r\n * @see {@link https://www.w3.org/TR/wai-aria-1.1/#aria-describedby} for more information\r\n * @param value Target element\r\n */\r\n set: function (value) {\r\n value = $type.toText(value);\r\n if (this.setPropertyValue(\"readerDescribedBy\", value)) {\r\n this.applyAccessibility();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"readerOrientation\", {\r\n /**\r\n * @return Orientation\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"readerOrientation\");\r\n },\r\n /**\r\n * Orientation of the element.\r\n *\r\n * @since 4.7.16\r\n * @param value Orientation\r\n */\r\n set: function (value) {\r\n value = $type.toText(value);\r\n if (this.setPropertyValue(\"readerOrientation\", value)) {\r\n this.applyAccessibility();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"readerValueNow\", {\r\n /**\r\n * @return Current value\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"readerValueNow\");\r\n },\r\n /**\r\n * Current value of the element.\r\n *\r\n * @since 4.7.16\r\n * @param value Current value\r\n */\r\n set: function (value) {\r\n value = $type.toText(value);\r\n if (this.setPropertyValue(\"readerValueNow\", value)) {\r\n this.applyAccessibility();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"readerValueText\", {\r\n /**\r\n * @return Current value (text)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"readerValueText\");\r\n },\r\n /**\r\n * Text representation of the current value of the element.\r\n *\r\n * @since 4.7.16\r\n * @param value Current value (text)\r\n */\r\n set: function (value) {\r\n value = $type.toText(value);\r\n if (this.setPropertyValue(\"readerValueText\", value)) {\r\n this.applyAccessibility();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"keyboardOptions\", {\r\n /**\r\n * ==========================================================================\r\n * USER INTERACTIONS\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Returns elements keyboard options.\r\n *\r\n * @return Keyboard options\r\n */\r\n get: function () {\r\n if (!this.interactions.keyboardOptions) {\r\n if (this.virtualParent) {\r\n return this.virtualParent.keyboardOptions;\r\n }\r\n if (this._parent) {\r\n return this._parent.keyboardOptions;\r\n }\r\n }\r\n return this.interactions.keyboardOptions;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"mouseOptions\", {\r\n /**\r\n * Mouse options.\r\n *\r\n * Enables controlling options related to the mouse, for example sensitivity\r\n * of its mouse wheel.\r\n *\r\n * E.g. the below will reduce chart's wheel-zoom speed to half its default\r\n * speed:\r\n *\r\n * ```TypeScript\r\n * chart.plotContainer.mouseOptions.sensitivity = 0.5;\r\n * ```\r\n * ```JavaScript\r\n * chart.plotContainer.mouseOptions.sensitivity = 0.5;\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"plotContainer\": {\r\n * \"mouseOptions\": {\r\n * \"sensitivity\": 0.5\r\n * }\r\n * }\r\n * }\r\n * ```\r\n *\r\n * @return Mouse options\r\n */\r\n get: function () {\r\n if (!this.interactions.mouseOptions) {\r\n if (this.virtualParent) {\r\n return this.virtualParent.mouseOptions;\r\n }\r\n if (this._parent) {\r\n return this._parent.mouseOptions;\r\n }\r\n }\r\n return this.interactions.mouseOptions;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"interactions\", {\r\n /**\r\n * Returns (creates if necessary) an [[InteractionObject]] associated with\r\n * this element.\r\n *\r\n * [[InteractionObject]] is used to attach all kinds of user-interactions to\r\n * the element, e.g. click/touch, dragging, hovering, and similar events.\r\n *\r\n * @return Interaction object\r\n */\r\n get: function () {\r\n if (!this._interaction) {\r\n var interaction = getInteraction().getInteraction(this.dom);\r\n this._interaction = interaction;\r\n this._interaction.clickable = this.clickable;\r\n this._interaction.hoverable = this.hoverable;\r\n this._interaction.trackable = this.trackable;\r\n this._interaction.draggable = this.draggable;\r\n this._interaction.swipeable = this.swipeable;\r\n this._interaction.resizable = this.resizable;\r\n this._interaction.wheelable = this.wheelable;\r\n this._interaction.contextMenuDisabled = this.contextMenuDisabled;\r\n this._interaction.inert = this.inert;\r\n this._interaction.sprite = this;\r\n this._disposers.push(this._interaction);\r\n }\r\n return this._interaction;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Returns true if interactions object was created. Mostly used just to avoid creating interactions object if not needed.\r\n * @return Is Sprite interactive?\r\n */\r\n Sprite.prototype.isInteractive = function () {\r\n if (this._interaction) {\r\n return true;\r\n }\r\n else {\r\n return false;\r\n }\r\n };\r\n Object.defineProperty(Sprite.prototype, \"focusable\", {\r\n /**\r\n * @return Can element be focused?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"focusable\");\r\n },\r\n /**\r\n * ==========================================================================\r\n * ELEMENT FOCUS-RELATED STUFF\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Controls if the element can gain focus.\r\n *\r\n * Focusable element will be selectable via TAB key.\r\n *\r\n * Please note, clicking it with a mouse or touching will not add focus to\r\n * it.\r\n *\r\n * Focused element will show a system-specific highlight, which might ruin\r\n * the overal look. This is why we don't focus element on click/touch.\r\n *\r\n * A default setting varies for different elements. By default all elements\r\n * are not focusable, except certain items like buttons, legend items, etc.\r\n *\r\n * @default undefined (auto)\r\n * @param value Can element be focused?\r\n */\r\n set: function (value) {\r\n var _this = this;\r\n value = $type.toBoolean(value);\r\n if (this.setPropertyValue(\"focusable\", value)) {\r\n if (!value && !this.isInteractive()) {\r\n }\r\n else {\r\n this.interactions.focusable = value;\r\n if (value) {\r\n this.setSVGAttribute({ \"focusable\": value });\r\n if (!this._tabindex) {\r\n this.tabindex = 0;\r\n }\r\n }\r\n else {\r\n this.removeSVGAttribute(\"focusable\");\r\n this.tabindex = undefined;\r\n }\r\n // Set focus events that would apply \"focus\" state\r\n // setEventDisposer will also remove listeners if value == false\r\n this.interactions.setEventDisposer(\"sprite-focusable\", value, function () { return new MultiDisposer([\r\n _this.events.on(\"blur\", _this.handleBlur, _this, false),\r\n _this.events.on(\"focus\", _this.handleFocus, _this, false)\r\n ]); });\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Applies filters (if set) when element gains focus.\r\n *\r\n * @ignore Exclude from docs\r\n * @param ev Original event\r\n */\r\n Sprite.prototype.handleFocus = function (ev) {\r\n if (this.focusable) {\r\n if (this.topParent) {\r\n this.topParent.hasFocused = true;\r\n this.topParent.focusedElement = this;\r\n }\r\n if (this.focusFilter) {\r\n // Any `filters` manipulation will trigger `applyFilters()` so we don't\r\n // need to call it here\r\n this.filters.push(this.focusFilter);\r\n }\r\n if (this.hoverOnFocus) {\r\n // Trigger a hover event as well\r\n this.isHover = true;\r\n this.handleOver();\r\n }\r\n }\r\n };\r\n /**\r\n * Removes focus filter (if set) when elementloses focus.\r\n *\r\n * @ignore Exclude from docs\r\n * @param ev Original event\r\n */\r\n Sprite.prototype.handleBlur = function (ev) {\r\n if (this.focusable) {\r\n if (this.topParent) {\r\n this.topParent.hasFocused = false;\r\n this.topParent.focusedElement = undefined;\r\n }\r\n if (this.focusFilter) {\r\n // Any `filters` manipulation will trigger `applyFilters()` so we don't\r\n // need to call it here\r\n this.filters.removeValue(this.focusFilter);\r\n }\r\n if (this.hoverOnFocus) {\r\n // Trigger a out event as well\r\n this.isHover = false;\r\n this.handleOut();\r\n }\r\n }\r\n };\r\n Object.defineProperty(Sprite.prototype, \"focusFilter\", {\r\n /**\r\n * A reference to a [[Filter]] to apply to element when it gains focus.\r\n *\r\n * Normally, browsers will draw a default ugly square around focused element,\r\n * which totally makes sense because its purpose is to help identify active\r\n * element for visually impaired people.\r\n *\r\n * However, if you would rather apply a filter, so you can modify how focused\r\n * element looks like, use `focusFilter`.\r\n *\r\n * Simply set it to an anstance of [[FocusFilter]], or any other filter\r\n * object.\r\n *\r\n * ```TypeScript\r\n * chart.focusFilter = new am4core.FocusFilter();\r\n * ```\r\n * ```JavaScript\r\n * chart.focusFilter = new am4core.FocusFilter();\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"focusFilter\": {\r\n * \"type\": \"FocusFilter\"\r\n * },\r\n * // ...\r\n * }\r\n * ```\r\n *\r\n * @see {@link Filter}\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/accessibility/} more about accessibility\r\n * @see {@link https://www.amcharts.com/docs/v4/tutorials/changing-appearance-of-focused-items/} cusomizing focus appearance\r\n * @ignore Exclude from docs\r\n * @return Focused element filter\r\n */\r\n get: function () {\r\n /*if (!this._focusFilter) {\r\n this._focusFilter = new FocusFilter();\r\n this._disposers.push(this._focusFilter);\r\n }*/\r\n //return this._focusFilter;\r\n var focusFilter = this._focusFilter;\r\n if (focusFilter) {\r\n return focusFilter;\r\n }\r\n if (this.virtualParent) {\r\n return this.virtualParent.focusFilter;\r\n }\r\n else if (this._parent) {\r\n return this._parent.focusFilter;\r\n }\r\n //this._focusFilter = new FocusFilter();\r\n //this._disposers.push(this._focusFilter);\r\n },\r\n /**\r\n * @see {@link Filter}\r\n * @ignore Exclude from docs\r\n * @todo This is still experimental, don't use it\r\n */\r\n set: function (value) {\r\n this._focusFilter = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"hoverOnFocus\", {\r\n /**\r\n * @return Trigger hover on focus?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"hoverOnFocus\");\r\n },\r\n /**\r\n * If set to `true`, this element will also trigger `\"over\"` event with all\r\n * the related consequences, like \"hover\" state being applied and tooltip\r\n * being shown.\r\n *\r\n * Useful as an accessibility feature to display rollover tooltips on items\r\n * selected via keyboard.\r\n *\r\n * @param value Trigger hover on focus?\r\n * @default false\r\n */\r\n set: function (value) {\r\n if (value !== this.hoverOnFocus) {\r\n this.setPropertyValue(\"hoverOnFocus\", value);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"tabindex\", {\r\n /**\r\n * @return TAB index\r\n */\r\n get: function () {\r\n var index = this._tabindex;\r\n if (index != null) {\r\n return index;\r\n }\r\n else if (this.virtualParent) {\r\n return this.virtualParent.tabindex;\r\n }\r\n else if (this._parent) {\r\n return this._parent.tabindex;\r\n }\r\n },\r\n /**\r\n * Sets or returns TAB index.\r\n *\r\n * Tab index maintains the order in which focusable elements gain focus when\r\n * TAB key is pressed.\r\n *\r\n * Please note, tab index is not local to the chart. It affects the whole\r\n * of the page, including non-SVG elements. Maintain extreme causion when\r\n * setting tab indexes, as it affects the user experience for the whole\r\n * web page.\r\n *\r\n * @param value TAB index\r\n */\r\n set: function (value) {\r\n value = $type.toNumber(value);\r\n if (this.setPropertyValue(\"tabindex\", value) && $type.isNumber(value)) {\r\n this.interactions.tabindex = value;\r\n this.setSVGAttribute({ \"tabindex\": value });\r\n this._tabindex = value;\r\n if (value > -1) {\r\n this.focusable = true;\r\n }\r\n else {\r\n this.focusable = undefined;\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"inertiaOptions\", {\r\n /**\r\n * ==========================================================================\r\n * DRAGGING AND RELATED STUFF\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Returns element's options to be used for inertia. This setting is\r\n * inheritable, meaning that if not set directly, it will search in all its\r\n * ascendants until very top.\r\n *\r\n * Inertia is used only if element's `inert` is set to `true`.\r\n *\r\n * \"Inert\" element, when dragged and released, will carry the momentum of the\r\n * movement, and will continue moving in the same drag direction, gradually\r\n * reducing in speed until finally stops.\r\n *\r\n * Check [[IInertiaOptions]] for how you tweak inertia animations.\r\n *\r\n * @return Inertia options\r\n */\r\n get: function () {\r\n if (!this.interactions.inertiaOptions) {\r\n if (this._parent) {\r\n return this._parent.inertiaOptions;\r\n }\r\n }\r\n return this.interactions.inertiaOptions;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"draggable\", {\r\n /**\r\n * @return `true` if element can be dragged\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"draggable\");\r\n },\r\n /**\r\n * Controls if the element is draggable.\r\n *\r\n * @param value `true` if element can be dragged\r\n */\r\n set: function (value) {\r\n var _this = this;\r\n value = $type.toBoolean(value);\r\n if (this.setPropertyValue(\"draggable\", value)) {\r\n if (!value && !this.isInteractive()) {\r\n }\r\n else {\r\n this.applyCursorStyle();\r\n this.interactions.draggable = value;\r\n //interaction.processDraggable(this);\r\n // Add events\r\n // @todo Maybe attach to InteractionObject's multidisposer so that\r\n // sprites events get disposed together with them?\r\n // this.interactions.disposers.getItem(\"movable\")\r\n // setEventDisposer will also remove listeners if value == false\r\n this.interactions.setEventDisposer(\"sprite-draggable\", value, function () { return new MultiDisposer([\r\n _this.events.on(\"down\", _this.handleDown, _this, false),\r\n _this.events.on(\"dragstart\", _this.handleDragStart, _this, false),\r\n _this.events.on(\"drag\", _this.handleDragMove, _this, false),\r\n _this.events.on(\"dragstop\", _this.handleDragStop, _this, false)\r\n ]); });\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Executes when dragged element is being started to drag.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Sprite.prototype.handleDragStart = function (ev) {\r\n if (!this.interactions.isTouchProtected || !ev.touch) {\r\n this.interactions.originalPosition = {\r\n x: this.pixelX,\r\n y: this.pixelY\r\n };\r\n this._isDragged = true;\r\n this.hideTooltip(0);\r\n }\r\n };\r\n /**\r\n * Tell this element to start being dragged. This is useful if you want to\r\n * drag items by interactions performed not directly on the target element.\r\n *\r\n * Parameter `pointer` is highly recommended. By passing in the Pointer you\r\n * will ensure that movement is tracked for the pointer that you want. If not\r\n * supplied, the system will try to determine the most logical pointer.\r\n *\r\n * However this may fail if you have more than one pointer active, which\r\n * might happen if you have several objects being dragged on a touch device.\r\n *\r\n * @ignore Exclude from docs\r\n * @param pointer Pointer to use for movement\r\n */\r\n Sprite.prototype.dragStart = function (pointer) {\r\n //this.dragStop(pointer);\r\n //this.draggable = true;\r\n this._isDragged = true;\r\n getInteraction().dragStart(this.interactions, pointer);\r\n };\r\n /**\r\n * Executes when dragged element is being dropped.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Sprite.prototype.handleDragStop = function (ev) {\r\n if (!this.interactions.isTouchProtected || !ev.touch) {\r\n this._isDragged = false;\r\n this.showTooltip();\r\n this.interactions.originalPosition = undefined;\r\n }\r\n };\r\n /**\r\n * Stops manually initiated dragging of the element.\r\n *\r\n * @ignore Exclude from docs\r\n * @param pointer Pointer to use as a reference\r\n */\r\n Sprite.prototype.dragStop = function (pointer, cancelled) {\r\n //this.draggable = false;\r\n this._isDragged = false;\r\n getInteraction().dragStop(this.interactions, pointer, cancelled);\r\n //this.handleDragStop();\r\n };\r\n /**\r\n * Executes when {Sprite} is being dragged.\r\n *\r\n * @ignore Exclude from docs\r\n * @param ev Event object\r\n * @todo Implement parent position offset calculation\r\n */\r\n Sprite.prototype.handleDragMove = function (ev) {\r\n if (!this.interactions.isTouchProtected || !ev.touch) {\r\n var point = this.interactions.originalPosition;\r\n if (point && this._isDragged) {\r\n var globalScale = this._parent.globalScale * this.svgContainer.cssScale;\r\n this.moveTo({ x: point.x + ev.shift.x / globalScale, y: point.y + ev.shift.y / globalScale }, undefined, undefined, true);\r\n }\r\n this.dispatchImmediately(\"dragged\", ev);\r\n }\r\n };\r\n Object.defineProperty(Sprite.prototype, \"inert\", {\r\n /**\r\n * @return `true` if element should use inertia when animated\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"inert\");\r\n },\r\n /**\r\n * Controls if the element should use inertia when interacted with.\r\n *\r\n * \"Inert\" element, when dragged and released, will carry the momentum of the\r\n * movement, and will continue moving in the same drag direction, gradually\r\n * reducing in speed until finally stops.\r\n *\r\n * @default false\r\n * @param value `true` if element should use inertia when animated\r\n */\r\n set: function (value) {\r\n value = $type.toBoolean(value);\r\n if (this.setPropertyValue(\"inert\", value)) {\r\n if (!value && !this.isInteractive()) {\r\n // void\r\n }\r\n else {\r\n this.interactions.inert = value;\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"hoverOptions\", {\r\n /**\r\n * ==========================================================================\r\n * HOVERING\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Returns Sprite's hover options.\r\n *\r\n * @see {@link IHoverOptions} for available options.\r\n * @return Options\r\n */\r\n get: function () {\r\n if (!this.interactions.hoverOptions) {\r\n if (this.virtualParent) {\r\n return this.virtualParent.hoverOptions;\r\n }\r\n if (this._parent) {\r\n return this._parent.hoverOptions;\r\n }\r\n }\r\n return this.interactions.hoverOptions;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"hoverable\", {\r\n /**\r\n * @return `true` if element is hoverable\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"hoverable\");\r\n },\r\n /**\r\n * Controls if the element is hoverable (hover events are registered).\r\n *\r\n * Use `over` and `out` events, to watch for those respective actions.\r\n *\r\n * @default false\r\n * @param value `true` if element can be hovered\r\n */\r\n set: function (value) {\r\n var _this = this;\r\n value = $type.toBoolean(value);\r\n if (this.setPropertyValue(\"hoverable\", value)) {\r\n if (!value && !this.isInteractive()) {\r\n // void\r\n }\r\n else {\r\n this.applyCursorStyle();\r\n this.interactions.hoverable = value;\r\n // setEventDisposer will also remove listeners if value == false\r\n this.interactions.setEventDisposer(\"sprite-hoverable\", value, function () { return new MultiDisposer([\r\n _this.events.on(\"over\", _this.handleOver, _this, false),\r\n _this.events.on(\"out\", _this.handleOut, _this, false),\r\n ]); });\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Handles tasks when element becomes hovered:\r\n * * Shows [[Tooltip]] if applicable\r\n * * Applies \"hover\" state\r\n *\r\n * @ignore Exclude from docs\r\n * @param ev Event object\r\n */\r\n Sprite.prototype.handleOver = function (ev) {\r\n if (this._outTimeout) {\r\n this._outTimeout.dispose();\r\n }\r\n if (this.isHover) {\r\n if (this.states.hasKey(\"hover\")) {\r\n //this.setState(\"hover\");\r\n // This will check `isHover` and will set \"hover\" state\r\n if (!this.isHidden) {\r\n this.applyCurrentState();\r\n }\r\n }\r\n var point = void 0;\r\n if (ev && ev.pointer) {\r\n point = $utils.documentPointToSvg(ev.pointer.point, this.svgContainer.SVGContainer, this.svgContainer.cssScale);\r\n }\r\n if (this.showTooltipOn == \"hover\") {\r\n this.showTooltip(point);\r\n }\r\n }\r\n else {\r\n if (this.showTooltipOn == \"hover\") {\r\n this.hideTooltip();\r\n }\r\n if (!this.isHidden && this.states.hasKey(\"hover\")) {\r\n this.applyCurrentState();\r\n }\r\n }\r\n };\r\n /**\r\n * Handles tasks when element loses hover:\r\n *\r\n * * Hides [[Tooltip]]\r\n * * Applies default state\r\n *\r\n * @ignore Exclude from docs\r\n * @param ev [description]\r\n */\r\n Sprite.prototype.handleOut = function (ev) {\r\n var _this = this;\r\n if (this.tooltip && this.tooltip.targetSprite == this && this.tooltip.keepTargetHover) {\r\n this._outTimeout = this.setTimeout(function () {\r\n if (!_this.tooltip.isHover) {\r\n if (_this.tooltip.targetSprite == _this) {\r\n _this.hideTooltip();\r\n }\r\n _this._outTimeout = _this.setTimeout(_this.handleOutReal.bind(_this), _this.rollOutDelay);\r\n }\r\n }, 10);\r\n return;\r\n }\r\n if (this.showTooltipOn == \"hover\") {\r\n this.hideTooltip();\r\n }\r\n this._outTimeout = this.setTimeout(this.handleOutReal.bind(this), this.rollOutDelay);\r\n };\r\n /**\r\n * [handleOutReal description]\r\n *\r\n * @ignore\r\n * @todo description\r\n */\r\n Sprite.prototype.handleOutReal = function () {\r\n if (!this.isHidden && !this.isHiding && this.states.hasKey(\"hover\")) {\r\n this.applyCurrentState();\r\n }\r\n };\r\n Object.defineProperty(Sprite.prototype, \"hitOptions\", {\r\n /**\r\n * ==========================================================================\r\n * CLICKING/TAPPING AND TOGGLING STUFF\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Returns Sprite's click (hit) options.\r\n *\r\n * Click (hit) options control things like double-click, timeouts, etc.\r\n *\r\n * @see {@link IHitOptions} for available options.\r\n * @return Options\r\n */\r\n get: function () {\r\n if (!this.interactions.hitOptions) {\r\n if (this.virtualParent) {\r\n return this.virtualParent.hitOptions;\r\n }\r\n if (this._parent) {\r\n return this._parent.hitOptions;\r\n }\r\n }\r\n return this.interactions.hitOptions;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Prepares element's after `down` event.\r\n *\r\n * @ignore Exclude from docs\r\n * @param ev Event\r\n */\r\n Sprite.prototype.handleDown = function (ev) {\r\n if (this.interactions.downPointers.length === 1) {\r\n this.interactions.originalPosition = {\r\n x: this.pixelX,\r\n y: this.pixelY\r\n };\r\n this.interactions.originalAngle = this.rotation;\r\n this.interactions.originalScale = this.scale;\r\n if (this.states.hasKey(\"down\")) {\r\n this.setState(\"down\");\r\n }\r\n }\r\n };\r\n /**\r\n * Prepares element's after `up` event.\r\n *\r\n * @ignore Exclude from docs\r\n * @param ev Event\r\n */\r\n Sprite.prototype.handleUp = function (ev) {\r\n var _this = this;\r\n /*if (!this.isDown) {\r\n this.interactions.originalPosition = null;\r\n this.interactions.originalAngle = null;\r\n this.interactions.originalScale = null;\r\n }*/\r\n this._isResized = false;\r\n if (this.states.hasKey(\"down\")) {\r\n this.applyCurrentState();\r\n }\r\n if (this.showTooltipOn == \"hit\") {\r\n this.updateTooltipPosition(ev.pointer ? ev.pointer.point : undefined);\r\n this._disposers.push(registry.events.once(\"exitframe\", function () {\r\n _this.showTooltip();\r\n }));\r\n this._disposers.push(getInteraction().body.events.once(\"down\", function (ev) {\r\n _this.hideTooltip();\r\n }));\r\n }\r\n };\r\n Object.defineProperty(Sprite.prototype, \"clickable\", {\r\n /**\r\n * @return {boolean}\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"clickable\");\r\n },\r\n /**\r\n * Indicates if the element is clickable.\r\n *\r\n * Some type of the elements, like buttons are clickable by default.\r\n *\r\n * Most of the elements are not clickable by default.\r\n *\r\n * Use `hit`, `doublehit`, `up`, `down`, `toggled` events to watch for\r\n * respective click/touch actions.\r\n *\r\n * @param value `true` if element can be clicked\r\n */\r\n set: function (value) {\r\n var _this = this;\r\n value = $type.toBoolean(value);\r\n if (this.setPropertyValue(\"clickable\", value)) {\r\n if (!value && !this.isInteractive()) {\r\n // void\r\n }\r\n else {\r\n this.applyCursorStyle();\r\n this.interactions.clickable = value;\r\n // setEventDisposer will also remove listeners if value == false\r\n this.interactions.setEventDisposer(\"sprite-clickable\", value, function () { return new MultiDisposer([\r\n _this.events.on(\"down\", _this.handleDown, _this, false),\r\n _this.events.on(\"up\", _this.handleUp, _this, false)\r\n ]); });\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"togglable\", {\r\n /**\r\n * @return Is togglable?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"togglable\");\r\n },\r\n /**\r\n * Indicates if element can be toggled on and off by subsequent clicks/taps.\r\n *\r\n * Togglable element will alternate its `isActive` property between `true`\r\n * and `false` with each click.\r\n *\r\n * @param value Is togglable?\r\n */\r\n set: function (value) {\r\n var _this = this;\r\n value = $type.toBoolean(value);\r\n if (this.setPropertyValue(\"togglable\", value)) {\r\n if (!value && !this.isInteractive()) {\r\n // void\r\n }\r\n else {\r\n // setEventDisposer will also remove listeners if value == false\r\n this.interactions.setEventDisposer(\"sprite-togglable\", value, function () { return _this.events.on(\"hit\", _this.handleToggle, _this, false); });\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Handles toggling of the element.\r\n *\r\n * @ignore Exclude from docs\r\n * @param ev Event\r\n */\r\n Sprite.prototype.handleToggle = function (ev) {\r\n this.isActive = !this.isActive;\r\n };\r\n Object.defineProperty(Sprite.prototype, \"contextMenuDisabled\", {\r\n /**\r\n * @return Context menu disabled?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"contextMenuDisabled\");\r\n },\r\n /**\r\n * Should element prevent context menu to be displayed, e.g. when\r\n * right-clicked?\r\n *\r\n * @default false\r\n * @param value Context menu disabled?\r\n */\r\n set: function (value) {\r\n value = $type.toBoolean(value);\r\n if (this.setPropertyValue(\"contextMenuDisabled\", value)) {\r\n this.interactions.contextMenuDisabled = value;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"url\", {\r\n /**\r\n * @return URL\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"url\");\r\n },\r\n /**\r\n * Click-through URL for this element.\r\n *\r\n * If set, clicking/tapping this element will open the new URL in a target\r\n * window/tab as set by `urlTarget`.\r\n *\r\n * Please note that URL will be parsed by data placeholders in curly\r\n * brackets, to be populated from data. E.g.:\r\n *\r\n * ```TypeScript\r\n * series.columns.template.url = \"https://www.google.com/search?q={category.urlEncode()}\";\r\n * ```\r\n * ```JavaScript\r\n * series.columns.template.url = \"https://www.google.com/search?q={category.urlEncode()}\";\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"series\": [{\r\n * // ...\r\n * \"columns\": {\r\n * \"url\": \"https://www.google.com/search?q={category.urlEncode()}\"\r\n * }\r\n * }]\r\n * }\r\n * ```\r\n *\r\n * @param value URL\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"url\", value)) {\r\n if (this._urlDisposer) {\r\n this._urlDisposer.dispose();\r\n }\r\n // If URL is not empty, set up events\r\n if ($utils.isNotEmpty(value)) {\r\n this._urlDisposer = this.events.on(\"hit\", this.urlHandler, this, false);\r\n // Set other required parameters\r\n this.clickable = true;\r\n this.cursorOverStyle = MouseCursorStyle.pointer;\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"baseId\", {\r\n /**\r\n * [baseId description]\r\n *\r\n * @ignore\r\n * @return [description]\r\n */\r\n get: function () {\r\n if (!this._baseId && this._parent) {\r\n this.baseId = this._parent.baseId;\r\n }\r\n return this._baseId;\r\n },\r\n /**\r\n * [baseId description]\r\n *\r\n * @ignore\r\n * @param value [description]\r\n */\r\n set: function (value) {\r\n this.setBaseId(value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Sprite.prototype.setBaseId = function (value) {\r\n if (value != this._baseId) {\r\n if (this.invalid) {\r\n this.invalid = false;\r\n registry.removeFromInvalidSprites(this);\r\n this.invalidate();\r\n }\r\n this._baseId = value;\r\n }\r\n };\r\n Object.defineProperty(Sprite.prototype, \"baseSprite\", {\r\n /**\r\n * Returns the mail chart object that this element belongs to.\r\n *\r\n * In most cases it will mean the chart object.\r\n *\r\n * Can be used to retrieve chart object in various events and adapters.\r\n *\r\n * ```TypeScript\r\n * chart.seriesContainer.events.on(\"hit\", function(ev) {\r\n * console.log(ev.target.baseSprite);\r\n * });\r\n * ```\r\n * ```JavaScript\r\n * chart.seriesContainer.events.on(\"hit\", function(ev) {\r\n * console.log(ev.target.baseSprite);\r\n * });\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"seriesContainer\": {\r\n * \"events\": {\r\n * \"hit\": function(ev) {\r\n * console.log(ev.target.baseSprite);\r\n * }\r\n * }\r\n * }\r\n * }\r\n * ```\r\n *\r\n * @readonly\r\n * @return Base chart object\r\n */\r\n get: function () {\r\n if (this.isBaseSprite) {\r\n return this;\r\n }\r\n else if (this._parent) {\r\n return this._parent.baseSprite;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"urlTarget\", {\r\n /**\r\n * @return URL target\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"urlTarget\");\r\n },\r\n /**\r\n * Target to use for URL clicks:\r\n *\r\n * * _blank\r\n * * _self (default)\r\n * * _parent\r\n * * _top\r\n * * Name of the window/frame\r\n *\r\n * Ignored if `url` is not set.\r\n *\r\n * @param value URL target\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"urlTarget\", value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Handles URL transition on element click.\r\n *\r\n * @ignore Exclude from docs\r\n * @param ev An event object\r\n */\r\n Sprite.prototype.urlHandler = function (ev) {\r\n // Is URL set?\r\n if ($utils.isNotEmpty(this.url)) {\r\n // Proceed to the URL\r\n var url = this.populateString(this.url);\r\n if (this.urlTarget === \"_self\") {\r\n window.location.href = url;\r\n }\r\n else {\r\n window.open(url, this.urlTarget);\r\n }\r\n }\r\n };\r\n Object.defineProperty(Sprite.prototype, \"swipeOptions\", {\r\n /**\r\n * ==========================================================================\r\n * SWIPING GESTURE TRACKING\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Returns element's swipe gesture options.\r\n *\r\n * @return Swipe gesture options\r\n */\r\n get: function () {\r\n if (!this.interactions.swipeOptions) {\r\n if (this.virtualParent) {\r\n return this.virtualParent.swipeOptions;\r\n }\r\n if (this._parent) {\r\n return this._parent.swipeOptions;\r\n }\r\n }\r\n return this.interactions.swipeOptions;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"swipeable\", {\r\n /**\r\n * @return Element swipable?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"swipeable\");\r\n },\r\n /**\r\n * Controls if element is swipeable.\r\n *\r\n * Swipable element will invoke `swipe`, `swipeleft` and `swiperight` events,\r\n * when quick horizontal drag action is performed with either mouse or touch.\r\n *\r\n * Please note that combining swipe and drag is possible, however will incur\r\n * a slight but noticeable delay in drag start.\r\n *\r\n * @param value Element swipable?\r\n */\r\n set: function (value) {\r\n value = $type.toBoolean(value);\r\n if (this.setPropertyValue(\"swipeable\", value)) {\r\n this.applyCursorStyle();\r\n if (!value && !this.isInteractive()) {\r\n // void\r\n }\r\n else {\r\n this.interactions.swipeable = value;\r\n }\r\n //interaction.processSwipeable(this);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"trackable\", {\r\n /**\r\n * @return Track cursor movement over element?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"trackable\");\r\n },\r\n /**\r\n * ==========================================================================\r\n * POINTER TRACKING\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Indicates if the element is trackable (mouse position over it is reported to\r\n * event listeners).\r\n *\r\n * Will invoke `track` events whenever pointer (cursor) changes position\r\n * while over element.\r\n *\r\n * Please note, touch devices will also invoke `track` events when touch\r\n * point is moved while holding down on a trackable element.\r\n *\r\n * @param value Track cursor movement over element?\r\n */\r\n set: function (value) {\r\n value = $type.toBoolean(value);\r\n if (this.setPropertyValue(\"trackable\", value)) {\r\n if (!value && !this.isInteractive()) {\r\n // void\r\n }\r\n else {\r\n this.applyCursorStyle();\r\n this.interactions.trackable = value;\r\n }\r\n //interaction.processTrackable(this);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"wheelable\", {\r\n /**\r\n * @return Mouse wheel events enabled?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"wheelable\");\r\n },\r\n /**\r\n * ==========================================================================\r\n * MOUSE-WHEEL RELATED\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Indicates if the element can be interacted with mouse wheel.\r\n *\r\n * Will invoke `wheel`, `wheelup`, `wheeldown`, `wheelleft`, and `wheelright`\r\n * events when using mouse wheel over the element.\r\n *\r\n * @param value Mouse wheel events enabled?\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"wheelable\", value)) {\r\n if (!value && !this.isInteractive()) {\r\n // void\r\n }\r\n else {\r\n this.applyCursorStyle();\r\n this.interactions.wheelable = value;\r\n }\r\n //interaction.processWheelable(this);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"resizable\", {\r\n /**\r\n * @return Element resizable?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"resizable\");\r\n },\r\n /**\r\n * ==========================================================================\r\n * RESIZE\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Indicates if this element is resizable.\r\n *\r\n * Enabling resize will turn on various interactions on the element. Their\r\n * actual functionality will depend on other properties.\r\n *\r\n * If the element also `draggable`, resize will only happen with two points\r\n * of contact on a touch device.\r\n *\r\n * If the element is not draggable, resize can be performed with just one\r\n * point of contact, touch or mouse.\r\n *\r\n * Will invoke `resize` event every time the size of the element changes.\r\n *\r\n * @param value Element resizable?\r\n */\r\n set: function (value) {\r\n var _this = this;\r\n value = $type.toBoolean(value);\r\n if (this.setPropertyValue(\"resizable\", value)) {\r\n if (!value && !this.isInteractive()) {\r\n // void\r\n }\r\n else {\r\n this.applyCursorStyle();\r\n this.interactions.resizable = value;\r\n // setEventDisposer will also remove listeners if value == false\r\n this.interactions.setEventDisposer(\"sprite-resizable\", value, function () { return new MultiDisposer([\r\n _this.events.on(\"down\", _this.handleDown, _this, false),\r\n _this.events.on(\"resize\", _this.handleResize, _this, false)\r\n ]); });\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Handles resize intermediate step.\r\n *\r\n * By default this method resizes actual element. Each element, can override\r\n * this method to implement their own resize logic.\r\n *\r\n * @ignore Exclude from docs\r\n * @param ev Event object\r\n */\r\n Sprite.prototype.handleResize = function (ev) {\r\n if (!this.interactions.isTouchProtected || !ev.touch) {\r\n this._isResized = true;\r\n this.scale = this.interactions.originalScale * ev.scale;\r\n this.validatePosition();\r\n /*center: (io.draggable\r\n ? $math.getMidPoint(point1, point2)\r\n : {\r\n \"x\": io.originalPosition.x,\r\n \"y\": io.originalPosition.y\r\n })*/\r\n //this.moveTo(this.originalPosition.x + ev.shift.x, this.originalPosition.y + ev.shift.y);\r\n if (this.draggable || this.dragWhileResize) {\r\n this._isDragged = false;\r\n var svgPoint1 = $utils.documentPointToSvg(ev.point1, this.htmlContainer, this.svgContainer.cssScale);\r\n var svgPoint2 = $utils.documentPointToSvg(ev.point2, this.htmlContainer, this.svgContainer.cssScale);\r\n var svgMidPoint = $math.getMidPoint(svgPoint1, svgPoint2);\r\n var parentPoint1 = $utils.documentPointToSprite(ev.startPoint1, this._parent);\r\n var parentPoint2 = $utils.documentPointToSprite(ev.startPoint2, this._parent);\r\n var originalPosition = this.interactions.originalPosition;\r\n var originalScale = this.interactions.originalScale;\r\n if (originalPosition) {\r\n var spritePoint1 = { x: (parentPoint1.x - originalPosition.x) / originalScale, y: (parentPoint1.y - originalPosition.y) / originalScale };\r\n var spritePoint2 = { x: (parentPoint2.x - originalPosition.x) / originalScale, y: (parentPoint2.y - originalPosition.y) / originalScale };\r\n var spriteMidPoint = $math.getMidPoint(spritePoint1, spritePoint2);\r\n var parentPoint = $utils.svgPointToSprite(svgMidPoint, this._parent);\r\n this.moveTo({ x: parentPoint.x - spriteMidPoint.x * this.scale, y: parentPoint.y - spriteMidPoint.y * this.scale }, undefined, undefined, true);\r\n }\r\n }\r\n }\r\n };\r\n Object.defineProperty(Sprite.prototype, \"cursorOptions\", {\r\n /**\r\n * ==========================================================================\r\n * MOUSE-RELATED\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Returns element's cursor options.\r\n *\r\n * Cursor options usually define cursor style for various states of the\r\n * hovered element.\r\n *\r\n * Elements inherit `cursorOptions` from their parents if they don't have\r\n * them set explicitly.\r\n *\r\n * @see {@link ICursorOptions} for a list of available options\r\n * @return Cursor options\r\n */\r\n get: function () {\r\n if (!this.interactions.cursorOptions) {\r\n if (this.virtualParent) {\r\n return this.virtualParent.cursorOptions;\r\n }\r\n if (this._parent) {\r\n return this._parent.cursorOptions;\r\n }\r\n }\r\n return this.interactions.cursorOptions;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"cursorOverStyle\", {\r\n /**\r\n * A shortcut to setting mouse cursor on hover.\r\n *\r\n * Example:\r\n *\r\n * ```TypeScript\r\n * series.slices.template.cursorOverStyle = am4core.MouseCursorStyle.pointer;\r\n * ```\r\n * ```JavaScript\r\n * series.slices.template.cursorOverStyle = am4core.MouseCursorStyle.pointer;\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"series\": {\r\n * // ...\r\n * \"slices\": {\r\n * \"cursorOverStyle\": \"pointer\"\r\n * }\r\n * }\r\n * }\r\n * ```\r\n *\r\n * @param style An array of styles to apply onhover\r\n */\r\n set: function (style) {\r\n if (!this.cursorOptions.overStyle) {\r\n this.interactions.cursorOptions = {\r\n defaultStyle: this.cursorOptions.defaultStyle\r\n };\r\n }\r\n this.cursorOptions.overStyle = style;\r\n getInteraction().applyCursorOverStyle(this.interactions);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"cursorDownStyle\", {\r\n /**\r\n * A shortcut to setting mouse cursor when button is pressed down.\r\n *\r\n * Example:\r\n *\r\n * ```TypeScript\r\n * series.slices.template.cursorDownStyle = am4core.MouseCursorStyle.grabbing;\r\n * ```\r\n * ```JavaScript\r\n * series.slices.template.cursorDownStyle = am4core.MouseCursorStyle.grabbing;\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"series\": {\r\n * // ...\r\n * \"slices\": {\r\n * \"cursorDownStyle\": \"grabbing\"\r\n * }\r\n * }\r\n * }\r\n * ```\r\n *\r\n * @param style An array of styles to apply onhover\r\n */\r\n set: function (style) {\r\n this.cursorOptions.downStyle = style;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Applies default cursor styles for interactable elements.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Determine if this is necessary. Maybe let's not apply any cursor styles by default\r\n */\r\n Sprite.prototype.applyCursorStyle = function () {\r\n // Draggable styles\r\n /*if (this.draggable) {\r\n\r\n if (!$type.hasValue(this.cursorOptions.overStyle)) {\r\n this.cursorOptions.overStyle = MouseCursorStyle.grab;\r\n }\r\n\r\n if (!$type.hasValue(this.cursorOptions.downStyle)) {\r\n this.cursorOptions.downStyle = MouseCursorStyle.grabbing;\r\n }\r\n }*/\r\n };\r\n Object.defineProperty(Sprite.prototype, \"interactionsEnabled\", {\r\n /**\r\n * @return Is interaction enabled for this element?\r\n */\r\n get: function () {\r\n var value = this.getPropertyValue(\"interactionsEnabled\");\r\n if (value === false) {\r\n return false;\r\n }\r\n if (this.virtualParent) {\r\n return this.virtualParent.interactionsEnabled;\r\n }\r\n if (this._parent) {\r\n return this._parent.interactionsEnabled;\r\n }\r\n return true;\r\n },\r\n /**\r\n * Setting this to `false` will effectively disable all interactivity on the\r\n * element.\r\n *\r\n * @param value Is interaction enabled for this element?\r\n */\r\n set: function (value) {\r\n value = $type.toBoolean(value);\r\n if (this.setPropertyValue(\"interactionsEnabled\", value)) {\r\n var pointerEvents = null; // must be null, not \"null\"!\r\n if (!value) {\r\n pointerEvents = \"none\";\r\n }\r\n else {\r\n // this is for IE\r\n this.group.node.style.pointerEvents = \"\";\r\n }\r\n this.group.node.style.pointerEvents = pointerEvents;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"exporting\", {\r\n /**\r\n * @return Export instance\r\n */\r\n get: function () {\r\n return this.getExporting();\r\n },\r\n /**\r\n * ==========================================================================\r\n * EXPORT-RELATED STUFF\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * An [[Export]] instance.\r\n *\r\n * Used to access API of the chart export functionality.\r\n *\r\n * If `exporting` is not set, the element inherits [[Export]] instance from\r\n * its parents.\r\n *\r\n * Upon request, if no parent has such instance, a new one is created, using\r\n * default settings, what in most cases is just enough.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/exporting/} for more info about exporting\r\n * @param exp Export\r\n */\r\n set: function (exp) {\r\n this._exporting.set(exp, exp);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * This is here as a method so that inheriting classes could override it.\r\n *\r\n * @return Export instance\r\n */\r\n Sprite.prototype.getExporting = function () {\r\n var _export = this._exporting.get();\r\n if (_export) {\r\n return _export;\r\n }\r\n else {\r\n if (this.isStandaloneInstance || !this._parent) {\r\n _export = new Export(this.svgContainer.SVGContainer);\r\n _export.sprite = this;\r\n _export.language = this.language;\r\n _export.numberFormatter = this.numberFormatter;\r\n _export.dateFormatter = this.dateFormatter;\r\n _export.durationFormatter = this.durationFormatter;\r\n this._exporting.set(_export, _export);\r\n }\r\n else {\r\n return this._parent.exporting;\r\n }\r\n }\r\n return _export;\r\n };\r\n Object.defineProperty(Sprite.prototype, \"exportable\", {\r\n /**\r\n * @return Export?\r\n */\r\n get: function () {\r\n return this._exportable;\r\n /*const svgContainer = this.svgContainer;\r\n return !svgContainer || $array.indexOf(svgContainer.nonExportableSprites, this) == -1;*/\r\n },\r\n /**\r\n * If set to `false` this element will be omitted when exporting the chart\r\n * to an image.\r\n *\r\n * @default true\r\n * @param value Export?\r\n */\r\n set: function (value) {\r\n var svgContainer = this.svgContainer;\r\n this._exportable = value;\r\n if (svgContainer) {\r\n if (value) {\r\n $array.remove(svgContainer.nonExportableSprites, this);\r\n }\r\n else if ($array.indexOf(svgContainer.nonExportableSprites, this) == -1) {\r\n svgContainer.nonExportableSprites.push(this);\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * ==========================================================================\r\n * MODAL/POPUP RELATED STUFF\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Private method to be used for \"classPrefix\" adapter for modals/popups.\r\n *\r\n * @param value Prefix\r\n */\r\n Sprite.prototype.modalPrefix = function (value) {\r\n value = options.classNamePrefix + value;\r\n return value;\r\n };\r\n Object.defineProperty(Sprite.prototype, \"modal\", {\r\n /**\r\n * Returns a [[Modal]] instance, associated with this chart.\r\n * (elements top parent)\r\n *\r\n * Accessing modal does not make it appear. To make a modal appear, use\r\n * `showModal()` method.\r\n *\r\n * @see {@link Modal} for more information about using Modal windows\r\n * @return Modal instance\r\n */\r\n get: function () {\r\n var svgContainer = this.svgContainer;\r\n if (svgContainer) {\r\n var modal = svgContainer.modal;\r\n if (!modal.adapter.has(\"classPrefix\", this.modalPrefix)) {\r\n modal.adapter.add(\"classPrefix\", this.modalPrefix);\r\n }\r\n return modal;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Opens a modal window with specific content (`text` parameter) and,\r\n * optionally, `title`.\r\n *\r\n * The `text` parameter can contain HTML content.\r\n *\r\n * @see {@link Modal} for more information about using Modal windows\r\n * @param text Modal contents\r\n * @param title Title for the modal window\r\n */\r\n Sprite.prototype.openModal = function (text, title) {\r\n var svgContainer = this.svgContainer;\r\n if (svgContainer) {\r\n return svgContainer.openModal(text, title);\r\n }\r\n };\r\n /**\r\n * Hides modal window if there is one currently open.\r\n */\r\n Sprite.prototype.closeModal = function () {\r\n var svgContainer = this.svgContainer;\r\n if (svgContainer) {\r\n svgContainer.closeModal();\r\n }\r\n };\r\n Object.defineProperty(Sprite.prototype, \"popups\", {\r\n /**\r\n * A list of popups for this chart.\r\n *\r\n * @return Popups\r\n */\r\n get: function () {\r\n var svgContainer = this.svgContainer;\r\n if (svgContainer) {\r\n var popups = svgContainer.popups;\r\n popups.template.sprite = this;\r\n if (!popups.template.adapter.has(\"classPrefix\", this.modalPrefix)) {\r\n popups.template.adapter.add(\"classPrefix\", this.modalPrefix);\r\n }\r\n return popups;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Creates, opens, and returns a new [[Popup]] window.\r\n *\r\n * `text` can be any valid HTML.\r\n *\r\n * `title` is currently not supported.\r\n *\r\n * @param text Popup contents\r\n * @param title Popup title\r\n * @return Popup instance\r\n */\r\n Sprite.prototype.openPopup = function (text, title) {\r\n var svgContainer = this.svgContainer;\r\n if (svgContainer) {\r\n return svgContainer.openPopup(text, title);\r\n }\r\n };\r\n /**\r\n * Closes all currently open popup windows\r\n */\r\n Sprite.prototype.closeAllPopups = function () {\r\n var svgContainer = this.svgContainer;\r\n if (svgContainer) {\r\n svgContainer.closeAllPopups();\r\n }\r\n };\r\n Object.defineProperty(Sprite.prototype, \"x\", {\r\n /**\r\n * @return X coordinate\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"x\");\r\n },\r\n /**\r\n * ==========================================================================\r\n * POSITIONAL PROPERTIES AND RELATED STUFF\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Element's absolute or relative X coordinate.\r\n *\r\n * If setting both X and Y, please consider using `moveTo()` method instead,\r\n * as it will be faster to set both coordinates at once.\r\n *\r\n * @param value X coordinate\r\n */\r\n set: function (value) {\r\n if (!this.isDragged) {\r\n this.setPercentProperty(\"x\", value, false, true, this._positionPrecision, true);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"pixelX\", {\r\n /**\r\n * Returns element's current absolute X coordinate in pixels.\r\n *\r\n * @readonly\r\n * @return X coordinate (px)\r\n */\r\n get: function () {\r\n var value = $math.fitToRange(this.getPixelX(this.x), this.minX, this.maxX);\r\n if (!this._adapterO) {\r\n return value;\r\n }\r\n else {\r\n return this._adapterO.apply(\"pixelX\", value);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"relativeX\", {\r\n /**\r\n * Returns element's current relative X coordinate in [[Percent]].\r\n *\r\n * @return X coordinate ([[Percent]])\r\n */\r\n get: function () {\r\n if (!this._adapterO) {\r\n return this.getRelativeX(this.x);\r\n }\r\n else {\r\n return this._adapterO.apply(\"relativeX\", this.getRelativeX(this.x));\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"minX\", {\r\n /**\r\n * @ignore Exclude from docs\r\n * @return Min X (px)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"minX\");\r\n },\r\n /**\r\n * The smallest allowable absolute X coordinate for this element.\r\n *\r\n * This is used to contain element movement within certain boundaries.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Min X (px)\r\n */\r\n set: function (value) {\r\n if ($type.isNumber(value)) {\r\n value = $math.round(value, this._positionPrecision, true);\r\n this.setPropertyValue(\"minX\", value, false, true);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"maxX\", {\r\n /**\r\n * @ignore Exclude from docs\r\n * @return Max X (px)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"maxX\");\r\n },\r\n /**\r\n * The biggest allowable absolute X coordinate for this element.\r\n *\r\n * This is used to contain element movement within certain boundaries.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Max X (px)\r\n */\r\n set: function (value) {\r\n if ($type.isNumber(value)) {\r\n value = $math.round(value, this._positionPrecision, true);\r\n this.setPropertyValue(\"maxX\", value, false, true);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"y\", {\r\n /**\r\n * @return Y coordinate\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"y\");\r\n },\r\n /**\r\n * Element's absolute or relative Y coordinate.\r\n *\r\n * If setting both X and Y, please consider using `moveTo()` method instead,\r\n * as it will be faster to set both coordinates at once.\r\n *\r\n * @param value Y coordinate\r\n */\r\n set: function (value) {\r\n if (!this.isDragged) {\r\n this.setPercentProperty(\"y\", value, false, true, this._positionPrecision, true);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"pixelY\", {\r\n /**\r\n * Returns element's current absolute Y coordinate in pixels.\r\n *\r\n * @readonly\r\n * @return Y coordinate (px)\r\n */\r\n get: function () {\r\n var value = $math.fitToRange(this.getPixelY(this.y), this.minY, this.maxY);\r\n if (!this._adapterO) {\r\n return value;\r\n }\r\n else {\r\n return this._adapterO.apply(\"pixelY\", value);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"relativeY\", {\r\n /**\r\n * Returns element's current relative Y coordinate in [[Percent]].\r\n *\r\n * @readonly\r\n * @return Y coordinate ([[Percent]])\r\n */\r\n get: function () {\r\n if (!this._adapterO) {\r\n return this.getRelativeX(this.y);\r\n }\r\n else {\r\n return this._adapterO.apply(\"relativeY\", this.getRelativeX(this.y));\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"minY\", {\r\n /**\r\n * @ignore Exclude from docs\r\n * @return Min Y (px)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"minY\");\r\n },\r\n /**\r\n * The smallest allowable absolute Y coordinate for this element.\r\n *\r\n * This is used to contain element movement within certain boundaries.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Min Y (px)\r\n */\r\n set: function (value) {\r\n if ($type.isNumber(value)) {\r\n value = $math.round(value, this._positionPrecision, true);\r\n this.setPropertyValue(\"minY\", value, false, true);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"maxY\", {\r\n /**\r\n * @ignore Exclude from docs\r\n * @return Max Y (px)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"maxY\");\r\n },\r\n /**\r\n * The biggest allowable absolute Y coordinate for this element.\r\n *\r\n * This is used to contain element movement within certain boundaries.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Max Y (px)\r\n */\r\n set: function (value) {\r\n if ($type.isNumber(value)) {\r\n value = $math.round(value, this._positionPrecision, true);\r\n this.setPropertyValue(\"maxY\", value, false, true);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"dx\", {\r\n /**\r\n * @return Horizontal offset (px)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"dx\");\r\n },\r\n /**\r\n * A horizontal offset for the element in pixels.\r\n *\r\n * Can be negative value for offset to the left.\r\n *\r\n * @param value Horizontal offset (px)\r\n */\r\n set: function (value) {\r\n if ($type.isNumber(value)) {\r\n value = $math.round(value, this._positionPrecision, true);\r\n this.setPropertyValue(\"dx\", value, false, true);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"dy\", {\r\n /**\r\n * @return Vertical offset (px)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"dy\");\r\n },\r\n /**\r\n * A vertical offset for the element in pixels.\r\n *\r\n * Can be negative value for offset upwards.\r\n *\r\n * @param value Vertical offset (px)\r\n */\r\n set: function (value) {\r\n if ($type.isNumber(value)) {\r\n value = $math.round(value, this._positionPrecision, true);\r\n this.setPropertyValue(\"dy\", value, false, true);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"rotation\", {\r\n /**\r\n * @return Rotation (0-360)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"rotation\");\r\n },\r\n /**\r\n * Rotation of the element in degrees. (0-360)\r\n *\r\n * Note: For convenience purposes, negative values (for counter-clockwise\r\n * rotation) and values exceeding 360 can also be used.\r\n *\r\n * @param value Rotation (0-360)\r\n */\r\n set: function (value) {\r\n value = $type.toNumber(value);\r\n if (!$type.isNumber(value)) {\r\n value = 0;\r\n }\r\n this.setPropertyValue(\"rotation\", value, false, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"align\", {\r\n /**\r\n * @return Horizontal align\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"align\");\r\n },\r\n /**\r\n * Controls horizontal alignment of the element.\r\n *\r\n * This is used by parent [[Container]] when layouting its children.\r\n *\r\n * @param value Horizontal align\r\n */\r\n set: function (value) {\r\n value = $type.toText(value);\r\n if (this.setPropertyValue(\"align\", value)) {\r\n if (this._parent) {\r\n this._parent.invalidateLayout();\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"valign\", {\r\n /**\r\n * @return Vertical align\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"valign\");\r\n },\r\n /**\r\n * Controls vertical alignment of the element.\r\n *\r\n * This is used by parent [[Container]] when layouting its children.\r\n *\r\n * @param value Vertical align\r\n */\r\n set: function (value) {\r\n value = $type.toText(value);\r\n if (this.setPropertyValue(\"valign\", value)) {\r\n if (this._parent) {\r\n this._parent.invalidateLayout();\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"horizontalCenter\", {\r\n /**\r\n * @return Horizontal center\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"horizontalCenter\");\r\n },\r\n /**\r\n * Controls which part of the element to treat as a horizontal center.\r\n *\r\n * The setting will be used when positioning, resizing and rotating the\r\n * element.\r\n *\r\n * @param value Horizontal center\r\n */\r\n set: function (value) {\r\n value = $type.toText(value);\r\n if (this.setPropertyValue(\"horizontalCenter\", value)) {\r\n this.updateCenter();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"verticalCenter\", {\r\n /**\r\n * @return Vertical center\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"verticalCenter\");\r\n },\r\n /**\r\n * Controls which part of the element to treat as a vertical center.\r\n *\r\n * The setting will be used when positioning, resizing and rotating the\r\n * element.\r\n *\r\n * @param value Vertical center\r\n */\r\n set: function (value) {\r\n value = $type.toText(value);\r\n if (this.setPropertyValue(\"verticalCenter\", value)) {\r\n this.updateCenter();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"maxWidth\", {\r\n /**\r\n * @return Maximum width (px)\r\n */\r\n get: function () {\r\n var maxWidth = this.getPropertyValue(\"maxWidth\");\r\n if (!$type.isNumber(maxWidth)) {\r\n if (this._parent) {\r\n var parentWidth = this._parent.maxWidth;\r\n if (this._parent.layout != \"absolute\" && this.align != \"none\" && this.align != undefined) {\r\n parentWidth = parentWidth - this.pixelMarginLeft - this.pixelMarginRight;\r\n }\r\n return parentWidth;\r\n }\r\n }\r\n return maxWidth;\r\n },\r\n /**\r\n * ==========================================================================\r\n * DIMENSIONAL PROPERTIES AND RELATED STUFF\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Maximum allowed width for the element in pixels.\r\n *\r\n * @param value Maximum width (px)\r\n */\r\n set: function (value) {\r\n this.setMaxWidth(value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Sprite.prototype.setMaxWidth = function (value) {\r\n var prevWidth = this.maxWidth;\r\n var prevHeight = this.maxHeight;\r\n if (this.setPropertyValue(\"maxWidth\", value)) {\r\n if ($type.isNumber(this.relativeWidth)) {\r\n this.invalidate();\r\n }\r\n var event_2 = {\r\n type: \"maxsizechanged\",\r\n target: this,\r\n previousWidth: prevWidth,\r\n previousHeight: prevHeight\r\n };\r\n this.dispatchImmediately(\"maxsizechanged\", event_2);\r\n }\r\n };\r\n Object.defineProperty(Sprite.prototype, \"maxHeight\", {\r\n /**\r\n * @return Maximum height (px)\r\n */\r\n get: function () {\r\n var maxHeight = this.getPropertyValue(\"maxHeight\");\r\n if (!$type.isNumber(maxHeight)) {\r\n if (this._parent) {\r\n var parentHeight = this._parent.maxHeight;\r\n if (this._parent.layout != \"absolute\" && this.valign != \"none\" && this.valign != undefined) {\r\n parentHeight = parentHeight - this.pixelMarginTop - this.pixelMarginBottom;\r\n }\r\n return parentHeight;\r\n }\r\n }\r\n return maxHeight;\r\n },\r\n /**\r\n * Maximum allowed height for the element in pixels.\r\n *\r\n * @param value Maximum height (px)\r\n */\r\n set: function (value) {\r\n this.setMaxHeight(value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Sprite.prototype.setMaxHeight = function (value) {\r\n var prevWidth = this.maxWidth;\r\n var prevHeight = this.maxHeight;\r\n if (this.setPropertyValue(\"maxHeight\", value)) {\r\n if ($type.isNumber(this.relativeHeight)) {\r\n this.invalidate();\r\n }\r\n var event_3 = {\r\n type: \"maxsizechanged\",\r\n target: this,\r\n previousWidth: prevWidth,\r\n previousHeight: prevHeight\r\n };\r\n this.dispatchImmediately(\"maxsizechanged\", event_3);\r\n }\r\n };\r\n Object.defineProperty(Sprite.prototype, \"minWidth\", {\r\n /**\r\n * @return Minimum width (px)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"minWidth\");\r\n },\r\n /**\r\n * Minimum width of the element in pixels.\r\n *\r\n * Set to `undefined` to remove the limit.\r\n *\r\n * @param value Minimum width (px)\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"minWidth\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"minHeight\", {\r\n /**\r\n * @return Minimum height (px)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"minHeight\");\r\n },\r\n /**\r\n * Minimum height for the element in pixels.\r\n *\r\n * Set to `undefined` to remove the limit.\r\n *\r\n * @param value Minimum height (px)\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"minHeight\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"width\", {\r\n /**\r\n * @return Width (absolute or relative)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"width\");\r\n },\r\n /**\r\n * Element's absolute or relative width.\r\n *\r\n * The width can either be absolute, set in numeric pixels, or relative, set\r\n * in [[Percent]].\r\n *\r\n * Relative width will be calculated using closest measured ancestor\r\n * [[Container]].\r\n *\r\n * NOTE: `width` is an accessor, which allows setting width in pixels or\r\n * percent. It is a sort of a \"shortcut\" for the users. Actual renderer does\r\n * not ever use it. It uses either `pixelWidth` or `percentWidth`, so if\r\n * you need to add an adapter for width add it for either of the two\r\n * properties - whichever suits your requirements.\r\n *\r\n * @param value Width (numeric in pixels or relative)\r\n */\r\n set: function (value) {\r\n var changed = this.setPercentProperty(\"width\", value, true, false, this._positionPrecision, true);\r\n if (changed) {\r\n this.percentWidth = undefined;\r\n this.relativeWidth = undefined;\r\n if (value instanceof Percent) {\r\n this.percentWidth = value.percent;\r\n if ($type.isNumber(this._pixelWidth)) {\r\n this.maxWidth = undefined;\r\n }\r\n this._pixelWidth = undefined;\r\n }\r\n else {\r\n this._pixelWidth = Number(value);\r\n //this._measuredWidth = this._pixelWidth;\r\n this.maxWidth = this._pixelWidth;\r\n }\r\n this.invalidatePosition();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"height\", {\r\n /**\r\n * @return height (absolute or relative)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"height\");\r\n },\r\n /**\r\n * Element's absolute or relative height.\r\n *\r\n * The height can either be absolute, set in numeric pixels, or relative, set\r\n * in [[Percent]].\r\n *\r\n * Relative height will be calculated using closest measured ancestor\r\n * [[Container]].\r\n *\r\n * NOTE: `height` is an accessor, which allows setting height in pixels or\r\n * percent. It is a sort of a \"shortcut\" for the users. Actual renderer does\r\n * not ever use it. It uses either `pixelHeight` or `percentHeight`, so if\r\n * you need to add an adapter for height add it for either of the two\r\n * properties - whichever suits your requirements.\r\n *\r\n * @param value Height (numeric in pixels or relative)\r\n */\r\n set: function (value) {\r\n var changed = this.setPercentProperty(\"height\", value, true, false, this._positionPrecision, true);\r\n if (changed) {\r\n this.percentHeight = undefined;\r\n this._relativeHeight = undefined;\r\n if (value instanceof Percent) {\r\n this.percentHeight = value.percent;\r\n if ($type.isNumber(this._pixelHeight)) {\r\n this.maxHeight = undefined;\r\n }\r\n this._pixelHeight = undefined;\r\n }\r\n else {\r\n this._pixelHeight = Number(value);\r\n //this._measuredHeight = this._pixelHeight;\r\n this.maxHeight = this._pixelHeight; // yes, we reset maxWidth\r\n }\r\n this.invalidatePosition();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"pixelWidth\", {\r\n /**\r\n * Returns element's width in pixels, if width was set. For actual width use measuredWidth property.\r\n *\r\n * @readonly\r\n * @return Width (px)\r\n */\r\n get: function () {\r\n var width;\r\n if ($type.isNumber(this.percentWidth)) {\r\n width = this.maxWidth;\r\n }\r\n else if ($type.isNumber(this._pixelWidth)) {\r\n width = this._pixelWidth;\r\n }\r\n else {\r\n width = 0;\r\n }\r\n var minWidth = this.minWidth;\r\n if (minWidth != null && width < minWidth) {\r\n width = minWidth;\r\n }\r\n var value = $math.round(width, this._positionPrecision, true);\r\n if (!this._adapterO) {\r\n return value;\r\n }\r\n else {\r\n return this._adapterO.apply(\"pixelWidth\", value);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"pixelHeight\", {\r\n /**\r\n * Returns element's height in pixels. For actual height use measuredHeight property.\r\n *\r\n * @readonly\r\n * @return Height (px)\r\n */\r\n get: function () {\r\n var height;\r\n if ($type.isNumber(this.percentHeight)) {\r\n height = this.maxHeight;\r\n }\r\n else if ($type.isNumber(this._pixelHeight)) {\r\n height = this._pixelHeight;\r\n }\r\n else {\r\n height = 0; //this._measuredHeightSelf;\r\n }\r\n var minHeight = this.minHeight;\r\n if (minHeight != null && height < minHeight) {\r\n height = minHeight;\r\n }\r\n var value = $math.round(height, this._positionPrecision, true);\r\n if (!this._adapterO) {\r\n return value;\r\n }\r\n else {\r\n return this._adapterO.apply(\"pixelHeight\", value);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"relativeWidth\", {\r\n /**\r\n * @return Relative width\r\n * @ignore\r\n */\r\n get: function () {\r\n var relativeWidth = this._relativeWidth;\r\n if ($type.isNumber(relativeWidth)) {\r\n if (!this._adapterO) {\r\n return relativeWidth;\r\n }\r\n else {\r\n return this._adapterO.apply(\"relativeWidth\", relativeWidth);\r\n }\r\n }\r\n },\r\n /**\r\n * Element's relative width in [[Percent]].\r\n * @ignore\r\n *\r\n * @param value Relative width\r\n */\r\n set: function (value) {\r\n if (this._relativeWidth != value) {\r\n this._relativeWidth = value;\r\n //\t\t\tthis.invalidate();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"relativeHeight\", {\r\n /**\r\n * @return Relative height\r\n * @ignore\r\n */\r\n get: function () {\r\n var relativeHeight = this._relativeHeight;\r\n if ($type.isNumber(relativeHeight)) {\r\n if (!this._adapterO) {\r\n return relativeHeight;\r\n }\r\n else {\r\n return this._adapterO.apply(\"relativeHeight\", relativeHeight);\r\n }\r\n }\r\n },\r\n /**\r\n * Element's relative height in [[Percent]].\r\n *\r\n * @param value Relative height\r\n * @ignore\r\n */\r\n set: function (value) {\r\n if (this._relativeHeight != value) {\r\n this._relativeHeight = value;\r\n //\t\t\tthis.invalidate();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"measuredWidth\", {\r\n /**\r\n * Returns element's measured width in pixels.\r\n *\r\n * A measured width is actual width of contents plus `paddingRight` and* `paddingLeft`, relative to sprite parent, meaning that\r\n * rotation and scale is taken into account.\r\n *\r\n * @readonly\r\n * @return Width (px)\r\n */\r\n get: function () {\r\n if (this.disabled || this.__disabled) {\r\n return 0;\r\n }\r\n if (!this._adapterO) {\r\n return this._measuredWidth;\r\n }\r\n else {\r\n return this._adapterO.apply(\"measuredWidth\", this._measuredWidth);\r\n }\r\n // it's not good to fit to min/max range as then rotations and scale won't be taken into account\r\n //return this.adapter.apply(\"measuredWidth\", $math.fitToRange(this._measuredWidth, this.minWidth, this.maxWidth));\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"measuredHeight\", {\r\n /**\r\n * Returns elements's measured height in pixels.\r\n *\r\n * A measured height is actual height of contents plus `paddingTop` and `paddingBottom`, relative to sprite parent, meaning that\r\n * rotation and scale taken into account.\r\n *\r\n * @readonly\r\n * @return Height (px)\r\n */\r\n get: function () {\r\n if (this.disabled || this.__disabled) {\r\n return 0;\r\n }\r\n // it's not good to fit to min/max range as then rotations and scale won't be taken into account\r\n //return this.adapter.apply(\"measuredHeight\", $math.fitToRange(this._measuredHeight, this.minHeight, this.maxHeight));\r\n if (!this._adapterO) {\r\n return this._measuredHeight;\r\n }\r\n else {\r\n return this._adapterO.apply(\"measuredHeight\", this._measuredHeight);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"outerWidth\", {\r\n /**\r\n * Returns element's measured width plus its left and right margins in\r\n * pixels.\r\n *\r\n * @readonly\r\n * @return Outer width (px)\r\n */\r\n get: function () {\r\n var value = this.pixelWidth + this.pixelMarginRight + this.pixelMarginLeft;\r\n if (!this._adapterO) {\r\n return value;\r\n }\r\n else {\r\n return this._adapterO.apply(\"outerWidth\", value);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"outerHeight\", {\r\n /**\r\n * Returns element's measured height plus its top and bottom margins in\r\n * pixels.\r\n *\r\n * @readonly\r\n * @return Outer height (px)\r\n */\r\n get: function () {\r\n var value = this.pixelHeight + this.pixelMarginTop + this.pixelMarginBottom;\r\n if (!this._adapterO) {\r\n return value;\r\n }\r\n else {\r\n return this._adapterO.apply(\"outerHeight\", value);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"innerWidth\", {\r\n /**\r\n * Returns element's measured inner width in pixels.\r\n *\r\n * Inner width is actual available space for content, e.g. element's width\r\n * minus horizontal padding.\r\n *\r\n * @readonly\r\n * @return Inner width (px)\r\n */\r\n get: function () {\r\n var value = Math.max(0, this.pixelWidth - this.pixelPaddingRight - this.pixelPaddingLeft);\r\n if (!this._adapterO) {\r\n return value;\r\n }\r\n else {\r\n return this._adapterO.apply(\"innerWidth\", value);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"innerHeight\", {\r\n /**\r\n * Returns element's measured inner height in pixels.\r\n *\r\n * Inner height is actual available space for content, e.g. element's height\r\n * minus vertical padding.\r\n *\r\n * @readonly\r\n * @return Inner height (px)\r\n */\r\n get: function () {\r\n var value = Math.max(0, this.pixelHeight - this.pixelPaddingTop - this.pixelPaddingBottom);\r\n if (!this._adapterO) {\r\n return value;\r\n }\r\n else {\r\n return this._adapterO.apply(\"innerHeight\", value);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"globalScale\", {\r\n /**\r\n * Returns element's current \"global\" scale.\r\n *\r\n * Scale values accumulate over hierarchy of elements.\r\n *\r\n * E.g. if a [[Container]] has `scale = 2` and it's child has a `scale = 2`,\r\n * the child's `globalScale` will be 4. (a multitude of `2 x 2`)\r\n *\r\n * @readonly\r\n * @return Global scale\r\n */\r\n get: function () {\r\n var scale = this.scale;\r\n if (this._parent) {\r\n scale = scale * this._parent.globalScale;\r\n }\r\n if (!this._adapterO) {\r\n return scale;\r\n }\r\n else {\r\n return this._adapterO.apply(\"globalScale\", scale);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"scale\", {\r\n /**\r\n * @return Scale (0-1)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"scale\");\r\n },\r\n /**\r\n * Scale of the element.\r\n *\r\n * The scale is set from 0 (element reduced to nothing) to 1 (default size).\r\n * * 2 will mean element is increased twice.\r\n * * 0.5 - reduced by 50%.\r\n *\r\n * Etc.\r\n *\r\n * @param value Scale (0-1)\r\n */\r\n set: function (value) {\r\n value = $type.toNumber(value);\r\n if (value < 0) {\r\n value = 0;\r\n }\r\n if (value != this.getPropertyValue(\"scale\")) {\r\n this.setPropertyValue(\"scale\", value, false, true);\r\n this.handleGlobalScale();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Sets all four margins for the element at once.\r\n *\r\n * Margins are set in pixels.\r\n *\r\n * @param top Top margin\r\n * @param right Right margin\r\n * @param bottom Bottom margin\r\n * @param left Left margin\r\n * @return Current element\r\n */\r\n Sprite.prototype.margin = function (top, right, bottom, left) {\r\n this.marginTop = top;\r\n this.marginRight = right;\r\n this.marginBottom = bottom;\r\n this.marginLeft = left;\r\n return this;\r\n };\r\n Object.defineProperty(Sprite.prototype, \"marginLeft\", {\r\n /**\r\n * @return Margin value\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"marginLeft\");\r\n },\r\n /**\r\n * Left margin - absolute (px) or relative ([[Percent]]).\r\n *\r\n * @param value Margin value\r\n */\r\n set: function (value) {\r\n this.setPercentProperty(\"marginLeft\", value, true, true, this._positionPrecision, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"marginRight\", {\r\n /**\r\n * @return Margin value\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"marginRight\");\r\n },\r\n /**\r\n * Right margin - absolute (px) or relative ([[Percent]]).\r\n *\r\n * @param value Margin value\r\n */\r\n set: function (value) {\r\n this.setPercentProperty(\"marginRight\", value, true, true, this._positionPrecision, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"marginTop\", {\r\n /**\r\n * @return Margin value\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"marginTop\");\r\n },\r\n /**\r\n * Top margin - absolute (px) or relative ([[Percent]]).\r\n *\r\n * @param value Margin value\r\n */\r\n set: function (value) {\r\n this.setPercentProperty(\"marginTop\", value, true, true, this._positionPrecision, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"marginBottom\", {\r\n /**\r\n * @return Margin value\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"marginBottom\");\r\n },\r\n /**\r\n * Bottom margin - absolute (px) or relative ([[Percent]]).\r\n *\r\n * @param value Margin value\r\n */\r\n set: function (value) {\r\n this.setPercentProperty(\"marginBottom\", value, true, true, this._positionPrecision, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"pixelMarginRight\", {\r\n /**\r\n * Returns current right margin in pixels.\r\n *\r\n * @readonly\r\n * @return Right margin (px)\r\n */\r\n get: function () {\r\n var value = this.getPixelX(this.marginRight);\r\n if (!this._adapterO) {\r\n return value;\r\n }\r\n else {\r\n return this._adapterO.apply(\"pixelMarginRight\", value);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"relativeMarginRight\", {\r\n /**\r\n * Returns current relative right margin.\r\n *\r\n * @readonly\r\n * @return Relative right margin\r\n */\r\n get: function () {\r\n // @todo Maybe use [[Percent]]?\r\n var value = this.getRelativeX(this.marginRight);\r\n if (!this._adapterO) {\r\n return value;\r\n }\r\n else {\r\n return this._adapterO.apply(\"relativeMarginRight\", value);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"pixelMarginLeft\", {\r\n /**\r\n * Returns current left margin in pixels.\r\n *\r\n * @readonly\r\n * @return Left margin (px)\r\n */\r\n get: function () {\r\n var value = this.getPixelX(this.marginLeft);\r\n if (!this._adapterO) {\r\n return value;\r\n }\r\n else {\r\n return this._adapterO.apply(\"pixelMarginLeft\", value);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"relativeMarginLeft\", {\r\n /**\r\n * Returns current relative left margin.\r\n *\r\n * @readonly\r\n * @return Relative left margin\r\n */\r\n get: function () {\r\n //@todo Maybe use [[Percent]]?\r\n var value = this.getRelativeX(this.marginLeft);\r\n if (!this._adapterO) {\r\n return value;\r\n }\r\n else {\r\n return this._adapterO.apply(\"relativeMarginLeft\", value);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"pixelMarginTop\", {\r\n /**\r\n * Returns current top margin in pixels.\r\n *\r\n * @readonly\r\n * @return Top margin (px)\r\n */\r\n get: function () {\r\n var value = this.getPixelY(this.marginTop);\r\n if (!this._adapterO) {\r\n return value;\r\n }\r\n else {\r\n return this._adapterO.apply(\"pixelMarginTop\", value);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"relativeMarginTop\", {\r\n /**\r\n * Returns current relative top margin.\r\n *\r\n * @readonly\r\n * @return Relative top margin\r\n */\r\n get: function () {\r\n // @todo Maybe use [[Percent]]?\r\n var value = this.getRelativeY(this.marginTop);\r\n if (!this._adapterO) {\r\n return value;\r\n }\r\n else {\r\n return this._adapterO.apply(\"relativeMarginTop\", value);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"pixelMarginBottom\", {\r\n /**\r\n * Returns current bottom margin in pixels.\r\n *\r\n * @readonly\r\n * @return Bottom margin (px)\r\n */\r\n get: function () {\r\n var value = this.getPixelY(this.marginBottom);\r\n if (!this._adapterO) {\r\n return value;\r\n }\r\n else {\r\n return this._adapterO.apply(\"pixelMarginBottom\", value);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"relativeMarginBottom\", {\r\n /**\r\n * Returns current relative bottom margin.\r\n *\r\n * @readonly\r\n * @return Relative bottom margin\r\n */\r\n get: function () {\r\n // @todo Maybe use [[Percent]]?\r\n var value = this.getRelativeY(this.marginBottom);\r\n if (!this._adapterO) {\r\n return value;\r\n }\r\n else {\r\n return this._adapterO.apply(\"relativeMarginBottom\", value);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Sets padding for the element in pixels.\r\n *\r\n * @param top Top padding (px)\r\n * @param right Right padding (px)\r\n * @param bottom Bottom padding (px)\r\n * @param left Left padding (px)\r\n * @return Element\r\n */\r\n Sprite.prototype.padding = function (top, right, bottom, left) {\r\n this.paddingTop = top;\r\n this.paddingRight = right;\r\n this.paddingBottom = bottom;\r\n this.paddingLeft = left;\r\n return this;\r\n };\r\n Object.defineProperty(Sprite.prototype, \"paddingLeft\", {\r\n /**\r\n * @return Padding value\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"paddingLeft\");\r\n },\r\n /**\r\n * Left padding - absolute (px) or relative ([[Percent]]).\r\n *\r\n * @param value Padding value\r\n */\r\n set: function (value) {\r\n this.setPercentProperty(\"paddingLeft\", value, true, true, this._positionPrecision, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"paddingRight\", {\r\n /**\r\n * @return Padding value\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"paddingRight\");\r\n },\r\n /**\r\n * Right padding - absolute (px) or relative ([[Percent]]).\r\n *\r\n * @param value Padding value\r\n */\r\n set: function (value) {\r\n this.setPercentProperty(\"paddingRight\", value, true, true, this._positionPrecision, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"paddingTop\", {\r\n /**\r\n * @return Padding value\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"paddingTop\");\r\n },\r\n /**\r\n * Top padding - absolute (px) or relative ([[Percent]]).\r\n *\r\n * @param value Padding value\r\n */\r\n set: function (value) {\r\n this.setPercentProperty(\"paddingTop\", value, true, true, this._positionPrecision, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"paddingBottom\", {\r\n /**\r\n * @return Padding value\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"paddingBottom\");\r\n },\r\n /**\r\n * Bottom padding - absolute (px) or relative ([[Percent]]).\r\n *\r\n * @param value Padding value\r\n */\r\n set: function (value) {\r\n this.setPercentProperty(\"paddingBottom\", value, true, true, this._positionPrecision, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"pixelPaddingRight\", {\r\n /**\r\n * Returns current right padding in pixels.\r\n *\r\n * @readonly\r\n * @return Right padding (px)\r\n */\r\n get: function () {\r\n return this.getPixelX(this.paddingRight);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"relativePaddingRight\", {\r\n /**\r\n * Returns current relative right padding.\r\n *\r\n * @readonly\r\n * @return Relative right padding\r\n */\r\n get: function () {\r\n // @todo Maybe use [[Percent]]?\r\n return this.getRelativeX(this.paddingRight);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"pixelPaddingLeft\", {\r\n /**\r\n * Returns current left padding in pixels.\r\n *\r\n * @readonly\r\n * @return Left padding (px)\r\n */\r\n get: function () {\r\n return this.getPixelX(this.paddingLeft);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"relativePaddingLeft\", {\r\n /**\r\n * Returns current relative left padding.\r\n *\r\n * @readonly\r\n * @return Relative left padding\r\n */\r\n get: function () {\r\n // @todo Maybe use [[Percent]]?\r\n return this.getRelativeX(this.paddingLeft);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"pixelPaddingTop\", {\r\n /**\r\n * Returns current top padding in pixels.\r\n *\r\n * @readonly\r\n * @return Top padding (px)\r\n */\r\n get: function () {\r\n return this.getPixelY(this.paddingTop);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"relativePaddingTop\", {\r\n /**\r\n * Returns current relative top padding.\r\n *\r\n * @readonly\r\n * @return Relative top padding\r\n */\r\n get: function () {\r\n // @todo Maybe use [[Percent]]?\r\n return this.getRelativeY(this.paddingTop);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"pixelPaddingBottom\", {\r\n /**\r\n * Returns current bottom padding in pixels.\r\n *\r\n * @readonly\r\n * @return Bottom padding (px)\r\n */\r\n get: function () {\r\n return this.getPixelY(this.paddingBottom);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"relativePaddingBottom\", {\r\n /**\r\n * Returns current relative bottom padding.\r\n *\r\n * @readonly\r\n * @return Relative bottom padding\r\n */\r\n get: function () {\r\n // @todo Maybe use [[Percent]]?\r\n return this.getRelativeY(this.paddingBottom);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"path\", {\r\n /**\r\n * @return Path of a Sprite element\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"path\");\r\n },\r\n /**\r\n * ==========================================================================\r\n * APPEARANCE-RELATED PROPERTIES AND RELATED STUFF\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Path of Sprite element\r\n */\r\n set: function (value) {\r\n this.setPath(value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * @ignore\r\n */\r\n Sprite.prototype.setPath = function (value) {\r\n if (this.setPropertyValue(\"path\", value)) {\r\n if (this._adapterO) {\r\n value = this._adapterO.apply(\"path\", value);\r\n }\r\n if (!this._isPath) {\r\n if (!this.element || (this.element.node && !(this.element.node instanceof SVGPathElement))) {\r\n this.element = this.paper.add(\"path\");\r\n }\r\n this._isPath = true;\r\n }\r\n if ($type.hasValue(value)) {\r\n this.element.attr({ \"d\": value });\r\n }\r\n else {\r\n this.element.removeAttr(\"d\");\r\n }\r\n this.invalidatePosition();\r\n // otherwise is 0x0\r\n if (!this.inited) {\r\n this.events.once(\"inited\", this.validatePosition, this, false);\r\n }\r\n return true;\r\n }\r\n return false;\r\n };\r\n Object.defineProperty(Sprite.prototype, \"fillModifier\", {\r\n /**\r\n * @return Fill color modifier\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"fillModifier\");\r\n },\r\n /**\r\n * [[ColorModifier]] that can be used to modify color and pattern of the\r\n * element's fill, e.g. create gradients.\r\n *\r\n * @param value Fill color modifiier\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"fillModifier\", value)) {\r\n this.setFill(this.fill);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"strokeModifier\", {\r\n /**\r\n * @return Stroke color modifier\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"strokeModifier\");\r\n },\r\n /**\r\n * [[ColorModifier]] that can be used to modify color and pattern of the\r\n * element's stroke (outline), e.g. create gradients.\r\n *\r\n * @param value Stroke color modifier\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"strokeModifier\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"fillOpacity\", {\r\n /**\r\n * @return Opacity (0-9)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"fillOpacity\");\r\n },\r\n /**\r\n * Element's fill opacity.\r\n *\r\n * Opacity ranges from 0 (fully transparent) to 1 (fully opaque).\r\n *\r\n * @param value Opacity (0-1)\r\n */\r\n set: function (value) {\r\n value = $math.toNumberRange(value, 0, 1);\r\n if (this.setPropertyValue(\"fillOpacity\", value)) {\r\n this.setSVGAttribute({ \"fill-opacity\": value });\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"fill\", {\r\n /**\r\n * @return Fill\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"fill\");\r\n },\r\n /**\r\n * Element's fill color or pattern.\r\n *\r\n * @param value Fill\r\n */\r\n set: function (value) {\r\n this.setFill(value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Sets actual `fill` property on the SVG element, including applicable color\r\n * modifiers.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Fill\r\n */\r\n Sprite.prototype.setFill = function (value) {\r\n if (!$type.isObject(value) || \"r\" in value) {\r\n value = toColor(value);\r\n }\r\n if (this.setColorProperty(\"fill\", value) || this.fillModifier) {\r\n // this can not go into next if, as value is turned to Gradient\r\n if (value instanceof Color) {\r\n if (this.fillModifier) {\r\n value = this.fillModifier.modify(value);\r\n }\r\n }\r\n this.realFill = value;\r\n // todo: review this place when some Color type will be added\r\n if (value instanceof Color) {\r\n this.setSVGAttribute({ \"fill\": value.toString() });\r\n }\r\n else if (!$type.hasValue(value)) {\r\n this.removeSVGAttribute(\"fill\");\r\n }\r\n else if (value instanceof Pattern || value instanceof LinearGradient || value instanceof RadialGradient) {\r\n var fill = value;\r\n fill.paper = this.paper;\r\n this.setSVGAttribute({ \"fill\": \"url(\\\"\" + $utils.getBaseURI() + fill.id + \"\\\")\" });\r\n }\r\n }\r\n };\r\n Object.defineProperty(Sprite.prototype, \"opacity\", {\r\n /**\r\n * @return Opacity (0-1)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"opacity\");\r\n },\r\n /**\r\n * Element's opacity.\r\n *\r\n * Opacity setting can range from 0 (fully transparent) to 1 (fully opaque).\r\n *\r\n * ATTENTION: It is highly not recommended to use `opacity` directly on the\r\n * element. The charts use `opacity` to hide/show elements, so your setting\r\n * might be lost if element is hidden and then later shown.\r\n *\r\n * Instead use methods `hide()` and `show()` to completely toggle off and on\r\n * the element.\r\n *\r\n * Or, use properties `fillOpacity` and `strokeOpacity`, if you need to make\r\n * the element semi-transparent.\r\n *\r\n * @param value Opacity (0-1)\r\n */\r\n set: function (value) {\r\n value = $math.toNumberRange(value, 0, 1);\r\n if (this.setPropertyValue(\"opacity\", value)) {\r\n this.setSVGAttribute({ \"opacity\": value });\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"stroke\", {\r\n /**\r\n * @return Stroke setting\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"stroke\");\r\n },\r\n /**\r\n * Element's stroke (outline) color or pattern.\r\n *\r\n * @param value Stroke setting\r\n */\r\n set: function (value) {\r\n this.setStroke(value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Sets actual `stroke` property on the SVG element, including applicable\r\n * color modifiers.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Stroke setting\r\n */\r\n Sprite.prototype.setStroke = function (value) {\r\n if (!$type.isObject(value) || \"r\" in value) {\r\n value = toColor(value);\r\n }\r\n if (this.setColorProperty(\"stroke\", value) || this.strokeModifier) {\r\n // this can not go into next if, as value is turned to Gradient\r\n if (value instanceof Color) {\r\n if (this.strokeModifier) {\r\n value = this.strokeModifier.modify(value);\r\n }\r\n }\r\n this.realStroke = value;\r\n if (value instanceof Color) {\r\n if (value.hex == \"none\") {\r\n this.removeSVGAttribute(\"stroke\");\r\n }\r\n else {\r\n this.setSVGAttribute({ \"stroke\": value.toString() });\r\n }\r\n }\r\n else if (!$type.hasValue(value)) {\r\n this.removeSVGAttribute(\"stroke\");\r\n }\r\n else if (value instanceof Pattern || value instanceof LinearGradient || value instanceof RadialGradient) {\r\n var stroke = value;\r\n stroke.paper = this.paper;\r\n this.setSVGAttribute({ \"stroke\": \"url(\\\"\" + $utils.getBaseURI() + stroke.id + \"\\\")\" });\r\n }\r\n }\r\n };\r\n Object.defineProperty(Sprite.prototype, \"strokeOpacity\", {\r\n /**\r\n * @return Opacity (0-1)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"strokeOpacity\");\r\n },\r\n /**\r\n * Stroke (outline) opacity.\r\n *\r\n * The values may range from 0 (fully transparent) to 1 (fully opaque).\r\n *\r\n * @param value Opacity (0-1)\r\n */\r\n set: function (value) {\r\n value = $math.toNumberRange(value, 0, 1);\r\n if (this.setPropertyValue(\"strokeOpacity\", value)) {\r\n this.setSVGAttribute({ \"stroke-opacity\": value });\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"nonScalingStroke\", {\r\n /**\r\n * @return Do not scale stroke (outline)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"nonScalingStroke\");\r\n },\r\n /**\r\n * Controls if the element's stroke (outline) should remain keep constant\r\n * thicnkess and do not scale when the whole element is resized.\r\n *\r\n * @param value Do not scale stroke (outline)\r\n */\r\n set: function (value) {\r\n value = $type.toBoolean(value);\r\n if (this.setPropertyValue(\"nonScalingStroke\", value)) {\r\n this.strokeWidth = this.strokeWidth;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"nonScaling\", {\r\n /**\r\n * @return Is element scaleable?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"nonScaling\");\r\n },\r\n /**\r\n * Controls if element should keep constant size and not scale even if there is\r\n * space available, or it does not fit.\r\n *\r\n * @param value Is element scaleable?\r\n */\r\n set: function (value) {\r\n // @todo Description (review)\r\n value = $type.toBoolean(value);\r\n this.setPropertyValue(\"nonScaling\", value, false, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"strokeWidth\", {\r\n /**\r\n * @return Thickness (px)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"strokeWidth\");\r\n },\r\n /**\r\n * Stroke (outline) thickness in pixels.\r\n *\r\n * @param value Thickness (px)\r\n */\r\n set: function (value) {\r\n value = $type.toNumber(value);\r\n this.setPropertyValue(\"strokeWidth\", value, true);\r\n if (this.nonScalingStroke) {\r\n if (!$type.isNumber(value)) {\r\n value = 1;\r\n }\r\n value = value / this.globalScale;\r\n }\r\n this.setSVGAttribute({ \"stroke-width\": value });\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"strokeDasharray\", {\r\n /**\r\n * @return `stroke-dasharray`\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"strokeDasharray\");\r\n },\r\n /**\r\n * A `stroke-dasharray` for the stroke (outline).\r\n *\r\n * \"Dasharray\" allows setting rules to make lines dashed, dotted, etc.\r\n *\r\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-dasharray} for more info on `stroke-dasharray`\r\n * @param value `stroke-dasharray`\r\n */\r\n set: function (value) {\r\n value = $type.toText(value);\r\n if (this.setPropertyValue(\"strokeDasharray\", value)) {\r\n this.setSVGAttribute({ \"stroke-dasharray\": value });\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"strokeDashoffset\", {\r\n /**\r\n * @return `stroke-dashoffset`\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"strokeDashoffset\");\r\n },\r\n /**\r\n * A `stroke-dashoffset` for the stroke (outline).\r\n *\r\n * \"Dashoffset\" allows setting the start position of the dashes if\r\n * `strokeDasharray` is used.\r\n *\r\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-dashoffset} for more info on `stroke-dashoffset`\r\n * @param value `stroke-dashoffset`\r\n */\r\n set: function (value) {\r\n value = $type.toNumber(value);\r\n if (this.setPropertyValue(\"strokeDashoffset\", value)) {\r\n this.setSVGAttribute({ \"stroke-dashoffset\": value });\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"strokeLinecap\", {\r\n /**\r\n * @return `stroke-linecap`\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"strokeLinecap\");\r\n },\r\n /**\r\n * A `stroke-linecap` to indicate how line ends are drawn.\r\n *\r\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Fills_and_Strokes#Stroke} for more info on `stroke-linecap`\r\n * @param value `stroke-linecap`\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"strokeLinecap\", value)) {\r\n this.setSVGAttribute({ \"stroke-linecap\": value });\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"strokeLinejoin\", {\r\n /**\r\n * @return `stroke-linejoin`\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"strokeLinejoin\");\r\n },\r\n /**\r\n * A `stroke-linejoin` to indicate how line ends are drawn.\r\n *\r\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Fills_and_Strokes#Stroke} for more info on `stroke-linejoin`\r\n * @param value `stroke-linejoin`\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"strokeLinejoin\", value)) {\r\n this.setSVGAttribute({ \"stroke-linejoin\": value });\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"shapeRendering\", {\r\n /**\r\n * @return 'shape-rendering' value\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"shapeRendering\");\r\n },\r\n /**\r\n * An SVG-specific `shape-rendering` value.\r\n *\r\n * `shape-rendering` controls how vector graphics are drawn and rendered.\r\n *\r\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/shape-rendering} for more information about `shape-rendering`\r\n * @default \"auto\"\r\n * @param value 'shape-rendering' value\r\n */\r\n set: function (value) {\r\n value = $type.toText(value);\r\n if (this.setPropertyValue(\"shapeRendering\", value)) {\r\n this.setSVGAttribute({ \"shape-rendering\": value });\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"pixelPerfect\", {\r\n /**\r\n * @return Use pixel perfect?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"pixelPerfect\");\r\n },\r\n /**\r\n * Controls if SVG vectors should be drawn with \"pixel\" precision, producing\r\n * perfectly crisp lines on retina displays.\r\n *\r\n * Setting this to `true` might improve visual quality, but may have a\r\n * negative effect on performance.\r\n *\r\n * Different elements use different default setting for `pixelPerfect`.\r\n *\r\n * We recommend leaving this at their default settings, unless there's a\r\n * specific need.\r\n *\r\n * @param value Use pixel perfect?\r\n */\r\n set: function (value) {\r\n value = $type.toBoolean(value);\r\n if (value) {\r\n this._positionPrecision = options.pixelPerfectPrecision;\r\n }\r\n else {\r\n this._positionPrecision = 3;\r\n }\r\n this.setPropertyValue(\"pixelPerfect\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"rtl\", {\r\n /**\r\n * @return RTL?\r\n */\r\n get: function () {\r\n if ($type.hasValue(this._rtl)) {\r\n return this._rtl;\r\n }\r\n else if (this._topParent) {\r\n return this._topParent.rtl;\r\n }\r\n //this.rtl = false;\r\n return false;\r\n },\r\n /**\r\n * An RTL (right-to-left) setting.\r\n *\r\n * RTL may affect alignment, text, and other visual properties.\r\n *\r\n * If you set this on a top-level chart object, it will be used for all\r\n * child elements, e.g. labels, unless they have their own `rtl` setting\r\n * set directly on them.\r\n *\r\n * @param value `true` for to use RTL\r\n */\r\n set: function (value) {\r\n value = $type.toBoolean(value);\r\n if (this.isBaseSprite) {\r\n this.topParent.rtl = value;\r\n }\r\n this._rtl = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * ==========================================================================\r\n * VISIBILITY AND ORDER PROPERTIES AND RELATED STUFF\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Reveals hidden element.\r\n *\r\n * Has no effect if element is already visible.\r\n *\r\n * If `duration` is not specified, it will use default.\r\n *\r\n * @param duration Fade in duration (ms)\r\n * @return Animation object if such object was created\r\n */\r\n Sprite.prototype.show = function (duration) {\r\n return this.showReal(duration);\r\n };\r\n /**\r\n * Performs actual operations to reveal this element.\r\n *\r\n * @ignore Exclude from docs\r\n * @param duration Fade in duration (ms)\r\n * @return Fade in duration (ms)\r\n */\r\n Sprite.prototype.showReal = function (duration) {\r\n var _this = this;\r\n if (this.preventShow) {\r\n return;\r\n }\r\n var transition;\r\n var properties = this.defaultState.properties;\r\n if (!this.disabled && (this.isHidden || !this.visible || this.isHiding || (properties.opacity != null && this.opacity < properties.opacity && !this.isShowing)) && !this.isDisposed()) {\r\n // helps to avoid flicker, as show might change opacity or visibility but item might be at invalid state/position\r\n if (this.invalid) {\r\n this.validate();\r\n }\r\n if (this.positionInvalid) {\r\n this.validatePosition();\r\n }\r\n if (!$type.isNumber(duration)) {\r\n duration = this.defaultState.transitionDuration;\r\n }\r\n if (this._hideAnimation) {\r\n this._hideAnimation.kill();\r\n this._hideAnimation = undefined;\r\n }\r\n // Cancel hide handler just in case it was there\r\n if (this._showHideDisposer) {\r\n this.removeDispose(this._showHideDisposer);\r\n }\r\n this._isHidden = false;\r\n this.isHiding = false;\r\n this.isShowing = true;\r\n // Apply current state\r\n transition = this.applyCurrentState(duration);\r\n if (transition && !transition.isFinished()) {\r\n this._showHideDisposer = transition.events.on(\"animationended\", function () {\r\n _this.isShowing = false;\r\n });\r\n this._disposers.push(this._showHideDisposer);\r\n }\r\n else {\r\n this.isShowing = false;\r\n }\r\n // Make it visible\r\n var visible = this.defaultState.properties.visible;\r\n if (!$type.hasValue(visible)) {\r\n visible = true;\r\n }\r\n this.visible = visible;\r\n // Unhide from screen readers\r\n this.readerHidden = false;\r\n // Dispatch \"show\" event\r\n this.dispatchImmediately(\"shown\");\r\n }\r\n return transition;\r\n };\r\n /**\r\n * Initiates hiding of Sprite.\r\n * When called it will fade out the the Sprite to transparency, then make it\r\n * invisible.\r\n * @param duration Duration in millisecons\r\n */\r\n /**\r\n * Hides the element, by applying `hidden` state.\r\n *\r\n * Has no effect if element is already hidden.\r\n *\r\n * If `duration` is not specified, it will use default.\r\n *\r\n * While element is fading out, its `isHiding` property will resolve to\r\n * `true`.\r\n *\r\n * When element is hidden, its `visible` property will resolve to `false`.\r\n *\r\n * @param duration Fade out duration (ms)\r\n * @return hide Animation object if such object was created\r\n */\r\n Sprite.prototype.hide = function (duration) {\r\n return this.hideReal(duration);\r\n };\r\n /**\r\n * Hides actual SVG elements and handles hiding animations.\r\n *\r\n * @param duration Fade out duration (ms)\r\n * @return Fade out duration (ms)\r\n * @ignore\r\n */\r\n Sprite.prototype.hideReal = function (duration) {\r\n var _this = this;\r\n var transition;\r\n if (!this.isHiding && this.visible && !this.isDisposed()) {\r\n // added to solve 51375\r\n if (this.tooltip && this.tooltip.currentSprite == this) {\r\n this.hideTooltip(0);\r\n }\r\n if (this._hideAnimation) {\r\n this._hideAnimation.kill();\r\n this._hideAnimation = undefined;\r\n }\r\n this.isShowing = false;\r\n // Cancel hide handler just in case it was there\r\n if (this._showHideDisposer) {\r\n this.removeDispose(this._showHideDisposer);\r\n }\r\n // Get state\r\n var hiddenState_1 = this.hiddenState;\r\n // Transition to \"hidden\" state, provided Sprite has one set\r\n if (hiddenState_1) {\r\n // Yes, we have a \"hidden\" state\r\n // `setState` will return an `Animation` object which we can set\r\n // events on\r\n transition = this.setState(hiddenState_1, duration, undefined);\r\n if (transition && !transition.isFinished()) {\r\n this._hideAnimation = transition;\r\n this._showHideDisposer = transition.events.on(\"animationended\", function () {\r\n _this.isHiding = false;\r\n _this._isHidden = true;\r\n if (hiddenState_1.properties.visible == false) {\r\n _this.visible = false;\r\n }\r\n }, this);\r\n this._disposers.push(this._showHideDisposer);\r\n // Thrown everything into `_disposers` just in case Sprite gets\r\n // destroyed in the meantime\r\n this._disposers.push(transition);\r\n }\r\n else {\r\n this.isHiding = false;\r\n this._isHidden = true;\r\n }\r\n }\r\n else {\r\n // No hidden state, let's just set `visible` and call it a day\r\n this.visible = false;\r\n this.isHiding = false;\r\n this._isHidden = true;\r\n }\r\n // Hide from screen readers\r\n this.readerHidden = true;\r\n // Dispach \"hidden\" event\r\n this.dispatchImmediately(\"hidden\");\r\n this.invalidate(); // hide it at once to avoid flickers // validate() causes SO\r\n }\r\n if (!$type.isNumber(duration)) {\r\n duration = this.hiddenState.transitionDuration;\r\n }\r\n return transition;\r\n };\r\n Object.defineProperty(Sprite.prototype, \"visible\", {\r\n /**\r\n * @return Visible?\r\n */\r\n get: function () {\r\n return this.getVisibility();\r\n },\r\n /**\r\n * Indicates if element is current visible (`true`) or hidden (`false`).\r\n *\r\n * @param value Visible?\r\n */\r\n set: function (value) {\r\n value = $type.toBoolean(value);\r\n this.setVisibility(value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Returns visibility value\r\n * @ignore\r\n */\r\n Sprite.prototype.getVisibility = function () {\r\n var value = this.getPropertyValue(\"visible\");\r\n if (!$type.hasValue(value)) {\r\n value = true;\r\n }\r\n return value;\r\n };\r\n /**\r\n * Sets `visibility` property:\r\n *\r\n * * `true` - visible\r\n * * `false` - hidden\r\n *\r\n * @param value true - visible, false - hidden\r\n * @return Current visibility\r\n */\r\n Sprite.prototype.setVisibility = function (value) {\r\n if (this.setPropertyValue(\"visible\", value)) {\r\n if (value) {\r\n this.group.removeAttr(\"visibility\");\r\n }\r\n else {\r\n this.group.attr({ \"visibility\": \"hidden\" });\r\n }\r\n //this.invalidatePosition();\r\n if (this.events.isEnabled(\"visibilitychanged\")) {\r\n var event_4 = {\r\n type: \"visibilitychanged\",\r\n target: this,\r\n visible: value\r\n };\r\n this.events.dispatchImmediately(\"visibilitychanged\", event_4);\r\n }\r\n }\r\n };\r\n Object.defineProperty(Sprite.prototype, \"zIndex\", {\r\n /**\r\n * @return zIndex\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"zIndex\");\r\n },\r\n /**\r\n * A \"zIndex\" of the element.\r\n *\r\n * \"zIndex\" determines the order of how elements are placed over each other.\r\n *\r\n * Higher \"zIndex\" will mean the element will be draw on top of elements\r\n * with lower \"zIndexes\".\r\n *\r\n * @param value zIndex\r\n */\r\n set: function (value) {\r\n value = $type.toNumber(value);\r\n if (this.setPropertyValue(\"zIndex\", value)) {\r\n this.dispatch(\"zIndexChanged\");\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Moves the element to the very top in element order, so that it appears\r\n * in front of other elements.\r\n */\r\n Sprite.prototype.toFront = function () {\r\n var parent = this._parent;\r\n if (parent && parent.children.indexOf(this) != parent.children.length - 1) {\r\n parent.children.moveValue(this, parent.children.length - 1);\r\n this.dispatch(\"zIndexChanged\");\r\n }\r\n };\r\n /**\r\n * Moves the element to the very bottom in the element order, so that it\r\n * appears behind other elements.\r\n */\r\n Sprite.prototype.toBack = function () {\r\n var parent = this._parent;\r\n if (parent && parent.children.indexOf(this) != 0) {\r\n parent.children.moveValue(this, 0);\r\n this.dispatch(\"zIndexChanged\");\r\n }\r\n };\r\n Object.defineProperty(Sprite.prototype, \"userClassName\", {\r\n /**\r\n * @return Class name\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"userClassName\");\r\n },\r\n /**\r\n * A custom class name to set on the element.\r\n *\r\n * If set, the value will be added to element's `class` attribute.\r\n *\r\n * @since 4.9.11\r\n * @param value Class name\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"userClassName\", value)) {\r\n if (!value && this.userClassName) {\r\n this.group.removeClass(this.userClassName);\r\n }\r\n this.setClassName();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"tooltip\", {\r\n /**\r\n * @return Tooltip\r\n */\r\n get: function () {\r\n if (this._tooltip) {\r\n return this._tooltip;\r\n }\r\n else if (this.virtualParent) {\r\n return this.virtualParent.tooltip;\r\n }\r\n else if (this._parent) {\r\n return this._parent.tooltip;\r\n }\r\n },\r\n /**\r\n * ==========================================================================\r\n * TOOLTIP-RELATED PROPERTIES STUFF\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * A [[Tooltip]] object to be used when displayed rollover information for\r\n * the element.\r\n *\r\n * @param tooltip Tooltip\r\n */\r\n set: function (tooltip) {\r\n if (this._tooltip) {\r\n //this._tooltip.dispose();\r\n this.removeDispose(this._tooltip);\r\n }\r\n this._tooltip = tooltip;\r\n if (tooltip) {\r\n tooltip.parent = this.tooltipContainer;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"tooltipDataItem\", {\r\n /**\r\n * @return Tooltip data item\r\n */\r\n get: function () {\r\n var tooltipDataItem = this._tooltipDataItem;\r\n if (tooltipDataItem) {\r\n return tooltipDataItem;\r\n }\r\n else {\r\n return this.dataItem;\r\n }\r\n },\r\n /**\r\n * A [[DataItem]] to use when populating content for the element's\r\n * [[Tooltip]].\r\n *\r\n * @see {@link Tooltip}\r\n * @see {@link DataItem}\r\n * @param value Tooltip data item\r\n */\r\n set: function (value) {\r\n // important: do not dispose tooltip dataItem, as it is some actual data item from data!\r\n this._tooltipDataItem = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"tooltipColorSource\", {\r\n /**\r\n * @return Tooltip color source\r\n */\r\n get: function () {\r\n return this._tooltipColorSource;\r\n },\r\n /**\r\n * A [[Sprite]] or sprite template to use when getting colors for tooltip. If a template is set,\r\n * tooltip will look for a clone in tooltipDataItem.sprites. If no clone is found, then template colors will be used.\r\n *\r\n * @see {@link Tooltip}\r\n * @see {@link Sprite}\r\n * @param sprite Sprite\r\n */\r\n set: function (sprite) {\r\n this._tooltipColorSource = sprite;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Shows the element's [[Tooltip]].\r\n *\r\n * A tooltip will be populated using text templates in either `tooltipHTML` or\r\n * `tooltipText` as well as data in `tooltipDataItem`.\r\n *\r\n * @see {@link Tooltip}\r\n * @param optional point (sprite-related) to which tooltip must point.\r\n * @return returns true if the tooltip was shown and false if it wasn't (no text was found)\r\n */\r\n Sprite.prototype.showTooltip = function (point) {\r\n if (this.showTooltipOn == \"always\" && !this._tooltip && this.tooltip) {\r\n this._tooltip = this.tooltip.clone();\r\n }\r\n if (!point && this.tooltipPosition == \"pointer\" && this.isHover) {\r\n point = $utils.documentPointToSvg(getInteraction().lastPointer.point, this.svgContainer.SVGContainer, this.svgContainer.cssScale);\r\n }\r\n // do not show if hidden\r\n var sprite = this;\r\n while (sprite != undefined) {\r\n if (!sprite.visible || sprite.disabled || sprite.__disabled) {\r\n if (this._tooltip && this._tooltip.visible) {\r\n this._tooltip.hide(0);\r\n }\r\n return;\r\n }\r\n sprite = sprite.parent;\r\n }\r\n if ($type.hasValue(this.tooltipText) || $type.hasValue(this.tooltipHTML)) {\r\n var tooltip = this.tooltip;\r\n var tooltipDataItem = this.tooltipDataItem;\r\n if (tooltip) {\r\n tooltip.targetSprite = this;\r\n var colorSource_1 = this;\r\n var tooltipColorSource_1 = this.tooltipColorSource;\r\n if ((tooltip.getStrokeFromObject || tooltip.getFillFromObject) && tooltipColorSource_1) {\r\n if (tooltipColorSource_1.isTemplate) {\r\n if (tooltipDataItem) {\r\n $array.eachContinue(tooltipDataItem.sprites, function (sprite) {\r\n if (sprite.clonedFrom == tooltipColorSource_1) {\r\n colorSource_1 = sprite;\r\n return false;\r\n }\r\n return true;\r\n });\r\n }\r\n }\r\n else {\r\n colorSource_1 = tooltipColorSource_1;\r\n }\r\n }\r\n if (tooltip.getStrokeFromObject) {\r\n var stroke = this.stroke;\r\n var source = colorSource_1;\r\n while (source.parent != undefined) {\r\n stroke = source.stroke;\r\n if (stroke == undefined) {\r\n source = source.parent;\r\n }\r\n if (stroke != undefined) {\r\n break;\r\n }\r\n }\r\n if (stroke instanceof Color) {\r\n tooltip.background.animate({ property: \"stroke\", to: stroke }, tooltip.animationDuration);\r\n }\r\n else {\r\n tooltip.background.stroke = stroke;\r\n }\r\n }\r\n // Set data item\r\n tooltip.dataItem = tooltipDataItem;\r\n tooltip.label.populateStringFrom = this;\r\n if (tooltip.getFillFromObject) {\r\n var fill = this.fill;\r\n var source = colorSource_1;\r\n while (source.parent != undefined) {\r\n fill = source.fill;\r\n if (fill == undefined || (fill instanceof Color && fill.rgb == undefined)) {\r\n source = source.parent;\r\n }\r\n else if (fill != undefined) {\r\n break;\r\n }\r\n }\r\n if (fill == undefined) {\r\n fill = color(\"#000000\");\r\n }\r\n if (fill instanceof Color) {\r\n if (!tooltip.visible) {\r\n tooltip.background.fill = fill;\r\n }\r\n else {\r\n tooltip.background.animate({ property: \"fill\", to: fill }, tooltip.animationDuration);\r\n }\r\n }\r\n else {\r\n tooltip.background.fill = fill;\r\n }\r\n if (tooltip.autoTextColor && fill instanceof Color) {\r\n tooltip.label.fill = fill.alternative;\r\n }\r\n }\r\n // Apply tooltip text\r\n var text = \"\";\r\n if (this.tooltipHTML) {\r\n tooltip.html = this.tooltipHTML;\r\n text = this.tooltipHTML;\r\n }\r\n if (this.tooltipText) {\r\n tooltip.text = this.tooltipText;\r\n text = this.tooltipText;\r\n }\r\n if (this.updateTooltipPosition(point)) {\r\n // Set accessibility option\r\n tooltip.readerDescribedBy = this.uidAttr();\r\n // make label to render to be able to check currentText\r\n if (tooltip.label.invalid) {\r\n tooltip.label.validate();\r\n }\r\n if (text != undefined && text != \"\" && tooltip.label.currentText != \"\") {\r\n //@todo: think of how to solve this better\r\n if (tooltip && !tooltip.parent) {\r\n tooltip.parent = this.tooltipContainer;\r\n }\r\n // Reveal tooltip\r\n // showing it in 1 ms helps to avoid strange flickering in IE\r\n var duration = tooltip.defaultState.transitionDuration;\r\n if (duration <= 0) {\r\n duration = 1;\r\n }\r\n tooltip.show(duration);\r\n tooltip.currentSprite = this;\r\n return true;\r\n }\r\n else {\r\n this.hideTooltip(0);\r\n }\r\n }\r\n else {\r\n this.hideTooltip(0);\r\n }\r\n }\r\n }\r\n return false;\r\n };\r\n /**\r\n * @ignore\r\n */\r\n Sprite.prototype.updateTooltipPosition = function (point) {\r\n var _this = this;\r\n if (this.tooltipPosition == \"pointer\") {\r\n if (this._interactionDisposer) {\r\n this._interactionDisposer.dispose();\r\n }\r\n this._interactionDisposer = getInteraction().body.events.on(\"track\", function (ev) {\r\n return _this.pointTooltipTo($utils.documentPointToSvg(ev.point, _this.svgContainer.SVGContainer, _this.svgContainer.cssScale), true);\r\n });\r\n if (point) {\r\n return this.pointTooltipTo(point, true);\r\n }\r\n }\r\n else {\r\n // Point to the X/Y of this Sprite\r\n var globalPoint = $utils.spritePointToSvg({\r\n \"x\": this.getTooltipX(),\r\n \"y\": this.getTooltipY()\r\n }, this);\r\n return this.pointTooltipTo(globalPoint);\r\n }\r\n };\r\n /**\r\n * Sets the point the [[Tooltip]] should point to.\r\n *\r\n * @param point Coordinates to point to\r\n * @param instantly Move instantly without animation\r\n */\r\n Sprite.prototype.pointTooltipTo = function (point, instantly) {\r\n var tooltip = this.tooltip;\r\n if (tooltip && this.topParent) {\r\n if (tooltip.showInViewport) {\r\n tooltip.pointTo(point, instantly);\r\n return true;\r\n }\r\n if ($math.isInRectangle(point, { x: 0, y: 0, width: this.topParent.maxWidth, height: this.topParent.maxHeight })) {\r\n tooltip.pointTo(point, instantly);\r\n return true;\r\n }\r\n }\r\n return false;\r\n };\r\n /**\r\n * Hides element's [[Tooltip]].\r\n *\r\n * @see {@link Tooltip}\r\n */\r\n Sprite.prototype.hideTooltip = function (duration) {\r\n if (this.showTooltipOn == \"always\") {\r\n return;\r\n }\r\n var tooltip = this.tooltip;\r\n if (tooltip) {\r\n if (tooltip.targetSprite == this) {\r\n tooltip.targetSprite = undefined;\r\n }\r\n tooltip.hide(duration);\r\n if (this._interactionDisposer) {\r\n this._interactionDisposer.dispose();\r\n this._interactionDisposer = undefined;\r\n }\r\n }\r\n };\r\n Object.defineProperty(Sprite.prototype, \"tooltipHTML\", {\r\n /**\r\n * @return Tooltip HTML content template\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"tooltipHTML\");\r\n },\r\n /**\r\n * An HTML template to be used to populate [[Tooltip]] contents.\r\n *\r\n * If element has `tooltipDataItem` or `dataItem` set, this will be parsed\r\n * for any data values to be replaced with the values from respective data\r\n * items.\r\n *\r\n * @param value Tooltip HTML content template\r\n */\r\n set: function (value) {\r\n value = $type.toText(value);\r\n this.hoverable = true;\r\n if (this.setPropertyValue(\"tooltipHTML\", value)) {\r\n if (this.tooltip) {\r\n if (this.tooltip.visible) {\r\n this.showTooltip();\r\n }\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"tooltipText\", {\r\n /**\r\n * @return Tooltip content template\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"tooltipText\");\r\n },\r\n /**\r\n * A text template to be used to populate Tooltip's contents.\r\n *\r\n * If element has `tooltipDataItem` or `dataItem` set, this will be parsed\r\n * for any data values to be replaced with the values from respective data\r\n * items.\r\n *\r\n * This template will also be parsed for any special formatting tags.\r\n *\r\n * @param value Tooltip content template\r\n * @see {@link TextFormatter}\r\n */\r\n set: function (value) {\r\n value = $type.toText(value);\r\n if (value) {\r\n this.hoverable = true;\r\n }\r\n if (this.setPropertyValue(\"tooltipText\", value)) {\r\n if (this.tooltip) {\r\n if (this.tooltip.visible) {\r\n this.showTooltip();\r\n }\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"tooltipContainer\", {\r\n /**\r\n * @ignore Exclude from docs\r\n * @return Container\r\n */\r\n get: function () {\r\n if (this._tooltipContainer) {\r\n return this._tooltipContainer;\r\n }\r\n else if (this._parent) {\r\n return this._parent.tooltipContainer;\r\n }\r\n },\r\n /**\r\n * A container reference that should be used to place element's\r\n * [[Tooltip]] in.\r\n *\r\n * Will use parent's container if does not have one set.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Container\r\n * @todo Dispose of the old _tooltipContainer ?\r\n */\r\n set: function (value) {\r\n this._tooltipContainer = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"tooltipX\", {\r\n /**\r\n * @return Tooltip X (px)\r\n */\r\n get: function () {\r\n return this.getTooltipX();\r\n },\r\n /**\r\n * X coordinate the [[Tooltip]] should be shown at.\r\n *\r\n * @param value Tooltip X (px)\r\n */\r\n set: function (value) {\r\n if (this.setPercentProperty(\"tooltipX\", value) && this.tooltip) {\r\n this.tooltip.invalidate();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"alwaysShowTooltip\", {\r\n /**\r\n * @return Always show tooltip?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"showTooltipOn\") == \"always\";\r\n },\r\n /**\r\n * DEPRECATION NOTICE: This setting is deprecated in favor of a more flexible\r\n * setting: `showTooltipOn`. Please use `showTooltipOn = \"always\"` instead.\r\n *\r\n * Indicates if this element should display a tooltip permanently.\r\n *\r\n * Useful, if you want to show permanent tooltips on some items.\r\n *\r\n * @default false\r\n * @since 4.5.4\r\n * @deprecated Use `showTooltipOn = \"always\"` instead\r\n * @param value Always show tooltip?\r\n */\r\n set: function (value) {\r\n value = $type.toBoolean(value);\r\n if (value) {\r\n this.showTooltipOn = \"always\";\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"showTooltipOn\", {\r\n /**\r\n * @return When to show tooltip\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"showTooltipOn\");\r\n },\r\n /**\r\n * Indicates when tooltip needs to be shown on this element:\r\n *\r\n * * `\"hover\"` (default) - Tooltip will be shown when element is hovered on.\r\n * * `\"hit\"` - Tooltip will be shown when element is clicked/tapped. Tooltip will be hidden when clicked/tapped anywhere else.\r\n * * `\"always\"` - Tooltip will be shown on the element permanently.\r\n *\r\n * For example, if you would like to show tooltips on all of the columns of\r\n * a [[ColumnSeries]]:\r\n *\r\n * ```TypeScript\r\n * series.columns.template.showTooltipOn = \"always\";\r\n * ```\r\n * ```JavaScript\r\n * series.columns.template.showTooltipOn = \"always\";\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"series\": [{\r\n * // ...\r\n * \"columns\": {\r\n * \"showTooltipOn\": \"always\"\r\n * }\r\n * }]\r\n * }\r\n * ```\r\n *\r\n * It can even be set to display on a selected columns via `propertyFields`:\r\n *\r\n * ```TypeScript\r\n * series.columns.template.propertyFields.showTooltipOn = \"tooltip\";\r\n * ```\r\n * ```JavaScript\r\n * series.columns.template.propertyFields.showTooltipOn = \"tooltip\";\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"series\": [{\r\n * // ...\r\n * \"columns\": {\r\n * \"propertyFields\": {\r\n * \"showTooltipOn\": \"tooltip\"\r\n * }\r\n * }\r\n * }]\r\n * }\r\n * ```\r\n *\r\n * @default \"hover\"\r\n * @since 4.7.9\r\n * @param value When to show tooltip\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"showTooltipOn\", value)) {\r\n if (value == \"hit\") {\r\n this.clickable = true;\r\n }\r\n if (this.tooltip) {\r\n if (value == \"always\") {\r\n this.showTooltip();\r\n }\r\n else {\r\n this.handleAlwaysShowTooltip();\r\n }\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"tooltipPosition\", {\r\n /**\r\n * Position\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"tooltipPosition\");\r\n },\r\n /**\r\n * Specifies if [[Tooltip]] should follow the mouse or touch pointer or stay\r\n * at the fixed position.\r\n *\r\n * @param value Position\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"tooltipPosition\", value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"tooltipY\", {\r\n /**\r\n * @return Tooltip Y (px)\r\n */\r\n get: function () {\r\n return this.getTooltipY();\r\n },\r\n /**\r\n * Y coordinate the [[Tooltip]] should be shown at.\r\n *\r\n * @param value Tooltip Y (px)\r\n */\r\n set: function (value) {\r\n if (this.setPercentProperty(\"tooltipY\", value) && this.tooltip) {\r\n this.tooltip.invalidate();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Returns Tooltip X coordinate if it's set, or middle of the element.\r\n *\r\n * @ignore Exclude from docs\r\n * @return X (px)\r\n */\r\n Sprite.prototype.getTooltipX = function () {\r\n var x = this.getPropertyValue(\"tooltipX\");\r\n if (!$type.hasValue(x)) {\r\n x = percent(50);\r\n }\r\n var value;\r\n if ($type.isNumber(x)) {\r\n value = x;\r\n }\r\n if (x instanceof Percent) {\r\n value = this.maxLeftSelf + this._measuredWidthSelf * x.value - this.pixelPaddingLeft - this.ex; // overflow is know only for measured items, so this is not always good\r\n }\r\n if (!$type.isNumber(value)) {\r\n value = 0;\r\n }\r\n return value;\r\n };\r\n /**\r\n * Returns Tooltip Y coordinate if it's set, or middle of the element.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Y (px)\r\n */\r\n Sprite.prototype.getTooltipY = function () {\r\n var y = this.getPropertyValue(\"tooltipY\");\r\n if (!$type.hasValue(y)) {\r\n y = percent(50);\r\n }\r\n var value;\r\n if ($type.isNumber(y)) {\r\n value = y;\r\n }\r\n if (y instanceof Percent) {\r\n value = this.maxTopSelf + this._measuredHeightSelf * y.value - this.pixelPaddingTop - this.ey; // overflow is know only for measured items, so this is not always good\r\n }\r\n if (!$type.isNumber(value)) {\r\n value = 0;\r\n }\r\n return value;\r\n };\r\n /**\r\n * Displays a modal or console message with error, and halts any further\r\n * processing of this item.\r\n *\r\n * @ignore Exclude from docs\r\n * @param e Error\r\n * @todo Implement from applying further actions to this item\r\n */\r\n Sprite.prototype.raiseCriticalError = function (e, closable) {\r\n if (this.svgContainer) {\r\n if (!this._adapterO) {\r\n this.modal.content = e.message;\r\n }\r\n else {\r\n this.modal.content = this._adapterO.apply(\"criticalError\", e).message;\r\n }\r\n if (!closable) {\r\n this.disabled = true;\r\n }\r\n else {\r\n this.modal.closable = true;\r\n }\r\n if (!options.suppressErrors) {\r\n this.modal.open();\r\n }\r\n }\r\n if (options.verbose) {\r\n console.log(e);\r\n }\r\n };\r\n /**\r\n * Processes JSON-based config before it is applied to the object.\r\n *\r\n * @ignore Exclude from docs\r\n * @param config Config\r\n */\r\n Sprite.prototype.processConfig = function (config) {\r\n if (config) {\r\n // Tooltip color source\r\n if ($type.hasValue(config.tooltipColorSource) && $type.isString(config.tooltipColorSource) && this.map.hasKey(config.tooltipColorSource)) {\r\n config.tooltipColorSource = this.map.getKey(config.tooltipColorSource);\r\n }\r\n // Cursor styles\r\n if ($type.hasValue(config.cursorOverStyle) && $type.isString(config.cursorOverStyle)) {\r\n config.cursorOverStyle = this.getCursorStyle(config.cursorOverStyle);\r\n }\r\n if ($type.hasValue(config.cursorDowntyle) && $type.isString(config.cursorDowntyle)) {\r\n config.cursorDowntyle = this.getCursorStyle(config.cursorDowntyle);\r\n }\r\n if ($type.hasValue(config.cursorOptions)) {\r\n if ($type.hasValue(config.cursorOptions.overStyle) && $type.isString(config.cursorOptions.overStyle)) {\r\n config.cursorOptions.overStyle = this.getCursorStyle(config.cursorOptions.overStyle);\r\n }\r\n if ($type.hasValue(config.cursorOptions.downStyle) && $type.isString(config.cursorOptions.downStyle)) {\r\n config.cursorOptions.downStyle = this.getCursorStyle(config.cursorOptions.downStyle);\r\n }\r\n }\r\n }\r\n _super.prototype.processConfig.call(this, config);\r\n this.processDelayedMap();\r\n };\r\n /**\r\n * Converts string name of the cursor into actual [[MouseCursorStyle]].\r\n *\r\n * @param style Cursor type\r\n * @return Cursor definition\r\n */\r\n Sprite.prototype.getCursorStyle = function (style) {\r\n switch (style) {\r\n case \"grab\":\r\n return MouseCursorStyle.grab;\r\n case \"grabbing\":\r\n return MouseCursorStyle.grabbing;\r\n case \"pointer\":\r\n return MouseCursorStyle.pointer;\r\n case \"horizontalResize\":\r\n return MouseCursorStyle.horizontalResize;\r\n case \"verticalResize\":\r\n return MouseCursorStyle.verticalResize;\r\n default:\r\n return MouseCursorStyle.default;\r\n }\r\n };\r\n /**\r\n * This function is used to sort element's JSON config properties, so that\r\n * some properties that absolutely need to be processed last, can be put at\r\n * the end.\r\n *\r\n * @ignore Exclude from docs\r\n * @param a Element 1\r\n * @param b Element 2\r\n * @return Sorting number\r\n */\r\n Sprite.prototype.configOrder = function (a, b) {\r\n if (a == b) {\r\n return 0;\r\n }\r\n // Must come last\r\n else if (a == \"tooltipColorSource\") {\r\n return 1;\r\n }\r\n else if (b == \"tooltipColorSource\") {\r\n return -1;\r\n }\r\n else {\r\n return _super.prototype.configOrder.call(this, a, b);\r\n }\r\n };\r\n Object.defineProperty(Sprite.prototype, \"isHidden\", {\r\n /**\r\n * If `sprite.hide()` is called, we set isHidden to true when sprite is hidden.\r\n * This was added becaus hidden state might have visibility set to true and so\r\n * there would not be possible to find out if a sprite is technically hidden or not.\r\n */\r\n get: function () {\r\n if (this._isHidden) {\r\n return this._isHidden;\r\n }\r\n else if (this._parent) {\r\n return this._parent.isHidden;\r\n }\r\n return false;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"showOnInit\", {\r\n /**\r\n * @return Show on init?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"showOnInit\");\r\n },\r\n /**\r\n * If this is set to `true`, Sprite, when inited will be instantly hidden\r\n * (\"hidden\" state applied) and then shown (\"default\" state applied).\r\n *\r\n * If your \"default\" state's `transitionDuration > 0` this will result in\r\n * initial animation from \"hidden\" state to \"default\" state.\r\n *\r\n * If you need a Sprite which has `showOnInit = true` not to be shown\r\n * initially, set `sprite.hidden = true`. Setting `sprite.visible = false`\r\n * will not prevent the animation and the sprite will be shown.\r\n *\r\n * @param value show on init?\r\n */\r\n set: function (value) {\r\n value = $type.toBoolean(value);\r\n this.setShowOnInit(value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * @ignore\r\n */\r\n Sprite.prototype.setShowOnInit = function (value) {\r\n if (this.setPropertyValue(\"showOnInit\", value)) {\r\n if (!this.isTemplate) {\r\n if (value && !this.inited && !this.hidden) {\r\n this._showOnInitDisposer = new MultiDisposer([\r\n registry.events.once(\"enterframe\", this.hideInitially, this),\r\n this.events.once(\"beforevalidated\", this.hideInitially, this, false),\r\n this.events.on(\"inited\", this.appear, this, false)\r\n ]);\r\n this._disposers.push(this._showOnInitDisposer);\r\n }\r\n else {\r\n if (this._showOnInitDisposer) {\r\n this._showOnInitDisposer.dispose();\r\n }\r\n }\r\n }\r\n }\r\n };\r\n /**\r\n * @ignore\r\n */\r\n Sprite.prototype.hideInitially = function () {\r\n if (!this.isDisposed()) {\r\n this.appeared = false;\r\n //if (!this.hidden && !this._isHidden) { // not good for series, as on enterframe it doesn't have data items yet.\r\n if (!this.inited) {\r\n this.hide(0);\r\n }\r\n }\r\n };\r\n /**\r\n * Hides the chart instantly and then shows it. If defaultState.transitionDuration > 0, this will result an animation in which properties of hidden state will animate to properties of visible state.\r\n */\r\n Sprite.prototype.appear = function () {\r\n var _this = this;\r\n this.appeared = false;\r\n if (!this.hidden && !this.isHidden) {\r\n this.hide(0);\r\n }\r\n if (!this.hidden) {\r\n var animation = this.show();\r\n if (animation && !animation.isFinished()) {\r\n this.addDisposer(animation.events.on(\"animationended\", function () {\r\n _this.appeared = true;\r\n _this.dispatch(\"appeared\");\r\n }));\r\n }\r\n else {\r\n this.appeared = true;\r\n this.dispatch(\"appeared\");\r\n }\r\n }\r\n else {\r\n this.appeared = true;\r\n this.dispatch(\"appeared\");\r\n }\r\n };\r\n Object.defineProperty(Sprite.prototype, \"hidden\", {\r\n /**\r\n * @return Is initially hidden?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"hidden\");\r\n },\r\n /**\r\n * If a sprite has `showOnInit = true`, it will animate from \"hidden\" to\r\n * \"default\" state when initialized. To prevent this but keep\r\n * `showOnInit = true`, you can set `sprite.hidden = true`.\r\n *\r\n * @param value initially hidden?\r\n */\r\n set: function (value) {\r\n value = $type.toBoolean(value);\r\n this.setPropertyValue(\"hidden\", value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"bbox\", {\r\n /**\r\n * Returns bounding box (square) for this element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n get: function () {\r\n if (this.definedBBox) {\r\n return this.definedBBox;\r\n }\r\n return this._bbox;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Sprite.prototype, \"plugins\", {\r\n /**\r\n * A list of plugins (objects that implement [[IPlugin]] interface) attached\r\n * to this object.\r\n *\r\n * @since 4.2.2\r\n * @return List of plugins\r\n */\r\n get: function () {\r\n var _this = this;\r\n if (!this._plugins) {\r\n this._plugins = new List();\r\n this._disposers.push(this._plugins.events.on(\"inserted\", function (ev) {\r\n ev.newValue.target = _this;\r\n ev.newValue.init();\r\n }));\r\n this._disposers.push(new ListDisposer(this._plugins));\r\n }\r\n return this._plugins;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Called during the System.update method\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Sprite.prototype._systemUpdate = function (skippedSprites) {\r\n this.validate();\r\n };\r\n /**\r\n * Called during the System.update method\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Sprite.prototype._systemCheckIfValidate = function () {\r\n return true;\r\n };\r\n /**\r\n * Called during the System.validatePositions method\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Sprite.prototype._systemValidatePositions = function () {\r\n this.validatePosition();\r\n };\r\n /**\r\n * Called during the System.validateLayouts method\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Sprite.prototype._systemValidateLayouts = function () {\r\n };\r\n return Sprite;\r\n}(BaseObjectEvents));\r\nexport { Sprite };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Sprite\"] = Sprite;\r\n","import { __extends } from \"tslib\";\r\nimport { Dictionary } from \"./utils/Dictionary\";\r\nimport { TargetedEventDispatcher } from \"./utils/EventDispatcher\";\r\nimport { MultiDisposer, CounterDisposer } from \"./utils/Disposer\";\r\nimport * as $utils from \"./utils/Utils\";\r\nimport * as $object from \"./utils/Object\";\r\n/**\r\n * An [[EventDispatcher]] for [[Sprite]].\r\n *\r\n * @important\r\n */\r\nvar SpriteEventDispatcher = /** @class */ (function (_super) {\r\n __extends(SpriteEventDispatcher, _super);\r\n function SpriteEventDispatcher() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n /**\r\n * [_interactionEvents description]\r\n *\r\n * @todo Description\r\n */\r\n _this._interactionEvents = new Dictionary();\r\n return _this;\r\n }\r\n /**\r\n * [_dispatchSpriteEvent description]\r\n *\r\n * @todo Description\r\n */\r\n SpriteEventDispatcher.prototype._dispatchSpriteEvent = function (ev) {\r\n if (this.target.disabled || this.target.isTemplate) {\r\n return;\r\n }\r\n // TODO remove this <any> later\r\n if (this.target.events.isEnabled(ev.type)) {\r\n var imev = $object.merge(ev, {\r\n target: this.target\r\n });\r\n this.target.events.dispatchImmediately(imev.type, imev);\r\n }\r\n };\r\n /**\r\n * [_dispatchSpritePointEvent description]\r\n *\r\n * @todo Description\r\n */\r\n SpriteEventDispatcher.prototype._dispatchSpritePointEvent = function (ev) {\r\n if (this.target.disabled || this.target.isTemplate) {\r\n return;\r\n }\r\n // TODO remove this <any> later\r\n if (this.target.events.isEnabled(ev.type)) {\r\n var imev = $object.merge(ev, {\r\n target: this.target,\r\n spritePoint: ev.point ? $utils.documentPointToSprite(ev.point, this.target) : undefined,\r\n svgPoint: this.target.getSvgPoint(ev.point)\r\n });\r\n this.target.events.dispatchImmediately(imev.type, imev);\r\n }\r\n };\r\n /**\r\n * [_addInteractionObjectEvent description]\r\n *\r\n * @todo Description\r\n */\r\n SpriteEventDispatcher.prototype._addInteractionObjectEvent = function (type, callback, context, shouldClone) {\r\n var _this = this;\r\n var key = shouldClone + \"-\" + type;\r\n var counter = this._interactionEvents.insertKeyIfEmpty(key, function () {\r\n var disposer = _this.target.interactions.events.on(type, callback, context, shouldClone);\r\n return new CounterDisposer(function () {\r\n _this._interactionEvents.removeKey(key);\r\n disposer.dispose();\r\n });\r\n });\r\n return counter.increment();\r\n };\r\n /**\r\n * [_on description]\r\n *\r\n * @todo Description\r\n */\r\n SpriteEventDispatcher.prototype._on = function (once, type, callback, context, shouldClone, dispatch) {\r\n var info = _super.prototype._on.call(this, once, type, callback, context, shouldClone, dispatch);\r\n var disposers = [info.disposer];\r\n /**\r\n * Catching Sprite-related events, converting them to [[SpriteEvent]] and\r\n * triggering them on sprite\r\n */\r\n switch (type) {\r\n case \"hit\":\r\n case \"track\":\r\n case \"doublehit\":\r\n case \"wheel\":\r\n case \"wheelup\":\r\n case \"wheeldown\":\r\n case \"wheelleft\":\r\n case \"wheelright\":\r\n disposers.push(this._addInteractionObjectEvent(type, this._dispatchSpritePointEvent, this, shouldClone));\r\n break;\r\n case \"rightclick\":\r\n case \"down\":\r\n //case \"hold\":\r\n case \"up\":\r\n case \"drag\":\r\n case \"dragged\":\r\n case \"dragstart\":\r\n case \"dragstop\":\r\n case \"over\":\r\n case \"out\":\r\n case \"swipe\":\r\n case \"swipeleft\":\r\n case \"swiperight\":\r\n case \"resize\":\r\n //case \"rotate\":\r\n case \"focus\":\r\n case \"blur\":\r\n case \"toggled\":\r\n disposers.push(this._addInteractionObjectEvent(type, this._dispatchSpriteEvent, this, shouldClone));\r\n break;\r\n }\r\n /**\r\n * Set functional properties based on events. For example if we add a\r\n * \"drag\" event handler, we want to make the Sprite draggable, even if we\r\n * don't explicitly set \"draggable\"\r\n */\r\n switch (type) {\r\n case \"hit\":\r\n case \"doublehit\":\r\n case \"rightclick\":\r\n case \"down\":\r\n case \"up\":\r\n this.target.clickable = true;\r\n break;\r\n case \"toggled\":\r\n this.target.togglable = true;\r\n break;\r\n case \"drag\":\r\n case \"dragstart\":\r\n case \"dragstop\":\r\n this.target.draggable = true;\r\n break;\r\n case \"track\":\r\n this.target.trackable = true;\r\n break;\r\n case \"resize\":\r\n this.target.resizable = true;\r\n break;\r\n case \"swipe\":\r\n case \"swipeleft\":\r\n case \"swiperight\":\r\n this.target.swipeable = true;\r\n break;\r\n case \"wheel\":\r\n case \"wheelup\":\r\n case \"wheeldown\":\r\n case \"wheelleft\":\r\n case \"wheelright\":\r\n this.target.wheelable = true;\r\n break;\r\n case \"over\":\r\n this.target.hoverable = true;\r\n case \"out\":\r\n this.target.hoverable = true;\r\n break;\r\n case \"focus\":\r\n case \"blur\":\r\n this.target.focusable = true;\r\n break;\r\n }\r\n info.disposer = new MultiDisposer(disposers);\r\n return info;\r\n };\r\n return SpriteEventDispatcher;\r\n}(TargetedEventDispatcher));\r\nexport { SpriteEventDispatcher };\r\n","/**\r\n * Module contains functionality related to [[Sprite]] states.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { BaseObject } from \"./Base\";\r\nimport { registry } from \"./Registry\";\r\nimport { Adapter } from \"./utils/Adapter\";\r\nimport { List, ListDisposer } from \"./utils/List\";\r\nimport { toColor } from \"./utils/Color\";\r\nimport { percent } from \"./utils/Percent\";\r\nimport * as $utils from \"./utils/Utils\";\r\nimport * as $ease from \"./utils/Ease\";\r\nimport * as $object from \"./utils/Object\";\r\nimport * as $type from \"./utils/Type\";\r\n/**\r\n * Defines a state for [[Sprite]].\r\n *\r\n * A \"state\" is a special object that has all the same properties as the\r\n * [[Sprite]] of the same type, and which can be used to quickly apply a set\r\n * of property values. (set state)\r\n *\r\n * When [[Sprite]] (or any object that extends Sprite) is created it creates a\r\n * \"default\" state. You can modify the \"default\" state so that when the Sprite\r\n * returns to default state certain properties are added.\r\n *\r\n * Default state can be accessed using Sprite's `defaultState` getter.\r\n *\r\n * ```TypeScript\r\n * sprite.defaultState.properties.fillOpacity = 0.5;\r\n * ```\r\n * ```JavaScript\r\n * sprite.defaultState.properties.fillOpacity = 0.5;\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"defaultState\": {\r\n * \"properties\": {\r\n * \"fillOpacity\": 0.5\r\n * }\r\n * }\r\n * }\r\n * ```\r\n *\r\n * If Sprite is \"hoverable\", it automatically adds a \"hover\" state, which is\r\n * applied when it has a cursor over it.\r\n *\r\n * ```TypeScript\r\n * let hoverstate = sprite.states.create(\"hover\");\r\n * hoverstate.properties.fillOpacity = 1;\r\n * ```\r\n * ```JavaScript\r\n * var hoverstate = sprite.states.create(\"hover\");\r\n * hoverstate.properties.fillOpacity = 1;\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"states\": {\r\n * \"hover\": {\r\n * \"properties\": {\r\n * \"fillOpacity\": 0.5\r\n * }\r\n * }\r\n * }\r\n * }\r\n * ```\r\n *\r\n * The above will automatically apply \"hover\" state when the Sprite is hovered,\r\n * thus will set its `fillOpacity` property to 1, and will reset it to 0.5 when\r\n * it's no longer hovered.\r\n *\r\n * Every object that inherits from [[Sprite]] can and will add their own\r\n * properties to the available list.\r\n *\r\n * User can create their own states, and apply them as needed:\r\n *\r\n * ```TypeScript\r\n * let myCustomState = sprite.states.create(\"mystate\");\r\n * myCustomState.properties.fillOpacity = 0.5;\r\n * myCustomState.properties.strokeOpacity = 0.8;\r\n * sprite.setState(\"mystate\");\r\n * ```\r\n * ```JavaScript\r\n * var myCustomState = sprite.states.create(\"mystate\");\r\n * myCustomState.properties.fillOpacity = 0.5;\r\n * myCustomState.properties.strokeOpacity = 0.8;\r\n * sprite.setState(\"mystate\");\r\n * ```\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/states/}\r\n * @important\r\n */\r\nvar SpriteState = /** @class */ (function (_super) {\r\n __extends(SpriteState, _super);\r\n /**\r\n * Constructor\r\n */\r\n function SpriteState() {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n /**\r\n * Duration of the transition to this state. 0 means instantenous transition.\r\n * Any number means the [[Sprite]] will transit smoothly to this state,\r\n * animating all animatable properties.\r\n *\r\n * @default 0\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/animations/} for more info about animations\r\n */\r\n _this.transitionDuration = 0;\r\n /**\r\n * Easing function to use when transitioning to this state.\r\n *\r\n * @default cubicOut\r\n * @see {@link Ease}\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/animations/} for more info about animations\r\n */\r\n _this.transitionEasing = $ease.cubicOut;\r\n /**\r\n * Collection of properties and their values that should be applied to [[Sprite]]\r\n * when switching to this State.\r\n *\r\n * The property values set on a [[SpriteState]] will override the ones set\r\n * directly on a [[Sprite]].\r\n */\r\n _this.properties = {};\r\n /**\r\n * A collection of key/value pairs that can be used to bind specific Sprite\r\n * properties to [[DataItem]].\r\n *\r\n * For example: `fill` property can be bound to `myCustomColor` field in\r\n * DataItem. The Sprite will automatically get the value for `fill` from its\r\n * DataItem.\r\n *\r\n * SpriteState-specific binding will override binding set directly on\r\n * [[Sprite]]. I.e. you can make Sprite use different fill color on hover by\r\n * adding a `fill` binding to a different DataItem key for Sprite's \"hover\"\r\n * state object.\r\n *\r\n * @see {@link Sprite}\r\n */\r\n _this.propertyFields = {};\r\n //public propertyFields: Dictionary<keyof this[\"_properties\"], string> = new Dictionary<keyof this[\"_properties\"], string>();;\r\n /**\r\n * A list of [[Filter]] elements to be applied to the relative [[Sprite]]\r\n * when switching to this State.\r\n *\r\n * @param {List}\r\n */\r\n _this.filters = new List();\r\n /**\r\n * Identifies if this object is a \"template\" and should not be treated as\r\n * real object that is drawn or actually used in the chart.\r\n */\r\n _this.isTemplate = false;\r\n _this.className = \"SpriteState\";\r\n // Make filter list disposable\r\n _this._disposers.push(new ListDisposer(_this.filters));\r\n // Apply theme\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n Object.defineProperty(SpriteState.prototype, \"adapter\", {\r\n /**\r\n * Holds Adapter.\r\n */\r\n get: function () {\r\n var _this = this;\r\n if (!this._adapterO) {\r\n this._adapterO = new Adapter(this);\r\n // Decorate adapter with events so that we can apply its settings whenever\r\n // it is modified\r\n this._adapterO.events.on(\"inserted\", function (ev) {\r\n _this[ev.newValue.key] = _this[ev.newValue.key];\r\n }, undefined, false);\r\n this._adapterO.events.on(\"removed\", function (ev) {\r\n _this[ev.newValue.key] = _this[ev.newValue.key];\r\n }, undefined, false);\r\n }\r\n return this._adapterO;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Returns [[Sprite]] element's property value.\r\n *\r\n * Will check if there are any bindings with [[DataItem]] and if there are\r\n * any method callbacks set up for the specific property.\r\n *\r\n * @param propertyName Property name\r\n * @return Property value\r\n */\r\n SpriteState.prototype.getPropertyValue = function (propertyName) {\r\n var propValue = this.properties[propertyName];\r\n var sprite = this.sprite;\r\n if (sprite) {\r\n var fieldName = this.propertyFields[propertyName];\r\n if ($type.hasValue(fieldName)) {\r\n if (sprite.dataItem) {\r\n propValue = sprite.dataItem.dataContext[fieldName];\r\n }\r\n if (propValue == undefined) {\r\n propValue = \"__unset\";\r\n }\r\n }\r\n // Apply adapters\r\n // If the value itself is undefined, we're going to pass in Sprite's\r\n // value to adapters\r\n // @todo get rid of <any>\r\n if (!$type.hasValue(propValue)) {\r\n var spriteValue = sprite.getPropertyValue(propertyName);\r\n if (this._adapterO) {\r\n propValue = this._adapterO.apply(propertyName, spriteValue);\r\n }\r\n else {\r\n propValue = spriteValue;\r\n }\r\n if (propValue == spriteValue) {\r\n propValue = undefined;\r\n }\r\n }\r\n else {\r\n if (this._adapterO) {\r\n propValue = this._adapterO.apply(propertyName, propValue);\r\n }\r\n }\r\n /*let method = this.propertyMethods.getKey(propertyName);\r\n if (method) {\r\n propValue = method(sprite, propertyName);\r\n }*/\r\n }\r\n return propValue;\r\n };\r\n /**\r\n * Copies all property and style values from another [[SpriteState]] object.\r\n *\r\n * @param source Source [[SpriteState]]\r\n */\r\n SpriteState.prototype.copyFrom = function (source) {\r\n if (source && source != this) {\r\n this.transitionDuration = source.transitionDuration;\r\n this.transitionEasing = source.transitionEasing;\r\n $utils.copyProperties(source.properties, this.properties);\r\n $utils.copyProperties(source.propertyFields, this.propertyFields);\r\n this.filters.copyFrom(source.filters);\r\n if (source._adapterO) {\r\n this.adapter.copyFrom(source._adapterO);\r\n }\r\n }\r\n };\r\n Object.defineProperty(SpriteState.prototype, \"allValues\", {\r\n /**\r\n * Returns all values that should be applied by the SpriteState.\r\n *\r\n * It takes adapters into account.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Properties\r\n * @todo Add adapter values\r\n * @todo proper type this[\"_properties\"]\r\n */\r\n get: function () {\r\n var _this = this;\r\n // Init return value\r\n var res = {};\r\n // Apply adapters to all values\r\n $object.each(this.properties, function (prop, value) {\r\n res[prop] = _this.getPropertyValue(prop);\r\n });\r\n // Cycle through all adapters and add values for missing properties\r\n if (this._adapterO) {\r\n var keys = this._adapterO.keys();\r\n $object.each(keys, function (_x, prop) {\r\n var value = _this.getPropertyValue(prop);\r\n res[prop] = value;\r\n });\r\n }\r\n // Cycle through all property fileds and add values for missing properties\r\n var propertyFields = this.propertyFields;\r\n $object.each(propertyFields, function (prop) {\r\n var value = _this.getPropertyValue(prop);\r\n res[prop] = value;\r\n });\r\n return res;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Resets the State to initial state - no values or Filters applied.\r\n */\r\n SpriteState.prototype.reset = function () {\r\n this.properties = {};\r\n this.filters.clear();\r\n };\r\n /**\r\n * Processes JSON-based config before it is applied to the object.\r\n *\r\n * @ignore Exclude from docs\r\n * @param config Config\r\n */\r\n SpriteState.prototype.processConfig = function (config) {\r\n if ($type.hasValue(config) && $type.hasValue(config[\"properties\"])) {\r\n $object.each(config[\"properties\"], function (key, value) {\r\n if ($type.isString(value)) {\r\n if (value.match(/^[0-9.\\-]+\\%$/)) {\r\n config[\"properties\"][key] = percent($type.toNumber(value));\r\n }\r\n else if (value.match(/^\\#[0-9abcdef]{3,}$/i)) {\r\n config[\"properties\"][key] = toColor(value);\r\n }\r\n }\r\n });\r\n }\r\n _super.prototype.processConfig.call(this, config);\r\n };\r\n /**\r\n * Adds easing functions to \"function\" fields.\r\n *\r\n * @param field Field name\r\n * @return Assign as function?\r\n */\r\n SpriteState.prototype.asFunction = function (field) {\r\n return field == \"transitionEasing\" || _super.prototype.asIs.call(this, field);\r\n };\r\n return SpriteState;\r\n}(BaseObject));\r\nexport { SpriteState };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"SpriteState\"] = SpriteState;\r\n","/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { registry, is } from \"./Registry\";\r\nimport { Container } from \"./Container\";\r\nimport { raf } from \"./utils/AsyncPending\";\r\nimport { triggerIdle } from \"./utils/AsyncPending\";\r\nimport * as $array from \"./utils/Array\";\r\nimport * as $object from \"./utils/Object\";\r\nimport * as $log from \"./utils/Log\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * The main class that handles system-wide tasks, like caching, heartbeats, etc.\r\n * @important\r\n */\r\nvar System = /** @class */ (function () {\r\n /**\r\n * Performs initialization of the System object.\r\n *\r\n * Called when the first [[Sprite]] object is created.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n function System() {\r\n /**\r\n * A flag indicating if the system is on pause.\r\n */\r\n this._isPaused = false;\r\n /**\r\n * Holds the list of currently playing animations.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n this.animations = [];\r\n /**\r\n * Unique ID of the object.\r\n */\r\n this.uid = registry.getUniqueId();\r\n /**\r\n * @todo Description\r\n * @todo Needed?\r\n * @ignore Exclude from docs\r\n */\r\n this.dummyCounter = 0;\r\n this._frameRequested = false;\r\n this.updateStepDuration = 45;\r\n this.time = Date.now();\r\n }\r\n /**\r\n * Reports time elapsed since timer was reset.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Needed?\r\n * @param msg Message to report in console\r\n * @param reset Reset time counter\r\n */\r\n System.prototype.reportTime = function (msg, reset) {\r\n if (this.dummyCounter < 6) {\r\n //console.log(Date.now() - this.time, msg, this.dummyCounter2);\r\n }\r\n if (reset) {\r\n this.time = Date.now();\r\n }\r\n };\r\n /**\r\n * Performs \"heartbeat\" operations `frameRate` number of times per second.\r\n *\r\n * When the chart element is invalidated, it is not immediately redrawn.\r\n *\r\n * Instead it waits for the next `update()` cycle to be re-validated.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Maybe should be private?\r\n */\r\n System.prototype.update = function () {\r\n var _this = this;\r\n if (this._isPaused) {\r\n return;\r\n }\r\n this._frameRequested = false;\r\n var time = Date.now();\r\n registry.dispatchImmediately(\"enterframe\");\r\n //this.validateLayouts();\r\n //this.validatePositions();\r\n /*\r\n for (let key in registry.invalidLayouts) {\r\n this.validateLayouts(key);\r\n }\r\n for (let key in registry.invalidPositions) {\r\n this.validatePositions(key);\r\n }\r\n */\r\n var skippedComponents = [];\r\n // data objects first - do all calculations\r\n // only data is parsed in chunks, thats why we do for loop instead of a while like with other invalid items.\r\n // important to go backwards, as items are removed!\r\n // TODO use iterator instead\r\n for (var key in registry.invalidDatas) {\r\n if ($object.hasKey(registry.invalidDatas, key)) {\r\n var invalidData = registry.invalidDatas[key];\r\n while (invalidData.length > 0) {\r\n var component = invalidData[0];\r\n var dataProvider = component.dataProvider;\r\n if (!component.isDisposed()) {\r\n if (dataProvider && dataProvider.dataInvalid) {\r\n try {\r\n dataProvider.validateData();\r\n if (dataProvider.dataValidationProgress < 1) {\r\n break;\r\n }\r\n }\r\n catch (e) {\r\n $array.remove(invalidData, dataProvider);\r\n dataProvider.raiseCriticalError(e);\r\n }\r\n }\r\n else {\r\n try {\r\n component.validateData();\r\n if (component.dataValidationProgress < 1) {\r\n break;\r\n }\r\n }\r\n catch (e) {\r\n $array.remove(invalidData, component);\r\n component.raiseCriticalError(e);\r\n }\r\n }\r\n }\r\n else {\r\n $array.remove(invalidData, component);\r\n }\r\n }\r\n if (Date.now() - time > this.updateStepDuration) {\r\n break;\r\n }\r\n }\r\n }\r\n while (registry.invalidRawDatas.length > 0) {\r\n var component = registry.invalidRawDatas[0];\r\n if (!component.isDisposed()) {\r\n try {\r\n component.validateRawData();\r\n }\r\n catch (e) {\r\n $array.remove(registry.invalidRawDatas, component);\r\n component.raiseCriticalError(e);\r\n }\r\n }\r\n else {\r\n $array.remove(registry.invalidRawDatas, component);\r\n }\r\n }\r\n // TODO use iterator instead\r\n while (registry.invalidDataItems.length > 0) {\r\n var component = registry.invalidDataItems[0];\r\n var dataProvider = component.dataProvider;\r\n // this is needed to avoid partial value validation when data is parsed in chunks\r\n if (component.isDisposed() || component.dataInvalid || (dataProvider && dataProvider.dataInvalid)) {\r\n // void\r\n }\r\n else {\r\n try {\r\n component.validateDataItems();\r\n }\r\n catch (e) {\r\n $array.remove(registry.invalidDataItems, component);\r\n component.raiseCriticalError(e);\r\n }\r\n }\r\n // this might seem too much, as validateValues removes from invalidDataItems aswell, but just to be sure (in case validateData is overriden and no super is called)\r\n $array.remove(registry.invalidDataItems, component);\r\n }\r\n // TODO use iterator instead\r\n while (registry.invalidDataRange.length > 0) {\r\n var component = registry.invalidDataRange[0];\r\n var dataProvider = component.dataProvider;\r\n if (component.isDisposed() || component.dataInvalid || (dataProvider && dataProvider.dataInvalid)) {\r\n // void\r\n }\r\n else {\r\n try {\r\n component.validateDataRange();\r\n if (!component.skipRangeEvent) {\r\n component.dispatchImmediately(\"datarangechanged\");\r\n }\r\n component.skipRangeEvent = false;\r\n }\r\n catch (e) {\r\n $array.remove(registry.invalidDataRange, component);\r\n component.raiseCriticalError(e);\r\n }\r\n }\r\n // this might seem too much, as validateDataRange removes from invalidDataRange aswell, but just to be sure (in case validateData is overriden and no super is called)\r\n $array.remove(registry.invalidDataRange, component);\r\n }\r\n var skippedSprites = [];\r\n // display objects later\r\n // TODO use iterator instead\r\n $object.each(registry.invalidLayouts, function (key) {\r\n _this.validateLayouts(key);\r\n });\r\n $object.each(registry.invalidPositions, function (key) {\r\n _this.validatePositions(key);\r\n });\r\n var hasSkipped = false;\r\n time = Date.now();\r\n $object.each(registry.invalidSprites, function (key, invalidSprites) {\r\n var count = 0;\r\n while (invalidSprites.length > 0) {\r\n _this.validateLayouts(key);\r\n _this.validatePositions(key);\r\n count++;\r\n if (count == 5) {\r\n if (Date.now() - time > _this.updateStepDuration) {\r\n break;\r\n }\r\n count = 0;\r\n }\r\n var sprite = invalidSprites[invalidSprites.length - 1];\r\n // we need to check this, as validateLayout might validate sprite\r\n if (sprite && !sprite.isDisposed()) {\r\n if (!sprite._systemCheckIfValidate()) {\r\n // void\r\n skippedSprites.push(sprite);\r\n }\r\n else {\r\n if (!_this.checkIfValidate2(sprite)) {\r\n // void\r\n skippedSprites.push(sprite);\r\n }\r\n else {\r\n try {\r\n sprite._systemUpdate(skippedSprites);\r\n }\r\n catch (e) {\r\n sprite.invalid = false;\r\n $array.remove(invalidSprites, sprite);\r\n sprite.raiseCriticalError(e);\r\n }\r\n }\r\n }\r\n // this might seem too much, but it's ok\r\n sprite.invalid = false;\r\n }\r\n $array.remove(invalidSprites, sprite);\r\n }\r\n registry.invalidSprites[key] = registry.invalidSprites[key].concat(skippedSprites);\r\n });\r\n $object.each(registry.invalidSprites, function (key, value) {\r\n if (value.length > 0) {\r\n hasSkipped = true;\r\n }\r\n });\r\n $object.each(registry.invalidDatas, function (key, value) {\r\n if (value.length > 0) {\r\n hasSkipped = true;\r\n }\r\n });\r\n // TODO make this more efficient\r\n // TODO don't copy the array\r\n $array.each($array.copy(this.animations), function (x) {\r\n x.update();\r\n });\r\n //if(!hasSkipped){\r\n $object.each(registry.invalidLayouts, function (key) {\r\n _this.validateLayouts(key);\r\n });\r\n $object.each(registry.invalidPositions, function (key) {\r\n _this.validatePositions(key);\r\n });\r\n //}\r\n triggerIdle();\r\n $object.each(registry.invalidLayouts, function (key) {\r\n _this.validateLayouts(key);\r\n });\r\n $object.each(registry.invalidPositions, function (key) {\r\n _this.validatePositions(key);\r\n });\r\n registry.dispatchImmediately(\"exitframe\");\r\n if (hasSkipped || this.animations.length > 0 || skippedComponents.length > 0) {\r\n this.requestFrame();\r\n }\r\n if (this.updateStepDuration < 200) {\r\n var all0_1 = true;\r\n $object.each(registry.invalidDatas, function (key, value) {\r\n if (value.length > 0) {\r\n all0_1 = false;\r\n }\r\n });\r\n $object.each(registry.invalidSprites, function (key, value) {\r\n if (value.length > 0) {\r\n all0_1 = false;\r\n }\r\n });\r\n if (all0_1) {\r\n this.updateStepDuration = 200;\r\n }\r\n }\r\n };\r\n System.prototype.checkIfValidate2 = function (sprite) {\r\n if (sprite.dataItem && sprite.dataItem.component && sprite.dataItem.component.dataInvalid && !sprite.dataItem.component.isTemplate) {\r\n return false;\r\n }\r\n else {\r\n return true;\r\n }\r\n };\r\n /**\r\n * Requests new animation frame\r\n */\r\n System.prototype.requestFrame = function () {\r\n var _this = this;\r\n if (!this._frameRequested) {\r\n raf(function () {\r\n _this.update();\r\n });\r\n this._frameRequested = true;\r\n }\r\n };\r\n /**\r\n * Call this method if you update data or config of a chart that is in\r\n * hidden container, after revealing the container, so that labels and\r\n * possibly other elements can correctly arrange themselves.\r\n *\r\n * @since 4.7.10\r\n * @param container Target container\r\n */\r\n System.prototype.softInvalidate = function (container) {\r\n var _this = this;\r\n container.children.each(function (child) {\r\n if (child instanceof Container) {\r\n _this.softInvalidate(child);\r\n }\r\n if (child.measureFailed) {\r\n if (is(child, \"Label\")) {\r\n child.hardInvalidate();\r\n }\r\n else {\r\n child.invalidate();\r\n }\r\n child.measureFailed = false;\r\n }\r\n });\r\n };\r\n /**\r\n * Triggers position re-validation on all [[Sprite]] elements that have\r\n * invalid(ated) positions.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Maybe should be private?\r\n */\r\n System.prototype.validatePositions = function (id) {\r\n // invalid positions\r\n // TODO use iterator instead\r\n var invalidPositions = registry.invalidPositions[id];\r\n while (invalidPositions.length > 0) {\r\n var sprite = invalidPositions[invalidPositions.length - 1];\r\n if (!sprite.isDisposed()) {\r\n try {\r\n sprite._systemValidatePositions();\r\n }\r\n catch (e) {\r\n sprite.positionInvalid = false;\r\n $array.remove(invalidPositions, sprite);\r\n sprite.raiseCriticalError(e);\r\n }\r\n }\r\n else {\r\n $array.remove(invalidPositions, sprite);\r\n }\r\n }\r\n };\r\n /**\r\n * Triggers position re-validation on all [[Container]] elements that have\r\n * invalid(ated) layouts.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Maybe should be private?\r\n */\r\n System.prototype.validateLayouts = function (id) {\r\n // invalid positions\r\n // TODO use iterator instead\r\n var invalidLayouts = registry.invalidLayouts[id];\r\n while (invalidLayouts.length > 0) {\r\n var container = invalidLayouts[invalidLayouts.length - 1];\r\n if (!container.isDisposed()) {\r\n try {\r\n container.children.each(function (sprite) {\r\n sprite._systemValidateLayouts();\r\n });\r\n container.validateLayout();\r\n }\r\n catch (e) {\r\n container.layoutInvalid = false;\r\n $array.remove(invalidLayouts, container);\r\n container.raiseCriticalError(e);\r\n }\r\n }\r\n else {\r\n $array.remove(invalidLayouts, container);\r\n }\r\n }\r\n };\r\n /**\r\n * Outputs string to console if `verbose` is `true`.\r\n *\r\n * @param value Message to output to console\r\n */\r\n System.prototype.log = function (value) {\r\n $log.log(value);\r\n };\r\n Object.defineProperty(System.prototype, \"isPaused\", {\r\n /**\r\n * @return Is system on pause?\r\n */\r\n get: function () {\r\n return this._isPaused;\r\n },\r\n /**\r\n * Pauses all the processes of all the amCharts objects on the page\r\n *\r\n * @return is paused?\r\n */\r\n set: function (value) {\r\n this._isPaused = value;\r\n if (!value) {\r\n this._frameRequested = false;\r\n this.requestFrame();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * amCharts Version.\r\n *\r\n * This follows npm's semver specification.\r\n *\r\n * @see {@link https://docs.npmjs.com/misc/semver}\r\n */\r\n System.VERSION = \"4.10.16\";\r\n return System;\r\n}());\r\nexport { System };\r\n/**\r\n * A singleton global instance of [[System]].\r\n *\r\n * All code should use this, rather than instantiating their\r\n * own System objects.\r\n */\r\nexport var system = new System();\r\n","/**\r\n * CSV parser.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { DataParser } from \"./DataParser\";\r\nimport * as $type from \"../utils/Type\";\r\nimport * as $array from \"../utils/Array\";\r\n/**\r\n * Define possible separators.\r\n */\r\nvar separators = [\",\", \";\", \"\\t\"];\r\n/**\r\n * A parser for CSV format.\r\n *\r\n * @important\r\n */\r\nvar CSVParser = /** @class */ (function (_super) {\r\n __extends(CSVParser, _super);\r\n function CSVParser() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n /**\r\n * Content-type suitable for CSV format.\r\n */\r\n _this.contentType = \"text/csv\";\r\n /**\r\n * Parser options.\r\n *\r\n * @see {@link ICSVOptions} for description of each option\r\n */\r\n _this.options = {\r\n delimiter: \"\",\r\n reverse: false,\r\n skipRows: 0,\r\n skipEmpty: true,\r\n useColumnNames: false\r\n };\r\n return _this;\r\n }\r\n /**\r\n * Tests if the format is CSV.\r\n *\r\n * @param data Source data\r\n * @return Is it CSV?\r\n */\r\n CSVParser.isCSV = function (data) {\r\n return CSVParser.getDelimiterFromData(data) ? true : false;\r\n };\r\n /**\r\n * Tries to determine a column separator.\r\n *\r\n * @param data Source data\r\n * @return Separator\r\n */\r\n CSVParser.getDelimiterFromData = function (data) {\r\n // We're going to take first few lines of the CSV with different\r\n // possible separators and check if it results in same number of columns.\r\n // If it does, we're going to assume it's a CSV\r\n var lines = data.split(\"\\n\");\r\n var len = lines.length;\r\n var separator;\r\n $array.each(separators, function (sep) {\r\n var columns = 0, lineColums = 0;\r\n // TODO replace with iterators\r\n for (var i = 0; i < len; ++i) {\r\n // Get number of columns in a line\r\n columns = lines[i].split(sep).length;\r\n if (columns > 1) {\r\n // More than one column - possible candidate\r\n if (lineColums === 0) {\r\n // First line\r\n lineColums = columns;\r\n }\r\n else if (columns != lineColums) {\r\n // Incorrect number of columns, give up on this separator\r\n lineColums = 0;\r\n break;\r\n }\r\n }\r\n else {\r\n // Not this separator\r\n // Not point in continuing\r\n lineColums = 0;\r\n break;\r\n }\r\n }\r\n // Check if we have a winner\r\n if (lineColums) {\r\n separator = sep;\r\n }\r\n });\r\n return separator;\r\n };\r\n /**\r\n * Parses and returns data.\r\n *\r\n * @param data Unparsed data\r\n * @return Parsed data\r\n */\r\n CSVParser.prototype.parse = function (csv) {\r\n // Check if we have delimiter set\r\n if (!this.options.delimiter) {\r\n this.options.delimiter = CSVParser.getDelimiterFromData(csv);\r\n }\r\n // Get CSV data as array\r\n var data = this.CSVToArray(csv, this.options.delimiter);\r\n // Do we need to cast some fields to numbers?\r\n var empty = $type.hasValue(this.options.emptyAs);\r\n var numbers = this.parsableNumbers;\r\n var dates = this.parsableDates;\r\n // Init resuling array\r\n var res = [], cols = [], col, i;\r\n // Skip rows\r\n for (i = 0; i < this.options.skipRows; i++) {\r\n data.shift();\r\n }\r\n // First row holds column names?\r\n if (this.options.useColumnNames) {\r\n cols = data.shift();\r\n // Normalize column names\r\n for (var x = 0; x < cols.length; x++) {\r\n // trim\r\n col = $type.hasValue(cols[x]) ? cols[x].replace(/^\\s+|\\s+$/gm, \"\") : \"\";\r\n // Check for empty\r\n if (\"\" === col) {\r\n col = \"col\" + x;\r\n }\r\n cols[x] = col;\r\n }\r\n }\r\n // Iterate through the result set\r\n var row;\r\n while (true) {\r\n row = this.options.reverse ? data.pop() : data.shift();\r\n if (!row) {\r\n break;\r\n }\r\n if (this.options.skipEmpty && row.length === 1 && row[0] === \"\") {\r\n continue;\r\n }\r\n var dataPoint = {};\r\n for (i = 0; i < row.length; i++) {\r\n col = undefined === cols[i] ? \"col\" + i : cols[i];\r\n dataPoint[col] = row[i] === \"\" ? this.options.emptyAs : row[i];\r\n // Convert\r\n if (empty) {\r\n dataPoint[col] = this.maybeToEmpty(dataPoint[col]);\r\n }\r\n if (numbers) {\r\n dataPoint[col] = this.maybeToNumber(col, dataPoint[col]);\r\n }\r\n if (dates) {\r\n dataPoint[col] = this.maybeToDate(col, dataPoint[col]);\r\n }\r\n }\r\n res.push(dataPoint);\r\n }\r\n return res;\r\n };\r\n /**\r\n * Converts CSV into array.\r\n *\r\n * The functionality of this function is taken from here:\r\n * http://www.bennadel.com/blog/1504-ask-ben-parsing-csv-strings-with-javascript-exec-regular-expression-command.htm\r\n *\r\n * @param data Source data\r\n * @param delimiter Column delimiter\r\n * @return Parsed array\r\n */\r\n CSVParser.prototype.CSVToArray = function (data, delimiter) {\r\n // Check to see if the delimiter is defined. If not,\r\n // then default to comma.\r\n delimiter = (delimiter || ',');\r\n // Create a regular expression to parse the CSV values.\r\n var objPattern = new RegExp((\r\n // Delimiters.\r\n \"(\\\\\" + delimiter + \"|\\\\r?\\\\n|\\\\r|^)\" +\r\n // Quoted fields.\r\n \"(?:\\\"([^\\\"]*(?:\\\"\\\"[^\\\"]*)*)\\\"|\" +\r\n // Standard fields.\r\n \"([^\\\"\\\\\" + delimiter + \"\\\\r\\\\n]*))\"), \"gi\");\r\n // Create an array to hold our data. Give the array\r\n // a default empty first row.\r\n var arrData = [\r\n []\r\n ];\r\n // Create an array to hold our individual pattern\r\n // matching groups.\r\n var arrMatches = null;\r\n // Keep looping over the regular expression matches\r\n // until we can no longer find a match.\r\n while (true) {\r\n arrMatches = objPattern.exec(data);\r\n if (!arrMatches) {\r\n break;\r\n }\r\n // Get the delimiter that was found.\r\n var strMatchedDelimiter = arrMatches[1];\r\n // Check to see if the given delimiter has a length\r\n // (is not the start of string) and if it matches\r\n // field delimiter. If id does not, then we know\r\n // that this delimiter is a row delimiter.\r\n if (strMatchedDelimiter.length &&\r\n (strMatchedDelimiter !== delimiter)) {\r\n // Since we have reached a new row of data,\r\n // add an empty row to our data array.\r\n arrData.push([]);\r\n }\r\n // Now that we have our delimiter out of the way,\r\n // let's check to see which kind of value we\r\n // captured (quoted or unquoted).\r\n var strMatchedValue = void 0;\r\n if (arrMatches[2]) {\r\n // We found a quoted value. When we capture\r\n // this value, unescape any double quotes.\r\n strMatchedValue = arrMatches[2].replace(new RegExp(\"\\\"\\\"\", \"g\"), \"\\\"\");\r\n }\r\n else {\r\n // We found a non-quoted value.\r\n strMatchedValue = arrMatches[3];\r\n }\r\n // Now that we have our value string, let's add\r\n // it to the data array.\r\n arrData[arrData.length - 1].push(strMatchedValue);\r\n }\r\n // Return the parsed data.\r\n return (arrData);\r\n };\r\n return CSVParser;\r\n}(DataParser));\r\nexport { CSVParser };\r\n","/**\r\n * Data Loader is responsible for loading and parsing external data\r\n */\r\nimport { CSVParser } from \"./CSVParser\";\r\nimport { JSONParser } from \"./JSONParser\";\r\nimport { Adapter } from \"../utils/Adapter\";\r\nimport * as $net from \"../utils/Net\";\r\nimport * as $array from \"../utils/Array\";\r\n;\r\n/**\r\n * Data Loader is responsible for loading and parsing external data.\r\n *\r\n * There is just one instance of DataLoader per system. Unless you have a\r\n * speicific reason, do not instantiate additional instances.\r\n *\r\n * The global instance of Data Loader is accessible via:\r\n *\r\n * ```TypeScript\r\n * am4core.dataLoader;\r\n * ```\r\n * ```JavaScript\r\n * am4core.dataLoader;\r\n * ```\r\n *\r\n * A loading of specific data source is done via [[DataSource]].\r\n *\r\n Please refer to [[DataSource]] for information how to use it.\r\n *\r\n * @see {@link IDataLoaderAdapters} for a list of available Adapters\r\n */\r\nvar DataLoader = /** @class */ (function () {\r\n function DataLoader() {\r\n /**\r\n * Adapter.\r\n */\r\n this.adapter = new Adapter(this);\r\n }\r\n /**\r\n * Loads a supplied [[DataSource]] or an array of data sources, then calls\r\n * their respective `parse` methods.\r\n *\r\n * @param source A single data source or an array of multiple of data sources\r\n */\r\n DataLoader.prototype.load = function (source) {\r\n var sources = Array.isArray(source) ? source : [source];\r\n // Add each Source to the list to be loaded simultaneously\r\n var promises = $array.map(sources, function (x) {\r\n // Dispatch events\r\n x.dispatchImmediately(\"started\");\r\n x.dispatchImmediately(\"loadstarted\");\r\n return $net.load(x.url, x, x.requestOptions);\r\n });\r\n // Run all promises in parallel\r\n Promise.all(promises).then(function (res) {\r\n // Process each loaded source\r\n $array.each(res, function (result) {\r\n // Get Source\r\n var source = result.target;\r\n // Dispatch events\r\n source.dispatchImmediately(\"loadended\");\r\n if (result.error) {\r\n if (source.events.isEnabled(\"error\")) {\r\n source.events.dispatchImmediately(\"error\", {\r\n type: \"error\",\r\n code: result.xhr.status,\r\n message: source.language.translate(\"Unable to load file: %1\", null, source.url),\r\n target: source\r\n });\r\n }\r\n }\r\n else {\r\n // Initiate parsing of the loaded data\r\n source.processData(result.response, result.type);\r\n }\r\n source.dispatchImmediately(\"ended\");\r\n });\r\n }).catch(function (res) {\r\n if (res.target) {\r\n res.target.dispatchImmediately(\"loadended\");\r\n if (res.target.events.isEnabled(\"error\")) {\r\n res.target.events.dispatchImmediately(\"error\", {\r\n type: \"error\",\r\n code: res.xhr.status,\r\n message: res.target.language.translate(\"Unable to load file: %1\", null, res.target.url),\r\n target: res.target\r\n });\r\n }\r\n res.target.dispatchImmediately(\"ended\");\r\n }\r\n });\r\n };\r\n /**\r\n * Instantiates a [[DataParser]] object based on the data type.\r\n * Built-in parser types are as follows:\r\n *\r\n * * \"csv\" or \"text/csv\"\r\n * * \"json\" or \"application/json\"\r\n *\r\n * @param contentType A format type\r\n * @return A parser object\r\n */\r\n DataLoader.prototype.getParserByType = function (contentType) {\r\n // Let some plugin decide\r\n var parser = this.adapter.apply(\"getParserByType\", {\r\n parser: null,\r\n type: contentType\r\n }).parser;\r\n if (parser) {\r\n return parser;\r\n }\r\n if (contentType == \"csv\" || contentType == \"text/csv\" || contentType == \"application/vnd.ms-excel\") {\r\n return new CSVParser();\r\n }\r\n if (contentType == \"json\" || contentType == \"application/json\") {\r\n return new JSONParser();\r\n }\r\n return;\r\n };\r\n /**\r\n * Tries to determine a parser out of content type and/or actual data.\r\n *\r\n * @param data Data\r\n * @param contentType Content-type\r\n * @return Parser instance\r\n */\r\n DataLoader.prototype.getParserByData = function (data, contentType) {\r\n // Let some plugin decide\r\n var parser = this.adapter.apply(\"getParserByData\", {\r\n parser: null,\r\n data: data,\r\n type: contentType\r\n }).parser;\r\n // Check if we have parser from outside code\r\n if (!parser) {\r\n // No, let's try to figure it out\r\n parser = this.getParserByType(contentType);\r\n if (parser) {\r\n // We're able to figure out parser by content-type\r\n return parser;\r\n }\r\n else if (JSONParser.isJSON(data)) {\r\n return this.getParserByType(\"json\");\r\n }\r\n else if (CSVParser.isCSV(data)) {\r\n return this.getParserByType(\"csv\");\r\n }\r\n }\r\n return parser;\r\n };\r\n return DataLoader;\r\n}());\r\nexport { DataLoader };\r\n/**\r\n * Create instance of Data Loader\r\n */\r\nexport var dataLoader = new DataLoader();\r\n","/**\r\n * Data parser module.\r\n */\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { DateFormatter } from \"../formatters/DateFormatter\";\r\nimport * as $utils from \"../utils/Utils\";\r\nimport * as $type from \"../utils/Type\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Base class for the data parsers.\r\n */\r\nvar DataParser = /** @class */ (function () {\r\n function DataParser() {\r\n }\r\n /**\r\n * A \"placeholder\" function for real parsers to override.\r\n *\r\n * @ignore Exclude from docs\r\n * @param data Source data\r\n * @return Parsed data (empty)\r\n */\r\n DataParser.prototype.parse = function (data) {\r\n return [];\r\n };\r\n ;\r\n Object.defineProperty(DataParser.prototype, \"parsableNumbers\", {\r\n /**\r\n * Checks if there are any numeric fields that need to be converted to\r\n * numbers.\r\n *\r\n * @return Numeric fields?\r\n */\r\n get: function () {\r\n return this.options.numberFields && (this.options.numberFields.length > 0);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Converts a value to 'number' if it is in `numberFields`.\r\n *\r\n * @param field Field name\r\n * @param value Value\r\n * @return Parsed or original value\r\n */\r\n DataParser.prototype.maybeToNumber = function (field, value) {\r\n if (this.options.numberFields.indexOf(field) !== -1) {\r\n return $utils.anyToNumber(value);\r\n }\r\n return value;\r\n };\r\n Object.defineProperty(DataParser.prototype, \"parsableDates\", {\r\n /**\r\n * Checks if there are any date fields that need to be converted to `Date`\r\n * objects.\r\n *\r\n * @return Date fields?\r\n */\r\n get: function () {\r\n return this.options.dateFields && (this.options.dateFields.length > 0);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Converts a value to `Date` if it is in `dateFields`.\r\n *\r\n * @param field Field name\r\n * @param value Value\r\n * @return Parsed or original value\r\n */\r\n DataParser.prototype.maybeToDate = function (field, value) {\r\n if (this.options.dateFields.indexOf(field) !== -1) {\r\n return this.options.dateFormatter.parse(value, this.dateFormat);\r\n }\r\n return value;\r\n };\r\n /**\r\n * Replaces empty value with something else.\r\n *\r\n * @param value Source value\r\n * @return Source value or replacement\r\n */\r\n DataParser.prototype.maybeToEmpty = function (value) {\r\n if ((!$type.hasValue(value) || value == \"\") && $type.hasValue(this.options.emptyAs)) {\r\n return this.options.emptyAs;\r\n }\r\n return value;\r\n };\r\n Object.defineProperty(DataParser.prototype, \"dateFormatter\", {\r\n /**\r\n * [[DateFormatter]] object for date parsing.\r\n *\r\n * If there was not [[DateFormatter]] supplied in parser options, a new one\r\n * is created.\r\n *\r\n * @return Date formatter\r\n * @see {@link DateFormatter}\r\n */\r\n get: function () {\r\n if (!this.options.dateFormatter) {\r\n this.options.dateFormatter = new DateFormatter;\r\n if (this.options.dateFormat) {\r\n this.options.dateFormat = this.options.dateFormat;\r\n }\r\n }\r\n return this.options.dateFormatter;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DataParser.prototype, \"dateFormat\", {\r\n /**\r\n * A date format to use when parsing dates.\r\n *\r\n * @return Date format\r\n * @see {@link DateFormatter}\r\n */\r\n get: function () {\r\n return this.options.dateFormat || this.dateFormatter.inputDateFormat;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return DataParser;\r\n}());\r\nexport { DataParser };\r\n","import { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { dataLoader } from \"./DataLoader\";\r\nimport { JSONParser } from \"./JSONParser\";\r\nimport { CSVParser } from \"./CSVParser\";\r\nimport { BaseObjectEvents } from \"../Base\";\r\nimport { Adapter } from \"../utils/Adapter\";\r\nimport { Language } from \"../utils/Language\";\r\nimport { DateFormatter } from \"../formatters/DateFormatter\";\r\nimport { registry } from \"../Registry\";\r\nimport * as $type from \"../utils/Type\";\r\nimport * as $object from \"../utils/Object\";\r\n;\r\n;\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Represents a single data source - external file with all of its settings,\r\n * such as format, data parsing, etc.\r\n *\r\n * ```TypeScript\r\n * chart.dataSource.url = \"http://www.myweb.com/data.json\";\r\n * chart.dataSource.parser = am4core.JSONParser;\r\n * ```\r\n * ```JavaScript\r\n * chart.dataSource.url = \"http://www.myweb.com/data.json\";\r\n * chart.dataSource.parser = am4core.JSONParser;\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"dataSource\": {\r\n * \"url\": \"http://www.myweb.com/data.json\",\r\n * \"parser\": \"JSONParser\"\r\n * },\r\n * // ...\r\n * }\r\n * ```\r\n *\r\n * @see {@link IDataSourceEvents} for a list of available events\r\n * @see {@link IDataSourceAdapters} for a list of available Adapters\r\n */\r\nvar DataSource = /** @class */ (function (_super) {\r\n __extends(DataSource, _super);\r\n /**\r\n * Constructor\r\n */\r\n function DataSource(url, parser) {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n /**\r\n * Adapter.\r\n */\r\n _this.adapter = new Adapter(_this);\r\n /**\r\n * Custom options for HTTP(S) request.\r\n */\r\n _this._requestOptions = {};\r\n /**\r\n * If set to `true`, any subsequent data loads will be considered incremental\r\n * (containing only new data points that are supposed to be added to existing\r\n * data).\r\n *\r\n * NOTE: this setting works only with element's `data` property. It won't\r\n * work with any other externally-loadable data property.\r\n *\r\n * @default false\r\n */\r\n _this._incremental = false;\r\n /**\r\n * A collection of key/value pairs to attach to a data source URL when making\r\n * an incremental request.\r\n */\r\n _this._incrementalParams = {};\r\n /**\r\n * This setting is used only when `incremental = true`. If set to `true`,\r\n * it will try to retain the same number of data items across each load.\r\n *\r\n * E.g. if incremental load yeilded 5 new records, then 5 items from the\r\n * beginning of data will be removed so that we end up with the same number\r\n * of data items.\r\n *\r\n * @default false\r\n */\r\n _this._keepCount = false;\r\n /**\r\n * If set to `true`, each subsequent load will be treated as an update to\r\n * currently loaded data, meaning that it will try to update values on\r\n * existing data items, not overwrite the whole data.\r\n *\r\n * This will work faster than complete update, and also will animate the\r\n * values to their new positions.\r\n *\r\n * Data sources across loads must contain the same number of data items.\r\n *\r\n * Loader will not truncate the data set if loaded data has fewer data items,\r\n * and if it is longer, the excess data items will be ignored.\r\n *\r\n * @default false\r\n * @since 4.5.5\r\n */\r\n _this._updateCurrentData = false;\r\n /**\r\n * Will show loading indicator when loading files.\r\n */\r\n _this.showPreloader = true;\r\n _this.className = \"DataSource\";\r\n // Set defaults\r\n if (url) {\r\n _this.url = url;\r\n }\r\n // Set parser\r\n if (parser) {\r\n if (typeof parser == \"string\") {\r\n _this.parser = dataLoader.getParserByType(parser);\r\n }\r\n else {\r\n _this.parser = parser;\r\n }\r\n }\r\n return _this;\r\n }\r\n /**\r\n * Processes the loaded data.\r\n *\r\n * @ignore Exclude from docs\r\n * @param data Raw (unparsed) data\r\n * @param contentType Content type of the loaded data (optional)\r\n */\r\n DataSource.prototype.processData = function (data, contentType) {\r\n // Parsing started\r\n this.dispatchImmediately(\"parsestarted\");\r\n // Check if parser is set\r\n if (!this.parser) {\r\n // Try to resolve from data\r\n this.parser = dataLoader.getParserByData(data, contentType);\r\n if (!this.parser) {\r\n // We have a problem - nobody knows what to do with the data\r\n // Raise error\r\n if (this.events.isEnabled(\"parseerror\")) {\r\n var event_1 = {\r\n type: \"parseerror\",\r\n message: this.language.translate(\"No parser available for file: %1\", null, this.url),\r\n target: this\r\n };\r\n this.events.dispatchImmediately(\"parseerror\", event_1);\r\n }\r\n this.dispatchImmediately(\"parseended\");\r\n return;\r\n }\r\n }\r\n // Apply options adapters\r\n this.parser.options = this.adapter.apply(\"parserOptions\", this.parser.options);\r\n this.parser.options.dateFields = this.adapter.apply(\"dateFields\", this.parser.options.dateFields || []);\r\n this.parser.options.numberFields = this.adapter.apply(\"numberFields\", this.parser.options.numberFields || []);\r\n // Check if we need to pass in date formatter\r\n if (this.parser.options.dateFields && !this.parser.options.dateFormatter) {\r\n this.parser.options.dateFormatter = this.dateFormatter;\r\n }\r\n // Parse\r\n this.data = this.adapter.apply(\"parsedData\", this.parser.parse(this.adapter.apply(\"unparsedData\", data)));\r\n // Check for parsing errors\r\n if (!$type.hasValue(this.data) && this.events.isEnabled(\"parseerror\")) {\r\n var event_2 = {\r\n type: \"parseerror\",\r\n message: this.language.translate(\"Error parsing file: %1\", null, this.url),\r\n target: this\r\n };\r\n this.events.dispatchImmediately(\"parseerror\", event_2);\r\n }\r\n // Wrap up\r\n this.dispatchImmediately(\"parseended\");\r\n if ($type.hasValue(this.data)) {\r\n this.dispatchImmediately(\"done\", {\r\n \"data\": this.data\r\n });\r\n }\r\n // The component is responsible for updating its own data vtriggered via\r\n // events.\r\n // Update last data load\r\n this.lastLoad = new Date();\r\n };\r\n Object.defineProperty(DataSource.prototype, \"url\", {\r\n /**\r\n * @return URL\r\n */\r\n get: function () {\r\n // Get URL\r\n var url = this.disableCache\r\n ? this.timestampUrl(this._url)\r\n : this._url;\r\n // Add incremental params\r\n if (this.incremental && this.component.data.length) {\r\n url = this.addUrlParams(url, this.incrementalParams);\r\n }\r\n return this.adapter.apply(\"url\", url);\r\n },\r\n /**\r\n * URL of the data source.\r\n *\r\n * @param value URL\r\n */\r\n set: function (value) {\r\n this._url = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DataSource.prototype, \"requestOptions\", {\r\n /**\r\n * @return Options\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"requestOptions\", this._requestOptions);\r\n },\r\n /**\r\n * Custom options for HTTP(S) request.\r\n *\r\n * At this moment the only option supported is: `requestHeaders`, which holds\r\n * an array of objects for custom request headers, e.g.:\r\n *\r\n * ```TypeScript\r\n * chart.dataSource.requestOptions.requestHeaders = [{\r\n * \"key\": \"x-access-token\",\r\n * \"value\": \"123456789\"\r\n * }];\r\n * ``````JavaScript\r\n * chart.dataSource.requestOptions.requestHeaders = [{\r\n * \"key\": \"x-access-token\",\r\n * \"value\": \"123456789\"\r\n * }];\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"dataSource\": {\r\n * // ...\r\n * \"requestOptions\": {\r\n * \"requestHeaders\": [{\r\n * \"key\": \"x-access-token\",\r\n * \"value\": \"123456789\"\r\n * }]\r\n * }\r\n * }\r\n * }\r\n * ```\r\n *\r\n * NOTE: setting this options on an-already loaded DataSource will not\r\n * trigger a reload.\r\n *\r\n * @param value Options\r\n */\r\n set: function (value) {\r\n this._requestOptions = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DataSource.prototype, \"parser\", {\r\n /**\r\n * @return Data parser\r\n */\r\n get: function () {\r\n if (!this._parser) {\r\n this._parser = new JSONParser();\r\n }\r\n return this.adapter.apply(\"parser\", this._parser);\r\n },\r\n /**\r\n * A parser to be used to parse data.\r\n *\r\n * ```TypeScript\r\n * chart.dataSource.url = \"http://www.myweb.com/data.json\";\r\n * chart.dataSource.parser = am4core.JSONParser;\r\n * ```\r\n * ```JavaScript\r\n * chart.dataSource.url = \"http://www.myweb.com/data.json\";\r\n * chart.dataSource.parser = am4core.JSONParser;\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"dataSource\": {\r\n * \"url\": \"http://www.myweb.com/data.json\",\r\n * \"parser\": {\r\n * \"type\": \"JSONParser\"\r\n * }\r\n * },\r\n * // ...\r\n * }\r\n * ```\r\n *\r\n * @default JSONParser\r\n * @param value Data parser\r\n */\r\n set: function (value) {\r\n this._parser = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DataSource.prototype, \"reloadFrequency\", {\r\n /**\r\n * @return Reload frequency (ms)\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"reloadTimeout\", this._reloadFrequency);\r\n },\r\n /**\r\n * Data source reload frequency.\r\n *\r\n * If set, it will reload the same URL every X milliseconds.\r\n *\r\n * @param value Reload frequency (ms)\r\n */\r\n set: function (value) {\r\n var _this = this;\r\n if (this._reloadFrequency != value) {\r\n this._reloadFrequency = value;\r\n // Should we schedule a reload?\r\n if (value) {\r\n if (!$type.hasValue(this._reloadDisposer)) {\r\n this._reloadDisposer = this.events.on(\"ended\", function (ev) {\r\n _this._reloadTimeout = setTimeout(function () {\r\n _this.load();\r\n }, _this.reloadFrequency);\r\n });\r\n }\r\n }\r\n else if ($type.hasValue(this._reloadDisposer)) {\r\n this._reloadDisposer.dispose();\r\n this._reloadDisposer = undefined;\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DataSource.prototype, \"incremental\", {\r\n /**\r\n * @return Incremental load?\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"incremental\", this._incremental);\r\n },\r\n /**\r\n * Should subsequent reloads be treated as incremental?\r\n *\r\n * Incremental loads will assume that they contain only new data items\r\n * since the last load.\r\n *\r\n * If `incremental = false` the loader will replace all of the target's\r\n * data with each load.\r\n *\r\n * This setting does not have any effect trhe first time data is loaded.\r\n *\r\n * NOTE: this setting works only with element's `data` property. It won't\r\n * work with any other externally-loadable data property.\r\n *\r\n * @default false\r\n * @param Incremental load?\r\n */\r\n set: function (value) {\r\n this._incremental = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DataSource.prototype, \"incrementalParams\", {\r\n /**\r\n * @return Incremental request parameters\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"incrementalParams\", this._incrementalParams);\r\n },\r\n /**\r\n * An object consisting of key/value pairs to apply to an URL when data\r\n * source is making an incremental request.\r\n *\r\n * @param value Incremental request parameters\r\n */\r\n set: function (value) {\r\n this._incrementalParams = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DataSource.prototype, \"keepCount\", {\r\n /**\r\n * @return keepCount load?\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"keepCount\", this._keepCount);\r\n },\r\n /**\r\n * This setting is used only when `incremental = true`. If set to `true`,\r\n * it will try to retain the same number of data items across each load.\r\n *\r\n * E.g. if incremental load yeilded 5 new records, then 5 items from the\r\n * beginning of data will be removed so that we end up with the same number\r\n * of data items.\r\n *\r\n * @default false\r\n * @param Keep record count?\r\n */\r\n set: function (value) {\r\n this._keepCount = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DataSource.prototype, \"updateCurrentData\", {\r\n /**\r\n * @return Update current data?\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"updateCurrentData\", this._updateCurrentData);\r\n },\r\n /**\r\n * If set to `true`, each subsequent load will be treated as an update to\r\n * currently loaded data, meaning that it will try to update values on\r\n * existing data items, not overwrite the whole data.\r\n *\r\n * This will work faster than complete update, and also will animate the\r\n * values to their new positions.\r\n *\r\n * Data sources across loads must contain the same number of data items.\r\n *\r\n * Loader will not truncate the data set if loaded data has fewer data items,\r\n * and if it is longer, the excess data items will be ignored.\r\n *\r\n * NOTE: this setting is ignored if `incremental = true`.\r\n *\r\n * @default false\r\n * @since 2.5.5\r\n * @param Update current data?\r\n */\r\n set: function (value) {\r\n this._updateCurrentData = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DataSource.prototype, \"language\", {\r\n /**\r\n * @return A [[Language]] instance to be used\r\n */\r\n get: function () {\r\n if (this._language) {\r\n return this._language;\r\n }\r\n else if (this.component) {\r\n this._language = this.component.language;\r\n return this._language;\r\n }\r\n this.language = new Language();\r\n return this.language;\r\n },\r\n /**\r\n * Language instance to use.\r\n *\r\n * Will inherit and use chart's language, if not set.\r\n *\r\n * @param value An instance of Language\r\n */\r\n set: function (value) {\r\n this._language = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DataSource.prototype, \"dateFormatter\", {\r\n /**\r\n * @return A [[DateFormatter]] instance to be used\r\n */\r\n get: function () {\r\n if (this._dateFormatter) {\r\n return this._dateFormatter;\r\n }\r\n else if (this.component) {\r\n this._dateFormatter = this.component.dateFormatter;\r\n return this._dateFormatter;\r\n }\r\n this.dateFormatter = new DateFormatter();\r\n return this.dateFormatter;\r\n },\r\n /**\r\n * A [[DateFormatter]] to use when parsing dates from string formats.\r\n *\r\n * Will inherit and use chart's DateFormatter if not ser.\r\n *\r\n * @param value An instance of [[DateFormatter]]\r\n */\r\n set: function (value) {\r\n this._dateFormatter = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Adds current timestamp to the URL.\r\n *\r\n * @param url Source URL\r\n * @return Timestamped URL\r\n */\r\n DataSource.prototype.timestampUrl = function (url) {\r\n var tstamp = new Date().getTime().toString();\r\n var params = {};\r\n params[tstamp] = \"\";\r\n return this.addUrlParams(url, params);\r\n };\r\n /**\r\n * Disposes of this object.\r\n */\r\n DataSource.prototype.dispose = function () {\r\n _super.prototype.dispose.call(this);\r\n if (this._reloadTimeout) {\r\n clearTimeout(this._reloadTimeout);\r\n }\r\n if ($type.hasValue(this._reloadDisposer)) {\r\n this._reloadDisposer.dispose();\r\n this._reloadDisposer = undefined;\r\n }\r\n };\r\n /**\r\n * Initiate the load.\r\n *\r\n * All loading in JavaScript is asynchronous. This function will trigger the\r\n * load and will exit immediately.\r\n *\r\n * Use DataSource's events to watch for loaded data and errors.\r\n */\r\n DataSource.prototype.load = function () {\r\n if (this.url) {\r\n if (this._reloadTimeout) {\r\n clearTimeout(this._reloadTimeout);\r\n }\r\n dataLoader.load(this);\r\n }\r\n };\r\n /**\r\n * Adds parameters to `url` as query strings. Will take care of proper\r\n * separators.\r\n *\r\n * @param url Source URL\r\n * @param params Parameters\r\n * @return New URL\r\n */\r\n DataSource.prototype.addUrlParams = function (url, params) {\r\n var join = url.match(/\\?/) ? \"&\" : \"?\";\r\n var add = [];\r\n $object.each(params, function (key, value) {\r\n if (value != \"\") {\r\n add.push(key + \"=\" + encodeURIComponent(value));\r\n }\r\n else {\r\n add.push(key);\r\n }\r\n });\r\n if (add.length) {\r\n return url + join + add.join(\"&\");\r\n }\r\n return url;\r\n };\r\n /**\r\n * Processes JSON-based config before it is applied to the object.\r\n *\r\n * @ignore Exclude from docs\r\n * @param config Config\r\n */\r\n DataSource.prototype.processConfig = function (config) {\r\n registry.registeredClasses[\"json\"] = JSONParser;\r\n registry.registeredClasses[\"JSONParser\"] = JSONParser;\r\n registry.registeredClasses[\"csv\"] = CSVParser;\r\n registry.registeredClasses[\"CSVParser\"] = CSVParser;\r\n _super.prototype.processConfig.call(this, config);\r\n };\r\n return DataSource;\r\n}(BaseObjectEvents));\r\nexport { DataSource };\r\n","/**\r\n * JSON parser.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { DataParser } from \"./DataParser\";\r\nimport * as $object from \"../utils/Object\";\r\nimport * as $type from \"../utils/Type\";\r\n/**\r\n * A parser for JSON.\r\n *\r\n * @important\r\n */\r\nvar JSONParser = /** @class */ (function (_super) {\r\n __extends(JSONParser, _super);\r\n function JSONParser() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n /**\r\n * Content-type suitable for JSON format.\r\n */\r\n _this.contentType = \"application/json\";\r\n /**\r\n * Parser options.\r\n *\r\n * @see {@link IJSONOptions} for description of each option\r\n */\r\n _this.options = {};\r\n return _this;\r\n }\r\n /**\r\n * Tests if the data is valid JSON.\r\n *\r\n * @param data Source data\r\n * @return Is it JSON?\r\n */\r\n JSONParser.isJSON = function (data) {\r\n try {\r\n // Try parsing JSON\r\n JSON.parse(data);\r\n // If we got to this point it means it's a valid JSON\r\n return true;\r\n }\r\n catch (e) {\r\n return false;\r\n }\r\n };\r\n /**\r\n * Parses and returns data.\r\n *\r\n * @param data Unparsed data\r\n * @return Parsed data\r\n */\r\n JSONParser.prototype.parse = function (data) {\r\n var _this = this;\r\n // Init return\r\n var res;\r\n // Try parsing\r\n try {\r\n if ($type.hasValue(JSON)) {\r\n res = JSON.parse(data);\r\n }\r\n }\r\n catch (e) {\r\n return undefined;\r\n }\r\n // Do we need to cast some fields to numbers or dates?\r\n var empty = $type.hasValue(this.options.emptyAs);\r\n var numbers = this.parsableNumbers;\r\n var dates = this.parsableDates;\r\n if (Array.isArray(res) && (numbers || dates || empty)) {\r\n var _loop_1 = function (i, len) {\r\n var row = res[i];\r\n $object.each(row, function (key, value) {\r\n if (empty) {\r\n row[key] = _this.maybeToEmpty(row[key]);\r\n }\r\n if (numbers) {\r\n row[key] = _this.maybeToNumber(key, row[key]);\r\n }\r\n if (dates) {\r\n row[key] = _this.maybeToDate(key, row[key]);\r\n }\r\n });\r\n };\r\n // Iterate through the data and check if it needs to be converted\r\n for (var i = 0, len = res.length; i < len; i++) {\r\n _loop_1(i, len);\r\n }\r\n }\r\n // Convert to array\r\n //return Array.isArray(res) ? res : [res];\r\n return res;\r\n };\r\n return JSONParser;\r\n}(DataParser));\r\nexport { JSONParser };\r\n","/**\r\n */\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { color } from \"../utils/Color\";\r\n/**\r\n * Defines a class that holds default properties for new SVG elements\r\n */\r\nvar SVGDefaults = /** @class */ (function () {\r\n function SVGDefaults() {\r\n }\r\n SVGDefaults.opacity = 1;\r\n SVGDefaults.strokeOpacity = 1;\r\n SVGDefaults.strokeWidth = 1;\r\n SVGDefaults.fillOpacity = 1;\r\n SVGDefaults.fill = color(\"#000000\");\r\n SVGDefaults.stroke = color(\"#000000\");\r\n SVGDefaults.focusable = undefined;\r\n SVGDefaults.tabindex = 0;\r\n return SVGDefaults;\r\n}());\r\nexport { SVGDefaults };\r\n","/**\r\n * Cone module.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Container } from \"../../Container\";\r\nimport { Sprite, visualProperties } from \"../../Sprite\";\r\nimport { Ellipse } from \"../../elements/Ellipse\";\r\nimport { LinearGradientModifier } from \"../../rendering/fills/LinearGradientModifier\";\r\nimport { percent } from \"../../utils/Percent\";\r\nimport * as $object from \"../../utils/Object\";\r\nimport * as $path from \"../../rendering/Path\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Builds a round cone/cylinder.\r\n *\r\n * @see {@link IConeEvents} for a list of available events\r\n * @see {@link IConeAdapters} for a list of available Adapters\r\n */\r\nvar Cone = /** @class */ (function (_super) {\r\n __extends(Cone, _super);\r\n /**\r\n * Constructor\r\n */\r\n function Cone() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"Cone\";\r\n _this.angle = 30;\r\n _this.radius = percent(100);\r\n _this.topRadius = percent(100);\r\n _this.top = _this.createChild(Ellipse);\r\n _this.top.shouldClone = false;\r\n _this.bottom = _this.createChild(Ellipse);\r\n _this.bottom.shouldClone = false;\r\n _this.body = _this.createChild(Sprite);\r\n _this.body.shouldClone = false;\r\n _this.body.setElement(_this.paper.add(\"path\"));\r\n _this.layout = \"none\";\r\n _this.bodyFillModifier = new LinearGradientModifier();\r\n _this.bodyFillModifier.lightnesses = [0, -0.25, 0];\r\n _this.body.fillModifier = _this.bodyFillModifier;\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Draws the element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Cone.prototype.draw = function () {\r\n _super.prototype.draw.call(this);\r\n $object.copyProperties(this, this.top, visualProperties);\r\n $object.copyProperties(this, this.bottom, visualProperties);\r\n $object.copyProperties(this, this.body, visualProperties);\r\n var w = this.innerWidth;\r\n var h = this.innerHeight;\r\n var bottom = this.bottom;\r\n var top = this.top;\r\n var angle = this.angle;\r\n var radiusBase;\r\n var dx;\r\n var dy;\r\n if (this.orientation == \"horizontal\") {\r\n radiusBase = h / 2;\r\n bottom.y = h / 2;\r\n top.y = h / 2;\r\n top.x = w;\r\n dx = (90 - angle) / 90;\r\n dy = 0;\r\n this.bodyFillModifier.gradient.rotation = 90;\r\n }\r\n else {\r\n dx = 0;\r\n dy = (90 - angle) / 90;\r\n radiusBase = w / 2;\r\n bottom.y = h;\r\n bottom.x = w / 2;\r\n top.x = w / 2;\r\n this.bodyFillModifier.gradient.rotation = 0;\r\n }\r\n var radius = this.radius.value * radiusBase;\r\n var topRadius = this.topRadius.value * radiusBase;\r\n bottom.radius = radius - radius * dx;\r\n bottom.radiusY = radius - radius * dy;\r\n top.radius = topRadius - topRadius * dx;\r\n top.radiusY = topRadius - topRadius * dy;\r\n var path;\r\n if (this.orientation == \"horizontal\") {\r\n path = $path.moveTo({ x: 0, y: h / 2 - bottom.radiusY }) + $path.arcTo(-90, -180, bottom.radius, bottom.radiusY) + $path.lineTo({ x: w, y: h / 2 + top.radiusY }) + $path.arcTo(90, 180, top.radius, top.radiusY) + $path.closePath();\r\n }\r\n else {\r\n path = $path.moveTo({ x: w / 2 - top.radius, y: 0 }) + $path.arcTo(180, -180, top.radius, top.radiusY) + $path.lineTo({ x: w / 2 + bottom.radius, y: h }) + $path.arcTo(0, 180, bottom.radius, bottom.radiusY) + $path.closePath();\r\n }\r\n this.body.path = path;\r\n };\r\n Object.defineProperty(Cone.prototype, \"angle\", {\r\n /**\r\n * @return Angle\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"angle\");\r\n },\r\n /**\r\n * Angle of the point of view to the 3D element. (0-360)\r\n *\r\n * @default 30\r\n * @param value Angle\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"angle\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Cone.prototype, \"radius\", {\r\n /**\r\n * @return Bottom radius\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"radius\");\r\n },\r\n /**\r\n * A relative radius of the cone's bottom (base).\r\n *\r\n * It is relevant to the inner width or height of the element.\r\n *\r\n * @default Percent(100)\r\n * @param value Bottom radius\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"radius\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Cone.prototype, \"topRadius\", {\r\n /**\r\n * @return Top radius\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"topRadius\");\r\n },\r\n /**\r\n * A relative radius of the cone's top (tip).\r\n *\r\n * It is relevant to the inner width or height of the element.\r\n *\r\n * @default Percent(0)\r\n * @param value Top radius\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"topRadius\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Cone.prototype, \"orientation\", {\r\n /**\r\n * Orientation\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"orientation\");\r\n },\r\n /**\r\n * Orientation of the cone\r\n *\r\n * @default \"vertical\"\r\n * @param value Orientation\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"orientation\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return Cone;\r\n}(Container));\r\nexport { Cone };\r\n","/**\r\n * Creates a 3D rectangle.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Container } from \"../../Container\";\r\nimport { Sprite } from \"../../Sprite\";\r\nimport * as $math from \"../../utils/Math\";\r\nimport * as $path from \"../../rendering/Path\";\r\nimport { Color, color, toColor } from \"../../utils/Color\";\r\nimport { RadialGradient } from \"../../rendering/fills/RadialGradient\";\r\nimport { LinearGradient } from \"../../rendering/fills/LinearGradient\";\r\nimport { LightenFilter } from \"../../rendering/filters/LightenFilter\";\r\nimport * as $type from \"../../utils/Type\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Builds a 3D rectangle\r\n * @see {@link IRectangle3DEvents} for a list of available events\r\n * @see {@link IRectangle3DAdapters} for a list of available Adapters\r\n */\r\nvar Rectangle3D = /** @class */ (function (_super) {\r\n __extends(Rectangle3D, _super);\r\n /**\r\n * Constructor\r\n */\r\n function Rectangle3D() {\r\n var _this = _super.call(this) || this;\r\n _this.angle = 30;\r\n _this.depth = 30;\r\n _this.className = \"Rectangle3D\";\r\n _this.layout = \"none\";\r\n var sideBack = _this.createChild(Sprite);\r\n sideBack.shouldClone = false;\r\n sideBack.setElement(_this.paper.add(\"path\"));\r\n sideBack.isMeasured = false;\r\n _this.sideBack = sideBack;\r\n _this._disposers.push(_this.sideBack);\r\n var sideBottom = _this.createChild(Sprite);\r\n sideBottom.shouldClone = false;\r\n sideBottom.setElement(_this.paper.add(\"path\"));\r\n sideBottom.isMeasured = false;\r\n _this.sideBottom = sideBottom;\r\n _this._disposers.push(_this.sideBottom);\r\n var sideLeft = _this.createChild(Sprite);\r\n sideLeft.shouldClone = false;\r\n sideLeft.setElement(_this.paper.add(\"path\"));\r\n sideLeft.isMeasured = false;\r\n _this.sideLeft = sideLeft;\r\n _this._disposers.push(_this.sideLeft);\r\n var sideRight = _this.createChild(Sprite);\r\n sideRight.shouldClone = false;\r\n sideRight.setElement(_this.paper.add(\"path\"));\r\n sideRight.isMeasured = false;\r\n _this.sideRight = sideRight;\r\n _this._disposers.push(_this.sideRight);\r\n var sideTop = _this.createChild(Sprite);\r\n sideTop.shouldClone = false;\r\n sideTop.setElement(_this.paper.add(\"path\"));\r\n sideTop.isMeasured = false;\r\n _this.sideTop = sideTop;\r\n _this._disposers.push(_this.sideTop);\r\n var sideFront = _this.createChild(Sprite);\r\n sideFront.shouldClone = false;\r\n sideFront.setElement(_this.paper.add(\"path\"));\r\n sideFront.isMeasured = false;\r\n _this.sideFront = sideFront;\r\n _this._disposers.push(_this.sideFront);\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Draws the element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Rectangle3D.prototype.draw = function () {\r\n _super.prototype.draw.call(this);\r\n var w = this.innerWidth;\r\n var h = this.innerHeight;\r\n var depth = this.depth;\r\n var angle = this.angle;\r\n var sin = $math.sin(angle);\r\n var cos = $math.cos(angle);\r\n var a = { x: 0, y: 0 };\r\n var b = { x: w, y: 0 };\r\n var c = { x: w, y: h };\r\n var d = { x: 0, y: h };\r\n var ah = { x: depth * cos, y: -depth * sin };\r\n var bh = { x: depth * cos + w, y: -depth * sin };\r\n var ch = { x: depth * cos + w, y: -depth * sin + h };\r\n var dh = { x: depth * cos, y: -depth * sin + h };\r\n this.sideFront.path = $path.moveTo(a) + $path.lineTo(b) + $path.lineTo(c) + $path.lineTo(d) + $path.closePath();\r\n this.sideBack.path = $path.moveTo(ah) + $path.lineTo(bh) + $path.lineTo(ch) + $path.lineTo(dh) + $path.closePath();\r\n this.sideLeft.path = $path.moveTo(a) + $path.lineTo(ah) + $path.lineTo(dh) + $path.lineTo(d) + $path.closePath();\r\n this.sideRight.path = $path.moveTo(b) + $path.lineTo(bh) + $path.lineTo(ch) + $path.lineTo(c) + $path.closePath();\r\n this.sideBottom.path = $path.moveTo(d) + $path.lineTo(dh) + $path.lineTo(ch) + $path.lineTo(c) + $path.closePath();\r\n this.sideTop.path = $path.moveTo(a) + $path.lineTo(ah) + $path.lineTo(bh) + $path.lineTo(b) + $path.closePath();\r\n };\r\n Object.defineProperty(Rectangle3D.prototype, \"depth\", {\r\n /**\r\n * @return Depth (px)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"depth\");\r\n },\r\n /**\r\n * Depth (Z dimension) of the 3D rectangle in pixels.\r\n *\r\n * @default 30\r\n * @param value Depth (px)\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"depth\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Rectangle3D.prototype, \"angle\", {\r\n /**\r\n * @return Angle\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"angle\");\r\n },\r\n /**\r\n * Angle of the point of view to the 3D element. (0-360)\r\n *\r\n * @default 30\r\n * @param value Angle\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"angle\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Sets actual `fill` property on the SVG element, including applicable color\r\n * modifiers.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Fill\r\n */\r\n Rectangle3D.prototype.setFill = function (value) {\r\n _super.prototype.setFill.call(this, value);\r\n if (!$type.isObject(value) || \"r\" in value) {\r\n value = toColor(value);\r\n }\r\n var colorStr;\r\n if (value instanceof Color) {\r\n colorStr = value.hex;\r\n }\r\n else if (value instanceof LinearGradient || value instanceof RadialGradient) {\r\n colorStr = value.stops.getIndex(0).color.hex;\r\n }\r\n else {\r\n var filter = new LightenFilter();\r\n filter.lightness = -0.2;\r\n this.sideBack.filters.push(filter);\r\n var filter2 = filter.clone();\r\n filter2.lightness = -0.4;\r\n this.sideLeft.filters.push(filter2);\r\n var filter3 = filter.clone();\r\n filter3.lightness = -0.2;\r\n this.sideRight.filters.push(filter3);\r\n var filter4 = filter.clone();\r\n filter4.lightness = -0.1;\r\n this.sideTop.filters.push(filter4);\r\n var filter5 = filter.clone();\r\n filter5.lightness = -0.5;\r\n this.sideBottom.filters.push(filter5);\r\n }\r\n if (colorStr) {\r\n this.sideBack.fill = color(colorStr).lighten(-0.2);\r\n this.sideLeft.fill = color(colorStr).lighten(-0.4);\r\n this.sideRight.fill = color(colorStr).lighten(-0.2);\r\n this.sideTop.fill = color(colorStr).lighten(-0.1);\r\n this.sideBottom.fill = color(colorStr).lighten(-0.5);\r\n }\r\n };\r\n /**\r\n * Copies all properties and related data from a different instance of Rectangle3D.\r\n *\r\n * @param source Source Rectangle3D\r\n */\r\n Rectangle3D.prototype.copyFrom = function (source) {\r\n _super.prototype.copyFrom.call(this, source);\r\n this.sideBack.copyFrom(source.sideBack);\r\n this.sideLeft.copyFrom(source.sideLeft);\r\n this.sideRight.copyFrom(source.sideRight);\r\n this.sideTop.copyFrom(source.sideTop);\r\n this.sideBottom.copyFrom(source.sideBottom);\r\n };\r\n return Rectangle3D;\r\n}(Container));\r\nexport { Rectangle3D };\r\n","/**\r\n * 3D slice module\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Slice } from \"../Slice\";\r\nimport { Sprite } from \"../../Sprite\";\r\nimport * as $math from \"../../utils/Math\";\r\nimport * as $path from \"../../rendering/Path\";\r\nimport * as $type from \"../../utils/Type\";\r\nimport { Color, color } from \"../../utils/Color\";\r\nimport { RadialGradient } from \"../../rendering/fills/RadialGradient\";\r\nimport { LinearGradient } from \"../../rendering/fills/LinearGradient\";\r\nimport { LightenFilter } from \"../../rendering/filters/LightenFilter\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Used to draw a 3D slice of a Pie chart.\r\n *\r\n * @see {@link ISlice3DEvents} for a list of available events\r\n * @see {@link ISlice3DAdapters} for a list of available Adapters\r\n */\r\nvar Slice3D = /** @class */ (function (_super) {\r\n __extends(Slice3D, _super);\r\n /**\r\n * Constructor\r\n */\r\n function Slice3D() {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n _this.className = \"Slice3D\";\r\n _this.layout = \"none\";\r\n // Create edge container\r\n var edge = _this.createChild(Sprite);\r\n _this.edge = edge;\r\n edge.shouldClone = false;\r\n edge.isMeasured = false;\r\n edge.toBack();\r\n // Set defaults\r\n _this.angle = 30;\r\n _this.depth = 20;\r\n // Create side A element\r\n var sideA = _this.createChild(Sprite);\r\n _this.sideA = sideA;\r\n sideA.shouldClone = false;\r\n sideA.isMeasured = false;\r\n //sideA.setElement(this.paper.add(\"path\"));\r\n //sideA.strokeOpacity = 0;\r\n // Crate side B element\r\n var sideB = _this.createChild(Sprite);\r\n _this.sideB = sideB;\r\n sideB.shouldClone = false;\r\n sideB.isMeasured = false;\r\n //sideB.setElement(this.paper.add(\"path\"));\r\n //sideB.strokeOpacity = 0;\r\n // Apply theme\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Sets actual `fill` property on the SVG element, including applicable color\r\n * modifiers.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Fill\r\n */\r\n Slice3D.prototype.setFill = function (value) {\r\n _super.prototype.setFill.call(this, value);\r\n var colorStr;\r\n if (value instanceof Color) {\r\n colorStr = value.hex;\r\n }\r\n else if (value instanceof LinearGradient || value instanceof RadialGradient) {\r\n colorStr = value.stops.getIndex(0).color.hex;\r\n }\r\n else {\r\n var filter = new LightenFilter();\r\n filter.lightness = -0.25;\r\n this.edge.filters.push(filter);\r\n this.sideA.filters.push(filter.clone());\r\n this.sideB.filters.push(filter.clone());\r\n }\r\n if (colorStr) {\r\n var edgeFill = color(colorStr).lighten(-0.25);\r\n this.edge.fill = edgeFill;\r\n this.sideA.fill = edgeFill;\r\n this.sideB.fill = edgeFill;\r\n this.edge.stroke = edgeFill;\r\n this.sideA.stroke = edgeFill;\r\n this.sideB.stroke = edgeFill;\r\n }\r\n };\r\n /**\r\n * Draws the element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Slice3D.prototype.draw = function () {\r\n this.cornerRadius = 0;\r\n this.innerCornerRadius = 0;\r\n _super.prototype.draw.call(this);\r\n if (this.arc !== 0 && this.radius > 0 && this.depth > 0) {\r\n this.sideB.show(0);\r\n this.sideA.show(0);\r\n this.edge.show(0);\r\n var startAngle = this.startAngle;\r\n var arc = this.arc;\r\n var innerRadius = this.pixelInnerRadius || 0;\r\n var radiusY = this.radiusY || 0;\r\n //let cornerRadius = this.cornerRadius || 0;\r\n //let innerCornerRadius = this.innerCornerRadius;\r\n var radius = this.radius;\r\n // this is code duplicate with $path.arc. @todo to think how to avoid it\r\n var endAngle = startAngle + arc;\r\n //let crSin = $math.sin($math.min(arc, 45) / 2);\r\n //innerCornerRadius = innerCornerRadius || cornerRadius;\r\n var innerRadiusY = (radiusY / radius) * innerRadius;\r\n //let cornerRadiusY = (radiusY / radius) * cornerRadius;\r\n //let innerCornerRadiusY = (radiusY / radius) * innerCornerRadius;\r\n //cornerRadius = $math.fitToRange(cornerRadius, 0, (radius - innerRadius) / 2);\r\n //cornerRadiusY = $math.fitToRange(cornerRadiusY, 0, (radiusY - innerRadiusY) / 2);\r\n //innerCornerRadius = $math.fitToRange(innerCornerRadius, 0, (radius - innerRadius) / 2);\r\n //innerCornerRadiusY = $math.fitToRange(innerCornerRadiusY, 0, (radiusY - innerRadiusY) / 2);\r\n //cornerRadius = $math.fitToRange(cornerRadius, 0, radius * crSin);\r\n //cornerRadiusY = $math.fitToRange(cornerRadiusY, 0, radiusY * crSin);\r\n //innerCornerRadius = $math.fitToRange(innerCornerRadius, 0, innerRadius * crSin);\r\n //innerCornerRadiusY = $math.fitToRange(innerCornerRadiusY, 0, innerRadiusY * crSin);\r\n //let crAngle: number = Math.asin(cornerRadius / radius / 2) * $math.DEGREES * 2;\r\n //let crAngleY: number = Math.asin(cornerRadiusY / radiusY / 2) * $math.DEGREES * 2;\r\n //if (innerRadius < innerCornerRadius) {\r\n //\tinnerRadius = innerCornerRadius;\r\n //}\r\n //if (innerRadiusY < innerCornerRadiusY) {\r\n //\tinnerRadiusY = innerCornerRadiusY;\r\n //}\r\n //let crInnerAngle: number = Math.asin(innerCornerRadius / innerRadius / 2) * $math.DEGREES * 2;\r\n //let crInnerAngleY: number = Math.asin(innerCornerRadiusY / innerRadiusY / 2) * $math.DEGREES * 2;\r\n //if (!$type.isNumber(crInnerAngle)) {\r\n //\tcrInnerAngle = 0;\r\n //}\r\n //if (!$type.isNumber(crInnerAngleY)) {\r\n //\tcrInnerAngleY = 0;\r\n //}\r\n //let middleAngle = startAngle + arc / 2;\r\n //let mPoint = { x: $math.round($math.cos(middleAngle) * innerRadius, 4), y: $math.round($math.sin(middleAngle) * innerRadiusY, 4) };\r\n var a0 = { x: $math.cos(startAngle) * (innerRadius), y: $math.sin(startAngle) * (innerRadiusY) };\r\n var b0 = { x: $math.cos(startAngle) * (radius), y: $math.sin(startAngle) * (radiusY) };\r\n var c0 = { x: $math.cos(endAngle) * (radius), y: $math.sin(endAngle) * (radiusY) };\r\n var d0 = { x: $math.cos(endAngle) * (innerRadius), y: $math.sin(endAngle) * (innerRadiusY) };\r\n // end of duplicate\r\n var h = this.depth;\r\n var ah = { x: a0.x, y: a0.y - h };\r\n var bh = { x: b0.x, y: b0.y - h };\r\n var ch = { x: c0.x, y: c0.y - h };\r\n var dh = { x: d0.x, y: d0.y - h };\r\n var edgePath = \"\";\r\n var count = Math.ceil(arc / 5);\r\n var step = arc / count;\r\n var mangle = startAngle;\r\n var prevPoint = bh;\r\n for (var i = 0; i < count; i++) {\r\n mangle += step;\r\n if (mangle > 0 && mangle < 180) {\r\n edgePath += $path.moveTo(prevPoint);\r\n var pp = { x: $math.cos(mangle) * (radius), y: $math.sin(mangle) * (radiusY) - h };\r\n edgePath += $path.lineTo({ x: prevPoint.x, y: prevPoint.y + h });\r\n edgePath += $path.arcToPoint({ x: pp.x, y: pp.y + h }, radius, radiusY, true);\r\n edgePath += $path.lineTo(pp);\r\n edgePath += $path.arcToPoint(prevPoint, radius, radiusY);\r\n edgePath += \"z\";\r\n prevPoint = pp;\r\n }\r\n else {\r\n edgePath += $path.moveTo(prevPoint);\r\n var pp = { x: $math.cos(mangle) * (radius), y: $math.sin(mangle) * (radiusY) - h };\r\n edgePath += $path.arcToPoint(pp, radius, radiusY, true);\r\n edgePath += $path.lineTo({ x: pp.x, y: pp.y + h });\r\n edgePath += $path.arcToPoint({ x: prevPoint.x, y: prevPoint.y + h }, radius, radiusY);\r\n edgePath += $path.lineTo(prevPoint);\r\n edgePath += \"z\";\r\n prevPoint = pp;\r\n }\r\n }\r\n prevPoint = ah;\r\n mangle = startAngle;\r\n for (var i = 0; i < count; i++) {\r\n mangle += step;\r\n if (mangle > 0 && mangle < 180) {\r\n edgePath += $path.moveTo(prevPoint);\r\n var pp = { x: $math.cos(mangle) * (innerRadius), y: $math.sin(mangle) * (innerRadiusY) - h };\r\n edgePath += $path.lineTo({ x: prevPoint.x, y: prevPoint.y + h });\r\n edgePath += $path.arcToPoint({ x: pp.x, y: pp.y + h }, innerRadius, innerRadiusY, true);\r\n edgePath += $path.lineTo(pp);\r\n edgePath += $path.arcToPoint(prevPoint, innerRadius, innerRadiusY);\r\n edgePath += \"z\";\r\n prevPoint = pp;\r\n }\r\n else {\r\n edgePath += $path.moveTo(prevPoint);\r\n var pp = { x: $math.cos(mangle) * (innerRadius), y: $math.sin(mangle) * (innerRadiusY) - h };\r\n edgePath += $path.arcToPoint(pp, innerRadius, innerRadiusY, true);\r\n edgePath += $path.lineTo({ x: pp.x, y: pp.y + h });\r\n edgePath += $path.arcToPoint({ x: prevPoint.x, y: prevPoint.y + h }, innerRadius, innerRadiusY);\r\n edgePath += $path.lineTo(prevPoint);\r\n edgePath += \"z\";\r\n prevPoint = pp;\r\n }\r\n }\r\n this.edge.path = edgePath;\r\n /*\r\n a0 = { x: $math.cos(startAngle) * (innerRadius + innerCornerRadius), y: $math.sin(startAngle) * (innerRadiusY + innerCornerRadiusY) };\r\n b0 = { x: $math.cos(startAngle) * (radius - cornerRadius), y: $math.sin(startAngle) * (radiusY - cornerRadiusY) };\r\n c0 = { x: $math.cos(endAngle) * (radius - cornerRadius), y: $math.sin(endAngle) * (radiusY - cornerRadiusY) };\r\n d0 = { x: $math.cos(endAngle) * (innerRadius + innerCornerRadius), y: $math.sin(endAngle) * (innerRadiusY + innerCornerRadiusY) };\r\n // end of duplicate\r\n \r\n ah = { x: a0.x, y: a0.y - h };\r\n bh = { x: b0.x, y: b0.y - h };\r\n ch = { x: c0.x, y: c0.y - h };\r\n dh = { x: d0.x, y: d0.y - h };\r\n */\r\n this.sideA.path = $path.moveTo(a0) + $path.lineTo(b0) + $path.lineTo(bh) + $path.lineTo(ah) + $path.closePath();\r\n this.sideB.path = $path.moveTo(c0) + $path.lineTo(d0) + $path.lineTo(dh) + $path.lineTo(ch) + $path.closePath();\r\n if (this.startAngle < 90) {\r\n this.sideA.toBack();\r\n }\r\n else {\r\n this.sideA.toFront();\r\n }\r\n if (this.startAngle + this.arc > 90) {\r\n this.sideB.toBack();\r\n }\r\n else {\r\n this.sideB.toFront();\r\n }\r\n this.slice.dy = -h;\r\n }\r\n else {\r\n this.sideA.hide(0);\r\n this.sideB.hide(0);\r\n this.edge.hide(0);\r\n }\r\n };\r\n Object.defineProperty(Slice3D.prototype, \"depth\", {\r\n /**\r\n * @return Depth (px)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"depth\");\r\n },\r\n /**\r\n * Depth (height) of the 3D slice in pixels.\r\n *\r\n * @default 20\r\n * @param depth Depth (px)\r\n */\r\n set: function (depth) {\r\n this.setPropertyValue(\"depth\", depth, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Slice3D.prototype, \"angle\", {\r\n /**\r\n * @return Angle\r\n */\r\n get: function () {\r\n var angle = this.getPropertyValue(\"angle\");\r\n if (!$type.isNumber(angle)) {\r\n angle = 0;\r\n }\r\n return angle;\r\n },\r\n /**\r\n * Angle of the point of view to the 3D element. (0-360)\r\n *\r\n * @default 30\r\n * @param value Angle\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"angle\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Slice3D.prototype, \"radiusY\", {\r\n /**\r\n * @return Vertical radius (0-1)\r\n */\r\n get: function () {\r\n var radiusY = this.getPropertyValue(\"radiusY\");\r\n if (!$type.isNumber(radiusY)) {\r\n radiusY = this.radius - this.radius * this.angle / 90;\r\n }\r\n return radiusY;\r\n },\r\n /**\r\n * Vertical radius for creating skewed slices.\r\n *\r\n * This is relevant to `radius`, e.g. 0.5 will set vertical radius to half\r\n * the `radius`.\r\n *\r\n * @param value Vertical radius (0-1)\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"radiusY\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Copies all properties and related data from a different instance of Axis.\r\n *\r\n * @param source Source Axis\r\n */\r\n Slice3D.prototype.copyFrom = function (source) {\r\n _super.prototype.copyFrom.call(this, source);\r\n this.edge.copyFrom(source.edge);\r\n this.sideA.copyFrom(source.sideA);\r\n this.sideB.copyFrom(source.sideB);\r\n };\r\n return Slice3D;\r\n}(Slice));\r\nexport { Slice3D };\r\n","/**\r\n * AmChartsLogo module.\r\n *\r\n * AmChartsLogo shows amCharts logo for non-commercial users of a library.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Container } from \"../Container\";\r\nimport { InterfaceColorSet } from \"../../core/utils/InterfaceColorSet\";\r\nimport { Polyspline } from \"./Polyspline\";\r\nimport { color } from \"../utils/Color\";\r\nimport { LinearGradient } from \"../rendering/fills/LinearGradient\";\r\nimport { DesaturateFilter } from \"../rendering/filters/DesaturateFilter\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * A class used to draw and display progress indicator.\r\n *\r\n * @see {@link IAmChartsLogoEvents} for a list of available events\r\n * @see {@link IAmChartsLogoAdapters} for a list of available Adapters\r\n * @ignore Exclude from docs\r\n */\r\nvar AmChartsLogo = /** @class */ (function (_super) {\r\n __extends(AmChartsLogo, _super);\r\n /**\r\n * Constructor\r\n */\r\n function AmChartsLogo() {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n _this.className = \"AmChartsLogo\";\r\n _this.valign = \"bottom\";\r\n var d = 0.3;\r\n _this.opacity = 0.3;\r\n _this.defaultState.properties.opacity = 0.4;\r\n _this.url = \"https://www.amcharts.com/\";\r\n _this.urlTarget = \"_blank\";\r\n _this.showSystemTooltip = true;\r\n _this.readerTitle = \"Chart created using amCharts library\";\r\n _this.width = 220 * d;\r\n _this.height = 70 * d;\r\n _this.background.opacity = 0;\r\n var aColor = color(\"#474758\");\r\n if (new InterfaceColorSet().getFor(\"background\").alternative.hex == \"#ffffff\") {\r\n aColor = color(\"#ffffff\");\r\n }\r\n var aGradient = new LinearGradient();\r\n aGradient.addColor(aColor);\r\n aGradient.addColor(aColor, 1, 0.75);\r\n aGradient.addColor(color(\"#3cabff\"), 1, 0.755);\r\n aGradient.rotation = -10;\r\n var aStroke = aGradient;\r\n var m = _this.createChild(Polyspline);\r\n m.shouldClone = false;\r\n m.isMeasured = false;\r\n m.segments = [[{ x: 50 * d, y: 50 * d }, { x: 90 * d, y: 50 * d }, { x: 120 * d, y: 20 * d }, { x: 135 * d, y: 35 * d }, { x: 150 * d, y: 20 * d }, { x: 180 * d, y: 50 * d }, { x: 200 * d, y: 50 * d }]];\r\n m.strokeWidth = 6 * d;\r\n m.tensionX = 0.8;\r\n m.tensionY = 1;\r\n m.stroke = color(\"#3cabff\");\r\n var a = _this.createChild(Polyspline);\r\n a.shouldClone = false;\r\n a.isMeasured = false;\r\n a.segments = [[{ x: 20 * d, y: 50 * d }, { x: 50 * d, y: 50 * d }, { x: 90 * d, y: 12 * d }, { x: 133 * d, y: 50 * d }, { x: 170 * d, y: 50 * d }, { x: 200 * d, y: 50 * d }]];\r\n a.strokeWidth = 6 * d;\r\n a.tensionX = 0.75;\r\n a.tensionY = 1;\r\n a.stroke = aStroke;\r\n _this._disposers.push(a);\r\n var desaturateFilter = new DesaturateFilter();\r\n _this.filters.push(desaturateFilter);\r\n var desaturateFilterHover = new DesaturateFilter();\r\n desaturateFilterHover.saturation = 1;\r\n var hoverState = _this.states.create(\"hover\");\r\n hoverState.properties.opacity = 1;\r\n hoverState.filters.push(desaturateFilterHover);\r\n // Apply theme\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n return AmChartsLogo;\r\n}(Container));\r\nexport { AmChartsLogo };\r\n","/**\r\n * Functionality for drawing simple buttons.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Container } from \"../Container\";\r\nimport { Label } from \"./Label\";\r\nimport { RoundedRectangle } from \"../elements/RoundedRectangle\";\r\nimport { InterfaceColorSet } from \"../../core/utils/InterfaceColorSet\";\r\nimport { registry } from \"../Registry\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Button class is capable of drawing a simple rectangular button with\r\n * optionally rounded corners and an icon in it.\r\n *\r\n * @see {@link IButtonEvents} for a list of available events\r\n * @see {@link IButtonAdapters} for a list of available Adapters\r\n */\r\nvar Button = /** @class */ (function (_super) {\r\n __extends(Button, _super);\r\n /**\r\n * Constructor\r\n */\r\n function Button() {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n _this.className = \"Button\";\r\n _this.tooltipY = 0;\r\n // Set defaults\r\n _this.iconPosition = \"left\";\r\n _this.layout = \"horizontal\";\r\n _this.contentAlign = \"center\";\r\n _this.contentValign = \"middle\";\r\n _this.padding(8, 16, 8, 16);\r\n _this.setStateOnChildren = true;\r\n var interfaceColors = new InterfaceColorSet();\r\n // Create background\r\n var background = _this.background;\r\n background.fill = interfaceColors.getFor(\"secondaryButton\");\r\n background.stroke = interfaceColors.getFor(\"secondaryButtonStroke\");\r\n background.fillOpacity = 1;\r\n background.strokeOpacity = 1;\r\n background.cornerRadius(3, 3, 3, 3);\r\n // Create the label element\r\n _this.label = new Label();\r\n _this.label.fill = interfaceColors.getFor(\"secondaryButtonText\");\r\n ;\r\n _this.label.shouldClone = false;\r\n // Create default states\r\n var hoverState = background.states.create(\"hover\");\r\n hoverState.properties.fillOpacity = 1;\r\n hoverState.properties.fill = interfaceColors.getFor(\"secondaryButtonHover\");\r\n var downState = background.states.create(\"down\");\r\n downState.transitionDuration = 100;\r\n downState.properties.fill = interfaceColors.getFor(\"secondaryButtonDown\");\r\n downState.properties.fillOpacity = 1;\r\n // Set up accessibility\r\n // A button should be always focusable\r\n _this.role = \"button\";\r\n _this.focusable = true;\r\n // Apply theme\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n Object.defineProperty(Button.prototype, \"icon\", {\r\n /**\r\n * @return Icon Sprite\r\n */\r\n get: function () {\r\n return this._icon;\r\n },\r\n /**\r\n * A [[Sprite]] to be used as an icon on button.\r\n *\r\n * @param icon Icon Sprite\r\n */\r\n set: function (icon) {\r\n var currentIcon = this._icon;\r\n if (currentIcon) {\r\n //this._icon.dispose();\r\n //this.removeDispose(currentIcon);\r\n currentIcon.parent = undefined;\r\n }\r\n if (icon) {\r\n this._icon = icon;\r\n icon.parent = this;\r\n icon.interactionsEnabled = false;\r\n icon.shouldClone = false;\r\n this.iconPosition = this.iconPosition;\r\n this._disposers.push(icon);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Button.prototype, \"iconPosition\", {\r\n /**\r\n * @return Icon position\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"iconPosition\");\r\n },\r\n /**\r\n * Icon position: \"left\" or \"right\".\r\n *\r\n * @default \"left\"\r\n * @param position Icon position\r\n */\r\n set: function (position) {\r\n this.setPropertyValue(\"iconPosition\", position);\r\n if (this.icon) {\r\n if (position == \"left\") {\r\n this.icon.toBack();\r\n }\r\n else {\r\n this.icon.toFront();\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Button.prototype, \"label\", {\r\n /**\r\n * @return Label element\r\n */\r\n get: function () {\r\n return this._label;\r\n },\r\n /**\r\n * [[Label]] element to be used for text.\r\n *\r\n * @param label element\r\n */\r\n set: function (label) {\r\n if (this._label) {\r\n //this._label.dispose();\r\n this.removeDispose(this._label);\r\n }\r\n this._label = label;\r\n if (label) {\r\n label.parent = this;\r\n label.interactionsEnabled = false;\r\n this._disposers.push(this._label);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Creates a background element for the button.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Background element\r\n */\r\n Button.prototype.createBackground = function () {\r\n return new RoundedRectangle();\r\n };\r\n /**\r\n * Copies properties and other attributes.\r\n *\r\n * @param source Source\r\n */\r\n Button.prototype.copyFrom = function (source) {\r\n _super.prototype.copyFrom.call(this, source);\r\n if (source.label) {\r\n this.label.copyFrom(source.label);\r\n }\r\n if (source.icon) {\r\n this.icon = source.icon.clone();\r\n }\r\n };\r\n return Button;\r\n}(Container));\r\nexport { Button };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Button\"] = Button;\r\n","/**\r\n * Functionality for drawing circles.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Sprite } from \"../Sprite\";\r\nimport { percent } from \"../utils/Percent\";\r\nimport { registry } from \"../Registry\";\r\nimport * as $utils from \"../utils/Utils\";\r\nimport * as $math from \"../utils/Math\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Used to create a circle\r\n * @see {@link ICircleEvents} for a list of available events\r\n * @see {@link ICircleAdapters} for a list of available Adapters\r\n */\r\nvar Circle = /** @class */ (function (_super) {\r\n __extends(Circle, _super);\r\n /**\r\n * Constructor\r\n */\r\n function Circle() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"Circle\";\r\n _this.element = _this.paper.add(\"circle\");\r\n _this.setPercentProperty(\"radius\", percent(100));\r\n _this.setPropertyValue(\"horizontalCenter\", \"middle\");\r\n _this.setPropertyValue(\"verticalCenter\", \"middle\");\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Draws the circle.\r\n */\r\n Circle.prototype.draw = function () {\r\n _super.prototype.draw.call(this);\r\n this.element.attr({ \"r\": this.pixelRadius });\r\n };\r\n Object.defineProperty(Circle.prototype, \"radius\", {\r\n /**\r\n * @return Radius\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"radius\");\r\n },\r\n /**\r\n * Radius of the circle.\r\n *\r\n * Can be either absolute (pixels) or relative ([Percent]).\r\n *\r\n * @param value Radius\r\n */\r\n set: function (value) {\r\n this.setPercentProperty(\"radius\", value, true, false, 10, false);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Circle.prototype, \"pixelRadius\", {\r\n /**\r\n * Radius of the circle in pixels.\r\n *\r\n * This is a read-only property. To set radius in pixels, use `radius`\r\n * property.\r\n *\r\n * @readonly\r\n * @return Radius (px)\r\n */\r\n get: function () {\r\n return $utils.relativeToValue(this.radius, $math.min(this.innerWidth / 2, this.innerHeight / 2));\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Updates bounding box.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Circle.prototype.measureElement = function () {\r\n var pixelRadius = this.pixelRadius;\r\n this._bbox = {\r\n x: -pixelRadius,\r\n y: -pixelRadius,\r\n width: pixelRadius * 2,\r\n height: pixelRadius * 2\r\n };\r\n };\r\n return Circle;\r\n}(Sprite));\r\nexport { Circle };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Circle\"] = Circle;\r\n","/**\r\n * Zoom out button functionality.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Button } from \"./Button\";\r\nimport { Sprite } from \"../Sprite\";\r\nimport { registry } from \"../Registry\";\r\nimport { InterfaceColorSet } from \"../../core/utils/InterfaceColorSet\";\r\nimport * as $path from \"../rendering/Path\";\r\nimport * as $type from \"../../core/utils/Type\";\r\nimport { MouseCursorStyle } from \"../../core/interaction/Mouse\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Creates a zoom out button.\r\n *\r\n * @see {@link ICloseButtonEvents} for a list of available events\r\n * @see {@link ICloseButtonAdapters} for a list of available Adapters\r\n */\r\nvar CloseButton = /** @class */ (function (_super) {\r\n __extends(CloseButton, _super);\r\n /**\r\n * Constructor\r\n */\r\n function CloseButton() {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n _this.className = \"CloseButton\";\r\n _this.padding(8, 8, 8, 8);\r\n _this.showSystemTooltip = true;\r\n _this.width = 30;\r\n _this.height = 30;\r\n var interfaceColors = new InterfaceColorSet();\r\n _this.cursorOverStyle = MouseCursorStyle.pointer;\r\n var background = _this.background;\r\n background.cornerRadius(20, 20, 20, 20);\r\n var bgc = interfaceColors.getFor(\"background\");\r\n background.fill = bgc;\r\n background.stroke = interfaceColors.getFor(\"primaryButton\");\r\n background.strokeOpacity = 1;\r\n background.strokeWidth = 1;\r\n var downColor = interfaceColors.getFor(\"primaryButtonActive\");\r\n var bhs = background.states.getKey(\"hover\");\r\n bhs.properties.strokeWidth = 3;\r\n bhs.properties.fill = bgc;\r\n var bds = background.states.getKey(\"down\");\r\n bds.properties.stroke = downColor;\r\n bds.properties.fill = bgc;\r\n // Create an icon\r\n var icon = new Sprite();\r\n icon.element = _this.paper.add(\"path\");\r\n icon.stroke = background.stroke;\r\n _this.icon = icon;\r\n // Apply theme\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n CloseButton.prototype.validate = function () {\r\n _super.prototype.validate.call(this);\r\n var w = this.pixelWidth / 3;\r\n var h = this.pixelHeight / 3;\r\n var path = $path.moveTo({ x: -w / 2, y: -h / 2 });\r\n path += $path.lineTo({ x: w / 2, y: h / 2 });\r\n path += $path.moveTo({ x: w / 2, y: -h / 2 });\r\n path += $path.lineTo({ x: -w / 2, y: h / 2 });\r\n this.icon.path = path;\r\n this.invalidateLayout();\r\n };\r\n /**\r\n * Sets defaults that instantiate some objects that rely on parent, so they\r\n * cannot be set in constructor.\r\n */\r\n CloseButton.prototype.applyInternalDefaults = function () {\r\n _super.prototype.applyInternalDefaults.call(this);\r\n if (!$type.hasValue(this.readerTitle)) {\r\n this.readerTitle = this.language.translate(\"Close\");\r\n }\r\n };\r\n return CloseButton;\r\n}(Button));\r\nexport { CloseButton };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"CloseButton\"] = CloseButton;\r\n","/**\r\n * Ellipse module.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Circle } from \"./Circle\";\r\nimport { registry } from \"../Registry\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Draws an ellipse\r\n * @see {@link IEllipseEvents} for a list of available events\r\n * @see {@link IEllipseAdapters} for a list of available Adapters\r\n */\r\nvar Ellipse = /** @class */ (function (_super) {\r\n __extends(Ellipse, _super);\r\n /**\r\n * Constructor\r\n */\r\n function Ellipse() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"Ellipse\";\r\n _this.element = _this.paper.add(\"ellipse\");\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Draws the ellipsis.\r\n */\r\n Ellipse.prototype.draw = function () {\r\n _super.prototype.draw.call(this);\r\n this.element.attr({ \"rx\": this.radius });\r\n this.element.attr({ \"ry\": this.radiusY });\r\n };\r\n Object.defineProperty(Ellipse.prototype, \"radiusY\", {\r\n /**\r\n * @return Vertical radius\r\n */\r\n get: function () {\r\n return this.innerHeight / 2;\r\n },\r\n /**\r\n * Vertical radius.\r\n *\r\n * It's a relative size to the `radius`.\r\n *\r\n * E.g. 0.8 will mean the height of the ellipsis will be 80% of it's\r\n * horizontal radius.\r\n *\r\n * @param value Vertical radius\r\n */\r\n set: function (value) {\r\n this.height = value * 2;\r\n this.invalidate();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Ellipse.prototype, \"radius\", {\r\n /**\r\n * @return Horizontal radius\r\n */\r\n get: function () {\r\n return this.innerWidth / 2;\r\n },\r\n /**\r\n * Horizontal radius.\r\n *\r\n * @param value Horizontal radius\r\n */\r\n set: function (value) {\r\n this.width = value * 2;\r\n this.invalidate();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return Ellipse;\r\n}(Circle));\r\nexport { Ellipse };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Ellipse\"] = Ellipse;\r\n","/**\r\n * Grip module.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Button } from \"./Button\";\r\nimport { Sprite } from \"../Sprite\";\r\nimport { InterfaceColorSet } from \"../../core/utils/InterfaceColorSet\";\r\nimport { registry } from \"../Registry\";\r\nimport { percent } from \"../utils/Percent\";\r\nimport * as $path from \"../rendering/Path\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Creates a grip element that can be used for scrolling or other things.\r\n *\r\n * @see {@link IGripEvents} for a list of available events\r\n * @see {@link IGripAdapters} for a list of available Adapters\r\n * @since 4.4.0\r\n */\r\nvar Grip = /** @class */ (function (_super) {\r\n __extends(Grip, _super);\r\n /**\r\n * Constructor\r\n */\r\n function Grip() {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n _this.className = \"Grip\";\r\n var cs = new InterfaceColorSet();\r\n // Set defaults\r\n _this.layout = \"absolute\";\r\n _this.padding(10, 10, 10, 10);\r\n _this.margin(3, 3, 3, 3);\r\n _this.background.fillOpacity = 0.3;\r\n _this.background.cornerRadius(10, 10, 10, 10);\r\n // Create an icon\r\n var icon = new Sprite();\r\n icon.element = _this.paper.add(\"path\");\r\n var path = $path.moveTo({ x: -6, y: 0 });\r\n path += $path.lineTo({ x: 6, y: 0 });\r\n path += $path.moveTo({ x: -8, y: -6 });\r\n path += $path.lineTo({ x: 0, y: -12 });\r\n path += $path.lineTo({ x: 8, y: -6 });\r\n path += $path.moveTo({ x: -8, y: 6 });\r\n path += $path.lineTo({ x: 0, y: 12 });\r\n path += $path.lineTo({ x: 8, y: 6 });\r\n icon.path = path;\r\n icon.strokeWidth = 2;\r\n icon.fillOpacity = 0;\r\n icon.pixelPerfect = true;\r\n icon.padding(0, 4, 0, 4);\r\n icon.stroke = cs.getFor(\"text\");\r\n icon.strokeOpacity = 0.7;\r\n icon.align = \"center\";\r\n icon.valign = \"middle\";\r\n _this.icon = icon;\r\n _this.label.dispose();\r\n _this.label = undefined;\r\n // Set default position\r\n _this.position = \"right\";\r\n // Set up autohide\r\n _this.autoHideDelay = 3000;\r\n _this.events.on(\"shown\", function (ev) {\r\n if (_this._autoHideTimeout) {\r\n _this._autoHideTimeout.dispose();\r\n }\r\n if (_this.autoHideDelay) {\r\n _this._autoHideTimeout = _this.setTimeout(function () {\r\n _this.hide();\r\n }, _this.autoHideDelay);\r\n }\r\n });\r\n _this.events.on(\"down\", function (ev) {\r\n if (_this._autoHideTimeout) {\r\n _this._autoHideTimeout.dispose();\r\n }\r\n });\r\n _this.events.on(\"out\", function (ev) {\r\n if (_this.autoHideDelay) {\r\n _this._autoHideTimeout = _this.setTimeout(function () {\r\n _this.hide();\r\n }, _this.autoHideDelay);\r\n }\r\n });\r\n // Apply theme\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n Object.defineProperty(Grip.prototype, \"position\", {\r\n /**\r\n * @return Position\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"position\");\r\n },\r\n /**\r\n * Sets position of the grip.\r\n *\r\n * Available options: \"left\", \"right\" (default), \"top\", \"bottom\".\r\n *\r\n * @param value Position\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"position\", value)) {\r\n switch (value) {\r\n case \"left\":\r\n this.align = \"left\";\r\n this.valign = \"middle\";\r\n this.horizontalCenter = \"left\";\r\n this.verticalCenter = \"middle\";\r\n this.icon.rotation = 0;\r\n this.width = undefined;\r\n this.height = percent(30);\r\n break;\r\n case \"right\":\r\n this.align = \"right\";\r\n this.valign = \"middle\";\r\n this.horizontalCenter = \"right\";\r\n this.verticalCenter = \"middle\";\r\n this.icon.rotation = 0;\r\n this.width = undefined;\r\n this.height = percent(30);\r\n break;\r\n case \"top\":\r\n this.align = \"center\";\r\n this.valign = \"top\";\r\n this.horizontalCenter = \"middle\";\r\n this.verticalCenter = \"top\";\r\n this.icon.rotation = 90;\r\n this.width = percent(30);\r\n this.height = undefined;\r\n break;\r\n case \"bottom\":\r\n this.align = \"center\";\r\n this.valign = \"bottom\";\r\n this.horizontalCenter = \"middle\";\r\n this.verticalCenter = \"bottom\";\r\n this.icon.rotation = 90;\r\n this.width = percent(30);\r\n this.height = undefined;\r\n break;\r\n default:\r\n this.align = \"center\";\r\n this.valign = \"middle\";\r\n this.horizontalCenter = \"middle\";\r\n this.verticalCenter = \"middle\";\r\n this.icon.rotation = 90;\r\n this.width = percent(30);\r\n this.height = undefined;\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Grip.prototype, \"autoHideDelay\", {\r\n /**\r\n * @return Delay\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"autoHideDelay\");\r\n },\r\n /**\r\n * Number of milliseconds to show grip until it is hidden automatically.\r\n *\r\n * @default 3000\r\n * @param value Delay\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"autoHideDelay\", value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return Grip;\r\n}(Button));\r\nexport { Grip };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Grip\"] = Grip;\r\n","/**\r\n * Functionality for adding images in SVG tree.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Sprite } from \"../Sprite\";\r\nimport { registry } from \"../Registry\";\r\nimport * as $dom from \"../utils/DOM\";\r\nimport * as $type from \"../utils/Type\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Used to add `<image>` elements to SVG.\r\n *\r\n * @see {@link IImageEvents} for a list of available events\r\n * @see {@link IImageAdapters} for a list of available Adapters\r\n */\r\nvar Image = /** @class */ (function (_super) {\r\n __extends(Image, _super);\r\n /**\r\n * Constructor\r\n */\r\n function Image() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"Image\";\r\n _this.element = _this.paper.add(\"image\");\r\n _this.applyTheme();\r\n _this.width = 50;\r\n _this.height = 50;\r\n return _this;\r\n }\r\n /**\r\n * Draws an `<image>` element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Image.prototype.draw = function () {\r\n _super.prototype.draw.call(this);\r\n if (this.href) {\r\n var width = this.innerWidth;\r\n var height = this.innerHeight;\r\n if ($type.isNumber(this.widthRatio)) {\r\n width = height * this.widthRatio;\r\n this.width = width;\r\n }\r\n if ($type.isNumber(this.heightRatio)) {\r\n height = width * this.heightRatio;\r\n this.height = height;\r\n }\r\n this.element.attr({\r\n \"width\": width,\r\n \"height\": height\r\n });\r\n this.element.attrNS($dom.XLINK, \"xlink:href\", this.href);\r\n }\r\n };\r\n Object.defineProperty(Image.prototype, \"href\", {\r\n /**\r\n * @return Image URI\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"href\");\r\n },\r\n /**\r\n * An image URI.\r\n *\r\n * @param value Image URI\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"href\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Image.prototype, \"widthRatio\", {\r\n /**\r\n * @return Ratio\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"widthRatio\");\r\n },\r\n /**\r\n * Sets image `width` relatively to its `height`.\r\n *\r\n * If image's `height = 100` and `widthRatio = 0.5` the actual width will be\r\n * `50`.\r\n *\r\n * @param value Ratio\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"widthRatio\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Image.prototype, \"heightRatio\", {\r\n /**\r\n * @return Ratio\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"heightRatio\");\r\n },\r\n /**\r\n * Sets image `height` relatively to its `width`.\r\n *\r\n * If image's `width = 100` and `heightRatio = 0.5` the actual height will be\r\n * `50`.\r\n *\r\n * @param value Ratio\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"heightRatio\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Image.prototype, \"bbox\", {\r\n /**\r\n * Returns bounding box (square) for this element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n get: function () {\r\n return {\r\n x: 0,\r\n y: 0,\r\n width: this.pixelWidth,\r\n height: this.pixelHeight\r\n };\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return Image;\r\n}(Sprite));\r\nexport { Image };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Image\"] = Image;\r\n","/**\r\n * Text class deals with all text placed on chart.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Container } from \"../Container\";\r\nimport { registry } from \"../Registry\";\r\nimport { getTextFormatter } from \"../formatters/TextFormatter\";\r\nimport { MultiDisposer } from \"../utils/Disposer\";\r\nimport { InterfaceColorSet } from \"../../core/utils/InterfaceColorSet\";\r\nimport * as $math from \"../utils/Math\";\r\nimport * as $utils from \"../utils/Utils\";\r\nimport * as $type from \"../utils/Type\";\r\nimport * as $dom from \"../utils/DOM\";\r\nimport { defaultRules, ResponsiveBreakpoints } from \"../utils/Responsive\";\r\n;\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Text is used to display highly configurable, data-enabled textual elements.\r\n *\r\n * ## Data Binding\r\n *\r\n * A Text element can dynamically parse and populate its contents with values\r\n * from a [[DataItem]].\r\n *\r\n * To activate such binding, set element's `dataItem` property.\r\n *\r\n * When activated, text contents will be parsed for special tags, e.g.:\r\n *\r\n * ```TypeScript\r\n * label.dataItem = myDataItem;\r\n * label.text = \"The title is: {title}\";\r\n * ```\r\n * ```JavaScript\r\n * label.dataItem = myDataItem;\r\n * label.text = \"The title is: {title}\";\r\n * ```\r\n *\r\n * The above will automatically replace \"{title}\" in the string with the\r\n * actual data value from `myDataItem`.\r\n *\r\n * Note, that most often dataItem is set by the Component.\r\n *\r\n *\r\n * @see {@link ILabelEvents} for a list of available events\r\n * @see {@link ILabelAdapters} for a list of available Adapters\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/formatters/formatting-strings/} for info on string formatting and data binding\r\n * @todo Vertical align\r\n * @important\r\n */\r\nvar Label = /** @class */ (function (_super) {\r\n __extends(Label, _super);\r\n /**\r\n * Constructor\r\n */\r\n function Label() {\r\n var _this = \r\n // Execute super's constructor\r\n _super.call(this) || this;\r\n /**\r\n * Indicates if the whole text does not fit into max dimenstions set for it.\r\n */\r\n _this.isOversized = false;\r\n // Set this class name\r\n _this.className = \"Label\";\r\n _this.fill = new InterfaceColorSet().getFor(\"text\");\r\n // not good to set this, as then these will appear on each label and values set on container won't be applied.\r\n //this.textDecoration = \"none\";\r\n //this.fontWeight = \"normal\";\r\n // Set defaults\r\n _this.wrap = false;\r\n _this.truncate = false;\r\n _this.fullWords = true;\r\n _this.ellipsis = \"…\";\r\n _this.textAlign = \"start\";\r\n _this.textValign = \"top\";\r\n _this.layout = \"absolute\";\r\n _this.baseLineRatio = -0.27;\r\n //this.pixelPerfect = true;\r\n _this._positionPrecision = 1;\r\n // Add events to watch for maxWidth/maxHeight changes so that we can\r\n // invalidate this\r\n _this.events.on(\"maxsizechanged\", function () {\r\n if (_this.inited) {\r\n _this.handleMaxSize();\r\n }\r\n }, _this, false);\r\n // this solves strange bug when text just added to svg is 0x0\r\n _this.events.once(\"validated\", _this.handleValidate, _this, false);\r\n // Aply theme\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * A placeholder method that is called **after** element finishes drawing\r\n * itself.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Label.prototype.afterDraw = function () {\r\n // since we removed validatePosition from sprite, we still need it here to handle rotated text\r\n _super.prototype.afterDraw.call(this);\r\n this.validatePosition();\r\n };\r\n /**\r\n * Sets [[Paper]] instance to use to draw elements.\r\n * @ignore\r\n * @param paper Paper\r\n * @return true if paper was changed, false, if it's the same\r\n */\r\n Label.prototype.setPaper = function (paper) {\r\n var changed = _super.prototype.setPaper.call(this, paper);\r\n if (changed) {\r\n this.hardInvalidate();\r\n }\r\n return changed;\r\n };\r\n /**\r\n * @ignore\r\n */\r\n Label.prototype.handleValidate = function () {\r\n if ((this.currentText || this.text) && (this.bbox.width == 0 || this.bbox.height == 0)) {\r\n registry.events.once(\"exitframe\", this.hardInvalidate, this);\r\n }\r\n };\r\n /**\r\n * @ignore\r\n */\r\n Label.prototype.handleMaxSize = function () {\r\n if ((this.bbox.width > this.availableWidth)\r\n || ((this.bbox.width < this.availableWidth) && (this.isOversized || this.truncate))\r\n || (this.bbox.height > this.availableHeight)\r\n || ((this.bbox.height < this.availableHeight) && this.isOversized)) {\r\n this.invalidate();\r\n }\r\n else {\r\n this.alignSVGText();\r\n }\r\n };\r\n /**\r\n * [arrange description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\n Label.prototype.arrange = function () {\r\n };\r\n /**\r\n * Updates current text according to data item and supported features.\r\n * Returns `true` if current text has changed.\r\n *\r\n * @return Text changed?\r\n */\r\n Label.prototype.updateCurrentText = function () {\r\n // Determine output format\r\n var output, text;\r\n if ($utils.isNotEmpty(this.html) && this.paper.supportsForeignObject()) {\r\n // We favor HTML text if it's set and browser supports `foreignObject`\r\n output = \"html\";\r\n text = this.html;\r\n }\r\n else {\r\n output = \"svg\";\r\n text = this.text;\r\n }\r\n // Need to toString source?\r\n if ($type.isObject(text)) {\r\n text = text.toString();\r\n }\r\n // Need to format text all the time\r\n if ($type.hasValue(text) && text !== \"\") {\r\n text = this.populateString(text, this.dataItem);\r\n }\r\n if (output == \"html\") {\r\n if (this._adapterO) {\r\n text = this._adapterO.apply(\"htmlOutput\", text);\r\n }\r\n }\r\n else {\r\n if (this._adapterO) {\r\n text = this._adapterO.apply(\"textOutput\", text);\r\n }\r\n }\r\n // Update the text\r\n var changed = text != this.currentText || output != this._currentFormat;\r\n this.currentText = text;\r\n this._currentFormat = output;\r\n return changed;\r\n };\r\n /**\r\n * Hard invalidate means the text will be redrawn even if it hasn't changed.\r\n * This is used when we change `fontSize`, `fontFamily`, or for some other\r\n * reasons.\r\n */\r\n Label.prototype.hardInvalidate = function () {\r\n this._prevStatus = \"\";\r\n this.invalidate();\r\n };\r\n /**\r\n * Gets line bbox, uses caching to save cpu\r\n * @ignore\r\n */\r\n Label.prototype.getLineBBox = function (lineInfo) {\r\n //let cacheKey = lineInfo.text + lineInfo.style;\r\n //let lineBBox = this.getCache(cacheKey);\r\n //if (!lineBBox) {\r\n //lineBBox = lineInfo.element.getBBox();\r\n //if (lineBBox.width != 0 && lineBBox.height != 0) {\r\n //\tthis.setCache(cacheKey, lineBBox, 5000);\r\n //}\r\n //}\r\n var element = lineInfo && lineInfo.element;\r\n var node = element && element.node;\r\n // Check for the parent Node to avoid FF from throwing errors\r\n if (node && node.parentNode) {\r\n lineInfo.bbox = element.getBBox();\r\n }\r\n };\r\n /**\r\n * Draws the textual label.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Label.prototype.draw = function () {\r\n // Draw super\r\n _super.prototype.draw.call(this);\r\n var oldW = this.bbox.width;\r\n var oldH = this.bbox.height;\r\n var topParent = this.topParent;\r\n if (topParent) {\r\n if (!topParent.maxWidth || !topParent.maxHeight) {\r\n topParent.events.once(\"maxsizechanged\", this.hardInvalidate, this, false);\r\n return;\r\n }\r\n }\r\n // Calculate max width and height\r\n var maxWidth = $math.max(this.availableWidth - this.pixelPaddingLeft - this.pixelPaddingRight, 0);\r\n var maxHeight = $math.max(this.availableHeight - this.pixelPaddingTop - this.pixelPaddingBottom, 0);\r\n // save\r\n var status = maxHeight + \",\" + maxWidth + this.wrap + this.truncate + this.fullWords + this.rtl + this.ellipsis;\r\n // Update text\r\n if (!this.updateCurrentText() && this.inited && this._prevStatus == status) {\r\n return;\r\n }\r\n this._measuredWidth = 0;\r\n this._measuredHeight = 0;\r\n // Reset\r\n this.isOversized = false;\r\n // Determine output format\r\n var output = this._currentFormat;\r\n var text = this.currentText;\r\n // Empty string\r\n if (!$type.hasValue(text) || text == \"\") {\r\n this.element.attr({ display: \"none\" });\r\n return;\r\n }\r\n // Chop up text into lines\r\n // We're still processing SVG and HTML in the same way for now\r\n var lines = text.split(\"\\n\");\r\n // Do we need to go through the trouble of measuring lines\r\n //let measure: boolean = true;// (lines.length > 1) || this.wrap;\r\n this._prevStatus = status;\r\n this.textAlign = this.textAlign;\r\n // need this to measure\r\n var display = this.group.getAttr(\"display\");\r\n if (display == \"none\") {\r\n this.group.removeAttr(\"display\");\r\n }\r\n if (this.textPathElement) {\r\n this.textPathElement.removeChildren();\r\n }\r\n // SVG or HTML?\r\n if (output === \"svg\") {\r\n /**\r\n * SVG\r\n */\r\n this.element.removeAttr(\"display\");\r\n // Clear the element\r\n var group = this.element;\r\n this.resetBBox();\r\n // Init state variables\r\n var currentHeight = 0;\r\n var currentFormat = \"\";\r\n // Process each line\r\n for (var i = 0; i < lines.length; i++) {\r\n // Get line\r\n var line = lines[i];\r\n // Check if line is empty\r\n if (line == \"\") {\r\n // It is, let's just update currentHeight and go to the next one\r\n // If it's the first line, we'll have to use arbirary line height,\r\n // since there's nothing to measure. For subsequent lines we can take\r\n // previous line's height\r\n var tempElement = this.getSVGLineElement(\"\", 0);\r\n tempElement.add(this.getSvgElement(\".\", getTextFormatter().translateStyleShortcuts(currentFormat)));\r\n group.add(tempElement);\r\n var offset = Math.ceil(tempElement.getBBox().height);\r\n if (offset > 0) {\r\n currentHeight += offset;\r\n }\r\n group.removeElement(tempElement);\r\n // Clear cache if necessary\r\n var lineInfo_1 = this.getLineInfo(i);\r\n if (lineInfo_1) {\r\n lineInfo_1.text = \"\";\r\n lineInfo_1.element.textContent = \"\";\r\n }\r\n continue;\r\n }\r\n // Chunk up the line and process each chunk\r\n var chunks = getTextFormatter().chunk(line, null, this.ignoreFormatting);\r\n var currentLineHeight = 0;\r\n var firstChunk = true;\r\n var skipTextChunks = false;\r\n // Create line element or grab it from cache\r\n var lineInfo = this.getLineInfo(i);\r\n if (lineInfo) {\r\n // Empty line\r\n lineInfo.text = \"\";\r\n lineInfo.element.textContent = \"\";\r\n }\r\n else {\r\n // Init new line info\r\n lineInfo = {\r\n \"text\": \"\",\r\n \"element\": this.getSVGLineElement(\"\", 0),\r\n \"complex\": false\r\n };\r\n // Create the line element\r\n //lineInfo.element = this.getSVGLineElement(\"\", 0);\r\n //lineElement = this.getSVGLineElement(\"\", 0);\r\n group.add(lineInfo.element);\r\n }\r\n lineInfo.element.removeAttr(\"display\");\r\n lineInfo.element.removeChildren(); // memory leak without this\r\n if (this.textPathElement) {\r\n lineInfo.element.add(this.textPathElement);\r\n }\r\n /*// @todo not needed anymore\r\n if (this.rtl) {\r\n chunks.reverse();\r\n }*/\r\n // Process each chunk\r\n for (var x = 0; x < chunks.length; x++) {\r\n // If there's more than one chunk, means the line is \"complex\"\r\n if (x) {\r\n lineInfo.complex = true;\r\n }\r\n // Get chunk\r\n var chunk = chunks[x];\r\n // Is this chunk format or text?\r\n if (chunk.type === \"format\") {\r\n // Log current format, so that we can apply it to multiple lines if\r\n // necessary\r\n currentFormat = chunk.text;\r\n }\r\n else {\r\n // It's text block\r\n // Need to skip?\r\n // We do this when truncating. We can't just simply go ahead and\r\n // abandon chunk processing as they might have formatting\r\n // instructions in them that are relevant for subsequent lines\r\n if (skipTextChunks) {\r\n continue;\r\n }\r\n // Add chunk to the current element\r\n //lineInfo.element.content += $utils.trim(getTextFormatter().format(currentFormat + chunk.text, output));\r\n lineInfo.text = chunk.text;\r\n lineInfo.style = getTextFormatter().translateStyleShortcuts(currentFormat);\r\n var tspan = this.getSvgElement(lineInfo.text, lineInfo.style);\r\n if (this.textPathElement) {\r\n this.textPathElement.add(tspan);\r\n }\r\n else {\r\n lineInfo.element.add(tspan);\r\n }\r\n this.getLineBBox(lineInfo);\r\n lineInfo.bbox.width = Math.ceil(lineInfo.bbox.width);\r\n // Updated current line height\r\n if (currentLineHeight < lineInfo.bbox.height) {\r\n currentLineHeight = lineInfo.bbox.height;\r\n }\r\n // Wrapping?\r\n if ((this.wrap || this.truncate) && (lineInfo.bbox.width > maxWidth)) {\r\n // Set oversized\r\n this.isOversized = true;\r\n // Take temporary measurements\r\n var lineText = lineInfo.element.textContent;\r\n var avgCharWidth = (lineInfo.bbox.width / lineText.length); // * .9;\r\n // Calculate average number of symbols / width\r\n var excessChars = $math.min(Math.ceil((lineInfo.bbox.width - maxWidth) / avgCharWidth), lineText.length);\r\n // Are we truncating or auto-wrapping text?\r\n if (this.truncate) {\r\n /**\r\n * Processing line truncation\r\n * With the addition of each text chunk we measure if current\r\n * line does not exceed maxWidth. If it does, we will stop\r\n * addition of further chunks as well as try to truncate\r\n * current or any number of previous chunks with an added\r\n * ellipsis\r\n */\r\n // Indicator whether we need to add ellipsis to the current\r\n // element, even if it fits. This is needed to indicate\r\n // whether we have already removed some subsequent chunks in\r\n // which case we need to add ellipsis.\r\n var addEllipsis = false;\r\n // Process each child in the temporary line, until the whole\r\n // line fits, preferably with an ellipsis\r\n // TODO use iterator instead\r\n var node_1 = lineInfo.element.node;\r\n if (node_1 && node_1.childNodes) {\r\n for (var e = lineInfo.element.node.childNodes.length - 1; e >= 0; e--) {\r\n // Get current element\r\n var node_2 = lineInfo.element.node.childNodes[e];\r\n // Add ellipsis only if previous chunk was removed in full\r\n // and this chunk already fits\r\n //if (addEllipsis && (bbox.width <= maxWidth)) {\r\n if (addEllipsis && (lineInfo.bbox.width <= maxWidth)) {\r\n // Add ellipsis\r\n node_2.textContent += \" \" + this.ellipsis;\r\n // Measure again (we need to make sure ellipsis fits)\r\n lineInfo.bbox = lineInfo.element.getBBox();\r\n lineInfo.bbox.width = Math.floor(lineInfo.bbox.width);\r\n // If it fits, we're done here\r\n // If it doesn't we continue rolling\r\n if (lineInfo.bbox.width <= maxWidth) {\r\n break;\r\n }\r\n }\r\n addEllipsis = false;\r\n // Get element text\r\n var elementText = node_2.textContent;\r\n // Calculate average number of symbols / width\r\n lineText = lineInfo.element.textContent;\r\n excessChars = $math.min(Math.ceil((lineInfo.bbox.width - maxWidth) / avgCharWidth), lineText.length);\r\n // Do this until we fit\r\n while ((lineInfo.bbox.width > maxWidth) && (excessChars <= lineText.length) && (excessChars > 0)) {\r\n // Calculate max available chars\r\n var maxChars = $math.max(lineText.length - excessChars - this.ellipsis.length, 1);\r\n // Is there anything left?\r\n if (maxChars <= 1) {\r\n // Nope, let's jump to the previous item\r\n // Set excess characters to zero so that this loop does\r\n // not repeat when it over\r\n excessChars = 0;\r\n // Add ellipsis to previous item\r\n // Subsequent iterations will check if the ellipsis fits\r\n if (e > 0) {\r\n // Indicating to add ellipsis to previous item\r\n addEllipsis = true;\r\n // Removing this node\r\n lineInfo.element.node.removeChild(node_2);\r\n }\r\n }\r\n // Truncate the text\r\n elementText = $utils.truncateWithEllipsis(elementText, maxChars, this.ellipsis, this.fullWords, this.rtl);\r\n if ((elementText.length > maxChars) && this.fullWords) {\r\n // Still too long?\r\n // Let's try truncating breaking words anyway\r\n elementText = $utils.truncateWithEllipsis(elementText, maxChars, this.ellipsis, false, this.rtl);\r\n }\r\n // Set truncated text\r\n node_2.textContent = elementText;\r\n // Measure again\r\n lineInfo.bbox = lineInfo.element.getBBox();\r\n lineInfo.bbox.width = Math.floor(lineInfo.bbox.width);\r\n // Increase excess characters count, just in case it still\r\n // doesn't fit and we have to go at it again\r\n excessChars = Math.ceil(excessChars * 1.1);\r\n }\r\n // Do not process further chunks\r\n skipTextChunks = true;\r\n }\r\n }\r\n }\r\n else {\r\n /**\r\n * Processign auto-wrap\r\n * In this case we're going to be adding text chunks until\r\n * they don't fit into current line. Once that happens we will\r\n * inject the rest of the chunks to the next line\r\n */\r\n // Get last node added and measure it\r\n var node_3 = lineInfo.element.node;\r\n if (node_3) {\r\n var lastNode = lineInfo.element.node.lastChild;\r\n // Init split lines\r\n var splitLines = void 0;\r\n while ((lineInfo.bbox.width > maxWidth) && (excessChars <= lineText.length) && (excessChars > 0)) {\r\n // Calculate max available chars\r\n var maxChars = $math.max(chunk.text.length - excessChars, 1);\r\n // Don't split the words mid-word if it's not the first chunk\r\n // in the line\r\n if (firstChunk) {\r\n // Split mid-word if necessary\r\n splitLines = $utils.splitTextByCharCount(chunk.text, maxChars, true, this.rtl);\r\n }\r\n else {\r\n // Don't split mid-word\r\n splitLines = $utils.splitTextByCharCount(chunk.text, maxChars, true, this.rtl);\r\n // Check if the first word is too long\r\n if ((splitLines[0].length > maxChars) || maxChars === 1) {\r\n // Yes - move the whole chunk to the next line\r\n // Remove the element we just added\r\n lineInfo.element.node.removeChild(lastNode);\r\n // Break out of the while on next cycle\r\n excessChars = 0;\r\n }\r\n }\r\n // Use the first line to update last item\r\n if (excessChars > 0) {\r\n lastNode.textContent = getTextFormatter().cleanUp($utils.trim(splitLines.shift()));\r\n }\r\n // Measure again, just in case\r\n lineInfo.bbox = lineInfo.element.getBBox();\r\n lineInfo.bbox.width = Math.floor(lineInfo.bbox.width);\r\n // Increase excess characters count, just in case it still\r\n // doesn't fit and we have to go at it again\r\n //excessChars = Math.ceil(excessChars * 1.05);\r\n excessChars++;\r\n }\r\n // Construct the rest of the line\r\n if (splitLines.length > 0) {\r\n var restOfLine = \"\";\r\n // Add leftovers from splitting the current chunk\r\n if ($type.hasValue(splitLines)) {\r\n if (this.rtl) {\r\n restOfLine += splitLines.join(\"\") + currentFormat;\r\n }\r\n else {\r\n restOfLine += currentFormat + splitLines.join(\"\").replace(/([\\[\\]]{1})/g, \"$1$1\");\r\n }\r\n }\r\n // Add the rest of the chunks\r\n for (var c = x + 1; c < chunks.length; c++) {\r\n if (chunks[c].type == \"value\") {\r\n // We're escaping single square brackets that were\r\n // cleaned up by chunk() back to double square brackets\r\n // so that they are not being treated as format on\r\n // next pass.\r\n restOfLine += chunks[c].text.replace(/([\\[\\]]{1})/g, \"$1$1\");\r\n }\r\n else {\r\n restOfLine += chunks[c].text;\r\n }\r\n }\r\n // Inject the rest of the lines as chunks for subsequent\r\n lines.splice(i + 1, 0, restOfLine);\r\n }\r\n // Skip processing the rest of the chunks\r\n skipTextChunks = true;\r\n }\r\n }\r\n }\r\n // Let's update the text's bbox with the line's one\r\n if (this.bbox.width < lineInfo.bbox.width) {\r\n this.bbox.width = lineInfo.bbox.width;\r\n }\r\n // commented to avoid bug (seen on sankey link) where text is incorrectly aligned\r\n //if (this.bbox.x > lineInfo.bbox.x) {\r\n //this.bbox.x = lineInfo.bbox.x;\r\n //}\r\n this.bbox.height = currentHeight + currentLineHeight;\r\n // Position current line\r\n if (!this.textPathElement) {\r\n lineInfo.element.attr({\r\n \"x\": \"0\",\r\n \"y\": currentHeight + currentLineHeight,\r\n \"dy\": $math.round((this.baseLineRatio * currentLineHeight), 3).toString()\r\n });\r\n }\r\n else {\r\n lineInfo.element.attr({\r\n \"dy\": -this.paddingBottom.toString()\r\n });\r\n }\r\n firstChunk = false;\r\n }\r\n }\r\n // Trim the last item\r\n var node = lineInfo.element.node;\r\n if (node) {\r\n var lastNode = node.lastChild;\r\n if (lastNode) {\r\n lastNode.textContent = this.rtl ?\r\n $utils.ltrim(lastNode.textContent) :\r\n $utils.rtrim(lastNode.textContent);\r\n }\r\n }\r\n // Increment collective height\r\n currentHeight += currentLineHeight;\r\n // Save line cache\r\n this.addLineInfo(lineInfo, i);\r\n }\r\n // Check if maybe we need to hide the whole label if it doesn't fit\r\n this.maybeHideOversized();\r\n this.measureFailed = false;\r\n if (this.bbox.width == 0 || this.bbox.height == 0) {\r\n this.measureFailed = true;\r\n }\r\n // Updated measured dims\r\n this._measuredWidth = $math.round($math.max(this.bbox.width, this.pixelWidth - this.pixelPaddingLeft - this.pixelPaddingRight));\r\n this._measuredHeight = $math.round($math.max(this.bbox.height, this.pixelHeight - this.pixelPaddingTop - this.pixelPaddingBottom));\r\n // Align the lines\r\n this.alignSVGText();\r\n this.bbox.width = this._measuredWidth;\r\n this.bbox.height = this._measuredHeight;\r\n if (oldH != this._measuredHeight || oldW != this._measuredWidth) {\r\n this.dispatch(\"transformed\");\r\n }\r\n this.hideUnused(lines.length);\r\n }\r\n else {\r\n /**\r\n * HTML\r\n */\r\n this.element.removeAttr(\"display\");\r\n this.resetBBox();\r\n // Clear the element\r\n var group = this.element;\r\n group.removeChildren();\r\n // Create a ForeignObject to use as HTML container\r\n var fo = this.paper.foreignObject();\r\n group.add(fo);\r\n // Set widths on foreignObject so that autosizing measurements work\r\n // This will bet reset to actual content width/height\r\n if (this.maxWidth) {\r\n fo.attr({\r\n width: this.maxWidth - this.pixelPaddingLeft - this.pixelPaddingRight\r\n });\r\n }\r\n if (this.maxHeight) {\r\n fo.attr({\r\n height: this.maxHeight - this.pixelPaddingTop - this.pixelPaddingBottom\r\n });\r\n }\r\n // Create line element\r\n //let lineElement: HTMLElement = this.getHTMLLineElement(getTextFormatter().format(this.html, output));\r\n var lineElement = this.getHTMLLineElement(text);\r\n fo.node.appendChild(lineElement);\r\n // Temporarily set to inline-block so we can measure real width and height\r\n lineElement.style.display = \"inline-block\";\r\n var clientWidth = lineElement.clientWidth;\r\n var clientHeight = lineElement.clientHeight;\r\n lineElement.style.display = \"block\";\r\n this._bbox = {\r\n x: 0,\r\n y: 0,\r\n width: clientWidth,\r\n height: clientHeight\r\n };\r\n // Set exact dimensions of foreignObject so it is sized exactly as\r\n // the content within (add one pixel to width so it does not wrap)\r\n fo.attr({\r\n width: clientWidth + 1,\r\n height: clientHeight\r\n });\r\n // Check if maybe we need to hide the whole label if it doesn't fit\r\n this.maybeHideOversized();\r\n // Set measurements and update bbox\r\n this._measuredWidth = $math.max(this.bbox.width, this.pixelWidth - this.pixelPaddingLeft - this.pixelPaddingRight);\r\n this._measuredHeight = $math.max(this.bbox.height, this.pixelHeight - this.pixelPaddingTop - this.pixelPaddingBottom);\r\n this.bbox.width = this._measuredWidth;\r\n this.bbox.height = this._measuredHeight;\r\n // Don't let labels bleed out of the alotted area\r\n if (this.truncate) {\r\n lineElement.style.overflow = \"hidden\";\r\n }\r\n if ((clientWidth > maxWidth) || (clientHeight > maxHeight)) {\r\n this.isOversized = true;\r\n }\r\n }\r\n // Set applicable styles\r\n this.setStyles();\r\n this.updateCenter();\r\n this.updateBackground();\r\n if (display == \"none\") {\r\n this.group.attr({ display: \"none\" });\r\n }\r\n if (this.pathElement) {\r\n this.paper.appendDef(this.pathElement);\r\n }\r\n };\r\n /**\r\n * Hides element if it does not fit into available space\r\n */\r\n Label.prototype.maybeHideOversized = function () {\r\n if (this.hideOversized) {\r\n if ((this.availableWidth < this.bbox.width) || (this.availableHeight < this.bbox.height)) {\r\n this.element.attr({ display: \"none\" });\r\n this.isOversized = true;\r\n }\r\n else {\r\n this.element.removeAttr(\"display\");\r\n this.isOversized = false;\r\n }\r\n }\r\n };\r\n /**\r\n * Aligns the lines horizontally ant vertically, based on properties.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Label.prototype.alignSVGText = function () {\r\n // Get Group\r\n var group = this.element;\r\n var children = group.node.children || group.node.childNodes;\r\n // Is there anything to align?\r\n if (!children || (children && children.length == 0)) {\r\n return;\r\n }\r\n var width = this._measuredWidth;\r\n var height = this._measuredHeight;\r\n // TODO maybe these aren't needed ?\r\n $utils.used(this.pixelPaddingLeft);\r\n $utils.used(this.pixelPaddingRight);\r\n $utils.used(this.pixelPaddingTop);\r\n $utils.used(this.pixelPaddingBottom);\r\n if (this.rtl) {\r\n group.attr({\r\n \"direction\": \"rtl\"\r\n });\r\n }\r\n else {\r\n group.removeAttr(\"direction\");\r\n }\r\n // Process each line\r\n //$iter.each(group.children.backwards().iterator(), (element) => {\r\n for (var i = children.length - 1; i >= 0; i--) {\r\n // Align horizontally\r\n // Since we are using `text-anchor` for horizontal alignment, all we need\r\n // to do here is move the `x` position\r\n var node = children[i];\r\n node.setAttribute(\"text-anchor\", this.textAlign);\r\n if (this.textPathElement) {\r\n node.removeAttribute(\"x\");\r\n node.removeAttribute(\"y\");\r\n }\r\n else {\r\n switch (this.textAlign) {\r\n case \"middle\":\r\n node.setAttribute(\"x\", (width / 2).toString() + \"px\");\r\n break;\r\n case \"end\":\r\n if (this.rtl) {\r\n }\r\n else {\r\n node.setAttribute(\"x\", width.toString());\r\n }\r\n break;\r\n default:\r\n if (this.rtl) {\r\n node.setAttribute(\"x\", width.toString());\r\n }\r\n else {\r\n node.removeAttribute(\"text-anchor\");\r\n }\r\n break;\r\n }\r\n var y = $type.toNumber(node.getAttribute(\"y\"));\r\n switch (this.textValign) {\r\n case \"middle\":\r\n node.setAttribute(\"y\", ((y || 0) + (height - this.bbox.height) / 2).toString());\r\n break;\r\n case \"bottom\":\r\n node.setAttribute(\"y\", ((y || 0) + height - this.bbox.height).toString());\r\n break;\r\n default:\r\n node.setAttribute(\"y\", (y || 0).toString());\r\n break;\r\n }\r\n }\r\n }\r\n };\r\n /**\r\n * Produces an SVG line element with formatted text.\r\n *\r\n * @ignore Exclude from docs\r\n * @param text Text to wrap into line\r\n * @param y Current line vertical position\r\n * @return A DOM element\r\n * @todo Implement HTML support\r\n */\r\n Label.prototype.getSVGLineElement = function (text, y) {\r\n // Create a <text> node and set text\r\n var element = this.paper.addGroup(\"text\");\r\n element.textContent = text;\r\n // Set parameters\r\n element.attr({\r\n \"x\": \"0\"\r\n //\"alignment-baseline\": \"hanging\",\r\n //\"baseline-shift\": \"-20%\",\r\n //\"text-anchor\": \"center\"\r\n });\r\n // Set `y` position\r\n if ($type.hasValue(y)) {\r\n element.attr({\r\n \"y\": y.toString()\r\n });\r\n }\r\n // Don't let labels blled out of the alotted area\r\n if (this.truncate || this.wrap) {\r\n element.attr({ \"overflow\": \"hidden\" });\r\n }\r\n // Add RTL?\r\n // This has now been moved to this.alignSVGText()\r\n // if (this.rtl) {\r\n // \telement.attr({\r\n // \t\t\"direction\": \"rtl\",\r\n // \t\t//\"unicode-bidi\": \"bidi-override\"\r\n // \t});\r\n // }\r\n return element;\r\n };\r\n Object.defineProperty(Label.prototype, \"rtl\", {\r\n /**\r\n * @return RTL?\r\n */\r\n get: function () {\r\n if ($type.hasValue(this._rtl)) {\r\n return this._rtl;\r\n }\r\n else if (this._topParent) {\r\n return this._topParent.rtl;\r\n }\r\n return false;\r\n },\r\n /**\r\n * An RTL (right-to-left) setting.\r\n *\r\n * RTL may affect alignment, text, and other visual properties.\r\n *\r\n * If you set this on a top-level chart object, it will be used for all\r\n * child elements, e.g. labels, unless they have their own `rtl` setting\r\n * set directly on them.\r\n *\r\n * @param value `true` for to use RTL\r\n */\r\n set: function (value) {\r\n value = $type.toBoolean(value);\r\n this._rtl = value;\r\n if (this.element) {\r\n this.alignSVGText();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Resets cached BBox.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Label.prototype.resetBBox = function () {\r\n this._bbox = { x: 0, y: 0, width: 0, height: 0 };\r\n };\r\n /**\r\n * Creates and returns an HTML line element (`<div>`).\r\n *\r\n * @ignore Exclude from docs\r\n * @param text Text to add\r\n * @return `<div>` element reference\r\n */\r\n Label.prototype.getHTMLLineElement = function (text) {\r\n // Create the <div> element\r\n var div = document.createElement(\"div\");\r\n div.innerHTML = text;\r\n // Set text alignment\r\n switch (this.textAlign) {\r\n case \"middle\":\r\n div.style.textAlign = \"center\";\r\n break;\r\n case \"end\":\r\n div.style.textAlign = \"right\";\r\n break;\r\n }\r\n // Disable or enable wrapping\r\n if (this.wrap) {\r\n div.style.wordWrap = \"break-word\";\r\n }\r\n else {\r\n div.style.whiteSpace = \"nowrap\";\r\n }\r\n // Don't let labels bleed out of the alotted area\r\n // Moved to `draw()` because setting \"hidden\" kills all measuring\r\n /*if (this.truncate) {\r\n div.style.overflow = \"hidden\";\r\n }*/\r\n // Set RTL-related styles\r\n if (this.rtl) {\r\n div.style.direction = \"rtl\";\r\n //div.style.unicodeBidi = \"bidi-override\";\r\n }\r\n // Translate some of the SVG styles into CSS\r\n if ($type.hasValue(this.fill)) {\r\n div.style.color = this.fill.toString();\r\n }\r\n return div;\r\n };\r\n /**\r\n * Applies specific styles to text to make it not selectable, unless it is\r\n * explicitly set as `selectable`.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Set styles via AMElement\r\n */\r\n Label.prototype.setStyles = function () {\r\n var group = this.element;\r\n if (!this.selectable || this.draggable || this.resizable || this.swipeable) {\r\n group.addStyle({\r\n \"webkitUserSelect\": \"none\",\r\n \"msUserSelect\": \"none\"\r\n });\r\n }\r\n else if (this.selectable) {\r\n group.removeStyle(\"webkitUserSelect\");\r\n group.removeStyle(\"msUserSelect\");\r\n }\r\n };\r\n /**\r\n * Hides unused lines\r\n */\r\n Label.prototype.hideUnused = function (index) {\r\n this.initLineCache();\r\n var lines = this.getCache(\"lineInfo\");\r\n if (lines.length >= index) {\r\n for (var i = index; i < lines.length; i++) {\r\n var line = lines[i];\r\n if (line && line.element) {\r\n line.element.attr({ \"display\": \"none\" });\r\n }\r\n }\r\n }\r\n };\r\n Object.defineProperty(Label.prototype, \"text\", {\r\n /**\r\n * @return SVG text\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"text\");\r\n },\r\n /**\r\n * An SVG text.\r\n *\r\n * Please note that setting `html` will override this setting if browser\r\n * supports `foreignObject` in SGV, such as most modern browsers excluding\r\n * IEs.\r\n *\r\n * @param value SVG Text\r\n */\r\n set: function (value) {\r\n //this.setPropertyValue(\"html\", undefined);\r\n this.setPropertyValue(\"text\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Label.prototype, \"path\", {\r\n /**\r\n * @return Path\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"path\");\r\n },\r\n /**\r\n * An SVG path string to position text along. If set, the text will follow\r\n * the curvature of the path.\r\n *\r\n * Location along the path can be set using `locationOnPath`.\r\n *\r\n * IMPORTANT: Only SVG text can be put on path. If you are using HTML text\r\n * this setting will be ignored.\r\n *\r\n * @since 4.1.2\r\n * @param value Path\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"path\", value, true)) {\r\n if (this.pathElement) {\r\n this.pathElement.dispose();\r\n }\r\n if (this.textPathElement) {\r\n this.textPathElement.dispose();\r\n }\r\n this.pathElement = this.paper.add(\"path\");\r\n this.pathElement.attr({ \"d\": value });\r\n this.pathElement.attr({ \"id\": \"text-path-\" + this.uid });\r\n this._disposers.push(this.pathElement);\r\n this.textPathElement = this.paper.addGroup(\"textPath\");\r\n this.textPathElement.attrNS($dom.XLINK, \"xlink:href\", \"#text-path-\" + this.uid);\r\n // TODO remove after https://bugzilla.mozilla.org/show_bug.cgi?id=455986 is fixed\r\n this.textPathElement.attr({ \"path\": value });\r\n this._disposers.push(this.textPathElement);\r\n this.hardInvalidate();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Label.prototype, \"locationOnPath\", {\r\n /**\r\n * @return Relatvie location on path\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"locationOnPath\");\r\n },\r\n /**\r\n * Relative label location on `path`. Value range is from 0 (beginning)\r\n * to 1 (end).\r\n *\r\n * Works only if you set `path` setting to an SVG path.\r\n *\r\n * @since 4.1.2\r\n * @default 0\r\n * @param value Relatvie location on path\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"locationOnPath\", value);\r\n if (this.textPathElement) {\r\n this.textPathElement.attr({ \"startOffset\": (value * 100) + \"%\" });\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Label.prototype, \"baseLineRatio\", {\r\n /**\r\n * @return Base line ratio\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"baseLineRatio\");\r\n },\r\n /**\r\n * A ratio to calculate text baseline. Ralative distance from the bottom of\r\n * the label.\r\n *\r\n * @since 4.4.2\r\n * @default -0.27\r\n * @param value Base line ratio\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"baseLineRatio\", value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Label.prototype, \"wrap\", {\r\n /**\r\n * @return Auto-wrap enabled or not\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"wrap\");\r\n },\r\n /**\r\n * Enables or disables autowrapping of text.\r\n *\r\n * @param value Auto-wrapping enabled\r\n */\r\n set: function (value) {\r\n this.resetBBox();\r\n this.setPropertyValue(\"wrap\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Label.prototype, \"truncate\", {\r\n /**\r\n * @return Truncate text?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"truncate\");\r\n },\r\n /**\r\n * Indicates if text lines need to be truncated if they do not fit, using\r\n * configurable `ellipsis` string.\r\n *\r\n * `truncate` overrides `wrap` if both are set to `true`.\r\n *\r\n * NOTE: For HTML text, this setting **won't** trigger a parser and actual\r\n * line truncation with ellipsis. It will just hide everything that goes\r\n * outside the label.\r\n *\r\n * @param value trincate text?\r\n */\r\n set: function (value) {\r\n this.resetBBox();\r\n this.setPropertyValue(\"truncate\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Label.prototype, \"fullWords\", {\r\n /**\r\n * @return Truncate on full words?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"fullWords\");\r\n },\r\n /**\r\n * If `truncate` is enabled, should Label try to break only on full words\r\n * (`true`), or whenever needed, including middle of the word. (`false`)\r\n *\r\n * @default true\r\n * @param value Truncate on full words?\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"fullWords\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Label.prototype, \"ellipsis\", {\r\n /**\r\n * @return Ellipsis string\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"ellipsis\");\r\n },\r\n /**\r\n * Ellipsis character to use if `truncate` is enabled.\r\n *\r\n * @param value Ellipsis string\r\n * @default \"...\"\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"ellipsis\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Label.prototype, \"selectable\", {\r\n /**\r\n * @return Text selectable?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"selectable\");\r\n },\r\n /**\r\n * Forces the text to be selectable. This setting will be ignored if the\r\n * object has some kind of interaction attached to it, such as it is\r\n * `draggable`, `swipeable`, `resizable`.\r\n *\r\n * @param value Text selectable?\r\n * @default false\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"selectable\", value, true);\r\n this.setStyles();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Label.prototype, \"textAlign\", {\r\n /**\r\n * @return Alignment\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"textAlign\");\r\n },\r\n /**\r\n * Horizontal text alignment.\r\n *\r\n * Available choices:\r\n * * \"start\"\r\n * * \"middle\"\r\n * * \"end\"\r\n *\r\n * @param value Alignment\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"textAlign\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Label.prototype, \"textValign\", {\r\n /**\r\n * @ignore Exclude from docs (not used)\r\n * @return Alignment\r\n * @deprecated\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"textValign\");\r\n },\r\n /**\r\n * Vertical text alignment.\r\n *\r\n * @ignore Exclude from docs (not used)\r\n * @param value Alignment\r\n * @deprecated\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"textValign\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Label.prototype, \"html\", {\r\n /**\r\n * @return HTML content\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"html\");\r\n },\r\n /**\r\n * Raw HTML to be used as text.\r\n *\r\n * NOTE: HTML text is subject to browser support. It relies on browsers\r\n * supporting SVG `foreignObject` nodes. Some browsers (read IEs) do not\r\n * support it. On those browsers, the text will fall back to basic SVG text,\r\n * striping out all HTML markup and styling that goes with it.\r\n *\r\n * For more information about `foreignObject` and its browser compatibility\r\n * refer to [this page](https://developer.mozilla.org/en/docs/Web/SVG/Element/foreignObject#Browser_compatibility).\r\n *\r\n * @param value HTML text\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"html\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Label.prototype, \"hideOversized\", {\r\n /**\r\n * @return Hide if text does not fit?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"hideOversized\");\r\n },\r\n /**\r\n * Indicates whether the whole text should be hidden if it does not fit into\r\n * its allotted space.\r\n *\r\n * @param value Hide if text does not fit?\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"hideOversized\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Label.prototype, \"ignoreFormatting\", {\r\n /**\r\n * @return Ignore formatting?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"ignoreFormatting\");\r\n },\r\n /**\r\n * If set to `true` square-bracket formatting blocks will be treated as\r\n * regular text.\r\n *\r\n * @default false\r\n * @param value Ignore formatting?\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"ignoreFormatting\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Override `mesaureElement` so it does not get measure again, because\r\n * internal `_bbox` is being updated by measuring routines in Text itself.\r\n */\r\n Label.prototype.measureElement = function () { };\r\n /**\r\n * Returns information about a line element.\r\n *\r\n * @ignore Exclude from docs\r\n * @param index Line index\r\n * @return Line info object\r\n */\r\n Label.prototype.getLineInfo = function (index) {\r\n this.initLineCache();\r\n var lines = this.getCache(\"lineInfo\");\r\n return lines.length > index ? lines[index] : undefined;\r\n };\r\n /**\r\n * Adds a line to line info cache.\r\n *\r\n * @ignore Exclude from docs\r\n * @param line Line info object\r\n * @param index Insert at specified index\r\n */\r\n Label.prototype.addLineInfo = function (line, index) {\r\n this.initLineCache();\r\n this.getCache(\"lineInfo\")[index] = line;\r\n };\r\n /**\r\n * Checks if line cache is initialized and initializes it.\r\n */\r\n Label.prototype.initLineCache = function () {\r\n if (!$type.hasValue(this.getCache(\"lineInfo\"))) {\r\n this.setCache(\"lineInfo\", [], 0);\r\n }\r\n };\r\n /**\r\n * Sets a [[DataItem]] to use for populating dynamic sections of the text.\r\n *\r\n * Check the description for [[Text]] class, for data binding.\r\n *\r\n * @param dataItem Data item\r\n */\r\n Label.prototype.setDataItem = function (dataItem) {\r\n if (this._sourceDataItemEvents) {\r\n this._sourceDataItemEvents.dispose();\r\n }\r\n if (dataItem) {\r\n this._sourceDataItemEvents = new MultiDisposer([\r\n dataItem.events.on(\"valuechanged\", this.invalidate, this, false),\r\n dataItem.events.on(\"workingvaluechanged\", this.invalidate, this, false),\r\n dataItem.events.on(\"calculatedvaluechanged\", this.invalidate, this, false),\r\n dataItem.events.on(\"propertychanged\", this.invalidate, this, false)\r\n ]);\r\n }\r\n _super.prototype.setDataItem.call(this, dataItem);\r\n };\r\n Object.defineProperty(Label.prototype, \"availableWidth\", {\r\n /**\r\n * Returns available horizontal space.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Available width (px)\r\n */\r\n get: function () {\r\n return $type.hasValue(this.maxWidth) ? this.maxWidth : this.pixelWidth;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Label.prototype, \"availableHeight\", {\r\n /**\r\n * Returns available vertical space.\r\n *\r\n * @return Available height (px)\r\n */\r\n get: function () {\r\n return $type.hasValue(this.maxHeight) ? this.maxHeight : this.pixelHeight;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n // temp, replacing textFormatter method\r\n Label.prototype.getSvgElement = function (text, style) {\r\n var element = this.paper.add(\"tspan\");\r\n element.textContent = text;\r\n if (style) {\r\n element.node.setAttribute(\"style\", style);\r\n }\r\n return element;\r\n };\r\n /**\r\n * Invalidates the whole element, including layout AND all its child\r\n * elements.\r\n */\r\n Label.prototype.deepInvalidate = function () {\r\n _super.prototype.deepInvalidate.call(this);\r\n this.hardInvalidate();\r\n };\r\n Object.defineProperty(Label.prototype, \"readerTitle\", {\r\n /**\r\n * @return Title\r\n */\r\n get: function () {\r\n var title = this.getPropertyValue(\"readerTitle\");\r\n if (!title) {\r\n title = this.populateString($utils.plainText($utils.isNotEmpty(this.html)\r\n ? this.html\r\n : this.text));\r\n }\r\n else if (this.dataItem) {\r\n title = this.populateString(title);\r\n }\r\n return title;\r\n },\r\n /**\r\n * Screen reader title of the element.\r\n *\r\n * @param value Title\r\n */\r\n set: function (value) {\r\n value = $type.toText(value);\r\n if (this.setPropertyValue(\"readerTitle\", value)) {\r\n this.applyAccessibility();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return Label;\r\n}(Container));\r\nexport { Label };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Label\"] = Label;\r\n/**\r\n * Add default responsive rules\r\n */\r\n/**\r\n * Hide labels added directly to chart, like titles if chart is short.\r\n */\r\ndefaultRules.push({\r\n relevant: ResponsiveBreakpoints.heightXS,\r\n state: function (target, stateId) {\r\n if (target instanceof Label && target.parent && target.parent.isBaseSprite) {\r\n var state = target.states.create(stateId);\r\n state.properties.disabled = true;\r\n return state;\r\n }\r\n return null;\r\n }\r\n});\r\n","/**\r\n * Line drawing functionality.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Sprite } from \"../Sprite\";\r\nimport { color } from \"../utils/Color\";\r\nimport { LinearGradient } from \"../rendering/fills/LinearGradient\";\r\nimport { registry } from \"../Registry\";\r\nimport * as $type from \"../utils/Type\";\r\nimport * as $math from \"../utils/Math\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Draws a line.\r\n *\r\n * @see {@link ILineEvents} for a list of available events\r\n * @see {@link ILineAdapters} for a list of available Adapters\r\n */\r\nvar Line = /** @class */ (function (_super) {\r\n __extends(Line, _super);\r\n /**\r\n * Constructor\r\n */\r\n function Line() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"Line\";\r\n _this.element = _this.paper.add(\"line\");\r\n _this.fill = color(); //\"none\";\r\n _this.x1 = 0;\r\n _this.y1 = 0;\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Draws the line.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Line.prototype.draw = function () {\r\n _super.prototype.draw.call(this);\r\n if (this.x1 == this.x2 || this.y1 == this.y2) {\r\n this.pixelPerfect = true;\r\n }\r\n else {\r\n this.pixelPerfect = false;\r\n }\r\n this.x1 = this.x1;\r\n this.x2 = this.x2;\r\n this.y1 = this.y1;\r\n this.y2 = this.y2;\r\n };\r\n Object.defineProperty(Line.prototype, \"x1\", {\r\n /**\r\n * @return X\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"x1\");\r\n },\r\n /**\r\n * X coordinate of first end.\r\n *\r\n * @param value X\r\n */\r\n set: function (value) {\r\n if (!$type.isNumber(value)) {\r\n value = 0;\r\n }\r\n var delta = 0;\r\n if (this.pixelPerfect && this.stroke instanceof LinearGradient) {\r\n delta = 0.00001;\r\n }\r\n this.setPropertyValue(\"x1\", value, true);\r\n this.element.attr({ \"x1\": value + delta });\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Line.prototype, \"x2\", {\r\n /**\r\n * @return X\r\n */\r\n get: function () {\r\n var value = this.getPropertyValue(\"x2\");\r\n if (!$type.isNumber(value)) {\r\n value = this.pixelWidth;\r\n }\r\n return value;\r\n },\r\n /**\r\n * X coordinate of second end.\r\n *\r\n * @param value X\r\n */\r\n set: function (value) {\r\n if (!$type.isNumber(value)) {\r\n value = 0;\r\n }\r\n this.setPropertyValue(\"x2\", value, true);\r\n this.element.attr({ \"x2\": value });\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Line.prototype, \"y1\", {\r\n /**\r\n * @return Y\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"y1\");\r\n },\r\n /**\r\n * Y coordinate of first end.\r\n *\r\n * @param value Y\r\n */\r\n set: function (value) {\r\n if (!$type.isNumber(value)) {\r\n value = 0;\r\n }\r\n var delta = 0;\r\n if (this.pixelPerfect && this.stroke instanceof LinearGradient) {\r\n delta = 0.00001;\r\n }\r\n this.setPropertyValue(\"y1\", value, true);\r\n this.element.attr({ \"y1\": value + delta });\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Line.prototype, \"y2\", {\r\n /**\r\n * @return Y\r\n */\r\n get: function () {\r\n var value = this.getPropertyValue(\"y2\");\r\n if (!$type.isNumber(value)) {\r\n value = this.pixelHeight;\r\n }\r\n return value;\r\n },\r\n /**\r\n * Y coordinate of second end.\r\n *\r\n * @param value Y\r\n */\r\n set: function (value) {\r\n if (!$type.isNumber(value)) {\r\n value = 0;\r\n }\r\n this.setPropertyValue(\"y2\", value, true);\r\n this.element.attr({ \"y2\": value });\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Converts relative position along the line (0-1) into pixel coordinates.\r\n *\r\n * @param position Position (0-1)\r\n * @return Coordinates\r\n */\r\n Line.prototype.positionToPoint = function (position) {\r\n var point1 = { x: this.x1, y: this.y1 };\r\n var point2 = { x: this.x2, y: this.y2 };\r\n var point = $math.getMidPoint(point1, point2, position);\r\n var angle = $math.getAngle(point1, point2);\r\n return { x: point.x, y: point.y, angle: angle };\r\n };\r\n return Line;\r\n}(Sprite));\r\nexport { Line };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Line\"] = Line;\r\n","/**\r\n * Modal class is used to display information over chart area.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Popup } from \"./Popup\";\r\nimport { Adapter } from \"../utils/Adapter\";\r\n/**\r\n * Shows an HTML modal which covers window or a chart area.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/popups-and-modals/} For examples and docs on Popups and Modals.\r\n */\r\nvar Modal = /** @class */ (function (_super) {\r\n __extends(Modal, _super);\r\n /**\r\n * Constructor\r\n */\r\n function Modal() {\r\n var _this = _super.call(this) || this;\r\n /**\r\n * Adapter.\r\n */\r\n _this.adapter = new Adapter(_this);\r\n _this.className = \"Modal\";\r\n _this.showCurtain = true;\r\n _this.draggable = false;\r\n return _this;\r\n }\r\n return Modal;\r\n}(Popup));\r\nexport { Modal };\r\n","/**\r\n * Play button functionality.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Button } from \"./Button\";\r\nimport { RoundedRectangle } from \"./RoundedRectangle\";\r\nimport { registry } from \"../Registry\";\r\nimport { InterfaceColorSet } from \"../../core/utils/InterfaceColorSet\";\r\nimport { Triangle } from \"./Triangle\";\r\nimport * as $type from \"../../core/utils/Type\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Creates a zoom out button.\r\n *\r\n * @see {@link IPlayButtonEvents} for a list of available events\r\n * @see {@link IPlayButtonAdapters} for a list of available Adapters\r\n */\r\nvar PlayButton = /** @class */ (function (_super) {\r\n __extends(PlayButton, _super);\r\n /**\r\n * Constructor\r\n */\r\n function PlayButton() {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n _this.className = \"PlayButton\";\r\n _this.padding(12, 12, 12, 12);\r\n _this.showSystemTooltip = true;\r\n var interfaceColors = new InterfaceColorSet();\r\n var background = _this.background;\r\n background.cornerRadius(25, 25, 25, 25);\r\n background.fill = interfaceColors.getFor(\"primaryButton\");\r\n background.stroke = interfaceColors.getFor(\"primaryButtonStroke\");\r\n background.strokeOpacity = 0;\r\n background.states.getKey(\"hover\").properties.fill = interfaceColors.getFor(\"primaryButtonHover\");\r\n background.states.getKey(\"down\").properties.fill = interfaceColors.getFor(\"primaryButtonActive\");\r\n // Create a play icon\r\n var playIcon = new Triangle();\r\n playIcon.direction = \"right\";\r\n playIcon.width = 9;\r\n playIcon.height = 11;\r\n playIcon.marginLeft = 1;\r\n playIcon.marginRight = 1;\r\n playIcon.horizontalCenter = \"middle\";\r\n playIcon.verticalCenter = \"middle\";\r\n playIcon.stroke = interfaceColors.getFor(\"primaryButtonText\");\r\n playIcon.fill = playIcon.stroke;\r\n _this.icon = playIcon;\r\n // Create a play icon\r\n var stopIcon = new RoundedRectangle();\r\n stopIcon.width = 11;\r\n stopIcon.height = 11;\r\n stopIcon.horizontalCenter = \"middle\";\r\n stopIcon.verticalCenter = \"middle\";\r\n stopIcon.cornerRadius(0, 0, 0, 0);\r\n stopIcon.stroke = interfaceColors.getFor(\"primaryButtonText\");\r\n stopIcon.fill = playIcon.stroke;\r\n _this.togglable = true;\r\n var activeState = _this.states.create(\"active\");\r\n activeState.transitionDuration = 0;\r\n activeState.properties.icon = stopIcon;\r\n _this.defaultState.transitionDuration = 0;\r\n // Apply theme\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Sets defaults that instantiate some objects that rely on parent, so they\r\n * cannot be set in constructor.\r\n */\r\n PlayButton.prototype.applyInternalDefaults = function () {\r\n _super.prototype.applyInternalDefaults.call(this);\r\n if (!$type.hasValue(this.readerTitle)) {\r\n this.readerTitle = this.language.translate(\"Play\");\r\n }\r\n };\r\n return PlayButton;\r\n}(Button));\r\nexport { PlayButton };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"PlayButton\"] = PlayButton;\r\n","/**\r\n * Pointed rectangle module.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { PointedShape } from \"./PointedShape\";\r\nimport * as $math from \"../utils/Math\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Draws a rectangle with a pointer.\r\n *\r\n * @see {@link IPointedRectangleEvents} for a list of available events\r\n * @see {@link IPointedRectangleAdapters} for a list of available Adapters\r\n */\r\nvar PointedRectangle = /** @class */ (function (_super) {\r\n __extends(PointedRectangle, _super);\r\n /**\r\n * Constructor\r\n */\r\n function PointedRectangle() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"PointedRectangle\";\r\n _this.element = _this.paper.add(\"path\");\r\n _this.cornerRadius = 6;\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Draws the element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n PointedRectangle.prototype.draw = function () {\r\n _super.prototype.draw.call(this);\r\n var cr = this.cornerRadius;\r\n var w = this.innerWidth;\r\n var h = this.innerHeight;\r\n if (w > 0 && h > 0) {\r\n var x = this.pointerX;\r\n var y = this.pointerY;\r\n var bwh = this.pointerBaseWidth / 2;\r\n var maxcr = $math.min(w / 2, h / 2);\r\n var crtl = $math.fitToRange(cr, 0, maxcr);\r\n var crtr = $math.fitToRange(cr, 0, maxcr);\r\n var crbr = $math.fitToRange(cr, 0, maxcr);\r\n var crbl = $math.fitToRange(cr, 0, maxcr);\r\n // corner coordinates\r\n // top left\r\n var xtl = 0;\r\n var ytl = 0;\r\n // top right\r\n var xtr = w;\r\n var ytr = 0;\r\n // bottom right\r\n var xbr = w;\r\n var ybr = h;\r\n // bottom left\r\n var xbl = 0;\r\n var ybl = h;\r\n var lineT = void 0;\r\n var lineR = void 0;\r\n var lineB = void 0;\r\n var lineL = void 0;\r\n // find stem base side: http://$math.stackexchange.com/questions/274712/calculate-on-which-side-of-straign-line-is-dot-located\r\n // d=(x−x1)(y2−y1)−(y−y1)(x2−x1)\r\n var d1 = (x - xtl) * (ybr - ytl) - (y - ytl) * (xbr - xtl);\r\n var d2 = (x - xbl) * (ytr - ybl) - (y - ybl) * (xtr - xbl);\r\n // top\r\n if (d1 > 0 && d2 > 0) {\r\n var stemX = $math.fitToRange(x, crtl + bwh, w - bwh - crtr);\r\n y = $math.fitToRange(y, -Infinity, 0);\r\n lineT = \"M\" + crtl + \",0 L\" + (stemX - bwh) + \",0 L\" + x + \",\" + y + \" L\" + (stemX + bwh) + \",0 L\" + (w - crtr) + \",0\";\r\n }\r\n else {\r\n lineT = \"M\" + crtl + \",0 L\" + (w - crtr) + \",0\";\r\n }\r\n // bottom\r\n if (d1 < 0 && d2 < 0) {\r\n var stemX = $math.fitToRange(x, crbl + bwh, w - bwh - crbr);\r\n y = $math.fitToRange(y, h, Infinity);\r\n lineB = \" L\" + (w - crbr) + \",\" + h + \" L\" + (stemX + bwh) + \",\" + h + \" L\" + x + \",\" + y + \" L\" + (stemX - bwh) + \",\" + h + \" L\" + crbl + \",\" + h;\r\n }\r\n else {\r\n lineB = \" L\" + crbl + \",\" + h;\r\n }\r\n // left\r\n if (d1 < 0 && d2 > 0) {\r\n var stemY = $math.fitToRange(y, crtl + bwh, h - crbl - bwh);\r\n x = $math.fitToRange(x, -Infinity, 0);\r\n lineL = \" L0,\" + (h - crbl) + \" L0,\" + (stemY + bwh) + \" L\" + x + \",\" + y + \" L0,\" + (stemY - bwh) + \" L0,\" + crtl;\r\n }\r\n else {\r\n lineL = \" L0,\" + crtl;\r\n }\r\n // right\r\n if (d1 > 0 && d2 < 0) {\r\n var stemY = $math.fitToRange(y, crtr + bwh, h - bwh - crbr);\r\n x = $math.fitToRange(x, w, Infinity);\r\n lineR = \" L\" + w + \",\" + crtr + \" L\" + w + \",\" + (stemY - bwh) + \" L\" + x + \",\" + y + \" L\" + w + \",\" + (stemY + bwh) + \" L\" + w + \",\" + (h - crbr);\r\n }\r\n else {\r\n lineR = \" L\" + w + \",\" + (h - crbr);\r\n }\r\n var arcTR = \" a\" + crtr + \",\" + crtr + \" 0 0 1 \" + crtr + \",\" + crtr;\r\n var arcBR = \" a\" + crbr + \",\" + crbr + \" 0 0 1 -\" + crbr + \",\" + crbr;\r\n var arcBL = \" a\" + crbl + \",\" + crbl + \" 0 0 1 -\" + crbl + \",-\" + crbl;\r\n var arcTL = \" a\" + crtl + \",\" + crtl + \" 0 0 1 \" + crtl + \",-\" + crtl;\r\n this.path = lineT + arcTR + lineR + arcBR + lineB + arcBL + lineL + arcTL;\r\n }\r\n };\r\n Object.defineProperty(PointedRectangle.prototype, \"cornerRadius\", {\r\n /**\r\n * @return Corner radius (px)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"cornerRadius\");\r\n },\r\n /**\r\n * Radius of rectangle's border in pixels.\r\n *\r\n * @default 0\r\n * @param value Corner radius (px)\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"cornerRadius\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return PointedRectangle;\r\n}(PointedShape));\r\nexport { PointedRectangle };\r\n","/**\r\n * Pointed shape module.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Sprite } from \"../Sprite\";\r\nimport * as $type from \"../utils/Type\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Draws a shape with a pointer.\r\n *\r\n * @see {@link IPointedShapeEvents} for a list of available events\r\n * @see {@link IPointedShapeAdapters} for a list of available Adapters\r\n */\r\nvar PointedShape = /** @class */ (function (_super) {\r\n __extends(PointedShape, _super);\r\n /**\r\n * Constructor\r\n */\r\n function PointedShape() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"PointedShape\";\r\n _this.pointerBaseWidth = 15;\r\n _this.pointerLength = 10;\r\n _this.pointerY = 0;\r\n _this.pointerX = 0;\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Draws the element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n PointedShape.prototype.draw = function () {\r\n _super.prototype.draw.call(this);\r\n if (!$type.isNumber(this.pointerX)) {\r\n this.pointerX = this.pixelWidth / 2;\r\n }\r\n if (!$type.isNumber(this.pointerY)) {\r\n this.pointerY = this.pixelHeight + 10;\r\n }\r\n };\r\n Object.defineProperty(PointedShape.prototype, \"pointerBaseWidth\", {\r\n /**\r\n * @return Width (px)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"pointerBaseWidth\");\r\n },\r\n /**\r\n * A width of the pinter's (stem's) thick end (base) in pixels.\r\n *\r\n * @default 15\r\n * @param value Width (px)\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"pointerBaseWidth\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(PointedShape.prototype, \"pointerLength\", {\r\n /**\r\n * @return Length (px)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"pointerLength\");\r\n },\r\n /**\r\n * A length of the pinter (stem) in pixels.\r\n *\r\n * @default 10\r\n * @param value Length (px)\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"pointerLength\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(PointedShape.prototype, \"pointerX\", {\r\n /**\r\n * @return X\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"pointerX\");\r\n },\r\n /**\r\n * X coordinate the shape is pointing to.\r\n *\r\n * @param value X\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"pointerX\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(PointedShape.prototype, \"pointerY\", {\r\n /**\r\n * @return Y\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"pointerY\");\r\n },\r\n /**\r\n * Y coordinate the shape is pointing to.\r\n *\r\n * @param value Y\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"pointerY\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return PointedShape;\r\n}(Sprite));\r\nexport { PointedShape };\r\n","/**\r\n * Module for a multi-part arched line.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Polyline } from \"./Polyline\";\r\nimport { registry } from \"../Registry\";\r\nimport * as $math from \"../../core/utils/Math\";\r\nimport * as $path from \"../../core/rendering/Path\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Draws a multi-part arched line.\r\n *\r\n * @see {@link IPolyarcEvents} for a list of available events\r\n * @see {@link IPolyarcAdapters} for a list of available Adapters\r\n */\r\nvar Polyarc = /** @class */ (function (_super) {\r\n __extends(Polyarc, _super);\r\n /**\r\n * Constructor\r\n */\r\n function Polyarc() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"Polyarc\";\r\n _this.controlPointDistance = 0.5;\r\n _this.controlPointPosition = 0.5;\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Creats and adds an SVG path for the arc.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Polyarc.prototype.makePath = function () {\r\n this._distance = 0;\r\n var segments = this.segments;\r\n if (segments && segments.length > 0) {\r\n var path = \"\";\r\n this._realSegments = [];\r\n for (var i = 0, len = segments.length; i < len; i++) {\r\n var points = segments[i];\r\n var realPoints = [];\r\n this._realSegments.push(realPoints);\r\n if (points.length > 0) {\r\n path += $path.moveTo(points[0]);\r\n for (var p = 1; p < points.length; p++) {\r\n var pointA = points[p - 1];\r\n var pointB = points[p];\r\n var distanceAB = $math.getDistance(pointB, pointA);\r\n var cpDistance = distanceAB * this.controlPointDistance;\r\n var controlPointPosition = this.controlPointPosition;\r\n var angle = -$math.getAngle(pointA, pointB);\r\n var cpx = pointA.x + (pointB.x - pointA.x) * controlPointPosition * 0.5 - cpDistance * $math.sin(angle);\r\n var cpy = pointA.y + (pointB.y - pointA.y) * controlPointPosition * 0.5 - cpDistance * $math.cos(angle);\r\n var controlPoint1 = { x: cpx, y: cpy };\r\n var cpx2 = pointA.x + (pointB.x - pointA.x) * controlPointPosition * 1.5 - cpDistance * $math.sin(angle);\r\n var cpy2 = pointA.y + (pointB.y - pointA.y) * controlPointPosition * 1.5 - cpDistance * $math.cos(angle);\r\n var controlPoint2 = { x: cpx2, y: cpy2 };\r\n path += $path.cubicCurveTo(pointB, controlPoint1, controlPoint2);\r\n // we add a lot of points in order to get the position/angle later\r\n var stepCount = Math.ceil(distanceAB);\r\n var prevPoint = pointA;\r\n if (stepCount > 0) {\r\n for (var i_1 = 0; i_1 <= stepCount; i_1++) {\r\n var point = $math.getPointOnCubicCurve(pointA, pointB, controlPoint1, controlPoint2, i_1 / stepCount);\r\n realPoints.push(point);\r\n this._distance += $math.getDistance(prevPoint, point);\r\n prevPoint = point;\r\n }\r\n }\r\n else {\r\n realPoints.push(pointA);\r\n }\r\n }\r\n }\r\n }\r\n this.path = path;\r\n }\r\n };\r\n Object.defineProperty(Polyarc.prototype, \"controlPointPosition\", {\r\n /**\r\n * @return Position (0-1)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"controlPointPosition\");\r\n },\r\n /**\r\n * Relative position along the line the control point is. (0-1)\r\n *\r\n * @default 0.5\r\n * @param value Position (0-1)\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"controlPointPosition\", value);\r\n this.makePath();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Polyarc.prototype, \"controlPointDistance\", {\r\n /**\r\n * @return Distance (0-1)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"controlPointDistance\");\r\n },\r\n /**\r\n * Relative distance of the control point. (0-1)\r\n *\r\n * Default is half the length of the line. (0.5)\r\n *\r\n * @default 0.5\r\n * @param value Distance (0-1)\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"controlPointDistance\", value);\r\n this.makePath();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return Polyarc;\r\n}(Polyline));\r\nexport { Polyarc };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Polyarc\"] = Polyarc;\r\n","/**\r\n * Polygon module.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Sprite } from \"../Sprite\";\r\nimport { Morpher } from \"../utils/Morpher\";\r\nimport { registry } from \"../Registry\";\r\nimport * as $path from \"../rendering/Path\";\r\nimport * as $type from \"../utils/Type\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Draws a polygon.\r\n *\r\n * @see {@link IPolygonEvents} for a list of available events\r\n * @see {@link IPolygonAdapters} for a list of available Adapters\r\n */\r\nvar Polygon = /** @class */ (function (_super) {\r\n __extends(Polygon, _super);\r\n /**\r\n * Constructor\r\n */\r\n function Polygon() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"Polygon\";\r\n _this.element = _this.paper.add(\"path\");\r\n _this.shapeRendering = \"auto\";\r\n _this._currentPoints = [];\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n Object.defineProperty(Polygon.prototype, \"points\", {\r\n /**\r\n * @return Polygon points\r\n */\r\n get: function () {\r\n var points = this.getPropertyValue(\"points\");\r\n var path = this.path;\r\n if (path && (!points || points.length == 0)) {\r\n var valueStr = path.slice(1, path.length - 1);\r\n var segments = valueStr.split(\"ZM\");\r\n for (var s = 0; s < segments.length; s++) {\r\n var segment = segments[s];\r\n if (segment.length > 0) {\r\n var areaHole = segment.split(\"M\");\r\n var areaArr = areaHole[0];\r\n var holeArr = areaHole[1];\r\n if (areaArr && areaArr.length > 0) {\r\n var pointsArr = areaArr.split(\"L\");\r\n if (pointsArr.length > 0) {\r\n var area = [];\r\n var areaAndHole = [area];\r\n points.push(areaAndHole);\r\n for (var p = 0; p < pointsArr.length; p++) {\r\n var coords = pointsArr[p].split(\",\");\r\n area.push({ x: +coords[0], y: +coords[1] });\r\n }\r\n if (holeArr && holeArr.length > 0) {\r\n var pointsArr_1 = holeArr.split(\"L\");\r\n if (pointsArr_1.length > 0) {\r\n var hole = [];\r\n areaAndHole.push(hole);\r\n for (var p = pointsArr_1.length - 1; p >= 0; p--) {\r\n var coords = pointsArr_1[p].split(\",\");\r\n hole.push({ x: +coords[0], y: +coords[1] });\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n this.setPropertyValue(\"points\", points);\r\n this._currentPoints = points;\r\n }\r\n return points;\r\n },\r\n /**\r\n * An array of X/Y coordinates for each elbow of the polygon.\r\n *\r\n * @todo Example\r\n * @param points Polygon points\r\n */\r\n set: function (points) {\r\n this.setPropertyValue(\"points\", points, true);\r\n this._currentPoints = points;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Polygon.prototype, \"currentPoints\", {\r\n /**\r\n * @return Polygon points\r\n */\r\n get: function () {\r\n if ((!this._currentPoints || this._currentPoints.length == 0) && this.path) {\r\n this._currentPoints = this.points;\r\n }\r\n return this._currentPoints;\r\n },\r\n /**\r\n * Current points. Used when morphing the element, so that original `points`\r\n * are not overwritten.\r\n *\r\n * @param points Polygon points\r\n */\r\n set: function (points) {\r\n if (this._currentPoints != points) {\r\n this._currentPoints = points;\r\n this.draw();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Draws the element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Polygon.prototype.draw = function () {\r\n var path = \"\";\r\n var points = this._currentPoints;\r\n var left;\r\n var right;\r\n var top;\r\n var bottom;\r\n if (points.length > 0) {\r\n // separate areas\r\n for (var i = 0, len = points.length; i < len; i++) {\r\n // surface\r\n var surface = points[i][0];\r\n var hole = points[i][1];\r\n if (surface && surface.length > 0) {\r\n var point = surface[0];\r\n path += $path.moveTo(point);\r\n for (var s = 0; s < surface.length; s++) {\r\n point = surface[s];\r\n path += $path.lineTo(point);\r\n if (!$type.isNumber(right) || (right < point.x)) {\r\n right = point.x;\r\n }\r\n if (!$type.isNumber(left) || (left > point.x)) {\r\n left = point.x;\r\n }\r\n if (!$type.isNumber(top) || (top > point.y)) {\r\n top = point.y;\r\n }\r\n if (!$type.isNumber(bottom) || (bottom < point.y)) {\r\n bottom = point.y;\r\n }\r\n }\r\n }\r\n // hole\r\n if (hole && hole.length > 0) {\r\n var point = hole[0];\r\n path += $path.moveTo(point);\r\n for (var h = 0, hlen = hole.length; h < hlen; h++) {\r\n point = hole[h];\r\n path += $path.lineTo(point);\r\n }\r\n }\r\n }\r\n if (path) {\r\n path += $path.closePath();\r\n }\r\n this.bbox.x = left;\r\n this.bbox.y = top;\r\n this.bbox.width = right - left;\r\n this.bbox.height = bottom - top;\r\n _super.prototype.setPath.call(this, path);\r\n }\r\n };\r\n /**\r\n * @ignore\r\n */\r\n Polygon.prototype.setPath = function (value) {\r\n if (_super.prototype.setPath.call(this, value)) {\r\n this.points = [];\r\n this._bbox = this.group.getBBox();\r\n return true;\r\n }\r\n return false;\r\n };\r\n /**\r\n * Measures element\r\n */\r\n Polygon.prototype.measureElement = function () {\r\n // Overriding to avoid extra measurement.\r\n };\r\n Object.defineProperty(Polygon.prototype, \"centerPoint\", {\r\n /**\r\n * A calculated center point for the shape.\r\n *\r\n * @readonly\r\n * @return Center\r\n */\r\n get: function () {\r\n return { x: this.bbox.x + this.bbox.width / 2, y: this.bbox.y + this.bbox.height / 2 };\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Polygon.prototype, \"morpher\", {\r\n /**\r\n * A [[Morpher]] instance that is used to morph polygon into some other\r\n * shape.\r\n *\r\n * @readonly\r\n * @return Morpher instance\r\n */\r\n get: function () {\r\n if (!this._morpher) {\r\n this._morpher = new Morpher(this);\r\n this._disposers.push(this._morpher);\r\n }\r\n return this._morpher;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return Polygon;\r\n}(Sprite));\r\nexport { Polygon };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Polygon\"] = Polygon;\r\n","/**\r\n * Polyline module\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Sprite } from \"../Sprite\";\r\nimport { color } from \"../utils/Color\";\r\nimport { registry } from \"../Registry\";\r\nimport * as $path from \"../rendering/Path\";\r\nimport * as $math from \"../utils/Math\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Draws a polyline.\r\n *\r\n * @see {@link IPolylineEvents} for a list of available events\r\n * @see {@link IPolylineAdapters} for a list of available Adapters\r\n */\r\nvar Polyline = /** @class */ (function (_super) {\r\n __extends(Polyline, _super);\r\n /**\r\n * Constructor\r\n */\r\n function Polyline() {\r\n var _this = _super.call(this) || this;\r\n /**\r\n * [_distance description]\r\n *\r\n * @todo Description\r\n */\r\n _this._distance = 0;\r\n _this.className = \"Polyline\";\r\n _this.element = _this.paper.add(\"path\");\r\n _this.shapeRendering = \"auto\";\r\n _this.fill = color();\r\n _this.strokeOpacity = 1;\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Creats and adds an SVG path for the arc.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Polyline.prototype.makePath = function () {\r\n this._distance = 0;\r\n var segments = this.segments;\r\n if (segments && segments.length > 0) {\r\n var path = \"\";\r\n for (var i = 0, len = segments.length; i < len; i++) {\r\n var points = segments[i];\r\n if (points.length > 0) {\r\n path += $path.moveTo(points[0]);\r\n for (var p = 1; p < points.length; p++) {\r\n var point = points[p];\r\n path += $path.lineTo(point);\r\n this._distance += $math.getDistance(points[p - 1], point);\r\n }\r\n }\r\n }\r\n this.path = path;\r\n }\r\n this._realSegments = segments;\r\n };\r\n Object.defineProperty(Polyline.prototype, \"segments\", {\r\n /**\r\n * @return Segments\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"segments\");\r\n },\r\n /**\r\n * A list of segment coordinates for the multi-part line.\r\n *\r\n * @todo Example\r\n * @param segments Segments\r\n */\r\n set: function (segments) {\r\n this.setPropertyValue(\"segments\", segments);\r\n this.makePath();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Polyline.prototype, \"distance\", {\r\n /**\r\n * [distance description]\r\n *\r\n * @todo Description\r\n * @return [description]\r\n */\r\n get: function () {\r\n return this._distance;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Converts relative position along the line (0-1) into pixel coordinates.\r\n *\r\n * @param position Position (0-1)\r\n * @return Coordinates\r\n */\r\n Polyline.prototype.positionToPoint = function (position) {\r\n var deltaAngle = 0;\r\n if (position < 0) {\r\n position = Math.abs(position);\r\n deltaAngle = 180;\r\n }\r\n var segments = this._realSegments;\r\n if (segments) {\r\n var totalDistance = this.distance;\r\n var currentDistance = 0;\r\n var distanceAB = void 0;\r\n var positionA = 0;\r\n var positionB = 0;\r\n var pointA = void 0;\r\n var pointB = void 0;\r\n for (var s = 0; s < segments.length; s++) {\r\n var points = segments[s];\r\n if (points.length > 1) {\r\n for (var p = 1; p < points.length; p++) {\r\n pointA = points[p - 1];\r\n pointB = points[p];\r\n positionA = currentDistance / totalDistance;\r\n distanceAB = $math.getDistance(pointA, pointB);\r\n currentDistance += distanceAB;\r\n positionB = currentDistance / totalDistance;\r\n if (positionA <= position && positionB > position) {\r\n s = segments.length;\r\n break;\r\n }\r\n }\r\n }\r\n else if (points.length == 1) {\r\n pointA = points[0];\r\n pointB = points[0];\r\n positionA = 0;\r\n positionB = 1;\r\n }\r\n }\r\n if (pointA && pointB) {\r\n var positionAB = (position - positionA) / (positionB - positionA);\r\n var midPoint = $math.getMidPoint(pointA, pointB, positionAB);\r\n return { x: midPoint.x, y: midPoint.y, angle: deltaAngle + $math.getAngle(pointA, pointB) };\r\n }\r\n }\r\n return { x: 0, y: 0, angle: 0 };\r\n };\r\n Object.defineProperty(Polyline.prototype, \"realSegments\", {\r\n /**\r\n * @ignore\r\n */\r\n get: function () {\r\n return this._realSegments;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return Polyline;\r\n}(Sprite));\r\nexport { Polyline };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Polyline\"] = Polyline;\r\n","/**\r\n * Polyspline (smoothed line) module.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Polyline } from \"./Polyline\";\r\nimport { registry } from \"../Registry\";\r\nimport * as $math from \"../../core/utils/Math\";\r\nimport * as $type from \"../../core/utils/Type\";\r\nimport * as $path from \"../../core/rendering/Path\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Draws a polysline. (smoothed multi-sigment line)\r\n *\r\n * @see {@link IPolysplineEvents} for a list of available events\r\n * @see {@link IPolysplineAdapters} for a list of available Adapters\r\n */\r\nvar Polyspline = /** @class */ (function (_super) {\r\n __extends(Polyspline, _super);\r\n /**\r\n * Constructor\r\n */\r\n function Polyspline() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"Polyspline\";\r\n _this.tensionX = 0.5;\r\n _this.tensionY = 0.5;\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Creats and adds an SVG path for the arc.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Polyspline.prototype.makePath = function () {\r\n this._distance = 0;\r\n var segments = this.segments;\r\n var tensionX = this.tensionX;\r\n var tensionY = this.tensionY;\r\n this.allPoints = [];\r\n if (segments && segments.length > 0) {\r\n var path = \"\";\r\n this._realSegments = [];\r\n for (var i = 0, len = segments.length; i < len; i++) {\r\n var points = segments[i];\r\n var realPoints = [];\r\n this._realSegments.push(realPoints);\r\n if (points.length > 0) {\r\n var first = points[0];\r\n var last = points[points.length - 1];\r\n var closed_1 = false;\r\n if ($math.round(first.x, 3) == $math.round(last.x) && $math.round(first.y) == $math.round(last.y)) {\r\n closed_1 = true;\r\n }\r\n path += $path.moveTo(points[0]);\r\n for (var p = 0; p < points.length - 1; p++) {\r\n var p0 = points[p - 1];\r\n var p1 = points[p];\r\n var p2 = points[p + 1];\r\n var p3 = points[p + 2];\r\n if (p === 0) {\r\n p0 = points[p];\r\n }\r\n else if (p == points.length - 2) {\r\n p3 = points[p + 1];\r\n }\r\n if (!p3) {\r\n p3 = p2;\r\n }\r\n if (p === 0) {\r\n if (closed_1) {\r\n p0 = points[points.length - 2];\r\n }\r\n else {\r\n p0 = points[i];\r\n }\r\n }\r\n else if (p == points.length - 2) {\r\n if (closed_1) {\r\n p3 = points[1];\r\n }\r\n else {\r\n p3 = points[p + 1];\r\n }\r\n }\r\n var controlPointA = $math.getCubicControlPointA(p0, p1, p2, p3, tensionX, tensionY);\r\n var controlPointB = $math.getCubicControlPointB(p0, p1, p2, p3, tensionX, tensionY);\r\n path += $path.cubicCurveTo(p2, controlPointA, controlPointB);\r\n // now split to small segments so that we could have positionToPoint later\r\n var stepCount = Math.ceil($math.getCubicCurveDistance(p1, p2, controlPointA, controlPointB, 20)) * 1.2;\r\n var prevPoint = p1;\r\n if (stepCount > 0) {\r\n // not good for curved charts\r\n //this.allPoints[0] = { x: points[0].x, y: points[0].y, angle: $math.getAngle(points[0], points[1]) };\r\n //realPoints.push(this.allPoints[0]);\r\n for (var s = 0; s <= stepCount; s++) {\r\n var point = $math.getPointOnCubicCurve(p1, p2, controlPointA, controlPointB, s / stepCount);\r\n if (point.x == prevPoint.x && point.y == prevPoint.y) {\r\n continue;\r\n }\r\n realPoints.push(point);\r\n var angle = $math.round($math.getAngle(prevPoint, point), 5);\r\n //this.allPoints.push({ x: point.x, y: point.y, angle: angle });\r\n this._distance += $math.getDistance(prevPoint, point);\r\n this.allPoints[Math.floor(this._distance)] = { x: point.x, y: point.y, angle: angle };\r\n prevPoint = point;\r\n }\r\n }\r\n else {\r\n realPoints.push(p0);\r\n }\r\n }\r\n }\r\n var allPoints = this.allPoints;\r\n if (allPoints.length > 1) {\r\n for (var i_1 = 0; i_1 < allPoints.length; i_1++) {\r\n if (!allPoints[i_1]) {\r\n if (i_1 > 1) {\r\n allPoints[i_1] = allPoints[i_1 - 1];\r\n }\r\n else {\r\n for (var k = 1; k < allPoints.length; k++) {\r\n if (allPoints[k]) {\r\n allPoints[i_1] = allPoints[k];\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n this.path = path;\r\n }\r\n };\r\n /**\r\n * Returns an index of the point that is closest to specified coordinates.\r\n *\r\n * @param point Reference point\r\n * @return Index\r\n */\r\n Polyspline.prototype.getClosestPointIndex = function (point) {\r\n var points = this.allPoints;\r\n var index;\r\n var closest = Infinity;\r\n if (points.length > 1) {\r\n for (var p = 1; p < points.length; p++) {\r\n var distance = $math.getDistance(point, points[p]);\r\n if (distance < closest) {\r\n index = p;\r\n closest = distance;\r\n }\r\n }\r\n }\r\n return index;\r\n };\r\n Object.defineProperty(Polyspline.prototype, \"tensionX\", {\r\n /**\r\n * @return Tension\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"tensionX\");\r\n },\r\n /**\r\n * Horizontal tension for the spline.\r\n *\r\n * Used by the line smoothing algorithm.\r\n *\r\n * @default 0.5\r\n * @param value Tension\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"tensionX\", value);\r\n this.makePath();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Polyspline.prototype, \"tensionY\", {\r\n /**\r\n * @return Tension\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"tensionY\");\r\n },\r\n /**\r\n * Vertical tension for the spline.\r\n *\r\n * Used by the line smoothing algorithm.\r\n *\r\n * @default 0.5\r\n * @param value Tensions\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"tensionY\", value, true);\r\n this.makePath();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Converts relative position along the line (0-1) into pixel coordinates.\r\n *\r\n * @param position Position (0-1)\r\n * @return Coordinates\r\n */\r\n Polyspline.prototype.positionToPoint = function (position, extend) {\r\n var deltaAngle = 0;\r\n var allPoints = this.allPoints;\r\n var len = allPoints.length;\r\n if (!$type.isNumber(position)) {\r\n position = 0;\r\n }\r\n if (len > 1) {\r\n if (extend && len > 3) {\r\n if (position < 0) {\r\n if (position < -0.01) {\r\n position = -0.01;\r\n }\r\n var f0 = allPoints[0];\r\n var f1 = allPoints[1];\r\n var x = f0.x - (f0.x - f1.x) * len * position;\r\n var y = f0.y - (f0.y - f1.y) * len * position;\r\n return { x: x, y: y, angle: $math.getAngle(f0, f1) };\r\n }\r\n else if (position > 1) {\r\n if (position > 1.01) {\r\n position = 1.01;\r\n }\r\n var f0 = allPoints[allPoints.length - 2];\r\n var f1 = allPoints[allPoints.length - 3];\r\n var x = f0.x + (f0.x - f1.x) * len * (position - 1);\r\n var y = f0.y + (f0.y - f1.y) * len * (position - 1);\r\n return { x: x, y: y, angle: $math.getAngle(f0, { x: x, y: y }) };\r\n }\r\n else if (position == 1) {\r\n var point_1 = allPoints[allPoints.length - 1];\r\n return { x: point_1.x, y: point_1.y, angle: point_1.angle };\r\n }\r\n }\r\n else {\r\n if (position < 0) {\r\n position = Math.abs(position);\r\n deltaAngle = 180;\r\n }\r\n if (position >= 1) {\r\n position = 0.9999999999999;\r\n }\r\n }\r\n var point = allPoints[Math.floor(position * len)];\r\n return { x: point.x, y: point.y, angle: point.angle + deltaAngle };\r\n }\r\n else if (len == 1) {\r\n var point = allPoints[0];\r\n return { x: point.x, y: point.y, angle: point.angle };\r\n }\r\n else {\r\n return { x: 0, y: 0, angle: 0 };\r\n }\r\n };\r\n return Polyspline;\r\n}(Polyline));\r\nexport { Polyspline };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Polyspline\"] = Polyspline;\r\n","/**\r\n * Popup class is used to display information over chart area.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport popupCSS from \"./PopupCSS\";\r\nimport { Adapter } from \"../utils/Adapter\";\r\nimport { BaseObjectEvents } from \"../Base\";\r\nimport { getInteraction } from \"../interaction/Interaction\";\r\nimport { keyboard } from \"../utils/Keyboard\";\r\nimport { MultiDisposer } from \"../utils/Disposer\";\r\nimport { getShadowRoot } from \"../utils/DOM\";\r\nimport * as $type from \"../utils/Type\";\r\nimport * as $object from \"../utils/Object\";\r\n/**\r\n * Shows an HTML popup which covers window or a chart area.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/popups-and-modals/} For examples and docs on Popups and Modals.\r\n * @todo Positioning over whole window\r\n */\r\nvar Popup = /** @class */ (function (_super) {\r\n __extends(Popup, _super);\r\n /**\r\n * Constructor\r\n */\r\n function Popup() {\r\n var _this = _super.call(this) || this;\r\n /**\r\n * Adapter.\r\n */\r\n _this.adapter = new Adapter(_this);\r\n /**\r\n * Holds references to various HTML elements, Popup consists of.\r\n */\r\n _this._elements = {};\r\n /**\r\n * Holdes Interaction objects for various Popup's elements.\r\n */\r\n _this._IOs = {};\r\n /**\r\n * Contents of popup window.\r\n */\r\n _this._content = \"\";\r\n /**\r\n * Title of the popup window.\r\n */\r\n _this._title = \"\";\r\n /**\r\n * Prefix to apply to class names for popup elements.\r\n */\r\n _this._classPrefix = \"ampopup\";\r\n /**\r\n * If set to `true` [[Popup]] will use default styles.\r\n */\r\n _this._defaultStyles = true;\r\n /**\r\n * If set to `true` [[Popup]] will dim out all chart content behind it by\r\n * showing a semi-transparent fill. (curtain)\r\n */\r\n _this._showCurtain = false;\r\n /**\r\n * Indicates whether popup can be dragged.\r\n */\r\n _this._draggable = true;\r\n /**\r\n * Horizontal position of the content window.\r\n */\r\n _this._align = \"center\";\r\n /**\r\n * Resize popup as images are being loaded.\r\n */\r\n _this._dynamicResize = true;\r\n /**\r\n * Vertical position of the content window.\r\n */\r\n _this._verticalAlign = \"middle\";\r\n /**\r\n * Shift in position of the element. (used for dragging)\r\n */\r\n _this._shift = {\r\n x: 0,\r\n y: 0\r\n };\r\n /**\r\n * Temporary shift in position of the element. (used for dragging)\r\n */\r\n _this._tempShift = {\r\n x: 0,\r\n y: 0\r\n };\r\n /**\r\n * A title for screen readers. It is very highly recommended to set that title\r\n * so that people using screen reader tools can get an immediate summary of\r\n * the information in the popup.\r\n */\r\n _this._readerTitle = \"\";\r\n /**\r\n * Is popup closable?\r\n */\r\n _this._closable = true;\r\n /**\r\n * Was CSS already loaded?\r\n */\r\n _this._cssLoaded = false;\r\n /**\r\n * If set to other than \"none\" will try to re-adjust the position of the\r\n * popop to fit within chart container or browser window.\r\n *\r\n * @ignore Feature not yet implemented\r\n * @todo Implement\r\n */\r\n _this._fitTo = \"window\";\r\n /**\r\n * Identifies if this object is a \"template\" and should not be treated as\r\n * real object that is drawn or actually used in the chart.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this.isTemplate = false;\r\n /**\r\n * Indicates if the element was already sized and should not be measured for\r\n * size again, saving some precious resources.\r\n */\r\n _this._sized = false;\r\n _this.className = \"Popup\";\r\n return _this;\r\n }\r\n /**\r\n * Shows popup window.\r\n */\r\n Popup.prototype.open = function () {\r\n if (this.container) {\r\n if (this._elements.wrapper) {\r\n this.container.appendChild(this._elements.wrapper);\r\n }\r\n if (this._elements.curtain) {\r\n this.container.appendChild(this._elements.curtain);\r\n this.showCurtain = this.showCurtain;\r\n }\r\n this.positionElement();\r\n this.dispatchImmediately(\"opened\");\r\n }\r\n };\r\n /**\r\n * Hides popup window.\r\n */\r\n Popup.prototype.close = function () {\r\n if (this._elements.wrapper) {\r\n if (this._elements.wrapper.parentElement) {\r\n this._elements.wrapper.parentElement.removeChild(this._elements.wrapper);\r\n }\r\n }\r\n if (this._elements.curtain) {\r\n if (this._elements.curtain.parentElement) {\r\n this._elements.curtain.parentElement.removeChild(this._elements.curtain);\r\n }\r\n }\r\n this.dispatchImmediately(\"closed\");\r\n this.releasePointers();\r\n };\r\n /**\r\n * Destroy (dispose) popup.\r\n */\r\n Popup.prototype.dispose = function () {\r\n this.close();\r\n _super.prototype.dispose.call(this);\r\n };\r\n /**\r\n * Positions content element in the center of popup based on its actual size.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Popup.prototype.positionElement = function (forceResize) {\r\n var _this = this;\r\n if (forceResize === void 0) { forceResize = true; }\r\n if (!this._elements.wrapper) {\r\n return;\r\n }\r\n setTimeout(function () {\r\n if (!_this._elements.wrapper) {\r\n return;\r\n }\r\n if (forceResize || !_this._sized) {\r\n _this._elements.wrapper.style.opacity = \"0.01\";\r\n _this._elements.wrapper.style.left = \"0\";\r\n _this._elements.wrapper.style.top = \"0\";\r\n _this._elements.wrapper.style.margin = \"0 0 0 0\";\r\n _this._elements.wrapper.style.width = \"\";\r\n _this._elements.wrapper.style.height = \"\";\r\n var bbox = _this._elements.wrapper.getBoundingClientRect();\r\n _this._elements.wrapper.style.width = bbox.width + \"px\";\r\n _this._elements.wrapper.style.height = bbox.height + \"px\";\r\n _this._sized = true;\r\n }\r\n // Check for any images that are not yet loaded\r\n if (_this.dynamicResize) {\r\n var images = _this._elements.wrapper.getElementsByTagName(\"img\");\r\n for (var i = 0; i < images.length; i++) {\r\n var image = images[i];\r\n if (!image.complete) {\r\n // Resize popup once again when image is loaded\r\n image.addEventListener(\"load\", function () {\r\n _this.positionElement(true);\r\n });\r\n // Do this for one image only as it will be checked again next time\r\n // anyway\r\n break;\r\n }\r\n }\r\n }\r\n setTimeout(function () {\r\n if (!_this._elements.wrapper) {\r\n return;\r\n }\r\n var bbox;\r\n if ((forceResize || !_this._sized) && _this._bbox) {\r\n bbox = _this._bbox;\r\n }\r\n else {\r\n bbox = _this._elements.wrapper.getBoundingClientRect();\r\n _this._elements.wrapper.style.opacity = \"\";\r\n }\r\n // Set horizontal positioning\r\n switch (_this.align) {\r\n case \"left\":\r\n _this._elements.wrapper.style.left = \"0\";\r\n _this._elements.wrapper.style.right = \"auto\";\r\n _this._elements.wrapper.style.marginLeft = _this.toStyle(_this._shift.x + _this._tempShift.x);\r\n break;\r\n case \"center\":\r\n _this._elements.wrapper.style.left = \"50%\";\r\n _this._elements.wrapper.style.right = \"auto\";\r\n _this._elements.wrapper.style.marginLeft = _this.toStyle(Math.round(-bbox.width / 2) + (_this._shift.x + _this._tempShift.x));\r\n break;\r\n case \"right\":\r\n _this._elements.wrapper.style.left = \"auto\";\r\n _this._elements.wrapper.style.right = \"0\";\r\n _this._elements.wrapper.style.marginLeft = _this.toStyle(_this._shift.x + _this._tempShift.x);\r\n break;\r\n default:\r\n _this._elements.wrapper.style.left = _this.toStyle(_this.left) || \"auto\";\r\n _this._elements.wrapper.style.right = _this.toStyle(_this.right) || \"auto\";\r\n _this._elements.wrapper.style.marginLeft = _this.toStyle(_this._shift.x + _this._tempShift.x);\r\n break;\r\n }\r\n // Set vertical positioning\r\n switch (_this.verticalAlign) {\r\n case \"top\":\r\n _this._elements.wrapper.style.top = \"0\";\r\n _this._elements.wrapper.style.bottom = \"auto\";\r\n _this._elements.wrapper.style.marginTop = _this.toStyle(_this._shift.y + _this._tempShift.y);\r\n break;\r\n case \"middle\":\r\n _this._elements.wrapper.style.top = \"50%\";\r\n _this._elements.wrapper.style.bottom = \"auto\";\r\n _this._elements.wrapper.style.marginTop = _this.toStyle(Math.round(-bbox.height / 2) + (_this._shift.y + _this._tempShift.y));\r\n break;\r\n case \"bottom\":\r\n _this._elements.wrapper.style.top = \"auto\";\r\n _this._elements.wrapper.style.bottom = \"0\";\r\n _this._elements.wrapper.style.marginTop = _this.toStyle(_this._shift.y + _this._tempShift.y);\r\n break;\r\n default:\r\n _this._elements.wrapper.style.top = _this.toStyle(_this.top) || \"auto\";\r\n _this._elements.wrapper.style.bottom = _this.toStyle(_this.bottom) || \"auto\";\r\n _this._elements.wrapper.style.marginTop = _this.toStyle(_this._shift.y + _this._tempShift.y);\r\n break;\r\n }\r\n }, 1);\r\n }, 1);\r\n };\r\n Popup.prototype.setupDragging = function () {\r\n var _this = this;\r\n if (this.draggable) {\r\n if (!this._IOs.header.events.has(\"drag\")) {\r\n this._IOs.header.events.on(\"drag\", function (ev) {\r\n _this._tempShift.x = ev.shift.x;\r\n _this._tempShift.y = ev.shift.y;\r\n _this.positionElement(false);\r\n });\r\n }\r\n if (!this._IOs.header.events.has(\"dragstop\")) {\r\n this._IOs.header.events.on(\"dragstop\", function (ev) {\r\n _this._shift.x += _this._tempShift.x;\r\n _this._shift.y += _this._tempShift.y;\r\n _this._tempShift.x = 0;\r\n _this._tempShift.y = 0;\r\n _this.positionElement(false);\r\n });\r\n }\r\n }\r\n else {\r\n if (this._IOs.header) {\r\n getInteraction().unprepElement(this._IOs.header);\r\n if (this._IOs.header.events.has(\"drag\")) {\r\n this._IOs.header.events.off(\"drag\");\r\n }\r\n if (this._IOs.header.events.has(\"dragstop\")) {\r\n this._IOs.header.events.off(\"dragstop\");\r\n }\r\n }\r\n }\r\n };\r\n Popup.prototype.toStyle = function (value) {\r\n if (!$type.hasValue(value)) {\r\n return null;\r\n }\r\n else if ($type.isNumber(value)) {\r\n return \"\" + value + \"px\";\r\n }\r\n else {\r\n return value.toString();\r\n }\r\n };\r\n Object.defineProperty(Popup.prototype, \"classPrefix\", {\r\n /**\r\n * A prefix that is applied to class names of various popup elements.\r\n *\r\n * @return Class name prefix\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"classPrefix\", this._classPrefix);\r\n },\r\n /**\r\n * @param value Class name prefix\r\n */\r\n set: function (value) {\r\n this._classPrefix = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Popup.prototype, \"classPrefixRaw\", {\r\n /**\r\n * Returns raw prefix (without adapters applied).\r\n *\r\n * @ignore Exclude from docs\r\n * @return Class name prefix\r\n */\r\n get: function () {\r\n return this._classPrefix;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Popup.prototype, \"content\", {\r\n /**\r\n * @return Popup content\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"content\", this._content);\r\n },\r\n /**\r\n * Popup content.\r\n *\r\n * Popup content can be any valid HTML, including CSS.\r\n *\r\n * @param value Popup content\r\n */\r\n set: function (value) {\r\n if (this._content != value) {\r\n this._content = value;\r\n if (!this._elements.content) {\r\n this.createContentElement();\r\n }\r\n this._elements.content.innerHTML = value;\r\n this.positionElement();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Popup.prototype.getClassNames = function () {\r\n return this.adapter.apply(\"classNames\", {\r\n wrapperClass: this.classPrefix + \"\",\r\n headerClass: this.classPrefix + \"-header\",\r\n titleClass: this.classPrefix + \"-title\",\r\n contentClass: this.classPrefix + \"-content\",\r\n insideClass: this.classPrefix + \"-inside\",\r\n curtainClass: this.classPrefix + \"-curtain\",\r\n closeClass: this.classPrefix + \"-close\"\r\n });\r\n };\r\n /**\r\n * Creates content element.\r\n */\r\n Popup.prototype.createContentElement = function () {\r\n // Check if it's created already\r\n if (this._elements.wrapper) {\r\n return;\r\n }\r\n // Get class names for popup elements\r\n var classNames = this.getClassNames();\r\n // Create content element\r\n var wrapper = document.createElement(\"div\");\r\n wrapper.className = classNames.contentClass;\r\n wrapper.style.opacity = \"0.01\";\r\n // Create close button\r\n var close = document.createElement(\"a\");\r\n close.className = classNames.closeClass;\r\n // header title\r\n var header = document.createElement(\"div\");\r\n header.className = classNames.headerClass;\r\n // Content title\r\n var title = document.createElement(\"div\");\r\n title.innerHTML = this.title;\r\n title.className = classNames.titleClass;\r\n if (!this.title) {\r\n title.style.display = \"none\";\r\n }\r\n // Content div\r\n var content = document.createElement(\"div\");\r\n content.className = classNames.insideClass;\r\n content.innerHTML = this.content;\r\n // Set up events for content\r\n this._IOs.wrapper = getInteraction().getInteraction(wrapper);\r\n this._IOs.header = getInteraction().getInteraction(header);\r\n this._disposers.push(this._IOs.wrapper);\r\n // Set hover/out events\r\n this._IOs.wrapper.events.on(\"over\", this.disablePointers, this);\r\n this._IOs.wrapper.events.on(\"out\", this.releasePointers, this);\r\n // Create an InteractionObject for close\r\n this._IOs.close = getInteraction().getInteraction(close);\r\n this._disposers.push(this._IOs.close);\r\n // Hide close for now\r\n close.style.visibility = \"hidden\";\r\n // Add accessible stuff\r\n wrapper.setAttribute(\"role\", \"dialog\");\r\n // Add to wrapper\r\n header.appendChild(close);\r\n header.appendChild(title);\r\n wrapper.appendChild(header);\r\n wrapper.appendChild(content);\r\n this.container.appendChild(wrapper);\r\n // Save for later access\r\n this._elements.wrapper = wrapper;\r\n this._elements.header = header;\r\n this._elements.content = content;\r\n this._elements.title = title;\r\n this._elements.close = close;\r\n // Load CSS\r\n if (this.defaultStyles) {\r\n this.loadDefaultCSS();\r\n }\r\n // Create curtain as well\r\n this.createCurtainElement();\r\n // Apply events\r\n this.applyEvents();\r\n this.applyReaderSettings();\r\n // Draggable?\r\n this.setupDragging();\r\n };\r\n Object.defineProperty(Popup.prototype, \"title\", {\r\n /**\r\n * @return Popup title\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"title\", this._title);\r\n },\r\n /**\r\n * Popup title.\r\n *\r\n * Popup title can be any valid HTML, including CSS.\r\n *\r\n * @param value Popup title\r\n */\r\n set: function (value) {\r\n if (this._title != value) {\r\n this._title = value;\r\n if (!this._elements.content) {\r\n this.createContentElement();\r\n }\r\n this._elements.title.innerHTML = value;\r\n this.positionElement();\r\n this.applyReaderSettings();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Popup.prototype, \"readerTitle\", {\r\n /**\r\n * @return Popup content\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"readerTitle\", this._readerTitle != \"\" ? this._readerTitle : this.title);\r\n },\r\n /**\r\n * A title for screen readers. It is very highly recommended to set that title\r\n * so that people using screen reader tools can get an immediate summary of\r\n * the information in the popup.\r\n *\r\n * @param value Reader title\r\n */\r\n set: function (value) {\r\n if (this._readerTitle != value) {\r\n this._readerTitle = value;\r\n this.applyReaderSettings();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Popup.prototype, \"closable\", {\r\n /**\r\n * @return Closable?\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"closable\", this._closable);\r\n },\r\n /**\r\n * Is popup closable?\r\n *\r\n * If it is, it can be closed in a number of ways, e.g. by hitting ESC key,\r\n * clicking curtain, or clicking the close button.\r\n *\r\n * If it is not closable, the only way to close it is via `close()` call.\r\n *\r\n * @param value Closable?\r\n */\r\n set: function (value) {\r\n if (value !== this._closable) {\r\n this._closable = value;\r\n this.applyEvents();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Popup.prototype, \"fitTo\", {\r\n /**\r\n * @ignore\r\n * @todo Implement\r\n * @return Fit option\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"fitTo\", this._fitTo);\r\n },\r\n /**\r\n * If set to other than \"none\" will try to re-adjust the position of the\r\n * popop to fit within chart container or browser window.\r\n *\r\n * @ignore\r\n * @todo Implement\r\n * @default \"window\"\r\n * @param value Fit option\r\n */\r\n set: function (value) {\r\n if (value != this._fitTo) {\r\n this._fitTo = value;\r\n this.positionElement();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Popup.prototype, \"defaultStyles\", {\r\n /**\r\n * @return Use default CSS?\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"defaultStyles\", this._defaultStyles);\r\n },\r\n /**\r\n * Should popup use default CSS?\r\n *\r\n * If default CSS is disabled, an external CSS should handle the look of the\r\n * popup, since it will look quite out of place otherwise.\r\n *\r\n * @default true\r\n * @param Use default CSS?\r\n */\r\n set: function (value) {\r\n if (this._defaultStyles != value) {\r\n this._defaultStyles = value;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Popup.prototype, \"showCurtain\", {\r\n /**\r\n * @return Show curtain?\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"showCurtain\", this._showCurtain);\r\n },\r\n /**\r\n * Should popup use dim out all content behind it?\r\n *\r\n * @default false\r\n * @param Show curtain?\r\n */\r\n set: function (value) {\r\n if (this._showCurtain != value) {\r\n this._showCurtain = value;\r\n if (this._elements.curtain) {\r\n this._elements.curtain.style.display = value ? \"block\" : \"none\";\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Creates curtain element.\r\n */\r\n Popup.prototype.createCurtainElement = function () {\r\n // Get class names for popup elements\r\n var classNames = this.getClassNames();\r\n // Create the curtain\r\n var curtain = document.createElement(\"div\");\r\n curtain.className = classNames.curtainClass;\r\n // Append curtain to wrapper\r\n this.container.appendChild(curtain);\r\n // Create an InteractionObject for curtain because we might need to\r\n // set interactions on it\r\n this._IOs.curtain = getInteraction().getInteraction(curtain);\r\n // Add Curtain IO to disposers\r\n this._disposers.push(this._IOs.curtain);\r\n // Set events to disable underlying interactivity\r\n this._IOs.curtain.events.on(\"over\", this.disablePointers, this);\r\n this._IOs.curtain.events.on(\"out\", this.releasePointers, this);\r\n // Hide it?\r\n curtain.style.display = this.showCurtain ? \"block\" : \"none\";\r\n // Save for later\r\n this._elements.curtain = curtain;\r\n };\r\n Object.defineProperty(Popup.prototype, \"draggable\", {\r\n /**\r\n * @return Show curtain?\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"draggable\", this._draggable);\r\n },\r\n /**\r\n * Can the popup be dragged with a pointer?\r\n *\r\n * @default false\r\n * @param Show curtain?\r\n */\r\n set: function (value) {\r\n if (this._draggable != value) {\r\n this._draggable = value;\r\n this.setupDragging();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Popup.prototype, \"dynamicResize\", {\r\n /**\r\n * @return Resize dynamically?\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"dynamicResize\", this._dynamicResize);\r\n },\r\n /**\r\n * Resize popup as images are being loaded.\r\n *\r\n * @default true\r\n * @since 4.9.17\r\n * @param Resize dynamically?\r\n */\r\n set: function (value) {\r\n if (this._dynamicResize != value) {\r\n this._dynamicResize = value;\r\n this.positionElement(true);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Popup.prototype, \"align\", {\r\n /**\r\n * @return Horizontal position\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"align\", this._align);\r\n },\r\n /**\r\n * Horizontal positioning of the content window.\r\n *\r\n * Available options: \"left\", \"center\" (default), \"right\", and \"none\".\r\n *\r\n * @default \"center\"\r\n * @param Horizontal position\r\n */\r\n set: function (value) {\r\n if (this._align != value) {\r\n this._align = value;\r\n this.positionElement();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Popup.prototype, \"verticalAlign\", {\r\n /**\r\n * @return Vertical position\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"verticalAlign\", this._verticalAlign);\r\n },\r\n /**\r\n * Vertical positioning of the content window.\r\n *\r\n * Available options: \"top\", \"middle\" (default), \"bottom\", and \"none\".\r\n *\r\n * @default \"middle\"\r\n * @param Vertical position\r\n */\r\n set: function (value) {\r\n if (this._verticalAlign != value) {\r\n this._verticalAlign = value;\r\n this.positionElement();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Popup.prototype, \"left\", {\r\n /**\r\n * @return Left\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"left\", this._left);\r\n },\r\n /**\r\n * \"left\" coordinate of a non-aligned (`align = \"none\"`) popup.\r\n *\r\n * Can be either absolute pixel value, or relative (`Percent`).\r\n *\r\n * Setting this property will automatically set `align` to \"none\".\r\n *\r\n * NOTE: The position is relative to the chart container.\r\n *\r\n * @param Left\r\n */\r\n set: function (value) {\r\n if (this.left != value) {\r\n this._left = value;\r\n this._align = \"none\";\r\n this.positionElement();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Popup.prototype, \"right\", {\r\n /**\r\n * @return Right\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"right\", this._right);\r\n },\r\n /**\r\n * \"right\" coordinate of a non-aligned (`align = \"none\"`) popup.\r\n *\r\n * Can be either absolute pixel value, or relative (`Percent`).\r\n *\r\n * Setting this property will automatically set `align` to \"none\".\r\n *\r\n * NOTE: The position is relative to the chart container.\r\n *\r\n * @param Right\r\n */\r\n set: function (value) {\r\n if (this.right != value) {\r\n this._right = value;\r\n this._align = \"none\";\r\n this.positionElement();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Popup.prototype, \"top\", {\r\n /**\r\n * @return Top\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"top\", this._top);\r\n },\r\n /**\r\n * \"top\" coordinate of a non-aligned (`verticalAlign = \"none\"`) popup.\r\n *\r\n * Can be either absolute pixel value, or relative (`Percent`).\r\n *\r\n * Setting this property will automatically set `verticalAlign` to \"none\".\r\n *\r\n * NOTE: The position is relative to the chart container.\r\n *\r\n * @param Top\r\n */\r\n set: function (value) {\r\n if (this.top != value) {\r\n this._top = value;\r\n this._verticalAlign = \"none\";\r\n this.positionElement();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Popup.prototype, \"bottom\", {\r\n /**\r\n * @return Bottom\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"bottom\", this._bottom);\r\n },\r\n /**\r\n * \"bottom\" coordinate of a non-aligned (`verticalAlign = \"none\"`) popup.\r\n *\r\n * Can be either absolute pixel value, or relative (`Percent`).\r\n *\r\n * Setting this property will automatically set `verticalAlign` to \"none\".\r\n *\r\n * NOTE: The position is relative to the chart container.\r\n *\r\n * @param Bottom\r\n */\r\n set: function (value) {\r\n if (this.bottom != value) {\r\n this._bottom = value;\r\n this._verticalAlign = \"none\";\r\n this.positionElement();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Popup.prototype, \"elements\", {\r\n /**\r\n * Returns an object with references to various elements of the Popup.\r\n *\r\n * * `wrapper`\r\n * * `title`\r\n * * `content`\r\n * * `close`\r\n * * `curtain`\r\n */\r\n get: function () {\r\n return this._elements;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Loads popup CSS.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Popup.prototype.loadDefaultCSS = function () {\r\n if (!this._cssLoaded) {\r\n this._disposers.push(popupCSS(getShadowRoot(this.container), this.classPrefix));\r\n $object.each(this._elements, function (key, el) {\r\n el.style.display = \"\";\r\n });\r\n this._cssLoaded = true;\r\n }\r\n };\r\n /**\r\n * If popup is closable, this method adds various events to popup elements.\r\n */\r\n Popup.prototype.applyEvents = function () {\r\n var _this = this;\r\n if (this._IOs.close) {\r\n if (this.closable) {\r\n this._IOs.close.element.style.visibility = \"visible\";\r\n var disposers = [\r\n getInteraction().body.events.on(\"keyup\", function (ev) {\r\n if (keyboard.isKey(ev.event, \"esc\") && _this.closable) {\r\n _this.close();\r\n }\r\n }),\r\n this._IOs.close.events.on(\"hit\", function (ev) {\r\n _this.close();\r\n })\r\n ];\r\n disposers.push(this._IOs.curtain.events.on(\"hit\", function (ev) {\r\n if (_this.showCurtain && _this.closable) {\r\n _this.close();\r\n }\r\n }));\r\n this._disposers.push(new MultiDisposer(disposers));\r\n }\r\n else {\r\n this._IOs.close.element.style.visibility = \"hidden\";\r\n }\r\n }\r\n };\r\n /**\r\n * Disables interactivity on parent chart.\r\n */\r\n Popup.prototype.disablePointers = function () {\r\n if (this.sprite) {\r\n this._spriteInteractionsEnabled = this.sprite.interactionsEnabled;\r\n this.sprite.interactionsEnabled = false;\r\n }\r\n };\r\n /**\r\n * Releases temporarily disabled pointers on parent chart.\r\n */\r\n Popup.prototype.releasePointers = function () {\r\n if ($type.hasValue(this._spriteInteractionsEnabled)) {\r\n this.sprite.interactionsEnabled = this._spriteInteractionsEnabled;\r\n this._spriteInteractionsEnabled = undefined;\r\n }\r\n };\r\n /**\r\n * Sets screen reader related settings.\r\n */\r\n Popup.prototype.applyReaderSettings = function () {\r\n this.elements.wrapper.setAttribute(\"aria-label\", this.readerTitle);\r\n };\r\n /**\r\n * Copies all properties and related data from different element.\r\n *\r\n * @param object Source element\r\n */\r\n Popup.prototype.copyFrom = function (source) {\r\n _super.prototype.copyFrom.call(this, source);\r\n this.container = source.container;\r\n this.sprite = source.sprite;\r\n this.classPrefix = source.classPrefixRaw;\r\n this.content = source.content;\r\n this.title = source.title;\r\n this.readerTitle = source.readerTitle;\r\n this.defaultStyles = source.defaultStyles;\r\n this.showCurtain = source.showCurtain;\r\n this.align = source.align;\r\n this.verticalAlign = source.verticalAlign;\r\n this.left = source.left;\r\n this.right = source.right;\r\n this.top = source.top;\r\n this.bottom = source.bottom;\r\n this.adapter.copyFrom(source.adapter);\r\n };\r\n return Popup;\r\n}(BaseObjectEvents));\r\nexport { Popup };\r\n","import { StyleRule } from \"../utils/DOM\";\r\nimport { Dictionary } from \"../utils/Dictionary\";\r\nimport { MultiDisposer, CounterDisposer } from \"../utils/Disposer\";\r\nimport { InterfaceColorSet } from \"../utils/InterfaceColorSet\";\r\nvar rules = new Dictionary();\r\n/**\r\n * Default CSS for Popup.\r\n *\r\n * @ignore Exclude from docs\r\n * @param prefix Prefix for CSS classes\r\n * @return Disposer for the CSS definition\r\n */\r\nexport default function (element, prefix) {\r\n if (!prefix) {\r\n prefix = \"ampopup\";\r\n }\r\n var cs = new InterfaceColorSet();\r\n var fg = cs.getFor(\"text\");\r\n var bg = cs.getFor(\"background\");\r\n bg.alpha = 0.8;\r\n var abg = cs.getFor(\"alternativeBackground\");\r\n abg.alpha = 0.05;\r\n var counter = rules.insertKeyIfEmpty(prefix, function () {\r\n var disposer = new MultiDisposer([\r\n new StyleRule(element, \".\" + prefix, {\r\n //\"width\": \"100%\",\r\n //\"height\": \"100%\",\r\n \"overflow\": \"visible\",\r\n \"position\": \"absolute\",\r\n \"top\": \"0\",\r\n \"left\": \"0\",\r\n \"z-index\": \"2000\"\r\n }),\r\n new StyleRule(element, \".\" + prefix + \"-curtain\", {\r\n \"width\": \"100%\",\r\n \"height\": \"100%\",\r\n \"position\": \"absolute\",\r\n \"top\": \"0\",\r\n \"left\": \"0\",\r\n \"z-index\": \"2001\",\r\n \"background-color\": bg.hex,\r\n \"opacity\": \"0.5\"\r\n }),\r\n new StyleRule(element, \".\" + prefix + \"-header\", {\r\n \"display\": \"block\",\r\n \"width\": \"100%\",\r\n \"min-height\": \"1.8em\",\r\n \"background\": abg.rgba\r\n }),\r\n new StyleRule(element, \".\" + prefix + \"-title\", {\r\n \"font-weight\": \"bold\",\r\n \"font-size\": \"110%\",\r\n \"padding\": \"0.5em 1.2em 0.5em 1em\"\r\n }),\r\n new StyleRule(element, \".\" + prefix + \"-content\", {\r\n /*\"width\": \"100%\",\r\n \"height\": \"100%\",*/\r\n // \"padding\": \"2em 1em 1em 1em\",\r\n \"background\": bg.hex,\r\n \"background-color\": bg.rgba,\r\n \"color\": fg.hex,\r\n \"display\": \"inline-block\",\r\n \"position\": \"absolute\",\r\n \"top\": \"0\",\r\n \"left\": \"0\",\r\n \"max-width\": \"90%\",\r\n \"max-height\": \"90%\",\r\n \"overflow\": \"auto\",\r\n \"z-index\": \"2002\"\r\n }),\r\n new StyleRule(element, \".\" + prefix + \"-inside\", {\r\n \"padding\": \"1em\"\r\n }),\r\n new StyleRule(element, \".\" + prefix + \"-close\", {\r\n \"display\": \"block\",\r\n \"position\": \"absolute\",\r\n \"top\": \"0.3em\",\r\n \"right\": \"0.3em\",\r\n \"background-color\": \"rgb(100, 100, 100)\",\r\n \"background\": \"rgba(100, 100, 100, 0.1) url(data:image/svg+xml;charset=utf-8;base64,PHN2ZyBoZWlnaHQ9IjUxMiIgdmVyc2lvbj0iMSIgdmlld0JveD0iMCAwIDUxMiA1MTIiIHdpZHRoPSI1MTIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTQ0NS4yIDEwOS4ybC00Mi40LTQyLjRMMjU2IDIxMy42IDEwOS4yIDY2LjhsLTQyLjQgNDIuNEwyMTMuNiAyNTYgNjYuOCA0MDIuOGw0Mi40IDQyLjRMMjU2IDI5OC40bDE0Ni44IDE0Ni44IDQyLjQtNDIuNEwyOTguNCAyNTYiLz48L3N2Zz4=) no-repeat center\",\r\n \"background-size\": \"80%\",\r\n \"width\": \"1.2em\",\r\n \"height\": \"1.2em\",\r\n \"cursor\": \"pointer\"\r\n }),\r\n ]);\r\n return new CounterDisposer(function () {\r\n rules.removeKey(prefix);\r\n disposer.dispose();\r\n });\r\n });\r\n return counter.increment();\r\n}\r\n","/**\r\n * Preloader module.\r\n *\r\n * Preloader is a progress indicator.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Container } from \"../Container\";\r\nimport { InterfaceColorSet } from \"../../core/utils/InterfaceColorSet\";\r\nimport { Slice } from \"./Slice\";\r\nimport { Label } from \"./Label\";\r\nimport { registry } from \"../Registry\";\r\nimport { percent } from \"../../core/utils/Percent\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * A class used to draw and display progress indicator.\r\n *\r\n * @see {@link IPreloaderEvents} for a list of available events\r\n * @see {@link IPreloaderAdapters} for a list of available Adapters\r\n */\r\nvar Preloader = /** @class */ (function (_super) {\r\n __extends(Preloader, _super);\r\n /**\r\n * Constructor\r\n */\r\n function Preloader() {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n _this.className = \"Preloader\";\r\n // Set dimensions\r\n _this.width = percent(100);\r\n _this.height = percent(100);\r\n var interfaceColors = new InterfaceColorSet();\r\n // Create main container\r\n var sliceContainer = _this.createChild(Container);\r\n sliceContainer.shouldClone = false;\r\n // Add background (100%) slice\r\n var backgroundSlice = sliceContainer.createChild(Slice);\r\n backgroundSlice.shouldClone = false;\r\n backgroundSlice.radius = 53;\r\n backgroundSlice.arc = 360;\r\n backgroundSlice.fill = interfaceColors.getFor(\"fill\");\r\n backgroundSlice.fillOpacity = 0.8;\r\n backgroundSlice.innerRadius = 42;\r\n backgroundSlice.isMeasured = false;\r\n _this.backgroundSlice = backgroundSlice;\r\n // Add progress slice\r\n var progressSlice = sliceContainer.createChild(Slice);\r\n progressSlice.shouldClone = false;\r\n progressSlice.radius = 50;\r\n progressSlice.innerRadius = 45;\r\n progressSlice.fill = interfaceColors.getFor(\"alternativeBackground\");\r\n progressSlice.fillOpacity = 0.2;\r\n progressSlice.isMeasured = false;\r\n _this.progressSlice = progressSlice;\r\n // Add text label element\r\n var label = sliceContainer.createChild(Label);\r\n label.shouldClone = false;\r\n label.horizontalCenter = \"middle\";\r\n label.verticalCenter = \"middle\";\r\n label.isMeasured = false;\r\n label.fill = interfaceColors.getFor(\"text\");\r\n label.align = \"center\";\r\n label.valign = \"middle\";\r\n label.textAlign = \"middle\";\r\n label.fillOpacity = 0.4;\r\n _this.label = label;\r\n // Set defaults\r\n _this.background.opacity = 1;\r\n _this.background.fill = interfaceColors.getFor(\"background\");\r\n _this.contentAlign = \"center\";\r\n _this.contentValign = \"middle\";\r\n _this.delay = 300;\r\n // Create hidden state\r\n var hiddenState = _this.states.create(\"hidden\");\r\n hiddenState.properties.opacity = 0;\r\n // Hide by default\r\n _this.visible = false;\r\n _this.hide(0);\r\n _this.__disabled = true;\r\n // Make it disposable\r\n // @todo Maybe it's enough to just dispose `sliceContainer`?\r\n _this._disposers.push(_this.backgroundSlice);\r\n _this._disposers.push(_this.progressSlice);\r\n _this._disposers.push(_this.label);\r\n _this._disposers.push(sliceContainer);\r\n return _this;\r\n }\r\n Object.defineProperty(Preloader.prototype, \"progress\", {\r\n /**\r\n * @return Progress (0-1)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"progress\");\r\n },\r\n /**\r\n * Current preload progress. (0-1)\r\n *\r\n * * 0 - 0%\r\n * * 0.5 - 50%\r\n * * 1 - 100%\r\n *\r\n * Setting this to a value less than 1, will automatically reveal the\r\n * preloader, while setting it to 1 (100%) will hide it.\r\n *\r\n * @param value Progress (0-1)\r\n */\r\n set: function (value) {\r\n var _this = this;\r\n this.__disabled = false;\r\n this.validateLayout(); // show not in center without this\r\n this.setPropertyValue(\"progress\", value);\r\n /*if (!this.visible && value == 1) {\r\n return;\r\n }*/\r\n this.progressSlice.arc = 360 * value;\r\n if (this.label) {\r\n this.label.text = Math.round(value * 100) + \"%\";\r\n }\r\n if (value >= 1) {\r\n // Cancel the timeout\r\n if (this._started) {\r\n this._started = undefined;\r\n }\r\n // TODO remove closure ?\r\n registry.events.once(\"enterframe\", function () {\r\n var animation = _this.hide();\r\n if (animation && !animation.isFinished()) {\r\n animation.events.once(\"animationended\", function () {\r\n _this.__disabled = true;\r\n });\r\n }\r\n else {\r\n _this.__disabled = true;\r\n }\r\n });\r\n this.interactionsEnabled = false;\r\n this.setPropertyValue(\"progress\", 0);\r\n }\r\n else if (value > 0) {\r\n if (this.delay) {\r\n if (!this._started) {\r\n this._started = new Date().getTime();\r\n }\r\n else if ((this._started + this.delay) <= new Date().getTime()) {\r\n this.__disabled = false;\r\n this.show();\r\n this.interactionsEnabled = true;\r\n }\r\n }\r\n else {\r\n this.__disabled = false;\r\n this.show();\r\n this.interactionsEnabled = true;\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Preloader.prototype, \"delay\", {\r\n /**\r\n * @return Delay (ms)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"delay\");\r\n },\r\n /**\r\n * Delay display of preloader by X milliseconds.\r\n *\r\n * When loading starts (`progress` is set to <1) and finishes (`progress` is\r\n * set to 1) before `delay` ms, the loader is never shown.\r\n *\r\n * This is used to avoid brief flashing of the preload for very quick loads.\r\n *\r\n * @default 1000\r\n * @param value Delay (ms)\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"delay\", value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return Preloader;\r\n}(Container));\r\nexport { Preloader };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Preloader\"] = Preloader;\r\n","/**\r\n * Functionality for drawing rectangles.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Sprite } from \"../Sprite\";\r\nimport { registry } from \"../Registry\";\r\nimport * as $math from \"../utils/Math\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Used to draw a rectangle.\r\n *\r\n * @see {@link IRectangleEvents} for a list of available events\r\n * @see {@link IRectangleAdapters} for a list of available Adapters\r\n */\r\nvar Rectangle = /** @class */ (function (_super) {\r\n __extends(Rectangle, _super);\r\n /**\r\n * Constructor\r\n * * Creates a `<rect>` element\r\n * * Creates default state\r\n */\r\n function Rectangle() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"Rectangle\";\r\n _this.element = _this.paper.add(\"rect\");\r\n //this.pixelPerfect = false;\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Draws the element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Rectangle.prototype.draw = function () {\r\n _super.prototype.draw.call(this);\r\n var precision = this._positionPrecision;\r\n if (this.pixelPerfect) {\r\n precision = 0;\r\n }\r\n var w = $math.round(this.innerWidth, precision);\r\n var h = $math.round(this.innerHeight, precision);\r\n this.element.attr({\r\n \"width\": w,\r\n \"height\": h\r\n });\r\n };\r\n /**\r\n * Measures the element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Rectangle.prototype.measureElement = function () {\r\n };\r\n Object.defineProperty(Rectangle.prototype, \"bbox\", {\r\n /**\r\n * Returns bounding box (square) for this element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n get: function () {\r\n if (this.definedBBox) {\r\n return this.definedBBox;\r\n }\r\n if (this.isMeasured) {\r\n return {\r\n x: 0,\r\n y: 0,\r\n width: this.innerWidth,\r\n height: this.innerHeight\r\n };\r\n }\r\n else {\r\n return { x: 0, y: 0, width: 0, height: 0 };\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return Rectangle;\r\n}(Sprite));\r\nexport { Rectangle };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Rectangle\"] = Rectangle;\r\n","/**\r\n * Resize button module.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Button } from \"./Button\";\r\nimport { Sprite } from \"../Sprite\";\r\nimport { InterfaceColorSet } from \"../../core/utils/InterfaceColorSet\";\r\nimport { registry } from \"../Registry\";\r\nimport * as $path from \"../rendering/Path\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Creates a draggable resize/grip button.\r\n *\r\n * @see {@link IResizeButtonEvents} for a list of available events\r\n * @see {@link IResizeButtonAdapters} for a list of available Adapters\r\n */\r\nvar ResizeButton = /** @class */ (function (_super) {\r\n __extends(ResizeButton, _super);\r\n /**\r\n * Constructor\r\n */\r\n function ResizeButton() {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n _this.className = \"ResizeButton\";\r\n // Set defaults\r\n _this.orientation = \"horizontal\";\r\n _this.layout = \"absolute\";\r\n _this.horizontalCenter = \"middle\";\r\n _this.verticalCenter = \"middle\";\r\n _this.draggable = true;\r\n _this.padding(8, 8, 8, 8);\r\n _this.background.cornerRadius(20, 20, 20, 20);\r\n // Create an icon\r\n var icon = new Sprite();\r\n icon.element = _this.paper.add(\"path\");\r\n var path = $path.moveTo({ x: -2, y: -6 });\r\n path += $path.lineTo({ x: -2, y: 6 });\r\n path += $path.moveTo({ x: 2, y: -6 });\r\n path += $path.lineTo({ x: 2, y: 6 });\r\n icon.path = path;\r\n icon.pixelPerfect = true;\r\n icon.padding(0, 4, 0, 4);\r\n icon.stroke = new InterfaceColorSet().getFor(\"alternativeText\");\r\n icon.strokeOpacity = 0.7;\r\n //icon.align = \"center\";\r\n //icon.valign = \"middle\";\r\n _this.icon = icon;\r\n _this.label.dispose();\r\n _this.label = undefined;\r\n // Apply theme\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n Object.defineProperty(ResizeButton.prototype, \"orientation\", {\r\n /**\r\n * Use for setting of direction (orientation) of the resize button.\r\n *\r\n * Available options: \"horizontal\", \"vertical\".\r\n *\r\n * @param value Orientation\r\n */\r\n set: function (value) {\r\n var icon = this.icon;\r\n if (icon) {\r\n if (value == \"horizontal\") {\r\n icon.rotation = 0;\r\n }\r\n else {\r\n icon.rotation = -90;\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return ResizeButton;\r\n}(Button));\r\nexport { ResizeButton };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"ResizeButton\"] = ResizeButton;\r\n","/**\r\n * Rounded rectangle module.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Sprite } from \"../Sprite\";\r\nimport { registry } from \"../Registry\";\r\nimport * as $math from \"../utils/Math\";\r\nimport * as $type from \"../utils/Type\";\r\nimport * as $utils from \"../utils/Utils\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Draws a rectangle with rounded corners.\r\n *\r\n * @see {@link IRoundedRectangleEvents} for a list of available events\r\n * @see {@link IRoundedRectangleAdapters} for a list of available Adapters\r\n */\r\nvar RoundedRectangle = /** @class */ (function (_super) {\r\n __extends(RoundedRectangle, _super);\r\n /**\r\n * Constructor\r\n */\r\n function RoundedRectangle() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"RoundedRectangle\";\r\n _this.element = _this.paper.add(\"path\");\r\n _this.cornerRadius(3, 3, 3, 3);\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Draws the element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n RoundedRectangle.prototype.draw = function () {\r\n _super.prototype.draw.call(this);\r\n var w = this.innerWidth;\r\n var h = this.innerHeight;\r\n if ($type.isNumber(w) && $type.isNumber(h)) {\r\n var minSide = $math.min(w, h) / 2;\r\n var cornerRadiusTopLeft = $utils.relativeToValue(this.cornerRadiusTopLeft, minSide);\r\n var cornerRadiusTopRight = $utils.relativeToValue(this.cornerRadiusTopRight, minSide);\r\n var cornerRadiusBottomRight = $utils.relativeToValue(this.cornerRadiusBottomRight, minSide);\r\n var cornerRadiusBottomLeft = $utils.relativeToValue(this.cornerRadiusBottomLeft, minSide);\r\n var maxcr = $math.min(Math.abs(w / 2), Math.abs(h / 2));\r\n var crtl = $math.fitToRange(cornerRadiusTopLeft, 0, maxcr);\r\n var crtr = $math.fitToRange(cornerRadiusTopRight, 0, maxcr);\r\n var crbr = $math.fitToRange(cornerRadiusBottomRight, 0, maxcr);\r\n var crbl = $math.fitToRange(cornerRadiusBottomLeft, 0, maxcr);\r\n var lineT = \"M\" + crtl + \",0 L\" + (w - crtr) + \",0\";\r\n var lineB = \" L\" + crbl + \",\" + h;\r\n var lineL = \" L0,\" + crtl;\r\n var lineR = \" L\" + w + \",\" + (h - crbr);\r\n var arcTR = \" a\" + crtr + \",\" + crtr + \" 0 0 1 \" + crtr + \",\" + crtr;\r\n var arcBR = \" a\" + crbr + \",\" + crbr + \" 0 0 1 -\" + crbr + \",\" + crbr;\r\n var arcBL = \" a\" + crbl + \",\" + crbl + \" 0 0 1 -\" + crbl + \",-\" + crbl;\r\n var arcTL = \" a\" + crtl + \",\" + crtl + \" 0 0 1 \" + crtl + \",-\" + crtl;\r\n var path = lineT + arcTR + lineR + arcBR + lineB + arcBL + lineL + arcTL + \" Z\";\r\n this.path = path;\r\n }\r\n };\r\n /**\r\n * Sets radius for all four corners at ones.\r\n *\r\n * All numbers are in pixels.\r\n *\r\n * @param tl Top-left corner\r\n * @param tr Top-right corner\r\n * @param bl Bottom-left corner\r\n * @param br Bottom-right corner\r\n */\r\n RoundedRectangle.prototype.cornerRadius = function (tl, tr, bl, br) {\r\n this.cornerRadiusTopLeft = tl;\r\n this.cornerRadiusTopRight = tr;\r\n this.cornerRadiusBottomLeft = bl;\r\n this.cornerRadiusBottomRight = br;\r\n };\r\n Object.defineProperty(RoundedRectangle.prototype, \"cornerRadiusTopLeft\", {\r\n /**\r\n * @return Radius (px or Percent)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"cornerRadiusTopLeft\");\r\n },\r\n /**\r\n * Radius of the top-left corner in pixels.\r\n *\r\n * @default 3\r\n * @param value Radius (px or Percent)\r\n */\r\n set: function (value) {\r\n this.setPercentProperty(\"cornerRadiusTopLeft\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(RoundedRectangle.prototype, \"cornerRadiusTopRight\", {\r\n /**\r\n * @return Radius (px or Percent)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"cornerRadiusTopRight\");\r\n },\r\n /**\r\n * Radius of the top-right corner in pixels.\r\n *\r\n * @default 3\r\n * @param value Radius (px or Percent)\r\n */\r\n set: function (value) {\r\n this.setPercentProperty(\"cornerRadiusTopRight\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(RoundedRectangle.prototype, \"cornerRadiusBottomRight\", {\r\n /**\r\n * @return Radius (px or Percent)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"cornerRadiusBottomRight\");\r\n },\r\n /**\r\n * Radius of the bottom-right corner in pixels.\r\n *\r\n * @default 3\r\n * @param value Radius (px or Percent)\r\n */\r\n set: function (value) {\r\n this.setPercentProperty(\"cornerRadiusBottomRight\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(RoundedRectangle.prototype, \"cornerRadiusBottomLeft\", {\r\n /**\r\n * @return Radius (px or Percent)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"cornerRadiusBottomLeft\");\r\n },\r\n /**\r\n * Radius of the bottom-left corner in pixels.\r\n *\r\n * @default 3\r\n * @param value Radius (px or Percent)\r\n */\r\n set: function (value) {\r\n this.setPercentProperty(\"cornerRadiusBottomLeft\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Measures the element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n RoundedRectangle.prototype.measureElement = function () {\r\n };\r\n Object.defineProperty(RoundedRectangle.prototype, \"bbox\", {\r\n /**\r\n * Returns bounding box (square) for this element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n get: function () {\r\n if (this.definedBBox) {\r\n return this.definedBBox;\r\n }\r\n if (this.isMeasured) {\r\n return {\r\n x: 0,\r\n y: 0,\r\n width: this.innerWidth,\r\n height: this.innerHeight\r\n };\r\n }\r\n else {\r\n return { x: 0, y: 0, width: 0, height: 0 };\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return RoundedRectangle;\r\n}(Sprite));\r\nexport { RoundedRectangle };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"RoundedRectangle\"] = RoundedRectangle;\r\n","/**\r\n * Provides functionality used to build scrollbars.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Container } from \"../Container\";\r\nimport { ResizeButton } from \"../elements/ResizeButton\";\r\nimport { Button } from \"../elements/Button\";\r\nimport { getInteraction } from \"../interaction/Interaction\";\r\nimport { MouseCursorStyle } from \"../interaction/Mouse\";\r\nimport { RoundedRectangle } from \"../elements/RoundedRectangle\";\r\nimport { registry } from \"../Registry\";\r\nimport { keyboard } from \"../utils/Keyboard\";\r\nimport { InterfaceColorSet } from \"../../core/utils/InterfaceColorSet\";\r\nimport { percent, Percent } from \"../utils/Percent\";\r\nimport * as $math from \"../utils/Math\";\r\nimport * as $ease from \"../utils/Ease\";\r\nimport * as $type from \"../utils/Type\";\r\nimport * as $utils from \"../utils/Utils\";\r\n;\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Scrollbar is a generic control allowing to select a range of values or pan\r\n * the selection.\r\n *\r\n * @see {@link IScrollbarEvents} for a list of available events\r\n * @see {@link IScrollbarAdapters} for a list of available Adapters\r\n */\r\nvar Scrollbar = /** @class */ (function (_super) {\r\n __extends(Scrollbar, _super);\r\n /**\r\n * Construtor\r\n */\r\n function Scrollbar() {\r\n var _this = _super.call(this) || this;\r\n /**\r\n * Previously selected lower (start) value.\r\n */\r\n _this._previousStart = 0;\r\n /**\r\n * Previously selected upper (end) value.\r\n */\r\n _this._previousEnd = 1;\r\n /**\r\n * A value of previously selected lower value, used for doubleclick function.\r\n */\r\n _this._prevStart = 0;\r\n /**\r\n * A value of previously selected upper value, used for doubleclick function.\r\n */\r\n _this._prevEnd = 1;\r\n /**\r\n * Indicates if the Scrollbar is currently \"busy\" (animating and or\r\n * performing zoom by user interaction).\r\n */\r\n _this._isBusy = false;\r\n /**\r\n * [_skipRangeEvents description]\r\n *\r\n * @todo Description\r\n */\r\n _this._skipRangeEvents = false;\r\n /**\r\n * Update the selection when dragging the grips.\r\n *\r\n * If set to `false` selection will be updated only when the grip is\r\n * released.\r\n *\r\n * @default true\r\n */\r\n _this.updateWhileMoving = true;\r\n _this.className = \"Scrollbar\";\r\n _this.minHeight = 12;\r\n _this.minWidth = 12;\r\n _this.animationDuration = 0;\r\n _this.animationEasing = $ease.cubicOut;\r\n _this.margin(10, 10, 10, 10);\r\n var interfaceColors = new InterfaceColorSet();\r\n // background is also container as it might contain graphs, grid, etc\r\n var background = _this.background;\r\n background.cornerRadius(10, 10, 10, 10);\r\n background.fill = interfaceColors.getFor(\"fill\");\r\n background.fillOpacity = 0.5;\r\n // Make system tooltips appear by default\r\n _this.showSystemTooltip = true;\r\n _this.startGrip = new ResizeButton();\r\n _this.endGrip = new ResizeButton();\r\n // Default orientation...\r\n // ... is set in `applyInternalDefaults()` because it accesses `language`\r\n // and should only be started to access when parent is set\r\n // Set events\r\n _this.events.on(\"transformed\", _this.updateThumb, _this, false);\r\n // Initial positions\r\n _this.start = 0;\r\n _this.end = 1;\r\n // Set roles\r\n _this.role = \"scrollbar\";\r\n _this.thumb.role = \"slider\";\r\n _this.thumb.readerLive = \"polite\";\r\n _this.startGrip.role = \"slider\";\r\n _this.endGrip.role = \"slider\";\r\n // otherwise range changed won't be registered\r\n _this.events.once(\"inited\", function () {\r\n _this._previousStart = undefined;\r\n _this.dispatchRangeChange();\r\n }, undefined, false);\r\n _this.hideGrips = false;\r\n _this.orientation = \"horizontal\";\r\n // Min/max values for accessibility\r\n _this.setSVGAttribute({ \"aria-valuemin\": \"0\" });\r\n _this.setSVGAttribute({ \"aria-valuemax\": \"100\" });\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Sets defaults that instantiate some objects that rely on parent, so they\r\n * cannot be set in constructor.\r\n */\r\n Scrollbar.prototype.applyInternalDefaults = function () {\r\n _super.prototype.applyInternalDefaults.call(this);\r\n // Set screen reader tetxt accordingly\r\n if (this.orientation === \"horizontal\") {\r\n if (!$type.hasValue(this.readerTitle)) {\r\n this.readerTitle = this.language.translate(\"Use TAB to select grip buttons or left and right arrows to change selection\");\r\n }\r\n if (!$type.hasValue(this.thumb.readerDescription)) {\r\n this.thumb.readerDescription = this.language.translate(\"Use left and right arrows to move selection\");\r\n }\r\n if (!$type.hasValue(this.startGrip.readerDescription)) {\r\n this.startGrip.readerDescription = this.language.translate(\"Use left and right arrows to move left selection\");\r\n }\r\n if (!$type.hasValue(this.endGrip.readerDescription)) {\r\n this.endGrip.readerDescription = this.language.translate(\"Use left and right arrows to move right selection\");\r\n }\r\n this.readerOrientation = \"horizontal\";\r\n }\r\n else {\r\n if (!$type.hasValue(this.readerTitle)) {\r\n this.readerTitle = this.language.translate(\"Use TAB select grip buttons or up and down arrows to change selection\");\r\n }\r\n if (!$type.hasValue(this.thumb.readerDescription)) {\r\n this.thumb.readerDescription = this.language.translate(\"Use up and down arrows to move selection\");\r\n }\r\n if (!$type.hasValue(this.startGrip.readerDescription)) {\r\n this.startGrip.readerDescription = this.language.translate(\"Use up and down arrows to move upper selection\");\r\n }\r\n if (!$type.hasValue(this.endGrip.readerDescription)) {\r\n this.endGrip.readerDescription = this.language.translate(\"Use up and down arrows to move lower selection\");\r\n }\r\n this.readerOrientation = \"vertical\";\r\n }\r\n this.readerControls = this.baseSprite.uidAttr();\r\n };\r\n /**\r\n * Validates the layout of the scrollbar's elements.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Scrollbar.prototype.validateLayout = function () {\r\n this.updateSize();\r\n _super.prototype.validateLayout.call(this);\r\n // when size changes, need to update extremes\r\n this.updateExtremes();\r\n };\r\n /**\r\n * Update background for the scrollbar.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Scrollbar.prototype.processBackground = function () {\r\n _super.prototype.processBackground.call(this);\r\n var background = this.background;\r\n background.clickable = true;\r\n background.events.on(\"hit\", this.handleBgHit, this, undefined);\r\n };\r\n /**\r\n * Zooms to the particular place when clicked/tapped on the scrollbar\r\n * background.\r\n *\r\n * @ignore Exclude from docs\r\n * @param event Event\r\n */\r\n Scrollbar.prototype.handleBgHit = function (event) {\r\n this.makeBusy();\r\n var point = event.spritePoint;\r\n point = $utils.spritePointToSprite(point, this.background, this);\r\n var thumb = this.thumb;\r\n if (this.orientation == \"horizontal\") {\r\n var thumbX = point.x - thumb.pixelWidth / 2;\r\n thumbX = $math.fitToRange(thumbX, 0, this.innerWidth - thumb.pixelWidth);\r\n this._thumbAnimation = thumb.animate({ property: \"x\", to: thumbX }, this.animationDuration, this.animationEasing);\r\n }\r\n else {\r\n var thumbY = point.y - thumb.pixelHeight / 2;\r\n thumbY = $math.fitToRange(thumbY, 0, this.innerHeight - thumb.pixelHeight);\r\n this._thumbAnimation = thumb.animate({ property: \"y\", to: thumbY }, this.animationDuration, this.animationEasing);\r\n }\r\n if (this.animationDuration > 0) {\r\n this._thumbAnimation.events.on(\"animationended\", this.makeUnbusy, this, false);\r\n }\r\n else {\r\n this._thumb.validate();\r\n this.makeUnbusy();\r\n }\r\n };\r\n /**\r\n * Set scrollbar as busy. (currently zooming)\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Scrollbar.prototype.makeBusy = function () {\r\n this._isBusy = true;\r\n this._skipRangeEvents = false;\r\n if (this._unbusyTimeout) {\r\n this.removeDispose(this._unbusyTimeout);\r\n }\r\n this._unbusyTimeout = undefined;\r\n this.stopAnimations();\r\n };\r\n /**\r\n * Stops all animations, currently playing for the scrollbar.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Scrollbar.prototype.stopAnimations = function () {\r\n if (this._thumbAnimation) {\r\n this._thumbAnimation.stop(true);\r\n }\r\n if (this._zoomAnimation) {\r\n this._zoomAnimation.stop(true);\r\n }\r\n };\r\n /**\r\n * Cancels \"busy\" status of the Scrollbar.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Scrollbar.prototype.makeUnbusy = function () {\r\n /**\r\n * We cannot make Scrollbar not busy right after release, because then axes\r\n * will take over controll and Scrollbar will start to animate.\r\n * Theorethically, it's not right to set timeout by `animationDuration`,\r\n * however we can not know all the durations of elements we scroll, so we\r\n * assume that animation duration will be the same as\r\n * `interpolationDuration` or `rangeChange` duration.\r\n */\r\n this._unbusyTimeout = this.setTimeout(this.makeUnbusyReal.bind(this), this.animationDuration * 1.1);\r\n };\r\n /**\r\n * [makeUnbusyReal description]\r\n *\r\n * @todo Description\r\n * @ignore Exclude from docs\r\n */\r\n Scrollbar.prototype.makeUnbusyReal = function () {\r\n this._usingGrip = undefined;\r\n this._isBusy = false;\r\n if (!this.updateWhileMoving) {\r\n this.dispatchRangeChange();\r\n }\r\n };\r\n /**\r\n * Disptatches rangechanged event if it really changed\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Scrollbar.prototype.dispatchRangeChange = function () {\r\n if (this._previousEnd != this.end || this._previousStart != this.start) {\r\n this._previousStart = this.start;\r\n this._previousEnd = this.end;\r\n this.dispatch(\"rangechanged\");\r\n }\r\n };\r\n /**\r\n * Updates the \"thumb\" element. A draggable element between the grips.\r\n */\r\n Scrollbar.prototype.updateThumb = function () {\r\n if (!this.parent) {\r\n return;\r\n }\r\n var thumb = this.thumb;\r\n var start = this.start;\r\n var end = this.end;\r\n var startGrip = this.startGrip;\r\n var endGrip = this.endGrip;\r\n if (this.orientation == \"horizontal\") {\r\n var innerWidth_1 = this.innerWidth;\r\n thumb.width = innerWidth_1 * (end - start);\r\n thumb.maxX = innerWidth_1 - thumb.pixelWidth;\r\n thumb.x = start * innerWidth_1;\r\n startGrip.moveTo({ x: thumb.pixelX, y: 0 }, undefined, undefined, true); // overrides dragging\r\n endGrip.moveTo({ x: thumb.pixelX + thumb.pixelWidth, y: 0 }, undefined, undefined, true);\r\n startGrip.readerTitle = this.language.translate(\"From %1\", undefined, this.adapter.apply(\"positionValue\", {\r\n value: Math.round(start * 100) + \"%\",\r\n position: start\r\n }).value);\r\n startGrip.readerValueNow = \"\" + Math.round(start * 100);\r\n startGrip.readerValueText = startGrip.readerTitle;\r\n endGrip.readerTitle = this.language.translate(\"To %1\", undefined, this.adapter.apply(\"positionValue\", {\r\n value: Math.round(end * 100) + \"%\",\r\n position: end\r\n }).value);\r\n endGrip.readerValueNow = \"\" + Math.round(end * 100);\r\n endGrip.readerValueText = endGrip.readerTitle;\r\n }\r\n else {\r\n var innerHeight_1 = this.innerHeight;\r\n thumb.height = innerHeight_1 * (end - start);\r\n thumb.maxY = innerHeight_1 - thumb.pixelHeight;\r\n thumb.y = (1 - end) * innerHeight_1;\r\n startGrip.moveTo({ x: 0, y: thumb.pixelY + thumb.pixelHeight }, undefined, undefined, true);\r\n endGrip.moveTo({ x: 0, y: thumb.pixelY }, undefined, undefined, true);\r\n startGrip.readerTitle = this.language.translate(\"To %1\", undefined, this.adapter.apply(\"positionValue\", {\r\n value: Math.round((1 - start) * 100) + \"%\",\r\n position: (1 - start)\r\n }).value);\r\n startGrip.readerValueNow = \"\" + Math.round(start * 100);\r\n startGrip.readerValueText = startGrip.readerTitle;\r\n endGrip.readerTitle = this.language.translate(\"From %1\", undefined, this.adapter.apply(\"positionValue\", {\r\n value: Math.round((1 - end) * 100) + \"%\",\r\n position: (1 - end)\r\n }).value);\r\n endGrip.readerValueNow = \"\" + Math.round(end * 100);\r\n endGrip.readerValueText = endGrip.readerTitle;\r\n }\r\n // Add accessibility\r\n thumb.readerTitle = this.language.translate(\"From %1 to %2\", undefined, this.adapter.apply(\"positionValue\", {\r\n value: Math.round(start * 100) + \"%\",\r\n position: start\r\n }).value, this.adapter.apply(\"positionValue\", {\r\n value: Math.round(end * 100) + \"%\",\r\n position: end\r\n }).value);\r\n thumb.readerValueNow = \"\" + Math.round(start * 100);\r\n thumb.readerValueText = thumb.readerTitle;\r\n this.readerValueNow = \"\" + Math.round(start * 100);\r\n this.readerValueText = thumb.readerTitle;\r\n if (!this._skipRangeEvents && this.updateWhileMoving) {\r\n this.dispatchRangeChange();\r\n }\r\n };\r\n /**\r\n * Updates extremes of the scrollbar.\r\n */\r\n Scrollbar.prototype.updateExtremes = function () {\r\n var orientation = this.orientation;\r\n var minX = 0;\r\n var minY = 0;\r\n var maxX = 0;\r\n var maxY = 0;\r\n if (orientation == \"horizontal\") {\r\n maxX = this.innerWidth;\r\n minY = maxY = this.innerHeight / 2;\r\n }\r\n else {\r\n maxY = this.innerHeight;\r\n minX = maxX = this.innerWidth / 2;\r\n }\r\n var startGrip = this.startGrip;\r\n startGrip.minX = minX;\r\n startGrip.maxX = maxX;\r\n startGrip.minY = minY;\r\n startGrip.maxY = maxY;\r\n var endGrip = this.endGrip;\r\n endGrip.minX = minX;\r\n endGrip.maxX = maxX;\r\n endGrip.minY = minY;\r\n endGrip.maxY = maxY;\r\n var thumb = this.thumb;\r\n thumb.minX = minX;\r\n thumb.maxX = maxX;\r\n thumb.minY = minY;\r\n thumb.maxY = maxY;\r\n };\r\n /**\r\n * Updates size of the scrollbar.\r\n */\r\n Scrollbar.prototype.updateSize = function () {\r\n var orientation = this.orientation;\r\n var startGrip = this.startGrip;\r\n if (startGrip) {\r\n startGrip.orientation = orientation;\r\n }\r\n if (this.endGrip) {\r\n this.endGrip.orientation = orientation;\r\n }\r\n var thumb = this.thumb;\r\n if (thumb) {\r\n if (orientation == \"horizontal\") {\r\n if (!$type.isNumber(this._pixelWidth)) {\r\n if (!(this.width instanceof Percent)) {\r\n this.width = percent(100);\r\n }\r\n }\r\n // this teorethically might be wrong, if user indeed sets height of a horizontal scrollbar in percent\r\n // however without this height might be equal to 100% if previous orientation was set to horizontal\r\n // so this is ok solution, in case user really wants to have scrollbar height set in percent,\r\n // he should do this after orientation.\r\n if ($type.hasValue(this.percentHeight)) {\r\n this.height = this.minHeight;\r\n }\r\n thumb.height = this.innerHeight;\r\n thumb.verticalCenter = \"middle\";\r\n thumb.horizontalCenter = \"left\";\r\n }\r\n else {\r\n if (!$type.isNumber(this._pixelHeight)) {\r\n if (!(this.height instanceof Percent)) {\r\n this.height = percent(100);\r\n }\r\n }\r\n // same as above with percentHeight\r\n if ($type.hasValue(this.percentWidth)) {\r\n this.width = this.minWidth;\r\n }\r\n thumb.width = this.innerWidth;\r\n thumb.verticalCenter = \"top\";\r\n thumb.horizontalCenter = \"middle\";\r\n }\r\n }\r\n };\r\n Object.defineProperty(Scrollbar.prototype, \"isBusy\", {\r\n /**\r\n * Indicates if the Scrollbar is currently \"busy\" (animating and or\r\n * performing zoom by user interaction).\r\n * @return boolean\r\n */\r\n get: function () {\r\n return this._isBusy;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Scrollbar.prototype, \"start\", {\r\n /**\r\n * @return Position (0-1)\r\n */\r\n get: function () {\r\n return Math.min(this.getPosition(this._start), this.getPosition(this._end));\r\n },\r\n /**\r\n * ==========================================================================\r\n * POSITIONS\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Relative position (0-1) of the start grip.\r\n *\r\n * @param position Position (0-1)\r\n */\r\n set: function (position) {\r\n if (!this._isBusy) {\r\n this.__start = position;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Scrollbar.prototype, \"__start\", {\r\n /**\r\n * @return [description]\r\n */\r\n get: function () {\r\n return this._start;\r\n },\r\n /**\r\n * [__start description]\r\n *\r\n * @todo Description\r\n * @param position [description]\r\n */\r\n set: function (position) {\r\n this._start = this.getPosition(position);\r\n this.updateThumb();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Scrollbar.prototype, \"end\", {\r\n /**\r\n * @return Position (0-1)\r\n */\r\n get: function () {\r\n return Math.max(this.getPosition(this._start), this.getPosition(this._end));\r\n },\r\n /**\r\n * Relative position (0-1) of the end grip.\r\n *\r\n * @param position Position (0-1)\r\n */\r\n set: function (position) {\r\n if (!this._isBusy) {\r\n this.__end = position;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Scrollbar.prototype, \"__end\", {\r\n /**\r\n * @return [description]\r\n */\r\n get: function () {\r\n return this._end;\r\n },\r\n /**\r\n * [__end description]\r\n *\r\n * @todo Description\r\n * @param position [description]\r\n */\r\n set: function (position) {\r\n this._end = this.getPosition(position);\r\n this.updateThumb();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Scrollbar.prototype, \"range\", {\r\n /**\r\n * Current selection range.\r\n *\r\n * @readonly\r\n * @return Range\r\n */\r\n get: function () {\r\n return { start: this.start, end: this.end, priority: this._usingGrip };\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Disables range change events.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Scrollbar.prototype.skipRangeEvents = function () {\r\n if (!this._isBusy) {\r\n this._skipRangeEvents = true;\r\n }\r\n };\r\n /**\r\n * [fixRange description]\r\n *\r\n * @todo Description\r\n * @ignore Exclude from docs\r\n * @param range Range\r\n */\r\n Scrollbar.prototype.fixRange = function (range) {\r\n if (range.start != $math.round(this._start, 2) || range.end != $math.round(this._end, 2)) {\r\n this._start = range.start;\r\n this._end = range.end;\r\n this._skipRangeEvents = true;\r\n this.updateThumb();\r\n this._skipRangeEvents = false;\r\n this.thumb.validate();\r\n this.thumb.background.validate();\r\n }\r\n };\r\n /**\r\n * [getPosition description]\r\n *\r\n * @todo Description\r\n * @param position [description]\r\n * @return [description]\r\n */\r\n Scrollbar.prototype.getPosition = function (position) {\r\n return $math.fitToRange($math.round(position, 4), 0, 1);\r\n };\r\n Object.defineProperty(Scrollbar.prototype, \"orientation\", {\r\n /**\r\n * @return Orientation\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"orientation\");\r\n },\r\n /**\r\n * ==========================================================================\r\n * MISC\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Orientation of the scrollbar.\r\n *\r\n * Available options: \"horizontal\" (default) and \"vertical\".\r\n *\r\n * @default \"horizontal\"\r\n * @param value Orientation\r\n */\r\n set: function (value) {\r\n if (this.setPropertyValue(\"orientation\", value)) {\r\n // Set mouse cursors and screen reader tetxt accordingly\r\n if (value === \"horizontal\") {\r\n // Mouse styles\r\n this.startGrip.cursorOverStyle = MouseCursorStyle.horizontalResize;\r\n this.endGrip.cursorOverStyle = MouseCursorStyle.horizontalResize;\r\n // Reader text\r\n /*this.readerTitle = this.language.translate(\"Use TAB to select grip buttons or left and right arrows to change selection\");\r\n this.thumb.readerDescription = this.language.translate(\"Use left and right arrows to move selection\");\r\n this.startGrip.readerDescription = this.language.translate(\"Use left and right arrows to move left selection\");\r\n this.endGrip.readerDescription = this.language.translate(\"Use left and right arrows to move right selection\");*/\r\n }\r\n else {\r\n // Mouse styles\r\n this.startGrip.cursorOverStyle = MouseCursorStyle.verticalResize;\r\n this.endGrip.cursorOverStyle = MouseCursorStyle.verticalResize;\r\n // Reader text\r\n /*this.readerTitle = this.language.translate(\"Use TAB select grip buttons or up and down arrows to change selection\");\r\n this.thumb.readerDescription = this.language.translate(\"Use up and down arrows to move selection\");\r\n this.startGrip.readerDescription = this.language.translate(\"Use up and down arrows to move upper selection\");\r\n this.endGrip.readerDescription = this.language.translate(\"Use up and down arrows to move lower selection\");*/\r\n }\r\n this.updateByOrientation();\r\n this.invalidate();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * @ignore\r\n */\r\n Scrollbar.prototype.updateByOrientation = function () {\r\n };\r\n Object.defineProperty(Scrollbar.prototype, \"startGrip\", {\r\n /**\r\n * @return Grip element\r\n */\r\n get: function () {\r\n return this._startGrip;\r\n },\r\n /**\r\n * ==========================================================================\r\n * GRIPS\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Start grip element. (button)\r\n *\r\n * @param button Grip element\r\n */\r\n set: function (button) {\r\n if (this._startGrip) {\r\n this.removeDispose(this._startGrip);\r\n }\r\n this._startGrip = button;\r\n this.processGrip(button);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Scrollbar.prototype, \"endGrip\", {\r\n /**\r\n * @return Grip element\r\n */\r\n get: function () {\r\n return this._endGrip;\r\n },\r\n /**\r\n * End grip element. (button)\r\n *\r\n * @param button Grip element\r\n */\r\n set: function (button) {\r\n if (this._endGrip) {\r\n this.removeDispose(this._endGrip);\r\n }\r\n this._endGrip = button;\r\n this.processGrip(button);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Decorates the grip button with properties and events.\r\n *\r\n * @ignore Exclude from docs\r\n * @param button Grip button\r\n */\r\n Scrollbar.prototype.processGrip = function (button) {\r\n button.parent = this;\r\n button.isMeasured = false;\r\n button.focusable = true;\r\n button.shouldClone = false;\r\n // Set button defaults\r\n //button.showSystemTooltip = true; // setting this here is not right because we break inheritance\r\n button.zIndex = 100;\r\n button.events.on(\"drag\", this.handleGripDrag, this, false);\r\n button.events.on(\"dragstop\", this.makeUnbusy, this, false);\r\n button.events.on(\"down\", this.makeBusy, this, false);\r\n button.events.on(\"up\", this.makeUnbusy, this, false);\r\n this._disposers.push(button);\r\n };\r\n /**\r\n * Updates positions of related elements after grip element is dragged.\r\n *\r\n * @ignore Exclude from docs\r\n * @param event Event\r\n */\r\n Scrollbar.prototype.handleGripDrag = function (event) {\r\n this.makeBusy();\r\n if (event.target === this._startGrip) {\r\n this._usingGrip = \"start\";\r\n }\r\n else {\r\n this._usingGrip = \"end\";\r\n }\r\n if (this.orientation == \"horizontal\") {\r\n this._start = this.startGrip.pixelX / this.innerWidth;\r\n this._end = this.endGrip.pixelX / this.innerWidth;\r\n }\r\n else {\r\n this._start = 1 - this.startGrip.pixelY / this.innerHeight;\r\n this._end = 1 - this.endGrip.pixelY / this.innerHeight;\r\n }\r\n this.updateThumb();\r\n };\r\n Object.defineProperty(Scrollbar.prototype, \"thumb\", {\r\n /**\r\n * @return Thumb element\r\n */\r\n get: function () {\r\n if (!this._thumb) {\r\n // Create scrollbar controls (setters will handle adding disposers)\r\n var thumb = new Button();\r\n thumb.background.cornerRadius(10, 10, 10, 10);\r\n thumb.padding(0, 0, 0, 0);\r\n this.thumb = thumb;\r\n }\r\n return this._thumb;\r\n },\r\n /**\r\n * A \"thumb\" element.\r\n *\r\n * It's a draggable square space between the grips, that can be used to\r\n * pan the selection.\r\n *\r\n * @param thumb Thumb element\r\n */\r\n set: function (thumb) {\r\n var _this = this;\r\n if (thumb) {\r\n if (this._thumb) {\r\n this.removeDispose(this._thumb);\r\n }\r\n this._thumb = thumb;\r\n thumb.parent = this;\r\n thumb.isMeasured = false;\r\n thumb.inert = true;\r\n thumb.draggable = true;\r\n thumb.clickable = true;\r\n thumb.hoverable = true;\r\n thumb.focusable = true;\r\n thumb.shouldClone = false;\r\n thumb.zIndex = 0;\r\n // TODO remove closures ?\r\n // Add events\r\n // Add cursor styles to thumb\r\n thumb.cursorOverStyle = MouseCursorStyle.grab;\r\n thumb.cursorDownStyle = MouseCursorStyle.grabbing;\r\n thumb.events.on(\"dragstart\", this.makeBusy, this, false);\r\n thumb.events.on(\"dragstop\", this.makeUnbusy, this, false);\r\n thumb.events.on(\"positionchanged\", this.handleThumbPosition, this, false);\r\n thumb.events.on(\"sizechanged\", this.handleThumbPosition, this, false);\r\n thumb.events.on(\"doublehit\", this.handleDoubleClick, this, false);\r\n // Add event for space and ENTER to toggle full zoom out and back\r\n // (same as doubleclick)\r\n this._disposers.push(getInteraction().body.events.on(\"keyup\", function (ev) {\r\n if (keyboard.isKey(ev.event, [\"space\", \"enter\"]) && _this.thumb.isFocused) {\r\n ev.event.preventDefault();\r\n _this.handleDoubleClick();\r\n }\r\n }));\r\n this._disposers.push(this._thumb);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Zooms-in and out the selection on double-click of the thumb.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Scrollbar.prototype.handleDoubleClick = function () {\r\n this.makeBusy();\r\n var newStart = 0;\r\n var newEnd = 1;\r\n if (this.start != 0 || this.end != 1) {\r\n this._prevStart = this.start;\r\n this._prevEnd = this.end;\r\n }\r\n else {\r\n newStart = this._prevStart;\r\n newEnd = this._prevEnd;\r\n }\r\n var zoomAnimation = this.animate([{ property: \"__start\", to: newStart }, { property: \"__end\", to: newEnd }], this.animationDuration, this.animationEasing);\r\n if (zoomAnimation && !zoomAnimation.isFinished()) {\r\n zoomAnimation.events.on(\"animationended\", this.makeUnbusy, this, false);\r\n this._zoomAnimation = zoomAnimation;\r\n }\r\n else {\r\n this.makeUnbusy();\r\n }\r\n };\r\n /**\r\n * Updates positions of other elements when thumb is moved.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Scrollbar.prototype.handleThumbPosition = function () {\r\n var thumb = this.thumb;\r\n if (this.orientation == \"horizontal\") {\r\n var innerWidth_2 = this.innerWidth;\r\n var w = thumb.innerWidth;\r\n var x = thumb.pixelX;\r\n this._start = x / innerWidth_2;\r\n this._end = (x + w) / innerWidth_2;\r\n this.updateThumb();\r\n }\r\n else {\r\n var innerHeight_2 = this.innerHeight;\r\n var h = thumb.innerHeight;\r\n var y = thumb.pixelY;\r\n this._start = 1 - (y + h) / innerHeight_2;\r\n this._end = 1 - y / innerHeight_2;\r\n this.updateThumb();\r\n }\r\n };\r\n /**\r\n * Creates a background element for the scrollbar.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Background\r\n */\r\n Scrollbar.prototype.createBackground = function () {\r\n return new RoundedRectangle();\r\n };\r\n Object.defineProperty(Scrollbar.prototype, \"hideGrips\", {\r\n /**\r\n * @return Show only on hover?\r\n */\r\n get: function () {\r\n return this._hideGrips;\r\n },\r\n /**\r\n * Use this property to set whether grips should be always visible (`false`),\r\n * or they should just appear on scrollbar hover (`true`).\r\n *\r\n * @param value Show only on hover?\r\n */\r\n set: function (value) {\r\n var _this = this;\r\n this._hideGrips = value;\r\n if (this._overDisposer) {\r\n this.removeDispose(this._overDisposer);\r\n }\r\n if (this._outDisposer) {\r\n this.removeDispose(this._outDisposer);\r\n }\r\n if (value) {\r\n this._overDisposer = this.events.on(\"over\", function () {\r\n _this.startGrip.show();\r\n _this.endGrip.show();\r\n }, undefined, false);\r\n this._outDisposer = this.events.on(\"out\", function () {\r\n _this.startGrip.hide();\r\n _this.endGrip.hide();\r\n }, undefined, false);\r\n this.startGrip.hide();\r\n this.endGrip.hide();\r\n }\r\n else {\r\n this.startGrip.show();\r\n this.endGrip.show();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Scrollbar.prototype, \"animationDuration\", {\r\n /**\r\n * @return Orientation\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"animationDuration\");\r\n },\r\n /**\r\n * Duration in milliseconds of scrollbar animation (happens when user clicks on a background of a scrollbar)\r\n * @default 0\r\n * @param value number\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"animationDuration\", value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Scrollbar.prototype, \"animationEasing\", {\r\n /**\r\n * @return {Function}\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"animationEasing\");\r\n },\r\n /**\r\n * Animation easing function.\r\n * @todo: review description and default\r\n * @default $ease.cubicOut\r\n * @param value (value: number) => number\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"animationEasing\", value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Adds easing functions to \"function\" fields.\r\n *\r\n * @param field Field name\r\n * @return Assign as function?\r\n */\r\n Scrollbar.prototype.asFunction = function (field) {\r\n return field == \"animationEasing\" || _super.prototype.asIs.call(this, field);\r\n };\r\n return Scrollbar;\r\n}(Container));\r\nexport { Scrollbar };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Scrollbar\"] = Scrollbar;\r\n","/**\r\n * Slice module.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Container } from \"../Container\";\r\nimport { Sprite } from \"../Sprite\";\r\nimport { registry } from \"../Registry\";\r\nimport * as $math from \"../utils/Math\";\r\nimport * as $path from \"../rendering/Path\";\r\nimport * as $type from \"../utils/Type\";\r\nimport * as $utils from \"../utils/Utils\";\r\nimport { Percent } from \"../utils/Percent\";\r\nimport { RadialGradient } from \"../rendering/fills/RadialGradient\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Draws a wedged semi-circle - slice. Usually used for Pie/Donut charts.\r\n *\r\n * @see {@link ISliceEvents} for a list of available events\r\n * @see {@link ISliceAdapters} for a list of available Adapters\r\n */\r\nvar Slice = /** @class */ (function (_super) {\r\n __extends(Slice, _super);\r\n /**\r\n * Constructor\r\n */\r\n function Slice() {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n _this.className = \"Slice\";\r\n // Set defaults\r\n _this.setPropertyValue(\"cornerRadius\", 0);\r\n _this.setPropertyValue(\"startAngle\", 0);\r\n _this.setPercentProperty(\"innerRadius\", 0);\r\n _this.setPercentProperty(\"radius\", 0);\r\n _this.setPropertyValue(\"arc\", 0);\r\n _this.setPropertyValue(\"shiftRadius\", 0);\r\n _this.strokeOpacity = 1;\r\n _this.setPropertyValue(\"layout\", \"none\");\r\n // Create a slice wedge element\r\n _this.slice = _this.createChild(Sprite);\r\n _this.slice.isMeasured = false;\r\n _this._disposers.push(_this.slice);\r\n //this.element.attr({ \"stroke-linejoin\": \"round\" });\r\n //this.element.attr({ \"stroke-linecap\": \"round\" });\r\n // Apply theme\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Draws the element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Slice.prototype.draw = function () {\r\n _super.prototype.draw.call(this);\r\n var radiusY = this.radiusY;\r\n if (this.radius > 0 && radiusY == 0) {\r\n radiusY = 0.01;\r\n }\r\n this.slice.path = $path.arc(this.startAngle, this.arc, this.radius, this.pixelInnerRadius, radiusY, this.cornerRadius, this.innerCornerRadius);\r\n this.slice.invalidate();\r\n this.shiftRadius = this.shiftRadius;\r\n if (this.realFill instanceof RadialGradient) {\r\n this.updateGradient(this.realFill);\r\n }\r\n if (this.realStroke instanceof RadialGradient) {\r\n this.updateGradient(this.realStroke);\r\n }\r\n };\r\n Slice.prototype.updateGradient = function (gradient) {\r\n gradient.element.attr({ \"gradientUnits\": \"userSpaceOnUse\" });\r\n gradient.element.attr({ \"r\": this.radius });\r\n gradient.cx = 0;\r\n gradient.cy = 0;\r\n gradient.element.attr({ radius: this.radius });\r\n };\r\n Object.defineProperty(Slice.prototype, \"bbox\", {\r\n /**\r\n * Returns bounding box (square) for this element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n get: function () {\r\n if (this.definedBBox) {\r\n return this.definedBBox;\r\n }\r\n if (this.isMeasured) {\r\n var innerRect = $math.getArcRect(this.startAngle, this.startAngle + this.arc, this.pixelInnerRadius);\r\n var outerRect = $math.getArcRect(this.startAngle, this.startAngle + this.arc, this.radius);\r\n return $math.getCommonRectangle([innerRect, outerRect]);\r\n }\r\n else {\r\n return { x: 0, y: 0, width: 0, height: 0 };\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Slice.prototype, \"startAngle\", {\r\n /**\r\n * @return Angle (0-360)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"startAngle\");\r\n },\r\n /**\r\n * The angle at which left edge of the slice is drawn. (0-360)\r\n *\r\n * 0 is to the right of the center.\r\n *\r\n * @param value Angle (0-360)\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"startAngle\", $math.normalizeAngle(value), true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Slice.prototype, \"arc\", {\r\n /**\r\n * @return [description]\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"arc\");\r\n },\r\n /**\r\n * [arc description]\r\n *\r\n * @todo Description\r\n * @param value [description]\r\n */\r\n set: function (value) {\r\n if (!$type.isNumber(value)) {\r\n value = 0;\r\n }\r\n this.setPropertyValue(\"arc\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Slice.prototype, \"radius\", {\r\n /**\r\n * @return Radius (px)\r\n */\r\n get: function () {\r\n var radius = this.getPropertyValue(\"radius\");\r\n if (!$type.isNumber(radius)) {\r\n radius = 0;\r\n }\r\n return radius;\r\n },\r\n /**\r\n * Radius of the slice in pixels.\r\n *\r\n * @param value Radius (px)\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"radius\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Slice.prototype, \"radiusY\", {\r\n /**\r\n * @return Vertical radius (0-1)\r\n */\r\n get: function () {\r\n var value = this.getPropertyValue(\"radiusY\");\r\n if (!$type.isNumber(value)) {\r\n value = this.radius;\r\n }\r\n return value;\r\n },\r\n /**\r\n * Vertical radius for creating skewed slices.\r\n *\r\n * This is relevant to `radius`, e.g. 0.5 will set vertical radius to half\r\n * the `radius`.\r\n *\r\n * @param value Vertical radius (0-1)\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"radiusY\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Slice.prototype, \"innerRadius\", {\r\n /**\r\n * @return Radius (px or %)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"innerRadius\");\r\n },\r\n /**\r\n * Inner radius of the slice for creating cut out (donut) slices.\r\n *\r\n * @default 0\r\n * @param value Radius (px or %)\r\n */\r\n set: function (value) {\r\n this.setPercentProperty(\"innerRadius\", value, true, false, 10, false);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Slice.prototype, \"pixelInnerRadius\", {\r\n /**\r\n * @return Radius px\r\n */\r\n get: function () {\r\n return $utils.relativeToValue(this.innerRadius, this.radius);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Slice.prototype, \"cornerRadius\", {\r\n /**\r\n * @return Radius (px)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"cornerRadius\");\r\n },\r\n /**\r\n * Radius of slice's outer corners in pixels.\r\n *\r\n * @default 0\r\n * @param value Radius (px)\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"cornerRadius\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Slice.prototype, \"innerCornerRadius\", {\r\n /**\r\n * @return Radius (px)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"innerCornerRadius\");\r\n },\r\n /**\r\n * Radius of slice's inner corners in pixels.\r\n *\r\n * @default 0\r\n * @param value Radius (px)\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"innerCornerRadius\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Slice.prototype, \"shiftRadius\", {\r\n /**\r\n * @return Radius shift\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"shiftRadius\");\r\n },\r\n /**\r\n * Indicates how far (relatively to center) a slice should be moved.\r\n *\r\n * The value is relative to the radius of the slice. Meaning 0 no shift,\r\n * 1 - slice shifted outside by whole of its radius.\r\n *\r\n * @param value Radius shift\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"shiftRadius\", value);\r\n this.dx = value * this.radius * this.ix;\r\n this.dy = value * this.radiusY * this.iy;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Slice.prototype, \"ix\", {\r\n /**\r\n * [ix description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @return [description]\r\n */\r\n get: function () {\r\n return $math.cos(this.middleAngle);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Slice.prototype, \"iy\", {\r\n /**\r\n * [iy description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @return [description]\r\n */\r\n get: function () {\r\n return $math.sin(this.middleAngle);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Slice.prototype, \"middleAngle\", {\r\n /**\r\n * An angle of the slice's middle.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Angle\r\n */\r\n get: function () {\r\n return this.startAngle + this.arc / 2;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * X coordinate for the slice tooltip.\r\n *\r\n * @return X\r\n */\r\n Slice.prototype.getTooltipX = function () {\r\n var value = this.getPropertyValue(\"tooltipX\");\r\n if ($type.isNumber(value)) {\r\n return value;\r\n }\r\n var p = 0.5;\r\n if (value instanceof Percent) {\r\n p = value.value;\r\n }\r\n var innerRadius = $utils.relativeToValue(this.innerRadius, this.radius);\r\n return this.ix * (innerRadius + (this.radius - innerRadius) * p);\r\n };\r\n /**\r\n * Y coordinate for the slice tooltip.\r\n *\r\n * @return Y\r\n */\r\n Slice.prototype.getTooltipY = function () {\r\n var value = this.getPropertyValue(\"tooltipY\");\r\n if ($type.isNumber(value)) {\r\n return value;\r\n }\r\n var p = 0.5;\r\n if (value instanceof Percent) {\r\n p = value.value;\r\n }\r\n var innerRadius = $utils.relativeToValue(this.innerRadius, this.radius);\r\n return this.iy * (innerRadius + (this.radius - innerRadius) * p) + this.slice.dy;\r\n };\r\n return Slice;\r\n}(Container));\r\nexport { Slice };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Slice\"] = Slice;\r\n","/**\r\n * Slider is a scrollbar with just one selection grip.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Scrollbar } from \"../../core/elements/Scrollbar\";\r\nimport { registry } from \"../Registry\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Creates a slider - a version of scrollbar with just one grip.\r\n *\r\n * @see {@link ISliderEvents} for a list of available events\r\n * @see {@link ISliderAdapters} for a list of available Adapters\r\n */\r\nvar Slider = /** @class */ (function (_super) {\r\n __extends(Slider, _super);\r\n /**\r\n * Constructor\r\n */\r\n function Slider() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"Slider\";\r\n _this.thumb.opacity = 0;\r\n _this.thumb.interactionsEnabled = false;\r\n _this.endGrip.opacity = 0;\r\n _this.endGrip.interactionsEnabled = false;\r\n _this.startGrip.events.on(\"drag\", function () {\r\n _this.endGrip.x = _this.startGrip.x;\r\n _this.endGrip.y = _this.startGrip.y;\r\n });\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n Object.defineProperty(Slider.prototype, \"__end\", {\r\n /**\r\n * @return [description]\r\n */\r\n get: function () {\r\n return this._start;\r\n },\r\n set: function (value) {\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Slider.prototype, \"end\", {\r\n /**\r\n * @return [description]\r\n */\r\n get: function () {\r\n return this._start;\r\n },\r\n /**\r\n * Relative position (0-1) of the end grip.\r\n *\r\n * @param position Position (0-1)\r\n */\r\n set: function (position) {\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Slider.prototype, \"start\", {\r\n /**\r\n * @return Position (0-1)\r\n */\r\n get: function () {\r\n return this._start;\r\n },\r\n /**\r\n * Relative position (0-1) of the start grip.\r\n *\r\n * @param position Position (0-1)\r\n */\r\n set: function (position) {\r\n if (!this._isBusy) {\r\n this.__start = position;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return Slider;\r\n}(Scrollbar));\r\nexport { Slider };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Slider\"] = Slider;\r\n","/**\r\n * Functionality for drawing simple SwitchButtons.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Container } from \"../Container\";\r\nimport { Label } from \"./Label\";\r\nimport { Button } from \"../elements/Button\";\r\nimport { InterfaceColorSet } from \"../../core/utils/InterfaceColorSet\";\r\nimport { Circle } from \"../../core/elements/Circle\";\r\nimport { percent } from \"../../core/utils/Percent\";\r\nimport { registry } from \"../Registry\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * SwitchButton class is capable of drawing a simple rectangular SwitchButton with\r\n * optionally rounded corners and an icon in it.\r\n *\r\n * @see {@link ISwitchButtonEvents} for a list of available events\r\n * @see {@link ISwitchButtonAdapters} for a list of available Adapters\r\n */\r\nvar SwitchButton = /** @class */ (function (_super) {\r\n __extends(SwitchButton, _super);\r\n /**\r\n * Constructor\r\n */\r\n function SwitchButton() {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n _this.className = \"SwitchButton\";\r\n _this.tooltipY = 0;\r\n // Set defaults\r\n _this.layout = \"horizontal\";\r\n _this.contentAlign = \"center\";\r\n _this.contentValign = \"middle\";\r\n _this.padding(8, 16, 8, 16);\r\n _this.setStateOnChildren = true;\r\n _this.states.create(\"active\");\r\n var interfaceColors = new InterfaceColorSet();\r\n // Create the label element\r\n var leftLabel = new Label();\r\n leftLabel.fillOpacity = 0.3;\r\n var llas = leftLabel.states.create(\"active\");\r\n llas.properties.fillOpacity = 1;\r\n leftLabel.isActive = true;\r\n _this.leftLabel = leftLabel;\r\n var button = new Button();\r\n var circle = new Circle();\r\n button.contentValign = \"none\";\r\n button.padding(0, 0, 0, 0);\r\n circle.radius = 10;\r\n button.icon = circle;\r\n button.icon.valign = \"middle\";\r\n button.label = undefined;\r\n var p100 = percent(100);\r\n button.background.cornerRadius(p100, p100, p100, p100);\r\n button.width = circle.radius * 3.5;\r\n button.height = circle.radius * 2.1;\r\n button.marginLeft = 8;\r\n button.marginRight = 8;\r\n button.togglable = true;\r\n circle.dx = -circle.radius * 0.7;\r\n circle.fill = interfaceColors.getFor(\"primaryButton\");\r\n var hs = circle.states.create(\"hover\");\r\n hs.properties.fill = interfaceColors.getFor(\"primaryButtonHover\");\r\n var as = circle.states.create(\"active\");\r\n as.properties.fill = interfaceColors.getFor(\"primaryButtonActive\");\r\n as.properties.dx = circle.radius * 0.7;\r\n _this.switchButton = button;\r\n _this.events.on(\"toggled\", function () {\r\n _this.leftLabel.isActive = !_this.isActive;\r\n _this.rightLabel.isActive = _this.isActive;\r\n });\r\n // Create the label element\r\n var rightLabel = new Label();\r\n rightLabel.fillOpacity = 0.3;\r\n var rlas = rightLabel.states.create(\"active\");\r\n rlas.properties.fillOpacity = 1;\r\n _this.rightLabel = rightLabel;\r\n // Set up accessibility\r\n // A Button should be always focusable\r\n _this.role = \"button\";\r\n _this.focusable = true;\r\n rightLabel.valign = \"middle\";\r\n leftLabel.valign = \"middle\";\r\n button.valign = \"middle\";\r\n // Apply theme\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n Object.defineProperty(SwitchButton.prototype, \"leftLabel\", {\r\n /**\r\n * @return Left label element\r\n */\r\n get: function () {\r\n return this._leftLabel;\r\n },\r\n /**\r\n * [[Label]] element to be used for left text.\r\n *\r\n * @param left label element\r\n */\r\n set: function (label) {\r\n if (this._leftLabel) {\r\n this.removeDispose(this._leftLabel);\r\n }\r\n this._leftLabel = label;\r\n if (label) {\r\n label.parent = this;\r\n label.interactionsEnabled = false;\r\n label.shouldClone = false;\r\n this._disposers.push(this._leftLabel);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(SwitchButton.prototype, \"rightLabel\", {\r\n /**\r\n * @return Rigth label element\r\n */\r\n get: function () {\r\n return this._rightLabel;\r\n },\r\n /**\r\n * [[Label]] element to be used for left text.\r\n *\r\n * @param rigth label element\r\n */\r\n set: function (label) {\r\n if (this._rightLabel) {\r\n this.removeDispose(this._rightLabel);\r\n }\r\n this._rightLabel = label;\r\n if (label) {\r\n label.parent = this;\r\n label.interactionsEnabled = false;\r\n label.shouldClone = false;\r\n this._disposers.push(this._rightLabel);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(SwitchButton.prototype, \"switch\", {\r\n /**\r\n * @ignore\r\n * @deprecated Use `switchButton` instead\r\n */\r\n get: function () {\r\n return this._switchButton;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(SwitchButton.prototype, \"switchButton\", {\r\n /**\r\n * @return Button\r\n */\r\n get: function () {\r\n return this._switchButton;\r\n },\r\n /**\r\n * A [[Button]] element for switch.\r\n *\r\n * @param Button\r\n */\r\n set: function (button) {\r\n if (this._switchButton) {\r\n this.removeDispose(this._switchButton);\r\n }\r\n this._switchButton = button;\r\n if (button) {\r\n button.parent = this;\r\n button.shouldClone = false;\r\n this._disposers.push(this._switchButton);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Copies properties and other attributes.\r\n *\r\n * @param source Source\r\n */\r\n SwitchButton.prototype.copyFrom = function (source) {\r\n _super.prototype.copyFrom.call(this, source);\r\n if (source.leftLabel) {\r\n this.leftLabel.copyFrom(source.leftLabel);\r\n }\r\n if (source.rightLabel) {\r\n this.rightLabel.copyFrom(source.rightLabel);\r\n }\r\n if (source.switchButton) {\r\n this.switchButton.copyFrom(source.switchButton);\r\n }\r\n };\r\n return SwitchButton;\r\n}(Container));\r\nexport { SwitchButton };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"SwitchButton\"] = SwitchButton;\r\n","/**\r\n * A module that defines Text element used to indicate links.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Label } from \"../../core/elements/Label\";\r\nimport { MouseCursorStyle } from \"../../core/interaction/Mouse\";\r\nimport { InterfaceColorSet } from \"../../core/utils/InterfaceColorSet\";\r\nimport { registry } from \"../Registry\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Creates a text element with a link.\r\n *\r\n * @see {@link ITextLinkEvents} for a list of available events\r\n * @see {@link ITextLinkAdapters} for a list of available Adapters\r\n */\r\nvar TextLink = /** @class */ (function (_super) {\r\n __extends(TextLink, _super);\r\n /**\r\n * Constructor\r\n */\r\n function TextLink() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"TextLink\";\r\n _this.selectable = true;\r\n var interfaceColors = new InterfaceColorSet();\r\n _this.fill = interfaceColors.getFor(\"primaryButton\").brighten(0.3);\r\n var hoverState = _this.states.create(\"hover\");\r\n hoverState.properties.fill = interfaceColors.getFor(\"primaryButtonHover\").brighten(0.3);\r\n var downState = _this.states.create(\"down\");\r\n downState.properties.fill = interfaceColors.getFor(\"primaryButtonDown\").brighten(0.3);\r\n _this.cursorOverStyle = MouseCursorStyle.pointer;\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n return TextLink;\r\n}(Label));\r\nexport { TextLink };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"TextLink\"] = TextLink;\r\n","/**\r\n * Provides functionality used to creating and showing tooltips (balloons).\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Container } from \"../Container\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport { PointedRectangle } from \"./PointedRectangle\";\r\nimport { Label } from \"../elements/Label\";\r\nimport { Animation } from \"../utils/Animation\";\r\nimport { color } from \"../utils/Color\";\r\nimport { DropShadowFilter } from \"../rendering/filters/DropShadowFilter\";\r\nimport * as $math from \"../utils/Math\";\r\nimport * as $ease from \"../utils/Ease\";\r\nimport * as $utils from \"../utils/Utils\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Tooltip displays text and/or multimedia information in a balloon over chart\r\n * area.\r\n * @see {@link ITooltipEvents} for a list of available events\r\n * @see {@link ITooltipAdapters} for a list of available Adapters\r\n */\r\nvar Tooltip = /** @class */ (function (_super) {\r\n __extends(Tooltip, _super);\r\n /**\r\n * Constructor\r\n */\r\n function Tooltip() {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n /**\r\n * Holds numeric boundary values. Calculated from the `boundingContainer`.\r\n * @ignore\r\n */\r\n _this._boundingRect = { x: -40000, y: -40000, width: 80000, height: 80000 };\r\n /**\r\n * Coordinates tooltip's pointer (stem) should point to.\r\n */\r\n _this._pointTo = { x: 0, y: 0 };\r\n /**\r\n * If set to `true` the pointer/stem of the Tooltip will not go outside\r\n * Tooltip's width or height depending on pointer's orientation.\r\n *\r\n * @default false\r\n */\r\n _this.fitPointerToBounds = false;\r\n /**\r\n * If `tooltipOrientation` is vertical, it can be drawn below or above point\r\n * We need to know this when solving overlapping.\r\n */\r\n _this._verticalOrientation = \"up\";\r\n /**\r\n * @ignore\r\n */\r\n _this.fixDoc = true;\r\n _this.className = \"Tooltip\";\r\n _this.isMeasured = false;\r\n _this.getFillFromObject = true;\r\n _this.margin(5, 5, 5, 5);\r\n _this.defaultState.transitionDuration = 1;\r\n _this.hiddenState.transitionDuration = 1;\r\n // Create chrome/background\r\n var background = _this.background;\r\n background.interactionsEnabled = false;\r\n background.fillOpacity = 0.9;\r\n background.strokeWidth = 1;\r\n background.strokeOpacity = 1;\r\n background.stroke = color(\"#ffffff\");\r\n background.cornerRadius = 3;\r\n background.pointerLength = 6;\r\n background.pointerBaseWidth = 10;\r\n var dropShadow = new DropShadowFilter();\r\n dropShadow.dy = 1;\r\n dropShadow.dx = 1;\r\n dropShadow.opacity = 0.5;\r\n background.filters.push(dropShadow);\r\n _this.autoTextColor = true;\r\n // Create text element\r\n var label = _this.createChild(Label);\r\n label.shouldClone = false;\r\n _this.label = label;\r\n label.padding(7, 12, 4, 12);\r\n label.interactionsEnabled = false;\r\n label.horizontalCenter = \"middle\";\r\n label.fill = color(\"#ffffff\");\r\n _this._disposers.push(label);\r\n _this.label.events.on(\"sizechanged\", _this.drawBackground, _this);\r\n _this.label.zIndex = 1; // @todo remove this line when bg sorting is solved\r\n // Set defaults\r\n _this.pointerOrientation = \"vertical\";\r\n _this.animationDuration = 0;\r\n _this.animationEasing = $ease.cubicOut;\r\n _this.setPropertyValue(\"showInViewport\", false);\r\n // Set accessibility options\r\n _this.role = \"tooltip\";\r\n _this.visible = false;\r\n _this.opacity = 0;\r\n _this.x = 0;\r\n _this.y = 0;\r\n _this.events.on(\"visibilitychanged\", _this.handleVisibility, _this);\r\n // Apply theme\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n Tooltip.prototype.handleVisibility = function () {\r\n if (this.visible) {\r\n this.label.invalidate();\r\n }\r\n };\r\n Object.defineProperty(Tooltip.prototype, \"getStrokeFromObject\", {\r\n /**\r\n * Specifies if tooltip background should get stroke color from the sprite it is pointing to.\r\n *\r\n * @return {boolean}\r\n * @default false\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"getStrokeFromObject\");\r\n },\r\n /**\r\n * Specifies if tooltip background should get stroke color from the sprite it is pointing to.\r\n *\r\n * @param value boolean\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"getStrokeFromObject\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Tooltip.prototype, \"autoTextColor\", {\r\n /**\r\n * @return {boolean}\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"autoTextColor\");\r\n },\r\n /**\r\n * Specifies if text color should be chosen automatically for a better\r\n * readability.\r\n *\r\n * IMPORTANT: this feature is generally ignored, if `getFillFromObject = false`.\r\n *\r\n * If inheriting of `fill` color from object tooltip is displayed for is\r\n * disabled, this feature will not work. If you are explicitly setting a\r\n * color for tooltip background, you may set a color for its label as well\r\n * using `tooltip.label.fill` property.\r\n *\r\n *\r\n * @param value boolean\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"autoTextColor\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Tooltip.prototype, \"keepTargetHover\", {\r\n /**\r\n * @return Keep target hovered?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"keepTargetHover\");\r\n },\r\n /**\r\n * If this tooltip is displayed on hover on some other object, keep that\r\n * element hovered if hovering on the tooltip.\r\n *\r\n * @default false\r\n * @since 4.1.13\r\n * @param value Keep target hovered?\r\n */\r\n set: function (value) {\r\n var _this = this;\r\n if (this.setPropertyValue(\"keepTargetHover\", value, true)) {\r\n if (value) {\r\n this.hoverable = true;\r\n this.background.interactionsEnabled = true;\r\n this._disposers.push(this.events.on(\"over\", function (ev) {\r\n if (_this.targetSprite && _this.targetSprite.hoverable) {\r\n _this.targetSprite.isHover = true;\r\n }\r\n }));\r\n this._disposers.push(this.events.on(\"out\", function (ev) {\r\n if (_this.targetSprite && _this.targetSprite.hoverable) {\r\n //this.hideTooltip();\r\n //this.targetSprite.handleOut();\r\n _this.targetSprite.isHover = false;\r\n }\r\n }));\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Tooltip.prototype, \"showInViewport\", {\r\n /**\r\n * @return Force showing tooltip?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"showInViewport\");\r\n },\r\n /**\r\n * Normally, a tooltip will hide itself if it is pointing to a coordinate\r\n * that is outside viewport.\r\n *\r\n * Setting this setting to `true` will override that and make tooltip\r\n * appear next to the viewport edge closest to the target point.\r\n *\r\n * @default false\r\n * @since 4.5.7\r\n * @param value Force showing tooltip?\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"showInViewport\", value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Tooltip.prototype, \"getFillFromObject\", {\r\n /**\r\n * Specifies if tooltip background should get fill color from the sprite it is pointing to.\r\n *\r\n * @return {boolean}\r\n * @default true\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"getFillFromObject\");\r\n },\r\n /**\r\n * @param value boolean\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"getFillFromObject\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Creates and returns a background element.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Background\r\n */\r\n Tooltip.prototype.createBackground = function () {\r\n return new PointedRectangle();\r\n };\r\n Object.defineProperty(Tooltip.prototype, \"pointerOrientation\", {\r\n /**\r\n * @return Orientation\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"pointerOrientation\");\r\n },\r\n /**\r\n * Pointer orientation: `\"horizontal\"`, `\"vertical\"`, `\"up\"`, `\"down\"`,\r\n * `\"right\"`, or `\"left\"`.\r\n *\r\n * Options`\"horizontal\"` or `\"vertical\"` are location-aware, meaning they\r\n * will change position of the Tooltip based on the target point's position\r\n * in relation to chart center.\r\n *\r\n * Options `\"up\"`, `\"down\"`, `\"right\"`, `\"left\"` are static and will point\r\n * in the specified direction regardless of the position, even if that means\r\n * going out of chart/screen bounds.\r\n *\r\n * IMPORTANT: in some situations, like having multiple tooltips stacked for\r\n * multiple series, the `\"up\"` and `\"down\"` values might be ignored in order\r\n * to make tooltip overlap algorithm work.\r\n *\r\n * @default \"vertical\"\r\n * @param value Orientation\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"pointerOrientation\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Tooltip.prototype, \"animationDuration\", {\r\n /**\r\n * @return Orientation\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"animationDuration\");\r\n },\r\n /**\r\n * Duration in milliseconds for the animation to take place when the tooltip\r\n * is moving from one place to another.\r\n *\r\n * @default 0\r\n * @param value number\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"animationDuration\", value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Tooltip.prototype, \"animationEasing\", {\r\n /**\r\n * @return {Function}\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"animationEasing\");\r\n },\r\n /**\r\n * Tooltip animation (moving from one place to another) easing function.\r\n *\r\n * @default $ease.cubicOut\r\n * @param value (value: number) => number\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"animationEasing\", value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Tooltip.prototype, \"html\", {\r\n /**\r\n * @return HTML content\r\n */\r\n get: function () {\r\n return this.label.html;\r\n },\r\n /**\r\n * HTML content for the Tooltip.\r\n *\r\n * Provided value will be used as is, without applying any further\r\n * formatting to it.\r\n *\r\n * @param value HTML content\r\n */\r\n set: function (value) {\r\n if (this.label.html != value) {\r\n this.label.html = value;\r\n this.invalidate();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Tooltip.prototype, \"text\", {\r\n /**\r\n * @return SVG text\r\n */\r\n get: function () {\r\n return this.label.text;\r\n },\r\n /**\r\n * SVG text content for the Tooltip.\r\n *\r\n * Text can have a number of formatting options supported by\r\n * [[TextFormatter]].\r\n *\r\n * @param value SVG text\r\n */\r\n set: function (value) {\r\n if (this.label.text != value) {\r\n this.label.text = value;\r\n this.invalidate();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Creates the Tooltip.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Tooltip.prototype.draw = function () {\r\n _super.prototype.draw.call(this);\r\n var label = this.label;\r\n if (label.invalid) {\r\n label.validate();\r\n }\r\n var x = this._pointTo.x;\r\n var y = this._pointTo.y;\r\n var boundingRect = this._boundingRect;\r\n var textW = label.measuredWidth;\r\n var textH = label.measuredHeight;\r\n var pointerLength = this.background.pointerLength;\r\n var textX;\r\n var textY;\r\n if (this.ignoreBounds) {\r\n boundingRect = undefined;\r\n }\r\n // try to handle if text is wider than br\r\n if (boundingRect && this.fixDoc && textW > boundingRect.width) {\r\n // TODO maybe this isn't needed ?\r\n $utils.spritePointToDocument({ x: boundingRect.x, y: boundingRect.y }, this.parent);\r\n var p1 = $utils.spritePointToDocument({ x: boundingRect.x + boundingRect.width, y: boundingRect.y + boundingRect.height }, this.parent);\r\n var documentWidth = document.body.offsetWidth;\r\n // TODO maybe this isn't needed ?\r\n $utils.used(document.body.offsetHeight);\r\n if (p1.x > documentWidth / 2) {\r\n boundingRect.x = boundingRect.width - textW;\r\n }\r\n else {\r\n boundingRect.width = boundingRect.x + textW;\r\n }\r\n }\r\n var pointerOrientation = this.pointerOrientation;\r\n // horizontal\r\n if (pointerOrientation == \"horizontal\" || pointerOrientation == \"left\" || pointerOrientation == \"right\") {\r\n textY = -textH / 2;\r\n if (pointerOrientation == \"horizontal\") {\r\n if (boundingRect && x > boundingRect.x + boundingRect.width / 2) {\r\n textX = -textW / 2 - pointerLength;\r\n }\r\n else {\r\n textX = textW / 2 + pointerLength;\r\n }\r\n }\r\n else if (pointerOrientation == \"left\") {\r\n textX = textW / 2 + pointerLength;\r\n }\r\n else {\r\n textX = -textW / 2 - pointerLength;\r\n }\r\n }\r\n // vertical pointer\r\n else {\r\n if (boundingRect) {\r\n textX = $math.fitToRange(0, boundingRect.x - x + textW / 2, boundingRect.x - x + boundingRect.width - textW / 2);\r\n }\r\n if (pointerOrientation == \"vertical\") {\r\n if (boundingRect && y > boundingRect.y + textH + pointerLength) {\r\n textY = -textH - pointerLength;\r\n this._verticalOrientation = \"up\";\r\n }\r\n else {\r\n textY = pointerLength;\r\n this._verticalOrientation = \"down\";\r\n }\r\n }\r\n else if (pointerOrientation == \"down\") {\r\n textY = -textH - pointerLength;\r\n this._verticalOrientation = \"up\";\r\n }\r\n else {\r\n textY = pointerLength;\r\n this._verticalOrientation = \"down\";\r\n }\r\n }\r\n if (boundingRect) {\r\n textY = $math.fitToRange(textY, boundingRect.y - y, boundingRect.y + boundingRect.height - textH - y);\r\n }\r\n label.x = textX;\r\n label.y = textY;\r\n this.drawBackground();\r\n };\r\n /**\r\n * Overrides functionality from the superclass.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Tooltip.prototype.updateBackground = function () {\r\n this.group.addToBack(this.background.group);\r\n };\r\n /**\r\n * Draws Tooltip background (chrome, background and pointer/stem).\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Tooltip.prototype.drawBackground = function () {\r\n var label = this.label;\r\n var background = this.background;\r\n var textWidth = label.measuredWidth;\r\n var textHeight = label.measuredHeight;\r\n var boundingRect = this._boundingRect;\r\n var bgWidth = textWidth;\r\n var bgX = label.pixelX - textWidth / 2;\r\n var bgHeight = textHeight;\r\n var bgY = label.pixelY;\r\n var x = this._pointTo.x;\r\n var y = this._pointTo.y;\r\n var boundX1 = boundingRect.x - x;\r\n var boundX2 = boundX1 + boundingRect.width;\r\n var boundY1 = boundingRect.y - y;\r\n var boundY2 = boundY1 + boundingRect.height;\r\n background.x = bgX;\r\n background.y = bgY;\r\n background.width = bgWidth;\r\n background.height = bgHeight;\r\n if (this.fitPointerToBounds) {\r\n background.pointerX = $math.fitToRange(-background.x, boundX1 - background.x, boundX2 - background.x);\r\n background.pointerY = $math.fitToRange(-background.y, boundY1 - background.y, boundY2 - background.y);\r\n }\r\n else {\r\n background.pointerX = -background.x;\r\n background.pointerY = -background.y;\r\n }\r\n background.validate();\r\n };\r\n /**\r\n *\r\n */\r\n Tooltip.prototype.delayedPointTo = function (point, instantly) {\r\n var _this = this;\r\n if (this._pointToDisposer) {\r\n this._pointToDisposer.dispose();\r\n }\r\n this._pointToDisposer = registry.events.once(\"exitframe\", function () {\r\n _this.pointTo(point, instantly);\r\n });\r\n this.addDisposer(this._pointToDisposer);\r\n };\r\n /**\r\n * Set nes tooltip's anchor point and moves whole tooltip.\r\n *\r\n * @param x X coordinate\r\n * @param y Y coordinate\r\n */\r\n Tooltip.prototype.pointTo = function (point, instantly) {\r\n if (this._pointTo.x != point.x || this._pointTo.y != point.y) {\r\n this._pointTo = point;\r\n this.invalidate();\r\n // this helps to avoid strange animation from nowhere on initial show or when balloon was hidden already\r\n if (!this.visible || instantly) {\r\n this.moveTo(this._pointTo);\r\n if (this._animation) {\r\n this._animation.kill();\r\n }\r\n }\r\n else {\r\n // helps to avoid flicker on top/left corner\r\n if (this.pixelX == 0 && this.pixelY == 0) {\r\n this.moveTo(this._pointTo);\r\n }\r\n else {\r\n if (this._animation) {\r\n this._animation.kill();\r\n }\r\n this._animation = new Animation(this, [{ property: \"x\", to: point.x, from: this.pixelX }, { property: \"y\", to: point.y, from: this.pixelY }], this.animationDuration, this.animationEasing).start();\r\n }\r\n }\r\n }\r\n };\r\n /**\r\n * Sets numeric boundaries Tooltip needs to obey (so it does not go outside\r\n * specific area).\r\n *\r\n * @ignore Exclude from docs\r\n * @param rectangle Boundary rectangle\r\n */\r\n Tooltip.prototype.setBounds = function (rectangle) {\r\n var oldRect = this._boundingRect;\r\n if (oldRect.x != rectangle.x || oldRect.y != rectangle.y || oldRect.width != rectangle.width || oldRect.height != rectangle.height) {\r\n this._boundingRect = rectangle;\r\n this.invalidate();\r\n }\r\n };\r\n Object.defineProperty(Tooltip.prototype, \"boundingContainer\", {\r\n /**\r\n * Sets a [[Container]] instance to be used when calculating numeric\r\n * boundaries for the Tooltip.\r\n *\r\n * @ignore Exclude from docs\r\n * @param container Boundary container\r\n */\r\n set: function (container) {\r\n this._boundingContainer = container;\r\n // TODO remove closures ?\r\n container.events.on(\"sizechanged\", this.updateBounds, this);\r\n container.events.on(\"positionchanged\", this.updateBounds, this);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Updates numeric boundaries for the Tooltip, based on the\r\n * `boundingCountrainer`.\r\n */\r\n Tooltip.prototype.updateBounds = function () {\r\n var boundingContainer = this._boundingContainer;\r\n // to global\r\n var rect = $utils.spriteRectToSvg({\r\n x: boundingContainer.pixelX,\r\n y: boundingContainer.pixelY,\r\n width: boundingContainer.maxWidth,\r\n height: boundingContainer.maxHeight\r\n }, boundingContainer);\r\n this.setBounds(rect);\r\n };\r\n Object.defineProperty(Tooltip.prototype, \"ignoreBounds\", {\r\n /**\r\n * @return Ignore chart bounds?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"ignoreBounds\");\r\n },\r\n /**\r\n * Normally, a tooltip's position will be adjusted so it always fits into\r\n * chart's coundaries.\r\n *\r\n * Setting this to `false` will disable such checks and will allow tooltip\r\n * to \"bleed over\" the edge of the chart.\r\n *\r\n * @default false\r\n * @since 4.10.8\r\n * @param value Ignore chart bounds?\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"ignoreBounds\", value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Tooltip.prototype, \"verticalOrientation\", {\r\n /**\r\n * If tooltipOrientation is vertical, it can be drawn below or above point.\r\n * We need to know this when solving overlapping.\r\n *\r\n * @ignore Exclude from docs\r\n * @return \"up\" | \"down\"\r\n */\r\n get: function () {\r\n return this._verticalOrientation;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Tooltip.prototype, \"tooltip\", {\r\n /**\r\n * To avoid stackoverflow\r\n * @ignore\r\n */\r\n get: function () {\r\n return undefined;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Copies properties and other attributes.\r\n *\r\n * @param source Source\r\n */\r\n Tooltip.prototype.copyFrom = function (source) {\r\n _super.prototype.copyFrom.call(this, source);\r\n this.label.copyFrom(source.label);\r\n if (source._boundingRect) {\r\n this._boundingRect = source._boundingRect;\r\n }\r\n };\r\n /**\r\n * Adds easing functions to \"function\" fields.\r\n *\r\n * @param field Field name\r\n * @return Assign as function?\r\n */\r\n Tooltip.prototype.asFunction = function (field) {\r\n return field == \"animationEasing\" || _super.prototype.asIs.call(this, field);\r\n };\r\n return Tooltip;\r\n}(Container));\r\nexport { Tooltip };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Tooltip\"] = Tooltip;\r\n","/**\r\n * Functionality for drawing a trapezoid.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Sprite } from \"../Sprite\";\r\nimport { percent } from \"../../core/utils/Percent\";\r\nimport { registry } from \"../Registry\";\r\nimport * as $utils from \"../utils/Utils\";\r\nimport * as $type from \"../utils/Type\";\r\nimport * as $path from \"../rendering/Path\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Used to draw a Trapezoid.\r\n *\r\n * @see {@link ITrapezoidEvents} for a list of available events\r\n * @see {@link ITrapezoidAdapters} for a list of available Adapters\r\n */\r\nvar Trapezoid = /** @class */ (function (_super) {\r\n __extends(Trapezoid, _super);\r\n /**\r\n * Constructor\r\n */\r\n function Trapezoid() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"Trapezoid\";\r\n _this.element = _this.paper.add(\"path\");\r\n _this.topSide = percent(100);\r\n _this.bottomSide = percent(100);\r\n _this.leftSide = percent(100);\r\n _this.rightSide = percent(100);\r\n _this.isMeasured = false; // todo: add measureElement\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Draws the element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Trapezoid.prototype.draw = function () {\r\n _super.prototype.draw.call(this);\r\n var w = this.pixelWidth;\r\n var h = this.pixelHeight;\r\n var ts = $utils.relativeToValue(this.topSide, w);\r\n var bs = $utils.relativeToValue(this.bottomSide, w);\r\n var ls = $utils.relativeToValue(this.leftSide, h);\r\n var rs = $utils.relativeToValue(this.rightSide, h);\r\n // 1----2\r\n // | |\r\n // 4----3\r\n var x0 = (w - ts) / 2;\r\n var y0 = (h - ls) / 2;\r\n var x1 = w - (w - ts) / 2;\r\n var y1 = (h - rs) / 2;\r\n var x2 = w - (w - bs) / 2;\r\n var y2 = h - (h - rs) / 2;\r\n var x3 = (w - bs) / 2;\r\n var y3 = h - (h - ls) / 2;\r\n var mt = \"\";\r\n var mr = \"\";\r\n var mb = \"\";\r\n var ml = \"\";\r\n if ($type.hasValue(this.horizontalNeck)) {\r\n var hn = this.horizontalNeck.value;\r\n mt = $path.lineTo({ x: w * hn, y: Math.max(y0, y1) });\r\n mb = $path.lineTo({ x: w * hn, y: Math.min(y2, y3) });\r\n }\r\n if ($type.hasValue(this.verticalNeck)) {\r\n var vn = this.verticalNeck.value;\r\n mr = $path.lineTo({ x: Math.min(x1, x2), y: h * vn });\r\n ml = $path.lineTo({ x: Math.max(x0, x3), y: h * vn });\r\n }\r\n var path = $path.moveTo({ x: x0, y: y0 })\r\n + mt\r\n + $path.lineTo({ x: x1, y: y1 })\r\n + mr\r\n + $path.lineTo({ x: x2, y: y2 })\r\n + mb\r\n + $path.lineTo({ x: x3, y: y3 })\r\n + ml;\r\n this.path = path;\r\n };\r\n Object.defineProperty(Trapezoid.prototype, \"topSide\", {\r\n /**\r\n * @return Width\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"topSide\");\r\n },\r\n /**\r\n * Wdith of the top side. Absolute (px) or relative ([[Percent]]).\r\n *\r\n * @default Percent(100)\r\n * @param value Width\r\n */\r\n set: function (value) {\r\n this.setPercentProperty(\"topSide\", value, true, false, 10, false);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Trapezoid.prototype, \"bottomSide\", {\r\n /**\r\n * @return Width\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"bottomSide\");\r\n },\r\n /**\r\n * Wdith of the bottom side. Absolute (px) or relative ([[Percent]]).\r\n *\r\n * @default Percent(100)\r\n * @param value Width\r\n */\r\n set: function (value) {\r\n this.setPercentProperty(\"bottomSide\", value, true, false, 10, false);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Trapezoid.prototype, \"leftSide\", {\r\n /**\r\n * @return Height\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"leftSide\");\r\n },\r\n /**\r\n * Height of the left side. Absolute (px) or relative ([[Percent]]).\r\n *\r\n * @default Percent(100)\r\n * @param value Height\r\n */\r\n set: function (value) {\r\n this.setPercentProperty(\"leftSide\", value, true, false, 10, false);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Trapezoid.prototype, \"rightSide\", {\r\n /**\r\n * @return Height\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"rightSide\");\r\n },\r\n /**\r\n * Height of the right side. Absolute (px) or relative ([[Percent]]).\r\n *\r\n * @default Percent(100)\r\n * @param value Height\r\n */\r\n set: function (value) {\r\n this.setPercentProperty(\"rightSide\", value, true, false, 10, false);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Trapezoid.prototype, \"horizontalNeck\", {\r\n /**\r\n * @return Horizontal neck position\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"horizontalNeck\");\r\n },\r\n /**\r\n * A relative vertical position of the \"neck\". If the top and bottom sides\r\n * are of different width, and `horizontalNeck` is set, a choke point\r\n * will be created at that position, creating a funnel shape.\r\n *\r\n * @param value Horizontal neck position\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"horizontalNeck\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Trapezoid.prototype, \"verticalNeck\", {\r\n /**\r\n * @return Vertical neck position\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"verticalNeck\");\r\n },\r\n /**\r\n * A relative horizontal position of the \"neck\". If the left and right sides\r\n * are of different height, and `verticalNeck` is set, a choke point\r\n * will be created at that position, creating a funnel shape.\r\n *\r\n * @param value Vertical neck position\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"verticalNeck\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return Trapezoid;\r\n}(Sprite));\r\nexport { Trapezoid };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Trapezoid\"] = Trapezoid;\r\n","/**\r\n * Functionality for drawing triangles.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Sprite } from \"../Sprite\";\r\nimport { registry } from \"../Registry\";\r\nimport * as $path from \"../rendering/Path\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Used to draw a triangle.\r\n *\r\n * @see {@link ITriangleEvents} for a list of available events\r\n * @see {@link ITriangleAdapters} for a list of available Adapters\r\n */\r\nvar Triangle = /** @class */ (function (_super) {\r\n __extends(Triangle, _super);\r\n /**\r\n * Constructor\r\n */\r\n function Triangle() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"Triangle\";\r\n _this.element = _this.paper.add(\"path\");\r\n _this.direction = \"top\";\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Draws the element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Triangle.prototype.draw = function () {\r\n _super.prototype.draw.call(this);\r\n var w = this.pixelWidth;\r\n var h = this.pixelHeight;\r\n var path;\r\n switch (this.direction) {\r\n case \"right\":\r\n path = $path.moveTo({ x: 0, y: 0 })\r\n + $path.lineTo({ x: w, y: h / 2 })\r\n + $path.lineTo({ x: 0, y: h })\r\n + $path.closePath();\r\n break;\r\n case \"left\":\r\n path = $path.moveTo({ x: w, y: 0 })\r\n + $path.lineTo({ x: 0, y: h / 2 })\r\n + $path.lineTo({ x: w, y: h })\r\n + $path.closePath();\r\n break;\r\n case \"bottom\":\r\n path = $path.moveTo({ x: 0, y: 0 })\r\n + $path.lineTo({ x: w, y: 0 })\r\n + $path.lineTo({ x: w / 2, y: h })\r\n + $path.closePath();\r\n break;\r\n case \"top\":\r\n path = $path.moveTo({ x: w / 2, y: 0 })\r\n + $path.lineTo({ x: w, y: h })\r\n + $path.lineTo({ x: 0, y: h })\r\n + $path.closePath();\r\n break;\r\n }\r\n this.path = path;\r\n };\r\n Object.defineProperty(Triangle.prototype, \"direction\", {\r\n /**\r\n * Returns direction of a triangle\r\n *\r\n * @return value\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"direction\");\r\n },\r\n /**\r\n * Sets direction of a triangle\r\n *\r\n * @param value\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"direction\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return Triangle;\r\n}(Sprite));\r\nexport { Triangle };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Triangle\"] = Triangle;\r\n","/**\r\n * Functionality for drawing waved circles.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Circle } from \"./Circle\";\r\nimport { registry } from \"../Registry\";\r\nimport * as $path from \"../rendering/Path\";\r\nimport * as $math from \"../utils/Math\";\r\nimport * as $utils from \"../utils/Utils\";\r\nimport * as $smoothing from \"../../core/rendering/Smoothing\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Draws a waved circle.\r\n *\r\n * @see {@link IWavedCircleEvents} for a list of available events\r\n * @see {@link IWavedCircleAdapters} for a list of available Adapters\r\n */\r\nvar WavedCircle = /** @class */ (function (_super) {\r\n __extends(WavedCircle, _super);\r\n /**\r\n * Constructor\r\n */\r\n function WavedCircle() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"WavedCircle\";\r\n _this.element = _this.paper.add(\"path\");\r\n _this.waveLength = 16;\r\n _this.waveHeight = 4;\r\n _this.fill = undefined;\r\n _this.fillOpacity = 0;\r\n _this.tension = 0.8;\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Draws the waved line.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n WavedCircle.prototype.draw = function () {\r\n var path = \"\";\r\n var radius = this.pixelRadius;\r\n if (radius > 0) {\r\n var points = this.getPoints(radius);\r\n path = $path.moveTo(points[0]) + new $smoothing.Tension(this.tension, this.tension).smooth(points);\r\n }\r\n var innerRadius = this.pixelInnerRadius;\r\n if (innerRadius > 0) {\r\n var points = this.getPoints(innerRadius);\r\n points.reverse();\r\n path += $path.moveTo(points[0]) + new $smoothing.Tension(this.tension, this.tension).smooth(points);\r\n }\r\n this.path = path;\r\n };\r\n /**\r\n * Returns points that circle consists of.\r\n *\r\n * @param radius Radius (px)\r\n * @return Points\r\n */\r\n WavedCircle.prototype.getPoints = function (radius) {\r\n var circleLength = radius * Math.PI * 2;\r\n var halfWaveHeight = this.waveHeight / 2;\r\n var waveLength = circleLength / Math.round(circleLength / this.waveLength);\r\n var halfWaveLength = waveLength / 2;\r\n var points = [];\r\n var count = circleLength / waveLength;\r\n for (var i = 0; i <= count; i++) {\r\n var angle1 = (i * waveLength) / circleLength * 360;\r\n var angle2 = (i * waveLength + halfWaveLength) / circleLength * 360;\r\n points.push({ x: (radius - halfWaveHeight) * $math.cos(angle1), y: (radius - halfWaveHeight) * $math.sin(angle1) });\r\n points.push({ x: (radius + halfWaveHeight) * $math.cos(angle2), y: (radius + halfWaveHeight) * $math.sin(angle2) });\r\n }\r\n points.pop();\r\n return points;\r\n };\r\n Object.defineProperty(WavedCircle.prototype, \"innerRadius\", {\r\n /**\r\n * @return Inner radius\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"innerRadius\");\r\n },\r\n /**\r\n * Inner radius of the circle in pixels (absolute) or [[Percent]] (relative).\r\n *\r\n * @param value Inner radius\r\n */\r\n set: function (value) {\r\n this.setPercentProperty(\"innerRadius\", value, true, false, 10, false);\r\n this.invalidate();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(WavedCircle.prototype, \"pixelInnerRadius\", {\r\n /**\r\n * Calculated inner radius of the circle in pixels.\r\n *\r\n * @readonly\r\n * @return Inner radius (px)\r\n */\r\n get: function () {\r\n return $utils.relativeToValue(this.innerRadius, $math.min(this.innerWidth / 2, this.innerHeight / 2));\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(WavedCircle.prototype, \"waveLength\", {\r\n /**\r\n * @return Wave length (px)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"waveLength\");\r\n },\r\n /**\r\n * Wave length in pixels.\r\n *\r\n * @default 16\r\n * @param value Wave length (px)\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"waveLength\", value);\r\n this.invalidate();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(WavedCircle.prototype, \"waveHeight\", {\r\n /**\r\n * @return Wave height (px)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"waveHeight\");\r\n },\r\n /**\r\n * Wave height in pixels.\r\n *\r\n * @default 4\r\n * @param value Wave height (px)\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"waveHeight\", value);\r\n this.invalidate();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(WavedCircle.prototype, \"tension\", {\r\n /**\r\n * @return Tension\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"tension\");\r\n },\r\n /**\r\n * Tension of the wave.\r\n *\r\n * @default 0.8\r\n * @param value Tension\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"tension\", value);\r\n this.invalidate();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return WavedCircle;\r\n}(Circle));\r\nexport { WavedCircle };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"WavedCircle\"] = WavedCircle;\r\n","/**\r\n * Functionality for drawing waved lines.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Line } from \"./Line\";\r\nimport { color } from \"../utils/Color\";\r\nimport { wavedLine } from \"../rendering/Smoothing\";\r\nimport * as $path from \"../rendering/Path\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Draws a waved line.\r\n *\r\n * @see {@link IWavedLineEvents} for a list of available events\r\n * @see {@link IWavedLineAdapters} for a list of available Adapters\r\n */\r\nvar WavedLine = /** @class */ (function (_super) {\r\n __extends(WavedLine, _super);\r\n /**\r\n * Constructor\r\n */\r\n function WavedLine() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"WavedLine\";\r\n _this.element = _this.paper.add(\"path\");\r\n _this.waveLength = 16;\r\n _this.waveHeight = 4;\r\n _this.tension = 0.8;\r\n _this.pixelPerfect = false;\r\n _this.fill = color();\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Draws the waved line.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n WavedLine.prototype.draw = function () {\r\n //super.draw();\r\n var p1 = { x: this.x1, y: this.y1 };\r\n var p2 = { x: this.x2, y: this.y2 };\r\n this.path = $path.moveTo(p1) + wavedLine(p1, p2, this.waveLength, this.waveHeight, this.tension, true);\r\n };\r\n Object.defineProperty(WavedLine.prototype, \"waveLength\", {\r\n /**\r\n * @return Wave length (px)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"waveLength\");\r\n },\r\n /**\r\n * Wave length in pixels.\r\n *\r\n * @default 16\r\n * @param value Wave length (px)\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"waveLength\", value);\r\n this.invalidate();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(WavedLine.prototype, \"waveHeight\", {\r\n /**\r\n * @return Wave height (px)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"waveHeight\");\r\n },\r\n /**\r\n * Wave height in pixels.\r\n *\r\n * @default 4\r\n * @param value Wave height (px)\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"waveHeight\", value);\r\n this.invalidate();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(WavedLine.prototype, \"tension\", {\r\n /**\r\n * @return Tension\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"tension\");\r\n },\r\n /**\r\n * Tension of the wave.\r\n *\r\n * @default 0.8\r\n * @param value Tension\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"tension\", value);\r\n this.invalidate();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return WavedLine;\r\n}(Line));\r\nexport { WavedLine };\r\n","/**\r\n * Functionality for drawing rectangles with waved edges.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Rectangle } from \"./Rectangle\";\r\nimport { wavedLine } from \"../rendering/Smoothing\";\r\nimport * as $path from \"../rendering/Path\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Draws a rectangle with waved edges.\r\n *\r\n * @see {@link IWavedRectangleEvents} for a list of available events\r\n * @see {@link IWavedRectangleAdapters} for a list of available Adapters\r\n */\r\nvar WavedRectangle = /** @class */ (function (_super) {\r\n __extends(WavedRectangle, _super);\r\n /**\r\n * Constructor\r\n */\r\n function WavedRectangle() {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n _this.className = \"WavedRectangle\";\r\n // Add path element\r\n _this.element = _this.paper.add(\"path\");\r\n // Set defaults\r\n _this.waveLength = 16;\r\n _this.waveHeight = 4;\r\n _this.tension = 0.8;\r\n _this.setPropertyValue(\"wavedLeft\", true);\r\n _this.setPropertyValue(\"wavedRight\", true);\r\n _this.setPropertyValue(\"wavedTop\", true);\r\n _this.setPropertyValue(\"wavedBottom\", true);\r\n // Apply theme\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Draws the waved rectangle.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n WavedRectangle.prototype.draw = function () {\r\n _super.prototype.draw.call(this);\r\n var w = this.pixelWidth;\r\n var h = this.pixelHeight;\r\n if (w > 0 && h > 0) {\r\n var p1 = { x: 0, y: 0 };\r\n var p2 = { x: w, y: 0 };\r\n var p3 = { x: w, y: h };\r\n var p4 = { x: 0, y: h };\r\n var waveLengthH = Math.min(w, this.waveLength);\r\n var waveHeightH = Math.min(h, this.waveHeight);\r\n var waveLengthV = Math.min(h, this.waveLength);\r\n var waveHeightV = Math.min(w, this.waveHeight);\r\n var td = \"\";\r\n var rd = \"\";\r\n var bd = \"\";\r\n var ld = \"\";\r\n if (this.wavedTop) {\r\n td = wavedLine(p1, p2, waveLengthH, waveHeightH, this.tension, true);\r\n }\r\n if (this.wavedRight) {\r\n rd = wavedLine(p2, p3, waveLengthV, waveHeightV, this.tension, true);\r\n }\r\n if (this.wavedBottom) {\r\n bd = wavedLine(p3, p4, waveLengthH, waveHeightH, this.tension, true);\r\n }\r\n if (this.wavedLeft) {\r\n ld = wavedLine(p4, p1, waveLengthV, waveHeightV, this.tension, true);\r\n }\r\n this.path = $path.moveTo(p1) + td + $path.lineTo(p2) + rd + $path.lineTo(p3) + bd + $path.lineTo(p4) + ld + \"z\";\r\n }\r\n };\r\n Object.defineProperty(WavedRectangle.prototype, \"waveLength\", {\r\n /**\r\n * @return Wave length (px)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"waveLength\");\r\n },\r\n /**\r\n * Wave length in pixels.\r\n *\r\n * @default 16\r\n * @param value Wave length (px)\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"waveLength\", value);\r\n this.invalidate();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(WavedRectangle.prototype, \"waveHeight\", {\r\n /**\r\n * @return Wave height (px)\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"waveHeight\");\r\n },\r\n /**\r\n * Wave height in pixels.\r\n *\r\n * @default 4\r\n * @param value Wave height (px)\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"waveHeight\", value);\r\n this.invalidate();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Sets which side should be waved or not. If particular side is set to\r\n * `false`, a straight line will be drawn on that side.\r\n *\r\n * @param top Top waved?\r\n * @param right Right side waved?\r\n * @param bottom Bottom Waved?\r\n * @param left Left side waved?\r\n */\r\n WavedRectangle.prototype.setWavedSides = function (top, right, bottom, left) {\r\n this.wavedTop = top;\r\n this.wavedRight = right;\r\n this.wavedBottom = bottom;\r\n this.wavedLeft = left;\r\n };\r\n Object.defineProperty(WavedRectangle.prototype, \"tension\", {\r\n /**\r\n * @return Tension\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"tension\");\r\n },\r\n /**\r\n * Tension of the wave.\r\n *\r\n * @default 0.8\r\n * @param value Tension\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"tension\", value);\r\n this.invalidate();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(WavedRectangle.prototype, \"wavedRight\", {\r\n /**\r\n * @return Wave right side?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"wavedRight\");\r\n },\r\n /**\r\n * Specifies if right side should be waved.\r\n *\r\n * @default true\r\n * @param value Waved?\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"wavedRight\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(WavedRectangle.prototype, \"wavedLeft\", {\r\n /**\r\n * @return Wave left side?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"wavedLeft\");\r\n },\r\n /**\r\n * Specifies if left side should be waved.\r\n *\r\n * @default true\r\n * @param value Waved?\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"wavedLeft\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(WavedRectangle.prototype, \"wavedTop\", {\r\n /**\r\n * @return Wave top side?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"wavedTop\");\r\n },\r\n /**\r\n * Specifies if top side should be waved.\r\n *\r\n * @default true\r\n * @param value Waved?\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"wavedTop\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(WavedRectangle.prototype, \"wavedBottom\", {\r\n /**\r\n * @return Wave bottom side?\r\n */\r\n get: function () {\r\n return this.getPropertyValue(\"wavedBottom\");\r\n },\r\n /**\r\n * Specifies if bottom side should be waved.\r\n *\r\n * @default true\r\n * @param value Waved?\r\n */\r\n set: function (value) {\r\n this.setPropertyValue(\"wavedBottom\", value, true);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return WavedRectangle;\r\n}(Rectangle));\r\nexport { WavedRectangle };\r\n","/**\r\n * Zoom out button functionality.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Button } from \"./Button\";\r\nimport { Sprite } from \"../Sprite\";\r\nimport { registry } from \"../Registry\";\r\nimport { InterfaceColorSet } from \"../../core/utils/InterfaceColorSet\";\r\nimport * as $path from \"../rendering/Path\";\r\nimport * as $type from \"../../core/utils/Type\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Creates a zoom out button.\r\n *\r\n * @see {@link IZoomOutButtonEvents} for a list of available events\r\n * @see {@link IZoomOutButtonAdapters} for a list of available Adapters\r\n */\r\nvar ZoomOutButton = /** @class */ (function (_super) {\r\n __extends(ZoomOutButton, _super);\r\n /**\r\n * Constructor\r\n */\r\n function ZoomOutButton() {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n _this.className = \"ZoomOutButton\";\r\n _this.padding(9, 9, 9, 9);\r\n //this.dx = - 5;\r\n //this.dy = 5;\r\n _this.showSystemTooltip = true;\r\n var interfaceColors = new InterfaceColorSet();\r\n var background = _this.background;\r\n background.cornerRadius(20, 20, 20, 20);\r\n background.fill = interfaceColors.getFor(\"primaryButton\");\r\n background.stroke = interfaceColors.getFor(\"primaryButtonStroke\");\r\n background.strokeOpacity = 0;\r\n background.states.getKey(\"hover\").properties.fill = interfaceColors.getFor(\"primaryButtonHover\");\r\n background.states.getKey(\"down\").properties.fill = interfaceColors.getFor(\"primaryButtonActive\");\r\n // Create an icon\r\n var icon = new Sprite();\r\n icon.element = _this.paper.add(\"path\");\r\n var path = $path.moveTo({ x: 0, y: 0 });\r\n path += $path.lineTo({ x: 11, y: 0 });\r\n icon.path = path;\r\n icon.pixelPerfect = true;\r\n icon.padding(8, 3, 8, 3);\r\n icon.stroke = interfaceColors.getFor(\"primaryButtonText\");\r\n _this.icon = icon;\r\n // Apply theme\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Sets defaults that instantiate some objects that rely on parent, so they\r\n * cannot be set in constructor.\r\n */\r\n ZoomOutButton.prototype.applyInternalDefaults = function () {\r\n _super.prototype.applyInternalDefaults.call(this);\r\n if (!$type.hasValue(this.readerTitle)) {\r\n this.readerTitle = this.language.translate(\"Zoom Out\");\r\n }\r\n };\r\n return ZoomOutButton;\r\n}(Button));\r\nexport { ZoomOutButton };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"ZoomOutButton\"] = ZoomOutButton;\r\n","/**\r\n * Export module.\r\n *\r\n * Parts of Export functionality rely on the following third party libraries:\r\n *\r\n * [canvg.js](https://github.com/canvg/canvg)\r\n * Copyright (c) Gabe Lerner\r\n * Licensed under [MIT](https://github.com/canvg/canvg/blob/master/LICENSE)\r\n *\r\n * [pdfmake](http://pdfmake.org/)\r\n * Copyright (c) 2014 bpampuch\r\n * Licensed under [MIT](https://github.com/bpampuch/pdfmake/blob/master/LICENSE)\r\n *\r\n * [SheetJS Community Edition](https://github.com/sheetjs/js-xlsx)\r\n * Licensed under [Apache License 2.0](https://github.com/SheetJS/js-xlsx/blob/master/LICENSE)\r\n *\r\n * [JSZip](http://stuartk.com/jszip)\r\n * Copyright (c) Stuart Knightley\r\n * Dual licenced under the [MIT license or GPLv3](https://raw.githubusercontent.com/Stuk/jszip/master/LICENSE.markdown).\r\n */\r\nimport { __awaiter, __extends, __generator } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { ExportMenu } from \"./ExportMenu\";\r\nimport { Adapter } from \"../utils/Adapter\";\r\nimport { Sprite } from \"../Sprite\";\r\nimport { Modal } from \"../elements/Modal\";\r\nimport { List } from \"../utils/List\";\r\nimport { Dictionary } from \"../utils/Dictionary\";\r\nimport { DateFormatter } from \"../formatters/DateFormatter\";\r\nimport { DurationFormatter } from \"../formatters/DurationFormatter\";\r\nimport { NumberFormatter } from \"../formatters/NumberFormatter\";\r\nimport { Language } from \"../utils/Language\";\r\nimport { Validatable } from \"../utils/Validatable\";\r\nimport { color } from \"../utils/Color\";\r\nimport { registry } from \"../Registry\";\r\nimport { options } from \"../Options\";\r\nimport { StyleRule, getComputedStyle } from \"../utils/DOM\";\r\nimport * as $browser from \"../utils/Browser\";\r\nimport * as $object from \"../utils/Object\";\r\nimport * as $net from \"../utils/Net\";\r\nimport * as $dom from \"../utils/DOM\";\r\nimport * as $type from \"../utils/Type\";\r\nimport * as $log from \"../utils/Log\";\r\nimport * as $utils from \"../utils/Utils\";\r\nimport * as $array from \"../utils/Array\";\r\nimport * as $math from \"../utils/Math\";\r\nimport * as $strings from \"../utils/Strings\";\r\n// This is used to cache the pdfmake loading\r\nvar pdfmakePromise;\r\n/**\r\n * Loads pdfmake dynamic module\r\n *\r\n * This is an asynchronous function. Check the description of `getImage()`\r\n * for description and example usage.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Instance of pdfmake\r\n * @async\r\n */\r\nfunction _pdfmake() {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var a, pdfmake, vfs_fonts, global;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0: return [4 /*yield*/, Promise.all([\r\n import(/* webpackChunkName: \"pdfmake\" */ \"pdfmake/build/pdfmake.js\"),\r\n import(/* webpackChunkName: \"pdfmake\" */ \"../../pdfmake/vfs_fonts\")\r\n ])];\r\n case 1:\r\n a = _a.sent();\r\n pdfmake = a[0];\r\n vfs_fonts = a[1];\r\n global = window;\r\n global.pdfMake = global.pdfMake || {};\r\n global.pdfMake.vfs = vfs_fonts.default;\r\n pdfmake.vfs = vfs_fonts.default;\r\n return [2 /*return*/, pdfmake];\r\n }\r\n });\r\n });\r\n}\r\n// TODO better parsing\r\nvar fontFamilySrcRegexp = /src: ([^;]+);/;\r\n// TODO better checks\r\nfunction supportsBlobUri() {\r\n return window.navigator.msSaveOrOpenBlob != null;\r\n}\r\n// TODO move into utils or something ?\r\nfunction blobToDataUri(blob) {\r\n return new Promise(function (resolve, reject) {\r\n // TODO handle abort ?\r\n var f = new FileReader();\r\n f.onload = function (e) { resolve(f.result); };\r\n f.onerror = function (e) { reject(e); };\r\n f.readAsDataURL(blob);\r\n });\r\n}\r\nfunction getCssRules(s) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var sheet, e_1;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n sheet = s.sheet;\r\n _a.label = 1;\r\n case 1:\r\n _a.trys.push([1, 2, , 4]);\r\n return [2 /*return*/, sheet.cssRules];\r\n case 2:\r\n e_1 = _a.sent();\r\n return [4 /*yield*/, new Promise(function (success, error) {\r\n s.addEventListener(\"load\", function () {\r\n success(sheet.cssRules);\r\n }, true);\r\n s.addEventListener(\"error\", function (e) {\r\n error(e);\r\n }, true);\r\n setTimeout(function () {\r\n error(new Error(\"Timeout while waiting for <style> to load\"));\r\n }, 10000);\r\n })];\r\n case 3: \r\n // Needed because of https://bugzilla.mozilla.org/show_bug.cgi?id=625013\r\n return [2 /*return*/, _a.sent()];\r\n case 4: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n}\r\n// This loads a stylesheet by URL and then calls the function with it\r\n// TODO this should be moved into utils or something\r\nfunction loadStylesheet(doc, url, f) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var response, e_2, s, rules;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n _a.trys.push([0, 2, , 3]);\r\n return [4 /*yield*/, $net.load(url)];\r\n case 1:\r\n response = _a.sent();\r\n return [3 /*break*/, 3];\r\n case 2:\r\n e_2 = _a.sent();\r\n console.error(\"Failed to load stylesheet\", url, e_2);\r\n return [2 /*return*/];\r\n case 3:\r\n s = doc.createElement(\"style\");\r\n s.textContent = response.response;\r\n doc.head.appendChild(s);\r\n _a.label = 4;\r\n case 4:\r\n _a.trys.push([4, , 7, 8]);\r\n return [4 /*yield*/, getCssRules(s)];\r\n case 5:\r\n rules = _a.sent();\r\n return [4 /*yield*/, eachStylesheet(doc, url, rules, f)];\r\n case 6:\r\n _a.sent();\r\n return [3 /*break*/, 8];\r\n case 7:\r\n doc.head.removeChild(s);\r\n return [7 /*endfinally*/];\r\n case 8: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n}\r\n// This calls a function for each CSSRule inside of a CSSStyleSheet.\r\n// If the CSSStyleSheet has any @import, then it will recursively call the function for those CSSRules too.\r\n// TODO this should be moved into utils or something\r\nfunction eachStylesheet(doc, topUrl, rules, f) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var promises, length, i, rule, url;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n promises = [];\r\n length = rules.length;\r\n for (i = 0; i < length; i++) {\r\n rule = rules[i];\r\n if (rule.type === CSSRule.IMPORT_RULE) {\r\n url = rule.href;\r\n if (url) {\r\n url = $utils.joinUrl(topUrl, url);\r\n promises.push(loadStylesheet(doc, url, f));\r\n }\r\n }\r\n else {\r\n f(topUrl, rule);\r\n }\r\n }\r\n if (!promises.length) return [3 /*break*/, 2];\r\n return [4 /*yield*/, Promise.all(promises)];\r\n case 1:\r\n _a.sent();\r\n _a.label = 2;\r\n case 2: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n}\r\n// This calls a function for each CSSRule for all of the stylesheets in the page.\r\n// If the CSSStyleSheet has any @import, then it will recursively call the function for those CSSRules too.\r\n// TODO this should be moved into utils or something\r\nfunction eachStylesheets(f) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var iframe, doc_1;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n iframe = document.createElement(\"iframe\");\r\n // This causes it to use the same origin policy as the parent page\r\n iframe.src = \"about:blank\";\r\n // This tries to make it more accessible for screen readers\r\n iframe.setAttribute(\"title\", \"\");\r\n document.head.appendChild(iframe);\r\n _a.label = 1;\r\n case 1:\r\n _a.trys.push([1, , 3, 4]);\r\n doc_1 = iframe.contentDocument;\r\n // TODO use $dom.getRoot instead of document ?\r\n return [4 /*yield*/, Promise.all($array.map(document.styleSheets, function (sheet) {\r\n var url = sheet.href;\r\n if (url == null) {\r\n return eachStylesheet(doc_1, location.href, sheet.cssRules, f);\r\n }\r\n else {\r\n url = $utils.joinUrl(location.href, url);\r\n return loadStylesheet(doc_1, url, f);\r\n }\r\n }))];\r\n case 2:\r\n // TODO use $dom.getRoot instead of document ?\r\n _a.sent();\r\n return [3 /*break*/, 4];\r\n case 3:\r\n document.head.removeChild(iframe);\r\n return [7 /*endfinally*/];\r\n case 4: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n}\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * [[Export]] allows downloading of current snapshot of the chart as an\r\n * image, PDF, or its data in various formats.\r\n *\r\n * The export functionality is enabled by default in charts and is accessible\r\n * via API or optional export menu.\r\n *\r\n * To enable menu, simply access export's `menu` property. E.g.:\r\n *\r\n * ```TypeScript\r\n * chart.exporting.menu = new am4core.ExportMenu();\r\n * ```\r\n * ```JavaScript\r\n * chart.exporting.menu = new am4core.ExportMenu();\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"exporting\": {\r\n * \"menu\": {}\r\n * }\r\n * }\r\n * ```\r\n *\r\n * To export via API, use `export()` method:\r\n *\r\n * ```TypeScript\r\n * chart.exporting.export(type, [options]);\r\n * ```\r\n * ```JavaScript\r\n * chart.exporting.export(type, [options]);\r\n * ```\r\n *\r\n * E.g.:\r\n *\r\n * ```TypeScript\r\n * chart.exporting.export(\"png\");\r\n * ```\r\n * ```JavaScript\r\n * chart.exporting.export(\"png\");\r\n * ```\r\n *\r\n * @todo Better loading indicator?\r\n * @todo Implement multiplier option\r\n * @todo Handling of hanged exports\r\n * @important\r\n */\r\nvar Export = /** @class */ (function (_super) {\r\n __extends(Export, _super);\r\n /**\r\n * Constructor\r\n */\r\n function Export(container) {\r\n var _this = _super.call(this) || this;\r\n /**\r\n * Adapter.\r\n */\r\n _this.adapter = new Adapter(_this);\r\n /**\r\n * Holds options for each format.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this._formatOptions = new Dictionary();\r\n /**\r\n * Extra [[Sprite]] elements to include in exports.\r\n */\r\n _this._extraSprites = [];\r\n /**\r\n * A list of [[Sprite]] elements that need to be valid before export\r\n * commences.\r\n */\r\n _this._validateSprites = [];\r\n /**\r\n * Holds an array of data field names. If set, exported data fields will try\r\n * to maintain this order.\r\n *\r\n * If not set (default), the export will try to maintain the same order as\r\n * in source data, or as in `dataFields` (if set).\r\n *\r\n * @since 4.9.7\r\n */\r\n _this.dataFieldsOrder = [];\r\n /**\r\n * Indicates whether data fields were generated dynamically (`true`) or\r\n * if they were pre-set by the user (`false`).\r\n */\r\n _this._dynamicDataFields = true;\r\n /**\r\n * Holds a list of objects that were temporarily removed from the DOM while\r\n * exporting. Those most probably are tainted images, or foreign objects that\r\n * would otherwise prevent SVG to be converted to canvas.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this._removedObjects = new List();\r\n /**\r\n * Holds references to the objects that were temporarily hidden when export\r\n * started, so that we can reveal them back when export ends.\r\n */\r\n _this._hiddenObjects = [];\r\n /**\r\n * Indicates if non-exportable objects are now hidden;\r\n */\r\n _this._objectsAlreadyHidden = false;\r\n /**\r\n * Exported files will be prefixed with whatever it is set here.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this._filePrefix = \"amCharts\";\r\n /**\r\n * If you are using web fonts (such as Google Fonts), your chart might be\r\n * using them as well.\r\n *\r\n * Normally, exporting to image will require to download these fonts so the\r\n * are carried over to exported image.\r\n *\r\n * This setting can be used to disable or enable this functionality.\r\n *\r\n * @default true\r\n */\r\n _this.useWebFonts = true;\r\n /**\r\n * Many modern displays have use more actual pixels per displayed pixel. This\r\n * results in sharper images on screen. Unfortunately, when exported to a\r\n * bitmap image of the sam width/height size it will lose those extra pixels,\r\n * resulting in somewhat blurry image.\r\n *\r\n * This is why we are going to export images larger than they are, so that we\r\n * don't lose any details.\r\n *\r\n * If you'd rather export images without change in size, set this to `false`.\r\n *\r\n * @default true\r\n */\r\n _this.useRetina = true;\r\n /**\r\n * By default Export will try to use built-in method for transforming chart\r\n * into an image for download, then fallback to external library (canvg) for\r\n * conversion if failed.\r\n *\r\n * Setting this to `false` will force use of external library for all export\r\n * operations.\r\n *\r\n * It might be useful to turn off simplified export if you are using strict\r\n * content security policies, that disallow images with blobs as their\r\n * source.\r\n *\r\n * @default true\r\n * @since 4.2.5\r\n */\r\n _this.useSimplifiedExport = true;\r\n /**\r\n * If export operation takes longer than milliseconds in this second, we will\r\n * show a modal saying export operation took longer than expected.\r\n */\r\n _this.timeoutDelay = 2000;\r\n _this._exportRunning = false;\r\n /**\r\n * Indicator used by [[Component]].\r\n *\r\n * @ignore\r\n */\r\n _this._prevHasData = false;\r\n _this._container = container;\r\n _this.className = \"Export\";\r\n // Set default options\r\n _this._formatOptions.setKey(\"png\", {});\r\n _this._formatOptions.setKey(\"jpg\", {\r\n quality: 0.8\r\n });\r\n _this._formatOptions.setKey(\"gif\", {});\r\n _this._formatOptions.setKey(\"svg\", {});\r\n _this._formatOptions.setKey(\"pdf\", {\r\n fontSize: 14,\r\n imageFormat: \"png\",\r\n align: \"left\",\r\n addURL: true,\r\n addColumnNames: true\r\n });\r\n _this._formatOptions.setKey(\"json\", {\r\n indent: 2,\r\n useLocale: true\r\n });\r\n _this._formatOptions.setKey(\"csv\", {\r\n addColumnNames: true,\r\n emptyAs: \"\"\r\n });\r\n _this._formatOptions.setKey(\"xlsx\", {\r\n addColumnNames: true,\r\n useLocale: true,\r\n emptyAs: \"\"\r\n });\r\n _this._formatOptions.setKey(\"html\", {\r\n addColumnNames: true,\r\n emptyAs: \"\"\r\n });\r\n _this._formatOptions.setKey(\"pdfdata\", {\r\n fontSize: 14,\r\n imageFormat: \"png\",\r\n addURL: true,\r\n addColumnNames: true,\r\n emptyAs: \"\"\r\n });\r\n _this._formatOptions.setKey(\"print\", {\r\n delay: 500,\r\n printMethod: \"iframe\"\r\n });\r\n // Add options adapter\r\n _this.adapter.add(\"options\", function (arg) {\r\n var formatOptions = _this._formatOptions.getKey(arg.type);\r\n if (arg.options) {\r\n arg.options = $object.merge(formatOptions, arg.options);\r\n }\r\n else {\r\n arg.options = formatOptions;\r\n }\r\n return arg;\r\n });\r\n _this.applyTheme();\r\n _this.dispatchImmediately(\"inited\");\r\n return _this;\r\n }\r\n Object.defineProperty(Export.prototype, \"menu\", {\r\n /**\r\n * @return ExportMenu instance\r\n */\r\n get: function () {\r\n return this._menu;\r\n },\r\n /**\r\n * An instance of [[ExportMenu]].\r\n *\r\n * To add an export menu to a chart, set this to a new instance of\r\n * [[ExportMenu]].\r\n *\r\n * ```TypeScript\r\n * chart.exporting.menu = new am4core.ExportMenu();\r\n * ```\r\n * ```JavaScript\r\n * chart.exporting.menu = new am4core.ExportMenu();\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"exporting\": {\r\n * \"menu\": {}\r\n * }\r\n * }\r\n * ```\r\n *\r\n * @param menu ExportMenu instance\r\n */\r\n set: function (menu) {\r\n var _this = this;\r\n if (this._menu) {\r\n this.removeDispose(this._menu);\r\n }\r\n this._menu = menu;\r\n // Set container and language\r\n this._menu.container = this.container;\r\n this._menu.language = this._language;\r\n // Add adapter to check for browser support\r\n this._menu.adapter.add(\"branch\", function (arg) {\r\n arg.branch.unsupported = !_this.typeSupported(arg.branch.type);\r\n return arg;\r\n });\r\n // Add click events\r\n this._menu.events.on(\"hit\", function (ev) {\r\n _this.export(ev.branch.type, ev.branch.options);\r\n _this.menu.close();\r\n });\r\n this._menu.events.on(\"enter\", function (ev) {\r\n _this.export(ev.branch.type, ev.branch.options);\r\n _this.menu.close();\r\n });\r\n this._menu.events.on(\"over\", function (ev) {\r\n _this._disablePointers();\r\n });\r\n this._menu.events.on(\"out\", function (ev) {\r\n setTimeout(function () { _this._releasePointers(); }, 10);\r\n });\r\n // Dispatch event\r\n this.dispatchImmediately(\"menucreated\");\r\n // Prefix with Sprite's class name\r\n this._menu.adapter.add(\"classPrefix\", function (obj) {\r\n obj.classPrefix = options.classNamePrefix + obj.classPrefix;\r\n return obj;\r\n });\r\n // Add menu to disposers so that it's destroyed when Export is disposed\r\n this._disposers.push(this._menu);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Checks if this specific menu item type is supported by current system.\r\n *\r\n * @param type Menu item type\r\n * @return `false` if not supported\r\n */\r\n Export.prototype.typeSupported = function (type) {\r\n var supported = true;\r\n var options = this.getFormatOptions(type);\r\n if ($type.hasValue(options) && options.disabled) {\r\n supported = false;\r\n }\r\n else if (type === \"pdf\") {\r\n //supported = this.downloadSupport();\r\n }\r\n else if (type === \"xlsx\") {\r\n //supported = (this.downloadSupport() && this._hasData()) ? true : false;\r\n supported = this._hasData() ? true : false;\r\n }\r\n else if (type == \"print\" && !window.print) {\r\n supported = false;\r\n }\r\n else if ([\"json\", \"csv\", \"html\", \"pdfdata\"].indexOf(type) !== -1 && !this._hasData()) {\r\n supported = false;\r\n }\r\n return this.adapter.apply(\"supported\", {\r\n supported: supported,\r\n type: type\r\n }).supported;\r\n };\r\n /**\r\n * Checks if data is available.\r\n *\r\n * @return Has data?\r\n */\r\n Export.prototype._hasData = function () {\r\n return this.data && this.data.length;\r\n };\r\n /**\r\n * Get function to handle export for particular format.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Export.prototype._getFunction = function (type) {\r\n switch (type) {\r\n case \"png\":\r\n case \"gif\":\r\n case \"jpg\":\r\n return this.getImage;\r\n case \"svg\":\r\n return this.getSVG;\r\n case \"pdf\":\r\n case \"pdfdata\":\r\n return this.getPDF;\r\n case \"xlsx\":\r\n return this.getExcel;\r\n case \"csv\":\r\n return this.getCSV;\r\n case \"json\":\r\n return this.getJSON;\r\n case \"html\":\r\n return this.getHTML;\r\n case \"print\":\r\n return this.getPrint;\r\n default:\r\n return this.unsupported;\r\n }\r\n };\r\n /**\r\n * Initiates export procedure.\r\n *\r\n * @param type Export type\r\n * @param options Options\r\n * @return `true` if export was successful\r\n * @async\r\n */\r\n Export.prototype.export = function (type, options) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var event_1, func, data, event_2, event_3;\r\n var _this = this;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n // Check if it's a custom item, and do nothing or execute custom callback\r\n if (type == \"custom\") {\r\n this.handleCustom(options);\r\n return [2 /*return*/, true];\r\n }\r\n // Set export running flag\r\n this._exportRunning = true;\r\n // Dispatch event\r\n if (this.events.isEnabled(\"exportstarted\")) {\r\n event_1 = {\r\n \"type\": \"exportstarted\",\r\n \"target\": this,\r\n \"format\": type,\r\n \"options\": options\r\n };\r\n this.events.dispatchImmediately(\"exportstarted\", event_1);\r\n }\r\n // Schedule a preloader\r\n this.showPreloader();\r\n // Schedule a timeout\r\n if (this.timeoutDelay) {\r\n this.hideTimeout();\r\n this._timeoutTimeout = this.setTimeout(function () {\r\n // Dispatch event\r\n if (_this.events.isEnabled(\"exporttimedout\")) {\r\n var event_4 = {\r\n \"type\": \"exporttimedout\",\r\n \"target\": _this,\r\n \"format\": type,\r\n \"options\": options\r\n };\r\n _this.events.dispatchImmediately(\"exporttimedout\", event_4);\r\n }\r\n // Show modal\r\n _this.showTimeout();\r\n }, this.timeoutDelay);\r\n }\r\n // Hide items that should not be exported\r\n this.hideNonExportableSprites();\r\n func = this._getFunction(type);\r\n // Give chance for plugins to override both function and options\r\n options = this.adapter.apply(\"options\", {\r\n options: options,\r\n type: type\r\n }).options;\r\n func = this.adapter.apply(\"exportFunction\", {\r\n func: func,\r\n type: type,\r\n options: options\r\n }).func;\r\n return [4 /*yield*/, func.call(this, type, options)];\r\n case 1:\r\n data = _a.sent();\r\n // Release pointers\r\n this._exportRunning = false;\r\n this._releasePointers();\r\n // Restore temporarily hidden elements\r\n this.restoreNonExportableSprites();\r\n if (data) {\r\n // Dispatch event\r\n if (this.events.isEnabled(\"exportfinished\")) {\r\n event_2 = {\r\n \"type\": \"exportfinished\",\r\n \"target\": this,\r\n \"format\": type,\r\n \"options\": options\r\n };\r\n this.events.dispatchImmediately(\"exportfinished\", event_2);\r\n }\r\n // Hide preloader and timeout modals\r\n this.hidePreloader();\r\n this.hideTimeout();\r\n if (this.menu) {\r\n this.menu.close();\r\n }\r\n // Download or print\r\n if (type === \"print\") {\r\n return [2 /*return*/, this.print(data, options, this.adapter.apply(\"title\", {\r\n title: this.title,\r\n options: options\r\n }).title)];\r\n }\r\n else {\r\n if (type == \"pdfdata\") {\r\n return [2 /*return*/, this.download(data, this.filePrefix + \".pdf\")];\r\n }\r\n return [2 /*return*/, this.download(data, this.filePrefix + \".\" + type)];\r\n }\r\n }\r\n else {\r\n // Throw exception?\r\n // @todo\r\n // Dispatch event\r\n if (this.events.isEnabled(\"error\")) {\r\n event_3 = {\r\n \"type\": \"error\",\r\n \"target\": this,\r\n \"format\": type,\r\n \"options\": options\r\n };\r\n this.events.dispatchImmediately(\"error\", event_3);\r\n }\r\n return [2 /*return*/, false];\r\n }\r\n return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * A function that should handle unsupported export types.\r\n *\r\n * @ignore Exclude from docs\r\n * @param type Export type\r\n * @param options Options\r\n * @return Promise\r\n * @async\r\n */\r\n Export.prototype.unsupported = function (type, options) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n return __generator(this, function (_a) {\r\n // TODO should this return `undefined`?\r\n return [2 /*return*/, \"\"];\r\n });\r\n });\r\n };\r\n /**\r\n * Handles click on a \"custom\" menu item.\r\n *\r\n * Basically, if it has \"callback\" enabled, it will be called. Nothing else.\r\n *\r\n * @ignore Exclude from docs\r\n * @param options Options\r\n */\r\n Export.prototype.handleCustom = function (options) {\r\n if ($type.hasValue(options) && $type.hasValue(options.callback)) {\r\n options.callback.call(options.callbackTarget || this, options);\r\n }\r\n };\r\n /**\r\n * Requests a Print of the chart.\r\n *\r\n * @param type Export type\r\n * @param options Options\r\n * @return Promise\r\n * @async\r\n */\r\n Export.prototype.getPrint = function (type, options) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n return __generator(this, function (_a) {\r\n return [2 /*return*/, this.getImage(\"png\", options)];\r\n });\r\n });\r\n };\r\n /**\r\n * A function that returns data: URI encoded @font-family, so that way it can be embedded into SVG.\r\n *\r\n * @ignore Exclude from docs\r\n * @return String which can be embedded directly into a <style> element.\r\n * @async\r\n */\r\n Export.prototype.getFontFamilies = function () {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var DOMURL, blobs, promises, a;\r\n var _this = this;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n DOMURL = this.getDOMURL();\r\n blobs = [];\r\n promises = [];\r\n return [4 /*yield*/, eachStylesheets(function (topUrl, rule) {\r\n if (rule.type === CSSRule.FONT_FACE_RULE) {\r\n var cssText_1 = rule.cssText;\r\n // TODO this is necessary because Edge doesn't let you access the src using getPropertyValue\r\n var src = fontFamilySrcRegexp.exec(cssText_1);\r\n if (src !== null) {\r\n // TODO make this faster (don't create Promises for non-url stuff)\r\n var urls = src[1].split(/ *, */).map(function (url) { return __awaiter(_this, void 0, void 0, function () {\r\n var a, after, fullUrl, response, url_1, e_3;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n a = /^url\\([\"']?([^\"'\\)]+)[\"']?\\)([^,]*)$/.exec(url);\r\n if (!(a === null)) return [3 /*break*/, 1];\r\n return [2 /*return*/, url];\r\n case 1:\r\n after = a[2];\r\n fullUrl = $utils.joinUrl(topUrl, a[1]);\r\n _a.label = 2;\r\n case 2:\r\n _a.trys.push([2, 7, , 8]);\r\n return [4 /*yield*/, $net.load(fullUrl, undefined, { responseType: \"blob\" })];\r\n case 3:\r\n response = _a.sent();\r\n if (!supportsBlobUri()) return [3 /*break*/, 4];\r\n url_1 = DOMURL.createObjectURL(response.blob);\r\n blobs.push(url_1);\r\n return [3 /*break*/, 6];\r\n case 4: return [4 /*yield*/, blobToDataUri(response.blob)];\r\n case 5:\r\n url_1 = _a.sent();\r\n _a.label = 6;\r\n case 6: \r\n // TODO should it should escape the URI ?\r\n return [2 /*return*/, \"url(\\\"\" + url_1 + \"\\\")\" + after];\r\n case 7:\r\n e_3 = _a.sent();\r\n console.error(\"Failed to load font\", fullUrl, e_3);\r\n return [2 /*return*/, null];\r\n case 8: return [2 /*return*/];\r\n }\r\n });\r\n }); });\r\n promises.push(Promise.all(urls).then(function (a) {\r\n a = a.filter(function (x) { return x != null; });\r\n if (a.length === 0) {\r\n return \"\";\r\n }\r\n else {\r\n return cssText_1.replace(fontFamilySrcRegexp, \"src: \" + a.join(\", \") + \";\");\r\n }\r\n }));\r\n }\r\n }\r\n })];\r\n case 1:\r\n _a.sent();\r\n return [4 /*yield*/, Promise.all(promises)];\r\n case 2:\r\n a = _a.sent();\r\n return [2 /*return*/, {\r\n blobs: blobs,\r\n cssText: a.filter(function (x) { return !!x; }).join(\"\\n\")\r\n }];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Produces image output from the element.\r\n *\r\n * Converts to a `Canvas` first, then produces an image to download.\r\n *\r\n * This is an asynchronous function. Rather than returning a result, it\r\n * returns a Promise.\r\n *\r\n * You can use `await` notion from other async functions, or `then()`\r\n * anywhere else.\r\n *\r\n * ```TypeScript\r\n * let img;\r\n *\r\n * // Async\r\n * img = await chart.exporting.getImage( \"png\" );\r\n *\r\n * // Sync\r\n * chart.exporting.getImage( \"png\" ).then( ( data ) => {\r\n * img = data;\r\n * } );\r\n * ```\r\n * ```JavaScript\r\n * var img;\r\n * chart.exporting.getImage( \"png\" ).then( ( data ) => {\r\n * img = data;\r\n * } );\r\n * ```\r\n *\r\n * @param type Image format\r\n * @param options Options\r\n * @param includeExtras Should extra sprites be included if set?\r\n * @return Promise\r\n */\r\n Export.prototype.getImage = function (type, options, includeExtras) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var prehidden, canvas, uri, e_4, data, data;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n prehidden = this._objectsAlreadyHidden;\r\n if (!prehidden) {\r\n this.hideNonExportableSprites();\r\n }\r\n if (!$type.hasValue(options)) {\r\n options = this.getFormatOptions(type);\r\n }\r\n // Wait for required elements to be ready before proceeding\r\n return [4 /*yield*/, this.awaitValidSprites()];\r\n case 1:\r\n // Wait for required elements to be ready before proceeding\r\n _a.sent();\r\n return [4 /*yield*/, this.simplifiedImageExport()];\r\n case 2:\r\n if (!_a.sent()) return [3 /*break*/, 10];\r\n canvas = void 0;\r\n _a.label = 3;\r\n case 3:\r\n _a.trys.push([3, 7, , 9]);\r\n return [4 /*yield*/, this.getCanvas(options)];\r\n case 4:\r\n canvas = _a.sent();\r\n if (!(includeExtras !== false)) return [3 /*break*/, 6];\r\n return [4 /*yield*/, this.addExtras(canvas, options)];\r\n case 5:\r\n canvas = _a.sent();\r\n _a.label = 6;\r\n case 6:\r\n uri = canvas.toDataURL(this.getContentType(type), options.quality);\r\n // Get rid of the canvas\r\n this.disposeCanvas(canvas);\r\n if (!prehidden) {\r\n this.restoreNonExportableSprites();\r\n }\r\n return [2 /*return*/, uri];\r\n case 7:\r\n e_4 = _a.sent();\r\n console.error(e_4.message + \"\\n\" + e_4.stack);\r\n $log.warn(\"Simple export failed, falling back to advanced export\");\r\n if (canvas) {\r\n this.disposeCanvas(canvas);\r\n }\r\n return [4 /*yield*/, this.getImageAdvanced(type, options, includeExtras)];\r\n case 8:\r\n data = _a.sent();\r\n if (!prehidden) {\r\n this.restoreNonExportableSprites();\r\n }\r\n return [2 /*return*/, data];\r\n case 9: return [3 /*break*/, 12];\r\n case 10: return [4 /*yield*/, this.getImageAdvanced(type, options, includeExtras)];\r\n case 11:\r\n data = _a.sent();\r\n if (!prehidden) {\r\n this.restoreNonExportableSprites();\r\n }\r\n return [2 /*return*/, data];\r\n case 12: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Adds extra elements to the canvas.\r\n *\r\n * @param canvas Original canvas\r\n * @param options Options\r\n */\r\n Export.prototype.addExtras = function (canvas, options, advanced) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var middleLeft_1, middleTop_1, middleWidth_1, middleHeight_1, extraRight_1, extraBottom_1, extras, newCanvas, ctx_1, background, left_1, top_1, right_1, bottom_1;\r\n var _this = this;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n if (!this.extraSprites.length) return [3 /*break*/, 2];\r\n middleLeft_1 = 0;\r\n middleTop_1 = 0;\r\n middleWidth_1 = canvas.width;\r\n middleHeight_1 = canvas.height;\r\n extraRight_1 = 0;\r\n extraBottom_1 = 0;\r\n return [4 /*yield*/, Promise.all($array.map(this.extraSprites, function (extraSprite) { return __awaiter(_this, void 0, void 0, function () {\r\n var extra, extraCanvas, extraWidth, extraHeight;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n if (extraSprite instanceof Sprite) {\r\n extra = {\r\n sprite: extraSprite,\r\n position: \"bottom\"\r\n };\r\n }\r\n else {\r\n extra = extraSprite;\r\n }\r\n // Set defaults\r\n extra.position = extra.position || \"bottom\";\r\n extra.marginTop = extra.marginTop || 0;\r\n extra.marginRight = extra.marginRight || 0;\r\n extra.marginBottom = extra.marginBottom || 0;\r\n extra.marginLeft = extra.marginLeft || 0;\r\n if (!advanced) return [3 /*break*/, 2];\r\n return [4 /*yield*/, extra.sprite.exporting.getCanvasAdvanced(options)];\r\n case 1:\r\n extraCanvas = _a.sent();\r\n return [3 /*break*/, 4];\r\n case 2: return [4 /*yield*/, extra.sprite.exporting.getCanvas(options)];\r\n case 3:\r\n extraCanvas = _a.sent();\r\n _a.label = 4;\r\n case 4:\r\n extraWidth = extraCanvas.width + extra.marginLeft + extra.marginRight;\r\n extraHeight = extraCanvas.height + extra.marginTop + extra.marginBottom;\r\n if (extra.position == \"top\") {\r\n middleWidth_1 = extra.crop ? middleHeight_1 : $math.max(middleWidth_1, extraWidth);\r\n middleTop_1 += extraHeight;\r\n }\r\n else if (extra.position == \"right\") {\r\n middleHeight_1 = extra.crop ? middleHeight_1 : $math.max(middleHeight_1, extraHeight);\r\n extraRight_1 += extraWidth;\r\n }\r\n else if (extra.position == \"left\") {\r\n middleHeight_1 = extra.crop ? middleHeight_1 : $math.max(middleHeight_1, extraHeight);\r\n middleLeft_1 += extraWidth;\r\n }\r\n else if (extra.position === \"bottom\") {\r\n middleWidth_1 = extra.crop ? middleHeight_1 : $math.max(middleWidth_1, extraWidth);\r\n extraBottom_1 += extraHeight;\r\n }\r\n return [2 /*return*/, {\r\n canvas: extraCanvas,\r\n position: extra.position,\r\n left: extra.marginLeft,\r\n top: extra.marginTop,\r\n width: extraWidth,\r\n height: extraHeight\r\n }];\r\n }\r\n });\r\n }); }))];\r\n case 1:\r\n extras = _a.sent();\r\n newCanvas = this.getDisposableCanvas();\r\n newCanvas.width = middleLeft_1 + middleWidth_1 + extraRight_1;\r\n newCanvas.height = middleTop_1 + middleHeight_1 + extraBottom_1;\r\n ctx_1 = newCanvas.getContext(\"2d\");\r\n background = this.backgroundColor || this.findBackgroundColor(this.sprite.dom);\r\n if (background) {\r\n ctx_1.fillStyle = background.toString();\r\n ctx_1.fillRect(0, 0, newCanvas.width, newCanvas.height);\r\n }\r\n left_1 = middleLeft_1;\r\n top_1 = middleTop_1;\r\n right_1 = left_1 + middleWidth_1;\r\n bottom_1 = top_1 + middleHeight_1;\r\n // Radiates outwards from center\r\n $array.each(extras, function (extra) {\r\n if (extra.position == \"top\") {\r\n top_1 -= extra.height;\r\n ctx_1.drawImage(extra.canvas, middleLeft_1 + extra.left, top_1 + extra.top);\r\n }\r\n else if (extra.position == \"right\") {\r\n ctx_1.drawImage(extra.canvas, right_1 + extra.left, middleTop_1 + extra.top);\r\n right_1 += extra.width;\r\n }\r\n else if (extra.position == \"left\") {\r\n left_1 -= extra.width;\r\n ctx_1.drawImage(extra.canvas, left_1 + extra.left, middleTop_1 + extra.top);\r\n }\r\n else if (extra.position === \"bottom\") {\r\n ctx_1.drawImage(extra.canvas, middleLeft_1 + extra.left, bottom_1 + extra.top);\r\n bottom_1 += extra.height;\r\n }\r\n _this.disposeCanvas(extra.canvas);\r\n });\r\n ctx_1.drawImage(canvas, middleLeft_1, middleTop_1);\r\n return [2 /*return*/, newCanvas];\r\n case 2: return [2 /*return*/, canvas];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Returns canvas representation of the [[Sprite]].\r\n *\r\n * @param options Options\r\n * @return Canvas\r\n */\r\n Export.prototype.getCanvas = function (options) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var background, DOMURL, url, blobs, canvas, width, height, font, fontSize, scale, pixelRatio, ctx, promises, a, data, svg, img;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n // Options are set?\r\n if (!$type.hasValue(options)) {\r\n options = {};\r\n }\r\n background = this.backgroundColor || this.findBackgroundColor(this.sprite.dom);\r\n DOMURL = this.getDOMURL();\r\n url = null;\r\n blobs = null;\r\n _a.label = 1;\r\n case 1:\r\n _a.trys.push([1, , 4, 5]);\r\n width = this.sprite.pixelWidth;\r\n height = this.sprite.pixelHeight;\r\n font = $dom.findFont(this.sprite.dom);\r\n fontSize = $dom.findFontSize(this.sprite.dom);\r\n scale = options.scale || 1;\r\n pixelRatio = this.getPixelRatio(options);\r\n // Check if scale needs to be updated as per min/max dimensions\r\n scale = this.getAdjustedScale(width * pixelRatio, height * pixelRatio, scale, options);\r\n // Create canvas and its 2D context\r\n canvas = this.getDisposableCanvas();\r\n // Set canvas width/height\r\n canvas.style.width = width * scale + 'px';\r\n canvas.style.height = height * scale + 'px';\r\n canvas.width = width * scale;\r\n canvas.height = height * scale;\r\n ctx = canvas.getContext(\"2d\");\r\n // if (pixelRatio != 1) {\r\n // \tctx.setTransform(pixelRatio, 0, 0, pixelRatio, 0, 0);\r\n // }\r\n // Add background if necessary\r\n if (background) {\r\n ctx.fillStyle = background.toString();\r\n ctx.fillRect(0, 0, width * scale, height * scale);\r\n }\r\n promises = [];\r\n if (this.useWebFonts) {\r\n // TODO what if one of the other things errors before it's been able to set `blobs` ?\r\n promises.push(this.getFontFamilies().then(function (fonts) {\r\n blobs = fonts.blobs;\r\n return fonts.cssText;\r\n }));\r\n }\r\n promises.push(this.imagesToDataURI(this.sprite.dom, options));\r\n promises.push(this.prepForeignObjects(this.sprite.dom, options));\r\n return [4 /*yield*/, Promise.all(promises)];\r\n case 2:\r\n a = _a.sent();\r\n data = this.normalizeSVG(\"<style>\" + a[0] + \"</style>\" + this.serializeElement(this.sprite.paper.defs) + this.serializeElement(this.sprite.dom), options, width, height, scale, font, fontSize);\r\n svg = new Blob([data], { type: \"image/svg+xml\" });\r\n url = DOMURL.createObjectURL(svg);\r\n return [4 /*yield*/, this.loadNewImage(url, width * scale * pixelRatio, height * scale * pixelRatio, \"anonymous\")];\r\n case 3:\r\n img = _a.sent();\r\n // Draw image on canvas\r\n ctx.drawImage(img, 0, 0);\r\n return [3 /*break*/, 5];\r\n case 4:\r\n if (url !== null) {\r\n DOMURL.revokeObjectURL(url);\r\n }\r\n if (blobs !== null) {\r\n $array.each(blobs, function (url) {\r\n DOMURL.revokeObjectURL(url);\r\n });\r\n }\r\n // Restore replaced tainted images in DOM\r\n this.restoreRemovedObjects();\r\n return [7 /*endfinally*/];\r\n case 5: return [2 /*return*/, canvas];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Returns canvas representation of the [[Sprite]] using canvg.\r\n *\r\n * @param options Options\r\n * @return Canvas\r\n */\r\n Export.prototype.getCanvasAdvanced = function (options) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var background, canvg, width, height, font, fontSize, scale, pixelRatio, data, canvas, config;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n // Options are set?\r\n if (!$type.hasValue(options)) {\r\n options = {};\r\n }\r\n // Convert external images to data uris\r\n return [4 /*yield*/, this.imagesToDataURI(this.sprite.dom, options)];\r\n case 1:\r\n // Convert external images to data uris\r\n _a.sent();\r\n background = this.backgroundColor || this.findBackgroundColor(this.sprite.dom);\r\n return [4 /*yield*/, this.canvg];\r\n case 2:\r\n canvg = _a.sent();\r\n width = this.sprite.pixelWidth;\r\n height = this.sprite.pixelHeight;\r\n font = $dom.findFont(this.sprite.dom);\r\n fontSize = $dom.findFontSize(this.sprite.dom);\r\n scale = options.scale || 1;\r\n pixelRatio = this.getPixelRatio(options);\r\n // Check if scale needs to be updated as per min/max dimensions\r\n scale = this.getAdjustedScale(width * pixelRatio, height * pixelRatio, scale, options);\r\n data = this.normalizeSVG(this.serializeElement(this.sprite.paper.defs) + this.serializeElement(this.sprite.dom), options, width, height, scale, font, fontSize, background);\r\n canvas = this.getDisposableCanvas();\r\n // Set canvas width/height\r\n canvas.style.width = (width * pixelRatio * scale) + 'px';\r\n canvas.style.height = (height * pixelRatio * scale) + 'px';\r\n canvas.width = width * pixelRatio * scale;\r\n canvas.height = height * pixelRatio * scale;\r\n config = {\r\n //ignoreDimensions: true,\r\n useCORS: true\r\n };\r\n if (pixelRatio != 1) {\r\n config.ignoreDimensions = true;\r\n config.scaleWidth = width * pixelRatio * scale;\r\n config.scaleHeight = height * pixelRatio * scale;\r\n }\r\n return [4 /*yield*/, canvg.fromString(canvas.getContext(\"2d\"), data, config).render()];\r\n case 3:\r\n _a.sent();\r\n return [2 /*return*/, canvas];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Tries to dynamically load [canvg.js](https://github.com/canvg/canvg) and\r\n * export an image using its functions.\r\n *\r\n * This is an asynchronous function. Check the description of `getImage()`\r\n * for description and example usage.\r\n *\r\n * @param type Image format\r\n * @param options Options\r\n * @return Data uri\r\n */\r\n Export.prototype.getImageAdvanced = function (type, options, includeExtras) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var prehidden, canvas, uri;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n prehidden = this._objectsAlreadyHidden;\r\n if (!prehidden) {\r\n this.hideNonExportableSprites();\r\n }\r\n if (!$type.hasValue(options)) {\r\n options = this.getFormatOptions(type);\r\n }\r\n return [4 /*yield*/, this.getCanvasAdvanced(options)];\r\n case 1:\r\n canvas = _a.sent();\r\n if (!(includeExtras !== false)) return [3 /*break*/, 3];\r\n return [4 /*yield*/, this.addExtras(canvas, options, true)];\r\n case 2:\r\n canvas = _a.sent();\r\n _a.label = 3;\r\n case 3:\r\n uri = canvas.toDataURL(this.getContentType(type), options.quality);\r\n // Get rid of the canvas\r\n this.disposeCanvas(canvas);\r\n if (!prehidden) {\r\n this.restoreNonExportableSprites();\r\n }\r\n return [2 /*return*/, uri];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Creates a `<canvas>` element and returns it.\r\n *\r\n * @return Canvas element\r\n */\r\n Export.prototype.getDisposableCanvas = function () {\r\n var canvas = document.createElement(\"canvas\");\r\n canvas.style.position = \"fixed\";\r\n canvas.style.top = \"-10000px\";\r\n document.body.appendChild(canvas);\r\n return canvas;\r\n };\r\n /**\r\n * Removes canvas.\r\n *\r\n * @param canvas Canvas element\r\n */\r\n Export.prototype.disposeCanvas = function (canvas) {\r\n document.body.removeChild(canvas);\r\n };\r\n /**\r\n * Returns pixel ratio for retina displays.\r\n *\r\n * @return Pixel ratio\r\n */\r\n Export.prototype.getPixelRatio = function (options) {\r\n // const scale = options && options.scale ? options.scale : 1;\r\n // return (this.useRetina ? $utils.getPixelRatio() : 1) * scale;\r\n return this.useRetina ? $utils.getPixelRatio() : 1;\r\n };\r\n /**\r\n * Calculates adjusted scale if image does not fit or is larger than min/max\r\n * settings.\r\n *\r\n * @param width Width of the source image\r\n * @param height Height of the source image\r\n * @param scale Current scale\r\n * @param options Options\r\n * @return Adjusted scale\r\n */\r\n Export.prototype.getAdjustedScale = function (width, height, scale, options) {\r\n if (!options) {\r\n return scale;\r\n }\r\n var adjWidth = width * scale;\r\n var adjHeight = width * scale;\r\n // Check max restrictions\r\n var widthScale;\r\n var heightScale;\r\n if (options.maxWidth && (adjWidth > options.maxWidth)) {\r\n widthScale = options.maxWidth / width;\r\n }\r\n if (options.maxHeight && (adjHeight > options.maxHeight)) {\r\n heightScale = options.maxHeight / height;\r\n }\r\n if (widthScale || heightScale) {\r\n return $math.min(widthScale, heightScale);\r\n }\r\n // Check min restrictions\r\n if (options.minWidth && (adjWidth < options.minWidth)) {\r\n widthScale = options.minWidth / width;\r\n }\r\n if (options.minHeight && (adjHeight < options.minHeight)) {\r\n heightScale = options.minHeight / height;\r\n }\r\n if (widthScale || heightScale) {\r\n return $math.max(widthScale, heightScale);\r\n }\r\n return scale;\r\n };\r\n /**\r\n * Converts all `<image>` tags in SVG to use data uris instead of external\r\n * URLs\r\n *\r\n * This is an asynchronous function. Check the description of `getImage()`\r\n * for description and example usage.\r\n *\r\n * @ignore Exclude from docs\r\n * @param el SVG node\r\n * @param options Options\r\n * @return Promise\r\n */\r\n Export.prototype.imagesToDataURI = function (el, options) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var images, promises, count, i, image, href;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n images = el.querySelectorAll(\"image\");\r\n if (!images.length) return [3 /*break*/, 2];\r\n promises = [];\r\n // There are images, process each of them\r\n for (count = images.length, i = 0; i < count; i++) {\r\n image = images[i];\r\n href = image.getAttributeNS(Export.XLINK, \"href\");\r\n // no href?\r\n if (!href) {\r\n continue;\r\n }\r\n if (href.indexOf(\"data:image\") !== -1) {\r\n // Ignore image if it's already in Data URI format\r\n }\r\n else {\r\n // SVG or bitmap image?\r\n if (href.indexOf(\".svg\") !== -1) {\r\n promises.push(this.svgToDataURI(image, options));\r\n }\r\n else {\r\n promises.push(this.imageToDataURI(image, options));\r\n }\r\n }\r\n }\r\n return [4 /*yield*/, Promise.all(promises)];\r\n case 1:\r\n _a.sent();\r\n return [2 /*return*/];\r\n case 2: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * `foreignObject` elements cannot be exported. This function hides them\r\n * temprarily. In the future it might try to convert them to SVG to make them\r\n * exportable.\r\n *\r\n * This is an asynchronous function. Check the description of `getImage()`\r\n * for description and example usage.\r\n *\r\n * @ignore Exclude from docs\r\n * @param el SVG node\r\n * @param options Options\r\n * @return Promise\r\n */\r\n Export.prototype.prepForeignObjects = function (el, options) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var objects, count, i;\r\n return __generator(this, function (_a) {\r\n objects = el.querySelectorAll(\"foreignObject\");\r\n if (objects.length) {\r\n // There are foreign objects, process each of them\r\n for (count = objects.length, i = 0; i < count; i++) {\r\n this.temporarilyRemoveObject(objects[i]);\r\n }\r\n }\r\n return [2 /*return*/];\r\n });\r\n });\r\n };\r\n /**\r\n * Converts an SVG `<image>` to use its data uri for `href` instead of\r\n * external file.\r\n *\r\n * This is an asynchronous function. Check the description of `getImage()`\r\n * for description and example usage.\r\n *\r\n * @ignore Exclude from docs\r\n * @param el SVG element\r\n * @param options Options\r\n */\r\n Export.prototype.imageToDataURI = function (el, options) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var img, canvas, uri, e_5;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n _a.trys.push([0, 2, , 3]);\r\n return [4 /*yield*/, this.loadNewImage(el.getAttributeNS(Export.XLINK, \"href\"), null, null, \"anonymous\")];\r\n case 1:\r\n // Create image\r\n img = _a.sent();\r\n canvas = document.createElement(\"canvas\");\r\n canvas.width = img.width;\r\n canvas.height = img.height;\r\n // Draw new image on it via `toDataURL`\r\n canvas.getContext(\"2d\").drawImage(img, 0, 0);\r\n // Replace image `href` with data uri\r\n // If we got to this point it means image has loaded, however we might\r\n // still get an error with `toDataURL()`\r\n try {\r\n uri = canvas.toDataURL();\r\n el.setAttribute(\"href\", uri);\r\n return [2 /*return*/, uri];\r\n }\r\n catch (e) {\r\n // Give up and temporarily remove the element href temporarily\r\n if (options.keepTainted !== false) {\r\n /*this._removedObjects.push({\r\n \"element\": el,\r\n \"originalHref\": el.getAttributeNS(Export.XLINK, \"href\")\r\n });\r\n el.setAttributeNS(Export.XLINK, \"href\", \"\");*/\r\n this.temporarilyRemoveObject(el);\r\n }\r\n return [2 /*return*/, undefined];\r\n }\r\n return [3 /*break*/, 3];\r\n case 2:\r\n e_5 = _a.sent();\r\n // Give up and temporarily remove the element's href\r\n if (!options || options.keepTainted !== false) {\r\n /*this._removedObjects.push({\r\n \"element\": el,\r\n \"originalHref\": el.getAttributeNS(Export.XLINK, \"href\")\r\n });\r\n el.setAttributeNS(Export.XLINK, \"href\", \"\");*/\r\n this.temporarilyRemoveObject(el);\r\n }\r\n return [2 /*return*/, undefined];\r\n case 3: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Converts `<image>` with external SVG source to data uri. Loads external SVG\r\n * file, then converts it to data uri and replaces the `xlink:href` parameter.\r\n *\r\n * This is an asynchronous function. Check the description of `getImage()`\r\n * for description and example usage.\r\n *\r\n * @ignore Exclude from docs\r\n * @param el An SVG element\r\n * @param options Options\r\n */\r\n Export.prototype.svgToDataURI = function (el, options) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var href, data, charset, uri, e_6;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n href = el.getAttributeNS(Export.XLINK, \"href\");\r\n _a.label = 1;\r\n case 1:\r\n _a.trys.push([1, 3, , 4]);\r\n return [4 /*yield*/, $net.load(href)];\r\n case 2:\r\n data = _a.sent();\r\n charset = this.adapter.apply(\"charset\", {\r\n charset: \"base64\",\r\n type: \"svg\",\r\n options: options\r\n }).charset;\r\n uri = this.adapter.apply(\"svgToDataURI\", {\r\n data: \"data:\" + this.getContentType(\"svg\") + \";\" + charset + \",\" + btoa(data.response),\r\n options: options\r\n }).data;\r\n el.setAttributeNS(Export.XLINK, \"href\", uri);\r\n return [2 /*return*/, uri];\r\n case 3:\r\n e_6 = _a.sent();\r\n // Disable temporarily\r\n if (!options || options.keepTainted !== false) {\r\n /*this._removedObjects.push({\r\n \"element\": el,\r\n \"originalHref\": href\r\n });\r\n el.setAttributeNS(Export.XLINK, \"href\", \"\");*/\r\n this.temporarilyRemoveObject(el);\r\n }\r\n return [2 /*return*/, undefined];\r\n case 4: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Temporarily removes element from DOM, and replaces it with a dummy\r\n * placeholder, as well as stores it for later restoration.\r\n *\r\n * This is an asynchronous function. Check the description of `getImage()`\r\n * for description and example usage.\r\n *\r\n * @ignore Exclude from docs\r\n * @param el Node\r\n */\r\n Export.prototype.temporarilyRemoveObject = function (el, placeholder) {\r\n // Get parent\r\n var parent = el.parentElement || el.parentNode;\r\n // Create a placeholder group element if it has not been passed in\r\n if (!placeholder) {\r\n placeholder = this.sprite.paper.add(\"g\").node;\r\n }\r\n parent.insertBefore(placeholder, el);\r\n // Check if we have a textContents we can replace with\r\n // @todo Perhaps we should explore alternatives to creating text nodes\r\n // i.e. creating a text version of the HTML-based Text, just for export\r\n // purposes. Converting HTML into SVG is very complicated\r\n if (el.textContent) {\r\n /*let text = this.sprite.paper.add(\"text\").node;\r\n text.textContent = el.textContent;\r\n placeholder.appendChild(text);\r\n\r\n // Copy properties from the removing element to the placeholder\r\n $dom.copyAttributes(el, placeholder);*/\r\n }\r\n // Remove the old element\r\n parent.removeChild(el);\r\n // Log removed item\r\n this._removedObjects.push({\r\n \"element\": el,\r\n \"placeholder\": placeholder\r\n });\r\n };\r\n /**\r\n * Restores all (possibly tainted or unsupported) objects that were\r\n * temporarily removed when exporting.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Export.prototype.restoreRemovedObjects = function () {\r\n var obj;\r\n while (true) {\r\n obj = this._removedObjects.pop();\r\n if (!obj) {\r\n break;\r\n }\r\n //obj.element.setAttribute(\"href\", obj.originalHref);\r\n var parent_1 = obj.placeholder.parentElement || obj.placeholder.parentNode;\r\n parent_1.insertBefore(obj.element, obj.placeholder);\r\n //parent.removeChild(obj.placeholder);\r\n }\r\n };\r\n /**\r\n * Checkes if simplified export can be used using `createObjectURL` and SVG\r\n * document does not contain any external images.\r\n *\r\n * This is an asynchronous function. Check the description of `getImage()`\r\n * for description and example usage.\r\n *\r\n * @ignore Exclude from docs\r\n * @return `true` if simplified export can be used\r\n */\r\n Export.prototype.simplifiedImageExport = function () {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var cache, canvas, ctx, DOMURL, svg, url, img, e_7, e_8;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n if (this.useSimplifiedExport === false) {\r\n return [2 /*return*/, false];\r\n }\r\n cache = registry.getCache(\"simplifiedImageExport\");\r\n if (cache === false || cache === true) {\r\n return [2 /*return*/, cache];\r\n }\r\n _a.label = 1;\r\n case 1:\r\n _a.trys.push([1, 6, , 7]);\r\n canvas = document.createElement(\"canvas\");\r\n canvas.width = 1;\r\n canvas.height = 1;\r\n ctx = canvas.getContext(\"2d\");\r\n DOMURL = this.getDOMURL();\r\n svg = new Blob([this.normalizeSVG(\"<g></g>\", {}, 1, 1)], { type: \"image/svg+xml\" });\r\n url = DOMURL.createObjectURL(svg);\r\n img = void 0;\r\n _a.label = 2;\r\n case 2:\r\n _a.trys.push([2, 4, , 5]);\r\n return [4 /*yield*/, this.loadNewImage(url, 1, 1)];\r\n case 3:\r\n img = _a.sent();\r\n return [3 /*break*/, 5];\r\n case 4:\r\n e_7 = _a.sent();\r\n return [2 /*return*/, false];\r\n case 5:\r\n ctx.drawImage(img, 0, 0);\r\n DOMURL.revokeObjectURL(url);\r\n try {\r\n //let uri = canvas.toDataURL(\"image/png\");\r\n registry.setCache(\"simplifiedImageExport\", true);\r\n return [2 /*return*/, true];\r\n }\r\n catch (e) {\r\n registry.setCache(\"simplifiedImageExport\", false);\r\n return [2 /*return*/, false];\r\n }\r\n return [3 /*break*/, 7];\r\n case 6:\r\n e_8 = _a.sent();\r\n registry.setCache(\"simplifiedImageExport\", false);\r\n return [2 /*return*/, false];\r\n case 7: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Returns a new `<image>` element.\r\n *\r\n * @ignore Exclude from docs\r\n * @param url URL of the image\r\n * @param width Width (px)\r\n * @param height Height (px)\r\n * @param crossOrigin Cross-Origin setting\r\n * @return Promise\r\n */\r\n Export.prototype.loadNewImage = function (url, width, height, crossOrigin) {\r\n return new Promise(function (success, error) {\r\n // New image\r\n var image;\r\n if (width && height) {\r\n image = new Image(width, height);\r\n }\r\n else {\r\n image = new Image();\r\n }\r\n // Set crossorigin\r\n if (crossOrigin) {\r\n image.setAttribute(\"crossOrigin\", crossOrigin);\r\n }\r\n // Report success on load\r\n image.onload = function () {\r\n success(image);\r\n };\r\n function onerror() {\r\n // Error occurred. Just in case it's the crossOrigin issue, let's try\r\n // stripping off this attribute and trying again\r\n if (crossOrigin) {\r\n // Retain old uri\r\n var currentHref = image.src;\r\n // Set up another `onerror` to handle situations where image is not\r\n // loadable at all (i.e. protected by CORS)\r\n image.onerror = function () {\r\n // Nope, no luck\r\n error(new Error(\"Loading image \\\"\" + url + \"\\\" failed\"));\r\n };\r\n // remove the `crossOrigin` attribute\r\n image.removeAttribute(\"crossorigin\");\r\n // retry\r\n image.src = \"\";\r\n image.src = currentHref;\r\n }\r\n else {\r\n error(new Error(\"Loading image \\\"\" + url + \"\\\" failed\"));\r\n }\r\n }\r\n // Set image error handlers\r\n image.onabort = onerror;\r\n image.onerror = onerror;\r\n // Trigger load\r\n image.src = url;\r\n });\r\n };\r\n /**\r\n * Returns current DOM URL.\r\n *\r\n * @ignore Exclude from docs\r\n * @return URL\r\n */\r\n Export.prototype.getDOMURL = function () {\r\n return self.URL || self.webkitURL || self;\r\n };\r\n /**\r\n * Returns an SVG representation of the chart.\r\n *\r\n * This is an asynchronous function. Check the description of `getImage()`\r\n * for description and example usage.\r\n *\r\n * @param type Type of the export\r\n * @param options Options\r\n * @param encodeURI If true, will return result will be data URI\r\n * @return Promise\r\n */\r\n Export.prototype.getSVG = function (type, options, encodeURI) {\r\n if (encodeURI === void 0) { encodeURI = true; }\r\n return __awaiter(this, void 0, void 0, function () {\r\n var prehidden, width, height, font, fontSize, scale, pixelRatio, svg, charset, uri;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n prehidden = this._objectsAlreadyHidden;\r\n if (!prehidden) {\r\n this.hideNonExportableSprites();\r\n }\r\n if (!$type.hasValue(options)) {\r\n options = this.getFormatOptions(\"svg\");\r\n }\r\n // Wait for required elements to be ready before proceeding\r\n return [4 /*yield*/, this.awaitValidSprites()];\r\n case 1:\r\n // Wait for required elements to be ready before proceeding\r\n _a.sent();\r\n width = this.sprite.pixelWidth;\r\n height = this.sprite.pixelHeight;\r\n font = $dom.findFont(this.sprite.dom);\r\n fontSize = $dom.findFontSize(this.sprite.dom);\r\n scale = options.scale || 1;\r\n pixelRatio = this.getPixelRatio(options);\r\n // Check if scale needs to be updated as per min/max dimensions\r\n scale = this.getAdjustedScale(width * pixelRatio, height * pixelRatio, scale, options);\r\n svg = this.normalizeSVG(this.serializeElement(this.sprite.paper.defs) + this.serializeElement(this.sprite.dom), options, width, height, scale, font, fontSize);\r\n charset = this.adapter.apply(\"charset\", {\r\n charset: \"charset=utf-8\",\r\n type: \"svg\",\r\n options: options\r\n }).charset;\r\n uri = this.adapter.apply(\"getSVG\", {\r\n data: encodeURI ? \"data:\" + this.getContentType(type) + \";\" + charset + \",\" + encodeURIComponent(svg) : svg,\r\n options: options\r\n }).data;\r\n if (!prehidden) {\r\n this.restoreNonExportableSprites();\r\n }\r\n return [2 /*return*/, uri];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Checks if SVG is fully formatted. Encloses in `<svg>...</svg>` if\r\n * necessary.\r\n *\r\n * @ignore Exclude from docs\r\n * @param svg Input SVG\r\n * @param options Options\r\n * @param width Width of the SVG viewport\r\n * @param height Height of the SVG viewport\r\n * @param font Font family to use as a base\r\n * @param fontSize Font size to use as a base\r\n * @return Output SVG\r\n * @todo Add style params to existing <svg>\r\n */\r\n Export.prototype.normalizeSVG = function (svg, options, width, height, scale, font, fontSize, background) {\r\n // Construct width/height params\r\n var dimParams = \"\";\r\n if (width) {\r\n dimParams += \"width=\\\"\" + Math.round(width * (scale || 1)) + \"px\\\" \";\r\n }\r\n if (height) {\r\n dimParams += \"height=\\\"\" + Math.round(height * (scale || 1)) + \"px\\\" \";\r\n }\r\n // Apply font settings\r\n var styleParams = \"\";\r\n if (font) {\r\n styleParams += \"font-family: \" + font.replace(/\"/g, \"\") + \";\";\r\n }\r\n if (fontSize) {\r\n styleParams += \"font-size: \" + fontSize + \";\";\r\n }\r\n // Scale\r\n if (scale) {\r\n dimParams += \"viewBox=\\\"0 0 \" + (width) + \" \" + (height) + \"\\\" \";\r\n }\r\n // Remove foreign objects temporarily\r\n var fos = [];\r\n var ms = svg.match(/<foreignObject[\\s\\S]*<\\/foreignObject>/gi);\r\n if (ms) {\r\n for (var i = 0; i < ms.length; i++) {\r\n svg = svg.replace(ms[i], $strings.PLACEHOLDER);\r\n fos.push(ms[i]);\r\n }\r\n }\r\n // Add missing <svg> enclosure\r\n if (!svg.match(/<svg/)) {\r\n svg = \"<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\"?><svg \" + dimParams + \" style=\\\"\" + styleParams + \"\\\" version=\\\"1.1\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\" xmlns:xlink=\\\"http://www.w3.org/1999/xlink\\\">\" + svg + \"</svg>\";\r\n }\r\n else {\r\n if (dimParams !== \"\") {\r\n // Clear current params\r\n svg = svg.replace(/(<svg[^>]*)width=\"[^\"]*\"/, \"$1\");\r\n svg = svg.replace(/(<svg[^>]*)height=\"[^\"]*\"/, \"$1\");\r\n // Add new params\r\n svg = svg.replace(/(<svg)/, \"$1\" + dimParams);\r\n }\r\n /*if (styleParams !== \"\") {\r\n // Clear current params\r\n svg = svg.replace(/(<svg[^>]*)stylewidth=\"[^\"]*\"/, \"$1\");\r\n svg = svg.replace(/(<svg[^>]*)height=\"[^\"]*\"/, \"$1\");\r\n\r\n // Add new params\r\n svg = svg.replace(/(<svg)/, \"$1\" + dimParams);\r\n }*/\r\n }\r\n if (background) {\r\n svg = svg.replace(/(<svg[^>]*>)/, \"$1<rect width=\\\"100%\\\" height=\\\"100%\\\" fill=\\\"\" + background.rgba + \"\\\"/>\");\r\n //svg = svg.replace(/<\\/svg>/, \"<rect width=\\\"100%\\\" height=\\\"100%\\\" fill=\\\"\" + background.rgba + \"\\\"/></svg>\");\r\n }\r\n if ($browser.isInternetExplorer()) {\r\n // IE can't handle exporting <feColorMatrix> for some reason\r\n svg = svg.replace(/<feColorMatrix [^\\/>]*\\/>/gi, \"\");\r\n }\r\n // Remove base uri-related stuff\r\n var reg = new RegExp(\"url\\\\(\" + $utils.escapeForRgex($utils.getBaseURI()), \"g\");\r\n svg = svg.replace(reg, \"url(#\");\r\n // Remove escaped quotes in url() parameters\r\n svg = svg.replace(/url\\("([^)]*)"\\)/gm, \"url($1)\");\r\n // Put foreignObjects back in\r\n if (fos.length) {\r\n for (var i = 0; i < fos.length; i++) {\r\n svg = svg.replace($strings.PLACEHOLDER, fos[i]);\r\n }\r\n }\r\n svg = this.adapter.apply(\"normalizeSVG\", {\r\n data: svg,\r\n options: options\r\n }).data;\r\n return svg;\r\n };\r\n /**\r\n * Serializes an element and returns its contents.\r\n *\r\n * @ignore Exclude from docs\r\n * @param element An element to serialize\r\n * @return A serialized XML\r\n */\r\n Export.prototype.serializeElement = function (element) {\r\n return new XMLSerializer().serializeToString(element);\r\n };\r\n /**\r\n * Returns a PDF containing chart image.\r\n *\r\n * This is an asynchronous function. Check the description of `getImage()`\r\n * for description and example usage.\r\n *\r\n * @param type Type of the export\r\n * @param options Options\r\n * @return Promise\r\n * @async\r\n * @todo Account for header when calculating vertical fit\r\n */\r\n Export.prototype.getPDF = function (type, options) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n function addFont(font) {\r\n var paths = {};\r\n paths.normal = font.normal.path;\r\n vfs[font.normal.path] = font.normal.bytes;\r\n if (font.bold) {\r\n paths.bold = font.bold.path;\r\n vfs[font.bold.path] = font.bold.bytes;\r\n }\r\n else {\r\n paths.bold = font.normal.path;\r\n }\r\n if (font.italics) {\r\n paths.italics = font.italics.path;\r\n vfs[font.italics.path] = font.italics.bytes;\r\n }\r\n else {\r\n paths.italics = font.normal.path;\r\n }\r\n if (font.bolditalics) {\r\n paths.bolditalics = font.bolditalics.path;\r\n vfs[font.bolditalics.path] = font.bolditalics.bytes;\r\n }\r\n else {\r\n paths.bolditalics = font.normal.path;\r\n }\r\n fonts[font.name] = paths;\r\n }\r\n var image, pdfmake, defaultMargins, doc, title, extraMargin, _a, _b, _c, fonts, vfs;\r\n return __generator(this, function (_d) {\r\n switch (_d.label) {\r\n case 0: return [4 /*yield*/, this.getImage(options.imageFormat || \"png\", options)];\r\n case 1:\r\n image = _d.sent();\r\n return [4 /*yield*/, this.pdfmake];\r\n case 2:\r\n pdfmake = _d.sent();\r\n defaultMargins = [30, 30, 30, 30];\r\n doc = {\r\n pageSize: options.pageSize || \"A4\",\r\n pageOrientation: options.pageOrientation || \"portrait\",\r\n pageMargins: options.pageMargins || defaultMargins,\r\n defaultStyle: {\r\n font: options.font ? options.font.name : undefined\r\n },\r\n //header: <any>[],\r\n content: []\r\n };\r\n title = this.adapter.apply(\"title\", {\r\n title: this.title,\r\n options: options\r\n }).title;\r\n extraMargin = 0;\r\n if (title) {\r\n doc.content.push({\r\n text: title,\r\n fontSize: options.fontSize || 14,\r\n bold: true,\r\n margin: [0, 0, 0, 15]\r\n });\r\n // Add some leftover margin for title\r\n extraMargin += 50;\r\n }\r\n // Add page URL?\r\n if (options.addURL) {\r\n doc.content.push({\r\n text: this.language.translate(\"Saved from\") + \": \" + document.location.href,\r\n fontSize: options.fontSize,\r\n margin: [0, 0, 0, 15]\r\n });\r\n // Add some leftover margin for URL\r\n extraMargin += 50;\r\n }\r\n // Add image\r\n if (type != \"pdfdata\") {\r\n doc.content.push({\r\n image: image,\r\n alignment: options.align || \"left\",\r\n fit: this.getPageSizeFit(doc.pageSize, doc.pageMargins, extraMargin)\r\n });\r\n }\r\n if (!(type == \"pdfdata\" || options.addData)) return [3 /*break*/, 4];\r\n _b = (_a = doc.content).push;\r\n _c = {};\r\n return [4 /*yield*/, this.getPDFData(\"pdf\", options)];\r\n case 3:\r\n _b.apply(_a, [(_c.table = _d.sent(),\r\n _c.fontSize = options.fontSize || 14,\r\n _c)]);\r\n _d.label = 4;\r\n case 4:\r\n // Apply adapters\r\n doc = this.adapter.apply(\"pdfmakeDocument\", {\r\n doc: doc,\r\n options: options\r\n }).doc;\r\n fonts = null;\r\n vfs = null;\r\n if (options.font) {\r\n fonts = {};\r\n vfs = {};\r\n addFont(options.font);\r\n if (options.extraFonts) {\r\n $array.each(options.extraFonts, addFont);\r\n }\r\n }\r\n return [4 /*yield*/, new Promise(function (success, error) {\r\n pdfmake.createPdf(doc, null, fonts, vfs).getDataUrl(function (uri) {\r\n success(uri);\r\n });\r\n })];\r\n case 5: \r\n // Create PDF\r\n return [2 /*return*/, _d.sent()];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Returns chart's data formatted suitable for PDF export (pdfmake).\r\n *\r\n * This is an asynchronous function. Check the description of `getImage()`\r\n * for description and example usage.\r\n *\r\n * @since 4.7.0\r\n * @param type Type of the export\r\n * @param options Options\r\n * @return Promise\r\n * @async\r\n */\r\n Export.prototype.getPDFData = function (type, options) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var content, dataFields, data, dataFieldsOrder_1, len, i;\r\n var _this = this;\r\n return __generator(this, function (_a) {\r\n content = {\r\n \"body\": []\r\n };\r\n dataFields = this.adapter.apply(\"formatDataFields\", {\r\n dataFields: this.dataFields,\r\n format: \"pdf\"\r\n }).dataFields;\r\n data = this.data;\r\n // Vertical or horizontal (default) layout\r\n if (options.pivot) {\r\n dataFieldsOrder_1 = this.adapter.apply(\"dataFieldsOrder\", {\r\n dataFieldsOrder: this.dataFieldsOrder,\r\n format: \"pdfdata\"\r\n }).dataFieldsOrder;\r\n $object.eachOrdered(dataFields, function (key, val) {\r\n var dataRow = [];\r\n if (options.addColumnNames) {\r\n dataRow.push(val);\r\n }\r\n for (var len = data.length, i = 0; i < len; i++) {\r\n var dataValue = data[i][key];\r\n dataRow.push(_this.convertToSpecialFormat(key, dataValue, options, true));\r\n }\r\n content.body.push(_this.getPDFDataRow(dataRow, options, undefined, true));\r\n }, function (a, b) {\r\n //console.log(a, b)\r\n var ai = dataFieldsOrder_1.indexOf(a);\r\n var bi = dataFieldsOrder_1.indexOf(b);\r\n if (ai > bi) {\r\n return 1;\r\n }\r\n else if (ai < bi) {\r\n return -1;\r\n }\r\n return 0;\r\n });\r\n }\r\n else {\r\n // Add column names?\r\n if (options.addColumnNames) {\r\n content.body.push(this.getPDFDataRow(dataFields, options, undefined, true));\r\n content.headerRows = 1;\r\n }\r\n for (len = data.length, i = 0; i < len; i++) {\r\n content.body.push(this.getPDFDataRow(data[i], options, dataFields));\r\n }\r\n }\r\n return [2 /*return*/, this.adapter.apply(\"pdfmakeTable\", {\r\n table: content,\r\n options: options\r\n }).table];\r\n });\r\n });\r\n };\r\n /**\r\n * Formats a row of data for use in PDF data table (pdfmake).\r\n *\r\n * @ignore Exclude from docs\r\n * @since 4.7.0\r\n * @param row An object holding data for the row\r\n * @param options Options\r\n * @param dataFields Data fields\r\n * @param asIs Do not try to convert to dates\r\n * @return Formated Data line\r\n */\r\n Export.prototype.getPDFDataRow = function (row, options, dataFields, asIs) {\r\n var _this = this;\r\n if (asIs === void 0) { asIs = false; }\r\n // Init\r\n var items = [];\r\n // Data fields\r\n if (!dataFields) {\r\n dataFields = row;\r\n }\r\n // Data fields order\r\n var dataFieldsOrder = this.adapter.apply(\"dataFieldsOrder\", {\r\n dataFieldsOrder: this.dataFieldsOrder,\r\n format: \"pdfdata\"\r\n }).dataFieldsOrder;\r\n // Process each row item\r\n $object.eachOrdered(dataFields, function (key, name) {\r\n // Get value\r\n var value = _this.convertEmptyValue(key, row[key], options);\r\n // Convert dates\r\n var item = asIs ? value : _this.convertToSpecialFormat(key, value, options);\r\n item = \"\" + item;\r\n // Add to item\r\n items.push(item);\r\n }, function (a, b) {\r\n //console.log(a, b)\r\n var ai = dataFieldsOrder.indexOf(a);\r\n var bi = dataFieldsOrder.indexOf(b);\r\n if (ai > bi) {\r\n return 1;\r\n }\r\n else if (ai < bi) {\r\n return -1;\r\n }\r\n return 0;\r\n });\r\n return items;\r\n };\r\n /**\r\n * Returns fit dimensions for available page sizes.\r\n *\r\n * @ignore Exclude from docs\r\n * @param pageSize Page size\r\n * @return `[width, height]` in pixels\r\n */\r\n Export.prototype.getPageSizeFit = function (pageSize, margins, extraMargin) {\r\n if (extraMargin === void 0) { extraMargin = 0; }\r\n // Check margins\r\n var newMargins = [0, 0, 0, 0];\r\n if (typeof margins == \"number\") {\r\n newMargins = [margins, margins, margins, margins];\r\n }\r\n else if (margins.length == 2) {\r\n newMargins = [margins[0], margins[1], margins[0], margins[1]];\r\n }\r\n else if (margins.length == 4) {\r\n newMargins = margins;\r\n }\r\n // Define available page sizes\r\n var sizes = {\r\n \"4A0\": [4767.87, 6740.79],\r\n \"2A0\": [3370.39, 4767.87],\r\n A0: [2383.94, 3370.39],\r\n A1: [1683.78, 2383.94],\r\n A2: [1190.55, 1683.78],\r\n A3: [841.89, 1190.55],\r\n A4: [595.28, 841.89],\r\n A5: [419.53, 595.28],\r\n A6: [297.64, 419.53],\r\n A7: [209.76, 297.64],\r\n A8: [147.40, 209.76],\r\n A9: [104.88, 147.40],\r\n A10: [73.70, 104.88],\r\n B0: [2834.65, 4008.19],\r\n B1: [2004.09, 2834.65],\r\n B2: [1417.32, 2004.09],\r\n B3: [1000.63, 1417.32],\r\n B4: [708.66, 1000.63],\r\n B5: [498.90, 708.66],\r\n B6: [354.33, 498.90],\r\n B7: [249.45, 354.33],\r\n B8: [175.75, 249.45],\r\n B9: [124.72, 175.75],\r\n B10: [87.87, 124.72],\r\n C0: [2599.37, 3676.54],\r\n C1: [1836.85, 2599.37],\r\n C2: [1298.27, 1836.85],\r\n C3: [918.43, 1298.27],\r\n C4: [649.13, 918.43],\r\n C5: [459.21, 649.13],\r\n C6: [323.15, 459.21],\r\n C7: [229.61, 323.15],\r\n C8: [161.57, 229.61],\r\n C9: [113.39, 161.57],\r\n C10: [79.37, 113.39],\r\n RA0: [2437.80, 3458.27],\r\n RA1: [1729.13, 2437.80],\r\n RA2: [1218.90, 1729.13],\r\n RA3: [864.57, 1218.90],\r\n RA4: [609.45, 864.57],\r\n SRA0: [2551.18, 3628.35],\r\n SRA1: [1814.17, 2551.18],\r\n SRA2: [1275.59, 1814.17],\r\n SRA3: [907.09, 1275.59],\r\n SRA4: [637.80, 907.09],\r\n EXECUTIVE: [521.86, 756.00],\r\n FOLIO: [612.00, 936.00],\r\n LEGAL: [612.00, 1008.00],\r\n LETTER: [612.00, 792.00],\r\n TABLOID: [792.00, 1224.00]\r\n };\r\n // Calculate size\r\n var fitSize = sizes[pageSize];\r\n fitSize[0] -= newMargins[0] + newMargins[2];\r\n fitSize[1] -= newMargins[1] + newMargins[3] + extraMargin;\r\n return fitSize;\r\n };\r\n /**\r\n * Returns an Excel file of chart's data.\r\n *\r\n * This is an asynchronous function. Check the description of `getImage()`\r\n * for description and example usage.\r\n *\r\n * @param type Type of the export\r\n * @param options Options\r\n * @return Promise\r\n * @async\r\n * @todo Handle dates\r\n * @todo Support for multi-sheet\r\n */\r\n Export.prototype.getExcel = function (type, options) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var XLSX, wbOptions, sheetName, wb, data, dataFields, dataFieldsOrder_2, len, i, uri;\r\n var _this = this;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n if (!$type.hasValue(options)) {\r\n options = this.getFormatOptions(\"xlsx\");\r\n }\r\n return [4 /*yield*/, this.xlsx];\r\n case 1:\r\n XLSX = _a.sent();\r\n wbOptions = this.adapter.apply(\"xlsxWorkbookOptions\", {\r\n xlsx: XLSX,\r\n options: {\r\n bookType: \"xlsx\",\r\n bookSST: false,\r\n type: \"base64\",\r\n }\r\n }).options;\r\n sheetName = this.normalizeExcelSheetName(this.adapter.apply(\"xlsxSheetName\", {\r\n xlsx: XLSX,\r\n name: this.title || this.language.translate(\"Data\")\r\n }).name);\r\n wb = {\r\n SheetNames: [sheetName],\r\n Sheets: {}\r\n };\r\n data = [];\r\n dataFields = this.adapter.apply(\"formatDataFields\", {\r\n dataFields: this.dataFields,\r\n format: \"xslx\"\r\n }).dataFields;\r\n // Vertical or horizontal (default) layout\r\n if (options.pivot) {\r\n dataFieldsOrder_2 = this.adapter.apply(\"dataFieldsOrder\", {\r\n dataFieldsOrder: this.dataFieldsOrder,\r\n format: \"xlsx\"\r\n }).dataFieldsOrder;\r\n $object.eachOrdered(dataFields, function (key, val) {\r\n var dataRow = [];\r\n if (options.addColumnNames) {\r\n dataRow.push(val);\r\n }\r\n for (var len = _this.data.length, i = 0; i < len; i++) {\r\n var dataValue = _this.data[i][key];\r\n dataRow.push(_this.convertToSpecialFormat(key, dataValue, options, true));\r\n }\r\n data.push(_this.getExcelRow(dataRow, options, undefined, true));\r\n }, function (a, b) {\r\n //console.log(a, b)\r\n var ai = dataFieldsOrder_2.indexOf(a);\r\n var bi = dataFieldsOrder_2.indexOf(b);\r\n if (ai > bi) {\r\n return 1;\r\n }\r\n else if (ai < bi) {\r\n return -1;\r\n }\r\n return 0;\r\n });\r\n }\r\n else {\r\n // Add column names?\r\n if (options.addColumnNames) {\r\n data.push(this.getExcelRow(dataFields, options, undefined, true));\r\n }\r\n // Add lines\r\n for (len = this.data.length, i = 0; i < len; i++) {\r\n data.push(this.getExcelRow(this.data[i], options, dataFields));\r\n }\r\n }\r\n // Create sheet and add data\r\n wb.Sheets[sheetName] = XLSX.utils.aoa_to_sheet(data);\r\n // Apply adapters\r\n wb = this.adapter.apply(\"xlsxWorkbook\", {\r\n xlsx: XLSX,\r\n workbook: wb,\r\n options: options\r\n }).workbook;\r\n uri = this.adapter.apply(\"getExcel\", {\r\n data: \"data:\" + this.getContentType(type) + \";base64,\" + XLSX.write(wb, wbOptions),\r\n options: options\r\n }).data;\r\n return [2 /*return*/, uri];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * This is needed to work around Excel limitations.\r\n *\r\n * @param name Source name\r\n * @return Normalized name\r\n */\r\n Export.prototype.normalizeExcelSheetName = function (name) {\r\n name = name.replace(/([:\\\\\\/?*\\[\\]]+)/g, \" \");\r\n return $utils.truncateWithEllipsis(name, 31, \"...\", true);\r\n };\r\n /**\r\n * Rertuns an array of values to be used as Excel row.\r\n *\r\n * @ignore Exclude from docs\r\n * @param row Row data\r\n * @param options Options\r\n * @param dataFields Data fields\r\n * @param asIs Do not try to convert to dates\r\n * @return Array of values\r\n */\r\n Export.prototype.getExcelRow = function (row, options, dataFields, asIs) {\r\n var _this = this;\r\n if (asIs === void 0) { asIs = false; }\r\n // Init\r\n var items = [];\r\n // Data fields\r\n if (!dataFields) {\r\n dataFields = row;\r\n }\r\n // Data fields order\r\n var dataFieldsOrder = this.adapter.apply(\"dataFieldsOrder\", {\r\n dataFieldsOrder: this.dataFieldsOrder,\r\n format: \"xlsx\"\r\n }).dataFieldsOrder;\r\n // Process each row item\r\n $object.eachOrdered(dataFields, function (key, name) {\r\n // Get value\r\n var value = _this.convertEmptyValue(key, row[key], options);\r\n // Convert dates\r\n var item = asIs ? value : _this.convertToSpecialFormat(key, value, options, true);\r\n items.push(item);\r\n }, function (a, b) {\r\n //console.log(a, b)\r\n var ai = dataFieldsOrder.indexOf(a);\r\n var bi = dataFieldsOrder.indexOf(b);\r\n if (ai > bi) {\r\n return 1;\r\n }\r\n else if (ai < bi) {\r\n return -1;\r\n }\r\n return 0;\r\n });\r\n return items;\r\n };\r\n /**\r\n * Returns chart's data formatted as CSV.\r\n *\r\n * This is an asynchronous function. Check the description of `getImage()`\r\n * for description and example usage.\r\n *\r\n * @param type Type of the export\r\n * @param options Options\r\n * @param encodeURI If true, will return result will be data URI\r\n * @return Promise\r\n * @async\r\n */\r\n Export.prototype.getCSV = function (type, options, encodeURI) {\r\n if (encodeURI === void 0) { encodeURI = true; }\r\n return __awaiter(this, void 0, void 0, function () {\r\n var csv, dataFields, br, data, dataFieldsOrder_3, len, i, row, charset, uri;\r\n var _this = this;\r\n return __generator(this, function (_a) {\r\n if (!$type.hasValue(options)) {\r\n options = this.getFormatOptions(\"csv\");\r\n }\r\n csv = \"\";\r\n dataFields = this.adapter.apply(\"formatDataFields\", {\r\n dataFields: this.dataFields,\r\n format: \"csv\"\r\n }).dataFields;\r\n br = \"\";\r\n data = this.data;\r\n // Vertical or horizontal (default) layout\r\n if (options.pivot) {\r\n dataFieldsOrder_3 = this.adapter.apply(\"dataFieldsOrder\", {\r\n dataFieldsOrder: this.dataFieldsOrder,\r\n format: \"csv\"\r\n }).dataFieldsOrder;\r\n $object.eachOrdered(dataFields, function (key, val) {\r\n var dataRow = [];\r\n if (options.addColumnNames) {\r\n dataRow.push(val);\r\n }\r\n for (var len = data.length, i = 0; i < len; i++) {\r\n var dataValue = data[i][key];\r\n dataRow.push(_this.convertToSpecialFormat(key, dataValue, options, true));\r\n }\r\n csv += br + _this.getCSVRow(dataRow, options, undefined, true);\r\n br = \"\\n\";\r\n }, function (a, b) {\r\n var ai = dataFieldsOrder_3.indexOf(a);\r\n var bi = dataFieldsOrder_3.indexOf(b);\r\n if (ai > bi) {\r\n return -1;\r\n }\r\n else if (ai < bi) {\r\n return 1;\r\n }\r\n return 0;\r\n });\r\n }\r\n else {\r\n for (len = data.length, i = 0; i < len; i++) {\r\n row = this.getCSVRow(data[i], options, dataFields);\r\n if (options.reverse) {\r\n csv = row + br + csv;\r\n }\r\n else {\r\n csv += br + row;\r\n }\r\n br = \"\\n\";\r\n }\r\n // Add column names?\r\n if (options.addColumnNames) {\r\n csv = this.getCSVRow(dataFields, options, undefined, true) + br + csv;\r\n }\r\n }\r\n charset = this.adapter.apply(\"charset\", {\r\n charset: \"charset=utf-8\",\r\n type: type,\r\n options: options\r\n }).charset;\r\n uri = this.adapter.apply(\"getCSV\", {\r\n data: encodeURI ? \"data:\" + this.getContentType(type) + \";\" + charset + \",\" + encodeURIComponent(csv) : csv,\r\n options: options\r\n }).data;\r\n return [2 /*return*/, uri];\r\n });\r\n });\r\n };\r\n /**\r\n * Formats a row of CSV data.\r\n *\r\n * @ignore Exclude from docs\r\n * @param row An object holding data for the row\r\n * @param options Options\r\n * @param dataFields Data fields\r\n * @param asIs Do not try to convert to dates\r\n * @return Formated CSV line\r\n */\r\n Export.prototype.getCSVRow = function (row, options, dataFields, asIs) {\r\n var _this = this;\r\n if (asIs === void 0) { asIs = false; }\r\n // Init\r\n var separator = options.separator || \",\";\r\n var items = [];\r\n // Data fields\r\n if (!dataFields) {\r\n dataFields = row;\r\n }\r\n // Data fields order\r\n var dataFieldsOrder = this.adapter.apply(\"dataFieldsOrder\", {\r\n dataFieldsOrder: this.dataFieldsOrder,\r\n format: \"csv\"\r\n }).dataFieldsOrder;\r\n // Process each row item\r\n $object.eachOrdered(dataFields, function (key, name) {\r\n // Get value\r\n var value = _this.convertEmptyValue(key, row[key], options);\r\n // Check if we need to skip\r\n // This is no longer required because we are iterating via dataFields anyway\r\n /*if ($type.hasValue(this.dataFields) && !$type.hasValue(this.dataFields[key])) {\r\n return;\r\n }*/\r\n // Convert dates\r\n var item = asIs ? value : _this.convertToSpecialFormat(key, value, options);\r\n // Cast and escape doublequotes\r\n item = \"\" + item;\r\n item = item.replace(/\"/g, '\"\"');\r\n // Enclose into double quotes\r\n if (options.forceQuotes || (item.search(new RegExp(\"\\\"|\\n|\" + separator, \"g\")) >= 0)) {\r\n item = \"\\\"\" + item + \"\\\"\";\r\n }\r\n // Add to item\r\n items.push(item);\r\n }, function (a, b) {\r\n //console.log(a, b)\r\n var ai = dataFieldsOrder.indexOf(a);\r\n var bi = dataFieldsOrder.indexOf(b);\r\n if (ai > bi) {\r\n return 1;\r\n }\r\n else if (ai < bi) {\r\n return -1;\r\n }\r\n return 0;\r\n });\r\n return items.join(separator);\r\n };\r\n /**\r\n * Returns chart's data formatted as HTML table.\r\n *\r\n * This is an asynchronous function. Check the description of `getImage()`\r\n * for description and example usage.\r\n *\r\n * @since 4.7.0\r\n * @param type Type of the export\r\n * @param options Options\r\n * @param encodeURI If true, will return result will be data URI\r\n * @return Promise\r\n * @async\r\n */\r\n Export.prototype.getHTML = function (type, options, encodeURI) {\r\n if (encodeURI === void 0) { encodeURI = true; }\r\n return __awaiter(this, void 0, void 0, function () {\r\n var html, dataFields, data, dataFieldsOrder_4, len, i, charset, uri;\r\n var _this = this;\r\n return __generator(this, function (_a) {\r\n if (!$type.hasValue(options)) {\r\n options = this.getFormatOptions(\"html\");\r\n }\r\n html = \"<table>\";\r\n if (options.tableClass) {\r\n html = \"<table class=\\\"\" + options.tableClass + \"\\\">\";\r\n }\r\n dataFields = this.adapter.apply(\"formatDataFields\", {\r\n dataFields: this.dataFields,\r\n format: \"html\"\r\n }).dataFields;\r\n data = this.data;\r\n // Vertical or horizontal (default) layout\r\n if (options.pivot) {\r\n dataFieldsOrder_4 = this.adapter.apply(\"dataFieldsOrder\", {\r\n dataFieldsOrder: this.dataFieldsOrder,\r\n format: \"html\"\r\n }).dataFieldsOrder;\r\n html += \"\\n<tbody>\";\r\n $object.eachOrdered(dataFields, function (key, val) {\r\n var dataRow = [];\r\n if (options.addColumnNames) {\r\n dataRow.push(val);\r\n }\r\n for (var len = data.length, i = 0; i < len; i++) {\r\n var dataValue = data[i][key];\r\n dataRow.push(_this.convertToSpecialFormat(key, dataValue, options, true));\r\n }\r\n html += \"\\n\" + _this.getHTMLRow(dataRow, options, undefined, true);\r\n }, function (a, b) {\r\n var ai = dataFieldsOrder_4.indexOf(a);\r\n var bi = dataFieldsOrder_4.indexOf(b);\r\n if (ai > bi) {\r\n return -1;\r\n }\r\n else if (ai < bi) {\r\n return 1;\r\n }\r\n return 0;\r\n });\r\n html += \"\\n</tbody>\";\r\n }\r\n else {\r\n // Add column names?\r\n if (options.addColumnNames) {\r\n html += \"\\n<thead>\\n\" + this.getHTMLRow(dataFields, options, undefined, true, true) + \"\\n</thead>\";\r\n }\r\n html += \"\\n<tbody>\";\r\n for (len = data.length, i = 0; i < len; i++) {\r\n html += \"\\n\" + this.getHTMLRow(data[i], options, dataFields);\r\n }\r\n html += \"\\n</tbody>\";\r\n }\r\n html += \"\\n</table>\";\r\n charset = this.adapter.apply(\"charset\", {\r\n charset: \"charset=utf-8\",\r\n type: type,\r\n options: options\r\n }).charset;\r\n uri = this.adapter.apply(\"getHTML\", {\r\n data: encodeURI ? \"data:\" + this.getContentType(type) + \";\" + charset + \",\" + encodeURIComponent(html) : html,\r\n options: options\r\n }).data;\r\n return [2 /*return*/, uri];\r\n });\r\n });\r\n };\r\n /**\r\n * Formats a row of HTML data.\r\n *\r\n * @since 4.7.0\r\n * @ignore Exclude from docs\r\n * @param row An object holding data for the row\r\n * @param options Options\r\n * @param dataFields Data fields\r\n * @param asIs Do not try to convert to dates\r\n * @return Formated HTML row\r\n */\r\n Export.prototype.getHTMLRow = function (row, options, dataFields, asIs, headerRow) {\r\n var _this = this;\r\n if (asIs === void 0) { asIs = false; }\r\n if (headerRow === void 0) { headerRow = false; }\r\n // Init output\r\n var html = \"\\t<tr>\";\r\n if (options.rowClass) {\r\n html = \"\\t<tr class=\\\"\" + options.rowClass + \"\\\">\";\r\n }\r\n // Data fields\r\n if (!dataFields) {\r\n dataFields = row;\r\n }\r\n // Data fields order\r\n var dataFieldsOrder = this.adapter.apply(\"dataFieldsOrder\", {\r\n dataFieldsOrder: this.dataFieldsOrder,\r\n format: \"html\"\r\n }).dataFieldsOrder;\r\n // th or dh?\r\n var tag = headerRow ? \"th\" : \"td\";\r\n // Process each row item\r\n var first = true;\r\n $object.eachOrdered(dataFields, function (key, name) {\r\n // Get value\r\n var value = _this.convertEmptyValue(key, row[key], options);\r\n // Convert dates\r\n var item = asIs ? value : _this.convertToSpecialFormat(key, value, options);\r\n // Escape HTML entities\r\n item = \"\" + item;\r\n item = item.replace(/[\\u00A0-\\u9999<>\\&]/gim, function (i) {\r\n return \"&#\" + i.charCodeAt(0) + \";\";\r\n });\r\n // Which tag to use\r\n var useTag = tag;\r\n if (options.pivot && first) {\r\n useTag = \"th\";\r\n }\r\n // Add cell\r\n if (options.cellClass) {\r\n html += \"\\n\\t\\t<\" + useTag + \" class=\\\"\" + options.cellClass + \"\\\">\" + item + \"</\" + useTag + \">\";\r\n }\r\n else {\r\n html += \"\\n\\t\\t<\" + useTag + \">\" + item + \"</\" + useTag + \">\";\r\n }\r\n first = false;\r\n }, function (a, b) {\r\n var ai = dataFieldsOrder.indexOf(a);\r\n var bi = dataFieldsOrder.indexOf(b);\r\n if (ai > bi) {\r\n return 1;\r\n }\r\n else if (ai < bi) {\r\n return -1;\r\n }\r\n return 0;\r\n });\r\n html += \"\\n\\t</tr>\";\r\n return html;\r\n };\r\n /**\r\n * Returns chart's data in JSON format.\r\n *\r\n * This is an asynchronous function. Check the description of `getImage()`\r\n * for description and example usage.\r\n *\r\n * @param type Type of the export\r\n * @param options Options\r\n * @param encodeURI If true, will return result will be data URI\r\n * @return Promise\r\n * @async\r\n */\r\n Export.prototype.getJSON = function (type, options, encodeURI) {\r\n if (encodeURI === void 0) { encodeURI = true; }\r\n return __awaiter(this, void 0, void 0, function () {\r\n var data, dataFields, sourceData, _loop_1, len, i, json, charset, uri;\r\n var _this = this;\r\n return __generator(this, function (_a) {\r\n if (!$type.hasValue(options)) {\r\n options = this.getFormatOptions(\"json\");\r\n }\r\n dataFields = this.adapter.apply(\"formatDataFields\", {\r\n dataFields: this.dataFields,\r\n format: \"csv\"\r\n }).dataFields;\r\n if (!this._dynamicDataFields) {\r\n data = [];\r\n sourceData = this.data;\r\n _loop_1 = function (len, i) {\r\n var value = sourceData[i];\r\n if (typeof value == \"object\") {\r\n var newValue_1 = {};\r\n $object.each(value, function (field, item) {\r\n if ($type.hasValue(dataFields[field])) {\r\n newValue_1[dataFields[field]] = _this.convertToSpecialFormat(field, item, options);\r\n }\r\n });\r\n data.push(newValue_1);\r\n }\r\n };\r\n for (len = sourceData.length, i = 0; i < len; i++) {\r\n _loop_1(len, i);\r\n }\r\n }\r\n else {\r\n data = this.data;\r\n }\r\n json = JSON.stringify(data, function (key, value) {\r\n if (typeof value == \"object\") {\r\n $object.each(value, function (field, item) {\r\n value[field] = _this.convertToSpecialFormat(field, item, options);\r\n });\r\n }\r\n return value;\r\n }, options.indent);\r\n charset = this.adapter.apply(\"charset\", {\r\n charset: \"charset=utf-8\",\r\n type: type,\r\n options: options\r\n }).charset;\r\n uri = this.adapter.apply(\"getJSON\", {\r\n data: encodeURI ? \"data:\" + this.getContentType(type) + \";\" + charset + \",\" + encodeURIComponent(json) : json,\r\n options: options\r\n }).data;\r\n return [2 /*return*/, uri];\r\n });\r\n });\r\n };\r\n /**\r\n * Converts the value to proper date format.\r\n *\r\n * @ignore Exclude from docs\r\n * @param field Field name\r\n * @param value Value\r\n * @param options Options\r\n * @param keepOriginal Will ignore formatting and will keep value as it is in data\r\n * @return Formatted date value or unmodified value\r\n */\r\n Export.prototype.convertToSpecialFormat = function (field, value, options, keepOriginal) {\r\n // Is this a timestamp or duration?\r\n if (typeof value == \"number\") {\r\n if (this.isDateField(field)) {\r\n value = new Date(value);\r\n }\r\n else if (this.isDurationField(field)) {\r\n return this.durationFormatter.format(value, this.durationFormat);\r\n }\r\n else if (this.isNumberField(field) && this.numberFormat) {\r\n return this.numberFormatter.format(value, this.numberFormat);\r\n }\r\n }\r\n if (value instanceof Date) {\r\n if (options.useTimestamps) {\r\n value = value.getTime();\r\n }\r\n else if (options.useLocale) {\r\n if (!keepOriginal) {\r\n value = value.toLocaleString();\r\n }\r\n }\r\n else {\r\n value = this.dateFormatter.format(value, this.dateFormat);\r\n }\r\n }\r\n else if ($type.isString(value) && this.isDateField(field) && this.dateFormat) {\r\n value = this.dateFormatter.format(this.dateFormatter.parse(value), this.dateFormat);\r\n }\r\n return value;\r\n };\r\n /**\r\n * Converts empty value based on `emptyAs` option.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Export.prototype.convertEmptyValue = function (field, value, options) {\r\n return $type.hasValue(value) ? value : options.emptyAs;\r\n };\r\n /**\r\n * Triggers download of the file.\r\n *\r\n * This is an asynchronous function. Check the description of `getImage()`\r\n * for description and example usage.\r\n *\r\n * @param uri Data URI with file content\r\n * @param fileName File name\r\n * @return Promise\r\n * @async\r\n */\r\n Export.prototype.download = function (uri, fileName) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var parts, contentType, decoded, blob_1, chars, i, charCode, blob, link_1, parts, contentType, decoded, blob_2, url_2, chars, i, charCode, blob, url_3, link, parts, contentType, iframe, idoc;\r\n return __generator(this, function (_a) {\r\n if (this.msBlobDownloadSupport()) {\r\n parts = uri.split(\";\");\r\n contentType = parts.shift().replace(/data:/, \"\");\r\n uri = decodeURIComponent(parts.join(\";\").replace(/^[^,]*,/, \"\"));\r\n // Check if we need to Base64-decode\r\n if ([\"image/svg+xml\", \"application/json\", \"text/csv\"].indexOf(contentType) == -1) {\r\n try {\r\n decoded = atob(uri);\r\n uri = decoded;\r\n }\r\n catch (e) {\r\n // Error occurred, meaning string was not Base64-encoded. Do nothing.\r\n return [2 /*return*/, false];\r\n }\r\n }\r\n else {\r\n blob_1 = new Blob([uri], { type: contentType });\r\n window.navigator.msSaveBlob(blob_1, fileName);\r\n return [2 /*return*/, true];\r\n }\r\n chars = new Array(uri.length);\r\n for (i = 0; i < uri.length; ++i) {\r\n charCode = uri.charCodeAt(i);\r\n chars[i] = charCode;\r\n }\r\n blob = new Blob([new Uint8Array(chars)], { type: contentType });\r\n window.navigator.msSaveBlob(blob, fileName);\r\n }\r\n else if (this.blobDownloadSupport()) {\r\n link_1 = document.createElement(\"a\");\r\n link_1.download = fileName;\r\n document.body.appendChild(link_1);\r\n parts = uri.split(\";\");\r\n contentType = parts.shift().replace(/data:/, \"\");\r\n uri = decodeURIComponent(parts.join(\";\").replace(/^[^,]*,/, \"\"));\r\n if ([\"image/svg+xml\", \"application/json\", \"text/csv\", \"text/html\"].indexOf(contentType) == -1) {\r\n try {\r\n decoded = atob(uri);\r\n uri = decoded;\r\n }\r\n catch (e) {\r\n // Error occurred, meaning string was not Base64-encoded. Do nothing.\r\n return [2 /*return*/, false];\r\n }\r\n }\r\n else {\r\n blob_2 = new Blob([uri], { type: contentType });\r\n url_2 = window.URL.createObjectURL(blob_2);\r\n link_1.href = url_2;\r\n link_1.download = fileName;\r\n link_1.click();\r\n setTimeout(function () {\r\n document.body.removeChild(link_1);\r\n window.URL.revokeObjectURL(url_2);\r\n }, 100);\r\n return [2 /*return*/, true];\r\n }\r\n chars = new Array(uri.length);\r\n for (i = 0; i < uri.length; ++i) {\r\n charCode = uri.charCodeAt(i);\r\n chars[i] = charCode;\r\n }\r\n blob = new Blob([new Uint8Array(chars)], { type: contentType });\r\n url_3 = window.URL.createObjectURL(blob);\r\n link_1.href = url_3;\r\n link_1.download = fileName;\r\n document.body.appendChild(link_1);\r\n link_1.click();\r\n document.body.removeChild(link_1);\r\n setTimeout(function () {\r\n window.URL.revokeObjectURL(url_3);\r\n }, 100);\r\n }\r\n else if (this.linkDownloadSupport()) {\r\n link = document.createElement(\"a\");\r\n link.download = fileName;\r\n link.href = uri;\r\n document.body.appendChild(link);\r\n link.click();\r\n document.body.removeChild(link);\r\n }\r\n else if (this.legacyIE()) {\r\n parts = uri.match(/^data:(.*);[ ]*([^,]*),(.*)$/);\r\n if (parts.length === 4) {\r\n // Base64-encoded or text-based stuff?\r\n if (parts[2] == \"base64\") {\r\n // Base64-encoded - probably an image\r\n if (parts[1].match(/^image\\//)) {\r\n // Yep, an image. Let's create a temporary image placeholder,\r\n // so that user can use do Save As.\r\n this.showModal(\"<img src=\\\"\" + uri + \"\\\" style=\\\"float: left; max-width: 50%; max-height: 80%; margin: 0 1em 0.5em 0; border: 1px solid #eee;\\\" />\" +\r\n \"<p>\" + this.language.translate(\"To save the image, right-click thumbnail on the left and choose \\\"Save picture as...\\\"\") +\r\n \"</p>\" +\r\n \"<p style=\\\"text-align: center;\\\"><small>\" + this.language.translate(\"(Press ESC to close this message)\") + \"</small></p>\", this.language.translate(\"Image Export Complete\"));\r\n }\r\n }\r\n else {\r\n contentType = void 0;\r\n if (fileName.match(/\\.svg$/)) {\r\n contentType = \"image/svg+xml\";\r\n }\r\n else {\r\n contentType = \"text/plain\";\r\n fileName += \".txt\";\r\n }\r\n iframe = document.createElement(\"iframe\");\r\n iframe.width = \"1px\";\r\n iframe.height = \"1px\";\r\n iframe.style.display = \"none\";\r\n document.body.appendChild(iframe);\r\n idoc = iframe.contentDocument;\r\n idoc.open(contentType, \"replace\");\r\n // TODO test this with various encodings (e.g. UTF)\r\n //idoc.charset = parts[2].replace(/charset=/, \"\");\r\n idoc.write(decodeURIComponent(parts[3]));\r\n idoc.close();\r\n idoc.execCommand(\"SaveAs\", true, fileName);\r\n // Destroy the iframe\r\n document.body.removeChild(iframe);\r\n }\r\n }\r\n }\r\n else {\r\n /**\r\n * Something else - perhaps a mobile.\r\n * Let's just display it in the same page.\r\n * (hey we don't like it either)\r\n */\r\n window.location.href = uri;\r\n }\r\n return [2 /*return*/, true];\r\n });\r\n });\r\n };\r\n /**\r\n * Returns `true` if browser has any supported methods to trigger download\r\n * of a binary file.\r\n *\r\n * @return Supports downloads?\r\n */\r\n Export.prototype.downloadSupport = function () {\r\n //return !this.legacyIE();\r\n return this.linkDownloadSupport() || this.msBlobDownloadSupport();\r\n };\r\n /**\r\n * Checks if the browser supports \"download\" attribute on links.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Browser supports triggering downloads?\r\n */\r\n Export.prototype.linkDownloadSupport = function () {\r\n // Do we have this cached?\r\n var cache = registry.getCache(\"linkDownloadSupport\");\r\n if (cache === false || cache === true) {\r\n return cache;\r\n }\r\n var a = document.createElement(\"a\");\r\n var res = typeof a.download !== \"undefined\";\r\n registry.setCache(\"linkDownloadSupport\", res);\r\n return res;\r\n };\r\n /**\r\n * Checks if the browser supports download via `msBlob`.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Browser supports triggering downloads?\r\n */\r\n Export.prototype.blobDownloadSupport = function () {\r\n return $type.hasValue(window.Blob);\r\n };\r\n /**\r\n * Checks if the browser supports download via `msBlob`.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Browser supports triggering downloads?\r\n */\r\n Export.prototype.msBlobDownloadSupport = function () {\r\n return $type.hasValue(window.navigator.msSaveOrOpenBlob);\r\n };\r\n /**\r\n * Checks if this is a legacy version of IE.\r\n *\r\n * @ignore Exclude from docs\r\n * @return IE9 or less?\r\n */\r\n Export.prototype.legacyIE = function () {\r\n // Create a temporary <div> with conditional tags in it an an <i> tag.\r\n // Count <i>s. If there are some, we have IE9 or late on our hands.\r\n var div = document.createElement(\"div\");\r\n div.innerHTML = \"<!--[if lt IE 10]><i></i><![endif]-->\";\r\n return div.getElementsByTagName(\"i\").length == 1;\r\n };\r\n /**\r\n * Initiates print of the chart.\r\n *\r\n * This is an asynchronous function. Check the description of `getImage()`\r\n * for description and example usage.\r\n *\r\n * @param data Data URI for the image\r\n * @param options Options\r\n * @param title Optional title to use (uses window's title by default)\r\n * @return Promise\r\n * @async\r\n */\r\n Export.prototype.print = function (data, options, title) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n return __generator(this, function (_a) {\r\n if (options.printMethod == \"css\") {\r\n return [2 /*return*/, this.printViaCSS(data, options, title)];\r\n }\r\n else {\r\n return [2 /*return*/, this.printViaIframe(data, options, title)];\r\n }\r\n return [2 /*return*/];\r\n });\r\n });\r\n };\r\n Export.prototype.printViaCSS = function (data, options, title) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var scroll, rule, originalTitle, img, isIOS;\r\n return __generator(this, function (_a) {\r\n scroll = document.documentElement.scrollTop || document.body.scrollTop;\r\n rule = new StyleRule($dom.getShadowRoot(this.container), \"body > *\", {\r\n \"display\": \"none\",\r\n \"position\": \"fixed\",\r\n \"visibility\": \"hidden\",\r\n \"opacity\": \"0\",\r\n \"clipPath\": \"polygon(0px 0px,0px 0px,0px 0px,0px 0px);\"\r\n });\r\n if (title && document && document.title) {\r\n originalTitle = document.title;\r\n document.title = title;\r\n }\r\n img = new Image();\r\n img.src = data;\r\n img.style.maxWidth = \"100%\";\r\n img.style.display = \"block\";\r\n img.style.position = \"relative\";\r\n img.style.visibility = \"visible\";\r\n img.style.opacity = \"1\";\r\n img.style.clipPath = \"none\";\r\n document.body.appendChild(img);\r\n // Print\r\n this.setTimeout(function () {\r\n window.print();\r\n }, 50);\r\n isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;\r\n if (isIOS && (options.delay < 1000)) {\r\n options.delay = 1000;\r\n }\r\n else if (options.delay < 100) {\r\n options.delay = 100;\r\n }\r\n // Delay function that resets back the document the way ot was before\r\n this.setTimeout(function () {\r\n // Remove image\r\n document.body.removeChild(img);\r\n // Reset back all elements\r\n /*for (let len = items.length, i = 0; i < len; i++) {\r\n let item = <HTMLElement>items[i];\r\n if ($dom.isElement(item)) {\r\n item.style.display = states[i];\r\n }\r\n }*/\r\n rule.dispose();\r\n // Restore title\r\n if (originalTitle) {\r\n document.title = document.title;\r\n }\r\n // Scroll back the document the way it was before\r\n document.documentElement.scrollTop = document.body.scrollTop = scroll;\r\n }, options.delay || 500);\r\n return [2 /*return*/, true];\r\n });\r\n });\r\n };\r\n Export.prototype.printViaIframe = function (data, options, title) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var iframe, img, isIOS;\r\n return __generator(this, function (_a) {\r\n iframe = document.createElement(\"iframe\");\r\n iframe.style.visibility = \"hidden\";\r\n document.body.appendChild(iframe);\r\n // This is needed for FireFox\r\n iframe.contentWindow.document.open();\r\n iframe.contentWindow.document.close();\r\n img = new Image();\r\n img.src = data;\r\n img.style.maxWidth = \"100%\";\r\n img.style.height = \"auto\";\r\n if (title) {\r\n iframe.contentWindow.document.title = title;\r\n }\r\n iframe.contentWindow.document.body.appendChild(img);\r\n iframe.load = function () {\r\n iframe.contentWindow.document.body.appendChild(img);\r\n };\r\n // Print\r\n this.setTimeout(function () {\r\n try {\r\n if (!iframe.contentWindow.document.execCommand(\"print\", false, null)) {\r\n iframe.contentWindow.print();\r\n }\r\n }\r\n catch (e) {\r\n iframe.contentWindow.print();\r\n }\r\n }, options.delay || 50);\r\n isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;\r\n if (isIOS && (options.delay < 1000)) {\r\n options.delay = 1000;\r\n }\r\n else if (options.delay < 100) {\r\n options.delay = 100;\r\n }\r\n // Delay function that resets back the document the way ot was before\r\n this.setTimeout(function () {\r\n // Remove image\r\n document.body.removeChild(iframe);\r\n }, options.delay + 50 || 100);\r\n return [2 /*return*/, true];\r\n });\r\n });\r\n };\r\n /**\r\n * Finds a background color for the element. If element is transparent it goes\r\n * up the DOM hierarchy to find a parent element that does.\r\n *\r\n * @ignore Exclude from docs\r\n * @param element Element\r\n * @return Color code\r\n */\r\n Export.prototype.findBackgroundColor = function (element) {\r\n // Check if element has styles set\r\n var opacity = 1, currentColor = getComputedStyle(element, \"background-color\");\r\n // Check opacity\r\n if (currentColor.match(/[^,]*,[^,]*,[^,]*,[ ]?0/) || currentColor == \"transparent\") {\r\n opacity = 0;\r\n }\r\n if (opacity == 0) {\r\n var parent_2 = element.parentElement; // || <Element>element.parentNode;\r\n // Completely transparent. Look for a parent\r\n if (parent_2) {\r\n return this.findBackgroundColor(parent_2);\r\n }\r\n else {\r\n return color(\"#fff\");\r\n }\r\n }\r\n else {\r\n return color(currentColor, opacity);\r\n }\r\n };\r\n Object.defineProperty(Export.prototype, \"container\", {\r\n /**\r\n * @return Reference\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"container\", {\r\n container: this._container\r\n }).container;\r\n },\r\n /**\r\n * A reference to a container to be used to place [[ExportMenu]] in.\r\n *\r\n * @param value Reference\r\n */\r\n set: function (value) {\r\n this._container = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Export.prototype, \"sprite\", {\r\n /**\r\n * @return Sprite\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"sprite\", {\r\n sprite: this._sprite\r\n }).sprite;\r\n },\r\n /**\r\n * A reference to [[Sprite]] to export. Can be any Sprite, including some\r\n * internal elements.\r\n *\r\n * @param value Sprite\r\n */\r\n set: function (value) {\r\n this._sprite = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Export.prototype, \"extraSprites\", {\r\n /**\r\n * @return Sprite\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"extraSprites\", {\r\n extraSprites: this._extraSprites\r\n }).extraSprites;\r\n },\r\n /**\r\n * An array of extra [[Sprite]] elements to include in export.\r\n *\r\n * It can be used to export any external elements, or even other charts.\r\n *\r\n * E.g.:\r\n *\r\n * ```TypeScript\r\n * chart.exporting.extraSprites.push(chart2);\r\n * ```\r\n * ```JavaScript\r\n * chart.exporting.extraSprites.push(chart2);\r\n * ```\r\n *\r\n * @since 4.2.0\r\n * @param value Sprite\r\n */\r\n set: function (value) {\r\n this._extraSprites = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Export.prototype, \"validateSprites\", {\r\n /**\r\n * @return Sprite\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"validateSprites\", {\r\n validateSprites: this._validateSprites\r\n }).validateSprites;\r\n },\r\n /**\r\n * An array of [[Sprite]] elements that need to be valid before export\r\n * commences.\r\n *\r\n * If any of those elements is not completely ready when export is triggered,\r\n * the export will wait until they are (their `validated` event triggers)\r\n * before going through with the export opertaion.\r\n *\r\n * This is useful if you need to modify chart appearance for the export.\r\n *\r\n * E.g.:\r\n *\r\n * ```TypeScript\r\n * // Add watermark\r\n * let watermark = chart.createChild(am4core.Label);\r\n * watermark.text = \"Copyright (C) 2019\";\r\n * watermark.disabled = true;\r\n *\r\n * // Add watermark to validated sprites\r\n * chart.exporting.validateSprites.push(watermark);\r\n *\r\n * // Enable watermark on export\r\n * chart.exporting.events.on(\"exportstarted\", function(ev) {\r\n * watermark.disabled = false;\r\n * });\r\n *\r\n * // Disable watermark when export finishes\r\n * chart.exporting.events.on(\"exportfinished\", function(ev) {\r\n * watermark.disabled = true;\r\n * });\r\n * ```\r\n * ```JavaScript\r\n * // Add watermark\r\n * var watermark = chart.createChild(am4core.Label);\r\n * watermark.text = \"Copyright (C) 2019\";\r\n * watermark.disabled = true;\r\n *\r\n * // Add watermark to validated sprites\r\n * chart.exporting.validateSprites.push(watermark);\r\n *\r\n * // Enable watermark on export\r\n * chart.exporting.events.on(\"exportstarted\", function(ev) {\r\n * watermark.disabled = false;\r\n * });\r\n *\r\n * // Disable watermark when export finishes\r\n * chart.exporting.events.on(\"exportfinished\", function(ev) {\r\n * watermark.disabled = true;\r\n * });\r\n * ```\r\n *\r\n * @since 4.6.8\r\n * @param value Sprite\r\n */\r\n set: function (value) {\r\n this._validateSprites = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Export.prototype, \"data\", {\r\n /**\r\n * @return Data\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"data\", {\r\n data: this._data\r\n }).data;\r\n },\r\n /**\r\n * Data to export.\r\n *\r\n * @param value Data\r\n */\r\n set: function (value) {\r\n this._data = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Export.prototype, \"dataFields\", {\r\n /**\r\n * @return Field names `{ field: fieldName }`\r\n */\r\n get: function () {\r\n if (!this._dataFields) {\r\n this.generateDataFields();\r\n }\r\n return this.adapter.apply(\"dataFields\", {\r\n dataFields: this._dataFields\r\n }).dataFields;\r\n },\r\n /**\r\n * Data fields in `{ field: fieldName }` format. Those are used for\r\n * exporting in data formats to name the columns.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/exporting/#Changing_order_and_names_of_columns} for examples and details\r\n * @param value Field names\r\n */\r\n set: function (value) {\r\n this._dataFields = value;\r\n this._dynamicDataFields = false;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Called after target chart's data updates.\r\n *\r\n * @ignore\r\n */\r\n Export.prototype.handleDataUpdated = function () {\r\n if (this._dynamicDataFields) {\r\n this._dataFields = undefined;\r\n }\r\n var hasData = this.data.length > 0;\r\n if (this._prevHasData != hasData) {\r\n this._prevHasData = hasData;\r\n if (this.menu) {\r\n this.menu.invalidate();\r\n }\r\n }\r\n };\r\n Object.defineProperty(Export.prototype, \"dateFormatter\", {\r\n /**\r\n * @return A DateFormatter instance\r\n */\r\n get: function () {\r\n if (!this._dateFormatter) {\r\n this._dateFormatter = new DateFormatter();\r\n this._dateFormatter.language = this.language;\r\n }\r\n return this.adapter.apply(\"dateFormatter\", {\r\n dateFormatter: this._dateFormatter\r\n }).dateFormatter;\r\n },\r\n /**\r\n * A [[DateFormatter]] to use when formatting dates when exporting data.\r\n *\r\n * @param value DateFormatter instance\r\n */\r\n set: function (value) {\r\n this._dateFormatter = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Export.prototype, \"dateFormat\", {\r\n /**\r\n * @return Date format\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"dateFormat\", {\r\n dateFormat: this._dateFormat\r\n }).dateFormat;\r\n },\r\n /**\r\n * A date format to use for exporting dates. Will use [[DateFormatter]]\r\n * format if not set.\r\n *\r\n * @param value Date format\r\n */\r\n set: function (value) {\r\n this._dateFormat = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Export.prototype, \"dateFields\", {\r\n /**\r\n * @return Date field list\r\n */\r\n get: function () {\r\n if (!this._dateFields) {\r\n this._dateFields = new List();\r\n }\r\n return this.adapter.apply(\"dateFields\", {\r\n dateFields: this._dateFields\r\n }).dateFields;\r\n },\r\n /**\r\n * A list of fields that hold date values.\r\n *\r\n * @param value Date field list\r\n */\r\n set: function (value) {\r\n this._dateFields = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Export.prototype, \"numberFormatter\", {\r\n /**\r\n * @return A NumberFormatter instance\r\n */\r\n get: function () {\r\n if (!this._numberFormatter) {\r\n this._numberFormatter = new NumberFormatter();\r\n this._numberFormatter.language = this.language;\r\n }\r\n return this.adapter.apply(\"numberFormatter\", {\r\n numberFormatter: this._numberFormatter\r\n }).numberFormatter;\r\n },\r\n /**\r\n * A [[NumberFormatter]] to use when formatting dates when exporting data.\r\n *\r\n * @since 4.5.15\r\n * @param value NumberFormatter instance\r\n */\r\n set: function (value) {\r\n this._numberFormatter = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Export.prototype, \"numberFormat\", {\r\n /**\r\n * @return Number format\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"numberFormat\", {\r\n numberFormat: this._numberFormat\r\n }).numberFormat;\r\n },\r\n /**\r\n * A number format to use for exporting dates. Will use [[NumberFormatter]]\r\n * format if not set.\r\n *\r\n * @since 4.5.15\r\n * @param value Number format\r\n */\r\n set: function (value) {\r\n this._numberFormat = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Export.prototype, \"numberFields\", {\r\n /**\r\n * @return Number field list\r\n */\r\n get: function () {\r\n if (!this._numberFields) {\r\n this._numberFields = new List();\r\n }\r\n return this.adapter.apply(\"numberFields\", {\r\n numberFields: this._numberFields\r\n }).numberFields;\r\n },\r\n /**\r\n * A list of fields that hold number values.\r\n *\r\n * @since 4.5.15\r\n * @param value Number field list\r\n */\r\n set: function (value) {\r\n this._numberFields = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Export.prototype, \"durationFormatter\", {\r\n /**\r\n * @return A DurationFormatter instance\r\n */\r\n get: function () {\r\n if (!this._durationFormatter) {\r\n this._durationFormatter = new DurationFormatter();\r\n this._durationFormatter.language = this.language;\r\n }\r\n return this.adapter.apply(\"durationFormatter\", {\r\n durationFormatter: this._durationFormatter\r\n }).durationFormatter;\r\n },\r\n /**\r\n * A [[DurationFormatter]] to use when formatting duration values when\r\n * exporting data.\r\n *\r\n * @param value DurationFormatter instance\r\n */\r\n set: function (value) {\r\n this._durationFormatter = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Export.prototype, \"durationFormat\", {\r\n /**\r\n * @return Duration format\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"durationFormat\", {\r\n durationFormat: this._durationFormat\r\n }).durationFormat;\r\n },\r\n /**\r\n * A format to use when formatting values from `durationFields`.\r\n * Will use [[DurationFormatter]] format if not set.\r\n *\r\n * @param value Duration format\r\n */\r\n set: function (value) {\r\n this._durationFormat = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Export.prototype, \"durationFields\", {\r\n /**\r\n * @return Duration field list\r\n */\r\n get: function () {\r\n if (!this._durationFields) {\r\n this._durationFields = new List();\r\n }\r\n return this.adapter.apply(\"durationFields\", {\r\n durationFields: this._durationFields\r\n }).durationFields;\r\n },\r\n /**\r\n * A list of fields that hold duration values.\r\n *\r\n * @param value Duration field list\r\n */\r\n set: function (value) {\r\n this._durationFields = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Generates data fields out of the first row of data.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Export.prototype.generateDataFields = function () {\r\n var _this = this;\r\n this._dataFields = {};\r\n if (this.data.length) {\r\n $array.each(this.data, function (row) {\r\n $object.each(row, function (key, value) {\r\n if (!$type.hasValue(_this._dataFields[key])) {\r\n _this._dataFields[key] = _this.adapter.apply(\"dataFieldName\", {\r\n name: key,\r\n field: key\r\n }).name;\r\n }\r\n });\r\n });\r\n }\r\n };\r\n /**\r\n * Cheks against `dateFields` property to determine if this field holds\r\n * dates.\r\n *\r\n * @ignore Exclude from docs\r\n * @param field Field name\r\n * @param options Options\r\n * @return `true` if it's a date field\r\n */\r\n Export.prototype.isDateField = function (field) {\r\n return this.adapter.apply(\"isDateField\", {\r\n isDateField: this.dateFields.contains(field),\r\n field: field\r\n }).isDateField;\r\n };\r\n /**\r\n * Cheks against `numberFields` property to determine if this field holds\r\n * numbers.\r\n *\r\n * @ignore Exclude from docs\r\n * @param field Field name\r\n * @param options Options\r\n * @return `true` if it's a number field\r\n */\r\n Export.prototype.isNumberField = function (field) {\r\n return this.adapter.apply(\"isNumberField\", {\r\n isNumberField: this.numberFields.contains(field),\r\n field: field\r\n }).isNumberField;\r\n };\r\n /**\r\n * Cheks against `durationFields` property to determine if this field holds\r\n * durations.\r\n *\r\n * @ignore Exclude from docs\r\n * @param field Field name\r\n * @param options Options\r\n * @return `true` if it's a date field\r\n */\r\n Export.prototype.isDurationField = function (field) {\r\n return this.adapter.apply(\"isDurationField\", {\r\n isDurationField: this.durationFields.contains(field),\r\n field: field\r\n }).isDurationField;\r\n };\r\n /**\r\n * Returns proper content type for the export type.\r\n *\r\n * @param type Export format/type\r\n * @return Proper content type, i.e. \"image/jpeg\"\r\n */\r\n Export.prototype.getContentType = function (type) {\r\n var contentType = \"\";\r\n switch (type) {\r\n case \"png\":\r\n case \"gif\":\r\n contentType = \"image/\" + type;\r\n break;\r\n case \"jpg\":\r\n contentType = \"image/jpeg\";\r\n break;\r\n case \"svg\":\r\n contentType = \"image/svg+xml\";\r\n break;\r\n case \"csv\":\r\n contentType = \"text/csv\";\r\n break;\r\n case \"json\":\r\n contentType = \"application/json\";\r\n break;\r\n case \"html\":\r\n contentType = \"text/html\";\r\n break;\r\n case \"pdf\":\r\n case \"pdfdata\":\r\n contentType = \"application/pdf\";\r\n break;\r\n case \"xlsx\":\r\n contentType = \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\";\r\n break;\r\n }\r\n return this.adapter.apply(\"contentType\", {\r\n contentType: contentType,\r\n type: type\r\n }).contentType;\r\n };\r\n Object.defineProperty(Export.prototype, \"filePrefix\", {\r\n /**\r\n * @return File prefix\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"filePrefix\", {\r\n filePrefix: this._filePrefix\r\n }).filePrefix;\r\n },\r\n /**\r\n * A file prefix to be used for all exported formats.\r\n *\r\n * Export will apply format-related extension to it. E.g. if this is set to\r\n * \"myExport\", the file name of the PNG exported image will be \"myExport.png\".\r\n *\r\n * @param value File prefix\r\n */\r\n set: function (value) {\r\n this._filePrefix = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Export.prototype, \"backgroundColor\", {\r\n /**\r\n * @return Background color\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"backgroundColor\", {\r\n backgroundColor: this._backgroundColor\r\n }).backgroundColor;\r\n },\r\n /**\r\n * A background color to be used for exported images. If set, this will\r\n * override the automatically acquired background color.\r\n *\r\n * @param value Color\r\n */\r\n set: function (value) {\r\n this._backgroundColor = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Export.prototype, \"title\", {\r\n /**\r\n * @return Title\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"title\", {\r\n title: this._title\r\n }).title;\r\n },\r\n /**\r\n * A title to be used when printing.\r\n *\r\n * @param value Title\r\n */\r\n set: function (value) {\r\n this._title = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Displays a preloader/exporting indicator.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Add ability to change text\r\n */\r\n Export.prototype.showPreloader = function () {\r\n var preloader = this.preloader;\r\n if (preloader) {\r\n preloader.progress = 0.5;\r\n preloader.label.text = \"...\";\r\n }\r\n };\r\n /**\r\n * Hides preloader/exporting indicator\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Export.prototype.hidePreloader = function () {\r\n var preloader = this.preloader;\r\n if (preloader) {\r\n preloader.progress = 1;\r\n }\r\n };\r\n Object.defineProperty(Export.prototype, \"preloader\", {\r\n /**\r\n * Returns a an instance of [[Preloader]] associated with the Sprite being\r\n * exported.\r\n *\r\n * @return Preloader\r\n */\r\n get: function () {\r\n return this._sprite && this._sprite.parent && this._sprite.parent.preloader ?\r\n this._sprite.parent.preloader :\r\n undefined;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Displays a modal saying export is taking longer than expected.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Export.prototype.showTimeout = function () {\r\n this.showModal(this.adapter.apply(\"timeoutMessage\", {\r\n message: this.language.translate(\"Export operation took longer than expected. Something might have gone wrong.\")\r\n }).message);\r\n };\r\n /**\r\n * Hides preloader/exporting indicator.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Export.prototype.hideTimeout = function () {\r\n if (this._timeoutTimeout) {\r\n this.removeDispose(this._timeoutTimeout);\r\n this._timeoutTimeout = null;\r\n }\r\n this.hideModal();\r\n };\r\n Object.defineProperty(Export.prototype, \"language\", {\r\n /**\r\n * @return A [[Language]] instance to be used\r\n */\r\n get: function () {\r\n if (!this._language) {\r\n this._language = new Language();\r\n }\r\n return this._language;\r\n },\r\n /**\r\n * A [[Language]] instance to be used for translations.\r\n *\r\n * @param value An instance of [[Language]]\r\n */\r\n set: function (value) {\r\n this._language = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Export.prototype, \"modal\", {\r\n /**\r\n * Returns (and creates) [[Modal]].\r\n *\r\n * @ignore Exclude from docs\r\n * @return Modal instance\r\n */\r\n get: function () {\r\n if (!this._modal) {\r\n this._modal = new Modal();\r\n // Prefix with Sprite's class name\r\n this._modal.adapter.add(\"classPrefix\", function (value) {\r\n value = options.classNamePrefix + value;\r\n return value;\r\n });\r\n }\r\n return this._modal;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Shows [[Modal]] with specific text.\r\n *\r\n * @ignore Exclude from docs\r\n * @param text Modal contents\r\n */\r\n Export.prototype.showModal = function (text, title) {\r\n // Hide previous modal and preloader\r\n this.hideModal();\r\n this.hidePreloader();\r\n // Create modal\r\n var modal = this.modal;\r\n modal.container = this.sprite.svgContainer.SVGContainer;\r\n modal.content = text;\r\n modal.readerTitle = title;\r\n modal.open();\r\n };\r\n /**\r\n * Hides modal window if one's currently open.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Export.prototype.hideModal = function () {\r\n if (this._modal) {\r\n this.modal.close();\r\n }\r\n };\r\n /**\r\n * Loads canvg dynamic module.\r\n *\r\n * This is an asynchronous function. Check the description of `getImage()`\r\n * for description and example usage.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Instance of canvg\r\n * @async\r\n */\r\n Export.prototype._canvg = function () {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var canvg;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0: return [4 /*yield*/, import(/* webpackChunkName: \"canvg\" */ \"../../canvg/index.js\")];\r\n case 1:\r\n canvg = (_a.sent());\r\n if (canvg.default != null) {\r\n return [2 /*return*/, canvg.default];\r\n }\r\n else {\r\n return [2 /*return*/, canvg];\r\n }\r\n return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n Object.defineProperty(Export.prototype, \"canvg\", {\r\n /**\r\n * Returns canvg instance.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Instance of canvg\r\n */\r\n get: function () {\r\n return this._canvg();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Export.prototype, \"pdfmake\", {\r\n /**\r\n * Returns pdfmake instance.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Instance of pdfmake\r\n */\r\n get: function () {\r\n if (pdfmakePromise == null) {\r\n pdfmakePromise = _pdfmake();\r\n }\r\n return pdfmakePromise;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Loads xlsx dynamic module.\r\n *\r\n * This is an asynchronous function. Check the description of `getImage()`\r\n * for description and example usage.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Instance of pdfmake\r\n * @async\r\n */\r\n Export.prototype._xlsx = function () {\r\n return __awaiter(this, void 0, void 0, function () {\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0: return [4 /*yield*/, import(/* webpackChunkName: \"xlsx\" */ \"xlsx\")];\r\n case 1: return [2 /*return*/, _a.sent()];\r\n }\r\n });\r\n });\r\n };\r\n Object.defineProperty(Export.prototype, \"xlsx\", {\r\n /**\r\n * Returns xlsx instance.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Instance of pdfmake\r\n */\r\n get: function () {\r\n return this._xlsx();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Sets options for a format.\r\n */\r\n Export.prototype.setFormatOptions = function (type, options) {\r\n this._formatOptions.setKey(type, options);\r\n };\r\n /**\r\n * Returns current options for a format.\r\n */\r\n Export.prototype.getFormatOptions = function (type) {\r\n return this._formatOptions.getKey(type);\r\n };\r\n Object.defineProperty(Export.prototype, \"formatOptions\", {\r\n /**\r\n * A [[Dictionary]] object containing format-specific options.\r\n *\r\n * May be used to change specific option for the format:\r\n *\r\n * ```TypeScript\r\n * chart.exporting.formatOptions.getKey(\"csv\").disabled = true;\r\n * ```\r\n * ```JavaScript\r\n * chart.exporting.formatOptions.getKey(\"csv\").disabled = true;\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"exporting\": {\r\n * // ...\r\n * \"formatOptions\": {\r\n * \"csv\": {\r\n * \"disabled\": true\r\n * }\r\n * }\r\n * }\r\n * }\r\n * ```\r\n *\r\n * @since 4.9.12\r\n * @return Options\r\n */\r\n get: function () {\r\n return this._formatOptions;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Disables interactivity on parent chart.\r\n */\r\n Export.prototype._disablePointers = function () {\r\n if (!$type.hasValue(this._spriteInteractionsEnabled)) {\r\n this._spriteInteractionsEnabled = this.sprite.interactionsEnabled;\r\n }\r\n this.sprite.interactionsEnabled = false;\r\n };\r\n /**\r\n * Releases temporarily disabled pointers on parent chart.\r\n */\r\n Export.prototype._releasePointers = function () {\r\n if ($type.hasValue(this._spriteInteractionsEnabled) && !this._exportRunning) {\r\n this.sprite.interactionsEnabled = this._spriteInteractionsEnabled;\r\n }\r\n };\r\n /**\r\n * Hides all elements that should not be included in the exported image.\r\n */\r\n Export.prototype.hideNonExportableSprites = function () {\r\n var _this = this;\r\n if (this._objectsAlreadyHidden) {\r\n return;\r\n }\r\n var svgContainer = this.sprite.svgContainer;\r\n if (svgContainer) {\r\n $array.each(svgContainer.nonExportableSprites, function (item) {\r\n if (!item.isHidden && !item.isHiding && item.visible) {\r\n _this._hiddenObjects.push(item);\r\n }\r\n item.hide(0);\r\n });\r\n }\r\n this._objectsAlreadyHidden = true;\r\n };\r\n /**\r\n * Respores elements that were hidden before export.\r\n */\r\n Export.prototype.restoreNonExportableSprites = function () {\r\n if (!this._objectsAlreadyHidden) {\r\n return;\r\n }\r\n $array.each(this._hiddenObjects, function (item) {\r\n item.show(0);\r\n });\r\n this._hiddenObjects = [];\r\n this._objectsAlreadyHidden = false;\r\n };\r\n /**\r\n * Checks if there are elements that absolutely need to be validated before\r\n * export.\r\n *\r\n * If there are invalid elements, it will await for them to be validated.\r\n *\r\n * @return Promise\r\n */\r\n Export.prototype.awaitValidSprites = function () {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var promises;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n promises = [];\r\n if (this.validateSprites.length) {\r\n $array.each(this.validateSprites, function (sprite, index) {\r\n if (sprite.invalid) {\r\n promises.push(new Promise(function (resolve, reject) {\r\n sprite.events.once(\"validated\", function (ev) {\r\n resolve();\r\n });\r\n }));\r\n }\r\n });\r\n }\r\n if (!promises.length) return [3 /*break*/, 2];\r\n return [4 /*yield*/, Promise.all(promises)];\r\n case 1:\r\n _a.sent();\r\n _a.label = 2;\r\n case 2: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Processes JSON-based config before it is applied to the object.\r\n *\r\n * @ignore Exclude from docs\r\n * @param config Config\r\n */\r\n Export.prototype.processConfig = function (config) {\r\n registry.registeredClasses[\"ExportMenu\"] = ExportMenu;\r\n if (config) {\r\n // Set up menu\r\n if ($type.hasValue(config.menu) && !$type.hasValue(config.menu.type)) {\r\n config.menu.type = \"ExportMenu\";\r\n }\r\n }\r\n _super.prototype.processConfig.call(this, config);\r\n };\r\n /**\r\n * XLINK namespace definition.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Export.XLINK = \"http://www.w3.org/1999/xlink\";\r\n return Export;\r\n}(Validatable));\r\nexport { Export };\r\n","import { StyleRule } from \"../utils/DOM\";\r\nimport { InterfaceColorSet } from \"../utils/InterfaceColorSet\";\r\nimport { Dictionary } from \"../utils/Dictionary\";\r\nimport { MultiDisposer, CounterDisposer } from \"../utils/Disposer\";\r\nvar rules = new Dictionary();\r\n/**\r\n * A dynamically-loadable CSS module for Export menu.\r\n *\r\n * @ignore Exclude from docs\r\n * @param prefix Prefix to addtach to class names\r\n * @return A MultiDisposer with style rules\r\n */\r\nexport default function (element, prefix) {\r\n var newPrefix = (prefix ? prefix : \"amexport\");\r\n var colorSet = new InterfaceColorSet();\r\n var counter = rules.insertKeyIfEmpty(newPrefix, function () {\r\n var disposer = new MultiDisposer([\r\n /*new StyleRule(`.${newPrefix}-menu`, {\r\n \"opacity\": \"0.3\",\r\n \"transition\": \"all 100ms ease-in-out\",\r\n }),\r\n\r\n new StyleRule(`div:hover .${newPrefix}-menu, .${newPrefix}-menu.active`, {\r\n \"opacity\": \"0.9\",\r\n }),*/\r\n new StyleRule(element, \".\" + newPrefix + \"-menu *\", {\r\n \"box-sizing\": \"border-box\"\r\n }),\r\n new StyleRule(element, \".\" + newPrefix + \"-menu-level-0\", {\r\n \"position\": \"absolute\",\r\n \"top\": \"5px\",\r\n \"right\": \"5px\",\r\n }),\r\n new StyleRule(element, \".\" + newPrefix + \"-menu-level-0.\" + newPrefix + \"-left\", {\r\n \"right\": \"auto\",\r\n \"left\": \"5px\",\r\n }),\r\n new StyleRule(element, \".\" + newPrefix + \"-menu-level-0.\" + newPrefix + \"-right\", {\r\n \"right\": \"5px\",\r\n \"left\": \"auto\",\r\n }),\r\n new StyleRule(element, \".\" + newPrefix + \"-menu-level-0.\" + newPrefix + \"-top\", {\r\n \"top\": \"5px\",\r\n \"bottom\": \"auto\",\r\n }),\r\n new StyleRule(element, \".\" + newPrefix + \"-menu-level-0.\" + newPrefix + \"-bottom\", {\r\n \"top\": \"auto\",\r\n \"bottom\": \"5px\",\r\n }),\r\n new StyleRule(element, \".\" + newPrefix + \"-item.\" + newPrefix + \"-item-level-0\", {\r\n \"opacity\": \"0.3\",\r\n \"width\": \"30px\",\r\n \"min-height\": \"30px\",\r\n \"transition\": \"all 100ms ease-in-out\",\r\n }),\r\n new StyleRule(element, \"div:hover .\" + newPrefix + \"-item.\" + newPrefix + \"-item-level-0, .\" + newPrefix + \"-item.\" + newPrefix + \"-item-level-0.active\", {\r\n \"opacity\": \"0.9\",\r\n }),\r\n new StyleRule(element, \".\" + newPrefix + \"-item.\" + newPrefix + \"-item-level-0 > a\", {\r\n \"padding\": \"0\",\r\n \"text-align\": \"center\",\r\n \"overflow\": \"hidden\"\r\n }),\r\n new StyleRule(element, \".\" + newPrefix + \"-item.\" + newPrefix + \"-item-level-0:before\", {\r\n \"display\": \"block\"\r\n }),\r\n new StyleRule(element, \".\" + newPrefix + \"-item\", {\r\n \"position\": \"relative\",\r\n \"display\": \"block\",\r\n \"opacity\": \"0\",\r\n \"z-index\": \"1\",\r\n \"border-radius\": \"3px\",\r\n \"background-color\": colorSet.getFor(\"secondaryButton\").hex,\r\n \"padding\": \"0\",\r\n \"margin\": \"1px 1px 0 0\",\r\n \"color\": colorSet.getFor(\"secondaryButton\").alternative.hex,\r\n \"transition\": \"all 100ms ease-in-out, opacity 0.5s ease 0.5s\",\r\n }),\r\n new StyleRule(element, \".\" + newPrefix + \"-left .\" + newPrefix + \"-item\", {\r\n \"margin\": \"1px 0 0 1px\",\r\n }),\r\n new StyleRule(element, \".\" + newPrefix + \"-item:hover, .\" + newPrefix + \"-item.active\", {\r\n \"background\": colorSet.getFor(\"secondaryButtonHover\").hex,\r\n \"color\": colorSet.getFor(\"secondaryButtonText\").hex,\r\n }),\r\n new StyleRule(element, \".\" + newPrefix + \"-item > .\" + newPrefix + \"-menu\", {\r\n \"position\": \"absolute\",\r\n \"top\": \"-1px\",\r\n \"right\": \"0\",\r\n \"margin-right\": \"100%\",\r\n }),\r\n new StyleRule(element, \".\" + newPrefix + \"-left .\" + newPrefix + \"-item > .\" + newPrefix + \"-menu\", {\r\n \"left\": \"0\",\r\n \"right\": \"auto\",\r\n \"margin-left\": \"100%\",\r\n \"margin-right\": \"auto\",\r\n }),\r\n new StyleRule(element, \".\" + newPrefix + \"-right .\" + newPrefix + \"-item > .\" + newPrefix + \"-menu\", {\r\n \"left\": \"auto\",\r\n \"right\": \"0\",\r\n \"margin-left\": \"auto\",\r\n \"margin-right\": \"100%\",\r\n }),\r\n new StyleRule(element, \".\" + newPrefix + \"-top .\" + newPrefix + \"-item > .\" + newPrefix + \"-menu\", {\r\n \"top\": \"-1px\",\r\n \"bottom\": \"auto\",\r\n }),\r\n new StyleRule(element, \".\" + newPrefix + \"-bottom .\" + newPrefix + \"-item > .\" + newPrefix + \"-menu\", {\r\n \"top\": \"auto\",\r\n \"bottom\": \"0\",\r\n }),\r\n new StyleRule(element, \".\" + newPrefix + \"-item > .\" + newPrefix + \"-menu\", {\r\n \"display\": \"none\",\r\n }),\r\n new StyleRule(element, \".\" + newPrefix + \"-item:hover > .\" + newPrefix + \"-menu, .\" + newPrefix + \"-item.active > .\" + newPrefix + \"-menu\", {\r\n \"display\": \"block\",\r\n }),\r\n new StyleRule(element, \".\" + newPrefix + \"-item:hover > .\" + newPrefix + \"-menu > .\" + newPrefix + \"-item, .\" + newPrefix + \"-item.active > .\" + newPrefix + \"-menu > .\" + newPrefix + \"-item\", {\r\n \"opacity\": \"1\",\r\n }),\r\n new StyleRule(element, \".\" + newPrefix + \"-menu\", {\r\n \"display\": \"block\",\r\n \"list-style\": \"none\",\r\n \"margin\": \"0\",\r\n \"padding\": \"0\",\r\n }),\r\n new StyleRule(element, \".\" + newPrefix + \"-label\", {\r\n \"display\": \"block\",\r\n \"cursor\": \"default\",\r\n \"padding\": \"0.5em 1em\",\r\n }),\r\n new StyleRule(element, \".\" + newPrefix + \"-icon\", {\r\n \"display\": \"block\",\r\n \"cursor\": \"default\",\r\n \"padding\": \"0.2em 0.4em\",\r\n \"width\": \"1.2em\",\r\n \"height\": \"1.2em\",\r\n \"min-width\": \"32px\",\r\n \"min-height\": \"32px\",\r\n \"margin\": \"auto auto\",\r\n \"border-radius\": \"3px\",\r\n }),\r\n new StyleRule(element, \".\" + newPrefix + \"-item-level-0 > .\" + newPrefix + \"-icon\", {\r\n \"padding\": \"0.1em 0.2em\",\r\n }),\r\n new StyleRule(element, \".\" + newPrefix + \"-clickable\", {\r\n \"cursor\": \"pointer\",\r\n }),\r\n ]);\r\n return new CounterDisposer(function () {\r\n rules.removeKey(newPrefix);\r\n disposer.dispose();\r\n });\r\n });\r\n return counter.increment();\r\n}\r\n","/**\r\n * ExportMenu provides functionality for building Export menu\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport exportCSS from \"./ExportCSS\";\r\nimport { Adapter } from \"../utils/Adapter\";\r\nimport { List } from \"../utils/List\";\r\nimport { getInteraction } from \"../interaction/Interaction\";\r\nimport { MutableValueDisposer } from \"../utils/Disposer\";\r\nimport { Language } from \"../utils/Language\";\r\nimport { Validatable } from \"../utils/Validatable\";\r\nimport { keyboard } from \"../utils/Keyboard\";\r\nimport * as $utils from \"../utils/Utils\";\r\nimport * as $iter from \"../utils/Iterator\";\r\nimport * as $dom from \"../utils/DOM\";\r\nimport * as $type from \"../utils/Type\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Creates a menu for Export operations.\r\n *\r\n * To add an export menu to a chart, set this to a new instance of\r\n * [[ExportMenu]].\r\n *\r\n * ```TypeScript\r\n * chart.exporting.menu = new am4core.ExportMenu();\r\n * ```\r\n * ```JavaScript\r\n * chart.exporting.menu = new am4core.ExportMenu();\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"exporting\": {\r\n * \"menu\": {}\r\n * }\r\n * }\r\n * ```\r\n * @important\r\n */\r\nvar ExportMenu = /** @class */ (function (_super) {\r\n __extends(ExportMenu, _super);\r\n /**\r\n * Constructor\r\n */\r\n function ExportMenu() {\r\n var _this = _super.call(this) || this;\r\n /**\r\n * An [[Adapter]].\r\n */\r\n _this.adapter = new Adapter(_this);\r\n /**\r\n * How many milliseconds to hold menu/sub-menu open after it loses focus or\r\n * hover, before auto-closing it.\r\n *\r\n * @default 1000\r\n */\r\n _this.closeDelay = 1000;\r\n /**\r\n * Close the menu automatically when some export operation is triggered.\r\n *\r\n * @default true\r\n * @since 4.2.2\r\n */\r\n _this.closeOnClick = true;\r\n /**\r\n * An instance of [[Language]].\r\n */\r\n _this._language = new MutableValueDisposer();\r\n /**\r\n * What HTML tags to use to build menu.\r\n */\r\n _this._menuTag = \"ul\";\r\n /**\r\n * Which tag to use to enclose individual menu items.\r\n */\r\n _this._itemTag = \"li\";\r\n /**\r\n * Tag to wrap menu item labels in.\r\n */\r\n _this._labelTag = \"a\";\r\n /**\r\n * Tag to use for icons\r\n */\r\n _this._iconTag = \"img\";\r\n /**\r\n * Prefix for class names applied to menu elements.\r\n */\r\n _this._classPrefix = \"amexport\";\r\n /**\r\n * If set to `true` [[ExportMenu]] will load it's own external CSS when\r\n * instantiated.\r\n */\r\n _this._defaultStyles = true;\r\n /**\r\n * Horizontal positioning.\r\n */\r\n _this._align = \"right\";\r\n /**\r\n * Vertical positioning.\r\n */\r\n _this._verticalAlign = \"top\";\r\n /**\r\n * A tabindex to apply to Export Menu.\r\n */\r\n _this._tabindex = 0;\r\n /**\r\n * Whether next menu close event should be ignored.\r\n */\r\n _this._ignoreNextClose = false;\r\n /**\r\n * Default menu items.\r\n */\r\n _this._items = [\r\n {\r\n \"label\": \"...\",\r\n \"menu\": [\r\n {\r\n \"label\": \"Image\",\r\n \"menu\": [\r\n { \"type\": \"png\", \"label\": \"PNG\" },\r\n { \"type\": \"jpg\", \"label\": \"JPG\" },\r\n { \"type\": \"svg\", \"label\": \"SVG\" },\r\n { \"type\": \"pdf\", \"label\": \"PDF\" }\r\n ]\r\n }, {\r\n \"label\": \"Data\",\r\n \"menu\": [\r\n { \"type\": \"json\", \"label\": \"JSON\" },\r\n { \"type\": \"csv\", \"label\": \"CSV\" },\r\n { \"type\": \"xlsx\", \"label\": \"XLSX\" },\r\n { \"type\": \"html\", \"label\": \"HTML\" },\r\n { \"type\": \"pdfdata\", \"label\": \"PDF\" }\r\n ]\r\n }, {\r\n \"label\": \"Print\", \"type\": \"print\"\r\n }\r\n ]\r\n }\r\n ];\r\n _this.className = \"ExportMenu\";\r\n _this._disposers.push(_this._language);\r\n _this.invalidate();\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * (Re)draws the Export menu.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n ExportMenu.prototype.validate = function () {\r\n this.draw();\r\n _super.prototype.validate.call(this);\r\n };\r\n /**\r\n * Draws the menu based on current items.\r\n *\r\n * Normally, there's no need to call this explicitly. The chart, if it has\r\n * export menu enabled, will automatically draw the menu.\r\n */\r\n ExportMenu.prototype.draw = function () {\r\n var _this = this;\r\n // Create top-level menu item, or clear it\r\n if (!this._element) {\r\n this._element = this.createMenuElement(0);\r\n }\r\n else {\r\n this._element.innerHTML = \"\";\r\n this._element.className = this.getMenuItemClass(0);\r\n }\r\n // See if we're loading external CSS\r\n // Hide it until CSS is loaded\r\n if (this.defaultStyles) {\r\n this._element.style.display = \"none\";\r\n }\r\n // Append to container\r\n $type.getValue(this._container).appendChild(this._element);\r\n // Apply adapter to menu items before processing\r\n var items = this.adapter.apply(\"items\", {\r\n items: this._items\r\n }).items;\r\n for (var len = items.length, i = 0; i < len; i++) {\r\n this.drawBranch(this._element, items[i], 0);\r\n }\r\n // Apply adapter to finalized menu element\r\n this._element = this.adapter.apply(\"menuElement\", {\r\n menuElement: this._element\r\n }).menuElement;\r\n // Set up global \"down\" event\r\n this._disposers.push(getInteraction().body.events.on(\"down\", function (ev) {\r\n if (!ev.pointer.touch) {\r\n _this._ignoreNextClose = false;\r\n }\r\n _this.close();\r\n }));\r\n // Set up global event on ESC press to close the menu\r\n this._disposers.push(getInteraction().body.events.on(\"keydown\", function (ev) {\r\n var key = keyboard.getEventKey(ev.event);\r\n switch (key) {\r\n case \"esc\":\r\n _this.close();\r\n break;\r\n case \"up\":\r\n case \"down\":\r\n case \"left\":\r\n case \"right\":\r\n if (_this._currentSelection) {\r\n ev.event.preventDefault();\r\n }\r\n _this.moveSelection(key);\r\n break;\r\n }\r\n }));\r\n if (this.defaultStyles) {\r\n this.loadDefaultCSS();\r\n }\r\n };\r\n /**\r\n * Creates a new branch in export menu. This function is recursive for\r\n * building multi-level menus.\r\n *\r\n * @ignore Exclude from docs\r\n * @param container Container to put branch elements in\r\n * @param branch Menu item\r\n * @param level Current nesting level\r\n */\r\n ExportMenu.prototype.drawBranch = function (container, branch, level) {\r\n var _this = this;\r\n // Apply adapter\r\n branch = this.adapter.apply(\"branch\", {\r\n branch: branch,\r\n level: level\r\n }).branch;\r\n // Unsupported?\r\n // ExportMenu does not check or know for specific browser/system\r\n // capabilities. It must happen in some other code and applied via Adapter.\r\n // Export itself will check compatibility, but there might be other plugins\r\n // that influence it or even add any specific export functionality.\r\n if (branch.unsupported === true) {\r\n return;\r\n }\r\n // Init ascendants\r\n if (!branch.ascendants) {\r\n branch.ascendants = new List();\r\n }\r\n // Get type\r\n var type = branch.type;\r\n // Create an item\r\n var element = this.createItemElement(level, type);\r\n // Create label\r\n var label;\r\n // Create icon\r\n if (branch.icon) {\r\n label = this.createIconElement(level, type);\r\n label.src = branch.icon;\r\n if (branch.label || branch.title) {\r\n label.title = branch.title || branch.label;\r\n }\r\n }\r\n else if (branch.svg) {\r\n label = this.createSvgElement(level, type, branch.svg);\r\n if (branch.label || branch.title) {\r\n label.title = branch.title || branch.label;\r\n }\r\n }\r\n else {\r\n label = this.createLabelElement(level, type);\r\n label.innerHTML = (branch.label ? this.language.translate(branch.label) : \"\");\r\n if (branch.title) {\r\n label.title = branch.title;\r\n }\r\n }\r\n // Apply reader text to label\r\n var readerLabel = this.getReaderLabel(branch, label.innerHTML);\r\n label.setAttribute(\"aria-label\", readerLabel);\r\n // Add Label\r\n element.appendChild(label);\r\n // Create interaction object\r\n // TODO clean this up when it's disposed\r\n branch.interactions = getInteraction().getInteraction(element);\r\n branch.element = element;\r\n // Create interaction manager we can set event listeners to\r\n if (this.typeClickable(type)) {\r\n //branch.interactions.clickable = true;\r\n // TODO clean this up when it's disposed\r\n branch.interactions.events.on(\"hit\", function (ev) {\r\n if (_this.events.isEnabled(\"hit\") && !_this.isDisposed()) {\r\n var event_1 = {\r\n \"type\": \"hit\",\r\n \"event\": ev.event,\r\n \"target\": _this,\r\n \"branch\": branch\r\n };\r\n _this.events.dispatchImmediately(\"hit\", event_1);\r\n }\r\n });\r\n // TODO clean this up when it's disposed\r\n branch.interactions.events.on(\"keyup\", function (ev) {\r\n if (keyboard.isKey(ev.event, \"enter\")) {\r\n if (_this.events.isEnabled(\"enter\")) {\r\n var event_2 = {\r\n \"type\": \"enter\",\r\n \"event\": ev.event,\r\n \"target\": _this,\r\n \"branch\": branch\r\n };\r\n _this.events.dispatchImmediately(\"enter\", event_2);\r\n }\r\n }\r\n });\r\n }\r\n {\r\n var submenu_1 = this.getSubMenu(branch);\r\n // Add ENTER event to open sub-menus\r\n if (submenu_1 != null) {\r\n // TODO clean this up when it's disposed\r\n branch.interactions.events.on(\"keyup\", function (ev) {\r\n if (keyboard.isKey(ev.event, \"enter\")) {\r\n // This is item has sub-menu, activate the first child on ENTER\r\n _this.selectBranch(submenu_1[0]);\r\n // Attempt to set focus\r\n _this.setFocus(submenu_1[0]);\r\n }\r\n });\r\n branch.interactions.events.on(\"hit\", function (ev) {\r\n _this.selectBranch(branch);\r\n });\r\n }\r\n }\r\n // Add events\r\n // TODO clean this up when it's disposed\r\n branch.interactions.events.on(\"over\", function (ev) {\r\n if (ev.pointer.touch) {\r\n // Cancel pending menu closure\r\n _this._ignoreNextClose = true;\r\n }\r\n _this.selectBranch(branch);\r\n if (_this.events.isEnabled(\"over\")) {\r\n var event_3 = {\r\n \"type\": \"over\",\r\n \"event\": ev.event,\r\n \"target\": _this,\r\n \"branch\": branch\r\n };\r\n _this.events.dispatchImmediately(\"over\", event_3);\r\n }\r\n });\r\n // TODO clean this up when it's disposed\r\n branch.interactions.events.on(\"out\", function (ev) {\r\n if (_this.isDisposed()) {\r\n return;\r\n }\r\n if (!ev.pointer.touch) {\r\n _this.delayUnselectBranch(branch);\r\n }\r\n if (_this.events.isEnabled(\"out\")) {\r\n var event_4 = {\r\n \"type\": \"out\",\r\n \"event\": ev.event,\r\n \"target\": _this,\r\n \"branch\": branch\r\n };\r\n _this.events.dispatchImmediately(\"out\", event_4);\r\n }\r\n });\r\n // TODO clean this up when it's disposed\r\n branch.interactions.events.on(\"focus\", function (ev) {\r\n _this.selectBranch(branch);\r\n });\r\n // TODO clean this up when it's disposed\r\n branch.interactions.events.on(\"blur\", function (ev) {\r\n _this.delayUnselectBranch(branch);\r\n });\r\n // Increment level\r\n var local_level = level + 1;\r\n // Has sub-menu?\r\n if (branch.menu) {\r\n var submenu = this.createMenuElement(local_level);\r\n branch.submenuElement = submenu;\r\n for (var len = branch.menu.length, i = 0; i < len; i++) {\r\n var ascendants = new List();\r\n branch.menu[i].ascendants = ascendants;\r\n if (branch.ascendants.length) {\r\n ascendants.copyFrom(branch.ascendants);\r\n }\r\n ascendants.push(branch);\r\n this.drawBranch(submenu, branch.menu[i], local_level);\r\n }\r\n // Sub-menu is empty (all items are not supported)\r\n // Do not draw this menu item at all\r\n if (submenu.innerHTML == \"\") {\r\n return;\r\n }\r\n element.appendChild(submenu);\r\n }\r\n // Should this item be hidden?\r\n if (branch.hidden) {\r\n this.hideBranch(branch);\r\n }\r\n // Add id?\r\n if (branch.id) {\r\n element.setAttribute(\"id\", branch.id);\r\n }\r\n // Background color?\r\n if (branch.color) {\r\n element.style.backgroundColor = branch.color.hex;\r\n }\r\n // Append to container\r\n container.appendChild(element);\r\n };\r\n /**\r\n * Creates a menu element to hold its elements in. Usually it's an `<ul>`\r\n * tag.\r\n *\r\n * @ignore Exclude from docs\r\n * @param level Current nesting level\r\n * @return HTML element reference\r\n */\r\n ExportMenu.prototype.createMenuElement = function (level) {\r\n var element = document.createElement(this.menuTag);\r\n element.className = this.getMenuItemClass(level);\r\n // Accessibility\r\n if (level === 0) {\r\n element.setAttribute(\"role\", \"menubar\");\r\n }\r\n else {\r\n element.setAttribute(\"role\", \"menu\");\r\n }\r\n return element;\r\n };\r\n /**\r\n * Generates a class name for the menu element based on its nesting level.\r\n *\r\n * @ignore Exclude from docs\r\n * @param level Current nesting level\r\n * @return Class name(s)\r\n */\r\n ExportMenu.prototype.getMenuItemClass = function (level) {\r\n var className = this.classPrefix + \"-menu \" + this.classPrefix + \"-menu-level-\" + level;\r\n if (level === 0) {\r\n className += \" \" + this.classPrefix + \"-menu-root \" +\r\n this.classPrefix + \"-\" + this.align + \" \" +\r\n this.classPrefix + \"-\" + this.verticalAlign;\r\n }\r\n return this.adapter.apply(\"menuClass\", {\r\n className: className,\r\n level: level\r\n }).className;\r\n };\r\n /**\r\n * Creates menu item. Usually `<li>` tag. Its label and sub-elements will go\r\n * into this element.\r\n *\r\n * @ignore Exclude from docs\r\n * @param level Current nesting level\r\n * @param type Type of the menu item\r\n * @return HTML element reference\r\n */\r\n ExportMenu.prototype.createItemElement = function (level, type) {\r\n var element = document.createElement(this.itemTag);\r\n var className = this.classPrefix + \"-item \" + this.classPrefix\r\n + \"-item-level-\" + level\r\n + \" \" + this.classPrefix + \"-item-\" + (type || \"blank\");\r\n element.className = this.adapter.apply(\"itemClass\", {\r\n className: className,\r\n level: level,\r\n type: type\r\n }).className;\r\n element.setAttribute(\"role\", \"menuitem\");\r\n element.setAttribute(\"tabindex\", this.tabindex.toString());\r\n return element;\r\n };\r\n /**\r\n * Creates a \"label\" part of the menu item. It could be text or any HTML\r\n * content.\r\n *\r\n * @ignore Exclude from docs\r\n * @param level Current nesting level\r\n * @param type Type of the menu item\r\n * @return An HTML Element\r\n */\r\n ExportMenu.prototype.createLabelElement = function (level, type) {\r\n var element = document.createElement(this.labelTag);\r\n var className = this.classPrefix + \"-label \" + this.classPrefix\r\n + \"-label-level-\" + level\r\n + \" \" + this.classPrefix + \"-item-\" + (type || \"blank\");\r\n if (this.typeClickable(type)) {\r\n className += \" \" + this.classPrefix + \"-clickable\";\r\n }\r\n element.className = this.adapter.apply(\"labelClass\", {\r\n className: className,\r\n level: level,\r\n type: type\r\n }).className;\r\n // Accessible navigation\r\n //element.setAttribute(\"tabindex\", this.tabindex.toString());\r\n //element.setAttribute(\"role\", \"menuitem\");\r\n return element;\r\n };\r\n /**\r\n * Creates a \"icon\" part of the menu item.\r\n *\r\n * @ignore Exclude from docs\r\n * @param level Current nesting level\r\n * @param type Type of the menu item\r\n * @return An HTML Element\r\n */\r\n ExportMenu.prototype.createIconElement = function (level, type) {\r\n var element = document.createElement(this.iconTag);\r\n var className = this.classPrefix + \"-icon \" + this.classPrefix\r\n + \"-icon-level-\" + level\r\n + \" \" + this.classPrefix + \"-item-\" + (type || \"blank\");\r\n if (this.typeClickable(type)) {\r\n className += \" \" + this.classPrefix + \"-clickable\";\r\n }\r\n element.className = this.adapter.apply(\"labelClass\", {\r\n className: className,\r\n level: level,\r\n type: type\r\n }).className;\r\n // Accessible navigation\r\n element.setAttribute(\"tabindex\", this.tabindex.toString());\r\n element.setAttribute(\"role\", \"menuitem\");\r\n return element;\r\n };\r\n /**\r\n * Creates a a custom element out of raw HTML.\r\n *\r\n * @ignore Exclude from docs\r\n * @param level Current nesting level\r\n * @param type Type of the menu item\r\n * @return An HTML Element\r\n */\r\n ExportMenu.prototype.createSvgElement = function (level, type, svg) {\r\n var parser = new DOMParser();\r\n var element = parser.parseFromString(svg, \"image/svg+xml\").documentElement;\r\n var className = this.classPrefix + \"-icon \" + this.classPrefix\r\n + \"-icon-level-\" + level\r\n + \" \" + this.classPrefix + \"-item-\" + (type || \"blank\");\r\n if (this.typeClickable(type)) {\r\n className += \" \" + this.classPrefix + \"-clickable\";\r\n }\r\n element.setAttribute(\"class\", this.adapter.apply(\"labelClass\", {\r\n className: className,\r\n level: level,\r\n type: type\r\n }).className);\r\n // Accessible navigation\r\n element.setAttribute(\"tabindex\", this.tabindex.toString());\r\n element.setAttribute(\"role\", \"menuitem\");\r\n return element;\r\n };\r\n /**\r\n * Destroys the menu and all its elements.\r\n */\r\n ExportMenu.prototype.dispose = function () {\r\n if (!this._disposed) {\r\n _super.prototype.dispose.call(this);\r\n if (this._element && this._element.parentNode) {\r\n this._element.parentNode.removeChild(this._element);\r\n }\r\n }\r\n };\r\n /**\r\n * Checks whether menu item type is supposed to be clickable.\r\n *\r\n * @ignore Exclude from docs\r\n * @param type Menu item type\r\n * @return Is clickable?\r\n */\r\n ExportMenu.prototype.typeClickable = function (type) {\r\n return $type.hasValue(type);\r\n };\r\n /**\r\n * Checks whether menu item has any sub-items.\r\n *\r\n * @ignore Exclude from docs\r\n * @param branch A menu item\r\n * @return Has sub-items?\r\n */\r\n ExportMenu.prototype.hasSubMenu = function (branch) {\r\n return (branch.menu && branch.menu.length) ? true : false;\r\n };\r\n /**\r\n * Returns sub-items (if they exist).\r\n *\r\n * @ignore Exclude from docs\r\n * @param branch A menu item\r\n * @return Submenus\r\n */\r\n ExportMenu.prototype.getSubMenu = function (branch) {\r\n if (branch.menu && branch.menu.length) {\r\n return branch.menu;\r\n }\r\n };\r\n /**\r\n * Generates and returns an applicable label to be used for screen readers.\r\n *\r\n * @ignore Exclude from docs\r\n * @param item A menu item instance\r\n * @param label Current label\r\n * @return Reader text\r\n */\r\n ExportMenu.prototype.getReaderLabel = function (branch, label) {\r\n // Strip any HTML from the label\r\n label = $utils.stripTags(label);\r\n // Add textual note if the branch is clickable\r\n if (branch.ascendants.length == 0) {\r\n label = label == \"...\" ? this.language.translate(\"Export\") : label;\r\n label += \" [\" + this.language.translate(\"Press ENTER or use arrow keys to navigate\") + \"]\";\r\n }\r\n else if (this.hasSubMenu(branch)) {\r\n label += \" [\" + this.language.translate(\"Click, tap or press ENTER to open\") + \"]\";\r\n }\r\n else if (branch.type == \"print\") {\r\n label = this.language.translate(\"Click, tap or press ENTER to print.\");\r\n }\r\n else if (this.typeClickable(branch.type)) {\r\n label = this.language.translate(\"Click, tap or press ENTER to export as %1.\", undefined, label);\r\n }\r\n return this.adapter.apply(\"rederLabel\", {\r\n label: label,\r\n branch: branch\r\n }).label;\r\n };\r\n Object.defineProperty(ExportMenu.prototype, \"container\", {\r\n /**\r\n * @return Container\r\n */\r\n get: function () {\r\n return this._container;\r\n },\r\n /**\r\n * Getters and setters\r\n */\r\n /**\r\n * An HTML container to place the Menu in.\r\n *\r\n * A container must be an HTML element, because menu itself is HTML, and\r\n * cannot be placed into SVG.\r\n *\r\n * @param container Reference to container element\r\n * @todo Check if menu is already build. If it is, just move it to a new container\r\n */\r\n set: function (container) {\r\n this._container = container;\r\n this.invalidate();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ExportMenu.prototype, \"items\", {\r\n /**\r\n * @return Menu items\r\n */\r\n get: function () {\r\n return this._items;\r\n },\r\n /**\r\n * A list of menu items. Can be nested.\r\n *\r\n * @param items Menu items\r\n */\r\n set: function (items) {\r\n this._items = items;\r\n this.invalidate();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ExportMenu.prototype, \"tag\", {\r\n /**\r\n * Sets main menu tag to place menu in.\r\n *\r\n * This also sets up how menu items are built.\r\n *\r\n * If you set this to \"ul\", menu items will be wrapped into `<li>` tags.\r\n *\r\n * If set to \"div\", menu items will be wrapped in `<div>` tags.\r\n *\r\n * @default \"ul\"\r\n * @param tag Tag to use for menu\r\n */\r\n set: function (tag) {\r\n this._menuTag = tag;\r\n this._itemTag = tag == \"ul\" ? \"li\" : \"div\";\r\n this.invalidate();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ExportMenu.prototype, \"menuTag\", {\r\n /**\r\n * Returns current menu tag.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Menu tag (item that contains sub-items)\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"menuTag\", {\r\n tag: this._menuTag\r\n }).tag;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ExportMenu.prototype, \"itemTag\", {\r\n /**\r\n * Returns tag to wrap items into.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Item tag\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"itemTag\", {\r\n tag: this._itemTag\r\n }).tag;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ExportMenu.prototype, \"labelTag\", {\r\n /**\r\n * Returns menu label tag.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Label tag\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"labelTag\", {\r\n tag: this._labelTag\r\n }).tag;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ExportMenu.prototype, \"iconTag\", {\r\n /**\r\n * Returns icon tag.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Icon tag\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"iconTag\", {\r\n tag: this._iconTag\r\n }).tag;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ExportMenu.prototype, \"align\", {\r\n /**\r\n * @return Horizontal alignment\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"align\", {\r\n align: this._align\r\n }).align;\r\n },\r\n /**\r\n * A horizontal alignment for the menu placement.\r\n *\r\n * @param value Horizontal alignment\r\n */\r\n set: function (value) {\r\n this._align = value;\r\n this.invalidate();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ExportMenu.prototype, \"verticalAlign\", {\r\n /**\r\n * @return Vertical alignment\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"verticalAlign\", {\r\n verticalAlign: this._verticalAlign\r\n }).verticalAlign;\r\n },\r\n /**\r\n * A vertical alignment for the menu placement.\r\n *\r\n * @param value Vertical alignment\r\n */\r\n set: function (value) {\r\n this._verticalAlign = value;\r\n this.invalidate();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ExportMenu.prototype, \"classPrefix\", {\r\n /**\r\n * @return Class name prefix\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"classPrefix\", {\r\n classPrefix: this._classPrefix\r\n }).classPrefix;\r\n },\r\n /**\r\n * Class name prefix.\r\n *\r\n * @default \"amexport\"\r\n * @param value Class name prefix\r\n */\r\n set: function (value) {\r\n this._classPrefix = value;\r\n this.invalidate();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ExportMenu.prototype, \"defaultStyles\", {\r\n /**\r\n * @return Should ExportMenu load its own CSS?\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"defaultStyles\", {\r\n defaultStyles: this._defaultStyles\r\n }).defaultStyles;\r\n },\r\n /**\r\n * Indicates whether [[ExportMenu]] should load external CSS to style itself.\r\n *\r\n * If set to `false`, the menu will not be styled, and will rely on some\r\n * external CSS.\r\n *\r\n * @default true\r\n * @param Should ExportMenu load its own CSS?\r\n */\r\n set: function (value) {\r\n if (this._defaultStyles != value) {\r\n this._defaultStyles = value;\r\n if (value) {\r\n this.loadDefaultCSS();\r\n }\r\n }\r\n this.invalidate();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Loads the default CSS.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n ExportMenu.prototype.loadDefaultCSS = function () {\r\n this._disposers.push(exportCSS($dom.getShadowRoot(this.container), this.classPrefix));\r\n if (this._element) {\r\n this._element.style.display = \"\";\r\n }\r\n };\r\n Object.defineProperty(ExportMenu.prototype, \"tabindex\", {\r\n /**\r\n * @return Tab index\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"tabindex\", {\r\n tabindex: this._tabindex\r\n }).tabindex;\r\n },\r\n /**\r\n * A tab index for the menu.\r\n *\r\n * Tab index will influence the order in which elements on the chart and\r\n * the whole page are selected when pressing TAB key.\r\n *\r\n * @param value Tab index\r\n */\r\n set: function (value) {\r\n this._tabindex = value;\r\n this.invalidate();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ExportMenu.prototype, \"language\", {\r\n /**\r\n * @return A [[Language]] instance to be used\r\n */\r\n get: function () {\r\n var _this = this;\r\n var language = this._language.get();\r\n if (language == null) {\r\n language = new Language();\r\n // TODO code duplication with `set language()`\r\n this._language.set(language, language.events.on(\"localechanged\", function (ev) {\r\n _this.invalidate();\r\n }));\r\n }\r\n return language;\r\n },\r\n /**\r\n * A [[Language]] instance.\r\n *\r\n * @param value An instance of [[Language]]\r\n */\r\n set: function (value) {\r\n var _this = this;\r\n this._language.set(value, value.events.on(\"localechanged\", function (ev) {\r\n _this.invalidate();\r\n }));\r\n this.invalidate();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Controlling the menu\r\n */\r\n /**\r\n * Removes all active classes from menu items. Useful on touch devices and\r\n * keyboard navigation where open menu can be closed instantly by clicking or\r\n * tapping outside it.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n ExportMenu.prototype.close = function () {\r\n var _this = this;\r\n if (this.isDisposed()) {\r\n return;\r\n }\r\n if (this._ignoreNextClose) {\r\n this._ignoreNextClose = false;\r\n return;\r\n }\r\n if (this.closeOnClick) {\r\n this._element.style.pointerEvents = \"none\";\r\n setTimeout(function () {\r\n _this._element.style.pointerEvents = \"auto\";\r\n }, 100);\r\n }\r\n if (this._currentSelection) {\r\n this.setBlur(this._currentSelection);\r\n this._currentSelection = undefined;\r\n }\r\n if (this._element) {\r\n var items = this._element.getElementsByClassName(\"active\");\r\n for (var len = items.length, i = len - 1; i >= 0; i--) {\r\n if (items[i]) {\r\n $dom.removeClass(items[i], \"active\");\r\n }\r\n }\r\n }\r\n this.events.dispatchImmediately(\"closed\", {\r\n type: \"closed\",\r\n target: this\r\n });\r\n };\r\n /**\r\n * Selects a branch in the menu.\r\n *\r\n * Handles closing of currently open branch.\r\n *\r\n * @ignore Exclude from docs\r\n * @param branch Branch to select\r\n */\r\n ExportMenu.prototype.selectBranch = function (branch) {\r\n var _this = this;\r\n if (this.isDisposed()) {\r\n return;\r\n }\r\n // Cancel previous closure\r\n if (branch.closeTimeout) {\r\n this.removeDispose(branch.closeTimeout);\r\n branch.closeTimeout = undefined;\r\n }\r\n // Add active class\r\n $dom.addClass(branch.element, \"active\");\r\n // Set expanded\r\n if (branch.submenuElement) {\r\n branch.submenuElement.setAttribute(\"aria-expanded\", \"true\");\r\n }\r\n // Remove current selection\r\n if (this._currentSelection && this._currentSelection !== branch && this._currentSelection.ascendants) {\r\n $iter.each($iter.concat($iter.fromArray([this._currentSelection]), this._currentSelection.ascendants.iterator()), function (ascendant) {\r\n if (!branch.ascendants.contains(ascendant) && branch !== ascendant) {\r\n _this.unselectBranch(ascendant, true);\r\n }\r\n });\r\n }\r\n // Select and/or cancel timeout for current ascendants\r\n $iter.each(branch.ascendants.iterator(), function (ascendant) {\r\n if (ascendant.closeTimeout) {\r\n _this.removeDispose(ascendant.closeTimeout);\r\n ascendant.closeTimeout = undefined;\r\n }\r\n $dom.addClass(ascendant.element, \"active\");\r\n });\r\n // Log current selection\r\n this._currentSelection = branch;\r\n // Invoke event\r\n if (this.events.isEnabled(\"branchselected\")) {\r\n var event_5 = {\r\n type: \"branchselected\",\r\n target: this,\r\n branch: branch\r\n };\r\n this.events.dispatchImmediately(\"branchselected\", event_5);\r\n }\r\n };\r\n /**\r\n * Unselects a branch. Also selects a branch one level up if necessary.\r\n *\r\n * @ignore Exclude from docs\r\n * @param branch Branch to unselect\r\n * @param simple If `true`, only the branch will be unselected without selecting parent branch\r\n */\r\n ExportMenu.prototype.unselectBranch = function (branch, simple) {\r\n if (this.isDisposed()) {\r\n return;\r\n }\r\n // Remove active class\r\n $dom.removeClass(branch.element, \"active\");\r\n // Set expanded\r\n if (branch.submenuElement) {\r\n branch.submenuElement.removeAttribute(\"aria-expanded\");\r\n }\r\n // Remove current selection\r\n if (this._currentSelection == branch) {\r\n this._currentSelection = undefined;\r\n }\r\n // Invoke event\r\n if (this.events.isEnabled(\"branchunselected\")) {\r\n var event_6 = {\r\n type: \"branchunselected\",\r\n target: this,\r\n branch: branch\r\n };\r\n this.events.dispatchImmediately(\"branchunselected\", event_6);\r\n }\r\n };\r\n /**\r\n * Delay unselection of a branch. This can still be cancelled in some other\r\n * place if the branch or its children regain focus.\r\n *\r\n * @ignore Exclude from docs\r\n * @param branch Branch to unselect\r\n * @param simple If `true`, only the branch will be unselected without selecting parent branch\r\n */\r\n ExportMenu.prototype.delayUnselectBranch = function (branch, simple) {\r\n var _this = this;\r\n if (this.isDisposed()) {\r\n return;\r\n }\r\n // Schedule branch unselection\r\n if (branch.closeTimeout) {\r\n this.removeDispose(branch.closeTimeout);\r\n branch.closeTimeout = undefined;\r\n }\r\n branch.closeTimeout = this.setTimeout(function () {\r\n _this.unselectBranch(branch, simple);\r\n }, this.closeDelay);\r\n // Schedule unselection of all ascendants\r\n // In case focus went away from the export menu altogether, this will ensure\r\n // that all items will be closed.\r\n // In case we're jumping to other menu item, those delayed unselections will\r\n // be cancelled by `selectBranch`\r\n if (simple !== true && branch.ascendants) {\r\n $iter.each(branch.ascendants.iterator(), function (ascendant) {\r\n _this.delayUnselectBranch(ascendant, true);\r\n });\r\n }\r\n };\r\n /**\r\n * Navigates the menu based on which direction kayboard key was pressed.\r\n *\r\n * @ignore Exclude from docs\r\n * @param key A key that was pressed\r\n */\r\n ExportMenu.prototype.moveSelection = function (key) {\r\n if (this.isDisposed()) {\r\n return;\r\n }\r\n // Check if there's a current selection\r\n if (!this._currentSelection) {\r\n return;\r\n }\r\n var newSelection;\r\n if (key == \"up\") {\r\n // Try moving up in current menu list, or to the last item if already\r\n // at the top\r\n newSelection = this.getPrevSibling(this._currentSelection);\r\n }\r\n else if (key == \"down\") {\r\n // Try moving down in current menu list, or to the top item if already\r\n // at the bottom\r\n newSelection = this.getNextSibling(this._currentSelection);\r\n }\r\n else if ((key == \"left\" && this.align == \"right\") || (key == \"right\" && this.align == \"left\")) {\r\n var menu = this.getSubMenu(this._currentSelection);\r\n // Go one level-deeper\r\n if (menu != null) {\r\n newSelection = menu[0];\r\n }\r\n }\r\n else if ((key == \"right\" && this.align == \"right\") || (key == \"left\" && this.align == \"left\")) {\r\n // Go one level-deeper\r\n newSelection = this.getParentItem(this._currentSelection);\r\n }\r\n if (newSelection && newSelection !== this._currentSelection) {\r\n this.selectBranch(newSelection);\r\n this.setFocus(newSelection);\r\n this._currentSelection = newSelection;\r\n }\r\n };\r\n /**\r\n * Returns all siblings of a menu item, including this same menu item.\r\n *\r\n * @ignore Exclude from docs\r\n * @param branch Menu item\r\n * @return List of sibling menu items\r\n */\r\n ExportMenu.prototype.getSiblings = function (branch) {\r\n var parent = this.getParentItem(branch);\r\n if (parent && parent.menu) {\r\n return parent.menu;\r\n }\r\n else {\r\n return [];\r\n }\r\n };\r\n /**\r\n * Returns menu items parent item.\r\n *\r\n * @ignore Exclude from docs\r\n * @param branch Menu item\r\n * @return Parent menu item\r\n */\r\n ExportMenu.prototype.getParentItem = function (branch) {\r\n if (branch.ascendants && branch.ascendants.length) {\r\n return branch.ascendants.getIndex(branch.ascendants.length - 1);\r\n }\r\n else {\r\n return undefined;\r\n }\r\n };\r\n /**\r\n * Returns next sibling in the same menu branch. If there is no next sibling,\r\n * the first one is returned. If there is just one item, that item is\r\n * returned. Unsupported menu items are skipped.\r\n *\r\n * @ignore Exclude from docs\r\n * @param branch Menu item to search siblings for\r\n * @return Menu item\r\n */\r\n ExportMenu.prototype.getNextSibling = function (branch) {\r\n var siblings = this.getSiblings(branch);\r\n if (siblings.length > 1) {\r\n var next = siblings.indexOf(branch) + 1;\r\n next = siblings.length == next ? 0 : next;\r\n return siblings[next].unsupported ? this.getNextSibling(siblings[next]) : siblings[next];\r\n }\r\n else {\r\n return branch;\r\n }\r\n };\r\n /**\r\n * Returns previous sibling in the same menu branch. If there is no next\r\n * sibling, the first one is returned. If there is just one item, that item is\r\n * returned. Unsupported menu items are skipped.\r\n *\r\n * @ignore Exclude from docs\r\n * @param branch Menu item to search siblings for\r\n * @return Menu item\r\n */\r\n ExportMenu.prototype.getPrevSibling = function (branch) {\r\n var siblings = this.getSiblings(branch);\r\n if (siblings.length > 1) {\r\n var prev = siblings.indexOf(branch) - 1;\r\n prev = prev == -1 ? siblings.length - 1 : prev;\r\n return siblings[prev].unsupported ? this.getPrevSibling(siblings[prev]) : siblings[prev];\r\n }\r\n else {\r\n return branch;\r\n }\r\n };\r\n /**\r\n * Attempts to set focus on particular menu element.\r\n *\r\n * @ignore Exclude from docs\r\n * @param branch Menu item\r\n */\r\n ExportMenu.prototype.setFocus = function (branch) {\r\n if (branch.interactions) {\r\n try {\r\n branch.interactions.element.focus();\r\n }\r\n catch (e) {\r\n // nothing\r\n }\r\n }\r\n };\r\n /**\r\n * Attempts to remove focus from the menu element.\r\n *\r\n * @ignore Exclude from docs\r\n * @param branch Menu item\r\n */\r\n ExportMenu.prototype.setBlur = function (branch) {\r\n if (branch.interactions) {\r\n try {\r\n branch.interactions.element.blur();\r\n }\r\n catch (e) {\r\n // nothing\r\n }\r\n }\r\n };\r\n /**\r\n * Hides the whole branch of menu.\r\n *\r\n * @param branch branch\r\n */\r\n ExportMenu.prototype.hideBranch = function (branch) {\r\n branch.element.style.display = \"none\";\r\n };\r\n /**\r\n * Show the branch of menu.\r\n *\r\n * @param branch branch\r\n */\r\n ExportMenu.prototype.showBranch = function (branch) {\r\n branch.element.style.display = \"\";\r\n };\r\n Object.defineProperty(ExportMenu.prototype, \"element\", {\r\n /**\r\n * The main element o fthe menu - usually `<ul>`.\r\n *\r\n * @since 4.10.6\r\n * @return Menu element\r\n */\r\n get: function () {\r\n return this._element;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return ExportMenu;\r\n}(Validatable));\r\nexport { ExportMenu };\r\n","/**\r\n * Handles date and time formatting\r\n */\r\nimport { __extends } from \"tslib\";\r\nimport { Language } from \"../utils/Language\";\r\nimport { BaseObject } from \"../Base\";\r\nimport { getTextFormatter } from \"../formatters/TextFormatter\";\r\nimport { registry } from \"../Registry\";\r\nimport * as $strings from \"../utils/Strings\";\r\nimport * as $utils from \"../utils/Utils\";\r\nimport * as $type from \"../utils/Type\";\r\nimport * as $time from \"../utils/Time\";\r\n/**\r\n * Handles date and time formatting.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/formatters/formatting-date-time/} Tutorial on date/time formatting\r\n * @todo Better type casting of passed in date?\r\n * @todo Quarter support?\r\n * @todo When parsing named months make the search case-insensitive\r\n * @todo Escape a.m./p.m. properly when used in RegEx\r\n */\r\nvar DateFormatter = /** @class */ (function (_super) {\r\n __extends(DateFormatter, _super);\r\n /**\r\n * Constructor\r\n */\r\n function DateFormatter() {\r\n var _this = _super.call(this) || this;\r\n /**\r\n * Date format.\r\n */\r\n _this._dateFormat = \"yyyy-MM-dd\";\r\n /**\r\n * Input date format.\r\n */\r\n _this._inputDateFormat = \"yyyy-MM-dd\";\r\n /**\r\n * Assume UTC time zone.\r\n */\r\n _this._utc = false;\r\n /**\r\n * If `timezone` is set, this will hold minute fraction of the timezone.\r\n *\r\n * @readonly\r\n * @ignore\r\n */\r\n _this.timezoneMinutes = 0;\r\n /**\r\n * First day of week.\r\n *\r\n * 0 - Sunday\r\n * 1 - Monday\r\n *\r\n * Etc.\r\n */\r\n _this._firstDayOfWeek = 1;\r\n /**\r\n * A list of month names.\r\n */\r\n _this.months = [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"];\r\n /**\r\n * A list of short month names.\r\n */\r\n _this.monthsShort = [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May(short)\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"];\r\n /**\r\n * A list of weekday names.\r\n */\r\n _this.weekdays = [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"];\r\n /**\r\n * A list of short weekday names.\r\n */\r\n _this.weekdaysShort = [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"];\r\n /**\r\n * Output format to produce. If the format calls for applying color to the\r\n * formatted value, this setting will determine what markup to use: SVG or\r\n * HTML.\r\n *\r\n * Available options: svg, html.\r\n *\r\n * @default \"svg\"\r\n */\r\n _this._outputFormat = \"svg\";\r\n /**\r\n * Should the first letter of the formatted date be capitalized?\r\n *\r\n * @default true\r\n */\r\n _this.capitalize = true;\r\n _this.className = \"DateFormatter\";\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n Object.defineProperty(DateFormatter.prototype, \"language\", {\r\n /**\r\n * @return Language\r\n */\r\n get: function () {\r\n return this._language;\r\n },\r\n /**\r\n * A reference to [[Language]] object.\r\n *\r\n * @param value Language\r\n */\r\n set: function (value) {\r\n this._language = value;\r\n this.dateFormat = this._language.translate(\"_date\");\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Formats the date value according to specified format.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/formatters/formatting-date-time/} Tutorial on date/time formatting\r\n * @param source Date value\r\n * @param format Format\r\n * @return Formatted date string\r\n */\r\n DateFormatter.prototype.format = function (source, format) {\r\n // No language?\r\n if (!this.language) {\r\n if (this.sprite) {\r\n this.language = this.sprite.language;\r\n }\r\n else {\r\n this.language = new Language();\r\n }\r\n }\r\n // No format passed in or it's empty\r\n if (typeof format === \"undefined\" || format === \"\") {\r\n format = this._dateFormat;\r\n }\r\n // Init return value\r\n var formatted;\r\n // Do casting if required\r\n // This will take care of timestamps as well as Date objects\r\n var date;\r\n if ($type.isString(source)) {\r\n // If it's a string, let's try parsing it using our own functionality\r\n date = this.parse(source);\r\n }\r\n else {\r\n date = $utils.anyToDate(source);\r\n }\r\n // Is it a built-in format or Intl.DateTimeFormat\r\n if ($type.isObject(format)) {\r\n try {\r\n if (this.intlLocales) {\r\n return new Intl.DateTimeFormat(this.intlLocales, format).format(date);\r\n }\r\n else {\r\n return new Intl.DateTimeFormat(undefined, format).format(date);\r\n }\r\n }\r\n catch (e) {\r\n return \"Invalid\";\r\n }\r\n }\r\n else {\r\n // Clean format\r\n format = $utils.cleanFormat(format);\r\n // get format info (it will also deal with parser caching)\r\n var info = this.parseFormat(format);\r\n // Should we apply custom time zone?\r\n if ($type.hasValue(this.timezoneOffset)) {\r\n date.setMinutes(date.getMinutes() + date.getTimezoneOffset() - this.timezoneOffset);\r\n }\r\n else if ($type.hasValue(this.timezone)) {\r\n date = $time.setTimezone(date, this.timezone);\r\n }\r\n // Check if it's a valid date\r\n if (!$type.isNumber(date.getTime())) {\r\n return this.language.translate(\"Invalid date\");\r\n }\r\n // Apply format\r\n formatted = this.applyFormat(date, info, this.language);\r\n // Capitalize\r\n if (this.capitalize) {\r\n formatted = formatted.replace(/^.{1}/, formatted.substr(0, 1).toUpperCase());\r\n }\r\n }\r\n // We're done\r\n return formatted;\r\n };\r\n /**\r\n * Parses format into structured infromation.\r\n *\r\n * @param format Format template\r\n */\r\n DateFormatter.prototype.parseFormat = function (format) {\r\n // Check cache\r\n var cached = this.getCache(format);\r\n if ($type.hasValue(cached)) {\r\n return cached;\r\n }\r\n // Init format parse info holder\r\n var info = {\r\n \"template\": \"\",\r\n \"parts\": []\r\n };\r\n // Let TextFormatter split into chunks\r\n var chunks = getTextFormatter().chunk(format, true);\r\n for (var i = 0; i < chunks.length; i++) {\r\n var chunk = chunks[i];\r\n if (chunk.type === \"value\") {\r\n // Just \"Date\"?\r\n if (chunk.text.match(/^date$/i) && $type.isString(this._dateFormat)) {\r\n chunk.text = this._dateFormat;\r\n }\r\n // Find all possible parts\r\n var matches = chunk.text.match(/G|yyyy|yyy|yy|y|YYYY|YYY|YY|Y|u|q|MMMMM|MMMM|MMM|MM|M|ww|w|W|dd|d|DDD|DD|D|F|g|EEEEE|EEEE|EEE|EE|E|eeeee|eeee|eee|ee|e|aaa|aa|a|hh|h|HH|H|KK|K|kk|k|mm|m|ss|s|SSS|SS|S|A|zzzz|zzz|zz|z|ZZ|Z|t|x|nnn|nn|n|i|I/g);\r\n // Found?\r\n if (matches) {\r\n // Populate template\r\n for (var x = 0; x < matches.length; x++) {\r\n info.parts.push(matches[x]);\r\n chunk.text = chunk.text.replace(matches[x], $strings.PLACEHOLDER);\r\n }\r\n }\r\n }\r\n // Apply to template\r\n info.template += chunk.text;\r\n }\r\n // Apply style formatting\r\n //info.template = getTextFormatter().format(info.template, this.outputFormat);\r\n // Save cache\r\n this.setCache(format, info);\r\n return info;\r\n };\r\n /**\r\n * Applies format to Date.\r\n *\r\n * @param date Date object\r\n * @param info Parsed format information\r\n * @param language Language\r\n * @return Formatted date string\r\n */\r\n DateFormatter.prototype.applyFormat = function (date, info, language) {\r\n // Init return value\r\n var res = info.template;\r\n // Get values\r\n var fullYear, month, weekday, day, hours, minutes, seconds, milliseconds, offset = date.getTimezoneOffset(), timestamp = date.getTime();\r\n if (this.utc) {\r\n fullYear = date.getUTCFullYear();\r\n month = date.getUTCMonth();\r\n weekday = date.getUTCDay();\r\n day = date.getUTCDate();\r\n hours = date.getUTCHours();\r\n minutes = date.getUTCMinutes();\r\n seconds = date.getUTCSeconds();\r\n milliseconds = date.getUTCMilliseconds();\r\n }\r\n else {\r\n fullYear = date.getFullYear();\r\n month = date.getMonth();\r\n weekday = date.getDay();\r\n day = date.getDate();\r\n hours = date.getHours();\r\n minutes = date.getMinutes();\r\n seconds = date.getSeconds();\r\n milliseconds = date.getMilliseconds();\r\n }\r\n // Go through each part and format/replace it in template\r\n for (var i = 0, len = info.parts.length; i < len; i++) {\r\n var value = \"\";\r\n switch (info.parts[i]) {\r\n case \"G\":\r\n value = language.translate(fullYear < 0\r\n ? \"_era_bc\"\r\n : \"_era_ad\");\r\n break;\r\n case \"yyyy\":\r\n value = Math.abs(fullYear).toString();\r\n if (fullYear < 0) {\r\n value += language.translate(\"_era_bc\");\r\n }\r\n break;\r\n case \"yyy\":\r\n case \"yy\":\r\n case \"y\":\r\n value = Math.abs(fullYear).toString().substr(-info.parts[i].length);\r\n if (fullYear < 0) {\r\n value += language.translate(\"_era_bc\");\r\n }\r\n break;\r\n case \"YYYY\":\r\n case \"YYY\":\r\n case \"YY\":\r\n case \"Y\":\r\n var week = $utils.getWeek(date);\r\n var year = fullYear;\r\n if (week == 1 && (weekday > 4)) {\r\n year--;\r\n }\r\n if (info.parts[i] == \"YYYY\") {\r\n value = Math.abs(year).toString();\r\n }\r\n else {\r\n value = Math.abs(year).toString().substr(-info.parts[i].length);\r\n }\r\n if (year < 0) {\r\n value += language.translate(\"_era_bc\");\r\n }\r\n break;\r\n case \"u\":\r\n // @todo\r\n break;\r\n case \"q\":\r\n value = \"\" + Math.ceil((date.getMonth() + 1) / 3);\r\n break;\r\n case \"MMMMM\":\r\n value = language.translate(this.months[month]).substr(0, 1);\r\n break;\r\n case \"MMMM\":\r\n value = language.translate(this.months[month]);\r\n break;\r\n case \"MMM\":\r\n value = language.translate(this.monthsShort[month]);\r\n break;\r\n case \"MM\":\r\n value = $utils.padString(month + 1, 2, \"0\");\r\n break;\r\n case \"M\":\r\n value = (month + 1).toString();\r\n break;\r\n case \"ww\":\r\n value = $utils.padString($utils.getWeek(date, this.utc), 2, \"0\");\r\n break;\r\n case \"w\":\r\n value = $utils.getWeek(date, this.utc).toString();\r\n break;\r\n case \"W\":\r\n value = $utils.getMonthWeek(date, this.utc).toString();\r\n break;\r\n case \"dd\":\r\n value = $utils.padString(day, 2, \"0\");\r\n break;\r\n case \"d\":\r\n value = day.toString();\r\n break;\r\n case \"DD\":\r\n case \"DDD\":\r\n value = $utils.padString($utils.getYearDay(date, this.utc).toString(), info.parts[i].length, \"0\");\r\n break;\r\n case \"D\":\r\n value = $utils.getYearDay(date, this.utc).toString();\r\n break;\r\n case \"F\":\r\n // @todo\r\n break;\r\n case \"g\":\r\n // @todo\r\n break;\r\n case \"t\":\r\n value = language.translateFunc(\"_dateOrd\").call(this, day);\r\n break;\r\n case \"E\":\r\n value = (weekday || 7).toString();\r\n break;\r\n case \"EE\":\r\n value = $utils.padString((weekday || 7).toString(), 2, \"0\");\r\n break;\r\n case \"EEE\":\r\n case \"eee\":\r\n value = language.translate(this.weekdaysShort[weekday]);\r\n break;\r\n case \"EEEE\":\r\n case \"eeee\":\r\n value = language.translate(this.weekdays[weekday]);\r\n break;\r\n case \"EEEEE\":\r\n case \"eeeee\":\r\n value = language.translate(this.weekdays[weekday]).substr(0, 1);\r\n break;\r\n case \"e\":\r\n case \"ee\":\r\n value = (weekday - this.firstDayOfWeek + 1).toString();\r\n if (info.parts[i] == \"ee\") {\r\n value = $utils.padString(value, 2, \"0\");\r\n }\r\n break;\r\n case \"a\":\r\n if (hours >= 12) {\r\n value = language.translate(\"PM\");\r\n }\r\n else {\r\n value = language.translate(\"AM\");\r\n }\r\n break;\r\n case \"aa\":\r\n if (hours >= 12) {\r\n value = language.translate(\"P.M.\");\r\n }\r\n else {\r\n value = language.translate(\"A.M.\");\r\n }\r\n break;\r\n case \"aaa\":\r\n if (hours >= 12) {\r\n value = language.translate(\"P\");\r\n }\r\n else {\r\n value = language.translate(\"A\");\r\n }\r\n break;\r\n case \"h\":\r\n value = $utils.get12Hours(hours).toString();\r\n break;\r\n case \"hh\":\r\n value = $utils.padString($utils.get12Hours(hours), 2, \"0\");\r\n break;\r\n case \"H\":\r\n value = hours.toString();\r\n break;\r\n case \"HH\":\r\n value = $utils.padString(hours, 2, \"0\");\r\n break;\r\n case \"K\":\r\n value = $utils.get12Hours(hours, 0).toString();\r\n break;\r\n case \"KK\":\r\n value = $utils.padString($utils.get12Hours(hours, 0), 2, \"0\");\r\n break;\r\n case \"k\":\r\n value = (hours + 1).toString();\r\n break;\r\n case \"kk\":\r\n value = $utils.padString(hours + 1, 2, \"0\");\r\n break;\r\n case \"m\":\r\n value = minutes.toString();\r\n break;\r\n case \"mm\":\r\n value = $utils.padString(minutes, 2, \"0\");\r\n break;\r\n case \"s\":\r\n value = seconds.toString();\r\n break;\r\n case \"ss\":\r\n value = $utils.padString(seconds, 2, \"0\");\r\n break;\r\n case \"S\":\r\n case \"SS\":\r\n case \"SSS\":\r\n value = Math.round((milliseconds / 1000) * Math.pow(10, info.parts[i].length)).toString();\r\n break;\r\n case \"x\":\r\n value = timestamp.toString();\r\n break;\r\n case \"n\":\r\n case \"nn\":\r\n case \"nnn\":\r\n value = $utils.padString(milliseconds, info.parts[i].length, \"0\");\r\n break;\r\n case \"z\":\r\n value = $utils.getTimeZone(date, false, false, this.utc);\r\n break;\r\n case \"zz\":\r\n value = $utils.getTimeZone(date, true, false, this.utc);\r\n break;\r\n case \"zzz\":\r\n value = $utils.getTimeZone(date, false, true, this.utc);\r\n break;\r\n case \"zzzz\":\r\n value = $utils.getTimeZone(date, true, true, this.utc);\r\n break;\r\n case \"Z\":\r\n case \"ZZ\":\r\n var tz = Math.abs(offset) / 60;\r\n var tzh = Math.floor(tz);\r\n var tzm = tz * 60 - tzh * 60;\r\n if (this.utc) {\r\n tzh = 0;\r\n tzm = 0;\r\n }\r\n if (info.parts[i] == \"Z\") {\r\n value = \"GMT\";\r\n value += offset > 0 ? \"-\" : \"+\";\r\n value += $utils.padString(tzh, 2) + \":\" + $utils.padString(tzm, 2);\r\n }\r\n else {\r\n value = offset > 0 ? \"-\" : \"+\";\r\n value += $utils.padString(tzh, 2) + $utils.padString(tzm, 2);\r\n }\r\n break;\r\n case \"i\":\r\n value = date.toISOString();\r\n break;\r\n case \"I\":\r\n value = date.toUTCString();\r\n break;\r\n }\r\n res = res.replace($strings.PLACEHOLDER, value);\r\n }\r\n return res;\r\n };\r\n /**\r\n * Parses any input value into Date object.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/formatters/formatting-date-time/#Parsing_Dates} Tutorial on date/time parsing\r\n * @param source Source value\r\n * @param format Source format\r\n * @return Date object\r\n */\r\n DateFormatter.prototype.parse = function (source, format) {\r\n // Format set?\r\n if (!$type.hasValue(format)) {\r\n format = this.inputDateFormat;\r\n }\r\n // Is it already a Date\r\n if (source instanceof Date) {\r\n return source;\r\n }\r\n // Is it a numeric timestamp\r\n if (typeof source === \"number\") {\r\n return new Date(source);\r\n }\r\n // No? Let's check if it's string, and try converting to it if nec\r\n if (typeof source !== \"string\") {\r\n source = source.toString();\r\n }\r\n // no language?\r\n if (!this.language) {\r\n if (this.sprite) {\r\n this.language = this.sprite.language;\r\n }\r\n else {\r\n this.language = new Language;\r\n }\r\n }\r\n // Init return value\r\n var res;\r\n // Init RegEx for parsing\r\n var reg = \"\";\r\n // Clean format\r\n format = $utils.cleanFormat(format);\r\n // Clip format to length of the source string\r\n format = format.substr(0, source.length);\r\n // Parse format\r\n var info = this.parseFormat(format);\r\n // Init parsed items holder\r\n var parsedIndexes = {\r\n \"year\": -1,\r\n \"year3\": -1,\r\n \"year2\": -1,\r\n \"year1\": -1,\r\n \"month\": -1,\r\n \"monthShort\": -1,\r\n \"monthLong\": -1,\r\n \"weekdayShort\": -1,\r\n \"weekdayLong\": -1,\r\n \"day\": -1,\r\n \"yearDay\": -1,\r\n \"week\": -1,\r\n \"hourBase0\": -1,\r\n \"hour12Base0\": -1,\r\n \"hourBase1\": -1,\r\n \"hour12Base1\": -1,\r\n \"minute\": -1,\r\n \"second\": -1,\r\n \"millisecond\": -1,\r\n \"millisecondDigits\": -1,\r\n \"am\": -1,\r\n \"zone\": -1,\r\n \"timestamp\": -1,\r\n \"iso\": -1\r\n };\r\n // Init values\r\n var resValues = {\r\n \"year\": 1970,\r\n \"month\": 0,\r\n \"day\": 1,\r\n \"hour\": 0,\r\n \"minute\": 0,\r\n \"second\": 0,\r\n \"millisecond\": 0,\r\n \"timestamp\": null,\r\n \"offset\": 0,\r\n \"utc\": this.utc\r\n };\r\n // Index adjuster\r\n var indexAdjust = 0, index = 0;\r\n // Iterate through all of the parts\r\n for (var i = 0; i < info.parts.length; i++) {\r\n // Set current match index\r\n index = i + indexAdjust + 1;\r\n switch (info.parts[i]) {\r\n case \"yyyy\":\r\n case \"YYYY\":\r\n reg += \"([0-9]{4})\";\r\n parsedIndexes.year = index;\r\n break;\r\n case \"yyy\":\r\n case \"YYY\":\r\n reg += \"([0-9]{3})\";\r\n parsedIndexes.year3 = index;\r\n break;\r\n case \"yy\":\r\n case \"YY\":\r\n reg += \"([0-9]{2})\";\r\n parsedIndexes.year2 = index;\r\n break;\r\n case \"y\":\r\n case \"Y\":\r\n reg += \"([0-9]{1})\";\r\n parsedIndexes.year1 = index;\r\n break;\r\n case \"MMMM\":\r\n reg += \"(\" + this.getStringList(this.months).join(\"|\") + \")\";\r\n parsedIndexes.monthLong = index;\r\n break;\r\n case \"MMM\":\r\n reg += \"(\" + this.getStringList(this.monthsShort).join(\"|\") + \")\";\r\n parsedIndexes.monthShort = index;\r\n break;\r\n case \"MM\":\r\n case \"M\":\r\n reg += \"([0-9]{2}|[0-9]{1})\";\r\n parsedIndexes.month = index;\r\n break;\r\n case \"ww\":\r\n case \"w\":\r\n reg += \"([0-9]{2}|[0-9]{1})\";\r\n parsedIndexes.week = index;\r\n break;\r\n case \"dd\":\r\n case \"d\":\r\n reg += \"([0-9]{2}|[0-9]{1})\";\r\n parsedIndexes.day = index;\r\n break;\r\n case \"DDD\":\r\n case \"DD\":\r\n case \"D\":\r\n reg += \"([0-9]{3}|[0-9]{2}|[0-9]{1})\";\r\n parsedIndexes.yearDay = index;\r\n break;\r\n case \"dddd\":\r\n reg += \"(\" + this.getStringList(this.weekdays).join(\"|\") + \")\";\r\n parsedIndexes.weekdayLong = index;\r\n break;\r\n case \"ddd\":\r\n reg += \"(\" + this.getStringList(this.weekdaysShort).join(\"|\") + \")\";\r\n parsedIndexes.weekdayShort = index;\r\n break;\r\n case \"aaa\":\r\n case \"aa\":\r\n case \"a\":\r\n // TODO: fix (escape regex)\r\n reg += \"(\" + this.getStringList([\"AM\", \"PM\", \"A\\.M\\.\", \"P\\.M\\.\", \"A\", \"P\"]).join(\"|\") + \")\";\r\n parsedIndexes.am = index;\r\n break;\r\n case \"hh\":\r\n case \"h\":\r\n reg += \"([0-9]{2}|[0-9]{1})\";\r\n parsedIndexes.hour12Base1 = index;\r\n break;\r\n case \"HH\":\r\n case \"H\":\r\n reg += \"([0-9]{2}|[0-9]{1})\";\r\n parsedIndexes.hourBase0 = index;\r\n break;\r\n case \"KK\":\r\n case \"K\":\r\n reg += \"([0-9]{2}|[0-9]{1})\";\r\n parsedIndexes.hour12Base0 = index;\r\n break;\r\n case \"kk\":\r\n case \"k\":\r\n reg += \"([0-9]{2}|[0-9]{1})\";\r\n parsedIndexes.hourBase1 = index;\r\n break;\r\n case \"mm\":\r\n case \"m\":\r\n reg += \"([0-9]{2}|[0-9]{1})\";\r\n parsedIndexes.minute = index;\r\n break;\r\n case \"ss\":\r\n case \"s\":\r\n reg += \"([0-9]{2}|[0-9]{1})\";\r\n parsedIndexes.second = index;\r\n break;\r\n case \"SSS\":\r\n case \"SS\":\r\n case \"S\":\r\n reg += \"([0-9]{3}|[0-9]{2}|[0-9]{1})\";\r\n parsedIndexes.millisecond = index;\r\n parsedIndexes.millisecondDigits = info.parts[i].length;\r\n break;\r\n case \"nnn\":\r\n case \"nn\":\r\n case \"n\":\r\n reg += \"([0-9]{3}|[0-9]{2}|[0-9]{1})\";\r\n parsedIndexes.millisecond = index;\r\n break;\r\n case \"x\":\r\n reg += \"([0-9]{1,})\";\r\n parsedIndexes.timestamp = index;\r\n break;\r\n case \"Z\":\r\n reg += \"GMT([-+]+[0-9]{2}:[0-9]{2})\";\r\n parsedIndexes.zone = index;\r\n break;\r\n case \"ZZ\":\r\n reg += \"([\\\\-+]+[0-9]{2}[0-9]{2})\";\r\n parsedIndexes.zone = index;\r\n break;\r\n case \"i\":\r\n reg += \"([0-9]{4})-?([0-9]{2})-?([0-9]{2})T?([0-9]{2}):?([0-9]{2}):?([0-9]{2})\\.?([0-9]{0,3})([zZ]|[+\\-][0-9]{2}:?[0-9]{2}|$)\";\r\n parsedIndexes.iso = index;\r\n indexAdjust += 7;\r\n break;\r\n case \"G\":\r\n case \"YYYY\":\r\n case \"YYY\":\r\n case \"YY\":\r\n case \"Y\":\r\n case \"MMMMM\":\r\n case \"W\":\r\n case \"EEEEE\":\r\n case \"EEEE\":\r\n case \"EEE\":\r\n case \"EE\":\r\n case \"E\":\r\n case \"eeeee\":\r\n case \"eeee\":\r\n case \"eee\":\r\n case \"ee\":\r\n case \"e\":\r\n case \"zzzz\":\r\n case \"zzz\":\r\n case \"zz\":\r\n case \"z\":\r\n case \"t\":\r\n // Ignore\r\n indexAdjust--;\r\n break;\r\n }\r\n reg += \"[^0-9]*\";\r\n }\r\n // Try matching\r\n var regex = new RegExp(reg);\r\n var matches = source.match(regex);\r\n if (matches) {\r\n // Populate the date object\r\n // Full year\r\n if (parsedIndexes.year > -1) {\r\n resValues.year = parseInt(matches[parsedIndexes.year]);\r\n }\r\n // 3-digit year\r\n if (parsedIndexes.year3 > -1) {\r\n var val = parseInt(matches[parsedIndexes.year3]);\r\n val += 1000;\r\n resValues.year = val;\r\n }\r\n // 2-digit year\r\n if (parsedIndexes.year2 > -1) {\r\n var val = parseInt(matches[parsedIndexes.year2]);\r\n if (val > 50) {\r\n val += 1000;\r\n }\r\n else {\r\n val += 2000;\r\n }\r\n resValues.year = val;\r\n }\r\n // 1-digit year\r\n if (parsedIndexes.year1 > -1) {\r\n var val = parseInt(matches[parsedIndexes.year1]);\r\n val = Math.floor((new Date().getFullYear()) / 10) * 10 + val;\r\n resValues.year = val;\r\n }\r\n // Full month\r\n if (parsedIndexes.monthLong > -1) {\r\n resValues.month = this.resolveMonth(matches[parsedIndexes.monthLong]);\r\n }\r\n // Short month\r\n if (parsedIndexes.monthShort > -1) {\r\n resValues.month = this.resolveShortMonth(matches[parsedIndexes.monthShort]);\r\n }\r\n // Numeric month\r\n if (parsedIndexes.month > -1) {\r\n resValues.month = parseInt(matches[parsedIndexes.month]) - 1;\r\n }\r\n // Weekday\r\n // @todo\r\n // Week\r\n if ((parsedIndexes.week > -1) && (parsedIndexes.day === -1)) {\r\n // We parse weeks ONLY if day is not explicitly set\r\n // TODO: this needs work\r\n // (but maybe later - I can hardly imagine anyone passing their dates in weeks)\r\n resValues.month = 0;\r\n resValues.day = $utils.getDayFromWeek(parseInt(matches[parsedIndexes.week]), resValues.year, 1, this.utc);\r\n }\r\n // Day\r\n if (parsedIndexes.day > -1) {\r\n resValues.day = parseInt(matches[parsedIndexes.day]);\r\n }\r\n // Year day\r\n if (parsedIndexes.yearDay > -1) {\r\n resValues.month = 0;\r\n resValues.day = parseInt(matches[parsedIndexes.yearDay]);\r\n }\r\n // 24 Hour (0-23)\r\n if (parsedIndexes.hourBase0 > -1) {\r\n resValues.hour = parseInt(matches[parsedIndexes.hourBase0]);\r\n }\r\n // 24 Hour (1-24)\r\n if (parsedIndexes.hourBase1 > -1) {\r\n resValues.hour = parseInt(matches[parsedIndexes.hourBase1]) - 1;\r\n }\r\n // 12 Hour (0-11)\r\n if (parsedIndexes.hour12Base0 > -1) {\r\n var val = parseInt(matches[parsedIndexes.hour12Base0]);\r\n if (val == 11) {\r\n val = 0;\r\n }\r\n if ((parsedIndexes.am > -1) && !this.isAm(matches[parsedIndexes.am])) {\r\n val += 12;\r\n }\r\n resValues.hour = val;\r\n }\r\n // 12 Hour (1-12)\r\n if (parsedIndexes.hour12Base1 > -1) {\r\n var val = parseInt(matches[parsedIndexes.hour12Base1]);\r\n if (val == 12) {\r\n val = 0;\r\n }\r\n if ((parsedIndexes.am > -1) && !this.isAm(matches[parsedIndexes.am])) {\r\n val += 12;\r\n }\r\n resValues.hour = val;\r\n }\r\n // Minute\r\n if (parsedIndexes.minute > -1) {\r\n resValues.minute = parseInt(matches[parsedIndexes.minute]);\r\n }\r\n // Second\r\n if (parsedIndexes.second > -1) {\r\n resValues.second = parseInt(matches[parsedIndexes.second]);\r\n }\r\n // Millisecond\r\n if (parsedIndexes.millisecond > -1) {\r\n var val = parseInt(matches[parsedIndexes.millisecond]);\r\n if (parsedIndexes.millisecondDigits == 2) {\r\n val *= 10;\r\n }\r\n else if (parsedIndexes.millisecondDigits == 1) {\r\n val *= 100;\r\n }\r\n resValues.millisecond = val;\r\n }\r\n // Timestamp\r\n if (parsedIndexes.timestamp > -1) {\r\n resValues.timestamp = parseInt(matches[parsedIndexes.timestamp]);\r\n var ts = new Date(resValues.timestamp);\r\n resValues.year = ts.getUTCFullYear();\r\n resValues.month = ts.getUTCMonth();\r\n resValues.day = ts.getUTCDate();\r\n resValues.hour = ts.getUTCHours();\r\n resValues.minute = ts.getUTCMinutes();\r\n resValues.second = ts.getUTCSeconds();\r\n resValues.millisecond = ts.getUTCMilliseconds();\r\n }\r\n // Adjust time zone\r\n if (parsedIndexes.zone > -1) {\r\n resValues.offset = this.resolveTimezoneOffset(new Date(resValues.year, resValues.month, resValues.day), matches[parsedIndexes.zone]);\r\n }\r\n // ISO\r\n if (parsedIndexes.iso > -1) {\r\n resValues.year = $type.toNumber(matches[parsedIndexes.iso + 0]);\r\n resValues.month = $type.toNumber(matches[parsedIndexes.iso + 1]) - 1;\r\n resValues.day = $type.toNumber(matches[parsedIndexes.iso + 2]);\r\n resValues.hour = $type.toNumber(matches[parsedIndexes.iso + 3]);\r\n resValues.minute = $type.toNumber(matches[parsedIndexes.iso + 4]);\r\n resValues.second = $type.toNumber(matches[parsedIndexes.iso + 5]);\r\n resValues.millisecond = $type.toNumber(matches[parsedIndexes.iso + 6]);\r\n if (matches[parsedIndexes.iso + 7] == \"Z\" || matches[parsedIndexes.iso + 7] == \"z\") {\r\n resValues.utc = true;\r\n }\r\n else if (matches[parsedIndexes.iso + 7] != \"\") {\r\n resValues.offset = this.resolveTimezoneOffset(new Date(resValues.year, resValues.month, resValues.day), matches[parsedIndexes.iso + 7]);\r\n }\r\n }\r\n // Create Date object\r\n if (resValues.utc) {\r\n res = new Date(Date.UTC(resValues.year, resValues.month, resValues.day, resValues.hour, resValues.minute, resValues.second, resValues.millisecond));\r\n }\r\n else {\r\n res = new Date(resValues.year, resValues.month, resValues.day, resValues.hour, resValues.minute + resValues.offset, resValues.second, resValues.millisecond);\r\n }\r\n }\r\n else {\r\n // Didn't match anything\r\n // Let's try dropping it into Date constructor and hope for the best\r\n res = new Date(source);\r\n }\r\n return res;\r\n };\r\n DateFormatter.prototype.resolveTimezoneOffset = function (date, zone) {\r\n var value = zone.match(/([+\\-]?)([0-9]{2}):?([0-9]{2})/);\r\n if (value) {\r\n var match = $type.getValue(zone.match(/([+\\-]?)([0-9]{2}):?([0-9]{2})/));\r\n var dir = match[1];\r\n var hour = match[2];\r\n var minute = match[3];\r\n var offset = parseInt(hour) * 60 + parseInt(minute);\r\n // Adjust offset\r\n // Making it negative does not seem to make sense, but it's right\r\n // because of how JavaScript calculates GMT offsets\r\n if (dir == \"+\") {\r\n offset *= -1;\r\n }\r\n // Check the difference in offset\r\n var originalOffset = (date || new Date()).getTimezoneOffset();\r\n var diff = offset - originalOffset;\r\n return diff;\r\n }\r\n return 0;\r\n };\r\n /**\r\n * Resolves month name (i.e. \"December\") into a month number (11).\r\n *\r\n * @param value Month name\r\n * @return Month number\r\n */\r\n DateFormatter.prototype.resolveMonth = function (value) {\r\n // Let's try English first\r\n var month = this.months.indexOf(value);\r\n if (month > -1) {\r\n return month;\r\n }\r\n // Try the translation\r\n if (this.language && !this.language.isDefault()) {\r\n month = this.language.translateAll(this.months).indexOf(value);\r\n if (month > -1) {\r\n return month;\r\n }\r\n }\r\n return 0;\r\n };\r\n /**\r\n * Resolves short month name (i.e. \"Dec\") into a month number.\r\n *\r\n * @param value Short month name\r\n * @return Month number\r\n */\r\n DateFormatter.prototype.resolveShortMonth = function (value) {\r\n // Let's try English first\r\n var month = this.monthsShort.indexOf(value);\r\n if (month > -1) {\r\n return month;\r\n }\r\n // Maybe long month (workaround for May)\r\n month = this.months.indexOf(value);\r\n if (month > -1) {\r\n return month;\r\n }\r\n // Try the translation\r\n if (this.language && !this.language.isDefault()) {\r\n month = this.language.translateAll(this.monthsShort).indexOf(value);\r\n if (month > -1) {\r\n return month;\r\n }\r\n }\r\n return 0;\r\n };\r\n /**\r\n * Checks if passed in string represents AM/PM notation in many of its\r\n * versions.\r\n *\r\n * @param value Source string\r\n * @return Is it AM/PM?\r\n */\r\n DateFormatter.prototype.isAm = function (value) {\r\n var list = this.getStringList([\"AM\", \"A.M.\", \"A\"]);\r\n return list.indexOf(value.toUpperCase()) > -1;\r\n };\r\n /**\r\n * Invalidates related [[Sprite]] causing it to redraw.\r\n */\r\n DateFormatter.prototype.invalidateSprite = function () {\r\n if (this.sprite) {\r\n this.sprite.invalidate();\r\n }\r\n };\r\n /**\r\n * Translates list of strings.\r\n *\r\n * @param list Source strings\r\n * @return Translated strings\r\n */\r\n DateFormatter.prototype.getStringList = function (list) {\r\n var res = [];\r\n for (var i = 0; i < list.length; i++) {\r\n // translate?\r\n if (this.language) {\r\n res.push($utils.escapeForRgex(this.language.translate(list[i])));\r\n }\r\n else {\r\n res.push($utils.escapeForRgex(list[i]));\r\n }\r\n }\r\n return res;\r\n };\r\n Object.defineProperty(DateFormatter.prototype, \"dateFormat\", {\r\n /**\r\n * @return Date format\r\n */\r\n get: function () {\r\n return this._dateFormat;\r\n },\r\n /**\r\n * Date format to use.\r\n *\r\n * If format is not supplied in-line in the string, this setting will be\r\n * used.\r\n *\r\n * @default \"yyyy-MM-dd\"\r\n * @param value Date format\r\n */\r\n set: function (value) {\r\n this._dateFormat = value;\r\n this.invalidateSprite();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DateFormatter.prototype, \"inputDateFormat\", {\r\n /**\r\n * @return Date format\r\n */\r\n get: function () {\r\n return this._inputDateFormat;\r\n },\r\n /**\r\n * Date format to use when parsing dates.\r\n *\r\n * @default \"yyyy-MM-dd\"\r\n * @param value Date format\r\n */\r\n set: function (value) {\r\n this._inputDateFormat = value;\r\n this.invalidateSprite();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DateFormatter.prototype, \"intlLocales\", {\r\n /**\r\n * @return Date format\r\n */\r\n get: function () {\r\n return this._intlLocales;\r\n },\r\n /**\r\n * Locales if you are using date formats in `Intl.DateTimeFormatOptions` syntax.\r\n *\r\n * @param value Locales\r\n */\r\n set: function (value) {\r\n this._intlLocales = value;\r\n this.invalidateSprite();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DateFormatter.prototype, \"utc\", {\r\n /**\r\n * @return Use UTC?\r\n */\r\n get: function () {\r\n return this._utc;\r\n },\r\n /**\r\n * Should formatter use UTC functions?\r\n *\r\n * If UTC is used, all date/time values will be independent on client's\r\n * time zone.\r\n *\r\n * @param value Use UTC?\r\n */\r\n set: function (value) {\r\n this._utc = value;\r\n this.invalidateSprite();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DateFormatter.prototype, \"timezoneOffset\", {\r\n /**\r\n * @return Offset (minutes)\r\n */\r\n get: function () {\r\n return this._timezoneOffset;\r\n },\r\n /**\r\n * If set, will apply specific offset in minutes before formatting the date\r\n * text.\r\n *\r\n * The value is a number of minutes from target time zone to UTC.\r\n *\r\n * E.g. `300` will recalculate Dates in \"GMT-5\" time zone.\r\n *\r\n * @param value Offset (minutes)\r\n */\r\n set: function (value) {\r\n if (this._timezoneOffset != value) {\r\n this._timezoneOffset = value;\r\n this.invalidateSprite();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DateFormatter.prototype, \"timezone\", {\r\n /**\r\n * @return Timezone\r\n */\r\n get: function () {\r\n return this._timezone;\r\n },\r\n /**\r\n * If set, will format date/time in specific time zone.\r\n *\r\n * The value should be named time zone, e.g.:\r\n * `\"America/Vancouver\"`, `\"Australia/Sydney\"`, `\"UTC\"`.\r\n *\r\n * @since 4.10.1\r\n * @param value Timezone\r\n */\r\n set: function (value) {\r\n if (this._timezone != value) {\r\n this._timezone = value;\r\n this.timezoneMinutes = $time.getTimezoneMinutes(value);\r\n this.invalidateSprite();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DateFormatter.prototype, \"firstDayOfWeek\", {\r\n /**\r\n * @return First day of week\r\n */\r\n get: function () {\r\n return this._firstDayOfWeek;\r\n },\r\n /**\r\n * First day of the week:\r\n *\r\n * * 0 - Sunday\r\n * * 1 - Monday\r\n * * 2 - Tuesday\r\n *\r\n * Etc.\r\n *\r\n * @param value First day of week\r\n */\r\n set: function (value) {\r\n this._firstDayOfWeek = value;\r\n this.invalidateSprite();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DateFormatter.prototype, \"outputFormat\", {\r\n /**\r\n * @ignore Exclude from docs\r\n * @return Format\r\n */\r\n get: function () {\r\n return this._outputFormat;\r\n },\r\n /**\r\n * Output format for the formatted date.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Format\r\n */\r\n set: function (value) {\r\n this._outputFormat = value.toLowerCase();\r\n this.invalidateSprite();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return DateFormatter;\r\n}(BaseObject));\r\nexport { DateFormatter };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"DateFormatter\"] = DateFormatter;\r\n","/**\r\n * Duration formatting functionality.\r\n */\r\nimport { __extends } from \"tslib\";\r\nimport { Language } from \"../utils/Language\";\r\nimport { BaseObject } from \"../Base\";\r\nimport { getTextFormatter } from \"../formatters/TextFormatter\";\r\nimport { registry } from \"../Registry\";\r\nimport * as $strings from \"../utils/Strings\";\r\nimport * as $object from \"../utils/Object\";\r\nimport * as $utils from \"../utils/Utils\";\r\nimport * as $type from \"../utils/Type\";\r\nimport * as $math from \"../utils/Math\";\r\n/**\r\n * DurationFormatter class. Formats numbers as durations.\r\n *\r\n * `1000` as `16:40`\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/formatters/formatting-duration/} Tutorial on duration formatting\r\n */\r\nvar DurationFormatter = /** @class */ (function (_super) {\r\n __extends(DurationFormatter, _super);\r\n /**\r\n * Constructor\r\n */\r\n function DurationFormatter() {\r\n var _this = _super.call(this) || this;\r\n /**\r\n * A base value for negative numbers. Will treat all numbers below this value\r\n * as negative numbers.\r\n */\r\n _this._negativeBase = 0;\r\n /**\r\n * A base unit to consider values are in.\r\n *\r\n * @default \"s\"\r\n */\r\n _this._baseUnit = \"second\";\r\n /**\r\n * Output format to produce. If the format calls for applying color to the\r\n * formatted value, this setting will determine what markup to use: SVG or\r\n * HTML.\r\n *\r\n * Available options: svg, html.\r\n *\r\n * @default \"svg\"\r\n */\r\n _this._outputFormat = \"svg\";\r\n /**\r\n * How many milliseconds each unit represents.\r\n */\r\n _this._unitValues = {\r\n \"millisecond\": 1,\r\n \"second\": 1000,\r\n \"minute\": 60000,\r\n \"hour\": 3600000,\r\n \"day\": 86400000,\r\n \"week\": 604800000,\r\n \"month\": 2592000000,\r\n \"year\": 31536000000,\r\n };\r\n /**\r\n * Collection of aliases for units.\r\n */\r\n _this._unitAliases = {\r\n \"Y\": \"y\",\r\n \"D\": \"d\",\r\n \"H\": \"h\",\r\n \"K\": \"h\",\r\n \"k\": \"h\",\r\n \"n\": \"S\"\r\n };\r\n _this.className = \"DurationFormatter\";\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Formats the number according as duration.\r\n *\r\n * For example `1000` (base unit seconds) would be converted to `16:40` as in\r\n * 16 minutes and 40 seconds.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/formatters/formatting-duration/} Tutorial on duration formatting\r\n * @param value Value to format\r\n * @param format Format to apply\r\n * @param base Override base unit\r\n * @return Formatted number\r\n */\r\n DurationFormatter.prototype.format = function (value, format, base) {\r\n // no language?\r\n if (!this.language) {\r\n if (this.sprite) {\r\n this.language = this.sprite.language;\r\n }\r\n else {\r\n this.language = new Language;\r\n }\r\n }\r\n // no base unit?\r\n var baseUnit = base || this._baseUnit;\r\n // no format passed in or empty\r\n if (typeof format === \"undefined\" || format === \"\") {\r\n if ($type.hasValue(this.durationFormat)) {\r\n format = this.durationFormat;\r\n }\r\n else {\r\n format = this.getFormat($type.toNumber(value), null, baseUnit);\r\n }\r\n }\r\n // Clean format\r\n format = $utils.cleanFormat(format);\r\n // get format info (it will also deal with parser caching)\r\n var info = this.parseFormat(format, baseUnit);\r\n // cast to number just in case\r\n // TODO: maybe use better casting\r\n var source = Number(value);\r\n // format and replace the number\r\n var details;\r\n if (source > this._negativeBase) {\r\n details = info.positive;\r\n }\r\n else if (source < this._negativeBase) {\r\n details = info.negative;\r\n }\r\n else {\r\n details = info.zero;\r\n }\r\n // Format\r\n var formatted = this.applyFormat(source, details);\r\n // Apply color?\r\n if (details.color !== \"\") {\r\n if (this._outputFormat === \"svg\") {\r\n formatted = \"<tspan fill='\" + details.color + \"'>\" + formatted + \"</tspan>\";\r\n }\r\n else if (this._outputFormat === \"html\") {\r\n formatted = \"<span style='color: \" + details.color + \";'>\" + formatted + \"</span>\";\r\n }\r\n }\r\n return formatted;\r\n };\r\n /**\r\n * Parses supplied format into structured object which can be used to format\r\n * the number.\r\n *\r\n * @param format Format string, i.e. \"#,###.00\"\r\n * @param base Override base unit\r\n * @return Parsed information\r\n */\r\n DurationFormatter.prototype.parseFormat = function (format, base) {\r\n var _this = this;\r\n // Check cache\r\n var cached = this.getCache(format);\r\n if ($type.hasValue(cached)) {\r\n return cached;\r\n }\r\n // no base unit?\r\n var baseUnit = base || this._baseUnit;\r\n // Initialize duration parsing info\r\n var info = {\r\n \"positive\": {\r\n \"color\": \"\",\r\n \"template\": \"\",\r\n \"parts\": [],\r\n \"source\": \"\",\r\n \"baseUnit\": baseUnit,\r\n \"parsed\": false,\r\n \"absolute\": false\r\n },\r\n \"negative\": {\r\n \"color\": \"\",\r\n \"template\": \"\",\r\n \"parts\": [],\r\n \"source\": \"\",\r\n \"baseUnit\": baseUnit,\r\n \"parsed\": false,\r\n \"absolute\": false\r\n },\r\n \"zero\": {\r\n \"color\": \"\",\r\n \"template\": \"\",\r\n \"parts\": [],\r\n \"source\": \"\",\r\n \"baseUnit\": baseUnit,\r\n \"parsed\": false,\r\n \"absolute\": false\r\n }\r\n };\r\n // Escape double vertical bars (that mean display one vertical bar)\r\n format = format.replace(\"||\", $strings.PLACEHOLDER2);\r\n // Split it up and deal with different formats\r\n var parts = format.split(\"|\");\r\n info.positive.source = parts[0];\r\n if (typeof parts[2] === \"undefined\") {\r\n info.zero = info.positive;\r\n }\r\n else {\r\n info.zero.source = parts[2];\r\n }\r\n if (typeof parts[1] === \"undefined\") {\r\n info.negative = info.positive;\r\n }\r\n else {\r\n info.negative.source = parts[1];\r\n }\r\n // Parse each\r\n $object.each(info, function (part, item) {\r\n // Already parsed\r\n if (item.parsed) {\r\n return;\r\n }\r\n // Check cached\r\n if (typeof _this.getCache(item.source) !== \"undefined\") {\r\n info[part] = _this.getCache(item.source);\r\n return;\r\n }\r\n // Begin parsing\r\n var partFormat = item.source;\r\n // Check for [] directives\r\n var dirs = [];\r\n dirs = item.source.match(/^\\[([^\\]]*)\\]/);\r\n if (dirs && dirs.length && dirs[0] !== \"\") {\r\n partFormat = item.source.substr(dirs[0].length);\r\n item.color = dirs[1];\r\n }\r\n // Let TextFormatter split into chunks\r\n var chunks = getTextFormatter().chunk(partFormat, true);\r\n for (var i = 0; i < chunks.length; i++) {\r\n var chunk = chunks[i];\r\n // replace back double vertical bar\r\n chunk.text = chunk.text.replace($strings.PLACEHOLDER2, \"|\");\r\n if (chunk.type === \"value\") {\r\n // Just \"Duration\"?\r\n // if (chunk.text.toLowerCase() === \"duration\") {\r\n // \tchunk.text = durationFormat;\r\n // }\r\n // Check for \"a\" (absolute) modifier\r\n if (chunk.text.match(/[yYMdDwhHKkmsSn]+a/)) {\r\n item.absolute = true;\r\n chunk.text = chunk.text.replace(/([yYMdDwhHKkmsSn]+)a/, \"$1\");\r\n }\r\n // Find all possible parts\r\n var matches = chunk.text.match(/y+|Y+|M+|d+|D+|w+|h+|H+|K+|k+|m+|s+|S+|n+/g);\r\n if (matches) {\r\n // Populate template\r\n for (var x = 0; x < matches.length; x++) {\r\n // Is it an alias?\r\n if (!$type.hasValue(matches[x])) {\r\n matches[x] = _this._unitAliases[matches[x]];\r\n }\r\n item.parts.push(matches[x]);\r\n chunk.text = chunk.text.replace(matches[x], $strings.PLACEHOLDER);\r\n }\r\n }\r\n }\r\n // Apply to template\r\n item.template += chunk.text;\r\n }\r\n // Apply style formatting\r\n //item.template = getTextFormatter().format(item.template, this.outputFormat);\r\n // Save cache\r\n _this.setCache(item.source, item);\r\n // Mark this as parsed\r\n item.parsed = true;\r\n });\r\n // Save cache (the whole thing)\r\n this.setCache(format, info);\r\n return info;\r\n };\r\n /**\r\n * Applies parsed format to a numeric value.\r\n *\r\n * @param value Value\r\n * @param details Parsed format as returned by {parseFormat}\r\n * @return Formatted duration\r\n */\r\n DurationFormatter.prototype.applyFormat = function (value, details) {\r\n // Use absolute values\r\n var negative = !details.absolute && (value < this._negativeBase);\r\n value = Math.abs(value);\r\n // Recalculate to milliseconds\r\n var tstamp = this.toTimeStamp(value, details.baseUnit);\r\n // Init return value\r\n var res = details.template;\r\n // Iterate through duration parts\r\n for (var i = 0, len = details.parts.length; i < len; i++) {\r\n // Gather the part\r\n var part = details.parts[i];\r\n var unit = this.toTimeUnit(part.substr(0, 1));\r\n var digits = part.length;\r\n // Calculate current unit value\r\n var ints = Math.floor(tstamp / this._unitValues[unit]);\r\n res = res.replace($strings.PLACEHOLDER, $utils.padString(ints, digits, \"0\"));\r\n // Reduce timestamp\r\n tstamp -= ints * this._unitValues[unit];\r\n }\r\n // Reapply negative sign\r\n if (negative) {\r\n res = \"-\" + res;\r\n }\r\n return res;\r\n };\r\n /**\r\n * Converts numeric value to timestamp in milliseconds.\r\n *\r\n * @param value A source value\r\n * @param baseUnit Base unit the source value is in: \"q\", \"s\", \"i\", \"h\", \"d\", \"w\", \"m\", \"y\"\r\n * @return Value representation as a timestamp in milliseconds\r\n */\r\n DurationFormatter.prototype.toTimeStamp = function (value, baseUnit) {\r\n return value * this._unitValues[baseUnit];\r\n };\r\n DurationFormatter.prototype.toTimeUnit = function (code) {\r\n switch (code) {\r\n case \"S\":\r\n return \"millisecond\";\r\n case \"s\":\r\n return \"second\";\r\n case \"m\":\r\n return \"minute\";\r\n case \"h\":\r\n return \"hour\";\r\n case \"d\":\r\n return \"day\";\r\n case \"w\":\r\n return \"week\";\r\n case \"M\":\r\n return \"month\";\r\n case \"y\":\r\n return \"year\";\r\n }\r\n ;\r\n };\r\n /**\r\n * Invalidates the parent [[Sprite]] object.\r\n */\r\n DurationFormatter.prototype.invalidateSprite = function () {\r\n if (this.sprite) {\r\n this.sprite.invalidate();\r\n }\r\n };\r\n Object.defineProperty(DurationFormatter.prototype, \"baseUnit\", {\r\n /**\r\n * @return Base unit\r\n */\r\n get: function () {\r\n return this._baseUnit;\r\n },\r\n /**\r\n * Base unit the values are in.\r\n *\r\n * A base unit will be used to recalculate the numeric value to millisecond\r\n * timestamps.\r\n *\r\n * Available options:\r\n *\r\n * * \"millisecond\"\r\n * * \"second\"\r\n * * \"minute\"\r\n * * \"hour\"\r\n * * \"day\"\r\n * * \"week\"\r\n * * \"month\"\r\n * * \"year\"\r\n *\r\n * @default \"s\"\r\n * @param baseUnit A base unit\r\n */\r\n set: function (baseUnit) {\r\n this._baseUnit = baseUnit;\r\n this.invalidateSprite();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DurationFormatter.prototype, \"outputFormat\", {\r\n /**\r\n * Getter for output format.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Output format\r\n */\r\n get: function () {\r\n return this._outputFormat;\r\n },\r\n /**\r\n * Setter for output format: \"svg\" or \"html.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Output format\r\n */\r\n set: function (outputFormat) {\r\n this._outputFormat = outputFormat.toLowerCase();\r\n this.invalidateSprite();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Returns appropriate default format for the value.\r\n *\r\n * If `maxValue` is sepcified, it will use that value to determine the time\r\n * unit for the format.\r\n *\r\n * For example if your `baseUnit` is `\"second\"` and you pass in `10`, you\r\n * will get `\"10\"`.\r\n *\r\n * However, you might want it to be formatted in the context of bigger scale,\r\n * say 10 minutes (600 seconds). If you pass in `600` as `maxValue`, all\r\n * values, including small ones will use format with minutes, e.g.:\r\n * `00:10`, `00:50`, `12: 30`, etc.\r\n *\r\n * @param value Value to format\r\n * @param maxValue Maximum value to be used to determine format\r\n * @param baseUnit Base unit of the value\r\n * @return Format\r\n */\r\n DurationFormatter.prototype.getFormat = function (value, maxValue, baseUnit) {\r\n // Is format override set?\r\n if ($type.hasValue(this.durationFormat)) {\r\n return this.durationFormat;\r\n }\r\n // Get base unit\r\n if (!baseUnit) {\r\n baseUnit = this.baseUnit;\r\n }\r\n if ($type.hasValue(maxValue) && value != maxValue) {\r\n value = Math.abs(value);\r\n maxValue = Math.abs(maxValue);\r\n var maxUnit = this.getValueUnit($math.max(value, maxValue), baseUnit);\r\n //let diffUnit = this.getValueUnit(Math.abs(maxValue - value), baseUnit);\r\n //console.log(maxUnit, diffUnit);\r\n return this.durationFormats[baseUnit][maxUnit];\r\n }\r\n else {\r\n var unit = this.getValueUnit(value, baseUnit);\r\n return this.durationFormats[baseUnit][unit];\r\n }\r\n };\r\n /**\r\n * Returns value's closest denominator time unit, e.g 100 seconds is\r\n * `\"minute\"`, while 59 seconds would still be `second`.\r\n *\r\n * @param value Source duration value\r\n * @param baseUnit Base unit\r\n * @return Denominator\r\n */\r\n DurationFormatter.prototype.getValueUnit = function (value, baseUnit) {\r\n // Get base unit\r\n if (!baseUnit) {\r\n baseUnit = this.baseUnit;\r\n }\r\n // Convert to milliseconds\r\n var currentUnit;\r\n var ms = this.getMilliseconds(value, baseUnit);\r\n $object.eachContinue(this._unitValues, function (key, val) {\r\n if (key == baseUnit || currentUnit) {\r\n var num = ms / val;\r\n if (num <= 1) {\r\n if (!currentUnit) {\r\n currentUnit = key;\r\n }\r\n return false;\r\n }\r\n currentUnit = key;\r\n }\r\n return true;\r\n });\r\n return currentUnit;\r\n };\r\n /**\r\n * Converts value to milliseconds according to `baseUnit`.\r\n *\r\n * @param value Source duration value\r\n * @param baseUnit Base unit\r\n * @return Value in milliseconds\r\n */\r\n DurationFormatter.prototype.getMilliseconds = function (value, baseUnit) {\r\n // Get base unit\r\n if (!baseUnit) {\r\n baseUnit = this.baseUnit;\r\n }\r\n return value * this._unitValues[baseUnit];\r\n };\r\n Object.defineProperty(DurationFormatter.prototype, \"durationFormat\", {\r\n /**\r\n * @return Format\r\n */\r\n get: function () {\r\n return this._durationFormat;\r\n },\r\n /**\r\n * If set, this format will be used instead of the one determined dynamically\r\n * based on the basedUnit and range of values.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/formatters/formatting-duration/} Available fomatting codes\r\n * @param value Format\r\n */\r\n set: function (value) {\r\n if (this._durationFormat != value) {\r\n this._durationFormat = value;\r\n this.invalidateSprite();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DurationFormatter.prototype, \"durationFormats\", {\r\n /**\r\n * @return Formats\r\n */\r\n get: function () {\r\n if (!this._durationFormats) {\r\n this._durationFormats = {\r\n \"millisecond\": {\r\n \"millisecond\": this.language.translate(\"_duration_millisecond\"),\r\n \"second\": this.language.translate(\"_duration_millisecond_second\"),\r\n \"minute\": this.language.translate(\"_duration_millisecond_minute\"),\r\n \"hour\": this.language.translate(\"_duration_millisecond_hour\"),\r\n \"day\": this.language.translate(\"_duration_millisecond_day\"),\r\n \"week\": this.language.translate(\"_duration_millisecond_week\"),\r\n \"month\": this.language.translate(\"_duration_millisecond_month\"),\r\n \"year\": this.language.translate(\"_duration_millisecond_year\")\r\n },\r\n \"second\": {\r\n \"second\": this.language.translate(\"_duration_second\"),\r\n \"minute\": this.language.translate(\"_duration_second_minute\"),\r\n \"hour\": this.language.translate(\"_duration_second_hour\"),\r\n \"day\": this.language.translate(\"_duration_second_day\"),\r\n \"week\": this.language.translate(\"_duration_second_week\"),\r\n \"month\": this.language.translate(\"_duration_second_month\"),\r\n \"year\": this.language.translate(\"_duration_second_year\")\r\n },\r\n \"minute\": {\r\n \"minute\": this.language.translate(\"_duration_minute\"),\r\n \"hour\": this.language.translate(\"_duration_minute_hour\"),\r\n \"day\": this.language.translate(\"_duration_minute_day\"),\r\n \"week\": this.language.translate(\"_duration_minute_week\"),\r\n \"month\": this.language.translate(\"_duration_minute_month\"),\r\n \"year\": this.language.translate(\"_duration_minute_year\")\r\n },\r\n \"hour\": {\r\n \"hour\": this.language.translate(\"_duration_hour\"),\r\n \"day\": this.language.translate(\"_duration_hour_day\"),\r\n \"week\": this.language.translate(\"_duration_hour_week\"),\r\n \"month\": this.language.translate(\"_duration_hour_month\"),\r\n \"year\": this.language.translate(\"_duration_hour_year\")\r\n },\r\n \"day\": {\r\n \"day\": this.language.translate(\"_duration_day\"),\r\n \"week\": this.language.translate(\"_duration_day_week\"),\r\n \"month\": this.language.translate(\"_duration_day_month\"),\r\n \"year\": this.language.translate(\"_duration_day_year\")\r\n },\r\n \"week\": {\r\n \"week\": this.language.translate(\"_duration_week\"),\r\n \"month\": this.language.translate(\"_duration_week_month\"),\r\n \"year\": this.language.translate(\"_duration_week_year\")\r\n },\r\n \"month\": {\r\n \"month\": this.language.translate(\"_duration_month\"),\r\n \"year\": this.language.translate(\"_duration_month_year\")\r\n },\r\n \"year\": {\r\n \"year\": this.language.translate(\"_duration_year\")\r\n }\r\n };\r\n }\r\n return this._durationFormats;\r\n },\r\n /**\r\n * Duration formats for various combination of base units.\r\n *\r\n * @param value Formats\r\n */\r\n set: function (value) {\r\n this._durationFormats = value;\r\n this.invalidateSprite();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return DurationFormatter;\r\n}(BaseObject));\r\nexport { DurationFormatter };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"DurationFormatter\"] = DurationFormatter;\r\n","/**\r\n * Number formatting-related functionality.\r\n */\r\nimport { __extends } from \"tslib\";\r\nimport { Language } from \"../utils/Language\";\r\nimport { BaseObject } from \"../Base\";\r\nimport { getTextFormatter } from \"../formatters/TextFormatter\";\r\nimport { registry } from \"../Registry\";\r\nimport * as $strings from \"../utils/Strings\";\r\nimport * as $object from \"../utils/Object\";\r\nimport * as $utils from \"../utils/Utils\";\r\nimport * as $type from \"../utils/Type\";\r\nimport * as $math from \"../utils/Math\";\r\n/**\r\n * NumberFormatter class. Formats numbers according to specified formats.\r\n *\r\n * @todo Apply translations to suffixes/prefixes\r\n */\r\nvar NumberFormatter = /** @class */ (function (_super) {\r\n __extends(NumberFormatter, _super);\r\n /**\r\n * Constructor\r\n */\r\n function NumberFormatter() {\r\n var _this = _super.call(this) || this;\r\n /**\r\n * A base value for negative numbers. Will treat all numbers below this value\r\n * as negative numbers.\r\n */\r\n _this._negativeBase = 0;\r\n /**\r\n * Holds number format.\r\n *\r\n * @default #,###.#####\r\n */\r\n _this._numberFormat = \"#,###.#####\";\r\n /**\r\n * Output format to produce. If the format calls for applying color to the\r\n * formatted value, this setting will determine what markup to use: SVG or\r\n * HTML.\r\n *\r\n * Available options: svg, html.\r\n *\r\n * @default \"svg\"\r\n */\r\n _this._outputFormat = \"svg\";\r\n /**\r\n * Any number smaller than this will be considered \"small\" number, which will\r\n * trigger special formatting if \"a\" format modifier is used.\r\n */\r\n _this._smallNumberThreshold = 1.00;\r\n _this.className = \"NumberFormatter\";\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n NumberFormatter.prototype.dispose = function () {\r\n _super.prototype.dispose.call(this);\r\n if (this.language) {\r\n this.language.dispose();\r\n }\r\n };\r\n Object.defineProperty(NumberFormatter.prototype, \"language\", {\r\n /**\r\n * @return Language\r\n */\r\n get: function () {\r\n if (!this._language) {\r\n if (this.sprite) {\r\n this._language = this.sprite.language;\r\n }\r\n else {\r\n this._language = new Language;\r\n }\r\n }\r\n return this._language;\r\n },\r\n /**\r\n * A reference to [[Language]] instance.\r\n *\r\n * Formatter will use language to translate various items, like number\r\n * suffixes, etc.\r\n *\r\n * @param value Language\r\n */\r\n set: function (value) {\r\n this._language = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Formats the number according to specific format.\r\n *\r\n * @param value Value to format\r\n * @param format Format to apply\r\n * @return Formatted number\r\n */\r\n NumberFormatter.prototype.format = function (value, format, precision) {\r\n // no format passed in or \"Number\"\r\n if (typeof format === \"undefined\" || ($type.isString(format) && format.toLowerCase() === \"number\")) {\r\n format = this._numberFormat;\r\n }\r\n // Init return value\r\n var formatted;\r\n // Cast to number just in case\r\n // TODO: maybe use better casting\r\n var source = Number(value);\r\n // Is it a built-in format or Intl.NumberFormatOptions\r\n if ($type.isObject(format)) {\r\n try {\r\n if (this.intlLocales) {\r\n return new Intl.NumberFormat(this.intlLocales, format).format(source);\r\n }\r\n else {\r\n return new Intl.NumberFormat(undefined, format).format(source);\r\n }\r\n }\r\n catch (e) {\r\n return \"Invalid\";\r\n }\r\n }\r\n else {\r\n // Clean format\r\n format = $utils.cleanFormat(format);\r\n // Get format info (it will also deal with parser caching)\r\n var info = this.parseFormat(format, this.language);\r\n // format and replace the number\r\n var details = void 0;\r\n if (source > this._negativeBase) {\r\n details = info.positive;\r\n }\r\n else if (source < this._negativeBase) {\r\n details = info.negative;\r\n }\r\n else {\r\n details = info.zero;\r\n }\r\n // Adjust precision\r\n if ($type.hasValue(precision) && !details.mod) {\r\n details = $object.clone(details);\r\n details.decimals.active = source == 0 ? 0 : precision;\r\n }\r\n // Format\r\n formatted = details.template.split($strings.PLACEHOLDER).join(this.applyFormat(source, details));\r\n }\r\n return formatted;\r\n };\r\n /**\r\n * Parses supplied format into structured object which can be used to format\r\n * the number.\r\n *\r\n * @param format Format string, i.e. \"#,###.00\"\r\n * @param language Language\r\n */\r\n NumberFormatter.prototype.parseFormat = function (format, language) {\r\n var _this = this;\r\n // Check cache\r\n var cached = this.getCache(format);\r\n if ($type.hasValue(cached)) {\r\n return cached;\r\n }\r\n // init format parse info holder\r\n var info = {\r\n \"positive\": {\r\n \"thousands\": {\r\n \"active\": -1,\r\n \"passive\": -1,\r\n \"interval\": -1,\r\n \"separator\": language.translateEmpty(\"_thousandSeparator\")\r\n },\r\n \"decimals\": {\r\n \"active\": -1,\r\n \"passive\": -1,\r\n \"separator\": language.translateEmpty(\"_decimalSeparator\")\r\n },\r\n \"template\": \"\",\r\n \"source\": \"\",\r\n \"parsed\": false\r\n },\r\n \"negative\": {\r\n \"thousands\": {\r\n \"active\": -1,\r\n \"passive\": -1,\r\n \"interval\": -1,\r\n \"separator\": language.translateEmpty(\"_thousandSeparator\")\r\n },\r\n \"decimals\": {\r\n \"active\": -1,\r\n \"passive\": -1,\r\n \"separator\": language.translateEmpty(\"_decimalSeparator\")\r\n },\r\n \"template\": \"\",\r\n \"source\": \"\",\r\n \"parsed\": false\r\n },\r\n \"zero\": {\r\n \"thousands\": {\r\n \"active\": -1,\r\n \"passive\": -1,\r\n \"interval\": -1,\r\n \"separator\": language.translateEmpty(\"_thousandSeparator\")\r\n },\r\n \"decimals\": {\r\n \"active\": -1,\r\n \"passive\": -1,\r\n \"separator\": language.translateEmpty(\"_decimalSeparator\")\r\n },\r\n \"template\": \"\",\r\n \"source\": \"\",\r\n \"parsed\": false\r\n }\r\n };\r\n // Escape double vertical bars (that mean display one vertical bar)\r\n format = format.replace(\"||\", $strings.PLACEHOLDER2);\r\n // Split it up and deal with different formats\r\n var parts = format.split(\"|\");\r\n info.positive.source = parts[0];\r\n if (typeof parts[2] === \"undefined\") {\r\n info.zero = info.positive;\r\n }\r\n else {\r\n info.zero.source = parts[2];\r\n }\r\n if (typeof parts[1] === \"undefined\") {\r\n info.negative = info.positive;\r\n }\r\n else {\r\n info.negative.source = parts[1];\r\n }\r\n // Parse each\r\n $object.each(info, function (part, item) {\r\n // Already parsed\r\n if (item.parsed) {\r\n return;\r\n }\r\n // Check cached\r\n if (typeof _this.getCache(item.source) !== \"undefined\") {\r\n info[part] = _this.getCache(item.source);\r\n return;\r\n }\r\n // Begin parsing\r\n var partFormat = item.source;\r\n // Just \"Number\"?\r\n if (partFormat.toLowerCase() === \"number\") {\r\n partFormat = $type.isString(_this._numberFormat) ? _this._numberFormat : \"#,###.#####\";\r\n }\r\n // Let TextFormatter split into chunks\r\n var chunks = getTextFormatter().chunk(partFormat, true);\r\n for (var i = 0; i < chunks.length; i++) {\r\n var chunk = chunks[i];\r\n // replace back double vertical bar\r\n chunk.text = chunk.text.replace($strings.PLACEHOLDER2, \"|\");\r\n if (chunk.type === \"value\") {\r\n // Parse format\r\n // Look for codes\r\n var matches = chunk.text.match(/[#0.,]+[ ]?[abesABES%!]?[abesABES‰!]?/);\r\n if (matches) {\r\n if (matches === null || matches[0] === \"\") {\r\n // no codes here - assume string\r\n // nothing to do here\r\n item.template += chunk.text;\r\n }\r\n else {\r\n // look for the format modifiers at the end\r\n var mods = matches[0].match(/[abesABES%‰!]{2}|[abesABES%‰]{1}$/);\r\n if (mods) {\r\n item.mod = mods[0].toLowerCase();\r\n item.modSpacing = matches[0].match(/[ ]{1}[abesABES%‰!]{1}$/) ? true : false;\r\n }\r\n // break the format up\r\n var a = matches[0].split(\".\");\r\n // Deal with thousands\r\n if (a[0] === \"\") {\r\n // No directives for thousands\r\n // Leave default settings (no formatting)\r\n }\r\n else {\r\n // Counts\r\n item.thousands.active = (a[0].match(/0/g) || []).length;\r\n item.thousands.passive = (a[0].match(/\\#/g) || []).length + item.thousands.active;\r\n // Separator interval\r\n var b = a[0].split(\",\");\r\n if (b.length === 1) {\r\n // No thousands separators\r\n // Do nothing\r\n }\r\n else {\r\n // Use length fo the last chunk as thousands length\r\n item.thousands.interval = $type.getValue(b.pop()).length;\r\n if (item.thousands.interval === 0) {\r\n item.thousands.interval = -1;\r\n }\r\n }\r\n }\r\n // Deal with decimals\r\n if (typeof (a[1]) === \"undefined\") {\r\n // No directives for decimals\r\n // Leave at defaults (no formatting)\r\n }\r\n else {\r\n // Counts\r\n item.decimals.active = (a[1].match(/0/g) || []).length;\r\n item.decimals.passive = (a[1].match(/\\#/g) || []).length + item.decimals.active;\r\n }\r\n // Add special code to template\r\n item.template += chunk.text.split(matches[0]).join($strings.PLACEHOLDER);\r\n }\r\n }\r\n }\r\n else {\r\n // Quoted string - take it as it is\r\n item.template += chunk.text;\r\n }\r\n }\r\n // Apply style formatting\r\n //item.template = getTextFormatter().format(item.template, this.outputFormat);\r\n // Save cache\r\n _this.setCache(item.source, item);\r\n // Mark this as parsed\r\n item.parsed = true;\r\n });\r\n // Save cache (the whole thing)\r\n this.setCache(format, info);\r\n return info;\r\n };\r\n /**\r\n * Applies parsed format to a numeric value.\r\n *\r\n * @param value Value\r\n * @param details Parsed format as returned by parseFormat()\r\n * @return Formatted number\r\n */\r\n NumberFormatter.prototype.applyFormat = function (value, details) {\r\n // Use absolute values\r\n var negative = value < 0;\r\n value = Math.abs(value);\r\n // Recalculate according to modifier\r\n var prefix = \"\", suffix = \"\";\r\n var mods = details.mod ? details.mod.split(\"\") : [];\r\n if (mods.indexOf(\"b\") !== -1) {\r\n var a_1 = this.applyPrefix(value, this.bytePrefixes, mods.indexOf(\"!\") !== -1);\r\n value = a_1[0];\r\n prefix = a_1[1];\r\n suffix = a_1[2];\r\n if (details.modSpacing) {\r\n suffix = \" \" + suffix;\r\n }\r\n }\r\n else if (mods.indexOf(\"a\") !== -1) {\r\n var a_2 = this.applyPrefix(value, value < this.smallNumberThreshold ? this.smallNumberPrefixes : this.bigNumberPrefixes, mods.indexOf(\"!\") !== -1);\r\n value = a_2[0];\r\n prefix = a_2[1];\r\n suffix = a_2[2];\r\n if (details.modSpacing) {\r\n suffix = \" \" + suffix;\r\n }\r\n }\r\n else if (mods.indexOf(\"%\") !== -1) {\r\n var ol = $math.min(value.toString().length + 2, 21);\r\n value *= 100;\r\n value = parseFloat(value.toPrecision(ol));\r\n suffix = \"%\";\r\n }\r\n else if (mods.indexOf(\"‰\") !== -1) {\r\n var ol = $math.min(value.toString().length + 3, 21);\r\n value *= 1000;\r\n value = parseFloat(value.toPrecision(ol));\r\n suffix = \"‰\";\r\n }\r\n // Round to passive\r\n if (mods.indexOf(\"e\") !== -1) {\r\n // convert the value to exponential\r\n var exp = void 0;\r\n if (details.decimals.passive >= 0) {\r\n exp = value.toExponential(details.decimals.passive).split(\"e\");\r\n }\r\n else {\r\n exp = value.toExponential().split(\"e\");\r\n }\r\n value = Number(exp[0]);\r\n suffix = \"e\" + exp[1];\r\n if (details.modSpacing) {\r\n suffix = \" \" + suffix;\r\n }\r\n }\r\n else if (details.decimals.passive === 0) {\r\n value = Math.round(value);\r\n }\r\n else if (details.decimals.passive > 0) {\r\n var d = Math.pow(10, details.decimals.passive);\r\n value = Math.round(value * d) / d;\r\n }\r\n // Init return value\r\n var res = \"\";\r\n // Calc integer and decimal parts\r\n var a = $utils.numberToString(value).split(\".\");\r\n // Format integers\r\n var ints = a[0];\r\n // Pad integers to active length\r\n if (ints.length < details.thousands.active) {\r\n ints = Array(details.thousands.active - ints.length + 1).join(\"0\") + ints;\r\n }\r\n // Insert thousands separators\r\n if (details.thousands.interval > 0) {\r\n var ip = [];\r\n var intsr = ints.split(\"\").reverse().join(\"\");\r\n for (var i = 0, len = ints.length; i <= len; i += details.thousands.interval) {\r\n var c = intsr.substr(i, details.thousands.interval).split(\"\").reverse().join(\"\");\r\n if (c !== \"\") {\r\n ip.unshift(c);\r\n }\r\n }\r\n ints = ip.join(details.thousands.separator);\r\n }\r\n // Add integers\r\n res += ints;\r\n // Add decimals\r\n if (a.length === 1) {\r\n a.push(\"\");\r\n }\r\n var decs = a[1];\r\n // Fill zeros?\r\n if (decs.length < details.decimals.active) {\r\n decs += Array(details.decimals.active - decs.length + 1).join(\"0\");\r\n }\r\n if (decs !== \"\") {\r\n res += details.decimals.separator + decs;\r\n }\r\n // Can't have empty return value\r\n if (res === \"\") {\r\n res = \"0\";\r\n }\r\n // Add minus sign back\r\n if (value !== 0 && negative && (mods.indexOf(\"s\") === -1)) {\r\n res = \"-\" + res;\r\n }\r\n // Add suffixes/prefixes\r\n if (prefix) {\r\n res = prefix + res;\r\n }\r\n if (suffix) {\r\n res += suffix;\r\n }\r\n return res;\r\n };\r\n /**\r\n * Chooses appropriate prefix and suffix based on the passed in rules.\r\n *\r\n * @param value Value\r\n * @param prefixes Prefix array\r\n * @param force Force application of a first prefix (@sice 4.5.4)\r\n * @return Result\r\n */\r\n NumberFormatter.prototype.applyPrefix = function (value, prefixes, force) {\r\n if (force === void 0) { force = false; }\r\n var newvalue = value;\r\n var prefix = \"\";\r\n var suffix = \"\";\r\n var applied = false;\r\n var k = 1;\r\n for (var i = 0, len = prefixes.length; i < len; i++) {\r\n if (prefixes[i].number <= value) {\r\n if (prefixes[i].number === 0) {\r\n newvalue = 0;\r\n }\r\n else {\r\n newvalue = value / prefixes[i].number;\r\n k = prefixes[i].number;\r\n }\r\n prefix = prefixes[i].prefix;\r\n suffix = prefixes[i].suffix;\r\n applied = true;\r\n }\r\n }\r\n if (!applied && force && prefixes.length && value != 0) {\r\n // Prefix was not applied. Use the first prefix.\r\n newvalue = value / prefixes[0].number;\r\n prefix = prefixes[0].prefix;\r\n suffix = prefixes[0].suffix;\r\n applied = true;\r\n }\r\n if (applied) {\r\n newvalue = parseFloat(newvalue.toPrecision($math.min(k.toString().length + Math.floor(newvalue).toString().replace(/[^0-9]*/g, \"\").length, 21)));\r\n }\r\n return [newvalue, prefix, suffix];\r\n };\r\n /**\r\n * Invalidates the parent [[Sprite]] object.\r\n */\r\n NumberFormatter.prototype.invalidateSprite = function () {\r\n if (this.sprite) {\r\n this.sprite.invalidate();\r\n }\r\n };\r\n Object.defineProperty(NumberFormatter.prototype, \"numberFormat\", {\r\n /**\r\n * @return A format to use for number formatting\r\n */\r\n get: function () {\r\n return this._numberFormat;\r\n },\r\n /**\r\n * Number format.\r\n *\r\n * @default \"#,###.#####\"\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/formatters/formatting-numbers/} Tutorial on number formatting\r\n * @param format A format to use for number formatting\r\n */\r\n set: function (format) {\r\n this._numberFormat = format;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(NumberFormatter.prototype, \"intlLocales\", {\r\n /**\r\n * @return Date format\r\n */\r\n get: function () {\r\n return this._intlLocales;\r\n },\r\n /**\r\n * Locales if you are using date formats in `Intl.NumberFormatOptions` syntax.\r\n *\r\n * @see (@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NumberFormat) about using Intl for number formatting\r\n * @param value Locales\r\n */\r\n set: function (value) {\r\n this._intlLocales = value;\r\n this.invalidateSprite();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(NumberFormatter.prototype, \"negativeBase\", {\r\n /**\r\n * @return A format to use for number formatting\r\n */\r\n get: function () {\r\n return this._negativeBase;\r\n },\r\n /**\r\n * Negative base for negative numbers.\r\n *\r\n * @default 0\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/formatters/formatting-numbers/} Tutorial on number formatting\r\n * @param format A format to use for number formatting\r\n */\r\n set: function (value) {\r\n this._negativeBase = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(NumberFormatter.prototype, \"bigNumberPrefixes\", {\r\n /**\r\n * @return Prefixes for big numbers\r\n */\r\n get: function () {\r\n if (!$type.hasValue(this._bigNumberPrefixes)) {\r\n this._bigNumberPrefixes = [\r\n { \"number\": 1e+3, \"suffix\": this.language.translate(\"_big_number_suffix_3\") },\r\n { \"number\": 1e+6, \"suffix\": this.language.translate(\"_big_number_suffix_6\") },\r\n { \"number\": 1e+9, \"suffix\": this.language.translate(\"_big_number_suffix_9\") },\r\n { \"number\": 1e+12, \"suffix\": this.language.translate(\"_big_number_suffix_12\") },\r\n { \"number\": 1e+15, \"suffix\": this.language.translate(\"_big_number_suffix_15\") },\r\n { \"number\": 1e+18, \"suffix\": this.language.translate(\"_big_number_suffix_18\") },\r\n { \"number\": 1e+21, \"suffix\": this.language.translate(\"_big_number_suffix_21\") },\r\n { \"number\": 1e+24, \"suffix\": this.language.translate(\"_big_number_suffix_24\") }\r\n ];\r\n }\r\n return this._bigNumberPrefixes;\r\n },\r\n /**\r\n * Prefixes for big numbers.\r\n *\r\n * It's an array of objects of number/prefix pairs.\r\n *\r\n * ```JSON\r\n * [\r\n * { \"number\": 1e+3, \"suffix\": \"K\" },\r\n * { \"number\": 1e+6, \"suffix\": \"M\" },\r\n * { \"number\": 1e+9, \"suffix\": \"G\" },\r\n * { \"number\": 1e+12, \"suffix\": \"T\" },\r\n * { \"number\": 1e+15, \"suffix\": \"P\" },\r\n * { \"number\": 1e+18, \"suffix\": \"E\" },\r\n * { \"number\": 1e+21, \"suffix\": \"Z\" },\r\n * { \"number\": 1e+24, \"suffix\": \"Y\" }\r\n * ]\r\n * ```\r\n *\r\n * If the number is bigger than the `number` ir will be converted to the\r\n * appropriate bigger number with prefix.\r\n *\r\n * E.g. as per above `1500` will be converted to `1.5K`.\r\n *\r\n * Please note that for this transformation to be enabled, you need to\r\n * enable it specific modifier in your format setting.\r\n *\r\n * The modifier for big/small number modification is \"a\":\r\n *\r\n * ```Text\r\n * {myfield.formatNumber(\"#,###.00a\")}\r\n * ```\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/formatters/formatting-numbers/} Tutorial on number formatting\r\n * @param prefixes Prefixes for big numbers\r\n */\r\n set: function (prefixes) {\r\n this._bigNumberPrefixes = prefixes;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(NumberFormatter.prototype, \"smallNumberPrefixes\", {\r\n /**\r\n * @return Prefixes for small numbers\r\n */\r\n get: function () {\r\n if (!$type.hasValue(this._smallNumberPrefixes)) {\r\n this._smallNumberPrefixes = [\r\n { \"number\": 1e-24, \"suffix\": this.language.translate(\"_small_number_suffix_24\") },\r\n { \"number\": 1e-21, \"suffix\": this.language.translate(\"_small_number_suffix_21\") },\r\n { \"number\": 1e-18, \"suffix\": this.language.translate(\"_small_number_suffix_18\") },\r\n { \"number\": 1e-15, \"suffix\": this.language.translate(\"_small_number_suffix_15\") },\r\n { \"number\": 1e-12, \"suffix\": this.language.translate(\"_small_number_suffix_12\") },\r\n { \"number\": 1e-9, \"suffix\": this.language.translate(\"_small_number_suffix_9\") },\r\n { \"number\": 1e-6, \"suffix\": this.language.translate(\"_small_number_suffix_6\") },\r\n { \"number\": 1e-3, \"suffix\": this.language.translate(\"_small_number_suffix_3\") }\r\n ];\r\n }\r\n return this._smallNumberPrefixes;\r\n },\r\n /**\r\n * Prefixes for big numbers.\r\n *\r\n * It's an array of objects of number/prefix pairs.\r\n *\r\n * ```JSON\r\n * [\r\n * { \"number\": 1e-24, \"suffix\": \"y\" },\r\n * { \"number\": 1e-21, \"suffix\": \"z\" },\r\n * { \"number\": 1e-18, \"suffix\": \"a\" },\r\n * { \"number\": 1e-15, \"suffix\": \"f\" },\r\n * { \"number\": 1e-12, \"suffix\": \"p\" },\r\n * { \"number\": 1e-9, \"suffix\": \"n\" },\r\n * { \"number\": 1e-6, \"suffix\": \"μ\" },\r\n * { \"number\": 1e-3, \"suffix\": \"m\" }\r\n * ]\r\n * ```\r\n *\r\n * If the number is smaller than the `number` ir will be converted to the\r\n * appropriate smaller number with prefix.\r\n *\r\n * E.g. as per above `0.0015` will be converted to `1.5m`.\r\n *\r\n * Please note that for this transformation to be enabled, you need to\r\n * enable it specific modifier in your format setting.\r\n *\r\n * The modifier for big/small number modification is \"a\":\r\n *\r\n * ```Text\r\n * {myfield.formatNumber(\"#,###.00a\")}\r\n * ```\r\n *\r\n * IMPORTANT: The order of the suffixes is important. The list must start\r\n * from the smallest number and work towards bigger ones.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/formatters/formatting-numbers/} Tutorial on number formatting\r\n * @param prefixes Prefixes for small numbers\r\n */\r\n set: function (prefixes) {\r\n this._smallNumberPrefixes = prefixes;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(NumberFormatter.prototype, \"smallNumberThreshold\", {\r\n /**\r\n * @return Small number threshold\r\n */\r\n get: function () {\r\n return this._smallNumberThreshold;\r\n },\r\n /**\r\n * Any number smaller than this will be considered \"small\" number, which will\r\n * trigger special formatting if \"a\" format modifier is used.\r\n *\r\n * @since 4.6.8\r\n * @param value Small number threshold\r\n */\r\n set: function (value) {\r\n this._smallNumberThreshold = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(NumberFormatter.prototype, \"bytePrefixes\", {\r\n /**\r\n * @return Prefixes for byte-size formatting\r\n */\r\n get: function () {\r\n if (!$type.hasValue(this._bytePrefixes)) {\r\n this._bytePrefixes = [\r\n { \"number\": 1, suffix: this.language.translate(\"_byte_suffix_B\") },\r\n { \"number\": 1024, suffix: this.language.translate(\"_byte_suffix_KB\") },\r\n { \"number\": 1048576, suffix: this.language.translate(\"_byte_suffix_MB\") },\r\n { \"number\": 1073741824, suffix: this.language.translate(\"_byte_suffix_GB\") },\r\n { \"number\": 1099511627776, suffix: this.language.translate(\"_byte_suffix_TB\") },\r\n { \"number\": 1125899906842624, suffix: this.language.translate(\"_byte_suffix_PB\") }\r\n ];\r\n }\r\n return this._bytePrefixes;\r\n },\r\n /**\r\n * Basically the same as `bigNumberPrefixes`, except base for calculation\r\n * is not thousand but byte (1024).\r\n *\r\n * The modifier is \"b\".\r\n *\r\n * ```Text\r\n * {myfield.formatNumber(\"#,###.00b\")}\r\n * ```\r\n *\r\n * The above `2048` will change to `2K`.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/formatters/formatting-numbers/} Tutorial on number formatting\r\n * @param prefixes Prefixes for byte-size formatting\r\n */\r\n set: function (prefixes) {\r\n this._bytePrefixes = prefixes;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(NumberFormatter.prototype, \"outputFormat\", {\r\n /**\r\n * @ignore Exclude from docs\r\n * @return Output format\r\n */\r\n get: function () {\r\n return this._outputFormat;\r\n },\r\n /**\r\n * Ooutput format: \"svg\" or \"html\".\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Output format\r\n */\r\n set: function (outputFormat) {\r\n this._outputFormat = outputFormat.toLowerCase();\r\n this.invalidateSprite();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Replaces brackets with temporary placeholders.\r\n *\r\n * @ignore Exclude from docs\r\n * @param text Input text\r\n * @return Escaped text\r\n */\r\n NumberFormatter.prototype.escape = function (text) {\r\n return text.replace(\"||\", $strings.PLACEHOLDER2);\r\n };\r\n /**\r\n * Replaces placeholders back to brackets.\r\n *\r\n * @ignore Exclude from docs\r\n * @param text Escaped text\r\n * @return Unescaped text\r\n */\r\n NumberFormatter.prototype.unescape = function (text) {\r\n return text.replace($strings.PLACEHOLDER2, \"|\");\r\n };\r\n return NumberFormatter;\r\n}(BaseObject));\r\nexport { NumberFormatter };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"NumberFormatter\"] = NumberFormatter;\r\n","/**\r\n * Handles formatting of pseudo-markup in text.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { BaseObject } from \"../Base\";\r\nimport { AMElement } from \"../rendering/AMElement\";\r\nimport { Adapter } from \"../utils/Adapter\";\r\nimport { registry } from \"../Registry\";\r\nimport * as $strings from \"../utils/Strings\";\r\nimport * as $type from \"../utils/Type\";\r\n/**\r\n * Handles formatting of pseudo-markdown in text.\r\n *\r\n * @todo Encode < > in output\r\n * @todo Add more adapters\r\n * @important\r\n */\r\nvar TextFormatter = /** @class */ (function (_super) {\r\n __extends(TextFormatter, _super);\r\n /**\r\n * Constructor\r\n */\r\n function TextFormatter() {\r\n var _this = _super.call(this) || this;\r\n /**\r\n * Adapter.\r\n */\r\n _this.adapter = new Adapter(_this);\r\n _this.className = \"TextFormatter\";\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n TextFormatter.prototype.debug = function () { };\r\n /**\r\n * Formats the text according to specifications passed in.\r\n *\r\n * @param text Text to format\r\n * @param output Output format (svg, html)\r\n * @return Formatted text\r\n */\r\n TextFormatter.prototype.format = function (text, output) {\r\n // Apply default\r\n if (!$type.hasValue(output)) {\r\n output = \"svg\";\r\n }\r\n // Init return value\r\n var formatted = \"\";\r\n // Replace double (escaped) square spaces with remporary codes\r\n text = this.escape(text);\r\n // Divvy up the string by style tags\r\n var styles = text.match(/\\[([^\\]]*?)\\]/gm);\r\n if (!styles) {\r\n // Nothing to do here - no formatting elements\r\n return this.wrap(text, \"\", output);\r\n }\r\n // Get pure text - no style tags\r\n var texts = text.split(/\\[[^\\[\\]]*\\]/);\r\n // Go through each of the texts and wrap it in style tags\r\n for (var i = 0, len = texts.length; i < len; i++) {\r\n // Get text bit\r\n var t = texts[i];\r\n // Check if string is empty\r\n if (t === \"\") {\r\n continue;\r\n }\r\n // Run through an adapter\r\n t = this.adapter.apply(\"chunk\", t);\r\n // Get related style\r\n var s = \"\";\r\n if (i > 0) {\r\n s = styles[i - 1].replace('[', '').replace(']', '');\r\n }\r\n // Wrap text in tag\r\n formatted += this.wrap(t, s, output);\r\n }\r\n // Replace placeholders back\r\n formatted = this.unescape(formatted);\r\n // Return result\r\n return this.cleanUp(formatted);\r\n };\r\n /**\r\n * Replaces brackets with temporary placeholders.\r\n *\r\n * @ignore Exclude from docs\r\n * @param text Input text\r\n * @return Escaped text\r\n */\r\n TextFormatter.prototype.escape = function (text) {\r\n return text.\r\n replace(/\\[\\[/g, registry.getPlaceholder(\"1\")).\r\n replace(/([^\\/]{1})\\]\\]/g, \"$1\" + registry.getPlaceholder(\"2\")).\r\n replace(/\\]\\]/g, registry.getPlaceholder(\"2\")).\r\n replace(/\\{\\{/g, registry.getPlaceholder(\"3\")).\r\n replace(/\\}\\}/g, registry.getPlaceholder(\"4\")).\r\n replace(/\\'\\'/g, registry.getPlaceholder(\"5\"));\r\n };\r\n /**\r\n * Replaces placeholders back to brackets.\r\n *\r\n * @ignore Exclude from docs\r\n * @param text Escaped text\r\n * @return Unescaped text\r\n */\r\n TextFormatter.prototype.unescape = function (text) {\r\n return text.\r\n replace(new RegExp(registry.getPlaceholder(\"1\"), \"g\"), \"[[\").\r\n replace(new RegExp(registry.getPlaceholder(\"2\"), \"g\"), \"]]\").\r\n replace(new RegExp(registry.getPlaceholder(\"3\"), \"g\"), \"{{\").\r\n replace(new RegExp(registry.getPlaceholder(\"4\"), \"g\"), \"}}\").\r\n replace(new RegExp(registry.getPlaceholder(\"5\"), \"g\"), \"'\");\r\n };\r\n /**\r\n * Cleans up the text text for leftover double square brackets.\r\n *\r\n * @ignore Exclude from docs\r\n * @param text Input text\r\n * @return Cleaned up text\r\n */\r\n TextFormatter.prototype.cleanUp = function (text) {\r\n return text.\r\n replace(/\\[\\[/g, \"[\").\r\n replace(/\\]\\]/g, \"]\").\r\n replace(/\\{\\{/g, \"{\").\r\n replace(/\\}\\}/g, \"}\").\r\n replace(/\\'\\'/g, \"'\");\r\n };\r\n /**\r\n * Wraps text into corresponding tags.\r\n *\r\n * @ignore Exclude from docs\r\n * @param text Text to wrap\r\n * @param style Styles\r\n * @param output Format to output in (svg, html)\r\n * @return Formatted string\r\n */\r\n TextFormatter.prototype.wrap = function (text, style, output) {\r\n if (style === \"\" || style === \"/\") {\r\n //return text;\r\n style = \"\";\r\n }\r\n switch (output) {\r\n case \"html\":\r\n return this.wrapHtml(text, this.translateStyleShortcuts(style));\r\n default:\r\n return this.wrapSvg(text, this.translateStyleShortcuts(style));\r\n }\r\n };\r\n /**\r\n * Wraps text in styled SVG tag.\r\n *\r\n * @ignore Exclude from docs\r\n * @param text Text to wrap\r\n * @param style Style property\r\n * @return Formatted tag\r\n */\r\n TextFormatter.prototype.wrapSvg = function (text, style) {\r\n if (style === \"\") {\r\n return \"<tspan>\" + text + \"</tspan>\";\r\n }\r\n else {\r\n return \"<tspan style='\" + style + \"'>\" + text + \"</tspan>\";\r\n }\r\n };\r\n /**\r\n * Returns an SVG `<tspan>` element.\r\n *\r\n * @ignore Exclude from docs\r\n * @param text Text\r\n * @param style Style\r\n * @return Element\r\n */\r\n TextFormatter.prototype.getSvgElement = function (text, style) {\r\n var element = new AMElement(\"tspan\");\r\n element.textContent = text;\r\n if (style) {\r\n element.node.setAttribute(\"style\", style);\r\n }\r\n return element;\r\n };\r\n /**\r\n * Wraps text in HTML <span> tag.\r\n *\r\n * @ignore Exclude from docs\r\n * @param text Text to wrap\r\n * @param style Style property\r\n * @return Formatted tag\r\n * @todo Translate SVG styles into HTML ones\r\n */\r\n TextFormatter.prototype.wrapHtml = function (text, style) {\r\n if (style === \"\") {\r\n return \"<span>\" + text + \"</span>\";\r\n }\r\n else {\r\n return \"<span style='\" + this.styleSvgToHtml(style) + \"'>\" + text + \"</span>\";\r\n }\r\n };\r\n /**\r\n * Returns an HTML `<span>` element.\r\n *\r\n * @ignore Exclude from docs\r\n * @param text Text/HTML\r\n * @param style Style definition\r\n * @return HTML element\r\n */\r\n TextFormatter.prototype.getHtmlElement = function (text, style) {\r\n var element = document.createElement(\"span\");\r\n element.innerHTML = text;\r\n if (style) {\r\n element.setAttribute(\"style\", style);\r\n }\r\n return element;\r\n };\r\n /**\r\n * Trabslates SVG CSS into HTML CSS.\r\n *\r\n * @ignore Exclude from docs\r\n * @param style SVG CSS\r\n * @return HTML CSS\r\n * @todo Implement actual translation\r\n */\r\n TextFormatter.prototype.styleSvgToHtml = function (style) {\r\n style = style.replace(/fill:/, \"color:\");\r\n return style;\r\n };\r\n /**\r\n * Translates style shortcuts into full styles, i.e.:\r\n * \"bold\" => \"font-weight: bold\"\r\n * \"#f00\" => \"fill: #f00\"\r\n *\r\n * @ignore Exclude from docs\r\n * @param style Untranslated style\r\n * @return Translated style\r\n * @todo Implement actual translation\r\n */\r\n TextFormatter.prototype.translateStyleShortcuts = function (style) {\r\n if (style == \"\" || style == \"[ ]\") {\r\n return \"\";\r\n }\r\n var cached = registry.getCache(\"translateStyleShortcuts_\" + style);\r\n if (cached) {\r\n return cached;\r\n }\r\n // Pre-process quoted text\r\n var q = style.match(/('[^']*')|(\"[^\"]*\")/gi);\r\n if (q) {\r\n for (var i = 0; i < q.length; i++) {\r\n style = style.replace(q[i], q[i].replace(/['\"]*/g, \"\").replace(/[ ]+/g, \"+\"));\r\n }\r\n }\r\n // Get style parts\r\n var b = style.match(/([\\w\\-]*:[\\s]?[^;\\s\\]]*)|(\\#[\\w]{1,6})|([\\w]+)|(\\/)/gi);\r\n // Empty?\r\n if (!b) {\r\n return style;\r\n }\r\n // Check each part\r\n for (var i = 0; i < b.length; i++) {\r\n if (b[i].match(/^bold$/i)) {\r\n // Bold\r\n b[i] = \"font-weight:\" + b[i];\r\n }\r\n else if (b[i] == \"/\") {\r\n // Just closing tag\r\n // Do nothing\r\n b[i] = \"\";\r\n }\r\n else if (!b[i].match(/:/)) {\r\n // Color\r\n b[i] = \"fill:\" + b[i];\r\n }\r\n else {\r\n b[i] = b[i].replace(/\\+/g, \" \");\r\n }\r\n }\r\n var res = b.join(';');\r\n registry.setCache(\"translateStyleShortcuts_\" + style, res);\r\n return res;\r\n };\r\n /**\r\n * Splits string into chunks. (style blocks, quoted blocks, regular blocks)\r\n *\r\n * If the second parameter `quotedBlocks` is set to `true` this method will\r\n * also single out text blocks enclosed within single quotes that no\r\n * formatting should be applied to, and they should be displayed as is.\r\n *\r\n * Default for the above is `false`, so that you can use single quote in text\r\n * without escaping it.\r\n *\r\n * If enabled, single quotes can be escaped by doubling it - adding two\r\n * single quotes, which will be replaced by a one single quote in the final\r\n * output.\r\n *\r\n * @ignore Exclude from docs\r\n * @param text Text to chunk\r\n * @param quotedBlocks Use quoted blocks\r\n * @param noFormatting Formatting blocks will be treated as regular text\r\n * @return Array of string chunks\r\n */\r\n TextFormatter.prototype.chunk = function (text, quotedBlocks, noFormatting) {\r\n if (quotedBlocks === void 0) { quotedBlocks = false; }\r\n if (noFormatting === void 0) { noFormatting = false; }\r\n // Init result\r\n var res = [];\r\n // Replace double (escaped) square spaces and quotes with temporary codes\r\n text = this.escape(text);\r\n // Deal with style blocks\r\n var chunks = quotedBlocks ? text.split(\"'\") : [text];\r\n for (var i = 0; i < chunks.length; i++) {\r\n var chunk = chunks[i];\r\n // Empty?\r\n if (chunk === \"\") {\r\n continue;\r\n }\r\n if ((i % 2) === 0) {\r\n // Text outside quotes\r\n // Parse for style blocks which are \"text\" chunks, the rest chunks are\r\n // \"value\"\r\n chunk = chunk.replace(/\\]\\[/g, \"]\" + $strings.PLACEHOLDER + \"[\");\r\n chunk = chunk.replace(/\\[\\]/g, \"[ ]\");\r\n var chunks2 = chunk.split(/[\\[\\]]+/);\r\n for (var i2 = 0; i2 < chunks2.length; i2++) {\r\n var chunk2 = this.cleanUp(this.unescape(chunks2[i2]));\r\n // Placeholder?\r\n if (chunk2 === $strings.PLACEHOLDER) {\r\n continue;\r\n }\r\n // Empty?\r\n if (chunk2 === \"\") {\r\n continue;\r\n }\r\n // Block or value\r\n if ((i2 % 2) === 0) {\r\n res.push({\r\n \"type\": \"value\",\r\n \"text\": this.adapter.apply(\"chunk\", chunk2)\r\n });\r\n }\r\n else {\r\n res.push({\r\n \"type\": noFormatting ? \"value\" : \"format\",\r\n \"text\": \"[\" + chunk2 + \"]\"\r\n });\r\n }\r\n }\r\n }\r\n else {\r\n // A text within doublequotes\r\n // All chunks are \"text\"\r\n var chunks2 = chunk.split(/[\\[\\]]+/);\r\n for (var i2 = 0; i2 < chunks2.length; i2++) {\r\n var chunk2 = this.cleanUp(this.unescape(chunks2[i2]));\r\n // Empty?\r\n if (chunk2 === \"\") {\r\n continue;\r\n }\r\n // Block or text\r\n if ((i2 % 2) === 0) {\r\n res.push({\r\n \"type\": \"text\",\r\n \"text\": chunk2\r\n });\r\n }\r\n else if (this.isImage(chunk2)) {\r\n res.push({\r\n \"type\": \"image\",\r\n \"text\": \"[\" + chunk2 + \"]\"\r\n });\r\n }\r\n else {\r\n res.push({\r\n \"type\": \"format\",\r\n \"text\": \"[\" + chunk2 + \"]\"\r\n });\r\n }\r\n }\r\n }\r\n }\r\n return res;\r\n };\r\n /**\r\n * Checks if supplied format contains image information and should be\r\n * formatted as such.\r\n * I.e.: `[img: myImage.png]`\r\n *\r\n * @ignore Exclude from docs\r\n * @param text Format\r\n * @return `true` if it is an image\r\n */\r\n TextFormatter.prototype.isImage = function (text) {\r\n return text.match(/img[ ]?:/) ? true : false;\r\n };\r\n return TextFormatter;\r\n}(BaseObject));\r\nexport { TextFormatter };\r\nvar formatter;\r\n/**\r\n * Returns the global instance of [[TextFormatter]].\r\n *\r\n * All classes and instances should reuse this universal text formatter,\r\n * rather than create their own instance of it.\r\n */\r\nexport function getTextFormatter() {\r\n if (formatter == null) {\r\n formatter = new TextFormatter();\r\n }\r\n return formatter;\r\n}\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"TextFormatter\"] = TextFormatter;\r\n","/**\r\n * Functionality related to inertia\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { BaseObject } from \"../Base\";\r\nimport { getInteraction } from \"./Interaction\";\r\nimport { AnimationDisposer } from \"../utils/Animation\";\r\nimport * as $type from \"../utils/Type\";\r\n/**\r\n * A point of inertia is to simulate gradually drecreasing motion even after\r\n * actual interaction by user, that caused it, has already ended.\r\n *\r\n * [[Inertia]] object will continue triggering the same [[Sprite]] handlers\r\n * as if the interaction was still happening, gradually reducing\r\n * shift/angle/scale values until full stop.\r\n *\r\n * Basically, from the target element's point of view, while inertia is\r\n * playing, it is still being interacted with by user, albeit with a\r\n * decreasing speed.\r\n */\r\nvar Inertia = /** @class */ (function (_super) {\r\n __extends(Inertia, _super);\r\n /**\r\n * Constructor\r\n */\r\n function Inertia(interaction, type, point, startPoint) {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n /**\r\n * List of animations currently playing.\r\n */\r\n _this.animations = [];\r\n _this.className = \"Inertia\";\r\n _this.interaction = interaction;\r\n _this.type = type;\r\n _this.point = point;\r\n _this.startPoint = startPoint;\r\n // Make animations disposable\r\n _this._disposers.push(new AnimationDisposer(_this.animations));\r\n return _this;\r\n }\r\n Object.defineProperty(Inertia.prototype, \"x\", {\r\n /**\r\n * Returns current X coordinate.\r\n *\r\n * @return X\r\n */\r\n get: function () {\r\n return this.point.x;\r\n },\r\n /**\r\n * Sets current X coordinate.\r\n *\r\n * Will trigger \"drag\" event for the target element.\r\n *\r\n * @param value X\r\n */\r\n set: function (value) {\r\n if ($type.isNumber(value)) {\r\n this.point.x = value;\r\n this.handleMove();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Inertia.prototype, \"y\", {\r\n /**\r\n * Returns current Y coordinate.\r\n *\r\n * @return Y\r\n */\r\n get: function () {\r\n return this.point.y;\r\n },\r\n /**\r\n * Sets current Y coordinate.\r\n *\r\n * Will trigger \"drag\" event for the target element.\r\n *\r\n * @param value Y\r\n */\r\n set: function (value) {\r\n if ($type.isNumber(value)) {\r\n this.point.y = value;\r\n this.handleMove();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Simulates dragging of element.\r\n */\r\n Inertia.prototype.handleMove = function () {\r\n // Prepare {InteractionEvent} object\r\n if (this.interaction.events.isEnabled(\"drag\")) {\r\n var imev = {\r\n type: \"drag\",\r\n target: this.interaction,\r\n shift: {\r\n x: this.x - this.startPoint.x,\r\n y: this.y - this.startPoint.y\r\n },\r\n startPoint: this.startPoint,\r\n point: {\r\n x: this.x,\r\n y: this.y\r\n },\r\n touch: false\r\n };\r\n // Call handler\r\n this.interaction.events.dispatchImmediately(\"drag\", imev);\r\n }\r\n };\r\n /**\r\n * Finishes up the inertia animation. (removes reference to this animation\r\n * object)\r\n */\r\n Inertia.prototype.done = function () {\r\n // Remove inertia animation from the object\r\n this.interaction.inertias.removeKey(this.type);\r\n // Move ended\r\n if (this.type === \"move\") {\r\n getInteraction().processDragStop(this.interaction);\r\n }\r\n // Destroy\r\n this.dispose();\r\n };\r\n return Inertia;\r\n}(BaseObject));\r\nexport { Inertia };\r\n","/**\r\n * Interaction manages all aspects of user interaction - mouse move,\r\n * click, hover, drag events, touch gestures.\r\n *\r\n * [[InteractionObject]] elements that want to use certain events, must attach event\r\n * listeners to Interaction instance.\r\n *\r\n * Interaction itself will not modify [[InteractionObject]] elements, it will be up to\r\n * those elements to handle interaction information received via event triggers.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { BaseObjectEvents } from \"../Base\";\r\nimport { List } from \"../utils/List\";\r\nimport { Animation } from \"../utils/Animation\";\r\nimport { MultiDisposer } from \"../utils/Disposer\";\r\nimport { InteractionObject } from \"./InteractionObject\";\r\nimport { InteractionKeyboardObject } from \"./InteractionKeyboardObject\";\r\nimport { Dictionary } from \"../utils/Dictionary\";\r\nimport { Inertia } from \"./Inertia\";\r\nimport { addEventListener } from \"../utils/DOM\";\r\nimport { keyboard } from \"../utils/Keyboard\";\r\nimport { system } from \"./../System\";\r\nimport { options } from \"./../Options\";\r\nimport * as $ease from \"../utils/Ease\";\r\nimport * as $math from \"../utils/Math\";\r\nimport * as $array from \"../utils/Array\";\r\nimport * as $dom from \"../utils/DOM\";\r\nimport * as $iter from \"../utils/Iterator\";\r\nimport * as $type from \"../utils/Type\";\r\nimport * as $time from \"../utils/Time\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n* Interaction manages all aspects of user interaction - mouse move,\r\n* click, hover, drag events, touch gestures.\r\n*\r\n* [[InteractionObject]] elements that want to use certain events, must attach event\r\n* listeners to Interaction instance.\r\n*\r\n* Interaction itself will not modify [[InteractionObject]] elements, it will be up to\r\n* those elements to handle interaction information received via event triggers.\r\n*\r\n* @see {@link IInteractionEvents} for a list of available events\r\n*/\r\nvar Interaction = /** @class */ (function (_super) {\r\n __extends(Interaction, _super);\r\n /**\r\n * Constructor. Sets up universal document-wide move events to handle stuff\r\n * outside particular chart container.\r\n */\r\n function Interaction() {\r\n var _this = \r\n // Call super\r\n _super.call(this) || this;\r\n /**\r\n * An indicator of global events were already initialized.\r\n */\r\n _this._globalEventsAdded = false;\r\n /**\r\n * Holds which mouse event listeners to use.\r\n */\r\n _this._pointerEvents = {\r\n \"pointerdown\": \"mousedown\",\r\n \"pointerup\": \"mouseup\",\r\n \"pointermove\": \"mousemove\",\r\n \"pointercancel\": \"mouseup\",\r\n \"pointerover\": \"mouseover\",\r\n \"pointerout\": \"mouseout\",\r\n \"wheel\": \"wheel\"\r\n };\r\n /**\r\n * Indicates if Interaction should use only \"pointer\" type events, like\r\n * \"pointermove\", available in all modern browsers, ignoring \"legacy\"\r\n * events, like \"touchmove\".\r\n */\r\n _this._usePointerEventsOnly = false;\r\n /**\r\n * Use only touch events (for touch only devices such as tablets and phones)\r\n */\r\n _this._useTouchEventsOnly = false;\r\n /**\r\n * Add special hover events. Normally, touch device tap will also simulate\r\n * hover event. On some devices (ahem iOS) we want to prevent that so that\r\n * over/out events are not duplicated.\r\n */\r\n _this._addHoverEvents = true;\r\n /**\r\n * Indicates if passive mode options is supported by this browser.\r\n */\r\n _this._passiveSupported = false;\r\n /**\r\n * Holds list of delayed events\r\n */\r\n _this._delayedEvents = { out: [] };\r\n /**\r\n * List of objects that current have a pointer hovered over them.\r\n */\r\n _this.overObjects = new List();\r\n /**\r\n * List of objects that currently has a pressed pointer.\r\n */\r\n _this.downObjects = new List();\r\n /**\r\n * List of objects that need mouse position to be reported to them.\r\n */\r\n _this.trackedObjects = new List();\r\n /**\r\n * List of objects that are currently being dragged.\r\n */\r\n _this.transformedObjects = new List();\r\n /**\r\n * Holds all known pointers.\r\n */\r\n _this.pointers = new Dictionary();\r\n /**\r\n * Inertia options that need to be applied to after element drag, if it's\r\n * `inert = true`.\r\n *\r\n * This is just a default, which can and probably will be overridden by\r\n * actual elements.\r\n */\r\n _this.inertiaOptions = new Dictionary();\r\n /**\r\n * Default options for click events. These can be overridden in\r\n * [[InteractionObject]].\r\n */\r\n _this.hitOptions = {\r\n \"doubleHitTime\": 300,\r\n //\"delayFirstHit\": false,\r\n \"hitTolerance\": 10,\r\n \"noFocus\": true\r\n };\r\n /**\r\n * Default options for hover events. These can be overridden in\r\n * [[InteractionObject]].\r\n */\r\n _this.hoverOptions = {\r\n \"touchOutBehavior\": \"leave\",\r\n \"touchOutDelay\": 1000\r\n };\r\n /**\r\n * Default options for detecting a swipe gesture. These can be overridden in\r\n * [[InteractionObject]].\r\n */\r\n _this.swipeOptions = {\r\n \"time\": 500,\r\n \"verticalThreshold\": 75,\r\n \"horizontalThreshold\": 30\r\n };\r\n /**\r\n * Default options for keyboard operations. These can be overridden in\r\n * [[InteractionObject]].\r\n */\r\n _this.keyboardOptions = {\r\n \"speed\": 0.1,\r\n \"accelleration\": 1.2,\r\n \"accellerationDelay\": 2000\r\n };\r\n /**\r\n * Default options for keyboard operations. These can be overridden in\r\n * [[InteractionObject]].\r\n *\r\n * @since 4.5.14\r\n */\r\n _this.mouseOptions = {\r\n \"sensitivity\": 1\r\n };\r\n // Set class name\r\n _this.className = \"Interaction\";\r\n // Create InteractionObject for <body>\r\n _this.body = _this.getInteraction(document.body);\r\n _this._disposers.push(_this.body);\r\n // Detect browser capabilities and determine what event listeners to use\r\n if (window.hasOwnProperty(\"PointerEvent\")) {\r\n // IE10+/Edge without touch controls enabled\r\n _this._pointerEvents.pointerdown = \"pointerdown\";\r\n _this._pointerEvents.pointerup = \"pointerup\";\r\n _this._pointerEvents.pointermove = \"pointermove\";\r\n _this._pointerEvents.pointercancel = \"pointercancel\";\r\n _this._pointerEvents.pointerover = \"pointerover\";\r\n _this._pointerEvents.pointerout = \"pointerout\";\r\n //this._usePointerEventsOnly = true;\r\n }\r\n else if (window.hasOwnProperty(\"MSPointerEvent\")) {\r\n // IE9\r\n _this._pointerEvents.pointerdown = \"MSPointerDown\";\r\n _this._pointerEvents.pointerup = \"MSPointerUp\";\r\n _this._pointerEvents.pointermove = \"MSPointerMove\";\r\n _this._pointerEvents.pointercancel = \"MSPointerUp\";\r\n _this._pointerEvents.pointerover = \"MSPointerOver\";\r\n _this._pointerEvents.pointerout = \"MSPointerOut\";\r\n //this._usePointerEventsOnly = true;\r\n }\r\n else if ((typeof matchMedia !== \"undefined\") && matchMedia('(pointer:fine)').matches) {\r\n // This is only for Safari as it does not support PointerEvent\r\n // Do nothing and let it use regular `mouse*` events\r\n // Hi Apple ;)\r\n // Additionally disable hover events for iOS devices\r\n if ('ontouchstart' in window) {\r\n _this._addHoverEvents = false;\r\n _this._useTouchEventsOnly = true;\r\n }\r\n }\r\n else if (window.navigator.userAgent.match(/MSIE /)) {\r\n // Oh looky, an MSIE that does not support PointerEvent. Hi granpa IE9!\r\n _this._usePointerEventsOnly = true;\r\n }\r\n else if (_this.fullFF()) {\r\n // Old FF, let's use regular events.\r\n // (Newer FFs would be detected by the PointerEvent availability check)\r\n _this._usePointerEventsOnly = true;\r\n }\r\n else {\r\n // Uses defaults for normal browsers\r\n // We also assume that this must be a touch device that does not have\r\n // any pointer events\r\n _this._useTouchEventsOnly = true;\r\n }\r\n // Detect if device has a mouse\r\n // This is turning out to be not reliable\r\n // @todo remove\r\n /*if (!window.navigator.msPointerEnabled && (typeof matchMedia !== \"undefined\") && !matchMedia('(pointer:fine)').matches && !this.fullFF()) {\r\n this._useTouchEventsOnly = true;\r\n }*/\r\n // Detect proper mouse wheel events\r\n if (\"onwheel\" in document.createElement(\"div\")) {\r\n // Modern browsers\r\n _this._pointerEvents.wheel = \"wheel\";\r\n }\r\n else if ($type.hasValue(document.onmousewheel)) {\r\n // Webkit and IE support at least \"mousewheel\"\r\n _this._pointerEvents.wheel = \"mousewheel\";\r\n }\r\n // Set up default inertia options\r\n _this.inertiaOptions.setKey(\"move\", {\r\n \"time\": 100,\r\n \"duration\": 500,\r\n \"factor\": 1,\r\n \"easing\": $ease.polyOut3\r\n });\r\n _this.inertiaOptions.setKey(\"resize\", {\r\n \"time\": 100,\r\n \"duration\": 500,\r\n \"factor\": 1,\r\n \"easing\": $ease.polyOut3\r\n });\r\n // Set the passive mode support\r\n _this._passiveSupported = Interaction.passiveSupported;\r\n // Apply theme\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * This is a nasty detection for Firefox. The reason why we have is that\r\n * Firefox ESR version does not support matchMedia correctly.\r\n *\r\n * On iOS, Firefox uses different userAgent, so we don't have to detect iOS.\r\n *\r\n * @return Full Firefox?\r\n */\r\n Interaction.prototype.fullFF = function () {\r\n return (window.navigator.userAgent.match(/Firefox/)) && !(window.navigator.userAgent.match(/Android/));\r\n };\r\n Interaction.prototype.debug = function () { };\r\n /**\r\n * ==========================================================================\r\n * Processing\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Sets up global events.\r\n *\r\n * We need this so that we can track drag movement beyond chart's container.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Interaction.prototype.addGlobalEvents = function () {\r\n var _this = this;\r\n if (!this._globalEventsAdded) {\r\n if (!this._useTouchEventsOnly) {\r\n this._disposers.push(addEventListener(document, this._pointerEvents.pointerdown, function (ev) { _this.handleGlobalPointerDown(ev); }));\r\n this._disposers.push(addEventListener(document, this._pointerEvents.pointermove, function (ev) { _this.handleGlobalPointerMove(ev); }));\r\n this._disposers.push(addEventListener(document, this._pointerEvents.pointerup, function (ev) { _this.handleGlobalPointerUp(ev); }));\r\n this._disposers.push(addEventListener(document, this._pointerEvents.pointercancel, function (ev) { _this.handleGlobalPointerUp(ev, true); }));\r\n this._disposers.push(addEventListener(document, \"mouseenter\", function (ev) {\r\n if (!$type.hasValue(ev.relatedTarget) && (ev.buttons == 0 || ev.which == 0)) {\r\n _this.handleDocumentLeave(ev);\r\n }\r\n }));\r\n }\r\n // No need to duplicate events for hubrid systems that support both\r\n // pointer events and touch events. Touch events are need only for\r\n // some touch-only systems, like Mobile Safari.\r\n if (!this._usePointerEventsOnly) {\r\n this._disposers.push(addEventListener(document, \"touchstart\", function (ev) { _this.handleGlobalTouchStart(ev); }));\r\n this._disposers.push(addEventListener(document, \"touchmove\", function (ev) { _this.handleGlobalTouchMove(ev); }));\r\n this._disposers.push(addEventListener(document, \"touchend\", function (ev) { _this.handleGlobalTouchEnd(ev); }));\r\n }\r\n this._disposers.push(addEventListener(document, \"keydown\", function (ev) { _this.handleGlobalKeyDown(ev); }));\r\n this._disposers.push(addEventListener(document, \"keyup\", function (ev) { _this.handleGlobalKeyUp(ev); }));\r\n this._globalEventsAdded = true;\r\n }\r\n };\r\n /**\r\n * Sets if [[InteractionObject]] is clickable.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io [[InteractionObject]] instance\r\n */\r\n Interaction.prototype.processClickable = function (io) {\r\n // Add or remove touch events\r\n this.processTouchable(io);\r\n };\r\n /**\r\n * Sets if [[InteractionObject]] will display context menu when right-clicked.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io [[InteractionObject]] instance\r\n */\r\n Interaction.prototype.processContextMenu = function (io) {\r\n if (io.contextMenuDisabled) {\r\n if (!io.eventDisposers.hasKey(\"contextMenuDisabled\")) {\r\n io.eventDisposers.setKey(\"contextMenuDisabled\", addEventListener(io.element, \"contextmenu\", function (e) {\r\n e.preventDefault();\r\n }));\r\n }\r\n }\r\n else {\r\n if (io.eventDisposers.hasKey(\"contextMenuDisabled\")) {\r\n io.eventDisposers.getKey(\"contextMenuDisabled\").dispose();\r\n }\r\n }\r\n };\r\n /**\r\n * Sets if [[InteractionObject]] is hoverable.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io [[InteractionObject]] instance\r\n */\r\n Interaction.prototype.processHoverable = function (io) {\r\n var _this = this;\r\n if (io.hoverable || io.trackable) {\r\n // Add global events\r\n this.addGlobalEvents();\r\n // Add hover styles\r\n this.applyCursorOverStyle(io);\r\n // Add local events\r\n if (!io.eventDisposers.hasKey(\"hoverable\") && this._addHoverEvents) {\r\n io.eventDisposers.setKey(\"hoverable\", new MultiDisposer([\r\n addEventListener(io.element, this._pointerEvents.pointerout, function (e) { return _this.handlePointerOut(io, e); }),\r\n addEventListener(io.element, this._pointerEvents.pointerover, function (e) { return _this.handlePointerOver(io, e); })\r\n ]));\r\n }\r\n if (io.trackable) {\r\n //sprite.addEventListener(\"touchmove\", this.handleTouchMove, false, this);\r\n }\r\n }\r\n else {\r\n var disposer = io.eventDisposers.getKey(\"hoverable\");\r\n if (disposer != null) {\r\n disposer.dispose();\r\n io.eventDisposers.removeKey(\"hoverable\");\r\n }\r\n }\r\n // Add or remove touch events\r\n this.processTouchable(io);\r\n };\r\n /**\r\n * Sets up [[InteractionObject]] as movable. Movable can be any\r\n * transformation, e.g. drag, swipe, resize, track.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n */\r\n Interaction.prototype.processMovable = function (io) {\r\n // Add unified events\r\n if (io.draggable || io.swipeable || io.trackable || io.resizable) {\r\n // Prep the element\r\n if (!this.isGlobalElement(io) && !io.isTouchProtected) {\r\n this.prepElement(io);\r\n }\r\n // Add hover styles\r\n this.applyCursorOverStyle(io);\r\n }\r\n // Add or remove touch events\r\n this.processTouchable(io);\r\n };\r\n /**\r\n * Checks if [[InteractionObject]] is trackable and sets relative events.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n */\r\n Interaction.prototype.processTrackable = function (io) {\r\n this.processHoverable(io);\r\n this.processMovable(io);\r\n if (io.trackable) {\r\n this.trackedObjects.moveValue(io);\r\n }\r\n else {\r\n this.trackedObjects.removeValue(io);\r\n }\r\n };\r\n /**\r\n * Checks if [[InteractionObject]] is draggable.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n */\r\n Interaction.prototype.processDraggable = function (io) {\r\n this.processMovable(io);\r\n };\r\n /**\r\n * Checks if [[InteractionObject]] is swipeable and sets relative events.\r\n *\r\n * A swipe event is triggered when a horizontal drag of 75px or more (and\r\n * less than 30px vertically) occurs within 700 milliseconds. This can be\r\n * overridden in sprites [[swipeOptions]].\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n */\r\n Interaction.prototype.processSwipeable = function (io) {\r\n this.processMovable(io);\r\n };\r\n /**\r\n * Checks if [[InteractionObject]] is resizable and attaches required events\r\n * to it.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n */\r\n Interaction.prototype.processResizable = function (io) {\r\n this.processMovable(io);\r\n };\r\n /**\r\n * Checks if [[InteractionObject]] is supposed to capture mouse wheel events\r\n * and prepares it to catch those events.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n */\r\n Interaction.prototype.processWheelable = function (io) {\r\n var _this = this;\r\n if (io.wheelable) {\r\n //io.hoverable = true;\r\n if (!io.eventDisposers.hasKey(\"wheelable\")) {\r\n io.eventDisposers.setKey(\"wheelable\", new MultiDisposer([\r\n addEventListener(io.element, this._pointerEvents.wheel, function (e) { return _this.handleMouseWheel(io, e); }, this._passiveSupported ? { passive: false } : false),\r\n io.events.on(\"out\", function (e) {\r\n if (io.wheelable) {\r\n _this.unlockWheel();\r\n }\r\n }),\r\n io.events.on(\"over\", function (e) {\r\n if (io.wheelable) {\r\n _this.lockWheel();\r\n }\r\n })\r\n ]));\r\n }\r\n }\r\n else {\r\n var disposer = io.eventDisposers.getKey(\"wheelable\");\r\n if (disposer != null) {\r\n disposer.dispose();\r\n io.eventDisposers.removeKey(\"wheelable\");\r\n }\r\n }\r\n };\r\n /**\r\n * Checks if [[InteractionObject]] is focusable. A focusable element is an\r\n * element that will be highlighted when users presses TAB key. If the\r\n * element is focusable, this function will attach relative focus/blur\r\n * events to it.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n */\r\n Interaction.prototype.processFocusable = function (io) {\r\n var _this = this;\r\n if (io.focusable === true && (io.tabindex > -1) && !this._useTouchEventsOnly) {\r\n if (!io.eventDisposers.hasKey(\"focusable\")) {\r\n io.eventDisposers.setKey(\"focusable\", new MultiDisposer([\r\n addEventListener(io.element, \"focus\", function (e) { return _this.handleFocus(io, e); }),\r\n addEventListener(io.element, \"blur\", function (e) { return _this.handleBlur(io, e); }),\r\n addEventListener(io.element, this._pointerEvents.pointerdown, function (e) { return _this.handleFocusBlur(io, e); }),\r\n addEventListener(io.element, \"touchstart\", function (e) { return _this.handleFocusBlur(io, e); }, this._passiveSupported ? { passive: false } : false)\r\n ]));\r\n }\r\n }\r\n else {\r\n var disposer = io.eventDisposers.getKey(\"focusable\");\r\n if (disposer != null) {\r\n disposer.dispose();\r\n io.eventDisposers.removeKey(\"focusable\");\r\n }\r\n }\r\n };\r\n /**\r\n * Checks if [[InteractionObject]] is \"touchable\". It means any interaction\r\n * whatsoever: mouse click, touch screen tap, swipe, drag, resize, etc.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n */\r\n Interaction.prototype.processTouchable = function (io) {\r\n var _this = this;\r\n // Add unified events\r\n if (io.clickable || io.hoverable || io.trackable || io.draggable || io.swipeable || io.resizable) {\r\n // Add global events\r\n this.addGlobalEvents();\r\n // Add local events\r\n if (!io.eventDisposers.hasKey(\"touchable\")) {\r\n if (!this._useTouchEventsOnly && !this._usePointerEventsOnly) {\r\n io.eventDisposers.setKey(\"touchable\", new MultiDisposer([\r\n addEventListener(io.element, this._pointerEvents.pointerdown, function (e) { return _this.handlePointerDown(io, e); }),\r\n addEventListener(io.element, \"touchstart\", function (e) { return _this.handleTouchDown(io, e); }, this._passiveSupported ? { passive: false } : false)\r\n ]));\r\n }\r\n else if (!this._useTouchEventsOnly) {\r\n io.eventDisposers.setKey(\"touchable\", addEventListener(io.element, this._pointerEvents.pointerdown, function (e) { return _this.handlePointerDown(io, e); }));\r\n }\r\n else if (!this._usePointerEventsOnly) {\r\n io.eventDisposers.setKey(\"touchable\", addEventListener(io.element, \"touchstart\", function (e) { return _this.handleTouchDown(io, e); }, this._passiveSupported ? { passive: false } : false));\r\n }\r\n }\r\n }\r\n else {\r\n var disposer = io.eventDisposers.getKey(\"touchable\");\r\n if (disposer != null) {\r\n disposer.dispose();\r\n io.eventDisposers.removeKey(\"touchable\");\r\n }\r\n }\r\n };\r\n /**\r\n * ==========================================================================\r\n * Non-pointer events\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Dispatches \"focus\" event when element gains focus.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n * @param ev Original event\r\n */\r\n Interaction.prototype.handleFocus = function (io, ev) {\r\n if (!io.focusable) {\r\n ev.preventDefault();\r\n return;\r\n }\r\n io.isFocused = true;\r\n if (io.events.isEnabled(\"focus\") && !system.isPaused) {\r\n var imev = {\r\n type: \"focus\",\r\n target: io,\r\n event: ev\r\n };\r\n io.events.dispatchImmediately(\"focus\", imev);\r\n }\r\n };\r\n /**\r\n * Used by regular click events to prevent focus if \"noFocus\" is set.\r\n *\r\n * This should not be called by \"focus\" handlers.\r\n *\r\n * @param io Element\r\n * @param ev Original event\r\n */\r\n Interaction.prototype.handleFocusBlur = function (io, ev) {\r\n if (io.focusable !== false && this.getHitOption(io, \"noFocus\")) {\r\n io.events.once(\"focus\", function () {\r\n io.events.disableType(\"blur\");\r\n $dom.blur();\r\n if (io.sprite) {\r\n io.sprite.handleBlur();\r\n }\r\n io.events.enableType(\"blur\");\r\n });\r\n }\r\n };\r\n /**\r\n * Dispatches \"blur\" event when element loses focus.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n * @param ev Original event\r\n */\r\n Interaction.prototype.handleBlur = function (io, ev) {\r\n if (!io.focusable) {\r\n ev.preventDefault();\r\n return;\r\n }\r\n io.isFocused = false;\r\n if (io.events.isEnabled(\"blur\") && !system.isPaused) {\r\n var imev = {\r\n type: \"blur\",\r\n target: io,\r\n event: ev\r\n };\r\n io.events.dispatchImmediately(\"blur\", imev);\r\n }\r\n };\r\n /**\r\n * ==========================================================================\r\n * Global keyboard-related even handlers\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Checks if there is an item that has currently focus and that they key is\r\n * one of the directional keys. If both of the conditions are true, it\r\n * creates an object to simulate movement of dragable element with keyboard.\r\n *\r\n * @ignore Exclude from docs\r\n * @param ev An original keyboard event\r\n */\r\n Interaction.prototype.handleGlobalKeyDown = function (ev) {\r\n if (this.focusedObject) {\r\n if (keyboard.isKey(ev, \"esc\")) {\r\n // ESC removes focus\r\n $dom.blur();\r\n }\r\n else if (this.focusedObject.draggable && keyboard.isKey(ev, [\"up\", \"down\", \"left\", \"right\"])) {\r\n // Prevent scrolling of the document\r\n ev.preventDefault();\r\n // Get focused object\r\n var io = this.focusedObject;\r\n // Get particular key\r\n var disposerKey = \"interactionKeyboardObject\";\r\n // If such disposer already exists we know the event is going on so we\r\n // just move on\r\n if (io.eventDisposers.hasKey(disposerKey)) {\r\n return;\r\n }\r\n // Create a keyboard mover\r\n var ko = new InteractionKeyboardObject(io, ev);\r\n io.eventDisposers.setKey(disposerKey, ko);\r\n switch (keyboard.getEventKey(ev)) {\r\n case \"up\":\r\n ko.directionY = -1;\r\n break;\r\n case \"down\":\r\n ko.directionY = 1;\r\n break;\r\n case \"left\":\r\n ko.directionX = -1;\r\n break;\r\n case \"right\":\r\n ko.directionX = 1;\r\n break;\r\n }\r\n }\r\n }\r\n };\r\n /**\r\n * Dispatches related events when the keyboard key is realeasd.\r\n *\r\n * @ignore Exclude from docs\r\n * @param ev An original keyboard event\r\n */\r\n Interaction.prototype.handleGlobalKeyUp = function (ev) {\r\n var disposerKey = \"interactionKeyboardObject\";\r\n if (this.focusedObject) {\r\n var disposer = this.focusedObject.eventDisposers.getKey(disposerKey);\r\n if (disposer != null) {\r\n // Prevent scrolling of the document\r\n ev.preventDefault();\r\n // Dispose stuff\r\n disposer.dispose();\r\n this.focusedObject.eventDisposers.removeKey(disposerKey);\r\n }\r\n // Does focused object have \"hit\" event?\r\n if (keyboard.isKey(ev, \"enter\")\r\n && this.focusedObject.sprite\r\n && !this.focusedObject.sprite.events.isEnabled(\"toggled\")) {\r\n if (this.focusedObject.sprite.events.isEnabled(\"hit\")) {\r\n this.focusedObject.dispatchImmediately(\"hit\");\r\n }\r\n else if (this.focusedObject.sprite.showTooltipOn == \"hit\") {\r\n this.focusedObject.dispatchImmediately(\"up\");\r\n }\r\n }\r\n }\r\n };\r\n /**\r\n * ==========================================================================\r\n * Global pointer-related even handlers\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Handler for a global \"pointermove\" event.\r\n *\r\n * @ignore Exclude from docs\r\n * @param ev Event object\r\n */\r\n Interaction.prototype.handleGlobalPointerMove = function (ev) {\r\n // Get pointer\r\n var pointer = this.getPointer(ev);\r\n // Update current point position\r\n pointer.point = this.getPointerPoint(ev);\r\n // Prepare and fire global event\r\n if (this.events.isEnabled(\"track\") && !system.isPaused) {\r\n var imev = {\r\n type: \"track\",\r\n target: this,\r\n event: ev,\r\n pointer: pointer,\r\n touch: pointer.touch\r\n };\r\n this.events.dispatchImmediately(\"track\", imev);\r\n }\r\n // Track\r\n this.addBreadCrumb(pointer, pointer.point);\r\n // Process further\r\n this.handleGlobalMove(pointer, ev);\r\n };\r\n /**\r\n * Handler for a global \"pointerdown\" event.\r\n *\r\n * @ignore Exclude from docs\r\n * @param ev Event object\r\n */\r\n Interaction.prototype.handleGlobalPointerDown = function (ev) {\r\n // Remove delayed hovers\r\n this.processDelayed();\r\n // Get pointer\r\n var pointer = this.getPointer(ev);\r\n // Prepare and fire global event\r\n if (this.events.isEnabled(\"down\") && !system.isPaused) {\r\n var imev = {\r\n type: \"down\",\r\n target: this,\r\n event: ev,\r\n pointer: pointer,\r\n touch: pointer.touch\r\n };\r\n this.events.dispatchImmediately(\"down\", imev);\r\n }\r\n };\r\n /**\r\n * Prevents touch action from firing.\r\n *\r\n * @ignore Exclude from docs\r\n * @param ev Event\r\n */\r\n Interaction.prototype.preventTouchAction = function (ev) {\r\n if (!ev.defaultPrevented) {\r\n ev.preventDefault();\r\n }\r\n };\r\n /**\r\n * Handler for a global \"pointerup\" event.\r\n *\r\n * @ignore Exclude from docs\r\n * @param ev Event object\r\n */\r\n Interaction.prototype.handleGlobalPointerUp = function (ev, cancelled) {\r\n if (cancelled === void 0) { cancelled = false; }\r\n // Get pointer\r\n var pointer = this.getPointer(ev);\r\n // Prepare and fire global event\r\n if (this.events.isEnabled(\"up\") && !system.isPaused) {\r\n var imev = {\r\n type: \"up\",\r\n target: this,\r\n event: ev,\r\n pointer: pointer,\r\n touch: pointer.touch\r\n };\r\n this.events.dispatchImmediately(\"up\", imev);\r\n }\r\n // Process further\r\n this.handleGlobalUp(pointer, ev, cancelled);\r\n };\r\n /**\r\n * ==========================================================================\r\n * Global touch-related even handlers\r\n * ==========================================================================\r\n */\r\n /**\r\n * Handler for a global \"touchmove\" event.\r\n *\r\n * @ignore Exclude from docs\r\n * @param ev Event object\r\n */\r\n Interaction.prototype.handleGlobalTouchMove = function (ev) {\r\n // Process each changed touch point\r\n for (var i = 0; i < ev.changedTouches.length; i++) {\r\n // Get pointer\r\n var pointer = this.getPointer(ev.changedTouches[i]);\r\n // Update current point position\r\n pointer.point = this.getPointerPoint(ev.changedTouches[i]);\r\n // Prepare and fire global event\r\n if (this.events.isEnabled(\"track\") && !system.isPaused) {\r\n var imev = {\r\n type: \"track\",\r\n target: this,\r\n event: ev,\r\n pointer: pointer,\r\n touch: pointer.touch\r\n };\r\n this.events.dispatchImmediately(\"track\", imev);\r\n }\r\n // Track\r\n this.addBreadCrumb(pointer, pointer.point);\r\n // Process further\r\n this.handleGlobalMove(pointer, ev);\r\n }\r\n };\r\n /**\r\n * Handler for a global \"touchstart\" event.\r\n *\r\n * @ignore Exclude from docs\r\n * @param ev Event object\r\n */\r\n Interaction.prototype.handleGlobalTouchStart = function (ev) {\r\n // Remove delayed hovers\r\n this.processDelayed();\r\n // Process each changed touch point\r\n for (var i = 0; i < ev.changedTouches.length; i++) {\r\n // Get pointer\r\n var pointer = this.getPointer(ev.changedTouches[i]);\r\n // Prepare and fire global event\r\n if (!this._usePointerEventsOnly && this.events.isEnabled(\"down\") && !system.isPaused) {\r\n var imev = {\r\n type: \"down\",\r\n target: this,\r\n event: ev,\r\n pointer: pointer,\r\n touch: pointer.touch\r\n };\r\n this.events.dispatchImmediately(\"down\", imev);\r\n }\r\n }\r\n };\r\n /**\r\n * Handler for a global \"touchend\" event.\r\n *\r\n * @ignore Exclude from docs\r\n * @param ev Event object\r\n */\r\n Interaction.prototype.handleGlobalTouchEnd = function (ev) {\r\n // Process each changed touch point\r\n for (var i = 0; i < ev.changedTouches.length; i++) {\r\n // Get pointer\r\n var pointer = this.getPointer(ev.changedTouches[i]);\r\n // Prepare and fire global event\r\n if (this.events.isEnabled(\"up\") && !system.isPaused) {\r\n var imev = {\r\n type: \"up\",\r\n target: this,\r\n event: ev,\r\n pointer: pointer,\r\n touch: pointer.touch\r\n };\r\n this.events.dispatchImmediately(\"up\", imev);\r\n }\r\n // Handle element-related events\r\n this.handleGlobalUp(pointer, ev);\r\n }\r\n };\r\n /**\r\n * ==========================================================================\r\n * Element-specific pointer-related even handlers\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Handles event when pointer is over [[InteractionObject]] and button is\r\n * pressed.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n * @param ev Original event\r\n */\r\n Interaction.prototype.handlePointerDown = function (io, ev) {\r\n // Stop further propagation so we don't get multiple triggers on hybrid\r\n // devices (both mouse and touch capabilities)\r\n //ev.preventDefault();\r\n //ev.stopPropagation();\r\n //if (ev.defaultPrevented) {\r\n //}\r\n // Get pointer\r\n var pointer = this.getPointer(ev);\r\n // Ignore if it's anything but mouse's primary button\r\n if (!pointer.touch && ev.which != 1 && ev.which != 3) {\r\n return;\r\n }\r\n // Set mouse button\r\n pointer.button = ev.which;\r\n // Reset pointer\r\n this.resetPointer(pointer, ev);\r\n // Process down\r\n this.handleDown(io, pointer, ev);\r\n };\r\n /**\r\n * Handles event when [[InteractionObject]] is hovered by a mouse pointer.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n * @param ev Original event\r\n */\r\n Interaction.prototype.handlePointerOver = function (io, ev) {\r\n // Get pointer\r\n var pointer = this.getPointer(ev);\r\n // Process down\r\n this.handleOver(io, pointer, ev);\r\n };\r\n /**\r\n * Handles event when [[InteractionObject]] loses hover from a mouse pointer.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n * @param ev Original event\r\n */\r\n Interaction.prototype.handlePointerOut = function (io, ev) {\r\n // Get pointer\r\n var pointer = this.getPointer(ev);\r\n // Process down\r\n this.handleOut(io, pointer, ev);\r\n };\r\n /**\r\n * Handles event when mouse wheel is crolled over the [[InteractionObject]].\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n * @param ev Original event\r\n * @todo Investigate more-cross browser stuff https://developer.mozilla.org/en-US/docs/Web/Events/wheel\r\n */\r\n Interaction.prototype.handleMouseWheel = function (io, ev) {\r\n // Get pointer\r\n var pointer = this.getPointer(ev);\r\n // Update current point position\r\n pointer.point = this.getPointerPoint(ev);\r\n // Init delta values\r\n var deltaX = 0, deltaY = 0;\r\n // Set up modifier\r\n // This is needed because FireFox reports wheel deltas in \"lines\" instead\r\n // of pixels so we have to approximate pixel value\r\n var mod = 1;\r\n if (ev.deltaMode == 1) {\r\n mod = 50;\r\n }\r\n // Adjust configurable sensitivity\r\n mod *= this.getMouseOption(io, \"sensitivity\");\r\n // Calculate deltas\r\n if (ev instanceof WheelEvent) {\r\n deltaX = Math.round((-1 * ev.wheelDeltaX) || ev.deltaX) * mod;\r\n deltaY = Math.round((-1 * ev.wheelDeltaY) || ev.deltaY) * mod;\r\n }\r\n else {\r\n throw new Error(\"Invalid event type\");\r\n }\r\n // Handle the event\r\n this.handleWheel(io, pointer, deltaX, deltaY, ev);\r\n };\r\n /**\r\n * ==========================================================================\r\n * Element-specific touch-related even handlers\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Handles an event when an [[InteractionObject]] is touched on a touch\r\n * device.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n * @param ev Original event\r\n */\r\n Interaction.prototype.handleTouchDown = function (io, ev) {\r\n // Stop further propagation so we don't get multiple triggers on hybrid\r\n // devices (both mouse and touch capabilities)\r\n //this.maybePreventDefault(io, ev);\r\n //return;\r\n // Process each changed touch point\r\n for (var i = 0; i < ev.changedTouches.length; i++) {\r\n // Get pointer\r\n var pointer = this.getPointer(ev.changedTouches[i]);\r\n this.maybePreventDefault(io, ev, pointer);\r\n // Reset pointer\r\n this.resetPointer(pointer, ev.changedTouches[i]);\r\n // Process down\r\n this.handleDown(io, pointer, ev);\r\n }\r\n };\r\n /**\r\n * ==========================================================================\r\n * Universal handlers\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Handles click/tap. Checks for doublehit.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Interaction object\r\n * @param pointer Pointer\r\n * @param ev Original event\r\n */\r\n Interaction.prototype.handleHit = function (io, pointer, ev) {\r\n // Check if this is a double-hit\r\n var now = $time.getTime();\r\n if (io.lastHit && (io.lastHit >= (now - this.getHitOption(io, \"doubleHitTime\")))) {\r\n // Yup - it's a double-hit\r\n // Cancel the hit\r\n //clearTimeout(io.lastHitPointer.hitTimeout);\r\n // If it happened too fast it probably means that hybrid device just\r\n // generated two events for the same tap\r\n if ((now - io.lastHit) < 100) {\r\n // Ignore\r\n return;\r\n }\r\n // Clear last hit\r\n io.lastHit = undefined;\r\n io.lastHitPointer = undefined;\r\n // Dispatch event\r\n if (io.events.isEnabled(\"doublehit\") && !system.isPaused) {\r\n var imev = {\r\n type: \"doublehit\",\r\n target: io,\r\n point: pointer.point,\r\n event: ev,\r\n touch: pointer.touch\r\n };\r\n io.events.dispatchImmediately(\"doublehit\", imev);\r\n }\r\n }\r\n else {\r\n // Log last hit\r\n io.lastHit = now;\r\n io.lastHitPointer = pointer;\r\n if (pointer.button === 3) {\r\n // Execute HIT now\r\n if (io.events.isEnabled(\"rightclick\") && !system.isPaused) {\r\n var imev = {\r\n type: \"rightclick\",\r\n target: io,\r\n event: ev\r\n };\r\n io.events.dispatchImmediately(\"rightclick\", imev);\r\n }\r\n }\r\n else {\r\n if (io.events.isEnabled(\"hit\") && !system.isPaused) {\r\n var imev = {\r\n type: \"hit\",\r\n target: io,\r\n event: ev,\r\n point: pointer.point,\r\n touch: pointer.touch\r\n };\r\n io.events.dispatchImmediately(\"hit\", imev);\r\n }\r\n }\r\n }\r\n };\r\n /**\r\n * Handles pointer hovering over [[InteractionObject]].\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Interaction object\r\n * @param pointer Pointer\r\n * @param ev Original event\r\n * @param soft Invoked by helper function\r\n */\r\n Interaction.prototype.handleOver = function (io, pointer, ev, soft) {\r\n if (soft === void 0) { soft = false; }\r\n if (!io.hoverable) {\r\n return;\r\n }\r\n var hoversPaused = false;\r\n if (this.shouldCancelHovers(pointer) && this.areTransformed() && this.moved(pointer, this.getHitOption(io, \"hitTolerance\"))) {\r\n hoversPaused = true;\r\n this.cancelAllHovers(ev);\r\n }\r\n // Remove any delayed outs\r\n this.processDelayed();\r\n // Add pointer\r\n io.overPointers.moveValue(pointer);\r\n // Check if object is not yet hovered\r\n if (!io.isRealHover) {\r\n // Set element as hovered\r\n if (!hoversPaused) {\r\n io.isHover = true;\r\n io.isRealHover = true;\r\n this.overObjects.moveValue(io);\r\n }\r\n // Generate body track event. This is needed so that if element loads\r\n // under unmoved mouse cursor, we still need all the actions that are\r\n // required to happen to kick in.\r\n this.handleTrack(this.body, pointer, ev, true);\r\n // Event\r\n if (io.events.isEnabled(\"over\") && !system.isPaused && !hoversPaused) {\r\n var imev = {\r\n type: \"over\",\r\n target: io,\r\n event: ev,\r\n pointer: pointer,\r\n touch: pointer.touch\r\n };\r\n io.events.dispatchImmediately(\"over\", imev);\r\n }\r\n }\r\n };\r\n /**\r\n * Handles when [[InteractionObject]] is no longer hovered.\r\n *\r\n * If `soft = true`, this means that method is being invoked by some other\r\n * code, not hard \"out\" function, like `handleUp` which implies we need to\r\n * run additional checks before unhovering the object.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Interaction object\r\n * @param pointer Pointer\r\n * @param ev Original event\r\n * @param soft Invoked by helper function\r\n * @param force Force imediate out\r\n */\r\n Interaction.prototype.handleOut = function (io, pointer, ev, soft, force) {\r\n var _this = this;\r\n if (soft === void 0) { soft = false; }\r\n if (force === void 0) { force = false; }\r\n if (!io.hoverable) {\r\n return;\r\n }\r\n // Remove pointer\r\n io.overPointers.removeValue(pointer);\r\n // Check if element is still hovered\r\n if (io.isHover && (!io.hasDelayedOut || force)) {\r\n // Should we run additional checks?\r\n if (soft && io.overPointers.length) {\r\n // There are still pointers hovering - don't do anything else and\r\n // wait until either no over pointers are there or we get a hard out\r\n // event.\r\n return;\r\n }\r\n // Should we delay \"out\" if this is happening on a touch device?\r\n if (pointer.touch && !force && !this.old(pointer)) {\r\n // This is a touch pointer, and it hasn't moved, let's pretend\r\n // the object is still hovered, and act as per \"behavior\" setting\r\n var behavior = this.getHoverOption(io, \"touchOutBehavior\");\r\n if (behavior == \"leave\") {\r\n // Set to \"leave\", so we do not execute any \"out\" event.\r\n // It will be handled by any other interaction that happens\r\n // afterwards.\r\n this._delayedEvents.out.push({\r\n type: \"out\",\r\n io: io,\r\n pointer: pointer,\r\n event: ev,\r\n keepUntil: $time.getTime() + 500\r\n });\r\n io.hasDelayedOut = true;\r\n return;\r\n }\r\n else if (behavior == \"delay\" && this.getHoverOption(io, \"touchOutDelay\")) {\r\n this._delayedEvents.out.push({\r\n type: \"out\",\r\n io: io,\r\n pointer: pointer,\r\n event: ev,\r\n keepUntil: $time.getTime() + 500,\r\n timeout: this.setTimeout(function () {\r\n _this.handleOut(io, pointer, ev, true);\r\n }, this.getHoverOption(io, \"touchOutDelay\"))\r\n });\r\n return;\r\n }\r\n else {\r\n // Nothing for \"remove\" - that's how it works \"out-of-the-box\"\r\n }\r\n }\r\n // Set element as not hovered\r\n io.isHover = false;\r\n this.overObjects.removeValue(io);\r\n // Invoke event\r\n if (!io.isDisposed() && io.events.isEnabled(\"out\") && !system.isPaused) {\r\n var imev = {\r\n type: \"out\",\r\n target: io,\r\n event: ev,\r\n pointer: pointer,\r\n touch: pointer.touch\r\n };\r\n io.events.dispatchImmediately(\"out\", imev);\r\n }\r\n // Reset object from lefover delayed outs, pointers\r\n io.overPointers.clear();\r\n io.hasDelayedOut = false;\r\n // @todo (clean delayed)\r\n }\r\n };\r\n /**\r\n * Processes dalyed events, such as \"out\" event that was initiated for\r\n * elements by touch.\r\n */\r\n Interaction.prototype.processDelayed = function () {\r\n var delayedEvent;\r\n while (true) {\r\n delayedEvent = this._delayedEvents.out.pop();\r\n if (!delayedEvent) {\r\n break;\r\n }\r\n if (delayedEvent.timeout) {\r\n delayedEvent.timeout.dispose();\r\n }\r\n this.handleOut(delayedEvent.io, delayedEvent.pointer, delayedEvent.event, false, true);\r\n }\r\n };\r\n /**\r\n * Performs tasks on pointer down.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n * @param pointer Pointer\r\n * @param ev Original event\r\n */\r\n Interaction.prototype.handleDown = function (io, pointer, ev) {\r\n // Need to prevent default event from happening on transformable objects\r\n this.maybePreventDefault(io, ev, pointer);\r\n // Stop inertia animations if they're currently being played out\r\n if (io.inert) {\r\n this.stopInertia(io);\r\n }\r\n // Trigger hover because some touch devices won't trigger over events\r\n // on their own\r\n this.handleOver(io, pointer, ev, true);\r\n // Add pointer to list\r\n io.downPointers.moveValue(pointer);\r\n // Apply styles if necessary\r\n this.applyCursorDownStyle(io, pointer);\r\n // Check if object is already down\r\n if (!io.isDown) {\r\n // Lose focus if needed\r\n if (io.focusable !== false && this.getHitOption(io, \"noFocus\") && this.focusedObject) {\r\n $dom.blur();\r\n }\r\n // Set object as hovered\r\n io.isDown = true;\r\n this.downObjects.moveValue(io);\r\n // Prep object for dragging and/or resizing\r\n if (io.draggable) {\r\n this.processDragStart(io, pointer, ev);\r\n }\r\n if (io.resizable) {\r\n this.processResizeStart(io, pointer, ev);\r\n }\r\n }\r\n // Dispatch \"down\" event\r\n if (io.events.isEnabled(\"down\") && !system.isPaused) {\r\n var imev = {\r\n type: \"down\",\r\n target: io,\r\n event: ev,\r\n pointer: pointer,\r\n touch: pointer.touch\r\n };\r\n io.events.dispatchImmediately(\"down\", imev);\r\n }\r\n };\r\n /**\r\n * Performs tasks on pointer up.\r\n *\r\n * @ignore Exclude from docs\r\n * @param pointer Pointer\r\n * @param ev Original event\r\n */\r\n Interaction.prototype.handleGlobalUp = function (pointer, ev, cancelled) {\r\n var _this = this;\r\n if (cancelled === void 0) { cancelled = false; }\r\n var sorted = this.downObjects.values.slice();\r\n sorted.sort(function (x, y) {\r\n if (x && y) {\r\n var pos = x.element.compareDocumentPosition(y.element);\r\n if (pos & Node.DOCUMENT_POSITION_CONTAINED_BY) {\r\n return 1;\r\n }\r\n else if (pos & Node.DOCUMENT_POSITION_CONTAINS) {\r\n return -1;\r\n }\r\n else {\r\n return 0;\r\n }\r\n }\r\n else {\r\n return 0;\r\n }\r\n });\r\n // Process all down objects\r\n $array.each(sorted, function (io) {\r\n // Check if this particular pointer is pressing down\r\n // on object\r\n if (io && io.downPointers.contains(pointer)) {\r\n _this.handleUp(io, pointer, ev, cancelled);\r\n }\r\n });\r\n };\r\n /**\r\n * Simulates all pointers being up once mouse leaves document area.\r\n *\r\n * @ignore Exclude from docs\r\n * @param ev Original event\r\n */\r\n Interaction.prototype.handleDocumentLeave = function (ev) {\r\n var _this = this;\r\n // Process all down objects\r\n $iter.each(this.downObjects.backwards().iterator(), function (io) {\r\n io.downPointers.each(function (pointer) {\r\n _this.handleUp(io, pointer, ev);\r\n });\r\n });\r\n };\r\n /**\r\n * Handles when [[InteractionObject]] is no longer hovered.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Interaction object\r\n * @param pointer Pointer\r\n * @param ev Original event\r\n */\r\n Interaction.prototype.handleUp = function (io, pointer, ev, cancelled) {\r\n if (cancelled === void 0) { cancelled = false; }\r\n // Restore cursor style\r\n this.restoreCursorDownStyle(io, pointer);\r\n // Remove pointer from the list\r\n io.downPointers.removeValue(pointer);\r\n // Trigger out because some touch devices won't trigger out events\r\n // on their own\r\n if (pointer.touch || this._useTouchEventsOnly) {\r\n this.handleOut(io, pointer, ev, true);\r\n }\r\n // Check if object still down\r\n if (io.isDown) {\r\n // Check if there are no other pointers hovering this element\r\n if (io.downPointers.length == 0) {\r\n // Set element as no longer down\r\n io.isDown = false;\r\n this.downObjects.removeValue(io);\r\n }\r\n // Dispatch \"up\" event\r\n if (io.events.isEnabled(\"up\") && !system.isPaused) {\r\n var imev = {\r\n type: \"up\",\r\n target: io,\r\n event: ev,\r\n pointer: pointer,\r\n touch: pointer.touch\r\n };\r\n io.events.dispatchImmediately(\"up\", imev);\r\n }\r\n // Check if this was not a cancelled event.\r\n // If event was canelled (which might happen if gesture resulted in\r\n // navigation or page scroll) there's no point in triggering hit and\r\n // other actions.\r\n if (!cancelled) {\r\n // Handle swiping-related stuff\r\n if (io.swipeable && this.swiped(io, pointer)) {\r\n // Swiped - nothing else should happen\r\n this.handleSwipe(io, pointer, ev);\r\n }\r\n else {\r\n // Check if it maybe a click\r\n if (io.clickable && !this.moved(pointer, this.getHitOption(io, \"hitTolerance\"))) {\r\n this.handleHit(io, pointer, ev);\r\n }\r\n // Handle inertia\r\n if (io.inert && this.moved(pointer, this.getHitOption(io, \"hitTolerance\"))) {\r\n this.handleInertia(io, pointer);\r\n }\r\n else if (io.draggable) {\r\n this.processDragStop(io, pointer, ev);\r\n }\r\n if (io.resizable) {\r\n this.processResizeStop(io, pointer, ev);\r\n }\r\n }\r\n }\r\n }\r\n };\r\n /**\r\n * Checks if event needs to be prevented on draggable and such items, so that\r\n * touch gestures like navigation and scroll do not kick in.\r\n *\r\n * @param io Object\r\n * @param ev Event\r\n */\r\n Interaction.prototype.maybePreventDefault = function (io, ev, pointer) {\r\n if ($type.hasValue(ev)\r\n && (io.draggable || io.swipeable || io.trackable || io.resizable)\r\n && !this.isGlobalElement(io)\r\n && ev.cancelable !== false\r\n && (!io.isTouchProtected || !pointer || !pointer.touch)) {\r\n ev.preventDefault();\r\n }\r\n };\r\n /**\r\n * Cancels all hovers on all currently hovered objects.\r\n *\r\n * @param pointer Pointer\r\n * @param ev Event\r\n */\r\n Interaction.prototype.cancelAllHovers = function (ev) {\r\n var _this = this;\r\n //this.overObjects.each((io) => {\r\n $iter.each(this.overObjects.backwards().iterator(), function (io) {\r\n if (io) {\r\n var pointer = io.overPointers.getIndex(0);\r\n _this.handleOut(io, pointer, ev, true, true);\r\n }\r\n });\r\n };\r\n /**\r\n * Checks if hovers should be cancelled on transform as per global options.\r\n * @param pointer Pointer\r\n * @return Cancel?\r\n */\r\n Interaction.prototype.shouldCancelHovers = function (pointer) {\r\n return options.disableHoverOnTransform == \"always\" || (options.disableHoverOnTransform == \"touch\" && pointer.touch);\r\n };\r\n /**\r\n * Handles pointer move.\r\n *\r\n * @ignore Exclude from docs\r\n * @param pointer Pointer\r\n * @param ev Original event\r\n */\r\n Interaction.prototype.handleGlobalMove = function (pointer, ev) {\r\n var _this = this;\r\n // Process hovered elements\r\n // We check if the element became unhovered without reporting the mouseout\r\n // event. (it happens in some cases)\r\n if (!pointer.touch) {\r\n var target_1 = $dom.eventTarget(pointer.lastEvent);\r\n $iter.each(this.overObjects.backwards().iterator(), function (io) {\r\n // Is this pointer relevant to element?\r\n if (io && io.overPointers.contains(pointer) && io.hoverable) {\r\n // Check if the element is still hovered\r\n var reset = false;\r\n if (io.element && pointer.lastEvent) {\r\n if (!$dom.contains(io.element, target_1)) {\r\n reset = true;\r\n }\r\n }\r\n else {\r\n reset = true;\r\n }\r\n if (reset) {\r\n _this.handleOut(io, pointer, ev, true);\r\n }\r\n }\r\n });\r\n }\r\n // Process down elements\r\n $iter.each(this.transformedObjects.backwards().iterator(), function (io) {\r\n // Is this pointer relevant to element?\r\n if (io.downPointers.contains(pointer) &&\r\n // Swipe still happening?\r\n !(io.swipeable && _this.swiping(io, pointer)) &&\r\n (io.draggable || io.resizable)) {\r\n _this.handleTransform(io, ev);\r\n }\r\n });\r\n // Process tracked elements\r\n $iter.each(this.trackedObjects.backwards().iterator(), function (io) {\r\n // Is this pointer relevant to element?\r\n if (!io.overPointers.contains(pointer)) {\r\n _this.handleTrack(io, pointer, ev);\r\n }\r\n });\r\n };\r\n /**\r\n * Handles reporting of pointer movement.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n * @param pointer Pointer\r\n * @param ev Original event\r\n * @param skipCheck Sould we skip check if cursor actually moved\r\n */\r\n Interaction.prototype.handleTrack = function (io, pointer, ev, skipCheck) {\r\n if (skipCheck === void 0) { skipCheck = false; }\r\n // Do nothing if the cursor did not actually move\r\n if (!skipCheck && !this.moved(pointer, 0)) {\r\n return;\r\n }\r\n // Initiate TRACK event\r\n if (io.events.isEnabled(\"track\") && !system.isPaused) {\r\n var imev = {\r\n type: \"track\",\r\n target: io,\r\n event: ev,\r\n point: pointer.point,\r\n pointer: pointer,\r\n touch: pointer.touch\r\n };\r\n io.events.dispatchImmediately(\"track\", imev);\r\n }\r\n };\r\n /**\r\n * Handles swipe action.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n * @param pointer Pointer\r\n * @param ev Original event\r\n */\r\n Interaction.prototype.handleSwipe = function (io, pointer, ev) {\r\n // We pass in InteractionEvent with shift in mouse coordinates\r\n // between when the drag started and ended\r\n if (io.events.isEnabled(\"swipe\") && !system.isPaused) {\r\n var imev = {\r\n type: \"swipe\",\r\n target: io,\r\n event: ev,\r\n touch: pointer.touch\r\n };\r\n io.events.dispatchImmediately(\"swipe\", imev);\r\n }\r\n if (pointer.startPoint.x < pointer.point.x) {\r\n if (io.events.isEnabled(\"swiperight\") && !system.isPaused) {\r\n var imev = {\r\n type: \"swiperight\",\r\n target: io,\r\n event: ev,\r\n touch: pointer.touch\r\n };\r\n io.events.dispatchImmediately(\"swiperight\", imev);\r\n }\r\n }\r\n else {\r\n if (io.events.isEnabled(\"swipeleft\") && !system.isPaused) {\r\n var imev = {\r\n type: \"swipeleft\",\r\n target: io,\r\n event: ev,\r\n touch: pointer.touch\r\n };\r\n io.events.dispatchImmediately(\"swipeleft\", imev);\r\n }\r\n }\r\n };\r\n /**\r\n * Handles event triggering for wheel rotation.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n * @param pointer Pointer\r\n * @param deltaX Horizontal shift\r\n * @param deltaY Vertical shift\r\n * @param ev Original event\r\n */\r\n Interaction.prototype.handleWheel = function (io, pointer, deltaX, deltaY, ev) {\r\n var shift = {\r\n x: deltaX,\r\n y: deltaY\r\n };\r\n // Trigger generic WHEEL event\r\n if (io.events.isEnabled(\"wheel\") && !system.isPaused) {\r\n io.events.dispatchImmediately(\"wheel\", {\r\n type: \"wheel\",\r\n target: io,\r\n event: ev,\r\n point: pointer.point,\r\n shift: shift\r\n });\r\n }\r\n // Trigger direction-specific events\r\n // Horizontal\r\n if (deltaX < 0) {\r\n if (io.events.isEnabled(\"wheelleft\") && !system.isPaused) {\r\n io.events.dispatchImmediately(\"wheelleft\", {\r\n type: \"wheelleft\",\r\n target: io,\r\n event: ev,\r\n point: pointer.point,\r\n shift: shift\r\n });\r\n }\r\n }\r\n else if (deltaX > 0) {\r\n if (io.events.isEnabled(\"swiperight\") && !system.isPaused) {\r\n io.events.dispatchImmediately(\"wheelright\", {\r\n type: \"wheelright\",\r\n target: io,\r\n event: ev,\r\n point: pointer.point,\r\n shift: shift\r\n });\r\n }\r\n // Vertical\r\n }\r\n else if (deltaY < 0) {\r\n if (io.events.isEnabled(\"wheelup\") && !system.isPaused) {\r\n io.events.dispatchImmediately(\"wheelup\", {\r\n type: \"wheelup\",\r\n target: io,\r\n event: ev,\r\n point: pointer.point,\r\n shift: shift\r\n });\r\n }\r\n }\r\n else if (deltaY > 0) {\r\n if (io.events.isEnabled(\"wheeldown\") && !system.isPaused) {\r\n io.events.dispatchImmediately(\"wheeldown\", {\r\n type: \"wheeldown\",\r\n target: io,\r\n event: ev,\r\n point: pointer.point,\r\n shift: shift\r\n });\r\n }\r\n }\r\n };\r\n /**\r\n * Initiates inertia checking sub-routines for different movement types:\r\n * drag, resize.\r\n *\r\n * @ignore Exclude from docs\r\n * @param sprite\r\n * @param pointer\r\n */\r\n Interaction.prototype.handleInertia = function (io, pointer) {\r\n if (io.draggable && io.downPointers.length === 0) {\r\n this.handleMoveInertia(io, pointer);\r\n }\r\n if (io.resizable && io.downPointers.length > 1) {\r\n this.handleResizeInertia(io, pointer);\r\n }\r\n };\r\n /**\r\n * Continues moving the element to simulate the effect of inertia. Happens\r\n * when `inert` and `draggable` object is dragged and then released.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n * @param pointer Pointer\r\n */\r\n Interaction.prototype.handleMoveInertia = function (io, pointer) {\r\n var interaction = io;\r\n var type = \"move\";\r\n var point = {\r\n \"x\": pointer.point.x,\r\n \"y\": pointer.point.y\r\n };\r\n var startPoint = {\r\n \"x\": pointer.startPoint.x,\r\n \"y\": pointer.startPoint.y\r\n };\r\n // Init inertia object\r\n var inertia = new Inertia(interaction, type, point, startPoint);\r\n // Get inertia data\r\n var ref = this.getTrailPoint(pointer, $time.getTime() - this.getInertiaOption(io, \"move\", \"time\"));\r\n if (typeof ref === \"undefined\") {\r\n this.processDragStop(io, pointer, pointer.lastUpEvent);\r\n return;\r\n }\r\n // Init animation options\r\n var factor = this.getInertiaOption(io, \"move\", \"factor\");\r\n var animationOptions = [{\r\n \"to\": pointer.point.x + (pointer.point.x - ref.point.x) * factor,\r\n \"property\": \"x\"\r\n }, {\r\n \"to\": pointer.point.y + (pointer.point.y - ref.point.y) * factor,\r\n \"property\": \"y\"\r\n }];\r\n // Start animation\r\n var animation = new Animation(inertia, animationOptions, this.getInertiaOption(io, \"move\", \"duration\"), this.getInertiaOption(io, \"move\", \"easing\")).start();\r\n this._disposers.push(animation.events.on(\"animationended\", function (ev) {\r\n inertia.done();\r\n }));\r\n // Add inertia object\r\n io.inertias.setKey(\"move\", inertia);\r\n };\r\n /**\r\n * Continues resizing of a `resizable` element after it is resized and\r\n * released.\r\n *\r\n * **NOTE:** this is is just a placeholder function. No actual fucntionality\r\n * is implemented, yet.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n * @param pointer Pointer\r\n */\r\n Interaction.prototype.handleResizeInertia = function (io, pointer) {\r\n // Some day, folks. Some day...\r\n };\r\n /**\r\n * Recalculates element's position and size based on position of\r\n * all its related pointers.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n * @param ev Original event\r\n */\r\n Interaction.prototype.handleTransform = function (io, ev) {\r\n // Get primary pointer and its respective points\r\n var pointer1 = io.downPointers.getIndex(0);\r\n var point1 = null;\r\n var startPoint1 = null;\r\n if (pointer1) {\r\n point1 = pointer1.point;\r\n startPoint1 = pointer1.startPoint;\r\n }\r\n // Init secondary pointer\r\n var pointer2;\r\n var point2;\r\n var startPoint2;\r\n // Use center of the sprite to simulate \"second\" point of touch\r\n point2 = {\r\n \"x\": io.originalPosition.x,\r\n \"y\": io.originalPosition.y\r\n };\r\n startPoint2 = point2;\r\n // Determine if it's a sinngle pointer or multi\r\n var singlePoint = true;\r\n for (var i = 1; i < io.downPointers.length; i++) {\r\n // Get pointer\r\n var nextPointer = io.downPointers.getIndex(i);\r\n // Doublecheck if it's not the same pointer by comparing original position\r\n if (startPoint1.x != nextPointer.startPoint.x && startPoint1.y != nextPointer.startPoint.y) {\r\n // Several pointers down\r\n singlePoint = false;\r\n // Get second pointer\r\n pointer2 = nextPointer;\r\n point2 = pointer2.point;\r\n startPoint2 = pointer2.startPoint;\r\n // Stop looking\r\n break;\r\n }\r\n }\r\n // Primary touch point moved?\r\n var pointer1Moved = pointer1 && this.moved(pointer1, 0);\r\n // Report DRAG_START if necessary\r\n if (io.draggable && pointer1 && pointer1.dragStartEvents && pointer1.dragStartEvents.length && pointer1Moved) {\r\n if (io.events.isEnabled(\"dragstart\") && !system.isPaused) {\r\n io.events.dispatchImmediately(\"dragstart\", pointer1.dragStartEvents.shift());\r\n }\r\n //delete pointer1.dragStartEvents;\r\n }\r\n // Determine what we do in order of superiority\r\n if (singlePoint && io.draggable) {\r\n // We have only one pointer and the Sprite is draggable\r\n // There's nothing else to be done - just move it\r\n this.handleTransformMove(io, point1, startPoint1, ev, pointer1Moved, pointer1.touch);\r\n if (this.shouldCancelHovers(pointer1) && this.moved(pointer1, this.getHitOption(io, \"hitTolerance\"))) {\r\n this.cancelAllHovers(ev);\r\n }\r\n }\r\n else {\r\n // Check if second touch point moved\r\n var pointer2Moved = pointer2 && this.moved(pointer2, 0);\r\n if ((this.shouldCancelHovers(pointer1) && this.moved(pointer1, this.getHitOption(io, \"hitTolerance\")))\r\n ||\r\n (this.shouldCancelHovers(pointer2) && this.moved(pointer2, this.getHitOption(io, \"hitTolerance\")))) {\r\n this.cancelAllHovers(ev);\r\n }\r\n if (io.draggable && io.resizable) {\r\n //this.handleTransformAll(io, point1, startPoint1, point2, startPoint2, ev, pointer1Moved && pointer2Moved);\r\n this.handleTransformMove(io, point1, startPoint1, ev, pointer1Moved && pointer2Moved, pointer1.touch);\r\n this.handleTransformResize(io, point1, startPoint1, point2, startPoint2, ev, pointer1Moved && pointer2Moved, pointer1.touch);\r\n }\r\n else {\r\n if (io.draggable) {\r\n this.handleTransformMove(io, point1, startPoint1, ev, pointer1Moved, pointer1.touch);\r\n }\r\n if (io.resizable && (!singlePoint || ev.ctrlKey)) {\r\n this.handleTransformResize(io, point1, startPoint1, point2, startPoint2, ev, pointer1Moved && pointer2Moved, pointer1.touch);\r\n }\r\n }\r\n }\r\n };\r\n /**\r\n * Handles movement of the dragged element.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n * @param point Current point of the pointer\r\n * @param startPoint Starting point of the pointer\r\n * @param ev Original event\r\n * @param pointerMoved Did pointer move?\r\n */\r\n Interaction.prototype.handleTransformMove = function (io, point, startPoint, ev, pointerMoved, touch) {\r\n if (pointerMoved) {\r\n if (io.events.isEnabled(\"drag\") && !system.isPaused && (!io.isTouchProtected || !touch)) {\r\n var imev = {\r\n type: \"drag\",\r\n target: io,\r\n event: ev,\r\n shift: {\r\n \"x\": point.x - startPoint.x,\r\n \"y\": point.y - startPoint.y\r\n },\r\n startPoint: startPoint,\r\n point: point,\r\n touch: touch\r\n };\r\n io.events.dispatchImmediately(\"drag\", imev);\r\n }\r\n }\r\n };\r\n /**\r\n * Handles resizing of the element.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n * @param point1 Current position of reference point #1\r\n * @param startPoint1 Original position of reference point #1\r\n * @param point2 Current position of reference point #2\r\n * @param startPoint2 Original position of reference point #2\r\n * @param ev Original event\r\n * @param pointerMoved Did pointer move?\r\n */\r\n Interaction.prototype.handleTransformResize = function (io, point1, startPoint1, point2, startPoint2, ev, pointerMoved, touch) {\r\n if (io.events.isEnabled(\"resize\") && !system.isPaused && (!io.isTouchProtected || !touch)) {\r\n var imev = {\r\n type: \"resize\",\r\n target: io,\r\n event: ev,\r\n scale: $math.getScale(point1, startPoint1, point2, startPoint2),\r\n startPoint1: startPoint1,\r\n point1: point1,\r\n startPoint2: startPoint2,\r\n point2: point2,\r\n touch: touch\r\n };\r\n io.events.dispatchImmediately(\"resize\", imev);\r\n }\r\n };\r\n /**\r\n * Handles all the preparations of the element when it starts to be dragged.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n * @param pointer Pointer\r\n * @param ev Original event\r\n */\r\n Interaction.prototype.processDragStart = function (io, pointer, ev) {\r\n // Add to draggedObjects\r\n this.transformedObjects.moveValue(io);\r\n if (this.shouldCancelHovers(pointer)) {\r\n this.cancelAllHovers(ev);\r\n }\r\n // Report \"dragstart\"\r\n var imev = {\r\n type: \"dragstart\",\r\n target: io,\r\n event: ev,\r\n touch: pointer ? pointer.touch : false\r\n };\r\n // Log object that we are starting to drag, so we can check against and\r\n // avoid hovers on other objects that might be in the path of movement.\r\n if (pointer) {\r\n pointer.dragTarget = io;\r\n //pointer.startPoint = pointer.point;\r\n }\r\n /**\r\n * If pointer is set we will not fire the event until the pointer has\r\n * actually moved. If it's not set we don't have to wait for anything, so we\r\n * just fire off the event right away.\r\n */\r\n if (pointer && pointer.dragStartEvents) {\r\n pointer.dragStartEvents.push(imev);\r\n }\r\n else {\r\n if (!system.isPaused) {\r\n io.dispatchImmediately(\"dragstart\", imev);\r\n }\r\n }\r\n };\r\n /**\r\n * Finishes up element drag operation.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n * @param pointer Pointer\r\n * @param ev Original event\r\n */\r\n Interaction.prototype.processDragStop = function (io, pointer, ev) {\r\n // Pointer set?\r\n if (!pointer) {\r\n pointer = this.getDragPointer(io);\r\n }\r\n // Unset drag object\r\n if (pointer) {\r\n pointer.dragTarget = undefined;\r\n }\r\n // Removed from transformedObjects\r\n this.transformedObjects.removeValue(io);\r\n // Unlock document\r\n //this.unlockDocument();\r\n // Report dragstop\r\n if (!pointer || this.moved(pointer, 0)) {\r\n if (io.events.isEnabled(\"dragstop\") && !system.isPaused) {\r\n var imev = {\r\n type: \"dragstop\",\r\n target: io,\r\n touch: pointer ? pointer.touch : false\r\n };\r\n io.events.dispatchImmediately(\"dragstop\", imev);\r\n }\r\n }\r\n };\r\n /**\r\n * Handles all the preparations of the element when it starts to be resized.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n * @param pointer Pointer\r\n * @param ev Original event\r\n */\r\n Interaction.prototype.processResizeStart = function (io, pointer, ev) {\r\n // Add to draggedObjects\r\n this.transformedObjects.moveValue(io);\r\n };\r\n /**\r\n * Finishes up element drag operation.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n * @param pointer Pointer\r\n * @param ev Original event\r\n */\r\n Interaction.prototype.processResizeStop = function (io, pointer, ev) {\r\n // Removed from transformedObjects\r\n this.transformedObjects.removeValue(io);\r\n };\r\n /**\r\n * ==========================================================================\r\n * Controls for InteractionObjects initiating directly\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Manually triggers drag start on the element. Could be useful in cases\r\n * where tracking or dragging one element can also influence dragging another\r\n * element.\r\n *\r\n * Passing in `pointer` reference is advisable. If not passed in it will try\r\n * to determine which pointer to attach to. However, it's better to specify\r\n * it explicitly.\r\n *\r\n * @param io Element\r\n * @param pointer Pointer\r\n */\r\n Interaction.prototype.dragStart = function (io, pointer) {\r\n if (!pointer) {\r\n pointer = this.getDragPointer(io);\r\n }\r\n if (pointer) {\r\n this.handleDown(io, pointer, pointer.lastDownEvent);\r\n }\r\n };\r\n /**\r\n * Manually ends drag on the element.\r\n *\r\n * @param io Element\r\n * @param pointer Pointer\r\n */\r\n Interaction.prototype.dragStop = function (io, pointer, cancelled) {\r\n if (!pointer) {\r\n pointer = this.getDragPointer(io);\r\n }\r\n if (pointer && !cancelled) {\r\n this.handleGlobalUp(pointer, pointer.lastUpEvent, cancelled);\r\n }\r\n };\r\n /**\r\n * This method uses a fuzzy logic to find the pointer to be used for dragging.\r\n * Beware that this is not a rock-solid solution. If there are a few objects\r\n * being dragged at the same time, you may get unexepected results.\r\n *\r\n * @param io InteractionObject to get pointers from\r\n * @return Pointer currently being used for dragging\r\n */\r\n Interaction.prototype.getDragPointer = function (io) {\r\n if (io) {\r\n // InteractionObject is supplied\r\n // Use it's first down pointer\r\n return io.downPointers.getIndex(0);\r\n }\r\n else if (this.transformedObjects.length) {\r\n // Use first dragged object\r\n return this.getDragPointer(this.transformedObjects.getIndex(0));\r\n }\r\n else {\r\n return undefined;\r\n }\r\n };\r\n /**\r\n * ==========================================================================\r\n * Utils\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Returns pointer id for the given event object.\r\n *\r\n * @param ev Event\r\n * @return Pointer ID\r\n */\r\n Interaction.prototype.getPointerId = function (ev) {\r\n var id = \"\";\r\n if ($type.hasValue(ev.identifier)) {\r\n id = \"\" + ev.identifier;\r\n }\r\n else if ($type.hasValue(ev.pointerId)) {\r\n id = \"\" + ev.pointerId;\r\n }\r\n else {\r\n id = \"m\";\r\n }\r\n return id.replace(\"-\", \"\");\r\n };\r\n /**\r\n * Returns a cursor position of the event.\r\n *\r\n * @param ev Original event\r\n * @return Event point\r\n */\r\n Interaction.prototype.getPointerPoint = function (ev) {\r\n return {\r\n \"x\": ev.clientX,\r\n \"y\": ev.clientY\r\n };\r\n };\r\n /**\r\n * Returns [[Pointer]] object that is associated with the Event.\r\n *\r\n * If no such [[Pointer]] object exists, it is created.\r\n *\r\n * @param ev Event\r\n * @return Pointer\r\n */\r\n Interaction.prototype.getPointer = function (ev) {\r\n // Get pointer id\r\n var id = this.getPointerId(ev);\r\n // Get current coordinates\r\n var point = this.getPointerPoint(ev);\r\n // Look for the pointer in the Dictionary if it maybe already exists\r\n var pointer;\r\n if (this.pointers.hasKey(id)) {\r\n // We already have such pointer\r\n pointer = this.pointers.getKey(id);\r\n // We need this, because Edge reuses pointer ids across touch and mouse\r\n pointer.touch = this.isPointerTouch(ev);\r\n // Reset pointer\r\n //pointer.point = point;\r\n }\r\n else {\r\n // Init pointer\r\n pointer = {\r\n \"id\": id,\r\n //\"touch\": !(ev instanceof MouseEvent) || ((<any>ev).pointerType && (<any>ev).pointerType != \"pointer\"),\r\n //\"touch\": !(ev instanceof MouseEvent) || ((<any>ev).pointerType && (<any>ev).pointerType != \"mouse\"),\r\n \"touch\": this.isPointerTouch(ev),\r\n \"startPoint\": point,\r\n \"startTime\": $time.getTime(),\r\n \"point\": point,\r\n \"track\": [],\r\n \"swipeCanceled\": false,\r\n \"dragStartEvents\": []\r\n };\r\n // Add first breadcrumb\r\n this.addBreadCrumb(pointer, point);\r\n // Add for re-use later\r\n this.pointers.setKey(id, pointer);\r\n }\r\n // Log last event\r\n pointer.lastEvent = ev;\r\n this.lastPointer = pointer;\r\n return pointer;\r\n };\r\n /**\r\n * Determines if pointer event originated from a touch pointer or mouse.\r\n *\r\n * @param ev Original event\r\n * @return Touch pointer?\r\n */\r\n Interaction.prototype.isPointerTouch = function (ev) {\r\n if (typeof Touch !== \"undefined\" && ev instanceof Touch) {\r\n return true;\r\n }\r\n else if (typeof PointerEvent !== \"undefined\" && ev instanceof PointerEvent && $type.hasValue(ev.pointerType)) {\r\n switch (ev.pointerType) {\r\n case \"touch\":\r\n case \"pen\":\r\n case 2:\r\n return true;\r\n case \"mouse\":\r\n case 4:\r\n return false;\r\n default:\r\n return !(ev instanceof MouseEvent);\r\n }\r\n }\r\n else if ($type.hasValue(ev.type)) {\r\n if (ev.type.match(/^mouse/)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n };\r\n /**\r\n * Resets the poiner to original state, i.e. cleans movement information,\r\n * starting point, etc.\r\n *\r\n * @param pointer Pointer\r\n */\r\n Interaction.prototype.resetPointer = function (pointer, ev) {\r\n // Get current coordinates\r\n var point = this.getPointerPoint(ev);\r\n ;\r\n pointer.startTime = $time.getTime();\r\n pointer.startPoint = { x: point.x, y: point.y };\r\n pointer.point = { x: point.x, y: point.y };\r\n pointer.track = [];\r\n pointer.swipeCanceled = false;\r\n //clearTimeout(pointer.swipeTimeout);\r\n //clearTimeout(pointer.holdTimeout);\r\n };\r\n /**\r\n * Adds a \"breadcrumb\" point to the [[Pointer]] to log its movement path.\r\n *\r\n * @param pointer Pointer\r\n * @param point Point coordinates\r\n */\r\n Interaction.prototype.addBreadCrumb = function (pointer, point) {\r\n pointer.track.push({\r\n \"timestamp\": $time.getTime(),\r\n \"point\": point\r\n });\r\n };\r\n /**\r\n * Prepares the document for various touch-related operations.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Interaction.prototype.lockDocument = function () {\r\n this.prepElement(this.body);\r\n };\r\n /**\r\n * Restores document functionality.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Interaction.prototype.unlockDocument = function () {\r\n if (this.transformedObjects.length == 0) {\r\n this.restoreAllStyles(this.body);\r\n }\r\n };\r\n /**\r\n * Lock element (disable all touch)\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Interaction.prototype.lockElement = function (io) {\r\n this.prepElement(io);\r\n };\r\n /**\r\n * Restores element's functionality.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Interaction.prototype.unlockElement = function (io) {\r\n this.restoreAllStyles(io);\r\n };\r\n /**\r\n * Locks document's wheel scroll.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Interaction.prototype.lockWheel = function () {\r\n window.addEventListener(this._pointerEvents.wheel, this.wheelLockEvent, this._passiveSupported ? { passive: false } : false);\r\n };\r\n /**\r\n * Unlocks document's wheel scroll.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Interaction.prototype.unlockWheel = function () {\r\n window.removeEventListener(this._pointerEvents.wheel, this.wheelLockEvent);\r\n };\r\n /**\r\n * Checks if top element at pointer's position belongs to the SVG.\r\n *\r\n * @ignore Exlude from docs\r\n * @param pointer Pointer\r\n * @param svg The <svg> element\r\n * @param id A unique identifier of the object that is checking for locality\r\n * @return Belongs to SVG\r\n */\r\n Interaction.prototype.isLocalElement = function (pointer, svg, id) {\r\n var cached = this.getCache(\"local_pointer_\" + pointer.id);\r\n if ($type.hasValue(cached)) {\r\n return cached;\r\n }\r\n var doc = ($dom.getRoot(svg) || document);\r\n if (doc.elementFromPoint) {\r\n var target = doc.elementFromPoint(pointer.point.x, pointer.point.y);\r\n var local = target && $dom.contains(svg, target);\r\n this.setCache(\"local_pointer_\" + pointer.id + \"_\" + id, local, 100);\r\n return local;\r\n }\r\n return false;\r\n };\r\n /**\r\n * A function that cancels mouse wheel scroll.\r\n *\r\n * @ignore Exclude from docs\r\n * @param ev Event object\r\n * @return Returns `false` to cancel\r\n */\r\n Interaction.prototype.wheelLockEvent = function (ev) {\r\n ev.preventDefault();\r\n return false;\r\n };\r\n /**\r\n * Applies a set of styles to an element. Stores the original styles so they\r\n * can be restored later.\r\n *\r\n * @ignore\r\n * @param io Element\r\n */\r\n Interaction.prototype.prepElement = function (io) {\r\n var el = io.element;\r\n if (el) {\r\n // Define possible props\r\n var props = [\r\n \"touchAction\", \"webkitTouchAction\", \"MozTouchAction\", \"MSTouchAction\", \"msTouchAction\", \"oTouchAction\",\r\n \"userSelect\", \"webkitUserSelect\", \"MozUserSelect\", \"MSUserSelect\", \"msUserSelect\", \"oUserSelect\",\r\n \"touchSelect\", \"webkitTouchSelect\", \"MozTouchSelect\", \"MSTouchSelect\", \"msTouchSelect\", \"oTouchSelect\",\r\n \"touchCallout\", \"webkitTouchCallout\", \"MozTouchCallout\", \"MSTouchCallout\", \"msTouchCallout\", \"oTouchCallout\",\r\n \"contentZooming\", \"webkitContentZooming\", \"MozContentZooming\", \"MSContentZooming\", \"msContentZooming\", \"oContentZooming\",\r\n \"userDrag\", \"webkitUserDrag\", \"MozUserDrag\", \"MSUserDrag\", \"msUserDrag\", \"oUserDrag\"\r\n ];\r\n for (var i = 0; i < props.length; i++) {\r\n if (props[i] in el.style) {\r\n this.setTemporaryStyle(io, props[i], \"none\");\r\n }\r\n }\r\n // Remove iOS-specific selection;\r\n this.setTemporaryStyle(io, \"tapHighlightColor\", \"rgba(0, 0, 0, 0)\");\r\n //this.setTemporaryStyle(io, \"webkitOverflowScrolling\", \"none\");\r\n }\r\n };\r\n /**\r\n * Restores replaced styles\r\n *\r\n * @ignore\r\n * @param io Element\r\n */\r\n Interaction.prototype.unprepElement = function (io) {\r\n var el = io.element;\r\n if (el) {\r\n // Define possible props\r\n var props = [\r\n \"touchAction\", \"webkitTouchAction\", \"MozTouchAction\", \"MSTouchAction\", \"msTouchAction\", \"oTouchAction\",\r\n \"userSelect\", \"webkitUserSelect\", \"MozUserSelect\", \"MSUserSelect\", \"msUserSelect\", \"oUserSelect\",\r\n \"touchSelect\", \"webkitTouchSelect\", \"MozTouchSelect\", \"MSTouchSelect\", \"msTouchSelect\", \"oTouchSelect\",\r\n \"touchCallout\", \"webkitTouchCallout\", \"MozTouchCallout\", \"MSTouchCallout\", \"msTouchCallout\", \"oTouchCallout\",\r\n \"contentZooming\", \"webkitContentZooming\", \"MozContentZooming\", \"MSContentZooming\", \"msContentZooming\", \"oContentZooming\",\r\n \"userDrag\", \"webkitUserDrag\", \"MozUserDrag\", \"MSUserDrag\", \"msUserDrag\", \"oUserDrag\"\r\n ];\r\n for (var i = 0; i < props.length; i++) {\r\n if (props[i] in el.style) {\r\n this.restoreStyle(io, props[i]);\r\n }\r\n }\r\n // Remove iOS-specific selection;\r\n this.restoreStyle(io, \"tapHighlightColor\");\r\n //this.restoreStyle(io, \"webkitOverflowScrolling\");\r\n }\r\n };\r\n /**\r\n * Returns an option associated with hit events.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n * @param option Option key\r\n * @return Option value\r\n */\r\n Interaction.prototype.getHitOption = function (io, option) {\r\n var res = io.hitOptions[option];\r\n if (typeof res === \"undefined\") {\r\n res = this.hitOptions[option];\r\n }\r\n return res;\r\n };\r\n /**\r\n * Returns an option associated with hover events.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n * @param option Option key\r\n * @return Option value\r\n */\r\n Interaction.prototype.getHoverOption = function (io, option) {\r\n var res = io.hoverOptions[option];\r\n if (typeof res === \"undefined\") {\r\n res = this.hoverOptions[option];\r\n }\r\n return res;\r\n };\r\n /**\r\n * Returns an option associated with swipe events.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n * @param option Option key\r\n * @return Option value\r\n */\r\n Interaction.prototype.getSwipeOption = function (io, option) {\r\n var res = io.swipeOptions[option];\r\n if (typeof res === \"undefined\") {\r\n res = this.swipeOptions[option];\r\n }\r\n return res;\r\n };\r\n /**\r\n * Returns an option for keyboard.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n * @param option Option key\r\n * @return Option value\r\n */\r\n Interaction.prototype.getKeyboardOption = function (io, option) {\r\n var res = io.keyboardOptions[option];\r\n if (typeof res === \"undefined\") {\r\n res = this.keyboardOptions[option];\r\n }\r\n return res;\r\n };\r\n /**\r\n * Returns an option for mouse.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n * @param option Option key\r\n * @return Option value\r\n */\r\n Interaction.prototype.getMouseOption = function (io, option) {\r\n var res = io.mouseOptions[option];\r\n if (typeof res === \"undefined\") {\r\n res = this.mouseOptions[option];\r\n }\r\n return res;\r\n };\r\n /**\r\n * Returns an option associated with inertia.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n * @param type Inertia type\r\n * @param option Option key\r\n * @return Option value\r\n */\r\n Interaction.prototype.getInertiaOption = function (io, type, option) {\r\n var options = io.inertiaOptions.getKey(type);\r\n var res;\r\n if (options && $type.hasValue(options[option])) {\r\n res = options[option];\r\n }\r\n else {\r\n res = this.inertiaOptions.getKey(type)[option];\r\n }\r\n return res;\r\n };\r\n /**\r\n * Stops currently going on inertia. Useful if inertia is currently being\r\n * animated and the object is being interacted with.\r\n *\r\n * @param io Element\r\n */\r\n Interaction.prototype.stopInertia = function (io) {\r\n var x;\r\n var inertias = [\"move\", \"resize\"];\r\n for (var i = 0; i < inertias.length; i++) {\r\n x = inertias[i];\r\n if (io.inertias.hasKey(x)) {\r\n var inertia = io.inertias.getKey(x);\r\n if (inertia) {\r\n inertia.dispose();\r\n //io.inertiaAnimations.removeKey(x);\r\n //this.processDragStop(io);\r\n continue;\r\n }\r\n }\r\n }\r\n };\r\n /**\r\n * Check if swiping is currently being performed on an object.\r\n *\r\n * @param io Element\r\n * @param pointer Pointer to check\r\n * @return `true` if swiping\r\n */\r\n Interaction.prototype.swiping = function (io, pointer) {\r\n var now = $time.getTime();\r\n if (pointer.swipeCanceled || !io.swipeable) {\r\n return false;\r\n }\r\n else if ((Math.abs(pointer.startPoint.y - pointer.point.y) < this.getSwipeOption(io, \"verticalThreshold\")) &&\r\n (pointer.startTime > (now - this.getSwipeOption(io, \"time\")))) {\r\n return true;\r\n }\r\n else {\r\n return false;\r\n }\r\n };\r\n /**\r\n * Returns `true` if a successfull swipe action was performed on an element.\r\n *\r\n * @param io Element\r\n * @param pointer Pointer\r\n * @return Swiped?\r\n */\r\n Interaction.prototype.swiped = function (io, pointer) {\r\n var now = $time.getTime();\r\n if (pointer.swipeCanceled) {\r\n return false;\r\n }\r\n else if ((Math.abs(pointer.startPoint.x - pointer.point.x) > this.getSwipeOption(io, \"horizontalThreshold\")) &&\r\n (Math.abs(pointer.startPoint.y - pointer.point.y) < this.getSwipeOption(io, \"verticalThreshold\")) &&\r\n (pointer.startTime > (now - this.getSwipeOption(io, \"time\")))) {\r\n return true;\r\n }\r\n else {\r\n return false;\r\n }\r\n };\r\n /**\r\n * Applies style to mouse cursor based on its stage in relation to\r\n * [[InteractionObject]].\r\n *\r\n * @ignore Exclude from docs\r\n * @param Element\r\n */\r\n Interaction.prototype.applyCursorOverStyle = function (io) {\r\n // Get sprite's cursor ooptions\r\n var options = io.cursorOptions;\r\n if (!$type.hasValue(options.overStyle)) {\r\n return;\r\n }\r\n // Apply cursor down styles\r\n for (var i = 0; i < options.overStyle.length; i++) {\r\n $dom.setStyle(io.element, options.overStyle[i].property, options.overStyle[i].value);\r\n }\r\n };\r\n /**\r\n * Applies style to mouse cursor based on its stage in relation to\r\n * [[InteractionObject]].\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n * @param pointer Pointer\r\n */\r\n Interaction.prototype.applyCursorDownStyle = function (io, pointer) {\r\n // Not applicable for touch pointers since they don't display a cursor\r\n if (pointer && pointer.touch) {\r\n return;\r\n }\r\n var downStyle = io.cursorOptions.downStyle;\r\n // Is down?\r\n if (io.downPointers.contains(pointer) && $type.hasValue(downStyle)) {\r\n // Apply cursor down styles\r\n for (var i = 0; i < downStyle.length; i++) {\r\n this.setTemporaryStyle(this.body, downStyle[i].property, downStyle[i].value);\r\n this.setTemporaryStyle(io, downStyle[i].property, downStyle[i].value);\r\n }\r\n }\r\n };\r\n /**\r\n * Restores original cursor style for the element.\r\n *\r\n * @ignore Exclude from docs\r\n * @param io Element\r\n * @param pointer Pointer\r\n */\r\n Interaction.prototype.restoreCursorDownStyle = function (io, pointer) {\r\n // Not applicable for touch pointers since they don't display a cursor\r\n if (pointer && pointer.touch) {\r\n return;\r\n }\r\n var downStyle = io.cursorOptions.downStyle;\r\n // Is down?\r\n if (io.downPointers.contains(pointer) && $type.hasValue(downStyle)) {\r\n // Apply cursor down styles\r\n for (var i = 0; i < downStyle.length; i++) {\r\n this.restoreStyle(this.body, downStyle[i].property);\r\n this.restoreStyle(io, downStyle[i].property);\r\n }\r\n }\r\n };\r\n /**\r\n * Sets style on the body of the document.\r\n *\r\n * @ignore Exclude from docs\r\n * @param style Style definitions\r\n */\r\n Interaction.prototype.setGlobalStyle = function (style) {\r\n var body = getInteraction().body;\r\n var styles = ($type.isArray(style) ? style : [style]);\r\n for (var i = 0; i < styles.length; i++) {\r\n this.setTemporaryStyle(body, styles[i].property, styles[i].value);\r\n }\r\n };\r\n /**\r\n * Restores style on the body of the document.\r\n *\r\n * @ignore Exclude from docs\r\n * @param style Style definitions\r\n */\r\n Interaction.prototype.restoreGlobalStyle = function (style) {\r\n var body = getInteraction().body;\r\n var styles = ($type.isArray(style) ? style : [style]);\r\n for (var i = 0; i < styles.length; i++) {\r\n this.restoreStyle(body, styles[i].property);\r\n }\r\n };\r\n /**\r\n * Checks if element is a non-cahrt element.\r\n *\r\n * @param io InteractionObject\r\n * @return Global element?\r\n */\r\n Interaction.prototype.isGlobalElement = function (io) {\r\n return document.body === io.element;\r\n };\r\n /**\r\n * Checks if pointer has moved since it was created.\r\n *\r\n * @param pointer Pointer\r\n * @param tolerance Tolerance in pixels\r\n * @param minTime Minimum time required for the pointer to be down to be considered moved\r\n * @return `true` if the pointer has moved\r\n */\r\n Interaction.prototype.moved = function (pointer, tolerance, minTime) {\r\n /*// If there was more time, we don't care if cursor actually moved\r\n let duration = $time.getTime() - pointer.startTime;\r\n if ($type.hasValue(minTime) && (minTime > duration)) {\r\n return false;\r\n }*/\r\n if (minTime === void 0) { minTime = 300; }\r\n // That was quick measure shift\r\n var shift = this.getShift(pointer);\r\n return (Math.abs(shift.x) > tolerance) || (Math.abs(shift.y) > tolerance);\r\n };\r\n /**\r\n * Returns if pointer is \"old\", meaning it has been pressing for more than\r\n * X milliseconds.\r\n *\r\n * @ignore\r\n * @param pointer Pointer\r\n * @param minTime Minimum time to consider pointer old\r\n * @return {boolean}\r\n */\r\n Interaction.prototype.old = function (pointer, minTime) {\r\n if (minTime === void 0) { minTime = 300; }\r\n return $time.getTime() - pointer.startTime > minTime;\r\n };\r\n /**\r\n * Returns total a shift in pointers coordinates between its original\r\n * position and now.\r\n *\r\n * @param pointer Pointer\r\n * @return Shift in coordinates (x/y)\r\n */\r\n Interaction.prototype.getShift = function (pointer) {\r\n return {\r\n \"x\": pointer.startPoint.x - pointer.point.x,\r\n \"y\": pointer.startPoint.y - pointer.point.y\r\n };\r\n };\r\n /**\r\n * Returns a point from [[Pointer]]'s move history at a certain timetamp.\r\n *\r\n * @param pointer Pointer\r\n * @param timestamp Timestamp\r\n * @return Point\r\n */\r\n Interaction.prototype.getTrailPoint = function (pointer, timestamp) {\r\n var res;\r\n for (var i = 0; i < pointer.track.length; i++) {\r\n if (pointer.track[i].timestamp >= timestamp) {\r\n res = pointer.track[i];\r\n break;\r\n }\r\n }\r\n return res;\r\n };\r\n /**\r\n * Checks if same pointer already exists in the list.\r\n *\r\n * @param list List to check agains\r\n * @param pointer Pointer\r\n * @return Exists?\r\n */\r\n Interaction.prototype.pointerExists = function (list, pointer) {\r\n var exists = false;\r\n list.each(function (item) {\r\n if (item == pointer) {\r\n return;\r\n }\r\n exists = item.point.x == pointer.point.x && item.point.y == pointer.point.y;\r\n });\r\n return exists;\r\n };\r\n /**\r\n * Returns an [[InteractionObject]] representation of a DOM element.\r\n *\r\n * You can use this on any HTML or SVG element, to add interactive features\r\n * to it.\r\n *\r\n * @param element Element\r\n * @return InteractionObject\r\n */\r\n Interaction.prototype.getInteraction = function (element) {\r\n return new InteractionObject(element);\r\n };\r\n /**\r\n * Sets a style property on an element. Stores original value to be restored\r\n * later with [[restoreStyle]].\r\n *\r\n * @see {@link restoreStyle}\r\n * @param io Element\r\n * @param property Property\r\n * @param value Value\r\n */\r\n Interaction.prototype.setTemporaryStyle = function (io, property, value) {\r\n // Get element\r\n //let el = io.element.tagName == \"g\" ? <SVGSVGElement>io.element.parentNode : io.element;\r\n var el = io.element;\r\n // Save original property if it is set and hasn't been saved before already\r\n if ($type.hasValue(el.style[property]) && !io.replacedStyles.hasKey(property)) {\r\n io.replacedStyles.setKey(property, el.style[property]);\r\n }\r\n // Replace with the new one\r\n $dom.setStyle(el, property, value);\r\n };\r\n /**\r\n * Restores specific style on an element.\r\n *\r\n * @param io Element\r\n * @param property Style property\r\n */\r\n Interaction.prototype.restoreStyle = function (io, property) {\r\n // Reset style\r\n if (io.replacedStyles.hasKey(property)) {\r\n io.element.style[property] = io.replacedStyles.getKey(property);\r\n io.replacedStyles.removeKey(property);\r\n }\r\n else {\r\n delete io.element.style[property];\r\n }\r\n };\r\n /**\r\n * Restore temporarily reset styles on an element.\r\n *\r\n * @param io Element\r\n */\r\n Interaction.prototype.restoreAllStyles = function (io) {\r\n $iter.each(io.replacedStyles.iterator(), function (a) {\r\n var key = a[0];\r\n var value = a[1];\r\n io.element.style[key] = value;\r\n io.replacedStyles.removeKey(key);\r\n });\r\n };\r\n /**\r\n * Disposes this object and cleans up after itself.\r\n */\r\n Interaction.prototype.dispose = function () {\r\n if (!this.isDisposed()) {\r\n _super.prototype.dispose.call(this);\r\n this.restoreAllStyles(this.body);\r\n this.unlockWheel();\r\n }\r\n };\r\n // @ts-ignore Used for debugging\r\n Interaction.prototype.log = function (text, ev, io) {\r\n var show = true;\r\n if (show) {\r\n // Touchlist?\r\n if (ev.changedTouches) {\r\n for (var i = 0; i < ev.changedTouches.length; i++) {\r\n this.logTouch(text, ev.type, ev.changedTouches[i]);\r\n }\r\n return;\r\n }\r\n // Get type\r\n var type = \"\";\r\n if (ev.pointerType) {\r\n switch (ev.pointerType) {\r\n case 2:\r\n type = \"touch\";\r\n break;\r\n case 4:\r\n type = \"mouse\";\r\n break;\r\n default:\r\n type = ev.pointerType;\r\n break;\r\n }\r\n }\r\n else if (typeof TouchEvent != \"undefined\" && ev instanceof TouchEvent) {\r\n type = \"touch\";\r\n }\r\n else if (ev.type.match(/^mouse/)) {\r\n type = \"mouse\";\r\n }\r\n else {\r\n type = \"???\";\r\n }\r\n // Get ID\r\n var id = \"\";\r\n if ($type.hasValue(ev.identifier)) {\r\n id = ev.identifier;\r\n }\r\n else if ($type.hasValue(ev.pointerId)) {\r\n id = ev.pointerId;\r\n }\r\n else {\r\n id = \"???\";\r\n }\r\n if (io) {\r\n console.log(text + \" (\" + io.uid + \") \" + ev.type + \" \" + type + \" \" + id);\r\n }\r\n else {\r\n console.log(text + \" \" + ev.type + \" \" + type + \" \" + id);\r\n }\r\n }\r\n };\r\n /**\r\n * Checks whether there are currently any objects being transformed (dragged\r\n * or resized).\r\n *\r\n * If `except` is set, that object will be ignored.\r\n *\r\n * @since 4.9.3\r\n * @param except Ignore this object(s)\r\n * @return Objects are being transformed\r\n */\r\n Interaction.prototype.areTransformed = function (except) {\r\n var count = this.transformedObjects.length;\r\n if (except) {\r\n var ex = $type.isArray(except) ? except : [except];\r\n for (var i = 0; i < ex.length; i++) {\r\n if (this.transformedObjects.contains(ex[i])) {\r\n count--;\r\n }\r\n }\r\n }\r\n return count > 0;\r\n };\r\n /**\r\n * Log.\r\n */\r\n Interaction.prototype.logTouch = function (text, type, ev) {\r\n console.log(text + \" \" + type + \" \" + \"touch\" + \" \" + ev.identifier);\r\n };\r\n Object.defineProperty(Interaction, \"passiveSupported\", {\r\n /**\r\n * Indicates if passive mode options is supported by this browser.\r\n */\r\n get: function () {\r\n var _this = this;\r\n if (this._passiveSupported == null) {\r\n // Check for passive mode support\r\n try {\r\n var options_1 = Object.defineProperty({}, \"passive\", {\r\n get: function () {\r\n _this._passiveSupported = true;\r\n }\r\n });\r\n window.addEventListener(\"test\", options_1, options_1);\r\n window.removeEventListener(\"test\", options_1, options_1);\r\n }\r\n catch (err) {\r\n this._passiveSupported = false;\r\n }\r\n }\r\n return this._passiveSupported;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return Interaction;\r\n}(BaseObjectEvents));\r\nexport { Interaction };\r\nvar interaction = null;\r\n/**\r\n * Returns a single unified global instance of [[Interaction]].\r\n *\r\n * All code should use this function, rather than create their own instances\r\n * of [[Interaction]].\r\n */\r\nexport function getInteraction() {\r\n if (interaction == null) {\r\n interaction = new Interaction();\r\n }\r\n return interaction;\r\n}\r\n","/**\r\n * Functionality related simulating of dragging of elements using keyboard.\r\n */\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { getInteraction } from \"./Interaction\";\r\nimport { system } from \"../System\";\r\nimport * as $array from \"../utils/Array\";\r\n/**\r\n * [[InteractionKeyboardObject]] is used to simulate dragging of the `draggable`\r\n * element using keyboard arrows.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\nvar InteractionKeyboardObject = /** @class */ (function () {\r\n /**\r\n * Constructor.\r\n *\r\n * @param io An InteractionObject\r\n */\r\n function InteractionKeyboardObject(io, ev) {\r\n /**\r\n * Indicates if this object has already been deleted. Any\r\n * destruction/disposal code should take this into account when deciding\r\n * wheter to run potentially costly disposal operations if they already have\r\n * been run.\r\n */\r\n this._disposed = false;\r\n /**\r\n * Indicates direction of current horizontal movement.\r\n *\r\n * 0 - not moving horizontally\r\n * 1 - moving right\r\n * -1 - moving left\r\n */\r\n this.directionX = 0;\r\n /**\r\n * Indicates direction of current vertical movement.\r\n *\r\n * 0 - not moving vertically\r\n * 1 - moving down\r\n * -1 - moving up\r\n */\r\n this.directionY = 0;\r\n this.interaction = io;\r\n this.keyboardEvent = ev;\r\n this._startedOn = new Date().getTime();\r\n getInteraction().processDragStart(io);\r\n system.animations.push(this);\r\n this.update();\r\n }\r\n /**\r\n * It's an update method which is called by the system if\r\n * [[InteractionObject]] is used as animation.\r\n *\r\n * This will update coordinates of the element based on the movement\r\n * directions.\r\n */\r\n InteractionKeyboardObject.prototype.update = function () {\r\n // Init and get settings\r\n var io = this.interaction;\r\n var speed = getInteraction().getKeyboardOption(io, \"speed\"), accelleration = getInteraction().getKeyboardOption(io, \"accelleration\"), accellerationDelay = getInteraction().getKeyboardOption(io, \"accellerationDelay\"), shift = {\r\n x: 0,\r\n y: 0\r\n };\r\n // If SHIFT key is pressed we slash speed by half and disable accelleration\r\n if (this.keyboardEvent.shiftKey) {\r\n speed *= 0.5;\r\n accelleration = 1;\r\n }\r\n // If CTRL is pressed we increase speed by x2\r\n else if (this.keyboardEvent.ctrlKey) {\r\n speed *= 2;\r\n }\r\n // Get elapsed time\r\n var ms = new Date().getTime() - this._startedOn;\r\n var accelleratedMs = ms - accellerationDelay;\r\n // Add accellerated movement\r\n if ((accelleration > 0) && (accelleratedMs > 0)) {\r\n var accellerationFactor = ms / accellerationDelay;\r\n ms = accellerationDelay;\r\n shift.x += this.directionX * (speed * accelleration * accellerationFactor * accelleratedMs);\r\n shift.y += this.directionY * (speed * accelleration * accellerationFactor * accelleratedMs);\r\n }\r\n // Calculate position\r\n shift.x += this.directionX * (speed * ms);\r\n shift.y += this.directionY * (speed * ms);\r\n // Simulate move on Interaction\r\n getInteraction().handleTransformMove(io, shift, { x: 0, y: 0 }, this.keyboardEvent, true, false);\r\n };\r\n /**\r\n * Returns if this object has been already been disposed.\r\n *\r\n * @return Is disposed?\r\n */\r\n InteractionKeyboardObject.prototype.isDisposed = function () {\r\n return this._disposed;\r\n };\r\n /**\r\n * Disposes this object. Removes from system animations.\r\n */\r\n InteractionKeyboardObject.prototype.dispose = function () {\r\n if (!this._disposed) {\r\n getInteraction().processDragStop(this.interaction);\r\n $array.remove(system.animations, this);\r\n }\r\n };\r\n return InteractionKeyboardObject;\r\n}());\r\nexport { InteractionKeyboardObject };\r\n","/**\r\n * Interaction Object module\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { InteractionObjectEventDispatcher } from \"./InteractionObjectEvents\";\r\nimport { BaseObjectEvents } from \"../Base\";\r\nimport { List } from \"../utils/List\";\r\nimport { Dictionary, DictionaryDisposer } from \"../utils/Dictionary\";\r\nimport { getInteraction } from \"./Interaction\";\r\nimport * as $type from \"../utils/Type\";\r\n/**\r\n * Re-exports\r\n */\r\nexport { InteractionObjectEventDispatcher };\r\n/**\r\n * Interaction object represents an object that is subject for any kind of\r\n * interaction with it with any input devices: mouse, touch or keyboard.\r\n *\r\n * Any DOM element can be wrapped into an Internaction object which in turn\r\n * enables attaching various interaction events to it, such as: hit, drag,\r\n * swipe, etc.\r\n *\r\n * To create an [[InteractionObject]] out of a [[Sprite]], use:\r\n * `interaction.getInteractionFromSprite(sprite: Sprite)`\r\n *\r\n * To create an [[InteractionObject]] out of a a regular element:\r\n * `interaction.getInteraction(element: HTMLElement)`\r\n */\r\nvar InteractionObject = /** @class */ (function (_super) {\r\n __extends(InteractionObject, _super);\r\n /**\r\n * Constructor\r\n */\r\n function InteractionObject(element) {\r\n var _this = _super.call(this) || this;\r\n /**\r\n * @ignore\r\n * An [[EventDispatcher]] instance which holds events for this object\r\n */\r\n _this._eventDispatcher = new InteractionObjectEventDispatcher(_this);\r\n /**\r\n * Collection of Disposers for various events. (so that those get disposed\r\n * when the whole InteractionObject is disposed)\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this.eventDisposers = new Dictionary();\r\n /**\r\n * A [[Dictionary]] that holds temporarily replaced original style values for\r\n * HTML element, so that they can be restored when the functionality that\r\n * replaced them is done.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this.replacedStyles = new Dictionary();\r\n _this._clickable = false;\r\n _this._contextMenuDisabled = false;\r\n _this._hoverable = false;\r\n _this._trackable = false;\r\n _this._draggable = false;\r\n _this._swipeable = false;\r\n _this._resizable = false;\r\n _this._wheelable = false;\r\n _this._inert = false;\r\n /**\r\n * Is element currently hovered?\r\n */\r\n _this._isHover = false;\r\n /**\r\n * Was this element hovered via pointer or is it just \"pretenting\" to be\r\n * hovered.\r\n *\r\n * @ignore\r\n */\r\n _this.isRealHover = false;\r\n /**\r\n * Is the element hovered by touch pointer?\r\n */\r\n _this._isHoverByTouch = false;\r\n /**\r\n * Has element got any pointers currently pressing down on it?\r\n */\r\n _this._isDown = false;\r\n /**\r\n * Does element have focus?\r\n */\r\n _this._isFocused = false;\r\n /**\r\n * Is element currently protected from touch interactions?\r\n */\r\n _this._isTouchProtected = false;\r\n /**\r\n * Options used for inertia functionality.\r\n */\r\n _this._inertiaOptions = new Dictionary();\r\n /**\r\n * A collection of different inertia types, currently playing out.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n _this.inertias = new Dictionary();\r\n /**\r\n * Click/tap options.\r\n */\r\n _this._hitOptions = {};\r\n /**\r\n * Hover options.\r\n */\r\n _this._hoverOptions = {};\r\n /**\r\n * Swipe gesture options.\r\n */\r\n _this._swipeOptions = {};\r\n /**\r\n * Keyboard options.\r\n */\r\n _this._keyboardOptions = {};\r\n /**\r\n * Mouse options.\r\n */\r\n _this._mouseOptions = {};\r\n /**\r\n * Cursor options.\r\n */\r\n _this._cursorOptions = {\r\n \"defaultStyle\": [{\r\n \"property\": \"cursor\",\r\n \"value\": \"default\"\r\n }]\r\n };\r\n _this._disposers.push(_this._eventDispatcher);\r\n _this._element = element;\r\n _this.className = \"InteractionObject\";\r\n _this._disposers.push(new DictionaryDisposer(_this.inertias));\r\n _this._disposers.push(new DictionaryDisposer(_this.eventDisposers));\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n ;\r\n Object.defineProperty(InteractionObject.prototype, \"events\", {\r\n /**\r\n * An [[EventDispatcher]] instance which holds events for this object\r\n */\r\n get: function () {\r\n return this._eventDispatcher;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"isHover\", {\r\n /**\r\n * @return Hovered?\r\n */\r\n get: function () {\r\n return this._isHover;\r\n },\r\n /**\r\n * Indicates if this element is currently hovered.\r\n *\r\n * @param value Hovered?\r\n */\r\n set: function (value) {\r\n if (this.isHover != value) {\r\n this._isHover = value;\r\n if (value) {\r\n getInteraction().overObjects.moveValue(this);\r\n }\r\n else {\r\n this.isRealHover = false;\r\n getInteraction().overObjects.removeValue(this);\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"isHoverByTouch\", {\r\n /**\r\n * @return Hovered?\r\n */\r\n get: function () {\r\n return this._isHoverByTouch;\r\n },\r\n /**\r\n * Indicates if this element is currently hovered.\r\n *\r\n * @param value Hovered?\r\n */\r\n set: function (value) {\r\n if (this.isHoverByTouch != value) {\r\n this._isHoverByTouch = value;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"overPointers\", {\r\n /**\r\n * A list of pointers currently over the element.\r\n *\r\n * @see {@link Pointer}\r\n * @return List if pointers currently hovering the element\r\n */\r\n get: function () {\r\n if (!this._overPointers) {\r\n this._overPointers = new List();\r\n }\r\n return this._overPointers;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"isDown\", {\r\n /**\r\n * @return Has down pointers?\r\n */\r\n get: function () {\r\n return this._isDown;\r\n },\r\n /**\r\n * Indicates if this element has currently any pointers pressing on it.\r\n *\r\n * @param value Has down pointers?\r\n */\r\n set: function (value) {\r\n if (this.isDown != value) {\r\n this._isDown = value;\r\n if (value) {\r\n getInteraction().downObjects.moveValue(this);\r\n }\r\n else {\r\n getInteraction().downObjects.removeValue(this);\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"downPointers\", {\r\n /**\r\n * A list of pointers currently pressing down on this element.\r\n *\r\n * @see {@link Pointer}\r\n * @return List of down pointers\r\n */\r\n get: function () {\r\n if (!this._downPointers) {\r\n this._downPointers = new List();\r\n }\r\n return this._downPointers;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"isFocused\", {\r\n /**\r\n * @return Focused?\r\n */\r\n get: function () {\r\n return this._isFocused;\r\n },\r\n /**\r\n * Indicates if this element is currently focused.\r\n *\r\n * @param value Focused?\r\n */\r\n set: function (value) {\r\n if (this.isFocused != value) {\r\n this._isFocused = value;\r\n if (value) {\r\n getInteraction().focusedObject = this;\r\n }\r\n else {\r\n getInteraction().focusedObject = undefined;\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"isTouchProtected\", {\r\n /**\r\n * @ignore\r\n * @return Touch protected?\r\n */\r\n get: function () {\r\n return this._isTouchProtected;\r\n },\r\n /**\r\n * Indicates if this element is currently being protected from touch actions.\r\n *\r\n * @ignore\r\n * @param value Touch protected?\r\n */\r\n set: function (value) {\r\n if (this._isTouchProtected != value) {\r\n this._isTouchProtected = value;\r\n if (value) {\r\n getInteraction().unprepElement(this);\r\n }\r\n else if (this.draggable || this.swipeable || this.trackable || this.resizable) {\r\n getInteraction().prepElement(this);\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"clickable\", {\r\n /**\r\n * @return Clickable?\r\n */\r\n get: function () {\r\n return this._clickable;\r\n },\r\n /**\r\n * Is element clickable? Clickable elements will generate \"hit\" events when\r\n * clicked or tapped.\r\n *\r\n * @param value Clickable?\r\n */\r\n set: function (value) {\r\n if (this._clickable !== value) {\r\n this._clickable = value;\r\n getInteraction().processClickable(this);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"contextMenuDisabled\", {\r\n /**\r\n * @return Context menu disabled?\r\n */\r\n get: function () {\r\n return this._contextMenuDisabled;\r\n },\r\n /**\r\n * Should element prevent context menu to be displayed, e.g. when\r\n * right-clicked?\r\n *\r\n * @default false\r\n * @param value Context menu disabled?\r\n */\r\n set: function (value) {\r\n if (this._contextMenuDisabled !== value) {\r\n this._contextMenuDisabled = value;\r\n getInteraction().processContextMenu(this);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"hoverable\", {\r\n /**\r\n * @return Hoverable?\r\n */\r\n get: function () {\r\n return this._hoverable;\r\n },\r\n /**\r\n * Indicates if element should generate hover events.\r\n *\r\n * @param value Hoverable?\r\n */\r\n set: function (value) {\r\n if (this._hoverable !== value) {\r\n this._hoverable = value;\r\n getInteraction().processHoverable(this);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"trackable\", {\r\n /**\r\n * @return Track pointer?\r\n */\r\n get: function () {\r\n return this._trackable;\r\n },\r\n /**\r\n * Indicates if pointer movement over element should be tracked.\r\n *\r\n * @param value Track pointer?\r\n */\r\n set: function (value) {\r\n if (this._trackable !== value) {\r\n this._trackable = value;\r\n getInteraction().processTrackable(this);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"draggable\", {\r\n /**\r\n * @return Draggable?\r\n */\r\n get: function () {\r\n return this._draggable;\r\n },\r\n /**\r\n * Indicates if element can be dragged. (moved)\r\n *\r\n * @param value Draggable?\r\n */\r\n set: function (value) {\r\n if (this._draggable !== value) {\r\n this._draggable = value;\r\n getInteraction().processDraggable(this);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"swipeable\", {\r\n /**\r\n * @return Track swipe?\r\n */\r\n get: function () {\r\n return this._swipeable;\r\n },\r\n /**\r\n * Indicates whether element should react to swipe gesture.\r\n *\r\n * @param value Track swipe?\r\n */\r\n set: function (value) {\r\n if (this._swipeable !== value) {\r\n this._swipeable = value;\r\n getInteraction().processSwipeable(this);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"resizable\", {\r\n /**\r\n * @return Resizeble?\r\n */\r\n get: function () {\r\n return this._resizable;\r\n },\r\n /**\r\n * Indicates if element can be resized.\r\n *\r\n * @param value Resizeable?\r\n */\r\n set: function (value) {\r\n if (this._resizable !== value) {\r\n this._resizable = value;\r\n getInteraction().processResizable(this);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"wheelable\", {\r\n /**\r\n * @return Track wheel?\r\n */\r\n get: function () {\r\n return this._wheelable;\r\n },\r\n /**\r\n * Indicates whether track moouse wheel rotation over element.\r\n *\r\n * @param value Track wheel?\r\n */\r\n set: function (value) {\r\n if (this._wheelable !== value) {\r\n this._wheelable = value;\r\n getInteraction().processWheelable(this);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"inert\", {\r\n /**\r\n * @return Inert?\r\n */\r\n get: function () {\r\n return this._inert;\r\n },\r\n /**\r\n * Indicates if element is inert, i.e. if it should carry movement momentum\r\n * after it is dragged and released.\r\n *\r\n * @param value Inert?\r\n */\r\n set: function (value) {\r\n if (this._inert !== value) {\r\n this._inert = value;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"focusable\", {\r\n /**\r\n * @return Focusable?\r\n */\r\n get: function () {\r\n return this._focusable;\r\n },\r\n /**\r\n * Indicates if element can gain focus.\r\n *\r\n * @param value Focusable?\r\n */\r\n set: function (value) {\r\n if (this._focusable !== value) {\r\n this._focusable = value;\r\n if (this._focusable && this.tabindex == -1) {\r\n this._tabindex = 1;\r\n }\r\n getInteraction().processFocusable(this);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"tabindex\", {\r\n /**\r\n * @return Tab index\r\n */\r\n get: function () {\r\n return $type.getValueDefault(this._tabindex, -1);\r\n },\r\n /**\r\n * Element's tab index.\r\n *\r\n * @param value Tab index\r\n */\r\n set: function (value) {\r\n if (this._tabindex !== value) {\r\n this._tabindex = value;\r\n if (value > -1) {\r\n this.focusable = true;\r\n }\r\n getInteraction().processFocusable(this);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"element\", {\r\n /**\r\n * @return Element\r\n */\r\n get: function () {\r\n return this._element;\r\n },\r\n /**\r\n * A DOM element associated with this element.\r\n *\r\n * @param element Element\r\n */\r\n set: function (element) {\r\n this._element = element;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"originalPosition\", {\r\n /**\r\n * @ignore Exclude from docs\r\n * @return Position.\r\n */\r\n get: function () {\r\n return this._originalPosition || { x: 0, y: 0 };\r\n },\r\n /**\r\n * Element's original position.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Position\r\n */\r\n set: function (value) {\r\n this._originalPosition = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"originalScale\", {\r\n /**\r\n * @return Scale\r\n */\r\n get: function () {\r\n return $type.getValueDefault(this._originalScale, 1);\r\n },\r\n /**\r\n * Element's original scale.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Scale\r\n */\r\n set: function (value) {\r\n if (this._originalScale !== value) {\r\n this._originalScale = value;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"originalAngle\", {\r\n /**\r\n * @return Angle\r\n */\r\n get: function () {\r\n return $type.getValueDefault(this._originalAngle, 0);\r\n },\r\n /**\r\n * Element's original angle.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Angle\r\n */\r\n set: function (value) {\r\n if (this._originalAngle !== value) {\r\n this._originalAngle = value;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"inertiaOptions\", {\r\n /**\r\n * @return Options\r\n */\r\n get: function () {\r\n if (this.sprite && this.sprite._adapterO) {\r\n return this.sprite._adapterO.apply(\"inertiaOptions\", this._inertiaOptions);\r\n }\r\n else {\r\n return this._inertiaOptions;\r\n }\r\n },\r\n /**\r\n * Inertia options.\r\n *\r\n * @param value Options\r\n */\r\n set: function (value) {\r\n this._inertiaOptions = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"hitOptions\", {\r\n /**\r\n * @return Options\r\n */\r\n get: function () {\r\n if (this.sprite && this.sprite._adapterO) {\r\n return this.sprite._adapterO.apply(\"hitOptions\", this._hitOptions);\r\n }\r\n else {\r\n return this._hitOptions;\r\n }\r\n },\r\n /**\r\n * Hit options.\r\n *\r\n * @param value Options\r\n */\r\n set: function (value) {\r\n this._hitOptions = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"hoverOptions\", {\r\n /**\r\n * @return Options\r\n */\r\n get: function () {\r\n if (this.sprite && this.sprite._adapterO) {\r\n return this.sprite._adapterO.apply(\"hoverOptions\", this._hoverOptions);\r\n }\r\n else {\r\n return this._hoverOptions;\r\n }\r\n },\r\n /**\r\n * Hover options.\r\n *\r\n * @param value Options\r\n */\r\n set: function (value) {\r\n this._hoverOptions = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"swipeOptions\", {\r\n /**\r\n * @return Options\r\n */\r\n get: function () {\r\n if (this.sprite && this.sprite._adapterO) {\r\n return this.sprite._adapterO.apply(\"swipeOptions\", this._swipeOptions);\r\n }\r\n else {\r\n return this._swipeOptions;\r\n }\r\n },\r\n /**\r\n * Swipe options.\r\n *\r\n * @param value Options\r\n */\r\n set: function (value) {\r\n this._swipeOptions = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"keyboardOptions\", {\r\n /**\r\n * @return Options\r\n */\r\n get: function () {\r\n if (this.sprite && this.sprite._adapterO) {\r\n return this.sprite._adapterO.apply(\"keyboardOptions\", this._keyboardOptions);\r\n }\r\n else {\r\n return this._keyboardOptions;\r\n }\r\n },\r\n /**\r\n * Keyboard options.\r\n *\r\n * @param value Options\r\n */\r\n set: function (value) {\r\n this._keyboardOptions = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"mouseOptions\", {\r\n /**\r\n * @return Options\r\n */\r\n get: function () {\r\n if (this.sprite && this.sprite._adapterO) {\r\n return this.sprite._adapterO.apply(\"mouseOptions\", this._mouseOptions);\r\n }\r\n else {\r\n return this._mouseOptions;\r\n }\r\n },\r\n /**\r\n * Mouse options.\r\n *\r\n * Enables controlling options related to the mouse, for example sensitivity\r\n * of its mouse wheel.\r\n *\r\n * E.g. the below will reduce chart's wheel-zoom speed to half its default\r\n * speed:\r\n *\r\n * ```TypeScript\r\n * chart.plotContainer.mouseOptions.sensitivity = 0.5;\r\n * ```\r\n * ```JavaScript\r\n * chart.plotContainer.mouseOptions.sensitivity = 0.5;\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"plotContainer\": {\r\n * \"mouseOptions\": {\r\n * \"sensitivity\": 0.5\r\n * }\r\n * }\r\n * }\r\n * ```\r\n *\r\n * @since 4.5.14\r\n * @param value Options\r\n */\r\n set: function (value) {\r\n this._mouseOptions = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InteractionObject.prototype, \"cursorOptions\", {\r\n /**\r\n * @return Options\r\n */\r\n get: function () {\r\n if (this.sprite && this.sprite._adapterO) {\r\n return this.sprite._adapterO.apply(\"cursorOptions\", this._cursorOptions);\r\n }\r\n else {\r\n return this._cursorOptions;\r\n }\r\n },\r\n /**\r\n * Cursor options.\r\n *\r\n * @param value Options\r\n */\r\n set: function (value) {\r\n this._cursorOptions = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Copies all properties and related assets from another object of the same\r\n * type.\r\n *\r\n * @param source Source object\r\n */\r\n InteractionObject.prototype.copyFrom = function (source) {\r\n _super.prototype.copyFrom.call(this, source);\r\n this.inertiaOptions = source.inertiaOptions;\r\n this.hitOptions = source.hitOptions;\r\n this.hoverOptions = source.hoverOptions;\r\n this.swipeOptions = source.swipeOptions;\r\n this.keyboardOptions = source.keyboardOptions;\r\n this.cursorOptions = source.cursorOptions;\r\n this.contextMenuDisabled = source.contextMenuDisabled;\r\n getInteraction().applyCursorOverStyle(this);\r\n };\r\n /**\r\n * @ignore Exclude from docs\r\n */\r\n InteractionObject.prototype.setEventDisposer = function (key, value, f) {\r\n var disposer = this.eventDisposers.getKey(key);\r\n if (value) {\r\n if (disposer == null) {\r\n this.eventDisposers.setKey(key, f());\r\n }\r\n }\r\n else {\r\n if (disposer != null) {\r\n disposer.dispose();\r\n this.eventDisposers.removeKey(key);\r\n }\r\n }\r\n };\r\n /**\r\n * Disposes object.\r\n */\r\n InteractionObject.prototype.dispose = function () {\r\n _super.prototype.dispose.call(this);\r\n // Remove from all interaction registries\r\n var interaction = getInteraction();\r\n interaction.overObjects.removeValue(this);\r\n interaction.downObjects.removeValue(this);\r\n interaction.trackedObjects.removeValue(this);\r\n interaction.transformedObjects.removeValue(this);\r\n // Unlock document wheel\r\n if (this.isHover && this.wheelable) {\r\n interaction.unlockWheel();\r\n }\r\n if (interaction.focusedObject === this) {\r\n interaction.focusedObject = undefined;\r\n }\r\n };\r\n return InteractionObject;\r\n}(BaseObjectEvents));\r\nexport { InteractionObject };\r\n","import { __extends } from \"tslib\";\r\nimport { TargetedEventDispatcher } from \"../utils/EventDispatcher\";\r\nimport { MultiDisposer, CounterDisposer } from \"../utils/Disposer\";\r\n/**\r\n * Represents an Event Dispatcher for [[InteractionObject]].\r\n *\r\n * Besides regular [[EventDispatcher]] functionality it adds new events with\r\n * direct application to DOM nodes. Primarily used to handle keyboard events,\r\n * but can turn into something else moving forward.\r\n */\r\nvar InteractionObjectEventDispatcher = /** @class */ (function (_super) {\r\n __extends(InteractionObjectEventDispatcher, _super);\r\n function InteractionObjectEventDispatcher() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n /**\r\n * Holds a list of Disposers for DOM events added.\r\n */\r\n _this._domEvents = {};\r\n return _this;\r\n }\r\n /**\r\n * Adds a DOM event and returns Disposer.\r\n *\r\n * @return Disposer\r\n */\r\n InteractionObjectEventDispatcher.prototype._addDOMEvent = function (type, key, listener, context) {\r\n var _this = this;\r\n if (!this._domEvents[type]) {\r\n var callback_1 = function (e) {\r\n listener.call(context, key, e);\r\n };\r\n this.target.element.addEventListener(type, callback_1, false);\r\n this._domEvents[type] = new CounterDisposer(function () {\r\n delete _this._domEvents[type];\r\n _this.target.element.removeEventListener(type, callback_1, false);\r\n });\r\n }\r\n return this._domEvents[type].increment();\r\n };\r\n InteractionObjectEventDispatcher.prototype._dispatchKeyboardEvent = function (key, ev) {\r\n // TODO use this.dispatchImmediately ?\r\n if (this.target.events.isEnabled(key)) {\r\n this.target.events.dispatchImmediately(key, {\r\n type: key,\r\n target: this.target,\r\n event: ev\r\n });\r\n }\r\n };\r\n InteractionObjectEventDispatcher.prototype._on = function (once, type, callback, context, shouldClone, dispatch) {\r\n var info = _super.prototype._on.call(this, once, type, callback, context, shouldClone, dispatch);\r\n var disposers = [info.disposer];\r\n switch (type) {\r\n case \"hit\":\r\n case \"doublehit\":\r\n case \"rightclick\":\r\n case \"down\":\r\n case \"up\":\r\n this.target.clickable = true;\r\n break;\r\n case \"drag\":\r\n case \"dragstart\":\r\n case \"dragstop\":\r\n this.target.draggable = true;\r\n break;\r\n case \"track\":\r\n this.target.trackable = true;\r\n break;\r\n case \"resize\":\r\n this.target.resizable = true;\r\n break;\r\n case \"swipe\":\r\n case \"swipeleft\":\r\n case \"swiperight\":\r\n this.target.swipeable = true;\r\n break;\r\n case \"wheel\":\r\n case \"wheelup\":\r\n case \"wheeldown\":\r\n case \"wheelleft\":\r\n case \"wheelright\":\r\n this.target.wheelable = true;\r\n break;\r\n case \"over\":\r\n case \"out\":\r\n this.target.hoverable = true;\r\n break;\r\n case \"focus\":\r\n case \"blur\":\r\n case \"focusin\":\r\n case \"focusout\":\r\n this.target.focusable = true;\r\n break;\r\n case \"keydown\":\r\n disposers.push(this._addDOMEvent(type, type, this._dispatchKeyboardEvent, this));\r\n break;\r\n case \"keyup\":\r\n disposers.push(this._addDOMEvent(type, type, this._dispatchKeyboardEvent, this));\r\n break;\r\n case \"keypress\":\r\n disposers.push(this._addDOMEvent(type, type, this._dispatchKeyboardEvent, this));\r\n break;\r\n case \"input\":\r\n disposers.push(this._addDOMEvent(type, type, this._dispatchKeyboardEvent, this));\r\n break;\r\n }\r\n info.disposer = new MultiDisposer(disposers);\r\n return info;\r\n };\r\n return InteractionObjectEventDispatcher;\r\n}(TargetedEventDispatcher));\r\nexport { InteractionObjectEventDispatcher };\r\n","/**\r\n * Mouse-related functionality\r\n */\r\n/**\r\n * Defines static methods that hold style list for various mouse cursor styles,\r\n * maintaining browser compatibility.\r\n */\r\nvar MouseCursorStyle = /** @class */ (function () {\r\n function MouseCursorStyle() {\r\n }\r\n /**\r\n * Styles for \"grab\" mouse cursor.\r\n */\r\n MouseCursorStyle.grab = [{\r\n \"property\": \"cursor\",\r\n \"value\": \"move\"\r\n }, {\r\n \"property\": \"cursor\",\r\n \"value\": \"grab\"\r\n }, {\r\n \"property\": \"cursor\",\r\n \"value\": \"-webkit-grab\"\r\n }];\r\n /**\r\n * Styles for \"grabbing\" mouse cursor.\r\n */\r\n MouseCursorStyle.grabbing = [{\r\n \"property\": \"cursor\",\r\n \"value\": \"move\"\r\n }, {\r\n \"property\": \"cursor\",\r\n \"value\": \"grabbing\"\r\n }, {\r\n \"property\": \"cursor\",\r\n \"value\": \"-webkit-grabbing\"\r\n }];\r\n /**\r\n * Styles for \"pointer\" mouse cursor. (usually used for links)\r\n */\r\n MouseCursorStyle.pointer = [{\r\n \"property\": \"cursor\",\r\n \"value\": \"pointer\"\r\n }];\r\n /**\r\n * Styles for default mouse cursor. (browser determines style)\r\n */\r\n MouseCursorStyle.default = [{\r\n \"property\": \"cursor\",\r\n \"value\": \"default\"\r\n }];\r\n /**\r\n * Styles for horizontal bi-directional resize mouse cursor.\r\n */\r\n MouseCursorStyle.horizontalResize = [{\r\n \"property\": \"cursor\",\r\n \"value\": \"ew-resize\"\r\n }];\r\n /**\r\n * Styles for vertical bi-directional mouse cursor.\r\n */\r\n MouseCursorStyle.verticalResize = [{\r\n \"property\": \"cursor\",\r\n \"value\": \"ns-resize\"\r\n }];\r\n /**\r\n * Styles for \"no-allowed\" cursor.\r\n * @since 4.7.15\r\n */\r\n MouseCursorStyle.notAllowed = [{\r\n \"property\": \"cursor\",\r\n \"value\": \"not-allowed\"\r\n }];\r\n /**\r\n * Styles for \"text\" cursor.\r\n * @since 4.9.12\r\n */\r\n MouseCursorStyle.text = [{\r\n \"property\": \"cursor\",\r\n \"value\": \"text\"\r\n }];\r\n return MouseCursorStyle;\r\n}());\r\nexport { MouseCursorStyle };\r\n","/**\r\n * [[AMElement]] represents any SVG element and related functionality.\r\n */\r\nimport * as $dom from \"../utils/DOM\";\r\nimport * as $object from \"../utils/Object\";\r\nimport * as $type from \"../utils/Type\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * A base class for all SVG elements. Provides low-level DOM functionality.\r\n *\r\n * All visual elements extend this class.\r\n */\r\nvar AMElement = /** @class */ (function () {\r\n /**\r\n * Constructor creates a new element or uses the one that was passed in.\r\n *\r\n * @param element Element reference node type\r\n */\r\n function AMElement(element) {\r\n /**\r\n * Indicates if the element was already disposed.\r\n */\r\n this._isDisposed = false;\r\n /**\r\n * Current X coordinate.\r\n */\r\n this._x = 0;\r\n /**\r\n * Current Y coordinate.\r\n */\r\n this._y = 0;\r\n /**\r\n *\r\n */\r\n this._rotationY = 0;\r\n /**\r\n *\r\n */\r\n this._rotationX = 0;\r\n /**\r\n * Current rotation.\r\n */\r\n this._rotation = 0;\r\n /**\r\n * Current scale.\r\n */\r\n this._scale = 1;\r\n if (typeof element === \"string\") {\r\n this.node = document.createElementNS($dom.SVGNS, element);\r\n }\r\n else {\r\n this.node = element;\r\n }\r\n }\r\n /**\r\n * Removes element's node from DOM.\r\n */\r\n AMElement.prototype.removeNode = function () {\r\n if (this.node) {\r\n if (this.node.parentNode) {\r\n this.node.parentNode.removeChild(this.node);\r\n }\r\n }\r\n };\r\n Object.defineProperty(AMElement.prototype, \"transformString\", {\r\n /**\r\n * Returns `transform` attribute of the element.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Transform attribute value\r\n */\r\n get: function () {\r\n if (this.node) {\r\n return this._transformString;\r\n /*\r\n const value = this.node.getAttribute(\"transform\");\r\n \r\n if (value !== null) {\r\n return value;\r\n }*/\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Appply position, rotation and scale properties via elemen's `transform`\r\n * property\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n AMElement.prototype.transform = function () {\r\n var transfromString = \"translate(\" + this._x + \",\" + this._y + \")\";\r\n if (this._scale != 1) {\r\n transfromString += ((transfromString ? \" \" : \"\") + \"scale(\" + this._scale + \")\");\r\n }\r\n if (this._rotation != 0) {\r\n var rotateString = \"rotate(\" + this._rotation + \")\";\r\n if (this._rotationX && this._rotationY) {\r\n rotateString = \"rotate(\" + this._rotation + \" \" + this._rotationX + \" \" + this._rotationY + \")\";\r\n }\r\n transfromString += ((transfromString ? \" \" : \"\") + rotateString);\r\n }\r\n this._transformString = transfromString;\r\n this.node.setAttribute(\"transform\", transfromString);\r\n };\r\n /**\r\n * Returns bounding box of the element.\r\n *\r\n * ATTENTION: Bounding box calculations are extremely costly so should be\r\n * used sparingly and cached whenever possible.\r\n *\r\n * @return Bounding rectangle\r\n */\r\n AMElement.prototype.getBBox = function () {\r\n var bbox = {\r\n width: 0,\r\n height: 0,\r\n x: 0,\r\n y: 0\r\n };\r\n // FF would fail if getBBox() is called without node added to parent\r\n if (this.node && this.node.parentNode) {\r\n try { // again for ff. TODO: check if this doesn't slow down\r\n var svgbbox = this.node.getBBox();\r\n bbox.x = svgbbox.x;\r\n bbox.y = svgbbox.y;\r\n bbox.width = svgbbox.width;\r\n bbox.height = svgbbox.height;\r\n }\r\n catch (err) { }\r\n }\r\n return bbox;\r\n };\r\n /**\r\n * Moves the element to new coordinates.\r\n *\r\n * @param x Target X\r\n * @param y Target Y\r\n */\r\n AMElement.prototype.moveTo = function (point) {\r\n if (point) {\r\n var x = point.x;\r\n var y = point.y;\r\n if (this._x != x || this._y != y) {\r\n this._x = x;\r\n this._y = y;\r\n this.transform();\r\n }\r\n }\r\n };\r\n Object.defineProperty(AMElement.prototype, \"content\", {\r\n /**\r\n * Returns element's contents as SVG markup.\r\n *\r\n * @return Contents\r\n */\r\n get: function () {\r\n // @todo Do not use `innerHTML` as this is not reliable and will not work on all browsers\r\n return this.node.innerHTML || \"\";\r\n },\r\n /**\r\n * Element's SVG contents.\r\n *\r\n * @param value Contents\r\n */\r\n set: function (value) {\r\n // @todo Do not use `innerHTML` as this is not reliable and will not work on all browsers\r\n this.node.innerHTML = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(AMElement.prototype, \"textContent\", {\r\n /**\r\n * @return Text contents\r\n */\r\n get: function () {\r\n return this.node.textContent || \"\";\r\n },\r\n /**\r\n * Text contents of the SVG element.\r\n *\r\n * @param value Text contents\r\n */\r\n set: function (value) {\r\n this.node.textContent = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(AMElement.prototype, \"x\", {\r\n /**\r\n * @return X coordinate (px)\r\n */\r\n get: function () {\r\n return this._x;\r\n },\r\n /**\r\n * Element's X position in pixels.\r\n *\r\n * @param value X coordinate (px)\r\n */\r\n set: function (value) {\r\n if (this._x != value) {\r\n this._x = value;\r\n this.transform();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(AMElement.prototype, \"y\", {\r\n /**\r\n * @return Y coordinate (px)\r\n */\r\n get: function () {\r\n return this._y;\r\n },\r\n /**\r\n * Element's Y position in pixels.\r\n *\r\n * @param value Y coordinate (px)\r\n */\r\n set: function (value) {\r\n if (this._y != value) {\r\n this._y = value;\r\n this.transform();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(AMElement.prototype, \"rotation\", {\r\n /**\r\n * @return Rotation\r\n */\r\n get: function () {\r\n return this._rotation;\r\n },\r\n /**\r\n * Element's rotation in degrees.\r\n *\r\n * @param value Rotation\r\n */\r\n set: function (angle) {\r\n if (this._rotation != angle) {\r\n this._rotation = angle;\r\n this.transform();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(AMElement.prototype, \"rotationX\", {\r\n /**\r\n * @ignore\r\n */\r\n get: function () {\r\n return this._rotationX;\r\n },\r\n /**\r\n * @ignore\r\n */\r\n set: function (x) {\r\n if (this._rotationX != x) {\r\n this._rotationX = x;\r\n this.transform();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(AMElement.prototype, \"rotationY\", {\r\n /**\r\n * @ignore\r\n */\r\n get: function () {\r\n return this._rotationY;\r\n },\r\n /**\r\n * @ignore\r\n */\r\n set: function (y) {\r\n if (this._rotationY != y) {\r\n this._rotationY = y;\r\n this.transform();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(AMElement.prototype, \"scale\", {\r\n /**\r\n * @return Scale\r\n */\r\n get: function () {\r\n return this._scale;\r\n },\r\n /**\r\n * Element's scale where 1 is original size.\r\n *\r\n * Setting to 0.5 will reduce element's size by 50%, 2 will make element\r\n * twice as large, etc.\r\n *\r\n * @param value Scale\r\n */\r\n set: function (value) {\r\n if (this._scale != value) {\r\n this._scale = value;\r\n this.transform();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Removes an attribute from element.\r\n *\r\n * @param attribute Attribute to remove\r\n */\r\n AMElement.prototype.removeAttr = function (attribute) {\r\n this.node.removeAttribute(attribute);\r\n };\r\n /**\r\n * Sets a set of attributes on a element.\r\n *\r\n * @param attributes An object with attribute names (key) and values\r\n * @return The same element\r\n */\r\n AMElement.prototype.attr = function (attributes) {\r\n var _this = this;\r\n $object.each(attributes, function (attributeName, attributeValue) {\r\n if (!$type.hasValue(attributeValue)) {\r\n _this.node.removeAttribute(attributeName);\r\n }\r\n else {\r\n // this is for performance testing\r\n //if(attributeValue == this.node.getAttribute(attributeName)){\r\n //\tconsole.log(attributeName, attributeValue)\r\n //}\r\n _this.node.setAttribute(attributeName, attributeValue);\r\n }\r\n });\r\n return this;\r\n };\r\n /**\r\n * Returns a value of a node attribute.\r\n *\r\n * @param attribute Attribute name\r\n * @return Attribute value\r\n */\r\n AMElement.prototype.getAttr = function (attribute) {\r\n return this.node.getAttribute(attribute);\r\n };\r\n /**\r\n * Sets a single attribute of the element's node using namesspace.\r\n *\r\n * @param ns Namespace\r\n * @param attribute Attribute\r\n * @param value Value\r\n * @return The same element\r\n */\r\n AMElement.prototype.attrNS = function (ns, attribute, value) {\r\n this.node.setAttributeNS(ns, attribute, value);\r\n return this;\r\n };\r\n /**\r\n * Returns a namespaced attribute value from node.\r\n *\r\n * @param ns Namespace\r\n * @param attribute Attribute\r\n * @return Attribute value\r\n */\r\n AMElement.prototype.getAttrNS = function (ns, attribute) {\r\n return this.node.getAttributeNS(ns, attribute);\r\n };\r\n /**\r\n * Removes `style` attribute from node.\r\n *\r\n * @param attribute Attribute to remove\r\n */\r\n AMElement.prototype.removeStyle = function (attribute) {\r\n // @todo Review because it's a bit messy and maybe not needed (pratically not used)\r\n this.node.style[attribute] = null;\r\n delete this.node.style[attribute];\r\n };\r\n /**\r\n * Returns style attribute value.\r\n *\r\n * @param attribute Style attribute value\r\n * @return Attribute value\r\n */\r\n AMElement.prototype.getStyle = function (attribute) {\r\n // @todo Review because it's a bit messy and maybe not needed (pratically not used)\r\n return this.node.style[attribute];\r\n };\r\n /**\r\n * Adds style attributes to element's node.\r\n *\r\n * @param attributes Object containing attribute: value pairs\r\n * @return The same element\r\n */\r\n AMElement.prototype.addStyle = function (attributes) {\r\n var _this = this;\r\n // @todo Review because it's a bit messy and maybe not needed (pratically not used)\r\n $object.each(attributes, function (attributeName, attributeValue) {\r\n if (!$type.hasValue(attributeValue)) {\r\n _this.removeStyle(attributeName);\r\n }\r\n else {\r\n _this.node.style[attributeName] = attributeValue;\r\n }\r\n });\r\n return this;\r\n };\r\n /**\r\n * Adds a class to element.\r\n *\r\n * @param name Class name\r\n */\r\n AMElement.prototype.addClass = function (name) {\r\n $dom.addClass(this.node, name);\r\n };\r\n /**\r\n * Removes a class from element.\r\n *\r\n * @param name Class name\r\n */\r\n AMElement.prototype.removeClass = function (name) {\r\n $dom.removeClass(this.node, name);\r\n };\r\n /**\r\n * Sets a class name on element.\r\n *\r\n * @param name Class name\r\n */\r\n AMElement.prototype.setClass = function (name) {\r\n this.node.setAttribute(\"class\", name);\r\n };\r\n /**\r\n * Removes all element's child nodes, basically leaving it empty.\r\n */\r\n AMElement.prototype.removeChildNodes = function () {\r\n // remove all children\r\n while (this.node.childNodes.length > 0) {\r\n this.node.removeChild(this.node.firstChild);\r\n }\r\n };\r\n /**\r\n * Was this element already been disposed?\r\n *\r\n * @return Disposed?\r\n */\r\n AMElement.prototype.isDisposed = function () {\r\n return this._isDisposed;\r\n };\r\n /**\r\n * Disposes element.\r\n */\r\n AMElement.prototype.dispose = function () {\r\n this.removeNode();\r\n };\r\n return AMElement;\r\n}());\r\nexport { AMElement };\r\n","import { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { AMElement } from \"./AMElement\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Creates an SVG `<g>` element.\r\n *\r\n * SVG groups are used for elements that need more elements just one.\r\n *\r\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/SVG/Element/g} About `<g>` element\r\n */\r\nvar Group = /** @class */ (function (_super) {\r\n __extends(Group, _super);\r\n /**\r\n * Constructor.\r\n *\r\n * @param elementName Element type (should be \"g\")\r\n */\r\n function Group(elementName) {\r\n return _super.call(this, elementName) || this;\r\n }\r\n /**\r\n * Adds an element to group.\r\n *\r\n * This will manipulate DOM. `element` will be physically moved into group.\r\n *\r\n * @param element Element\r\n */\r\n Group.prototype.add = function (element) {\r\n if (element) {\r\n this.node.appendChild(element.node);\r\n }\r\n };\r\n /**\r\n * Adds an element to group.\r\n *\r\n * This will manipulate DOM. `element` will be physically moved into group.\r\n *\r\n * @param element Element\r\n */\r\n Group.prototype.addToBack = function (element) {\r\n if (element) {\r\n var first = this.node.childNodes[0];\r\n if (first) {\r\n if (first != element.node) {\r\n this.node.insertBefore(element.node, first);\r\n }\r\n }\r\n else {\r\n this.node.appendChild(element.node);\r\n }\r\n }\r\n };\r\n /**\r\n * Removes the `element` from group.\r\n *\r\n * Please note that this will not dispose the element itself, it will just\r\n * remove it from the group.\r\n *\r\n * @param element Element\r\n */\r\n Group.prototype.removeElement = function (element) {\r\n // todo: not sure about the speed, need to investigate, maybe it's faster to check if node is a child\r\n if (element) {\r\n try {\r\n if (element.node && element.node.parentNode == this.node) {\r\n this.node.removeChild(element.node);\r\n }\r\n }\r\n catch (err) {\r\n }\r\n }\r\n };\r\n /**\r\n * Checks if this group already has the child element added\r\n *\r\n * @param element\r\n * @return {boolean}\r\n */\r\n Group.prototype.hasChild = function (element) {\r\n for (var i = 0; i < this.node.childNodes.length; i++) {\r\n if (this.node.childNodes[i] == element.node) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n };\r\n Object.defineProperty(Group.prototype, \"content\", {\r\n /**\r\n * @return SVG markup\r\n */\r\n get: function () {\r\n return this.node.innerHTML;\r\n },\r\n /**\r\n * Content of the group element.\r\n *\r\n * Can be used to add a lot of proprietary SVG markup into group.\r\n *\r\n * @param value SVG markup\r\n */\r\n set: function (value) {\r\n this.node.innerHTML = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Removes all children from the group.\r\n */\r\n Group.prototype.removeChildren = function () {\r\n if (this.node.childNodes) {\r\n while (this.node.childNodes.length > 0) {\r\n var childNode = this.node.firstChild;\r\n if (childNode && childNode.parentNode) {\r\n childNode.parentNode.removeChild(childNode);\r\n }\r\n }\r\n }\r\n };\r\n return Group;\r\n}(AMElement));\r\nexport { Group };\r\n","/**\r\n * Paper class just like the white sheet of pressed fiber it draws its name\r\n * inspiration from is used as a starting point to start a drawing.\r\n *\r\n * Before we can start adding elements (drawing) we need to take out a new sheet\r\n * of paper, or in this instance create a blank SVG element.\r\n *\r\n * This class creates such element, as well as implements methods needed to\r\n * start adding elements to it.\r\n */\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { AMElement } from \"./AMElement\";\r\nimport { Group } from \"./Group\";\r\nimport { SVGContainer } from \"./SVGContainer\";\r\nimport * as $dom from \"../utils/DOM\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Paper class which when instantiated will create an SVG element as well as\r\n * some of the sub-elements like `<desc>`, `<defs>`.\r\n *\r\n * Use its methods like `addGroup` and `append` to add elements to the paper.\r\n */\r\nvar Paper = /** @class */ (function () {\r\n /**\r\n * Creates main `<svg>` container and related elements.\r\n *\r\n * @param container A reference to HTML element to create `<svg>` in\r\n */\r\n function Paper(container, id) {\r\n // Store container reference\r\n this.container = container;\r\n this.id = id;\r\n // Create SVG element\r\n var svg = document.createElementNS($dom.SVGNS, \"svg\");\r\n svg.setAttribute(\"version\", \"1.1\");\r\n svg.setAttributeNS($dom.XMLNS, \"xmlns\", $dom.SVGNS);\r\n svg.setAttributeNS($dom.XMLNS, \"xmlns:xlink\", $dom.XLINK);\r\n svg.setAttribute(\"role\", \"group\");\r\n this.container.appendChild(svg);\r\n // Add description\r\n //let desc: SVGElement = <SVGElement>document.createElementNS($dom.SVGNS, \"desc\");\r\n //desc.appendChild(document.createTextNode(\"JavaScript chart by amCharts\"));\r\n //svg.appendChild(desc);\r\n // Add defs\r\n this.defs = document.createElementNS($dom.SVGNS, \"defs\");\r\n svg.appendChild(this.defs);\r\n // Set width and height to fit container\r\n svg.style.width = \"100%\";\r\n svg.style.height = \"100%\";\r\n svg.style.overflow = \"visible\";\r\n // Store variable\r\n this.svg = svg;\r\n }\r\n /**\r\n * Creates and returns a new element. Does not attach it to Paper yet.\r\n *\r\n * @param elementName Element name\r\n * @return New element\r\n */\r\n Paper.prototype.add = function (elementName) {\r\n return new AMElement(elementName);\r\n };\r\n /**\r\n * Creates and returns a new Group element. Does not attach it to Paper.\r\n *\r\n * @param groupName Element name\r\n * @return New Group\r\n */\r\n Paper.prototype.addGroup = function (groupName) {\r\n return new Group(groupName);\r\n };\r\n /**\r\n * Appends an element to Paper.\r\n *\r\n * @param element Element to append\r\n */\r\n Paper.prototype.append = function (element) {\r\n if (element) {\r\n this.svg.appendChild(element.node);\r\n }\r\n };\r\n /**\r\n * Appends an element to `<defs>` block of the Paper.\r\n *\r\n * @param element Element\r\n */\r\n Paper.prototype.appendDef = function (element) {\r\n if (element) {\r\n this.defs.appendChild(element.node);\r\n }\r\n };\r\n /**\r\n * Creates and returns new `<foreignObject>` element. Does not append it to\r\n * Paper.\r\n *\r\n * @return A foreignObject element\r\n */\r\n Paper.prototype.foreignObject = function () {\r\n var element = new AMElement(\"foreignObject\");\r\n //this.append(element);\r\n return element;\r\n };\r\n /**\r\n * Checks if browser supports `<foreignObject>` elements.\r\n *\r\n * @return Supports `foreignObject`?\r\n */\r\n Paper.prototype.supportsForeignObject = function () {\r\n return document.implementation.hasFeature(\"http://www.w3.org/TR/SVG11/feature#Extensibility\", \"1.1\");\r\n };\r\n return Paper;\r\n}());\r\nexport { Paper };\r\nvar ghostPaper = null;\r\n/**\r\n * A [[Paper]] instance to create elements, that are not yet ready to be\r\n * placed in visible DOM.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\nexport function getGhostPaper() {\r\n if (ghostPaper === null) {\r\n // ghost is used to draw elements while real paper is not yet created or Sprite doesn't know parent yet\r\n var ghostDiv = document.createElement(\"div\");\r\n ghostDiv.hidden = true;\r\n ghostDiv.style.width = \"1px\";\r\n ghostDiv.style.height = \"1px\";\r\n ghostDiv.style.position = \"absolute\";\r\n ghostDiv.style.zIndex = \"-1000000\";\r\n document.body.appendChild(ghostDiv);\r\n var ghostSvgContainer = new SVGContainer(ghostDiv, true);\r\n ghostPaper = new Paper(ghostSvgContainer.SVGContainer, \"ghost\");\r\n }\r\n return ghostPaper;\r\n}\r\n","/**\r\n * A collection of functions that deals with path calculations.\r\n */\r\nimport * as $math from \"../utils/Math\";\r\nimport * as $type from \"../utils/Type\";\r\nimport { getGhostPaper } from \"../rendering/Paper\";\r\nimport { options } from \"../Options\";\r\n/**\r\n * ============================================================================\r\n * PATH FUNCTIONS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Returns an SVG path from a number of points.\r\n *\r\n * @ignore Exclude from docs\r\n * @param points An array of line elbow points\r\n * @return SVG path\r\n */\r\nexport function polyline(points) {\r\n var path = lineTo(points[0]);\r\n var prevPoint = { x: 0, y: 0 };\r\n var minStep = options.minPolylineStep;\r\n if (!$type.isNumber(minStep)) {\r\n minStep = 0.5;\r\n }\r\n for (var i = 0, len = points.length; i < len; i++) {\r\n var point = points[i];\r\n if ($math.getDistance(point, prevPoint) > minStep) {\r\n path += lineTo(point);\r\n prevPoint = point;\r\n }\r\n }\r\n return path;\r\n}\r\n/**\r\n * Returns a starting point of an SVG path.\r\n *\r\n * @ignore Exclude from docs\r\n * @param point Starting point\r\n * @return SVG path\r\n */\r\nexport function moveTo(point) {\r\n return \" M\" + $math.round(point.x, 4) + \",\" + $math.round(point.y, 4) + \" \";\r\n}\r\n/**\r\n * Returns a line part of SVG path.\r\n *\r\n * @ignore Exclude from docs\r\n * @param point SVG path\r\n * @return SVG path\r\n */\r\nexport function lineTo(point) {\r\n return \" L\" + $math.round(point.x, 4) + \",\" + $math.round(point.y, 4) + \" \";\r\n}\r\n/**\r\n * Returns a quadratic curve part of an SVG path.\r\n *\r\n * @ignore Exclude from docs\r\n * @param point End point of the curve\r\n * @param controlPoint Control point\r\n * @return SVG path\r\n */\r\nexport function quadraticCurveTo(point, controlPoint) {\r\n return \" Q\" + $math.round(controlPoint.x, 4)\r\n + \",\" + $math.round(controlPoint.y, 4) + \" \" + $math.round(point.x, 4)\r\n + \",\" + $math.round(point.y, 4);\r\n}\r\n/**\r\n * Returns a cubic curve part of an SVG path.\r\n *\r\n * @ignore Exclude from docs\r\n * @param point End point of the curve\r\n * @param controlPointA Control point A\r\n * @param controlPointB Control point B\r\n * @return SVG path\r\n */\r\nexport function cubicCurveTo(point, controlPointA, controlPointB) {\r\n return \" C\" + $math.round(controlPointA.x, 4)\r\n + \",\" + $math.round(controlPointA.y, 4) + \" \" + $math.round(controlPointB.x, 4)\r\n + \",\" + $math.round(controlPointB.y, 4) + \" \" + $math.round(point.x, 4)\r\n + \",\" + $math.round(point.y, 4);\r\n}\r\n/**\r\n * Returns a terminator for an SVG path.\r\n *\r\n * @ignore Exclude from docs\r\n * @return SVG path\r\n */\r\nexport function closePath() {\r\n return \" Z\";\r\n}\r\n/**\r\n * Returns an arc part of an SVG path.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Better parameter descriptions\r\n * @param startAngle Starting angle\r\n * @param arc Arc\r\n * @param radius Radius\r\n * @param radiusY Vertical radius\r\n * @return SVG path\r\n */\r\nexport function arcTo(startAngle, arc, radius, radiusY) {\r\n if (arc == 0) {\r\n return \"\";\r\n }\r\n if (!$type.isNumber(radiusY)) {\r\n radiusY = radius;\r\n }\r\n var path = \"\";\r\n var c = \",\";\r\n var segments = Math.ceil(Math.abs(arc) / 180);\r\n var l = 1;\r\n if (arc < 0) {\r\n l = 0;\r\n }\r\n // previous, as we use a not A\r\n var pax = 0;\r\n var pay = 0;\r\n // center\r\n var cx = -$math.cos(startAngle) * radius;\r\n var cy = -$math.sin(startAngle) * radiusY;\r\n // foir very short angles and big radius, solves artefacts\r\n if (arc < 0.5 && radius > 3000) {\r\n var endAngle = startAngle + arc;\r\n var ax = $math.round($math.cos(endAngle) * radius, 4);\r\n var ay = $math.round($math.sin(endAngle) * radiusY, 4);\r\n return lineTo({ x: ax, y: ay });\r\n }\r\n for (var i = 0; i < segments; i++) {\r\n var endAngle = startAngle + arc / segments * (i + 1);\r\n var ax = $math.round($math.cos(endAngle) * radius + cx - pax, 4);\r\n var ay = $math.round($math.sin(endAngle) * radiusY + cy - pay, 4);\r\n path += \" a\" + radius + c + radiusY + c + 0 + c + 0 + c + l + c + ax + c + ay;\r\n pax = ax;\r\n pay = ay;\r\n }\r\n return path;\r\n}\r\n/**\r\n * Creates an arc path.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param startAngle [description]\r\n * @param arc [description]\r\n * @param radius [description]\r\n * @param innerRadius [description]\r\n * @param radiusY [description]\r\n * @param cornerRadius [description]\r\n * @param innerCornerRadius [description]\r\n * @return SVG path\r\n */\r\nexport function arc(startAngle, arc, radius, innerRadius, radiusY, cornerRadius, innerCornerRadius) {\r\n if (arc == 0) {\r\n return \"\";\r\n }\r\n if (!$type.isNumber(innerRadius)) {\r\n innerRadius = 0;\r\n }\r\n if (radius == 0 && innerRadius <= 0) {\r\n return \"\";\r\n }\r\n if (radius < innerRadius) {\r\n var temp = radius;\r\n radius = innerRadius;\r\n innerRadius = temp;\r\n if ($type.isNumber(radiusY)) {\r\n radiusY = radiusY / innerRadius * radius;\r\n }\r\n }\r\n arc = $math.min(arc, 360);\r\n if (arc == 360) {\r\n cornerRadius = 0;\r\n innerCornerRadius = 0;\r\n }\r\n var endAngle = startAngle + arc;\r\n var crSin = $math.sin($math.min(arc, 45) / 2);\r\n radiusY = $type.isNumber(radiusY) ? radiusY : radius;\r\n cornerRadius = cornerRadius || 0;\r\n innerCornerRadius = $type.isNumber(innerCornerRadius) ? innerCornerRadius : cornerRadius;\r\n var innerRadiusY = (radiusY / radius) * innerRadius;\r\n var cornerRadiusY = (radiusY / radius) * cornerRadius;\r\n var innerCornerRadiusY = (radiusY / radius) * innerCornerRadius;\r\n cornerRadius = $math.fitToRange(cornerRadius, 0, (radius - innerRadius) / 2);\r\n cornerRadiusY = $math.fitToRange(cornerRadiusY, 0, (radiusY - innerRadiusY) / 2);\r\n innerCornerRadius = $math.fitToRange(innerCornerRadius, 0, (radius - innerRadius) / 2);\r\n innerCornerRadiusY = $math.fitToRange(innerCornerRadiusY, 0, (radiusY - innerRadiusY) / 2);\r\n cornerRadius = $math.round($math.fitToRange(cornerRadius, 0, radius * crSin), 4);\r\n cornerRadiusY = $math.round($math.fitToRange(cornerRadiusY, 0, radiusY * crSin), 4);\r\n innerCornerRadius = $math.round($math.fitToRange(innerCornerRadius, 0, innerRadius * crSin), 4);\r\n innerCornerRadiusY = $math.round($math.fitToRange(innerCornerRadiusY, 0, innerRadiusY * crSin), 4);\r\n var crAngle = Math.asin(cornerRadius / radius / 2) * $math.DEGREES * 2;\r\n var crAngleY = Math.asin(cornerRadiusY / radiusY / 2) * $math.DEGREES * 2;\r\n if (innerRadius < innerCornerRadius) {\r\n innerRadius = innerCornerRadius;\r\n }\r\n if (innerRadiusY < innerCornerRadiusY) {\r\n innerRadiusY = innerCornerRadiusY;\r\n }\r\n var crInnerAngle = Math.asin(innerCornerRadius / innerRadius / 2) * $math.DEGREES * 2;\r\n var crInnerAngleY = Math.asin(innerCornerRadiusY / innerRadiusY / 2) * $math.DEGREES * 2;\r\n if (!$type.isNumber(crInnerAngle)) {\r\n crInnerAngle = 0;\r\n }\r\n if (!$type.isNumber(crInnerAngleY)) {\r\n crInnerAngleY = 0;\r\n }\r\n var middleAngle = startAngle + arc / 2;\r\n var mPoint = { x: $math.round($math.cos(middleAngle) * innerRadius, 4), y: $math.sin(middleAngle) * innerRadiusY };\r\n var a0 = { x: $math.cos(startAngle) * (innerRadius + innerCornerRadius), y: $math.sin(startAngle) * (innerRadiusY + innerCornerRadiusY) };\r\n var b0 = { x: $math.cos(startAngle) * (radius - cornerRadius), y: $math.sin(startAngle) * (radiusY - cornerRadiusY) };\r\n var c0 = { x: $math.cos(endAngle) * (radius - cornerRadius), y: $math.sin(endAngle) * (radiusY - cornerRadiusY) };\r\n var d0 = { x: $math.cos(endAngle) * (innerRadius + innerCornerRadius), y: $math.sin(endAngle) * (innerRadiusY + innerCornerRadiusY) };\r\n var b1 = { x: $math.cos(startAngle + crAngle) * radius, y: $math.sin(startAngle + crAngleY) * radiusY };\r\n var d1 = { x: $math.cos(endAngle - crInnerAngle) * innerRadius, y: $math.sin(endAngle - crInnerAngleY) * innerRadiusY };\r\n // some magic math\r\n innerCornerRadius += innerCornerRadius * $math.sin(crInnerAngle / 2);\r\n innerCornerRadiusY += innerCornerRadiusY * $math.sin(crInnerAngleY / 2);\r\n if (crInnerAngle > (endAngle - startAngle) / 2) {\r\n d1 = mPoint;\r\n }\r\n var path = \"\";\r\n // start from b if this is full circle\r\n if (arc == 360) {\r\n path = moveTo(b0);\r\n }\r\n // otherwise start from a\r\n else {\r\n path = moveTo(a0);\r\n path += lineTo(b0);\r\n path += arcToPoint(b1, cornerRadius, cornerRadiusY, true);\r\n }\r\n // draw arc\r\n path += arcTo(startAngle + crAngle, arc - 2 * crAngle, radius, radiusY);\r\n // draw inner arc\r\n if ($type.isNumber(innerRadius) && innerRadius != 0) {\r\n // move to B if this is full circle\r\n if (arc == 360 && cornerRadius == 0) {\r\n path += moveTo(d0);\r\n }\r\n // draw line otherwise\r\n else {\r\n path += arcToPoint(c0, cornerRadius, cornerRadiusY, true);\r\n path += lineTo(d0);\r\n path += arcToPoint(d1, innerCornerRadius, innerCornerRadiusY, true);\r\n }\r\n path += arcTo(endAngle - crInnerAngle, -(arc - 2 * crInnerAngle), innerRadius, innerRadiusY);\r\n if (arc < 360 || cornerRadius > 0) {\r\n path += arcToPoint(a0, innerCornerRadius, innerCornerRadiusY, true);\r\n }\r\n path += lineTo(a0);\r\n }\r\n else {\r\n path += arcToPoint(c0, cornerRadius, cornerRadiusY, true);\r\n if (arc < 360) {\r\n path += lineTo(a0);\r\n }\r\n }\r\n return path;\r\n}\r\n/**\r\n * Creates a path for an arc to specific coordinate.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param point Reference point\r\n * @param radius Radius\r\n * @param radiusY Vertical radius (for skewed arcs)\r\n * @param sweepFlag [description]\r\n * @param largeArcFlag [description]\r\n * @param xAxisRotation [description]\r\n * @return Arc path\r\n */\r\nexport function arcToPoint(point, radius, radiusY, sweepFlag, largeArcFlag, xAxisRotation) {\r\n if (radius == 0) {\r\n return \"\";\r\n }\r\n xAxisRotation = xAxisRotation || 0;\r\n largeArcFlag = Boolean(largeArcFlag);\r\n sweepFlag = Boolean(sweepFlag);\r\n var c = \",\";\r\n var sweepFlagValue = +sweepFlag; // converts to 1 or 0\r\n var largeArcFlagValue = +largeArcFlag; // converts to 1 or 0\r\n return \" A\" + radius + c + radiusY + c + xAxisRotation + c + largeArcFlagValue + c + sweepFlagValue + c + $math.round(point.x, 4) + c + $math.round(point.y, 4);\r\n}\r\n/**\r\n * Creates a new rectangle.\r\n *\r\n * @ignore Exclude from docs\r\n * @param width Width (px)\r\n * @param height Height (px)\r\n * @param x X position\r\n * @param y Y position\r\n * @return Rectangle\r\n */\r\nexport function rectangle(width, height, x, y) {\r\n if (!$type.isNumber(x)) {\r\n x = 0;\r\n }\r\n if (!$type.isNumber(y)) {\r\n y = 0;\r\n }\r\n return moveTo({ x: x, y: y }) + lineTo({ x: x + width, y: y }) + lineTo({ x: x + width, y: y + height }) + lineTo({ x: x, y: y + height }) + closePath();\r\n}\r\n/**\r\n * Converts a rectangle to an SVG path.\r\n *\r\n * @ignore Exclude from docs\r\n * @param rect Rectangle\r\n * @param ccw Counter-clockwise?\r\n * @return SVG path\r\n */\r\nexport function rectToPath(rect, ccw) {\r\n var c = \",\";\r\n var L = \" L\";\r\n if (ccw) {\r\n return \"M\" + rect.x\r\n + c + rect.y + L + rect.x\r\n + c + (rect.y + rect.height) + L + (rect.x + rect.width)\r\n + c + (rect.y + rect.height) + L + (rect.x + rect.width)\r\n + c + rect.y + L + rect.x\r\n + c + rect.y;\r\n }\r\n else {\r\n return \"M\" + rect.x\r\n + c + rect.y + L + (rect.x + rect.width)\r\n + c + rect.y + L + (rect.x + rect.width)\r\n + c + (rect.y + rect.height) + L + rect.x\r\n + c + (rect.y + rect.height) + L + rect.x\r\n + c + rect.y;\r\n }\r\n}\r\n/**\r\n * Converts SVG path to array of points.\r\n *\r\n * Note, this is experimental feature based on method which is deprecated\r\n * on some browsers and some browsers do not support it at all.\r\n *\r\n * You can save the output of this function, but not rely on it completely.\r\n */\r\nexport function pathToPoints(path, pointCount) {\r\n var paper = getGhostPaper();\r\n var svgPath = paper.add(\"path\").node;\r\n svgPath.setAttribute(\"d\", path);\r\n if (svgPath.getPointAtLength && svgPath.getTotalLength) {\r\n var length_1 = svgPath.getTotalLength();\r\n var toPoints = [];\r\n for (var i = 0; i < pointCount; i++) {\r\n var point = svgPath.getPointAtLength(i / pointCount * length_1);\r\n toPoints.push({ x: point.x, y: point.y });\r\n }\r\n return toPoints;\r\n }\r\n svgPath.remove();\r\n}\r\nexport function spiralPoints(cx, cy, radius, radiusY, innerRadius, step, radiusStep, startAngle, endAngle) {\r\n if (!$type.isNumber(startAngle)) {\r\n startAngle = 0;\r\n }\r\n if (!$type.isNumber(startAngle)) {\r\n endAngle = startAngle;\r\n }\r\n var r = innerRadius + 0.01;\r\n var angle = startAngle * $math.RADIANS;\r\n var points = [];\r\n while (r < radius + radiusStep) {\r\n var stepSize = step;\r\n if (stepSize / 2 > r) {\r\n stepSize = 2 * r;\r\n }\r\n angle += 2 * Math.asin(stepSize / 2 / r);\r\n if (angle * $math.DEGREES > endAngle + ((radius - innerRadius) / radiusStep) * 360) {\r\n break;\r\n }\r\n var degrees = angle * $math.DEGREES;\r\n var point = { x: cx + r * Math.cos(angle), y: cy + r * radiusY / radius * Math.sin(angle) };\r\n points.push(point);\r\n r = innerRadius + degrees / 360 * radiusStep;\r\n }\r\n points.shift();\r\n return points;\r\n}\r\nexport function pointsToPath(points) {\r\n if (!points || points.length == 0) {\r\n return \"\";\r\n }\r\n var path = moveTo(points[0]);\r\n if (points && points.length > 0) {\r\n for (var i = 1; i < points.length; i++) {\r\n path += lineTo(points[i]);\r\n }\r\n }\r\n return path;\r\n}\r\n","/**\r\n * This functionality is related to the HTML wrapper that houses `<svg>` tag.\r\n */\r\nimport { Popup } from \"../elements/Popup\";\r\nimport { Modal } from \"../elements/Modal\";\r\nimport { ListTemplate, ListDisposer } from \"../utils/List\";\r\nimport * as $utils from \"../utils/Utils\";\r\nimport * as $dom from \"../utils/DOM\";\r\nimport * as $array from \"../utils/Array\";\r\nimport * as $type from \"../utils/Type\";\r\nimport { ResizeSensor } from \"../utils/ResizeSensor\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * A array of all SVG Containers (one SVG container per chart instance).\r\n *\r\n * @ignore Exclude from docs\r\n */\r\nexport var svgContainers = [];\r\n/**\r\n * A class used to create an HTML wrapper for the SVG contents.\r\n */\r\nvar SVGContainer = /** @class */ (function () {\r\n /**\r\n * Constructor\r\n *\r\n * * Creates an HTML wrapper for SVG\r\n */\r\n function SVGContainer(htmlElement, ghost) {\r\n var _this = this;\r\n /**\r\n * Indicates if this object has already been deleted. Any\r\n * destruction/disposal code should take this into account when deciding\r\n * wheter to run potentially costly disposal operations if they already have\r\n * been run.\r\n */\r\n this._disposed = false;\r\n /**\r\n * If this component is in a separate HTML container, `autoResize` means the\r\n * module will constantly measure container's size and adopt contents to it.\r\n */\r\n this.autoResize = true;\r\n /**\r\n * Holds list of references to [[Sprite]] objects that should not be exported\r\n * when exporting chart to an image.\r\n *\r\n * @ignore\r\n */\r\n this.nonExportableSprites = [];\r\n /**\r\n * List of objects that need to be disposed when this one is disposed.\r\n */\r\n this._disposers = [];\r\n this.cssScale = 1;\r\n // This is needed so that it won't resize while printing, so that way printing works correctly.\r\n this._printing = false;\r\n // Log parent HTML element\r\n this.htmlElement = htmlElement;\r\n if (!ghost) {\r\n this._printing = false;\r\n this.initSensor();\r\n this._disposers.push($dom.addEventListener(window, \"beforeprint\", function () {\r\n _this._printing = true;\r\n }));\r\n this._disposers.push($dom.addEventListener(window, \"afterprint\", function () {\r\n _this._printing = false;\r\n }));\r\n }\r\n // Adds to containers array\r\n svgContainers.push(this);\r\n /**\r\n * Create child div for the container - it will have svg node\r\n * It might seem that this container is not necessay, however having it solves\r\n * a problems with mouse position detection and some other.\r\n */\r\n var svgContainer = document.createElement(\"div\");\r\n var style = svgContainer.style;\r\n style.width = \"100%\";\r\n style.height = \"100%\";\r\n style.position = \"relative\";\r\n htmlElement.appendChild(svgContainer);\r\n this.SVGContainer = svgContainer;\r\n }\r\n /**\r\n * (Re)Initializes a resize sensor.\r\n */\r\n SVGContainer.prototype.initSensor = function () {\r\n var _this = this;\r\n if (this.resizeSensor) {\r\n this.resizeSensor.dispose();\r\n }\r\n var callback = function () {\r\n if (_this.autoResize && !_this._printing) {\r\n _this.measure();\r\n }\r\n };\r\n this.resizeSensor = new ResizeSensor(this.htmlElement, callback);\r\n this._disposers.push(this.resizeSensor);\r\n };\r\n /**\r\n * Measures size of parent HTML element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n SVGContainer.prototype.measure = function () {\r\n var width = $utils.width(this.htmlElement);\r\n var height = $utils.height(this.htmlElement);\r\n var container = this.container;\r\n if (container) {\r\n if (this.width != width || this.height != height) {\r\n this.width = width;\r\n this.height = height;\r\n if (width > 0) {\r\n container.maxWidth = width;\r\n }\r\n if (height > 0) {\r\n container.maxHeight = height;\r\n }\r\n $dom.fixPixelPerfect(this.SVGContainer);\r\n }\r\n if (!container.maxWidth) {\r\n container.maxWidth = 0;\r\n }\r\n if (!container.maxHeight) {\r\n container.maxHeight = 0;\r\n }\r\n this.cssScale = 1;\r\n this.checkTransform(this.htmlElement);\r\n }\r\n };\r\n Object.defineProperty(SVGContainer.prototype, \"container\", {\r\n /**\r\n * @return Container\r\n */\r\n get: function () {\r\n return this._container;\r\n },\r\n /**\r\n * A [[Container]] element which is placed into container.\r\n *\r\n * @param container Container\r\n */\r\n set: function (container) {\r\n this._container = container;\r\n this.measure();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Returns if this object has been already been disposed.\r\n *\r\n * @return Is disposed?\r\n */\r\n SVGContainer.prototype.isDisposed = function () {\r\n return this._disposed;\r\n };\r\n /**\r\n * Removes this container from SVG container list in system, which\r\n * effectively disables size change monitoring for it.\r\n */\r\n SVGContainer.prototype.dispose = function () {\r\n if (!this._disposed) {\r\n $array.remove(svgContainers, this);\r\n }\r\n $array.each(this._disposers, function (item) {\r\n item.dispose();\r\n });\r\n };\r\n Object.defineProperty(SVGContainer.prototype, \"hideOverflow\", {\r\n /**\r\n * Indicates if chart container should have its style set\r\n * to `overflow: hidden`.\r\n *\r\n * Normally, we don't want that, so that certain elements, such as tooltips,\r\n * would be able to go outside chart area.\r\n *\r\n * There is one issue though. Some browsers ignore SVG masks and would\r\n * display scrollbars if chart elements, that go outside chart area extend\r\n * outside window.\r\n *\r\n * This is especially true for [[MapChart]], which can have its elements\r\n * extend very widely when zoomed in. Even if those parts are not visible\r\n * because of SVG masks, some browsers might still display window scrollbars.\r\n *\r\n * This is why we set this setting to `true` in [[MapChart]].\r\n *\r\n * Other charts use default of `false`.\r\n */\r\n set: function (value) {\r\n if (value) {\r\n this.SVGContainer.style.overflow = \"hidden\";\r\n }\r\n else {\r\n this.SVGContainer.style.overflow = \"\";\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(SVGContainer.prototype, \"modal\", {\r\n /**\r\n * ==========================================================================\r\n * MODAL/POPUP RELATED STUFF\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * Returns a [[Modal]] instance, associated with this chart.\r\n * (elements top parent)\r\n *\r\n * Accessing modal does not make it appear. To make a modal appear, use\r\n * `showModal()` method.\r\n *\r\n * @see {@link Modal} for more information about using Modal windows\r\n * @return Modal instance\r\n */\r\n get: function () {\r\n if (!$type.hasValue(this._modal)) {\r\n // Create new modal\r\n this._modal = new Modal();\r\n this._modal.container = this.SVGContainer;\r\n // Add to disposers\r\n this._disposers.push(this._modal);\r\n }\r\n return this._modal;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Opens a modal window with specific content (`text` parameter) and,\r\n * optionally, `title`.\r\n *\r\n * The `text` parameter can contain HTML content.\r\n *\r\n * @see {@link Modal} for more information about using Modal windows\r\n * @param text Modal contents\r\n * @param title Title for the modal window\r\n */\r\n SVGContainer.prototype.openModal = function (text, title) {\r\n // Hide previous modal\r\n this.closeModal();\r\n // Create modal\r\n var modal = this.modal;\r\n modal.content = text;\r\n modal.readerTitle = title || \"\";\r\n modal.title = title || \"\";\r\n modal.open();\r\n return modal;\r\n };\r\n /**\r\n * Hides modal window if there is one currently open.\r\n */\r\n SVGContainer.prototype.closeModal = function () {\r\n if (this._modal) {\r\n this.modal.close();\r\n }\r\n };\r\n Object.defineProperty(SVGContainer.prototype, \"popups\", {\r\n /**\r\n * A list of popups for this chart.\r\n *\r\n * @return Popups\r\n */\r\n get: function () {\r\n if (!$type.hasValue(this._popups)) {\r\n // Create popup template\r\n var popupTemplate = new Popup();\r\n popupTemplate.container = this.SVGContainer;\r\n // Create the list\r\n this._popups = new ListTemplate(popupTemplate);\r\n // Add to disposers\r\n this._disposers.push(new ListDisposer(this._popups));\r\n this._disposers.push(this._popups.template);\r\n }\r\n return this._popups;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Creates, opens, and returns a new [[Popup]] window.\r\n *\r\n * `text` can be any valid HTML.\r\n *\r\n * `title` is currently not supported.\r\n *\r\n * @param text Popup contents\r\n * @param title Popup title\r\n * @return Popup instance\r\n */\r\n SVGContainer.prototype.openPopup = function (text, title) {\r\n var popup = this.popups.create();\r\n popup.content = text;\r\n if ($type.hasValue(title)) {\r\n popup.title = title;\r\n }\r\n popup.open();\r\n return popup;\r\n };\r\n /**\r\n * Closes all currently open popup windows\r\n */\r\n SVGContainer.prototype.closeAllPopups = function () {\r\n this.popups.each(function (popup) {\r\n popup.close();\r\n });\r\n };\r\n Object.defineProperty(SVGContainer.prototype, \"readerAlertElement\", {\r\n /**\r\n * ==========================================================================\r\n * ACCESSIBILITY STUFF\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n /**\r\n * A `<div>` element used as as placeholder to trigger screen alerts.\r\n *\r\n * @sunce 4.9.2\r\n * @return Element\r\n */\r\n get: function () {\r\n if (!$type.hasValue(this._readerAlertElement)) {\r\n // Create element\r\n var div = document.createElement(\"div\");\r\n div.setAttribute(\"role\", \"alert\");\r\n div.style.zIndex = \"-100000\";\r\n div.style.opacity = \"0\";\r\n div.style.position = \"absolute\";\r\n div.style.top = \"0\";\r\n this.SVGContainer.appendChild(div);\r\n this._readerAlertElement = div;\r\n }\r\n return this._readerAlertElement;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Triggers screen reader read out a message.\r\n *\r\n * @since 4.9.2\r\n * @param text Alert text\r\n */\r\n SVGContainer.prototype.readerAlert = function (text) {\r\n this.readerAlertElement.innerHTML = text;\r\n };\r\n /**\r\n * ==========================================================================\r\n * OTHER STUFF\r\n * ==========================================================================\r\n * @hidden\r\n */\r\n SVGContainer.prototype.checkTransform = function (div) {\r\n if (window.getComputedStyle) {\r\n if (div && div.style) {\r\n var style = window.getComputedStyle(div, null);\r\n if (style) {\r\n var matrix = style.getPropertyValue(\"-webkit-transform\") ||\r\n style.getPropertyValue(\"-moz-transform\") ||\r\n style.getPropertyValue(\"-ms-transform\") ||\r\n style.getPropertyValue(\"-o-transform\") ||\r\n style.getPropertyValue(\"transform\");\r\n if (matrix && matrix !== \"none\") {\r\n var values = matrix.split('(')[1].split(')')[0].split(',');\r\n var a = Number(values[0]);\r\n var b = Number(values[1]);\r\n var scale = Math.sqrt(a * a + b * b);\r\n if (!isNaN(scale)) {\r\n this.cssScale *= scale;\r\n }\r\n }\r\n }\r\n }\r\n if (div.parentNode && div.parentNode instanceof HTMLElement) {\r\n this.checkTransform(div.parentNode);\r\n }\r\n }\r\n };\r\n return SVGContainer;\r\n}());\r\nexport { SVGContainer };\r\n","import { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { registry } from \"../Registry\";\r\nimport * as $path from \"./Path\";\r\nimport * as $array from \"../utils/Array\";\r\nimport * as $utils from \"../utils/Utils\";\r\nimport * as $math from \"../utils/Math\";\r\n/**\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\nvar Tension = /** @class */ (function () {\r\n /**\r\n * Constructor.\r\n *\r\n * @param tensionX [description]\r\n * @param tensionY [description]\r\n */\r\n function Tension(tensionX, tensionY) {\r\n this._tensionX = tensionX;\r\n this._tensionY = tensionY;\r\n }\r\n /**\r\n * [smooth description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param points [description]\r\n * @return [description]\r\n */\r\n Tension.prototype.smooth = function (points) {\r\n for (var i = points.length - 1; i > 0; i--) {\r\n var p0 = points[i];\r\n var p1 = points[i - 1];\r\n if (Math.abs(p0.x - p1.x) < 0.1 && Math.abs(p0.y - p1.y) < 0.1) {\r\n points.splice(i - 1, 1);\r\n }\r\n }\r\n var tensionX = this._tensionX;\r\n var tensionY = this._tensionY;\r\n if (points.length < 3 || (tensionX >= 1 && tensionY >= 1)) {\r\n return $path.polyline(points);\r\n }\r\n var first = points[0];\r\n var last = points[points.length - 1];\r\n var closed = false;\r\n if ($math.round(first.x, 3) == $math.round(last.x) && $math.round(first.y) == $math.round(last.y)) {\r\n closed = true;\r\n }\r\n // Can't moveTo here, as it wont be possible to have fill then.\r\n var path = \"\";\r\n for (var i = 0, len = points.length - 1; i < len; i++) {\r\n var p0 = points[i - 1];\r\n var p1 = points[i];\r\n var p2 = points[i + 1];\r\n var p3 = points[i + 2];\r\n if (i === 0) {\r\n if (closed) {\r\n p0 = points[points.length - 2];\r\n }\r\n else {\r\n p0 = points[i];\r\n }\r\n }\r\n else if (i == points.length - 2) {\r\n if (closed) {\r\n p3 = points[1];\r\n }\r\n else {\r\n p3 = points[i + 1];\r\n }\r\n }\r\n var controlPointA = $math.getCubicControlPointA(p0, p1, p2, p3, tensionX, tensionY);\r\n var controlPointB = $math.getCubicControlPointB(p0, p1, p2, p3, tensionX, tensionY);\r\n path += $path.cubicCurveTo(p2, controlPointA, controlPointB);\r\n }\r\n return path;\r\n };\r\n return Tension;\r\n}());\r\nexport { Tension };\r\n/**\r\n * Returns a waved line SVG path between two points.\r\n *\r\n * @ignore Exclude from docs\r\n * @param point1 Starting point\r\n * @param point2 Ending point\r\n * @param waveLength Wave length\r\n * @param waveHeight Wave height\r\n * @param adjustWaveLength Adjust wave length based on the actual line length\r\n * @return SVG path\r\n */\r\nexport function wavedLine(point1, point2, waveLength, waveHeight, tension, adjustWaveLength) {\r\n var x1 = point1.x;\r\n var y1 = point1.y;\r\n var x2 = point2.x;\r\n var y2 = point2.y;\r\n var distance = $math.getDistance(point1, point2);\r\n if (adjustWaveLength) {\r\n waveLength = distance / Math.round(distance / waveLength);\r\n }\r\n var d = registry.getCache($utils.stringify([\"wavedLine\", point1.x, point2.x, point1.y, point2.y, waveLength, waveHeight]));\r\n if (!d) {\r\n if (distance > 0) {\r\n var angle = Math.atan2(y2 - y1, x2 - x1);\r\n var cos = Math.cos(angle);\r\n var sin = Math.sin(angle);\r\n var waveLengthX = waveLength * cos;\r\n var waveLengthY = waveLength * sin;\r\n if (waveLength <= 1 || waveHeight <= 1) {\r\n d = $path.lineTo(point2);\r\n }\r\n else {\r\n var halfWaveCount = Math.round(2 * distance / waveLength);\r\n var points = [];\r\n var sign_1 = 1;\r\n if (x2 < x1) {\r\n sign_1 *= -1;\r\n }\r\n if (y2 < y1) {\r\n sign_1 *= -1;\r\n }\r\n for (var i = 0; i <= halfWaveCount; i++) {\r\n sign_1 *= -1;\r\n var x = x1 + i * waveLengthX / 2 + sign_1 * waveHeight / 2 * sin;\r\n var y = y1 + i * waveLengthY / 2 - sign_1 * waveHeight / 2 * cos;\r\n points.push({ x: x, y: y });\r\n }\r\n d = new Tension(tension, tension).smooth(points);\r\n }\r\n }\r\n else {\r\n d = \"\";\r\n }\r\n registry.setCache($utils.stringify([\"wavedLine\", point1.x, point2.x, point1.y, point2.y, waveLength, waveHeight]), d);\r\n }\r\n return d;\r\n}\r\nvar Monotone = /** @class */ (function () {\r\n function Monotone(reversed, info) {\r\n this._reversed = reversed;\r\n this._closed = info.closed;\r\n }\r\n // According to https://en.wikipedia.org/wiki/Cubic_Hermite_spline#Representations\r\n // \"you can express cubic Hermite interpolation in terms of cubic Bézier curves\r\n // with respect to the four values p0, p0 + m0 / 3, p1 - m1 / 3, p1\".\r\n Monotone.prototype._curve = function (x0, x1, y0, y1, t0, t1) {\r\n var dx = (x1 - x0) / 3;\r\n if (this._reversed) {\r\n return $path.cubicCurveTo({ x: y1, y: x1 }, { x: y0 + dx * t0, y: x0 + dx }, { x: y1 - dx * t1, y: x1 - dx });\r\n }\r\n else {\r\n return $path.cubicCurveTo({ x: x1, y: y1 }, { x: x0 + dx, y: y0 + dx * t0 }, { x: x1 - dx, y: y1 - dx * t1 });\r\n }\r\n };\r\n Monotone.prototype.smooth = function (points) {\r\n var _this = this;\r\n var x0 = NaN;\r\n var x1 = NaN;\r\n var y0 = NaN;\r\n var y1 = NaN;\r\n var t0 = NaN;\r\n var point = 0;\r\n var output = \"\";\r\n $array.each(points, function (_a) {\r\n var x = _a.x, y = _a.y;\r\n if (_this._reversed) {\r\n var temp = x;\r\n x = y;\r\n y = temp;\r\n }\r\n var t1 = NaN;\r\n if (!(x === x1 && y === y1)) {\r\n switch (point) {\r\n case 0:\r\n point = 1;\r\n if (_this._reversed) {\r\n output += $path.lineTo({ x: y, y: x });\r\n }\r\n else {\r\n output += $path.lineTo({ x: x, y: y });\r\n }\r\n break;\r\n case 1:\r\n point = 2;\r\n break;\r\n case 2:\r\n point = 3;\r\n output += _this._curve(x0, x1, y0, y1, slope2(x0, x1, y0, y1, t1 = slope3(x0, x1, y0, y1, x, y)), t1);\r\n break;\r\n default:\r\n output += _this._curve(x0, x1, y0, y1, t0, t1 = slope3(x0, x1, y0, y1, x, y));\r\n break;\r\n }\r\n x0 = x1;\r\n x1 = x;\r\n y0 = y1;\r\n y1 = y;\r\n t0 = t1;\r\n }\r\n });\r\n switch (point) {\r\n case 2:\r\n if (this._reversed) {\r\n output += $path.lineTo({ x: y1, y: x1 });\r\n }\r\n else {\r\n output += $path.lineTo({ x: x1, y: y1 });\r\n }\r\n break;\r\n case 3:\r\n output += this._curve(x0, x1, y0, y1, t0, slope2(x0, x1, y0, y1, t0));\r\n break;\r\n }\r\n if (this._closed) {\r\n output += $path.closePath();\r\n }\r\n return output;\r\n };\r\n return Monotone;\r\n}());\r\nexport { Monotone };\r\n// TODO move this someplace else\r\nfunction sign(x) {\r\n return x < 0 ? -1 : 1;\r\n}\r\nfunction slope2(x0, x1, y0, y1, t) {\r\n var h = x1 - x0;\r\n return h ? (3 * (y1 - y0) / h - t) / 2 : t;\r\n}\r\nfunction slope3(x0, x1, y0, y1, x2, y2) {\r\n var h0 = x1 - x0;\r\n var h1 = x2 - x1;\r\n var s0 = (y1 - y0) / (h0 || h1 < 0 && -0);\r\n var s1 = (y2 - y1) / (h1 || h0 < 0 && -0);\r\n var p = (s0 * h1 + s1 * h0) / (h0 + h1);\r\n return (sign(s0) + sign(s1)) * Math.min(Math.abs(s0), Math.abs(s1), 0.5 * Math.abs(p)) || 0;\r\n}\r\nvar MonotoneX = /** @class */ (function (_super) {\r\n __extends(MonotoneX, _super);\r\n function MonotoneX(info) {\r\n return _super.call(this, false, info) || this;\r\n }\r\n return MonotoneX;\r\n}(Monotone));\r\nexport { MonotoneX };\r\nvar MonotoneY = /** @class */ (function (_super) {\r\n __extends(MonotoneY, _super);\r\n function MonotoneY(info) {\r\n return _super.call(this, true, info) || this;\r\n }\r\n return MonotoneY;\r\n}(Monotone));\r\nexport { MonotoneY };\r\n/**\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\nvar Basis = /** @class */ (function () {\r\n /**\r\n * Constructor.\r\n *\r\n * @param info [description]\r\n */\r\n function Basis(info) {\r\n this._closed = info.closed;\r\n }\r\n /**\r\n * [smooth description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param points [description]\r\n * @return [description]\r\n */\r\n Basis.prototype.smooth = function (points) {\r\n var _this = this;\r\n var x0 = NaN;\r\n var x1 = NaN;\r\n var x2 = NaN;\r\n var x3 = NaN;\r\n var x4 = NaN;\r\n var y0 = NaN;\r\n var y1 = NaN;\r\n var y2 = NaN;\r\n var y3 = NaN;\r\n var y4 = NaN;\r\n var point = 0;\r\n var output = \"\";\r\n var pushCurve = function (x, y) {\r\n output += $path.cubicCurveTo({\r\n x: (x0 + 4 * x1 + x) / 6,\r\n y: (y0 + 4 * y1 + y) / 6\r\n }, {\r\n x: (2 * x0 + x1) / 3,\r\n y: (2 * y0 + y1) / 3\r\n }, {\r\n x: (x0 + 2 * x1) / 3,\r\n y: (y0 + 2 * y1) / 3\r\n });\r\n };\r\n var pushPoint = function (_a) {\r\n var x = _a.x, y = _a.y;\r\n switch (point) {\r\n case 0:\r\n point = 1;\r\n if (_this._closed) {\r\n x2 = x;\r\n y2 = y;\r\n }\r\n else {\r\n output += $path.lineTo({ x: x, y: y });\r\n }\r\n break;\r\n case 1:\r\n point = 2;\r\n if (_this._closed) {\r\n x3 = x;\r\n y3 = y;\r\n }\r\n break;\r\n case 2:\r\n point = 3;\r\n if (_this._closed) {\r\n x4 = x;\r\n y4 = y;\r\n output += $path.moveTo({ x: (x0 + 4 * x1 + x) / 6, y: (y0 + 4 * y1 + y) / 6 });\r\n break;\r\n }\r\n else {\r\n output += $path.lineTo({ x: (5 * x0 + x1) / 6, y: (5 * y0 + y1) / 6 });\r\n // fall-through\r\n }\r\n default:\r\n pushCurve(x, y);\r\n break;\r\n }\r\n x0 = x1;\r\n x1 = x;\r\n y0 = y1;\r\n y1 = y;\r\n };\r\n $array.each(points, pushPoint);\r\n if (this._closed) {\r\n switch (point) {\r\n case 1:\r\n output += $path.moveTo({ x: x2, y: y2 });\r\n output += $path.closePath();\r\n break;\r\n case 2:\r\n output += $path.moveTo({ x: (x2 + 2 * x3) / 3, y: (y2 + 2 * y3) / 3 });\r\n output += $path.lineTo({ x: (x3 + 2 * x2) / 3, y: (y3 + 2 * y2) / 3 });\r\n output += $path.closePath();\r\n break;\r\n case 3:\r\n pushPoint({ x: x2, y: y2 });\r\n pushPoint({ x: x3, y: y3 });\r\n pushPoint({ x: x4, y: y4 });\r\n break;\r\n }\r\n }\r\n else {\r\n switch (point) {\r\n case 3:\r\n pushCurve(x1, y1);\r\n // fall-through\r\n case 2:\r\n output += $path.lineTo({ x: x1, y: y1 });\r\n break;\r\n }\r\n output += $path.closePath();\r\n }\r\n return output;\r\n };\r\n return Basis;\r\n}());\r\nexport { Basis };\r\n","/**\r\n * Rectangular pattern module.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Pattern } from \"./Pattern\";\r\nimport { registry } from \"../../Registry\";\r\n;\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Circular pattern\r\n */\r\nvar CirclePattern = /** @class */ (function (_super) {\r\n __extends(CirclePattern, _super);\r\n /**\r\n * Constructor\r\n */\r\n function CirclePattern() {\r\n var _this = _super.call(this) || this;\r\n _this.properties[\"radius\"] = 2;\r\n _this._circle = _this.paper.add(\"circle\");\r\n _this.addElement(_this._circle);\r\n _this.shapeRendering = \"auto\";\r\n return _this;\r\n }\r\n /**\r\n * Draws the circle element.\r\n */\r\n CirclePattern.prototype.draw = function () {\r\n _super.prototype.draw.call(this);\r\n if (this._circle) {\r\n this._circle.attr({ \"r\": this.radius, \"cx\": this.width / 2, \"cy\": this.height / 2 });\r\n }\r\n };\r\n Object.defineProperty(CirclePattern.prototype, \"radius\", {\r\n /**\r\n * @return Radius (px)\r\n */\r\n get: function () {\r\n return this.properties[\"radius\"];\r\n },\r\n /**\r\n * Circle radius in pixels.\r\n *\r\n * @param value Radius (px)\r\n */\r\n set: function (value) {\r\n this.properties[\"radius\"] = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return CirclePattern;\r\n}(Pattern));\r\nexport { CirclePattern };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"CirclePattern\"] = CirclePattern;\r\n","import { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { BaseObject } from \"../../Base\";\r\nimport { registry } from \"../../Registry\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * A base class for color modifiers.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\nvar ColorModifier = /** @class */ (function (_super) {\r\n __extends(ColorModifier, _super);\r\n /**\r\n * Constructor\r\n */\r\n function ColorModifier() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"ColorModifier\";\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Modifies color value.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Original color\r\n * @return Modified\r\n */\r\n ColorModifier.prototype.modify = function (value) {\r\n return value;\r\n };\r\n return ColorModifier;\r\n}(BaseObject));\r\nexport { ColorModifier };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"ColorModifier\"] = ColorModifier;\r\n","import { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { ColorModifier } from \"./ColorModifier\";\r\nimport { registry } from \"../../Registry\";\r\nimport * as $math from \"../../utils/Math\";\r\nimport * as $type from \"../../utils/Type\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * This class can be used to modify linear gradient steps, changing visual\r\n * properties like lightness, brightness, opacity of each set.\r\n *\r\n * It can also set offsets for each gradient step.\r\n *\r\n * E.g. if I want to fill a columns in a column series to be a solid fill from\r\n * top to 80% of height, then gradually fades out, I can use the following\r\n * gradient modifier as a `fillModifier`:\r\n *\r\n * ```TypeScript\r\n * let fillModifier = new am4core.GradientModifier();\r\n * fillModifier.opacities = [1, 1, 0];\r\n * fillModifier.offsets = [0, 0.8, 1];\r\n * columnSeries.columns.template.fillModifier = fillModifier;\r\n * ```\r\n * ```JavaScript\r\n * var fillModifier = new am4core.GradientModifier();\r\n * fillModifier.opacities = [1, 1, 0];\r\n * fillModifier.offsets = [0, 0.8, 1];\r\n * columnSeries.columns.template.fillModifier = fillModifier;\r\n * ```\r\n * ```JSON\r\n * \"series\": [{\r\n * \"type\": \"ColumnSeries\",\r\n * \"columns\": {\r\n * \"fillModifier\": {\r\n * \"type\": \"GradientModifier\",\r\n * \"opacities\": [1, 1, 0],\r\n * \"offsets\": [0, 0.8, 1]\r\n * }\r\n * }\r\n * }]\r\n * ```\r\n */\r\nvar GradientModifier = /** @class */ (function (_super) {\r\n __extends(GradientModifier, _super);\r\n /**\r\n * Constructor.\r\n */\r\n function GradientModifier() {\r\n var _this = _super.call(this) || this;\r\n _this.lightnesses = [];\r\n _this.brightnesses = [];\r\n _this.opacities = [];\r\n _this.offsets = [];\r\n _this.className = \"GradientModifier\";\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n Object.defineProperty(GradientModifier.prototype, \"lightnesses\", {\r\n /**\r\n * @return Lightness values\r\n */\r\n get: function () {\r\n return this._lightnesses;\r\n },\r\n /**\r\n * An array of lightness values for each step.\r\n *\r\n * @param value Lightness values\r\n */\r\n set: function (value) {\r\n this._lightnesses = value;\r\n this._brightnesses = [];\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(GradientModifier.prototype, \"brightnesses\", {\r\n /**\r\n * @return Brightness values\r\n */\r\n get: function () {\r\n return this._brightnesses;\r\n },\r\n /**\r\n * An array of brightness values for each step.\r\n *\r\n * @param value Brightness values\r\n */\r\n set: function (value) {\r\n this._brightnesses = value;\r\n this._lightnesses = [];\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(GradientModifier.prototype, \"opacities\", {\r\n /**\r\n * @return Opacity values\r\n */\r\n get: function () {\r\n return this._opacities;\r\n },\r\n /**\r\n * An array of opacity values for each step.\r\n *\r\n * @param value Opacity values\r\n */\r\n set: function (value) {\r\n this._opacities = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(GradientModifier.prototype, \"offsets\", {\r\n /**\r\n * @return Offsets\r\n */\r\n get: function () {\r\n return this._offsets;\r\n },\r\n /**\r\n * An array of relative position (0-1) for each step.\r\n *\r\n * If not set, all steps will be of equal relative length.\r\n *\r\n * @param value Offsets\r\n */\r\n set: function (value) {\r\n this._offsets = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Modifies the color based on step setting.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Source color\r\n * @return A gradient that matches set modification rules\r\n */\r\n GradientModifier.prototype.modify = function (value) {\r\n // Clear current gradient\r\n this.gradient.clear();\r\n // Get step count\r\n var count = 0;\r\n if (this.opacities) {\r\n count = $math.max(count, this.opacities.length);\r\n }\r\n if (this.lightnesses) {\r\n count = $math.max(count, this.lightnesses.length);\r\n }\r\n if (this.brightnesses) {\r\n count = $math.max(count, this.brightnesses.length);\r\n }\r\n // Init step values\r\n var opacity = 1, lightness, brightness;\r\n // Apply steps\r\n for (var i = 0; i < count; i++) {\r\n // Take base color\r\n var color = value;\r\n // Check if there are any parameters for this step\r\n if (this.opacities && $type.isNumber(this.opacities[i])) {\r\n opacity = this.opacities[i];\r\n }\r\n if (this.lightnesses && $type.isNumber(this.lightnesses[i])) {\r\n lightness = this.lightnesses[i];\r\n brightness = undefined;\r\n }\r\n if (this.brightnesses && $type.isNumber(this.brightnesses[i])) {\r\n brightness = this.brightnesses[i];\r\n lightness = undefined;\r\n }\r\n // Check if we need to brighten/lighten color\r\n if ($type.isNumber(brightness)) {\r\n color = value.brighten(this.brightnesses[i]);\r\n }\r\n else if ($type.isNumber(lightness)) {\r\n color = value.lighten(this.lightnesses[i]);\r\n }\r\n // Get offset (it's OK if it's undefined)\r\n var offset = this.offsets[i];\r\n // Apply step\r\n this.gradient.addColor(color, opacity, offset);\r\n }\r\n return this.gradient;\r\n };\r\n GradientModifier.prototype.copyFrom = function (source) {\r\n _super.prototype.copyFrom.call(this, source);\r\n this._offsets = source.offsets;\r\n this._brightnesses = source.brightnesses;\r\n this._lightnesses = source.lightnesses;\r\n this._opacities = source.opacities;\r\n };\r\n return GradientModifier;\r\n}(ColorModifier));\r\nexport { GradientModifier };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"GradientModifier\"] = GradientModifier;\r\n","import { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Pattern } from \"./Pattern\";\r\nimport { registry } from \"../../Registry\";\r\nimport * as $path from \"../../rendering/Path\";\r\n;\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Line pattern.\r\n */\r\nvar LinePattern = /** @class */ (function (_super) {\r\n __extends(LinePattern, _super);\r\n /**\r\n * Constructor\r\n */\r\n function LinePattern() {\r\n var _this = _super.call(this) || this;\r\n _this.properties[\"gap\"] = 0;\r\n _this._line = _this.paper.add(\"path\");\r\n _this.addElement(_this._line);\r\n return _this;\r\n }\r\n /**\r\n * Draws the pattern.\r\n */\r\n LinePattern.prototype.draw = function () {\r\n _super.prototype.draw.call(this);\r\n if (Math.round(this.rotation / 90) != this.rotation / 90) {\r\n this.properties[\"shapeRendering\"] = \"auto\";\r\n }\r\n if (this._line) {\r\n var w = this.width;\r\n var h = this.height;\r\n var path = \"\";\r\n if (!this.gap) {\r\n if (Math.round(this.rotation / 90) != this.rotation / 90) {\r\n path = $path.moveTo({ x: -w, y: h / 2 }) + $path.lineTo({ x: w * 2, y: h / 2 });\r\n this.properties[\"rotationX\"] = this.width / 2;\r\n this.properties[\"rotationY\"] = this.height / 2;\r\n }\r\n else {\r\n path = $path.moveTo({ x: 0, y: 0 }) + $path.lineTo({ x: w, y: 0 });\r\n }\r\n }\r\n else {\r\n var step = this.gap + this.strokeWidth;\r\n var count = this.height / step;\r\n for (var i = -count / 2; i < count * 1.5; i++) {\r\n if (Math.round(this.rotation / 90) != this.rotation / 90) {\r\n path += $path.moveTo({ x: -w, y: (i + 0.5) * step }) + $path.lineTo({ x: w * 2, y: (i + 0.5) * step });\r\n this.properties[\"rotationX\"] = this.width / 2;\r\n this.properties[\"rotationY\"] = this.height / 2;\r\n }\r\n else {\r\n path += $path.moveTo({ x: -w, y: i * step }) + $path.lineTo({ x: w * 2, y: i * step });\r\n }\r\n }\r\n }\r\n this._line.attr({ \"d\": path });\r\n }\r\n };\r\n Object.defineProperty(LinePattern.prototype, \"gap\", {\r\n /**\r\n * @return gap\r\n */\r\n get: function () {\r\n return this.properties[\"gap\"];\r\n },\r\n /**\r\n * Number of pixels between pattern lines.\r\n *\r\n * The pattern will automatically draw required number of lines to fill\r\n * pattern area maintaining `gap` distance between them.\r\n *\r\n * 0 (zero) means only single line will be drawn.\r\n *\r\n * @default 0\r\n * @since 4.7.7\r\n */\r\n set: function (value) {\r\n this.properties[\"gap\"] = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return LinePattern;\r\n}(Pattern));\r\nexport { LinePattern };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"LinePattern\"] = LinePattern;\r\n","/**\r\n * Contains code and logic for generating linear gradients.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { BaseObject } from \"../../Base\";\r\nimport { List } from \"../../utils/List\";\r\nimport { getGhostPaper } from \"../Paper\";\r\nimport { registry } from \"../../Registry\";\r\nimport * as $iter from \"../../utils/Iterator\";\r\nimport * as $math from \"../../utils/Math\";\r\nimport * as $type from \"../../utils/Type\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Linear gradient class.\r\n */\r\nvar LinearGradient = /** @class */ (function (_super) {\r\n __extends(LinearGradient, _super);\r\n /**\r\n * Constructor.\r\n */\r\n function LinearGradient() {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n /**\r\n * List of colors switch definitions in a gradient.\r\n */\r\n _this._stops = new List();\r\n /**\r\n * Gradient direction.\r\n */\r\n _this._rotation = 0;\r\n _this.className = \"LinearGradient\";\r\n _this._stops.events.on(\"setIndex\", _this.validate, _this);\r\n _this._stops.events.on(\"inserted\", _this.validate, _this);\r\n // Create element\r\n _this.element = _this.paper.addGroup(\"linearGradient\");\r\n _this.id = \"gradient-\" + registry.getUniqueId();\r\n _this.element.attr({ \"id\": _this.id });\r\n _this._disposers.push(_this.element);\r\n // Apply theme\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Draws gradient.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n LinearGradient.prototype.validate = function () {\r\n var _this = this;\r\n var rotation = (this._rotation + 90) * $math.RADIANS;\r\n var x1 = Math.round(50 + Math.sin(rotation + Math.PI) * 50) + '%';\r\n var y1 = Math.round(50 + Math.cos(rotation) * 50) + '%';\r\n var x2 = Math.round(50 + Math.sin(rotation) * 50) + '%';\r\n var y2 = Math.round(50 + Math.cos(rotation + Math.PI) * 50) + '%';\r\n var gradientElement = this.element;\r\n gradientElement.removeChildNodes();\r\n gradientElement.attr({ \"x1\": x1, \"x2\": x2, \"y1\": y1, \"y2\": y2 });\r\n $iter.each($iter.indexed(this._stops.iterator()), function (a) {\r\n var i = a[0];\r\n var stop = a[1];\r\n var offset = stop.offset;\r\n if (!$type.isNumber(offset)) {\r\n offset = i / (_this._stops.length - 1);\r\n }\r\n var gradientStop = _this.paper.add(\"stop\");\r\n if ($type.hasValue(stop.color)) {\r\n gradientStop.attr({ \"stop-color\": stop.color.toString() });\r\n }\r\n if ($type.isNumber(stop.opacity)) {\r\n gradientStop.attr({ \"stop-opacity\": stop.opacity });\r\n }\r\n if ($type.isNumber(offset)) {\r\n gradientStop.attr({ \"offset\": offset });\r\n }\r\n gradientElement.add(gradientStop);\r\n });\r\n };\r\n /**\r\n * Clears the gradient.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n LinearGradient.prototype.clear = function () {\r\n this._stops.clear();\r\n };\r\n /**\r\n * Adds a color step to the gradient.\r\n *\r\n * @param color Color (hex code or named color)\r\n * @param opacity Opacity (value from 0 to 1; 0 completely transaprent, 1 fully opaque)\r\n * @param offset Position of color in the gradient (value 0 to 1; 0 meaning start of the gradient and 1 end)\r\n */\r\n LinearGradient.prototype.addColor = function (color, opacity, offset) {\r\n this._stops.push({ color: color, opacity: opacity, offset: offset });\r\n };\r\n Object.defineProperty(LinearGradient.prototype, \"stops\", {\r\n /**\r\n * A list of color stops in the gradient.\r\n *\r\n * @return Stops\r\n */\r\n get: function () {\r\n return this._stops;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(LinearGradient.prototype, \"paper\", {\r\n /**\r\n * @ignore Exclude from docs\r\n * @return Paper\r\n */\r\n get: function () {\r\n if (this._paper) {\r\n return this._paper;\r\n }\r\n return getGhostPaper();\r\n },\r\n /**\r\n * [[Paper]] instace to use for the gradient.\r\n *\r\n * @ignore Exclude from docs\r\n * @param paper Paper\r\n */\r\n set: function (paper) {\r\n if (this._paper != paper) {\r\n this._paper = paper;\r\n this.validate();\r\n paper.appendDef(this.element);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(LinearGradient.prototype, \"rotation\", {\r\n /**\r\n * @return Rotation\r\n */\r\n get: function () {\r\n return this._rotation;\r\n },\r\n /**\r\n * Rotation (direction) of the gradient in degrees.\r\n *\r\n * @param value Rotation\r\n */\r\n set: function (value) {\r\n //this.element.attr({ \"gradientTransform\": \"rotate(\" + value + \" 10 100)\" });\r\n this._rotation = value;\r\n this.validate();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n LinearGradient.prototype.copyFrom = function (source) {\r\n _super.prototype.copyFrom.call(this, source);\r\n this.stops.copyFrom(source.stops);\r\n this._rotation = source.rotation;\r\n };\r\n Object.defineProperty(LinearGradient.prototype, \"gradientUnits\", {\r\n /**\r\n * Which units are used when drawing gradient filter.\r\n *\r\n * Use `\"userSpaceOnUse\"` when applying gradient on a perfectly straight line.\r\n *\r\n * @since 4.9.17\r\n * @default objectBoundingBox\r\n * @param value Filter units\r\n */\r\n set: function (value) {\r\n this.element.attr({ gradientUnits: value });\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return LinearGradient;\r\n}(BaseObject));\r\nexport { LinearGradient };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"LinearGradient\"] = LinearGradient;\r\n","import { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { LinearGradient } from \"./LinearGradient\";\r\nimport { GradientModifier } from \"./GradientModifier\";\r\nimport { registry } from \"../../Registry\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * This class can be used to modify linear gradient steps, changing visual\r\n * properties like lightness, brightness, opacity of each set.\r\n *\r\n * It can also set offsets for each gradient step.\r\n *\r\n * E.g. if I want to fill a columns in a column series to be a solid fill from\r\n * top to 80% of height, then gradually fades out, I can use the following\r\n * gradient modifier as a `fillModifier`:\r\n *\r\n * ```TypeScript\r\n * let fillModifier = new am4core.LinearGradientModifier();\r\n * fillModifier.opacities = [1, 1, 0];\r\n * fillModifier.offsets = [0, 0.8, 1];\r\n * columnSeries.columns.template.fillModifier = fillModifier;\r\n * ```\r\n * ```JavaScript\r\n * var fillModifier = new am4core.LinearGradientModifier();\r\n * fillModifier.opacities = [1, 1, 0];\r\n * fillModifier.offsets = [0, 0.8, 1];\r\n * columnSeries.columns.template.fillModifier = fillModifier;\r\n * ```\r\n * ```JSON\r\n * \"series\": [{\r\n * \"type\": \"ColumnSeries\",\r\n * \"columns\": {\r\n * \"fillModifier\": {\r\n * \"type\": \"LinearGradientModifier\",\r\n * \"opacities\": [1, 1, 0],\r\n * \"offsets\": [0, 0.8, 1]\r\n * }\r\n * }\r\n * }]\r\n * ```\r\n */\r\nvar LinearGradientModifier = /** @class */ (function (_super) {\r\n __extends(LinearGradientModifier, _super);\r\n /**\r\n * Constructor.\r\n */\r\n function LinearGradientModifier() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"LinearGradientModifier\";\r\n _this.gradient = new LinearGradient();\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n LinearGradientModifier.prototype.copyFrom = function (source) {\r\n _super.prototype.copyFrom.call(this, source);\r\n this.gradient = source.gradient.clone();\r\n };\r\n return LinearGradientModifier;\r\n}(GradientModifier));\r\nexport { LinearGradientModifier };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"LinearGradientModifier\"] = LinearGradientModifier;\r\n","/**\r\n * Pattern module.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { BaseObject } from \"../../Base\";\r\nimport { getGhostPaper } from \"../Paper\";\r\nimport { List, ListDisposer } from \"../../utils/List\";\r\nimport { Animation, AnimationDisposer } from \"../../utils/Animation\";\r\nimport { registry } from \"../../Registry\";\r\nimport { InterfaceColorSet } from \"../../utils/InterfaceColorSet\";\r\nimport * as $iter from \"../../utils/Iterator\";\r\nimport * as $object from \"../../utils/Object\";\r\nimport * as $type from \"../../utils/Type\";\r\n;\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Base class to define patterns.\r\n */\r\nvar Pattern = /** @class */ (function (_super) {\r\n __extends(Pattern, _super);\r\n //public propertyValues = new Dictionary<PatternProperties, any>();\r\n /**\r\n * Constructor\r\n */\r\n function Pattern() {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n /**\r\n * List of elements the pattern consists of.\r\n */\r\n _this._elements = new List();\r\n /**\r\n * A storage for Filter property/value pairs.\r\n *\r\n * @ignore Exclude from docs\r\n * @see {@link PatternProperties}\r\n */\r\n _this.properties = {};\r\n _this.className = \"Pattern\";\r\n // Set defaults\r\n _this.width = 10;\r\n _this.height = 10;\r\n _this.x = 0;\r\n _this.y = 0;\r\n _this.patternUnits = \"userSpaceOnUse\";\r\n var interfaceColors = new InterfaceColorSet();\r\n _this.backgroundFill = interfaceColors.getFor(\"background\");\r\n _this.backgroundOpacity = 0;\r\n _this.fillOpacity = 1;\r\n _this.fill = interfaceColors.getFor(\"alternativeBackground\");\r\n _this.stroke = interfaceColors.getFor(\"alternativeBackground\");\r\n _this.strokeOpacity = 1;\r\n _this.strokeWidth = 1;\r\n _this.shapeRendering = \"crispEdges\";\r\n _this.rotation = 0;\r\n // Create main group to store pattern elements inelements\r\n _this.element = _this.paper.addGroup(\"pattern\");\r\n _this.id = \"pattern-\" + registry.getUniqueId();\r\n _this.element.attr({ \"id\": _this.id });\r\n _this._disposers.push(_this.element);\r\n // Make elements disposable\r\n _this._disposers.push(new ListDisposer(_this._elements));\r\n // Request again to trigger getter/setter code\r\n _this.patternUnits = _this.patternUnits;\r\n _this.width = _this.width;\r\n _this.height = _this.height;\r\n // Apply theme\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Draws the pattern.\r\n */\r\n Pattern.prototype.draw = function () {\r\n var _this = this;\r\n var patternElement = this.element;\r\n if (patternElement) {\r\n patternElement.removeChildNodes();\r\n var background = this.paper.add(\"rect\");\r\n background.attr({ \"width\": this.width, \"height\": this.height, \"shape-rendering\": \"crispEdges\", \"fill\": this.backgroundFill.hex, \"fill-opacity\": this.backgroundOpacity, \"stroke\": this.backgroundFill.hex, \"stroke-opacity\": 0 });\r\n patternElement.add(background);\r\n patternElement.attr({ \"x\": this.x, \"y\": this.y, \"width\": this.width, \"height\": this.height, \"stroke\": this.stroke.hex, \"fill\": this.fill.hex, \"fill-opacity\": this.fillOpacity, \"stroke-opacity\": this.strokeOpacity, \"stroke-width\": this.strokeWidth, \"shape-rendering\": this.shapeRendering, \"patternUnits\": this.patternUnits, \"stroke-dasharray\": this.strokeDasharray });\r\n $iter.each(this._elements.iterator(), function (element) {\r\n element.rotation = _this.rotation;\r\n element.rotationX = _this.properties[\"rotationX\"];\r\n element.rotationY = _this.properties[\"rotationY\"];\r\n _this.element.add(element);\r\n });\r\n }\r\n };\r\n /**\r\n * Animate pattern properties.\r\n *\r\n * @see {@link Animation}\r\n * @param animationOptions Animation options\r\n * @param duration Duration (ms)\r\n * @param easing Easing function\r\n * @return Animation instance\r\n */\r\n Pattern.prototype.animate = function (animationOptions, duration, easing) {\r\n return new Animation(this, animationOptions, duration, easing).start();\r\n };\r\n /**\r\n * Adds an element to the pattern.\r\n *\r\n * @param element Element\r\n */\r\n Pattern.prototype.addElement = function (element) {\r\n this._elements.push(element);\r\n this._disposers.push(element);\r\n };\r\n /**\r\n * Remove an element from the pattern.\r\n *\r\n * @param element Element\r\n */\r\n Pattern.prototype.removeElement = function (element) {\r\n this._elements.removeValue(element);\r\n this.removeDispose(element);\r\n };\r\n Object.defineProperty(Pattern.prototype, \"elements\", {\r\n /**\r\n * Returns the list of SVG elements comprising the pattern.\r\n *\r\n * @return Pattern elements\r\n */\r\n get: function () {\r\n return this._elements;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Pattern.prototype, \"fillOpacity\", {\r\n /**\r\n * @return Opacity (0-1)\r\n */\r\n get: function () {\r\n return this.properties[\"fillOpacity\"];\r\n },\r\n /**\r\n * Pattern fill opacity. (0-1)\r\n *\r\n * @param value Opacity (0-1)\r\n */\r\n set: function (value) {\r\n this.properties[\"fillOpacity\"] = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Pattern.prototype, \"fill\", {\r\n /**\r\n * @return Fill color\r\n */\r\n get: function () {\r\n return this.properties[\"fill\"];\r\n },\r\n /**\r\n * Fill color of the pattern.\r\n *\r\n * @param value Fill color\r\n */\r\n set: function (value) {\r\n this.properties[\"fill\"] = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Pattern.prototype, \"backgroundFill\", {\r\n /**\r\n * @return Background color\r\n */\r\n get: function () {\r\n return this.properties[\"backgroundFill\"];\r\n },\r\n /**\r\n * Pattern background fill color.\r\n *\r\n * @param value Background color\r\n */\r\n set: function (value) {\r\n this.properties[\"backgroundFill\"] = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Pattern.prototype, \"backgroundOpacity\", {\r\n /**\r\n * @return Background opacity (0-1)\r\n */\r\n get: function () {\r\n return this.properties[\"backgroundOpacity\"];\r\n },\r\n /**\r\n * Pattern backgorund opacity. (0-1)\r\n *\r\n * @param value Background opacity (0-1)\r\n */\r\n set: function (value) {\r\n this.properties[\"backgroundOpacity\"] = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Pattern.prototype, \"stroke\", {\r\n /**\r\n * @return Color\r\n */\r\n get: function () {\r\n return this.properties[\"stroke\"];\r\n },\r\n /**\r\n * Pattern stroke (border) color.\r\n *\r\n * @param value Color\r\n */\r\n set: function (value) {\r\n this.properties[\"stroke\"] = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Pattern.prototype, \"strokeOpacity\", {\r\n /**\r\n * @return Opacity (0-1)\r\n */\r\n get: function () {\r\n return this.properties[\"strokeOpacity\"];\r\n },\r\n /**\r\n * Pattern stroke opacity. (0-1)\r\n *\r\n * @param value Opacity (0-1)\r\n */\r\n set: function (value) {\r\n this.properties[\"strokeOpacity\"] = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Pattern.prototype, \"strokeWidth\", {\r\n /**\r\n * @return Stroke thickness (px)\r\n */\r\n get: function () {\r\n return this.properties[\"strokeWidth\"];\r\n },\r\n /**\r\n * Pattern stroke thickness in pixels.\r\n *\r\n * @param value Stroke thickness (px)\r\n */\r\n set: function (value) {\r\n this.properties[\"strokeWidth\"] = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Pattern.prototype, \"shapeRendering\", {\r\n get: function () {\r\n return this.properties[\"shapeRendering\"];\r\n },\r\n /**\r\n * Shape rendering\r\n * @param value [description]\r\n */\r\n set: function (value) {\r\n this.properties[\"shapeRendering\"] = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Pattern.prototype, \"rotation\", {\r\n /**\r\n * @return Rotation\r\n */\r\n get: function () {\r\n return this.properties[\"rotation\"];\r\n },\r\n /**\r\n * Pattern rotation in degrees.\r\n *\r\n * @param value Rotation\r\n */\r\n set: function (value) {\r\n this.properties[\"rotation\"] = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Pattern.prototype, \"patternUnits\", {\r\n /**\r\n * @return Units\r\n */\r\n get: function () {\r\n return this.properties[\"patternUnits\"];\r\n },\r\n /**\r\n * Pattern measuring units.\r\n *\r\n * Available options: \"userSpaceOnUse\" | \"objectBoundingBox\".\r\n *\r\n * @param value Units\r\n */\r\n set: function (value) {\r\n this.properties[\"patternUnits\"] = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Pattern.prototype, \"width\", {\r\n /**\r\n * @return Width (px)\r\n */\r\n get: function () {\r\n return this.properties[\"width\"];\r\n },\r\n /**\r\n * Pattern width in pixels.\r\n *\r\n * @param value Width (px)\r\n */\r\n set: function (value) {\r\n this.properties[\"width\"] = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Pattern.prototype, \"height\", {\r\n /**\r\n * @return Height (px)\r\n */\r\n get: function () {\r\n return this.properties[\"height\"];\r\n },\r\n /**\r\n * Pattern height in pixels.\r\n *\r\n * @param value Height (px)\r\n */\r\n set: function (value) {\r\n this.properties[\"height\"] = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Pattern.prototype, \"x\", {\r\n /**\r\n * @return X (px)\r\n */\r\n get: function () {\r\n return this.properties[\"x\"];\r\n },\r\n /**\r\n * X position. (pixels)\r\n *\r\n * @param value X (px)\r\n */\r\n set: function (value) {\r\n this.properties[\"x\"] = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Pattern.prototype, \"y\", {\r\n /**\r\n * @return Y (px)\r\n */\r\n get: function () {\r\n return this.properties[\"y\"];\r\n },\r\n /**\r\n * Y position (px).\r\n *\r\n * @param value Y (px)\r\n */\r\n set: function (value) {\r\n this.properties[\"y\"] = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Pattern.prototype, \"paper\", {\r\n /**\r\n * @ignore Exclude from docs\r\n * @return Paper\r\n */\r\n get: function () {\r\n if (this._paper) {\r\n return this._paper;\r\n }\r\n return getGhostPaper();\r\n },\r\n /**\r\n * [[Paper]] instance to draw pattern in.\r\n *\r\n * @ignore Exclude from docs\r\n * @param paper Paper\r\n */\r\n set: function (paper) {\r\n if (this._paper != paper) {\r\n this._paper = paper;\r\n this.draw();\r\n paper.appendDef(this.element);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Copies properties from another Pattern instance.\r\n *\r\n * @param source Source pattern\r\n */\r\n Pattern.prototype.copyFrom = function (source) {\r\n var _this = this;\r\n _super.prototype.copyFrom.call(this, source);\r\n $object.each(source.properties, function (key, value) {\r\n _this[key] = value;\r\n });\r\n };\r\n Object.defineProperty(Pattern.prototype, \"animations\", {\r\n /**\r\n * A list of animations currently running on the patter.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Animation list\r\n */\r\n get: function () {\r\n if (!this._animations) {\r\n this._animations = [];\r\n this._disposers.push(new AnimationDisposer(this._animations));\r\n }\r\n return this._animations;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Pattern.prototype, \"strokeDasharray\", {\r\n /**\r\n * @return `stroke-dasharray`\r\n */\r\n get: function () {\r\n return this.properties[\"strokeDashArray\"];\r\n },\r\n /**\r\n * A `stroke-dasharray` for the stroke (outline).\r\n *\r\n * \"Dasharray\" allows setting rules to make lines dashed, dotted, etc.\r\n *\r\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-dasharray} for more info on `stroke-dasharray`\r\n * @param value `stroke-dasharray`\r\n */\r\n set: function (value) {\r\n this.properties[\"strokeDashArray\"] = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Processes JSON-based config before it is applied to the object.\r\n *\r\n * @ignore Exclude from docs\r\n * @param config Config\r\n */\r\n Pattern.prototype.processConfig = function (config) {\r\n if (config) {\r\n // Set up series\r\n if ($type.hasValue(config.elements) && $type.isArray(config.elements)) {\r\n for (var i = 0, len = config.elements.length; i < len; i++) {\r\n var element = config.elements[i];\r\n if ($type.hasValue(element[\"type\"])) {\r\n var sprite = this.createEntryInstance(element);\r\n if (sprite instanceof BaseObject) {\r\n sprite.config = element;\r\n }\r\n this.addElement($type.hasValue(element[\"typeProperty\"])\r\n ? sprite[element[\"typeProperty\"]]\r\n : sprite.element);\r\n }\r\n }\r\n }\r\n }\r\n _super.prototype.processConfig.call(this, config);\r\n };\r\n return Pattern;\r\n}(BaseObject));\r\nexport { Pattern };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Pattern\"] = Pattern;\r\n","/**\r\n * Contains code and logic for generating radial gradients.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { BaseObject } from \"../../Base\";\r\nimport { List } from \"../../utils/List\";\r\nimport { getGhostPaper } from \"../Paper\";\r\nimport { registry } from \"../../Registry\";\r\nimport * as $iter from \"../../utils/Iterator\";\r\nimport * as $type from \"../../utils/Type\";\r\nimport { Percent } from \"../../utils/Percent\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Radial gradient class.\r\n */\r\nvar RadialGradient = /** @class */ (function (_super) {\r\n __extends(RadialGradient, _super);\r\n /**\r\n * Constructor\r\n */\r\n function RadialGradient() {\r\n var _this = _super.call(this) || this;\r\n /**\r\n * List of colors switch definitions in a gradient.\r\n */\r\n _this._stops = new List();\r\n _this.element = _this.paper.addGroup(\"radialGradient\");\r\n _this.id = \"gradient-\" + registry.getUniqueId();\r\n _this.element.attr({ \"id\": _this.id });\r\n _this._disposers.push(_this.element);\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Draws gradient.\r\n */\r\n RadialGradient.prototype.draw = function () {\r\n var _this = this;\r\n var gradientElement = this.element;\r\n if ($type.isNumber(this.cx)) {\r\n var value = this.cx;\r\n if (value instanceof Percent) {\r\n value = value.percent + \"%\";\r\n }\r\n gradientElement.attr({ \"cx\": value });\r\n }\r\n if ($type.isNumber(this.cy)) {\r\n var value = this.cy;\r\n if (value instanceof Percent) {\r\n value = value.percent + \"%\";\r\n }\r\n gradientElement.attr({ \"cy\": value });\r\n }\r\n if (this.fx) {\r\n var value = this.fx;\r\n if (value instanceof Percent) {\r\n value = value.percent + \"%\";\r\n }\r\n gradientElement.attr({ \"fx\": value });\r\n }\r\n if (this.fy) {\r\n var value = this.fy;\r\n if (value instanceof Percent) {\r\n value = value.percent + \"%\";\r\n }\r\n gradientElement.attr({ \"fy\": value });\r\n }\r\n gradientElement.removeChildNodes();\r\n $iter.each($iter.indexed(this._stops.iterator()), function (a) {\r\n var i = a[0];\r\n var stop = a[1];\r\n var offset = stop.offset;\r\n if (!$type.isNumber(offset)) {\r\n offset = i / (_this._stops.length - 1);\r\n }\r\n var gradientStop = _this.paper.add(\"stop\");\r\n if ($type.hasValue(stop.color)) {\r\n gradientStop.attr({ \"stop-color\": stop.color.toString() });\r\n }\r\n if ($type.isNumber(stop.opacity)) {\r\n gradientStop.attr({ \"stop-opacity\": stop.opacity });\r\n }\r\n if ($type.isNumber(offset)) {\r\n gradientStop.attr({ \"offset\": offset });\r\n }\r\n gradientElement.add(gradientStop);\r\n });\r\n };\r\n /**\r\n * Adds a color step to the gradient.\r\n *\r\n * @param color Color (hex code or named color)\r\n * @param opacity Opacity (value from 0 to 1; 0 completely transaprent, 1 fully opaque)\r\n * @param offset Position of color in the gradient (value 0 to 1; 0 meaning start of the gradient and 1 end)\r\n */\r\n RadialGradient.prototype.addColor = function (color, opacity, offset) {\r\n this._stops.push({ color: color, opacity: opacity, offset: offset });\r\n this.draw();\r\n };\r\n Object.defineProperty(RadialGradient.prototype, \"paper\", {\r\n /**\r\n * @ignore Exclude from docs\r\n * @return Paper\r\n */\r\n get: function () {\r\n if (this._paper) {\r\n return this._paper;\r\n }\r\n return getGhostPaper();\r\n },\r\n /**\r\n * A [[Paper]] instace to use for the gradient.\r\n *\r\n * @ignore Exclude from docs\r\n * @param paper Paper\r\n */\r\n set: function (paper) {\r\n if (this._paper != paper) {\r\n this._paper = paper;\r\n this.draw();\r\n paper.appendDef(this.element);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(RadialGradient.prototype, \"cx\", {\r\n get: function () {\r\n return this._cx;\r\n },\r\n /**\r\n * Center x coordinate of the gradient, can be set as number or Percent\r\n *\r\n * @param point Center point\r\n */\r\n set: function (value) {\r\n this._cx = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(RadialGradient.prototype, \"cy\", {\r\n get: function () {\r\n return this._cy;\r\n },\r\n /**\r\n * Center y coordinate of the gradient, can be set as number or Percent\r\n *\r\n * @param point Center point\r\n */\r\n set: function (value) {\r\n this._cy = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(RadialGradient.prototype, \"fx\", {\r\n get: function () {\r\n return this._fx;\r\n },\r\n /**\r\n * y coordinate of the focal point of a gradient, can be set in pixels or as Percent\r\n *\r\n * @param point Center point\r\n */\r\n set: function (value) {\r\n this._fx = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(RadialGradient.prototype, \"fy\", {\r\n get: function () {\r\n return this._fy;\r\n },\r\n /**\r\n * y coordinate of the focal point of a gradient, can be set in pixels or as Percent\r\n *\r\n * @param point Center point\r\n */\r\n set: function (value) {\r\n this._fy = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n RadialGradient.prototype.copyFrom = function (source) {\r\n _super.prototype.copyFrom.call(this, source);\r\n this.stops.copyFrom(source.stops);\r\n this.cx = source.cx;\r\n this.cy = source.cy;\r\n this.fx = source.fx;\r\n this.fy = source.fy;\r\n };\r\n Object.defineProperty(RadialGradient.prototype, \"stops\", {\r\n /**\r\n * A list of color stops in the gradient.\r\n *\r\n * @return Stops\r\n */\r\n get: function () {\r\n return this._stops;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Clears the gradient.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n RadialGradient.prototype.clear = function () {\r\n this._stops.clear();\r\n };\r\n return RadialGradient;\r\n}(BaseObject));\r\nexport { RadialGradient };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"RadialGradient\"] = RadialGradient;\r\n","import { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { RadialGradient } from \"./RadialGradient\";\r\nimport { GradientModifier } from \"./GradientModifier\";\r\nimport { registry } from \"../../Registry\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * This class can be used to modify radial gradient steps, changing visual\r\n * properties like lightness, brightness, opacity of each set.\r\n *\r\n * It can also set offsets for each gradient step.\r\n *\r\n * E.g. if I want to fill a columns in a column series to be a solid fill from\r\n * top to 80% of height, then gradually fades out, I can use the following\r\n * gradient modifier as a `fillModifier`:\r\n *\r\n * ```TypeScript\r\n * let fillModifier = new am4core.LinearGradientModifier();\r\n * fillModifier.opacities = [1, 1, 0];\r\n * fillModifier.offsets = [0, 0.8, 1];\r\n * columnSeries.columns.template.fillModifier = fillModifier;\r\n * ```\r\n * ```JavaScript\r\n * var fillModifier = new am4core.LinearGradientModifier();\r\n * fillModifier.opacities = [1, 1, 0];\r\n * fillModifier.offsets = [0, 0.8, 1];\r\n * columnSeries.columns.template.fillModifier = fillModifier;\r\n * ```\r\n * ```JSON\r\n * \"series\": [{\r\n * \"type\": \"ColumnSeries\",\r\n * \"columns\": {\r\n * \"fillModifier\": {\r\n * \"type\": \"LinearGradientModifier\",\r\n * \"opacities\": [1, 1, 0],\r\n * \"offsets\": [0, 0.8, 1]\r\n * }\r\n * }\r\n * }]\r\n * ```\r\n */\r\nvar RadialGradientModifier = /** @class */ (function (_super) {\r\n __extends(RadialGradientModifier, _super);\r\n /**\r\n * Constructor.\r\n */\r\n function RadialGradientModifier() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"RadialGradientModifier\";\r\n _this.gradient = new RadialGradient();\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n RadialGradientModifier.prototype.copyFrom = function (source) {\r\n _super.prototype.copyFrom.call(this, source);\r\n this.gradient = source.gradient.clone();\r\n };\r\n return RadialGradientModifier;\r\n}(GradientModifier));\r\nexport { RadialGradientModifier };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"RadialGradientModifier\"] = RadialGradientModifier;\r\n","/**\r\n * Rectangular pattern module.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Pattern } from \"./Pattern\";\r\nimport { registry } from \"../../Registry\";\r\n;\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Rectangular pattern\r\n */\r\nvar RectPattern = /** @class */ (function (_super) {\r\n __extends(RectPattern, _super);\r\n /**\r\n * Constructor\r\n */\r\n function RectPattern() {\r\n var _this = _super.call(this) || this;\r\n _this.rectHeight = 1;\r\n _this.rectWidth = 1;\r\n _this._rect = _this.paper.add(\"rect\");\r\n _this.addElement(_this._rect);\r\n return _this;\r\n }\r\n /**\r\n * Draws the rectangular element.\r\n */\r\n RectPattern.prototype.draw = function () {\r\n _super.prototype.draw.call(this);\r\n this.properties[\"rotationX\"] = this.width / 2;\r\n this.properties[\"rotationY\"] = this.height / 2;\r\n if (this._rect) {\r\n this._rect.attr({ \"width\": this.rectWidth, \"height\": this.rectHeight, \"x\": (this.width - this.rectWidth) / 2, \"y\": (this.height - this.rectHeight) / 2 });\r\n }\r\n };\r\n Object.defineProperty(RectPattern.prototype, \"rectWidth\", {\r\n /**\r\n * @return Width (px)\r\n */\r\n get: function () {\r\n return this.properties[\"rectWidth\"];\r\n },\r\n /**\r\n * Rectangle width in pixels.\r\n *\r\n * @param value Width (px)\r\n */\r\n set: function (value) {\r\n this.properties[\"rectWidth\"] = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(RectPattern.prototype, \"rectHeight\", {\r\n /**\r\n * @return Height (px)\r\n */\r\n get: function () {\r\n return this.properties[\"rectHeight\"];\r\n },\r\n /**\r\n * Rectangle height in pixels.\r\n *\r\n * @param value Height (px)\r\n */\r\n set: function (value) {\r\n this.properties[\"rectHeight\"] = value;\r\n this.draw();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return RectPattern;\r\n}(Pattern));\r\nexport { RectPattern };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"RectPattern\"] = RectPattern;\r\n","/**\r\n * Module for \"Blur\" filter.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Filter } from \"./Filter\";\r\nimport { registry } from \"../../Registry\";\r\n;\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Creates a \"Blur\" filter.\r\n */\r\nvar BlurFilter = /** @class */ (function (_super) {\r\n __extends(BlurFilter, _super);\r\n /**\r\n * Constructor\r\n */\r\n function BlurFilter() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"BlurFilter\";\r\n // Create elements\r\n // NOTE: we do not need to add each individual element to `_disposers`\r\n // because `filterPrimitives` has an event handler which automatically adds\r\n // anything added to it to `_disposers`\r\n _this.feGaussianBlur = _this.paper.add(\"feGaussianBlur\");\r\n _this.feGaussianBlur.attr({ \"result\": \"blurOut\", \"in\": \"SourceGraphic\" });\r\n _this.filterPrimitives.push(_this.feGaussianBlur);\r\n // Set default properties\r\n _this.width = 200;\r\n _this.height = 200;\r\n _this.blur = 1.5;\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n Object.defineProperty(BlurFilter.prototype, \"blur\", {\r\n /**\r\n * @return Blur\r\n */\r\n get: function () {\r\n return this.properties.blur;\r\n },\r\n /**\r\n * Blur value.\r\n *\r\n * The bigger the value, the blurrier the target element will become.\r\n *\r\n * @default 1.5\r\n * @param value Blur\r\n */\r\n set: function (value) {\r\n this.properties.blur = value;\r\n this.feGaussianBlur.attr({ \"stdDeviation\": value / this.scale });\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return BlurFilter;\r\n}(Filter));\r\nexport { BlurFilter };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"BlurFilter\"] = BlurFilter;\r\n","/**\r\n * Module for \"Colorize\" filter.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Filter } from \"./Filter\";\r\nimport { registry } from \"../../Registry\";\r\n;\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Creates a \"Colorize\" filter.\r\n */\r\nvar ColorizeFilter = /** @class */ (function (_super) {\r\n __extends(ColorizeFilter, _super);\r\n /**\r\n * Constructor\r\n */\r\n function ColorizeFilter() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"ColorizeFilter\";\r\n // Create elements\r\n // NOTE: we do not need to add each individual element to `_disposers`\r\n // because `filterPrimitives` has an event handler which automatically adds\r\n // anything added to it to `_disposers`\r\n _this.feColorMatrix = _this.paper.add(\"feColorMatrix\");\r\n _this.feColorMatrix.attr({ \"type\": \"matrix\" });\r\n //this.feColorMatrix.setAttribute(\"in\", \"SourceAlpha\");\r\n _this.filterPrimitives.push(_this.feColorMatrix);\r\n // Set default properties\r\n _this.intensity = 1;\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * (Re)applies colors to the already existing filter by modifying filyer's\r\n * color matrix element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n ColorizeFilter.prototype.applyFilter = function () {\r\n var i = this.intensity;\r\n var ii = 1 - i;\r\n var r;\r\n var g;\r\n var b;\r\n var color = this.color;\r\n if (color && color.rgb) {\r\n r = color.rgb.r / 255 * i;\r\n g = color.rgb.g / 255 * i;\r\n b = color.rgb.b / 255 * i;\r\n }\r\n else {\r\n r = 0;\r\n g = 0;\r\n b = 0;\r\n }\r\n this.feColorMatrix.attr({ \"values\": ii + \" 0 0 0 \" + r + \" 0 \" + ii + \" 0 0 \" + g + \" 0 0 \" + ii + \" 0 \" + b + \" 0 0 0 1 0\" });\r\n };\r\n Object.defineProperty(ColorizeFilter.prototype, \"color\", {\r\n /**\r\n * @return Color\r\n */\r\n get: function () {\r\n return this.properties[\"color\"];\r\n },\r\n /**\r\n * Target color to apply to the element.\r\n *\r\n * Depending on the `intensity`, all colors of the target element will steer\r\n * towards this color.\r\n *\r\n * E.g. setting to `am4core.color(\"greener\")` will make all colors greener.\r\n *\r\n * @param value Color\r\n */\r\n set: function (value) {\r\n this.properties[\"color\"] = value;\r\n this.applyFilter();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ColorizeFilter.prototype, \"intensity\", {\r\n /**\r\n * @return Intensity (0-1)\r\n */\r\n get: function () {\r\n return this.properties.intensity;\r\n },\r\n /**\r\n * Intensity of the color (0-1).\r\n *\r\n * The bigger the number the more of a `color` target's colors will become.\r\n *\r\n * 0 means the colors will remain as they are.\r\n * 1 means all colors will become the target `color`.\r\n *\r\n * @default 1\r\n * @param value Intensity (0-1)\r\n */\r\n set: function (value) {\r\n this.properties.intensity = value;\r\n this.applyFilter();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return ColorizeFilter;\r\n}(Filter));\r\nexport { ColorizeFilter };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"ColorizeFilter\"] = ColorizeFilter;\r\n","/**\r\n * Module for \"Desaturate\" filter.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Filter } from \"./Filter\";\r\nimport { registry } from \"../../Registry\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Creats a \"Desaturate\" filter\r\n */\r\nvar DesaturateFilter = /** @class */ (function (_super) {\r\n __extends(DesaturateFilter, _super);\r\n /**\r\n * Constructor\r\n */\r\n function DesaturateFilter() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"DesaturateFilter\";\r\n // Create elements\r\n // NOTE: we do not need to add each individual element to `_disposers`\r\n // because `filterPrimitives` has an event handler which automatically adds\r\n // anything added to it to `_disposers`\r\n _this.feColorMatrix = _this.paper.add(\"feColorMatrix\");\r\n _this.feColorMatrix.attr({ \"type\": \"saturate\" });\r\n _this.filterPrimitives.push(_this.feColorMatrix);\r\n // Set default properties\r\n _this.width = 120;\r\n _this.height = 120;\r\n _this.saturation = 0;\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n Object.defineProperty(DesaturateFilter.prototype, \"saturation\", {\r\n /**\r\n * @return Saturation (0-1)\r\n */\r\n get: function () {\r\n return this.properties[\"saturation\"];\r\n },\r\n /**\r\n * Saturation.\r\n *\r\n * 0 - completely desaturated.\r\n * 1 - fully saturated (gray).\r\n *\r\n * @param value Saturation (0-1)\r\n */\r\n set: function (value) {\r\n this.properties[\"saturation\"] = value;\r\n this.feColorMatrix.attr({ \"values\": value.toString() });\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return DesaturateFilter;\r\n}(Filter));\r\nexport { DesaturateFilter };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"DesaturateFilter\"] = DesaturateFilter;\r\n","/**\r\n * Module for \"Drop Shadow\" filter.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Filter } from \"./Filter\";\r\nimport { color } from \"../../utils/Color\";\r\nimport { registry } from \"../../Registry\";\r\n;\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Creats a \"Drop Shadow\" filter.\r\n */\r\nvar DropShadowFilter = /** @class */ (function (_super) {\r\n __extends(DropShadowFilter, _super);\r\n /**\r\n * Constructor\r\n */\r\n function DropShadowFilter() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"DropShadowFilter\";\r\n // Create elements\r\n // NOTE: we do not need to add each individual element to `_disposers`\r\n // because `filterPrimitives` has an event handler which automatically adds\r\n // anything added to it to `_disposers`\r\n _this.color = color(\"#000\");\r\n _this.feGaussianBlur = _this.paper.add(\"feGaussianBlur\");\r\n _this.feGaussianBlur.attr({ \"result\": \"blurOut\", \"in\": \"SourceGraphic\" });\r\n _this.filterPrimitives.push(_this.feGaussianBlur);\r\n _this.feOffset = _this.paper.add(\"feOffset\");\r\n _this.feOffset.attr({ \"result\": \"offsetBlur\" });\r\n _this.filterPrimitives.push(_this.feOffset);\r\n _this.feFlood = _this.paper.add(\"feFlood\");\r\n _this.feFlood.attr({ \"flood-color\": _this.color });\r\n _this.filterPrimitives.push(_this.feFlood);\r\n _this.feComposite = _this.paper.add(\"feComposite\");\r\n _this.feComposite.attr({ \"in2\": \"offsetBlur\", operator: \"in\" });\r\n _this.filterPrimitives.push(_this.feComposite);\r\n _this.feMerge = _this.paper.addGroup(\"feMerge\");\r\n _this.feMerge.add(_this.paper.add(\"feMergeNode\"));\r\n _this.feMerge.add(_this.paper.add(\"feMergeNode\").attr({ \"in\": \"SourceGraphic\" }));\r\n _this.filterPrimitives.push(_this.feMerge);\r\n // Set default properties\r\n _this.width = 200;\r\n _this.height = 200;\r\n _this.blur = 1.5;\r\n _this.dx = 3;\r\n _this.dy = 3;\r\n _this.opacity = 0.5;\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n Object.defineProperty(DropShadowFilter.prototype, \"color\", {\r\n /**\r\n * @return Color\r\n */\r\n get: function () {\r\n return this.properties.color;\r\n },\r\n /**\r\n * Shadow color.\r\n *\r\n * @param value Color\r\n */\r\n set: function (value) {\r\n this.properties.color = value;\r\n if (this.feFlood) {\r\n this.feFlood.attr({ \"flood-color\": value });\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DropShadowFilter.prototype, \"opacity\", {\r\n /**\r\n * @return Opacity (0-1)\r\n */\r\n get: function () {\r\n return this.properties.opacity;\r\n },\r\n /**\r\n * Opacity of the shadow. (0-1)\r\n *\r\n * @param value Opacity (0-1)\r\n */\r\n set: function (value) {\r\n this.properties.opacity = value;\r\n this.feFlood.attr({ \"flood-opacity\": value });\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DropShadowFilter.prototype, \"dx\", {\r\n /**\r\n * @return Horizontal offset (px)\r\n */\r\n get: function () {\r\n return this.properties.dx;\r\n },\r\n /**\r\n * Horizontal offset in pixels.\r\n *\r\n * @param value Horizontal offset (px)\r\n */\r\n set: function (value) {\r\n this.properties.dx = value;\r\n this.feOffset.attr({ \"dx\": value / this.scale });\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DropShadowFilter.prototype, \"dy\", {\r\n /**\r\n * @return Vertical offset (px)\r\n */\r\n get: function () {\r\n return this.properties.dy;\r\n },\r\n /**\r\n * Vertical offset in pixels.\r\n *\r\n * @param value Vertical offset (px)\r\n */\r\n set: function (value) {\r\n this.properties.dy = value;\r\n this.feOffset.attr({ \"dy\": value / this.scale });\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DropShadowFilter.prototype, \"blur\", {\r\n /**\r\n * @return Blur\r\n */\r\n get: function () {\r\n return this.properties.blur;\r\n },\r\n /**\r\n * Blur.\r\n *\r\n * @param value Blur\r\n */\r\n set: function (value) {\r\n this.properties.blur = value;\r\n this.feGaussianBlur.attr({ \"stdDeviation\": value / this.scale });\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * [updateScale description]\r\n *\r\n * @todo Description\r\n */\r\n DropShadowFilter.prototype.updateScale = function () {\r\n this.dx = this.dx;\r\n this.dy = this.dy;\r\n this.blur = this.blur;\r\n };\r\n return DropShadowFilter;\r\n}(Filter));\r\nexport { DropShadowFilter };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"DropShadowFilter\"] = DropShadowFilter;\r\n","/**\r\n * This module contains a base class for an SVG filter.\r\n *\r\n * Filters can be used to decorate, change and transform just about any DOM\r\n * element.\r\n *\r\n * A Filter works by applying one or more effects (primitives) to SVG element.\r\n *\r\n * For more information on how SVG filters work, refer to\r\n * [this MDN tutorial](https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/SVG_Filters_Tutorial).\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { BaseObject } from \"../../Base\";\r\nimport { getGhostPaper } from \"../Paper\";\r\nimport { Animation, AnimationDisposer } from \"../../utils/Animation\";\r\nimport { List } from \"../../utils/List\";\r\nimport * as $object from \"../../utils/Object\";\r\nimport * as $iter from \"../../utils/Iterator\";\r\n;\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Base filter class.\r\n *\r\n * This class while can be instantiated will not do anything. It is just a base\r\n * functionality for any other \"real\" filters to extend.\r\n *\r\n * Filters can be used to decorate, change and transform just about any DOM\r\n * element.\r\n *\r\n * A Filter works by applying one or more effects (primitives) to SVG element.\r\n *\r\n * For more information on how SVG filters work, refer to\r\n * [this MDN tutorial](https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/SVG_Filters_Tutorial).\r\n *\r\n * @todo Example\r\n */\r\nvar Filter = /** @class */ (function (_super) {\r\n __extends(Filter, _super);\r\n /**\r\n * Constructor\r\n */\r\n function Filter() {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n /**\r\n * A storage for Filter property/value pairs.\r\n *\r\n * @ignore Exclude from docs\r\n * @see {@link FilterProperties}\r\n */\r\n _this.properties = {};\r\n /**\r\n * Identifies if this object is a \"template\" and should not be treated as\r\n * real object that is drawn or actually used in the chart.\r\n */\r\n _this.isTemplate = false;\r\n /**\r\n * [_scale description]\r\n *\r\n * @todo Description\r\n */\r\n _this._scale = 1;\r\n /**\r\n * [_nonScaling description]\r\n *\r\n * @todo Description\r\n */\r\n _this._nonScaling = true;\r\n _this.className = \"Filter\";\r\n // Create a list to hold primitives (effect elements)\r\n _this.filterPrimitives = new List();\r\n _this.properties.filterUnits = \"objectBoundingBox\";\r\n // Automatically add added primitives to `_disposers` so they are discarded\r\n // when Filter object is destroyed (disposed)\r\n _this.filterPrimitives.events.on(\"inserted\", function (ev) {\r\n _this._disposers.push(ev.newValue);\r\n });\r\n // Set default dimensions\r\n _this.width = 120;\r\n _this.height = 120;\r\n // Apply theme\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Appends actual filter elements to the filter group.\r\n *\r\n * @ignore Exclude from docs\r\n * @param filterElement An SVG `<group>` element to add filter element to\r\n */\r\n Filter.prototype.appendPrimitives = function (filterElement) {\r\n $iter.each(this.filterPrimitives.iterator(), function (filterPrimitive) {\r\n filterElement.add(filterPrimitive);\r\n });\r\n };\r\n /**\r\n * Uses Transitions filter's values from current to target. This is used to\r\n * smoothly appear filter, rather than it pop into effect.\r\n *\r\n * @ignore Exclude from docs\r\n * @param animationOptions Animation options\r\n * @param duration Duration in milliseconds\r\n * @param easing Easing function\r\n * @return Animation instance\r\n */\r\n Filter.prototype.animate = function (animationOptions, duration, easing) {\r\n var animation = new Animation(this, animationOptions, duration, easing).start();\r\n return animation;\r\n };\r\n Object.defineProperty(Filter.prototype, \"width\", {\r\n /**\r\n * @return Width (%)\r\n */\r\n get: function () {\r\n return this.properties[\"width\"];\r\n },\r\n /**\r\n * Width of the filter element in percent.\r\n *\r\n * If the filter is designed to \"bleed out\" of the original target element,\r\n * like for example a shadow, you need this bigger than 100, or the\r\n * non-fitting parts will be clipped.\r\n *\r\n * @default 120\r\n * @param value Width (px)\r\n */\r\n set: function (value) {\r\n this.properties[\"width\"] = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Filter.prototype, \"height\", {\r\n /**\r\n * @return Height\r\n */\r\n get: function () {\r\n return this.properties[\"height\"];\r\n },\r\n /**\r\n * Height of the filter element in percent.\r\n *\r\n * If the filter is designed to \"bleed out\" of the original target element,\r\n * like for example a shadow, you need this bigger than 100, or the\r\n * non-fitting parts will be clipped.\r\n *\r\n * @default 120\r\n * @param value Height (%)\r\n */\r\n set: function (value) {\r\n this.properties[\"height\"] = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Copies properties from another [[Filter]] object.\r\n *\r\n * @param filter Source [[Filter]] object\r\n */\r\n Filter.prototype.copyFrom = function (filter) {\r\n var _this = this;\r\n _super.prototype.copyFrom.call(this, filter);\r\n $object.each(filter.properties, function (key, value) {\r\n _this[key] = value;\r\n });\r\n };\r\n Object.defineProperty(Filter.prototype, \"paper\", {\r\n /**\r\n * @return Paper\r\n */\r\n get: function () {\r\n if (this._paper) {\r\n return this._paper;\r\n }\r\n return getGhostPaper();\r\n },\r\n /**\r\n * Sets [[Paper]] instance to create filter's elements in.\r\n *\r\n * @ignore Exclude from docs\r\n * @param paper Paper\r\n */\r\n set: function (paper) {\r\n if (this._paper != paper) {\r\n this._paper = paper;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Filter.prototype, \"animations\", {\r\n /**\r\n * All animations currently in play.\r\n *\r\n * @ignore Exclude from docs\r\n * @return List of animations\r\n */\r\n get: function () {\r\n if (!this._animations) {\r\n this._animations = [];\r\n this._disposers.push(new AnimationDisposer(this._animations));\r\n }\r\n return this._animations;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Filter.prototype, \"scale\", {\r\n /**\r\n * @ignore Exclude from docs\r\n */\r\n get: function () {\r\n return this._scale;\r\n },\r\n /**\r\n * [[Sprite]] uses this method to inform filter about it's scale.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n set: function (value) {\r\n this._scale = value;\r\n this.updateScale();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Updates filter properties which depend on scale.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Filter.prototype.updateScale = function () {\r\n // Dummy method for extending classes to override.\r\n };\r\n Object.defineProperty(Filter.prototype, \"filterUnits\", {\r\n /**\r\n * @return Filter units\r\n */\r\n get: function () {\r\n return this.properties.filterUnits;\r\n },\r\n /**\r\n * Which units are used when drawing filter.\r\n *\r\n * Use `\"userSpaceOnUse\"` when applying filters on a perfectly straight line.\r\n *\r\n * @since 4.9.17\r\n * @default objectBoundingBox\r\n * @param value Filter units\r\n */\r\n set: function (value) {\r\n this.properties.filterUnits = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Filter.prototype, \"nonScaling\", {\r\n /**\r\n * @return Non scaling?\r\n */\r\n get: function () {\r\n return this._nonScaling;\r\n },\r\n /**\r\n * If a filter is non scaling, it will look the same even if the sprite is\r\n * scaled, otherwise filter will scale together with a [[Sprite]].\r\n *\r\n * @default false\r\n * @param value Non scaling?\r\n */\r\n set: function (value) {\r\n this._nonScaling = value;\r\n if (!value) {\r\n this._scale = 1;\r\n }\r\n this.updateScale();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Filter.prototype, \"sprite\", {\r\n /**\r\n * A target element this filter is currently attached to.\r\n *\r\n * We need to keep track of it because one filter can be used for just one\r\n * element, so we have to remove it from the old \"parent\" when attaching to\r\n * the new one.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Target element\r\n */\r\n set: function (value) {\r\n this.setSprite(value);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Sets filter's target element.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Element filter is being attached to\r\n */\r\n Filter.prototype.setSprite = function (value) {\r\n if (this._sprite && this._sprite != value) {\r\n this._sprite.filters.removeValue(this);\r\n }\r\n this._sprite = value;\r\n };\r\n return Filter;\r\n}(BaseObject));\r\nexport { Filter };\r\n","/**\r\n * Module for \"Focus\" filter.\r\n */\r\nimport { __extends } from \"tslib\";\r\nimport { Filter } from \"./Filter\";\r\nimport { InterfaceColorSet } from \"../../utils/InterfaceColorSet\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Creates a \"Focus\" filter.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/accessibility/} more about accessibility\r\n * @see {@link https://www.amcharts.com/docs/v4/tutorials/changing-appearance-of-focused-items/} cusomizing focus appearance\r\n */\r\nvar FocusFilter = /** @class */ (function (_super) {\r\n __extends(FocusFilter, _super);\r\n /**\r\n * Constructor\r\n */\r\n function FocusFilter() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"FocusFilter\";\r\n // Create elements\r\n // NOTE: we do not need to add each individual element to `_disposers`\r\n // because `filterPrimitives` has an event handler which automatically adds\r\n // anything added to it to `_disposers`\r\n _this.feFlood = _this.paper.add(\"feFlood\");\r\n _this.feFlood.attr({ \"flood-color\": new InterfaceColorSet().getFor(\"primaryButtonHover\"), \"result\": \"base\" });\r\n _this.filterPrimitives.push(_this.feFlood);\r\n _this.feMorphology = _this.paper.add(\"feMorphology\");\r\n _this.feMorphology.attr({ \"result\": \"bigger\", \"in\": \"SourceGraphic\", \"operator\": \"dilate\", \"radius\": \"2\" });\r\n _this.filterPrimitives.push(_this.feMorphology);\r\n _this.feColorMatrix = _this.paper.add(\"feColorMatrix\");\r\n _this.feColorMatrix.attr({ \"result\": \"mask\", \"in\": \"bigger\", \"type\": \"matrix\", \"values\": \"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0\" });\r\n _this.filterPrimitives.push(_this.feColorMatrix);\r\n _this.feComposite = _this.paper.add(\"feComposite\");\r\n _this.feComposite.attr({ \"result\": \"drop\", \"in\": \"base\", \"in2\": \"mask\", \"operator\": \"in\" });\r\n _this.filterPrimitives.push(_this.feComposite);\r\n _this.feBlend = _this.paper.add(\"feBlend\");\r\n _this.feBlend.attr({ \"in\": \"SourceGraphic\", \"in2\": \"drop\", \"mode\": \"normal\" });\r\n _this.filterPrimitives.push(_this.feBlend);\r\n // Set default properties\r\n _this.width = 130;\r\n _this.height = 130;\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n Object.defineProperty(FocusFilter.prototype, \"stroke\", {\r\n /**\r\n * @return Color\r\n */\r\n get: function () {\r\n return this.properties[\"stroke\"];\r\n },\r\n /**\r\n * Stroke (outline) color.\r\n *\r\n * @param value Color\r\n */\r\n set: function (value) {\r\n this.properties[\"stroke\"] = value;\r\n this.feFlood.attr({ \"flood-color\": value });\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(FocusFilter.prototype, \"strokeWidth\", {\r\n /**\r\n * @return Outline thickness (px)\r\n */\r\n get: function () {\r\n return this.properties[\"strokeWidth\"];\r\n },\r\n /**\r\n * Stroke (outline) thickness in pixels.\r\n *\r\n * @param value Outline thickness (px)\r\n */\r\n set: function (value) {\r\n this.properties[\"strokeWidth\"] = value;\r\n this.feMorphology.attr({ \"radius\": value });\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(FocusFilter.prototype, \"opacity\", {\r\n /**\r\n * @return Outline opacity (0-1)\r\n */\r\n get: function () {\r\n return this.properties[\"opacity\"];\r\n },\r\n /**\r\n * Opacity of the outline. (0-1)\r\n *\r\n * @param value Outline opacity (0-1)\r\n */\r\n set: function (value) {\r\n this.properties[\"opacity\"] = value;\r\n this.feColorMatrix.attr({ \"values\": \"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 \" + value + \" 0\" });\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Sets filter's target element.\r\n *\r\n * In addition it also disables built-in focus outline on element this\r\n * filter is applied to.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Element filter is being attached to\r\n */\r\n FocusFilter.prototype.setSprite = function (value) {\r\n if (this._sprite && this._sprite != value) {\r\n this._sprite.group.removeStyle(\"outline\");\r\n }\r\n value.group.addStyle({\r\n \"outline\": \"none\"\r\n });\r\n _super.prototype.setSprite.call(this, value);\r\n };\r\n return FocusFilter;\r\n}(Filter));\r\nexport { FocusFilter };\r\n","/**\r\n * Module for \"Lighten\" filter.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Filter } from \"./Filter\";\r\nimport { registry } from \"../../Registry\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Creates a \"Lighten\" filter.\r\n */\r\nvar LightenFilter = /** @class */ (function (_super) {\r\n __extends(LightenFilter, _super);\r\n /**\r\n * Constructor\r\n */\r\n function LightenFilter() {\r\n var _this = _super.call(this) || this;\r\n _this.className = \"LightenFilter\";\r\n // Create elements\r\n // NOTE: we do not need to add each individual element to `_disposers`\r\n // because `filterPrimitives` has an event handler which automatically adds\r\n // anything added to it to `_disposers`\r\n _this.feColorMatrix = _this.paper.add(\"feColorMatrix\");\r\n _this.feColorMatrix.attr({ \"type\": \"matrix\" });\r\n _this.filterPrimitives.push(_this.feColorMatrix);\r\n // Set default properties\r\n _this.lightness = 0;\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n Object.defineProperty(LightenFilter.prototype, \"lightness\", {\r\n /**\r\n * @return Lightness\r\n */\r\n get: function () {\r\n return this.properties[\"lightness\"];\r\n },\r\n /**\r\n * Lightness of the target colors.\r\n *\r\n * If `lightness` is a positive number, the filter will make all colors\r\n * lighter.\r\n *\r\n * If `lightness` is negative, colors will be darkened.\r\n *\r\n * @param value Lightness\r\n */\r\n set: function (value) {\r\n this.properties[\"lightness\"] = value;\r\n var v = value + 1;\r\n this.feColorMatrix.attr({ \"values\": v + \" 0 0 0 0 0 \" + v + \" 0 0 0 0 0 \" + v + \" 0 0 0 0 0 1 0\" });\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return LightenFilter;\r\n}(Filter));\r\nexport { LightenFilter };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"LightenFilter\"] = LightenFilter;\r\n","/**\r\n * An Adapter can be used to apply chained synchronous transformations to any\r\n * value at runtime.\r\n *\r\n * Each type class using Adapters must have `adapters` property and adapter\r\n * interface defined.\r\n *\r\n * Adapters can be used to allow external code to apply transformations to any\r\n * value at any time.\r\n *\r\n * For example we have a Weather class which has a method `now()` which returns\r\n * current temperature.\r\n *\r\n * ```\r\n * function now() {\r\n * // ... calculate temperature\r\n * let temp = \"Temperature now is \" + degrees + \"F\";\r\n * return temp;\r\n * }\r\n * ```\r\n *\r\n * Now, supposed we want to let other classes to modify the output of the\r\n * `now()`? We just apply an adapter to the `temp` before it is returned:\r\n *\r\n * ```\r\n * temp = this.adapters.apply(\"now\", {\r\n * temp: temp,\r\n * degrees: degrees\r\n * }).temp;\r\n * ```\r\n *\r\n * Some other class might tap onto it by defining an Adapter that calculates\r\n * the temperature in Celsius:\r\n *\r\n * weather.adapters.add(\"now\", (arg) => {\r\n * arg.temp += \"(\" + farenheitToCelsius(arg.degrees) + \"C)\";\r\n * return arh;\r\n * });\r\n *\r\n * Furthermore some time-related class could add time:\r\n *\r\n * weather.adapters.add(\"now\", (arg) => {\r\n * arg.temp += \"; the time now is \" + (new Date().toLocaleString());\r\n * return arh;\r\n * });\r\n *\r\n * So without adapters we would get output like this:\r\n *\r\n * ```\r\n * Temperature now is 90F\r\n * ```\r\n *\r\n * With adapters applied we now have:\r\n *\r\n * ```\r\n * Temperature now is 90F (32C); the time now is 12/11/2012, 7:00:00 PM\r\n * ```\r\n */\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { SortedList } from \"./SortedList\";\r\nimport * as $number from \"./Number\";\r\nimport * as $order from \"./Order\";\r\nimport * as $iter from \"../utils/Iterator\";\r\nimport * as $array from \"../utils/Array\";\r\nimport * as $type from \"../utils/Type\";\r\nimport * as $object from \"../utils/Object\";\r\n/**\r\n * ============================================================================\r\n * GLOBAL ADAPTER\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * A global adapter is an adpater that is attached to a class type rather than\r\n * specific object instance.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\nvar GlobalAdapter = /** @class */ (function () {\r\n function GlobalAdapter() {\r\n /**\r\n * Callback id iterator.\r\n */\r\n this._callbackId = 0;\r\n /**\r\n * A list of if callbacks (adapters).\r\n */\r\n this._callbacks = new SortedList(function (left, right) {\r\n return $order.or($number.order(left.priority, right.priority), $number.order(left.id, right.id));\r\n });\r\n }\r\n /**\r\n * Adds a global callback which is not specific to any particular object.\r\n * Whenever an adapter in any object of the specific class type is invoked\r\n * global adapters will kick in.\r\n *\r\n * @param type Class type\r\n * @param key Adapter key\r\n * @param callback Callback function\r\n * @param priority Priority (higher priority meaning adapter will be applied later)\r\n * @param scope Callback function scaope\r\n */\r\n GlobalAdapter.prototype.addAll = function (type, key, callback, priority, scope) {\r\n if (priority === void 0) { priority = 0; }\r\n this._callbacks.insert({\r\n id: ++this._callbackId,\r\n key: key,\r\n callback: callback,\r\n priority: priority,\r\n scope: scope,\r\n type: type\r\n });\r\n };\r\n /**\r\n * Returns if there are adapters for specific type available.\r\n *\r\n * @param type Adapter type\r\n * @param key Adapter key\r\n * @return {boolean}\r\n */\r\n GlobalAdapter.prototype.isEnabled = function (type, key) {\r\n return $array.any(this._callbacks.values, function (x) { return x.key === key && type instanceof x.type; });\r\n };\r\n /**\r\n * Applies global adapters for the object of the specific type.\r\n *\r\n * @param type Class type\r\n * @param key Adapter key\r\n * @param value Value\r\n */\r\n GlobalAdapter.prototype.applyAll = function (type, key, value) {\r\n // This is needed to improve the performance and reduce garbage collection\r\n var callbacks = this._callbacks.values;\r\n var length = callbacks.length;\r\n if (length == 0) {\r\n return value;\r\n }\r\n // Cycle through all callbacks and find the ones we need to use\r\n for (var i = 0; i < length; ++i) {\r\n var item = callbacks[i];\r\n if (item.key === key && type instanceof item.type) {\r\n value = item.callback.call(item.scope, value, type, key);\r\n }\r\n }\r\n return value;\r\n };\r\n return GlobalAdapter;\r\n}());\r\nexport { GlobalAdapter };\r\n/**\r\n * A global Adapter for plugins that want to add specific\r\n * functionality for any chart, not just specific instance.\r\n *\r\n * If you want to add an adapter which applies to all instances of the same\r\n * object type, like, for instance all slices in PieSeries, you can use\r\n * global adapter.\r\n *\r\n * Global adapter is a system-wide instance, accessible via `globalAdapter`.\r\n *\r\n * ```TypeScript\r\n * am4core.globalAdapter.addAll<am4charts.IPieSeriesAdapters, am4charts.PieSeries, \"fill\">(am4charts.PieSeries, \"fill\", (value, target, key) => {\r\n * return am4core.color(\"#005500\");\r\n * });\r\n * ```\r\n * ```JavaScript\r\n * am4core.globalAdapter.addAll(am4charts.PieSeries, \"fill\", (value, target, key) => {\r\n * return am4core.color(\"#005500\");\r\n * });\r\n * ```\r\n *\r\n * @ignore\r\n */\r\nexport var globalAdapter = new GlobalAdapter();\r\n/**\r\n * ============================================================================\r\n * REGULAR ADAPTER\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Adapter allows adding ordered callback functions and associating them with a\r\n * string-based key. An Adapter user can then easily invoke those callbacks to\r\n * apply custom functions on its input, output or intermediate values.\r\n *\r\n * Custom code and plugins can add their own callbacks to modify and enhance\r\n * core functionality.\r\n *\r\n * See the description of `add()` for an example.\r\n *\r\n * Almost any object in amCharts4 has own adapter, accessible with `adapter`\r\n * property.\r\n *\r\n * Any adapters added to it will be applied to that object only.\r\n *\r\n * ### Global Adapters\r\n *\r\n * If you want to add an adapter which applies to all instances of the same\r\n * object type, like, for instance all slices in PieSeries, you can use\r\n * global adapter.\r\n *\r\n * Global adapter is a system-wide instance, accessible via `globalAdapter`.\r\n *\r\n * ```TypeScript\r\n * am4core.globalAdapter.addAll<am4charts.IPieSeriesAdapters, am4charts.PieSeries, \"fill\">(am4charts.PieSeries. \"fill\", (value, target, key) => {\r\n * return am4core.color(\"#005500\");\r\n * });\r\n * ```\r\n * ```JavaScript\r\n * am4core.globalAdapter.addAll(am4charts.PieSeries. \"fill\", (value, target, key) => {\r\n * return am4core.color(\"#005500\");\r\n * });\r\n * ```\r\n *\r\n * {@link https://www.amcharts.com/docs/v4/reference/adapter_module/#globalAdapter_property More info}.\r\n *\r\n * @important\r\n */\r\nvar Adapter = /** @class */ (function () {\r\n /**\r\n * Constructor, sets the object referece this Adapter should be used for.\r\n *\r\n * @param c Object\r\n */\r\n function Adapter(c) {\r\n /**\r\n * Internal counter for callback ids.\r\n */\r\n this._callbackId = 0;\r\n /**\r\n * A list of adapter callbacks.\r\n *\r\n * @param $number.order(left.priority, right.priority) [description]\r\n * @param $number.order(left.id, right.id));\t} [description]\r\n */\r\n this._callbacks = new SortedList(function (left, right) {\r\n return $order.or($number.order(left.priority, right.priority), $number.order(left.id, right.id));\r\n });\r\n this._disabled = {};\r\n this.object = c;\r\n // TODO this exposes the internal events\r\n this.events = this._callbacks.events;\r\n }\r\n /**\r\n * Adds a callback for a specific key.\r\n *\r\n * ```TypeScript\r\n * // Override fill color value and make all slices green\r\n * chart.series.template.adapter.add(\"fill\", (value, target, key) => {\r\n * return am4core.color(\"#005500\");\r\n * });\r\n * ```\r\n * ```JavaScript\r\n * // Override fill color value and make all slices green\r\n * chart.series.template.adapter.add(\"fill\", function(value, target, key) {\r\n * return am4core.color(\"#005500\");\r\n * });\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"series\": [{\r\n * // ...\r\n * \"adapter\": {\r\n * \t// Override fill color value and make all slices green\r\n * \t\"fill\": function(value, target, key) {\r\n * \t return am4core.color(\"#005500\");\r\n * \t}\r\n * }\r\n * }]\r\n * }\r\n * ```\r\n *\r\n * The above will call user-defined function (adapter) whenever `fill` value\r\n * is requested from the Pie series, allowing it to override the default\r\n * using custom code and any fuzzy logic.\r\n *\r\n * There can be any number of adapters set on one property key.\r\n *\r\n * In this case adapters will be applied in daisy-chain fashion. The first\r\n * adapter in queue will make its transformation. The next one will have\r\n * the output of the first adapter as a starting value, etc.\r\n *\r\n * The order of the adapters are determined either by the order they were\r\n * added in, or their `priority` value.\r\n *\r\n * The heigher the `priority`, the later in the game adapter will be applied.\r\n *\r\n * @param key Key\r\n * @param callback A callback function\r\n * @param priority The higher priority, the more chance the adapter will be applied last\r\n * @param scope Scope for the callback function\r\n */\r\n Adapter.prototype.add = function (key, callback, priority, scope) {\r\n if (priority === void 0) { priority = 0; }\r\n this._callbacks.insert({\r\n id: ++this._callbackId,\r\n key: key,\r\n callback: callback,\r\n priority: priority,\r\n scope: scope\r\n });\r\n };\r\n /**\r\n * Checks whether specific adapter is already set.\r\n *\r\n * @param key Key\r\n * @param callback A callback function\r\n * @param priority The higher priority, the more chance the adapter will be applied last\r\n * @param scope Scope for the callback function\r\n * @returns Adapter set?\r\n */\r\n Adapter.prototype.has = function (key, callback, priority, scope) {\r\n if (priority === void 0) { priority = 0; }\r\n return $iter.contains(this._callbacks.iterator(), function (item) {\r\n return item.key === key && item.callback === callback && item.priority === priority && item.scope === scope;\r\n });\r\n };\r\n /**\r\n * Removes adapter callbacks for the specific `key`.\r\n *\r\n * If `priority` is specified, only callbacks for that priority are removed.\r\n *\r\n * @param key Key\r\n * @param priority Priority\r\n * @todo Implement\r\n */\r\n Adapter.prototype.remove = function (key, priority) {\r\n var _this = this;\r\n // It has to make a copy because it removes the elements while iterating\r\n // TODO inefficient\r\n // TODO should this re-enable the key ?\r\n $array.each($iter.toArray(this._callbacks.iterator()), function (item) {\r\n // TODO test this\r\n if (item.key === key && (!$type.isNumber(priority) || priority === item.priority)) {\r\n _this._callbacks.remove(item);\r\n }\r\n });\r\n };\r\n /**\r\n * Enable applying adapters for a certain key, if it was disabled before by\r\n * `disableKey()`.\r\n *\r\n * @param key Key\r\n */\r\n Adapter.prototype.enableKey = function (key) {\r\n delete this._disabled[key];\r\n };\r\n /**\r\n * Disable applying adapters for a certain key.\r\n *\r\n * Optionally, can set how many applies to skip before automatically\r\n * re-enabling the applying.\r\n *\r\n * @param key Key\r\n * @param amount Number of applies to skip\r\n */\r\n Adapter.prototype.disableKey = function (key, amount) {\r\n if (amount === void 0) { amount = Infinity; }\r\n this._disabled[key] = amount;\r\n };\r\n Adapter.prototype._hasListenersByType = function (key) {\r\n return $array.any(this._callbacks.values, function (x) { return x.key === key; });\r\n };\r\n /**\r\n * Returns if there are any enabled adapters set for the specific `key`.\r\n *\r\n * @returns Are there any adapters for the key?\r\n */\r\n Adapter.prototype.isEnabled = function (key) {\r\n return this._disabled[key] == null && (this._hasListenersByType(key) || globalAdapter.isEnabled(this.object, key));\r\n };\r\n Adapter.prototype._shouldDispatch = function (key) {\r\n var count = this._disabled[key];\r\n if (!$type.isNumber(count)) {\r\n return true;\r\n }\r\n else {\r\n if (count <= 1) {\r\n delete this._disabled[key];\r\n }\r\n else {\r\n --this._disabled[key];\r\n }\r\n return false;\r\n }\r\n };\r\n /**\r\n * Passes the input value through all the callbacks for the defined `key`.\r\n *\r\n * @param key Key\r\n * @param value Input value\r\n * @param ...rest Rest of the parameters to be passed into callback\r\n * @return Output value\r\n */\r\n Adapter.prototype.apply = function (key, value) {\r\n if (this._shouldDispatch(key)) {\r\n // This is needed to improve the performance and reduce garbage collection\r\n var callbacks = this._callbacks.values;\r\n var length_1 = callbacks.length;\r\n if (length_1 > 0) {\r\n for (var i = 0; i < length_1; ++i) {\r\n var item = callbacks[i];\r\n if (item.key === key) {\r\n value = item.callback.call(item.scope, value, this.object, key);\r\n }\r\n }\r\n }\r\n // Apply global adapters\r\n value = globalAdapter.applyAll(this.object, key, value);\r\n return value;\r\n }\r\n else {\r\n return value;\r\n }\r\n };\r\n /**\r\n * Returns all adapter keys which are in this adapter.\r\n *\r\n * @return Adapter keys\r\n */\r\n Adapter.prototype.keys = function () {\r\n // TODO inefficient\r\n return $iter.toArray($iter.map(this._callbacks.iterator(), function (x) { return x.key; }));\r\n };\r\n /**\r\n * Copies all the adapter callbacks from `source`.\r\n *\r\n * @param source An Adapter to copy items from\r\n */\r\n Adapter.prototype.copyFrom = function (source) {\r\n var _this = this;\r\n $iter.each(source._callbacks.iterator(), function (x) {\r\n _this.add(x.key, x.callback, x.priority, x.scope);\r\n });\r\n $object.each(source._disabled, function (key, val) {\r\n _this._disabled[key] = val;\r\n });\r\n };\r\n /**\r\n * Clears all callbacks from this Adapter.\r\n */\r\n Adapter.prototype.clear = function () {\r\n // TODO should this also re-enable all the keys ?\r\n this._callbacks.clear();\r\n };\r\n return Adapter;\r\n}());\r\nexport { Adapter };\r\n","/**\r\n * Animation module.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { BaseObjectEvents } from \"../Base\";\r\nimport { SVGDefaults } from \"../defs/SVGDefaults\";\r\nimport { Disposer } from \"../utils/Disposer\";\r\nimport { Color } from \"../utils/Color\";\r\nimport { Percent, percent } from \"../utils/Percent\";\r\nimport * as $async from \"../utils/AsyncPending\";\r\nimport * as $ease from \"../utils/Ease\";\r\nimport * as $colors from \"../utils/Colors\";\r\nimport * as $math from \"../utils/Math\";\r\nimport * as $array from \"../utils/Array\";\r\nimport * as $type from \"../utils/Type\";\r\nimport { system } from \"../System\";\r\nimport { options } from \"../Options\";\r\n/**\r\n * Calls a `callback` function for the `duration` of milliseconds.\r\n *\r\n * @todo Needed?\r\n * @deprecated Not used anywhere\r\n * @ignore Exclude from docs\r\n * @param duration Duration (ms)\r\n * @param callback Callback function\r\n * @return Disposer\r\n */\r\nexport function animate(duration, callback) {\r\n var disposed = false;\r\n // TODO use performance.now() ?\r\n var startTime = Date.now();\r\n function loop(now) {\r\n if (!disposed) {\r\n var diff = now - startTime;\r\n if (diff >= duration) {\r\n callback(1);\r\n }\r\n else {\r\n $async.nextFrame(loop);\r\n callback(diff / duration);\r\n }\r\n }\r\n }\r\n $async.nextFrame(loop);\r\n return new Disposer(function () {\r\n disposed = true;\r\n });\r\n}\r\n/**\r\n * Returns numeric value accoring to progress between start and end values.\r\n *\r\n * @param progress Progress (0-1)\r\n * @param from\r\n * @param to\r\n * @return Value according to progress\r\n */\r\nfunction getProgressNumber(progress, from, to) {\r\n return from + ((to - from) * progress);\r\n}\r\n/**\r\n * Returns [[Percent]] value accoring to progress between start and end\r\n * values.\r\n *\r\n * @param progress Progress (0-1)\r\n * @param from\r\n * @param to\r\n * @return Value according to progress\r\n */\r\nfunction getProgressPercent(progress, from, to) {\r\n return new Percent(getProgressNumber(progress, from.percent, to.percent));\r\n}\r\n/**\r\n * Returns color value accoring to progress between start and end values.\r\n *\r\n * @param progress Progress (0-1)\r\n * @param from\r\n * @param to\r\n * @return Color according to progress\r\n */\r\nfunction getProgressColor(progress, from, to) {\r\n var color = new Color($colors.interpolate(from.rgb, to.rgb, progress));\r\n if (from.alpha != to.alpha) {\r\n color.alpha = from.alpha + (to.alpha - from.alpha) * progress;\r\n }\r\n return color;\r\n}\r\n/**\r\n * [getHybridProperty description]\r\n *\r\n * @todo Description\r\n * @param property [description]\r\n * @param type [description]\r\n * @return [description]\r\n */\r\nfunction getHybridProperty(property, type) {\r\n return type + property.charAt(0).toUpperCase() + property.substr(1);\r\n}\r\nvar AnimationDisposer = /** @class */ (function () {\r\n function AnimationDisposer(array) {\r\n this._disposer = new Disposer(function () {\r\n while (array.length !== 0) {\r\n array[0].dispose();\r\n }\r\n });\r\n }\r\n AnimationDisposer.prototype.isDisposed = function () {\r\n return this._disposer.isDisposed();\r\n };\r\n AnimationDisposer.prototype.dispose = function () {\r\n this._disposer.dispose();\r\n };\r\n return AnimationDisposer;\r\n}());\r\nexport { AnimationDisposer };\r\n/**\r\n * Animation can be used to transition certain properties on an object that\r\n * implements [[IAnimatable]] interface.\r\n *\r\n * @see {@link IAnimationEvents} for a list of available events\r\n */\r\nvar Animation = /** @class */ (function (_super) {\r\n __extends(Animation, _super);\r\n /**\r\n * Constructor\r\n *\r\n * @param object An object animation should run on\r\n * @param animationOptions One or several (array) of animation options\r\n * @param duration Duration (ms)\r\n * @param easing Easing function\r\n */\r\n function Animation(object, animationOptions, duration, easing) {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n /**\r\n * Duration of the animation in milliseconds.\r\n */\r\n _this.duration = 0;\r\n /**\r\n * Easing function to use.\r\n *\r\n * @see {@link Ease}\r\n */\r\n _this.easing = $ease.linear;\r\n /**\r\n * Contains progress of the current animation: 0 (start) to 1 (end).\r\n */\r\n _this.progress = 0;\r\n /**\r\n * Indicated how many times animation should loop.\r\n */\r\n _this._loop = 0;\r\n /**\r\n * Animation is paused.\r\n */\r\n _this._pause = false;\r\n /**\r\n * Holds reference to timeout for delayed play.\r\n */\r\n _this._delayTimeout = null;\r\n /**\r\n * Elapsed time in currently playing animation.\r\n */\r\n _this._time = 0;\r\n _this._isFinished = false;\r\n _this.className = \"Animation\";\r\n // Override duration if animations disabled system-wide\r\n if (options.animationsEnabled === false) {\r\n duration = 0;\r\n }\r\n // Set parameters\r\n _this.object = object;\r\n _this.animationOptions = $array.toArray(animationOptions);\r\n _this.duration = duration;\r\n if (easing) {\r\n _this.easing = easing;\r\n }\r\n // Run check if there are already animations playing on the same properties\r\n // and stop them - the last animation takes precedence\r\n //this.stopSameAnimations();\r\n /*if ($type.hasValue(callback)) {\r\n // TODO don't use .call\r\n this.events.on(\"animationended\", callback, object);\r\n }*/\r\n // Apply theme\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n // TODO verify that this is correct\r\n Animation.prototype.debug = function () { };\r\n /**\r\n * Disposes this object, clears up after itself.\r\n */\r\n Animation.prototype.dispose = function () {\r\n _super.prototype.dispose.call(this);\r\n this.pause();\r\n };\r\n /**\r\n * Delays animation start by X milliseconds.\r\n *\r\n * @param delay Delay (ms)\r\n * @return Animation\r\n */\r\n Animation.prototype.delay = function (delay) {\r\n var _this = this;\r\n //@todo Maybe not use `bind()`\r\n if (delay > 0) {\r\n this.pause();\r\n // This is so that it will get disposed if `this.object` is disposed\r\n // TODO hacky, figure out a better way\r\n $array.move(this.object.animations, this);\r\n var id_1 = setTimeout(function () {\r\n _this._delayTimeout = null;\r\n _this.start();\r\n }, delay);\r\n this._delayTimeout = new Disposer(function () {\r\n clearTimeout(id_1);\r\n });\r\n }\r\n return this;\r\n };\r\n Animation.prototype._start = function () {\r\n this._isFinished = false;\r\n // Clear delay timeout if there was one\r\n if (this._delayTimeout) {\r\n this.removeDispose(this._delayTimeout);\r\n this._delayTimeout = null;\r\n }\r\n // Run check if there are already animations playing on the same properties\r\n // and stop them - the last animation takes precedence\r\n this.stopSameAnimations();\r\n // Reset counters\r\n this._pause = false;\r\n // Register animation\r\n $array.move(system.animations, this);\r\n // Register this animation in object's `animations` list\r\n $array.move(this.object.animations, this);\r\n system.requestFrame();\r\n };\r\n /**\r\n * Starts animation.\r\n *\r\n * @return Animation\r\n */\r\n Animation.prototype.start = function () {\r\n this._start();\r\n this._startTime = Date.now();\r\n this._time = 0;\r\n this.staticOptions = [];\r\n // Process initial property values\r\n for (var i = this.animationOptions.length - 1; i >= 0; i--) {\r\n var options_1 = this.animationOptions[i];\r\n if (!$type.hasValue(options_1.from)) {\r\n if (options_1.childObject) {\r\n options_1.from = options_1.childObject[options_1.property];\r\n }\r\n else {\r\n options_1.from = this.object[options_1.property];\r\n if (!$type.hasValue(options_1.from)) {\r\n options_1.from = SVGDefaults[options_1.property];\r\n }\r\n }\r\n /*if (!$type.hasValue(options.from)) {\r\n throw Error(\"Could not get initial transition value.\");\r\n }*/\r\n }\r\n if (options_1.from == options_1.to) { // || options.to == (<any>this.object)[options.property]){ this is not good, as dataItem.value is set to final at once, and we animate workingValue\r\n $array.remove(this.animationOptions, options_1);\r\n }\r\n else if (!$type.hasValue(options_1.from) || (!(options_1.from instanceof Percent) && (options_1.to instanceof Percent)) || ((options_1.from instanceof Percent) && !(options_1.to instanceof Percent))) {\r\n // Initial value is undefined, treat it as static\r\n this.staticOptions.push(options_1);\r\n $array.remove(this.animationOptions, options_1);\r\n }\r\n else {\r\n // Use different update methods for different value types\r\n if ($type.isNumber(options_1.to)) {\r\n // Numeric value\r\n options_1.updateMethod = getProgressNumber;\r\n // Check if initial value is not Percent\r\n if (options_1.from instanceof Percent) {\r\n // It is. Let's convert it to pixel value\r\n // @todo Check if we can do this in a less hacky way\r\n var convertedFrom = this.object[getHybridProperty(options_1.property, \"pixel\")];\r\n if (!isNaN(convertedFrom)) {\r\n options_1.from = convertedFrom;\r\n }\r\n else {\r\n this.staticOptions.push(options_1);\r\n $array.remove(this.animationOptions, options_1);\r\n }\r\n }\r\n else if (isNaN(options_1.from)) {\r\n // Static value\r\n this.staticOptions.push(options_1);\r\n $array.remove(this.animationOptions, options_1);\r\n }\r\n }\r\n else {\r\n // Check if maybe we have a color or percent value\r\n if (options_1.to instanceof Color) {\r\n // Yup - set resolved named color\r\n //options.from = $colors.stringToColor(<string>options.from);\r\n if (options_1.from) {\r\n options_1.updateMethod = getProgressColor;\r\n }\r\n else {\r\n // Static value\r\n this.staticOptions.push(options_1);\r\n $array.remove(this.animationOptions, options_1);\r\n }\r\n }\r\n else if (options_1.to instanceof Percent) {\r\n // Percent\r\n options_1.updateMethod = getProgressPercent;\r\n // Check if the initial value is maybe in pixels\r\n if (!isNaN(options_1.from)) {\r\n // It is. Let's convert it\r\n // @todo Check if we can do this in a less hacky way\r\n var convertedFrom = this.object[getHybridProperty(options_1.property, \"relative\")];\r\n if (!isNaN(convertedFrom)) {\r\n options_1.from = percent(convertedFrom * 100);\r\n }\r\n }\r\n }\r\n else {\r\n // Static value\r\n this.staticOptions.push(options_1);\r\n $array.remove(this.animationOptions, options_1);\r\n }\r\n }\r\n }\r\n }\r\n // Apply static options (just in case they were reset by previous\r\n // animation loop)\r\n this.applyStaticOptions();\r\n if (this.events.isEnabled(\"animationstarted\")) {\r\n var event_1 = {\r\n type: \"animationstarted\",\r\n target: this,\r\n progress: this.progress\r\n };\r\n this.events.dispatchImmediately(\"animationstarted\", event_1);\r\n }\r\n this.update();\r\n // If duration is 0, just end animation\r\n if (this.duration === 0) {\r\n this.end();\r\n }\r\n return this;\r\n };\r\n /**\r\n * Sets loop count for the animation. If parameter is not a valid number the\r\n * animation will keep on looping indefinitely.\r\n *\r\n * @param count Number of times to loop animation\r\n * @return Animation\r\n */\r\n Animation.prototype.loop = function (count) {\r\n if (!$type.isNumber(count)) {\r\n count = Infinity;\r\n }\r\n this._loop = count;\r\n return this;\r\n };\r\n /**\r\n * Pauses animation.\r\n *\r\n * @return Animation\r\n */\r\n Animation.prototype.pause = function () {\r\n this._pause = true;\r\n if (this._delayTimeout) {\r\n this.removeDispose(this._delayTimeout);\r\n this._delayTimeout = null;\r\n }\r\n $array.remove(system.animations, this);\r\n $array.remove(this.object.animations, this);\r\n return this;\r\n };\r\n /**\r\n * Resumes paused animation.\r\n *\r\n * @return Animation\r\n */\r\n Animation.prototype.resume = function () {\r\n this._start();\r\n this._startTime = Date.now() - this._time;\r\n return this;\r\n };\r\n /**\r\n * Jumps to animation end. If animation is set to loop, this will start\r\n * another round of animation from start.\r\n *\r\n * @return Animation\r\n */\r\n Animation.prototype.end = function () {\r\n // Pause and complete the progress\r\n if (this._loop == 0) {\r\n this.pause();\r\n }\r\n this.setProgress(1);\r\n // Apply static options\r\n this.applyStaticOptions();\r\n if (this.events.isEnabled(\"animationended\")) {\r\n var event_2 = {\r\n type: \"animationended\",\r\n target: this,\r\n progress: this.progress\r\n };\r\n this.events.dispatchImmediately(\"animationended\", event_2);\r\n }\r\n // Check if we should loop\r\n if (this._loop > 0) {\r\n this._loop--;\r\n this.start();\r\n }\r\n else {\r\n this.stop();\r\n this._isFinished = true;\r\n }\r\n return this;\r\n };\r\n /**\r\n * Stops animation immediately leaving properties in their current values.\r\n */\r\n Animation.prototype.kill = function () {\r\n this.pause();\r\n this._isFinished = true;\r\n };\r\n /**\r\n * Returns indicator if this animation is finished or not\r\n *\r\n * @return Is finished?\r\n */\r\n Animation.prototype.isFinished = function () {\r\n return this._isFinished;\r\n };\r\n /**\r\n * Applies static options that can't be animated.\r\n */\r\n Animation.prototype.applyStaticOptions = function () {\r\n var _this = this;\r\n $array.each(this.staticOptions, function (options) {\r\n if (options.childObject) {\r\n options.childObject[options.property] = _this.progress == 1 ? options.to : options.from;\r\n }\r\n else {\r\n _this.object[options.property] = _this.progress == 1 ? options.to : options.from;\r\n }\r\n });\r\n };\r\n /**\r\n * Stops animation.\r\n *\r\n * When animation is stopped, the properties of the target object will remain\r\n * where they were at the moment when `stop()` was called.\r\n *\r\n * @param skipEvent Do not trigger `animationstopped` event\r\n * @return Animation\r\n */\r\n Animation.prototype.stop = function (skipEvent) {\r\n this.pause();\r\n if (!skipEvent) {\r\n if (this.events.isEnabled(\"animationstopped\")) {\r\n var event_3 = {\r\n type: \"animationstopped\",\r\n target: this,\r\n progress: this.progress\r\n };\r\n this.events.dispatchImmediately(\"animationstopped\", event_3);\r\n }\r\n }\r\n return this;\r\n };\r\n /**\r\n * Sets current progress and updates object's numeric and color values.\r\n *\r\n * @param progress Progress (0-1)\r\n */\r\n Animation.prototype.setProgress = function (progress) {\r\n var _this = this;\r\n this._time = this.duration * progress; // just in case we call this from outside\r\n $array.each(this.animationOptions, function (options) {\r\n if (options.updateMethod && $type.hasValue(options.from)) {\r\n var value = options.updateMethod(progress, options.from, options.to);\r\n if (options.childObject) {\r\n options.childObject[options.property] = value;\r\n }\r\n else {\r\n _this.object[options.property] = value;\r\n }\r\n }\r\n });\r\n this.progress = progress;\r\n if (this.events.isEnabled(\"animationprogress\")) {\r\n var event_4 = {\r\n type: \"animationprogress\",\r\n target: this,\r\n progress: this.progress\r\n };\r\n this.events.dispatchImmediately(\"animationprogress\", event_4);\r\n }\r\n system.requestFrame();\r\n };\r\n /**\r\n * Tracks and sets progress according to time or frames.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Animation\r\n */\r\n Animation.prototype.update = function () {\r\n if (!this._pause) {\r\n var progress = void 0;\r\n this._time = $math.fitToRange(Date.now() - this._startTime, 0, this.duration);\r\n var timeProgress = this._time / this.duration;\r\n progress = this.easing(timeProgress);\r\n if (this.duration == 0 || !$type.isNumber(progress) || timeProgress >= 1) {\r\n progress = 1;\r\n }\r\n this.setProgress(progress);\r\n if ($math.round(this._time / this.duration, 6) == 1) {\r\n this.end();\r\n }\r\n }\r\n return this;\r\n };\r\n Object.defineProperty(Animation.prototype, \"delayed\", {\r\n /**\r\n * Returns `true` if this animation is delayed.\r\n *\r\n * @readonly\r\n * @return [description]\r\n */\r\n get: function () {\r\n return this._delayTimeout ? true : false;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Checks other animations currently running on the same object and removes\r\n * overlapping options from those other animations that are contained in\r\n * this animation.\r\n *\r\n * This is needed to ensure that no two confurent animations step on each\r\n * other's toes by trying to animate the same property.\r\n */\r\n Animation.prototype.stopSameAnimations = function () {\r\n var _this = this;\r\n // stop animation of the same property\r\n // TODO make this more efficient\r\n // TODO don't copy the array\r\n $array.each($array.copy(this.object.animations), function (animation) {\r\n if (animation !== _this && !animation.delayed) {\r\n var killed_1 = [];\r\n $array.each(_this.animationOptions, function (newOptions) {\r\n $array.each(animation.animationOptions, function (oldOptions) {\r\n if (newOptions.property == oldOptions.property && newOptions.childObject == oldOptions.childObject) {\r\n killed_1.push(oldOptions);\r\n if (animation.animationOptions.length == 0) {\r\n animation.kill();\r\n }\r\n }\r\n });\r\n });\r\n $array.each(killed_1, function (oldOptions) {\r\n $array.remove(animation.animationOptions, oldOptions);\r\n });\r\n }\r\n });\r\n };\r\n /**\r\n * Adds easing functions to \"function\" fields.\r\n *\r\n * @param field Field name\r\n * @return Assign as function?\r\n */\r\n Animation.prototype.asFunction = function (field) {\r\n return field == \"easing\" || _super.prototype.asIs.call(this, field);\r\n };\r\n return Animation;\r\n}(BaseObjectEvents));\r\nexport { Animation };\r\n","import * as $math from \"./Math\";\r\nimport * as $type from \"./Type\";\r\n/**\r\n * ============================================================================\r\n * UTILITY FUNCTIONS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Searches `array` for `value`.\r\n *\r\n * Returns -1 if not found.\r\n *\r\n * @param array Source array\r\n * @param value Value to search\r\n * @returns Index\r\n */\r\nexport function indexOf(array, value) {\r\n var length = array.length;\r\n for (var i = 0; i < length; ++i) {\r\n // TODO handle NaN\r\n if (array[i] === value) {\r\n return i;\r\n }\r\n }\r\n return -1;\r\n}\r\n/**\r\n * Calls `test` for each element in `array`.\r\n *\r\n * If `test` returns `true` then it immediately returns `true`.\r\n *\r\n * If `test` returns `false` for all of the elements in `array` then it returns `false`.\r\n *\r\n * @param array Source array\r\n * @param test Function which is called on each element\r\n * @returns Whether `test` returned true or not\r\n */\r\nexport function any(array, test) {\r\n var length = array.length;\r\n for (var i = 0; i < length; ++i) {\r\n if (test(array[i])) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n}\r\n/**\r\n * Calls `fn` function for every member of array and returns a new array out\r\n * of all outputs.\r\n *\r\n * @param array Source array\r\n * @param fn Callback function\r\n * @returns New array\r\n */\r\nexport function map(array, fn) {\r\n var length = array.length;\r\n var output = new Array(length);\r\n for (var i = 0; i < length; ++i) {\r\n output[i] = fn(array[i], i);\r\n }\r\n return output;\r\n}\r\n/**\r\n * Iterates through all items in array and calls `fn` function for each of\r\n * them.\r\n *\r\n * @param array Source array\r\n * @param fn Callback function\r\n */\r\nexport function each(array, fn) {\r\n var length = array.length;\r\n for (var i = 0; i < length; ++i) {\r\n fn(array[i], i);\r\n }\r\n}\r\n/**\r\n * Iterates through all items in array in reverse order and calls `fn` function for each of\r\n * them.\r\n *\r\n * @param array Source array\r\n * @param fn Callback function\r\n */\r\nexport function eachReverse(array, fn) {\r\n var i = array.length;\r\n while (i--) {\r\n fn(array[i], i);\r\n }\r\n}\r\n/**\r\n * Iterates through all items in array and calls `fn` function for each of\r\n * them.\r\n *\r\n * If `fn` call evaluates to `false`, further iteration is cancelled.\r\n *\r\n * @param array Source array\r\n * @param fn Callback function\r\n */\r\nexport function eachContinue(array, fn) {\r\n var length = array.length;\r\n for (var i = 0; i < length; ++i) {\r\n if (!fn(array[i], i)) {\r\n break;\r\n }\r\n }\r\n}\r\n/**\r\n * Shifts an item at `index` towards beginning of the array.\r\n *\r\n * @param array Source array\r\n * @param index Target element index\r\n */\r\nexport function shiftLeft(array, index) {\r\n var length = array.length;\r\n for (var i = index; i < length; ++i) {\r\n array[i - index] = array[i];\r\n }\r\n array.length = length - index;\r\n}\r\n/**\r\n * Returns the last item of the array.\r\n *\r\n * @param array Source array\r\n * @returns Last item\r\n */\r\nexport function last(array) {\r\n var length = array.length;\r\n return length ? array[length - 1] : undefined;\r\n}\r\n/**\r\n * Returns the first item of the array.\r\n *\r\n * @param array Source array\r\n * @returns Last item\r\n */\r\nexport function first(array) {\r\n return array[0];\r\n}\r\n/**\r\n * Inserts `element` into `array` at `index`.\r\n *\r\n * Caps `index` to be between `0` and `array.length`\r\n *\r\n * @param array Source array\r\n * @param element Item to insert\r\n * @param array Index to insert item at\r\n */\r\nexport function insert(array, element, index) {\r\n //if (array) {\r\n index = $math.fitToRange(index, 0, array.length);\r\n array.splice(index, 0, element);\r\n //}\r\n}\r\n/**\r\n * Removes all copies of `element` from `array` (if they exist) and then\r\n * inserts `element` at `index`.\r\n *\r\n * @param array Source array\r\n * @param element Item\r\n * @param array Index to move item to\r\n */\r\nexport function setIndex(array, element, index) {\r\n remove(array, element);\r\n insert(array, element, index);\r\n}\r\n/**\r\n * Pushes all of the elements from `input` into `array`.\r\n *\r\n * @param array Output array\r\n * @param input Input array\r\n */\r\nexport function pushAll(array, input) {\r\n var length = input.length;\r\n for (var i = 0; i < length; ++i) {\r\n array.push(input[i]);\r\n }\r\n}\r\n/**\r\n * Removes `element` from `array`.\r\n *\r\n * If there are multiple copies of `element`, they are all removed.\r\n *\r\n * @param array Source array\r\n * @param element Item to remove\r\n */\r\nexport function remove(array, element) {\r\n var found = false;\r\n var index = array.indexOf(element);\r\n if (index !== -1) {\r\n found = true;\r\n array.splice(index, 1);\r\n var length_1 = array.length;\r\n while (index < length_1) {\r\n // TODO handle NaN\r\n if (array[index] === element) {\r\n array.splice(index, 1);\r\n --length_1;\r\n }\r\n else {\r\n ++index;\r\n }\r\n }\r\n }\r\n return found;\r\n}\r\n/**\r\n * Adds an `element` to `array`.\r\n *\r\n * If array already contains and item like this, it is removed before adding\r\n * it again.\r\n *\r\n * Optionally `toIndex` can be specified to add element at specific index.\r\n *\r\n * @param array Source array\r\n * @param element Item to add\r\n * @param array Index to move item to\r\n */\r\nexport function move(array, element, toIndex) {\r\n // @todo this implementation must be the same as the List.moveValue method\r\n // @todo don't do anything if the desired index is the same as the current index\r\n var index = indexOf(array, element);\r\n // @todo remove all old values rather than only the first ?\r\n if (index !== -1) {\r\n removeIndex(array, index);\r\n }\r\n if (toIndex == null) {\r\n array.push(element);\r\n }\r\n else {\r\n insertIndex(array, toIndex, element);\r\n }\r\n}\r\n/**\r\n * Inserts `element` into `array` at `index`.\r\n *\r\n * If `index` is not provided, it will insert `element` at the end of `array`.\r\n *\r\n * @param array Source array\r\n * @param element Item to add\r\n * @param array Index to add item at\r\n */\r\nexport function add(array, element, index) {\r\n // Append to the end if index is not set\r\n if (!$type.isNumber(index)) {\r\n array.push(element);\r\n }\r\n // Add to the beginning of array if index is 0\r\n else if (index === 0) {\r\n array.unshift(element);\r\n }\r\n // Add to indicated place if index is set\r\n else {\r\n array.splice(index, 0, element);\r\n }\r\n}\r\n/**\r\n * Removes `element` from `array` (if it exists) and then inserts `element` at\r\n * `index`.\r\n *\r\n * If `index` is not provided, it will insert `element` at the end of `array`.\r\n *\r\n * @param array Source array\r\n * @param element Item to remove\r\n * @param array Index to move item to\r\n */\r\nexport function replace(array, element, index) {\r\n // check if exists\r\n var ind = array.indexOf(element);\r\n // remove if exists\r\n if (ind !== -1) {\r\n array.splice(ind, 1);\r\n }\r\n // add to end if index is not set\r\n if (!$type.isNumber(index)) {\r\n array.push(element);\r\n }\r\n // add to indicated place if index is set\r\n else {\r\n array.splice(index, 0, element);\r\n }\r\n}\r\n/**\r\n * Wraps `input` in an array, if it isn't already an array.\r\n *\r\n * @param input Source value\r\n * @return An array\r\n */\r\nexport function toArray(input) {\r\n if (Array.isArray(input)) {\r\n return input;\r\n }\r\n else {\r\n return [input];\r\n }\r\n}\r\n/**\r\n * Returns `true` if `element` exists in `array`.\r\n *\r\n * @param array Source array\r\n * @param element Item to search for\r\n * @returns Item in array?\r\n */\r\nexport function has(array, element) {\r\n return indexOf(array, element) !== -1;\r\n}\r\n/**\r\n * Returns a shallow copy of `array`.\r\n *\r\n * @param array Source array\r\n * @returns Copy of the array\r\n */\r\nexport function copy(array) {\r\n var length = array.length;\r\n // It's faster to create the array with a pre-defined length\r\n var output = new Array(length);\r\n for (var i = 0; i < length; ++i) {\r\n // Because the array has a pre-defined length, we have to assign rather than push\r\n // This is also faster than pushing\r\n output[i] = array[i];\r\n }\r\n return output;\r\n}\r\n/**\r\n * Returns a copy of `array` which contains all the elements between `start`\r\n * and `end`. (including `start` and excluding `end`)\r\n *\r\n * If `end` is not provided, it defaults to `array.length`.\r\n *\r\n * @param array Source array\r\n * @param start Start index\r\n * @param end End index\r\n * @returns Part of the array\r\n */\r\nexport function slice(array, start, end) {\r\n if (end === void 0) { end = array.length; }\r\n var output = new Array(end - start);\r\n for (var i = start; i < end; ++i) {\r\n output[i - start] = array[i];\r\n }\r\n return output;\r\n}\r\n/**\r\n * Inserts a value into array at specific index.\r\n *\r\n * @param array Source array\r\n * @param index Index\r\n * @param value Value to insert\r\n */\r\nexport function insertIndex(array, index, value) {\r\n array.splice(index, 0, value);\r\n}\r\n/**\r\n * Removes a value from array at specific index.\r\n *\r\n * @param array Source array\r\n * @param index Index\r\n */\r\nexport function removeIndex(array, index) {\r\n array.splice(index, 1);\r\n}\r\n/**\r\n * Orders an array using specific `ordering` function and returns index of\r\n * the `value`.\r\n *\r\n * @ignore Exclude from docs\r\n * @param array Source array\r\n * @param ordering An ordering function\r\n * @param value Value to search for\r\n * @returns Result of the search\r\n */\r\nexport function getSortedIndex(array, ordering, value) {\r\n var start = 0;\r\n var end = array.length;\r\n var found = false;\r\n while (start < end) {\r\n // TODO is this faster/slower than using Math.floor ?\r\n var pivot = (start + end) >> 1;\r\n var order = ordering(value, array[pivot]);\r\n // less\r\n if (order < 0) {\r\n end = pivot;\r\n // equal\r\n }\r\n else if (order === 0) {\r\n found = true;\r\n start = pivot + 1;\r\n // more\r\n }\r\n else {\r\n start = pivot + 1;\r\n }\r\n }\r\n return {\r\n found: found,\r\n index: (found ? start - 1 : start)\r\n };\r\n}\r\n/**\r\n * Searches the array using custom function and returns index of the item if\r\n * found.\r\n *\r\n * Will call `matches` function on all items of the array. If return value\r\n * evaluates to `true`, index is returned.\r\n *\r\n * Otherwise returns -1.\r\n *\r\n * @param array Source array\r\n * @param matches Search function\r\n * @returns Index of the item if found\r\n */\r\nexport function findIndex(array, matches) {\r\n var length = array.length;\r\n for (var i = 0; i < length; ++i) {\r\n if (matches(array[i], i)) {\r\n return i;\r\n }\r\n }\r\n return -1;\r\n}\r\n/**\r\n * Searches the array using custom function and returns item if found.\r\n *\r\n * Will call `matches` function on all items of the array. If return value\r\n * evaluates to `true`, index is returned.\r\n *\r\n * Otherwise returns `undefined`.\r\n *\r\n * @param array Source array\r\n * @param matches Search function\r\n * @returns Item if found\r\n */\r\nexport function find(array, matches) {\r\n var index = findIndex(array, matches);\r\n if (index !== -1) {\r\n return array[index];\r\n }\r\n}\r\n/**\r\n * Iterates through all items in array and calls `fn` function for each of\r\n * them.\r\n *\r\n * @param array Source array\r\n * @param fn Callback function\r\n */\r\nexport function shuffle(array) {\r\n // https://stackoverflow.com/a/2450976/449477\r\n var currentIndex = array.length, temporaryValue, randomIndex;\r\n // While there remain elements to shuffle...\r\n while (0 !== currentIndex) {\r\n // Pick a remaining element...\r\n randomIndex = Math.floor(Math.random() * currentIndex);\r\n currentIndex -= 1;\r\n // And swap it with the current element.\r\n temporaryValue = array[currentIndex];\r\n array[currentIndex] = array[randomIndex];\r\n array[randomIndex] = temporaryValue;\r\n }\r\n}\r\nexport function keepIf(array, keep) {\r\n var length = array.length;\r\n var i = 0;\r\n while (i < length) {\r\n if (keep(array[i])) {\r\n ++i;\r\n }\r\n else {\r\n array.splice(i, 1);\r\n --length;\r\n }\r\n }\r\n}\r\n","/**\r\n * A collection of low-level async operation stuff.\r\n */\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport * as $array from \"./Array\";\r\nvar pendingFrame = false;\r\nvar nextQueue = [];\r\nvar readQueue = [];\r\nvar writeQueue = [];\r\nvar idleQueue = [];\r\nvar fps = 1000 / 60;\r\n/**\r\n * [raf description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\nexport var raf = (typeof requestAnimationFrame === \"function\"\r\n ? function (fn) {\r\n requestAnimationFrame(fn);\r\n }\r\n : function (fn) {\r\n setTimeout(fn, fps);\r\n });\r\n/**\r\n * [frameLoop description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\nfunction frameLoop() {\r\n var now = Date.now();\r\n var length = nextQueue.length;\r\n for (var i = 0; i < length; ++i) {\r\n nextQueue[i](now);\r\n }\r\n $array.shiftLeft(nextQueue, length);\r\n for (var i = 0; i < readQueue.length; ++i) {\r\n readQueue[i](now);\r\n }\r\n readQueue.length = 0;\r\n for (var i = 0; i < writeQueue.length; ++i) {\r\n writeQueue[i](now);\r\n }\r\n writeQueue.length = 0;\r\n if (nextQueue.length === 0 && readQueue.length === 0) {\r\n pendingFrame = false;\r\n }\r\n else {\r\n raf(frameLoop);\r\n }\r\n}\r\n/**\r\n * [pendFrame description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\nfunction pendFrame() {\r\n if (!pendingFrame) {\r\n pendingFrame = true;\r\n raf(frameLoop);\r\n }\r\n}\r\n/**\r\n * [nextFrame description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param fn [description]\r\n */\r\nexport function nextFrame(fn) {\r\n nextQueue.push(fn);\r\n pendFrame();\r\n}\r\n/**\r\n * [readFrame description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param fn [description]\r\n */\r\nexport function readFrame(fn) {\r\n readQueue.push(fn);\r\n pendFrame();\r\n}\r\n/**\r\n * [writeFrame description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param fn [description]\r\n */\r\nexport function writeFrame(fn) {\r\n writeQueue.push(fn);\r\n pendFrame();\r\n}\r\n/**\r\n * [whenIdle description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param fn [description]\r\n */\r\nexport function whenIdle(fn) {\r\n idleQueue.push(fn);\r\n}\r\n/**\r\n * [triggerIdle description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @todo Maybe don't trigger a callback which was added while in the middle of triggering?\r\n */\r\nexport function triggerIdle() {\r\n var now = Date.now();\r\n var length = idleQueue.length;\r\n for (var i = 0; i < length; ++i) {\r\n idleQueue.shift()(now);\r\n }\r\n}\r\n","// Also detects iOS\r\nexport function isSafari() {\r\n return /apple/i.test(navigator.vendor);\r\n}\r\nexport function isInternetExplorer() {\r\n return /MSIE |Trident\\//.test(navigator.userAgent);\r\n}\r\n","/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Dictionary } from \"./Dictionary\";\r\nimport * as $type from \"./Type\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Represents object cache.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Better storage\r\n * @todo TTL logging\r\n * @todo Garbage collector\r\n */\r\nvar Cache = /** @class */ (function () {\r\n function Cache() {\r\n /**\r\n * Storage for cache items.\r\n */\r\n this._storage = new Dictionary();\r\n /**\r\n * Default TTL in milliseconds.\r\n */\r\n this.ttl = 1000;\r\n }\r\n /**\r\n * Caches or updates cached value, resets TTL.\r\n *\r\n * If `ttl` is set to zero, item will never expire.\r\n *\r\n * @param owner An id of the object that owns this cache\r\n * @param key Index key\r\n * @param value Value\r\n * @param ttl TTL of the cache to live in milliseconds\r\n */\r\n Cache.prototype.set = function (owner, key, value, ttl) {\r\n // Create if storage does not exist for this owner\r\n var ownerStorage = this._storage.insertKeyIfEmpty(owner, function () { return new Dictionary(); });\r\n // Create cache item\r\n var item = {\r\n \"touched\": new Date().getTime(),\r\n \"ttl\": $type.isNumber(ttl) ? ttl : this.ttl,\r\n \"value\": value\r\n };\r\n // Set\r\n ownerStorage.setKey(key, item);\r\n };\r\n /**\r\n * Rerturns cached item, respecting TTL.\r\n *\r\n * @param owner An id of the object that owns this cache\r\n * @param key Index key\r\n * @param value Value to return if cache not available\r\n * @return Value, or `undefined` if not set\r\n */\r\n Cache.prototype.get = function (owner, key, value) {\r\n if (value === void 0) { value = undefined; }\r\n // \t\t || ypeof this._storage[owner][key] === \"undefined\" || this._storage[owner][key].expired === true) {\r\n if (this._storage.hasKey(owner)) {\r\n var ownerStorage = this._storage.getKey(owner);\r\n if (ownerStorage.hasKey(key)) {\r\n var cacheItem = ownerStorage.getKey(key);\r\n if (cacheItem.ttl && ((cacheItem.touched + cacheItem.ttl) < new Date().getTime())) {\r\n cacheItem.expired = true;\r\n }\r\n if (cacheItem.expired) {\r\n ownerStorage.removeKey(key);\r\n return value;\r\n }\r\n return cacheItem.value;\r\n }\r\n else {\r\n return value;\r\n }\r\n }\r\n else {\r\n return value;\r\n }\r\n };\r\n /**\r\n * Clears cache for specific owner or everything.\r\n *\r\n * @param owner Owner to clear cache for\r\n */\r\n Cache.prototype.clear = function (owner) {\r\n if (owner) {\r\n this._storage.removeKey(owner);\r\n }\r\n else {\r\n this._storage.clear();\r\n }\r\n };\r\n return Cache;\r\n}());\r\nexport { Cache };\r\n/**\r\n * ============================================================================\r\n * GLOBAL INSTANCE\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * A global instance of cache. Use this instance to cache any values.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\nexport var cache = new Cache();\r\n","/**\r\n * This module contains Color object definition\r\n */\r\nimport { registry } from \"../Registry\";\r\nimport * as $colors from \"./Colors\";\r\nimport * as $type from \"./Type\";\r\n/**\r\n * Represents a color.\r\n *\r\n * `Color` accepts value only in [[iRGB]] object format. To create `Color`\r\n * object by parsing it from any supported string-based formats, use helper\r\n * [[color]] function:\r\n *\r\n * ```TypeScript\r\n * am4core.color(\"#ff0000\");\r\n * am4core.color(\"#f00\");\r\n * am4core.color(\"rgb(255, 0, 0)\");\r\n * am4core.color(\"rgba(255, 0, 0, 0.5)\");\r\n * am4core.color({ r: 255, g: 0, b: 0 });\r\n * am4core.color(\"red\");\r\n * ```\r\n * ```JavaScript\r\n * am4core.color(\"#ff0000\");\r\n * am4core.color(\"#f00\");\r\n * am4core.color(\"rgb(255, 0, 0)\");\r\n * am4core.color(\"rgba(255, 0, 0, 0.5)\");\r\n * am4core.color({ r: 255, g: 0, b: 0 });\r\n * am4core.color(\"red\");\r\n * ```\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/colors/} for color-related info\r\n */\r\nvar Color = /** @class */ (function () {\r\n /**\r\n * Constructor\r\n *\r\n * @param color Source color\r\n */\r\n function Color(color) {\r\n this._value = color;\r\n }\r\n Object.defineProperty(Color.prototype, \"rgb\", {\r\n /**\r\n * Returns [[iRGB]] representation of the color.\r\n *\r\n * @return RGB object\r\n */\r\n get: function () {\r\n return this._value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Color.prototype, \"hex\", {\r\n /**\r\n * Returns color hex value string, e.g. \"#FF0000\".\r\n *\r\n * @return Hex color code\r\n */\r\n get: function () {\r\n return this._value ? $colors.rgbToHex(this._value) : \"none\";\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Color.prototype, \"rgba\", {\r\n /**\r\n * Returns an `rgba()` representation of the color, e.g.:\r\n * `rgba(255, 0, 0, 0.5)`.\r\n *\r\n * @return rgba color string\r\n */\r\n get: function () {\r\n return this._value ? $colors.rgbToRGBA(this._value) : \"none\";\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Color.prototype, \"alpha\", {\r\n /**\r\n * Returns current transparency.\r\n *\r\n * @return Alpha (0-1)\r\n */\r\n get: function () {\r\n if (this._value != null && this._value.a != null) {\r\n return this._value.a;\r\n }\r\n else {\r\n return 1;\r\n }\r\n },\r\n /**\r\n * Set alpha (transparency) of the color.\r\n *\r\n * @param value Alpha (0-1)\r\n */\r\n set: function (value) {\r\n if (this._value) {\r\n this._value.a = value;\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Color.prototype, \"lightColor\", {\r\n /**\r\n * Returns current light color setting.\r\n *\r\n * @return Color\r\n */\r\n get: function () {\r\n if (!this._lightColor) {\r\n this._lightColor = new Color({ r: 255, g: 255, b: 255 });\r\n }\r\n return this._lightColor;\r\n },\r\n /**\r\n * Sets \"light\" color. Used when determining contrasting color.\r\n *\r\n * @param color Color\r\n */\r\n set: function (color) {\r\n this._lightColor = color;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Color.prototype, \"darkColor\", {\r\n /**\r\n * Returns current dark color setting.\r\n *\r\n * @return Color\r\n */\r\n get: function () {\r\n if (!this._darkColor) {\r\n this._darkColor = new Color({ r: 0, g: 0, b: 0 });\r\n }\r\n return this._darkColor;\r\n },\r\n /**\r\n * Sets \"dark\" color. Used when determining contrasting color.\r\n *\r\n * @param color Color\r\n */\r\n set: function (color) {\r\n this._darkColor = color;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Overrides `toString` method so that [[Color]] object can be used as\r\n * string.\r\n *\r\n * @ignore Exclude from docs\r\n * @return String represantion of color (usable in CSS)\r\n */\r\n Color.prototype.toString = function () {\r\n return this.alpha < 1 ? this.rgba : this.hex;\r\n };\r\n /**\r\n * Returns a new [[Color]] which is percent lighter (positive value),\r\n * or darker (negative value).\r\n *\r\n * Parameter is in the scale of -1 to 1.\r\n *\r\n * @param percent Increase/decrease lightness by X\r\n * @return New Color\r\n */\r\n Color.prototype.lighten = function (percent) {\r\n return new Color($colors.lighten(this.rgb, percent));\r\n };\r\n /**\r\n * Returns a new [[Color]] which is percent brighter (positive value),\r\n * or darker (negative value).\r\n *\r\n * Parameter is in the scale of -1 to 1.\r\n *\r\n * @param percent Increase/decrease brightness by X\r\n * @return New Color\r\n */\r\n Color.prototype.brighten = function (percent) {\r\n return new Color($colors.brighten(this.rgb, percent));\r\n };\r\n /**\r\n * Returns a new [[Color]] based on current color with specific saturation\r\n * applied.\r\n *\r\n * `saturation` can be in the range of 0 (fully desaturated) to 1 (fully\r\n * saturated).\r\n *\r\n * @param saturation Saturation (0-1)\r\n * @return New (saturated) color\r\n */\r\n Color.prototype.saturate = function (saturation) {\r\n return new Color($colors.saturate(this.rgb, saturation));\r\n };\r\n Object.defineProperty(Color.prototype, \"alternative\", {\r\n /**\r\n * Returns a either light or dark color that contrasts specifically with\r\n * this color.\r\n *\r\n * Uses properties `darkColor` (default black) and `lightColor` (default\r\n * white).\r\n *\r\n * Useful when determining which color label should be on a colored\r\n * background, so that it stands out.\r\n *\r\n * @return Contrasting color\r\n */\r\n get: function () {\r\n if (this.rgb != null) {\r\n return $colors.isLight(this.rgb) ? this.darkColor : this.lightColor;\r\n }\r\n else {\r\n throw new Error(\"Color does not exist\");\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return Color;\r\n}());\r\nexport { Color };\r\n/**\r\n * Resolves an input variable to a normal [[iRGB]] color and creates [[Color]]\r\n * object for it.\r\n *\r\n * @param value Input value\r\n * @param alpha Alpha (0-1)\r\n * @return Color object\r\n */\r\nexport function color(value, alpha) {\r\n if (!$type.hasValue(value)) {\r\n return new Color(undefined);\r\n }\r\n if (typeof value == \"string\") {\r\n var cacheId = \"_color_\" + value + \"_\" + (alpha || \"1\");\r\n var cached = registry.getCache(cacheId);\r\n if (cached) {\r\n return new Color({\r\n r: cached.r,\r\n g: cached.g,\r\n b: cached.b,\r\n a: cached.a\r\n });\r\n }\r\n var rgb = $colors.rgb(value, alpha);\r\n registry.setCache(cacheId, rgb);\r\n return new Color(rgb);\r\n }\r\n // Check if it's already a Color object\r\n if (value instanceof Color) {\r\n if ($type.hasValue(alpha)) {\r\n value.alpha = alpha;\r\n }\r\n return value;\r\n }\r\n // Not a string or Color instance, it's the iRGB object then\r\n return new Color(value);\r\n}\r\n/**\r\n * Checks if supplied argument is instance of [[Color]].\r\n *\r\n * @param value Input value\r\n * @return Is Color?\r\n */\r\nexport function isColor(value) {\r\n return value instanceof Color;\r\n}\r\n/**\r\n * Converts any value to [[Color]].\r\n *\r\n * @param value Input value\r\n * @return Color\r\n */\r\nexport function castColor(value) {\r\n return color(value);\r\n}\r\n/**\r\n * Converts any value into a [[Color]].\r\n *\r\n * @param value Source value\r\n * @return Color object\r\n */\r\nexport function toColor(value) {\r\n if ($type.hasValue(value) && !isColor(value)) {\r\n return castColor(value);\r\n }\r\n return value;\r\n}\r\n","/**\r\n * This module contains ColorSet object definition\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { BaseObject } from \"../Base\";\r\nimport { Color, color } from \"./Color\";\r\nimport { registry } from \"../Registry\";\r\nimport * as $colors from \"./Colors\";\r\nimport * as $type from \"./Type\";\r\nimport * as $utils from \"./Utils\";\r\nimport * as $math from \"./Math\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Represents a set of colors. Can also generate colors according to set rules.\r\n *\r\n * @important\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/colors/} for color-related info\r\n */\r\nvar ColorSet = /** @class */ (function (_super) {\r\n __extends(ColorSet, _super);\r\n /**\r\n * Constructor\r\n */\r\n function ColorSet() {\r\n var _this = _super.call(this) || this;\r\n /**\r\n * Holds the list of the colors in this set. (preset or auto-generated)\r\n */\r\n _this._list = [];\r\n /**\r\n * Current step in a color generator's cycle.\r\n */\r\n _this._currentStep = 0;\r\n /**\r\n * If set to non-zero value, the ColorSet will start iterating colors from\r\n * that particular index, not the first color in the list.\r\n */\r\n _this._startIndex = 0;\r\n /**\r\n * Current pass in the color generator's cycle. Normally a generator would\r\n * cycle through all available hue range, then repeat it, alternating other\r\n * color properties, to generate distinctive colors.\r\n */\r\n _this._currentPass = 0;\r\n /**\r\n * A base color. If there are no colors pre-set in the color list, ColorSet\r\n * will use this color as a base when generating new ones, applying\r\n * `stepOptions` and `passOptions` to this base color.\r\n */\r\n _this.baseColor = new Color({\r\n r: 103,\r\n g: 183,\r\n b: 220\r\n });\r\n /**\r\n * Modifications to apply with each new generated color.\r\n */\r\n _this.stepOptions = {};\r\n /**\r\n * Modifications to apply on top of `stepOptions` for each \"pass\" of the\r\n * color generation.\r\n *\r\n * A \"pass\" is when ColorSet generates `minColors` number of colors.\r\n */\r\n _this.passOptions = {\r\n brighten: -0.2\r\n };\r\n /**\r\n * An index increment to use when iterating through color list.\r\n *\r\n * Default is 1, which means returning each and every color.\r\n *\r\n * Setting it to a bigger number will make ColorSet `next()` iterator skip\r\n * some colors.\r\n *\r\n * E.g. setting to 2, will return every second color in the list.\r\n *\r\n * This is useful, when the color list has colors that are too close each\r\n * other for contrast.\r\n *\r\n * However, having bigger number will mean that `next()` iterator will go\r\n * through the list quicker, and the generator will kick sooner.\r\n */\r\n _this.step = 1;\r\n /**\r\n * A number of colors to generate in one \"pass\".\r\n *\r\n * This setting can be automatically overridden, if ColorSet has a list of\r\n * pre-set colors. In such case ColorSet will generate exactly the same\r\n * number of colors with each pass as there were colors in original set.\r\n */\r\n _this.minColors = 20;\r\n /**\r\n * Do not let the \"lightness\" of generated color to fall below this\r\n * threshold.\r\n */\r\n _this.minLightness = 0.2;\r\n /**\r\n * Do not let the \"lightness\" of generated color to get above this threshold.\r\n */\r\n _this.maxLightness = 0.9;\r\n /**\r\n * Randomly shuffle generated colors.\r\n */\r\n _this.shuffle = false;\r\n /**\r\n * When colors are generated, based on `stepOptions`, each generated color\r\n * gets either lighter or darker.\r\n *\r\n * If this is set to `true`, color generator will switch to opposing spectrum\r\n * when reaching `minLightness` or `maxLightness`.\r\n *\r\n * E.g. if we start off with a red color, then gradually generate lighter\r\n * colors through rose shades, then switch back to dark red and gradually\r\n * increase the lightness of it until it reaches the starting red.\r\n *\r\n * If set to `false` it will stop there and cap lightness at whatever level\r\n * we hit `minLightness` or `maxLightness`, which may result in a number of\r\n * the same colors.\r\n */\r\n _this.wrap = true;\r\n /**\r\n * Re-use same colors in the pre-set list, when ColorSet runs out of colors,\r\n * rather than start generating new ones.\r\n */\r\n _this.reuse = false;\r\n /**\r\n * Saturation of colors. This will change saturation of all colors of color\r\n * set.\r\n *\r\n * It is recommended to set this in theme, as changing it at run time won't\r\n * make the items to redraw and change color.\r\n */\r\n _this.saturation = 1;\r\n _this.className = \"ColorSet\";\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n Object.defineProperty(ColorSet.prototype, \"list\", {\r\n /**\r\n * Returns current list of colors.\r\n *\r\n * If there are none, a new list of colors is generated, based on various\r\n * ColorSet settings.\r\n *\r\n * @return Color list\r\n */\r\n get: function () {\r\n if (!this._list) {\r\n this.generate(this.minColors);\r\n }\r\n return this._list;\r\n },\r\n /**\r\n * Sets a list of pre-defined colors to use for the iterator.\r\n *\r\n * @param value Color list\r\n */\r\n set: function (value) {\r\n this._list = value;\r\n this.reset();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Gets reusable color.\r\n *\r\n * @param index Index of color\r\n * @return Color\r\n */\r\n ColorSet.prototype.getReusableColor = function (index) {\r\n if (this._list.length == 0) {\r\n this.generate(1);\r\n return this.list[0];\r\n }\r\n else {\r\n var tmpstep = index - (Math.floor(index / this._list.length) * this.list.length);\r\n return this.list[tmpstep];\r\n }\r\n };\r\n /**\r\n * Returns next color in the list using internal iterator counter.\r\n *\r\n * If `step` is set to something other than 1, it may return other color than\r\n * exact next one in the list.\r\n *\r\n * @return Color\r\n */\r\n ColorSet.prototype.next = function () {\r\n var color;\r\n if (this.list.length <= this._currentStep) {\r\n if (this.reuse) {\r\n color = this.getReusableColor(this._currentStep);\r\n }\r\n else {\r\n this.generate($math.max(this.minColors, this._currentStep + 1));\r\n color = this.list[this._currentStep];\r\n }\r\n }\r\n else {\r\n color = this.list[this._currentStep];\r\n }\r\n this._currentStep += this.step;\r\n return color.saturate(this.saturation);\r\n };\r\n /**\r\n * Returns a color at specific index in the list.\r\n *\r\n * @param i Index\r\n * @return Color\r\n */\r\n ColorSet.prototype.getIndex = function (i) {\r\n var color;\r\n if (this.list.length <= i) {\r\n if (this.reuse) {\r\n color = this.getReusableColor(i);\r\n }\r\n else {\r\n this.generate(this.minColors);\r\n color = this.getIndex(i);\r\n }\r\n }\r\n else {\r\n color = this.list[i];\r\n }\r\n return color.saturate(this.saturation);\r\n };\r\n /**\r\n * Resets internal iterator.\r\n *\r\n * Calling `next()` after this will return the very first color in the color\r\n * list, even if it was already returned before.\r\n */\r\n ColorSet.prototype.reset = function () {\r\n this._currentStep = this._startIndex;\r\n };\r\n Object.defineProperty(ColorSet.prototype, \"currentStep\", {\r\n /**\r\n * @return Step\r\n */\r\n get: function () {\r\n return this._currentStep;\r\n },\r\n /**\r\n * Sets current color iteration. You can use this property to skip some\r\n * colors from iteration. E.g. setting it to `10` will skip first ten\r\n * colors.\r\n *\r\n * Please note that the number is zero-based.\r\n *\r\n * @param value Step\r\n */\r\n set: function (value) {\r\n this._currentStep = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ColorSet.prototype, \"startIndex\", {\r\n /**\r\n * @return Index\r\n */\r\n get: function () {\r\n return this._startIndex;\r\n },\r\n /**\r\n * If set to non-zero value, the ColorSet will start iterating colors from\r\n * that particular index, not the first color in the list.\r\n *\r\n * @default 0\r\n * @since 4.4.9\r\n * @param value Index\r\n */\r\n set: function (value) {\r\n this._startIndex = value;\r\n this.reset();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Generates colors based on the various ColorSet settings.\r\n *\r\n * @param count Number of colors to generate\r\n */\r\n ColorSet.prototype.generate = function (count) {\r\n // Init\r\n var curColor = this.currentColor;\r\n var hsl = $colors.rgbToHsl($type.getValue(curColor.rgb));\r\n var hueStep = $type.hasValue(this.stepOptions.hue) ? this.stepOptions.hue : 1 / count;\r\n var mods = {\r\n brighten: 0,\r\n lighten: 0,\r\n hue: hsl.h,\r\n lightness: hsl.l,\r\n saturation: hsl.s\r\n };\r\n // Generate list of hues, and shuffle them\r\n var hues = [];\r\n var startIndex = this.list.length == 0 ? 0 : 1;\r\n if (this.reuse) {\r\n for (var i = startIndex; i <= count; i++) {\r\n hues.push($colors.rgbToHsl($type.getValue(this._list[i].rgb)).h);\r\n }\r\n }\r\n else {\r\n for (var i = startIndex; i <= count; i++) {\r\n var h = hsl.h + hueStep * i;\r\n if (this.wrap && (h > 1)) {\r\n h -= 1;\r\n }\r\n hues.push(h);\r\n }\r\n }\r\n // Shuffle colors randomly\r\n if (this.shuffle) {\r\n hues.sort(function (a, b) {\r\n return Math.random() - 0.5;\r\n });\r\n }\r\n // Generate colors by rotating hue\r\n for (var i = 0; i < count; i++) {\r\n // Update hue\r\n if (this.reuse) {\r\n hsl = $colors.rgbToHsl($type.getValue(this._list[i].rgb));\r\n }\r\n else {\r\n hsl.h = hues.shift();\r\n }\r\n // Apply HSL mods\r\n this.applyStepOptions(hsl, mods, i, this._currentPass);\r\n // Convert back to Color\r\n var c = color($colors.hslToRgb(hsl));\r\n // Apply regular color mods\r\n var brighten = (this.stepOptions.brighten || 0) * i + (this.passOptions.brighten || 0) * this._currentPass;\r\n if (brighten != 0) {\r\n if (this.wrap) {\r\n brighten = $utils.fitNumberRelative(brighten, this.minLightness, this.maxLightness);\r\n }\r\n else {\r\n brighten = $utils.fitNumber(brighten, this.minLightness, this.maxLightness);\r\n }\r\n c = c.brighten(brighten);\r\n }\r\n var lighten = (this.stepOptions.lighten || 0) * i + (this.passOptions.lighten || 0) * this._currentPass;\r\n if (lighten != 0) {\r\n if (this.wrap) {\r\n lighten = $utils.fitNumberRelative(lighten, this.minLightness, this.maxLightness);\r\n }\r\n else {\r\n lighten = $utils.fitNumber(lighten, this.minLightness, this.maxLightness);\r\n }\r\n c = c.lighten(lighten);\r\n }\r\n this._list.push(c);\r\n }\r\n this._currentPass++;\r\n };\r\n Object.defineProperty(ColorSet.prototype, \"currentColor\", {\r\n /**\r\n * Returns current last color. It's either the last color in the list of\r\n * colors, or `baseColor` if list is empty.\r\n *\r\n * @return Color\r\n */\r\n get: function () {\r\n if (this._list.length == 0) {\r\n return this.baseColor.saturate(this.saturation);\r\n }\r\n else {\r\n return this._list[this._list.length - 1].saturate(this.saturation);\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Generates modifiers for color, based on what step and pass.\r\n *\r\n * @param hsl Curren HSL value of the color to modify\r\n * @param base The modifiers that were before modification to use as a base\r\n * @param step Current step\r\n * @param pass Current pass\r\n */\r\n ColorSet.prototype.applyStepOptions = function (hsl, base, step, pass) {\r\n // Process lightness\r\n hsl.l = base.lightness + (this.stepOptions.lightness || 0) * step + (this.passOptions.lightness || 0) * pass;\r\n if (this.wrap) {\r\n if (hsl.l > 1) {\r\n hsl.l = hsl.l - Math.floor(hsl.l);\r\n }\r\n else if (hsl.l < 0) {\r\n hsl.l = -(hsl.l - Math.floor(hsl.l));\r\n }\r\n hsl.l = $utils.fitNumberRelative(hsl.l, this.minLightness, this.maxLightness);\r\n }\r\n else {\r\n if (hsl.l > 1) {\r\n hsl.l = 1;\r\n }\r\n else if (hsl.l < 0) {\r\n hsl.l = 0;\r\n }\r\n hsl.l = $utils.fitNumber(hsl.l, this.minLightness, this.maxLightness);\r\n }\r\n };\r\n /**\r\n * Processes JSON-based config before it is applied to the object.\r\n *\r\n * @ignore Exclude from docs\r\n * @param config Config\r\n */\r\n ColorSet.prototype.processConfig = function (config) {\r\n if (config) {\r\n // Cast colors\r\n if ($type.hasValue(config.list) && $type.isArray(config.list)) {\r\n for (var i = 0, len = config.list.length; i < len; i++) {\r\n if (!(config.list[i] instanceof Color)) {\r\n config.list[i] = color(config.list[i]);\r\n }\r\n }\r\n }\r\n if ($type.hasValue(config.baseColor) && !(config.baseColor instanceof Color)) {\r\n config.baseColor = color(config.baseColor);\r\n }\r\n }\r\n _super.prototype.processConfig.call(this, config);\r\n };\r\n return ColorSet;\r\n}(BaseObject));\r\nexport { ColorSet };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"ColorSet\"] = ColorSet;\r\n","/**\r\n * A collection of color-related functions\r\n */\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport * as $math from \"./Math\";\r\nimport * as $type from \"./Type\";\r\n/**\r\n * Define named colors for easy resolution to RGB.\r\n */\r\nvar namedColors = {\r\n aliceblue: { r: 240, g: 248, b: 255 },\r\n antiquewhite: { r: 250, g: 235, b: 215 },\r\n aqua: { r: 0, g: 255, b: 255 },\r\n aquamarine: { r: 127, g: 255, b: 212 },\r\n azure: { r: 240, g: 255, b: 255 },\r\n beige: { r: 245, g: 245, b: 220 },\r\n bisque: { r: 255, g: 228, b: 196 },\r\n black: { r: 0, g: 0, b: 0 },\r\n blanchedalmond: { r: 255, g: 235, b: 205 },\r\n blue: { r: 0, g: 0, b: 255 },\r\n blueviolet: { r: 138, g: 43, b: 226 },\r\n brown: { r: 165, g: 42, b: 42 },\r\n burlywood: { r: 222, g: 184, b: 135 },\r\n cadetblue: { r: 95, g: 158, b: 160 },\r\n chartreuse: { r: 127, g: 255, b: 0 },\r\n chocolate: { r: 210, g: 105, b: 30 },\r\n coral: { r: 255, g: 127, b: 80 },\r\n cornflowerblue: { r: 100, g: 149, b: 237 },\r\n cornsilk: { r: 255, g: 248, b: 220 },\r\n crimson: { r: 220, g: 20, b: 60 },\r\n cyan: { r: 0, g: 255, b: 255 },\r\n darkblue: { r: 0, g: 0, b: 139 },\r\n darkcyan: { r: 0, g: 139, b: 139 },\r\n darkgoldenrod: { r: 184, g: 134, b: 11 },\r\n darkgray: { r: 169, g: 169, b: 169 },\r\n darkgrey: { r: 169, g: 169, b: 169 },\r\n darkgreen: { r: 0, g: 100, b: 0 },\r\n darkkhaki: { r: 189, g: 183, b: 107 },\r\n darkmagenta: { r: 139, g: 0, b: 139 },\r\n darkolivegreen: { r: 85, g: 107, b: 47 },\r\n darkorange: { r: 255, g: 140, b: 0 },\r\n darkorchid: { r: 153, g: 50, b: 204 },\r\n darkred: { r: 139, g: 0, b: 0 },\r\n darksalmon: { r: 233, g: 150, b: 122 },\r\n darkseagreen: { r: 143, g: 188, b: 143 },\r\n darkslateblue: { r: 72, g: 61, b: 139 },\r\n darkslategray: { r: 47, g: 79, b: 79 },\r\n darkslategrey: { r: 47, g: 79, b: 79 },\r\n darkturquoise: { r: 0, g: 206, b: 209 },\r\n darkviolet: { r: 148, g: 0, b: 211 },\r\n deeppink: { r: 255, g: 20, b: 147 },\r\n deepskyblue: { r: 0, g: 191, b: 255 },\r\n dimgray: { r: 105, g: 105, b: 105 },\r\n dimgrey: { r: 105, g: 105, b: 105 },\r\n dodgerblue: { r: 30, g: 144, b: 255 },\r\n firebrick: { r: 178, g: 34, b: 34 },\r\n floralwhite: { r: 255, g: 250, b: 240 },\r\n forestgreen: { r: 34, g: 139, b: 34 },\r\n fuchsia: { r: 255, g: 0, b: 255 },\r\n gainsboro: { r: 220, g: 220, b: 220 },\r\n ghostwhite: { r: 248, g: 248, b: 255 },\r\n gold: { r: 255, g: 215, b: 0 },\r\n goldenrod: { r: 218, g: 165, b: 32 },\r\n gray: { r: 128, g: 128, b: 128 },\r\n grey: { r: 128, g: 128, b: 128 },\r\n green: { r: 0, g: 128, b: 0 },\r\n greenyellow: { r: 173, g: 255, b: 47 },\r\n honeydew: { r: 240, g: 255, b: 240 },\r\n hotpink: { r: 255, g: 105, b: 180 },\r\n indianred: { r: 205, g: 92, b: 92 },\r\n indigo: { r: 75, g: 0, b: 130 },\r\n ivory: { r: 255, g: 255, b: 240 },\r\n khaki: { r: 240, g: 230, b: 140 },\r\n lavender: { r: 230, g: 230, b: 250 },\r\n lavenderblush: { r: 255, g: 240, b: 245 },\r\n lawngreen: { r: 124, g: 252, b: 0 },\r\n lemonchiffon: { r: 255, g: 250, b: 205 },\r\n lightblue: { r: 173, g: 216, b: 230 },\r\n lightcoral: { r: 240, g: 128, b: 128 },\r\n lightcyan: { r: 224, g: 255, b: 255 },\r\n lightgoldenrodyellow: { r: 250, g: 250, b: 210 },\r\n lightgray: { r: 211, g: 211, b: 211 },\r\n lightgrey: { r: 211, g: 211, b: 211 },\r\n lightgreen: { r: 144, g: 238, b: 144 },\r\n lightpink: { r: 255, g: 182, b: 193 },\r\n lightsalmon: { r: 255, g: 160, b: 122 },\r\n lightseagreen: { r: 32, g: 178, b: 170 },\r\n lightskyblue: { r: 135, g: 206, b: 250 },\r\n lightslategray: { r: 119, g: 136, b: 153 },\r\n lightslategrey: { r: 119, g: 136, b: 153 },\r\n lightsteelblue: { r: 176, g: 196, b: 222 },\r\n lightyellow: { r: 255, g: 255, b: 224 },\r\n lime: { r: 0, g: 255, b: 0 },\r\n limegreen: { r: 50, g: 205, b: 50 },\r\n linen: { r: 250, g: 240, b: 230 },\r\n magenta: { r: 255, g: 0, b: 255 },\r\n maroon: { r: 128, g: 0, b: 0 },\r\n mediumaquamarine: { r: 102, g: 205, b: 170 },\r\n mediumblue: { r: 0, g: 0, b: 205 },\r\n mediumorchid: { r: 186, g: 85, b: 211 },\r\n mediumpurple: { r: 147, g: 112, b: 219 },\r\n mediumseagreen: { r: 60, g: 179, b: 113 },\r\n mediumslateblue: { r: 123, g: 104, b: 238 },\r\n mediumspringgreen: { r: 0, g: 250, b: 154 },\r\n mediumturquoise: { r: 72, g: 209, b: 204 },\r\n mediumvioletred: { r: 199, g: 21, b: 133 },\r\n midnightblue: { r: 25, g: 25, b: 112 },\r\n mintcream: { r: 245, g: 255, b: 250 },\r\n mistyrose: { r: 255, g: 228, b: 225 },\r\n moccasin: { r: 255, g: 228, b: 181 },\r\n navajowhite: { r: 255, g: 222, b: 173 },\r\n navy: { r: 0, g: 0, b: 128 },\r\n oldlace: { r: 253, g: 245, b: 230 },\r\n olive: { r: 128, g: 128, b: 0 },\r\n olivedrab: { r: 107, g: 142, b: 35 },\r\n orange: { r: 255, g: 165, b: 0 },\r\n orangered: { r: 255, g: 69, b: 0 },\r\n orchid: { r: 218, g: 112, b: 214 },\r\n palegoldenrod: { r: 238, g: 232, b: 170 },\r\n palegreen: { r: 152, g: 251, b: 152 },\r\n paleturquoise: { r: 175, g: 238, b: 238 },\r\n palevioletred: { r: 219, g: 112, b: 147 },\r\n papayawhip: { r: 255, g: 239, b: 213 },\r\n peachpuff: { r: 255, g: 218, b: 185 },\r\n peru: { r: 205, g: 133, b: 63 },\r\n pink: { r: 255, g: 192, b: 203 },\r\n plum: { r: 221, g: 160, b: 221 },\r\n powderblue: { r: 176, g: 224, b: 230 },\r\n purple: { r: 128, g: 0, b: 128 },\r\n rebeccapurple: { r: 102, g: 51, b: 153 },\r\n red: { r: 255, g: 0, b: 0 },\r\n rosybrown: { r: 188, g: 143, b: 143 },\r\n royalblue: { r: 65, g: 105, b: 225 },\r\n saddlebrown: { r: 139, g: 69, b: 19 },\r\n salmon: { r: 250, g: 128, b: 114 },\r\n sandybrown: { r: 244, g: 164, b: 96 },\r\n seagreen: { r: 46, g: 139, b: 87 },\r\n seashell: { r: 255, g: 245, b: 238 },\r\n sienna: { r: 160, g: 82, b: 45 },\r\n silver: { r: 192, g: 192, b: 192 },\r\n skyblue: { r: 135, g: 206, b: 235 },\r\n slateblue: { r: 106, g: 90, b: 205 },\r\n slategray: { r: 112, g: 128, b: 144 },\r\n slategrey: { r: 112, g: 128, b: 144 },\r\n snow: { r: 255, g: 250, b: 250 },\r\n springgreen: { r: 0, g: 255, b: 127 },\r\n steelblue: { r: 70, g: 130, b: 180 },\r\n tan: { r: 210, g: 180, b: 140 },\r\n teal: { r: 0, g: 128, b: 128 },\r\n thistle: { r: 216, g: 191, b: 216 },\r\n tomato: { r: 255, g: 99, b: 71 },\r\n turquoise: { r: 64, g: 224, b: 208 },\r\n violet: { r: 238, g: 130, b: 238 },\r\n wheat: { r: 245, g: 222, b: 179 },\r\n white: { r: 255, g: 255, b: 255 },\r\n whitesmoke: { r: 245, g: 245, b: 245 },\r\n yellow: { r: 255, g: 255, b: 0 },\r\n yellowgreen: { r: 154, g: 205, b: 50 }\r\n};\r\n/**\r\n * Tries to resolve a named color into a hex color representation.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Color name\r\n * @return Color\r\n * @deprecated\r\n * @hidden\r\n */\r\n/*export function resolveNamedColor(value: string): Color {\r\n return (<any>namedColors)[value] ? (<any>namedColors)[value] : undefined;\r\n}*/\r\n/**\r\n * Converts a proper color hex code (i.e. \"#FF5500\") or named color (i.e. \"red\")\r\n * into an {iRGB} object. If the code is not correctly formatted, an RGB of\r\n * black is returned.\r\n *\r\n * @ignore Exclude from docs\r\n * @param color Color code\r\n * @param alpha Alpha (0-1)\r\n * @return RGB\r\n */\r\nexport function rgb(color, alpha) {\r\n // Init return value\r\n var rgb;\r\n // Try resolving color format\r\n // Named color?\r\n if (namedColors[color]) {\r\n rgb = namedColors[color];\r\n }\r\n // Hex code?\r\n else if (color.charAt(0) === \"#\") {\r\n rgb = hexToRgb(color);\r\n }\r\n // rgb() format?\r\n else if (color.match(/^rgba?\\(/)) {\r\n rgb = rgbaToRgb(color);\r\n }\r\n // Was not able to resolve?\r\n if (!rgb) {\r\n rgb = { r: 0, g: 0, b: 0, a: 1 };\r\n }\r\n // Set alpha\r\n if ($type.hasValue(alpha)) {\r\n rgb.a = alpha;\r\n }\r\n return rgb;\r\n}\r\n/**\r\n * Converts a hex color code (i.e. \"#FF5500\") to an [[iRGB]] object.\r\n *\r\n * @ignore Exclude from docs\r\n * @param hex Hex color code\r\n * @return RGB\r\n */\r\nexport function hexToRgb(hex) {\r\n // Expand shorthand form (e.g. \"03F\") to full form (e.g. \"0033FF\")\r\n var shorthandRegex = /^#?([a-f\\d])([a-f\\d])([a-f\\d])$/i;\r\n hex = hex.replace(shorthandRegex, function (m, r, g, b) {\r\n return r + r + g + g + b + b;\r\n });\r\n var result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex);\r\n return result ? {\r\n r: parseInt(result[1], 16),\r\n g: parseInt(result[2], 16),\r\n b: parseInt(result[3], 16)\r\n } : hexToRgbWithAlpha(hex);\r\n}\r\n/**\r\n * Converts a hex color code with alpha (i.e. \"#FF5500128\") to an [[iRGB]] object.\r\n *\r\n * @ignore Exclude from docs\r\n * @param hex Hex color code\r\n * @return RGB\r\n */\r\nexport function hexToRgbWithAlpha(hex) {\r\n // Expand shorthand form (e.g. \"03FA\") to full form (e.g. \"0033FFAA\")\r\n var shorthandRegex = /^#?([a-f\\d])([a-f\\d])([a-f\\d])([a-f\\d])$/i;\r\n hex = hex.replace(shorthandRegex, function (m, r, g, b, a) {\r\n return r + r + g + g + b + b + a + a;\r\n });\r\n var result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex);\r\n return result ? {\r\n r: parseInt(result[1], 16),\r\n g: parseInt(result[2], 16),\r\n b: parseInt(result[3], 16),\r\n a: parseInt(result[4], 16) / 256\r\n } : undefined;\r\n}\r\n/**\r\n * Converts color strings in format like `rgb()` and `rgba()` to [[iRGB]].\r\n *\r\n * @ignore Exclude from docs\r\n * @param color Color code\r\n * @return RGB\r\n */\r\nexport function rgbaToRgb(color) {\r\n color = color.replace(/[ ]/g, \"\");\r\n // Init\r\n var matches = color.match(/^rgb\\(([0-9]*),([0-9]*),([0-9]*)\\)/i);\r\n // Try rgb() format\r\n if (matches) {\r\n matches.push(\"1\");\r\n }\r\n else {\r\n matches = color.match(/^rgba\\(([0-9]*),([0-9]*),([0-9]*),([.0-9]*)\\)/i);\r\n if (!matches) {\r\n return;\r\n }\r\n }\r\n return {\r\n r: parseInt(matches[1]),\r\n g: parseInt(matches[2]),\r\n b: parseInt(matches[3]),\r\n a: parseFloat(matches[4])\r\n };\r\n}\r\n/**\r\n * Converts an [[iRGB]] object into a hex color code.\r\n *\r\n * @ignore Exclude from docs\r\n * @param rgb RGB\r\n * @return Hex color code\r\n */\r\nexport function rgbToHex(rgb) {\r\n return \"#\" + pad2(rgb.r.toString(16)) + pad2(rgb.g.toString(16)) + pad2(rgb.b.toString(16));\r\n}\r\n/**\r\n * Converts an [[iRGB]] object into its `rgb()` or `rgba()` representation.\r\n *\r\n * @ignore Exclude from docs\r\n * @param rgb RGB\r\n * @return `rgba()` syntax\r\n */\r\nexport function rgbToRGBA(rgb) {\r\n if ($type.hasValue(rgb.a) && rgb.a !== 1) {\r\n return \"rgba(\" + rgb.r + \",\" + rgb.g + \",\" + rgb.b + \",\" + rgb.a + \")\";\r\n }\r\n else {\r\n return \"rgb(\" + rgb.r + \",\" + rgb.g + \",\" + rgb.b + \")\";\r\n }\r\n}\r\n/**\r\n * Pads a 1-digit string with a zero.\r\n *\r\n * @ignore Exclude from docs\r\n * @param c Input string\r\n * @return Padded string\r\n */\r\nexport function pad2(c) {\r\n return c.length == 1 ? \"0\" + c : \"\" + c;\r\n}\r\n/**\r\n * Returns an intermediate color between two colors based on the relative\r\n * position. Position needs to be in range between 0 and 1. Zero meaning the\r\n * resulting color will be closest to the first reference color.\r\n *\r\n * @ignore Exclude from docs\r\n * @param color1 First reference color\r\n * @param color2 Second reference color\r\n * @param percent Relative position (0-1)\r\n * @return Interpolated color\r\n */\r\nexport function interpolate(rgb1, rgb2, percent) {\r\n percent = $math.fitToRange(percent, 0, 1);\r\n if (rgb1) {\r\n if (rgb2) {\r\n return {\r\n r: rgb1.r + Math.round((rgb2.r - rgb1.r) * percent),\r\n g: rgb1.g + Math.round((rgb2.g - rgb1.g) * percent),\r\n b: rgb1.b + Math.round((rgb2.b - rgb1.b) * percent),\r\n a: (rgb1.a || 1) + Math.round(((rgb2.a || 1) - (rgb1.a || 1)) * percent)\r\n };\r\n }\r\n else {\r\n return rgb1;\r\n }\r\n }\r\n else if (rgb2) {\r\n return rgb2;\r\n }\r\n else {\r\n return rgb1;\r\n }\r\n}\r\n/**\r\n * Returns a color that is `percent` brighter than the reference color.\r\n *\r\n * @ignore Exclude from docs\r\n * @param color Reference color\r\n * @param percent Brightness percent\r\n * @return Hex code of the new color\r\n */\r\nexport function lighten(rgb, percent) {\r\n if (rgb) {\r\n return {\r\n r: Math.max(0, Math.min(255, rgb.r + getLightnessStep(rgb.r, percent))),\r\n g: Math.max(0, Math.min(255, rgb.g + getLightnessStep(rgb.g, percent))),\r\n b: Math.max(0, Math.min(255, rgb.b + getLightnessStep(rgb.b, percent))),\r\n a: rgb.a\r\n };\r\n }\r\n else {\r\n // TODO is this correct ?\r\n return rgb;\r\n }\r\n}\r\n;\r\n/**\r\n * Gets lightness step.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Value\r\n * @param percent Percent\r\n * @return Step\r\n */\r\nexport function getLightnessStep(value, percent) {\r\n var base = percent > 0 ? 255 - value : value;\r\n return Math.round(base * percent);\r\n}\r\n/**\r\n * Returns a color that is `percent` brighter than the source `color`.\r\n *\r\n * @ignore Exclude from docs\r\n * @param color Source color\r\n * @param percent Brightness percent\r\n * @return New color\r\n */\r\nexport function brighten(rgb, percent) {\r\n if (rgb) {\r\n var base = Math.min(Math.max(rgb.r, rgb.g, rgb.b), 230);\r\n //let base = Math.max(rgb.r, rgb.g, rgb.b);\r\n var step = getLightnessStep(base, percent);\r\n return {\r\n r: Math.max(0, Math.min(255, Math.round(rgb.r + step))),\r\n g: Math.max(0, Math.min(255, Math.round(rgb.g + step))),\r\n b: Math.max(0, Math.min(255, Math.round(rgb.b + step))),\r\n a: rgb.a\r\n };\r\n }\r\n else {\r\n // TODO is this correct ?\r\n return rgb;\r\n }\r\n}\r\n;\r\n/**\r\n * Returns brightness step.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Value\r\n * @param percent Percent\r\n * @return Step\r\n */\r\nexport function getBrightnessStep(value, percent) {\r\n var base = 255; //percent > 0 ? 255 - value : value;\r\n return Math.round(base * percent);\r\n}\r\n/**\r\n * Returns a new [[iRGB]] object based on `rgb` parameter with specific\r\n * saturation applied.\r\n *\r\n * `saturation` can be in the range of 0 (fully desaturated) to 1 (fully\r\n * saturated).\r\n *\r\n * @ignore Exclude from docs\r\n * @param color Base color\r\n * @param saturation Saturation (0-1)\r\n * @return New color\r\n */\r\nexport function saturate(rgb, saturation) {\r\n if (rgb == null || saturation == 1) {\r\n return rgb;\r\n }\r\n var hsl = rgbToHsl(rgb);\r\n hsl.s = saturation;\r\n return hslToRgb(hsl);\r\n}\r\n/*\r\n// not used\r\nexport function rgbToMatrix(rgb: iRGB): string {\r\n let r = $type.toText($math.round((rgb.r || 0) / 255, 10));\r\n let g = $type.toText($math.round((rgb.g || 0) / 255, 10));\r\n let b = $type.toText($math.round((rgb.b || 0) / 255, 10));\r\n let a = $type.toText(rgb.a || 1);\r\n return\t r + \" 0 0 0 0\" +\r\n \" 0 \" + g + \" 0 0 0\" +\r\n \" 0 0 \" + b + \" 0 0\" +\r\n \" 0 0 0 \" + a + \" 0\";\r\n}\r\n*/\r\n/**\r\n * The functions below are taken and adapted from Garry Tan's blog post:\r\n * http://axonflux.com/handy-rgb-to-hsl-and-rgb-to-hsv-color-model-c\r\n *\r\n * The further attributions go mjijackson.com, which now seems to be defunct.\r\n */\r\n/**\r\n * Converts an HSL color value to RGB. Conversion formula\r\n * adapted from http://en.wikipedia.org/wiki/HSL_color_space.\r\n * Assumes h, s, and l are contained in the set [0, 1] and\r\n * returns r, g, and b in the set [0, 255].\r\n *\r\n * Function adapted from:\r\n * http://axonflux.com/handy-rgb-to-hsl-and-rgb-to-hsv-color-model-c\r\n *\r\n * @ignore Exclude from docs\r\n * @param h The hue\r\n * @param s The saturation\r\n * @param l The lightness\r\n * @return The RGB representation\r\n */\r\nexport function hslToRgb(color) {\r\n var r, g, b;\r\n var h = color.h;\r\n var s = color.s;\r\n var l = color.l;\r\n if (s == 0) {\r\n r = g = b = l; // achromatic\r\n }\r\n else {\r\n var hue2rgb = function hue2rgb(p, q, t) {\r\n if (t < 0) {\r\n t += 1;\r\n }\r\n if (t > 1) {\r\n t -= 1;\r\n }\r\n if (t < 1 / 6) {\r\n return p + (q - p) * 6 * t;\r\n }\r\n if (t < 1 / 2) {\r\n return q;\r\n }\r\n if (t < 2 / 3) {\r\n return p + (q - p) * (2 / 3 - t) * 6;\r\n }\r\n return p;\r\n };\r\n var q = l < 0.5 ? l * (1 + s) : l + s - l * s;\r\n var p = 2 * l - q;\r\n r = hue2rgb(p, q, h + 1 / 3);\r\n g = hue2rgb(p, q, h);\r\n b = hue2rgb(p, q, h - 1 / 3);\r\n }\r\n return {\r\n r: Math.round(r * 255),\r\n g: Math.round(g * 255),\r\n b: Math.round(b * 255)\r\n };\r\n}\r\n/**\r\n * Converts an RGB color value to HSL. Conversion formula\r\n * adapted from http://en.wikipedia.org/wiki/HSL_color_space.\r\n * Assumes r, g, and b are contained in the set [0, 255] and\r\n * returns h, s, and l in the set [0, 1].\r\n *\r\n * Function adapted from:\r\n * http://axonflux.com/handy-rgb-to-hsl-and-rgb-to-hsv-color-model-c\r\n *\r\n * @ignore Exclude from docs\r\n * @param r The red color value\r\n * @param g The green color value\r\n * @param b The blue color value\r\n * @return The HSL representation\r\n */\r\nexport function rgbToHsl(color) {\r\n var r = color.r / 255;\r\n var g = color.g / 255;\r\n var b = color.b / 255;\r\n var max = Math.max(r, g, b);\r\n var min = Math.min(r, g, b);\r\n var h = 0;\r\n var s = 0;\r\n var l = (max + min) / 2;\r\n if (max === min) {\r\n h = s = 0; // achromatic\r\n }\r\n else {\r\n var d = max - min;\r\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\r\n switch (max) {\r\n case r:\r\n h = (g - b) / d + (g < b ? 6 : 0);\r\n break;\r\n case g:\r\n h = (b - r) / d + 2;\r\n break;\r\n case b:\r\n h = (r - g) / d + 4;\r\n break;\r\n }\r\n h /= 6;\r\n }\r\n return {\r\n h: h,\r\n s: s,\r\n l: l\r\n };\r\n}\r\n/**\r\n * Converts an RGB color value to HSV. Conversion formula\r\n * adapted from http://en.wikipedia.org/wiki/HSV_color_space.\r\n * Assumes r, g, and b are contained in the set [0, 255] and\r\n * returns h, s, and v in the set [0, 1].\r\n *\r\n * @ignore Exclude from docs\r\n * @param Number r The red color value\r\n * @param Number g The green color value\r\n * @param Number b The blue color value\r\n * @return Array The HSV representation\r\n */\r\nexport function rgbToHsv(color) {\r\n var r = color.r / 255;\r\n var g = color.g / 255;\r\n var b = color.b / 255;\r\n var max = Math.max(r, g, b), min = Math.min(r, g, b);\r\n var h = 0;\r\n var s = 0;\r\n var v = max;\r\n var d = max - min;\r\n s = max == 0 ? 0 : d / max;\r\n if (max == min) {\r\n h = 0; // achromatic\r\n }\r\n else {\r\n switch (max) {\r\n case r:\r\n h = (g - b) / d + (g < b ? 6 : 0);\r\n break;\r\n case g:\r\n h = (b - r) / d + 2;\r\n break;\r\n case b:\r\n h = (r - g) / d + 4;\r\n break;\r\n }\r\n h /= 6;\r\n }\r\n return {\r\n h: h,\r\n s: s,\r\n v: v\r\n };\r\n}\r\n/**\r\n * Converts an HSV color value to RGB. Conversion formula\r\n * adapted from http://en.wikipedia.org/wiki/HSV_color_space.\r\n * Assumes h, s, and v are contained in the set [0, 1] and\r\n * returns r, g, and b in the set [0, 255].\r\n *\r\n * @ignore Exclude from docs\r\n * @param Number h The hue\r\n * @param Number s The saturation\r\n * @param Number v The value\r\n * @return Array The RGB representation\r\n */\r\nexport function hsvToRgb(color) {\r\n var r = 0;\r\n var g = 0;\r\n var b = 0;\r\n var h = color.h;\r\n var s = color.s;\r\n var v = color.v;\r\n var i = Math.floor(h * 6);\r\n var f = h * 6 - i;\r\n var p = v * (1 - s);\r\n var q = v * (1 - f * s);\r\n var t = v * (1 - (1 - f) * s);\r\n switch (i % 6) {\r\n case 0:\r\n r = v;\r\n g = t;\r\n b = p;\r\n break;\r\n case 1:\r\n r = q;\r\n g = v;\r\n b = p;\r\n break;\r\n case 2:\r\n r = p;\r\n g = v;\r\n b = t;\r\n break;\r\n case 3:\r\n r = p;\r\n g = q;\r\n b = v;\r\n break;\r\n case 4:\r\n r = t;\r\n g = p;\r\n b = v;\r\n break;\r\n case 5:\r\n r = v;\r\n g = p;\r\n b = q;\r\n break;\r\n }\r\n return {\r\n r: Math.round(r * 255),\r\n g: Math.round(g * 255),\r\n b: Math.round(b * 255)\r\n };\r\n}\r\n/**\r\n * Returns `true` if color is \"light\". Useful indetermining which contrasting\r\n * color to use for elements over this color. E.g.: you would want to use\r\n * black text over light background, and vice versa.\r\n *\r\n * @ignore Exclude from docs\r\n * @param color Source color\r\n * @return Light?\r\n */\r\nexport function isLight(color) {\r\n return ((color.r * 299) + (color.g * 587) + (color.b * 114)) / 1000 >= 128;\r\n}\r\n","/**\r\n * A collection of DOM-related functions.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Disposer } from \"./Disposer\";\r\nimport { readFrame, writeFrame } from \"./AsyncPending\";\r\nimport { options } from \"../Options\";\r\nimport * as $object from \"./Object\";\r\nimport * as $array from \"./Array\";\r\nimport * as $type from \"./Type\";\r\n/**\r\n * SVG namespace.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\nexport var SVGNS = \"http://www.w3.org/2000/svg\";\r\n/**\r\n * XML namespace.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\nexport var XMLNS = \"http://www.w3.org/2000/xmlns/\";\r\n/**\r\n * XLINK namespace.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\nexport var XLINK = \"http://www.w3.org/1999/xlink\";\r\n/**\r\n * Function that adds a disposable event listener directly to a DOM element.\r\n *\r\n * @ignore Exclude from docs\r\n * @param dom A DOM element to add event to\r\n * @param type Event type\r\n * @param listener Event listener\r\n * @returns Disposable event\r\n */\r\nexport function addEventListener(dom, type, listener, options) {\r\n //@todo proper type check for options: EventListenerOptions | boolean (TS for some reason gives error on passive parameter)\r\n //console.log(type, dom);\r\n dom.addEventListener(type, listener, options || false);\r\n return new Disposer(function () {\r\n dom.removeEventListener(type, listener, options || false);\r\n });\r\n}\r\n/**\r\n * Finds and returns an element reference using following logic:\r\n * * If we pass in an element instance, we just return it back.\r\n * * If we pass in a string, the function looks for an element with such id.\r\n * * If no element with such id is found, we grab the first element with a tag name like this.\r\n *\r\n * @ignore Exclude from docs\r\n * @param el Element definition (reference, or id, or tag name)\r\n * @return Element reference\r\n * @todo Review this function as it seems pretty fuzzy and hacky\r\n */\r\nexport function getElement(el) {\r\n if ($type.isString(el)) {\r\n var e = document.getElementById(el);\r\n if (e == null) {\r\n e = document.getElementsByClassName(el)[0];\r\n }\r\n if (e instanceof HTMLElement) {\r\n return e;\r\n }\r\n }\r\n else if (el instanceof HTMLElement) {\r\n return el;\r\n }\r\n}\r\n/**\r\n * Adds a class name to an HTML or SVG element.\r\n *\r\n * @ignore Exclude from docs\r\n * @param element Element\r\n * @param className Class name to add\r\n */\r\nexport function addClass(element, className) {\r\n if (!element) {\r\n return;\r\n }\r\n if (element.classList) {\r\n element.classList.add(className);\r\n }\r\n else {\r\n var currentClassName = element.getAttribute(\"class\");\r\n if (currentClassName) {\r\n element.setAttribute(\"class\", currentClassName.split(\" \").filter(function (item) {\r\n return item !== className;\r\n }).join(\" \") + \" \" + className);\r\n }\r\n else {\r\n element.setAttribute(\"class\", className);\r\n }\r\n //element.className = element.className.replace(new RegExp(\"^\" + className + \"| \" + className), \"\") + \" \" + className;\r\n }\r\n}\r\n/**\r\n * Removes a class name from an HTML or SVG element.\r\n *\r\n * @ignore Exclude from docs\r\n * @param element Element\r\n * @param className Class name to add\r\n */\r\nexport function removeClass(element, className) {\r\n if (!element) {\r\n return;\r\n }\r\n if (element.classList) {\r\n element.classList.remove(className);\r\n }\r\n else {\r\n var currentClassName = element.getAttribute(\"class\");\r\n if (currentClassName) {\r\n element.setAttribute(\"class\", currentClassName.split(\" \").filter(function (item) {\r\n return item !== className;\r\n }).join(\" \"));\r\n }\r\n //element.className = element.className.replace(new RegExp(\"^\" + className + \"| \" + className), \"\");\r\n }\r\n}\r\n/**\r\n * Sets style property on DOM element.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Still needed?\r\n */\r\nexport function setStyle(element, property, value) {\r\n element.style[property] = value;\r\n}\r\n/**\r\n * Gets the computed style value for an element.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\nexport function getComputedStyle(element, property) {\r\n if (element.currentStyle) {\r\n return element.currentStyle[property];\r\n }\r\n return document.defaultView.getComputedStyle(element, null).getPropertyValue(property);\r\n}\r\n/**\r\n * Removes focus from any element by shifting focus to body.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\nexport function blur() {\r\n if (document.activeElement && document.activeElement != document.body) {\r\n if (document.activeElement.blur) {\r\n document.activeElement.blur();\r\n }\r\n else {\r\n var input = document.createElement(\"button\");\r\n input.style.position = \"fixed\";\r\n input.style.top = \"0px\";\r\n input.style.left = \"-10000px\";\r\n document.body.appendChild(input);\r\n input.focus();\r\n input.blur();\r\n document.body.removeChild(input);\r\n }\r\n }\r\n}\r\n/**\r\n * Tries to focus the element.\r\n *\r\n * @ignore Exlude from docs\r\n * @param element Element to focus\r\n */\r\nexport function focus(element) {\r\n if (element instanceof HTMLElement) {\r\n element.focus();\r\n }\r\n else {\r\n var input = document.createElement(\"input\");\r\n var fo = document.createElementNS(SVGNS, \"foreignObject\");\r\n fo.appendChild(input);\r\n element.appendChild(fo);\r\n input.focus();\r\n input.disabled = true;\r\n fo.remove();\r\n }\r\n /*if ((<any>element).focus != undefined) {\r\n (<any>element).focus();\r\n }\r\n else if (element instanceof SVGSVGElement) {\r\n // Not implemented\r\n // @todo implement focus fallback\r\n }*/\r\n}\r\n/**\r\n * Returns markup for the element including the element tag itself.\r\n * SVG elements do not support `outerHTML` so this functions applies of\r\n * a workaround which creates a new temporary wrapper, clones element and uses\r\n * wrapper's `innerHTML`.\r\n *\r\n * @ignore Exclude from docs\r\n * @param element Element to get full markup for\r\n * @return Markup\r\n * @deprecated Not in use anywhere\r\n */\r\nexport function outerHTML(element) {\r\n if (element.outerHTML) {\r\n return element.outerHTML;\r\n }\r\n else {\r\n var twrap = document.createElement(\"div\");\r\n var tnode = element.cloneNode(true);\r\n twrap.appendChild(tnode);\r\n var content = twrap.innerHTML;\r\n return content;\r\n }\r\n}\r\n/**\r\n * Checks if element is a valid DOM node.\r\n *\r\n * @ignore Exclude from docs\r\n * @param el Element\r\n * @return `true` if element is a valid DOM node\r\n */\r\nexport function isElement(el) {\r\n return el instanceof Object && el && el.nodeType === 1;\r\n}\r\n/**\r\n * Checks of element `a` contains element `b`.\r\n *\r\n * @param a Aleged ascendant\r\n * @param b Aleged descendant\r\n * @return Contains?\r\n */\r\nexport function contains(a, b) {\r\n var cursor = b;\r\n while (true) {\r\n if (a === cursor) {\r\n return true;\r\n }\r\n else if (cursor.parentNode == null) {\r\n // TODO better ShadowRoot detection\r\n if (cursor.host == null) {\r\n return false;\r\n }\r\n else {\r\n cursor = cursor.host;\r\n }\r\n }\r\n else {\r\n cursor = cursor.parentNode;\r\n }\r\n }\r\n}\r\n/**\r\n * Returns the shadow root of the element or null\r\n *\r\n * @param a Node\r\n * @return Root\r\n */\r\nexport function getShadowRoot(a) {\r\n var cursor = a;\r\n while (true) {\r\n if (cursor.parentNode == null) {\r\n // TODO better ShadowRoot detection\r\n if (cursor.host != null) {\r\n return cursor;\r\n }\r\n else {\r\n return null;\r\n }\r\n }\r\n else {\r\n cursor = cursor.parentNode;\r\n }\r\n }\r\n}\r\n/**\r\n * Returns the root of the element (either the Document or the ShadowRoot)\r\n *\r\n * @param a Node\r\n * @return Root\r\n */\r\nexport function getRoot(a) {\r\n // TODO replace with Node.prototype.getRootNode\r\n var owner = a.ownerDocument;\r\n var cursor = a;\r\n while (true) {\r\n if (cursor.parentNode == null) {\r\n // If the cursor is the document, or it is a ShadowRoot\r\n // TODO better ShadowRoot detection\r\n if (cursor === owner || cursor.host != null) {\r\n return cursor;\r\n }\r\n else {\r\n return null;\r\n }\r\n }\r\n else {\r\n cursor = cursor.parentNode;\r\n }\r\n }\r\n}\r\n/**\r\n * Gets the true target of the Event.\r\n *\r\n * This is needed to make events work with the shadow DOM.\r\n *\r\n * @param event Event\r\n * @return EventTarget\r\n */\r\nexport function eventTarget(event) {\r\n if (typeof event.composedPath === \"function\") {\r\n return event.composedPath()[0];\r\n }\r\n else {\r\n return event.target;\r\n }\r\n}\r\n/**\r\n * Copies attributes from one element to another.\r\n *\r\n * @ignore Exclude from docs\r\n * @param source Element to copy attributes from\r\n * @param target Element to copy attributes to\r\n */\r\nexport function copyAttributes(source, target) {\r\n $array.each(source.attributes, function (attr) {\r\n // TODO what if it's null ?\r\n if (attr.value != null) {\r\n target.setAttribute(attr.name, attr.value);\r\n }\r\n });\r\n}\r\n/**\r\n * [fixPixelPerfect description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param el Element\r\n */\r\nexport function fixPixelPerfect(el) {\r\n readFrame(function () {\r\n // sometimes IE doesn't like this\r\n // TODO figure out a way to remove this\r\n try {\r\n var rect = el.getBoundingClientRect();\r\n var left_1 = rect.left - Math.round(rect.left);\r\n var top_1 = rect.top - Math.round(rect.top);\r\n if (left_1 !== 0) {\r\n writeFrame(function () {\r\n el.style.left = left_1 + \"px\";\r\n });\r\n }\r\n if (top_1 !== 0) {\r\n writeFrame(function () {\r\n el.style.top = top_1 + \"px\";\r\n });\r\n }\r\n }\r\n catch (e) { }\r\n });\r\n}\r\n/**\r\n * [rootStylesheet description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\nvar rootStylesheet;\r\n/**\r\n * [getStylesheet description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @return [description]\r\n */\r\nfunction getStylesheet(element) {\r\n if (element == null) {\r\n if (!$type.hasValue(rootStylesheet)) {\r\n // TODO use createElementNS ?\r\n var e = document.createElement(\"style\");\r\n e.type = \"text/css\";\r\n if (options.nonce != \"\") {\r\n e.setAttribute(\"nonce\", options.nonce);\r\n }\r\n document.head.appendChild(e);\r\n rootStylesheet = e.sheet;\r\n }\r\n return rootStylesheet;\r\n }\r\n else {\r\n // TODO use createElementNS ?\r\n var e = document.createElement(\"style\");\r\n e.type = \"text/css\";\r\n if (options.nonce != \"\") {\r\n e.setAttribute(\"nonce\", options.nonce);\r\n }\r\n element.appendChild(e);\r\n return e.sheet;\r\n }\r\n}\r\n/**\r\n * [makeStylesheet description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param selector [description]\r\n * @return [description]\r\n */\r\nfunction appendStylesheet(root, selector) {\r\n var index = root.cssRules.length;\r\n root.insertRule(selector + \"{}\", index);\r\n return root.cssRules[index];\r\n}\r\n/**\r\n * Defines a class for a CSS rule.\r\n *\r\n * Can be used to dynamically add CSS to the document.\r\n */\r\nvar StyleRule = /** @class */ (function (_super) {\r\n __extends(StyleRule, _super);\r\n /**\r\n * Constructor.\r\n *\r\n * @param selector CSS selector\r\n * @param styles An object of style attribute - value pairs\r\n */\r\n function StyleRule(element, selector, styles) {\r\n var _this = this;\r\n var root = getStylesheet(element);\r\n // TODO test this\r\n _this = _super.call(this, function () {\r\n // TODO a bit hacky\r\n var index = $array.indexOf(root.cssRules, _this._rule);\r\n if (index === -1) {\r\n throw new Error(\"Could not dispose StyleRule\");\r\n }\r\n else {\r\n // TODO if it's empty remove it from the DOM ?\r\n root.deleteRule(index);\r\n }\r\n }) || this;\r\n _this._rule = appendStylesheet(root, selector);\r\n $object.each(styles, function (key, value) {\r\n _this.setStyle(key, value);\r\n });\r\n return _this;\r\n }\r\n Object.defineProperty(StyleRule.prototype, \"selector\", {\r\n /**\r\n * @return CSS selector\r\n */\r\n get: function () {\r\n return this._rule.selectorText;\r\n },\r\n /**\r\n * A CSS selector text.\r\n *\r\n * E.g.: `.myClass p`\r\n *\r\n * @param selector CSS selector\r\n */\r\n set: function (selector) {\r\n this._rule.selectorText = selector;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Sets the same style properties with browser-specific prefixes.\r\n *\r\n * @param name Attribute name\r\n * @param value Attribute value\r\n */\r\n StyleRule.prototype._setVendorPrefixName = function (name, value) {\r\n var style = this._rule.style;\r\n style.setProperty(\"-webkit-\" + name, value, \"\");\r\n style.setProperty(\"-moz-\" + name, value, \"\");\r\n style.setProperty(\"-ms-\" + name, value, \"\");\r\n style.setProperty(\"-o-\" + name, value, \"\");\r\n style.setProperty(name, value, \"\");\r\n };\r\n /**\r\n * Sets a value for specific style attribute.\r\n *\r\n * @param name Attribute\r\n * @param value Value\r\n */\r\n StyleRule.prototype.setStyle = function (name, value) {\r\n if (name === \"transition\") {\r\n this._setVendorPrefixName(name, value);\r\n }\r\n else {\r\n this._rule.style.setProperty(name, value, \"\");\r\n }\r\n };\r\n return StyleRule;\r\n}(Disposer));\r\nexport { StyleRule };\r\n/**\r\n * An internal counter for unique style ids.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\nvar styleId = 0;\r\n/**\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\nvar StyleClass = /** @class */ (function (_super) {\r\n __extends(StyleClass, _super);\r\n /**\r\n * Constructor.\r\n *\r\n * @param styles An object of style attribute - value pairs\r\n * @param name Class name\r\n */\r\n function StyleClass(element, styles, name) {\r\n var _this = this;\r\n var className = (!$type.hasValue(name)\r\n // TODO generate the classname randomly\r\n ? \"__style_\" + (++styleId) + \"__\"\r\n : name);\r\n _this = _super.call(this, element, \".\" + className, styles) || this;\r\n _this._className = className;\r\n return _this;\r\n }\r\n Object.defineProperty(StyleClass.prototype, \"className\", {\r\n /**\r\n * @return Class name\r\n */\r\n get: function () {\r\n return this._className;\r\n },\r\n /**\r\n * Class name.\r\n *\r\n * @param name Class name\r\n */\r\n set: function (name) {\r\n this._className = name;\r\n this.selector = \".\" + name;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Converts the whole class to\r\n * @ignore Exclude from docs\r\n */\r\n StyleClass.prototype.toString = function () {\r\n return this._className;\r\n };\r\n return StyleClass;\r\n}(StyleRule));\r\nexport { StyleClass };\r\nexport function ready(f) {\r\n if (document.readyState !== \"loading\") {\r\n f();\r\n }\r\n else {\r\n var listener_1 = function () {\r\n if (document.readyState !== \"loading\") {\r\n document.removeEventListener(\"readystatechange\", listener_1);\r\n f();\r\n }\r\n };\r\n document.addEventListener(\"readystatechange\", listener_1);\r\n }\r\n}\r\n/**\r\n * Returns a font fmaily name for the element (directly set or\r\n * computed/inherited).\r\n *\r\n * @ignore Exclude from docs\r\n * @param element Element\r\n * @return Font family\r\n */\r\nexport function findFont(element) {\r\n // Check if element has styles set\r\n var font = getComputedStyle(element, \"font-family\");\r\n if (!font) {\r\n // Completely transparent. Look for a parent\r\n var parent_1 = element.parentElement || element.parentNode;\r\n if (parent_1) {\r\n return findFont(parent_1);\r\n }\r\n else {\r\n return undefined;\r\n }\r\n }\r\n else {\r\n return font;\r\n }\r\n}\r\n/**\r\n * Returns a font fmaily name for the element (directly set or\r\n * computed/inherited).\r\n *\r\n * @ignore Exclude from docs\r\n * @param element Element\r\n * @return Font family\r\n */\r\nexport function findFontSize(element) {\r\n // Check if element has styles set\r\n var font = getComputedStyle(element, \"font-size\");\r\n if (!font) {\r\n // Completely transparent. Look for a parent\r\n var parent_2 = element.parentElement || element.parentNode;\r\n if (parent_2) {\r\n return findFontSize(parent_2);\r\n }\r\n else {\r\n return undefined;\r\n }\r\n }\r\n else {\r\n return font;\r\n }\r\n}\r\n/**\r\n * Checks whether element is not visible, whether directly or via its\r\n * ascendants.\r\n *\r\n * @param element Target element\r\n * @return Hidden?\r\n */\r\nexport function isHidden(element) {\r\n return (element.offsetParent === null);\r\n}\r\n/**\r\n * Checks wthether element is in the current viewport.\r\n *\r\n * @since 2.5.5\r\n * @param el Element\r\n * @return Within viewport?\r\n */\r\nexport function isElementInViewport(el, viewportTarget) {\r\n // Get position data of the element\r\n var rect = el.getBoundingClientRect();\r\n // Convert to array\r\n var targets = $type.isArray(viewportTarget) ? viewportTarget : viewportTarget ? [viewportTarget] : [];\r\n // Should we measure against specific viewport element?\r\n if (targets.length) {\r\n for (var i = 0; i < targets.length; i++) {\r\n var target = targets[i];\r\n // Check if viewport itself is visible\r\n if (!isElementInViewport(target)) {\r\n return false;\r\n }\r\n // Check if element is visible within the viewport\r\n var viewportRect = target.getBoundingClientRect();\r\n if (rect.top >= 0 &&\r\n rect.left >= 0 &&\r\n rect.top <= (viewportRect.top + viewportRect.height) &&\r\n rect.left <= (viewportRect.left + viewportRect.width)) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n return (rect.top >= 0 &&\r\n rect.left >= 0 &&\r\n rect.top <= (window.innerHeight || document.documentElement.clientHeight) &&\r\n rect.left <= (window.innerWidth || document.documentElement.clientWidth));\r\n}\r\n","import { __extends, __generator, __read } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Disposer } from \"./Disposer\";\r\nimport { EventDispatcher } from \"./EventDispatcher\";\r\nimport * as $object from \"./Object\";\r\nimport * as $iter from \"./Iterator\";\r\nimport * as $string from \"./String\";\r\n/**\r\n * A disposable dictionary, which when disposed itself will call `dispose()`\r\n * method on all its items.\r\n */\r\nvar DictionaryDisposer = /** @class */ (function (_super) {\r\n __extends(DictionaryDisposer, _super);\r\n function DictionaryDisposer(dict) {\r\n var _this = this;\r\n var disposer = dict.events.on(\"removed\", function (x) {\r\n x.oldValue.dispose();\r\n }, undefined, false);\r\n _this = _super.call(this, function () {\r\n disposer.dispose();\r\n // TODO clear the dictionary ?\r\n $iter.each(dict.iterator(), function (a) {\r\n var v = a[1];\r\n v.dispose();\r\n });\r\n }) || this;\r\n return _this;\r\n }\r\n return DictionaryDisposer;\r\n}(Disposer));\r\nexport { DictionaryDisposer };\r\n/**\r\n * A Dictionary is collection where values of some type can be mapped to\r\n * string keys.\r\n *\r\n * You might call it an \"associative list\" or \"associative array\".\r\n */\r\nvar Dictionary = /** @class */ (function () {\r\n /**\r\n * Constructor\r\n */\r\n function Dictionary() {\r\n /**\r\n * Event dispatcher.\r\n */\r\n this.events = new EventDispatcher();\r\n this._dictionary = {};\r\n }\r\n /**\r\n * Returns `true` if key exists in Dictionary.\r\n *\r\n * @param key The key to search for\r\n * @return `true` if key exists, `false` if it doesn't\r\n */\r\n Dictionary.prototype.hasKey = function (key) {\r\n return $object.hasKey(this._dictionary, key);\r\n };\r\n /**\r\n * Returns the value for a specific key.\r\n *\r\n * @param key The key to search for\r\n * @return Value for the key, or `undefined` if it doesn't exist\r\n */\r\n Dictionary.prototype.getKey = function (key) {\r\n return this._dictionary[key];\r\n };\r\n /**\r\n * Inserts value at specific key.\r\n *\r\n * Will thrown an exception if the key already exists in the dictionary.\r\n *\r\n * @param key Key\r\n * @param value Value\r\n */\r\n Dictionary.prototype.insertKey = function (key, value) {\r\n if ($object.hasKey(this._dictionary, key)) {\r\n throw new Error(\"Key \" + key + \" already exists in dictionary\");\r\n }\r\n else {\r\n this._dictionary[key] = value;\r\n if (this.events.isEnabled(\"insertKey\")) {\r\n this.events.dispatchImmediately(\"insertKey\", {\r\n type: \"insertKey\",\r\n target: this,\r\n key: key,\r\n newValue: value\r\n });\r\n }\r\n }\r\n };\r\n /**\r\n * Adds or updates key/value into dictionary.\r\n *\r\n * If the key already exists, the old value will be overwritten.\r\n *\r\n * If the new value is exactly the same as the old value (using ===), it won't do anything.\r\n *\r\n * @param key Key\r\n * @param value Value\r\n */\r\n Dictionary.prototype.setKey = function (key, value) {\r\n if ($object.hasKey(this._dictionary, key)) {\r\n var oldValue = this._dictionary[key];\r\n if (oldValue !== value) {\r\n this._dictionary[key] = value;\r\n if (this.events.isEnabled(\"setKey\")) {\r\n this.events.dispatchImmediately(\"setKey\", {\r\n type: \"setKey\",\r\n target: this,\r\n key: key,\r\n oldValue: oldValue,\r\n newValue: value\r\n });\r\n }\r\n if (this.events.isEnabled(\"removed\")) {\r\n this.events.dispatchImmediately(\"removed\", {\r\n type: \"removed\",\r\n target: this,\r\n oldValue: oldValue\r\n });\r\n }\r\n }\r\n }\r\n else {\r\n this._dictionary[key] = value;\r\n if (this.events.isEnabled(\"insertKey\")) {\r\n this.events.dispatchImmediately(\"insertKey\", {\r\n type: \"insertKey\",\r\n target: this,\r\n key: key,\r\n newValue: value\r\n });\r\n }\r\n }\r\n };\r\n /**\r\n * Updates the value at specific `key` using custom function.\r\n *\r\n * Passes in current value into the function, and uses its output as a new\r\n * value.\r\n *\r\n * If the new value is exactly the same as the old value (using ===), it won't do anything.\r\n *\r\n * @ignore Exclude from docs\r\n * @param key Key\r\n * @param fn Function to transform the value\r\n */\r\n Dictionary.prototype.updateKey = function (key, fn) {\r\n if ($object.hasKey(this._dictionary, key)) {\r\n var oldValue = this._dictionary[key];\r\n var newValue = fn(oldValue);\r\n if (oldValue !== newValue) {\r\n this._dictionary[key] = newValue;\r\n if (this.events.isEnabled(\"setKey\")) {\r\n this.events.dispatchImmediately(\"setKey\", {\r\n type: \"setKey\",\r\n target: this,\r\n key: key,\r\n oldValue: oldValue,\r\n newValue: newValue\r\n });\r\n }\r\n if (this.events.isEnabled(\"removed\")) {\r\n this.events.dispatchImmediately(\"removed\", {\r\n type: \"removed\",\r\n target: this,\r\n oldValue: oldValue\r\n });\r\n }\r\n }\r\n }\r\n else {\r\n throw new Error(\"Key \" + key + \" doesn't exist in dictionary\");\r\n }\r\n };\r\n /**\r\n * Removes value at specific `key` from dictionary.\r\n *\r\n * @param key Key to remove\r\n */\r\n Dictionary.prototype.removeKey = function (key) {\r\n if ($object.hasKey(this._dictionary, key)) {\r\n var oldValue = this._dictionary[key];\r\n delete this._dictionary[key];\r\n if (this.events.isEnabled(\"removeKey\")) {\r\n this.events.dispatchImmediately(\"removeKey\", {\r\n type: \"removeKey\",\r\n target: this,\r\n key: key,\r\n oldValue: oldValue\r\n });\r\n }\r\n if (this.events.isEnabled(\"removed\")) {\r\n this.events.dispatchImmediately(\"removed\", {\r\n type: \"removed\",\r\n target: this,\r\n oldValue: oldValue\r\n });\r\n }\r\n }\r\n };\r\n /**\r\n * [insertKeyIfEmpty description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo description\r\n * @param key [description]\r\n * @param ifEmpty [description]\r\n * @return [description]\r\n */\r\n Dictionary.prototype.insertKeyIfEmpty = function (key, ifEmpty) {\r\n if (!this.hasKey(key)) {\r\n this.insertKey(key, ifEmpty());\r\n }\r\n return this.getKey(key);\r\n };\r\n /**\r\n * Removes all items from the dictionary.\r\n */\r\n Dictionary.prototype.clear = function () {\r\n var _this = this;\r\n // TODO dispatch this after clear\r\n if (this.events.isEnabled(\"removed\")) {\r\n $object.each(this._dictionary, function (key, value) {\r\n _this.events.dispatchImmediately(\"removed\", {\r\n type: \"removed\",\r\n target: _this,\r\n oldValue: value\r\n });\r\n });\r\n }\r\n this._dictionary = {};\r\n if (this.events.isEnabled(\"cleared\")) {\r\n this.events.dispatchImmediately(\"cleared\", {\r\n type: \"cleared\",\r\n target: this\r\n });\r\n }\r\n };\r\n /**\r\n * Copies items from another Dictionary.\r\n *\r\n * @param source A Dictionary to copy items from\r\n */\r\n Dictionary.prototype.copyFrom = function (source) {\r\n var _this = this;\r\n $iter.each(source.iterator(), function (a) {\r\n // TODO fix this type cast\r\n _this.setKey(a[0], a[1]);\r\n });\r\n };\r\n /**\r\n * Returns an interator that can be used to iterate through all items in\r\n * the dictionary.\r\n *\r\n * @return Iterator\r\n */\r\n Dictionary.prototype.iterator = function () {\r\n // @todo fix this type after the Iterator bug is fixed\r\n // https://github.com/Microsoft/TypeScript/issues/16730\r\n return $object.entries(this._dictionary);\r\n };\r\n /**\r\n * Returns an ES6 iterator for the keys/values of the dictionary.\r\n */\r\n Dictionary.prototype[Symbol.iterator] = function () {\r\n var _a, _b, _i, key;\r\n return __generator(this, function (_c) {\r\n switch (_c.label) {\r\n case 0:\r\n _a = [];\r\n for (_b in this._dictionary)\r\n _a.push(_b);\r\n _i = 0;\r\n _c.label = 1;\r\n case 1:\r\n if (!(_i < _a.length)) return [3 /*break*/, 4];\r\n key = _a[_i];\r\n if (!$object.hasKey(this._dictionary, key)) return [3 /*break*/, 3];\r\n return [4 /*yield*/, [key, this._dictionary[key]]];\r\n case 2:\r\n _c.sent();\r\n _c.label = 3;\r\n case 3:\r\n _i++;\r\n return [3 /*break*/, 1];\r\n case 4: return [2 /*return*/];\r\n }\r\n });\r\n };\r\n /**\r\n * Calls `f` for each key/value in the dictionary.\r\n */\r\n Dictionary.prototype.each = function (f) {\r\n $iter.each(this.iterator(), function (_a) {\r\n var _b = __read(_a, 2), key = _b[0], value = _b[1];\r\n return f(key, value);\r\n });\r\n };\r\n /**\r\n * Returns an iterator that can be used to iterate through all items in\r\n * the dictionary, ordered by key.\r\n *\r\n * @ignore Exclude from docs\r\n * @return Iterator\r\n */\r\n Dictionary.prototype.sortedIterator = function () {\r\n return $iter.sort(this.iterator(), function (x, y) { return $string.order(x[0], y[0]); });\r\n };\r\n return Dictionary;\r\n}());\r\nexport { Dictionary };\r\n/**\r\n * A version of a [[Dictionary]] that has a \"template\".\r\n *\r\n * A template is an instance of an object, that can be used to create new\r\n * elements in the list without actually needing to create instances for those.\r\n *\r\n * When new element is created in the list, e.g. by calling its `create()`\r\n * method, an exact copy of the element is created (including properties and\r\n * other attributes), inserted into the list and returned.\r\n */\r\nvar DictionaryTemplate = /** @class */ (function (_super) {\r\n __extends(DictionaryTemplate, _super);\r\n /**\r\n * Constructor\r\n *\r\n * @param t Template object\r\n */\r\n function DictionaryTemplate(t) {\r\n var _this = _super.call(this) || this;\r\n _this.template = t;\r\n return _this;\r\n }\r\n Object.defineProperty(DictionaryTemplate.prototype, \"template\", {\r\n /**\r\n * @return Template object\r\n */\r\n get: function () {\r\n return this._template;\r\n },\r\n /**\r\n * A \"template\" object to copy all properties from when creating new list\r\n * items.\r\n *\r\n * @param v Template object\r\n */\r\n set: function (v) {\r\n v.isTemplate = true;\r\n this._template = v;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Copies all elements from other dictionary.\r\n *\r\n * @param source Source dictionary\r\n */\r\n DictionaryTemplate.prototype.copyFrom = function (source) {\r\n var _this = this;\r\n $iter.each(source.iterator(), function (a) {\r\n // TODO fix this type cast\r\n // TODO why does this need to clone ?\r\n _this.setKey(a[0], a[1].clone());\r\n });\r\n };\r\n /**\r\n * Instantiates a new object of the specified type, adds it to specified\r\n * `key` in the dictionary, and returns it.\r\n *\r\n * @param make Item type to use. Will use the default type for the dictionary if not specified.\r\n * @return Newly created item\r\n */\r\n DictionaryTemplate.prototype.create = function (key) {\r\n var _this = this;\r\n return this.insertKeyIfEmpty(key, function () { return _this.template.clone(); });\r\n };\r\n return DictionaryTemplate;\r\n}(Dictionary));\r\nexport { DictionaryTemplate };\r\n","import { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport * as $array from \"./Array\";\r\nimport * as $type from \"./Type\";\r\n/**\r\n * A base class for disposable objects.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\nvar Disposer = /** @class */ (function () {\r\n /**\r\n * Constructor.\r\n *\r\n * @param dispose Function that disposes object\r\n */\r\n function Disposer(dispose) {\r\n this._disposed = false;\r\n this._dispose = dispose;\r\n }\r\n /**\r\n * Checks if object is disposed.\r\n *\r\n * @return Disposed?\r\n */\r\n Disposer.prototype.isDisposed = function () {\r\n return this._disposed;\r\n };\r\n /**\r\n * Disposes the object.\r\n */\r\n Disposer.prototype.dispose = function () {\r\n if (!this._disposed) {\r\n this._disposed = true;\r\n this._dispose();\r\n }\r\n };\r\n return Disposer;\r\n}());\r\nexport { Disposer };\r\n/**\r\n * A collection of related disposers that can be disposed in one go.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\nvar MultiDisposer = /** @class */ (function (_super) {\r\n __extends(MultiDisposer, _super);\r\n function MultiDisposer(disposers) {\r\n return _super.call(this, function () {\r\n $array.each(disposers, function (x) {\r\n x.dispose();\r\n });\r\n }) || this;\r\n }\r\n return MultiDisposer;\r\n}(Disposer));\r\nexport { MultiDisposer };\r\n/**\r\n * A special kind of Disposer that has attached value set.\r\n *\r\n * If a new value is set using `set()` method, the old disposer value is\r\n * disposed.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\nvar MutableValueDisposer = /** @class */ (function (_super) {\r\n __extends(MutableValueDisposer, _super);\r\n /**\r\n * Constructor.\r\n */\r\n function MutableValueDisposer() {\r\n var _this = _super.call(this, function () {\r\n if ($type.hasValue(_this._disposer)) {\r\n _this._disposer.dispose();\r\n _this._disposer = undefined;\r\n }\r\n }) || this;\r\n return _this;\r\n }\r\n /**\r\n * Returns current value.\r\n *\r\n * @return Value\r\n */\r\n MutableValueDisposer.prototype.get = function () {\r\n return this._value;\r\n };\r\n /**\r\n * Sets value and disposes previous disposer if it was set.\r\n *\r\n * @param value New value\r\n * @param disposer Disposer\r\n */\r\n MutableValueDisposer.prototype.set = function (value, disposer) {\r\n if ($type.hasValue(this._disposer)) {\r\n this._disposer.dispose();\r\n }\r\n this._disposer = disposer;\r\n this._value = value;\r\n };\r\n /**\r\n * Resets the disposer value.\r\n */\r\n MutableValueDisposer.prototype.reset = function () {\r\n this.set(undefined, undefined);\r\n };\r\n return MutableValueDisposer;\r\n}(Disposer));\r\nexport { MutableValueDisposer };\r\n/**\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\nvar CounterDisposer = /** @class */ (function (_super) {\r\n __extends(CounterDisposer, _super);\r\n function CounterDisposer() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n /**\r\n * [_counter description]\r\n *\r\n * @todo Description\r\n */\r\n _this._counter = 0;\r\n return _this;\r\n }\r\n /**\r\n * [increment description]\r\n *\r\n * @todo Description\r\n */\r\n CounterDisposer.prototype.increment = function () {\r\n var _this = this;\r\n // TODO throw an error if it is disposed\r\n ++this._counter;\r\n // TODO make this more efficient\r\n return new Disposer(function () {\r\n --_this._counter;\r\n if (_this._counter === 0) {\r\n _this.dispose();\r\n }\r\n });\r\n };\r\n return CounterDisposer;\r\n}(Disposer));\r\nexport { CounterDisposer };\r\n","/**\r\n * A collection of easing functions\r\n *\r\n * Parts of this collection are taken from D3.js library (https://d3js.org/)\r\n */\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport * as $math from \"../utils/Math\";\r\nimport { registry } from \"../Registry\";\r\n/**\r\n * The functions below are from D3.js library (https://d3js.org/)\r\n *\r\n * ----------------------------------------------------------------------------\r\n * Copyright 2017 Mike Bostock\r\n *\r\n * Redistribution and use in source and binary forms, with or without\r\n * modification, are permitted provided that the following conditions are met:\r\n *\r\n * 1. Redistributions of source code must retain the above copyright notice,\r\n * this list of conditions and the following disclaimer.\r\n *\r\n * 2. Redistributions in binary form must reproduce the above copyright notice,\r\n * this list of conditions and the following disclaimer in the documentation\r\n * and/or other materials provided with the distribution.\r\n *\r\n * 3. Neither the name of the copyright holder nor the names of its\r\n * contributors may be used to endorse or promote products derived from this\r\n * software without specific prior written permission.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\r\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\r\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\r\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\r\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n * ----------------------------------------------------------------------------\r\n * @hidden\r\n */\r\n/**\r\n * ============================================================================\r\n * LINEAR FUNCTIONS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Easing function: \"linear\".\r\n */\r\nexport function linear(t) {\r\n return +t;\r\n}\r\nregistry.registeredClasses[\"ease.linear\"] = linear;\r\n/**\r\n * Easing function: \"quadIn\".\r\n */\r\nexport function quadIn(t) {\r\n return t * t;\r\n}\r\nregistry.registeredClasses[\"ease.quadIn\"] = quadIn;\r\n/**\r\n * Easing function: \"quadOut\".\r\n */\r\nexport function quadOut(t) {\r\n return t * (2 - t);\r\n}\r\nregistry.registeredClasses[\"ease.quadOut\"] = quadOut;\r\n/**\r\n * Easing function: \"quadInOut\".\r\n */\r\nexport function quadInOut(t) {\r\n t *= 2;\r\n return (t <= 1 ? t * t : --t * (2 - t) + 1) / 2;\r\n}\r\nregistry.registeredClasses[\"ease.quadInOut\"] = quadInOut;\r\n/**\r\n * Easing function: \"polyIn\".\r\n */\r\nexport function polyIn(t, e) {\r\n return Math.pow(t, e);\r\n}\r\nregistry.registeredClasses[\"ease.polyIn\"] = polyIn;\r\n/**\r\n * Easing function: \"polyOut\".\r\n */\r\nexport function polyOut(t, e) {\r\n return 1 - Math.pow(1 - t, e);\r\n}\r\nregistry.registeredClasses[\"ease.polyOut\"] = polyOut;\r\n/**\r\n * Easing function: \"polyInOut\".\r\n */\r\nexport function polyInOut(t, e) {\r\n t *= 2;\r\n return (t <= 1 ? Math.pow(t, e) : 2 - Math.pow(2 - t, e)) / 2;\r\n}\r\nregistry.registeredClasses[\"ease.polyInOut\"] = polyInOut;\r\n/**\r\n * Easing function: \"polyIn3\".\r\n */\r\nexport function polyIn3(t) {\r\n return polyIn(t, 3);\r\n}\r\nregistry.registeredClasses[\"ease.polyIn3\"] = polyIn3;\r\n/**\r\n * Easing function: \"polyOut3\".\r\n */\r\nexport function polyOut3(t) {\r\n return polyOut(t, 3);\r\n}\r\nregistry.registeredClasses[\"ease.polyOut3\"] = polyOut3;\r\n/**\r\n * Easing function: \"polyInOut3\".\r\n */\r\nexport function polyInOut3(t) {\r\n return polyInOut(t, 3);\r\n}\r\nregistry.registeredClasses[\"ease.polyInOut3\"] = polyInOut3;\r\n/**\r\n * ============================================================================\r\n * EXPONENTIAL FUNCTIONS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Easing function: \"expIn\".\r\n */\r\nexport function expIn(t) {\r\n return Math.pow(2, 10 * t - 10);\r\n}\r\nregistry.registeredClasses[\"ease.expIn\"] = expIn;\r\n/**\r\n * Easing function: \"expOut\".\r\n */\r\nexport function expOut(t) {\r\n return 1 - Math.pow(2, -10 * t);\r\n}\r\nregistry.registeredClasses[\"ease.expOut\"] = expOut;\r\n/**\r\n * Easing function: \"expInOut\".\r\n */\r\nexport function expInOut(t) {\r\n t *= 2;\r\n return (t <= 1 ? Math.pow(2, 10 * t - 10) : 2 - Math.pow(2, 10 - 10 * t)) / 2;\r\n}\r\nregistry.registeredClasses[\"ease.expInOut\"] = expInOut;\r\n/**\r\n * ============================================================================\r\n * SINE FUNCTIONS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Easing function: \"sinIn\".\r\n */\r\nexport function sinIn(t) {\r\n return 1 - Math.cos(t * $math.HALFPI);\r\n}\r\nregistry.registeredClasses[\"ease.sinIn\"] = sinIn;\r\n/**\r\n * Easing function: \"sinOut\".\r\n */\r\nexport function sinOut(t) {\r\n return Math.sin(t * $math.HALFPI);\r\n}\r\nregistry.registeredClasses[\"ease.sinOut\"] = sinOut;\r\n/**\r\n * Easing function: \"sinInOut\".\r\n */\r\nexport function sinInOut(t) {\r\n return (1 - Math.cos($math.PI * t)) / 2;\r\n}\r\nregistry.registeredClasses[\"ease.sinInOut\"] = sinInOut;\r\n/**\r\n * ============================================================================\r\n * CUBIC FUNCTIONS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Easing function: \"cubicIn\".\r\n */\r\nexport function cubicIn(t) {\r\n return t * t * t;\r\n}\r\nregistry.registeredClasses[\"ease.cubicIn\"] = cubicIn;\r\n/**\r\n * Easing function: \"cubicOut\".\r\n */\r\nexport function cubicOut(t) {\r\n return --t * t * t + 1;\r\n}\r\nregistry.registeredClasses[\"ease.cubicOut\"] = cubicOut;\r\n/**\r\n * Easing function: \"cubicInOut\".\r\n */\r\nexport function cubicInOut(t) {\r\n t *= 2;\r\n return (t <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2;\r\n}\r\nregistry.registeredClasses[\"ease.cubicInOut\"] = cubicInOut;\r\n/**\r\n * ============================================================================\r\n * CIRCLE FUNCTIONS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Easing function: \"circleIn\".\r\n */\r\nexport function circleIn(t) {\r\n return 1 - Math.sqrt(1 - t * t);\r\n}\r\nregistry.registeredClasses[\"ease.circleIn\"] = circleIn;\r\n/**\r\n * Easing function: \"circleOut\".\r\n */\r\nexport function circleOut(t) {\r\n return Math.sqrt(1 - --t * t);\r\n}\r\nregistry.registeredClasses[\"ease.circleOut\"] = circleOut;\r\n/**\r\n * Easing function: \"circleInOut\".\r\n */\r\nexport function circleInOut(t) {\r\n t *= 2;\r\n return (t <= 1 ? 1 - Math.sqrt(1 - t * t) : Math.sqrt(1 - (t -= 2) * t) + 1) / 2;\r\n}\r\nregistry.registeredClasses[\"ease.circleInOut\"] = circleInOut;\r\n/**\r\n * ============================================================================\r\n * BOUNCE FUNCTIONS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nvar b1 = 4 / 11, b2 = 6 / 11, b3 = 8 / 11, b4 = 3 / 4, b5 = 9 / 11, b6 = 10 / 11, b7 = 15 / 16, b8 = 21 / 22, b9 = 63 / 64, b0 = 1 / b1 / b1;\r\n/**\r\n * Easing function: \"bounceIn\".\r\n */\r\nexport function bounceIn(t) {\r\n return 1 - bounceOut(1 - t);\r\n}\r\nregistry.registeredClasses[\"ease.bounceIn\"] = bounceIn;\r\n/**\r\n * Easing function: \"bounceOut\".\r\n */\r\nexport function bounceOut(t) {\r\n t = +t;\r\n return t < b1 ? b0 * t * t : t < b3 ? b0 * (t -= b2) * t + b4 : t < b6 ? b0 * (t -= b5) * t + b7 : b0 * (t -= b8) * t + b9;\r\n}\r\nregistry.registeredClasses[\"ease.bounceOut\"] = bounceOut;\r\n/**\r\n * Easing function: \"bounceInOut\".\r\n */\r\nexport function bounceInOut(t) {\r\n t *= 2;\r\n return (t <= 1 ? 1 - bounceOut(1 - t) : bounceOut(t - 1) + 1) / 2;\r\n}\r\nregistry.registeredClasses[\"ease.bounceInOut\"] = bounceInOut;\r\n/**\r\n * ============================================================================\r\n * ELASTIC FUNCTIONS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nvar tau = 2 * Math.PI;\r\nvar amplitude = 1;\r\nvar period = 0.3 / tau;\r\nvar s = Math.asin(1 / amplitude) * period;\r\n/**\r\n * Easing function: \"elasticIn\".\r\n *\r\n * @function elasticIn\r\n * @param a Amplitude\r\n * @param p period\r\n */\r\nexport function elasticIn(t) {\r\n return amplitude * Math.pow(2, 10 * --t) * Math.sin((s - t) / period);\r\n}\r\nregistry.registeredClasses[\"ease.elasticIn\"] = elasticIn;\r\n/**\r\n * Easing function: \"elasticOut\".\r\n *\r\n * @function elasticOut\r\n * @param a Amplitude\r\n * @param p period\r\n */\r\nexport function elasticOut(t) {\r\n return 1 - amplitude * Math.pow(2, -10 * (t = +t)) * Math.sin((t + s) / period);\r\n}\r\nregistry.registeredClasses[\"ease.elasticOut\"] = elasticOut;\r\n/**\r\n * Easing function: \"elasticInOut\".\r\n *\r\n * @function elasticInOut\r\n * @param a Amplitude\r\n * @param p period\r\n */\r\nexport function elasticInOut(t) {\r\n t = t * 2 - 1;\r\n return (t < 0\r\n ? amplitude * Math.pow(2, 10 * t) * Math.sin((s - t) / period)\r\n : 2 - amplitude * Math.pow(2, -10 * t) * Math.sin((s + t) / period)) / 2;\r\n}\r\nregistry.registeredClasses[\"ease.elasticInOut\"] = elasticInOut;\r\n","/**\r\n * Event Dispatcher module is used for registering listeners and dispatching\r\n * events across amCharts system.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Disposer } from \"./Disposer\";\r\nimport * as $array from \"./Array\";\r\nimport * as $async from \"./AsyncPending\";\r\nimport * as $type from \"./Type\";\r\n/*export interface IEventDispatcher<T> {\r\n isDisposed(): boolean;\r\n dispose(): void;\r\n hasListeners(): boolean;\r\n enable(): void;\r\n disable(): void;\r\n enableType<Key extends keyof T>(type: Key): void;\r\n disableType<Key extends keyof T>(type: Key, amount?: number): void;\r\n isEnabled<Key extends keyof T>(type: Key): boolean;\r\n has<C, Key extends keyof T>(type: Key, callback?: (this: C, event: T[Key]) => void, context?: C): boolean;\r\n dispatchImmediately<Key extends keyof T>(type: Key, event: T[Key]): void;\r\n dispatch<Key extends keyof T>(type: Key, event: T[Key]): void;\r\n onAll<C, Key extends keyof T>(callback: (this: C, type: Key, event: T[Key]) => void, context?: C): IDisposer;\r\n on<C, Key extends keyof T>(type: Key, callback: (this: C, event: T[Key]) => void, context?: C): IDisposer;\r\n once<C, Key extends keyof T>(type: Key, callback: (this: C, event: T[Key]) => void, context?: C): IDisposer;\r\n off<C, Key extends keyof T>(type: Key, callback: (this: C, event: T[Key]) => void, context?: C): void;\r\n off<C, Key extends keyof T>(type: Key, callback: (this: C, event: T[Key]) => void, context?: C): void;\r\n copyFrom(source: this): void;\r\n}*/\r\n/**\r\n * Universal Event Dispatcher.\r\n *\r\n * @important\r\n */\r\nvar EventDispatcher = /** @class */ (function () {\r\n /**\r\n * Constructor\r\n */\r\n function EventDispatcher() {\r\n this._listeners = [];\r\n this._killed = [];\r\n this._disabled = {};\r\n this._iterating = 0;\r\n this._enabled = true;\r\n this._disposed = false;\r\n }\r\n /**\r\n * Returns if this object has been already disposed.\r\n *\r\n * @return Disposed?\r\n */\r\n EventDispatcher.prototype.isDisposed = function () {\r\n return this._disposed;\r\n };\r\n /**\r\n * Dispose (destroy) this object.\r\n */\r\n EventDispatcher.prototype.dispose = function () {\r\n if (!this._disposed) {\r\n this._disposed = true;\r\n var a = this._listeners;\r\n this._iterating = 1;\r\n this._listeners = null;\r\n this._disabled = null;\r\n try {\r\n $array.each(a, function (x) {\r\n x.disposer.dispose();\r\n });\r\n }\r\n finally {\r\n this._killed = null;\r\n this._iterating = null;\r\n }\r\n }\r\n };\r\n /**\r\n * Checks if this particular event dispatcher has any listeners set.\r\n *\r\n * @return Has listeners?\r\n */\r\n EventDispatcher.prototype.hasListeners = function () {\r\n return this._listeners.length !== 0;\r\n };\r\n /**\r\n * Checks if this particular event dispatcher has any particular listeners set.\r\n *\r\n * @return Has particular event listeners?\r\n */\r\n EventDispatcher.prototype.hasListenersByType = function (type) {\r\n return $array.any(this._listeners, function (x) { return (x.type === null || x.type === type) && !x.killed; });\r\n };\r\n /**\r\n * Enable dispatching of events if they were previously disabled by\r\n * `disable()`.\r\n */\r\n EventDispatcher.prototype.enable = function () {\r\n this._enabled = true;\r\n };\r\n /**\r\n * Disable dispatching of events until re-enabled by `enable()`.\r\n */\r\n EventDispatcher.prototype.disable = function () {\r\n this._enabled = false;\r\n };\r\n /**\r\n * Enable dispatching particular event, if it was disabled before by\r\n * `disableType()`.\r\n *\r\n * @param type Event type\r\n */\r\n EventDispatcher.prototype.enableType = function (type) {\r\n delete this._disabled[type];\r\n };\r\n /**\r\n * Disable dispatching of events for a certain event type.\r\n *\r\n * Optionally, can set how many dispatches to skip before automatically\r\n * re-enabling the dispatching.\r\n *\r\n * @param type Event type\r\n * @param amount Number of event dispatches to skip\r\n */\r\n EventDispatcher.prototype.disableType = function (type, amount) {\r\n if (amount === void 0) { amount = Infinity; }\r\n this._disabled[type] = amount;\r\n };\r\n /**\r\n * Removes listener from dispatcher.\r\n *\r\n * Will throw an exception if such listener does not exists.\r\n *\r\n * @param listener Listener to remove\r\n */\r\n EventDispatcher.prototype._removeListener = function (listener) {\r\n if (this._iterating === 0) {\r\n var index = this._listeners.indexOf(listener);\r\n if (index === -1) {\r\n throw new Error(\"Invalid state: could not remove listener\");\r\n }\r\n this._listeners.splice(index, 1);\r\n }\r\n else {\r\n this._killed.push(listener);\r\n }\r\n };\r\n /**\r\n * Removes existing listener by certain parameters.\r\n *\r\n * @param once Listener's once setting\r\n * @param type Listener's type\r\n * @param callback Callback function\r\n * @param context Callback context\r\n */\r\n EventDispatcher.prototype._removeExistingListener = function (once, type, callback, context) {\r\n if (this._disposed) {\r\n throw new Error(\"EventDispatcher is disposed\");\r\n }\r\n this._eachListener(function (info) {\r\n if (info.once === once && // TODO is this correct ?\r\n info.type === type &&\r\n (callback == null || info.callback === callback) &&\r\n info.context === context) {\r\n info.disposer.dispose();\r\n }\r\n });\r\n };\r\n /**\r\n * Checks if dispatching for particular event type is enabled.\r\n *\r\n * @param type Event type\r\n * @return Enabled?\r\n */\r\n EventDispatcher.prototype.isEnabled = function (type) {\r\n if (this._disposed) {\r\n throw new Error(\"EventDispatcher is disposed\");\r\n }\r\n // TODO is this check correct ?\r\n return this._enabled && this._listeners.length > 0 && this.hasListenersByType(type) && this._disabled[type] == null;\r\n };\r\n /**\r\n * Checks if there's already a listener with specific parameters.\r\n *\r\n * @param type Listener's type\r\n * @param callback Callback function\r\n * @param context Callback context\r\n * @return Has listener?\r\n */\r\n EventDispatcher.prototype.has = function (type, callback, context) {\r\n var index = $array.findIndex(this._listeners, function (info) {\r\n return info.once !== true && // Ignoring \"once\" listeners\r\n info.type === type &&\r\n (callback == null || info.callback === callback) &&\r\n info.context === context;\r\n });\r\n return index !== -1;\r\n };\r\n /**\r\n * Checks whether event of the particular type should be dispatched.\r\n *\r\n * @param type Event type\r\n * @return Dispatch?\r\n */\r\n EventDispatcher.prototype._shouldDispatch = function (type) {\r\n if (this._disposed) {\r\n throw new Error(\"EventDispatcher is disposed\");\r\n }\r\n var count = this._disabled[type];\r\n if (!$type.isNumber(count)) {\r\n return this._enabled;\r\n }\r\n else {\r\n if (count <= 1) {\r\n delete this._disabled[type];\r\n }\r\n else {\r\n --this._disabled[type];\r\n }\r\n return false;\r\n }\r\n };\r\n /**\r\n * [_eachListener description]\r\n *\r\n * All of this extra code is needed when a listener is removed while iterating\r\n *\r\n * @todo Description\r\n * @param fn [description]\r\n */\r\n EventDispatcher.prototype._eachListener = function (fn) {\r\n var _this = this;\r\n ++this._iterating;\r\n try {\r\n $array.each(this._listeners, fn);\r\n }\r\n finally {\r\n --this._iterating;\r\n // TODO should this be inside or outside the finally ?\r\n if (this._iterating === 0 && this._killed.length !== 0) {\r\n // Remove killed listeners\r\n $array.each(this._killed, function (killed) {\r\n _this._removeListener(killed);\r\n });\r\n this._killed.length = 0;\r\n }\r\n }\r\n };\r\n /**\r\n * Dispatches an event immediately without waiting for next cycle.\r\n *\r\n * @param type Event type\r\n * @param event Event object\r\n * @todo automatically add in type and target properties if they are missing\r\n */\r\n EventDispatcher.prototype.dispatchImmediately = function (type, event) {\r\n if (this._shouldDispatch(type)) {\r\n // TODO check if it's faster to use an object of listeners rather than a single big array\r\n // TODO if the function throws, maybe it should keep going ?\r\n this._eachListener(function (listener) {\r\n if (!listener.killed && (listener.type === null || listener.type === type)) {\r\n listener.dispatch(type, event);\r\n }\r\n });\r\n }\r\n };\r\n /**\r\n * Shelves the event to be dispatched within next update cycle.\r\n *\r\n * @param type Event type\r\n * @param event Event object\r\n * @todo automatically add in type and target properties if they are missing\r\n */\r\n EventDispatcher.prototype.dispatch = function (type, event) {\r\n if (this._shouldDispatch(type)) {\r\n this._eachListener(function (listener) {\r\n // TODO check if it's faster to use an object of listeners rather than a single big array\r\n if (!listener.killed && (listener.type === null || listener.type === type)) {\r\n // TODO if the function throws, maybe it should keep going ?\r\n // TODO dispatch during the update cycle, rather than using whenIdle\r\n $async.whenIdle(function () {\r\n if (!listener.killed) {\r\n listener.dispatch(type, event);\r\n }\r\n });\r\n }\r\n });\r\n }\r\n };\r\n /**\r\n * Creates, catalogs and returns an [[EventListener]].\r\n *\r\n * Event listener can be disposed.\r\n *\r\n * @param once Listener's once setting\r\n * @param type Listener's type\r\n * @param callback Callback function\r\n * @param context Callback context\r\n * @param shouldClone Whether the listener should be copied when the EventDispatcher is copied\r\n * @param dispatch\r\n * @returns An event listener\r\n */\r\n EventDispatcher.prototype._on = function (once, type, callback, context, shouldClone, dispatch) {\r\n var _this = this;\r\n if (this._disposed) {\r\n throw new Error(\"EventDispatcher is disposed\");\r\n }\r\n this._removeExistingListener(once, type, callback, context);\r\n var info = {\r\n type: type,\r\n callback: callback,\r\n context: context,\r\n shouldClone: shouldClone,\r\n dispatch: dispatch,\r\n killed: false,\r\n once: once,\r\n disposer: new Disposer(function () {\r\n info.killed = true;\r\n _this._removeListener(info);\r\n })\r\n };\r\n this._listeners.push(info);\r\n return info;\r\n };\r\n /**\r\n * Creates an event listener to be invoked on **any** event.\r\n *\r\n * @param callback Callback function\r\n * @param context Callback context\r\n * @param shouldClone Whether the listener should be copied when the EventDispatcher is copied\r\n * @returns A disposable event listener\r\n * @todo what if `listen` is called on the same function twice ?\r\n */\r\n EventDispatcher.prototype.onAll = function (callback, context, shouldClone) {\r\n if (shouldClone === void 0) { shouldClone = true; }\r\n return this._on(false, null, callback, context, shouldClone, function (type, event) { return callback.call(context, type, event); }).disposer;\r\n };\r\n /**\r\n * Creates an event listener to be invoked on a specific event type.\r\n *\r\n * ```TypeScript\r\n * series.events.on(\"hidden\", (ev) => {\r\n * console.log(\"Series hidden: \" + ev.target.name);\r\n * }, this);\r\n * ```\r\n * ```JavaScript\r\n * series.events.on(\"hidden\", function(ev) {\r\n * console.log(\"Series hidden: \" + ev.target.name);\r\n * }, this);\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"series\": [{\r\n * // ...\r\n * \"events\": {\r\n * \t\"hidden\": function(ev) {\r\n * \t console.log(\"Series hidden: \" + ev.target.name);\r\n * \t}\r\n * }\r\n * }]\r\n * }\r\n * ```\r\n *\r\n * The above will invoke our custom event handler whenever series we put\r\n * event on is hidden.\r\n *\r\n * @param type Listener's type\r\n * @param callback Callback function\r\n * @param context Callback context\r\n * @param shouldClone Whether the listener should be copied when the EventDispatcher is copied\r\n * @returns A disposable event listener\r\n * @todo what if `listen` is called on the same function twice ?\r\n */\r\n EventDispatcher.prototype.on = function (type, callback, context, shouldClone) {\r\n if (shouldClone === void 0) { shouldClone = true; }\r\n return this._on(false, type, callback, context, shouldClone, function (type, event) { return callback.call(context, event); }).disposer;\r\n };\r\n /**\r\n * Creates an event listener to be invoked on a specific event type once.\r\n *\r\n * Once the event listener is invoked, it is automatically disposed.\r\n *\r\n * ```TypeScript\r\n * series.events.on(\"hidden\", (ev) => {\r\n * console.log(\"Series hidden: \" + ev.target.name);\r\n * }, this);\r\n * ```\r\n * ```JavaScript\r\n * series.events.on(\"hidden\", function(ev) {\r\n * console.log(\"Series hidden: \" + ev.target.name);\r\n * }, this);\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"series\": [{\r\n * // ...\r\n * \"events\": {\r\n * \t\"hidden\": function(ev) {\r\n * \t console.log(\"Series hidden: \" + ev.target.name);\r\n * \t}\r\n * }\r\n * }]\r\n * }\r\n * ```\r\n *\r\n * The above will invoke our custom event handler the first time series we\r\n * put event on is hidden.\r\n *\r\n * @param type Listener's type\r\n * @param callback Callback function\r\n * @param context Callback context\r\n * @param shouldClone Whether the listener should be copied when the EventDispatcher is copied\r\n * @returns A disposable event listener\r\n * @todo what if `listen` is called on the same function twice ?\r\n */\r\n EventDispatcher.prototype.once = function (type, callback, context, shouldClone) {\r\n if (shouldClone === void 0) { shouldClone = true; }\r\n var x = this._on(true, type, callback, context, shouldClone, function (type, event) {\r\n x.disposer.dispose();\r\n callback.call(context, event);\r\n });\r\n // TODO maybe this should return a different Disposer ?\r\n return x.disposer;\r\n };\r\n /**\r\n * Removes the event listener with specific parameters.\r\n *\r\n * @param type Listener's type\r\n * @param callback Callback function\r\n * @param context Callback context\r\n */\r\n EventDispatcher.prototype.off = function (type, callback, context) {\r\n this._removeExistingListener(false, type, callback, context);\r\n };\r\n /**\r\n * Copies all dispatcher parameters, including listeners, from another event\r\n * dispatcher.\r\n *\r\n * @param source Source event dispatcher\r\n */\r\n EventDispatcher.prototype.copyFrom = function (source) {\r\n var _this = this;\r\n if (this._disposed) {\r\n throw new Error(\"EventDispatcher is disposed\");\r\n }\r\n if (source === this) {\r\n throw new Error(\"Cannot copyFrom the same TargetedEventDispatcher\");\r\n }\r\n $array.each(source._listeners, function (x) {\r\n // TODO is this correct ?\r\n if (!x.killed && x.shouldClone) {\r\n if (x.type === null) {\r\n _this.onAll(x.callback, x.context);\r\n }\r\n else if (x.once) {\r\n _this.once(x.type, x.callback, x.context);\r\n }\r\n else {\r\n _this.on(x.type, x.callback, x.context);\r\n }\r\n }\r\n });\r\n };\r\n return EventDispatcher;\r\n}());\r\nexport { EventDispatcher };\r\n/**\r\n * A version of the [[EventDispatcher]] that dispatches events for a specific\r\n * target object.\r\n *\r\n * @important\r\n */\r\nvar TargetedEventDispatcher = /** @class */ (function (_super) {\r\n __extends(TargetedEventDispatcher, _super);\r\n /**\r\n * Constructor\r\n *\r\n * @param target Event dispatcher target\r\n */\r\n function TargetedEventDispatcher(target) {\r\n var _this = _super.call(this) || this;\r\n _this.target = target;\r\n return _this;\r\n }\r\n /**\r\n * Copies all dispatcher parameters, including listeners, from another event\r\n * dispatcher.\r\n *\r\n * @param source Source event dispatcher\r\n */\r\n TargetedEventDispatcher.prototype.copyFrom = function (source) {\r\n var _this = this;\r\n if (this._disposed) {\r\n throw new Error(\"EventDispatcher is disposed\");\r\n }\r\n if (source === this) {\r\n throw new Error(\"Cannot copyFrom the same TargetedEventDispatcher\");\r\n }\r\n $array.each(source._listeners, function (x) {\r\n // TODO very hacky\r\n if (x.context === source.target) {\r\n return;\r\n }\r\n // TODO is this correct ?\r\n if (!x.killed && x.shouldClone) {\r\n if (x.type === null) {\r\n _this.onAll(x.callback, x.context);\r\n }\r\n else if (x.once) {\r\n _this.once(x.type, x.callback, x.context);\r\n }\r\n else {\r\n _this.on(x.type, x.callback, x.context);\r\n }\r\n }\r\n });\r\n };\r\n return TargetedEventDispatcher;\r\n}(EventDispatcher));\r\nexport { TargetedEventDispatcher };\r\n","import { __read, __spread } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { system } from \"../System\";\r\nimport { registry } from \"../Registry\";\r\nimport { Container } from \"../Container\";\r\nimport { Component } from \"../Component\";\r\nimport { Paper } from \"../rendering/Paper\";\r\nimport { SVGContainer, svgContainers } from \"../rendering/SVGContainer\";\r\nimport { FocusFilter } from \"../rendering/filters/FocusFilter\";\r\nimport { Preloader } from \"../elements/Preloader\";\r\nimport { AmChartsLogo } from \"../elements/AmChartsLogo\";\r\nimport { Tooltip } from \"../elements/Tooltip\";\r\nimport { Disposer, MultiDisposer } from \"../utils/Disposer\";\r\nimport { percent } from \"./Percent\";\r\nimport { options } from \"../Options\";\r\nimport * as $array from \"./Array\";\r\nimport * as $type from \"./Type\";\r\nimport * as $dom from \"./DOM\";\r\nimport * as $utils from \"./Utils\";\r\nimport * as $log from \"./Log\";\r\n/**\r\n * ============================================================================\r\n * INSTANTIATION FUNCTIONS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Creates all HTML and SVG containers needed for the chart instance, as well\r\n * as the new [[Sprite]] (as specified in `classType` parameter).\r\n *\r\n * @param htmlElement A container to creat elements in\r\n * @param classType A class definition of the new element to create\r\n * @return Newly-created Sprite object\r\n */\r\nfunction createChild(htmlElement, classType) {\r\n var htmlContainer = $dom.getElement(htmlElement);\r\n // If there's no container available yet, we create a fake one\r\n var tmpContainer = false;\r\n if (!htmlContainer) {\r\n htmlContainer = document.createElement(\"div\");\r\n htmlContainer.style.width = \"200px\";\r\n htmlContainer.style.height = \"200px\";\r\n htmlContainer.style.visibility = \"hidden\";\r\n htmlContainer.style.position = \"absolute\";\r\n document.body.appendChild(htmlContainer);\r\n tmpContainer = true;\r\n }\r\n if (htmlContainer) {\r\n htmlContainer.innerHTML = \"\";\r\n //htmlContainer.style.overflow = \"hidden\";\r\n var svgDiv_1 = new SVGContainer(htmlContainer);\r\n var paper = new Paper(svgDiv_1.SVGContainer, \"svg-\" + (svgContainers.length - 1));\r\n // the approach with masks is chosen because overflow:visible is set on SVG element in order tooltips could go outside\r\n // svg area - this is often needed when working with small charts.\r\n // main container which holds content container and tooltips container\r\n var container_1 = new Container();\r\n container_1.htmlContainer = htmlContainer;\r\n container_1.svgContainer = svgDiv_1;\r\n container_1.width = percent(100);\r\n container_1.height = percent(100);\r\n container_1.background.fillOpacity = 0;\r\n container_1.paper = paper;\r\n paper.append(container_1.group);\r\n // Set up moving to proper element container if it's not yet ready at call time\r\n if (tmpContainer) {\r\n $dom.ready(function () {\r\n container_1.moveHtmlContainer(htmlElement);\r\n });\r\n }\r\n // this is set from parent container, but this one doesn't have, so do it manually.\r\n container_1.relativeWidth = 1;\r\n container_1.relativeHeight = 1;\r\n svgDiv_1.container = container_1;\r\n // creating classType instance\r\n var sprite_1 = container_1.createChild(classType);\r\n sprite_1.topParent = container_1;\r\n var uid = sprite_1.uid;\r\n registry.invalidSprites[uid] = [];\r\n registry.invalidDatas[uid] = [];\r\n registry.invalidPositions[uid] = [];\r\n registry.invalidLayouts[uid] = [];\r\n container_1.baseId = uid;\r\n sprite_1.isBaseSprite = true;\r\n sprite_1.focusFilter = new FocusFilter();\r\n registry.baseSprites.push(sprite_1);\r\n registry.baseSpritesByUid[uid] = sprite_1;\r\n sprite_1.maskRectangle = { x: 0, y: 0, width: Math.max(svgDiv_1.width || 0, 0), height: Math.max(svgDiv_1.height || 0, 0) };\r\n // this solves issues with display:none, as all children are measured as 0x0\r\n container_1.events.on(\"maxsizechanged\", function (event) {\r\n if (event.previousWidth == 0 || event.previousHeight == 0) {\r\n container_1.deepInvalidate();\r\n }\r\n if (sprite_1.maskRectangle) {\r\n sprite_1.maskRectangle = { x: 0, y: 0, width: Math.max(svgDiv_1.width || 0, 0), height: Math.max(svgDiv_1.height || 0, 0) };\r\n }\r\n });\r\n var loopTimer_1 = null;\r\n // Checks to see whether the chart was properly disposed or not\r\n var loop_1 = function () {\r\n if (!sprite_1.isDisposed()) {\r\n if ($dom.getRoot(sprite_1.dom) == null) {\r\n if (options.autoDispose) {\r\n container_1.htmlContainer = undefined;\r\n svgDiv_1.htmlElement = undefined;\r\n sprite_1.dispose();\r\n }\r\n else {\r\n $log.warn(\"Chart was not disposed\", sprite_1.uid);\r\n }\r\n loopTimer_1 = null;\r\n }\r\n else {\r\n loopTimer_1 = window.setTimeout(loop_1, 1000);\r\n }\r\n }\r\n else {\r\n loopTimer_1 = null;\r\n }\r\n };\r\n loop_1();\r\n sprite_1.addDisposer(new Disposer(function () {\r\n if (loopTimer_1 !== null) {\r\n clearTimeout(loopTimer_1);\r\n }\r\n $array.remove(registry.baseSprites, sprite_1);\r\n registry.baseSpritesByUid[sprite_1.uid] = undefined;\r\n }));\r\n // TODO figure out a better way of doing this\r\n sprite_1.addDisposer(container_1);\r\n // tooltip container\r\n var tooltipContainer_1 = container_1.createChild(Container);\r\n tooltipContainer_1.topParent = container_1;\r\n tooltipContainer_1.width = percent(100);\r\n tooltipContainer_1.height = percent(100);\r\n tooltipContainer_1.isMeasured = false;\r\n container_1.tooltipContainer = tooltipContainer_1;\r\n sprite_1.tooltip = new Tooltip();\r\n sprite_1.tooltip.hide(0);\r\n sprite_1.tooltip.setBounds({ x: 0, y: 0, width: tooltipContainer_1.maxWidth, height: tooltipContainer_1.maxHeight });\r\n tooltipContainer_1.events.on(\"maxsizechanged\", function () {\r\n $type.getValue(sprite_1.tooltip).setBounds({ x: 0, y: 0, width: tooltipContainer_1.maxWidth, height: tooltipContainer_1.maxHeight });\r\n }, undefined, false);\r\n //@todo: maybe we don't need to create one by default but only on request?\r\n var preloader_1 = new Preloader();\r\n preloader_1.events.on(\"inited\", function () {\r\n preloader_1.__disabled = true;\r\n }, undefined, false);\r\n container_1.preloader = preloader_1;\r\n //if (!options.commercialLicense) {\r\n if (sprite_1 instanceof Container && !sprite_1.hasLicense()) {\r\n var logo_1 = tooltipContainer_1.createChild(AmChartsLogo);\r\n tooltipContainer_1.events.on(\"maxsizechanged\", function (ev) {\r\n if ((tooltipContainer_1.maxWidth <= 100) || (tooltipContainer_1.maxHeight <= 50)) {\r\n logo_1.hide();\r\n }\r\n else if (logo_1.isHidden || logo_1.isHiding) {\r\n logo_1.show();\r\n }\r\n }, undefined, false);\r\n sprite_1.logo = logo_1;\r\n logo_1.align = \"left\";\r\n logo_1.valign = \"bottom\";\r\n }\r\n $utils.used(sprite_1.numberFormatter); // need to create one.\r\n // Set this as an autonomouse instance\r\n // Controls like Preloader, Export will use this.\r\n container_1.isStandaloneInstance = true;\r\n if (options.onlyShowOnViewport) {\r\n if (!$dom.isElementInViewport(htmlContainer, options.viewportTarget)) {\r\n sprite_1.__disabled = true;\r\n sprite_1.tooltipContainer.__disabled = true;\r\n var disposers = [\r\n $dom.addEventListener(window, \"DOMContentLoaded\", function () { viewPortHandler(sprite_1); }),\r\n $dom.addEventListener(window, \"load\", function () { viewPortHandler(sprite_1); }),\r\n $dom.addEventListener(window, \"resize\", function () { viewPortHandler(sprite_1); }),\r\n $dom.addEventListener(window, \"scroll\", function () { viewPortHandler(sprite_1); })\r\n ];\r\n if (options.viewportTarget) {\r\n var targets = $type.isArray(options.viewportTarget) ? options.viewportTarget : options.viewportTarget ? [options.viewportTarget] : [];\r\n for (var i = 0; i < targets.length; i++) {\r\n var target = targets[i];\r\n disposers.push($dom.addEventListener(target, \"resize\", function () { viewPortHandler(sprite_1); }));\r\n disposers.push($dom.addEventListener(target, \"scroll\", function () { viewPortHandler(sprite_1); }));\r\n }\r\n }\r\n var disposer = new MultiDisposer(disposers);\r\n sprite_1.addDisposer(disposer);\r\n sprite_1.vpDisposer = disposer;\r\n }\r\n else if (options.queue) {\r\n addToQueue(sprite_1);\r\n }\r\n }\r\n else if (options.queue) {\r\n addToQueue(sprite_1);\r\n }\r\n return sprite_1;\r\n }\r\n else {\r\n system.log(\"html container not found\");\r\n throw new Error(\"html container not found\");\r\n }\r\n}\r\n/**\r\n * Disposes all of the currently active charts.\r\n */\r\nexport function disposeAllCharts() {\r\n while (registry.baseSprites.length !== 0) {\r\n registry.baseSprites.pop().dispose();\r\n }\r\n}\r\nexport function addToQueue(sprite) {\r\n if (registry.queue.indexOf(sprite) == -1) {\r\n sprite.__disabled = true;\r\n sprite.tooltipContainer.__disabled = true;\r\n sprite.events.disableType(\"appeared\");\r\n if (registry.queue.length == 0) {\r\n registry.events.once(\"exitframe\", function () {\r\n queueHandler(sprite);\r\n });\r\n system.requestFrame();\r\n }\r\n sprite.addDisposer(new Disposer(function () {\r\n removeFromQueue(sprite);\r\n }));\r\n registry.queue.push(sprite);\r\n }\r\n}\r\nexport function removeFromQueue(sprite) {\r\n var index = registry.queue.indexOf(sprite);\r\n if (index >= 0) {\r\n registry.queue.splice(registry.queue.indexOf(sprite), 1);\r\n var nextSprite = registry.queue[index];\r\n if (nextSprite) {\r\n queueHandler(nextSprite);\r\n }\r\n }\r\n}\r\n/**\r\n * Checks whether the chart was not initialized fully due to setting\r\n * of `onlyShowOnViewport`. If it hasn't and is now in the viewport\r\n * the chart will be initialized.\r\n *\r\n * @since 4.9.12\r\n * @param sprite Top-level chart object\r\n */\r\nexport function viewPortHandler(sprite) {\r\n if (sprite.__disabled && $dom.isElementInViewport(sprite.htmlContainer, options.viewportTarget)) {\r\n if (sprite.vpDisposer) {\r\n sprite.vpDisposer.dispose();\r\n }\r\n addToQueue(sprite);\r\n }\r\n}\r\nexport function queueHandler(sprite) {\r\n sprite.__disabled = false;\r\n sprite.tooltipContainer.__disabled = false;\r\n sprite.events.enableType(\"appeared\");\r\n sprite.dispatch(\"removedfromqueue\");\r\n if (sprite.showOnInit) {\r\n sprite.events.on(\"appeared\", function () {\r\n removeFromQueue(sprite);\r\n });\r\n }\r\n if (sprite.vpDisposer) {\r\n sprite.vpDisposer.dispose();\r\n }\r\n if (sprite instanceof Container) {\r\n sprite.invalidateLabels();\r\n }\r\n if (sprite.tooltipContainer) {\r\n sprite.tooltipContainer.invalidateLayout();\r\n }\r\n if (sprite instanceof Component) {\r\n sprite.invalidateData();\r\n sprite.reinit();\r\n sprite.events.once(\"datavalidated\", function () {\r\n if (sprite.showOnInit) {\r\n sprite.appear();\r\n }\r\n else {\r\n removeFromQueue(sprite);\r\n }\r\n });\r\n }\r\n else {\r\n sprite.reinit();\r\n sprite.events.once(\"inited\", function () {\r\n removeFromQueue(sprite);\r\n });\r\n if (sprite.showOnInit) {\r\n sprite.appear();\r\n }\r\n }\r\n}\r\n/**\r\n * A shortcut to creating a chart instance.\r\n *\r\n * The first argument is either a reference to or an id of a DOM element to be\r\n * used as a container for the chart.\r\n *\r\n * The second argument is the type reference of the chart type. (for plain\r\n * JavaScript users this can also be a string indicating chart type)\r\n *\r\n * ```TypeScript\r\n * let chart = am4core.create(\"chartdiv\", am4charts.PieChart);\r\n * ```\r\n * ```JavaScript\r\n * // Can pass in chart type reference like this:\r\n * var chart = am4core.create(\"chartdiv\", am4charts.PieChart);\r\n *\r\n * // ... or chart class type as a string:\r\n * var chart = am4core.create(\"chartdiv\", \"PieChart\");\r\n * ```\r\n *\r\n * @param htmlElement Reference or id of the target container element\r\n * @param classType Class type of the target chart type\r\n * @return Chart instance\r\n */\r\nexport function create(htmlElement, classType) {\r\n // This is a nasty hack for the benefit of vanilla JS users, who do not\r\n // enjoy benefits of type-check anyway.\r\n // We're allowing passing in a name of the class rather than type reference\r\n // itself.\r\n var classError;\r\n if ($type.isString(classType)) {\r\n if ($type.hasValue(registry.registeredClasses[classType])) {\r\n classType = registry.registeredClasses[classType];\r\n }\r\n else {\r\n classType = registry.registeredClasses[\"Container\"];\r\n classError = new Error(\"Class [\" + classType + \"] is not loaded.\");\r\n }\r\n }\r\n // Create the chart\r\n var chart = createChild(htmlElement, classType);\r\n // Error?\r\n if (classError) {\r\n chart.raiseCriticalError(classError);\r\n }\r\n return chart;\r\n}\r\n/**\r\n * A shortcut to creating a chart from a config object.\r\n *\r\n * Example:\r\n *\r\n * ```TypeScript\r\n * let chart am4core.createFromConfig({ ... }, \"chartdiv\", am4charts.XYChart );\r\n * ```\r\n * ```JavaScript\r\n * var chart am4core.createFromConfig({ ... }, \"chartdiv\", \"XYChart\" );\r\n * ```\r\n *\r\n * If `chartType` parameter is not supplied it must be set in a config object,\r\n * via reference to chart type, e.g.:\r\n *\r\n * ```TypeScript\r\n * {\r\n * \"type\": am4charts.XYChart,\r\n * // ...\r\n * }\r\n * ```\r\n * ```JavaScript\r\n * {\r\n * \"type\": am4charts.XYChart,\r\n * // ...\r\n * }\r\n * ```\r\n *\r\n * Or via string: (if you are using JavaScript)\r\n *\r\n * ```TypeScript\r\n * {\r\n * \"type\": \"XYChart\",\r\n * // ...\r\n * }\r\n * ```\r\n * ```JavaScript\r\n * {\r\n * \"type\": \"XYChart\",\r\n * // ...\r\n * }\r\n * ```\r\n *\r\n * A `container` can either be a reference to an HTML container to put chart\r\n * in, or it's unique id.\r\n *\r\n * If `container` is not specified, it must be included in the config object:\r\n *\r\n * ```TypeScript\r\n * {\r\n * \"type\": \"XYChart\",\r\n * \"container\": \"chartdiv\",\r\n * // ...\r\n * }\r\n * ```\r\n * ```JavaScript\r\n * {\r\n * \"type\": \"XYChart\",\r\n * \"container\": \"chartdiv\",\r\n * // ...\r\n * }\r\n * ```\r\n *\r\n * @param config Config object in property/value pairs\r\n * @param htmlElement Container reference or ID\r\n * @param objectType Chart type\r\n * @return A newly created chart instance\r\n * @todo Throw exception if type is not correct\r\n */\r\nexport function createFromConfig(config, htmlElement, classType) {\r\n // Extract chart type from config if necessary\r\n if (!$type.hasValue(classType)) {\r\n classType = config.type;\r\n delete config.type;\r\n }\r\n // Extract element from config if necessary\r\n if (!$type.hasValue(htmlElement)) {\r\n htmlElement = config.container;\r\n delete config.container;\r\n }\r\n // Check if we need to extract actual type reference\r\n var finalType;\r\n var classError;\r\n if ($type.isString(classType) && $type.hasValue(registry.registeredClasses[classType])) {\r\n finalType = registry.registeredClasses[classType];\r\n }\r\n else if (typeof classType !== \"function\") {\r\n finalType = Container;\r\n classError = new Error(\"Class [\" + classType + \"] is not loaded.\");\r\n }\r\n else {\r\n finalType = classType;\r\n }\r\n // Create the chart\r\n var chart = createChild(htmlElement, finalType);\r\n // Set config\r\n if (classError) {\r\n chart.raiseCriticalError(classError);\r\n }\r\n else {\r\n chart.config = config;\r\n }\r\n return chart;\r\n}\r\n/**\r\n * Useful in creating real queues form mult-chart creation.\r\n *\r\n * Accepts a reference to a function which crates and returns actual chart\r\n * object.\r\n *\r\n * It returns a `Promise` which you can use to catch chart instance once it's\r\n * created.\r\n *\r\n * ```TypeScript\r\n * am4core.createDeferred(function(div) {\r\n * // Create first chart\r\n * let chart = am4core.create(div, am4charts.XYChart);\r\n * // ...\r\n * return chart;\r\n * }, \"chartdiv1\").then(chart) {\r\n * // `chart` variable holds an instance of the chart\r\n * console.log(\"Chart ready\", chart);\r\n * }\r\n *\r\n * am4core.createDeferred(function(div) {\r\n * // Create second chart\r\n * let chart = am4core.create(div, am4charts.PieChart);\r\n * // ...\r\n * return chart;\r\n * }, \"chartdiv2\").then(chart) {\r\n * // `chart` variable holds an instance of the chart\r\n * console.log(\"Chart ready\", chart);\r\n * }\r\n * ```\r\n * ```JavaScript\r\n * am4core.createDeferred(function(div) {\r\n * // Create first chart\r\n * var chart = am4core.create(div, am4charts.XYChart);\r\n * // ...\r\n * return chart;\r\n * }, \"chartdiv1\").then(chart) {\r\n * // `chart` variable holds an instance of the chart\r\n * console.log(\"Chart ready\", chart);\r\n * }\r\n *\r\n * am4core.createDeferred(function(div) {\r\n * // Create second chart\r\n * var chart = am4core.create(div, am4charts.PieChart);\r\n * // ...\r\n * return chart;\r\n * }, \"chartdiv2\").then(chart) {\r\n * // `chart` variable holds an instance of the chart\r\n * console.log(\"Chart ready\", chart);\r\n * }\r\n * ```\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/performance/#Deferred_daisy_chained_instantiation} for more information\r\n * @since 4.10.0\r\n * @param callback Callback function that creates chart\r\n * @param scope Scope to call callback in\r\n * @param ...rest Parameters to pass into callback\r\n * @return Promise with chart instance\r\n */\r\nexport function createDeferred(callback, scope) {\r\n var rest = [];\r\n for (var _i = 2; _i < arguments.length; _i++) {\r\n rest[_i - 2] = arguments[_i];\r\n }\r\n return new Promise(function (resolve, reject) {\r\n registry.deferred.push({\r\n scope: scope,\r\n callback: callback,\r\n args: rest,\r\n resolve: resolve\r\n });\r\n if (registry.deferred.length == 1) {\r\n processNextDeferred();\r\n }\r\n });\r\n}\r\nfunction processNextDeferred() {\r\n var _a;\r\n var next = registry.deferred[0];\r\n if (next) {\r\n var sprite_2 = (_a = next.callback).call.apply(_a, __spread([next.scope], next.args));\r\n sprite_2.events.on(\"ready\", function () {\r\n next.resolve(sprite_2);\r\n registry.deferred.shift();\r\n if (options.deferredDelay) {\r\n setTimeout(processNextDeferred, options.deferredDelay);\r\n }\r\n else {\r\n processNextDeferred();\r\n }\r\n });\r\n }\r\n}\r\n/**\r\n * Applies a theme to System, and subsequently all chart instances created\r\n * from that point forward.\r\n *\r\n * amCharts supports multiple themes. Calling `useTheme` multiple times will\r\n * make the System apply multiple themes, rather than overwrite previously\r\n * set one.\r\n *\r\n * This enables combining features from multiple themes on the same chart.\r\n * E.g.:\r\n *\r\n * ```TypeScript\r\n * am4core.useTheme(am4themes.material);\r\n * am4core.useTheme(am4themes.animated);\r\n * ```\r\n * ```JavaScript\r\n * am4core.useTheme(am4themes.material);\r\n * am4core.useTheme(am4themes.animated);\r\n * ```\r\n *\r\n * The above will apply both the Material color and animation options to all\r\n * charts created.\r\n *\r\n * @param value A reference to a theme\r\n */\r\nexport function useTheme(value) {\r\n if (registry.themes.indexOf(value) === -1) {\r\n registry.themes.push(value);\r\n }\r\n}\r\n/**\r\n * Removes a theme from \"active themes\" list, so it won't get applied to any\r\n * charts created subsequently.\r\n *\r\n * @param value A reference to a theme\r\n */\r\nexport function unuseTheme(value) {\r\n $array.remove(registry.themes, value);\r\n}\r\n/**\r\n * Removes all \"active\" themes. Any charts created subsequently will not have\r\n * any theme applied to them.\r\n */\r\nexport function unuseAllThemes() {\r\n registry.themes = [];\r\n}\r\n/**\r\n * Adds a license, e.g.:\r\n *\r\n * ```TypeScript\r\n * am4core.addLicense(\"xxxxxxxx\");\r\n * ```\r\n * ```JavaScript\r\n * am4core.addLicense(\"xxxxxxxx\");\r\n * ```\r\n *\r\n * Multiple licenses can be added to cover for multiple products.\r\n *\r\n * @since 4.5.16\r\n * @param license License key\r\n */\r\nexport function addLicense(license) {\r\n options.licenses.push(license);\r\n}\r\n","/**\r\n * This module contains a version of ColorSet that can (and should) be used for\r\n * coloring UI elements.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { BaseObject } from \"../Base\";\r\nimport { registry } from \"../Registry\";\r\nimport { color } from \"./Color\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * This module contains a version of ColorSet that can (and should) be used for\r\n * coloring UI elements.\r\n *\r\n * The main difference from the basic [[ColorSet]] is that instead of sequenced\r\n * colors, it uses a concept of named colors.\r\n *\r\n * This way, every element in the UI can extract an exact color theme author\r\n * meant for the specific purpose, like strokes, backgrounds, etc.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/colors/} for color-related info\r\n */\r\nvar InterfaceColorSet = /** @class */ (function (_super) {\r\n __extends(InterfaceColorSet, _super);\r\n /**\r\n * Constructor\r\n */\r\n function InterfaceColorSet() {\r\n var _this = _super.call(this) || this;\r\n /**\r\n * Maps the list of purposes (like \"stroke\") to an index of color of the\r\n * color set.\r\n */\r\n _this._purposes = {\r\n stroke: color(\"#e5e5e5\"),\r\n fill: color(\"#f3f3f3\"),\r\n primaryButton: color(\"#6794dc\"),\r\n primaryButtonHover: color(\"#6771dc\"),\r\n primaryButtonDown: color(\"#68dc75\"),\r\n primaryButtonActive: color(\"#68dc75\"),\r\n primaryButtonText: color(\"#FFFFFF\"),\r\n primaryButtonStroke: color(\"#FFFFFF\"),\r\n secondaryButton: color(\"#d9d9d9\"),\r\n secondaryButtonHover: color(\"#d9d9d9\").brighten(-0.25),\r\n secondaryButtonDown: color(\"#d9d9d9\").brighten(-0.35),\r\n secondaryButtonActive: color(\"#d9d9d9\").brighten(0.35),\r\n secondaryButtonText: color(\"#000000\"),\r\n secondaryButtonStroke: color(\"#FFFFFF\"),\r\n grid: color(\"#000000\"),\r\n background: color(\"#ffffff\"),\r\n alternativeBackground: color(\"#000000\"),\r\n text: color(\"#000000\"),\r\n alternativeText: color(\"#FFFFFF\"),\r\n disabledBackground: color(\"#999999\"),\r\n positive: color(\"#67dc75\"),\r\n negative: color(\"#dc6788\")\r\n };\r\n _this.className = \"InterfaceColorSet\";\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n InterfaceColorSet.prototype.debug = function () { };\r\n /**\r\n * Returns a color to be used for the specific purpose.\r\n *\r\n * ```TypeScript\r\n * let uicolors = new am4core.InterfaceColorSet();\r\n * console.log(uicolors.getFor(\"stroke\"));\r\n * ```\r\n * ```JavaScript\r\n * var uicolors = new am4core.InterfaceColorSet();\r\n * console.log(uicolors.getFor(\"stroke\"));\r\n * ```\r\n *\r\n * @param purpose Color use purpuse\r\n * @return Color\r\n */\r\n InterfaceColorSet.prototype.getFor = function (purpose) {\r\n return this._purposes[purpose];\r\n };\r\n /**\r\n * Sets color to be used for the specific purpose.\r\n *\r\n * @param purpose Color use purpose\r\n * @param color Color\r\n */\r\n InterfaceColorSet.prototype.setFor = function (purpose, color) {\r\n this._purposes[purpose] = color;\r\n };\r\n return InterfaceColorSet;\r\n}(BaseObject));\r\nexport { InterfaceColorSet };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"InterfaceColorSet\"] = InterfaceColorSet;\r\n","import * as $array from \"./Array\";\r\n/**\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\nexport function fromArray(array) {\r\n return function (push) {\r\n var length = array.length;\r\n for (var i = 0; i < length; ++i) {\r\n if (!push(array[i])) {\r\n break;\r\n }\r\n }\r\n };\r\n}\r\n/**\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\nexport function length(iter) {\r\n var sum = 0;\r\n iter(function (_) {\r\n ++sum;\r\n return true;\r\n });\r\n return sum;\r\n}\r\n/**\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\nexport function toArray(iter) {\r\n var output = [];\r\n iter(function (value) {\r\n output.push(value);\r\n return true;\r\n });\r\n return output;\r\n}\r\n/**\r\n * [iter description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\nexport function eachContinue(iter, fn) {\r\n iter(fn);\r\n}\r\n/**\r\n * [iter description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\nexport function each(iter, fn) {\r\n iter(function (value) {\r\n fn(value);\r\n return true;\r\n });\r\n}\r\n/**\r\n * [iter description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\nexport function sort(iter, fn) {\r\n return fromArray(toArray(iter).sort(fn));\r\n}\r\n/**\r\n * [A description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\nexport function map(iter, fn) {\r\n return function (push) { return iter(function (value) { return push(fn(value)); }); };\r\n}\r\n/**\r\n * [iter description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\nexport function filter(iter, fn) {\r\n return function (push) { return iter(function (value) {\r\n if (fn(value)) {\r\n return push(value);\r\n }\r\n else {\r\n return true;\r\n }\r\n }); };\r\n}\r\n/**\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\nexport function concat() {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n return function (push) {\r\n var go = true;\r\n var push2 = function (value) { return (go = push(value)); };\r\n var length = args.length;\r\n for (var i = 0; i < length; ++i) {\r\n args[i](push2);\r\n if (!go) {\r\n break;\r\n }\r\n }\r\n };\r\n}\r\n/**\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\nexport function flatten(iter) {\r\n return function (push) {\r\n var go = true;\r\n var push2 = function (value) { return (go = push(value)); };\r\n iter(function (value) {\r\n value(push2);\r\n return go;\r\n });\r\n };\r\n}\r\n/**\r\n * [number description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\nexport function indexed(iter) {\r\n return function (push) {\r\n var index = 0;\r\n iter(function (value) { return push([index++, value]); });\r\n };\r\n}\r\n/**\r\n * [iter description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\nexport function findIndex(iter, matches) {\r\n var found = false;\r\n var i = 0;\r\n iter(function (value) {\r\n if (matches(value)) {\r\n found = true;\r\n return false;\r\n }\r\n else {\r\n ++i;\r\n return true;\r\n }\r\n });\r\n return (found ? i : -1);\r\n}\r\n/**\r\n * [iter description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\nexport function find(iter, matches) {\r\n var output;\r\n iter(function (value) {\r\n if (matches(value)) {\r\n output = value;\r\n return false;\r\n }\r\n else {\r\n return true;\r\n }\r\n });\r\n return output;\r\n}\r\n/**\r\n * [A description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\nexport function findMap(iter, matches) {\r\n var output;\r\n iter(function (value) {\r\n var v = matches(value);\r\n if (v !== null) {\r\n output = v;\r\n return false;\r\n }\r\n else {\r\n return true;\r\n }\r\n });\r\n return output;\r\n}\r\n/**\r\n * [iter description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\nexport function contains(iter, matches) {\r\n var output = false;\r\n iter(function (value) {\r\n if (matches(value)) {\r\n output = true;\r\n return false;\r\n }\r\n else {\r\n return true;\r\n }\r\n });\r\n return output;\r\n}\r\n/**\r\n * [A description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\nexport function foldl(iter, init, fn) {\r\n iter(function (value) {\r\n init = fn(init, value);\r\n return true;\r\n });\r\n return init;\r\n}\r\n/**\r\n * [min2 description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param left [description]\r\n * @param right [description]\r\n * @return [description]\r\n */\r\nfunction min2(left, right) {\r\n if (left == null || right < left) {\r\n return right;\r\n }\r\n else {\r\n return left;\r\n }\r\n}\r\n/**\r\n * [min description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Verify that this works correctly\r\n * @todo Description\r\n * @param a [description]\r\n * @return [description]\r\n */\r\nexport function min(a) {\r\n return foldl(a, null, min2);\r\n}\r\n/**\r\n * [max2 description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param left [description]\r\n * @param right [description]\r\n * @return [description]\r\n */\r\nfunction max2(left, right) {\r\n if (left == null || right > left) {\r\n return right;\r\n }\r\n else {\r\n return left;\r\n }\r\n}\r\n/**\r\n * [max description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Verify that this works correctly\r\n * @todo Description\r\n * @param a [description]\r\n * @return [description]\r\n */\r\nexport function max(a) {\r\n return foldl(a, null, max2);\r\n}\r\n/**\r\n * [join description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param iter [description]\r\n * @param separator [description]\r\n * @return [description]\r\n */\r\nexport function join(iter, separator) {\r\n if (separator === void 0) { separator = \"\"; }\r\n var first = true;\r\n var init = \"\";\r\n iter(function (value) {\r\n if (first) {\r\n first = false;\r\n }\r\n else {\r\n init += separator;\r\n }\r\n init += value;\r\n return true;\r\n });\r\n return init;\r\n}\r\n/**\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n */\r\nvar ListIterator = /** @class */ (function () {\r\n /**\r\n * Constructor\r\n *\r\n * @param list [description]\r\n * @param create [description]\r\n */\r\n function ListIterator(list, create) {\r\n // flag specifies if iterator should create new list item if it is reqested for a nextItem but there is no more left in the list\r\n this.createNewItems = false;\r\n this.list = list;\r\n this._create = create;\r\n this.reset();\r\n }\r\n ListIterator.prototype.reset = function () {\r\n this._listCopy = toArray(this.list.iterator());\r\n };\r\n ListIterator.prototype.clear = function () {\r\n this._listCopy.length = 0;\r\n };\r\n ListIterator.prototype.getFirst = function () {\r\n return this.returnItem(0);\r\n };\r\n ListIterator.prototype.getLast = function () {\r\n return this.returnItem(this._listCopy.length - 1);\r\n };\r\n ListIterator.prototype.find = function (fn) {\r\n var index = $array.findIndex(this._listCopy, fn);\r\n if (index !== -1) {\r\n var item = this._listCopy[index];\r\n // TODO use removeIndex instead ?\r\n $array.remove(this._listCopy, item);\r\n return item;\r\n }\r\n else {\r\n return this.getLast();\r\n }\r\n };\r\n ListIterator.prototype.removeItem = function (item) {\r\n return $array.remove(this._listCopy, item);\r\n };\r\n ListIterator.prototype.returnItem = function (index) {\r\n if (index >= 0 && index < this._listCopy.length) {\r\n var item = this._listCopy[index];\r\n // TODO use removeIndex instead ?\r\n $array.remove(this._listCopy, item);\r\n return item;\r\n }\r\n else if (this.createNewItems) {\r\n return this._create();\r\n }\r\n };\r\n ListIterator.prototype.iterator = function () {\r\n return fromArray(this._listCopy);\r\n };\r\n return ListIterator;\r\n}());\r\nexport { ListIterator };\r\n","/**\r\n * A collection of keyboard-related utilities accessible via `keyboard`\r\n * instance.\r\n */\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport * as $type from \"./Type\";\r\n/**\r\n * A class that represents collection of keyboard-related utilities.\r\n *\r\n * Do not instantiate this class directly, but rather use `keyboard` variable.\r\n */\r\nvar Keyboard = /** @class */ (function () {\r\n function Keyboard() {\r\n }\r\n /**\r\n * Returns a named key based on information contained in the event or\r\n * \"other\".\r\n *\r\n * @param ev A keyboard event\r\n * @return Keyboard named key\r\n */\r\n Keyboard.prototype.getEventKey = function (ev) {\r\n // Get the key code\r\n var code = ev.keyCode || ev.which, key;\r\n // Map to internal key\r\n switch (code) {\r\n case 38:\r\n key = \"up\";\r\n break;\r\n case 40:\r\n key = \"down\";\r\n break;\r\n case 37:\r\n key = \"left\";\r\n break;\r\n case 39:\r\n key = \"right\";\r\n break;\r\n case 13:\r\n key = \"enter\";\r\n break;\r\n case 27:\r\n key = \"esc\";\r\n break;\r\n case 36:\r\n key = \"home\";\r\n break;\r\n case 35:\r\n key = \"end\";\r\n break;\r\n case 9:\r\n key = \"tab\";\r\n break;\r\n case 17:\r\n key = \"ctrl\";\r\n break;\r\n case 18:\r\n key = \"alt\";\r\n break;\r\n case 16:\r\n key = \"shift\";\r\n break;\r\n case 32:\r\n key = \"space\";\r\n break;\r\n case 36:\r\n key = \"home\";\r\n break;\r\n case 35:\r\n key = \"end\";\r\n break;\r\n case 33:\r\n key = \"pgup\";\r\n break;\r\n case 34:\r\n key = \"pgdn\";\r\n break;\r\n case 45:\r\n key = \"ins\";\r\n break;\r\n case 46:\r\n key = \"del\";\r\n break;\r\n case 107:\r\n key = \"plus\";\r\n break;\r\n case 109:\r\n key = \"minus\";\r\n break;\r\n default:\r\n key = \"other\";\r\n break;\r\n }\r\n return key;\r\n };\r\n /**\r\n * Checks if event key is one or more of the selected named keys.\r\n *\r\n * @param ev Keyboard event\r\n * @param key Named key or array of keys\r\n * @return Is event key one of the list?\r\n */\r\n Keyboard.prototype.isKey = function (ev, key) {\r\n var eventKey = this.getEventKey(ev);\r\n if ($type.isString(key)) {\r\n key = [key];\r\n }\r\n return key.indexOf(eventKey) !== -1;\r\n };\r\n /**\r\n * Returns `true` if shift key was presset at the moment of the event.\r\n *\r\n * @param ev Event object\r\n * @return Was shift pressed?\r\n */\r\n Keyboard.prototype.shiftKey = function (ev) {\r\n return ev.shiftKey;\r\n };\r\n /**\r\n * Returns `true` if ctrl key was presset at the moment of the event.\r\n *\r\n * @param ev Event object\r\n * @return Was ctrl pressed?\r\n */\r\n Keyboard.prototype.ctrlKey = function (ev) {\r\n return ev.ctrlKey;\r\n };\r\n /**\r\n * Returns `true` if alt key was presset at the moment of the event\r\n * @param ev Event object\r\n * @return Was alt pressed?\r\n */\r\n Keyboard.prototype.altKey = function (ev) {\r\n return ev.altKey;\r\n };\r\n /**\r\n * Returns `true` if meta key was presset at the moment of the event\r\n * @param ev Event object\r\n * @return Was meta pressed?\r\n */\r\n Keyboard.prototype.metaKey = function (ev) {\r\n return ev.metaKey;\r\n };\r\n return Keyboard;\r\n}());\r\nexport { Keyboard };\r\n/**\r\n * A single [[Keyboard]] instance to be reused across all elements so that\r\n * they don't need to instantiate their own.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\nexport var keyboard = new Keyboard();\r\n","/**\r\n * Language module contains everything related to language-specific operations:\r\n * * Translating prompts\r\n * * Translating functions\r\n * * Date format localizations\r\n */\r\nimport { __extends, __read, __spread } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { BaseObjectEvents } from \"../Base\";\r\nimport { Adapter } from \"./Adapter\";\r\nimport * as $array from \"./Array\";\r\nimport * as $type from \"./Type\";\r\nimport en from \"../../../lang/en\";\r\nimport { options } from \"../Options\";\r\n;\r\n;\r\n/**\r\n * Handles all language-related tasks, like loading and storing translations,\r\n * translating prompts, lists of prompts and even functions.\r\n *\r\n * Almost every object in amCharts4 universe will have a `language` property,\r\n * which can be accessed for prompt translation.\r\n *\r\n * @see {@link ILanguageAdapters} for a list of available Adapters\r\n * @todo Make prompt keys case-insensitive\r\n * @important\r\n */\r\nvar Language = /** @class */ (function (_super) {\r\n __extends(Language, _super);\r\n /**\r\n * Constructor\r\n */\r\n function Language() {\r\n var _this = _super.call(this) || this;\r\n /**\r\n * Adapter.\r\n */\r\n _this.adapter = new Adapter(_this);\r\n /**\r\n * Current locale.\r\n */\r\n _this._locale = en;\r\n /**\r\n * Default locale. A locale to fall back to if none is specified, or\r\n * if there's no translation for the prompt for the current language.\r\n */\r\n _this._defaultLocale = en;\r\n _this.className = \"Language\";\r\n // Set default language if necessary\r\n if ($type.hasValue(options.defaultLocale)) {\r\n _this.locale = options.defaultLocale;\r\n }\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Returns locale that is currently used.\r\n *\r\n * @param locale Force locale. Will use current language if not set.\r\n * @return Locale\r\n */\r\n Language.prototype.getLocale = function (locale) {\r\n if (locale == null) {\r\n locale = this._locale;\r\n }\r\n return this.adapter.apply(\"locale\", {\r\n locale: locale\r\n }).locale;\r\n };\r\n /**\r\n * Returns the translation of the string.\r\n *\r\n * If the translation is empty, it will return untranslated prompt.\r\n *\r\n * Third parameter and up are strings that can be used to replace \"%X\"\r\n * placeholders in prompt.\r\n *\r\n * E.g.:\r\n *\r\n * ```TypeScript\r\n * // Results in \"This is a first translation test\"\r\n * chart.language.translate(\"This is a %1 translation %2\", null, \"first\", \"test\");\r\n * ```\r\n * ```JavaScriptScript\r\n * // Results in \"This is a first translation test\"\r\n * chart.language.translate(\"This is a %1 translation %2\", null, \"first\", \"test\");\r\n * ```\r\n *\r\n * @param prompt A string to translate\r\n * @param locale Force translation into specific locale, e.g. fr_FR\r\n * @param rest Parameters to replace in string\r\n * @return Translation\r\n */\r\n Language.prototype.translate = function (prompt, locale) {\r\n var rest = [];\r\n for (var _i = 2; _i < arguments.length; _i++) {\r\n rest[_i - 2] = arguments[_i];\r\n }\r\n // Get langauge\r\n locale = this.getLocale(locale);\r\n // Init translation\r\n var translation = prompt;\r\n // Get translations for the locale\r\n var translations = this.getTranslations(locale);\r\n var value = translations[prompt];\r\n // Try to look for the translation\r\n if (value === null) {\r\n value = \"\";\r\n }\r\n else if ($type.hasValue(value)) {\r\n // It might be an empty string\r\n if (value) {\r\n translation = value;\r\n }\r\n }\r\n else if (locale !== this._defaultLocale) {\r\n // Try to look in default language\r\n return this.translate.apply(this, __spread([prompt, this._defaultLocale], rest));\r\n }\r\n // Replace %1, %2, etc params\r\n if (rest.length) {\r\n for (var len = rest.length, i = 0; i < len; ++i) {\r\n translation = translation.split(\"%\" + (i + 1)).join(rest[i]);\r\n }\r\n }\r\n // Return the translation\r\n return this.adapter.apply(\"translate\", {\r\n translation: translation,\r\n locale: locale\r\n }).translation;\r\n };\r\n /**\r\n * Non-type-checked translation.\r\n *\r\n * Can be used by plugins and other code that may have their own non-standard\r\n * translation prompts.\r\n *\r\n * @since 4.5.5\r\n * @param prompt A string to translate\r\n * @param locale Force translation into specific locale, e.g. fr_FR\r\n * @param rest Parameters to replace in string\r\n * @return Translation\r\n */\r\n Language.prototype.translateAny = function (prompt, locale) {\r\n var rest = [];\r\n for (var _i = 2; _i < arguments.length; _i++) {\r\n rest[_i - 2] = arguments[_i];\r\n }\r\n return this.translate.apply(this, __spread([prompt, locale], rest));\r\n };\r\n /**\r\n * Sets a prompt translation.\r\n *\r\n * @since 4.9.35\r\n * @param prompt Prompt in English\r\n * @param translation Translation\r\n * @param locale Locale\r\n */\r\n Language.prototype.setTranslationAny = function (prompt, translation, locale) {\r\n var localeTarget = locale || this.locale;\r\n localeTarget[prompt] = translation;\r\n };\r\n /**\r\n * Translates prompt.\r\n *\r\n * If translation is empty, it will return empty string, which is a different\r\n * behavior than that of regular `translate`.\r\n *\r\n * @param prompt A string to translate\r\n * @param locale Force translation into specific locale, e.g. fr_FR\r\n * @param ...rest Parameters to replace in string\r\n * @return Translation\r\n */\r\n Language.prototype.translateEmpty = function (prompt, locale) {\r\n var rest = [];\r\n for (var _i = 2; _i < arguments.length; _i++) {\r\n rest[_i - 2] = arguments[_i];\r\n }\r\n var translation = this.translate.apply(this, __spread([prompt, locale], rest));\r\n return translation == prompt ? \"\" : translation;\r\n };\r\n /**\r\n * Translates a function.\r\n *\r\n * This method will return a function reference, but will not run it. It's\r\n * up to the caller script to run the function.\r\n *\r\n * @param prompt A function id to translate\r\n * @param locale Force translation into specific locale. e.g. fr_FR\r\n * @return A language-specific version of the function\r\n * @todo Apply adapter\r\n */\r\n Language.prototype.translateFunc = function (prompt, locale) {\r\n // Get langauge\r\n locale = this.getLocale(locale);\r\n // Get translations for the locale\r\n var translations = this.getTranslations(locale);\r\n var value = translations[prompt];\r\n // Try to look for the translation\r\n if (value != null) {\r\n return value;\r\n }\r\n // Try to look in default language\r\n if (locale !== this._defaultLocale) {\r\n return this.translateFunc(prompt, this._defaultLocale);\r\n }\r\n // Fail - return empty function\r\n return function () {\r\n return \"\";\r\n };\r\n };\r\n /**\r\n * Translates a list of prompts in one go.\r\n *\r\n * @param list An array of strings to translate\r\n * @param locale Force translation into specific locale. e.g. fr_FR\r\n * @return An array of translated strings in the same order as source list\r\n */\r\n Language.prototype.translateAll = function (list, locale) {\r\n var _this = this;\r\n // Translate all items in the list\r\n if (!this.isDefault()) {\r\n return $array.map(list, function (x) { return _this.translate(x, locale); });\r\n }\r\n else {\r\n return list;\r\n }\r\n };\r\n /**\r\n * Returns `true` if the currently selected locale is a default locale.\r\n *\r\n * @return `true` if locale is default; `false` if it is not.\r\n */\r\n Language.prototype.isDefault = function () {\r\n return this._defaultLocale === this._locale;\r\n };\r\n Object.defineProperty(Language.prototype, \"locale\", {\r\n /**\r\n * @return Locale definition\r\n */\r\n get: function () {\r\n return this._locale;\r\n },\r\n /**\r\n * Current locale.\r\n *\r\n * @param value Locale definition (translations)\r\n */\r\n set: function (value) {\r\n if (this._locale != value) {\r\n this._locale = value;\r\n if (this.events.isEnabled(\"localechanged\")) {\r\n var event_1 = {\r\n type: \"localechanged\",\r\n locale: value,\r\n target: this\r\n };\r\n this.events.dispatchImmediately(\"localechanged\", event_1);\r\n }\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Returns translations for a given locale.\r\n *\r\n * @ignore\r\n * @deprecated\r\n * @param locale Locale\r\n * @return Translations\r\n */\r\n Language.prototype.getTranslations = function (locale) {\r\n return this.adapter.apply(\"translations\", {\r\n translations: locale,\r\n locale: locale\r\n }).translations;\r\n };\r\n return Language;\r\n}(BaseObjectEvents));\r\nexport { Language };\r\n","import { __extends, __generator } from \"tslib\";\r\nimport { Disposer, MultiDisposer } from \"./Disposer\";\r\nimport { EventDispatcher } from \"./EventDispatcher\";\r\nimport * as $array from \"./Array\";\r\nimport * as $iter from \"./Iterator\";\r\n/**\r\n * @todo Description\r\n */\r\nvar IndexedIterable = /** @class */ (function () {\r\n /**\r\n * Constructor.\r\n *\r\n * @param array List items\r\n * @param start Start index\r\n * @param end End index\r\n */\r\n function IndexedIterable(array, start, end) {\r\n this._array = array;\r\n this._start = start;\r\n this._end = end;\r\n }\r\n /**\r\n * Returns a list item iterator.\r\n *\r\n * @return Iterator\r\n */\r\n IndexedIterable.prototype.iterator = function () {\r\n var _this = this;\r\n return function (push) {\r\n if (_this._start !== _this._end) {\r\n if (_this._start < _this._end) {\r\n for (var i = _this._start; i < _this._end; ++i) {\r\n if (!push(_this._array[i])) {\r\n break;\r\n }\r\n }\r\n }\r\n else {\r\n for (var i = _this._start - 1; i >= _this._end; --i) {\r\n if (!push(_this._array[i])) {\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n };\r\n };\r\n /**\r\n * Returns an interable list sorted backwards than current list.\r\n *\r\n * @return List\r\n */\r\n IndexedIterable.prototype.backwards = function () {\r\n return new IndexedIterable(this._array, this._end, this._start);\r\n };\r\n /**\r\n * Returns a new list consisting only of specific range of items between\r\n * `start` and `end` indexes.\r\n *\r\n * @param start Start index\r\n * @param end End index\r\n * @return List\r\n */\r\n IndexedIterable.prototype.range = function (start, end) {\r\n if (start <= end) {\r\n if (this._start === this._end) {\r\n return this;\r\n }\r\n else if (this._start < this._end) {\r\n var diff = end - start;\r\n start = Math.max(this._start + start, this._start);\r\n end = Math.min(start + diff, this._end);\r\n return new IndexedIterable(this._array, start, end);\r\n }\r\n else {\r\n var diff = end - start;\r\n start = Math.max(this._start - start, this._end);\r\n end = Math.max(start - diff, this._end);\r\n return new IndexedIterable(this._array, start, end);\r\n }\r\n }\r\n else {\r\n throw new Error(\"Start index must be lower than end index\");\r\n }\r\n };\r\n return IndexedIterable;\r\n}());\r\nexport { IndexedIterable };\r\n/**\r\n * ListGrouper organizes [[List]] items into groups.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\nvar ListGrouper = /** @class */ (function (_super) {\r\n __extends(ListGrouper, _super);\r\n /**\r\n * Constructor.\r\n */\r\n function ListGrouper(list, getKey, sort) {\r\n var _this = _super.call(this, [\r\n list.events.on(\"inserted\", function (x) {\r\n var value = x.newValue;\r\n var key = _this._getKey(value);\r\n var index = 0;\r\n $iter.eachContinue(list.iterator(), function (x) {\r\n if (x === value) {\r\n return false;\r\n }\r\n else if (_this._getKey(x) === key) {\r\n ++index;\r\n }\r\n return true;\r\n });\r\n _this._insert(value, key, index);\r\n }, undefined, false),\r\n list.events.on(\"removed\", function (x) {\r\n _this._remove(x.oldValue);\r\n }, undefined, false)\r\n ]) || this;\r\n /**\r\n * Grouping keys.\r\n */\r\n _this._keys = [];\r\n /**\r\n * List item groups.\r\n */\r\n _this._groups = {};\r\n _this._getKey = getKey;\r\n _this._sort = sort;\r\n $iter.each(list.iterator(), function (x) {\r\n _this._insert(x, getKey(x));\r\n });\r\n return _this;\r\n }\r\n /**\r\n * Inserts an item (`x`) to a specific group (`key`) and specific `index`.\r\n *\r\n * @param x Item\r\n * @param key Group name\r\n * @param index Index\r\n */\r\n ListGrouper.prototype._insert = function (x, key, index) {\r\n if (this._groups[key] == null) {\r\n this._groups[key] = [];\r\n // TODO code duplication with SortedList\r\n var _a = $array.getSortedIndex(this._keys, this._sort, key), found = _a.found, index_1 = _a.index;\r\n if (found) {\r\n throw new Error(\"Key already exists: \" + key);\r\n }\r\n else {\r\n $array.insertIndex(this._keys, index_1, key);\r\n }\r\n }\r\n if (index == null) {\r\n this._groups[key].push(x);\r\n }\r\n else {\r\n $array.insertIndex(this._groups[key], index, x);\r\n }\r\n };\r\n /**\r\n * Removes an item from the list.\r\n *\r\n * @param x Item to remove\r\n */\r\n ListGrouper.prototype._remove = function (x) {\r\n var key = this._getKey(x);\r\n var values = this._groups[key];\r\n if (values != null) {\r\n $array.remove(values, x);\r\n if (values.length === 0) {\r\n delete this._groups[key];\r\n var _a = $array.getSortedIndex(this._keys, this._sort, key), found = _a.found, index = _a.index;\r\n if (found) {\r\n $array.removeIndex(this._keys, index);\r\n }\r\n else {\r\n throw new Error(\"Key doesn't exist: \" + key);\r\n }\r\n }\r\n }\r\n };\r\n /**\r\n * Returns an iterator for the list.\r\n *\r\n * The iterator will iterate through all items in all groups.\r\n *\r\n * @return Iterator\r\n */\r\n ListGrouper.prototype.iterator = function () {\r\n var _this = this;\r\n return $iter.flatten($iter.map($iter.fromArray(this._keys), function (key) {\r\n return $iter.fromArray(_this._groups[key]);\r\n }));\r\n };\r\n return ListGrouper;\r\n}(MultiDisposer));\r\nexport { ListGrouper };\r\n/**\r\n * A disposable list, which when disposed itself will call `dispose()` method\r\n * on all its items.\r\n */\r\nvar ListDisposer = /** @class */ (function (_super) {\r\n __extends(ListDisposer, _super);\r\n function ListDisposer(list, disposeOnRemove) {\r\n if (disposeOnRemove === void 0) { disposeOnRemove = true; }\r\n var _this = this;\r\n if (disposeOnRemove) {\r\n var disposer_1 = list.events.on(\"removed\", function (x) {\r\n x.oldValue.dispose();\r\n }, undefined, false);\r\n _this = _super.call(this, function () {\r\n disposer_1.dispose();\r\n // TODO clear the list ?\r\n $iter.each(list.iterator(), function (x) {\r\n x.dispose();\r\n });\r\n }) || this;\r\n }\r\n else {\r\n _this = _super.call(this, function () {\r\n // TODO clear the list ?\r\n $iter.each(list.iterator(), function (x) {\r\n x.dispose();\r\n });\r\n }) || this;\r\n }\r\n return _this;\r\n }\r\n return ListDisposer;\r\n}(Disposer));\r\nexport { ListDisposer };\r\n/**\r\n * Checks if specific index fits into length.\r\n *\r\n * @param index Index\r\n * @param len Length\r\n */\r\nfunction checkBounds(index, len) {\r\n if (!(index >= 0 && index < len)) {\r\n throw new Error(\"Index out of bounds: \" + index);\r\n }\r\n}\r\n/**\r\n * A List class is used to hold a number of indexed items of the same type.\r\n */\r\nvar List = /** @class */ (function () {\r\n /**\r\n * Constructor\r\n *\r\n * @param initial Inital list of values to add to list\r\n */\r\n function List(initial) {\r\n if (initial === void 0) { initial = []; }\r\n /**\r\n * Event dispatcher.\r\n */\r\n this.events = new EventDispatcher();\r\n this._values = initial;\r\n }\r\n Object.defineProperty(List.prototype, \"values\", {\r\n /**\r\n * An array of values in the list.\r\n *\r\n * Do not use this property to add values. Rather use dedicated methods, like\r\n * `push()`, `removeIndex()`, etc.\r\n *\r\n * @readonly\r\n * @return List values\r\n */\r\n get: function () {\r\n return this._values;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Checks if list contains specific item reference.\r\n *\r\n * @param item Item to search for\r\n * @return `true` if found, `false` if not found\r\n */\r\n List.prototype.contains = function (value) {\r\n return this._values.indexOf(value) !== -1;\r\n };\r\n /**\r\n * Removes specific item from the list.\r\n *\r\n * @param item An item to remove\r\n */\r\n List.prototype.removeValue = function (value) {\r\n var i = 0;\r\n var length = this._values.length;\r\n while (i < length) {\r\n // TODO handle NaN\r\n if (this._values[i] === value) {\r\n this.removeIndex(i);\r\n --length;\r\n }\r\n else {\r\n ++i;\r\n }\r\n }\r\n };\r\n /**\r\n * Searches the list for specific item and returns its index.\r\n *\r\n * @param item An item to search for\r\n * @return Index or -1 if not found\r\n */\r\n List.prototype.indexOf = function (value) {\r\n return $array.indexOf(this._values, value);\r\n };\r\n Object.defineProperty(List.prototype, \"length\", {\r\n /**\r\n * Number of items in list.\r\n *\r\n * @readonly\r\n * @return Number of items\r\n */\r\n get: function () {\r\n return this._values.length;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Checks if there's a value at specific index.\r\n *\r\n * @param index Index\r\n * @return Value exists?\r\n */\r\n List.prototype.hasIndex = function (index) {\r\n return index >= 0 && index < this._values.length;\r\n };\r\n /**\r\n * Returns an item at specified index.\r\n *\r\n * @param index Index\r\n * @return List item\r\n */\r\n List.prototype.getIndex = function (index) {\r\n return this._values[index];\r\n };\r\n /**\r\n * Sets value at specific index.\r\n *\r\n * If there's already a value at the index, it is overwritten.\r\n *\r\n * @param index Index\r\n * @param value New value\r\n * @return New value\r\n */\r\n List.prototype.setIndex = function (index, value) {\r\n checkBounds(index, this._values.length);\r\n var oldValue = this._values[index];\r\n // Do nothing if the old value and the new value are the same\r\n if (oldValue !== value) {\r\n this._values[index] = value;\r\n if (this.events.isEnabled(\"setIndex\")) {\r\n this.events.dispatchImmediately(\"setIndex\", {\r\n type: \"setIndex\",\r\n target: this,\r\n index: index,\r\n oldValue: oldValue,\r\n newValue: value\r\n });\r\n }\r\n if (this.events.isEnabled(\"removed\")) {\r\n this.events.dispatchImmediately(\"removed\", {\r\n type: \"removed\",\r\n target: this,\r\n oldValue: oldValue\r\n });\r\n }\r\n if (this.events.isEnabled(\"inserted\")) {\r\n this.events.dispatchImmediately(\"inserted\", {\r\n type: \"inserted\",\r\n target: this,\r\n newValue: value\r\n });\r\n }\r\n }\r\n return oldValue;\r\n };\r\n /**\r\n * Adds an item to the list at a specific index, which pushes all the other\r\n * items further down the list.\r\n *\r\n * @param index Index\r\n * @param item An item to add\r\n */\r\n List.prototype.insertIndex = function (index, value) {\r\n checkBounds(index, this._values.length + 1);\r\n $array.insertIndex(this._values, index, value);\r\n if (this.events.isEnabled(\"insertIndex\")) {\r\n this.events.dispatchImmediately(\"insertIndex\", {\r\n type: \"insertIndex\",\r\n target: this,\r\n index: index,\r\n newValue: value\r\n });\r\n }\r\n if (this.events.isEnabled(\"inserted\")) {\r\n this.events.dispatchImmediately(\"inserted\", {\r\n type: \"inserted\",\r\n target: this,\r\n newValue: value\r\n });\r\n }\r\n };\r\n /**\r\n * [_sortQuicksort description]\r\n *\r\n * @todo Description\r\n * @param low [description]\r\n * @param high [description]\r\n * @param order [description]\r\n */\r\n List.prototype._sortQuicksort = function (low, high, order) {\r\n if (low < high) {\r\n var p = this._sortPartition(low, high, order);\r\n this._sortQuicksort(low, p, order);\r\n this._sortQuicksort(p + 1, high, order);\r\n }\r\n };\r\n /**\r\n * [_sortPartition description]\r\n *\r\n * @todo Description\r\n * @param low [description]\r\n * @param high [description]\r\n * @param order [description]\r\n * @return [description]\r\n */\r\n List.prototype._sortPartition = function (low, high, order) {\r\n var values = this._values;\r\n var pivot = values[low];\r\n var i = low - 1;\r\n var j = high + 1;\r\n for (;;) {\r\n do {\r\n ++i;\r\n } while (order(values[i], pivot) < 0);\r\n do {\r\n --j;\r\n } while (order(values[j], pivot) > 0);\r\n if (i >= j) {\r\n return j;\r\n }\r\n else {\r\n this.swap(i, j);\r\n }\r\n }\r\n };\r\n /**\r\n * Reorders list items according to specific ordering function.\r\n *\r\n * @param order Ordering function\r\n */\r\n List.prototype.sort = function (order) {\r\n // https://en.wikipedia.org/wiki/Quicksort#Hoare_partition_scheme\r\n // @todo faster implementation of this\r\n // @todo test this\r\n this._sortQuicksort(0, this._values.length - 1, order);\r\n };\r\n /**\r\n * Swaps indexes of two items in the list.\r\n *\r\n * @param a Item 1\r\n * @param b Item 2\r\n */\r\n List.prototype.swap = function (a, b) {\r\n var len = this._values.length;\r\n checkBounds(a, len);\r\n checkBounds(b, len);\r\n if (a !== b) {\r\n var value_a = this._values[a];\r\n var value_b = this._values[b];\r\n this._values[a] = value_b;\r\n if (this.events.isEnabled(\"setIndex\")) {\r\n this.events.dispatchImmediately(\"setIndex\", {\r\n type: \"setIndex\",\r\n target: this,\r\n index: a,\r\n oldValue: value_a,\r\n newValue: value_b\r\n });\r\n }\r\n this._values[b] = value_a;\r\n if (this.events.isEnabled(\"setIndex\")) {\r\n this.events.dispatchImmediately(\"setIndex\", {\r\n type: \"setIndex\",\r\n target: this,\r\n index: b,\r\n oldValue: value_b,\r\n newValue: value_a\r\n });\r\n }\r\n }\r\n };\r\n /**\r\n * Removes a value at specific index.\r\n *\r\n * @param index Index of value to remove\r\n * @return Removed value\r\n */\r\n List.prototype.removeIndex = function (index) {\r\n checkBounds(index, this._values.length);\r\n var oldValue = this._values[index];\r\n $array.removeIndex(this._values, index);\r\n if (this.events.isEnabled(\"removeIndex\")) {\r\n this.events.dispatchImmediately(\"removeIndex\", {\r\n type: \"removeIndex\",\r\n target: this,\r\n index: index,\r\n oldValue: oldValue\r\n });\r\n }\r\n if (this.events.isEnabled(\"removed\")) {\r\n this.events.dispatchImmediately(\"removed\", {\r\n type: \"removed\",\r\n target: this,\r\n oldValue: oldValue\r\n });\r\n }\r\n return oldValue;\r\n };\r\n /**\r\n * Moves an item to a specific index within the list.\r\n *\r\n * If the index is not specified it will move the item to the end of the\r\n * list.\r\n *\r\n * @param value Item to move\r\n * @param index Index to place item at\r\n */\r\n List.prototype.moveValue = function (value, toIndex) {\r\n // TODO don't do anything if the desired index is the same as the current index\r\n var index = this.indexOf(value);\r\n // TODO remove all old values rather than only the first ?\r\n if (index !== -1) {\r\n var oldValue = this._values[index];\r\n $array.removeIndex(this._values, index);\r\n if (this.events.isEnabled(\"removeIndex\")) {\r\n this.events.dispatchImmediately(\"removeIndex\", {\r\n type: \"removeIndex\",\r\n target: this,\r\n index: index,\r\n oldValue: oldValue\r\n });\r\n }\r\n }\r\n if (toIndex == null) {\r\n toIndex = this._values.length;\r\n this._values.push(value);\r\n }\r\n else {\r\n $array.insertIndex(this._values, toIndex, value);\r\n }\r\n if (this.events.isEnabled(\"insertIndex\")) {\r\n this.events.dispatchImmediately(\"insertIndex\", {\r\n type: \"insertIndex\",\r\n target: this,\r\n index: toIndex,\r\n newValue: value\r\n });\r\n }\r\n if (index === -1) {\r\n if (this.events.isEnabled(\"inserted\")) {\r\n this.events.dispatchImmediately(\"inserted\", {\r\n type: \"inserted\",\r\n target: this,\r\n newValue: value\r\n });\r\n }\r\n }\r\n };\r\n /**\r\n * Adds an item to the end of the list.\r\n *\r\n * @param item An item to add\r\n */\r\n List.prototype.push = function (value) {\r\n var index = this._values.push(value) - 1;\r\n if (this.events.isEnabled(\"insertIndex\")) {\r\n this.events.dispatchImmediately(\"insertIndex\", {\r\n type: \"insertIndex\",\r\n target: this,\r\n index: index,\r\n newValue: value\r\n });\r\n }\r\n if (this.events.isEnabled(\"inserted\")) {\r\n this.events.dispatchImmediately(\"inserted\", {\r\n type: \"inserted\",\r\n target: this,\r\n newValue: value\r\n });\r\n }\r\n return value;\r\n };\r\n /**\r\n * Adds an item as a first item in the list.\r\n *\r\n * @param item An item to add\r\n */\r\n List.prototype.unshift = function (value) {\r\n this.insertIndex(0, value);\r\n };\r\n /**\r\n * Adds multiple items to the list.\r\n *\r\n * @param items An Array of items to add\r\n */\r\n List.prototype.pushAll = function (values) {\r\n var _this = this;\r\n $array.each(values, function (value) {\r\n _this.push(value);\r\n });\r\n };\r\n /**\r\n * Copies and adds items from abother list.\r\n *\r\n * @param source A list top copy items from\r\n */\r\n List.prototype.copyFrom = function (source) {\r\n this.pushAll(source._values);\r\n };\r\n /**\r\n * Returns the last item from the list, and removes it.\r\n *\r\n * @return Item\r\n */\r\n List.prototype.pop = function () {\r\n var index = this._values.length - 1;\r\n return index < 0 ? undefined : this.removeIndex(this._values.length - 1);\r\n };\r\n /**\r\n * Returns the first item from the list, and removes it.\r\n *\r\n * @return Item\r\n */\r\n List.prototype.shift = function () {\r\n return this._values.length ? this.removeIndex(0) : undefined;\r\n };\r\n /**\r\n * Sets multiple items to the list.\r\n *\r\n * All current items are removed.\r\n *\r\n * @param newArray New items\r\n */\r\n List.prototype.setAll = function (newArray) {\r\n var _this = this;\r\n // @tod if a value exists in both the new and old arrays, don't send remove/insert events\r\n var oldArray = $array.copy(this._values);\r\n this._values.length = 0;\r\n $array.each(newArray, function (value) {\r\n _this._values.push(value);\r\n });\r\n if (this.events.isEnabled(\"setAll\")) {\r\n this.events.dispatchImmediately(\"setAll\", {\r\n type: \"setAll\",\r\n target: this,\r\n oldArray: oldArray,\r\n newArray: this._values // TODO make a copy ?\r\n });\r\n }\r\n if (this.events.isEnabled(\"removed\")) {\r\n $array.each(oldArray, function (x) {\r\n _this.events.dispatchImmediately(\"removed\", {\r\n type: \"removed\",\r\n target: _this,\r\n oldValue: x\r\n });\r\n });\r\n }\r\n if (this.events.isEnabled(\"inserted\")) {\r\n $array.each(this._values, function (x) {\r\n _this.events.dispatchImmediately(\"inserted\", {\r\n type: \"inserted\",\r\n target: _this,\r\n newValue: x\r\n });\r\n });\r\n }\r\n };\r\n /**\r\n * Removes all items from the list.\r\n */\r\n List.prototype.clear = function () {\r\n this.setAll([]);\r\n };\r\n /**\r\n * Returns a list iterator.\r\n *\r\n * @return Iterator\r\n */\r\n List.prototype.iterator = function () {\r\n return $iter.fromArray(this._values);\r\n };\r\n /**\r\n * Returns an ES6 iterator for the list.\r\n */\r\n List.prototype[Symbol.iterator] = function () {\r\n var length, i;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n length = this._values.length;\r\n i = 0;\r\n _a.label = 1;\r\n case 1:\r\n if (!(i < length)) return [3 /*break*/, 4];\r\n return [4 /*yield*/, this._values[i]];\r\n case 2:\r\n _a.sent();\r\n _a.label = 3;\r\n case 3:\r\n ++i;\r\n return [3 /*break*/, 1];\r\n case 4: return [2 /*return*/];\r\n }\r\n });\r\n };\r\n /**\r\n * Calls `f` for each element in the list.\r\n *\r\n * `f` should have at least one parameter defined which will get a current\r\n * item, with optional second argument - index.\r\n */\r\n List.prototype.each = function (f) {\r\n $array.each(this._values, f);\r\n };\r\n /**\r\n * Returns a specific range of list items, which can be iterated.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Code duplication with IndexedIterable\r\n * @param start Start index\r\n * @param end End index\r\n * @return Range\r\n */\r\n List.prototype.range = function (start, end) {\r\n if (start <= end) {\r\n var diff = end - start;\r\n start = Math.max(start, 0);\r\n end = Math.min(start + diff, this._values.length);\r\n return new IndexedIterable(this._values, start, end);\r\n }\r\n else {\r\n throw new Error(\"Start index must be lower than end index\");\r\n }\r\n };\r\n /**\r\n * Returns an iterator that has list items sorted backwards.\r\n *\r\n * @ignore Exclude from docs\r\n * @return List\r\n */\r\n List.prototype.backwards = function () {\r\n return new IndexedIterable(this._values, this._values.length, 0);\r\n };\r\n return List;\r\n}());\r\nexport { List };\r\n/**\r\n * A version of a [[List]] that has a \"template\".\r\n *\r\n * A template is an instance of an object, that can be used to create new\r\n * elements in the list without actually needing to create instances for those.\r\n *\r\n * When new element is created in the list, e.g. by calling its `create()`\r\n * method, an exact copy of the element is created (including properties and\r\n * other attributes), inserted into the list and returned.\r\n */\r\nvar ListTemplate = /** @class */ (function (_super) {\r\n __extends(ListTemplate, _super);\r\n /**\r\n * Constructor\r\n *\r\n * @param t Template object\r\n */\r\n function ListTemplate(t) {\r\n var _this = _super.call(this) || this;\r\n _this.template = t;\r\n return _this;\r\n }\r\n Object.defineProperty(ListTemplate.prototype, \"template\", {\r\n /**\r\n * @return Template object\r\n */\r\n get: function () {\r\n return this._template;\r\n },\r\n /**\r\n * A \"template\" object to copy all properties from when creating new list\r\n * items.\r\n *\r\n * @param v Template object\r\n */\r\n set: function (v) {\r\n v.isTemplate = true;\r\n this._template = v;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Copies all elements from other list.\r\n *\r\n * @param source Source list\r\n */\r\n ListTemplate.prototype.copyFrom = function (source) {\r\n var _this = this;\r\n $iter.each(source.iterator(), function (value) {\r\n _this.push(value.clone());\r\n });\r\n };\r\n ListTemplate.prototype.create = function (make) {\r\n var clone = (make != null\r\n ? new make()\r\n : this.template.clone());\r\n this.push(clone);\r\n return clone;\r\n };\r\n /**\r\n * Creates an exact clone of the list, including its items and template.\r\n *\r\n * @return New list\r\n */\r\n ListTemplate.prototype.clone = function () {\r\n var out = new ListTemplate(this.template);\r\n var values = this.values;\r\n var length = values.length;\r\n for (var i = 0; i < length; ++i) {\r\n out.push(values[i].clone());\r\n }\r\n return out;\r\n };\r\n return ListTemplate;\r\n}(List));\r\nexport { ListTemplate };\r\n","import { __read, __spread } from \"tslib\";\r\nimport { options } from \"../Options\";\r\n/**\r\n * Outputs string to console if `verbose` is `true`.\r\n */\r\nexport function log() {\r\n var messages = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n messages[_i] = arguments[_i];\r\n }\r\n if (options.verbose) {\r\n if (console) {\r\n console.log.apply(console, __spread(messages));\r\n }\r\n }\r\n}\r\n/**\r\n * Outputs a warning to the console.\r\n */\r\nexport function warn() {\r\n var messages = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n messages[_i] = arguments[_i];\r\n }\r\n if (!options.suppressWarnings) {\r\n if (console) {\r\n console.warn.apply(console, __spread(messages));\r\n }\r\n }\r\n}\r\n","/**\r\n * A collection of Math-related functions\r\n *\r\n * @todo Comment trigonometric functions?\r\n */\r\nimport * as $type from \"./Type\";\r\n/**\r\n * ============================================================================\r\n * CONSTANTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nexport var PI = Math.PI;\r\nexport var HALFPI = PI / 2;\r\nexport var RADIANS = PI / 180;\r\nexport var DEGREES = 180 / PI;\r\n/**\r\n * Converts any value and fits it into a specific value range.\r\n *\r\n * @param value Source value\r\n * @param min Minimum allowable value\r\n * @param max Maximum allowable value\r\n * @return Number\r\n */\r\nexport function toNumberRange(value, min, max) {\r\n if ($type.hasValue(value)) {\r\n value = $type.toNumber(value);\r\n return fitToRange(value, min, max);\r\n }\r\n return value;\r\n}\r\n/**\r\n * Rounds the numeric value to whole number or specific precision of set.\r\n *\r\n * @param value Value\r\n * @param precision Precision (number of decimal points)\r\n * @param floor In case value ends with 0.5 and precision is 0, we might need to floor the value instead of ceiling it.\r\n * @return Rounded value\r\n */\r\nexport function round(value, precision, floor) {\r\n if (!$type.isNumber(precision) || precision <= 0) {\r\n var rounded = Math.round(value);\r\n if (floor) {\r\n if (rounded - value == 0.5) {\r\n rounded--;\r\n }\r\n }\r\n return rounded;\r\n }\r\n else {\r\n var d = Math.pow(10, precision);\r\n return Math.round(value * d) / d;\r\n }\r\n}\r\n/**\r\n * Ceils the numeric value to whole number or specific precision of set.\r\n *\r\n * @param value Value\r\n * @param precision Precision (number of decimal points)\r\n * @return Rounded value\r\n */\r\nexport function ceil(value, precision) {\r\n if (!$type.isNumber(precision) || precision <= 0) {\r\n return Math.ceil(value);\r\n }\r\n else {\r\n var d = Math.pow(10, precision);\r\n return Math.ceil(value * d) / d;\r\n }\r\n}\r\n/**\r\n * Stretches `t` so that it will always be between `from` and `to`.\r\n *\r\n * @param t Number from 0 to 1\r\n * @param from Lowest possible value\r\n * @param to Highest possible value\r\n * @return Adjusted value\r\n */\r\nexport function stretch(t, from, to) {\r\n return (t * (to - from)) + from;\r\n}\r\n/**\r\n * Adjust numeric value so it fits to specific value range.\r\n *\r\n * @param value Value\r\n * @param minValue Lowest possible value\r\n * @param maxValue Highest possible value\r\n * @return Adjusted value\r\n */\r\nexport function fitToRange(value, minValue, maxValue) {\r\n if ($type.isNumber(minValue)) {\r\n if ($type.isNumber(maxValue) && maxValue < minValue) {\r\n var temp = maxValue;\r\n maxValue = minValue;\r\n minValue = temp;\r\n }\r\n if (value < minValue) {\r\n value = minValue;\r\n }\r\n }\r\n if ($type.isNumber(maxValue)) {\r\n if (value > maxValue) {\r\n value = maxValue;\r\n }\r\n }\r\n return value;\r\n}\r\n/**\r\n * Returns sine of a number.\r\n *\r\n * @param value Value\r\n * @return Sine\r\n */\r\nexport function sin(value) {\r\n return round(Math.sin(RADIANS * value), 10);\r\n}\r\n/**\r\n * Returns tan of a number.\r\n *\r\n * @param value Value\r\n * @return Sine\r\n */\r\nexport function tan(value) {\r\n return round(Math.tan(RADIANS * value), 10);\r\n}\r\n/**\r\n * Returns cosine of a number.\r\n *\r\n * @param value Value\r\n * @return Cosine\r\n */\r\nexport function cos(value) {\r\n return round(Math.cos(RADIANS * value), 10);\r\n}\r\nexport function max(left, right) {\r\n if ($type.isNumber(left)) {\r\n if ($type.isNumber(right)) {\r\n if (right > left) {\r\n return right;\r\n }\r\n else {\r\n return left;\r\n }\r\n }\r\n else {\r\n return left;\r\n }\r\n }\r\n else if ($type.isNumber(right)) {\r\n return right;\r\n }\r\n else {\r\n return null;\r\n }\r\n}\r\nexport function min(left, right) {\r\n if ($type.isNumber(left)) {\r\n if ($type.isNumber(right)) {\r\n if (right < left) {\r\n return right;\r\n }\r\n else {\r\n return left;\r\n }\r\n }\r\n else {\r\n return left;\r\n }\r\n }\r\n else if ($type.isNumber(right)) {\r\n return right;\r\n }\r\n else {\r\n return null;\r\n }\r\n}\r\n/**\r\n * Returns the closest value from the array of values to the reference value.\r\n *\r\n * @param values Array of values\r\n * @param value Reference value\r\n * @return Closes value from the array\r\n */\r\nexport function closest(values, referenceValue) {\r\n return values.reduce(function (prev, curr) {\r\n return (Math.abs(curr - referenceValue) < Math.abs(prev - referenceValue) ? curr : prev);\r\n });\r\n}\r\n/**\r\n * Checks whether two ranges of values intersect.\r\n *\r\n * @param range1 Range 1\r\n * @param range2 Range 2\r\n * @return Any intersecting numbers?\r\n */\r\nexport function intersect(range1, range2) {\r\n var start1 = $type.getValue(range1.start);\r\n var start2 = $type.getValue(range2.start);\r\n var end1 = $type.getValue(range1.end);\r\n var end2 = $type.getValue(range2.end);\r\n return Math.max(start1, start2) <= Math.min(end1, end2);\r\n}\r\n/**\r\n * Inverts the range of values.\r\n *\r\n * @param range Range\r\n */\r\nexport function invertRange(range) {\r\n var start = $type.getValue(range.start);\r\n var end = $type.getValue(range.end);\r\n return { start: 1 - end, end: 1 - start };\r\n}\r\n/**\r\n * Returns an intersection range between two ranges of values.\r\n *\r\n * @param range1 Range 1\r\n * @param range2 Range 2\r\n * @return Intersecting value range\r\n */\r\nexport function intersection(range1, range2) {\r\n var start1 = $type.getValue(range1.start);\r\n var start2 = $type.getValue(range2.start);\r\n var end1 = $type.getValue(range1.end);\r\n var end2 = $type.getValue(range2.end);\r\n var startMax = Math.max(start1, start2);\r\n var endMin = Math.min(end1, end2);\r\n if (endMin < startMax) {\r\n return undefined;\r\n }\r\n else {\r\n return { start: startMax, end: endMin };\r\n }\r\n}\r\n/**\r\n * Returns pixel \"distance\" between two points.\r\n *\r\n * If second point is not specified, distance from {x:0, y:0} point is\r\n * calculated.\r\n *\r\n * @param point1 Point 1\r\n * @param point2 Point 2\r\n * @return Distance in relative pixels\r\n */\r\nexport function getDistance(point1, point2) {\r\n if (!point1) {\r\n return 0;\r\n }\r\n if (!point2) {\r\n point2 = { x: 0, y: 0 };\r\n }\r\n return Math.sqrt(Math.pow(Math.abs(point1.x - point2.x), 2) + Math.pow(Math.abs(point1.y - point2.y), 2));\r\n}\r\n/**\r\n * Returns pixel \"horizontal distance\" between two points.\r\n *\r\n * If second point is not specified, distance from {x:0, y:0} point is\r\n * calculated.\r\n *\r\n * @param point1 Point 1\r\n * @param point2 Point 2\r\n * @return Distance in relative pixels\r\n */\r\nexport function getHorizontalDistance(point1, point2) {\r\n if (!point1) {\r\n return 0;\r\n }\r\n if (!point2) {\r\n point2 = { x: 0, y: 0 };\r\n }\r\n return Math.abs(point1.x - point2.x);\r\n}\r\n/**\r\n * Returns pixel \"vertical distance\" between two points.\r\n *\r\n * If second point is not specified, distance from {x:0, y:0} point is\r\n * calculated.\r\n *\r\n * @param point1 Point 1\r\n * @param point2 Point 2\r\n * @return Distance in relative pixels\r\n */\r\nexport function getVerticalDistance(point1, point2) {\r\n if (!point1) {\r\n return 0;\r\n }\r\n if (!point2) {\r\n point2 = { x: 0, y: 0 };\r\n }\r\n return Math.abs(point1.y - point2.y);\r\n}\r\n/**\r\n * Returns approximate pixel \"distance\" between two points of cubic curve\r\n *\r\n * If second point is not specified, distance from {x:0, y:0} point is\r\n * calculated.\r\n *\r\n * @param point1 Point 1\r\n * @param point2 Point 2\r\n * @param controlPointA Control Point 1\r\n * @param controlPointB Control Point 2\r\n * @param stepCount number of steps (the more, the more accurate result)\r\n * @return Distance in relative pixels\r\n */\r\nexport function getCubicCurveDistance(point1, point2, controlPointA, controlPointB, stepCount) {\r\n if (!point1) {\r\n return 0;\r\n }\r\n if (!point2) {\r\n point2 = { x: 0, y: 0 };\r\n }\r\n var distance = 0;\r\n var prevPoint = point1;\r\n if (stepCount > 0) {\r\n for (var s = 0; s <= stepCount; s++) {\r\n var point = getPointOnCubicCurve(point1, point2, controlPointA, controlPointB, s / stepCount);\r\n distance += getDistance(prevPoint, point);\r\n prevPoint = point;\r\n }\r\n }\r\n return distance;\r\n}\r\n/**\r\n * Returns scale based on original and end position of the two points.\r\n *\r\n * @param point1 Current position of point 1\r\n * @param startPoint1 Start position of point 1\r\n * @param point2 Current position of point 1\r\n * @param startPoint2 Start position of point 2\r\n * @return Scale Calculated scale\r\n */\r\nexport function getScale(point1, startPoint1, point2, startPoint2) {\r\n var initialDistance = getDistance(startPoint1, startPoint2);\r\n var currentDistance = getDistance(point1, point2);\r\n return Math.abs(currentDistance / initialDistance);\r\n}\r\n/**\r\n * Returns an exact mid point between two points.\r\n *\r\n * @param point1 Position of point 1\r\n * @param point2 Position of point 2\r\n * @return Mid point Position of mid-point\r\n */\r\nexport function getMidPoint(point1, point2, position) {\r\n if (!$type.isNumber(position)) {\r\n position = 0.5;\r\n }\r\n return {\r\n \"x\": (point1.x + (point2.x - point1.x) * position),\r\n \"y\": (point1.y + (point2.y - point1.y) * position)\r\n };\r\n}\r\n/**\r\n * Returns difference in angles between starting and ending position of two\r\n * vectors.\r\n *\r\n * @param point1 Current position of point 1\r\n * @param startPoint1 Start position of point 1\r\n * @param point2 Current position of point 1\r\n * @param startPoint2 Start position of point 2\r\n * @return Angle difference in degrees\r\n */\r\nexport function getRotation(point1, startPoint1, point2, startPoint2) {\r\n // Get start and end angles\r\n var startAngle = getAngle(startPoint1, startPoint2);\r\n var angle = getAngle(point1, point2);\r\n // Calculate angle\r\n var diff = startAngle - angle;\r\n if (diff < 0) {\r\n diff += 360;\r\n }\r\n return diff;\r\n}\r\n/**\r\n * Calculates angle of the vector based on two or one point.\r\n *\r\n * @param point1 Point 1\r\n * @param point2 Point 2\r\n * @return Angle in degrees\r\n */\r\nexport function getAngle(point1, point2) {\r\n if (!point2) {\r\n point2 = { x: point1.x * 2, y: point1.y * 2 };\r\n }\r\n var diffX = point2.x - point1.x;\r\n var diffY = point2.y - point1.y;\r\n var angle = Math.atan2(diffY, diffX) * DEGREES;\r\n if (angle < 0) {\r\n angle += 360;\r\n }\r\n return normalizeAngle(angle);\r\n}\r\n/**\r\n * Returns the shift in coordinates of the center when item is rotated, moved\r\n * and scaled at the same time.\r\n *\r\n * @param center Current center\r\n * @param point1 Frst reference point\r\n * @param startPoint1 Original position of the first reference point\r\n * @param point2 Second reference point\r\n * @param startPoint2 Original position of the first reference point\r\n * @return Shift in center point coordinates\r\n */\r\nexport function getCenterShift(center, point1, startPoint1, point2, startPoint2) {\r\n // Get angle\r\n var angle = getRotation(point1, startPoint1, point2, startPoint2) - 90;\r\n if (angle < 0) {\r\n angle += 360;\r\n }\r\n // Get distance between new position\r\n var distance = getDistance(point1, point2);\r\n // Calculate new X\r\n var x = Math.cos(angle) / distance + point1.x;\r\n var y = Math.cos(angle) / distance + point1.y;\r\n var shift = {\r\n \"x\": x - center.x,\r\n \"y\": y - center.y\r\n };\r\n return shift;\r\n}\r\n/**\r\n * Converts an array of points into a bounding box rectangle.\r\n *\r\n * Array can contain any number of points.\r\n *\r\n * @param points Points\r\n * @return Bounding box rectangle\r\n */\r\nexport function getBBox(points) {\r\n if (points) {\r\n var length_1 = points.length;\r\n if (length_1 !== 0) {\r\n var left = void 0;\r\n var right = void 0;\r\n var top_1;\r\n var bottom = void 0;\r\n for (var i = 0; i < length_1; i++) {\r\n var point = points[i];\r\n if (!$type.isNumber(right) || (point.x > right)) {\r\n right = point.x;\r\n }\r\n if (!$type.isNumber(left) || (point.x < left)) {\r\n left = point.x;\r\n }\r\n if (!$type.isNumber(top_1) || (point.y < top_1)) {\r\n top_1 = point.y;\r\n }\r\n if (!$type.isNumber(bottom) || (point.y > bottom)) {\r\n bottom = point.y;\r\n }\r\n }\r\n return { x: left, y: top_1, width: right - left, height: bottom - top_1 };\r\n }\r\n }\r\n return { x: 0, y: 0, width: 0, height: 0 };\r\n}\r\n/**\r\n * Returns a [[IRectangle]] object representing a common rectangle that fits\r\n * all passed in rectangles in it.\r\n *\r\n * @param rectangles An array of rectangles\r\n * @return Common rectangle\r\n */\r\nexport function getCommonRectangle(rectangles) {\r\n var length = rectangles.length;\r\n if (length !== 0) {\r\n var minX = void 0;\r\n var minY = void 0;\r\n var maxX = void 0;\r\n var maxY = void 0;\r\n for (var i = 0; i < length; i++) {\r\n var rectangle = rectangles[i];\r\n minX = min(rectangle.x, minX);\r\n minY = min(rectangle.y, minY);\r\n maxX = max(rectangle.x + rectangle.width, maxX);\r\n maxY = max(rectangle.y + rectangle.height, maxY);\r\n }\r\n return { x: minX, y: minY, width: maxX - minX, height: maxY - minY };\r\n }\r\n}\r\n/**\r\n * [getPointOnQuadraticCurve description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param pointA [description]\r\n * @param pointB [description]\r\n * @param controlPoint [description]\r\n * @param position [description]\r\n * @return [description]\r\n */\r\nexport function getPointOnQuadraticCurve(pointA, pointB, controlPoint, position) {\r\n var x = (1 - position) * (1 - position) * pointA.x + 2 * (1 - position) * position * controlPoint.x + position * position * pointB.x;\r\n var y = (1 - position) * (1 - position) * pointA.y + 2 * (1 - position) * position * controlPoint.y + position * position * pointB.y;\r\n return { x: x, y: y };\r\n}\r\n/**\r\n * [getPointOnCubicCurve description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param pointA [description]\r\n * @param pointB [description]\r\n * @param controlPointA [description]\r\n * @param controlPointB [description]\r\n * @param position [description]\r\n * @return [description]\r\n */\r\nexport function getPointOnCubicCurve(pointA, pointB, controlPointA, controlPointB, position) {\r\n var point = { x: 0, y: 0 };\r\n var mt1 = 1 - position;\r\n var mt2 = mt1 * mt1;\r\n var mt3 = mt2 * mt1;\r\n point.x = pointA.x * mt3 + controlPointA.x * 3 * mt2 * position + controlPointB.x * 3 * mt1 * position * position + pointB.x * position * position * position;\r\n point.y = pointA.y * mt3 + controlPointA.y * 3 * mt2 * position + controlPointB.y * 3 * mt1 * position * position + pointB.y * position * position * position;\r\n return point;\r\n}\r\n/**\r\n * [getCubicControlPointA description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param p0 [description]\r\n * @param p1 [description]\r\n * @param p2 [description]\r\n * @param p3 [description]\r\n * @param tensionX [description]\r\n * @param tensionY [description]\r\n * @return [description]\r\n */\r\nexport function getCubicControlPointA(p0, p1, p2, p3, tensionX, tensionY) {\r\n tensionX = adjustTension(tensionX);\r\n tensionY = adjustTension(tensionY);\r\n return { x: ((-p0.x + p1.x / tensionX + p2.x) * tensionX), y: ((-p0.y + p1.y / tensionY + p2.y) * tensionY) };\r\n}\r\n/**\r\n * [getCubicControlPointB description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param p0 [description]\r\n * @param p1 [description]\r\n * @param p2 [description]\r\n * @param p3 [description]\r\n * @param tensionX [description]\r\n * @param tensionY [description]\r\n * @return [description]\r\n */\r\nexport function getCubicControlPointB(p0, p1, p2, p3, tensionX, tensionY) {\r\n tensionX = adjustTension(tensionX);\r\n tensionY = adjustTension(tensionY);\r\n return { x: ((p1.x + p2.x / tensionX - p3.x) * tensionX), y: ((p1.y + p2.y / tensionY - p3.y) * tensionY) };\r\n}\r\n/**\r\n * [adjustTension description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param tension [description]\r\n * @return [description]\r\n */\r\nexport function adjustTension(tension) {\r\n return 1 - tension + 0.00001;\r\n}\r\n/**\r\n * [normalizeAngle description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param value [description]\r\n * @return [description]\r\n */\r\nexport function normalizeAngle(value) {\r\n if (value == 360) {\r\n return 360;\r\n }\r\n return value % 360;\r\n}\r\n/**\r\n * [normalizeAngleToRange description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @todo review this with various angles, can be tested on radar chart with custom start/end angles\r\n * @param value [description]\r\n * @param startAngle [description]\r\n * @param endAngle [description]\r\n * @return [description]\r\n */\r\nexport function fitAngleToRange(value, startAngle, endAngle) {\r\n if (startAngle > endAngle) {\r\n var temp = startAngle;\r\n startAngle = endAngle;\r\n endAngle = temp;\r\n }\r\n value = normalizeAngle(value);\r\n var count = (startAngle - normalizeAngle(startAngle)) / 360;\r\n if (value < startAngle) {\r\n value += 360 * (count + 1);\r\n }\r\n var maxEnd = startAngle + (endAngle - startAngle) / 2 + 180;\r\n var maxStart = startAngle + (endAngle - startAngle) / 2 - 180;\r\n if (value > endAngle) {\r\n if (value - 360 > startAngle) {\r\n value -= 360;\r\n }\r\n else {\r\n if (value < maxEnd) {\r\n value = endAngle;\r\n }\r\n else {\r\n value = startAngle;\r\n }\r\n }\r\n }\r\n if (value < startAngle) {\r\n if (value > maxStart) {\r\n value = startAngle;\r\n }\r\n else {\r\n value = endAngle;\r\n }\r\n }\r\n return value;\r\n}\r\n/**\r\n * Returns [[IRectangle]] of an arc in relative values, assuming that the\r\n * center is at the circle center.\r\n *\r\n * Used to find out max radius of an arc.\r\n *\r\n * @ignore Exclude from docs\r\n * @param startAngle Start angle\r\n * @param endAngle End angle\r\n * @param radius \t Relative radius\r\n * @return Rectangle\r\n */\r\nexport function getArcRect(startAngle, endAngle, radius) {\r\n var minX = Number.MAX_VALUE;\r\n var minY = Number.MAX_VALUE;\r\n var maxX = -Number.MAX_VALUE;\r\n var maxY = -Number.MAX_VALUE;\r\n var bpoints = [];\r\n if (!$type.isNumber(radius)) {\r\n radius = 1;\r\n }\r\n bpoints.push(getArcPoint(radius, startAngle));\r\n bpoints.push(getArcPoint(radius, endAngle));\r\n var fromAngle = Math.min(Math.floor(startAngle / 90) * 90, Math.floor(endAngle / 90) * 90);\r\n var toAngle = Math.max(Math.ceil(startAngle / 90) * 90, Math.ceil(endAngle / 90) * 90);\r\n for (var angle = fromAngle; angle <= toAngle; angle += 90) {\r\n if (angle >= startAngle && angle <= endAngle) {\r\n bpoints.push(getArcPoint(radius, angle));\r\n }\r\n }\r\n for (var i = 0; i < bpoints.length; i++) {\r\n var pt = bpoints[i];\r\n if (pt.x < minX) {\r\n minX = pt.x;\r\n }\r\n if (pt.y < minY) {\r\n minY = pt.y;\r\n }\r\n if (pt.x > maxX) {\r\n maxX = pt.x;\r\n }\r\n if (pt.y > maxY) {\r\n maxY = pt.y;\r\n }\r\n }\r\n return ({ x: minX, y: minY, width: maxX - minX, height: maxY - minY });\r\n}\r\n/**\r\n * Returns point on arc\r\n *\r\n * @param center point\r\n * @param radius\r\n * @param arc\r\n * @return {boolean}\r\n */\r\nexport function getArcPoint(radius, arc) {\r\n return ({ x: radius * cos(arc), y: radius * sin(arc) });\r\n}\r\n/**\r\n * Returns true if a point is within rectangle\r\n *\r\n * @param point\r\n * @param rectangle\r\n * @return {boolean}\r\n */\r\nexport function isInRectangle(point, rectangle) {\r\n if (point.x >= rectangle.x && point.x <= rectangle.x + rectangle.width && point.y > rectangle.y && point.y < rectangle.y + rectangle.height) {\r\n return true;\r\n }\r\n return false;\r\n}\r\nexport function getLineIntersection(pointA1, pointA2, pointB1, pointB2) {\r\n var x = ((pointA1.x * pointA2.y - pointA2.x * pointA1.y) * (pointB1.x - pointB2.x) - (pointA1.x - pointA2.x) * (pointB1.x * pointB2.y - pointB1.y * pointB2.x)) / ((pointA1.x - pointA2.x) * (pointB1.y - pointB2.y) - (pointA1.y - pointA2.y) * (pointB1.x - pointB2.x));\r\n var y = ((pointA1.x * pointA2.y - pointA2.x * pointA1.y) * (pointB1.y - pointB2.y) - (pointA1.y - pointA2.y) * (pointB1.x * pointB2.y - pointB1.y * pointB2.x)) / ((pointA1.x - pointA2.x) * (pointB1.y - pointB2.y) - (pointA1.y - pointA2.y) * (pointB1.x - pointB2.x));\r\n return { x: x, y: y };\r\n}\r\n","/**\r\n * Morpher module contains functionality that allows morphing one polygon to\r\n * another.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { BaseObject } from \"../Base\";\r\nimport { Animation, AnimationDisposer } from \"../utils/Animation\";\r\nimport * as $math from \"../utils/Math\";\r\nimport * as $ease from \"../utils/Ease\";\r\nimport * as $type from \"../utils/Type\";\r\n/**\r\n * Morpher can be used to morph one polygon to some other polygon.\r\n */\r\nvar Morpher = /** @class */ (function (_super) {\r\n __extends(Morpher, _super);\r\n /**\r\n * Constructor.\r\n *\r\n * @param morphable An object to morph\r\n */\r\n function Morpher(morphable) {\r\n var _this = _super.call(this) || this;\r\n /**\r\n * A storage for measurements.\r\n */\r\n _this._bboxes = [];\r\n /**\r\n * Duration of the morphing animation in milliseconds.\r\n */\r\n _this.morphDuration = 800;\r\n /**\r\n * An easing function to use for morphing animation.\r\n *\r\n * @see {@link Ease}\r\n */\r\n _this.morphEasing = $ease.cubicOut;\r\n /**\r\n * If set to `true`, all separate parts of the multi-part polygon will\r\n * morph into a single circle or polygon when using built-in methods\r\n * `morphToCircle()` or `morphToPolygon()`.\r\n *\r\n * Otherwise each separate part of polygon will morph to individual target\r\n * circle or polgyon.\r\n */\r\n _this.morphToSingle = true;\r\n /**\r\n * A ratio to scale morphed object in relation to the source object.\r\n */\r\n _this.scaleRatio = 1;\r\n _this.className = \"Morpher\";\r\n _this.morphable = morphable;\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n /**\r\n * Morphs a polygon to another polygon.\r\n *\r\n * @param toPoints Corner points of the target shape\r\n * @param duration Duration in milliseconds\r\n * @param easing Easing function\r\n * @return Animation\r\n */\r\n Morpher.prototype.morphToPolygon = function (toPoints, duration, easing) {\r\n var points = this.morphable.currentPoints;\r\n if (points && toPoints) {\r\n this.sortPoints(points);\r\n this.sortPoints(toPoints);\r\n this._morphFromPointsReal = [];\r\n this._morphToPointsReal = [];\r\n if (!$type.hasValue(duration)) {\r\n duration = this.morphDuration;\r\n }\r\n if (!$type.hasValue(easing)) {\r\n easing = this.morphEasing;\r\n }\r\n this._morphFromPointsReal = this.normalizePoints(toPoints, points);\r\n this._morphToPointsReal = this.normalizePoints(points, toPoints);\r\n this.morphable.currentPoints = this._morphFromPointsReal;\r\n var animation = new Animation(this, { property: \"morphProgress\", from: 0, to: 1 }, duration, easing);\r\n this._disposers.push(animation);\r\n animation.start();\r\n return animation;\r\n }\r\n };\r\n /**\r\n * [normalizePoints description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param pointsA Point A\r\n * @param pointsB Point B\r\n * @return Normalized points\r\n */\r\n Morpher.prototype.normalizePoints = function (pointsA, pointsB) {\r\n for (var i = 0, len = pointsA.length; i < len; i++) {\r\n var surfaceA = pointsA[i][0];\r\n var holeA = pointsA[i][1];\r\n var bboxA = $type.getValue($math.getBBox(surfaceA));\r\n var middleX = bboxA.x + bboxA.width;\r\n var middleY = bboxA.y + bboxA.height;\r\n // check if we have the same in PointsB\r\n if (!pointsB[i]) {\r\n pointsB[i] = [];\r\n }\r\n // check if we have surface in pointsB\r\n if (surfaceA && !pointsB[i][0]) {\r\n pointsB[i][0] = [{ x: middleX, y: middleY }, { x: middleX, y: middleY }];\r\n }\r\n if (pointsB[i][0]) {\r\n pointsB[i][0] = this.addPoints(pointsB[i][0], surfaceA.length);\r\n var distance = Infinity;\r\n var splitAt = 0;\r\n for (var a = 0; a < pointsB[i][0].length; a++) {\r\n var newDistance = $math.getDistance(pointsB[i][0][a], surfaceA[0]);\r\n if (newDistance < distance) {\r\n splitAt = a;\r\n distance = newDistance;\r\n }\r\n }\r\n var partA = pointsB[i][0].slice(0, splitAt);\r\n var partB = pointsB[i][0].slice(splitAt);\r\n pointsB[i][0] = partB.concat(partA);\r\n }\r\n if (holeA) {\r\n if (!pointsB[i][1]) {\r\n pointsB[i][1] = [{ x: middleX, y: middleY }, { x: middleX, y: middleY }];\r\n }\r\n pointsB[i][1] = this.addPoints(pointsB[i][1], holeA.length);\r\n }\r\n }\r\n return pointsB;\r\n };\r\n /**\r\n * [sortPoints description]\r\n *\r\n * @ignore Exclude from doc\r\n * @todo Description\r\n * @param points [description]\r\n * @return common bbox of points\r\n */\r\n Morpher.prototype.sortPoints = function (points) {\r\n points.sort(function (a, b) {\r\n var bbox1 = $type.getValue($math.getBBox(a[0]));\r\n var bbox2 = $type.getValue($math.getBBox(b[0]));\r\n if (bbox1.width * bbox1.height > bbox2.width * bbox2.height) {\r\n return -1;\r\n }\r\n else {\r\n return 1;\r\n }\r\n });\r\n var bboxes = [];\r\n for (var i = 0, len = points.length; i < len; i++) {\r\n var surface = points[i][0];\r\n if (surface) {\r\n bboxes.push($type.getValue($math.getBBox(surface)));\r\n }\r\n }\r\n return $math.getCommonRectangle(bboxes);\r\n };\r\n /**\r\n * Morphs polygon to a circle (it is actually a polygon which makes a circle).\r\n *\r\n * @param radius Target circle radius (px)\r\n * @param duration Duration (ms)\r\n * @param easing Easing function\r\n * @return Animation\r\n */\r\n Morpher.prototype.morphToCircle = function (radius, duration, easing) {\r\n var points = this.morphable.points;\r\n var commonBBox = this.sortPoints(points);\r\n this._morphFromPointsReal = [];\r\n this._morphToPointsReal = [];\r\n if (!$type.hasValue(duration)) {\r\n duration = this.morphDuration;\r\n }\r\n if (!$type.hasValue(easing)) {\r\n easing = this.morphEasing;\r\n }\r\n // surface\r\n for (var i = 0, len = points.length; i < len; i++) {\r\n var surface = points[i][0];\r\n var hole = points[i][1];\r\n this._morphFromPointsReal[i] = [];\r\n this._morphToPointsReal[i] = [];\r\n if (surface) {\r\n var toPoints = surface;\r\n var fromPoints = surface;\r\n var bbox = $type.getValue($math.getBBox(fromPoints)); // this._bboxes[i];\r\n if (this.morphToSingle) {\r\n bbox = $type.getValue(commonBBox);\r\n }\r\n var middleX = bbox.x + bbox.width / 2;\r\n var middleY = bbox.y + bbox.height / 2;\r\n var realRadius = radius;\r\n if (!$type.isNumber(realRadius)) {\r\n realRadius = Math.min(bbox.width / 2, bbox.height / 2);\r\n }\r\n toPoints = [];\r\n // find angle for the first point\r\n var startAngle = $math.getAngle({ x: middleX, y: middleY }, surface[0]);\r\n var count = 100;\r\n if (surface.length > count) {\r\n count = surface.length;\r\n }\r\n fromPoints = this.addPoints(surface, count);\r\n count = fromPoints.length; // add Points might increase number a bit\r\n var angle = 360 / (count - 1);\r\n for (var a = 0; a < count; a++) {\r\n var realAngle = angle * a + startAngle;\r\n var pointOnCircle = { x: middleX + realRadius * $math.cos(realAngle), y: middleY + realRadius * $math.sin(realAngle) };\r\n toPoints[a] = pointOnCircle;\r\n }\r\n if (hole && hole.length > 0) {\r\n for (var i_1 = 0, hlen = hole.length; i_1 < hlen; i_1++) {\r\n toPoints.push({ x: middleX, y: middleY });\r\n }\r\n }\r\n this._morphFromPointsReal[i][0] = fromPoints;\r\n this._morphToPointsReal[i][0] = toPoints;\r\n }\r\n }\r\n this.morphable.currentPoints = this._morphFromPointsReal;\r\n var animation = new Animation(this, { property: \"morphProgress\", from: 0, to: 1 }, duration, easing);\r\n this._disposers.push(animation);\r\n animation.start();\r\n return animation;\r\n };\r\n /**\r\n * [addPoints description]\r\n *\r\n * @ignore Exclude from doc\r\n * @todo Description\r\n * @param points [description]\r\n * @param mustHaveCount [description]\r\n * @return [description]\r\n */\r\n Morpher.prototype.addPoints = function (points, mustHaveCount) {\r\n var addToSegmentCount = Math.round(mustHaveCount / points.length);\r\n var newPoints = [];\r\n for (var i = 0, len = points.length; i < len; i++) {\r\n var point0 = points[i];\r\n var point1 = void 0;\r\n if (i == points.length - 1) {\r\n point1 = points[0];\r\n }\r\n else {\r\n point1 = points[i + 1];\r\n }\r\n newPoints.push(point0);\r\n for (var p = 1; p < addToSegmentCount; p++) {\r\n var percent = p / addToSegmentCount;\r\n var extraPoint = { x: point0.x + (point1.x - point0.x) * percent, y: point0.y + (point1.y - point0.y) * percent };\r\n newPoints.push(extraPoint);\r\n }\r\n // stop adding in case we already added more than left in original\r\n if (newPoints.length + points.length - i == mustHaveCount) {\r\n addToSegmentCount = 0;\r\n }\r\n }\r\n if (newPoints.length < mustHaveCount && points.length > 0) {\r\n var lastPoint = points[points.length - 1];\r\n for (var p = newPoints.length; p < mustHaveCount; p++) {\r\n // add same as last\r\n newPoints.push({ x: lastPoint.x, y: lastPoint.y });\r\n }\r\n }\r\n return newPoints;\r\n };\r\n /**\r\n * Morphs polygon into a rectangular polygon.\r\n *\r\n * @param width Width of the target rectangle (px)\r\n * @param height Height of the target rectangle (px)\r\n * @param duration Duration (ms)\r\n * @param easing Easing function\r\n * @return Animation\r\n */\r\n Morpher.prototype.morphToRectangle = function (width, height, duration, easing) {\r\n var points = this.morphable.points;\r\n this.sortPoints(points);\r\n this._morphFromPointsReal = [];\r\n this._morphToPointsReal = [];\r\n if (!$type.hasValue(duration)) {\r\n duration = this.morphDuration;\r\n }\r\n if (!$type.hasValue(easing)) {\r\n easing = this.morphEasing;\r\n }\r\n //\t\tlet biggestBBox: IRectangle = this._bboxes[this._biggestIndex];\r\n // surface\r\n for (var i = 0, len = points.length; i < len; i++) {\r\n var surface = points[i][0];\r\n var hole = points[i][1];\r\n this._morphFromPointsReal[i] = [];\r\n this._morphToPointsReal[i] = [];\r\n if (surface) {\r\n var toPoints = surface;\r\n var fromPoints = surface;\r\n var bbox = this._bboxes[i];\r\n // we only work with first area. TODO: maybe we should find the biggest one?\r\n if (this.morphToSingle) {\r\n //if (i != this._biggestIndex) {\r\n //\tbbox = { x: biggestBBox.x + biggestBBox.width / 2, y: biggestBBox.y + biggestBBox.height / 2, width: 0, height: 0 };\r\n //}\r\n }\r\n var x = bbox.x;\r\n var y = bbox.y;\r\n var realWidth = width;\r\n var realHeight = height;\r\n if (!$type.isNumber(realWidth)) {\r\n realWidth = bbox.width;\r\n }\r\n if (!$type.isNumber(realHeight)) {\r\n realHeight = bbox.height;\r\n }\r\n toPoints = [{ x: x, y: y }, { x: x + realWidth, y: y }, { x: x + realWidth, y: y + realHeight }, { x: x, y: y + realHeight }];\r\n toPoints = this.addPoints(toPoints, surface.length);\r\n // if polygon has less points then count, add\r\n if (surface.length < 4) {\r\n for (var i_2 = surface.length; i_2 < 4; i_2++) {\r\n toPoints.push({ x: surface[i_2].x, y: surface[i_2].y });\r\n }\r\n }\r\n if (hole && hole.length > 0) {\r\n var middleX = bbox.x + bbox.width / 2;\r\n var middleY = bbox.y + bbox.height / 2;\r\n for (var i_3 = 0, hlen = hole.length; i_3 < hlen; i_3++) {\r\n toPoints.push({ x: middleX, y: middleY });\r\n }\r\n }\r\n this._morphFromPointsReal[i][0] = fromPoints;\r\n this._morphToPointsReal[i][0] = toPoints;\r\n }\r\n }\r\n this.morphable.currentPoints = this._morphFromPointsReal;\r\n var animation = new Animation(this, { property: \"morphProgress\", from: 0, to: 1 }, duration, easing);\r\n this._disposers.push(animation);\r\n animation.start();\r\n return animation;\r\n };\r\n Object.defineProperty(Morpher.prototype, \"morphProgress\", {\r\n /**\r\n * Returns the progress of morph transition.\r\n *\r\n * @return Progress (0-1)\r\n */\r\n get: function () {\r\n return this._morphProgress;\r\n },\r\n /**\r\n * Progress of the morph transition.\r\n *\r\n * Setting this will also trigger actual transformation.\r\n *\r\n * @param value Progress (0-1)\r\n */\r\n set: function (value) {\r\n this._morphProgress = value;\r\n var currentPoints = [];\r\n if (value != null) {\r\n var fromPoints = this._morphFromPointsReal;\r\n var toPoints = this._morphToPointsReal;\r\n if (fromPoints != null && toPoints != null) {\r\n for (var i = 0, len = fromPoints.length; i < len; i++) {\r\n var currentArea = [];\r\n currentPoints.push(currentArea);\r\n var surfaceFrom = fromPoints[i][0];\r\n var holeFrom = fromPoints[i][1];\r\n var surfaceTo = toPoints[i][0];\r\n var holeTo = toPoints[i][1];\r\n if (surfaceFrom && surfaceFrom.length > 0 && surfaceTo && surfaceTo.length > 0) {\r\n var currentSurface = [];\r\n for (var i_4 = 0, slen = surfaceFrom.length; i_4 < slen; i_4++) {\r\n var point0 = surfaceFrom[i_4];\r\n var point1 = surfaceTo[i_4];\r\n var currentPoint = { x: point0.x + (point1.x * this.scaleRatio - point0.x) * value, y: point0.y + (point1.y * this.scaleRatio - point0.y) * value };\r\n currentSurface.push(currentPoint);\r\n }\r\n currentArea[0] = currentSurface;\r\n }\r\n if (holeFrom && holeFrom.length > 0 && holeTo && holeTo.length > 0) {\r\n var currentHole = [];\r\n for (var i_5 = 0, hlen = holeFrom.length; i_5 < hlen; i_5++) {\r\n var point0 = holeFrom[i_5];\r\n var point1 = holeTo[i_5];\r\n var currentPoint = { x: point0.x + (point1.x * this.scaleRatio - point0.x) * value, y: point0.y + (point1.y * this.scaleRatio - point0.y) * value };\r\n currentHole.push(currentPoint);\r\n }\r\n currentArea[1] = currentHole;\r\n }\r\n }\r\n }\r\n }\r\n this.morphable.currentPoints = currentPoints;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Restores the polygon to its original appearance.\r\n *\r\n * @param duration Duration (ms)\r\n * @param easing Easing function\r\n * @return Animation\r\n */\r\n Morpher.prototype.morphBack = function (duration, easing) {\r\n this._morphToPointsReal = this._morphFromPointsReal;\r\n this._morphFromPointsReal = this.morphable.currentPoints;\r\n if (!$type.hasValue(duration)) {\r\n duration = this.morphDuration;\r\n }\r\n if (!$type.hasValue(easing)) {\r\n easing = this.morphEasing;\r\n }\r\n var animation = new Animation(this, { property: \"morphProgress\", from: 0, to: 1 }, duration, easing);\r\n this._disposers.push(animation);\r\n animation.start();\r\n return animation;\r\n };\r\n Object.defineProperty(Morpher.prototype, \"animations\", {\r\n /**\r\n * Returns a list of morph animations currently being played.\r\n *\r\n * @return List of animations\r\n */\r\n get: function () {\r\n if (!this._animations) {\r\n this._animations = [];\r\n this._disposers.push(new AnimationDisposer(this._animations));\r\n }\r\n return this._animations;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return Morpher;\r\n}(BaseObject));\r\nexport { Morpher };\r\n","/**\r\n * A collection of network-related functions\r\n */\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport * as $type from \"./Type\";\r\n/**\r\n * Loads an external file via its URL.\r\n *\r\n * Please note that this is an asynchronous function.\r\n *\r\n * It will not return the result, but rather a `Promise`.\r\n *\r\n * You can use the `await` notion, or `then()`.\r\n *\r\n * ```TypeScript\r\n * // Using await\r\n * let response = await Net.load( \"http://www.my.com/data.json\" );\r\n * console.log( response.response );\r\n *\r\n * // Using then()\r\n * Net.load( \"http://www.my.com/data.json\" ).then( ( response ) => {\r\n * console.log( response.response );\r\n * } );\r\n * ```\r\n * ```JavaScript\r\n * // Using then()\r\n * Net.load( \"http://www.my.com/data.json\" ).then( function( response ) {\r\n * console.log( response.response );\r\n * } );\r\n * ```\r\n *\r\n * @async\r\n * @param url URL for the file to load\r\n * @param target A target element that is requesting the net load\r\n * @param options Request options\r\n * @return Result (Promise)\r\n */\r\nexport function load(url, target, options) {\r\n return new Promise(function (success, error) {\r\n // Is return type Blob?\r\n var isBlob = $type.hasValue(options) && options.responseType == \"blob\";\r\n // Create request and set up handlers\r\n var xhr = new XMLHttpRequest();\r\n xhr.onload = function () {\r\n if (xhr.status === 200) {\r\n var response = void 0;\r\n var blob_1;\r\n if (isBlob) {\r\n blob_1 = xhr.response;\r\n readBlob(blob_1).then(function (response) {\r\n var output = {\r\n xhr: xhr,\r\n error: false,\r\n response: response,\r\n blob: blob_1,\r\n type: xhr.getResponseHeader(\"Content-Type\"),\r\n target: target\r\n };\r\n success(output);\r\n });\r\n return;\r\n }\r\n else {\r\n response = xhr.responseText || xhr.response;\r\n }\r\n var output = {\r\n xhr: xhr,\r\n error: false,\r\n response: response,\r\n blob: blob_1,\r\n type: xhr.getResponseHeader(\"Content-Type\"),\r\n target: target\r\n };\r\n success(output);\r\n }\r\n else {\r\n error({\r\n xhr: xhr,\r\n error: true,\r\n type: xhr.getResponseHeader(\"Content-Type\"),\r\n target: target\r\n });\r\n }\r\n };\r\n xhr.onerror = function () {\r\n error({\r\n xhr: xhr,\r\n error: true,\r\n type: xhr.getResponseHeader(\"Content-Type\"),\r\n target: target\r\n });\r\n };\r\n // Open request\r\n xhr.open(\"GET\", url, true);\r\n if (options && options.withCredentials) {\r\n xhr.withCredentials = true;\r\n }\r\n // Process options\r\n if ($type.hasValue(options)) {\r\n if ($type.hasValue(options.requestHeaders)) {\r\n for (var i = 0; i < options.requestHeaders.length; i++) {\r\n var header = options.requestHeaders[i];\r\n xhr.setRequestHeader(header.key, header.value);\r\n }\r\n }\r\n if ($type.hasValue(options.responseType)) {\r\n xhr.responseType = options.responseType;\r\n }\r\n }\r\n // Send request\r\n xhr.send();\r\n });\r\n}\r\n/**\r\n * Returns textual representation of a Blob object.\r\n *\r\n * @param blob Target blob\r\n * @return Text promise\r\n */\r\nexport function readBlob(blob) {\r\n return new Promise(function (success, error) {\r\n var reader = new FileReader();\r\n reader.onload = function (event) {\r\n success(reader.result);\r\n };\r\n reader.onerror = function (e) {\r\n error(e);\r\n };\r\n reader.readAsText(blob);\r\n });\r\n}\r\n","/**\r\n * ============================================================================\r\n * COMPARING FUNCTIONS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Comparing function used for ordering.\r\n *\r\n * @ignore Exclude from docs\r\n * @param a Number 1\r\n * @param b Number 2\r\n * @return Result\r\n */\r\nexport function order(a, b) {\r\n if (a === b) {\r\n return 0;\r\n }\r\n else if (a < b) {\r\n return -1;\r\n }\r\n else {\r\n return 1;\r\n }\r\n}\r\n","/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport * as $array from \"./Array\";\r\nimport * as $type from \"./Type\";\r\n/**\r\n * ============================================================================\r\n * UTILITY FUNCTIONS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Returns an iterator for all entries in object.\r\n *\r\n * Can be used to safely iterate through all properties of the object.\r\n *\r\n * @param object Source object\r\n * @returns Iterator\r\n */\r\nexport function entries(object) {\r\n return function (push) {\r\n // TODO make this more efficient ?\r\n for (var key in object) {\r\n if (hasKey(object, key)) {\r\n if (!push([key, object[key]])) {\r\n break;\r\n }\r\n }\r\n }\r\n };\r\n}\r\n/**\r\n * Returns an array of object's property names.\r\n *\r\n * @param object Source object\r\n * @returns Object property names\r\n */\r\nexport function keys(object) {\r\n var output = [];\r\n for (var key in object) {\r\n if (hasKey(object, key)) {\r\n output.push(key);\r\n }\r\n }\r\n return output;\r\n}\r\n/**\r\n * Returns an array of object's property names ordered using specific ordering\r\n * function.\r\n *\r\n * @param object Source object\r\n * @param order Ordering function\r\n * @returns Object property names\r\n */\r\nexport function keysOrdered(object, order) {\r\n return keys(object).sort(order);\r\n}\r\n/**\r\n * Checks if `object` has a specific `key`.\r\n *\r\n * @param object Source object\r\n * @param key Property name\r\n * @returns Has key?\r\n */\r\nexport function hasKey(object, key) {\r\n return {}.hasOwnProperty.call(object, key);\r\n}\r\n/**\r\n * Returns value of the specific `key`.\r\n *\r\n * @param object Source object\r\n * @param key Property name\r\n * @returns Key value\r\n */\r\nexport function getKey(object, key) {\r\n return object[key];\r\n}\r\n/**\r\n * Iterates through all properties of the object calling `fn` for each of them.\r\n *\r\n * If return value of the function evaluates to `false` further iteration is\r\n * cancelled.\r\n *\r\n * @param object Source object\r\n * @param fn Callback function\r\n */\r\nexport function eachContinue(object, fn) {\r\n for (var key in object) {\r\n if (hasKey(object, key)) {\r\n if (!fn(key, object[key])) {\r\n break;\r\n }\r\n }\r\n }\r\n}\r\n/**\r\n * Iterates through all properties of the object calling `fn` for each of them.\r\n *\r\n * @param object Source object\r\n * @param fn Callback function\r\n */\r\nexport function each(object, fn) {\r\n eachContinue(object, function (key, value) {\r\n fn(key, value);\r\n return true;\r\n });\r\n}\r\n/**\r\n * Orders object properties using custom `ord` function and iterates through\r\n * them calling `fn` for each of them.\r\n *\r\n * @param object Source object\r\n * @param fn Callback function\r\n * @param order Ordering function\r\n */\r\nexport function eachOrdered(object, fn, ord) {\r\n $array.each(keysOrdered(object, ord), function (key) {\r\n fn(key, object[key]);\r\n });\r\n}\r\n/**\r\n * Returns a copy of the object.\r\n *\r\n * @param object Source object\r\n * @returns Copy of the object\r\n */\r\nexport function copy(object) {\r\n return Object.assign({}, object);\r\n}\r\n/**\r\n * Merges two objects and returns a new object that contains properties from\r\n * both source objects.\r\n *\r\n * @param object1 Source object #1\r\n * @param object2 Source object #2\r\n * @returns Combined object\r\n */\r\nexport function merge(object1, object2) {\r\n return Object.assign({}, object1, object2);\r\n}\r\n/**\r\n * Returns object clone.\r\n *\r\n * @param object Source object\r\n * @returns Clone\r\n */\r\nexport function clone(object) {\r\n return JSON.parse(JSON.stringify(object));\r\n}\r\n/**\r\n * Copies a list of properties from one object to another.\r\n *\r\n * Will not copy empty properties.\r\n *\r\n * @param source Source object\r\n * @param target Target object\r\n * @param keys List of keys to copy\r\n */\r\nexport function copyProperties(source, target, keys) {\r\n $array.each(keys, function (key) {\r\n if ($type.hasValue(source[key])) {\r\n target[key] = source[key];\r\n }\r\n });\r\n}\r\n/**\r\n * Copies a list of properties from one object to another only if target does't have value of the property set.\r\n *\r\n * Will not copy empty properties.\r\n *\r\n * @param source Source object\r\n * @param target Target object\r\n * @param keys List of keys to copy\r\n */\r\nexport function softCopyProperties(source, target, keys) {\r\n $array.each(keys, function (key) {\r\n if ($type.hasValue(source[key]) && !($type.hasValue(target[key]))) {\r\n target[key] = source[key];\r\n }\r\n });\r\n}\r\n/**\r\n * Copies a list of properties from one object to another.\r\n *\r\n * Will copy empty properties.\r\n *\r\n * @param source Source object\r\n * @param target Target object\r\n * @param keys List of keys to copy\r\n */\r\nexport function forceCopyProperties(source, target, keys) {\r\n $array.each(keys, function (key) {\r\n target[key] = source[key];\r\n });\r\n}\r\n/**\r\n * Copies all properties from one object to another.\r\n *\r\n * @param from Source object\r\n * @param to Target object\r\n */\r\nexport function copyAllProperties(from, to) {\r\n copyProperties(from, to, keys(from));\r\n}\r\n","/**\r\n * A collection of functions for ordering.\r\n */\r\n/**\r\n * [reverse description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param a [description]\r\n * @return [description]\r\n */\r\nexport function reverse(a) {\r\n switch (a) {\r\n case 0:\r\n return 0;\r\n case -1:\r\n return 1;\r\n case 1:\r\n return -1;\r\n }\r\n}\r\n/**\r\n * [or description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param a Item 1\r\n * @param b Item 2\r\n * @return [description]\r\n */\r\nexport function or(a, b) {\r\n if (a === 0) {\r\n return b;\r\n }\r\n else {\r\n return a;\r\n }\r\n}\r\n","/**\r\n * This module contains PatternSet object definition\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { BaseObject } from \"../Base\";\r\nimport { Color } from \"./Color\";\r\nimport { InterfaceColorSet } from \"./InterfaceColorSet\";\r\nimport { LinePattern } from \"../rendering/fills/LinePattern\";\r\nimport { RectPattern } from \"../rendering/fills/RectPattern\";\r\nimport { CirclePattern } from \"../rendering/fills/CirclePattern\";\r\nimport { registry } from \"../Registry\";\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Defines an interable list of distinctive patterns that can be used in\r\n * conjunction to colors to generate various fill patterns.\r\n *\r\n * @important\r\n * @since 4.7.5\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/colors/} for color-related info\r\n */\r\nvar PatternSet = /** @class */ (function (_super) {\r\n __extends(PatternSet, _super);\r\n /**\r\n * Constructor\r\n */\r\n function PatternSet() {\r\n var _this = _super.call(this) || this;\r\n /**\r\n * Holds the list of the colors in this set. (preset or auto-generated)\r\n */\r\n _this._list = [];\r\n /**\r\n * Current step.\r\n */\r\n _this._currentStep = 0;\r\n /**\r\n * If set to non-zero value, the PatternSet will start iterating patterns from\r\n * that particular index, not the first pattern in the list.\r\n */\r\n _this._startIndex = 0;\r\n /**\r\n * Current pass in cycle. Once all patterns in the list are iterated,\r\n * iteration restarts from beginning and currentPass is incremented.\r\n */\r\n _this._currentPass = 0;\r\n /**\r\n * A base color. If there are no colors pre-set in the color list, ColorSet\r\n * will use this color as a base when generating new ones, applying\r\n * `stepOptions` and `passOptions` to this base color.\r\n */\r\n _this.baseColor = new Color({\r\n r: 103,\r\n g: 183,\r\n b: 220\r\n });\r\n _this.className = \"PatternSet\";\r\n // Set base color to be used for pattern elements\r\n var interfaceColors = new InterfaceColorSet();\r\n // Set default patterns\r\n _this.list = [\r\n _this.getLinePattern(1000, 45, 1, 6),\r\n _this.getRectPattern(10, 0, 4),\r\n _this.getLinePattern(1000, -45, 1, 6),\r\n _this.getCirclePattern(11, 2, true),\r\n _this.getLinePattern(6, 90, 1),\r\n _this.getRectPattern(12, 45, 6, true),\r\n _this.getLinePattern(6, 0, 1),\r\n _this.getRectPattern(7, 0, 4),\r\n _this.getLinePattern(1000, 45, 2, 3, \"4,2\"),\r\n _this.getCirclePattern(9, 3, false),\r\n _this.getLinePattern(1000, -45, 2, 3, \"4,2\"),\r\n _this.getRectPattern(10, 45, Math.sqrt(50)),\r\n _this.getLinePattern(1000, -45, 2, 1),\r\n _this.getRectPattern(10, 0, 9),\r\n _this.getLinePattern(1000, 45, 2, 1),\r\n _this.getLinePattern(1000, 0, 3, 1),\r\n _this.getRectPattern(10, 45, 10),\r\n _this.getLinePattern(1000, 90, 3, 1)\r\n ];\r\n _this.baseColor = interfaceColors.getFor(\"stroke\");\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n PatternSet.prototype.getLinePattern = function (size, rotation, thickness, gap, strokeDashArray) {\r\n var pattern = new LinePattern();\r\n pattern.width = size;\r\n pattern.height = size;\r\n pattern.stroke = this.baseColor;\r\n pattern.gap = gap;\r\n pattern.strokeDasharray = strokeDashArray;\r\n pattern.strokeWidth = thickness;\r\n pattern.rotation = rotation;\r\n return pattern;\r\n };\r\n PatternSet.prototype.getRectPattern = function (size, rotation, thickness, outline) {\r\n var pattern = new RectPattern();\r\n pattern.width = size;\r\n pattern.height = size;\r\n pattern.rectWidth = thickness;\r\n pattern.rectHeight = thickness;\r\n if (outline) {\r\n pattern.stroke = this.baseColor;\r\n pattern.strokeWidth = 1;\r\n pattern.fillOpacity = 0;\r\n }\r\n else {\r\n pattern.fill = this.baseColor;\r\n pattern.strokeWidth = 0;\r\n }\r\n if (rotation != 0) {\r\n pattern.shapeRendering = \"auto\";\r\n }\r\n pattern.rotation = rotation;\r\n return pattern;\r\n };\r\n PatternSet.prototype.getCirclePattern = function (size, radius, outline) {\r\n var pattern = new CirclePattern();\r\n pattern.width = size;\r\n pattern.height = size;\r\n pattern.shapeRendering = \"auto\";\r\n pattern.radius = radius;\r\n if (outline) {\r\n pattern.stroke = this.baseColor;\r\n pattern.strokeWidth = 1;\r\n pattern.fillOpacity = 0;\r\n }\r\n else {\r\n pattern.fill = this.baseColor;\r\n pattern.strokeWidth = 0;\r\n }\r\n return pattern;\r\n };\r\n Object.defineProperty(PatternSet.prototype, \"list\", {\r\n /**\r\n * @return Pattern list\r\n */\r\n get: function () {\r\n return this._list;\r\n },\r\n /**\r\n * List of pre-defined patterns to be used in set.\r\n *\r\n * @param value Pattern list\r\n */\r\n set: function (value) {\r\n this._list = value;\r\n this.reset();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Returns the next pattern in list.\r\n *\r\n * @return Pattern\r\n */\r\n PatternSet.prototype.next = function () {\r\n var pattern = this.getIndex(this.currentStep);\r\n this._currentStep++;\r\n return pattern;\r\n };\r\n /**\r\n * Returns a color at specific index in the list.\r\n *\r\n * @param i Index\r\n * @return Pattern\r\n */\r\n PatternSet.prototype.getIndex = function (i) {\r\n var pattern;\r\n while (this.list.length <= i) {\r\n this.generatePatterns();\r\n }\r\n pattern = this.list[i];\r\n return pattern.clone();\r\n };\r\n /**\r\n * Generates a new set of patterns.\r\n */\r\n PatternSet.prototype.generatePatterns = function () {\r\n var count = this.list.length / (this._currentPass + 1);\r\n this._currentPass++;\r\n for (var i = 0; i < count; i++) {\r\n this.list.push(this.list[i].clone());\r\n }\r\n };\r\n /**\r\n * Resets internal iterator.\r\n *\r\n * Calling `next()` after this will return the very first color in the color\r\n * list, even if it was already returned before.\r\n */\r\n PatternSet.prototype.reset = function () {\r\n this._currentStep = this._startIndex;\r\n };\r\n Object.defineProperty(PatternSet.prototype, \"currentStep\", {\r\n /**\r\n * @return Step\r\n */\r\n get: function () {\r\n return this._currentStep;\r\n },\r\n /**\r\n * Sets current color iteration. You can use this property to skip some\r\n * colors from iteration. E.g. setting it to `10` will skip first ten\r\n * colors.\r\n *\r\n * Please note that the number is zero-based.\r\n *\r\n * @param value Step\r\n */\r\n set: function (value) {\r\n this._currentStep = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(PatternSet.prototype, \"startIndex\", {\r\n /**\r\n * @return Index\r\n */\r\n get: function () {\r\n return this._startIndex;\r\n },\r\n /**\r\n * If set to non-zero value, the ColorSet will start iterating colors from\r\n * that particular index, not the first color in the list.\r\n *\r\n * @default 0\r\n * @param value Index\r\n */\r\n set: function (value) {\r\n this._startIndex = value;\r\n this.reset();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Processes JSON-based config before it is applied to the object.\r\n *\r\n * @ignore Exclude from docs\r\n * @param config Config\r\n */\r\n PatternSet.prototype.processConfig = function (config) {\r\n // if (config) {\r\n // \t// Set up axis ranges\r\n // \tif ($type.hasValue(config.list) && $type.isArray(config.list)) {\r\n // \t\tfor (let i = 0, len = config.list.length; i < len; i++) {\r\n // \t\t\tif (!(config.list[i] instanceof Color)) {\r\n // \t\t\t\tconfig.list[i] = color(config.list[i]);\r\n // \t\t\t}\r\n // \t\t}\r\n // \t}\r\n // }\r\n _super.prototype.processConfig.call(this, config);\r\n };\r\n return PatternSet;\r\n}(BaseObject));\r\nexport { PatternSet };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"PatternSet\"] = PatternSet;\r\n","/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Represents a relative value (percent).\r\n *\r\n * The Percent object, can be instantiated using two ways:\r\n *\r\n * * Via `new Percent(X)`.\r\n * * Via `am4core.percent(X)`.\r\n *\r\n * `Percent` type objects can be used in a number of dual-measuring or\r\n * positioning properties, like `width`. E.g.:\r\n *\r\n * ```TypeScript\r\n * chart.paddingRight = new Percent(10);\r\n * // or\r\n * chart.paddingRight = am4core.percent(10);\r\n * ```\r\n * ```JavaScript\r\n * chart.paddingRight = new Percent(10);\r\n * // or\r\n * chart.paddingRight = am4core.percent(10);\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"paddingRight\": \"10%\"\r\n * }\r\n * ```\r\n */\r\nvar Percent = /** @class */ (function () {\r\n /**\r\n * Constructor.\r\n *\r\n * @param percent Percent value\r\n */\r\n function Percent(percent) {\r\n this._value = percent;\r\n }\r\n Object.defineProperty(Percent.prototype, \"value\", {\r\n /**\r\n * Relative value.\r\n *\r\n * E.g. 100% is 1, 50% is 0.5, etc.\r\n *\r\n * This is useful to apply transformations to other values. E.g.:\r\n *\r\n * ```TypeScript\r\n * let value = 256;\r\n * let percent = new am4core.Percent(50);\r\n * console.log(value * percent.value); // outputs 128\r\n * ```\r\n * ```JavaScript\r\n * var value = 256;\r\n * var percent = new am4core.Percent(50);\r\n * console.log(value * percent.value); // outputs 128\r\n * ```\r\n *\r\n * Alternatively, you can use `am4core.percent()` helper function:\r\n *\r\n * ```TypeScript\r\n * let value = 256;\r\n * let percent = am4core.percent(50);\r\n * console.log(value * percent.value); // outputs 128\r\n * ```\r\n * ```JavaScript\r\n * var value = 256;\r\n * var percent = am4core.percent(50);\r\n * console.log(value * percent.value); // outputs 128\r\n * ```\r\n *\r\n * @readonly\r\n * @return Relative value\r\n */\r\n get: function () {\r\n return this._value / 100;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Percent.prototype, \"percent\", {\r\n /**\r\n * Value in percent.\r\n *\r\n * @return Percent\r\n */\r\n get: function () {\r\n return this._value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Percent.prototype.toString = function () {\r\n return \"\" + this._value + \"%\";\r\n };\r\n return Percent;\r\n}());\r\nexport { Percent };\r\n/**\r\n * Converts numeric percent value to a proper [[Percent]] object.\r\n *\r\n * ```TypeScript\r\n * pieSeries.radius = am4core.percent(80);\r\n * ```\r\n * ```JavaScript\r\n * pieSeries.radius = am4core.percent(80);\r\n * ```\r\n *\r\n * @param value Percent\r\n * @return Percent object\r\n */\r\nexport function percent(value) {\r\n return new Percent(value);\r\n}\r\n/**\r\n * Checks if value is a [[Percent]] object.\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Input value\r\n * @return Is percent?\r\n */\r\nexport function isPercent(value) {\r\n return value instanceof Percent;\r\n}\r\n","/**\r\n * A plugin base class.\r\n */\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * This is a base class that provides core functionality for plugins.\r\n *\r\n * The easiest way to start off with a new plugin is to extend this class.\r\n *\r\n * It will provide all the mandatory functionality, such as disposers.\r\n *\r\n * @since 4.2.2\r\n */\r\nvar Plugin = /** @class */ (function () {\r\n /**\r\n * Constructor\r\n */\r\n function Plugin() {\r\n /**\r\n * Is this object disposed?\r\n */\r\n this._disposed = false;\r\n /**\r\n * List of IDisposer which will be disposed when the BaseObject is disposed.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n this._disposers = [];\r\n // Nothing to do here\r\n }\r\n /**\r\n * Decorates series with required events and adapters used to hijack its\r\n * data.\r\n */\r\n Plugin.prototype.init = function () {\r\n // Does nothing\r\n // Override it\r\n };\r\n /**\r\n * Returns if this element is already disposed.\r\n *\r\n * @return Is disposed?\r\n */\r\n Plugin.prototype.isDisposed = function () {\r\n return this._disposed;\r\n };\r\n /**\r\n * Disposes this object and related stuff.\r\n */\r\n Plugin.prototype.dispose = function () {\r\n if (!this._disposed) {\r\n this._disposed = true;\r\n var a = this._disposers;\r\n this._disposers = null;\r\n while (a.length !== 0) {\r\n var disposer = a.shift();\r\n disposer.dispose();\r\n }\r\n }\r\n };\r\n return Plugin;\r\n}());\r\nexport { Plugin };\r\n","import * as $array from \"./Array\";\r\nimport * as $log from \"./Log\";\r\nvar Native = /** @class */ (function () {\r\n function Native() {\r\n var _this = this;\r\n this._targets = [];\r\n this._observer = new ResizeObserver(function (entries) {\r\n $array.each(entries, function (entry) {\r\n $array.each(_this._targets, function (x) {\r\n if (x.target === entry.target) {\r\n x.callback();\r\n }\r\n });\r\n });\r\n });\r\n }\r\n Native.prototype.addTarget = function (target, callback) {\r\n this._observer.observe(target, { box: \"content-box\" });\r\n this._targets.push({ target: target, callback: callback });\r\n };\r\n Native.prototype.removeTarget = function (target) {\r\n this._observer.unobserve(target);\r\n $array.keepIf(this._targets, function (x) {\r\n return x.target !== target;\r\n });\r\n };\r\n return Native;\r\n}());\r\nvar Raf = /** @class */ (function () {\r\n function Raf() {\r\n this._targets = [];\r\n }\r\n Raf.prototype.addTarget = function (target, callback) {\r\n var _this = this;\r\n if (this._targets.length === 0) {\r\n var lastTime_1 = null;\r\n var loop_1 = function () {\r\n var currentTime = Date.now();\r\n if (lastTime_1 === null || currentTime > (lastTime_1 + Raf.delay)) {\r\n lastTime_1 = currentTime;\r\n $array.each(_this._targets, function (x) {\r\n var newSize = x.target.getBoundingClientRect();\r\n if (newSize.width !== x.size.width || newSize.height !== x.size.height) {\r\n x.size = newSize;\r\n x.callback();\r\n }\r\n });\r\n }\r\n _this._timer = requestAnimationFrame(loop_1);\r\n };\r\n this._timer = requestAnimationFrame(loop_1);\r\n }\r\n var size = target.getBoundingClientRect();\r\n this._targets.push({ target: target, callback: callback, size: size });\r\n };\r\n Raf.prototype.removeTarget = function (target) {\r\n $array.keepIf(this._targets, function (x) {\r\n return x.target !== target;\r\n });\r\n if (this._targets.length === 0) {\r\n cancelAnimationFrame(this._timer);\r\n }\r\n };\r\n Raf.delay = 200;\r\n return Raf;\r\n}());\r\nvar observer = null;\r\nfunction makeSensor() {\r\n if (observer === null) {\r\n if (typeof ResizeObserver !== \"undefined\") {\r\n observer = new Native();\r\n }\r\n else {\r\n observer = new Raf();\r\n }\r\n }\r\n return observer;\r\n}\r\nvar ResizeSensor = /** @class */ (function () {\r\n function ResizeSensor(element, callback) {\r\n this._disposed = false;\r\n this._sensor = makeSensor();\r\n this._element = element;\r\n this._sensor.addTarget(element, callback);\r\n }\r\n ResizeSensor.prototype.isDisposed = function () {\r\n return this._disposed;\r\n };\r\n ResizeSensor.prototype.dispose = function () {\r\n if (!this._disposed) {\r\n this._disposed = true;\r\n this._sensor.removeTarget(this._element);\r\n }\r\n };\r\n Object.defineProperty(ResizeSensor.prototype, \"sensor\", {\r\n get: function () {\r\n return this._sensor;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Deprecated: do not use.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n ResizeSensor.prototype.reset = function () {\r\n $log.warn(\"resizeSensor.reset() is no longer needed and can be removed\");\r\n };\r\n return ResizeSensor;\r\n}());\r\nexport { ResizeSensor };\r\n","/**\r\n * Responsive functionality module.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { BaseObjectEvents } from \"../Base\";\r\nimport { List } from \"../utils/List\";\r\nimport { Adapter } from \"../utils/Adapter\";\r\nimport { registry } from \"../Registry\";\r\nimport * as $iter from \"../utils/Iterator\";\r\nimport * as $array from \"../utils/Array\";\r\nimport * as $type from \"../utils/Type\";\r\nimport * as $object from \"../utils/Object\";\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Responsive is responsible for overriding certain properties when conditions\r\n * are met.\r\n *\r\n * This class is used to dynamically apply and change certain chart properties\r\n * based on the current values of properties.\r\n *\r\n * Mainly, this is used with [[Sprite]]'s dimensional properties, like\r\n * `pixelWidth` and `pixelHeight`. However, it can be used to dynamically\r\n * change any property, based on any other property's value.\r\n *\r\n * A default responsive rules are disabled.\r\n *\r\n * To enable, set `enabled = false`. E.g.:\r\n *\r\n * ```TypeScript\r\n * chart.responsive.enabled = true;\r\n * ```\r\n * ```JavaScript\r\n * chart.responsive.enabled = true;\r\n * ```\r\n *\r\n * @see {@link IResponsiveEvents} for a list of available events\r\n * @see {@link IResponsiveAdapters} for a list of available Adapters\r\n * @todo Add default rules\r\n * @todo Watch for rule modification\r\n * @important\r\n */\r\nvar Responsive = /** @class */ (function (_super) {\r\n __extends(Responsive, _super);\r\n /**\r\n * Constructor\r\n */\r\n function Responsive() {\r\n var _this = \r\n // Init\r\n _super.call(this) || this;\r\n /**\r\n * Holds a list of responsive rules organized by object type.\r\n */\r\n _this._rules = new List();\r\n /**\r\n * Holds the list of the default responsive rules.\r\n * @deprecated\r\n */\r\n //protected _defaultRules = new List<IResponsiveRule>();\r\n /**\r\n * Holds the list of currently applied rules.\r\n */\r\n _this._appliedRules = {};\r\n /**\r\n * Used to keep track of objects that have rules applied at the moment.\r\n */\r\n _this._appliedTargets = [];\r\n /**\r\n * Use default rules in addition to the user-defined ones?\r\n */\r\n _this._useDefault = true;\r\n /**\r\n * Adapter.\r\n */\r\n _this.adapter = new Adapter(_this);\r\n /**\r\n * Indicates of responsive rules application is enabled.\r\n */\r\n _this._enabled = false;\r\n /**\r\n * Holds disposers for all events added by this class.\r\n */\r\n _this._responsiveDisposers = [];\r\n /**\r\n * Collection of objects and state ids that do not have any properties set.\r\n */\r\n _this._noStates = [];\r\n _this.className = \"Responsive\";\r\n // Set up rules list events\r\n _this.rules.events.on(\"inserted\", function () { _this.checkRules(); }, true);\r\n _this.rules.events.on(\"removed\", function () { _this.checkRules(); }, true);\r\n _this._disposers.push(_this.rules.events);\r\n // Apply theme\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n Object.defineProperty(Responsive.prototype, \"component\", {\r\n /**\r\n * @return Target object\r\n */\r\n get: function () {\r\n return this._component;\r\n },\r\n /**\r\n * A target object that responsive rules will need to be applied to.\r\n *\r\n * @param value Target object\r\n */\r\n set: function (value) {\r\n var _this = this;\r\n // Check if it's the same\r\n if (value == this._component) {\r\n return;\r\n }\r\n // Check if we already have a set up component and remove its events\r\n this.disposeResponsiveHandlers();\r\n // Set\r\n this._component = value;\r\n // Set up resize monitoring events\r\n this._responsiveDisposers.push($type.getValue(this.component).events.on(\"sizechanged\", function () { _this.checkRules(); }, this));\r\n this._responsiveDisposers.push($type.getValue(this.component).events.on(\"datavalidated\", function () {\r\n if (_this._component.isReady()) {\r\n _this.checkRules(true);\r\n }\r\n }, this));\r\n // Enable resoponsive\r\n this.enabled = true;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Responsive.prototype, \"enabled\", {\r\n /**\r\n * @return Apply responsive rules?\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"enabled\", this._enabled);\r\n },\r\n /**\r\n * Should responsive rules be checked against and applied?\r\n *\r\n * @default false\r\n * @param value Apply responsive rules?\r\n */\r\n set: function (value) {\r\n if (this._enabled != value) {\r\n this._enabled = value;\r\n // Run `applyRules` so that any currently applied rules can be reset\r\n this.applyRules();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Responsive.prototype, \"useDefault\", {\r\n /**\r\n * @return Use default rules?\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"useDefault\", this._useDefault);\r\n },\r\n /**\r\n * Should default responsive rules be applied in addition to user-defined\r\n * ones.\r\n *\r\n * User-defined rules will take precedence over default rules whenever they\r\n * produce conflicting settings.\r\n *\r\n * @default true\r\n * @param value Use default rules?\r\n */\r\n set: function (value) {\r\n if (this._useDefault != value) {\r\n this._useDefault = value;\r\n // Run `applyRules` so that any currently applied rules can be reset\r\n this.applyRules();\r\n }\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Responsive.prototype, \"rules\", {\r\n /**\r\n * @return User-defined rules\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"rules\", this._rules);\r\n },\r\n /**\r\n * User-defined responsive rules.\r\n *\r\n * User-defined rules will take precedence over default rules whenever they\r\n * produce conflicting settings.\r\n *\r\n * Use `allRules` to get all applicable rules including default and\r\n * user-defined ones.\r\n *\r\n * @param value User-defined rules\r\n */\r\n set: function (value) {\r\n this._rules = value;\r\n this._enabled = true;\r\n this.applyRules();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Responsive.prototype, \"defaultRules\", {\r\n /**\r\n * Default responsive rules.\r\n *\r\n * @readonly\r\n * @return List of responsive rules\r\n */\r\n get: function () {\r\n return this.adapter.apply(\"defaultRules\", defaultRules);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Responsive.prototype, \"allRules\", {\r\n /**\r\n * Returns all rules: default rules (if not disabled) combined with\r\n * user-defined ones.\r\n *\r\n * @readonly\r\n * @return List of all applicable rules\r\n */\r\n get: function () {\r\n // Create empty list\r\n var rules = new List();\r\n // Add default rules if not disabled\r\n // A code, requesting `allRules` must ensure loading of default rules\r\n // by calling `loadDefaultRules()`\r\n if (this.useDefault) {\r\n rules.copyFrom(this.defaultRules);\r\n }\r\n // Add user-defined ones\r\n rules.copyFrom(this.rules);\r\n return this.adapter.apply(\"allRules\", rules);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Checks if rule by the particular id currently applied.\r\n *\r\n * @param ruleId Rule ID\r\n * @return Is currently applied?\r\n */\r\n Responsive.prototype.isApplied = function (ruleId) {\r\n var rule = this._appliedRules[ruleId];\r\n return $type.hasValue(rule) ? rule : false;\r\n };\r\n /**\r\n * Checks which responsive rules currently satisfy their conditions and\r\n * should be applied, or unapplied.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Responsive.prototype.checkRules = function (force) {\r\n var _this = this;\r\n if (force === void 0) { force = false; }\r\n // Check if there are any rules\r\n var rules = this.allRules;\r\n if (!rules || rules.length == 0) {\r\n return;\r\n }\r\n // Init a list of rules to be applied\r\n var rulesChanged = false;\r\n var component = $type.getValue(this.component);\r\n // Check which rules match\r\n $iter.each(rules.iterator(), function (rule) {\r\n // Check if rule has an id\r\n if (!rule.id) {\r\n rule.id = registry.getUniqueId();\r\n }\r\n // Init indicator if this rule should be applied\r\n var apply = rule.relevant(component);\r\n // Let's check if this rule needs to be applied\r\n if ((apply && !_this.isApplied(rule.id)) || (!apply && _this.isApplied(rule.id))) {\r\n rulesChanged = true;\r\n }\r\n _this._appliedRules[rule.id] = apply;\r\n });\r\n if (force) {\r\n rulesChanged = true;\r\n }\r\n // Check if we need to re-apply the rules\r\n if (rulesChanged) {\r\n if (!this.component.isReady()) {\r\n // The chart is not yet ready (built)\r\n // We will hide the chart and delay application of rules\r\n // until \"ready\" event kicks in\r\n //component.hide(0);\r\n component.hidden = true;\r\n component.events.once(\"ready\", function (ev) {\r\n ev.target.show(0);\r\n _this.applyRules();\r\n });\r\n return;\r\n }\r\n this.dispatchImmediately(\"ruleschanged\");\r\n this.applyRules();\r\n }\r\n };\r\n /**\r\n * Applies current rules to the object.\r\n *\r\n * @ignore Exclude from docs\r\n * @param target Target object\r\n * @todo Better type check\r\n */\r\n Responsive.prototype.applyRules = function (target) {\r\n var _this = this;\r\n // If no target supplied, we assume the top-level element\r\n var newTarget = ($type.hasValue(target)\r\n ? target\r\n : $type.getValue(this.component));\r\n // Check each rule\r\n var defaultStateApplied = false;\r\n if (this.enabled) {\r\n var isApplied_1 = false;\r\n $iter.each(this.allRules.iterator(), function (rule) {\r\n // Get relevant state\r\n var state = _this.getState(rule, newTarget);\r\n // If there's a state, it means it needs to be applied\r\n if (state) {\r\n // Check if default state was already applied to this element.\r\n // We don't want to go resetting default states to ALL element,\r\n // if they don't have responsive states.\r\n if (!defaultStateApplied) {\r\n // Nope, reset states (instantly).\r\n if ($array.indexOf(_this._appliedTargets, newTarget.uid) !== -1) {\r\n // But only if this element has any rules applied, otherwise no\r\n // point in setting current state\r\n newTarget.setState(_this.getDefaultState(newTarget), 0);\r\n }\r\n defaultStateApplied = true;\r\n }\r\n // Is this rule currently applied?\r\n if (_this.isApplied($type.getValue(rule.id))) {\r\n // Yes. Apply the responsive state\r\n state.transitionDuration = 0;\r\n _this.setTargetState(newTarget, state);\r\n _this.dispatchImmediately(\"ruleapplied\", {\r\n rule: rule\r\n });\r\n isApplied_1 = true;\r\n }\r\n }\r\n });\r\n if (isApplied_1) {\r\n $array.replace(this._appliedTargets, newTarget.uid);\r\n }\r\n else {\r\n $array.remove(this._appliedTargets, newTarget.uid);\r\n }\r\n }\r\n // Apply rules to the children\r\n if (newTarget.children) {\r\n $iter.each(newTarget.children.iterator(), function (child) {\r\n _this.applyRules(child);\r\n });\r\n }\r\n };\r\n /**\r\n * Returns a relative state for the rule/target, or `undefined` if no state is\r\n * needed.\r\n *\r\n * @param rule [description]\r\n * @param target [description]\r\n * @return [description]\r\n */\r\n Responsive.prototype.getState = function (rule, target) {\r\n var stateId = \"responsive-\" + rule.id;\r\n var tmpId = target.uid + \"_\" + stateId;\r\n if ($array.indexOf(this._noStates, tmpId) !== -1) {\r\n return;\r\n }\r\n else if (!target.states.hasKey(stateId)) {\r\n var state = rule.state(target, stateId);\r\n if (!state) {\r\n this._noStates.push(tmpId);\r\n }\r\n return state;\r\n }\r\n else {\r\n return target.states.getKey(stateId);\r\n }\r\n };\r\n /**\r\n * Creates and returns default responsive rule for the target.\r\n *\r\n * This rule will be used to \"reset\" to non-responsive values.\r\n * @param target Target Sprite\r\n * @return State\r\n */\r\n Responsive.prototype.getDefaultState = function (target) {\r\n if (target.states.hasKey(\"responsive-default\")) {\r\n return target.states.getKey(\"responsive-default\");\r\n }\r\n return target.states.create(\"responsive-default\");\r\n };\r\n /**\r\n * Sets state on the target element and updates default state with the\r\n * overwritten values if needed.\r\n *\r\n * @param target Target\r\n * @param state State\r\n */\r\n Responsive.prototype.setTargetState = function (target, state) {\r\n var _this = this;\r\n // Update default state\r\n var defaultState = this.getDefaultState(target);\r\n $object.each(state.properties, function (key, val) {\r\n if (!$type.hasValue(defaultState.properties[key])) {\r\n defaultState.properties[key] = _this.getValue(target, key);\r\n }\r\n });\r\n target.setState(state);\r\n };\r\n /**\r\n * Gets a value from an element.\r\n *\r\n * @ignore Exclude from docs\r\n * @param target Target object\r\n * @param property Property\r\n * @return Property value\r\n */\r\n Responsive.prototype.getValue = function (target, property) {\r\n // This is a bit hacky, first we check if the property exist.\r\n // If it doesn't we try accessing target's property directly\r\n var value = target.getPropertyValue(property);\r\n if (!$type.hasValue(value) && $type.hasValue(target[property])) {\r\n value = target[property];\r\n }\r\n return value;\r\n };\r\n /**\r\n * Disposes the object.\r\n */\r\n Responsive.prototype.dispose = function () {\r\n this.disposeResponsiveHandlers();\r\n _super.prototype.dispose.call(this);\r\n };\r\n /**\r\n * Disposes all event handlers.\r\n */\r\n Responsive.prototype.disposeResponsiveHandlers = function () {\r\n var disposer = this._responsiveDisposers.pop();\r\n while (disposer) {\r\n disposer.dispose();\r\n disposer = this._responsiveDisposers.pop();\r\n }\r\n };\r\n return Responsive;\r\n}(BaseObjectEvents));\r\nexport { Responsive };\r\n/**\r\n * [defaultRules description]\r\n *\r\n * @todo description\r\n */\r\nexport var defaultRules = new List();\r\ndefaultRules.events.on(\"inserted\", function (ev) {\r\n ev.newValue.id = registry.getUniqueId();\r\n});\r\n/**\r\n *\r\n * @todo description\r\n */\r\nvar ResponsiveBreakpoints = /** @class */ (function () {\r\n function ResponsiveBreakpoints() {\r\n }\r\n // Breakpoint functions (for use in `relevant` clause of the responsive rules)\r\n ResponsiveBreakpoints.widthXXS = function (container) {\r\n return container.pixelWidth <= ResponsiveBreakpoints.XXS;\r\n };\r\n ResponsiveBreakpoints.widthXS = function (container) {\r\n return container.pixelWidth <= ResponsiveBreakpoints.XS;\r\n };\r\n ResponsiveBreakpoints.widthS = function (container) {\r\n return container.pixelWidth <= ResponsiveBreakpoints.S;\r\n };\r\n ResponsiveBreakpoints.widthM = function (container) {\r\n return container.pixelWidth <= ResponsiveBreakpoints.M;\r\n };\r\n ResponsiveBreakpoints.widthL = function (container) {\r\n return container.pixelWidth <= ResponsiveBreakpoints.L;\r\n };\r\n ResponsiveBreakpoints.widthXL = function (container) {\r\n return container.pixelWidth <= ResponsiveBreakpoints.XL;\r\n };\r\n ResponsiveBreakpoints.widthXXL = function (container) {\r\n return container.pixelWidth <= ResponsiveBreakpoints.XXL;\r\n };\r\n ResponsiveBreakpoints.heightXXS = function (container) {\r\n return container.pixelHeight <= ResponsiveBreakpoints.XXS;\r\n };\r\n ResponsiveBreakpoints.heightXS = function (container) {\r\n return container.pixelHeight <= ResponsiveBreakpoints.XS;\r\n };\r\n ResponsiveBreakpoints.heightS = function (container) {\r\n return container.pixelHeight <= ResponsiveBreakpoints.S;\r\n };\r\n ResponsiveBreakpoints.heightM = function (container) {\r\n return container.pixelHeight <= ResponsiveBreakpoints.M;\r\n };\r\n ResponsiveBreakpoints.heightL = function (container) {\r\n return container.pixelHeight <= ResponsiveBreakpoints.L;\r\n };\r\n ResponsiveBreakpoints.heightXL = function (container) {\r\n return container.pixelHeight <= ResponsiveBreakpoints.XL;\r\n };\r\n ResponsiveBreakpoints.heightXXL = function (container) {\r\n return container.pixelHeight <= ResponsiveBreakpoints.XXL;\r\n };\r\n ResponsiveBreakpoints.isXXS = function (container) {\r\n return (container.pixelWidth <= ResponsiveBreakpoints.XXS) && (container.pixelHeight <= ResponsiveBreakpoints.XXS);\r\n };\r\n ResponsiveBreakpoints.isXS = function (container) {\r\n return (container.pixelWidth <= ResponsiveBreakpoints.XS) && (container.pixelHeight <= ResponsiveBreakpoints.XS);\r\n };\r\n ResponsiveBreakpoints.isS = function (container) {\r\n return (container.pixelWidth <= ResponsiveBreakpoints.S) && (container.pixelHeight <= ResponsiveBreakpoints.S);\r\n };\r\n ResponsiveBreakpoints.isM = function (container) {\r\n return (container.pixelWidth <= ResponsiveBreakpoints.M) && (container.pixelHeight <= ResponsiveBreakpoints.M);\r\n };\r\n ResponsiveBreakpoints.isL = function (container) {\r\n return (container.pixelWidth <= ResponsiveBreakpoints.L) && (container.pixelHeight <= ResponsiveBreakpoints.L);\r\n };\r\n ResponsiveBreakpoints.isXL = function (container) {\r\n return (container.pixelWidth <= ResponsiveBreakpoints.XL) && (container.pixelHeight <= ResponsiveBreakpoints.XL);\r\n };\r\n ResponsiveBreakpoints.isXXL = function (container) {\r\n return (container.pixelWidth <= ResponsiveBreakpoints.XXL) && (container.pixelHeight <= ResponsiveBreakpoints.XXL);\r\n };\r\n ResponsiveBreakpoints.maybeXXS = function (container) {\r\n return (container.pixelWidth <= ResponsiveBreakpoints.XXS) || (container.pixelHeight <= ResponsiveBreakpoints.XXS);\r\n };\r\n ResponsiveBreakpoints.maybeXS = function (container) {\r\n return (container.pixelWidth <= ResponsiveBreakpoints.XS) || (container.pixelHeight <= ResponsiveBreakpoints.XS);\r\n };\r\n ResponsiveBreakpoints.maybeS = function (container) {\r\n return (container.pixelWidth <= ResponsiveBreakpoints.S) || (container.pixelHeight <= ResponsiveBreakpoints.S);\r\n };\r\n ResponsiveBreakpoints.maybeM = function (container) {\r\n return (container.pixelWidth <= ResponsiveBreakpoints.M) || (container.pixelHeight <= ResponsiveBreakpoints.M);\r\n };\r\n ResponsiveBreakpoints.maybeL = function (container) {\r\n return (container.pixelWidth <= ResponsiveBreakpoints.L) || (container.pixelHeight <= ResponsiveBreakpoints.L);\r\n };\r\n ResponsiveBreakpoints.maybeXL = function (container) {\r\n return (container.pixelWidth <= ResponsiveBreakpoints.XL) || (container.pixelHeight <= ResponsiveBreakpoints.XL);\r\n };\r\n ResponsiveBreakpoints.maybeXXL = function (container) {\r\n return (container.pixelWidth <= ResponsiveBreakpoints.XXL) || (container.pixelHeight <= ResponsiveBreakpoints.XXL);\r\n };\r\n // Named pixel breakpoints\r\n ResponsiveBreakpoints.XXS = 100;\r\n ResponsiveBreakpoints.XS = 200;\r\n ResponsiveBreakpoints.S = 300;\r\n ResponsiveBreakpoints.M = 400;\r\n ResponsiveBreakpoints.L = 600;\r\n ResponsiveBreakpoints.XL = 800;\r\n ResponsiveBreakpoints.XXL = 1000;\r\n return ResponsiveBreakpoints;\r\n}());\r\nexport { ResponsiveBreakpoints };\r\n","import { __extends, __generator } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { EventDispatcher } from \"./EventDispatcher\";\r\nimport * as $array from \"./Array\";\r\nimport * as $iter from \"./Iterator\";\r\nimport * as $type from \"./Type\";\r\n/**\r\n * Ordered list contains values of any type in an indexed array.\r\n */\r\nvar OrderedList = /** @class */ (function () {\r\n /**\r\n * Constructor\r\n *\r\n * @param initial Inital list of values to add to list\r\n */\r\n function OrderedList(initial) {\r\n /**\r\n * Holds list values.\r\n */\r\n this._values = [];\r\n /**\r\n * Event dispatcher.\r\n */\r\n this.events = new EventDispatcher();\r\n if (initial != null) {\r\n this.setAll(initial);\r\n }\r\n }\r\n Object.defineProperty(OrderedList.prototype, \"values\", {\r\n /**\r\n * All items of the list.\r\n *\r\n * Do not modify the list directly. Rather use `insert()` and `remove()`\r\n * methods.\r\n *\r\n * @return List values\r\n */\r\n get: function () {\r\n return this._values;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Inserts a value into list item array.\r\n *\r\n * @param value Value\r\n */\r\n OrderedList.prototype._insert = function (value) {\r\n this._values.push(value);\r\n return this._values.length - 1;\r\n };\r\n Object.defineProperty(OrderedList.prototype, \"length\", {\r\n /**\r\n * Number of items in the list.\r\n *\r\n * @readonly\r\n * @return Length\r\n */\r\n get: function () {\r\n return this._values.length;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Returns the index of the specific `value`.\r\n *\r\n * -1 if not found.\r\n *\r\n * @param value Value\r\n * @return Index\r\n */\r\n OrderedList.prototype.indexOf = function (value) {\r\n return $array.indexOf(this._values, value);\r\n };\r\n /**\r\n * Checks if list contains the `value`.\r\n *\r\n * @param value Value\r\n * @return In the list?\r\n */\r\n OrderedList.prototype.contains = function (value) {\r\n return this.indexOf(value) !== -1;\r\n };\r\n /**\r\n * Returns an item at specific `index`.\r\n *\r\n * @param index Index\r\n * @return Item\r\n */\r\n OrderedList.prototype.getIndex = function (index) {\r\n return this._values[index];\r\n };\r\n Object.defineProperty(OrderedList.prototype, \"first\", {\r\n /**\r\n * First item in the list.\r\n *\r\n * @return Item\r\n */\r\n get: function () {\r\n return this._values[0];\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(OrderedList.prototype, \"last\", {\r\n /**\r\n * Last item in the list.\r\n *\r\n * @return Item\r\n */\r\n get: function () {\r\n return this._values[this._values.length - 1];\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Inserts a value into list.\r\n *\r\n * @param value Value\r\n */\r\n OrderedList.prototype.insert = function (value) {\r\n var index = this._insert(value);\r\n if (this.events.isEnabled(\"inserted\")) {\r\n this.events.dispatchImmediately(\"inserted\", {\r\n type: \"inserted\",\r\n target: this,\r\n index: index,\r\n newValue: value\r\n });\r\n }\r\n };\r\n /**\r\n * Removes an item with the `value` from the list.\r\n *\r\n * @param value Value\r\n */\r\n OrderedList.prototype.remove = function (value) {\r\n var index = this.indexOf(value);\r\n if (index !== -1) {\r\n var oldValue = this._values[index];\r\n $array.removeIndex(this._values, index);\r\n if (this.events.isEnabled(\"removed\")) {\r\n this.events.dispatchImmediately(\"removed\", {\r\n type: \"removed\",\r\n target: this,\r\n index: index,\r\n oldValue: oldValue,\r\n });\r\n }\r\n }\r\n };\r\n /**\r\n * Sets multiple items to the list.\r\n *\r\n * All current items are removed.\r\n *\r\n * @param newArray New items\r\n */\r\n OrderedList.prototype.setAll = function (newArray) {\r\n var _this = this;\r\n $array.eachReverse(this._values, function (x, i) {\r\n _this._values.pop();\r\n if (_this.events.isEnabled(\"removed\")) {\r\n _this.events.dispatchImmediately(\"removed\", {\r\n type: \"removed\",\r\n target: _this,\r\n index: i,\r\n oldValue: x\r\n });\r\n }\r\n });\r\n $array.each(newArray, function (value) {\r\n _this.insert(value);\r\n });\r\n };\r\n /**\r\n * Removes all items from the list.\r\n */\r\n OrderedList.prototype.clear = function () {\r\n this.setAll([]);\r\n };\r\n /**\r\n * Returns part of the list between `start` and `end` indexes, as a new\r\n * [[OrderedList]].\r\n *\r\n * @param start Start index\r\n * @param end End index\r\n * @return Items in range\r\n */\r\n OrderedList.prototype.slice = function (start, end) {\r\n var out = new OrderedList();\r\n out._values = this._values.slice(start, end);\r\n return out;\r\n };\r\n /**\r\n * Finds a closest available index to the `value` in specified direction.\r\n *\r\n * @ignore exclude from docs\r\n * @param value value to search for\r\n * @param fn A callback function that returns value of the item\r\n * @param direction Direciton\r\n * @return Index\r\n */\r\n OrderedList.prototype.findClosestIndex = function (value, fn, direction) {\r\n if (direction === void 0) { direction = \"any\"; }\r\n // Init temporary values\r\n var closestIndex = -1;\r\n var closestValue;\r\n var closestDifference;\r\n var i = 0;\r\n $iter.eachContinue(this.iterator(), function (element) {\r\n var item = fn(element);\r\n // Calc difference\r\n if (direction === \"any\") {\r\n // Exact match?\r\n if (item === value) {\r\n // Found exact value - don't bother searching further\r\n closestIndex = i;\r\n return false;\r\n }\r\n var difference = Math.abs(value - item);\r\n if (!$type.hasValue(closestDifference) || (closestDifference > difference)) {\r\n closestIndex = i;\r\n closestValue = item;\r\n closestDifference = difference;\r\n }\r\n }\r\n else if (direction === \"left\" && (item < value)) {\r\n if (!$type.hasValue(closestValue) || (closestValue < item)) {\r\n closestIndex = i;\r\n closestValue = item;\r\n }\r\n }\r\n else if (direction === \"right\" && (item >= value)) {\r\n if (!$type.hasValue(closestValue) || (closestValue >= item)) {\r\n closestIndex = i;\r\n closestValue = item;\r\n }\r\n }\r\n ++i;\r\n return true;\r\n });\r\n // Found nothing?\r\n if (closestIndex === -1) {\r\n if (direction === \"left\") {\r\n // Use First one\r\n closestIndex = 0;\r\n }\r\n else if (direction === \"right\") {\r\n // Use last item\r\n closestIndex = this.length - 1;\r\n }\r\n }\r\n return closestIndex;\r\n };\r\n /**\r\n * Returns a list iterator.\r\n *\r\n * @return Iterator\r\n */\r\n OrderedList.prototype.iterator = function () {\r\n return $iter.fromArray(this._values);\r\n };\r\n /**\r\n * Returns an ES6 iterator for the list.\r\n */\r\n OrderedList.prototype[Symbol.iterator] = function () {\r\n var length, i;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n length = this._values.length;\r\n i = 0;\r\n _a.label = 1;\r\n case 1:\r\n if (!(i < length)) return [3 /*break*/, 4];\r\n return [4 /*yield*/, this._values[i]];\r\n case 2:\r\n _a.sent();\r\n _a.label = 3;\r\n case 3:\r\n ++i;\r\n return [3 /*break*/, 1];\r\n case 4: return [2 /*return*/];\r\n }\r\n });\r\n };\r\n /**\r\n * Calls `f` for each element in the list.\r\n */\r\n OrderedList.prototype.each = function (f) {\r\n $array.each(this._values, f);\r\n };\r\n return OrderedList;\r\n}());\r\nexport { OrderedList };\r\n/**\r\n * A list where all items are ordered according to specific ordering function,\r\n * which is passed in via constructor parameter, when creating an instance of\r\n * [[SortedList]].\r\n */\r\nvar SortedList = /** @class */ (function (_super) {\r\n __extends(SortedList, _super);\r\n /**\r\n * Constructor.\r\n *\r\n * @param sort Ordering function\r\n */\r\n function SortedList(sort) {\r\n var _this = _super.call(this) || this;\r\n _this._ordering = sort;\r\n return _this;\r\n }\r\n /**\r\n * Inserts item into the list.\r\n *\r\n * @param value Item\r\n */\r\n SortedList.prototype._insert = function (value) {\r\n var index = $array.getSortedIndex(this._values, this._ordering, value).index;\r\n $array.insertIndex(this._values, index, value);\r\n return index;\r\n };\r\n /**\r\n * Returns index of the item in list if found.\r\n *\r\n * -1 if item is not in the list.\r\n *\r\n * @param value Item to search for\r\n * @return Index\r\n */\r\n SortedList.prototype.indexOf = function (value) {\r\n var _a = $array.getSortedIndex(this._values, this._ordering, value), found = _a.found, index = _a.index;\r\n if (found) {\r\n return index;\r\n }\r\n else {\r\n return -1;\r\n }\r\n };\r\n /**\r\n * [udpate description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param value [description]\r\n */\r\n SortedList.prototype.update = function (value) {\r\n // @todo test this\r\n var index = $array.indexOf(this._values, value);\r\n // @todo throw an error if it doesn't exist ?\r\n if (index !== -1) {\r\n var last = this._values.length - 1;\r\n // Check if the current ordering is correct\r\n if (!((index === 0 || this._ordering(this._values[index - 1], value) < 0) &&\r\n (index === last || this._ordering(value, this._values[index + 1]) < 0))) {\r\n // TODO send remove/insert/move events\r\n $array.removeIndex(this._values, index);\r\n this._insert(value);\r\n }\r\n }\r\n };\r\n return SortedList;\r\n}(OrderedList));\r\nexport { SortedList };\r\n/**\r\n * A version of a [[OrderedList]] that has a \"template\".\r\n *\r\n * A template is an instance of an object, that can be used to create new\r\n * elements in the list without actually needing to create instances for those.\r\n *\r\n * When new element is created in the list, e.g. by calling its `create()`\r\n * method, an exact copy of the element is created (including properties and\r\n * other attributes), inserted into the list and returned.\r\n */\r\nvar OrderedListTemplate = /** @class */ (function (_super) {\r\n __extends(OrderedListTemplate, _super);\r\n /**\r\n * Constructor\r\n *\r\n * @param t Template object\r\n */\r\n function OrderedListTemplate(t) {\r\n var _this = _super.call(this) || this;\r\n _this.template = t;\r\n return _this;\r\n }\r\n Object.defineProperty(OrderedListTemplate.prototype, \"template\", {\r\n /**\r\n * @return Template object\r\n */\r\n get: function () {\r\n return this._template;\r\n },\r\n /**\r\n * A \"template\" object to copy all properties from when creating new list\r\n * items.\r\n *\r\n * @param v Template object\r\n */\r\n set: function (v) {\r\n v.isTemplate = true;\r\n this._template = v;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Copies all elements from other list.\r\n *\r\n * @param source Source list\r\n */\r\n OrderedListTemplate.prototype.copyFrom = function (source) {\r\n var _this = this;\r\n $iter.each(source.iterator(), function (value) {\r\n _this.insert(value.clone());\r\n });\r\n };\r\n /**\r\n * Returns part of the list, starting at `start` and ending at `end` indexes,\r\n * as a new [[OrderedListTemplate]].\r\n *\r\n * @param start Start index\r\n * @param end End index\r\n * @return New list\r\n */\r\n OrderedListTemplate.prototype.slice = function (start, end) {\r\n var out = new OrderedListTemplate(this.template);\r\n out._values = this._values.slice(start, end);\r\n return out;\r\n };\r\n OrderedListTemplate.prototype.create = function (make) {\r\n var clone = (make != null\r\n ? new make()\r\n : this.template.clone());\r\n this.insert(clone);\r\n return clone;\r\n };\r\n return OrderedListTemplate;\r\n}(OrderedList));\r\nexport { OrderedListTemplate };\r\n/**\r\n * A version of a [[SortedList]] that has a \"template\".\r\n *\r\n * A template is an instance of an object, that can be used to create new\r\n * elements in the list without actually needing to create instances for those.\r\n *\r\n * When new element is created in the list, e.g. by calling its `create()`\r\n * method, an exact copy of the element is created (including properties and\r\n * other attributes), inserted into the list and returned.\r\n */\r\nvar SortedListTemplate = /** @class */ (function (_super) {\r\n __extends(SortedListTemplate, _super);\r\n /**\r\n * Constructor\r\n *\r\n * @param t Template object\r\n * @param sort Ordering function\r\n */\r\n function SortedListTemplate(t, sort) {\r\n var _this = _super.call(this, sort) || this;\r\n _this.template = t;\r\n return _this;\r\n }\r\n Object.defineProperty(SortedListTemplate.prototype, \"template\", {\r\n /**\r\n * @return Template object\r\n */\r\n get: function () {\r\n return this._template;\r\n },\r\n /**\r\n * A \"template\" object to copy all properties from when creating new list\r\n * items.\r\n *\r\n * @param v Template object\r\n */\r\n set: function (v) {\r\n v.isTemplate = true;\r\n this._template = v;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Copies all elements from other list.\r\n *\r\n * @param source Source list\r\n */\r\n SortedListTemplate.prototype.copyFrom = function (source) {\r\n var _this = this;\r\n $iter.each(source.iterator(), function (value) {\r\n _this.insert(value.clone());\r\n });\r\n };\r\n SortedListTemplate.prototype.create = function (make) {\r\n var clone = (make != null\r\n ? new make()\r\n : this.template.clone());\r\n this.insert(clone);\r\n return clone;\r\n };\r\n return SortedListTemplate;\r\n}(SortedList));\r\nexport { SortedListTemplate };\r\n","/**\r\n * ============================================================================\r\n * COMPARING FUNCTIONS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Comparing function used for ordering.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Use localeCompare\r\n * @param a Item 1\r\n * @param b Item 2\r\n * @return Result\r\n */\r\nexport function order(a, b) {\r\n if (a === b) {\r\n return 0;\r\n }\r\n else if (a < b) {\r\n return -1;\r\n }\r\n else {\r\n return 1;\r\n }\r\n}\r\n/**\r\n * ============================================================================\r\n * OTHER FUNCTIONS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Repeats a `string` number of times as set in `amount`.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Make this faster\r\n * @param string Source string\r\n * @param amount Number of times to repeat string\r\n * @return New string\r\n */\r\nexport function repeat(string, amount) {\r\n return new Array(amount + 1).join(string);\r\n}\r\n/**\r\n * Generates a random string `characters` length.\r\n *\r\n * @param chars Number of characters\r\n * @return Random string\r\n */\r\nexport function random(chars) {\r\n var res = \"\";\r\n var choice = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\r\n for (var i = 0; i < chars; i++) {\r\n res += choice.charAt(Math.floor(Math.random() * choice.length));\r\n }\r\n return res;\r\n}\r\n","/**\r\n * A collection of String-based constants.\r\n * @hidden\r\n * @ignore Exclude from docs\r\n */\r\n/**\r\n * @ignore Exclude from docs\r\n */\r\nexport var PX = \"px\";\r\n/**\r\n * @ignore Exclude from docs\r\n */\r\nexport var STRING = \"string\";\r\n/**\r\n * @ignore Exclude from docs\r\n */\r\nexport var NUMBER = \"number\";\r\n/**\r\n * @ignore Exclude from docs\r\n */\r\nexport var DATE = \"date\";\r\n/**\r\n * @ignore Exclude from docs\r\n */\r\nexport var DURATION = \"duration\";\r\n/**\r\n * @ignore Exclude from docs\r\n */\r\nexport var PLACEHOLDER = \"__§§§__\";\r\n/**\r\n * @ignore Exclude from docs\r\n */\r\nexport var PLACEHOLDER2 = \"__§§§§__\";\r\n","import * as $type from \"../utils/Type\";\r\n/**\r\n * Maps time period names to their numeric representations in milliseconds.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\nexport var timeUnitDurations = {\r\n millisecond: 1,\r\n second: 1000,\r\n minute: 60000,\r\n hour: 3600000,\r\n day: 86400000,\r\n week: 604800000,\r\n month: 2592000000,\r\n year: 31536000000\r\n};\r\n/**\r\n * Returns the next time unit that goes after source `unit`.\r\n *\r\n * E.g. \"hour\" is the next unit after \"minute\", etc.\r\n *\r\n * @ignore Exclude from docs\r\n * @param unit Source time unit\r\n * @return Next time unit\r\n */\r\nexport function getNextUnit(unit) {\r\n switch (unit) {\r\n case \"year\":\r\n return;\r\n case \"month\":\r\n return \"year\";\r\n case \"week\":\r\n return \"month\";\r\n case \"day\":\r\n return \"month\"; // not a mistake\r\n case \"hour\":\r\n return \"day\";\r\n case \"minute\":\r\n return \"hour\";\r\n case \"second\":\r\n return \"minute\";\r\n case \"millisecond\":\r\n return \"second\";\r\n }\r\n}\r\n/**\r\n * Returns number of milliseconds in the `count` of time `unit`.\r\n *\r\n * Available units: \"millisecond\", \"second\", \"minute\", \"hour\", \"day\", \"week\",\r\n * \"month\", and \"year\".\r\n *\r\n * @ignore Exclude from docs\r\n * @param unit Time unit\r\n * @param count Number of units\r\n * @return Milliseconds\r\n */\r\nexport function getDuration(unit, count) {\r\n if (!$type.hasValue(count)) {\r\n count = 1;\r\n }\r\n return timeUnitDurations[unit] * count;\r\n}\r\n/**\r\n * Returns current `Date` object.\r\n *\r\n * @return Current date\r\n */\r\nexport function now() {\r\n return new Date();\r\n}\r\n/**\r\n * Returns current timestamp.\r\n *\r\n * @return Current timestamp\r\n */\r\nexport function getTime() {\r\n return now().getTime();\r\n}\r\n/**\r\n * Returns a copy of the `Date` object.\r\n *\r\n * @ignore Exclude from docs\r\n * @param date Source date\r\n * @return Copy\r\n */\r\nexport function copy(date) {\r\n return new Date(date.getTime()); // todo: check if this is ok. new Date(date) used to strip milliseconds on FF in v3\r\n}\r\n/**\r\n * Checks if the `unit` part of two `Date` objects do not match. Two dates\r\n * represent a \"range\" of time, rather the same time date.\r\n *\r\n * @ignore Exclude from docs\r\n * @param dateOne Date 1\r\n * @param dateTwo Date 2\r\n * @param unit Time unit to check\r\n * @return Range?\r\n */\r\nexport function checkChange(dateOne, dateTwo, unit, utc) {\r\n dateOne = new Date(dateOne.getTime());\r\n dateTwo = new Date(dateTwo.getTime());\r\n var timeZoneOffset1 = 0;\r\n var timeZoneOffset2 = 0;\r\n if (!utc && unit != \"millisecond\") {\r\n timeZoneOffset1 = dateOne.getTimezoneOffset();\r\n dateOne.setUTCMinutes(dateOne.getUTCMinutes() - timeZoneOffset1);\r\n timeZoneOffset2 = dateTwo.getTimezoneOffset();\r\n dateTwo.setUTCMinutes(dateTwo.getUTCMinutes() - timeZoneOffset2);\r\n }\r\n var changed = false;\r\n switch (unit) {\r\n case \"year\":\r\n if (dateOne.getUTCFullYear() != dateTwo.getUTCFullYear()) {\r\n changed = true;\r\n }\r\n break;\r\n case \"month\":\r\n if (dateOne.getUTCFullYear() != dateTwo.getUTCFullYear()) {\r\n changed = true;\r\n }\r\n else if (dateOne.getUTCMonth() != dateTwo.getUTCMonth()) {\r\n changed = true;\r\n }\r\n break;\r\n case \"day\":\r\n if (dateOne.getUTCMonth() != dateTwo.getUTCMonth()) {\r\n changed = true;\r\n }\r\n else if (dateOne.getUTCDate() != dateTwo.getUTCDate()) {\r\n changed = true;\r\n }\r\n break;\r\n case \"hour\":\r\n if (dateOne.getUTCHours() != dateTwo.getUTCHours()) {\r\n changed = true;\r\n }\r\n break;\r\n case \"minute\":\r\n if (dateOne.getUTCMinutes() != dateTwo.getUTCMinutes()) {\r\n changed = true;\r\n }\r\n break;\r\n case \"second\":\r\n if (dateOne.getUTCSeconds() != dateTwo.getUTCSeconds()) {\r\n changed = true;\r\n }\r\n break;\r\n case \"millisecond\":\r\n if (dateOne.getTime() != dateTwo.getTime()) {\r\n changed = true;\r\n }\r\n break;\r\n }\r\n if (changed) {\r\n return true;\r\n }\r\n var nextUnit = getNextUnit(unit);\r\n if (nextUnit) {\r\n dateOne.setUTCMinutes(dateOne.getUTCMinutes() + timeZoneOffset1);\r\n dateTwo.setUTCMinutes(dateTwo.getUTCMinutes() + timeZoneOffset2);\r\n return checkChange(dateOne, dateTwo, nextUnit, utc);\r\n }\r\n else {\r\n return false;\r\n }\r\n}\r\n/**\r\n * Adds `count` of time `unit` to the source date. Returns a modified `Date` object.\r\n *\r\n * @ignore Exclude from docs\r\n * @param date Source date\r\n * @param unit Time unit\r\n * @param count Number of units to add\r\n * @return Modified date\r\n */\r\nexport function add(date, unit, count, utc) {\r\n var timeZoneOffset = 0;\r\n if (!utc && unit != \"millisecond\") {\r\n timeZoneOffset = date.getTimezoneOffset();\r\n date.setUTCMinutes(date.getUTCMinutes() - timeZoneOffset);\r\n }\r\n switch (unit) {\r\n case \"day\":\r\n var day = date.getUTCDate();\r\n date.setUTCDate(day + count);\r\n break;\r\n case \"second\":\r\n var seconds = date.getUTCSeconds();\r\n date.setUTCSeconds(seconds + count);\r\n break;\r\n case \"millisecond\":\r\n var milliseconds = date.getUTCMilliseconds();\r\n date.setUTCMilliseconds(milliseconds + count);\r\n break;\r\n case \"hour\":\r\n var hours = date.getUTCHours();\r\n date.setUTCHours(hours + count);\r\n break;\r\n case \"minute\":\r\n var minutes = date.getUTCMinutes();\r\n date.setUTCMinutes(minutes + count);\r\n break;\r\n case \"year\":\r\n var year = date.getUTCFullYear();\r\n date.setUTCFullYear(year + count);\r\n break;\r\n case \"month\":\r\n var month = date.getUTCMonth();\r\n date.setUTCMonth(month + count);\r\n break;\r\n case \"week\":\r\n var wday = date.getUTCDate();\r\n date.setUTCDate(wday + count * 7);\r\n break;\r\n }\r\n if (!utc && unit != \"millisecond\") {\r\n date.setUTCMinutes(date.getUTCMinutes() + timeZoneOffset);\r\n if (unit == \"day\" || unit == \"week\" || unit == \"month\" || unit == \"year\") {\r\n var newTimeZoneOffset = date.getTimezoneOffset();\r\n if (newTimeZoneOffset != timeZoneOffset) {\r\n var diff = newTimeZoneOffset - timeZoneOffset;\r\n date.setUTCMinutes(date.getUTCMinutes() + diff);\r\n // solves issues if newe time falls back to old time zone\r\n if (date.getTimezoneOffset() != newTimeZoneOffset) {\r\n date.setUTCMinutes(date.getUTCMinutes() - diff);\r\n }\r\n }\r\n }\r\n }\r\n return date;\r\n}\r\n/**\r\n * \"Rounds\" the date to specific time unit.\r\n *\r\n * @ignore Exclude from docs\r\n * @param date Source date\r\n * @param unit Time unit\r\n * @param count Number of units to round to\r\n * @param firstDateOfWeek First day of week\r\n * @param roundMinutes Minutes to round to (some timezones use non-whole hour)\r\n * @param timezone Use specific named timezone when rounding\r\n * @return New date\r\n */\r\nexport function round(date, unit, count, firstDateOfWeek, utc, firstDate, roundMinutes, timezone) {\r\n if (roundMinutes === void 0) { roundMinutes = 0; }\r\n if (!$type.isNumber(count)) {\r\n count = 1;\r\n }\r\n var timeZoneOffset = 0;\r\n if (timezone && [\"day\", \"month\", \"week\", \"year\"].indexOf(unit) != -1) {\r\n date = setTimezone(date, timezone);\r\n }\r\n if (!utc && unit != \"millisecond\") {\r\n timeZoneOffset = date.getTimezoneOffset();\r\n date.setUTCMinutes(date.getUTCMinutes() - timeZoneOffset);\r\n }\r\n switch (unit) {\r\n case \"day\":\r\n var day = date.getUTCDate();\r\n if (count > 1) {\r\n //\tday = Math.floor(day / count) * count;\r\n if (firstDate) {\r\n firstDate = round(firstDate, \"day\", 1);\r\n var difference = date.getTime() - firstDate.getTime();\r\n var unitCount = Math.floor(difference / getDuration(\"day\") / count);\r\n var duration = getDuration(\"day\", unitCount * count);\r\n date.setTime(firstDate.getTime() + duration - timeZoneOffset * getDuration(\"minute\"));\r\n }\r\n }\r\n else {\r\n date.setUTCDate(day);\r\n }\r\n date.setUTCHours(0, 0, 0, 0);\r\n break;\r\n case \"second\":\r\n var seconds = date.getUTCSeconds();\r\n if (count > 1) {\r\n seconds = Math.floor(seconds / count) * count;\r\n }\r\n date.setUTCSeconds(seconds, 0);\r\n break;\r\n case \"millisecond\":\r\n if (count == 1) {\r\n return date; // much better for perf!\r\n }\r\n var milliseconds = date.getUTCMilliseconds();\r\n milliseconds = Math.floor(milliseconds / count) * count;\r\n date.setUTCMilliseconds(milliseconds);\r\n break;\r\n case \"hour\":\r\n var hours = date.getUTCHours();\r\n if (count > 1) {\r\n hours = Math.floor(hours / count) * count;\r\n }\r\n date.setUTCHours(hours, roundMinutes, 0, 0);\r\n break;\r\n case \"minute\":\r\n var minutes = date.getUTCMinutes();\r\n milliseconds = date.getUTCMilliseconds();\r\n if (count > 1) {\r\n minutes = Math.floor(minutes / count) * count;\r\n }\r\n date.setUTCMinutes(minutes, 0, 0);\r\n break;\r\n case \"month\":\r\n var month = date.getUTCMonth();\r\n if (count > 1) {\r\n month = Math.floor(month / count) * count;\r\n }\r\n date.setUTCMonth(month, 1);\r\n date.setUTCHours(0, roundMinutes, 0, 0);\r\n break;\r\n case \"year\":\r\n var year = date.getUTCFullYear();\r\n if (count > 1) {\r\n year = Math.floor(year / count) * count;\r\n }\r\n date.setUTCFullYear(year, 0, 1);\r\n date.setUTCHours(0, roundMinutes, 0, 0);\r\n //let nonUTCDateY = new Date(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds());\r\n //timeZoneOffset = nonUTCDateY.getTimezoneOffset();\r\n break;\r\n case \"week\":\r\n var wday = date.getUTCDate();\r\n var weekDay = date.getUTCDay();\r\n if (!$type.isNumber(firstDateOfWeek)) {\r\n firstDateOfWeek = 1;\r\n }\r\n // todo: rounding when count is not 1\r\n if (weekDay >= firstDateOfWeek) {\r\n wday = wday - weekDay + firstDateOfWeek;\r\n }\r\n else {\r\n wday = wday - (7 + weekDay) + firstDateOfWeek;\r\n }\r\n date.setUTCDate(wday);\r\n date.setUTCHours(0, roundMinutes, 0, 0);\r\n break;\r\n }\r\n if (!utc && unit != \"millisecond\") {\r\n date.setUTCMinutes(date.getUTCMinutes() + timeZoneOffset);\r\n if (unit == \"day\" || unit == \"week\" || unit == \"month\" || unit == \"year\") {\r\n var newTimeZoneOffset = date.getTimezoneOffset();\r\n if (newTimeZoneOffset != timeZoneOffset) {\r\n var diff = newTimeZoneOffset - timeZoneOffset;\r\n date.setUTCMinutes(date.getUTCMinutes() + diff);\r\n }\r\n }\r\n }\r\n return date;\r\n}\r\n/**\r\n * Returns a new `Date` object which corresponds to the source date in a\r\n * specific timezone.\r\n *\r\n * @since 4.10.1\r\n * @param date Source date\r\n * @param timezone Timezone identifier\r\n * @return Recalculated new Date\r\n */\r\nexport function setTimezone(date, timezone) {\r\n var d = new Date(date.toLocaleString(\"en-US\", { timeZone: timezone }));\r\n return d;\r\n}\r\n/**\r\n * Returns minute fraction of the set timezone.\r\n *\r\n * @since 4.10.12\r\n * @param timezone Timezone identifier\r\n * @return Minutes\r\n */\r\nexport function getTimezoneMinutes(timezone) {\r\n var d = new Date();\r\n d.setHours(0, 0, 0, 0);\r\n var d2 = setTimezone(d, timezone);\r\n return d2.getMinutes();\r\n}\r\n","/**\r\n * A collection of utility functions for various type checks and conversion\r\n * @todo Review unused functions for removal\r\n * @hidden\r\n */\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { percent, isPercent } from \"./Percent\";\r\n/**\r\n * ============================================================================\r\n * TYPE CHECK\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Returns `true` if value is not a number (NaN).\r\n *\r\n * @param value Input value\r\n * @return Is NaN?\r\n * @deprecated Is not used anywhere. JS built-in isNaN is used everywhere. Maybe we don't need this, or if we do, then we should use it everywhere\r\n */\r\nexport function isNaN(value) {\r\n return Number(value) !== value;\r\n}\r\n/**\r\n * Returns a type of the value.\r\n *\r\n * @param value Input value\r\n * @return Type of the value\r\n */\r\nexport function getType(value) {\r\n return ({}).toString.call(value);\r\n}\r\n/**\r\n * Returns a default value if the passed in value is empty.\r\n *\r\n * @param value Input value\r\n * @param optional Default value\r\n * @return Value or default value whichever is available\r\n * @deprecated Not used anywhere\r\n */\r\nexport function getDefault(value, optional) {\r\n return value || optional;\r\n}\r\n/**\r\n * Checks if the passed in value is a string.\r\n *\r\n * @param value Value\r\n * @return Is string?\r\n * @throws {Error}\r\n * @deprecated Not used anywhere\r\n */\r\nexport function checkString(value) {\r\n if (typeof value === \"string\") {\r\n return true;\r\n }\r\n else {\r\n throw new Error(\"Expected a string but got \" + getType(value));\r\n }\r\n}\r\n/**\r\n * Checks if the passed in value is a boolean.\r\n *\r\n * @param value Value\r\n * @return Is boolean?\r\n * @throws {Error}\r\n * @deprecated Not used anywhere\r\n */\r\nexport function checkBoolean(value) {\r\n if (typeof value === \"boolean\") {\r\n return true;\r\n }\r\n else {\r\n throw new Error(\"Expected a boolean but got \" + getType(value));\r\n }\r\n}\r\n/**\r\n * Checks if the passed in value is a number.\r\n *\r\n * @param value Value\r\n * @return Is number?\r\n * @throws {Error}\r\n */\r\nexport function checkNumber(value) {\r\n if (typeof value === \"number\") {\r\n if (isNaN(value)) {\r\n throw new Error(\"Expected a number but got NaN\");\r\n }\r\n }\r\n else {\r\n throw new Error(\"Expected a number but got \" + getType(value));\r\n }\r\n return true;\r\n}\r\n/**\r\n * Checks if the passed in value is an object.\r\n *\r\n * @param value Value\r\n * @return Is object?\r\n * @throws {Error}\r\n * @todo Is the input type correct?\r\n * @deprecated Not used anywhere\r\n */\r\nexport function checkObject(value) {\r\n var t = getType(value);\r\n if (t === \"[object Object]\") {\r\n return true;\r\n }\r\n else {\r\n throw new Error(\"Expected an object but got \" + t);\r\n }\r\n}\r\n/**\r\n * Checks if the passed in value is an array.\r\n *\r\n * @param value Value\r\n * @return Is array?\r\n * @throws {Error}\r\n * @deprecated Not used anywhere\r\n */\r\nexport function checkArray(value) {\r\n if (Array.isArray(value)) {\r\n return true;\r\n }\r\n else {\r\n throw new Error(\"Expected an array but got \" + getType(value));\r\n }\r\n}\r\n/**\r\n * Checks if the passed in value is a Date object.\r\n *\r\n * @param value Value\r\n * @return Is Date object?\r\n * @throws {Error}\r\n * @deprecated Not used anywhere\r\n */\r\nexport function checkDate(value) {\r\n var t = getType(value);\r\n if (t === \"[object Date]\") {\r\n return true;\r\n }\r\n else {\r\n throw new Error(\"Expected a date but got \" + t);\r\n }\r\n}\r\n/**\r\n * ============================================================================\r\n * TYPE CASTING\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Casts string or a number into string.\r\n *\r\n * @param value Input\r\n * @return String value\r\n * @deprecated Not used anywhere\r\n */\r\nexport function castString(value) {\r\n if (typeof value === \"string\") {\r\n return value;\r\n }\r\n else if (typeof value === \"number\") {\r\n return \"\" + value;\r\n }\r\n else {\r\n throw new Error(\"Expected a string or number but got \" + getType(value));\r\n }\r\n}\r\n/**\r\n * Casts string or a number into a number.\r\n *\r\n * @param value Input value\r\n * @return Number value\r\n * @throws {Error}\r\n */\r\nexport function castNumber(value) {\r\n if (typeof value === \"string\") {\r\n var number = +value;\r\n if (isNaN(number)) {\r\n throw new Error(\"Cannot cast string \" + JSON.stringify(value) + \" to a number\");\r\n }\r\n else {\r\n return number;\r\n }\r\n }\r\n else if (typeof value === \"number\") {\r\n if (isNaN(value)) {\r\n throw new Error(\"Expected a number but got NaN\");\r\n }\r\n else {\r\n return value;\r\n }\r\n }\r\n else {\r\n var t = getType(value);\r\n if (t === \"[object Date]\") {\r\n return value.getTime();\r\n }\r\n else {\r\n throw new Error(\"Expected a string, number, or date but got \" + t);\r\n }\r\n }\r\n}\r\n/**\r\n * Casts number, string or Date into a Date object.\r\n *\r\n * @param value Input value\r\n * @return Date object\r\n * @deprecated Not used anywhere\r\n * @throws {Error}\r\n * @hidden\r\n * @deprecated\r\n */\r\n/*export function castDate(value: string | number | Date, formatter?: DateFormatter): Date {\r\n if (typeof value === \"string\") {\r\n if (formatter) {\r\n return formatter.parse(value);\r\n }\r\n return new Date(value);\r\n\r\n } else if (typeof value === \"number\") {\r\n return new Date(value);\r\n\r\n } else {\r\n const t = getType(value);\r\n\r\n if (t === \"[object Date]\") {\r\n return value;\r\n\r\n } else {\r\n throw new Error(\"Expected a string, number, or date but got \" + t);\r\n }\r\n }\r\n}*/\r\n/**\r\n * ============================================================================\r\n * QUICK CONVERSION\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Converts any value into `boolean`.\r\n *\r\n * @param value Source value\r\n * @return `true` or `false`\r\n */\r\nexport function toBoolean(value) {\r\n return value ? true : false;\r\n}\r\n/**\r\n * Converts any value into a `number`.\r\n *\r\n * @param value Source value\r\n * @return Number representation of value\r\n */\r\nexport function toNumber(value) {\r\n if (hasValue(value) && !isNumber(value)) {\r\n var converted = Number(value);\r\n if (isNaN(converted) && isString(value) && value != \"\") {\r\n return toNumber(value.replace(/[^0-9.\\-]+/g, ''));\r\n }\r\n return converted;\r\n }\r\n return value;\r\n}\r\n/**\r\n * Converts any value into a string (text).\r\n *\r\n * @param value Source value\r\n * @return String representation of the input\r\n */\r\nexport function toText(value) {\r\n if (hasValue(value) && !isString(value)) {\r\n if (isNumber(value)) {\r\n return castString(value);\r\n }\r\n else if (isObject(value)) {\r\n return value.toString();\r\n }\r\n }\r\n return value;\r\n}\r\n/**\r\n * Converts any value to a number or [[Percent]].\r\n *\r\n * If the parameter is a string and contains \"%\", it will\r\n * convert it into a [[Percent]].\r\n *\r\n * Otherwise, it will convert into a number.\r\n *\r\n * @param value Number or percent\r\n * @return Percent object\r\n */\r\nexport function toNumberOrPercent(value) {\r\n if (!hasValue(value) || isNumber(value) || isPercent(value)) {\r\n return value;\r\n }\r\n if (isString(value) && value.indexOf(\"%\") != -1) {\r\n return percent(toNumber(value));\r\n }\r\n return toNumber(value);\r\n}\r\n/**\r\n * Checks if a variable has a value.\r\n *\r\n * @param a Input value\r\n * @returns Has value?\r\n */\r\nexport function hasValue(a) {\r\n return a != null;\r\n}\r\n/**\r\n * Returns a value or throws an {Error} exception if the variable has not\r\n * value.\r\n *\r\n * @param a Input value\r\n * @returns Value\r\n */\r\nexport function getValue(a) {\r\n if (hasValue(a)) {\r\n return a;\r\n }\r\n else {\r\n throw new Error(\"Value doesn't exist\");\r\n }\r\n}\r\n/**\r\n * Returns a value, or returns the default value if it doesn't have a value.\r\n *\r\n * @param a Input value\r\n * @returns Value\r\n */\r\nexport function getValueDefault(a, defaultValue) {\r\n if (hasValue(a)) {\r\n return a;\r\n }\r\n else {\r\n return defaultValue;\r\n }\r\n}\r\n/**\r\n * ============================================================================\r\n * TYPE CHECK\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Checks if parameter is `Date`.\r\n *\r\n * @param value Input value\r\n * @return Is Date?\r\n */\r\nexport function isDate(value) {\r\n return getType(value) === \"[object Date]\";\r\n}\r\n/**\r\n * Checks if parameter is `string`.\r\n *\r\n * @param value Input value\r\n * @return Is string?\r\n */\r\nexport function isString(value) {\r\n return typeof value === \"string\";\r\n}\r\n/**\r\n * Checks if parameter is `number`.\r\n *\r\n * @param value Input value\r\n * @return Is number?\r\n */\r\nexport function isNumber(value) {\r\n return typeof value === \"number\" && Number(value) == value;\r\n}\r\n/**\r\n * Checks if parameter is `object`.\r\n *\r\n * @param value Input value\r\n * @return Is object?\r\n */\r\nexport function isObject(value) {\r\n return typeof value === \"object\" && value != null;\r\n}\r\n/**\r\n * Checks if parameter is `Array`.\r\n *\r\n * @param value Input value\r\n * @return Is Array?\r\n */\r\nexport function isArray(value) {\r\n return Array.isArray(value);\r\n}\r\n","/**\r\n * A collection of universal utility functions.\r\n */\r\nimport { Percent } from \"./Percent\";\r\nimport { isSafari } from \"./Browser\";\r\nimport * as $math from \"../utils/Math\";\r\nimport * as $type from \"../utils/Type\";\r\nimport * as $string from \"./String\";\r\nimport * as $strings from \"./Strings\";\r\nimport * as $object from \"./Object\";\r\nimport * as $array from \"./Array\";\r\n/**\r\n * ============================================================================\r\n * MISC FUNCTIONS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Marks a value as being used (e.g. because the value has side effects).\r\n */\r\nexport function used(value) { }\r\n/**\r\n * Copies all properties of one object to the other, omitting undefined.\r\n *\r\n * @param fromObject Source object\r\n * @param toObject Target object\r\n * @return Updated target object\r\n * @todo Maybe consolidate with utils.copy?\r\n */\r\nexport function copyProperties(source, target) {\r\n $object.each(source, function (key, value) {\r\n // only if value is set\r\n if ($type.hasValue(value)) {\r\n target[key] = value;\r\n }\r\n });\r\n return target;\r\n}\r\n/**\r\n * Removes target from url\r\n */\r\nexport function stripHash(url) {\r\n return /^[^#]*/.exec(url)[0];\r\n}\r\nexport function getBaseURI() {\r\n var url = \"#\";\r\n // Needed until https://bugs.webkit.org/show_bug.cgi?id=189499 is fixed\r\n if (isSafari()) {\r\n var baseURI = document.baseURI;\r\n if (baseURI) {\r\n baseURI = stripHash(baseURI);\r\n var loc = stripHash(location.href);\r\n if (baseURI !== loc) {\r\n url = loc + url;\r\n }\r\n }\r\n }\r\n return url;\r\n}\r\n/**\r\n * Copies all properties of one object to the other, omitting undefined, but only if property in target object doesn't have a value set.\r\n *\r\n * @param fromObject Source object\r\n * @param toObject Target object\r\n * @return Updated target object\r\n * @todo Maybe consolidate with utils.copy?\r\n */\r\nexport function softCopyProperties(source, target) {\r\n $object.each(source, function (key, value) {\r\n // only if value is set\r\n if ($type.hasValue(value) && !($type.hasValue(target[key]))) {\r\n target[key] = value;\r\n }\r\n });\r\n return target;\r\n}\r\n/**\r\n * Copies all properties of one object to the other.\r\n *\r\n * @param source Source object\r\n * @param recipient Target object\r\n * @return Updated target object\r\n */\r\nexport function copy(source, target) {\r\n $object.each(source, function (key, value) {\r\n target[key] = value;\r\n });\r\n return target;\r\n}\r\n/**\r\n * Checks if value is not empty (undefined or zero-length string).\r\n *\r\n * @param value Value to check\r\n * @return `true` if value is not \"empty\"\r\n */\r\nexport function isNotEmpty(value) {\r\n return $type.hasValue(value) && (value.toString() !== \"\");\r\n}\r\n/**\r\n * [relativeToValue description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param percent [description]\r\n * @param full [description]\r\n * @return [description]\r\n */\r\nexport function relativeToValue(percent, full) {\r\n if ($type.isNumber(percent)) {\r\n return percent;\r\n }\r\n else if (percent != null && $type.isNumber(percent.value) && $type.isNumber(full)) {\r\n return full * percent.value;\r\n }\r\n else {\r\n return 0;\r\n }\r\n}\r\n/**\r\n * [relativeRadiusToValue description]\r\n *\r\n * Differs from relativeToValue so that if a value is negative, it subtracts\r\n * it from full value.\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param percent [description]\r\n * @param full [description]\r\n * @param subtractIfNegative [description]\r\n * @return [description]\r\n */\r\nexport function relativeRadiusToValue(percent, full, subtractIfNegative) {\r\n var value;\r\n if ($type.isNumber(percent)) {\r\n value = percent;\r\n if (value < 0) {\r\n if (subtractIfNegative) {\r\n value = full + value;\r\n }\r\n else {\r\n value = full - value;\r\n }\r\n }\r\n }\r\n else if (percent != null && $type.isNumber(percent.value)) {\r\n value = full * percent.value;\r\n }\r\n return value;\r\n}\r\n/**\r\n * [valueToRelative description]\r\n *\r\n * @ignore Exclude from docs\r\n * @todo Description\r\n * @param value [description]\r\n * @param full [description]\r\n * @return [description]\r\n */\r\nexport function valueToRelative(value, full) {\r\n if (value instanceof Percent) {\r\n return value.value;\r\n }\r\n else {\r\n return value / full;\r\n }\r\n}\r\n/**\r\n * Returns pixel ratio of the current screen (used on retina displays).\r\n *\r\n * @return Pixel ratio\r\n */\r\nexport function getPixelRatio() {\r\n var ratio = window.devicePixelRatio || 1;\r\n return ratio;\r\n}\r\n/**\r\n * ============================================================================\r\n * STRING FORMATTING FUNCTIONS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Converts camelCased text to dashed version:\r\n * (\"thisIsString\" > \"this-is-string\")\r\n *\r\n * @param str Input\r\n * @return Output\r\n */\r\nexport function camelToDashed(str) {\r\n return str.replace(/\\W+/g, '-').replace(/([a-z\\d])([A-Z])/g, '$1-$2').toLowerCase();\r\n}\r\n/**\r\n * Converts tring to uppercase.\r\n *\r\n * @param str String to convert\r\n * @return uppercased string\r\n * @todo Maybe make it better\r\n */\r\nexport function capitalize(str) {\r\n var arr = str.split(\"\");\r\n arr[0] = arr[0].toUpperCase();\r\n return arr.join(\"\");\r\n}\r\n/**\r\n * Converts any value into its string representation.\r\n *\r\n * @param value Value\r\n * @return String represantation of the value\r\n */\r\nexport function stringify(value) {\r\n return JSON.stringify(value);\r\n}\r\n/**\r\n * Escapes string so it can safely be used in a Regex.\r\n *\r\n * @param value Unsescaped string\r\n * @return Escaped string\r\n */\r\nexport function escapeForRgex(value) {\r\n return value.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&');\r\n}\r\n/**\r\n * Splits the text into multiple lines, respecting maximum character count.\r\n * Prioretizes splitting on spaces and punctuation. Falls back on splitting\r\n * mid-word if there's no other option.\r\n *\r\n * @param text Text\r\n * @param maxChars Maximum number of characters per line\r\n * @return An array of split text\r\n */\r\nexport function splitTextByCharCount(text, maxChars, fullWords, rtl) {\r\n // Maybe the text fits?\r\n if (text.length <= maxChars) {\r\n return [text];\r\n }\r\n // Init result\r\n var res = [];\r\n // Split by words or by charts\r\n if (fullWords) {\r\n // Split by words first\r\n // Split by spacing\r\n var currentIndex = -1;\r\n //let tmpText = text.replace(/([,;:!?\\\\\\/\\.]+[\\s]+|[\\s])/g, $strings.PLACEHOLDER + \"$1\" + $strings.PLACEHOLDER);\r\n var tmpText = text.replace(/([,;:!?\\\\\\/\\.]+|[\\s])/g, $strings.PLACEHOLDER + \"$1\" + $strings.PLACEHOLDER);\r\n var words = tmpText.split($strings.PLACEHOLDER);\r\n // Glue end-of-word punctuation to the word itself\r\n for (var i = 1; i < words.length; i++) {\r\n var word = words[i];\r\n if ((word == \".\" || word == \",\") && words[i - 1].match(/[\\w]+$/)) {\r\n words[i - 1] += word;\r\n words[i] = \"\";\r\n }\r\n }\r\n // Process each word\r\n for (var i = 0; i < words.length; i++) {\r\n // Get word and symbol count\r\n var word = words[i];\r\n var wordLength = word.length;\r\n // Ignore empty words\r\n if (wordLength === 0) {\r\n continue;\r\n }\r\n // Check word length\r\n //if ((wordLength > maxChars) && fullWords !== true) {\r\n if (wordLength > maxChars) {\r\n // A single word is longer than allowed symbol count\r\n // Break it up\r\n if (rtl) {\r\n word = reverseString(word);\r\n }\r\n var parts = word.match(new RegExp(\".{1,\" + maxChars + \"}\", \"g\"));\r\n // TODO is this correct ?\r\n if (parts) {\r\n if (rtl) {\r\n for (var x = 0; x < parts.length; x++) {\r\n parts[x] = reverseString(parts[x]);\r\n }\r\n //parts.reverse();\r\n }\r\n res = res.concat(parts);\r\n }\r\n }\r\n else {\r\n // Init current line\r\n if (currentIndex === -1) {\r\n res.push(\"\");\r\n currentIndex = 0;\r\n }\r\n // Check if we need to break into another line\r\n if (((res[currentIndex].length + wordLength + 1) > maxChars) && res[currentIndex] !== \"\") {\r\n res.push(\"\");\r\n currentIndex++;\r\n }\r\n // Add word\r\n res[currentIndex] += word;\r\n }\r\n // Update index\r\n currentIndex = res.length - 1;\r\n }\r\n }\r\n else {\r\n // Splitting by anywhere (living la vida facil)\r\n var parts = text.match(new RegExp(\".{1,\" + maxChars + \"}\", \"g\"));\r\n if (parts) {\r\n if (rtl) {\r\n for (var x = 0; x < parts.length; x++) {\r\n parts[x] = reverseString(parts[x]);\r\n }\r\n }\r\n res = parts;\r\n }\r\n }\r\n // Do we have only one word that does not fit?\r\n // Since fullWords is set and we can't split the word, we end up with empty\r\n // set.\r\n if (res.length == 1 && fullWords && (res[0].length > maxChars)) {\r\n res = [];\r\n }\r\n return res;\r\n}\r\n/**\r\n * Truncates the text to certain character count.\r\n *\r\n * Will add ellipsis if the string is truncated. Optionally, can truncate on\r\n * full words only.\r\n *\r\n * For RTL support, pass in the fifth parameter as `true`.\r\n *\r\n * @param text Input text\r\n * @param maxChars Maximum character count of output\r\n * @param ellipsis Ellipsis string, i.e. \"...\"\r\n * @param fullWords If `true`, will not break mid-word, unless there's a single word and it does not with into `maxChars`\r\n * @param rtl Is this an RTL text?\r\n * @return Truncated text\r\n */\r\nexport function truncateWithEllipsis(text, maxChars, ellipsis, fullWords, rtl) {\r\n if (text.length <= maxChars) {\r\n return text;\r\n }\r\n // Calc max chars\r\n maxChars -= ellipsis.length;\r\n if (maxChars < 1) {\r\n maxChars = 1;\r\n //ellipsis = \"\";\r\n }\r\n // Get lines\r\n var lines = splitTextByCharCount(text, maxChars, fullWords, rtl);\r\n // Use first line\r\n return (lines[0] || \"\") + ellipsis;\r\n}\r\n/**\r\n * Removes whitespace from beginning and end of the string.\r\n *\r\n * @param str Input\r\n * @return Output\r\n */\r\nexport function trim(str) {\r\n return str.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, \"\");\r\n}\r\n;\r\n/**\r\n * Removes whitespace from end of the string.\r\n *\r\n * @param str Input\r\n * @return Output\r\n */\r\nexport function rtrim(str) {\r\n return str.replace(/[\\s\\uFEFF\\xA0]+$/g, \"\");\r\n}\r\n;\r\n/**\r\n * Removes whitespace from beginning of the string.\r\n *\r\n * @param str Input\r\n * @return Output\r\n */\r\nexport function ltrim(str) {\r\n return str.replace(/^[\\s\\uFEFF\\xA0]+/g, \"\");\r\n}\r\n;\r\n/**\r\n * Reverses string.\r\n *\r\n * @param str Input\r\n * @return Output\r\n */\r\nexport function reverseString(str) {\r\n return str.split(\"\").reverse().join(\"\");\r\n}\r\n/**\r\n * Removes quotes from the string.\r\n *\r\n * @param str Input\r\n * @return Output\r\n */\r\nexport function unquote(str) {\r\n var res = str.trim();\r\n res = str.replace(/^'(.*)'$/, \"$1\");\r\n if (res == str) {\r\n res = str.replace(/^\"(.*)\"$/, \"$1\");\r\n }\r\n return res;\r\n}\r\n/**\r\n * Pads a string with additional characters to certain length.\r\n *\r\n * @param value A numeric value\r\n * @param len Result string length in characters\r\n * @param char A character to use for padding\r\n * @return Padded value as string\r\n */\r\nexport function padString(value, len, char) {\r\n if (len === void 0) { len = 0; }\r\n if (char === void 0) { char = \"0\"; }\r\n if (typeof value !== \"string\") {\r\n value = value.toString();\r\n }\r\n return len > value.length ? Array(len - value.length + 1).join(char) + value : value;\r\n}\r\n/**\r\n * Tries to determine format type.\r\n *\r\n * @ignore Exclude from docs\r\n * @param format Format string\r\n * @return Format type (\"string\" | \"number\" | \"date\" | \"duration\")\r\n */\r\nexport function getFormat(format) {\r\n // Undefined?\r\n if (typeof format === \"undefined\") {\r\n return $strings.STRING;\r\n }\r\n // Cleanup and lowercase format\r\n format = format.toLowerCase().replace(/^\\[[^\\]]*\\]/, \"\");\r\n // Remove style tags\r\n format = format.replace(/\\[[^\\]]+\\]/, \"\");\r\n // Trim\r\n format = format.trim();\r\n // Check for any explicit format hints (i.e. /Date)\r\n var hints = format.match(/\\/(date|number|duration)$/);\r\n if (hints) {\r\n return hints[1];\r\n }\r\n // Check for explicit hints\r\n if (format === $strings.NUMBER) {\r\n return $strings.NUMBER;\r\n }\r\n if (format === $strings.DATE) {\r\n return $strings.DATE;\r\n }\r\n if (format === $strings.DURATION) {\r\n return $strings.DURATION;\r\n }\r\n // Detect number formatting symbols\r\n if (format.match(/[#0]/)) {\r\n return $strings.NUMBER;\r\n }\r\n // Detect date formatting symbols\r\n if (format.match(/[ymwdhnsqaxkzgtei]/)) {\r\n return $strings.DATE;\r\n }\r\n // Nothing? Let's display as string\r\n return $strings.STRING;\r\n}\r\n/**\r\n * Cleans up format:\r\n * * Strips out formatter hints\r\n *\r\n * @ignore Exclude from docs\r\n * @param format Format\r\n * @return Cleaned format\r\n */\r\nexport function cleanFormat(format) {\r\n return format.replace(/\\/(date|number|duration)$/i, \"\");\r\n}\r\n/**\r\n * Strips all tags from the string.\r\n *\r\n * @param text Source string\r\n * @return String without tags\r\n */\r\nexport function stripTags(text) {\r\n return text ? text.replace(/<[^>]*>/g, \"\") : text;\r\n}\r\n/**\r\n * Removes new lines and tags from a string.\r\n *\r\n * @param text String to conver\r\n * @return Converted string\r\n */\r\nexport function plainText(text) {\r\n return text ? stripTags((\"\" + text).replace(/[\\n\\r]+/g, \". \")) : text;\r\n}\r\n/**\r\n * ============================================================================\r\n * TYPE CONVERSION FUNCTIONS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Converts numeric value into string. Deals with large or small numbers that\r\n * would otherwise use exponents.\r\n *\r\n * @param value Numeric value\r\n * @return Numeric value as string\r\n */\r\nexport function numberToString(value) {\r\n // TODO handle Infinity and -Infinity\r\n if ($type.isNaN(value)) {\r\n return \"NaN\";\r\n }\r\n if (value === Infinity) {\r\n return \"Infinity\";\r\n }\r\n if (value === -Infinity) {\r\n return \"-Infinity\";\r\n }\r\n // Negative 0\r\n if ((value === 0) && (1 / value === -Infinity)) {\r\n return \"-0\";\r\n }\r\n // Preserve negative and deal with absoute values\r\n var negative = value < 0;\r\n value = Math.abs(value);\r\n // TODO test this\r\n var parsed = $type.getValue(/^([0-9]+)(?:\\.([0-9]+))?(?:e[\\+\\-]([0-9]+))?$/.exec(\"\" + value));\r\n var digits = parsed[1];\r\n var decimals = parsed[2] || \"\";\r\n var res;\r\n // Leave the nummber as it is if it does not use exponents\r\n if (parsed[3] == null) {\r\n res = (decimals === \"\" ? digits : digits + \".\" + decimals);\r\n }\r\n else {\r\n var exponent = +parsed[3];\r\n // Deal with decimals\r\n if (value < 1) {\r\n var zeros = exponent - 1;\r\n res = \"0.\" + $string.repeat(\"0\", zeros) + digits + decimals;\r\n // Deal with integers\r\n }\r\n else {\r\n var zeros = exponent - decimals.length;\r\n if (zeros === 0) {\r\n res = digits + decimals;\r\n }\r\n else if (zeros < 0) {\r\n res = digits + decimals.slice(0, zeros) + \".\" + decimals.slice(zeros);\r\n }\r\n else {\r\n res = digits + decimals + $string.repeat(\"0\", zeros);\r\n }\r\n }\r\n }\r\n return negative ? \"-\" + res : res;\r\n}\r\n/**\r\n * Converts anything to Date object.\r\n *\r\n * @param value A value of any type\r\n * @return Date object representing a value\r\n */\r\nexport function anyToDate(value) {\r\n if ($type.isDate(value)) {\r\n // TODO maybe don't create a new Date ?\r\n return new Date(value);\r\n }\r\n else if ($type.isNumber(value)) {\r\n return new Date(value);\r\n }\r\n else {\r\n // Try converting to number (assuming timestamp)\r\n var num = Number(value);\r\n if (!$type.isNumber(num)) {\r\n return new Date(value);\r\n }\r\n else {\r\n return new Date(num);\r\n }\r\n }\r\n}\r\n/**\r\n * Tries converting any value to a number.\r\n *\r\n * @param value Source value\r\n * @return Number\r\n */\r\nexport function anyToNumber(value) {\r\n if ($type.isDate(value)) {\r\n return value.getTime();\r\n }\r\n else if ($type.isNumber(value)) {\r\n return value;\r\n }\r\n else if ($type.isString(value)) {\r\n // Try converting to number (assuming timestamp)\r\n var num = Number(value);\r\n if (!$type.isNumber(num)) {\r\n // Failing\r\n return undefined;\r\n }\r\n else {\r\n return num;\r\n }\r\n }\r\n}\r\n/**\r\n * ============================================================================\r\n * DATE-RELATED FUNCTIONS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Returns a year day.\r\n *\r\n * @param date Date\r\n * @param utc Assume UTC dates?\r\n * @return Year day\r\n * @todo Account for UTC\r\n */\r\nexport function getYearDay(date, utc) {\r\n if (utc === void 0) { utc = false; }\r\n var start = new Date(date.getFullYear(), 0, 0);\r\n var diff = (date.getTime() - start.getTime()) + ((start.getTimezoneOffset() - date.getTimezoneOffset()) * 60 * 1000);\r\n var oneDay = 1000 * 60 * 60 * 24;\r\n return Math.floor(diff / oneDay);\r\n}\r\n/**\r\n * Returns week number for a given date.\r\n *\r\n * @param date Date\r\n * @param utc Assume UTC dates?\r\n * @return Week number\r\n * @todo Account for UTC\r\n */\r\nexport function getWeek(date, utc) {\r\n if (utc === void 0) { utc = false; }\r\n var day = getYearDay(date, utc) - 1;\r\n var week = Math.floor((day - (date.getDay() || 7) + 10) / 7);\r\n if (week === 0) {\r\n week = 53;\r\n }\r\n else if (week === 53) {\r\n week = 1;\r\n }\r\n return week;\r\n}\r\n/**\r\n * Returns a week number in the month.\r\n *\r\n * @param date Source Date\r\n * @param utc Assume UTC dates?\r\n * @return Week number in month\r\n */\r\nexport function getMonthWeek(date, utc) {\r\n if (utc === void 0) { utc = false; }\r\n var firstWeek = getWeek(new Date(date.getFullYear(), date.getMonth(), 1), utc);\r\n var currentWeek = getWeek(date, utc);\r\n if (currentWeek == 1) {\r\n currentWeek = 53;\r\n }\r\n return currentWeek - firstWeek + 1;\r\n}\r\n/**\r\n * Returns a year day out of the given week number.\r\n *\r\n * @param week Week\r\n * @param year Year\r\n * @param weekday Weekday\r\n * @param utc Assume UTC dates\r\n * @return Day in a year\r\n */\r\nexport function getDayFromWeek(week, year, weekday, utc) {\r\n if (weekday === void 0) { weekday = 1; }\r\n if (utc === void 0) { utc = false; }\r\n var date = new Date(year, 0, 4, 0, 0, 0, 0);\r\n if (utc) {\r\n date.setUTCFullYear(year);\r\n }\r\n var day = week * 7 + weekday - ((date.getDay() || 7) + 3);\r\n return day;\r\n}\r\n/**\r\n * Returns 12-hour representation out of the 24-hour hours.\r\n *\r\n * @param hours 24-hour number\r\n * @return 12-hour number\r\n */\r\nexport function get12Hours(hours, base) {\r\n if (hours > 12) {\r\n hours -= 12;\r\n }\r\n else if (hours === 0) {\r\n hours = 12;\r\n }\r\n return $type.hasValue(base) ? hours + (base - 1) : hours;\r\n}\r\n/**\r\n * Returns a string name of the tome zone.\r\n *\r\n * @param date Date object\r\n * @param long Should return long (\"Pacific Standard Time\") or short abbreviation (\"PST\")\r\n * @param savings Include information if it's in daylight savings mode\r\n * @param utc Assume UTC dates\r\n * @return Time zone name\r\n */\r\nexport function getTimeZone(date, long, savings, utc) {\r\n if (long === void 0) { long = false; }\r\n if (savings === void 0) { savings = false; }\r\n if (utc === void 0) { utc = false; }\r\n if (utc) {\r\n return long ? \"Coordinated Universal Time\" : \"UTC\";\r\n }\r\n var wotz = date.toLocaleString(\"UTC\");\r\n var wtz = date.toLocaleString(\"UTC\", { timeZoneName: long ? \"long\" : \"short\" }).substr(wotz.length);\r\n //wtz = wtz.replace(/[+-]+[0-9]+$/, \"\");\r\n if (savings === false) {\r\n wtz = wtz.replace(/ (standard|daylight|summer|winter) /i, \" \");\r\n }\r\n return wtz;\r\n}\r\n/**\r\n * ============================================================================\r\n * NUMBER-RELATED FUNCTIONS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Returns a random number between `from` and `to`.\r\n *\r\n * @param from From number\r\n * @param to To number\r\n * @return Random number\r\n */\r\nexport function random(from, to) {\r\n return Math.floor(Math.random() * (to - from)) + from;\r\n}\r\n/**\r\n * Fits the number into specific `min` and `max` bounds.\r\n *\r\n * @param value Input value\r\n * @param min Minimum value\r\n * @param max Maximum value\r\n * @return Possibly adjusted value\r\n */\r\nexport function fitNumber(value, min, max) {\r\n if (value > max) {\r\n return max;\r\n }\r\n else if (value < min) {\r\n return min;\r\n }\r\n return value;\r\n}\r\n/**\r\n * Fits the number into specific `min` and `max` bounds.\r\n *\r\n * If the value is does not fit withing specified range, it \"wraps\" around the\r\n * values.\r\n *\r\n * For example, if we have input value 10 with min set at 1 and max set at 8,\r\n * the value will not fit. The remainder that does not fit (2) will be added\r\n * to `min`, resulting in 3.\r\n *\r\n * The output of regular `fitNumber()` would return 8 instead.\r\n *\r\n * @param value Input value\r\n * @param min Minimum value\r\n * @param max Maximum value\r\n * @return Possibly adjusted value\r\n */\r\nexport function fitNumberRelative(value, min, max) {\r\n var gap = max - min;\r\n if (value > max) {\r\n value = min + (value - gap * Math.floor(value / gap));\r\n }\r\n else if (value < min) {\r\n value = min + (value - gap * Math.floor(value / gap));\r\n }\r\n return value;\r\n}\r\n/**\r\n * ============================================================================\r\n * SPRITE-RELATED FUNCTIONS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Converts SVG element coordinates to coordinates within specific [[Sprite]].\r\n *\r\n * @param point SVG coordinates\r\n * @param sprite Sprite\r\n * @return Sprite coordinates\r\n */\r\nexport function svgPointToSprite(point, sprite) {\r\n var x = point.x;\r\n var y = point.y;\r\n var sprites = [];\r\n if (sprite) {\r\n while ($type.hasValue(sprite.parent)) {\r\n sprites.push(sprite);\r\n sprite = sprite.parent;\r\n }\r\n sprites.reverse();\r\n for (var i = 0; i < sprites.length; i++) {\r\n var sprite_1 = sprites[i];\r\n var angle = sprite_1.rotation;\r\n var relativeX = x - sprite_1.pixelX - sprite_1.ex;\r\n var relativeY = y - sprite_1.pixelY - sprite_1.ey;\r\n if (sprite_1.dx) {\r\n x -= sprite_1.dx;\r\n }\r\n if (sprite_1.dy) {\r\n y -= sprite_1.dy;\r\n }\r\n var scale = sprite_1.scale;\r\n // this handles nonscaling\r\n if (sprite_1.group) {\r\n scale = sprite_1.group.scale;\r\n }\r\n x = ($math.cos(-angle) * relativeX - $math.sin(-angle) * relativeY) / scale - sprite_1.pixelPaddingLeft;\r\n y = ($math.cos(-angle) * relativeY + $math.sin(-angle) * relativeX) / scale - sprite_1.pixelPaddingTop;\r\n }\r\n }\r\n return { x: x, y: y };\r\n}\r\n/**\r\n * Converts coordinates within [[Sprite]] to coordinates relative to the whole\r\n * SVG element.\r\n *\r\n * @param point Sprite coordinates\r\n * @param sprite Sprite\r\n * @return SVG coordinates\r\n */\r\nexport function spritePointToSvg(point, sprite) {\r\n var x = point.x;\r\n var y = point.y;\r\n if (sprite) {\r\n while ($type.hasValue(sprite.parent)) {\r\n var angle = sprite.rotation;\r\n x += sprite.pixelPaddingLeft + sprite.ex;\r\n y += sprite.pixelPaddingTop + sprite.ey;\r\n var scale = sprite.scale;\r\n // this handles nonscaling\r\n if (sprite.group) {\r\n scale = sprite.group.scale;\r\n }\r\n var relativeX = sprite.pixelX + ((x * $math.cos(angle) - y * $math.sin(angle))) * scale;\r\n var relativeY = sprite.pixelY + ((x * $math.sin(angle) + y * $math.cos(angle))) * scale;\r\n if (sprite.dx) {\r\n relativeX += sprite.dx;\r\n }\r\n if (sprite.dy) {\r\n relativeY += sprite.dy;\r\n }\r\n x = relativeX;\r\n y = relativeY;\r\n sprite = sprite.parent;\r\n }\r\n }\r\n return { x: x, y: y };\r\n}\r\n/**\r\n * Converts coordinates of one sprite to another.\r\n *\r\n * @param point Sprite coordinates\r\n * @param sprite Sprite\r\n * @param toSprite Sprite\r\n * @return converted coordinates\r\n */\r\nexport function spritePointToSprite(point, sprite, toSprite) {\r\n return svgPointToSprite(spritePointToSvg(point, sprite), toSprite);\r\n}\r\n/**\r\n * Converts a rectangle expressed in SVG element coordinates to coordinates\r\n * within specific [[Sprite]].\r\n *\r\n * @param rect SVG rectangle\r\n * @param sprite Sprite\r\n * @return Sprite rectangle\r\n */\r\nexport function svgRectToSprite(rect, sprite) {\r\n var p1 = svgPointToSprite(rect, sprite);\r\n var p2 = svgPointToSprite({ x: rect.x + rect.width, y: rect.y + rect.height }, sprite);\r\n return { x: p1.x, y: p1.y, width: p2.x - p1.x, height: p2.y - p1.y };\r\n}\r\n/**\r\n * Converts a rectangle expressed in [[Sprite]] coordinates to SVG coordinates.\r\n *\r\n * @param rect Sprite rectangle\r\n * @param sprite Sprite\r\n * @return SVG rectangle\r\n */\r\nexport function spriteRectToSvg(rect, sprite) {\r\n var p1 = spritePointToSvg(rect, sprite);\r\n var p2 = spritePointToSvg({ x: rect.x + rect.width, y: rect.y + rect.height }, sprite);\r\n return { x: p1.x, y: p1.y, width: p2.x - p1.x, height: p2.y - p1.y };\r\n}\r\n/**\r\n * Converts global document-wide coordinates to coordinates within SVG element.\r\n *\r\n * @param point Global coordinates\r\n * @param svgContainer SVG element\r\n * @return SVG coordinates\r\n */\r\nexport function documentPointToSvg(point, svgContainer, cssScale) {\r\n try {\r\n var bbox = svgContainer.getBoundingClientRect();\r\n if (!$type.isNumber(cssScale)) {\r\n cssScale = 1;\r\n }\r\n return {\r\n \"x\": (point.x - bbox.left) / cssScale,\r\n \"y\": (point.y - bbox.top) / cssScale\r\n };\r\n }\r\n catch (e) {\r\n return point;\r\n }\r\n}\r\n/**\r\n * Converts SVG coordinates to global document-wide coordinates.\r\n *\r\n * @param point SVG coordinates\r\n * @param svgContainer SVG element\r\n * @return Global coordinates\r\n */\r\nexport function svgPointToDocument(point, svgContainer) {\r\n try {\r\n var bbox = svgContainer.getBoundingClientRect();\r\n return {\r\n \"x\": point.x + bbox.left,\r\n \"y\": point.y + bbox.top\r\n };\r\n }\r\n catch (e) {\r\n return point;\r\n }\r\n}\r\n/**\r\n * Converts document-wide global coordinates to coordinates within specific\r\n * [[Sprite]].\r\n *\r\n * @param point Global coordinates\r\n * @param sprite Sprite\r\n * @return Sprite coordinates\r\n */\r\nexport function documentPointToSprite(point, sprite) {\r\n if (sprite && sprite.htmlContainer) {\r\n var svgPoint = documentPointToSvg(point, $type.getValue(sprite.htmlContainer), sprite.svgContainer.cssScale);\r\n return svgPointToSprite(svgPoint, sprite);\r\n }\r\n else {\r\n return point;\r\n }\r\n}\r\n/**\r\n * Converts coordinates within [[Sprite]] to global document coordinates.\r\n *\r\n * @param point Sprite coordinates\r\n * @param sprite Sprite\r\n * @return Global coordinates\r\n */\r\nexport function spritePointToDocument(point, sprite) {\r\n if (sprite && sprite.htmlContainer) {\r\n var svgPoint = spritePointToSvg(point, sprite);\r\n return svgPointToDocument(svgPoint, $type.getValue(sprite.htmlContainer));\r\n }\r\n else {\r\n return point;\r\n }\r\n}\r\n/**\r\n * ============================================================================\r\n * DEPRECATED FUNCTIONS\r\n * @todo Review and remove\r\n * ============================================================================\r\n * @hidden\r\n */\r\n/**\r\n * Returns element's width.\r\n *\r\n * @ignore Exclude from docs\r\n * @param element Element\r\n * @return Width (px)\r\n * @deprecated Not used anywhere\r\n */\r\nexport function width(element) {\r\n var cs = getComputedStyle(element);\r\n var paddingX = parseFloat(cs.paddingLeft) + parseFloat(cs.paddingRight);\r\n var borderX = parseFloat(cs.borderLeftWidth) + parseFloat(cs.borderRightWidth);\r\n return element.clientWidth - paddingX - borderX;\r\n}\r\n/**\r\n * Returns element's height.\r\n *\r\n * @ignore Exclude from docs\r\n * @param element Element\r\n * @return Height (px)\r\n * @deprecated Not used anywhere\r\n */\r\nexport function height(element) {\r\n var cs = getComputedStyle(element);\r\n var paddingY = parseFloat(cs.paddingTop) + parseFloat(cs.paddingBottom);\r\n var borderY = parseFloat(cs.borderTopWidth) + parseFloat(cs.borderBottomWidth);\r\n return element.clientHeight - paddingY - borderY;\r\n}\r\n/**\r\n * Returns number of decimals\r\n *\r\n * @ignore Exclude from docs\r\n * @param number Input number\r\n * @return Number of decimals\r\n */\r\nexport function decimalPlaces(number) {\r\n var match = ('' + number).match(/(?:\\.(\\d+))?(?:[eE]([+-]?\\d+))?$/);\r\n if (!match) {\r\n return 0;\r\n }\r\n return Math.max(0, (match[1] ? match[1].length : 0) - (match[2] ? +match[2] : 0));\r\n}\r\nvar urlRegexp = /^([a-zA-Z][a-zA-Z0-9\\+\\.\\-]*:)?(?:(\\/\\/)([^\\@]+\\@)?([^\\/\\?\\#\\:]*)(\\:[0-9]+)?)?([^\\?\\#]*)(\\?[^\\#]*)?(\\#.*)?$/;\r\n/**\r\n * Parses a URL\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n// TODO test this\r\nexport function parseUrl(url) {\r\n var match = urlRegexp.exec(url);\r\n return {\r\n protocol: (match && match[1]) || \"\",\r\n separator: (match && match[2]) || \"\",\r\n authority: (match && match[3]) || \"\",\r\n domain: (match && match[4]) || \"\",\r\n port: (match && match[5]) || \"\",\r\n path: (match && match[6]) || \"\",\r\n query: (match && match[7]) || \"\",\r\n hash: (match && match[8]) || \"\"\r\n };\r\n}\r\n/**\r\n * Serializes a Url into a string\r\n *\r\n * @ignore Exclude from docs\r\n */\r\nexport function serializeUrl(url) {\r\n return url.protocol + url.separator + url.authority + url.domain + url.port + url.path + url.query + url.hash;\r\n}\r\n/**\r\n * Checks whether a Url is relative or not\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n// TODO is this correct ?\r\nfunction isRelativeUrl(url) {\r\n return url.protocol === \"\" &&\r\n url.separator === \"\" &&\r\n url.authority === \"\" &&\r\n url.domain === \"\" &&\r\n url.port === \"\";\r\n}\r\n/**\r\n * Joins together two URLs, resolving relative URLs correctly\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n// TODO test this\r\nexport function joinUrl(left, right) {\r\n var parsedLeft = parseUrl(left);\r\n var parsedRight = parseUrl(right);\r\n if (isRelativeUrl(parsedLeft)) {\r\n throw new Error(\"Left URL is not absolute\");\r\n }\r\n if (isRelativeUrl(parsedRight)) {\r\n // TODO is this correct ?\r\n if (parsedRight.path !== \"\") {\r\n if (parsedRight.path[0] === \"/\") {\r\n parsedLeft.path = parsedRight.path;\r\n // TODO is this correct ?\r\n }\r\n else {\r\n var leftPath = parsedLeft.path.split(/\\//);\r\n var rightPath = parsedRight.path.split(/\\//);\r\n // TODO is this correct ?\r\n if (leftPath.length === 0) {\r\n if (rightPath.length !== 0) {\r\n leftPath.push(\"\");\r\n }\r\n }\r\n else if (leftPath.length > 1) {\r\n leftPath.pop();\r\n }\r\n $array.pushAll(leftPath, rightPath);\r\n parsedLeft.path = leftPath.join(\"/\");\r\n if (parsedLeft.path !== \"\" && parsedLeft.path[0] !== \"/\") {\r\n throw new Error(\"URL path must start with /\");\r\n }\r\n }\r\n }\r\n // TODO is this correct ?\r\n parsedLeft.query = parsedRight.query;\r\n parsedLeft.hash = parsedRight.hash;\r\n return serializeUrl(parsedLeft);\r\n }\r\n else {\r\n return serializeUrl(parsedRight);\r\n }\r\n}\r\n/**\r\n * Detects MSIE.\r\n *\r\n * @return Is IE?\r\n */\r\nexport function isIE() {\r\n return !!window.MSInputMethodContext && !!document.documentMode;\r\n}\r\n","/**\r\n * This module defines a [[Validatable]] class which can be used by all\r\n * non-[[Sprite]] classes to use system beats to revalidate themselves.\r\n */\r\nimport { __extends } from \"tslib\";\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { BaseObjectEvents } from \"../Base\";\r\nimport { registry } from \"../Registry\";\r\n/**\r\n * This module defines a [[Validatable]] class which can be used by all\r\n * non-[[Sprite]] classes to use system update cycle to revalidate themselves.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\nvar Validatable = /** @class */ (function (_super) {\r\n __extends(Validatable, _super);\r\n function Validatable() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n /**\r\n * Is invalid and should be revalidated?\r\n */\r\n _this._validateDisposer = null;\r\n return _this;\r\n }\r\n /**\r\n * Invalidates the element, so that it can re-validate/redraw itself in the\r\n * next cycle.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Validatable.prototype.invalidate = function () {\r\n if (this._validateDisposer === null) {\r\n this._validateDisposer = registry.events.on(\"exitframe\", this.validate, this);\r\n }\r\n };\r\n /**\r\n * Validates itself.\r\n *\r\n * Most probably the extending class will have an overriding `validate()`\r\n * method which will do actual work, as well as call this method using\r\n * `super.validate()`.\r\n *\r\n * @ignore Exclude from docs\r\n */\r\n Validatable.prototype.validate = function () {\r\n if (this._validateDisposer !== null) {\r\n this._validateDisposer.dispose();\r\n this._validateDisposer = null;\r\n }\r\n };\r\n Validatable.prototype.dispose = function () {\r\n if (this._validateDisposer !== null) {\r\n this._validateDisposer.dispose();\r\n this._validateDisposer = null;\r\n }\r\n _super.prototype.dispose.call(this);\r\n };\r\n return Validatable;\r\n}(BaseObjectEvents));\r\nexport { Validatable };\r\n","import { is } from \"../core/Registry\";\r\nvar theme = function (object) {\r\n if (is(object, \"SpriteState\")) {\r\n object.transitionDuration = 400;\r\n }\r\n if (is(object, \"Component\")) {\r\n object.rangeChangeDuration = 500;\r\n object.interpolationDuration = 500;\r\n object.sequencedInterpolation = false;\r\n if (is(object, \"SankeyDiagram\")) {\r\n object.sequencedInterpolation = true;\r\n }\r\n if (is(object, \"FunnelSeries\")) {\r\n object.sequencedInterpolation = true;\r\n }\r\n }\r\n if (is(object, \"Chart\")) {\r\n object.defaultState.transitionDuration = 2000;\r\n object.hiddenState.transitionDuration = 1000;\r\n }\r\n if (is(object, \"Tooltip\")) {\r\n object.animationDuration = 400;\r\n object.defaultState.transitionDuration = 400;\r\n object.hiddenState.transitionDuration = 400;\r\n }\r\n if (is(object, \"Scrollbar\")) {\r\n object.animationDuration = 500;\r\n }\r\n if (is(object, \"Series\")) {\r\n object.defaultState.transitionDuration = 1000;\r\n object.hiddenState.transitionDuration = 700;\r\n object.hiddenState.properties.opacity = 1;\r\n object.showOnInit = true;\r\n }\r\n if (is(object, \"MapSeries\")) {\r\n object.hiddenState.properties.opacity = 0;\r\n }\r\n if (is(object, \"PercentSeries\")) {\r\n object.hiddenState.properties.opacity = 0;\r\n }\r\n if (is(object, \"FunnelSlice\")) {\r\n object.defaultState.transitionDuration = 800;\r\n object.hiddenState.transitionDuration = 1000;\r\n object.hiddenState.properties.opacity = 1;\r\n }\r\n if (is(object, \"Slice\")) {\r\n object.defaultState.transitionDuration = 700;\r\n object.hiddenState.transitionDuration = 1000;\r\n object.hiddenState.properties.opacity = 1;\r\n }\r\n if (is(object, \"Preloader\")) {\r\n object.hiddenState.transitionDuration = 2000;\r\n }\r\n if (is(object, \"Column\")) {\r\n object.defaultState.transitionDuration = 700;\r\n object.hiddenState.transitionDuration = 1000;\r\n object.hiddenState.properties.opacity = 1;\r\n }\r\n if (is(object, \"Column3D\")) {\r\n object.hiddenState.properties.opacity = 0;\r\n }\r\n};\r\nexport default theme;\r\n","/**\r\n * This module houses all core/framework functionality and is required for\r\n * all charting components to work\r\n */\r\n/**\r\n * Elements: core\r\n */\r\nexport { System, system } from \"./.internal/core/System\";\r\nexport { BaseObject, BaseObjectEvents } from \"./.internal/core/Base\";\r\nexport { Component } from \"./.internal/core/Component\";\r\nexport { Container } from \"./.internal/core/Container\";\r\nexport { DataItem } from \"./.internal/core/DataItem\";\r\nexport { Sprite } from \"./.internal/core/Sprite\";\r\nexport { SpriteEventDispatcher } from \"./.internal/core/SpriteEvents\";\r\nexport { SpriteState } from \"./.internal/core/SpriteState\";\r\nexport { registry, Registry, is } from \"./.internal/core/Registry\";\r\nexport { options } from \"./.internal/core/Options\";\r\n/**\r\n * Elements: data\r\n */\r\nexport { CSVParser } from \"./.internal/core/data/CSVParser\";\r\nexport { DataLoader, dataLoader } from \"./.internal/core/data/DataLoader\";\r\nexport { DataParser } from \"./.internal/core/data/DataParser\";\r\nexport { DataSource } from \"./.internal/core/data/DataSource\";\r\nexport { JSONParser } from \"./.internal/core/data/JSONParser\";\r\nexport { SVGDefaults } from \"./.internal/core/defs/SVGDefaults\";\r\n/**\r\n * Elements: elements\r\n */\r\nexport { Button } from \"./.internal/core/elements/Button\";\r\nexport { Circle } from \"./.internal/core/elements/Circle\";\r\nexport { Ellipse } from \"./.internal/core/elements/Ellipse\";\r\nexport { Image } from \"./.internal/core/elements/Image\";\r\nexport { Label } from \"./.internal/core/elements/Label\";\r\nexport { Line } from \"./.internal/core/elements/Line\";\r\nexport { Popup } from \"./.internal/core/elements/Popup\";\r\nexport { Modal } from \"./.internal/core/elements/Modal\";\r\nexport { PointedRectangle } from \"./.internal/core/elements/PointedRectangle\";\r\nexport { PointedShape } from \"./.internal/core/elements/PointedShape\";\r\nexport { Polyarc } from \"./.internal/core/elements/Polyarc\";\r\nexport { Polygon } from \"./.internal/core/elements/Polygon\";\r\nexport { Polyline } from \"./.internal/core/elements/Polyline\";\r\nexport { Polyspline } from \"./.internal/core/elements/Polyspline\";\r\nexport { Preloader } from \"./.internal/core/elements/Preloader\";\r\nexport { Rectangle } from \"./.internal/core/elements/Rectangle\";\r\nexport { ResizeButton } from \"./.internal/core/elements/ResizeButton\";\r\nexport { CloseButton } from \"./.internal/core/elements/CloseButton\";\r\nexport { SwitchButton } from \"./.internal/core/elements/SwitchButton\";\r\nexport { RoundedRectangle } from \"./.internal/core/elements/RoundedRectangle\";\r\nexport { Scrollbar } from \"./.internal/core/elements/Scrollbar\";\r\nexport { Slider } from \"./.internal/core/elements/Slider\";\r\nexport { Slice } from \"./.internal/core/elements/Slice\";\r\nexport { TextLink } from \"./.internal/core/elements/TextLink\";\r\nexport { Tooltip } from \"./.internal/core/elements/Tooltip\";\r\nexport { Trapezoid } from \"./.internal/core/elements/Trapezoid\";\r\nexport { Triangle } from \"./.internal/core/elements/Triangle\";\r\nexport { WavedCircle } from \"./.internal/core/elements/WavedCircle\";\r\nexport { WavedLine } from \"./.internal/core/elements/WavedLine\";\r\nexport { WavedRectangle } from \"./.internal/core/elements/WavedRectangle\";\r\nexport { ZoomOutButton } from \"./.internal/core/elements/ZoomOutButton\";\r\nexport { PlayButton } from \"./.internal/core/elements/PlayButton\";\r\n/**\r\n * Elements: 3d\r\n */\r\nexport { Cone } from \"./.internal/core/elements/3d/Cone\";\r\nexport { Rectangle3D } from \"./.internal/core/elements/3d/Rectangle3D\";\r\nexport { Slice3D } from \"./.internal/core/elements/3d/Slice3D\";\r\n/**\r\n * Elements: export\r\n */\r\nexport { Export } from \"./.internal/core/export/Export\";\r\nexport { ExportMenu } from \"./.internal/core/export/ExportMenu\";\r\n/**\r\n * Elements: formatters\r\n */\r\nexport { DateFormatter } from \"./.internal/core/formatters/DateFormatter\";\r\nexport { DurationFormatter } from \"./.internal/core/formatters/DurationFormatter\";\r\nexport { NumberFormatter } from \"./.internal/core/formatters/NumberFormatter\";\r\nexport { TextFormatter, getTextFormatter } from \"./.internal/core/formatters/TextFormatter\";\r\n/**\r\n * Elements: interaction\r\n */\r\nexport { Inertia } from \"./.internal/core/interaction/Inertia\";\r\nexport { Interaction, getInteraction } from \"./.internal/core/interaction/Interaction\";\r\nexport { InteractionKeyboardObject } from \"./.internal/core/interaction/InteractionKeyboardObject\";\r\nexport { InteractionObject } from \"./.internal/core/interaction/InteractionObject\";\r\nexport { InteractionObjectEventDispatcher } from \"./.internal/core/interaction/InteractionObjectEvents\";\r\nexport { MouseCursorStyle } from \"./.internal/core/interaction/Mouse\";\r\n/**\r\n * Elements: rendering\r\n */\r\nexport { AMElement } from \"./.internal/core/rendering/AMElement\";\r\nexport { Group } from \"./.internal/core/rendering/Group\";\r\nexport { Paper } from \"./.internal/core/rendering/Paper\";\r\nexport { Tension, Basis } from \"./.internal/core/rendering/Smoothing\";\r\nexport { SVGContainer } from \"./.internal/core/rendering/SVGContainer\";\r\n/**\r\n * Elements: fills\r\n */\r\nexport { ColorModifier } from \"./.internal/core/rendering/fills/ColorModifier\";\r\nexport { LinearGradient } from \"./.internal/core/rendering/fills/LinearGradient\";\r\nexport { LinearGradientModifier } from \"./.internal/core/rendering/fills/LinearGradientModifier\";\r\nexport { RadialGradientModifier } from \"./.internal/core/rendering/fills/RadialGradientModifier\";\r\nexport { LinePattern } from \"./.internal/core/rendering/fills/LinePattern\";\r\nexport { CirclePattern } from \"./.internal/core/rendering/fills/CirclePattern\";\r\nexport { Pattern } from \"./.internal/core/rendering/fills/Pattern\";\r\nexport { RadialGradient } from \"./.internal/core/rendering/fills/RadialGradient\";\r\nexport { RectPattern } from \"./.internal/core/rendering/fills/RectPattern\";\r\n/**\r\n * Elements: filters\r\n */\r\nexport { ColorizeFilter } from \"./.internal/core/rendering/filters/ColorizeFilter\";\r\nexport { DesaturateFilter } from \"./.internal/core/rendering/filters/DesaturateFilter\";\r\nexport { DropShadowFilter } from \"./.internal/core/rendering/filters/DropShadowFilter\";\r\nexport { BlurFilter } from \"./.internal/core/rendering/filters/BlurFilter\";\r\nexport { Filter } from \"./.internal/core/rendering/filters/Filter\";\r\nexport { FocusFilter } from \"./.internal/core/rendering/filters/FocusFilter\";\r\nexport { LightenFilter } from \"./.internal/core/rendering/filters/LightenFilter\";\r\n/**\r\n * Elements: utils\r\n */\r\nexport { GlobalAdapter, globalAdapter, Adapter } from \"./.internal/core/utils/Adapter\";\r\nexport { Animation, animate } from \"./.internal/core/utils/Animation\";\r\nexport { nextFrame, readFrame, writeFrame, whenIdle, triggerIdle } from \"./.internal/core/utils/AsyncPending\";\r\nexport { Cache, cache } from \"./.internal/core/utils/Cache\";\r\nexport { Color, color, isColor, castColor } from \"./.internal/core/utils/Color\";\r\nexport { ColorSet } from \"./.internal/core/utils/ColorSet\";\r\nexport { PatternSet } from \"./.internal/core/utils/PatternSet\";\r\nexport { InterfaceColorSet } from \"./.internal/core/utils/InterfaceColorSet\";\r\nexport { DictionaryDisposer, Dictionary, DictionaryTemplate } from \"./.internal/core/utils/Dictionary\";\r\nexport { Disposer, MultiDisposer, MutableValueDisposer, CounterDisposer } from \"./.internal/core/utils/Disposer\";\r\nexport { StyleRule, StyleClass, getElement, addClass, removeClass, blur, focus, outerHTML, isElement, copyAttributes, fixPixelPerfect, ready } from \"./.internal/core/utils/DOM\";\r\nexport { EventDispatcher, TargetedEventDispatcher } from \"./.internal/core/utils/EventDispatcher\";\r\nexport { ListIterator, min, max, join } from \"./.internal/core/utils/Iterator\";\r\nexport { Keyboard, keyboard } from \"./.internal/core/utils/Keyboard\";\r\nexport { Language } from \"./.internal/core/utils/Language\";\r\nexport { IndexedIterable, ListGrouper, ListDisposer, List, ListTemplate } from \"./.internal/core/utils/List\";\r\nexport { Morpher } from \"./.internal/core/utils/Morpher\";\r\nexport { reverse, or } from \"./.internal/core/utils/Order\";\r\nexport { Percent, percent, isPercent } from \"./.internal/core/utils/Percent\";\r\nexport { Plugin } from \"./.internal/core/utils/Plugin\";\r\nexport { Responsive, ResponsiveBreakpoints, defaultRules } from \"./.internal/core/utils/Responsive\";\r\nexport { OrderedList, SortedList, OrderedListTemplate, SortedListTemplate } from \"./.internal/core/utils/SortedList\";\r\nexport { PX, STRING, NUMBER, DATE, DURATION, PLACEHOLDER, PLACEHOLDER2 } from \"./.internal/core/utils/Strings\";\r\nexport { isNaN, checkString, checkBoolean, checkNumber, checkObject, castString, castNumber, isString, isNumber, isObject, isArray } from \"./.internal/core/utils/Type\";\r\nexport { Validatable } from \"./.internal/core/utils/Validatable\";\r\n/**\r\n * Functions: rendering\r\n */\r\nimport * as path from \"./.internal/core/rendering/Path\";\r\nexport { path };\r\n/**\r\n * Functions: utils\r\n */\r\nimport * as colors from \"./.internal/core/utils/Colors\";\r\nexport { colors };\r\nimport * as ease from \"./.internal/core/utils/Ease\";\r\nexport { ease };\r\nimport * as math from \"./.internal/core/utils/Math\";\r\nexport { math };\r\nimport * as array from \"./.internal/core/utils/Array\";\r\nexport { array };\r\nimport * as number from \"./.internal/core/utils/Number\";\r\nexport { number };\r\nimport * as object from \"./.internal/core/utils/Object\";\r\nexport { object };\r\nimport * as string from \"./.internal/core/utils/String\";\r\nexport { string };\r\nimport * as time from \"./.internal/core/utils/Time\";\r\nexport { time };\r\nimport * as utils from \"./.internal/core/utils/Utils\";\r\nexport { utils };\r\nimport * as iter from \"./.internal/core/utils/Iterator\";\r\nexport { iter };\r\nimport * as type from \"./.internal/core/utils/Type\";\r\nexport { type };\r\nimport * as net from \"./.internal/core/utils/Net\";\r\nexport { net };\r\nexport { create, createFromConfig, createDeferred, disposeAllCharts, viewPortHandler } from \"./.internal/core/utils/Instance\";\r\nexport { useTheme, unuseTheme, unuseAllThemes, addLicense } from \"./.internal/core/utils/Instance\";\r\n","/**\r\n * amCharts 4 locale\r\n *\r\n * Locale: en\r\n * Language: International English\r\n * Author: Martynas Majeris\r\n *\r\n * Follow instructions in [on this page](https://www.amcharts.com/docs/v4/tutorials/creating-translations/) to make corrections or add new translations.\r\n *\r\n * ---\r\n * Edit but leave the header section above this line. You can remove any\r\n * subsequent comment sections.\r\n * ---\r\n *\r\n * Use this file as a template to create translations. Leave the key part in\r\n * English intact. Fill the value with a translation.\r\n *\r\n * Empty string means no translation, so default \"International English\"\r\n * will be used.\r\n *\r\n * If you need the translation to literally be an empty string, use `null`\r\n * instead.\r\n *\r\n * IMPORTANT:\r\n * When translating make good effort to keep the translation length\r\n * at least the same chartcount as the English, especially for short prompts.\r\n *\r\n * Having significantly longer prompts may distort the actual charts.\r\n *\r\n * NOTE:\r\n * Some prompts - like months or weekdays - come in two versions: full and\r\n * shortened.\r\n *\r\n * If there's no official shortened version of these in your language, and it\r\n * would not be possible to invent such short versions that don't seem weird\r\n * to native speakers of that language, fill those with the same as full\r\n * version.\r\n *\r\n * PLACEHOLDERS:\r\n * Some prompts have placeholders like \"%1\". Those will be replaced by actual\r\n * values during translation and should be retained in the translated prompts.\r\n *\r\n * Placeholder positions may be changed to better suit structure of the\r\n * sentence.\r\n *\r\n * For example \"From %1 to %2\", when actually used will replace \"%1\" with an\r\n * actual value representing range start, and \"%2\" will be replaced by end\r\n * value.\r\n *\r\n * E.g. in a Scrollbar for Value axis \"From %1 to %2\" will become\r\n * \"From 100 to 200\". You may translate \"From\" and \"to\", as well as re-arrange\r\n * the order of the prompt itself, but make sure the \"%1\" and \"%2\" remain, in\r\n * places where they will make sense.\r\n *\r\n * Save the file as language_LOCALE, i.e. `en_GB.ts`, `fr_FR.ts`, etc.\r\n */\r\nexport default {\r\n // Number formatting options.\r\n // \r\n // Please check with the local standards which separator is accepted to be\r\n // used for separating decimals, and which for thousands.\r\n \"_decimalSeparator\": \".\",\r\n \"_thousandSeparator\": \",\",\r\n // Suffixes for numbers\r\n // When formatting numbers, big or small numers might be reformatted to\r\n // shorter version, by applying a suffix.\r\n // \r\n // For example, 1000000 might become \"1m\".\r\n // Or 1024 might become \"1KB\" if we're formatting byte numbers.\r\n // \r\n // This section defines such suffixes for all such cases.\r\n \"_big_number_suffix_3\": \"k\",\r\n \"_big_number_suffix_6\": \"M\",\r\n \"_big_number_suffix_9\": \"G\",\r\n \"_big_number_suffix_12\": \"T\",\r\n \"_big_number_suffix_15\": \"P\",\r\n \"_big_number_suffix_18\": \"E\",\r\n \"_big_number_suffix_21\": \"Z\",\r\n \"_big_number_suffix_24\": \"Y\",\r\n \"_small_number_suffix_3\": \"m\",\r\n \"_small_number_suffix_6\": \"μ\",\r\n \"_small_number_suffix_9\": \"n\",\r\n \"_small_number_suffix_12\": \"p\",\r\n \"_small_number_suffix_15\": \"f\",\r\n \"_small_number_suffix_18\": \"a\",\r\n \"_small_number_suffix_21\": \"z\",\r\n \"_small_number_suffix_24\": \"y\",\r\n \"_byte_suffix_B\": \"B\",\r\n \"_byte_suffix_KB\": \"KB\",\r\n \"_byte_suffix_MB\": \"MB\",\r\n \"_byte_suffix_GB\": \"GB\",\r\n \"_byte_suffix_TB\": \"TB\",\r\n \"_byte_suffix_PB\": \"PB\",\r\n // Default date formats for various periods.\r\n // \r\n // This should reflect official or de facto formatting universally accepted\r\n // in the country translation is being made for\r\n // Available format codes here:\r\n // https://www.amcharts.com/docs/v4/concepts/formatters/formatting-date-time/#Format_codes\r\n // \r\n // This will be used when formatting date/time for particular granularity,\r\n // e.g. \"_date_hour\" will be shown whenever we need to show time as hours.\r\n // \r\n // \"date\" is used as in default date format when showing standalone dates.\r\n \"_date\": \"yyyy-MM-dd\",\r\n \"_date_millisecond\": \"mm:ss SSS\",\r\n \"_date_second\": \"HH:mm:ss\",\r\n \"_date_minute\": \"HH:mm\",\r\n \"_date_hour\": \"HH:mm\",\r\n \"_date_day\": \"MMM dd\",\r\n \"_date_week\": \"ww\",\r\n \"_date_month\": \"MMM\",\r\n \"_date_year\": \"yyyy\",\r\n // Default duration formats for various base units.\r\n // \r\n // This will be used by DurationFormatter to format numeric values into\r\n // duration.\r\n // \r\n // Notice how each duration unit comes in several versions. This is to ensure\r\n // that each base unit is shown correctly.\r\n // \r\n // For example, if we have baseUnit set to \"second\", meaning our duration is\r\n // in seconds.\r\n // \r\n // If we pass in `50` to formatter, it will know that we have just 50 seconds\r\n // (less than a minute) so it will use format in `\"_duration_second\"` (\"ss\"),\r\n // and the formatted result will be in like `\"50\"`.\r\n // \r\n // If we pass in `70`, which is more than a minute, the formatter will switch\r\n // to `\"_duration_second_minute\"` (\"mm:ss\"), resulting in \"01:10\" formatted\r\n // text.\r\n // \r\n // Available codes here:\r\n // https://www.amcharts.com/docs/v4/concepts/formatters/formatting-duration/#Available_Codes\r\n \"_duration_millisecond\": \"SSS\",\r\n \"_duration_millisecond_second\": \"ss.SSS\",\r\n \"_duration_millisecond_minute\": \"mm:ss SSS\",\r\n \"_duration_millisecond_hour\": \"hh:mm:ss SSS\",\r\n \"_duration_millisecond_day\": \"d'd' mm:ss SSS\",\r\n \"_duration_millisecond_week\": \"d'd' mm:ss SSS\",\r\n \"_duration_millisecond_month\": \"M'm' dd'd' mm:ss SSS\",\r\n \"_duration_millisecond_year\": \"y'y' MM'm' dd'd' mm:ss SSS\",\r\n \"_duration_second\": \"ss\",\r\n \"_duration_second_minute\": \"mm:ss\",\r\n \"_duration_second_hour\": \"hh:mm:ss\",\r\n \"_duration_second_day\": \"d'd' hh:mm:ss\",\r\n \"_duration_second_week\": \"d'd' hh:mm:ss\",\r\n \"_duration_second_month\": \"M'm' dd'd' hh:mm:ss\",\r\n \"_duration_second_year\": \"y'y' MM'm' dd'd' hh:mm:ss\",\r\n \"_duration_minute\": \"mm\",\r\n \"_duration_minute_hour\": \"hh:mm\",\r\n \"_duration_minute_day\": \"d'd' hh:mm\",\r\n \"_duration_minute_week\": \"d'd' hh:mm\",\r\n \"_duration_minute_month\": \"M'm' dd'd' hh:mm\",\r\n \"_duration_minute_year\": \"y'y' MM'm' dd'd' hh:mm\",\r\n \"_duration_hour\": \"hh'h'\",\r\n \"_duration_hour_day\": \"d'd' hh'h'\",\r\n \"_duration_hour_week\": \"d'd' hh'h'\",\r\n \"_duration_hour_month\": \"M'm' dd'd' hh'h'\",\r\n \"_duration_hour_year\": \"y'y' MM'm' dd'd' hh'h'\",\r\n \"_duration_day\": \"d'd'\",\r\n \"_duration_day_week\": \"d'd'\",\r\n \"_duration_day_month\": \"M'm' dd'd'\",\r\n \"_duration_day_year\": \"y'y' MM'm' dd'd'\",\r\n \"_duration_week\": \"w'w'\",\r\n \"_duration_week_month\": \"w'w'\",\r\n \"_duration_week_year\": \"w'w'\",\r\n \"_duration_month\": \"M'm'\",\r\n \"_duration_month_year\": \"y'y' MM'm'\",\r\n \"_duration_year\": \"y'y'\",\r\n // Era translations\r\n \"_era_ad\": \"AD\",\r\n \"_era_bc\": \"BC\",\r\n // Day part, used in 12-hour formats, e.g. 5 P.M.\r\n // Please note that these come in 3 variants:\r\n // * one letter (e.g. \"A\")\r\n // * two letters (e.g. \"AM\")\r\n // * two letters with dots (e.g. \"A.M.\")\r\n // \r\n // All three need to to be translated even if they are all the same. Some\r\n // users might use one, some the other.\r\n \"A\": \"\",\r\n \"P\": \"\",\r\n \"AM\": \"\",\r\n \"PM\": \"\",\r\n \"A.M.\": \"\",\r\n \"P.M.\": \"\",\r\n // Date-related stuff.\r\n // \r\n // When translating months, if there's a difference, use the form which is\r\n // best for a full date, e.g. as you would use it in \"2018 January 1\".\r\n // \r\n // Note that May is listed twice. This is because in English May is the same\r\n // in both long and short forms, while in other languages it may not be the\r\n // case. Translate \"May\" to full word, while \"May(short)\" to shortened\r\n // version.\r\n // \r\n // Should month names and weekdays be capitalized or not?\r\n // \r\n // Rule of thumb is this: if the names should always be capitalized,\r\n // regardless of name position within date (\"January\", \"21st January 2018\",\r\n // etc.) use capitalized names. Otherwise enter all lowercase.\r\n // \r\n // The date formatter will automatically capitalize names if they are the\r\n // first (or only) word in resulting date.\r\n \"January\": \"\",\r\n \"February\": \"\",\r\n \"March\": \"\",\r\n \"April\": \"\",\r\n \"May\": \"\",\r\n \"June\": \"\",\r\n \"July\": \"\",\r\n \"August\": \"\",\r\n \"September\": \"\",\r\n \"October\": \"\",\r\n \"November\": \"\",\r\n \"December\": \"\",\r\n \"Jan\": \"\",\r\n \"Feb\": \"\",\r\n \"Mar\": \"\",\r\n \"Apr\": \"\",\r\n \"May(short)\": \"May\",\r\n \"Jun\": \"\",\r\n \"Jul\": \"\",\r\n \"Aug\": \"\",\r\n \"Sep\": \"\",\r\n \"Oct\": \"\",\r\n \"Nov\": \"\",\r\n \"Dec\": \"\",\r\n // Weekdays.\r\n \"Sunday\": \"\",\r\n \"Monday\": \"\",\r\n \"Tuesday\": \"\",\r\n \"Wednesday\": \"\",\r\n \"Thursday\": \"\",\r\n \"Friday\": \"\",\r\n \"Saturday\": \"\",\r\n \"Sun\": \"\",\r\n \"Mon\": \"\",\r\n \"Tue\": \"\",\r\n \"Wed\": \"\",\r\n \"Thu\": \"\",\r\n \"Fri\": \"\",\r\n \"Sat\": \"\",\r\n // Date ordinal function.\r\n // \r\n // This is used when adding number ordinal when formatting days in dates.\r\n // \r\n // E.g. \"January 1st\", \"February 2nd\".\r\n // \r\n // The function accepts day number, and returns a string to be added to the\r\n // day, like in default English translation, if we pass in 2, we will receive\r\n // \"nd\" back.\r\n \"_dateOrd\": function (day) {\r\n var res = \"th\";\r\n if ((day < 11) || (day > 13)) {\r\n switch (day % 10) {\r\n case 1:\r\n res = \"st\";\r\n break;\r\n case 2:\r\n res = \"nd\";\r\n break;\r\n case 3:\r\n res = \"rd\";\r\n break;\r\n }\r\n }\r\n return res;\r\n },\r\n // Various chart controls.\r\n // Shown as a tooltip on zoom out button.\r\n \"Zoom Out\": \"\",\r\n // Timeline buttons\r\n \"Play\": \"\",\r\n \"Stop\": \"\",\r\n // Chart's Legend screen reader title.\r\n \"Legend\": \"\",\r\n // Legend's item screen reader indicator.\r\n \"Click, tap or press ENTER to toggle\": \"\",\r\n // Shown when the chart is busy loading something.\r\n \"Loading\": \"\",\r\n // Shown as the first button in the breadcrumb navigation, e.g.:\r\n // Home > First level > ...\r\n \"Home\": \"\",\r\n // Chart types.\r\n // Those are used as default screen reader titles for the main chart element\r\n // unless developer has set some more descriptive title.\r\n \"Chart\": \"\",\r\n \"Serial chart\": \"\",\r\n \"X/Y chart\": \"\",\r\n \"Pie chart\": \"\",\r\n \"Gauge chart\": \"\",\r\n \"Radar chart\": \"\",\r\n \"Sankey diagram\": \"\",\r\n \"Flow diagram\": \"\",\r\n \"Chord diagram\": \"\",\r\n \"TreeMap chart\": \"\",\r\n \"Force directed tree\": \"\",\r\n \"Sliced chart\": \"\",\r\n // Series types.\r\n // Used to name series by type for screen readers if they do not have their\r\n // name set.\r\n \"Series\": \"\",\r\n \"Candlestick Series\": \"\",\r\n \"OHLC Series\": \"\",\r\n \"Column Series\": \"\",\r\n \"Line Series\": \"\",\r\n \"Pie Slice Series\": \"\",\r\n \"Funnel Series\": \"\",\r\n \"Pyramid Series\": \"\",\r\n \"X/Y Series\": \"\",\r\n // Map-related stuff.\r\n \"Map\": \"\",\r\n \"Press ENTER to zoom in\": \"\",\r\n \"Press ENTER to zoom out\": \"\",\r\n \"Use arrow keys to zoom in and out\": \"\",\r\n \"Use plus and minus keys on your keyboard to zoom in and out\": \"\",\r\n // Export-related stuff.\r\n // These prompts are used in Export menu labels.\r\n // \r\n // \"Export\" is the top-level menu item.\r\n // \r\n // \"Image\", \"Data\", \"Print\" as second-level indicating type of export\r\n // operation.\r\n // \r\n // Leave actual format untranslated, unless you absolutely know that they\r\n // would convey more meaning in some other way.\r\n \"Export\": \"\",\r\n \"Image\": \"\",\r\n \"Data\": \"\",\r\n \"Print\": \"\",\r\n \"Press ENTER or use arrow keys to navigate\": \"\",\r\n \"Click, tap or press ENTER to open\": \"\",\r\n \"Click, tap or press ENTER to print.\": \"\",\r\n \"Click, tap or press ENTER to export as %1.\": \"\",\r\n 'To save the image, right-click this link and choose \"Save picture as...\"': \"\",\r\n 'To save the image, right-click thumbnail on the left and choose \"Save picture as...\"': \"\",\r\n \"(Press ESC to close this message)\": \"\",\r\n \"Image Export Complete\": \"\",\r\n \"Export operation took longer than expected. Something might have gone wrong.\": \"\",\r\n \"Saved from\": \"\",\r\n \"PNG\": \"\",\r\n \"JPG\": \"\",\r\n \"GIF\": \"\",\r\n \"SVG\": \"\",\r\n \"PDF\": \"\",\r\n \"JSON\": \"\",\r\n \"CSV\": \"\",\r\n \"XLSX\": \"\",\r\n // Scrollbar-related stuff.\r\n // \r\n // Scrollbar is a control which can zoom and pan the axes on the chart.\r\n // \r\n // Each scrollbar has two grips: left or right (for horizontal scrollbar) or\r\n // upper and lower (for vertical one).\r\n // \r\n // Prompts change in relation to whether Scrollbar is vertical or horizontal.\r\n // \r\n // The final section is used to indicate the current range of selection.\r\n \"Use TAB to select grip buttons or left and right arrows to change selection\": \"\",\r\n \"Use left and right arrows to move selection\": \"\",\r\n \"Use left and right arrows to move left selection\": \"\",\r\n \"Use left and right arrows to move right selection\": \"\",\r\n \"Use TAB select grip buttons or up and down arrows to change selection\": \"\",\r\n \"Use up and down arrows to move selection\": \"\",\r\n \"Use up and down arrows to move lower selection\": \"\",\r\n \"Use up and down arrows to move upper selection\": \"\",\r\n \"From %1 to %2\": \"\",\r\n \"From %1\": \"\",\r\n \"To %1\": \"\",\r\n // Data loader-related.\r\n \"No parser available for file: %1\": \"\",\r\n \"Error parsing file: %1\": \"\",\r\n \"Unable to load file: %1\": \"\",\r\n \"Invalid date\": \"\",\r\n // Common actions\r\n \"Close\": \"\",\r\n \"Minimize\": \"\"\r\n};\r\n","/**\r\n * Duplicated\r\n */\r\nexport { LegendDataItem, Legend, LegendSettings } from \"./.internal/charts/Legend\";\r\nexport { HeatLegend } from \"./.internal/charts/elements/HeatLegend\";\r\n/**\r\n * Maps\r\n */\r\nexport { MapChartDataItem, MapChart } from \"./.internal/charts/types/MapChart\";\r\nexport { MapSeriesDataItem, MapSeries } from \"./.internal/charts/map/MapSeries\";\r\nexport { MapObject } from \"./.internal/charts/map/MapObject\";\r\nexport { MapPolygon } from \"./.internal/charts/map/MapPolygon\";\r\nexport { MapImage } from \"./.internal/charts/map/MapImage\";\r\nexport { MapLine } from \"./.internal/charts/map/MapLine\";\r\nexport { MapLineObject } from \"./.internal/charts/map/MapLineObject\";\r\nexport { MapSpline } from \"./.internal/charts/map/MapSpline\";\r\nexport { MapArc } from \"./.internal/charts/map/MapArc\";\r\nexport { Graticule } from \"./.internal/charts/map/Graticule\";\r\nexport { MapPolygonSeriesDataItem, MapPolygonSeries } from \"./.internal/charts/map/MapPolygonSeries\";\r\nexport { MapLineSeriesDataItem, MapLineSeries } from \"./.internal/charts/map/MapLineSeries\";\r\nexport { MapSplineSeriesDataItem, MapSplineSeries } from \"./.internal/charts/map/MapSplineSeries\";\r\nexport { MapImageSeriesDataItem, MapImageSeries } from \"./.internal/charts/map/MapImageSeries\";\r\nexport { MapArcSeriesDataItem, MapArcSeries } from \"./.internal/charts/map/MapArcSeries\";\r\nexport { GraticuleSeriesDataItem, GraticuleSeries } from \"./.internal/charts/map/GraticuleSeries\";\r\nexport { multiPolygonToGeo, multiLineToGeo, multiPointToGeo, pointToGeo, multiGeoPolygonToMultipolygon, getBackground, multiGeoLineToMultiLine, multiGeoToPoint, getCircle } from \"./.internal/charts/map/MapUtils\";\r\nexport { ZoomControl } from \"./.internal/charts/map/ZoomControl\";\r\nexport { SmallMap } from \"./.internal/charts/map/SmallMap\";\r\n/**\r\n * Elements: projections\r\n */\r\nexport { Projection } from \"./.internal/charts/map/projections/Projection\";\r\nimport * as projections from \"./.internal/charts/map/projections\";\r\nexport { projections };\r\nimport * as geo from \"./.internal/charts/map/Geo\";\r\nexport { geo };\r\nimport * as d3geo from \"d3-geo\";\r\nexport { d3geo };\r\n","export { default } from \"../.internal/themes/animated\";\r\n","// https://github.com/python/cpython/blob/a74eea238f5baba15797e2e8b570d153bc8690a7/Modules/mathmodule.c#L1423\nexport class Adder {\n constructor() {\n this._partials = new Float64Array(32);\n this._n = 0;\n }\n add(x) {\n const p = this._partials;\n let i = 0;\n for (let j = 0; j < this._n && j < 32; j++) {\n const y = p[j],\n hi = x + y,\n lo = Math.abs(x) < Math.abs(y) ? x - (hi - y) : y - (hi - x);\n if (lo) p[i++] = lo;\n x = hi;\n }\n p[i] = x;\n this._n = i + 1;\n return this;\n }\n valueOf() {\n const p = this._partials;\n let n = this._n, x, y, lo, hi = 0;\n if (n > 0) {\n hi = p[--n];\n while (n > 0) {\n x = hi;\n y = p[--n];\n hi = x + y;\n lo = y - (hi - x);\n if (lo) break;\n }\n if (n > 0 && ((lo < 0 && p[n - 1] < 0) || (lo > 0 && p[n - 1] > 0))) {\n y = lo * 2;\n x = hi + y;\n if (y == x - hi) hi = x;\n }\n }\n return hi;\n }\n}\n\nexport default function(values, valueof) {\n const adder = new Adder();\n if (valueof === undefined) {\n for (let value of values) {\n if (value = +value) {\n adder.add(value);\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if (value = +valueof(value, ++index, values)) {\n adder.add(value);\n }\n }\n }\n return +adder;\n}\n","function* flatten(arrays) {\n for (const array of arrays) {\n yield* array;\n }\n}\n\nexport default function merge(arrays) {\n return Array.from(flatten(arrays));\n}\n","export default function(start, stop, step) {\n start = +start, stop = +stop, step = (n = arguments.length) < 2 ? (stop = start, start = 0, 1) : n < 3 ? 1 : +step;\n\n var i = -1,\n n = Math.max(0, Math.ceil((stop - start) / step)) | 0,\n range = new Array(n);\n\n while (++i < n) {\n range[i] = start + i * step;\n }\n\n return range;\n}\n","import {geoProjection as projection} from \"d3-geo\";\nimport {abs, asin, cos, epsilon, halfPi, pi, sin, sqrt} from \"./math.js\";\n\nexport function eckert6Raw(lambda, phi) {\n var k = (1 + halfPi) * sin(phi);\n for (var i = 0, delta = Infinity; i < 10 && abs(delta) > epsilon; i++) {\n phi -= delta = (phi + sin(phi) - k) / (1 + cos(phi));\n }\n k = sqrt(2 + pi);\n return [\n lambda * (1 + cos(phi)) / k,\n 2 * phi / k\n ];\n}\n\neckert6Raw.invert = function(x, y) {\n var j = 1 + halfPi,\n k = sqrt(j / 2);\n return [\n x * 2 * k / (1 + cos(y *= k)),\n asin((y + sin(y)) / j)\n ];\n};\n\nexport default function() {\n return projection(eckert6Raw)\n .scale(173.044);\n}\n","export var abs = Math.abs;\nexport var atan = Math.atan;\nexport var atan2 = Math.atan2;\nexport var ceil = Math.ceil;\nexport var cos = Math.cos;\nexport var exp = Math.exp;\nexport var floor = Math.floor;\nexport var log = Math.log;\nexport var max = Math.max;\nexport var min = Math.min;\nexport var pow = Math.pow;\nexport var round = Math.round;\nexport var sign = Math.sign || function(x) { return x > 0 ? 1 : x < 0 ? -1 : 0; };\nexport var sin = Math.sin;\nexport var tan = Math.tan;\n\nexport var epsilon = 1e-6;\nexport var epsilon2 = 1e-12;\nexport var pi = Math.PI;\nexport var halfPi = pi / 2;\nexport var quarterPi = pi / 4;\nexport var sqrt1_2 = Math.SQRT1_2;\nexport var sqrt2 = sqrt(2);\nexport var sqrtPi = sqrt(pi);\nexport var tau = pi * 2;\nexport var degrees = 180 / pi;\nexport var radians = pi / 180;\n\nexport function sinci(x) {\n return x ? x / Math.sin(x) : 1;\n}\n\nexport function asin(x) {\n return x > 1 ? halfPi : x < -1 ? -halfPi : Math.asin(x);\n}\n\nexport function acos(x) {\n return x > 1 ? 0 : x < -1 ? pi : Math.acos(x);\n}\n\nexport function sqrt(x) {\n return x > 0 ? Math.sqrt(x) : 0;\n}\n\nexport function tanh(x) {\n x = exp(2 * x);\n return (x - 1) / (x + 1);\n}\n\nexport function sinh(x) {\n return (exp(x) - exp(-x)) / 2;\n}\n\nexport function cosh(x) {\n return (exp(x) + exp(-x)) / 2;\n}\n\nexport function arsinh(x) {\n return log(x + sqrt(x * x + 1));\n}\n\nexport function arcosh(x) {\n return log(x + sqrt(x * x - 1));\n}\n","import {geoProjection as projection} from \"d3-geo\";\nimport {atan, exp, log, quarterPi, pi, tan} from \"./math.js\";\n\nexport function millerRaw(lambda, phi) {\n return [lambda, 1.25 * log(tan(quarterPi + 0.4 * phi))];\n}\n\nmillerRaw.invert = function(x, y) {\n return [x, 2.5 * atan(exp(0.8 * y)) - 0.625 * pi];\n};\n\nexport default function() {\n return projection(millerRaw)\n .scale(108.318);\n}\n","import {Adder} from \"d3-array\";\nimport {atan2, cos, quarterPi, radians, sin, tau} from \"./math.js\";\nimport noop from \"./noop.js\";\nimport stream from \"./stream.js\";\n\nexport var areaRingSum = new Adder();\n\n// hello?\n\nvar areaSum = new Adder(),\n lambda00,\n phi00,\n lambda0,\n cosPhi0,\n sinPhi0;\n\nexport var areaStream = {\n point: noop,\n lineStart: noop,\n lineEnd: noop,\n polygonStart: function() {\n areaRingSum = new Adder();\n areaStream.lineStart = areaRingStart;\n areaStream.lineEnd = areaRingEnd;\n },\n polygonEnd: function() {\n var areaRing = +areaRingSum;\n areaSum.add(areaRing < 0 ? tau + areaRing : areaRing);\n this.lineStart = this.lineEnd = this.point = noop;\n },\n sphere: function() {\n areaSum.add(tau);\n }\n};\n\nfunction areaRingStart() {\n areaStream.point = areaPointFirst;\n}\n\nfunction areaRingEnd() {\n areaPoint(lambda00, phi00);\n}\n\nfunction areaPointFirst(lambda, phi) {\n areaStream.point = areaPoint;\n lambda00 = lambda, phi00 = phi;\n lambda *= radians, phi *= radians;\n lambda0 = lambda, cosPhi0 = cos(phi = phi / 2 + quarterPi), sinPhi0 = sin(phi);\n}\n\nfunction areaPoint(lambda, phi) {\n lambda *= radians, phi *= radians;\n phi = phi / 2 + quarterPi; // half the angular distance from south pole\n\n // Spherical excess E for a spherical triangle with vertices: south pole,\n // previous point, current point. Uses a formula derived from Cagnoli’s\n // theorem. See Todhunter, Spherical Trig. (1871), Sec. 103, Eq. (2).\n var dLambda = lambda - lambda0,\n sdLambda = dLambda >= 0 ? 1 : -1,\n adLambda = sdLambda * dLambda,\n cosPhi = cos(phi),\n sinPhi = sin(phi),\n k = sinPhi0 * sinPhi,\n u = cosPhi0 * cosPhi + k * cos(adLambda),\n v = k * sdLambda * sin(adLambda);\n areaRingSum.add(atan2(v, u));\n\n // Advance the previous points.\n lambda0 = lambda, cosPhi0 = cosPhi, sinPhi0 = sinPhi;\n}\n\nexport default function(object) {\n areaSum = new Adder();\n stream(object, areaStream);\n return areaSum * 2;\n}\n","import {Adder} from \"d3-array\";\nimport {areaStream, areaRingSum} from \"./area.js\";\nimport {cartesian, cartesianCross, cartesianNormalizeInPlace, spherical} from \"./cartesian.js\";\nimport {abs, degrees, epsilon, radians} from \"./math.js\";\nimport stream from \"./stream.js\";\n\nvar lambda0, phi0, lambda1, phi1, // bounds\n lambda2, // previous lambda-coordinate\n lambda00, phi00, // first point\n p0, // previous 3D point\n deltaSum,\n ranges,\n range;\n\nvar boundsStream = {\n point: boundsPoint,\n lineStart: boundsLineStart,\n lineEnd: boundsLineEnd,\n polygonStart: function() {\n boundsStream.point = boundsRingPoint;\n boundsStream.lineStart = boundsRingStart;\n boundsStream.lineEnd = boundsRingEnd;\n deltaSum = new Adder();\n areaStream.polygonStart();\n },\n polygonEnd: function() {\n areaStream.polygonEnd();\n boundsStream.point = boundsPoint;\n boundsStream.lineStart = boundsLineStart;\n boundsStream.lineEnd = boundsLineEnd;\n if (areaRingSum < 0) lambda0 = -(lambda1 = 180), phi0 = -(phi1 = 90);\n else if (deltaSum > epsilon) phi1 = 90;\n else if (deltaSum < -epsilon) phi0 = -90;\n range[0] = lambda0, range[1] = lambda1;\n },\n sphere: function() {\n lambda0 = -(lambda1 = 180), phi0 = -(phi1 = 90);\n }\n};\n\nfunction boundsPoint(lambda, phi) {\n ranges.push(range = [lambda0 = lambda, lambda1 = lambda]);\n if (phi < phi0) phi0 = phi;\n if (phi > phi1) phi1 = phi;\n}\n\nfunction linePoint(lambda, phi) {\n var p = cartesian([lambda * radians, phi * radians]);\n if (p0) {\n var normal = cartesianCross(p0, p),\n equatorial = [normal[1], -normal[0], 0],\n inflection = cartesianCross(equatorial, normal);\n cartesianNormalizeInPlace(inflection);\n inflection = spherical(inflection);\n var delta = lambda - lambda2,\n sign = delta > 0 ? 1 : -1,\n lambdai = inflection[0] * degrees * sign,\n phii,\n antimeridian = abs(delta) > 180;\n if (antimeridian ^ (sign * lambda2 < lambdai && lambdai < sign * lambda)) {\n phii = inflection[1] * degrees;\n if (phii > phi1) phi1 = phii;\n } else if (lambdai = (lambdai + 360) % 360 - 180, antimeridian ^ (sign * lambda2 < lambdai && lambdai < sign * lambda)) {\n phii = -inflection[1] * degrees;\n if (phii < phi0) phi0 = phii;\n } else {\n if (phi < phi0) phi0 = phi;\n if (phi > phi1) phi1 = phi;\n }\n if (antimeridian) {\n if (lambda < lambda2) {\n if (angle(lambda0, lambda) > angle(lambda0, lambda1)) lambda1 = lambda;\n } else {\n if (angle(lambda, lambda1) > angle(lambda0, lambda1)) lambda0 = lambda;\n }\n } else {\n if (lambda1 >= lambda0) {\n if (lambda < lambda0) lambda0 = lambda;\n if (lambda > lambda1) lambda1 = lambda;\n } else {\n if (lambda > lambda2) {\n if (angle(lambda0, lambda) > angle(lambda0, lambda1)) lambda1 = lambda;\n } else {\n if (angle(lambda, lambda1) > angle(lambda0, lambda1)) lambda0 = lambda;\n }\n }\n }\n } else {\n ranges.push(range = [lambda0 = lambda, lambda1 = lambda]);\n }\n if (phi < phi0) phi0 = phi;\n if (phi > phi1) phi1 = phi;\n p0 = p, lambda2 = lambda;\n}\n\nfunction boundsLineStart() {\n boundsStream.point = linePoint;\n}\n\nfunction boundsLineEnd() {\n range[0] = lambda0, range[1] = lambda1;\n boundsStream.point = boundsPoint;\n p0 = null;\n}\n\nfunction boundsRingPoint(lambda, phi) {\n if (p0) {\n var delta = lambda - lambda2;\n deltaSum.add(abs(delta) > 180 ? delta + (delta > 0 ? 360 : -360) : delta);\n } else {\n lambda00 = lambda, phi00 = phi;\n }\n areaStream.point(lambda, phi);\n linePoint(lambda, phi);\n}\n\nfunction boundsRingStart() {\n areaStream.lineStart();\n}\n\nfunction boundsRingEnd() {\n boundsRingPoint(lambda00, phi00);\n areaStream.lineEnd();\n if (abs(deltaSum) > epsilon) lambda0 = -(lambda1 = 180);\n range[0] = lambda0, range[1] = lambda1;\n p0 = null;\n}\n\n// Finds the left-right distance between two longitudes.\n// This is almost the same as (lambda1 - lambda0 + 360°) % 360°, except that we want\n// the distance between ±180° to be 360°.\nfunction angle(lambda0, lambda1) {\n return (lambda1 -= lambda0) < 0 ? lambda1 + 360 : lambda1;\n}\n\nfunction rangeCompare(a, b) {\n return a[0] - b[0];\n}\n\nfunction rangeContains(range, x) {\n return range[0] <= range[1] ? range[0] <= x && x <= range[1] : x < range[0] || range[1] < x;\n}\n\nexport default function(feature) {\n var i, n, a, b, merged, deltaMax, delta;\n\n phi1 = lambda1 = -(lambda0 = phi0 = Infinity);\n ranges = [];\n stream(feature, boundsStream);\n\n // First, sort ranges by their minimum longitudes.\n if (n = ranges.length) {\n ranges.sort(rangeCompare);\n\n // Then, merge any ranges that overlap.\n for (i = 1, a = ranges[0], merged = [a]; i < n; ++i) {\n b = ranges[i];\n if (rangeContains(a, b[0]) || rangeContains(a, b[1])) {\n if (angle(a[0], b[1]) > angle(a[0], a[1])) a[1] = b[1];\n if (angle(b[0], a[1]) > angle(a[0], a[1])) a[0] = b[0];\n } else {\n merged.push(a = b);\n }\n }\n\n // Finally, find the largest gap between the merged ranges.\n // The final bounding box will be the inverse of this gap.\n for (deltaMax = -Infinity, n = merged.length - 1, i = 0, a = merged[n]; i <= n; a = b, ++i) {\n b = merged[i];\n if ((delta = angle(a[1], b[0])) > deltaMax) deltaMax = delta, lambda0 = b[0], lambda1 = a[1];\n }\n }\n\n ranges = range = null;\n\n return lambda0 === Infinity || phi0 === Infinity\n ? [[NaN, NaN], [NaN, NaN]]\n : [[lambda0, phi0], [lambda1, phi1]];\n}\n","import {asin, atan2, cos, sin, sqrt} from \"./math.js\";\n\nexport function spherical(cartesian) {\n return [atan2(cartesian[1], cartesian[0]), asin(cartesian[2])];\n}\n\nexport function cartesian(spherical) {\n var lambda = spherical[0], phi = spherical[1], cosPhi = cos(phi);\n return [cosPhi * cos(lambda), cosPhi * sin(lambda), sin(phi)];\n}\n\nexport function cartesianDot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\n}\n\nexport function cartesianCross(a, b) {\n return [a[1] * b[2] - a[2] * b[1], a[2] * b[0] - a[0] * b[2], a[0] * b[1] - a[1] * b[0]];\n}\n\n// TODO return a\nexport function cartesianAddInPlace(a, b) {\n a[0] += b[0], a[1] += b[1], a[2] += b[2];\n}\n\nexport function cartesianScale(vector, k) {\n return [vector[0] * k, vector[1] * k, vector[2] * k];\n}\n\n// TODO return d\nexport function cartesianNormalizeInPlace(d) {\n var l = sqrt(d[0] * d[0] + d[1] * d[1] + d[2] * d[2]);\n d[0] /= l, d[1] /= l, d[2] /= l;\n}\n","import {Adder} from \"d3-array\";\nimport {asin, atan2, cos, degrees, epsilon, epsilon2, hypot, radians, sin, sqrt} from \"./math.js\";\nimport noop from \"./noop.js\";\nimport stream from \"./stream.js\";\n\nvar W0, W1,\n X0, Y0, Z0,\n X1, Y1, Z1,\n X2, Y2, Z2,\n lambda00, phi00, // first point\n x0, y0, z0; // previous point\n\nvar centroidStream = {\n sphere: noop,\n point: centroidPoint,\n lineStart: centroidLineStart,\n lineEnd: centroidLineEnd,\n polygonStart: function() {\n centroidStream.lineStart = centroidRingStart;\n centroidStream.lineEnd = centroidRingEnd;\n },\n polygonEnd: function() {\n centroidStream.lineStart = centroidLineStart;\n centroidStream.lineEnd = centroidLineEnd;\n }\n};\n\n// Arithmetic mean of Cartesian vectors.\nfunction centroidPoint(lambda, phi) {\n lambda *= radians, phi *= radians;\n var cosPhi = cos(phi);\n centroidPointCartesian(cosPhi * cos(lambda), cosPhi * sin(lambda), sin(phi));\n}\n\nfunction centroidPointCartesian(x, y, z) {\n ++W0;\n X0 += (x - X0) / W0;\n Y0 += (y - Y0) / W0;\n Z0 += (z - Z0) / W0;\n}\n\nfunction centroidLineStart() {\n centroidStream.point = centroidLinePointFirst;\n}\n\nfunction centroidLinePointFirst(lambda, phi) {\n lambda *= radians, phi *= radians;\n var cosPhi = cos(phi);\n x0 = cosPhi * cos(lambda);\n y0 = cosPhi * sin(lambda);\n z0 = sin(phi);\n centroidStream.point = centroidLinePoint;\n centroidPointCartesian(x0, y0, z0);\n}\n\nfunction centroidLinePoint(lambda, phi) {\n lambda *= radians, phi *= radians;\n var cosPhi = cos(phi),\n x = cosPhi * cos(lambda),\n y = cosPhi * sin(lambda),\n z = sin(phi),\n w = atan2(sqrt((w = y0 * z - z0 * y) * w + (w = z0 * x - x0 * z) * w + (w = x0 * y - y0 * x) * w), x0 * x + y0 * y + z0 * z);\n W1 += w;\n X1 += w * (x0 + (x0 = x));\n Y1 += w * (y0 + (y0 = y));\n Z1 += w * (z0 + (z0 = z));\n centroidPointCartesian(x0, y0, z0);\n}\n\nfunction centroidLineEnd() {\n centroidStream.point = centroidPoint;\n}\n\n// See J. E. Brock, The Inertia Tensor for a Spherical Triangle,\n// J. Applied Mechanics 42, 239 (1975).\nfunction centroidRingStart() {\n centroidStream.point = centroidRingPointFirst;\n}\n\nfunction centroidRingEnd() {\n centroidRingPoint(lambda00, phi00);\n centroidStream.point = centroidPoint;\n}\n\nfunction centroidRingPointFirst(lambda, phi) {\n lambda00 = lambda, phi00 = phi;\n lambda *= radians, phi *= radians;\n centroidStream.point = centroidRingPoint;\n var cosPhi = cos(phi);\n x0 = cosPhi * cos(lambda);\n y0 = cosPhi * sin(lambda);\n z0 = sin(phi);\n centroidPointCartesian(x0, y0, z0);\n}\n\nfunction centroidRingPoint(lambda, phi) {\n lambda *= radians, phi *= radians;\n var cosPhi = cos(phi),\n x = cosPhi * cos(lambda),\n y = cosPhi * sin(lambda),\n z = sin(phi),\n cx = y0 * z - z0 * y,\n cy = z0 * x - x0 * z,\n cz = x0 * y - y0 * x,\n m = hypot(cx, cy, cz),\n w = asin(m), // line weight = angle\n v = m && -w / m; // area weight multiplier\n X2.add(v * cx);\n Y2.add(v * cy);\n Z2.add(v * cz);\n W1 += w;\n X1 += w * (x0 + (x0 = x));\n Y1 += w * (y0 + (y0 = y));\n Z1 += w * (z0 + (z0 = z));\n centroidPointCartesian(x0, y0, z0);\n}\n\nexport default function(object) {\n W0 = W1 =\n X0 = Y0 = Z0 =\n X1 = Y1 = Z1 = 0;\n X2 = new Adder();\n Y2 = new Adder();\n Z2 = new Adder();\n stream(object, centroidStream);\n\n var x = +X2,\n y = +Y2,\n z = +Z2,\n m = hypot(x, y, z);\n\n // If the area-weighted ccentroid is undefined, fall back to length-weighted ccentroid.\n if (m < epsilon2) {\n x = X1, y = Y1, z = Z1;\n // If the feature has zero length, fall back to arithmetic mean of point vectors.\n if (W1 < epsilon) x = X0, y = Y0, z = Z0;\n m = hypot(x, y, z);\n // If the feature still has an undefined ccentroid, then return.\n if (m < epsilon2) return [NaN, NaN];\n }\n\n return [atan2(y, x) * degrees, asin(z / m) * degrees];\n}\n","import {cartesian, cartesianNormalizeInPlace, spherical} from \"./cartesian.js\";\nimport constant from \"./constant.js\";\nimport {acos, cos, degrees, epsilon, radians, sin, tau} from \"./math.js\";\nimport {rotateRadians} from \"./rotation.js\";\n\n// Generates a circle centered at [0°, 0°], with a given radius and precision.\nexport function circleStream(stream, radius, delta, direction, t0, t1) {\n if (!delta) return;\n var cosRadius = cos(radius),\n sinRadius = sin(radius),\n step = direction * delta;\n if (t0 == null) {\n t0 = radius + direction * tau;\n t1 = radius - step / 2;\n } else {\n t0 = circleRadius(cosRadius, t0);\n t1 = circleRadius(cosRadius, t1);\n if (direction > 0 ? t0 < t1 : t0 > t1) t0 += direction * tau;\n }\n for (var point, t = t0; direction > 0 ? t > t1 : t < t1; t -= step) {\n point = spherical([cosRadius, -sinRadius * cos(t), -sinRadius * sin(t)]);\n stream.point(point[0], point[1]);\n }\n}\n\n// Returns the signed angle of a cartesian point relative to [cosRadius, 0, 0].\nfunction circleRadius(cosRadius, point) {\n point = cartesian(point), point[0] -= cosRadius;\n cartesianNormalizeInPlace(point);\n var radius = acos(-point[1]);\n return ((-point[2] < 0 ? -radius : radius) + tau - epsilon) % tau;\n}\n\nexport default function() {\n var center = constant([0, 0]),\n radius = constant(90),\n precision = constant(6),\n ring,\n rotate,\n stream = {point: point};\n\n function point(x, y) {\n ring.push(x = rotate(x, y));\n x[0] *= degrees, x[1] *= degrees;\n }\n\n function circle() {\n var c = center.apply(this, arguments),\n r = radius.apply(this, arguments) * radians,\n p = precision.apply(this, arguments) * radians;\n ring = [];\n rotate = rotateRadians(-c[0] * radians, -c[1] * radians, 0).invert;\n circleStream(stream, r, p, 1);\n c = {type: \"Polygon\", coordinates: [ring]};\n ring = rotate = null;\n return c;\n }\n\n circle.center = function(_) {\n return arguments.length ? (center = typeof _ === \"function\" ? _ : constant([+_[0], +_[1]]), circle) : center;\n };\n\n circle.radius = function(_) {\n return arguments.length ? (radius = typeof _ === \"function\" ? _ : constant(+_), circle) : radius;\n };\n\n circle.precision = function(_) {\n return arguments.length ? (precision = typeof _ === \"function\" ? _ : constant(+_), circle) : precision;\n };\n\n return circle;\n}\n","import clip from \"./index.js\";\nimport {abs, atan, cos, epsilon, halfPi, pi, sin} from \"../math.js\";\n\nexport default clip(\n function() { return true; },\n clipAntimeridianLine,\n clipAntimeridianInterpolate,\n [-pi, -halfPi]\n);\n\n// Takes a line and cuts into visible segments. Return values: 0 - there were\n// intersections or the line was empty; 1 - no intersections; 2 - there were\n// intersections, and the first and last segments should be rejoined.\nfunction clipAntimeridianLine(stream) {\n var lambda0 = NaN,\n phi0 = NaN,\n sign0 = NaN,\n clean; // no intersections\n\n return {\n lineStart: function() {\n stream.lineStart();\n clean = 1;\n },\n point: function(lambda1, phi1) {\n var sign1 = lambda1 > 0 ? pi : -pi,\n delta = abs(lambda1 - lambda0);\n if (abs(delta - pi) < epsilon) { // line crosses a pole\n stream.point(lambda0, phi0 = (phi0 + phi1) / 2 > 0 ? halfPi : -halfPi);\n stream.point(sign0, phi0);\n stream.lineEnd();\n stream.lineStart();\n stream.point(sign1, phi0);\n stream.point(lambda1, phi0);\n clean = 0;\n } else if (sign0 !== sign1 && delta >= pi) { // line crosses antimeridian\n if (abs(lambda0 - sign0) < epsilon) lambda0 -= sign0 * epsilon; // handle degeneracies\n if (abs(lambda1 - sign1) < epsilon) lambda1 -= sign1 * epsilon;\n phi0 = clipAntimeridianIntersect(lambda0, phi0, lambda1, phi1);\n stream.point(sign0, phi0);\n stream.lineEnd();\n stream.lineStart();\n stream.point(sign1, phi0);\n clean = 0;\n }\n stream.point(lambda0 = lambda1, phi0 = phi1);\n sign0 = sign1;\n },\n lineEnd: function() {\n stream.lineEnd();\n lambda0 = phi0 = NaN;\n },\n clean: function() {\n return 2 - clean; // if intersections, rejoin first and last segments\n }\n };\n}\n\nfunction clipAntimeridianIntersect(lambda0, phi0, lambda1, phi1) {\n var cosPhi0,\n cosPhi1,\n sinLambda0Lambda1 = sin(lambda0 - lambda1);\n return abs(sinLambda0Lambda1) > epsilon\n ? atan((sin(phi0) * (cosPhi1 = cos(phi1)) * sin(lambda1)\n - sin(phi1) * (cosPhi0 = cos(phi0)) * sin(lambda0))\n / (cosPhi0 * cosPhi1 * sinLambda0Lambda1))\n : (phi0 + phi1) / 2;\n}\n\nfunction clipAntimeridianInterpolate(from, to, direction, stream) {\n var phi;\n if (from == null) {\n phi = direction * halfPi;\n stream.point(-pi, phi);\n stream.point(0, phi);\n stream.point(pi, phi);\n stream.point(pi, 0);\n stream.point(pi, -phi);\n stream.point(0, -phi);\n stream.point(-pi, -phi);\n stream.point(-pi, 0);\n stream.point(-pi, phi);\n } else if (abs(from[0] - to[0]) > epsilon) {\n var lambda = from[0] < to[0] ? pi : -pi;\n phi = direction * lambda / 2;\n stream.point(-lambda, phi);\n stream.point(0, phi);\n stream.point(lambda, phi);\n } else {\n stream.point(to[0], to[1]);\n }\n}\n","import noop from \"../noop.js\";\n\nexport default function() {\n var lines = [],\n line;\n return {\n point: function(x, y, m) {\n line.push([x, y, m]);\n },\n lineStart: function() {\n lines.push(line = []);\n },\n lineEnd: noop,\n rejoin: function() {\n if (lines.length > 1) lines.push(lines.pop().concat(lines.shift()));\n },\n result: function() {\n var result = lines;\n lines = [];\n line = null;\n return result;\n }\n };\n}\n","import {cartesian, cartesianAddInPlace, cartesianCross, cartesianDot, cartesianScale, spherical} from \"../cartesian.js\";\nimport {circleStream} from \"../circle.js\";\nimport {abs, cos, epsilon, pi, radians, sqrt} from \"../math.js\";\nimport pointEqual from \"../pointEqual.js\";\nimport clip from \"./index.js\";\n\nexport default function(radius) {\n var cr = cos(radius),\n delta = 6 * radians,\n smallRadius = cr > 0,\n notHemisphere = abs(cr) > epsilon; // TODO optimise for this common case\n\n function interpolate(from, to, direction, stream) {\n circleStream(stream, radius, delta, direction, from, to);\n }\n\n function visible(lambda, phi) {\n return cos(lambda) * cos(phi) > cr;\n }\n\n // Takes a line and cuts into visible segments. Return values used for polygon\n // clipping: 0 - there were intersections or the line was empty; 1 - no\n // intersections 2 - there were intersections, and the first and last segments\n // should be rejoined.\n function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? pi : -pi), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || pointEqual(point0, point2) || pointEqual(point1, point2))\n point1[2] = 1;\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1], 2);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1], 3);\n }\n }\n }\n if (v && (!point0 || !pointEqual(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }\n\n // Intersects the great circle between a and b with the clip circle.\n function intersect(a, b, two) {\n var pa = cartesian(a),\n pb = cartesian(b);\n\n // We have two planes, n1.p = d1 and n2.p = d2.\n // Find intersection line p(t) = c1 n1 + c2 n2 + t (n1 ⨯ n2).\n var n1 = [1, 0, 0], // normal\n n2 = cartesianCross(pa, pb),\n n2n2 = cartesianDot(n2, n2),\n n1n2 = n2[0], // cartesianDot(n1, n2),\n determinant = n2n2 - n1n2 * n1n2;\n\n // Two polar points.\n if (!determinant) return !two && a;\n\n var c1 = cr * n2n2 / determinant,\n c2 = -cr * n1n2 / determinant,\n n1xn2 = cartesianCross(n1, n2),\n A = cartesianScale(n1, c1),\n B = cartesianScale(n2, c2);\n cartesianAddInPlace(A, B);\n\n // Solve |p(t)|^2 = 1.\n var u = n1xn2,\n w = cartesianDot(A, u),\n uu = cartesianDot(u, u),\n t2 = w * w - uu * (cartesianDot(A, A) - 1);\n\n if (t2 < 0) return;\n\n var t = sqrt(t2),\n q = cartesianScale(u, (-w - t) / uu);\n cartesianAddInPlace(q, A);\n q = spherical(q);\n\n if (!two) return q;\n\n // Two intersection points.\n var lambda0 = a[0],\n lambda1 = b[0],\n phi0 = a[1],\n phi1 = b[1],\n z;\n\n if (lambda1 < lambda0) z = lambda0, lambda0 = lambda1, lambda1 = z;\n\n var delta = lambda1 - lambda0,\n polar = abs(delta - pi) < epsilon,\n meridian = polar || delta < epsilon;\n\n if (!polar && phi1 < phi0) z = phi0, phi0 = phi1, phi1 = z;\n\n // Check that the first point is between a and b.\n if (meridian\n ? polar\n ? phi0 + phi1 > 0 ^ q[1] < (abs(q[0] - lambda0) < epsilon ? phi0 : phi1)\n : phi0 <= q[1] && q[1] <= phi1\n : delta > pi ^ (lambda0 <= q[0] && q[0] <= lambda1)) {\n var q1 = cartesianScale(u, (-w + t) / uu);\n cartesianAddInPlace(q1, A);\n return [q, spherical(q1)];\n }\n }\n\n // Generates a 4-bit vector representing the location of a point relative to\n // the small circle's bounding box.\n function code(lambda, phi) {\n var r = smallRadius ? radius : pi - radius,\n code = 0;\n if (lambda < -r) code |= 1; // left\n else if (lambda > r) code |= 2; // right\n if (phi < -r) code |= 4; // below\n else if (phi > r) code |= 8; // above\n return code;\n }\n\n return clip(visible, clipLine, interpolate, smallRadius ? [0, -radius] : [-pi, radius - pi]);\n}\n","import clipRectangle from \"./rectangle.js\";\n\nexport default function() {\n var x0 = 0,\n y0 = 0,\n x1 = 960,\n y1 = 500,\n cache,\n cacheStream,\n clip;\n\n return clip = {\n stream: function(stream) {\n return cache && cacheStream === stream ? cache : cache = clipRectangle(x0, y0, x1, y1)(cacheStream = stream);\n },\n extent: function(_) {\n return arguments.length ? (x0 = +_[0][0], y0 = +_[0][1], x1 = +_[1][0], y1 = +_[1][1], cache = cacheStream = null, clip) : [[x0, y0], [x1, y1]];\n }\n };\n}\n","import clipBuffer from \"./buffer.js\";\nimport clipRejoin from \"./rejoin.js\";\nimport {epsilon, halfPi} from \"../math.js\";\nimport polygonContains from \"../polygonContains.js\";\nimport {merge} from \"d3-array\";\n\nexport default function(pointVisible, clipLine, interpolate, start) {\n return function(sink) {\n var line = clipLine(sink),\n ringBuffer = clipBuffer(),\n ringSink = clipLine(ringBuffer),\n polygonStarted = false,\n polygon,\n segments,\n ring;\n\n var clip = {\n point: point,\n lineStart: lineStart,\n lineEnd: lineEnd,\n polygonStart: function() {\n clip.point = pointRing;\n clip.lineStart = ringStart;\n clip.lineEnd = ringEnd;\n segments = [];\n polygon = [];\n },\n polygonEnd: function() {\n clip.point = point;\n clip.lineStart = lineStart;\n clip.lineEnd = lineEnd;\n segments = merge(segments);\n var startInside = polygonContains(polygon, start);\n if (segments.length) {\n if (!polygonStarted) sink.polygonStart(), polygonStarted = true;\n clipRejoin(segments, compareIntersection, startInside, interpolate, sink);\n } else if (startInside) {\n if (!polygonStarted) sink.polygonStart(), polygonStarted = true;\n sink.lineStart();\n interpolate(null, null, 1, sink);\n sink.lineEnd();\n }\n if (polygonStarted) sink.polygonEnd(), polygonStarted = false;\n segments = polygon = null;\n },\n sphere: function() {\n sink.polygonStart();\n sink.lineStart();\n interpolate(null, null, 1, sink);\n sink.lineEnd();\n sink.polygonEnd();\n }\n };\n\n function point(lambda, phi) {\n if (pointVisible(lambda, phi)) sink.point(lambda, phi);\n }\n\n function pointLine(lambda, phi) {\n line.point(lambda, phi);\n }\n\n function lineStart() {\n clip.point = pointLine;\n line.lineStart();\n }\n\n function lineEnd() {\n clip.point = point;\n line.lineEnd();\n }\n\n function pointRing(lambda, phi) {\n ring.push([lambda, phi]);\n ringSink.point(lambda, phi);\n }\n\n function ringStart() {\n ringSink.lineStart();\n ring = [];\n }\n\n function ringEnd() {\n pointRing(ring[0][0], ring[0][1]);\n ringSink.lineEnd();\n\n var clean = ringSink.clean(),\n ringSegments = ringBuffer.result(),\n i, n = ringSegments.length, m,\n segment,\n point;\n\n ring.pop();\n polygon.push(ring);\n ring = null;\n\n if (!n) return;\n\n // No intersections.\n if (clean & 1) {\n segment = ringSegments[0];\n if ((m = segment.length - 1) > 0) {\n if (!polygonStarted) sink.polygonStart(), polygonStarted = true;\n sink.lineStart();\n for (i = 0; i < m; ++i) sink.point((point = segment[i])[0], point[1]);\n sink.lineEnd();\n }\n return;\n }\n\n // Rejoin connected segments.\n // TODO reuse ringBuffer.rejoin()?\n if (n > 1 && clean & 2) ringSegments.push(ringSegments.pop().concat(ringSegments.shift()));\n\n segments.push(ringSegments.filter(validSegment));\n }\n\n return clip;\n };\n}\n\nfunction validSegment(segment) {\n return segment.length > 1;\n}\n\n// Intersections are sorted along the clip edge. For both antimeridian cutting\n// and circle clipping, the same comparison is used.\nfunction compareIntersection(a, b) {\n return ((a = a.x)[0] < 0 ? a[1] - halfPi - epsilon : halfPi - a[1])\n - ((b = b.x)[0] < 0 ? b[1] - halfPi - epsilon : halfPi - b[1]);\n}\n","export default function(a, b, x0, y0, x1, y1) {\n var ax = a[0],\n ay = a[1],\n bx = b[0],\n by = b[1],\n t0 = 0,\n t1 = 1,\n dx = bx - ax,\n dy = by - ay,\n r;\n\n r = x0 - ax;\n if (!dx && r > 0) return;\n r /= dx;\n if (dx < 0) {\n if (r < t0) return;\n if (r < t1) t1 = r;\n } else if (dx > 0) {\n if (r > t1) return;\n if (r > t0) t0 = r;\n }\n\n r = x1 - ax;\n if (!dx && r < 0) return;\n r /= dx;\n if (dx < 0) {\n if (r > t1) return;\n if (r > t0) t0 = r;\n } else if (dx > 0) {\n if (r < t0) return;\n if (r < t1) t1 = r;\n }\n\n r = y0 - ay;\n if (!dy && r > 0) return;\n r /= dy;\n if (dy < 0) {\n if (r < t0) return;\n if (r < t1) t1 = r;\n } else if (dy > 0) {\n if (r > t1) return;\n if (r > t0) t0 = r;\n }\n\n r = y1 - ay;\n if (!dy && r < 0) return;\n r /= dy;\n if (dy < 0) {\n if (r > t1) return;\n if (r > t0) t0 = r;\n } else if (dy > 0) {\n if (r < t0) return;\n if (r < t1) t1 = r;\n }\n\n if (t0 > 0) a[0] = ax + t0 * dx, a[1] = ay + t0 * dy;\n if (t1 < 1) b[0] = ax + t1 * dx, b[1] = ay + t1 * dy;\n return true;\n}\n","import {abs, epsilon} from \"../math.js\";\nimport clipBuffer from \"./buffer.js\";\nimport clipLine from \"./line.js\";\nimport clipRejoin from \"./rejoin.js\";\nimport {merge} from \"d3-array\";\n\nvar clipMax = 1e9, clipMin = -clipMax;\n\n// TODO Use d3-polygon’s polygonContains here for the ring check?\n// TODO Eliminate duplicate buffering in clipBuffer and polygon.push?\n\nexport default function clipRectangle(x0, y0, x1, y1) {\n\n function visible(x, y) {\n return x0 <= x && x <= x1 && y0 <= y && y <= y1;\n }\n\n function interpolate(from, to, direction, stream) {\n var a = 0, a1 = 0;\n if (from == null\n || (a = corner(from, direction)) !== (a1 = corner(to, direction))\n || comparePoint(from, to) < 0 ^ direction > 0) {\n do stream.point(a === 0 || a === 3 ? x0 : x1, a > 1 ? y1 : y0);\n while ((a = (a + direction + 4) % 4) !== a1);\n } else {\n stream.point(to[0], to[1]);\n }\n }\n\n function corner(p, direction) {\n return abs(p[0] - x0) < epsilon ? direction > 0 ? 0 : 3\n : abs(p[0] - x1) < epsilon ? direction > 0 ? 2 : 1\n : abs(p[1] - y0) < epsilon ? direction > 0 ? 1 : 0\n : direction > 0 ? 3 : 2; // abs(p[1] - y1) < epsilon\n }\n\n function compareIntersection(a, b) {\n return comparePoint(a.x, b.x);\n }\n\n function comparePoint(a, b) {\n var ca = corner(a, 1),\n cb = corner(b, 1);\n return ca !== cb ? ca - cb\n : ca === 0 ? b[1] - a[1]\n : ca === 1 ? a[0] - b[0]\n : ca === 2 ? a[1] - b[1]\n : b[0] - a[0];\n }\n\n return function(stream) {\n var activeStream = stream,\n bufferStream = clipBuffer(),\n segments,\n polygon,\n ring,\n x__, y__, v__, // first point\n x_, y_, v_, // previous point\n first,\n clean;\n\n var clipStream = {\n point: point,\n lineStart: lineStart,\n lineEnd: lineEnd,\n polygonStart: polygonStart,\n polygonEnd: polygonEnd\n };\n\n function point(x, y) {\n if (visible(x, y)) activeStream.point(x, y);\n }\n\n function polygonInside() {\n var winding = 0;\n\n for (var i = 0, n = polygon.length; i < n; ++i) {\n for (var ring = polygon[i], j = 1, m = ring.length, point = ring[0], a0, a1, b0 = point[0], b1 = point[1]; j < m; ++j) {\n a0 = b0, a1 = b1, point = ring[j], b0 = point[0], b1 = point[1];\n if (a1 <= y1) { if (b1 > y1 && (b0 - a0) * (y1 - a1) > (b1 - a1) * (x0 - a0)) ++winding; }\n else { if (b1 <= y1 && (b0 - a0) * (y1 - a1) < (b1 - a1) * (x0 - a0)) --winding; }\n }\n }\n\n return winding;\n }\n\n // Buffer geometry within a polygon and then clip it en masse.\n function polygonStart() {\n activeStream = bufferStream, segments = [], polygon = [], clean = true;\n }\n\n function polygonEnd() {\n var startInside = polygonInside(),\n cleanInside = clean && startInside,\n visible = (segments = merge(segments)).length;\n if (cleanInside || visible) {\n stream.polygonStart();\n if (cleanInside) {\n stream.lineStart();\n interpolate(null, null, 1, stream);\n stream.lineEnd();\n }\n if (visible) {\n clipRejoin(segments, compareIntersection, startInside, interpolate, stream);\n }\n stream.polygonEnd();\n }\n activeStream = stream, segments = polygon = ring = null;\n }\n\n function lineStart() {\n clipStream.point = linePoint;\n if (polygon) polygon.push(ring = []);\n first = true;\n v_ = false;\n x_ = y_ = NaN;\n }\n\n // TODO rather than special-case polygons, simply handle them separately.\n // Ideally, coincident intersection points should be jittered to avoid\n // clipping issues.\n function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n clipStream.point = point;\n if (v_) activeStream.lineEnd();\n }\n\n function linePoint(x, y) {\n var v = visible(x, y);\n if (polygon) ring.push([x, y]);\n if (first) {\n x__ = x, y__ = y, v__ = v;\n first = false;\n if (v) {\n activeStream.lineStart();\n activeStream.point(x, y);\n }\n } else {\n if (v && v_) activeStream.point(x, y);\n else {\n var a = [x_ = Math.max(clipMin, Math.min(clipMax, x_)), y_ = Math.max(clipMin, Math.min(clipMax, y_))],\n b = [x = Math.max(clipMin, Math.min(clipMax, x)), y = Math.max(clipMin, Math.min(clipMax, y))];\n if (clipLine(a, b, x0, y0, x1, y1)) {\n if (!v_) {\n activeStream.lineStart();\n activeStream.point(a[0], a[1]);\n }\n activeStream.point(b[0], b[1]);\n if (!v) activeStream.lineEnd();\n clean = false;\n } else if (v) {\n activeStream.lineStart();\n activeStream.point(x, y);\n clean = false;\n }\n }\n }\n x_ = x, y_ = y, v_ = v;\n }\n\n return clipStream;\n };\n}\n","import pointEqual from \"../pointEqual.js\";\nimport {epsilon} from \"../math.js\";\n\nfunction Intersection(point, points, other, entry) {\n this.x = point;\n this.z = points;\n this.o = other; // another intersection\n this.e = entry; // is an entry?\n this.v = false; // visited\n this.n = this.p = null; // next & previous\n}\n\n// A generalized polygon clipping algorithm: given a polygon that has been cut\n// into its visible line segments, and rejoins the segments by interpolating\n// along the clip edge.\nexport default function(segments, compareIntersection, startInside, interpolate, stream) {\n var subject = [],\n clip = [],\n i,\n n;\n\n segments.forEach(function(segment) {\n if ((n = segment.length - 1) <= 0) return;\n var n, p0 = segment[0], p1 = segment[n], x;\n\n if (pointEqual(p0, p1)) {\n if (!p0[2] && !p1[2]) {\n stream.lineStart();\n for (i = 0; i < n; ++i) stream.point((p0 = segment[i])[0], p0[1]);\n stream.lineEnd();\n return;\n }\n // handle degenerate cases by moving the point\n p1[0] += 2 * epsilon;\n }\n\n subject.push(x = new Intersection(p0, segment, null, true));\n clip.push(x.o = new Intersection(p0, null, x, false));\n subject.push(x = new Intersection(p1, segment, null, false));\n clip.push(x.o = new Intersection(p1, null, x, true));\n });\n\n if (!subject.length) return;\n\n clip.sort(compareIntersection);\n link(subject);\n link(clip);\n\n for (i = 0, n = clip.length; i < n; ++i) {\n clip[i].e = startInside = !startInside;\n }\n\n var start = subject[0],\n points,\n point;\n\n while (1) {\n // Find first unvisited intersection.\n var current = start,\n isSubject = true;\n while (current.v) if ((current = current.n) === start) return;\n points = current.z;\n stream.lineStart();\n do {\n current.v = current.o.v = true;\n if (current.e) {\n if (isSubject) {\n for (i = 0, n = points.length; i < n; ++i) stream.point((point = points[i])[0], point[1]);\n } else {\n interpolate(current.x, current.n.x, 1, stream);\n }\n current = current.n;\n } else {\n if (isSubject) {\n points = current.p.z;\n for (i = points.length - 1; i >= 0; --i) stream.point((point = points[i])[0], point[1]);\n } else {\n interpolate(current.x, current.p.x, -1, stream);\n }\n current = current.p;\n }\n current = current.o;\n points = current.z;\n isSubject = !isSubject;\n } while (!current.v);\n stream.lineEnd();\n }\n}\n\nfunction link(array) {\n if (!(n = array.length)) return;\n var n,\n i = 0,\n a = array[0],\n b;\n while (++i < n) {\n a.n = b = array[i];\n b.p = a;\n a = b;\n }\n a.n = b = array[0];\n b.p = a;\n}\n","export default function(a, b) {\n\n function compose(x, y) {\n return x = a(x, y), b(x[0], x[1]);\n }\n\n if (a.invert && b.invert) compose.invert = function(x, y) {\n return x = b.invert(x, y), x && a.invert(x[0], x[1]);\n };\n\n return compose;\n}\n","export default function(x) {\n return function() {\n return x;\n };\n}\n","import {default as polygonContains} from \"./polygonContains.js\";\nimport {default as distance} from \"./distance.js\";\nimport {epsilon2, radians} from \"./math.js\";\n\nvar containsObjectType = {\n Feature: function(object, point) {\n return containsGeometry(object.geometry, point);\n },\n FeatureCollection: function(object, point) {\n var features = object.features, i = -1, n = features.length;\n while (++i < n) if (containsGeometry(features[i].geometry, point)) return true;\n return false;\n }\n};\n\nvar containsGeometryType = {\n Sphere: function() {\n return true;\n },\n Point: function(object, point) {\n return containsPoint(object.coordinates, point);\n },\n MultiPoint: function(object, point) {\n var coordinates = object.coordinates, i = -1, n = coordinates.length;\n while (++i < n) if (containsPoint(coordinates[i], point)) return true;\n return false;\n },\n LineString: function(object, point) {\n return containsLine(object.coordinates, point);\n },\n MultiLineString: function(object, point) {\n var coordinates = object.coordinates, i = -1, n = coordinates.length;\n while (++i < n) if (containsLine(coordinates[i], point)) return true;\n return false;\n },\n Polygon: function(object, point) {\n return containsPolygon(object.coordinates, point);\n },\n MultiPolygon: function(object, point) {\n var coordinates = object.coordinates, i = -1, n = coordinates.length;\n while (++i < n) if (containsPolygon(coordinates[i], point)) return true;\n return false;\n },\n GeometryCollection: function(object, point) {\n var geometries = object.geometries, i = -1, n = geometries.length;\n while (++i < n) if (containsGeometry(geometries[i], point)) return true;\n return false;\n }\n};\n\nfunction containsGeometry(geometry, point) {\n return geometry && containsGeometryType.hasOwnProperty(geometry.type)\n ? containsGeometryType[geometry.type](geometry, point)\n : false;\n}\n\nfunction containsPoint(coordinates, point) {\n return distance(coordinates, point) === 0;\n}\n\nfunction containsLine(coordinates, point) {\n var ao, bo, ab;\n for (var i = 0, n = coordinates.length; i < n; i++) {\n bo = distance(coordinates[i], point);\n if (bo === 0) return true;\n if (i > 0) {\n ab = distance(coordinates[i], coordinates[i - 1]);\n if (\n ab > 0 &&\n ao <= ab &&\n bo <= ab &&\n (ao + bo - ab) * (1 - Math.pow((ao - bo) / ab, 2)) < epsilon2 * ab\n )\n return true;\n }\n ao = bo;\n }\n return false;\n}\n\nfunction containsPolygon(coordinates, point) {\n return !!polygonContains(coordinates.map(ringRadians), pointRadians(point));\n}\n\nfunction ringRadians(ring) {\n return ring = ring.map(pointRadians), ring.pop(), ring;\n}\n\nfunction pointRadians(point) {\n return [point[0] * radians, point[1] * radians];\n}\n\nexport default function(object, point) {\n return (object && containsObjectType.hasOwnProperty(object.type)\n ? containsObjectType[object.type]\n : containsGeometry)(object, point);\n}\n","import length from \"./length.js\";\n\nvar coordinates = [null, null],\n object = {type: \"LineString\", coordinates: coordinates};\n\nexport default function(a, b) {\n coordinates[0] = a;\n coordinates[1] = b;\n return length(object);\n}\n","import {range} from \"d3-array\";\nimport {abs, ceil, epsilon} from \"./math.js\";\n\nfunction graticuleX(y0, y1, dy) {\n var y = range(y0, y1 - epsilon, dy).concat(y1);\n return function(x) { return y.map(function(y) { return [x, y]; }); };\n}\n\nfunction graticuleY(x0, x1, dx) {\n var x = range(x0, x1 - epsilon, dx).concat(x1);\n return function(y) { return x.map(function(x) { return [x, y]; }); };\n}\n\nexport default function graticule() {\n var x1, x0, X1, X0,\n y1, y0, Y1, Y0,\n dx = 10, dy = dx, DX = 90, DY = 360,\n x, y, X, Y,\n precision = 2.5;\n\n function graticule() {\n return {type: \"MultiLineString\", coordinates: lines()};\n }\n\n function lines() {\n return range(ceil(X0 / DX) * DX, X1, DX).map(X)\n .concat(range(ceil(Y0 / DY) * DY, Y1, DY).map(Y))\n .concat(range(ceil(x0 / dx) * dx, x1, dx).filter(function(x) { return abs(x % DX) > epsilon; }).map(x))\n .concat(range(ceil(y0 / dy) * dy, y1, dy).filter(function(y) { return abs(y % DY) > epsilon; }).map(y));\n }\n\n graticule.lines = function() {\n return lines().map(function(coordinates) { return {type: \"LineString\", coordinates: coordinates}; });\n };\n\n graticule.outline = function() {\n return {\n type: \"Polygon\",\n coordinates: [\n X(X0).concat(\n Y(Y1).slice(1),\n X(X1).reverse().slice(1),\n Y(Y0).reverse().slice(1))\n ]\n };\n };\n\n graticule.extent = function(_) {\n if (!arguments.length) return graticule.extentMinor();\n return graticule.extentMajor(_).extentMinor(_);\n };\n\n graticule.extentMajor = function(_) {\n if (!arguments.length) return [[X0, Y0], [X1, Y1]];\n X0 = +_[0][0], X1 = +_[1][0];\n Y0 = +_[0][1], Y1 = +_[1][1];\n if (X0 > X1) _ = X0, X0 = X1, X1 = _;\n if (Y0 > Y1) _ = Y0, Y0 = Y1, Y1 = _;\n return graticule.precision(precision);\n };\n\n graticule.extentMinor = function(_) {\n if (!arguments.length) return [[x0, y0], [x1, y1]];\n x0 = +_[0][0], x1 = +_[1][0];\n y0 = +_[0][1], y1 = +_[1][1];\n if (x0 > x1) _ = x0, x0 = x1, x1 = _;\n if (y0 > y1) _ = y0, y0 = y1, y1 = _;\n return graticule.precision(precision);\n };\n\n graticule.step = function(_) {\n if (!arguments.length) return graticule.stepMinor();\n return graticule.stepMajor(_).stepMinor(_);\n };\n\n graticule.stepMajor = function(_) {\n if (!arguments.length) return [DX, DY];\n DX = +_[0], DY = +_[1];\n return graticule;\n };\n\n graticule.stepMinor = function(_) {\n if (!arguments.length) return [dx, dy];\n dx = +_[0], dy = +_[1];\n return graticule;\n };\n\n graticule.precision = function(_) {\n if (!arguments.length) return precision;\n precision = +_;\n x = graticuleX(y0, y1, 90);\n y = graticuleY(x0, x1, precision);\n X = graticuleX(Y0, Y1, 90);\n Y = graticuleY(X0, X1, precision);\n return graticule;\n };\n\n return graticule\n .extentMajor([[-180, -90 + epsilon], [180, 90 - epsilon]])\n .extentMinor([[-180, -80 - epsilon], [180, 80 + epsilon]]);\n}\n\nexport function graticule10() {\n return graticule()();\n}\n","export default x => x;\n","export {default as geoArea} from \"./area.js\";\nexport {default as geoBounds} from \"./bounds.js\";\nexport {default as geoCentroid} from \"./centroid.js\";\nexport {default as geoCircle} from \"./circle.js\";\nexport {default as geoClipAntimeridian} from \"./clip/antimeridian.js\";\nexport {default as geoClipCircle} from \"./clip/circle.js\";\nexport {default as geoClipExtent} from \"./clip/extent.js\"; // DEPRECATED! Use d3.geoIdentity().clipExtent(…).\nexport {default as geoClipRectangle} from \"./clip/rectangle.js\";\nexport {default as geoContains} from \"./contains.js\";\nexport {default as geoDistance} from \"./distance.js\";\nexport {default as geoGraticule, graticule10 as geoGraticule10} from \"./graticule.js\";\nexport {default as geoInterpolate} from \"./interpolate.js\";\nexport {default as geoLength} from \"./length.js\";\nexport {default as geoPath} from \"./path/index.js\";\nexport {default as geoAlbers} from \"./projection/albers.js\";\nexport {default as geoAlbersUsa} from \"./projection/albersUsa.js\";\nexport {default as geoAzimuthalEqualArea, azimuthalEqualAreaRaw as geoAzimuthalEqualAreaRaw} from \"./projection/azimuthalEqualArea.js\";\nexport {default as geoAzimuthalEquidistant, azimuthalEquidistantRaw as geoAzimuthalEquidistantRaw} from \"./projection/azimuthalEquidistant.js\";\nexport {default as geoConicConformal, conicConformalRaw as geoConicConformalRaw} from \"./projection/conicConformal.js\";\nexport {default as geoConicEqualArea, conicEqualAreaRaw as geoConicEqualAreaRaw} from \"./projection/conicEqualArea.js\";\nexport {default as geoConicEquidistant, conicEquidistantRaw as geoConicEquidistantRaw} from \"./projection/conicEquidistant.js\";\nexport {default as geoEqualEarth, equalEarthRaw as geoEqualEarthRaw} from \"./projection/equalEarth.js\";\nexport {default as geoEquirectangular, equirectangularRaw as geoEquirectangularRaw} from \"./projection/equirectangular.js\";\nexport {default as geoGnomonic, gnomonicRaw as geoGnomonicRaw} from \"./projection/gnomonic.js\";\nexport {default as geoIdentity} from \"./projection/identity.js\";\nexport {default as geoProjection, projectionMutator as geoProjectionMutator} from \"./projection/index.js\";\nexport {default as geoMercator, mercatorRaw as geoMercatorRaw} from \"./projection/mercator.js\";\nexport {default as geoNaturalEarth1, naturalEarth1Raw as geoNaturalEarth1Raw} from \"./projection/naturalEarth1.js\";\nexport {default as geoOrthographic, orthographicRaw as geoOrthographicRaw} from \"./projection/orthographic.js\";\nexport {default as geoStereographic, stereographicRaw as geoStereographicRaw} from \"./projection/stereographic.js\";\nexport {default as geoTransverseMercator, transverseMercatorRaw as geoTransverseMercatorRaw} from \"./projection/transverseMercator.js\";\nexport {default as geoRotation} from \"./rotation.js\";\nexport {default as geoStream} from \"./stream.js\";\nexport {default as geoTransform} from \"./transform.js\";\n","import {asin, atan2, cos, degrees, haversin, radians, sin, sqrt} from \"./math.js\";\n\nexport default function(a, b) {\n var x0 = a[0] * radians,\n y0 = a[1] * radians,\n x1 = b[0] * radians,\n y1 = b[1] * radians,\n cy0 = cos(y0),\n sy0 = sin(y0),\n cy1 = cos(y1),\n sy1 = sin(y1),\n kx0 = cy0 * cos(x0),\n ky0 = cy0 * sin(x0),\n kx1 = cy1 * cos(x1),\n ky1 = cy1 * sin(x1),\n d = 2 * asin(sqrt(haversin(y1 - y0) + cy0 * cy1 * haversin(x1 - x0))),\n k = sin(d);\n\n var interpolate = d ? function(t) {\n var B = sin(t *= d) / k,\n A = sin(d - t) / k,\n x = A * kx0 + B * kx1,\n y = A * ky0 + B * ky1,\n z = A * sy0 + B * sy1;\n return [\n atan2(y, x) * degrees,\n atan2(z, sqrt(x * x + y * y)) * degrees\n ];\n } : function() {\n return [x0 * degrees, y0 * degrees];\n };\n\n interpolate.distance = d;\n\n return interpolate;\n}\n","import {Adder} from \"d3-array\";\nimport {abs, atan2, cos, radians, sin, sqrt} from \"./math.js\";\nimport noop from \"./noop.js\";\nimport stream from \"./stream.js\";\n\nvar lengthSum,\n lambda0,\n sinPhi0,\n cosPhi0;\n\nvar lengthStream = {\n sphere: noop,\n point: noop,\n lineStart: lengthLineStart,\n lineEnd: noop,\n polygonStart: noop,\n polygonEnd: noop\n};\n\nfunction lengthLineStart() {\n lengthStream.point = lengthPointFirst;\n lengthStream.lineEnd = lengthLineEnd;\n}\n\nfunction lengthLineEnd() {\n lengthStream.point = lengthStream.lineEnd = noop;\n}\n\nfunction lengthPointFirst(lambda, phi) {\n lambda *= radians, phi *= radians;\n lambda0 = lambda, sinPhi0 = sin(phi), cosPhi0 = cos(phi);\n lengthStream.point = lengthPoint;\n}\n\nfunction lengthPoint(lambda, phi) {\n lambda *= radians, phi *= radians;\n var sinPhi = sin(phi),\n cosPhi = cos(phi),\n delta = abs(lambda - lambda0),\n cosDelta = cos(delta),\n sinDelta = sin(delta),\n x = cosPhi * sinDelta,\n y = cosPhi0 * sinPhi - sinPhi0 * cosPhi * cosDelta,\n z = sinPhi0 * sinPhi + cosPhi0 * cosPhi * cosDelta;\n lengthSum.add(atan2(sqrt(x * x + y * y), z));\n lambda0 = lambda, sinPhi0 = sinPhi, cosPhi0 = cosPhi;\n}\n\nexport default function(object) {\n lengthSum = new Adder();\n stream(object, lengthStream);\n return +lengthSum;\n}\n","export var epsilon = 1e-6;\nexport var epsilon2 = 1e-12;\nexport var pi = Math.PI;\nexport var halfPi = pi / 2;\nexport var quarterPi = pi / 4;\nexport var tau = pi * 2;\n\nexport var degrees = 180 / pi;\nexport var radians = pi / 180;\n\nexport var abs = Math.abs;\nexport var atan = Math.atan;\nexport var atan2 = Math.atan2;\nexport var cos = Math.cos;\nexport var ceil = Math.ceil;\nexport var exp = Math.exp;\nexport var floor = Math.floor;\nexport var hypot = Math.hypot;\nexport var log = Math.log;\nexport var pow = Math.pow;\nexport var sin = Math.sin;\nexport var sign = Math.sign || function(x) { return x > 0 ? 1 : x < 0 ? -1 : 0; };\nexport var sqrt = Math.sqrt;\nexport var tan = Math.tan;\n\nexport function acos(x) {\n return x > 1 ? 0 : x < -1 ? pi : Math.acos(x);\n}\n\nexport function asin(x) {\n return x > 1 ? halfPi : x < -1 ? -halfPi : Math.asin(x);\n}\n\nexport function haversin(x) {\n return (x = sin(x / 2)) * x;\n}\n","export default function noop() {}\n","import {Adder} from \"d3-array\";\nimport {abs} from \"../math.js\";\nimport noop from \"../noop.js\";\n\nvar areaSum = new Adder(),\n areaRingSum = new Adder(),\n x00,\n y00,\n x0,\n y0;\n\nvar areaStream = {\n point: noop,\n lineStart: noop,\n lineEnd: noop,\n polygonStart: function() {\n areaStream.lineStart = areaRingStart;\n areaStream.lineEnd = areaRingEnd;\n },\n polygonEnd: function() {\n areaStream.lineStart = areaStream.lineEnd = areaStream.point = noop;\n areaSum.add(abs(areaRingSum));\n areaRingSum = new Adder();\n },\n result: function() {\n var area = areaSum / 2;\n areaSum = new Adder();\n return area;\n }\n};\n\nfunction areaRingStart() {\n areaStream.point = areaPointFirst;\n}\n\nfunction areaPointFirst(x, y) {\n areaStream.point = areaPoint;\n x00 = x0 = x, y00 = y0 = y;\n}\n\nfunction areaPoint(x, y) {\n areaRingSum.add(y0 * x - x0 * y);\n x0 = x, y0 = y;\n}\n\nfunction areaRingEnd() {\n areaPoint(x00, y00);\n}\n\nexport default areaStream;\n","import noop from \"../noop.js\";\n\nvar x0 = Infinity,\n y0 = x0,\n x1 = -x0,\n y1 = x1;\n\nvar boundsStream = {\n point: boundsPoint,\n lineStart: noop,\n lineEnd: noop,\n polygonStart: noop,\n polygonEnd: noop,\n result: function() {\n var bounds = [[x0, y0], [x1, y1]];\n x1 = y1 = -(y0 = x0 = Infinity);\n return bounds;\n }\n};\n\nfunction boundsPoint(x, y) {\n if (x < x0) x0 = x;\n if (x > x1) x1 = x;\n if (y < y0) y0 = y;\n if (y > y1) y1 = y;\n}\n\nexport default boundsStream;\n","import {sqrt} from \"../math.js\";\n\n// TODO Enforce positive area for exterior, negative area for interior?\n\nvar X0 = 0,\n Y0 = 0,\n Z0 = 0,\n X1 = 0,\n Y1 = 0,\n Z1 = 0,\n X2 = 0,\n Y2 = 0,\n Z2 = 0,\n x00,\n y00,\n x0,\n y0;\n\nvar centroidStream = {\n point: centroidPoint,\n lineStart: centroidLineStart,\n lineEnd: centroidLineEnd,\n polygonStart: function() {\n centroidStream.lineStart = centroidRingStart;\n centroidStream.lineEnd = centroidRingEnd;\n },\n polygonEnd: function() {\n centroidStream.point = centroidPoint;\n centroidStream.lineStart = centroidLineStart;\n centroidStream.lineEnd = centroidLineEnd;\n },\n result: function() {\n var centroid = Z2 ? [X2 / Z2, Y2 / Z2]\n : Z1 ? [X1 / Z1, Y1 / Z1]\n : Z0 ? [X0 / Z0, Y0 / Z0]\n : [NaN, NaN];\n X0 = Y0 = Z0 =\n X1 = Y1 = Z1 =\n X2 = Y2 = Z2 = 0;\n return centroid;\n }\n};\n\nfunction centroidPoint(x, y) {\n X0 += x;\n Y0 += y;\n ++Z0;\n}\n\nfunction centroidLineStart() {\n centroidStream.point = centroidPointFirstLine;\n}\n\nfunction centroidPointFirstLine(x, y) {\n centroidStream.point = centroidPointLine;\n centroidPoint(x0 = x, y0 = y);\n}\n\nfunction centroidPointLine(x, y) {\n var dx = x - x0, dy = y - y0, z = sqrt(dx * dx + dy * dy);\n X1 += z * (x0 + x) / 2;\n Y1 += z * (y0 + y) / 2;\n Z1 += z;\n centroidPoint(x0 = x, y0 = y);\n}\n\nfunction centroidLineEnd() {\n centroidStream.point = centroidPoint;\n}\n\nfunction centroidRingStart() {\n centroidStream.point = centroidPointFirstRing;\n}\n\nfunction centroidRingEnd() {\n centroidPointRing(x00, y00);\n}\n\nfunction centroidPointFirstRing(x, y) {\n centroidStream.point = centroidPointRing;\n centroidPoint(x00 = x0 = x, y00 = y0 = y);\n}\n\nfunction centroidPointRing(x, y) {\n var dx = x - x0,\n dy = y - y0,\n z = sqrt(dx * dx + dy * dy);\n\n X1 += z * (x0 + x) / 2;\n Y1 += z * (y0 + y) / 2;\n Z1 += z;\n\n z = y0 * x - x0 * y;\n X2 += z * (x0 + x);\n Y2 += z * (y0 + y);\n Z2 += z * 3;\n centroidPoint(x0 = x, y0 = y);\n}\n\nexport default centroidStream;\n","import {tau} from \"../math.js\";\nimport noop from \"../noop.js\";\n\nexport default function PathContext(context) {\n this._context = context;\n}\n\nPathContext.prototype = {\n _radius: 4.5,\n pointRadius: function(_) {\n return this._radius = _, this;\n },\n polygonStart: function() {\n this._line = 0;\n },\n polygonEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line === 0) this._context.closePath();\n this._point = NaN;\n },\n point: function(x, y) {\n switch (this._point) {\n case 0: {\n this._context.moveTo(x, y);\n this._point = 1;\n break;\n }\n case 1: {\n this._context.lineTo(x, y);\n break;\n }\n default: {\n this._context.moveTo(x + this._radius, y);\n this._context.arc(x, y, this._radius, 0, tau);\n break;\n }\n }\n },\n result: noop\n};\n","import identity from \"../identity.js\";\nimport stream from \"../stream.js\";\nimport pathArea from \"./area.js\";\nimport pathBounds from \"./bounds.js\";\nimport pathCentroid from \"./centroid.js\";\nimport PathContext from \"./context.js\";\nimport pathMeasure from \"./measure.js\";\nimport PathString from \"./string.js\";\n\nexport default function(projection, context) {\n var pointRadius = 4.5,\n projectionStream,\n contextStream;\n\n function path(object) {\n if (object) {\n if (typeof pointRadius === \"function\") contextStream.pointRadius(+pointRadius.apply(this, arguments));\n stream(object, projectionStream(contextStream));\n }\n return contextStream.result();\n }\n\n path.area = function(object) {\n stream(object, projectionStream(pathArea));\n return pathArea.result();\n };\n\n path.measure = function(object) {\n stream(object, projectionStream(pathMeasure));\n return pathMeasure.result();\n };\n\n path.bounds = function(object) {\n stream(object, projectionStream(pathBounds));\n return pathBounds.result();\n };\n\n path.centroid = function(object) {\n stream(object, projectionStream(pathCentroid));\n return pathCentroid.result();\n };\n\n path.projection = function(_) {\n return arguments.length ? (projectionStream = _ == null ? (projection = null, identity) : (projection = _).stream, path) : projection;\n };\n\n path.context = function(_) {\n if (!arguments.length) return context;\n contextStream = _ == null ? (context = null, new PathString) : new PathContext(context = _);\n if (typeof pointRadius !== \"function\") contextStream.pointRadius(pointRadius);\n return path;\n };\n\n path.pointRadius = function(_) {\n if (!arguments.length) return pointRadius;\n pointRadius = typeof _ === \"function\" ? _ : (contextStream.pointRadius(+_), +_);\n return path;\n };\n\n return path.projection(projection).context(context);\n}\n","import {Adder} from \"d3-array\";\nimport {sqrt} from \"../math.js\";\nimport noop from \"../noop.js\";\n\nvar lengthSum = new Adder(),\n lengthRing,\n x00,\n y00,\n x0,\n y0;\n\nvar lengthStream = {\n point: noop,\n lineStart: function() {\n lengthStream.point = lengthPointFirst;\n },\n lineEnd: function() {\n if (lengthRing) lengthPoint(x00, y00);\n lengthStream.point = noop;\n },\n polygonStart: function() {\n lengthRing = true;\n },\n polygonEnd: function() {\n lengthRing = null;\n },\n result: function() {\n var length = +lengthSum;\n lengthSum = new Adder();\n return length;\n }\n};\n\nfunction lengthPointFirst(x, y) {\n lengthStream.point = lengthPoint;\n x00 = x0 = x, y00 = y0 = y;\n}\n\nfunction lengthPoint(x, y) {\n x0 -= x, y0 -= y;\n lengthSum.add(sqrt(x0 * x0 + y0 * y0));\n x0 = x, y0 = y;\n}\n\nexport default lengthStream;\n","export default function PathString() {\n this._string = [];\n}\n\nPathString.prototype = {\n _radius: 4.5,\n _circle: circle(4.5),\n pointRadius: function(_) {\n if ((_ = +_) !== this._radius) this._radius = _, this._circle = null;\n return this;\n },\n polygonStart: function() {\n this._line = 0;\n },\n polygonEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line === 0) this._string.push(\"Z\");\n this._point = NaN;\n },\n point: function(x, y) {\n switch (this._point) {\n case 0: {\n this._string.push(\"M\", x, \",\", y);\n this._point = 1;\n break;\n }\n case 1: {\n this._string.push(\"L\", x, \",\", y);\n break;\n }\n default: {\n if (this._circle == null) this._circle = circle(this._radius);\n this._string.push(\"M\", x, \",\", y, this._circle);\n break;\n }\n }\n },\n result: function() {\n if (this._string.length) {\n var result = this._string.join(\"\");\n this._string = [];\n return result;\n } else {\n return null;\n }\n }\n};\n\nfunction circle(radius) {\n return \"m0,\" + radius\n + \"a\" + radius + \",\" + radius + \" 0 1,1 0,\" + -2 * radius\n + \"a\" + radius + \",\" + radius + \" 0 1,1 0,\" + 2 * radius\n + \"z\";\n}\n","import {abs, epsilon} from \"./math.js\";\n\nexport default function(a, b) {\n return abs(a[0] - b[0]) < epsilon && abs(a[1] - b[1]) < epsilon;\n}\n","import {Adder} from \"d3-array\";\nimport {cartesian, cartesianCross, cartesianNormalizeInPlace} from \"./cartesian.js\";\nimport {abs, asin, atan2, cos, epsilon, epsilon2, halfPi, pi, quarterPi, sign, sin, tau} from \"./math.js\";\n\nfunction longitude(point) {\n if (abs(point[0]) <= pi)\n return point[0];\n else\n return sign(point[0]) * ((abs(point[0]) + pi) % tau - pi);\n}\n\nexport default function(polygon, point) {\n var lambda = longitude(point),\n phi = point[1],\n sinPhi = sin(phi),\n normal = [sin(lambda), -cos(lambda), 0],\n angle = 0,\n winding = 0;\n\n var sum = new Adder();\n\n if (sinPhi === 1) phi = halfPi + epsilon;\n else if (sinPhi === -1) phi = -halfPi - epsilon;\n\n for (var i = 0, n = polygon.length; i < n; ++i) {\n if (!(m = (ring = polygon[i]).length)) continue;\n var ring,\n m,\n point0 = ring[m - 1],\n lambda0 = longitude(point0),\n phi0 = point0[1] / 2 + quarterPi,\n sinPhi0 = sin(phi0),\n cosPhi0 = cos(phi0);\n\n for (var j = 0; j < m; ++j, lambda0 = lambda1, sinPhi0 = sinPhi1, cosPhi0 = cosPhi1, point0 = point1) {\n var point1 = ring[j],\n lambda1 = longitude(point1),\n phi1 = point1[1] / 2 + quarterPi,\n sinPhi1 = sin(phi1),\n cosPhi1 = cos(phi1),\n delta = lambda1 - lambda0,\n sign = delta >= 0 ? 1 : -1,\n absDelta = sign * delta,\n antimeridian = absDelta > pi,\n k = sinPhi0 * sinPhi1;\n\n sum.add(atan2(k * sign * sin(absDelta), cosPhi0 * cosPhi1 + k * cos(absDelta)));\n angle += antimeridian ? delta + sign * tau : delta;\n\n // Are the longitudes either side of the point’s meridian (lambda),\n // and are the latitudes smaller than the parallel (phi)?\n if (antimeridian ^ lambda0 >= lambda ^ lambda1 >= lambda) {\n var arc = cartesianCross(cartesian(point0), cartesian(point1));\n cartesianNormalizeInPlace(arc);\n var intersection = cartesianCross(normal, arc);\n cartesianNormalizeInPlace(intersection);\n var phiArc = (antimeridian ^ delta >= 0 ? -1 : 1) * asin(intersection[2]);\n if (phi > phiArc || phi === phiArc && (arc[0] || arc[1])) {\n winding += antimeridian ^ delta >= 0 ? 1 : -1;\n }\n }\n }\n }\n\n // First, determine whether the South pole is inside or outside:\n //\n // It is inside if:\n // * the polygon winds around it in a clockwise direction.\n // * the polygon does not (cumulatively) wind around it, but has a negative\n // (counter-clockwise) area.\n //\n // Second, count the (signed) number of times a segment crosses a lambda\n // from the point to the South pole. If it is zero, then the point is the\n // same side as the South pole.\n\n return (angle < -epsilon || angle < epsilon && sum < -epsilon2) ^ (winding & 1);\n}\n","import conicEqualArea from \"./conicEqualArea.js\";\n\nexport default function() {\n return conicEqualArea()\n .parallels([29.5, 45.5])\n .scale(1070)\n .translate([480, 250])\n .rotate([96, 0])\n .center([-0.6, 38.7]);\n}\n","import {epsilon} from \"../math.js\";\nimport albers from \"./albers.js\";\nimport conicEqualArea from \"./conicEqualArea.js\";\nimport {fitExtent, fitSize, fitWidth, fitHeight} from \"./fit.js\";\n\n// The projections must have mutually exclusive clip regions on the sphere,\n// as this will avoid emitting interleaving lines and polygons.\nfunction multiplex(streams) {\n var n = streams.length;\n return {\n point: function(x, y) { var i = -1; while (++i < n) streams[i].point(x, y); },\n sphere: function() { var i = -1; while (++i < n) streams[i].sphere(); },\n lineStart: function() { var i = -1; while (++i < n) streams[i].lineStart(); },\n lineEnd: function() { var i = -1; while (++i < n) streams[i].lineEnd(); },\n polygonStart: function() { var i = -1; while (++i < n) streams[i].polygonStart(); },\n polygonEnd: function() { var i = -1; while (++i < n) streams[i].polygonEnd(); }\n };\n}\n\n// A composite projection for the United States, configured by default for\n// 960×500. The projection also works quite well at 960×600 if you change the\n// scale to 1285 and adjust the translate accordingly. The set of standard\n// parallels for each region comes from USGS, which is published here:\n// http://egsc.usgs.gov/isb/pubs/MapProjections/projections.html#albers\nexport default function() {\n var cache,\n cacheStream,\n lower48 = albers(), lower48Point,\n alaska = conicEqualArea().rotate([154, 0]).center([-2, 58.5]).parallels([55, 65]), alaskaPoint, // EPSG:3338\n hawaii = conicEqualArea().rotate([157, 0]).center([-3, 19.9]).parallels([8, 18]), hawaiiPoint, // ESRI:102007\n point, pointStream = {point: function(x, y) { point = [x, y]; }};\n\n function albersUsa(coordinates) {\n var x = coordinates[0], y = coordinates[1];\n return point = null,\n (lower48Point.point(x, y), point)\n || (alaskaPoint.point(x, y), point)\n || (hawaiiPoint.point(x, y), point);\n }\n\n albersUsa.invert = function(coordinates) {\n var k = lower48.scale(),\n t = lower48.translate(),\n x = (coordinates[0] - t[0]) / k,\n y = (coordinates[1] - t[1]) / k;\n return (y >= 0.120 && y < 0.234 && x >= -0.425 && x < -0.214 ? alaska\n : y >= 0.166 && y < 0.234 && x >= -0.214 && x < -0.115 ? hawaii\n : lower48).invert(coordinates);\n };\n\n albersUsa.stream = function(stream) {\n return cache && cacheStream === stream ? cache : cache = multiplex([lower48.stream(cacheStream = stream), alaska.stream(stream), hawaii.stream(stream)]);\n };\n\n albersUsa.precision = function(_) {\n if (!arguments.length) return lower48.precision();\n lower48.precision(_), alaska.precision(_), hawaii.precision(_);\n return reset();\n };\n\n albersUsa.scale = function(_) {\n if (!arguments.length) return lower48.scale();\n lower48.scale(_), alaska.scale(_ * 0.35), hawaii.scale(_);\n return albersUsa.translate(lower48.translate());\n };\n\n albersUsa.translate = function(_) {\n if (!arguments.length) return lower48.translate();\n var k = lower48.scale(), x = +_[0], y = +_[1];\n\n lower48Point = lower48\n .translate(_)\n .clipExtent([[x - 0.455 * k, y - 0.238 * k], [x + 0.455 * k, y + 0.238 * k]])\n .stream(pointStream);\n\n alaskaPoint = alaska\n .translate([x - 0.307 * k, y + 0.201 * k])\n .clipExtent([[x - 0.425 * k + epsilon, y + 0.120 * k + epsilon], [x - 0.214 * k - epsilon, y + 0.234 * k - epsilon]])\n .stream(pointStream);\n\n hawaiiPoint = hawaii\n .translate([x - 0.205 * k, y + 0.212 * k])\n .clipExtent([[x - 0.214 * k + epsilon, y + 0.166 * k + epsilon], [x - 0.115 * k - epsilon, y + 0.234 * k - epsilon]])\n .stream(pointStream);\n\n return reset();\n };\n\n albersUsa.fitExtent = function(extent, object) {\n return fitExtent(albersUsa, extent, object);\n };\n\n albersUsa.fitSize = function(size, object) {\n return fitSize(albersUsa, size, object);\n };\n\n albersUsa.fitWidth = function(width, object) {\n return fitWidth(albersUsa, width, object);\n };\n\n albersUsa.fitHeight = function(height, object) {\n return fitHeight(albersUsa, height, object);\n };\n\n function reset() {\n cache = cacheStream = null;\n return albersUsa;\n }\n\n return albersUsa.scale(1070);\n}\n","import {asin, atan2, cos, sin, sqrt} from \"../math.js\";\n\nexport function azimuthalRaw(scale) {\n return function(x, y) {\n var cx = cos(x),\n cy = cos(y),\n k = scale(cx * cy);\n if (k === Infinity) return [2, 0];\n return [\n k * cy * sin(x),\n k * sin(y)\n ];\n }\n}\n\nexport function azimuthalInvert(angle) {\n return function(x, y) {\n var z = sqrt(x * x + y * y),\n c = angle(z),\n sc = sin(c),\n cc = cos(c);\n return [\n atan2(x * sc, z * cc),\n asin(z && y * sc / z)\n ];\n }\n}\n","import {asin, sqrt} from \"../math.js\";\nimport {azimuthalRaw, azimuthalInvert} from \"./azimuthal.js\";\nimport projection from \"./index.js\";\n\nexport var azimuthalEqualAreaRaw = azimuthalRaw(function(cxcy) {\n return sqrt(2 / (1 + cxcy));\n});\n\nazimuthalEqualAreaRaw.invert = azimuthalInvert(function(z) {\n return 2 * asin(z / 2);\n});\n\nexport default function() {\n return projection(azimuthalEqualAreaRaw)\n .scale(124.75)\n .clipAngle(180 - 1e-3);\n}\n","import {acos, sin} from \"../math.js\";\nimport {azimuthalRaw, azimuthalInvert} from \"./azimuthal.js\";\nimport projection from \"./index.js\";\n\nexport var azimuthalEquidistantRaw = azimuthalRaw(function(c) {\n return (c = acos(c)) && c / sin(c);\n});\n\nazimuthalEquidistantRaw.invert = azimuthalInvert(function(z) {\n return z;\n});\n\nexport default function() {\n return projection(azimuthalEquidistantRaw)\n .scale(79.4188)\n .clipAngle(180 - 1e-3);\n}\n","import {degrees, pi, radians} from \"../math.js\";\nimport {projectionMutator} from \"./index.js\";\n\nexport function conicProjection(projectAt) {\n var phi0 = 0,\n phi1 = pi / 3,\n m = projectionMutator(projectAt),\n p = m(phi0, phi1);\n\n p.parallels = function(_) {\n return arguments.length ? m(phi0 = _[0] * radians, phi1 = _[1] * radians) : [phi0 * degrees, phi1 * degrees];\n };\n\n return p;\n}\n","import {abs, atan, atan2, cos, epsilon, halfPi, log, pi, pow, sign, sin, sqrt, tan} from \"../math.js\";\nimport {conicProjection} from \"./conic.js\";\nimport {mercatorRaw} from \"./mercator.js\";\n\nfunction tany(y) {\n return tan((halfPi + y) / 2);\n}\n\nexport function conicConformalRaw(y0, y1) {\n var cy0 = cos(y0),\n n = y0 === y1 ? sin(y0) : log(cy0 / cos(y1)) / log(tany(y1) / tany(y0)),\n f = cy0 * pow(tany(y0), n) / n;\n\n if (!n) return mercatorRaw;\n\n function project(x, y) {\n if (f > 0) { if (y < -halfPi + epsilon) y = -halfPi + epsilon; }\n else { if (y > halfPi - epsilon) y = halfPi - epsilon; }\n var r = f / pow(tany(y), n);\n return [r * sin(n * x), f - r * cos(n * x)];\n }\n\n project.invert = function(x, y) {\n var fy = f - y, r = sign(n) * sqrt(x * x + fy * fy),\n l = atan2(x, abs(fy)) * sign(fy);\n if (fy * n < 0)\n l -= pi * sign(x) * sign(fy);\n return [l / n, 2 * atan(pow(f / r, 1 / n)) - halfPi];\n };\n\n return project;\n}\n\nexport default function() {\n return conicProjection(conicConformalRaw)\n .scale(109.5)\n .parallels([30, 30]);\n}\n","import {abs, asin, atan2, cos, epsilon, pi, sign, sin, sqrt} from \"../math.js\";\nimport {conicProjection} from \"./conic.js\";\nimport {cylindricalEqualAreaRaw} from \"./cylindricalEqualArea.js\";\n\nexport function conicEqualAreaRaw(y0, y1) {\n var sy0 = sin(y0), n = (sy0 + sin(y1)) / 2;\n\n // Are the parallels symmetrical around the Equator?\n if (abs(n) < epsilon) return cylindricalEqualAreaRaw(y0);\n\n var c = 1 + sy0 * (2 * n - sy0), r0 = sqrt(c) / n;\n\n function project(x, y) {\n var r = sqrt(c - 2 * n * sin(y)) / n;\n return [r * sin(x *= n), r0 - r * cos(x)];\n }\n\n project.invert = function(x, y) {\n var r0y = r0 - y,\n l = atan2(x, abs(r0y)) * sign(r0y);\n if (r0y * n < 0)\n l -= pi * sign(x) * sign(r0y);\n return [l / n, asin((c - (x * x + r0y * r0y) * n * n) / (2 * n))];\n };\n\n return project;\n}\n\nexport default function() {\n return conicProjection(conicEqualAreaRaw)\n .scale(155.424)\n .center([0, 33.6442]);\n}\n","import {abs, atan2, cos, epsilon, pi, sign, sin, sqrt} from \"../math.js\";\nimport {conicProjection} from \"./conic.js\";\nimport {equirectangularRaw} from \"./equirectangular.js\";\n\nexport function conicEquidistantRaw(y0, y1) {\n var cy0 = cos(y0),\n n = y0 === y1 ? sin(y0) : (cy0 - cos(y1)) / (y1 - y0),\n g = cy0 / n + y0;\n\n if (abs(n) < epsilon) return equirectangularRaw;\n\n function project(x, y) {\n var gy = g - y, nx = n * x;\n return [gy * sin(nx), g - gy * cos(nx)];\n }\n\n project.invert = function(x, y) {\n var gy = g - y,\n l = atan2(x, abs(gy)) * sign(gy);\n if (gy * n < 0)\n l -= pi * sign(x) * sign(gy);\n return [l / n, g - sign(n) * sqrt(x * x + gy * gy)];\n };\n\n return project;\n}\n\nexport default function() {\n return conicProjection(conicEquidistantRaw)\n .scale(131.154)\n .center([0, 13.9389]);\n}\n","import {asin, cos, sin} from \"../math.js\";\n\nexport function cylindricalEqualAreaRaw(phi0) {\n var cosPhi0 = cos(phi0);\n\n function forward(lambda, phi) {\n return [lambda * cosPhi0, sin(phi) / cosPhi0];\n }\n\n forward.invert = function(x, y) {\n return [x / cosPhi0, asin(y * cosPhi0)];\n };\n\n return forward;\n}\n","import projection from \"./index.js\";\nimport {abs, asin, cos, epsilon2, sin, sqrt} from \"../math.js\";\n\nvar A1 = 1.340264,\n A2 = -0.081106,\n A3 = 0.000893,\n A4 = 0.003796,\n M = sqrt(3) / 2,\n iterations = 12;\n\nexport function equalEarthRaw(lambda, phi) {\n var l = asin(M * sin(phi)), l2 = l * l, l6 = l2 * l2 * l2;\n return [\n lambda * cos(l) / (M * (A1 + 3 * A2 * l2 + l6 * (7 * A3 + 9 * A4 * l2))),\n l * (A1 + A2 * l2 + l6 * (A3 + A4 * l2))\n ];\n}\n\nequalEarthRaw.invert = function(x, y) {\n var l = y, l2 = l * l, l6 = l2 * l2 * l2;\n for (var i = 0, delta, fy, fpy; i < iterations; ++i) {\n fy = l * (A1 + A2 * l2 + l6 * (A3 + A4 * l2)) - y;\n fpy = A1 + 3 * A2 * l2 + l6 * (7 * A3 + 9 * A4 * l2);\n l -= delta = fy / fpy, l2 = l * l, l6 = l2 * l2 * l2;\n if (abs(delta) < epsilon2) break;\n }\n return [\n M * x * (A1 + 3 * A2 * l2 + l6 * (7 * A3 + 9 * A4 * l2)) / cos(l),\n asin(sin(l) / M)\n ];\n};\n\nexport default function() {\n return projection(equalEarthRaw)\n .scale(177.158);\n}\n","import projection from \"./index.js\";\n\nexport function equirectangularRaw(lambda, phi) {\n return [lambda, phi];\n}\n\nequirectangularRaw.invert = equirectangularRaw;\n\nexport default function() {\n return projection(equirectangularRaw)\n .scale(152.63);\n}\n","import {default as geoStream} from \"../stream.js\";\nimport boundsStream from \"../path/bounds.js\";\n\nfunction fit(projection, fitBounds, object) {\n var clip = projection.clipExtent && projection.clipExtent();\n projection.scale(150).translate([0, 0]);\n if (clip != null) projection.clipExtent(null);\n geoStream(object, projection.stream(boundsStream));\n fitBounds(boundsStream.result());\n if (clip != null) projection.clipExtent(clip);\n return projection;\n}\n\nexport function fitExtent(projection, extent, object) {\n return fit(projection, function(b) {\n var w = extent[1][0] - extent[0][0],\n h = extent[1][1] - extent[0][1],\n k = Math.min(w / (b[1][0] - b[0][0]), h / (b[1][1] - b[0][1])),\n x = +extent[0][0] + (w - k * (b[1][0] + b[0][0])) / 2,\n y = +extent[0][1] + (h - k * (b[1][1] + b[0][1])) / 2;\n projection.scale(150 * k).translate([x, y]);\n }, object);\n}\n\nexport function fitSize(projection, size, object) {\n return fitExtent(projection, [[0, 0], size], object);\n}\n\nexport function fitWidth(projection, width, object) {\n return fit(projection, function(b) {\n var w = +width,\n k = w / (b[1][0] - b[0][0]),\n x = (w - k * (b[1][0] + b[0][0])) / 2,\n y = -k * b[0][1];\n projection.scale(150 * k).translate([x, y]);\n }, object);\n}\n\nexport function fitHeight(projection, height, object) {\n return fit(projection, function(b) {\n var h = +height,\n k = h / (b[1][1] - b[0][1]),\n x = -k * b[0][0],\n y = (h - k * (b[1][1] + b[0][1])) / 2;\n projection.scale(150 * k).translate([x, y]);\n }, object);\n}\n","import {atan, cos, sin} from \"../math.js\";\nimport {azimuthalInvert} from \"./azimuthal.js\";\nimport projection from \"./index.js\";\n\nexport function gnomonicRaw(x, y) {\n var cy = cos(y), k = cos(x) * cy;\n return [cy * sin(x) / k, sin(y) / k];\n}\n\ngnomonicRaw.invert = azimuthalInvert(atan);\n\nexport default function() {\n return projection(gnomonicRaw)\n .scale(144.049)\n .clipAngle(60);\n}\n","import clipRectangle from \"../clip/rectangle.js\";\nimport identity from \"../identity.js\";\nimport {transformer} from \"../transform.js\";\nimport {fitExtent, fitSize, fitWidth, fitHeight} from \"./fit.js\";\nimport {cos, degrees, radians, sin} from \"../math.js\";\n\nexport default function() {\n var k = 1, tx = 0, ty = 0, sx = 1, sy = 1, // scale, translate and reflect\n alpha = 0, ca, sa, // angle\n x0 = null, y0, x1, y1, // clip extent\n kx = 1, ky = 1,\n transform = transformer({\n point: function(x, y) {\n var p = projection([x, y])\n this.stream.point(p[0], p[1]);\n }\n }),\n postclip = identity,\n cache,\n cacheStream;\n\n function reset() {\n kx = k * sx;\n ky = k * sy;\n cache = cacheStream = null;\n return projection;\n }\n\n function projection (p) {\n var x = p[0] * kx, y = p[1] * ky;\n if (alpha) {\n var t = y * ca - x * sa;\n x = x * ca + y * sa;\n y = t;\n } \n return [x + tx, y + ty];\n }\n projection.invert = function(p) {\n var x = p[0] - tx, y = p[1] - ty;\n if (alpha) {\n var t = y * ca + x * sa;\n x = x * ca - y * sa;\n y = t;\n }\n return [x / kx, y / ky];\n };\n projection.stream = function(stream) {\n return cache && cacheStream === stream ? cache : cache = transform(postclip(cacheStream = stream));\n };\n projection.postclip = function(_) {\n return arguments.length ? (postclip = _, x0 = y0 = x1 = y1 = null, reset()) : postclip;\n };\n projection.clipExtent = function(_) {\n return arguments.length ? (postclip = _ == null ? (x0 = y0 = x1 = y1 = null, identity) : clipRectangle(x0 = +_[0][0], y0 = +_[0][1], x1 = +_[1][0], y1 = +_[1][1]), reset()) : x0 == null ? null : [[x0, y0], [x1, y1]];\n };\n projection.scale = function(_) {\n return arguments.length ? (k = +_, reset()) : k;\n };\n projection.translate = function(_) {\n return arguments.length ? (tx = +_[0], ty = +_[1], reset()) : [tx, ty];\n }\n projection.angle = function(_) {\n return arguments.length ? (alpha = _ % 360 * radians, sa = sin(alpha), ca = cos(alpha), reset()) : alpha * degrees;\n };\n projection.reflectX = function(_) {\n return arguments.length ? (sx = _ ? -1 : 1, reset()) : sx < 0;\n };\n projection.reflectY = function(_) {\n return arguments.length ? (sy = _ ? -1 : 1, reset()) : sy < 0;\n };\n projection.fitExtent = function(extent, object) {\n return fitExtent(projection, extent, object);\n };\n projection.fitSize = function(size, object) {\n return fitSize(projection, size, object);\n };\n projection.fitWidth = function(width, object) {\n return fitWidth(projection, width, object);\n };\n projection.fitHeight = function(height, object) {\n return fitHeight(projection, height, object);\n };\n\n return projection;\n}\n","import clipAntimeridian from \"../clip/antimeridian.js\";\nimport clipCircle from \"../clip/circle.js\";\nimport clipRectangle from \"../clip/rectangle.js\";\nimport compose from \"../compose.js\";\nimport identity from \"../identity.js\";\nimport {cos, degrees, radians, sin, sqrt} from \"../math.js\";\nimport {rotateRadians} from \"../rotation.js\";\nimport {transformer} from \"../transform.js\";\nimport {fitExtent, fitSize, fitWidth, fitHeight} from \"./fit.js\";\nimport resample from \"./resample.js\";\n\nvar transformRadians = transformer({\n point: function(x, y) {\n this.stream.point(x * radians, y * radians);\n }\n});\n\nfunction transformRotate(rotate) {\n return transformer({\n point: function(x, y) {\n var r = rotate(x, y);\n return this.stream.point(r[0], r[1]);\n }\n });\n}\n\nfunction scaleTranslate(k, dx, dy, sx, sy) {\n function transform(x, y) {\n x *= sx; y *= sy;\n return [dx + k * x, dy - k * y];\n }\n transform.invert = function(x, y) {\n return [(x - dx) / k * sx, (dy - y) / k * sy];\n };\n return transform;\n}\n\nfunction scaleTranslateRotate(k, dx, dy, sx, sy, alpha) {\n if (!alpha) return scaleTranslate(k, dx, dy, sx, sy);\n var cosAlpha = cos(alpha),\n sinAlpha = sin(alpha),\n a = cosAlpha * k,\n b = sinAlpha * k,\n ai = cosAlpha / k,\n bi = sinAlpha / k,\n ci = (sinAlpha * dy - cosAlpha * dx) / k,\n fi = (sinAlpha * dx + cosAlpha * dy) / k;\n function transform(x, y) {\n x *= sx; y *= sy;\n return [a * x - b * y + dx, dy - b * x - a * y];\n }\n transform.invert = function(x, y) {\n return [sx * (ai * x - bi * y + ci), sy * (fi - bi * x - ai * y)];\n };\n return transform;\n}\n\nexport default function projection(project) {\n return projectionMutator(function() { return project; })();\n}\n\nexport function projectionMutator(projectAt) {\n var project,\n k = 150, // scale\n x = 480, y = 250, // translate\n lambda = 0, phi = 0, // center\n deltaLambda = 0, deltaPhi = 0, deltaGamma = 0, rotate, // pre-rotate\n alpha = 0, // post-rotate angle\n sx = 1, // reflectX\n sy = 1, // reflectX\n theta = null, preclip = clipAntimeridian, // pre-clip angle\n x0 = null, y0, x1, y1, postclip = identity, // post-clip extent\n delta2 = 0.5, // precision\n projectResample,\n projectTransform,\n projectRotateTransform,\n cache,\n cacheStream;\n\n function projection(point) {\n return projectRotateTransform(point[0] * radians, point[1] * radians);\n }\n\n function invert(point) {\n point = projectRotateTransform.invert(point[0], point[1]);\n return point && [point[0] * degrees, point[1] * degrees];\n }\n\n projection.stream = function(stream) {\n return cache && cacheStream === stream ? cache : cache = transformRadians(transformRotate(rotate)(preclip(projectResample(postclip(cacheStream = stream)))));\n };\n\n projection.preclip = function(_) {\n return arguments.length ? (preclip = _, theta = undefined, reset()) : preclip;\n };\n\n projection.postclip = function(_) {\n return arguments.length ? (postclip = _, x0 = y0 = x1 = y1 = null, reset()) : postclip;\n };\n\n projection.clipAngle = function(_) {\n return arguments.length ? (preclip = +_ ? clipCircle(theta = _ * radians) : (theta = null, clipAntimeridian), reset()) : theta * degrees;\n };\n\n projection.clipExtent = function(_) {\n return arguments.length ? (postclip = _ == null ? (x0 = y0 = x1 = y1 = null, identity) : clipRectangle(x0 = +_[0][0], y0 = +_[0][1], x1 = +_[1][0], y1 = +_[1][1]), reset()) : x0 == null ? null : [[x0, y0], [x1, y1]];\n };\n\n projection.scale = function(_) {\n return arguments.length ? (k = +_, recenter()) : k;\n };\n\n projection.translate = function(_) {\n return arguments.length ? (x = +_[0], y = +_[1], recenter()) : [x, y];\n };\n\n projection.center = function(_) {\n return arguments.length ? (lambda = _[0] % 360 * radians, phi = _[1] % 360 * radians, recenter()) : [lambda * degrees, phi * degrees];\n };\n\n projection.rotate = function(_) {\n return arguments.length ? (deltaLambda = _[0] % 360 * radians, deltaPhi = _[1] % 360 * radians, deltaGamma = _.length > 2 ? _[2] % 360 * radians : 0, recenter()) : [deltaLambda * degrees, deltaPhi * degrees, deltaGamma * degrees];\n };\n\n projection.angle = function(_) {\n return arguments.length ? (alpha = _ % 360 * radians, recenter()) : alpha * degrees;\n };\n\n projection.reflectX = function(_) {\n return arguments.length ? (sx = _ ? -1 : 1, recenter()) : sx < 0;\n };\n\n projection.reflectY = function(_) {\n return arguments.length ? (sy = _ ? -1 : 1, recenter()) : sy < 0;\n };\n\n projection.precision = function(_) {\n return arguments.length ? (projectResample = resample(projectTransform, delta2 = _ * _), reset()) : sqrt(delta2);\n };\n\n projection.fitExtent = function(extent, object) {\n return fitExtent(projection, extent, object);\n };\n\n projection.fitSize = function(size, object) {\n return fitSize(projection, size, object);\n };\n\n projection.fitWidth = function(width, object) {\n return fitWidth(projection, width, object);\n };\n\n projection.fitHeight = function(height, object) {\n return fitHeight(projection, height, object);\n };\n\n function recenter() {\n var center = scaleTranslateRotate(k, 0, 0, sx, sy, alpha).apply(null, project(lambda, phi)),\n transform = scaleTranslateRotate(k, x - center[0], y - center[1], sx, sy, alpha);\n rotate = rotateRadians(deltaLambda, deltaPhi, deltaGamma);\n projectTransform = compose(project, transform);\n projectRotateTransform = compose(rotate, projectTransform);\n projectResample = resample(projectTransform, delta2);\n return reset();\n }\n\n function reset() {\n cache = cacheStream = null;\n return projection;\n }\n\n return function() {\n project = projectAt.apply(this, arguments);\n projection.invert = project.invert && invert;\n return recenter();\n };\n}\n","import {atan, exp, halfPi, log, pi, tan, tau} from \"../math.js\";\nimport rotation from \"../rotation.js\";\nimport projection from \"./index.js\";\n\nexport function mercatorRaw(lambda, phi) {\n return [lambda, log(tan((halfPi + phi) / 2))];\n}\n\nmercatorRaw.invert = function(x, y) {\n return [x, 2 * atan(exp(y)) - halfPi];\n};\n\nexport default function() {\n return mercatorProjection(mercatorRaw)\n .scale(961 / tau);\n}\n\nexport function mercatorProjection(project) {\n var m = projection(project),\n center = m.center,\n scale = m.scale,\n translate = m.translate,\n clipExtent = m.clipExtent,\n x0 = null, y0, x1, y1; // clip extent\n\n m.scale = function(_) {\n return arguments.length ? (scale(_), reclip()) : scale();\n };\n\n m.translate = function(_) {\n return arguments.length ? (translate(_), reclip()) : translate();\n };\n\n m.center = function(_) {\n return arguments.length ? (center(_), reclip()) : center();\n };\n\n m.clipExtent = function(_) {\n return arguments.length ? ((_ == null ? x0 = y0 = x1 = y1 = null : (x0 = +_[0][0], y0 = +_[0][1], x1 = +_[1][0], y1 = +_[1][1])), reclip()) : x0 == null ? null : [[x0, y0], [x1, y1]];\n };\n\n function reclip() {\n var k = pi * scale(),\n t = m(rotation(m.rotate()).invert([0, 0]));\n return clipExtent(x0 == null\n ? [[t[0] - k, t[1] - k], [t[0] + k, t[1] + k]] : project === mercatorRaw\n ? [[Math.max(t[0] - k, x0), y0], [Math.min(t[0] + k, x1), y1]]\n : [[x0, Math.max(t[1] - k, y0)], [x1, Math.min(t[1] + k, y1)]]);\n }\n\n return reclip();\n}\n","import projection from \"./index.js\";\nimport {abs, epsilon} from \"../math.js\";\n\nexport function naturalEarth1Raw(lambda, phi) {\n var phi2 = phi * phi, phi4 = phi2 * phi2;\n return [\n lambda * (0.8707 - 0.131979 * phi2 + phi4 * (-0.013791 + phi4 * (0.003971 * phi2 - 0.001529 * phi4))),\n phi * (1.007226 + phi2 * (0.015085 + phi4 * (-0.044475 + 0.028874 * phi2 - 0.005916 * phi4)))\n ];\n}\n\nnaturalEarth1Raw.invert = function(x, y) {\n var phi = y, i = 25, delta;\n do {\n var phi2 = phi * phi, phi4 = phi2 * phi2;\n phi -= delta = (phi * (1.007226 + phi2 * (0.015085 + phi4 * (-0.044475 + 0.028874 * phi2 - 0.005916 * phi4))) - y) /\n (1.007226 + phi2 * (0.015085 * 3 + phi4 * (-0.044475 * 7 + 0.028874 * 9 * phi2 - 0.005916 * 11 * phi4)));\n } while (abs(delta) > epsilon && --i > 0);\n return [\n x / (0.8707 + (phi2 = phi * phi) * (-0.131979 + phi2 * (-0.013791 + phi2 * phi2 * phi2 * (0.003971 - 0.001529 * phi2)))),\n phi\n ];\n};\n\nexport default function() {\n return projection(naturalEarth1Raw)\n .scale(175.295);\n}\n","import {asin, cos, epsilon, sin} from \"../math.js\";\nimport {azimuthalInvert} from \"./azimuthal.js\";\nimport projection from \"./index.js\";\n\nexport function orthographicRaw(x, y) {\n return [cos(y) * sin(x), sin(y)];\n}\n\northographicRaw.invert = azimuthalInvert(asin);\n\nexport default function() {\n return projection(orthographicRaw)\n .scale(249.5)\n .clipAngle(90 + epsilon);\n}\n","import {cartesian} from \"../cartesian.js\";\nimport {abs, asin, atan2, cos, epsilon, radians, sqrt} from \"../math.js\";\nimport {transformer} from \"../transform.js\";\n\nvar maxDepth = 16, // maximum depth of subdivision\n cosMinDistance = cos(30 * radians); // cos(minimum angular distance)\n\nexport default function(project, delta2) {\n return +delta2 ? resample(project, delta2) : resampleNone(project);\n}\n\nfunction resampleNone(project) {\n return transformer({\n point: function(x, y) {\n x = project(x, y);\n this.stream.point(x[0], x[1]);\n }\n });\n}\n\nfunction resample(project, delta2) {\n\n function resampleLineTo(x0, y0, lambda0, a0, b0, c0, x1, y1, lambda1, a1, b1, c1, depth, stream) {\n var dx = x1 - x0,\n dy = y1 - y0,\n d2 = dx * dx + dy * dy;\n if (d2 > 4 * delta2 && depth--) {\n var a = a0 + a1,\n b = b0 + b1,\n c = c0 + c1,\n m = sqrt(a * a + b * b + c * c),\n phi2 = asin(c /= m),\n lambda2 = abs(abs(c) - 1) < epsilon || abs(lambda0 - lambda1) < epsilon ? (lambda0 + lambda1) / 2 : atan2(b, a),\n p = project(lambda2, phi2),\n x2 = p[0],\n y2 = p[1],\n dx2 = x2 - x0,\n dy2 = y2 - y0,\n dz = dy * dx2 - dx * dy2;\n if (dz * dz / d2 > delta2 // perpendicular projected distance\n || abs((dx * dx2 + dy * dy2) / d2 - 0.5) > 0.3 // midpoint close to an end\n || a0 * a1 + b0 * b1 + c0 * c1 < cosMinDistance) { // angular distance\n resampleLineTo(x0, y0, lambda0, a0, b0, c0, x2, y2, lambda2, a /= m, b /= m, c, depth, stream);\n stream.point(x2, y2);\n resampleLineTo(x2, y2, lambda2, a, b, c, x1, y1, lambda1, a1, b1, c1, depth, stream);\n }\n }\n }\n return function(stream) {\n var lambda00, x00, y00, a00, b00, c00, // first point\n lambda0, x0, y0, a0, b0, c0; // previous point\n\n var resampleStream = {\n point: point,\n lineStart: lineStart,\n lineEnd: lineEnd,\n polygonStart: function() { stream.polygonStart(); resampleStream.lineStart = ringStart; },\n polygonEnd: function() { stream.polygonEnd(); resampleStream.lineStart = lineStart; }\n };\n\n function point(x, y) {\n x = project(x, y);\n stream.point(x[0], x[1]);\n }\n\n function lineStart() {\n x0 = NaN;\n resampleStream.point = linePoint;\n stream.lineStart();\n }\n\n function linePoint(lambda, phi) {\n var c = cartesian([lambda, phi]), p = project(lambda, phi);\n resampleLineTo(x0, y0, lambda0, a0, b0, c0, x0 = p[0], y0 = p[1], lambda0 = lambda, a0 = c[0], b0 = c[1], c0 = c[2], maxDepth, stream);\n stream.point(x0, y0);\n }\n\n function lineEnd() {\n resampleStream.point = point;\n stream.lineEnd();\n }\n\n function ringStart() {\n lineStart();\n resampleStream.point = ringPoint;\n resampleStream.lineEnd = ringEnd;\n }\n\n function ringPoint(lambda, phi) {\n linePoint(lambda00 = lambda, phi), x00 = x0, y00 = y0, a00 = a0, b00 = b0, c00 = c0;\n resampleStream.point = linePoint;\n }\n\n function ringEnd() {\n resampleLineTo(x0, y0, lambda0, a0, b0, c0, x00, y00, lambda00, a00, b00, c00, maxDepth, stream);\n resampleStream.lineEnd = lineEnd;\n lineEnd();\n }\n\n return resampleStream;\n };\n}\n","import {atan, cos, sin} from \"../math.js\";\nimport {azimuthalInvert} from \"./azimuthal.js\";\nimport projection from \"./index.js\";\n\nexport function stereographicRaw(x, y) {\n var cy = cos(y), k = 1 + cos(x) * cy;\n return [cy * sin(x) / k, sin(y) / k];\n}\n\nstereographicRaw.invert = azimuthalInvert(function(z) {\n return 2 * atan(z);\n});\n\nexport default function() {\n return projection(stereographicRaw)\n .scale(250)\n .clipAngle(142);\n}\n","import {atan, exp, halfPi, log, tan} from \"../math.js\";\nimport {mercatorProjection} from \"./mercator.js\";\n\nexport function transverseMercatorRaw(lambda, phi) {\n return [log(tan((halfPi + phi) / 2)), -lambda];\n}\n\ntransverseMercatorRaw.invert = function(x, y) {\n return [-y, 2 * atan(exp(x)) - halfPi];\n};\n\nexport default function() {\n var m = mercatorProjection(transverseMercatorRaw),\n center = m.center,\n rotate = m.rotate;\n\n m.center = function(_) {\n return arguments.length ? center([-_[1], _[0]]) : (_ = center(), [_[1], -_[0]]);\n };\n\n m.rotate = function(_) {\n return arguments.length ? rotate([_[0], _[1], _.length > 2 ? _[2] + 90 : 90]) : (_ = rotate(), [_[0], _[1], _[2] - 90]);\n };\n\n return rotate([0, 0, 90])\n .scale(159.155);\n}\n","import compose from \"./compose.js\";\nimport {abs, asin, atan2, cos, degrees, pi, radians, sin, tau} from \"./math.js\";\n\nfunction rotationIdentity(lambda, phi) {\n return [abs(lambda) > pi ? lambda + Math.round(-lambda / tau) * tau : lambda, phi];\n}\n\nrotationIdentity.invert = rotationIdentity;\n\nexport function rotateRadians(deltaLambda, deltaPhi, deltaGamma) {\n return (deltaLambda %= tau) ? (deltaPhi || deltaGamma ? compose(rotationLambda(deltaLambda), rotationPhiGamma(deltaPhi, deltaGamma))\n : rotationLambda(deltaLambda))\n : (deltaPhi || deltaGamma ? rotationPhiGamma(deltaPhi, deltaGamma)\n : rotationIdentity);\n}\n\nfunction forwardRotationLambda(deltaLambda) {\n return function(lambda, phi) {\n return lambda += deltaLambda, [lambda > pi ? lambda - tau : lambda < -pi ? lambda + tau : lambda, phi];\n };\n}\n\nfunction rotationLambda(deltaLambda) {\n var rotation = forwardRotationLambda(deltaLambda);\n rotation.invert = forwardRotationLambda(-deltaLambda);\n return rotation;\n}\n\nfunction rotationPhiGamma(deltaPhi, deltaGamma) {\n var cosDeltaPhi = cos(deltaPhi),\n sinDeltaPhi = sin(deltaPhi),\n cosDeltaGamma = cos(deltaGamma),\n sinDeltaGamma = sin(deltaGamma);\n\n function rotation(lambda, phi) {\n var cosPhi = cos(phi),\n x = cos(lambda) * cosPhi,\n y = sin(lambda) * cosPhi,\n z = sin(phi),\n k = z * cosDeltaPhi + x * sinDeltaPhi;\n return [\n atan2(y * cosDeltaGamma - k * sinDeltaGamma, x * cosDeltaPhi - z * sinDeltaPhi),\n asin(k * cosDeltaGamma + y * sinDeltaGamma)\n ];\n }\n\n rotation.invert = function(lambda, phi) {\n var cosPhi = cos(phi),\n x = cos(lambda) * cosPhi,\n y = sin(lambda) * cosPhi,\n z = sin(phi),\n k = z * cosDeltaGamma - y * sinDeltaGamma;\n return [\n atan2(y * cosDeltaGamma + z * sinDeltaGamma, x * cosDeltaPhi + k * sinDeltaPhi),\n asin(k * cosDeltaPhi - x * sinDeltaPhi)\n ];\n };\n\n return rotation;\n}\n\nexport default function(rotate) {\n rotate = rotateRadians(rotate[0] * radians, rotate[1] * radians, rotate.length > 2 ? rotate[2] * radians : 0);\n\n function forward(coordinates) {\n coordinates = rotate(coordinates[0] * radians, coordinates[1] * radians);\n return coordinates[0] *= degrees, coordinates[1] *= degrees, coordinates;\n }\n\n forward.invert = function(coordinates) {\n coordinates = rotate.invert(coordinates[0] * radians, coordinates[1] * radians);\n return coordinates[0] *= degrees, coordinates[1] *= degrees, coordinates;\n };\n\n return forward;\n}\n","function streamGeometry(geometry, stream) {\n if (geometry && streamGeometryType.hasOwnProperty(geometry.type)) {\n streamGeometryType[geometry.type](geometry, stream);\n }\n}\n\nvar streamObjectType = {\n Feature: function(object, stream) {\n streamGeometry(object.geometry, stream);\n },\n FeatureCollection: function(object, stream) {\n var features = object.features, i = -1, n = features.length;\n while (++i < n) streamGeometry(features[i].geometry, stream);\n }\n};\n\nvar streamGeometryType = {\n Sphere: function(object, stream) {\n stream.sphere();\n },\n Point: function(object, stream) {\n object = object.coordinates;\n stream.point(object[0], object[1], object[2]);\n },\n MultiPoint: function(object, stream) {\n var coordinates = object.coordinates, i = -1, n = coordinates.length;\n while (++i < n) object = coordinates[i], stream.point(object[0], object[1], object[2]);\n },\n LineString: function(object, stream) {\n streamLine(object.coordinates, stream, 0);\n },\n MultiLineString: function(object, stream) {\n var coordinates = object.coordinates, i = -1, n = coordinates.length;\n while (++i < n) streamLine(coordinates[i], stream, 0);\n },\n Polygon: function(object, stream) {\n streamPolygon(object.coordinates, stream);\n },\n MultiPolygon: function(object, stream) {\n var coordinates = object.coordinates, i = -1, n = coordinates.length;\n while (++i < n) streamPolygon(coordinates[i], stream);\n },\n GeometryCollection: function(object, stream) {\n var geometries = object.geometries, i = -1, n = geometries.length;\n while (++i < n) streamGeometry(geometries[i], stream);\n }\n};\n\nfunction streamLine(coordinates, stream, closed) {\n var i = -1, n = coordinates.length - closed, coordinate;\n stream.lineStart();\n while (++i < n) coordinate = coordinates[i], stream.point(coordinate[0], coordinate[1], coordinate[2]);\n stream.lineEnd();\n}\n\nfunction streamPolygon(coordinates, stream) {\n var i = -1, n = coordinates.length;\n stream.polygonStart();\n while (++i < n) streamLine(coordinates[i], stream, 1);\n stream.polygonEnd();\n}\n\nexport default function(object, stream) {\n if (object && streamObjectType.hasOwnProperty(object.type)) {\n streamObjectType[object.type](object, stream);\n } else {\n streamGeometry(object, stream);\n }\n}\n","export default function(methods) {\n return {\n stream: transformer(methods)\n };\n}\n\nexport function transformer(methods) {\n return function(stream) {\n var s = new TransformStream;\n for (var key in methods) s[key] = methods[key];\n s.stream = stream;\n return s;\n };\n}\n\nfunction TransformStream() {}\n\nTransformStream.prototype = {\n constructor: TransformStream,\n point: function(x, y) { this.stream.point(x, y); },\n sphere: function() { this.stream.sphere(); },\n lineStart: function() { this.stream.lineStart(); },\n lineEnd: function() { this.stream.lineEnd(); },\n polygonStart: function() { this.stream.polygonStart(); },\n polygonEnd: function() { this.stream.polygonEnd(); }\n};\n","'use strict';\n\nvar Queue = require('tinyqueue');\n\nif (Queue.default) Queue = Queue.default; // temporary webpack fix\n\nmodule.exports = polylabel;\nmodule.exports.default = polylabel;\n\nfunction polylabel(polygon, precision, debug) {\n precision = precision || 1.0;\n\n // find the bounding box of the outer ring\n var minX, minY, maxX, maxY;\n for (var i = 0; i < polygon[0].length; i++) {\n var p = polygon[0][i];\n if (!i || p[0] < minX) minX = p[0];\n if (!i || p[1] < minY) minY = p[1];\n if (!i || p[0] > maxX) maxX = p[0];\n if (!i || p[1] > maxY) maxY = p[1];\n }\n\n var width = maxX - minX;\n var height = maxY - minY;\n var cellSize = Math.min(width, height);\n var h = cellSize / 2;\n\n if (cellSize === 0) {\n var degeneratePoleOfInaccessibility = [minX, minY];\n degeneratePoleOfInaccessibility.distance = 0;\n return degeneratePoleOfInaccessibility;\n }\n\n // a priority queue of cells in order of their \"potential\" (max distance to polygon)\n var cellQueue = new Queue(undefined, compareMax);\n\n // cover polygon with initial cells\n for (var x = minX; x < maxX; x += cellSize) {\n for (var y = minY; y < maxY; y += cellSize) {\n cellQueue.push(new Cell(x + h, y + h, h, polygon));\n }\n }\n\n // take centroid as the first best guess\n var bestCell = getCentroidCell(polygon);\n\n // special case for rectangular polygons\n var bboxCell = new Cell(minX + width / 2, minY + height / 2, 0, polygon);\n if (bboxCell.d > bestCell.d) bestCell = bboxCell;\n\n var numProbes = cellQueue.length;\n\n while (cellQueue.length) {\n // pick the most promising cell from the queue\n var cell = cellQueue.pop();\n\n // update the best cell if we found a better one\n if (cell.d > bestCell.d) {\n bestCell = cell;\n if (debug) console.log('found best %d after %d probes', Math.round(1e4 * cell.d) / 1e4, numProbes);\n }\n\n // do not drill down further if there's no chance of a better solution\n if (cell.max - bestCell.d <= precision) continue;\n\n // split the cell into four cells\n h = cell.h / 2;\n cellQueue.push(new Cell(cell.x - h, cell.y - h, h, polygon));\n cellQueue.push(new Cell(cell.x + h, cell.y - h, h, polygon));\n cellQueue.push(new Cell(cell.x - h, cell.y + h, h, polygon));\n cellQueue.push(new Cell(cell.x + h, cell.y + h, h, polygon));\n numProbes += 4;\n }\n\n if (debug) {\n console.log('num probes: ' + numProbes);\n console.log('best distance: ' + bestCell.d);\n }\n\n var poleOfInaccessibility = [bestCell.x, bestCell.y];\n poleOfInaccessibility.distance = bestCell.d;\n return poleOfInaccessibility;\n}\n\nfunction compareMax(a, b) {\n return b.max - a.max;\n}\n\nfunction Cell(x, y, h, polygon) {\n this.x = x; // cell center x\n this.y = y; // cell center y\n this.h = h; // half the cell size\n this.d = pointToPolygonDist(x, y, polygon); // distance from cell center to polygon\n this.max = this.d + this.h * Math.SQRT2; // max distance to polygon within a cell\n}\n\n// signed distance from point to polygon outline (negative if point is outside)\nfunction pointToPolygonDist(x, y, polygon) {\n var inside = false;\n var minDistSq = Infinity;\n\n for (var k = 0; k < polygon.length; k++) {\n var ring = polygon[k];\n\n for (var i = 0, len = ring.length, j = len - 1; i < len; j = i++) {\n var a = ring[i];\n var b = ring[j];\n\n if ((a[1] > y !== b[1] > y) &&\n (x < (b[0] - a[0]) * (y - a[1]) / (b[1] - a[1]) + a[0])) inside = !inside;\n\n minDistSq = Math.min(minDistSq, getSegDistSq(x, y, a, b));\n }\n }\n\n return minDistSq === 0 ? 0 : (inside ? 1 : -1) * Math.sqrt(minDistSq);\n}\n\n// get polygon centroid\nfunction getCentroidCell(polygon) {\n var area = 0;\n var x = 0;\n var y = 0;\n var points = polygon[0];\n\n for (var i = 0, len = points.length, j = len - 1; i < len; j = i++) {\n var a = points[i];\n var b = points[j];\n var f = a[0] * b[1] - b[0] * a[1];\n x += (a[0] + b[0]) * f;\n y += (a[1] + b[1]) * f;\n area += f * 3;\n }\n if (area === 0) return new Cell(points[0][0], points[0][1], 0, polygon);\n return new Cell(x / area, y / area, 0, polygon);\n}\n\n// get squared distance from a point to a segment\nfunction getSegDistSq(px, py, a, b) {\n\n var x = a[0];\n var y = a[1];\n var dx = b[0] - x;\n var dy = b[1] - y;\n\n if (dx !== 0 || dy !== 0) {\n\n var t = ((px - x) * dx + (py - y) * dy) / (dx * dx + dy * dy);\n\n if (t > 1) {\n x = b[0];\n y = b[1];\n\n } else if (t > 0) {\n x += dx * t;\n y += dy * t;\n }\n }\n\n dx = px - x;\n dy = py - y;\n\n return dx * dx + dy * dy;\n}\n","\nexport default class TinyQueue {\n constructor(data = [], compare = defaultCompare) {\n this.data = data;\n this.length = this.data.length;\n this.compare = compare;\n\n if (this.length > 0) {\n for (let i = (this.length >> 1) - 1; i >= 0; i--) this._down(i);\n }\n }\n\n push(item) {\n this.data.push(item);\n this.length++;\n this._up(this.length - 1);\n }\n\n pop() {\n if (this.length === 0) return undefined;\n\n const top = this.data[0];\n const bottom = this.data.pop();\n this.length--;\n\n if (this.length > 0) {\n this.data[0] = bottom;\n this._down(0);\n }\n\n return top;\n }\n\n peek() {\n return this.data[0];\n }\n\n _up(pos) {\n const {data, compare} = this;\n const item = data[pos];\n\n while (pos > 0) {\n const parent = (pos - 1) >> 1;\n const current = data[parent];\n if (compare(item, current) >= 0) break;\n data[pos] = current;\n pos = parent;\n }\n\n data[pos] = item;\n }\n\n _down(pos) {\n const {data, compare} = this;\n const halfLength = this.length >> 1;\n const item = data[pos];\n\n while (pos < halfLength) {\n let left = (pos << 1) + 1;\n let best = data[left];\n const right = left + 1;\n\n if (right < this.length && compare(data[right], best) < 0) {\n left = right;\n best = data[right];\n }\n if (compare(best, item) >= 0) break;\n\n data[pos] = best;\n pos = left;\n }\n\n data[pos] = item;\n }\n}\n\nfunction defaultCompare(a, b) {\n return a < b ? -1 : a > b ? 1 : 0;\n}\n"],"names":["__extends","dataLoader","JSONParser","CSVParser","BaseObjectEvents","Adapter","Language","DateFormatter","registry","$type","$object","DataSource","_super","url","parser","_this","call","adapter","_requestOptions","_incremental","_incrementalParams","_keepCount","_updateCurrentData","showPreloader","className","getParserByType","prototype","processData","data","contentType","dispatchImmediately","getParserByData","events","isEnabled","event_1","type","message","language","translate","target","options","apply","dateFields","numberFields","dateFormatter","parse","hasValue","event_2","lastLoad","Date","Object","defineProperty","get","disableCache","timestampUrl","_url","incremental","component","length","addUrlParams","incrementalParams","set","value","enumerable","configurable","_parser","_reloadFrequency","_reloadDisposer","on","ev","_reloadTimeout","setTimeout","load","reloadFrequency","dispose","undefined","_language","_dateFormatter","tstamp","getTime","toString","params","clearTimeout","join","match","add","each","key","push","encodeURIComponent","processConfig","config","registeredClasses","__awaiter","__generator","ExportMenu","Sprite","Modal","List","Dictionary","DurationFormatter","NumberFormatter","Validatable","color","StyleRule","getComputedStyle","$browser","$net","$dom","$log","$utils","$array","$math","$strings","pdfmakePromise","_pdfmake","a","pdfmake","vfs_fonts","global","_a","label","Promise","all","sent","window","pdfMake","vfs","default","fontFamilySrcRegexp","supportsBlobUri","navigator","msSaveOrOpenBlob","blobToDataUri","blob","resolve","reject","f","FileReader","onload","e","result","onerror","readAsDataURL","getCssRules","s","sheet","e_1","trys","cssRules","success","error","addEventListener","Error","loadStylesheet","doc","response","e_2","rules","console","createElement","textContent","head","appendChild","eachStylesheet","removeChild","topUrl","promises","i","rule","CSSRule","IMPORT_RULE","href","joinUrl","eachStylesheets","iframe","doc_1","document","src","setAttribute","contentDocument","map","styleSheets","location","Export","container","_formatOptions","_extraSprites","_validateSprites","dataFieldsOrder","_dynamicDataFields","_removedObjects","_hiddenObjects","_objectsAlreadyHidden","_filePrefix","useWebFonts","useRetina","useSimplifiedExport","timeoutDelay","_exportRunning","_prevHasData","_container","setKey","quality","fontSize","imageFormat","align","addURL","addColumnNames","indent","useLocale","emptyAs","delay","printMethod","arg","formatOptions","getKey","merge","applyTheme","_menu","menu","removeDispose","branch","unsupported","typeSupported","export","close","_disablePointers","_releasePointers","obj","classPrefix","classNamePrefix","_disposers","supported","getFormatOptions","disabled","_hasData","print","indexOf","_getFunction","getImage","getSVG","getPDF","getExcel","getCSV","getJSON","getHTML","getPrint","func","event_3","handleCustom","hideTimeout","_timeoutTimeout","event_4","showTimeout","hideNonExportableSprites","restoreNonExportableSprites","hidePreloader","title","download","filePrefix","callback","callbackTarget","getFontFamilies","DOMURL","blobs","getDOMURL","FONT_FACE_RULE","cssText_1","cssText","exec","urls","split","after","fullUrl","url_1","e_3","responseType","createObjectURL","then","filter","x","replace","includeExtras","prehidden","canvas","uri","e_4","awaitValidSprites","simplifiedImageExport","getCanvas","addExtras","toDataURL","getContentType","disposeCanvas","stack","warn","getImageAdvanced","advanced","middleLeft_1","middleTop_1","middleWidth_1","middleHeight_1","extraRight_1","extraBottom_1","extras","newCanvas","ctx_1","background","left_1","top_1","right_1","bottom_1","extraSprites","width","height","extraSprite","extra","extraCanvas","extraWidth","extraHeight","sprite","position","marginTop","marginRight","marginBottom","marginLeft","exporting","getCanvasAdvanced","crop","max","left","top","getDisposableCanvas","getContext","backgroundColor","findBackgroundColor","dom","fillStyle","fillRect","drawImage","font","scale","pixelRatio","ctx","svg","img","pixelWidth","pixelHeight","findFont","findFontSize","getPixelRatio","getAdjustedScale","style","fonts","imagesToDataURI","prepForeignObjects","normalizeSVG","serializeElement","paper","defs","Blob","loadNewImage","revokeObjectURL","restoreRemovedObjects","canvg","useCORS","ignoreDimensions","scaleWidth","scaleHeight","fromString","render","body","adjWidth","adjHeight","widthScale","heightScale","maxWidth","maxHeight","min","minWidth","minHeight","el","images","count","image","querySelectorAll","getAttributeNS","XLINK","svgToDataURI","imageToDataURI","objects","temporarilyRemoveObject","e_5","keepTainted","charset","e_6","btoa","setAttributeNS","placeholder","parent","parentElement","parentNode","node","insertBefore","pop","parent_1","element","cache","e_7","e_8","getCache","setCache","crossOrigin","Image","currentHref","removeAttribute","onabort","self","URL","webkitURL","encodeURI","dimParams","Math","round","styleParams","fos","ms","PLACEHOLDER","rgba","isInternetExplorer","reg","RegExp","escapeForRgex","getBaseURI","XMLSerializer","serializeToString","addFont","paths","normal","path","bytes","bold","italics","bolditalics","name","defaultMargins","extraMargin","_b","_c","_d","pageSize","pageOrientation","pageMargins","defaultStyle","content","text","margin","alignment","fit","getPageSizeFit","addData","getPDFData","table","extraFonts","createPdf","getDataUrl","dataFields","dataFieldsOrder_1","len","format","pivot","eachOrdered","val","dataRow","dataValue","convertToSpecialFormat","getPDFDataRow","b","ai","bi","headerRows","row","asIs","items","convertEmptyValue","item","margins","newMargins","sizes","A0","A1","A2","A3","A4","A5","A6","A7","A8","A9","A10","B0","B1","B2","B3","B4","B5","B6","B7","B8","B9","B10","C0","C1","C2","C3","C4","C5","C6","C7","C8","C9","C10","RA0","RA1","RA2","RA3","RA4","SRA0","SRA1","SRA2","SRA3","SRA4","EXECUTIVE","FOLIO","LEGAL","LETTER","TABLOID","fitSize","XLSX","wbOptions","sheetName","wb","dataFieldsOrder_2","xlsx","bookType","bookSST","normalizeExcelSheetName","SheetNames","Sheets","getExcelRow","utils","aoa_to_sheet","workbook","write","truncateWithEllipsis","csv","br","dataFieldsOrder_3","getCSVRow","reverse","separator","forceQuotes","search","html","dataFieldsOrder_4","tableClass","getHTMLRow","headerRow","rowClass","tag","first","charCodeAt","useTag","cellClass","sourceData","_loop_1","json","newValue_1","field","JSON","stringify","keepOriginal","isDateField","isDurationField","durationFormatter","durationFormat","isNumberField","numberFormat","numberFormatter","useTimestamps","toLocaleString","dateFormat","isString","fileName","parts","decoded","blob_1","chars","charCode","link_1","blob_2","url_2","url_3","link","idoc","msBlobDownloadSupport","shift","decodeURIComponent","atob","msSaveBlob","Array","Uint8Array","blobDownloadSupport","click","linkDownloadSupport","legacyIE","showModal","display","open","execCommand","downloadSupport","res","div","innerHTML","getElementsByTagName","printViaCSS","printViaIframe","scroll","originalTitle","isIOS","documentElement","scrollTop","getShadowRoot","visibility","opacity","clipPath","test","userAgent","MSStream","contentWindow","currentColor","parent_2","_sprite","validateSprites","_data","_dataFields","generateDataFields","handleDataUpdated","hasData","invalidate","_dateFormat","_dateFields","_numberFormatter","_numberFormat","_numberFields","_durationFormatter","_durationFormat","_durationFields","durationFields","contains","_backgroundColor","_title","preloader","progress","hideModal","_modal","modal","svgContainer","SVGContainer","readerTitle","_canvg","_xlsx","setFormatOptions","_spriteInteractionsEnabled","interactionsEnabled","nonExportableSprites","isHidden","isHiding","visible","hide","show","index","invalid","once","SVGDefaults","Disposer","Color","Percent","percent","$async","$ease","$colors","system","animate","duration","disposed","startTime","now","loop","diff","nextFrame","getProgressNumber","from","to","getProgressPercent","getProgressColor","interpolate","rgb","alpha","getHybridProperty","property","charAt","toUpperCase","substr","AnimationDisposer","array","_disposer","isDisposed","Animation","object","animationOptions","easing","linear","_loop","_pause","_delayTimeout","_time","_isFinished","animationsEnabled","toArray","debug","pause","move","animations","id_1","start","_start","stopSameAnimations","requestFrame","_startTime","staticOptions","options_1","childObject","remove","isNumber","updateMethod","convertedFrom","isNaN","applyStaticOptions","update","end","Infinity","resume","setProgress","stop","kill","isFinished","skipEvent","fitToRange","timeProgress","copy","animation","delayed","killed_1","newOptions","oldOptions","asFunction","pendingFrame","nextQueue","readQueue","writeQueue","idleQueue","fps","raf","requestAnimationFrame","fn","frameLoop","shiftLeft","pendFrame","readFrame","writeFrame","whenIdle","triggerIdle","EventDispatcher","_listeners","_killed","_disabled","_iterating","_enabled","_disposed","disposer","hasListeners","hasListenersByType","any","killed","enable","disable","enableType","disableType","amount","_removeListener","listener","splice","_removeExistingListener","context","_eachListener","info","has","findIndex","_shouldDispatch","event","dispatch","_on","shouldClone","onAll","off","copyFrom","source","TargetedEventDispatcher","isBlob","xhr","XMLHttpRequest","status","readBlob","output","getResponseHeader","responseText","withCredentials","requestHeaders","header","setRequestHeader","send","reader","readAsText"],"sourceRoot":"webpack:///"}