@wcardinal/wcardinal-ui 0.289.0 → 0.291.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/dist/types/wcardinal/ui/d-chart-axis-bar.d.ts +5 -0
  2. package/dist/types/wcardinal/ui/d-chart-axis-base-options-parser.d.ts +23 -12
  3. package/dist/types/wcardinal/ui/d-chart-axis-base-options.d.ts +12 -4
  4. package/dist/types/wcardinal/ui/d-chart-axis-base-tick-container.d.ts +13 -4
  5. package/dist/types/wcardinal/ui/d-chart-axis-base.d.ts +5 -4
  6. package/dist/types/wcardinal/ui/d-chart-axis-tick-container.d.ts +5 -0
  7. package/dist/types/wcardinal/ui/d-chart-axis-tick-major.d.ts +4 -0
  8. package/dist/types/wcardinal/ui/d-chart-axis-tick-minor.d.ts +4 -0
  9. package/dist/types/wcardinal/ui/d-chart-coordinate-base.d.ts +52 -0
  10. package/dist/types/wcardinal/ui/d-chart-coordinate-linear.d.ts +4 -46
  11. package/dist/types/wcardinal/ui/d-chart-coordinate-log.d.ts +4 -42
  12. package/dist/types/wcardinal/ui/d-table-body.d.ts +7 -0
  13. package/dist/types/wcardinal/ui/index.d.ts +11 -0
  14. package/dist/types/wcardinal/ui/theme/dark/d-theme-dark-chart-axis-base.d.ts +7 -0
  15. package/dist/types/wcardinal/ui/theme/white/d-theme-white-chart-axis-base.d.ts +7 -0
  16. package/dist/wcardinal/ui/d-chart-axis-bar.js.map +1 -1
  17. package/dist/wcardinal/ui/d-chart-axis-base-options-parser.js +123 -23
  18. package/dist/wcardinal/ui/d-chart-axis-base-options-parser.js.map +1 -1
  19. package/dist/wcardinal/ui/d-chart-axis-base-options.js.map +1 -1
  20. package/dist/wcardinal/ui/d-chart-axis-base-tick-container.js +65 -44
  21. package/dist/wcardinal/ui/d-chart-axis-base-tick-container.js.map +1 -1
  22. package/dist/wcardinal/ui/d-chart-axis-base-tick-minor.js +1 -0
  23. package/dist/wcardinal/ui/d-chart-axis-base-tick-minor.js.map +1 -1
  24. package/dist/wcardinal/ui/d-chart-axis-base.js +17 -3
  25. package/dist/wcardinal/ui/d-chart-axis-base.js.map +1 -1
  26. package/dist/wcardinal/ui/d-chart-axis-tick-container.js.map +1 -1
  27. package/dist/wcardinal/ui/d-chart-axis-tick-major.js.map +1 -1
  28. package/dist/wcardinal/ui/d-chart-axis-tick-minor.js.map +1 -1
  29. package/dist/wcardinal/ui/d-chart-coordinate-base.js +186 -0
  30. package/dist/wcardinal/ui/d-chart-coordinate-base.js.map +1 -0
  31. package/dist/wcardinal/ui/d-chart-coordinate-linear-tick.js +2 -1
  32. package/dist/wcardinal/ui/d-chart-coordinate-linear-tick.js.map +1 -1
  33. package/dist/wcardinal/ui/d-chart-coordinate-linear.js +9 -165
  34. package/dist/wcardinal/ui/d-chart-coordinate-linear.js.map +1 -1
  35. package/dist/wcardinal/ui/d-chart-coordinate-log-tick.js +2 -1
  36. package/dist/wcardinal/ui/d-chart-coordinate-log-tick.js.map +1 -1
  37. package/dist/wcardinal/ui/d-chart-coordinate-log.js +9 -153
  38. package/dist/wcardinal/ui/d-chart-coordinate-log.js.map +1 -1
  39. package/dist/wcardinal/ui/d-chart-series-line-of-any.js +4 -2
  40. package/dist/wcardinal/ui/d-chart-series-line-of-any.js.map +1 -1
  41. package/dist/wcardinal/ui/d-scroll-bar-vertical.js +1 -0
  42. package/dist/wcardinal/ui/d-scroll-bar-vertical.js.map +1 -1
  43. package/dist/wcardinal/ui/d-table-body.js +39 -0
  44. package/dist/wcardinal/ui/d-table-body.js.map +1 -1
  45. package/dist/wcardinal/ui/d-table.js +3 -3
  46. package/dist/wcardinal/ui/d-table.js.map +1 -1
  47. package/dist/wcardinal/ui/index.js +11 -0
  48. package/dist/wcardinal/ui/index.js.map +1 -1
  49. package/dist/wcardinal/ui/theme/dark/d-theme-dark-chart-axis-base.js +21 -0
  50. package/dist/wcardinal/ui/theme/dark/d-theme-dark-chart-axis-base.js.map +1 -1
  51. package/dist/wcardinal/ui/theme/white/d-theme-white-chart-axis-base.js +21 -0
  52. package/dist/wcardinal/ui/theme/white/d-theme-white-chart-axis-base.js.map +1 -1
  53. package/dist/wcardinal-ui-theme-dark.js +22 -1
  54. package/dist/wcardinal-ui-theme-dark.min.js +2 -2
  55. package/dist/wcardinal-ui-theme-dark.min.js.map +1 -1
  56. package/dist/wcardinal-ui-theme-white.js +22 -1
  57. package/dist/wcardinal-ui-theme-white.min.js +2 -2
  58. package/dist/wcardinal-ui-theme-white.min.js.map +1 -1
  59. package/dist/wcardinal-ui.cjs.js +754 -641
  60. package/dist/wcardinal-ui.js +712 -641
  61. package/dist/wcardinal-ui.min.js +2 -2
  62. package/dist/wcardinal-ui.min.js.map +1 -1
  63. package/package.json +1 -1
@@ -1,10 +1,10 @@
1
1
  /*
2
- Winter Cardinal UI v0.289.0
2
+ Winter Cardinal UI v0.291.0
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
6
6
  Material Design icons by Google
7
7
  Apache license version 2.0.
8
8
  */
9
- !function(t){"use strict";var n={},i={},r={CIRCLE:0,RECTANGLE:1,RECTANGLE_ROUNDED:2,TRIANGLE:3,TRIANGLE_ROUNDED:4,LINE:5,IMAGE:6,IMAGE_SDF:7,GROUP:8,BAR:9,LABEL:10,NULL:11,GROUP_SHADOWED:12,LINE_OF_CIRCLES:13,LINE_OF_RECTANGLES:14,LINE_OF_RECTANGLE_ROUNDEDS:15,LINE_OF_TRIANGLES:16,LINE_OF_TRIANGLE_ROUNDEDS:17,EMBEDDED:18,EMBEDDED_LAYER:19,BUTTON:20,RECTANGLE_PIVOTED:21,CONNECTOR_LINE:22,CONNECTOR_ELBOW:23,SEMICIRCLE:24,EXTENSION:1e3},e={},u=function(){function t(t,n,i,r,e,u){this.buffer=t,this.i=u,this.u=n,this.h=i,this.o=r,this.l=e}return t.prototype.init=function(t){t.uploaded=this;for(var n=this.buffer,i=this.i,r=0,e=i.length;r<e;++r)i[r].init(n);return this.update(t),this},t.prototype.update=function(t){for(var n=this.buffer,i=this.i,r=0,e=i.length;r<e;++r)i[r].update(n,t)},t.prototype.isCompatible=function(t){for(var n=this.i,i=0,r=n.length;i<r;++i)if(!n[i].isCompatible(t))return!1;return!0},t.prototype.getBuffer=function(){return this.buffer},t.prototype.getVertexOffset=function(){return this.u},t.prototype.getVertexCount=function(){return this.o},t.prototype.getIndexOffset=function(){return this.h},t.prototype.getIndexCount=function(){return this.l},t.prototype.buildUnit=function(t){for(var n=this.i,i=0,r=n.length;i<r;++i)n[i].buildUnit(t)},t}(),s={NONE:0,NON_EXPANDING_WIDTH:2,NON_SHRINKING_WIDTH:4,NON_SCALING_DOT_AND_DASH:8,NON_SCALING:14,NON_SCALING_MASK:14,DOTTED:16,DOTTED_DENSELY:32,DOTTED_LOOSELY:64,DOTTED_MASK:112,DASHED:128,DASHED_DENSELY:256,DASHED_LOOSELY:512,DASHED_MASK:896},h=function(t,n,i,r){return i&s.DOTTED_MASK?i&s.DOTTED?r.set(n,n):i&s.DOTTED_DENSELY?r.set(n,.5*n):r.set(n,2*n):i&s.DASHED_MASK?i&s.DASHED?r.set(2*n,n):i&s.DASHED_DENSELY?r.set(2*n,.5*n):r.set(2*n,2*n):r.set(2*t,0),r},o=function(t){var n=t&s.NON_EXPANDING_WIDTH?1:0,i=t&s.NON_SHRINKING_WIDTH?2:0;return t&(s.DOTTED_MASK||s.DASHED_MASK)?n|i|(t&s.NON_SCALING_DOT_AND_DASH?4:0):n|i},a=new t.Point,c=function(t,n){var i=3*n-1;t[++i]=1,t[++i]=0,t[++i]=3,t[++i]=0,t[++i]=1,t[++i]=5,t[++i]=1,t[++i]=0,t[++i]=3,t[++i]=0,t[++i]=1,t[++i]=5},f=function(t,n,i){var r=3*i-1;t[++r]=n,t[++r]=n+2,t[++r]=n+1,t[++r]=n+1,t[++r]=n+2,t[++r]=n+3},l=function(t,n,i,r,e,u,s,c,f){var l=f.a,v=f.b,b=f.c,d=f.d,g=f.tx,m=f.ty,w=e[0],O=e[1],p=l*w+b*O+g,D=v*w+d*O+m,E=e[2],M=e[3],S=l*E+b*M+g,T=v*E+d*M+m,j=S-p,N=T-D,I=Math.sqrt(j*j+N*N),C=I;if(0<=u&&1e-5<I){var A=u/I;S=p+(j*=A),T=D+(N*=A),C=u}var R=p-j,L=D-N,y=S+j,k=T+N,x=o(c),B=h(C,s,c,a),_=B.x,P=B.y,U=(r<<1)-1,F=(r<<2)-1,G=6*r-1;t[++U]=p,t[++U]=D,t[++U]=p,t[++U]=D,n[++G]=s,n[++G]=x,n[++G]=R,n[++G]=L,n[++G]=S,n[++G]=T,n[++G]=s,n[++G]=x,n[++G]=R,n[++G]=L,n[++G]=S,n[++G]=T,i[++F]=0,i[++F]=_,i[++F]=P,i[++F]=C,i[++F]=0,i[++F]=_,i[++F]=P,i[++F]=C,t[++U]=S,t[++U]=T,t[++U]=S,t[++U]=T,n[++G]=s,n[++G]=x,n[++G]=p,n[++G]=D,n[++G]=y,n[++G]=k,n[++G]=s,n[++G]=x,n[++G]=p,n[++G]=D,n[++G]=y,n[++G]=k,i[++F]=C,i[++F]=_,i[++F]=P,i[++F]=C,i[++F]=C,i[++F]=_,i[++F]=P,i[++F]=C},v=function(t,n,i){var r=(n<<1)-1;t[++r]=i.x0,t[++r]=i.y0,t[++r]=i.x3,t[++r]=i.y3,t[++r]=i.x1,t[++r]=i.y1,t[++r]=i.x2,t[++r]=i.y2},b=function(){function t(){this.target="",this.position=0}return t.prototype.init=function(t){this.target=t,this.position=0},t.prototype.hasNext=function(){return this.position<this.target.length},t.prototype.findNextBreak=function(t,n){for(var i=t.length,r=n;r<i;++r){var e=t.charCodeAt(r);if(!this.isLowSurrogate(e)&&!this.isVariationSelector(e))return r}return i},t.prototype.isHighSurrogate=function(t){return 55296<=t&&t<=56319},t.prototype.isLowSurrogate=function(t){return 56320<=t&&t<=57343},t.prototype.isVariationSelector=function(t){return 65024<=t&&t<=65039},t.prototype.next=function(){var t=this.target,n=this.position,i=this.findNextBreak(t,n+1),r=t.substring(n,i);return this.position=i,r},t.prototype.advance=function(t){var n=this.target,i=this.position,r=this.findNextBreak(n,i+1);return n.substring(i,r)!==t&&(this.position=r,!0)},t.prototype.close=function(){var t=this.target.length;return this.position<t&&(this.position=t,!0)},t.from=function(n){null==t.v&&(t.v=new t);var i=t.v;return i.init(n),i},t.v=null,t}(),d={NORMAL:0,BOLD:1},g={NORMAL:0,ITALIC:1},m={LEFT:0,CENTER:1,RIGHT:2,OUTSIDE_LEFT:3,OUTSIDE_RIGHT:4},w={TOP:0,MIDDLE:1,BOTTOM:2,OUTSIDE_TOP:3,OUTSIDE_BOTTOM:4},O={LEFT_TO_RIGHT:0,TOP_TO_BOTTOM:1,BOTTOM_TO_TOP:2,RIGHT_TO_LEFT:3},p=function(t,n,i,r){var e=i-t,u=r-n;return Math.sqrt(e*e+u*u)},D=1e-5,E=new t.Point,M=function(t){return 12*Math.ceil(t.text.value.length/12)},S=function(t,n,i){for(var r=3*n-1,e=3*(n+i)-1;r<e;)t[++r]=0,t[++r]=0,t[++r]=2},T=function(t,n,i,r){for(var e=3*i-1,u=3*(i+r)-1,s=n;e<u;)t[++e]=s,t[++e]=s+1,t[++e]=s+3,t[++e]=s+1,t[++e]=s+2,t[++e]=s+3,s+=4},j=function(t,n,i,r,e,u,h,a,c){var f=6*n-1,l=6*(n+i)-1,v=o(s.NONE);if(null!=r)for(var b=r.font.size/(e*(a+c)*.5),g=h===d.NORMAL?0:.05;f<l;)t[++f]=u,t[++f]=v,t[++f]=b,t[++f]=1,t[++f]=0,t[++f]=g;else for(;f<l;)t[++f]=0,t[++f]=v,t[++f]=0,t[++f]=1,t[++f]=0,t[++f]=0},N=function(t,n,i,r,e,u,s,h,o,a,c,f,l,v,b,d,g,O,p,D,E){switch(t){case m.LEFT:switch(n){case w.TOP:E.x=o+g*(i+e)+p*(r+u),E.y=a+O*(i+e)+D*(r+u);break;case w.MIDDLE:E.x=.5*(o+b)+g*(i+e)+p*(r-.5*h),E.y=.5*(a+d)+O*(i+e)+D*(r-.5*h);break;case w.BOTTOM:E.x=b+g*(i+e)+p*(r-u-h),E.y=d+O*(i+e)+D*(r-u-h);break;case w.OUTSIDE_TOP:E.x=o+g*(i+e)+p*(r-u-h),E.y=a+O*(i+e)+D*(r-u-h);break;case w.OUTSIDE_BOTTOM:E.x=b+g*(i+e)+p*(r+u),E.y=d+O*(i+e)+D*(r+u)}break;case m.CENTER:switch(n){case w.TOP:E.x=.5*(o+c)+g*(i-.5*s)+p*(r+u),E.y=.5*(a+f)+O*(i-.5*s)+D*(r+u);break;case w.MIDDLE:E.x=.5*(o+l)+g*(i-.5*s)+p*(r-.5*h),E.y=.5*(a+v)+O*(i-.5*s)+D*(r-.5*h);break;case w.BOTTOM:E.x=.5*(b+l)+g*(i-.5*s)+p*(r-u-h),E.y=.5*(d+v)+O*(i-.5*s)+D*(r-u-h);break;case w.OUTSIDE_TOP:E.x=.5*(o+c)+g*(i-.5*s)+p*(r-u-h),E.y=.5*(a+f)+O*(i-.5*s)+D*(r-u-h);break;case w.OUTSIDE_BOTTOM:E.x=.5*(b+l)+g*(i-.5*s)+p*(r+u),E.y=.5*(d+v)+O*(i-.5*s)+D*(r+u)}break;case m.RIGHT:switch(n){case w.TOP:E.x=c+g*(i-e-s)+p*(r+u),E.y=f+O*(i-e-s)+D*(r+u);break;case w.MIDDLE:E.x=.5*(c+l)+g*(i-e-s)+p*(r-.5*h),E.y=.5*(f+v)+O*(i-e-s)+D*(r-.5*h);break;case w.BOTTOM:E.x=l+g*(i-e-s)+p*(r-u-h),E.y=v+O*(i-e-s)+D*(r-u-h);break;case w.OUTSIDE_TOP:E.x=c+g*(i-e-s)+p*(r-u-h),E.y=f+O*(i-e-s)+D*(r-u-h);break;case w.OUTSIDE_BOTTOM:E.x=l+g*(i-e-s)+p*(r+u),E.y=v+O*(i-e-s)+D*(r+u)}break;case m.OUTSIDE_LEFT:switch(n){case w.TOP:E.x=o+g*(i-e-s)+p*(r+u),E.y=a+O*(i-e-s)+D*(r+u);break;case w.MIDDLE:E.x=.5*(o+b)+g*(i-e-s)+p*(r-.5*h),E.y=.5*(a+d)+O*(i-e-s)+D*(r-.5*h);break;case w.BOTTOM:E.x=b+g*(i-e-s)+p*(r-u-h),E.y=d+O*(i-e-s)+D*(r-u-h);break;case w.OUTSIDE_TOP:E.x=o+g*(i-e-s)+p*(r-u-h),E.y=a+O*(i-e-s)+D*(r-u-h);break;case w.OUTSIDE_BOTTOM:E.x=b+g*(i-e-s)+p*(r+u),E.y=d+O*(i-e-s)+D*(r+u)}break;case m.OUTSIDE_RIGHT:switch(n){case w.TOP:E.x=c+g*(i+e)+p*(r+u),E.y=f+O*(i+e)+D*(r+u);break;case w.MIDDLE:E.x=.5*(c+l)+g*(i+e)+p*(r-.5*h),E.y=.5*(f+v)+O*(i+e)+D*(r-.5*h);break;case w.BOTTOM:E.x=l+g*(i+e)+p*(r-u-h),E.y=v+O*(i+e)+D*(r-u-h);break;case w.OUTSIDE_TOP:E.x=c+g*(i+e)+p*(r-u-h),E.y=f+O*(i+e)+D*(r-u-h);break;case w.OUTSIDE_BOTTOM:E.x=l+g*(i+e)+p*(r+u),E.y=v+O*(i+e)+D*(r+u)}}},I=function(t,n,i,r,e,u,s,h,o,a,c,f,l,v,d,M,S,T,j,I,R,L,y,x,B){var _=.5*s,P=.5*h,U=B.a,F=B.b,G=B.c,H=B.d,z=B.tx,V=B.ty,W=e-_,X=u-P,K=e+_,Y=u-P,J=e+_,Z=u+P,q=U*W+G*X+z,Q=F*W+H*X+V,$=U*K+G*Y+z,tt=F*K+H*Y+V,nt=U*J+G*Z+z,it=F*J+H*Z+V,rt=q+(nt-$),et=Q+(it-tt),ut=p(q,Q,$,tt),st=p(0,0,U,F),ht=1,ot=0;if(D<st){var at=1/st;ht=U*at,ot=F*at}var ct=p(q,Q,rt,et),ft=p(0,0,G,H),lt=0,vt=1;if(D<st){var bt=1/ft;lt=G*bt,vt=H*bt}var dt=E;switch(j){case O.LEFT_TO_RIGHT:break;case O.TOP_TO_BOTTOM:dt.set(lt,vt),lt=-ht,vt=-ot,ht=dt.x,ot=dt.y,dt.x=ft,ft=st,st=dt.x;break;case O.BOTTOM_TO_TOP:dt.set(lt,vt),lt=ht,vt=ot,ht=-dt.x,ot=-dt.y,dt.x=ft,ft=st,st=dt.x;break;case O.RIGHT_TO_LEFT:ht=-ht,ot=-ot,lt=-lt,vt=-vt}for(var gt=0,mt=0,wt=0,Ot=a*ft,pt=Math.max(0,a+T)*ft,Dt=0,Et=o.characters,Mt=b.from(c),St=0;Mt.hasNext();)"\n"!==(hn=Mt.next())?(0<St&&(Dt+=Math.max(0,St+S)),(an=Et[hn])?(St=an.advance,wt=an.height):St=0):(Dt+=St,St=0,gt=Math.max(gt,Dt),Dt=0,mt+=pt);var Tt=a/o.font.size,jt=st*Tt,Nt=ft*Tt;Dt+=St,gt=Math.max(gt,Dt)*jt,Dt=0,wt*=Nt,mt+=Ot;var It=0,Ct=0,At=NaN;switch(j){case O.LEFT_TO_RIGHT:if(N(l,v,d,M,I,R,gt,mt,q,Q,$,tt,nt,it,rt,et,ht,ot,lt,vt,dt),It=dt.x,Ct=dt.y,L)switch(l){case m.LEFT:case m.CENTER:case m.RIGHT:switch(v){case w.TOP:case w.MIDDLE:case w.BOTTOM:At=ut-2*I}}break;case O.TOP_TO_BOTTOM:if(N(function(t){switch(t){case w.TOP:return m.LEFT;case w.MIDDLE:return m.CENTER;case w.BOTTOM:return m.RIGHT;case w.OUTSIDE_TOP:return m.OUTSIDE_LEFT;case w.OUTSIDE_BOTTOM:return m.OUTSIDE_RIGHT}}(v),function(t){switch(t){case m.LEFT:return w.BOTTOM;case m.CENTER:return w.MIDDLE;case m.RIGHT:return w.TOP;case m.OUTSIDE_LEFT:return w.OUTSIDE_BOTTOM;case m.OUTSIDE_RIGHT:return w.OUTSIDE_TOP}}(l),M,d,R,I,gt,mt,$,tt,nt,it,rt,et,q,Q,ht,ot,lt,vt,dt),It=dt.x,Ct=dt.y,L)switch(v){case w.TOP:case w.MIDDLE:case w.BOTTOM:switch(l){case m.LEFT:case m.CENTER:case m.RIGHT:At=ct-2*R}}break;case O.BOTTOM_TO_TOP:if(N(function(t){switch(t){case w.TOP:return m.RIGHT;case w.MIDDLE:return m.CENTER;case w.BOTTOM:return m.LEFT;case w.OUTSIDE_TOP:return m.OUTSIDE_RIGHT;case w.OUTSIDE_BOTTOM:return m.OUTSIDE_LEFT}}(v),function(t){switch(t){case m.LEFT:return w.TOP;case m.CENTER:return w.MIDDLE;case m.RIGHT:return w.BOTTOM;case m.OUTSIDE_LEFT:return w.OUTSIDE_TOP;case m.OUTSIDE_RIGHT:return w.OUTSIDE_BOTTOM}}(l),M,d,R,I,gt,mt,rt,et,q,Q,$,tt,nt,it,ht,ot,lt,vt,dt),It=dt.x,Ct=dt.y,L)switch(v){case w.TOP:case w.MIDDLE:case w.BOTTOM:switch(l){case m.LEFT:case m.CENTER:case m.RIGHT:At=ct-2*R}}break;case O.RIGHT_TO_LEFT:if(N(function(t){switch(t){case m.LEFT:return m.RIGHT;case m.CENTER:return m.CENTER;case m.RIGHT:return m.LEFT;case m.OUTSIDE_LEFT:return m.OUTSIDE_RIGHT;case m.OUTSIDE_RIGHT:return m.OUTSIDE_LEFT}}(l),function(t){switch(t){case w.TOP:return w.BOTTOM;case w.MIDDLE:return w.MIDDLE;case w.BOTTOM:return w.TOP;case w.OUTSIDE_TOP:return w.OUTSIDE_BOTTOM;case w.OUTSIDE_BOTTOM:return w.OUTSIDE_TOP}}(v),d,M,I,R,gt,mt,nt,it,rt,et,q,Q,$,tt,ht,ot,lt,vt,dt),It=dt.x,Ct=dt.y,L)switch(l){case m.LEFT:case m.CENTER:case m.RIGHT:switch(v){case w.TOP:case w.MIDDLE:case w.BOTTOM:At=ut-2*I}}}if(At<gt){var Rt=.5*(gt-At);y[0]=It+ht*Rt,y[1]=Ct+ot*Rt,y[2]=ht,y[3]=ot,y[4]=lt,y[5]=vt,y[6]=At,y[7]=mt,y[8]=st,y[9]=ft}else y[0]=It,y[1]=Ct,y[2]=ht,y[3]=ot,y[4]=lt,y[5]=vt,y[6]=gt,y[7]=mt,y[8]=st,y[9]=ft;var Lt=x.x0,yt=x.x1,kt=x.x3,xt=x.y0,Bt=x.y1,_t=x.y3,Pt=yt-Lt,Ut=Bt-xt,Ft=kt-Lt,Gt=_t-xt,Ht=pt*lt,zt=pt*vt,Vt=jt*ht,Wt=jt*ot,Xt=.5*(wt-Ot),Kt=Xt*lt,Yt=Xt*vt,Jt=f===g.NORMAL?0:.25*a,Zt=It-Kt+Jt*Vt,qt=Ct-Yt+Jt*Wt,Qt=It+Kt+Ot*lt,$t=Ct+Yt+Ot*vt,tn=Zt,nn=qt,rn=Qt,en=$t;Dt=0,St=0,Mt.position=0;for(var un=0,sn=2*i;Mt.hasNext();sn+=8){var hn;if("\n"!==(hn=Mt.next())){var on=Dt;0<St&&(Dt+=Math.max(0,St+S));var an,cn=Dt*Vt,fn=Dt*Wt;if(tn=Zt+cn,nn=qt+fn,rn=Qt+cn,en=$t+fn,un+=1,an=Et[hn]){var ln=an.advance;if(At<(Dt+ln)*jt){var vn=Et["..."];if(vn){if(1<un&&At<(Dt+vn.advance)*jt){sn-=8,un-=1;var bn=(Dt=on)*Vt,dn=Dt*Wt;tn=Zt+bn,nn=qt+dn,rn=Qt+bn,en=$t+dn}for(St=vn.advance,A(t,n,sn,vn,o,Vt,Wt,tn,nn,rn,en,Pt,Ut,Ft,Gt,Lt,xt),sn+=8;;sn+=8){if(!Mt.hasNext()||!Mt.advance("\n")){sn-=8;break}C(t,n,sn,tn,nn,rn,en,Lt,xt,kt,_t),un+=1}}else St=ln,C(t,n,sn,tn,nn,rn,en,Lt,xt,kt,_t)}else St=ln,A(t,n,sn,an,o,Vt,Wt,tn,nn,rn,en,Pt,Ut,Ft,Gt,Lt,xt)}else St=0,C(t,n,sn,tn,nn,rn,en,Lt,xt,kt,_t)}else Dt+=St,St=0,C(t,n,sn,tn=Zt+=Ht,nn=qt+=zt,rn=Qt+=Ht,en=$t+=zt,Lt,xt,kt,_t),k(t,ht,ot,un,sn,gt-Dt*jt,j,l,v),Dt=0,un=0}k(t,ht,ot,un,sn,gt-(Dt+=St)*jt,j,l,v);for(var gn=2*(i+r);sn<gn;sn+=2)t[sn+0]=It,t[sn+1]=Ct,n[sn+0]=Lt,n[sn+1]=xt},C=function(t,n,i,r,e,u,s,h,o,a,c){t[i+0]=r,t[i+1]=e,t[i+2]=r,t[i+3]=e,t[i+4]=u,t[i+5]=s,t[i+6]=u,t[i+7]=s,n[i+0]=h,n[i+1]=o,n[i+2]=h,n[i+3]=o,n[i+4]=a,n[i+5]=c,n[i+6]=a,n[i+7]=c},A=function(t,n,i,r,e,u,s,h,o,a,c,f,l,v,b,d,g){var m=r.x-r.origin.x,w=r.width,O=m*u,p=m*s,D=(m+w)*u,E=(m+w)*s;t[i+0]=h+O,t[i+1]=o+p,t[i+2]=h+D,t[i+3]=o+E,t[i+4]=a+D,t[i+5]=c+E,t[i+6]=a+O,t[i+7]=c+p;var M=r.x/e.width,S=r.y/e.height,T=(r.x+r.width)/e.width,j=(r.y+r.height)/e.height,N=f*M,I=l*M,C=f*T,A=l*T,R=v*S,L=b*S,y=v*j,k=b*j;n[i+0]=d+N+R,n[i+1]=g+I+L,n[i+2]=d+C+R,n[i+3]=g+A+L,n[i+4]=d+C+y,n[i+5]=g+A+k,n[i+6]=d+N+y,n[i+7]=g+I+k},R=function(t,n,i,r,e){for(var u=n-8*i-1,s=0;s<i;++s)t[++u]+=r,t[++u]+=e,t[++u]+=r,t[++u]+=e,t[++u]+=r,t[++u]+=e,t[++u]+=r,t[++u]+=e},L=function(t,n,i,r,e,u){R(t,n,i,(r*=.5)*e,r*u)},y=function(t,n,i,r,e,u){R(t,n,i,r*e,r*u)},k=function(t,n,i,r,e,u,s,h,o){if(D<u)switch(s){case O.LEFT_TO_RIGHT:switch(h){case m.OUTSIDE_RIGHT:case m.LEFT:break;case m.CENTER:L(t,e,r,u,n,i);break;case m.OUTSIDE_LEFT:case m.RIGHT:y(t,e,r,u,n,i)}break;case O.TOP_TO_BOTTOM:switch(o){case w.OUTSIDE_BOTTOM:case w.TOP:break;case w.MIDDLE:L(t,e,r,u,n,i);break;case w.OUTSIDE_TOP:case w.BOTTOM:y(t,e,r,u,n,i)}break;case O.BOTTOM_TO_TOP:switch(o){case w.OUTSIDE_BOTTOM:case w.TOP:y(t,e,r,u,n,i);break;case w.MIDDLE:L(t,e,r,u,n,i)}break;case O.RIGHT_TO_LEFT:switch(h){case m.OUTSIDE_RIGHT:case m.LEFT:y(t,e,r,u,n,i);break;case m.CENTER:L(t,e,r,u,n,i)}}},x=function(t,n){return(x=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(t,n)};function B(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}x(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}var _,P,U,F={NONE:0,CLOSED:1,NON_EXPANDING_WIDTH:2,NON_SHRINKING_WIDTH:4,NON_SCALING_DOT_AND_DASH:8,NON_SCALING_MASK:14,DOTTED:16,DOTTED_DENSELY:32,DOTTED_LOOSELY:64,DOTTED_MASK:112,DASHED:128,DASHED_DENSELY:256,DASHED_LOOSELY:512,DASHED_MASK:896,CURVE:1024,FORMATTER_MASK:1024},G=function(t,n,i,r,e){for(var u=(t>>16&255)/255*n,s=(t>>8&255)/255*n,h=(t>>0&255)/255*n,o=n,a=(i<<2)-1,c=(i+r<<2)-1;a<c;)e[++a]=u,e[++a]=s,e[++a]=h,e[++a]=o},H=function(){function n(t,n,i,r){this.vertexOffset=t,this.indexOffset=n,this.vertexCount=i,this.indexCount=r,this.sizeX=NaN,this.sizeY=NaN,this.transformLocalId=-1,this.strokeAlign=NaN,this.strokeWidth=NaN,this.strokeSide=NaN,this.strokeStyle=NaN,this.colorFill=NaN,this.alphaFill=-1,this.colorStroke=NaN,this.alphaStroke=-1,this.texture=null,this.textureTransformId=NaN}return n.prototype.isCompatible=function(t){return!0},n.prototype.updateColorFill=function(t,n){var i=n.fill,r=n.visible&&i.enable,e=i.color,u=r?i.alpha:0;e===this.colorFill&&u===this.alphaFill||(this.colorFill=e,this.alphaFill=u,t.updateColorFills(),G(e,u,this.vertexOffset,this.vertexCount,t.colorFills))},n.prototype.updateColorStroke=function(t,n){var i=n.stroke,r=n.visible&&i.enable&&0<i.width,e=i.color,u=r?i.alpha:0;e===this.colorStroke&&u===this.alphaStroke||(this.colorStroke=e,this.alphaStroke=u,t.updateColorStrokes(),G(e,u,this.vertexOffset,this.vertexCount,t.colorStrokes))},n.prototype.buildUnit=function(n){var i=this.texture||t.Texture.WHITE,r=i.baseTexture;if(r!==n.baseTexture){n.baseTexture=r;var e=this.indexOffset;n.push(i,e)}},n}(),z=function(t){return t.updateTransform(),t.transform.getLocalId()},V=function(n){return n.texture||t.Texture.WHITE},W=function(t){var n=t;return null==n._uvs&&t.updateUvs(),n._updateID},X=function(t){return t._uvs},K=function(){function t(){}return t.setDefaultThemeClass=function(t){this.DEFAULT_THEME_CLASS=t},t.getDefaultThemeClass=function(){return this.DEFAULT_THEME_CLASS},t.getInstance=function(){if(null==this.INSTANCE){var t=this.getDefaultThemeClass();if(null==t)throw new Error("No default theme class found");this.INSTANCE=new t}return this.INSTANCE},t.setInstance=function(t){var n=this.INSTANCE;return this.INSTANCE=t,n},t.get=function(t){return this.getInstance().get(t)},t.set=function(t,n){this.getInstance().set(t,n)},t.getClass=function(t){return this.getInstance().getClass(t)},t.setClass=function(t,n){this.getInstance().setClass(t,n)},t.getAtlas=function(){return this.getInstance().getAtlas()},t.DEFAULT_THEME_CLASS=null,t.INSTANCE=null,t}(),Y=function(){function t(){}return Object.defineProperty(t,"THEME",{get:function(){var t=this.g;if(null!=t)return t;var n=K.getInstance().get("EShape");return this.g=n,n},enumerable:!1,configurable:!0}),Object.defineProperty(t,"FILL_COLOR",{get:function(){return this.THEME.getFillColor()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"FILL_ALPHA",{get:function(){return this.THEME.getFillAlpha()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"STROKE_COLOR",{get:function(){return this.THEME.getStrokeColor()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"STROKE_ALPHA",{get:function(){return this.THEME.getStrokeAlpha()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"STROKE_WIDTH",{get:function(){return this.THEME.getStrokeWidth()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"STROKE_ALIGN",{get:function(){return this.THEME.getStrokeAlign()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"STROKE_SIDE",{get:function(){return this.THEME.getStrokeSide()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"STROKE_STYLE",{get:function(){return this.THEME.getStrokeStyle()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"TEXT_VALUE",{get:function(){return this.THEME.getTextValue()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"TEXT_COLOR",{get:function(){return this.THEME.getTextColor()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"TEXT_ALPHA",{get:function(){return this.THEME.getTextAlpha()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"TEXT_FAMILY",{get:function(){return this.THEME.getTextFamily()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"TEXT_SIZE",{get:function(){return this.THEME.getTextSize()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"RADIUS",{get:function(){return this.THEME.getRadius()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"SIZE_X",{get:function(){return this.THEME.getSizeX()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"SIZE_Y",{get:function(){return this.THEME.getSizeY()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"HIGHLIGHT_COLOR",{get:function(){return this.THEME.getHighlightColor()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"CURVE_SEGMENT_COUNT",{get:function(){return this.THEME.getCurveSegmentCount()},enumerable:!1,configurable:!0}),t}(),J={NONE:0,CIRCLE:1,TRIANGLE:2,RECTANGLE:3},Z=function(){function t(t,n,i,r){this.O=t,this.p=n,this.S=i,this.T=r}return Object.defineProperty(t.prototype,"enable",{get:function(){return this.p},set:function(t){this.p!==t&&(this.p=t,this.O.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this.S},set:function(t){this.S!==t&&(this.S=t,this.O.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return this.T},set:function(t){this.T!==t&&(this.T=t,this.O.updateUploaded())},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){t&&this.set(t.enable,t.color,t.alpha)},t.prototype.set=function(t,n,i){var r=!1;void 0!==t&&this.p!==t&&(this.p=t,r=!0),void 0!==n&&this.S!==n&&(this.S=n,r=!0),void 0!==i&&this.T!==i&&(this.T=i,r=!0),r&&this.O.updateUploaded()},t.prototype.clone=function(){return new t(this.O,this.p,this.S,this.T)},t.prototype.toObject=function(){return{enable:this.p,color:this.S,alpha:this.T}},t.prototype.serialize=function(t){var n="[".concat(this.p?1:0,",").concat(this.S,",").concat(this.T,"]");return t.addResource(n)},t.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getFill(t);if(null!=r)this.set(!!r[0],r[1],r[2]);else{var e=JSON.parse(i[t]);n.setFill(t,e),this.set(!!e[0],e[1],e[2])}}},t}(),q=function(){function n(){}return n.prototype.lock=function(){return this},n.prototype.unlock=function(){return this},Object.defineProperty(n.prototype,"type",{get:function(){return J.NONE},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"size",{get:function(){var n=this.j;return null==n&&(n=new t.Point,this.j=n),n},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"transform",{get:function(){var n=this.I;return null==n&&(n=new t.Matrix,this.I=n),n},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"fill",{get:function(){var t=this.C;return null==t&&(t=new Z(this,!0,Y.FILL_COLOR,1),this.C=t),t},enumerable:!1,configurable:!0}),n.prototype.updateUploaded=function(){},n.prototype.copy=function(t){return this},n.prototype.set=function(t,n,i){return this},n.prototype.serialize=function(t){return-1},n.prototype.deserialize=function(t,n){},n}(),Q=function(){function t(){this.A=new q}return t.prototype.lock=function(){return this},t.prototype.unlock=function(){return this},Object.defineProperty(t.prototype,"head",{get:function(){return this.A},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tail",{get:function(){return this.A},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){return this},t.prototype.serialize=function(t){return-1},t.prototype.deserialize=function(t,n){},t.getInstance=function(){var n=this.INSTANCE;return null==n&&(n=new t,this.INSTANCE=n),n},t}(),$={TOP:0,LEFT:1,RIGHT:2,BOTTOM:3},tt=function(){function n(t){this.O=t,this.R=0,this.L=[0,0,0,0],this.k=[],this.B=F.NONE,this.j=-1,this._=$.TOP,this.P=NaN,this.U=NaN,this.F=NaN,this.G=NaN}return n.prototype.getComputedSize=function(t,n,i,r){if(0<=t)return t;switch(n){case $.TOP:case $.BOTTOM:return Math.abs(r);case $.RIGHT:case $.LEFT:return Math.abs(i)}return 0},n.prototype.update=function(){var t=this.O.size,n=t.x,i=t.y,r=this._,e=this.j;if(this.P!==e||this.U!==n||this.F!==i||this.G!==r){this.R+=1,this.P=e,this.U=n,this.F=i,this.G=r;var u=.5*n,s=.5*i,h=this.getComputedSize(e,r,n,i),o=this.L;switch(r){case $.TOP:o[0]=0,o[1]=-s,o[2]=0,o[3]=-s+h;break;case $.RIGHT:o[0]=u,o[1]=0,o[2]=u-h,o[3]=0;break;case $.BOTTOM:o[0]=0,o[1]=s,o[2]=0,o[3]=s-h;break;case $.LEFT:o[0]=-u,o[1]=0,o[2]=-u+h,o[3]=0}}},Object.defineProperty(n.prototype,"length",{get:function(){return 2},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"id",{get:function(){return this.update(),this.R},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"values",{get:function(){return this.update(),this.L},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"segments",{get:function(){return this.k},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"size",{get:function(){return this.j},set:function(t){this.moveTo(void 0,t,void 0)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"position",{get:function(){return this._},set:function(t){this.moveTo(t,void 0,void 0)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"style",{get:function(){return this.B},set:function(t){this.moveTo(void 0,void 0,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"marker",{get:function(){var t=this.A;return null==t&&(t=Q.getInstance(),this.A=t),t},enumerable:!1,configurable:!0}),n.prototype.getMarker=function(){},Object.defineProperty(n.prototype,"formatter",{get:function(){return null},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"formatted",{get:function(){return this},enumerable:!1,configurable:!0}),n.prototype.copy=function(t){return t instanceof n?this.moveTo(t.position,t.size,t.style):this.moveTo(void 0,void 0,t.style)},n.prototype.set=function(t,n,i){var r,e;if(null!=t){var u=t[0];if(0===u){var s=t[1];r=s<=0?$.TOP:$.BOTTOM,e=Math.abs(t[3]-s)}else r=u<=0?$.LEFT:$.RIGHT,e=Math.abs(t[2]-u)}return this.moveTo(r,e,i)},n.prototype.moveTo=function(t,n,i){var r=!1;return null!=i&&this.B!==i&&(this.B=i,r=!0),null!=t&&this._!==t&&(this._=t,r=!0),null!=n&&this.j!==n&&(this.j=n,r=!0),r&&this.O.updateUploaded(),this},n.prototype.clone=function(t){return new n(t).copy(this)},n.prototype.toPoints=function(n){for(var i=[],r=this.values,e=0,u=r.length;e<u;e+=2){var s=new t.Point(r[e+0],r[e+1]);i.push(n.apply(s,s))}return i},n.prototype.serialize=function(t){return t.addResource("[".concat(this._,",").concat(this.j,",").concat(this.B,"]"))},n.prototype.deserialize=function(t,n){if(0<=t&&t<n.resources.length){var i=n.resources[t],r=JSON.parse(i);this.moveTo(r[0],r[1],r[2])}},n.prototype.calcHitPointAbs=function(t,n,i,r,e,u,s,h){if(2<=this.length){var o=this.L;if(s(t,n,o[0],o[1],o[2],o[3],0,e,h))return!0}return!1},n}(),nt={NONE:0,LINE:1,MARKER_TAIL:2,MARKER_HEAD:3,TEXT:4,CHILDREN:5},it={NONE:0,TOP_LEFT:1,TOP_RIGHT:2,BOTTOM_LEFT:4,BOTTOM_RIGHT:8,TOP:3,BOTTOM:12,LEFT:5,RIGHT:10,ALL:15},rt=function(){function t(){}return t.add=function(n){t.INSTANCES.push(n)},t.first=function(){var n=t.INSTANCES;if(0<n.length)return n[0];throw new Error("No application found.")},t.last=function(){var n=t.INSTANCES;if(0<n.length)return n[n.length-1];throw new Error("No application found.")},t.get=function(n){var i=t.INSTANCES;return 0<=n&&n<i.length?i[n]:null},t.indexOf=function(n){return t.INSTANCES.indexOf(n)},t.size=function(){return t.INSTANCES.length},t.getStage=function(t){for(var n=t;n.parent;)n=n.parent;return"application"in n&&"layer"in n?n:null},t.find=function(t){var n=this.getStage(t);return n?n.layer.application:null},t.getLayerBase=function(t){var n=this.getStage(t);return n?n.layer.application.getLayerBase():null},t.getLayerOverlay=function(t){var n=this.getStage(t);return n?n.layer.application.getLayerOverlay():null},t.getLayer=function(t){var n=this.getStage(t);return n?n.layer:null},t.getResolution=function(t){var n,i=this.getLayer(t);return i?i.renderer.resolution:null!==(n=window.devicePixelRatio)&&void 0!==n?n:1},t.update=function(n){if(n){var i=this.getStage(n);i&&i.layer.update()}else for(var r=t.INSTANCES,e=0,u=r.length;e<u;++e)r[e].update()},t.render=function(n){if(n){var i=this.getStage(n);i&&i.layer.render()}else for(var r=t.INSTANCES,e=0,u=r.length;e<u;++e)r[e].render()},t.INSTANCES=[],t}(),et=function(){function t(){this.values=[]}return t.prototype.add=function(t,n){var i=this.values;return null!=n?i.splice(n,0,t):i.push(t),this},t.prototype.addAll=function(t){for(var n=this.values,i=0,r=t.length;i<r;++i)n.push(t[i]);return this},t.prototype.clearAndAdd=function(t){return this.clear(),this.add(t),this},t.prototype.clearAndAddAll=function(t){return this.clear(),this.addAll(t),this},t.prototype.indexOf=function(t){for(var n=this.values,i=0,r=n.length;i<r;++i)if(n[i]===t)return i;for(i=0,r=n.length;i<r;++i)if(n[i].isEquals(t))return i;return-1},t.prototype.get=function(t){var n=this.values;return 0<=t||t<n.length?n[t]:null},t.prototype.set=function(t,n){var i=this.values;if(0<=t||t<i.length){var r=i[t];return i[t]=n,r}return null},t.prototype.remove=function(t){var n=this.values;return 0<=t||t<n.length?n.splice(t,1)[0]:null},t.prototype.clear=function(){return this.values.length=0,this},t.prototype.size=function(){return this.values.length},t.prototype.swap=function(t,n){var i=this.values,r=i[n];return i[n]=i[t],i[t]=r,this},t.prototype.serialize=function(t){for(var n=[],i=this.values,r=0,e=i.length;r<e;++r)n.push(i[r].serialize(t));return n},t}(),ut=function(){function t(t){this.O=t,this.V=new Set}return t.prototype.add=function(t){var n=this.V;return!n.has(t)&&(n.add(t),!0)},t.prototype.contains=function(t){return this.V.has(t)},t.prototype.size=function(){return this.V.size},t.prototype.remove=function(t){return this.V.delete(t)},t.prototype.clear=function(){return 0<this.V.size&&(this.V.clear(),!0)},t.prototype.copy=function(t){var n=this.V;return n.clear(),t.each((function(t){n.add(t)})),this},t.prototype.each=function(t){return this.V.forEach(t),this},t.prototype.fit=function(t){this.V.forEach(this.toOnFitBound(t))},t.prototype.toOnFitBound=function(t){var n;return t?(null==(n=this.W)&&(n=this.newOnFitBound(!0),this.W=n),n):(null==(n=this.K)&&(n=this.newOnFitBound(!1),this.K=n),n)},t.prototype.newOnFitBound=function(t){var n=this;return function(i){n.onFit(i,t)}},t.prototype.onFit=function(t,n){t.fit(n)},t.prototype.attach=function(){var t=this.O;return this.V.forEach((function(n){n.set(t)})),this},t.prototype.detach=function(){return this.V.forEach((function(t){t.set(null)})),this},t}(),st={NONE:0,TRANSFORM:1,SIZE:2,STYLE:4,ACTION:8,POINTS:16,STATE:32,IMAGE:64,DATA:128,TAG:128,CONNECTOR:256,CAPABILITY:512,ALL:1023},ht={HOVERED:"HOVERED",ACTIVE:"ACTIVE",FOCUSED:"FOCUSED",UNFOCUSABLE:"UNFOCUSABLE",FOCUS_ROOT:"FOCUS_ROOT",FOCUS_REVERSE:"FOCUS_REVERSE",READ_ONLY:"READ_ONLY",DISABLED:"DISABLED",GESTURING:"GESTURING",PRESSED:"PRESSED",INVALID:"INVALID",SUCCEEDED:"SUCCEEDED",FAILED:"FAILED",WARNED:"WARNED",CHANGED:"CHANGED",ALTERNATED:"ALTERNATED",NEW_WINDOW:"NEW_WINDOW"},ot=function(t){return"function"==typeof t},at=function(t){return"string"==typeof t||"[object String]"===Object.prototype.toString.call(t)},ct=function(){function t(){this.J=new Set,this.O=null}return t.prototype.is=function(t){return this.J.has(t)},t.prototype.in=function(t){return this.is(t)||this.under(t)},t.prototype.on=function(t){var n,i;return null!==(i=null===(n=this.O)||void 0===n?void 0:n.is(t))&&void 0!==i&&i},t.prototype.under=function(t){var n,i;return null!==(i=null===(n=this.O)||void 0===n?void 0:n.in(t))&&void 0!==i&&i},t.prototype.lock=function(t){return this},t.prototype.unlock=function(){return this},t.prototype.begin=function(){return this},t.prototype.end=function(){return this},t.prototype.checkAdded=function(t){return!this.J.has(t)},t.prototype.add=function(t){return this.checkAdded(t)&&(this.begin(),this.J.add(t),this.end()),this},t.prototype.checkAddeds=function(t){for(var n=this.J,i=0,r=t.length;i<r;++i)if(!n.has(t[i]))return!0;return!1},t.prototype.addAll=function(t){var n=at(t)?arguments:t;if(this.checkAddeds(n)){this.begin();for(var i=this.J,r=0,e=n.length;r<e;++r)i.add(n[r]);this.end()}return this},t.prototype.checkRemoved=function(t){return this.J.has(t)},t.prototype.remove=function(t){return this.checkRemoved(t)&&(this.begin(),this.J.delete(t),this.end()),this},t.prototype.checkRemoveds=function(t){for(var n=this.J,i=0,r=t.length;i<r;++i)if(n.has(t[i]))return!0;return!1},t.prototype.removeAll=function(t){var n=this,i=this.J;if(ot(t)){var r=!1;i.forEach((function(e){t(e)&&(r||(r=!0,n.begin()),i.delete(e))})),r&&this.end()}else{var e=at(t)?arguments:t;if(this.checkRemoveds(e)){this.begin();for(var u=0,s=e.length;u<s;++u)i.delete(e[u]);this.end()}}return this},t.prototype.clear=function(){var t=this.J;return 0<t.size&&(this.begin(),t.clear(),this.end()),this},t.prototype.set=function(t,n){if(!0===n)null!=t&&this.add(t);else if(!1===n)null!=t&&this.remove(t);else{var i=t,r=n;null!=i?null!=r?(this.checkAdded(i)||this.checkRemoved(r))&&(this.begin(),this.J.add(i).delete(r),this.end()):this.add(i):null!=r&&this.remove(r)}return this},t.prototype.setAll=function(t,n){if(!0===n)null!=t&&this.addAll(t);else if(!1===n)null!=t&&this.removeAll(t);else{var i=t,r=n;if(null!=i)if(null!=r){if(this.checkAddeds(i)||this.checkRemoveds(r)){this.begin();for(var e=this.J,u=0,s=i.length;u<s;++u)e.add(i[u]);for(u=0,s=r.length;u<s;++u)e.delete(r[u]);this.end()}}else this.addAll(i);else null!=r&&this.removeAll(r)}return this},t.prototype.each=function(t){return this.J.forEach((function(n){t(n)})),this},t.prototype.size=function(){return this.J.size},t.prototype.copy=function(n){if(n instanceof t){this.begin();var i=this.J;i.clear(),n.local.forEach((function(t){i.add(t)})),this.O=n.parent,this.end()}return this},Object.defineProperty(t.prototype,"local",{get:function(){return this.J},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){return this.O},set:function(t){this.O!==t&&(this.begin(),this.O=t,this.end())},enumerable:!1,configurable:!0}),t.prototype.onParentChange=function(t,n){this.O=n,this.begin(),this.O=t,this.end()},Object.defineProperty(t.prototype,"isHovered",{get:function(){return this.is(ht.HOVERED)},set:function(t){this.set(ht.HOVERED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inHovered",{get:function(){return this.in(ht.HOVERED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onHovered",{get:function(){return this.on(ht.HOVERED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underHovered",{get:function(){return this.under(ht.HOVERED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isActive",{get:function(){return this.is(ht.ACTIVE)},set:function(t){this.set(ht.ACTIVE,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inActive",{get:function(){return this.in(ht.ACTIVE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onActive",{get:function(){return this.on(ht.ACTIVE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underActive",{get:function(){return this.under(ht.ACTIVE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isPressed",{get:function(){return this.is(ht.PRESSED)},set:function(t){this.set(ht.PRESSED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inPressed",{get:function(){return this.in(ht.PRESSED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onPressed",{get:function(){return this.on(ht.PRESSED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underPressed",{get:function(){return this.under(ht.PRESSED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isReadOnly",{get:function(){return this.is(ht.READ_ONLY)},set:function(t){this.set(ht.READ_ONLY,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inReadOnly",{get:function(){return this.in(ht.READ_ONLY)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onReadOnly",{get:function(){return this.on(ht.READ_ONLY)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underReadOnly",{get:function(){return this.under(ht.READ_ONLY)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isEnabled",{get:function(){return!this.is(ht.DISABLED)},set:function(t){this.set(ht.DISABLED,!t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inEnabled",{get:function(){return!this.in(ht.DISABLED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onEnabled",{get:function(){return!this.on(ht.DISABLED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underEnabled",{get:function(){return!this.under(ht.DISABLED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isDisabled",{get:function(){return this.is(ht.DISABLED)},set:function(t){this.set(ht.DISABLED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inDisabled",{get:function(){return this.in(ht.DISABLED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onDisabled",{get:function(){return this.on(ht.DISABLED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underDisabled",{get:function(){return this.under(ht.DISABLED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isActionable",{get:function(){return!this.in(ht.DISABLED)&&!this.in(ht.READ_ONLY)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isGesturing",{get:function(){return this.is(ht.GESTURING)},set:function(t){this.set(ht.GESTURING,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inGesturing",{get:function(){return this.in(ht.GESTURING)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onGesturing",{get:function(){return this.on(ht.GESTURING)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underGesturing",{get:function(){return this.under(ht.GESTURING)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isFocused",{get:function(){return this.is(ht.FOCUSED)},set:function(t){this.set(ht.FOCUSED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inFocused",{get:function(){return this.in(ht.FOCUSED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onFocused",{get:function(){return this.on(ht.FOCUSED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underFocused",{get:function(){return this.under(ht.FOCUSED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isFocusRoot",{get:function(){return this.is(ht.FOCUS_ROOT)},set:function(t){this.set(ht.FOCUS_ROOT,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inFocusRoot",{get:function(){return this.in(ht.FOCUS_ROOT)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onFocusRoot",{get:function(){return this.on(ht.FOCUS_ROOT)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underFocusRoot",{get:function(){return this.under(ht.FOCUS_ROOT)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isFocusReverse",{get:function(){return this.is(ht.FOCUS_REVERSE)},set:function(t){this.set(ht.FOCUS_REVERSE,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inFocusReverse",{get:function(){return this.in(ht.FOCUS_REVERSE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onFocusReverse",{get:function(){return this.on(ht.FOCUS_REVERSE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underFocusReverse",{get:function(){return this.under(ht.FOCUS_REVERSE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isFocusable",{get:function(){return!this.is(ht.UNFOCUSABLE)},set:function(t){this.set(ht.UNFOCUSABLE,!t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inFocusable",{get:function(){return!this.in(ht.UNFOCUSABLE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onFocusable",{get:function(){return!this.on(ht.UNFOCUSABLE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underFocusable",{get:function(){return!this.under(ht.UNFOCUSABLE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isUnfocusable",{get:function(){return this.is(ht.UNFOCUSABLE)},set:function(t){this.set(ht.UNFOCUSABLE,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inUnfocusable",{get:function(){return this.in(ht.UNFOCUSABLE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onUnfocusable",{get:function(){return this.on(ht.UNFOCUSABLE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underUnfocusable",{get:function(){return this.under(ht.UNFOCUSABLE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isInvalid",{get:function(){return this.is(ht.INVALID)},set:function(t){this.set(ht.INVALID,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inInvalid",{get:function(){return this.in(ht.INVALID)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onInvalid",{get:function(){return this.on(ht.INVALID)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underInvalid",{get:function(){return this.on(ht.INVALID)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isSucceeded",{get:function(){return this.is(ht.SUCCEEDED)},set:function(t){this.set(ht.SUCCEEDED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inSucceeded",{get:function(){return this.in(ht.SUCCEEDED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onSucceeded",{get:function(){return this.on(ht.SUCCEEDED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underSucceeded",{get:function(){return this.under(ht.SUCCEEDED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isFailed",{get:function(){return this.is(ht.FAILED)},set:function(t){this.set(ht.FAILED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inFailed",{get:function(){return this.in(ht.FAILED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onFailed",{get:function(){return this.on(ht.FAILED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underFailed",{get:function(){return this.under(ht.FAILED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isWarned",{get:function(){return this.is(ht.WARNED)},set:function(t){this.set(ht.WARNED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inWarned",{get:function(){return this.in(ht.WARNED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onWarned",{get:function(){return this.on(ht.WARNED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underWarned",{get:function(){return this.on(ht.WARNED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isChanged",{get:function(){return this.is(ht.CHANGED)},set:function(t){this.set(ht.CHANGED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inChanged",{get:function(){return this.in(ht.CHANGED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onChanged",{get:function(){return this.on(ht.CHANGED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underChanged",{get:function(){return this.on(ht.CHANGED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isAlternated",{get:function(){return this.is(ht.ALTERNATED)},set:function(t){this.set(ht.ALTERNATED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inAlternated",{get:function(){return this.in(ht.ALTERNATED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onAlternated",{get:function(){return this.on(ht.ALTERNATED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underAlternated",{get:function(){return this.on(ht.ALTERNATED)},enumerable:!1,configurable:!0}),t.prototype.toObject=function(){var t=[];return this.J.forEach((function(n){t.push(n)})),{local:t}},t.prototype.toString=function(){return JSON.stringify(this.toObject())},t}(),ft=function(t){function n(n){var i=t.call(this)||this;return i.Z=n,i.q=0,i.$=!1,i.tt=!0,i}return B(n,t),n.prototype.lock=function(t){return this.q+=1,!1===t&&(this.tt=!1),this},n.prototype.unlock=function(){return this.q-=1,this.end()},Object.defineProperty(n.prototype,"saved",{get:function(){var t=this.nt;return null==t&&(t=new ct,this.nt=t),t},enumerable:!1,configurable:!0}),n.prototype.begin=function(){return this.tt&&!this.$&&(this.$=!0,this.saved.copy(this)),this},n.prototype.end=function(){return this.q<=0&&(this.tt=!0,this.$&&(this.$=!1,this.onChange(this,this.saved))),this},n.prototype.onChange=function(t,n){this.Z(t,n)},n}(ct),lt={CLICKED:"CLICKED",DBL_CLICKED:"DBL_CLICKED",DOWN:"DOWN",UP:"UP",UP_OUTSIDE:"UP_OUTSIDE",RIGHT_CLICKED:"RIGHT_CLICKED",RIGHT_DOWN:"RIGHT_DOWN",RIGHT_UP:"RIGHT_UP",RIGHT_UP_OUTSIDE:"RIGHT_UP_OUTSIDE",RIGHT_PRESSED:"RIGHT_PRESSED",ACTIVATED:"ACTIVATED",DEACTIVATED:"DEACTIVATED"},vt=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.onChange=function(n,i){n.isActive?i.isActive||this.J.add(lt.ACTIVATED).delete(lt.DEACTIVATED):i.isActive&&this.J.add(lt.DEACTIVATED).delete(lt.ACTIVATED),t.prototype.onChange.call(this,n,i)},Object.defineProperty(n.prototype,"isClicked",{get:function(){return this.is(lt.CLICKED)},set:function(t){this.set(lt.CLICKED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inClicked",{get:function(){return this.in(lt.CLICKED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onClicked",{get:function(){return this.on(lt.CLICKED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"underClicked",{get:function(){return this.under(lt.CLICKED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isDblClicked",{get:function(){return this.is(lt.DBL_CLICKED)},set:function(t){this.set(lt.DBL_CLICKED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inDblClicked",{get:function(){return this.in(lt.DBL_CLICKED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onDblClicked",{get:function(){return this.on(lt.DBL_CLICKED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"underDblClicked",{get:function(){return this.under(lt.DBL_CLICKED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isDown",{get:function(){return this.is(lt.DOWN)},set:function(t){this.set(lt.DOWN,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inDown",{get:function(){return this.in(lt.DOWN)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onDown",{get:function(){return this.on(lt.DOWN)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"underDown",{get:function(){return this.under(lt.DOWN)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isUp",{get:function(){return this.is(lt.UP)},set:function(t){this.set(lt.UP,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inUp",{get:function(){return this.in(lt.UP)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onUp",{get:function(){return this.on(lt.UP)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"underUp",{get:function(){return this.under(lt.UP)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isUpOutside",{get:function(){return this.is(lt.UP_OUTSIDE)},set:function(t){this.set(lt.UP_OUTSIDE,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inUpOutside",{get:function(){return this.in(lt.UP_OUTSIDE)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onUpOutside",{get:function(){return this.on(lt.UP_OUTSIDE)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"underUpOutside",{get:function(){return this.under(lt.UP_OUTSIDE)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isRightClicked",{get:function(){return this.is(lt.RIGHT_CLICKED)},set:function(t){this.set(lt.RIGHT_CLICKED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inRightClicked",{get:function(){return this.in(lt.RIGHT_CLICKED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onRightClicked",{get:function(){return this.on(lt.RIGHT_CLICKED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"underRightClicked",{get:function(){return this.under(lt.RIGHT_CLICKED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isRightDown",{get:function(){return this.is(lt.RIGHT_DOWN)},set:function(t){this.set(lt.RIGHT_DOWN,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inRightDown",{get:function(){return this.in(lt.RIGHT_DOWN)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onRightDown",{get:function(){return this.on(lt.RIGHT_DOWN)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"underRightDown",{get:function(){return this.under(lt.RIGHT_DOWN)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isRightUp",{get:function(){return this.is(lt.RIGHT_UP)},set:function(t){this.set(lt.RIGHT_UP,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inRightUp",{get:function(){return this.in(lt.RIGHT_UP)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onRightUp",{get:function(){return this.on(lt.RIGHT_UP)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"underRightUp",{get:function(){return this.under(lt.RIGHT_UP)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isRightUpOutside",{get:function(){return this.is(lt.RIGHT_UP_OUTSIDE)},set:function(t){this.set(lt.RIGHT_UP_OUTSIDE,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inRightUpOutside",{get:function(){return this.in(lt.RIGHT_UP_OUTSIDE)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onRightUpOutside",{get:function(){return this.on(lt.RIGHT_UP_OUTSIDE)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"underRightUpOutside",{get:function(){return this.under(lt.RIGHT_UP_OUTSIDE)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isRightPressed",{get:function(){return this.is(lt.RIGHT_PRESSED)},set:function(t){this.set(lt.RIGHT_PRESSED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inRightPressed",{get:function(){return this.in(lt.RIGHT_PRESSED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onRightPressed",{get:function(){return this.on(lt.RIGHT_PRESSED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"underRightPressed",{get:function(){return this.under(lt.RIGHT_PRESSED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isActivated",{get:function(){return this.is(lt.ACTIVATED)},set:function(t){this.set(lt.ACTIVATED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inActivated",{get:function(){return this.in(lt.ACTIVATED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onActivated",{get:function(){return this.on(lt.ACTIVATED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"underActivated",{get:function(){return this.under(lt.ACTIVATED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isDeactivated",{get:function(){return this.is(lt.DEACTIVATED)},set:function(t){this.set(lt.DEACTIVATED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inDeactivated",{get:function(){return this.in(lt.DEACTIVATED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onDeactivated",{get:function(){return this.on(lt.DEACTIVATED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"underDeactivated",{get:function(){return this.under(lt.DEACTIVATED)},enumerable:!1,configurable:!0}),n}(ft),bt=function(n){function i(i){var r=n.call(this)||this;return r.internalTransform=new t.Matrix,r.O=i,r}return B(i,n),i.prototype.onChange=function(){n.prototype.onChange.call(this),this.O.onTransformChange()},i.prototype.updateSkew=function(){n.prototype.updateSkew.call(this),this.O.onTransformChange()},i.prototype.getLocalIdCurrent=function(){return this._currentLocalID},i.prototype.getLocalId=function(){return this._localID},i.prototype.getParentId=function(){return this._parentID},i.prototype.getWorldId=function(){return this._worldID},i.prototype.updateTransform=function(t){var r=this._currentLocalID,e=this._worldID;n.prototype.updateTransform.call(this,t);var u=this._currentLocalID,s=this._worldID;if(r!==u){var h=this.localTransform,o=this.internalTransform;h.copyTo(o),t instanceof i&&o.prepend(t.internalTransform)}else e!==s&&(h=this.localTransform,o=this.internalTransform,t instanceof i&&(h.copyTo(o).prepend(t.internalTransform),this._currentLocalID+=1,this._localID=this._currentLocalID))},i}(t.Transform),dt=function(){function t(){this.x=0,this.y=0,this.width=0,this.height=0,this.strokeWidth=0,this.strokeScale=1,this.strokeAlign=0}return t.prototype.set=function(t,n,i,r,e,u,s){return this.x=t,this.y=n,this.width=i,this.height=r,this.strokeWidth=e,this.strokeScale=u,this.strokeAlign=s,this},t}(),gt=function(t,n,i,r){return-i<=t&&t<=+i&&-r<=n&&n<=+r},mt=function(t){for(var n=t.points,i="[".concat(t.direction),r=0,e=n.length,u=1;r<e;r+=1,u+=3){var s=n[r];i+=",".concat(s.color,",").concat(s.alpha,",").concat(s.position)}return i+"]"},wt={NONE:0,ID:1,POSITION:2,WIDTH:4,HEIGHT:8,ROTATION:16,SKEW:32,ALIGN:0,REPLACING:64,GROUPING:128,UNGROUPING:256,FILL:512,STROKE:1024,STROKE_SIDE:2048,BORDER_RADIUS:4096,TEXT:8192,TEXTURE:16384,TAG:32768,DATA:32768,DATA_MAPPING:1048576,ACTION:65536,CURSOR:131072,ORDER_IN_LAYER:262144,CHILDREN:524288,COORDINATE:62,SHAPE:1728,LAYER:262144,PRIMITIVE:1042175,GROUP:1042431,EMBEDDED:1417471,CONNECTOR:1041985,ALL:2097151},Ot=function(){function t(){this.added=wt.NONE,this.removed=wt.NONE,this.locked=wt.NONE}return t.prototype.add=function(t){return this.removed&=~t,this.added|=t,this},t.prototype.remove=function(t){return this.added&=~t,this.removed|=t,this},t.prototype.lock=function(t){return this.locked|=t,this},t.prototype.unlock=function(t){return this.locked&=~t,this},t.prototype.clear=function(){return this.added=wt.NONE,this.removed=wt.NONE,this.locked=wt.NONE,this},t.prototype.set=function(t,n,i){return null!=t&&(this.added=t),null!=n&&(this.removed=n),null!=i&&(this.locked=i),this},t.prototype.copy=function(t){return this.added=t.added,this.removed=t.removed,this.locked=t.locked,this},t}(),pt=function(n){function i(t){var i=n.call(this)||this;return i.id="",i.uuid=0,i.type=t,i.transform=i.newTransform(),i.it=0,i.rt=!1,i.action=new et,i.et=!0,i.ut=0,i.st=!1,i.ht=!1,i.ot=NaN,i.ct=NaN,i.ft=NaN,i.interactive=!1,i.parent=null,i.children=[],i.selected=!1,i.index=0,i.reference=0,i}return B(i,n),i.prototype.newTransform=function(){return new bt(this)},i.prototype.onSizeChange=function(){this.ot=NaN,this.ct=NaN,this.ft=NaN,this.lt(),this.updateUploaded();var t=this.vt;null!=t&&t.fit(!0);var n=this.runtime;null!=n&&n.onResize(this)},i.prototype.onTransformChange=function(){this.lt(),this.onParentTransformChange()},i.prototype.onParentTransformChange=function(){this.updateUploaded();var t=this.vt;null!=t&&t.fit(!0);for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].onParentTransformChange()},i.prototype.lt=function(){if(0===this.it){var t=this.parent;null!=t&&t.onChildTransformChange()}else this.rt=!0},i.prototype.disallowOnTransformChange=function(){this.it+=1,1===this.it&&(this.rt=!1)},i.prototype.allowOnTransformChange=function(t){this.it-=1,0===this.it&&this.rt&&(this.rt=!1,t&&this.onTransformChange())},i.prototype.onChildTransformChange=function(){},i.prototype.disallowUploadedUpdate=function(){this.ut+=1,1===this.ut&&(this.st=!1,this.ht=!1)},i.prototype.allowUploadedUpdate=function(){this.ut-=1,0===this.ut&&(this.ht?(this.ht=!1,this.st=!1,this.updateUploadedRecursively()):this.st&&(this.st=!1,this.updateUploaded()))},i.prototype.updateUploadedRecursively=function(){if(0===this.ut){this.updateUploaded();for(var t=this.children,n=0,i=t.length;n<i;++n)t[n].updateUploadedRecursively()}else this.ht=!0},i.prototype.updateUploaded=function(){if(0===this.ut){var t=this.uploaded;null!=t&&t.update(this)}else this.st=!0},Object.defineProperty(i.prototype,"image",{get:function(){return this.bt},set:function(t){this.bt=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"points",{get:function(){return this.gt},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"root",{get:function(){for(var t=this;t.parent instanceof i;)t=t.parent;return t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"connector",{get:function(){var t=this.vt;return null==t&&(t=new ut(this),this.vt=t),t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"visible",{get:function(){if(this.et){var t=this.parent;return!(t instanceof i)||t.visible}return!1},set:function(t){this.et!==t&&(this.et=t,this.updateUploadedRecursively())},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"worldVisible",{get:function(){if(this.et){var t=this.parent;return!t||t.worldVisible}return!1},enumerable:!1,configurable:!0}),i.prototype.toDirty=function(){var t=this.parent;null!=t&&t.toDirty()},i.prototype.attach=function(t,n){this.detach(),this.parent=t;var i=t.children;return null!=n&&0<=n&&n<i.length?i.splice(n,0,this):i.push(this),t.onChildTransformChange(),t.toDirty(),this.onAttach(),this},i.prototype.onAttach=function(){this.uploaded=void 0;var t=this.vt;t&&(t.attach(),t.fit(!0));for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].onAttach()},i.prototype.detach=function(){var t=this.parent;if(t){this.parent=null;var n=t.children,i=n.indexOf(this);0<=i&&(n.splice(i,1),t.onChildTransformChange(),t.toDirty(),this.onDetach())}return this},i.prototype.onDetach=function(){this.uploaded=void 0;var t=this.vt;t&&t.detach();for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].onDetach()},i.prototype.updateTransform=function(){var n=this.parent;n?(n.parent&&n.updateTransform(),this.transform.updateTransform(n.transform)):this.transform.updateTransform(t.Transform.IDENTITY)},i.prototype.serializeChildren=function(t){for(var n=this.children,i=[],r=0,e=n.length;r<e;++r){var u=n[r];i.push(u.serialize(t))}return i},i.prototype.serializeImage=function(t){var n=this.bt;return null!=n?t.addResource(n.src):-1},i.prototype.serializeGradient=function(t){var n=this.gradient;return null!=n?(null==n.serialized&&(n.serialized=mt(n)),t.addResource(n.serialized)):-1},i.prototype.serializeState=function(t){var n=this.state;return(this.interactive?1:0)|(n.isFocusable?0:2)|(n.isActive?4:0)},i.prototype.serialize=function(t){var n=this.transform,i=n.position,r=n.pivot,e=this.size,u=this.shortcut,s=null!=u?t.addResource(u):-1,h=this.cursor,o=null!=h?t.addResource(h):-1,a=this.title,c=null!=a?t.addResource(a):-1,f=wt.NONE,l=wt.NONE,v=wt.NONE,b=this.wt;return null!=b&&(f=b.added,l=b.removed,v=b.locked),[this.type,t.addResource(this.id),i.x,i.y,e.x,e.y,n.rotation,n.skew.x,this.fill.serialize(t),this.stroke.serialize(t),o,this.text.serialize(t),this.data.serialize(t),this.radius,this.corner,-1,-1,this.action.serialize(t),this.serializeImage(t),this.serializeGradient(t),this.serializeChildren(t),r.x,r.y,this.serializeState(t),s,c,this.uuid,f,l,v]},i.prototype.addUuid=function(t){this.uuid=t.addUuid(this.uuid);for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].addUuid(t)},i.prototype.updateUuid=function(t){this.uuid=t.updateUuid(this.uuid);for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].updateUuid(t)},i.prototype.getShapeScale=function(){var t=this.root.parent;return null!=t&&null!=t.getShapeScale?t.getShapeScale():1},i.prototype.getStrokeWidthScale=function(t){return t&s.NON_EXPANDING_WIDTH?t&s.NON_SHRINKING_WIDTH?this.getShapeScale():Math.min(1,this.getShapeScale()):t&s.NON_SHRINKING_WIDTH?Math.max(1,this.getShapeScale()):1},i.prototype.getHitTestSize=function(t){var n=this.size;return t.width=.5*n.x,t.height=.5*n.y,t},i.prototype.toHitTestData=function(t,n){var r,e=this.getHitTestSize(null!==(r=i.WORK_HIT_TEST_DATA)&&void 0!==r?r:i.WORK_HIT_TEST_DATA=new dt),u=e.width,s=e.height,h=this.transform.pivot,o=t-h.x,a=n-h.y,c=this.stroke,f=c.enable?c.width:0,l=this.getStrokeWidthScale(c.style),v=c.align,b=f*l*v;return e.set(0<=u?+o:-o,0<=s?+a:-a,Math.abs(u)+b,Math.abs(s)+b,f,l,v)},i.prototype.contains=function(t,n){var i=this.toHitTestData(t,n);return this.containsAbs(i.x,i.y,i.width,i.height,i.strokeWidth,i.strokeScale,i.strokeAlign)?this:this.containsText(t,n)||this.containsChildren(t,n)},i.prototype.containsText=function(t,n){var i=this.text;if(null!=i.atlas){var r=i.world;if(null!=r){var e=this.transform.internalTransform,u=e.a*t+e.c*n+e.tx-r[0],s=e.b*t+e.d*n+e.ty-r[1],h=r[2]*u+r[3]*s,o=r[4]*u+r[5]*s,a=r[6],c=r[7];if(0<=h&&h<=a&&0<=o&&o<=c)return this}}return null},i.prototype.containsChildren=function(t,n){for(var i=this.children,r=i.length-1;0<=r;--r){var e=i[r];e.updateTransform();var u=e.transform.localTransform,s=u.a,h=u.b,o=u.c,a=u.d,c=u.tx,f=u.ty,l=1/(s*a-o*h),v=(a*t-o*n+f*o-c*a)*l,b=(s*n-h*t-f*s+c*h)*l,d=e.contains(v,b);if(null!=d)return d}return null},i.prototype.containsBBox=function(t,n){var i=this.toHitTestData(t,n);return this.containsAbsBBox(i.x,i.y,i.width,i.height)},i.prototype.containsAbs=function(t,n,i,r,e,u,s){return this.containsAbsBBox(t,n,i,r)},i.prototype.containsAbsBBox=function(t,n,i,r){return gt(t,n,i,r)},i.prototype.select=function(t){return!1},i.prototype.toGlobal=function(t,n,i){return!0!==i&&this.updateTransform(),n.copyFrom(t),this.transform.worldTransform.apply(n,n),n},i.prototype.toLocal=function(n,i,r,e){return!0!==e&&this.updateTransform(),void 0===r&&(r=new t.Point),r.copyFrom(n),this.transform.worldTransform.applyInverse(r,r),r},i.prototype.getBounds=function(n,i){!0!==n&&this.updateTransform();var r=this._bounds||new t.Rectangle;this._bounds=r;var e=this.transform.getWorldId();return e!==this.ot&&(this.ot=e,this.Ot(this.transform.worldTransform,r)),i.copyFrom(r),i},i.prototype.getBoundsInternal=function(n,i){!0!==n&&this.updateTransform();var r=this.Dt||new t.Rectangle;this.Dt=r;var e=this.transform.getLocalIdCurrent();return e!==this.ct&&(this.ct=e,this.Ot(this.transform.internalTransform,r)),i.copyFrom(r),i},i.prototype.getBoundsLocal=function(n,i){!0!==n&&this.updateTransform();var r=this.Et||new t.Rectangle;this.Et=r;var e=this.transform.getLocalIdCurrent();return e!==this.ft&&(this.ft=e,this.Ot(this.transform.localTransform,r)),i.copyFrom(r),i},i.prototype.getBoundsSize=function(){return this.size},i.prototype.Ot=function(t,n){var i=this.transform.pivot,r=i.x,e=i.y,u=this.getBoundsSize(),s=.5*u.x,h=.5*u.y,o=t.a,a=t.b,c=t.c,f=t.d,l=-s+r,v=-h+e,b=o*l+c*v,d=a*l+f*v,g=o*(l=+s+r)+c*(v=-h+e),m=a*l+f*v,w=o*(l=-s+r)+c*(v=+h+e),O=a*l+f*v,p=o*(l=+s+r)+c*(v=+h+e),D=a*l+f*v,E=Math.min(b,g,w,p),M=Math.min(d,m,O,D),S=Math.max(b,g,w,p),T=Math.max(d,m,O,D);return n.x=E+t.tx,n.y=M+t.ty,n.width=S-E,n.height=T-M,n},i.prototype.destroy=function(){for(var t=this.children,n=t.length-1;0<=n;--n)t[n].destroy();t.length=0},i.prototype.onStateChange=function(t,n){var r=this.runtime;null!=r&&r.onStateChange(this,t,n);for(var e=this.children,u=0,s=e.length;u<s;++u){var h=e[u];h instanceof i&&h.state.onParentChange(t,n)}},Object.defineProperty(i.prototype,"state",{get:function(){var t=this,n=this.Mt;return null==n&&(n=new vt((function(n,i){t.onStateChange(n,i)})),this.Mt=n),n},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"capability",{get:function(){var t=this.wt;return null==t&&(t=new Ot,this.wt=t),t},enumerable:!1,configurable:!0}),i.prototype.getCapability=function(){return this.wt},i.prototype.focus=function(){return this.setFocused(!0),this},i.prototype.blur=function(){return this.setFocused(!1),this},i.prototype.setFocused=function(t){if(this.state.isFocused!==t){var n=rt.getLayer(this);n&&n.getFocusController().set(this,t)}},i.prototype.onKeyDown=function(t){var n=this.runtime;return!!n&&n.onKeyDown(this,t)},i.prototype.onKeyUp=function(t){var n=this.runtime;return!!n&&n.onKeyUp(this,t)},i.prototype.update=function(t){var n=this.runtime;n&&n.update(this,t)},i.prototype.onRender=function(t,n){var i=this.runtime;i&&i.onRender(this,t,n)},i.prototype.updateRecursively=function(t){this.update(t);for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].update(t)},i.prototype.copy=function(t,n){if(void 0===n&&(n=st.ALL),this.id=t.id,this.uuid=t.uuid,n&st.TRANSFORM){var r=this.transform,e=t.transform;r.position.copyFrom(e.position),r.rotation=e.rotation,r.skew.copyFrom(e.skew),r.pivot.copyFrom(e.pivot),r.scale.copyFrom(e.scale)}if(n&st.SIZE&&this.size.copyFrom(t.size),n&st.STYLE&&(this.fill.copy(t.fill),this.stroke.copy(t.stroke),this.text.copy(t.text),this.radius=t.radius,this.corner=t.corner),n&st.DATA&&this.data.copy(t.data),n&st.IMAGE&&(this.image=t.image),n&st.ACTION&&(this.action.clearAndAddAll(t.action.values),this.interactive=t.interactive,this.cursor=t.cursor,this.shortcut=t.shortcut),n&st.POINTS){var u=t.points;if(null!=u){var s=this.points;null!=s&&s.copy(u)}}if(n&st.STATE&&this.state.lock(!1).copy(t.state).unlock(),n&st.CONNECTOR)if(t instanceof i){var h=t.vt;h?this.connector.copy(h):(o=this.vt)&&o.clear()}else{var o;(o=this.vt)&&o.clear()}if(n&st.CAPABILITY){var a=t.getCapability();if(null!=a)this.capability.copy(a);else{var c=this.wt;null!=c&&c.clear()}}return this},i}(t.utils.EventEmitter),Dt=function(){function t(t,n,i,r,e,u,s,h){this.O=t,this.p=n,this.S=i,this.T=r,this.St=e,this.Tt=u,this.jt=s,this.B=h}return Object.defineProperty(t.prototype,"enable",{get:function(){return this.p},set:function(t){this.p!==t&&(this.p=t,this.O.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this.S},set:function(t){this.S!==t&&(this.S=t,this.O.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return this.T},set:function(t){this.T!==t&&(this.T=t,this.O.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.St},set:function(t){this.St!==t&&(this.St=t,this.O.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"align",{get:function(){return this.Tt},set:function(t){this.Tt!==t&&(this.Tt=t,this.O.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"side",{get:function(){return this.jt},set:function(t){this.jt!==t&&(this.jt=t,this.O.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"style",{get:function(){return this.B},set:function(t){this.B!==t&&(this.B=t,this.O.updateUploaded())},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){t&&this.set(t.enable,t.color,t.alpha,t.width,t.align,t.side,t.style)},t.prototype.set=function(t,n,i,r,e,u,s){var h=!1;void 0!==t&&this.p!==t&&(this.p=t,h=!0),void 0!==n&&this.S!==n&&(this.S=n,h=!0),void 0!==i&&this.T!==i&&(this.T=i,h=!0),void 0!==r&&this.St!==r&&(this.St=r,h=!0),void 0!==e&&this.Tt!==e&&(this.Tt=e,h=!0),void 0!==u&&this.jt!==u&&(this.jt=u,h=!0),void 0!==s&&this.B!==s&&(this.B=s,h=!0),h&&this.O.updateUploaded()},t.prototype.clone=function(){return new t(this.O,this.p,this.S,this.T,this.St,this.Tt,this.jt,this.B)},t.prototype.toObject=function(){return{enable:this.p,color:this.S,alpha:this.T,width:this.St,align:this.Tt,side:this.jt,style:this.B}},t.prototype.serialize=function(t){var n=this.p?1:0,i="[".concat(n,",").concat(this.S,",").concat(this.T,",").concat(this.St,",").concat(this.Tt,",").concat(this.jt,",").concat(this.B,"]");return t.addResource(i)},t.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getStroke(t);if(null!=r)this.set(!!r[0],r[1],r[2],r[3],r[4],r[5],r[6]);else{var e=JSON.parse(i[t]);n.setStroke(t,e),this.set(!!e[0],e[1],e[2],e[3],e[4],e[5],e[6])}}},t}(),Et={NONE:0,FROM:1,TO:2,FROM_TO:3},Mt=function(){function t(){this.Nt=Et.NONE,this.It=0,this.Ct=1}return Object.defineProperty(t.prototype,"type",{get:function(){return this.Nt},set:function(t){if(this.Nt!==t){this.Nt=t;var n=this.parent;null!=n&&(n.isChanged=!0)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"from",{get:function(){return this.It},set:function(t){if(this.It!==t){this.It=t;var n=this.parent;null!=n&&(n.isChanged=!0)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"to",{get:function(){return this.Ct},set:function(t){if(this.Ct!==t){this.Ct=t;var n=this.parent;null!=n&&(n.isChanged=!0)}},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n){var i=!1;if(void 0!==t&&void 0!==n)if(null!==t&&null!==n){var r=this.Nt|Et.FROM|Et.TO;this.Nt===r&&this.It===t&&this.Ct===n||(this.Nt=r,this.It=t,this.Ct=n,i=!0)}else null!==t?(r=(this.Nt|Et.FROM)&~Et.TO,this.Nt===r&&this.It===t||(this.Nt=r,this.It=t,i=!0)):null!==n?(r=(this.Nt|Et.TO)&~Et.FROM,this.Nt===r&&this.It===t||(this.Nt=r,this.Ct=n,i=!0)):(r=this.Nt&~(Et.TO|Et.FROM),this.Nt!==r&&(this.Nt=r,i=!0));else void 0!==t?null!==t?(r=this.Nt|Et.FROM,this.Nt===r&&this.It===t||(this.Nt=r,this.It=t,i=!0)):(r=this.Nt&~Et.FROM,this.Nt!==r&&(this.Nt=r,i=!0)):void 0!==n&&(null!==n?(r=this.Nt|Et.TO,this.Nt===r&&this.Ct===n||(this.Nt=r,this.Ct=n,i=!0)):(r=this.Nt&~Et.TO,this.Nt!==r&&(this.Nt=r,i=!0)));if(i){var e=this.parent;null!=e&&(e.isChanged=!0)}return i},t.prototype.normalize=function(t){var n=this.Nt,i=this.It,r=this.Ct;switch(n){case Et.FROM_TO:return(t-i)/(r-i);case Et.FROM:return t-i;case Et.TO:return r-t;case Et.NONE:default:return t}},t.prototype.isEquals=function(t){return this.Nt===t.type&&this.It===t.from&&this.Ct===t.to},t.prototype.copy=function(t){return this.At(t.type,t.from,t.to)},t.prototype.At=function(t,n,i){var r=!1;if(this.Nt!==t&&(this.Nt=t,r=!0),this.It!==n&&(this.It=n,r=!0),this.Ct!==i&&(this.Ct=i,r=!0),r){var e=this.parent;null!=e&&(e.isChanged=!0)}return this},t.prototype.toObject=function(){return{type:this.type,from:this.from,to:this.to}},t.prototype.serialize=function(t){var n="[".concat(this.Nt,",").concat(this.It,",").concat(this.Ct,"]");return t.addResource(n)},t.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getRange(t);if(null!=r)this.At(r[0],r[1],r[2]);else{var e=JSON.parse(i[t]);n.setRange(t,e),this.At(e[0],e[1],e[2])}}},t}(),St={ASCENDING:0,DESCENDING:1},Tt={BOOLEAN:7,BOOLEAN_ARRAY:8,NUMBER:0,NUMBER_ARRAY:1,STRING:2,STRING_ARRAY:3,OBJECT:4,OBJECT_ARRAY:5,TICKER:6,EXTENSION:1e3},jt={PRIVATE:0,PUBLIC:1,PROTECTED:2},Nt={UNKNOWN:-1,FOUND:0,NOT_FOUND:1,BAD_REQUEST:2,SERVER_ERROR:3,SERVICE_UNAVAILABLE:4,FORBIDDEN:5,NOT_DEFINED:6},It=function(t,n){return t-n},Ct=function(){function t(){this.id="",this.as="",this.type=Tt.NUMBER,this.scope=jt.PUBLIC,this.initial="",this.format="",this.range=new Mt,this.Rt=0,this.Lt=0,this.Mt=Nt.UNKNOWN,this.yt=0,this.kt=St.ASCENDING}return Object.defineProperty(t.prototype,"parent",{get:function(){return this.O},set:function(t){this.O!==t&&(this.O=t,this.range.parent=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this.Rt},set:function(t){var n=this.formatter;null!=n&&(t=n(t));var i=this.yt;if(i<=0){if(this.Rt!==t){this.Rt=t;var r=this.parent;null!=r&&(r.isChanged=!0)}}else{var e=this.L;null==e&&(e=[],this.L=e),this.Rt=t;var u=this.kt;u===St.ASCENDING?e.push(t):e.unshift(t);var s=e.length-i;if(0<s)if(u===St.ASCENDING)for(var h=0;h<s;++h)e.shift();else e.length=i;var o=this.parent;null!=o&&(o.isChanged=!0)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nvalue",{get:function(){return this.range.normalize(this.Rt)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"values",{get:function(){var t=this.L;return null==t&&(t=[],this.L=t),t},set:function(t){var n=t.length;if(0<n){var i=this.yt;if(i<=0){var r=t[n-1];if(null!=(s=this.formatter)&&(r=s(r)),this.Rt!==r){this.Rt=r;var e=this.parent;null!=e&&(e.isChanged=!0)}}else{var u=this.L;null==u&&(u=[],this.L=u);var s,h=this.kt;if(null!=(s=this.formatter))if(this.Rt=s(t[n-1]),h===St.ASCENDING)for(var o=0;o<n;++o)u.push(s(t[o]));else for(o=0;o<n;++o)u.unshift(s(t[o]));else if(this.Rt=t[n-1],h===St.ASCENDING)for(o=0;o<n;++o)u.push(t[o]);else for(o=0;o<n;++o)u.unshift(t[o]);var a=u.length-i;if(0<a)if(h===St.ASCENDING)for(o=0;o<a;++o)u.shift();else u.length=i;var c=this.parent;null!=c&&(c.isChanged=!0)}}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"time",{get:function(){return this.Lt},set:function(t){var n=this.yt;if(n<=0){if(this.Lt!==t){this.Lt=t;var i=this.parent;null!=i&&(i.isChanged=!0)}}else{var r=this.xt;null==r&&(r=[],this.xt=r),this.Lt=t;var e=this.kt;e===St.ASCENDING?r.push(t):r.unshift(t);var u=r.length-n;if(0<u)if(e===St.ASCENDING)for(var s=0;s<u;++s)r.shift();else r.length=n;var h=this.parent;null!=h&&(h.isChanged=!0)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"times",{get:function(){var t=this.xt;return null==t&&(t=[],this.xt=t),t},set:function(t){var n=t.length;if(0<n){var i=this.yt;if(i<=0){var r=t[n-1];if(this.Lt!==r){this.Lt=r;var e=this.parent;null!=e&&(e.isChanged=!0)}}else{var u=this.xt;null==u&&(u=[],this.xt=u),this.Lt=t[n-1];var s=this.kt;if(s===St.ASCENDING)for(var h=0;h<n;++h)u.push(t[h]);else for(h=0;h<n;++h)u.unshift(t[h]);var o=u.length-i;if(0<o)if(s===St.ASCENDING)for(h=0;h<o;++h)u.shift();else u.length=i;var a=this.parent;null!=a&&(a.isChanged=!0)}}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"state",{get:function(){return this.Mt},set:function(t){var n=this.yt;if(n<=0){if(this.Mt!==t){this.Mt=t;var i=this.parent;null!=i&&(i.isChanged=!0)}}else{var r=this.Bt;null==r&&(r=[],this.Bt=r),this.Mt=t;var e=this.kt;e===St.ASCENDING?r.push(t):r.unshift(t);var u=r.length-n;if(0<u)if(e===St.ASCENDING)for(var s=0;s<u;++s)r.shift();else r.length=n;var h=this.parent;null!=h&&(h.isChanged=!0)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"states",{get:function(){var t=this.Bt;return null==t&&(t=[],this.Bt=t),t},set:function(t){var n=t.length;if(0<n){var i=this.yt;if(i<=0){var r=t[n-1];if(this.Mt!==r){this.Mt=r;var e=this.parent;null!=e&&(e.isChanged=!0)}}else{var u=this.Bt;null==u&&(u=[],this.Bt=u),this.Mt=t[n-1];var s=this.kt;if(s===St.ASCENDING)for(var h=0;h<n;++h)u.push(t[h]);else for(h=0;h<n;++h)u.unshift(t[h]);var o=u.length-i;if(0<o)if(s===St.ASCENDING)for(h=0;h<o;++h)u.shift();else u.length=i;var a=this.parent;null!=a&&(a.isChanged=!0)}}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"capacity",{get:function(){return this.yt},set:function(t){if(this.yt<t)this.yt=t;else if(t<this.yt){this.yt=t;var n=!1,i=this.kt,r=this.L;if(null!=r&&0<(s=r.length-t)){if(i===St.ASCENDING)for(var e=0;e<s;++e)r.shift();else r.length=t;n=!0}var u=this.xt;if(null!=u&&0<(s=u.length-t)){if(i===St.ASCENDING)for(e=0;e<s;++e)u.shift();else u.length=t;n=!0}var s,h=this.Bt;if(null!=h&&0<(s=h.length-t)){if(i===St.ASCENDING)for(e=0;e<s;++e)h.shift();else h.length=t;n=!0}if(n){var o=this.parent;null!=o&&(o.isChanged=!0)}}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"order",{get:function(){return this.kt},set:function(t){this.kt=t},enumerable:!1,configurable:!0}),t.prototype.remove=function(t){var n=!1,i=this.L;null!=i&&0<=t&&t<i.length&&(i.splice(t,1),n=!0);var r=this.xt;null!=r&&0<=t&&t<r.length&&(r.splice(t,1),n=!0);var e=this.Bt;if(null!=e&&0<=t&&t<e.length&&(e.splice(t,1),n=!0),n){var u=this.parent;null!=u&&(u.isChanged=!0)}},t.prototype.removeAll=function(t){var n=!1,i=t.slice(0).sort(It),r=i.length,e=this.L;if(null!=e)for(var u=r-1;0<=u;--u)0<=(o=i[u])&&o<e.length&&(e.splice(o,1),n=!0);var s=this.xt;if(null!=s)for(u=r-1;0<=u;--u)0<=(o=i[u])&&o<s.length&&(s.splice(o,1),n=!0);var h=this.Bt;if(null!=h)for(u=r-1;0<=u;--u){var o;0<=(o=i[u])&&o<h.length&&(h.splice(o,1),n=!0)}if(n){var a=this.parent;null!=a&&(a.isChanged=!0)}},t.prototype.clear=function(){var t=!1,n=this.L;null!=n&&(n.length=0,t=!0);var i=this.xt;null!=i&&(i.length=0,t=!0);var r=this.Bt;if(null!=r&&(r.length=0,t=!0),t){var e=this.parent;null!=e&&(e.isChanged=!0)}},t.prototype.toDirty=function(){var t=this.parent;null!=t&&(t.isChanged=!0)},t.prototype.copy=function(t){return this.id=t.id,this.as=t.as,this.type=t.type,this.scope=t.scope,this.initial=t.initial,this.format=t.format,this.formatter=t.formatter,this.range.copy(t.range),this.Rt=t.value,this.Lt=t.time,this.Mt=t.state,this.yt=t.capacity,this},t.prototype.isEquals=function(t){return this.id===t.id&&this.as===t.as&&this.type===t.type&&this.scope===t.scope&&this.initial===t.initial&&this.formatter===t.formatter&&this.range.isEquals(t.range)},t.prototype.serialize=function(t){var n=t.addData(this.id),i=t.addResource(this.as),r=t.addResource(this.initial),e=t.addResource(this.format.trim()),u=this.range.serialize(t);return t.addResource("[".concat(n,",").concat(r,",").concat(e,",").concat(u,",").concat(this.yt,",").concat(this.kt,",").concat(this.type,",").concat(this.scope,",").concat(i,"]"))},t.prototype.deserialize=function(t,n){var i,r,e=n.resources;if(0<=t&&t<e.length){var u=n.getDataValue(t);null==u&&(u=JSON.parse(e[t]),n.setDataValue(t,u)),this.id=n.data[u[0]]||"";var s=u[8];this.as=null!=s&&e[s]||"",this.type=null!==(i=u[6])&&void 0!==i?i:Tt.NUMBER,this.scope=null!==(r=u[7])&&void 0!==r?r:jt.PUBLIC,this.initial=e[u[1]]||"",this.format=e[u[2]]||"",this.range.deserialize(u[3],n),this.yt=u[4],this.kt=u[5]}return this},t}(),At=function(){function t(){this.values=[]}return t.prototype.add=function(t,n){var i=this.values;return null!=n?i.splice(n,0,t):i.push(t),this},t.prototype.addAll=function(t){for(var n=this.values,i=0,r=t.length;i<r;++i)n.push(t[i]);return this},t.prototype.clearAndAdd=function(t){return this.clear(),this.add(t),this},t.prototype.clearAndAddAll=function(t){return this.clear(),this.addAll(t),this},t.prototype.indexOf=function(t){for(var n=this.values,i=0,r=n.length;i<r;++i)if((e=n[i])===t)return i;for(i=0,r=n.length;i<r;++i){var e;if((e=n[i])[0]===t[0]&&e[1]===t[1]&&e[2]===t[2])return i}return-1},t.prototype.get=function(t){var n=this.values;return 0<=t||t<n.length?n[t]:null},t.prototype.set=function(t,n){var i=this.values;if(0<=t||t<i.length){var r=i[t];return i[t]=n,r}return null},t.prototype.remove=function(t){var n=this.values;return 0<=t||t<n.length?n.splice(t,1)[0]:null},t.prototype.clear=function(){return this.values.length=0,this},t.prototype.size=function(){return this.values.length},t.prototype.swap=function(t,n){var i=this.values,r=i[n];return i[n]=i[t],i[t]=r,this},t.prototype.copy=function(t){this.clearAndAddAll(t.values)},t.prototype.serialize=function(t){var n=this.values;if(n.length<=0)return-1;for(var i="[",r="",e=0,u=n.length;e<u;++e){var s=n[e],h=t.addResource(s[0]),o=t.addResource(s[1]),a=t.addResource(s[2]);i+="".concat(r).concat(h,",").concat(o,",").concat(a),r=","}return i+="]",t.addResource(i)},t.prototype.deserialize=function(t,n){var i=this.values;i.length=0;var r=n.resources,e=r.length;if(0<=t&&t<e){var u=n.getDataMapping(t);null==u&&(u=JSON.parse(r[t]),n.setDataMapping(t,u));for(var s=0,h=u.length;s<h;s+=3){var o=u[s],a=u[s+1],c=u[s+2];i.push([0<=o&&o<e?r[o]:"",0<=a&&a<e?r[a]:"",0<=c&&c<e?r[c]:""])}}},t}(),Rt=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},Lt=function(){function t(){}return Object.defineProperty(t.prototype,"ids",{get:function(){var t=this.Pt;if(null==t)return[];var n=[];return t.forEach((function(t,i){n.push(i)})),n},enumerable:!1,configurable:!0}),t.prototype.add=function(t,n){var i,r=null!==(i=this.Pt)&&void 0!==i?i:this.Pt=new Map,e=r.get(t);null==e?r.set(t,[n]):e.push(n)},t.prototype.set=function(t,n,i,r,e,u){var s=this.Pt;if(null==s)return!1;var h=s.get(t);if(null==h)return!1;var o=h.length;if(o<=0)return!1;for(var a=0;a<o;++a){var c=h[a];c.range.set(e,u),void 0!==i&&(c.time=i),void 0!==r&&(c.state=r),c.value=n}return!0},t.prototype.toDirty=function(t){var n=this.Pt;if(null==n)return!1;var i=n.get(t);if(null==i)return!1;var r=i.length;if(r<=0)return!1;for(var e=0;e<r;++e)i[e].toDirty();return!0},t.prototype.each=function(t){var n=this.Pt;if(null==n)return null;var i=null;return n.forEach((function(n,r){null==i&&!1===t(r)&&(i=r)})),i},t}(),yt=function(){function t(){this.Pt=new Map}return t.prototype.set=function(t,n){return this.Pt.set(t,n),this},t.prototype.get=function(t){var n;return null!==(n=this.Pt.get(t))&&void 0!==n?n:null},t.prototype.contains=function(t){return this.Pt.has(t)},t.prototype.remove=function(t){var n=this.Pt,i=n.get(t);return n.delete(t),null!=i?i:null},t.prototype.clear=function(){return this.Pt.clear(),this},t.prototype.size=function(){return this.Pt.size},t.prototype.each=function(t){var n=!1;return this.Pt.forEach((function(i,r){n||!1===t(i,r)&&(n=!0)})),this},t.prototype.copy=function(t){var n=this.Pt;return n.clear(),t.each((function(t,i){n.set(i,t)})),this},t.prototype.serialize=function(t){var n=this.Pt;if(n.size<=0)return-1;var i=[];return n.forEach((function(n,r){var e=t.addResource(n),u=t.addResource(r);i.push(u,e)})),t.addResource(JSON.stringify(i))},t.prototype.deserialize=function(t,n){var i=this.Pt;i.clear();var r=n.resources,e=r.length;if(0<=t&&t<e){var u=n.getDataSystem(t);null==u&&(u=JSON.parse(r[t]),n.setDataSystem(t,u));for(var s=0,h=u.length;s<h;s+=2){var o=u[s];if(0<=o&&o<e){var a=r[o],c=u[s+1];0<=c&&c<e&&i.set(a,r[c])}}}},t}(),kt=function(){function t(){this.L=[],this.Ut=!0}return Object.defineProperty(t.prototype,"values",{get:function(){return this.L},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isChanged",{get:function(){return this.Ut},set:function(t){this.Ut=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"id",{get:function(){var t=this.L;return 0<t.length?t[0].id:""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"as",{get:function(){var t=this.L;return 0<t.length?t[0].as:""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){var t=this.L;return 0<t.length?t[0].type:Tt.NUMBER},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"scope",{get:function(){var t=this.L;return 0<t.length?t[0].scope:jt.PRIVATE},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"initial",{get:function(){var t=this.L;return 0<t.length?t[0].initial:""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"format",{get:function(){var t=this.L;return 0<t.length?t[0].format:""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"range",{get:function(){var t=this.L;return 0<t.length?t[0].range:null!=_?_:_=new Mt},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){var t=this.L;return 0<t.length?t[0].value:0},set:function(t){var n=this.L;0<n.length&&(n[0].value=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nvalue",{get:function(){var t=this.L;return 0<t.length?t[0].nvalue:0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"time",{get:function(){var t=this.L;return 0<t.length?t[0].time:0},set:function(t){var n=this.L;0<n.length&&(n[0].time=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"state",{get:function(){var t=this.L;return 0<t.length?t[0].state:Nt.UNKNOWN},set:function(t){var n=this.L;0<n.length&&(n[0].state=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"capacity",{get:function(){var t=this.L;return 0<t.length?t[0].capacity:0},set:function(t){var n=this.L;0<n.length&&(n[0].capacity=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alias",{get:function(){var t=this.Ft;return null==t&&(t=this.newAlias(),this.Ft=t),t},enumerable:!1,configurable:!0}),t.prototype.newAlias=function(){var t=this.L,n=t.length;if(0<n){for(var i={},r=0;r<n;++r){var e=t[r];i[e.as||e.id]=e}return i}return null!=P?P:P={}},Object.defineProperty(t.prototype,"mapping",{get:function(){var t=this.Gt;return null==t&&(t=this.newMapping(),this.Gt=t),t},enumerable:!1,configurable:!0}),t.prototype.newMapping=function(){return new At},t.prototype.getMapping=function(){return this.Gt},Object.defineProperty(t.prototype,"private",{get:function(){var t=this.Ht;return null==t&&(t=this.newPrivate(),this.Ht=t),t},enumerable:!1,configurable:!0}),t.prototype.newPrivate=function(){return new Lt},t.prototype.getPrivate=function(){return this.Ht},Object.defineProperty(t.prototype,"system",{get:function(){var t=this.zt;return null==t&&(t=this.newSystem(),this.zt=t),t},enumerable:!1,configurable:!0}),t.prototype.newSystem=function(){return new yt},t.prototype.getSystem=function(){return this.zt},t.prototype.add=function(t,n){var i=this.L;t.parent=this,void 0===n?i.push(t):i.splice(n,0,t)},t.prototype.set=function(t,n){var i=this.L;if(0<=t&&t<i.length){var r=i[t];return n.parent=this,i[t]=n,r.parent=void 0,r}return null},t.prototype.remove=function(t){var n=this.L;0<=t&&t<n.length&&(n.splice(t,1)[0].parent=void 0)},t.prototype.indexOf=function(t){for(var n=this.L,i=n.length,r=0;r<i;++r)if(n[r]===t)return r;for(r=0;r<i;++r)if(n[r].isEquals(t))return r;for(r=0;r<i;++r)if(n[r].id===t.id)return r;return-1},t.prototype.get=function(t){var n=this.L;return 0<=t&&t<n.length?n[t]:null},t.prototype.size=function(){return this.L.length},t.prototype.swap=function(t,n){var i=this.L,r=i[n];i[n]=i[t],i[t]=r},t.prototype.copy=function(t){var n=this.L;n.length=0;for(var i=0,r=t.size();i<r;++i){var e=t.get(i);if(null!=e){var u=(new Ct).copy(e);u.parent=this,n.push(u)}}var s=t.getMapping();s&&this.mapping.copy(s);var h=t.getSystem();return h&&this.system.copy(h),this},t.prototype.serialize=function(t){for(var n=this.L,i=[],r=0,e=n.length;r<e;++r)i.push(n[r].serialize(t));var u,s=this.Gt;return null!=s?(i.push(s.serialize(t)),null!=(u=this.zt)?t.addResource("[".concat(JSON.stringify(i),",").concat(u.serialize(t),"]")):t.addResource("[".concat(JSON.stringify(i),"]"))):null!=(u=this.zt)?(i.push(-1),t.addResource("[".concat(JSON.stringify(i),",").concat(u.serialize(t),"]"))):t.addResource(JSON.stringify(i))},t.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getData(t);null==r&&(r=JSON.parse(i[t]),n.setData(t,r));var e=this.L;if(e.length=0,this.isMapped(r)){for(var u=r[0],s=u.length,h=0,o=s-1;h<o;++h){var a=u[h];(l=new Ct).parent=this,l.deserialize(a,n),e.push(l)}var c=u[s-1];0<=c&&this.mapping.deserialize(c,n);var f=r[1];null!=f&&0<=f&&this.system.deserialize(f,n)}else for(h=0,o=r.length;h<o;++h){var l;a=r[h],(l=new Ct).parent=this,l.deserialize(a,n),e.push(l)}}},t.prototype.isMapped=function(t){return 0<t.length&&Rt(t[0])},t}(),xt=function(){function t(t,n,i){this.O=t,this.Vt=n,this.Wt=i}return Object.defineProperty(t.prototype,"horizontal",{get:function(){return this.Vt},set:function(t){this.Vt!==t&&(this.Vt=t,this.O.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"vertical",{get:function(){return this.Wt},set:function(t){this.Wt!==t&&(this.Wt=t,this.O.updateUploaded())},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){t&&this.set(t.horizontal,t.vertical)},t.prototype.set=function(t,n){var i=!1;null!=t&&this.Vt!==t&&(this.Vt=t,i=!0),null!=n&&this.Wt!==n&&(this.Wt=n,i=!0),i&&this.O.updateUploaded()},t.prototype.toObject=function(){return{horizontal:this.Vt,vertical:this.Wt}},t.prototype.serialize=function(t){return t.addResource("[".concat(this.Vt,",").concat(this.Wt,"]"))},t.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getAlign(t);if(null!=r)this.set(r[0],r[1]);else{var e=JSON.parse(i[t]);n.setAlign(t,e),this.set(e[0],e[1])}}},t}(),Bt=function(){function t(t,n,i){this.O=t,this.Vt=n,this.Wt=i}return Object.defineProperty(t.prototype,"horizontal",{get:function(){return this.Vt},set:function(t){this.Vt!==t&&(this.Vt=t,this.O.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"vertical",{get:function(){return this.Wt},set:function(t){this.Wt!==t&&(this.Wt=t,this.O.updateUploaded())},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){t&&this.set(t.horizontal,t.vertical)},t.prototype.set=function(t,n){var i=!1;null!=t&&this.Vt!==t&&(this.Vt=t,i=!0),null!=n&&this.Wt!==n&&(this.Wt=n,i=!0),i&&this.O.updateUploaded()},t.prototype.toObject=function(){return{horizontal:this.Vt,vertical:this.Wt}},t.prototype.serialize=function(t){return t.addResource("[".concat(this.Vt,",").concat(this.Wt,"]"))},t.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getMargin(t);if(null!=r)this.set(r[0],r[1]);else{var e=JSON.parse(i[t]);n.setMargin(t,e),this.set(e[0],e[1])}}},t}(),_t=function(){function t(t,n,i,r,e){this.O=t,this.p=n,this.S=i,this.T=r,this.St=e}return Object.defineProperty(t.prototype,"enable",{get:function(){return this.p},set:function(t){this.p!==t&&(this.p=t,this.O.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this.S},set:function(t){this.S!==t&&(this.S=t,this.O.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return this.T},set:function(t){this.T!==t&&(this.T=t,this.O.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.St},set:function(t){this.St!==t&&(this.St=t,this.O.updateUploaded())},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){t&&this.set(t.enable,t.color,t.alpha,t.width)},t.prototype.set=function(t,n,i,r){var e=!1;void 0!==t&&this.p!==t&&(this.p=t,e=!0),void 0!==n&&this.S!==n&&(this.S=n,e=!0),void 0!==i&&this.T!==i&&(this.T=i,e=!0),void 0!==r&&this.St!==r&&(this.St=r,e=!0),e&&this.O.updateUploaded()},t.prototype.clone=function(){return new t(this.O,this.p,this.S,this.T,this.St)},t.prototype.toObject=function(){return{enable:this.p,color:this.S,alpha:this.T,width:this.St}},t.prototype.serialize=function(t){var n="[".concat(this.p?1:0,",").concat(this.S,",").concat(this.T,",").concat(this.St,"]");return t.addResource(n)},t.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getTextOutline(t);if(null!=r)this.set(!!r[0],r[1],r[2],r[3]);else{var e=JSON.parse(i[t]);n.setTextOutline(t,e),this.set(!!e[0],e[1],e[2],e[3])}}},t}(),Pt=function(){function t(t,n,i,r,e,u){this.O=t,this.p=!0,this.Rt=n,this.S=i,this.T=r,this.Xt=e,this.j=u,this.Kt=d.NORMAL,this.align=new xt(t,m.CENTER,w.MIDDLE),this.offset=new Bt(t,0,0),this.B=g.NORMAL,this.spacing=new Bt(t,0,0),this.outline=new _t(t,!1,16777215,1,.5),this.Yt=O.LEFT_TO_RIGHT,this.padding=new Bt(t,10,10),this.Jt=!1}return Object.defineProperty(t.prototype,"enable",{get:function(){return this.p},set:function(t){this.p!==t&&(this.p=t,this.O.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this.Rt},set:function(t){if(this.Rt!==t){this.Rt=t;var n=this.O,i=n.uploaded;if(null==i||!i.isCompatible(n))return this.atlas=void 0,void n.toDirty();var r=this.atlas,e=r&&r.characters;if(null==e)return this.atlas=void 0,void n.toDirty();for(var u=0,s=t.length;u<s;++u)if(!(t[u]in e))return this.atlas=void 0,void n.toDirty();n.updateUploaded()}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"family",{get:function(){return this.Xt},set:function(t){this.Xt!==t&&(this.Xt=t,this.O.toDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this.S},set:function(t){this.S!==t&&(this.S=t,this.O.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return this.T},set:function(t){this.T!==t&&(this.T=t,this.O.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return this.j},set:function(t){this.j!==t&&(this.j=t,this.O.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"weight",{get:function(){return this.Kt},set:function(t){this.Kt!==t&&(this.Kt=t,this.O.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"style",{get:function(){return this.B},set:function(t){this.B!==t&&(this.B=t,this.O.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"direction",{get:function(){return this.Yt},set:function(t){this.Yt!==t&&(this.Yt=t,this.O.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"clipping",{get:function(){return this.Jt},set:function(t){this.Jt!==t&&(this.Jt=t,this.O.updateUploaded())},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){return t&&(this.set(t.value,t.color,t.alpha,t.family,t.size,t.weight,t.style,t.direction,t.clipping),this.align.copy(t.align),this.offset.copy(t.offset),this.outline.copy(t.outline),this.spacing.copy(t.spacing),this.padding.copy(t.padding)),this},t.prototype.set=function(t,n,i,r,e,u,s,h,o){var a=!1,c=!1;return null!=t&&this.Rt!==t&&(this.Rt=t,a=!0),null!=n&&this.S!==n&&(this.S=n,c=!0),null!=i&&this.T!==i&&(this.T=i,c=!0),null!=r&&this.Xt!==r&&(this.Xt=r,a=!0),null!=e&&this.j!==e&&(this.j=e,c=!0),null!=u&&this.Kt!==u&&(this.Kt=u,c=!0),null!=s&&this.B!==s&&(this.B=s,c=!0),null!=h&&this.Yt!==h&&(this.Yt=h,c=!0),null!=o&&this.Jt!==o&&(this.Jt=o,c=!0),a?this.O.toDirty():c&&this.O.updateUploaded(),this},t.prototype.toObject=function(){return{value:this.Rt,color:this.S,alpha:this.T,family:this.Xt,size:this.j,weight:this.Kt,align:this.align.toObject(),offset:this.offset.toObject(),style:this.B,outline:this.outline.toObject(),direction:this.Yt,spacing:this.spacing.toObject(),padding:this.padding.toObject(),clipping:this.Jt}},t.prototype.serialize=function(t){var n=t.addResource(this.Rt),i=t.addResource(this.Xt),r=this.align.serialize(t),e=this.offset.serialize(t),u=this.outline.serialize(t),s=this.spacing.serialize(t),h=this.padding.serialize(t),o="[".concat(n,",").concat(this.S,",").concat(this.T,",").concat(i,",").concat(this.j,",")+"".concat(this.Kt,",").concat(r,",").concat(e,",").concat(this.B,",").concat(u,",")+"".concat(s,",").concat(this.Yt,",").concat(h,",").concat(this.Jt?1:0,"]");return t.addResource(o)},t.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getText(t);null==r&&(r=JSON.parse(i[t]),n.setText(t,r)),this.set(i[r[0]]||"",r[1],r[2],i[r[3]]||"auto",r[4],r[5],r[8],r[11],!!r[13]),this.align.deserialize(r[6],n),this.offset.deserialize(r[7],n),this.outline.deserialize(r[9],n),this.spacing.deserialize(r[10],n),this.padding.deserialize(r[12],n)}},t}(),Ut=function(n){function i(t){var i=n.call(this,t)||this;i.size=i.newSize(),i.fill=i.newFill(),i.stroke=i.newStroke(),i.Zt=Y.RADIUS,i.qt=it.ALL;var r=new kt;return i.data=r,i.tag=r,i.text=i.newText(),i}return B(i,n),i.prototype.newSize=function(){var n=this;return new t.ObservablePoint((function(){n.onSizeChange()}),void 0,Y.SIZE_X,Y.SIZE_Y)},i.prototype.newFill=function(){return new Z(this,!0,Y.FILL_COLOR,Y.FILL_ALPHA)},i.prototype.newStroke=function(){return new Dt(this,!0,Y.STROKE_COLOR,Y.STROKE_ALPHA,Y.STROKE_WIDTH,Y.STROKE_ALIGN,Y.STROKE_SIDE,Y.STROKE_STYLE)},i.prototype.newText=function(){return new Pt(this,Y.TEXT_VALUE,Y.TEXT_COLOR,Y.TEXT_ALPHA,Y.TEXT_FAMILY,Y.TEXT_SIZE)},Object.defineProperty(i.prototype,"corner",{get:function(){return this.qt},set:function(t){this.qt!==t&&(this.qt=t,this.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"radius",{get:function(){return this.Zt},set:function(t){this.Zt!==t&&(this.Zt=t,this.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"image",{get:function(){return this.bt},set:function(t){if(this.bt!==t){null!=t?(this.bt=t,this.imageSrc=t.src):(this.bt=void 0,this.imageSrc=void 0);var n=this.parent;null!=n&&n.toDirty()}},enumerable:!1,configurable:!0}),i}(pt),Ft=function(t,n,i,r,e,u,s){if(t.fill.enable){if((c=n*n)*(o=e*e)+(f=i*i)*(h=r*r)<=h*o)return!0}else if(0<u){var h,o,a=u*s,c=n*n,f=i*i,l=Math.max(0,r-a),v=Math.max(0,e-a),b=l*l,d=v*v;if(b*d<=c*d+f*b&&c*(o=e*e)+f*(h=r*r)<=h*o)return!0}return!1},Gt={NONE:0,TOP:1,RIGHT:2,BOTTOM:4,LEFT:8,TOP_OR_LEFT:9,TOP_OR_RIGHT:3,BOTTOM_OR_LEFT:12,BOTTOM_OR_RIGHT:6,ALL:15},Ht=function(t,n,i,r,e,u,s){if(gt(n,i,r,e)){if(t.fill.enable)return!0;var h=t.stroke.side;if(0<u&&h!==Gt.NONE){var o=u*s,a=Math.max(0,r-o),c=Math.max(0,e-o);if(!gt(n,i,a,c))return!(h!==Gt.ALL&&!(n<=-a?i<=-c?h&Gt.TOP_OR_LEFT:+c<=i?h&Gt.BOTTOM_OR_LEFT:h&Gt.LEFT:+a<=n?i<=-c?h&Gt.TOP_OR_RIGHT:+c<=i?h&Gt.BOTTOM_OR_RIGHT:h&Gt.RIGHT:i<=-c?h&Gt.TOP:+c<=i&&h&Gt.BOTTOM))}}return!1},zt=function(t,n,i,r,e){return+i*t+r-n<=0&&-i*t+r-n<=0&&n<=e},Vt=function(t,n,i,r,e,u,s){var h=2*e/r;if(t.fill.enable){if(zt(n,i,h,-e,+e))return!0}else if(0<u){var o=u*s;if(zt(n,i,h,-e,+e)){var a=2*r*e/(r+Math.sqrt(r*r+4*e*e)),c=e-a,f=c+(-e-c)*Math.max(0,a-o)/a;if(!zt(n,i,h,f,e-o))return!0}}return!1},Wt=function(t,n,i){return.5*(i+t*n)},Xt=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getHitTestSize=function(n){var i=this.gt.formatted;if("boundary"in i){var r=i.boundary;n.width=Math.max(Math.abs(r[0]),Math.abs(r[2])),n.height=Math.max(Math.abs(r[1]),Math.abs(r[3]))}else t.prototype.getHitTestSize.call(this,n);return n},n.prototype.toMarkerSize=function(t){var n=0,i=t.getMarker();if(i){var r=i.head;if(r.type!==J.NONE){var e=r.size;n=Math.max(n,2*Math.max(Math.abs(e.x),Math.abs(e.y)))}var u=i.tail;u.type!==J.NONE&&(e=u.size,n=Math.max(n,2*Math.max(Math.abs(e.x),Math.abs(e.y))))}return n},n.prototype.containsAbsMarker=function(t,n,i,r,e,u){var s=t.type;if(s!==J.NONE){var h=t.transform,o=h.a,a=h.b,c=h.c,f=h.d,l=h.tx,v=h.ty,b=1/(o*f-c*a),d=(f*n-c*i+v*c-l*f)*b,g=(o*i-a*n-v*o+l*a)*b,m=t.size,w=.5*m.x,O=.5*m.y;w<0&&(w=-w,n=-n),O<0&&(O=-O,i=-i);var p=r*e*u;switch(w+=p,O+=p,s){case J.CIRCLE:return Ft(this,d,g,w,O,r,e);case J.TRIANGLE:return Vt(this,d,g,w,O,r,e);case J.RECTANGLE:return Ht(this,d,g,w,O,r,e)}}return!1},n.prototype.containsAbs=function(t,n,i,r,e,u,s){var h=this.gt,o=Wt(e,u,0),a=o+this.toMarkerSize(h);if(this.containsAbsBBox(t,n,i+a,r+a)){var c=h.getMarker();if(c){if(this.containsAbsMarker(c.head,t,n,e,u,s))return!0;if(this.containsAbsMarker(c.tail,t,n,e,u,s))return!0}var f=this.calcHitPointAbsHitTester;return h.calcHitPointAbs(t,n,i,r,o,null,f,null)}return!1},n.prototype.calcHitPart=function(t,n){var i=this.toHitTestData(t,n),r=i.strokeWidth,e=i.strokeScale,u=Wt(r,e,0),s=this.gt,h=u+this.toMarkerSize(s),o=i.x,a=i.y,c=i.width,f=i.height;if(this.containsAbsBBox(o,a,c+h,f+h)){var l=s.getMarker();if(l){var v=i.strokeAlign;if(this.containsAbsMarker(l.head,o,a,r,e,v))return nt.MARKER_HEAD;if(this.containsAbsMarker(l.tail,o,a,r,e,v))return nt.MARKER_TAIL}var b=this.calcHitPointAbsHitTester;if(s.calcHitPointAbs(o,a,c,f,u,null,b,null))return nt.LINE}return this.containsText(t,n)?nt.TEXT:this.containsChildren(t,n)?nt.CHILDREN:nt.NONE},n.prototype.calcHitPoint=function(t,n,i,r,e,u){var s=this.gt,h=this.toHitTestData(t,n),o=(i||Wt)(h.strokeWidth,h.strokeScale,0);return!!this.containsAbsBBox(h.x,h.y,h.width+o,h.height+o)&&s.calcHitPointAbs(h.x,h.y,h.width,h.height,o,r,e,u)},n.prototype.calcHitPointAbsHitTester=function(t,n,i,r,e,u,s,h,o){var a=e-i,c=u-r,f=t-i,l=n-r,v=a*a+c*c,b=a*f+c*l,d=f*f+l*l;if(1e-4<v){var g=Math.max(0,Math.min(1,b/v));if(v*g*g-2*b*g+d<h*h)return!0}return!1},n}(Ut),Kt=function(t){function n(n){void 0===n&&(n=r.BAR);var i=t.call(this,n)||this;return i.gt=new tt(i),i}return B(n,t),Object.defineProperty(n.prototype,"points",{get:function(){return this.gt},enumerable:!1,configurable:!0}),n.prototype.clone=function(){return new n(this.type).copy(this)},n.prototype.containsAbsBBox=function(n,i,r,e){var u=Math.max(0,this.gt.size);return t.prototype.containsAbsBBox.call(this,n,i,r+u,e+u)},n.prototype.serialize=function(n){var i=t.prototype.serialize.call(this,n);return i[15]=this.gt.serialize(n),i},n}(Xt),Yt=function(t){function n(n,i){var r=t.call(this,n,i,4,2)||this;return r.pointsId=NaN,r.pointsStyle=F.NONE,r}return B(n,t),n.prototype.init=function(t){var n=this.vertexOffset,i=this.indexOffset;t.updateClippings(),t.updateIndices(),c(t.clippings,n),f(t.indices,n,i)},n.prototype.update=function(t,n){this.updateVertexStepAndColorFill(t,n),this.updateColorStroke(t,n),this.updateUv(t,n)},n.prototype.updateVertexStepAndColorFill=function(t,n){if(n instanceof Kt){var i=n.size,r=i.x,e=i.y,u=r!==this.sizeX||e!==this.sizeY,s=n.stroke,h=s.enable?s.width:0,o=s.style,a=h!==this.strokeWidth||o!==this.strokeStyle,c=z(n),f=this.transformLocalId!==c,v=n.points,b=v.id,d=b!==this.pointsId,g=v.style,m=g!==this.pointsStyle;(u||f||a||d||m)&&(this.sizeX=r,this.sizeY=e,this.strokeWidth=h,this.strokeStyle=o,this.transformLocalId=c,this.pointsId=b,this.pointsStyle=g,d&&(this.textureTransformId=NaN),t.updateVertices(),t.updateSteps(),t.updateColorFills(),l(t.vertices,t.steps,t.colorFills,this.vertexOffset,v.values,v.size,h,o,n.transform.internalTransform))}},n.prototype.updateUv=function(t,n){var i=V(n),r=W(i);i===this.texture&&r===this.textureTransformId||(this.texture=i,this.textureTransformId=r,t.updateUvs(),v(t.uvs,this.vertexOffset,X(i)))},n}(H),Jt=function(){function n(t,n,i,r){this.vertexOffset=t,this.indexOffset=n,this.vertexCount=i,this.indexCount=r,this.sizeX=NaN,this.sizeY=NaN,this.transformLocalId=NaN,this.scaleX=1,this.scaleY=1,this.size=NaN,this.family="auto",this.value="",this.texture=null,this.textureTransformId=NaN,this.color=NaN,this.alpha=NaN,this.weight=NaN,this.style=NaN,this.alignHorizontal=NaN,this.alignVertical=NaN,this.offsetHorizontal=NaN,this.offsetVertical=NaN,this.outlineWidth=NaN,this.outlineColor=NaN,this.outlineAlpha=NaN,this.spacingHorizontal=NaN,this.spacingVertical=NaN,this.direction=NaN,this.paddingHorizontal=NaN,this.paddingVertical=NaN,this.clipping=!1}return n.prototype.init=function(t){var n=this.vertexCount;if(0<n){var i=this.vertexOffset;t.updateClippings(),S(t.clippings,i,n),t.updateIndices(),T(t.indices,i,this.indexOffset,this.indexCount)}},n.prototype.isCompatible=function(t){return 4*M(t)===this.vertexCount},n.prototype.update=function(t,n){if(0<this.vertexCount){var i=n.text.atlas;null!=i&&(this.updateVertex(t,n,i),this.updateColorFill(t,n),this.updateColorStroke(t,n),this.updateStep(t,n))}},n.prototype.updateVertex=function(n,i,r){var e=i.size,u=e.x,s=e.y,h=u!==this.sizeX||s!==this.sizeY,o=z(i),a=this.transformLocalId!==o,c=i.text,f=c.size,l=c.family,v=c.value,b=c.style,d=c.align.horizontal,g=c.align.vertical,m=c.offset.horizontal,w=c.offset.vertical,O=c.spacing.horizontal,p=c.spacing.vertical,D=c.direction,E=c.padding.horizontal,M=c.padding.vertical,S=c.clipping,T=c.texture||t.Texture.WHITE,j=W(T),N=v!==this.value||l!==this.family,C=f!==this.size,A=b!==this.style,R=d!==this.alignHorizontal||g!==this.alignVertical,L=m!==this.offsetHorizontal||w!==this.offsetVertical,y=O!==this.spacingHorizontal||p!==this.spacingVertical||E!==this.paddingHorizontal||M!==this.paddingVertical,k=D!==this.direction,x=this.clipping!==S,B=T!==this.texture||j!==this.textureTransformId;if(h||a||N||C||A||R||L||y||k||x||B){this.size=f,this.family=l,this.value=v,this.style=b,this.alignHorizontal=d,this.alignVertical=g,this.offsetHorizontal=m,this.offsetVertical=w,this.spacingHorizontal=O,this.spacingVertical=p,this.direction=D,this.paddingHorizontal=E,this.paddingVertical=M,this.clipping=S,this.texture=T,this.textureTransformId=j,C&&(this.weight=NaN),n.updateVertices(),n.updateUvs();var _=i.size,P=c.world;null==P&&(P=[0,0,0,0,0,0,0,0],c.world=P),I(n.vertices,n.uvs,this.vertexOffset,this.vertexCount,0,0,_.x,_.y,r,f,v,b,d,g,m,w,O,p,D,E,M,S,P,X(T),i.transform.internalTransform)}},n.prototype.updateColorFill=function(t,n){var i=n.text,r=i.color,e=n.visible&&i.enable?i.alpha:0;r===this.color&&e===this.alpha||(this.color=r,this.alpha=e,t.updateColorFills(),G(r,e,this.vertexOffset,this.vertexCount,t.colorFills))},n.prototype.updateColorStroke=function(t,n){var i=n.text,r=i.outline,e=r.color,u=n.visible&&i.enable?r.alpha:0;e===this.outlineColor&&u===this.outlineAlpha||(this.outlineColor=e,this.outlineAlpha=u,t.updateColorStrokes(),G(e,u,this.vertexOffset,this.vertexCount,t.colorStrokes))},n.prototype.updateStep=function(t,n){var i=n.text,r=i.outline,e=r.enable?r.width:0,u=e!==this.outlineWidth,s=i.weight,h=s!==this.weight,o=1,a=1,c=i.world;null!=c&&(o=c[8],a=c[9]);var f=D<Math.abs(this.scaleX-o)||D<Math.abs(this.scaleY-a);(h||u||f)&&(this.weight=s,this.outlineWidth=e,this.scaleX=o,this.scaleY=a,t.updateSteps(),j(t.steps,this.vertexOffset,this.vertexCount,i.atlas,i.size,e,s,this.scaleX,this.scaleY))},n.prototype.buildUnit=function(n){if(0<this.vertexCount){var i=this.texture||t.Texture.WHITE,r=i.baseTexture;r!==n.baseTexture&&(n.baseTexture=r,n.push(i,this.indexOffset))}},n}(),Zt=function(t,n,i,r,e){var s=M(n),h=4*s,o=2*s,a=4+h,c=2+o;return t.check(i,r,a,c)?new u(t,i,r,a,c,[new Yt(i,r),new Jt(i+4,r+2,h,o)]).init(n):null},qt=function(t,n,i){var r=t.length;if(n<r)return t;for(var e="",u=0,s=n-r;u<s;++u)e+=i;return e+t},Qt=function(){function t(){}return t.toCode=function(t){return qt(t.toString(16).toUpperCase(),6,"0")},t.fromCode=function(t){var n=t.trim().toLowerCase();if(6===n.length){var i=Number("0x".concat(n));if(i==i)return i}return null},t.fromRgb=function(t,n,i){return 255*t<<16|255*n<<8|255*i|0},t.blend=function(t,n,i){var r=t>>16&255,e=t>>8&255,u=255&(0|t),s=n>>16&255,h=n>>8&255,o=255&(0|n),a=Math.max(0,Math.min(1,i)),c=1-a;return Math.max(0,Math.min(255,r*c+s*a))<<16|Math.max(0,Math.min(255,e*c+h*a))<<8|0|Math.max(0,Math.min(255,u*c+o*a))},t.brighten=function(t,n){return 0<=n?this.blend(t,16777215,n):this.blend(t,0,-n)},t.darken=function(t,n){return 0<=n?this.blend(t,0,n):this.blend(t,16777215,-n)},t.toGrayscale=function(t){var n=this.toLuma(t);return n<<16|n<<8|n},t.toLuma=function(t){return.2126*(t>>16&255)+.7152*(t>>8&255)+.0722*(255&(0|t))&255},t}(),$t={NONE:0,POSITION_X:1,POSITION_Y:2,POSITION:3,ROTATION:4,COLOR_FILL:8,COLOR_STROKE:16,COLOR_FILL_AND_STROKE:24,COLOR_TEXT:32,COLOR_TEXT_OUTLINE:64,COLOR:120,VISIBILITY:128,HEIGHT:256,WIDTH:512,SIZE:768,TEXT:1024,CURSOR:2048},tn=function(){function t(){}return t.toBaseFill=function(t,n){return(n.written&$t.COLOR_FILL?t:n).fill},t.toBaseStroke=function(t,n){return(n.written&$t.COLOR_STROKE?t:n).stroke},t.toBaseText=function(t,n){return(n.written&$t.COLOR_TEXT?t:n).text},t.toBaseTextOutline=function(t,n){return(n.written&$t.COLOR_TEXT_OUTLINE?t:n).text.outline},t}(),nn={isInitializing:!1},rn=function(){function t(){}return t.from=function(t,n,i,r,e,u){if(t.trim().length<=0)return i;try{var s="try {with (shape) {with (state) {with (data.alias) {with (environment) {"+(e?"var result = (".concat(t,");")+"return (result != null ? ".concat(n,"(result) : null);"):"return ".concat(n,"(").concat(t,");"))+"}}}}} catch (e) {"+"return ".concat(r,";")+"}";return null==u?Function("shape","time","environment",s):Function("shape","time","environment",u,s)}catch(t){return i}},t.ofNumberOrNull=function(t){return this.from(t,"Number",this.NULL,"null",!0)},t.ofStringOrNull=function(t){return this.from(t,"String",this.NULL,"null",!0)},t.ofUnknown=function(t){return this.from(t,"",this.NULL,"null",!1)},t.ofNumber=function(t){return this.from(t,"Number",this.ZERO,"0",!1)},t.ofNumberOrOne=function(t){return this.from(t,"Number",this.ONE,"1",!1)},t.ofNumberOrOneHundred=function(t){return this.from(t,"Number",this.ONE_HUNDRED,"100",!1)},t.ofString=function(t){return this.from(t,"String",this.EMPTY,'""',!1)},t.ofBoolean=function(t){return this.from(t,"Boolean",this.TRUE,"true",!1)},t.ofBooleanOrTrue=function(t){return this.from(t,"Boolean",this.TRUE,"true",!1)},t.ofBooleanOrFalse=function(t){return this.from(t,"Boolean",this.FALSE,"false",!1)},t.ofElementOrNull=function(t){return this.from(t,"",void 0,"null",!1,"container")},t.NULL=function(){return null},t.ZERO=function(){return 0},t.ONE=function(){return 1},t.ONE_HUNDRED=function(){return 100},t.EMPTY=function(){return""},t.TRUE=function(){return!0},t.FALSE=function(){return!1},t}(),en=function(){function t(t){this.reset=t||$t.NONE}return t.prototype.initialize=function(t,n){},t.prototype.execute=function(t,n,i){},t.prototype.onResize=function(t,n){},t.prototype.onFocus=function(t,n){},t.prototype.onBlur=function(t,n){},t.prototype.onClick=function(t,n,i){},t.prototype.onDblClick=function(t,n,i,r){},t.prototype.onDowning=function(t,n,i){},t.prototype.onDown=function(t,n,i){},t.prototype.onMove=function(t,n,i){},t.prototype.onOver=function(t,n,i){},t.prototype.onOut=function(t,n,i){},t.prototype.onUp=function(t,n,i){},t.prototype.onUpOutside=function(t,n,i){},t.prototype.onPressed=function(t,n,i){},t.prototype.onUnpressed=function(t,n,i){},t.prototype.onKeyDown=function(t,n,i){},t.prototype.onKeyUp=function(t,n,i){},t.prototype.onRightClick=function(t,n,i){},t.prototype.onRightDowning=function(t,n,i){},t.prototype.onRightDown=function(t,n,i){},t.prototype.onRightUp=function(t,n,i){},t.prototype.onRightUpOutside=function(t,n,i){},t.prototype.onRightPressed=function(t,n,i){},t.prototype.onRightUnpressed=function(t,n,i){},t.prototype.onRender=function(t,n,i,r){},t}(),un=function(t){function n(n,i){var r=t.call(this,i)||this;return r.condition=rn.ofBoolean(n.condition),r}return B(n,t),n}(en),sn=function(t){function n(n,i){var r=t.call(this,n,i)||this;return r.interval=n.interval,r}return B(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,nn)){var r=this.interval,e=r<<1,u=i%e;u<r?(this.toOff(t,n),n.effect=i+(r-u)):(this.toOn(t,n),n.effect=i+(e-u))}},n.prototype.toOn=function(t,n){},n.prototype.toOff=function(t,n){},n}(un),hn=function(t){function n(n){return t.call(this,n,$t.COLOR)||this}return B(n,t),n.prototype.toOn=function(t,n){var i=tn.toBaseFill(t,n);t.fill.set(void 0,Qt.brighten(i.color,.5),i.alpha);var r=tn.toBaseStroke(t,n);t.stroke.set(void 0,Qt.brighten(r.color,.5),r.alpha);var e=tn.toBaseText(t,n);t.text.set(void 0,Qt.brighten(e.color,.5),e.alpha);var u=tn.toBaseTextOutline(t,n);t.text.outline.set(void 0,Qt.brighten(u.color,.5),u.alpha),n.written|=this.reset},n}(sn),on=function(t){function n(n){var i=t.call(this,n,$t.COLOR_FILL)||this;return i.color=n.color,i.alpha=n.alpha,i}return B(n,t),n.prototype.toOn=function(t,n){t.fill.set(void 0,this.color,this.alpha),n.written|=this.reset},n}(sn),an=function(t){function n(n){var i=t.call(this,n,$t.COLOR_STROKE)||this;return i.color=n.color,i.alpha=n.alpha,i}return B(n,t),n.prototype.toOn=function(t,n){t.stroke.set(void 0,this.color,this.alpha),n.written|=this.reset},n}(sn),cn=function(t){function n(n){return t.call(this,n,$t.COLOR)||this}return B(n,t),n.prototype.toOn=function(t,n){var i=tn.toBaseFill(t,n);t.fill.set(void 0,Qt.darken(i.color,.5),i.alpha);var r=tn.toBaseStroke(t,n);t.stroke.set(void 0,Qt.darken(r.color,.5),r.alpha);var e=tn.toBaseText(t,n);t.text.set(void 0,Qt.darken(e.color,.5),e.alpha);var u=tn.toBaseTextOutline(t,n);t.text.outline.set(void 0,Qt.darken(u.color,.5),u.alpha),n.written|=this.reset},n}(sn),fn=function(t){function n(n){return t.call(this,n,$t.COLOR_FILL_AND_STROKE)||this}return B(n,t),n.prototype.toOn=function(t,n){var i=tn.toBaseFill(t,n);t.fill.set(void 0,i.color,.5*i.alpha);var r=tn.toBaseStroke(t,n);t.stroke.set(void 0,r.color,.5*r.alpha),n.written|=this.reset},n}(sn),ln=function(t){function n(n){return t.call(this,n,$t.VISIBILITY)||this}return B(n,t),n.prototype.toOn=function(t,n){t.visible=!0,n.written|=this.reset},n.prototype.toOff=function(t,n){t.visible=!1,n.written|=this.reset},n}(sn),vn={VISIBILITY:0,BRIGHTEN:1,DARKEN:2,OPACITY:3,COLOR_FILL:4,COLOR_STROKE:5},bn=function(){function t(t,n){this.type=t,this.condition=n}return t.prototype.isEquals=function(t){return this.type===t.type&&this.condition===t.condition},t.prototype.toLabel=function(){return this.getTheme().toLabel(this)},t.prototype.getTheme=function(){var n;return null!==(n=t.THEME)&&void 0!==n?n:t.THEME=K.getInstance().get("EShapeActionValue")},t}(),dn=function(t){function n(n,i,r){var e=t.call(this,n,i)||this;return e.subtype=r,e}return B(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.subtype===i.subtype},n}(bn),gn={SHOW_HIDE:0,BLINK:1,TRANSFORM:2,OPEN:3,EMIT_EVENT:4,CHANGE_COLOR_LEGACY:5,CHANGE_TEXT:6,CHANGE_CURSOR:7,MISC:8,CHANGE_COLOR:9,GESTURE:10,EXTENSION:1e3},mn=function(t){return"number"==typeof t||"[object Number]"===Object.prototype.toString.call(t)},wn=function(){function t(){}return t.toResource=function(t,n,i){if(0<=t&&t<n.length){var r=n[t];if(mn(r)&&0<=r&&r<i.length)return i[r]}return""},t}(),On=function(t){function n(n,i,r,e,u){var s=t.call(this,gn.BLINK,i,n)||this;return s.interval=r,s.color=e,s.alpha=u,s}return B(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.interval===i.interval&&this.color===i.color&&this.alpha===i.alpha},n.prototype.toRuntime=function(){switch(this.subtype){case vn.BRIGHTEN:return new hn(this);case vn.COLOR_FILL:return new on(this);case vn.COLOR_STROKE:return new an(this);case vn.DARKEN:return new cn(this);case vn.OPACITY:return new fn(this);case vn.VISIBILITY:return new ln(this)}},n.prototype.serialize=function(t){var n=t.addResource(this.condition);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(this.interval,",").concat(this.color,",").concat(this.alpha,"]"))},n.deserialize=function(t,i){var r=wn.toResource(1,t,i.resources);return new n(t[2],r,t[3],t[4],t[5])},n}(dn),pn=function(){function t(){}return t.blend=function(t,n,i){var r=Math.max(0,Math.min(1,i));return Math.max(0,Math.min(1,t*(1-r)+n*r))},t}(),Dn=function(t){function n(n){return t.call(this,n,n.subtype<<3)||this}return B(n,t),n.prototype.set=function(t,n,i,r,e,u){var s=this.reset;if(null!=r){if(null!=e)if(null!=u){if(s&$t.COLOR_FILL){var h=tn.toBaseFill(t,n);t.fill.set(void 0,Qt.blend(h.color,r,u),pn.blend(h.alpha,e,u))}s&$t.COLOR_STROKE&&(h=tn.toBaseStroke(t,n),t.stroke.set(void 0,Qt.blend(h.color,r,u),pn.blend(h.alpha,e,u))),s&$t.COLOR_TEXT&&(h=tn.toBaseText(t,n),t.text.set(void 0,Qt.blend(h.color,r,u),pn.blend(h.alpha,e,u))),s&$t.COLOR_TEXT_OUTLINE&&(h=tn.toBaseTextOutline(t,n),t.text.outline.set(void 0,Qt.blend(h.color,r,u),pn.blend(h.alpha,e,u)))}else s&$t.COLOR_FILL&&t.fill.set(void 0,r,e),s&$t.COLOR_STROKE&&t.stroke.set(void 0,r,e),s&$t.COLOR_TEXT&&t.text.set(void 0,r,e),s&$t.COLOR_TEXT_OUTLINE&&t.text.outline.set(void 0,r,e);else null!=u?(s&$t.COLOR_FILL&&(h=tn.toBaseFill(t,n),t.fill.set(void 0,Qt.blend(h.color,r,u),h.alpha)),s&$t.COLOR_STROKE&&(h=tn.toBaseStroke(t,n),t.stroke.set(void 0,Qt.blend(h.color,r,u),h.alpha)),s&$t.COLOR_TEXT&&(h=tn.toBaseText(t,n),t.text.set(void 0,Qt.blend(h.color,r,u),h.alpha)),s&$t.COLOR_TEXT_OUTLINE&&(h=tn.toBaseTextOutline(t,n),t.text.outline.set(void 0,Qt.blend(h.color,r,u),h.alpha))):(s&$t.COLOR_FILL&&(h=tn.toBaseFill(t,n),t.fill.set(void 0,r,h.alpha)),s&$t.COLOR_STROKE&&(h=tn.toBaseStroke(t,n),t.stroke.set(void 0,r,h.alpha)),s&$t.COLOR_TEXT&&(h=tn.toBaseText(t,n),t.text.set(void 0,r,h.alpha)),s&$t.COLOR_TEXT_OUTLINE&&(h=tn.toBaseTextOutline(t,n),t.text.outline.set(void 0,r,h.alpha)));n.written|=s}else null!=e&&(null!=u?(s&$t.COLOR_FILL&&(h=tn.toBaseFill(t,n),t.fill.set(void 0,h.color,pn.blend(h.alpha,e,u))),s&$t.COLOR_STROKE&&(h=tn.toBaseStroke(t,n),t.stroke.set(void 0,h.color,pn.blend(h.alpha,e,u))),s&$t.COLOR_TEXT&&(h=tn.toBaseText(t,n),t.text.set(void 0,h.color,pn.blend(h.alpha,e,u))),s&$t.COLOR_TEXT_OUTLINE&&(h=tn.toBaseTextOutline(t,n),t.text.outline.set(void 0,h.color,pn.blend(h.alpha,e,u)))):(s&$t.COLOR_FILL&&(h=tn.toBaseFill(t,n),t.fill.set(void 0,h.color,e)),s&$t.COLOR_STROKE&&(h=tn.toBaseStroke(t,n),t.stroke.set(void 0,h.color,e)),s&$t.COLOR_TEXT&&(h=tn.toBaseText(t,n),t.text.set(void 0,h.color,e)),s&$t.COLOR_TEXT_OUTLINE&&(h=tn.toBaseTextOutline(t,n),t.text.outline.set(void 0,h.color,e))),n.written|=s)},n}(un),En={COLOR_AND_ALPHA:0,COLOR:1,ALPHA:2,CODE:3,BRIGHTNESS:4},Mn=function(t){function n(n){var i=t.call(this,n)||this;switch(n.target){case En.COLOR:i.color=n.color,i.alpha=null;break;case En.ALPHA:i.color=null,i.alpha=n.alpha;break;default:i.color=n.color,i.alpha=n.alpha}return i.blend=rn.ofNumberOrNull(n.blend),i}return B(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,nn)){var r=this.color,e=this.alpha,u=this.blend(t,i,nn);this.set(t,n,i,r,e,u)}},n}(Dn),Sn={NONE:0,FILL:1,STROKE:2,TEXT:4,TEXT_OUTLINE:8,FILL_AND_STROKE:3,ALL:15},Tn={FILL:0,STROKE:1,FILL_AND_STROKE:2,TEXT:3,TEXT_OUTLINE:4,ALL:5},jn=function(){function t(){}return t.from=function(t){if(t[0]===gn.CHANGE_COLOR)return t[2];switch(t[2]){case Tn.FILL:return Sn.FILL;case Tn.STROKE:return Sn.STROKE;case Tn.FILL_AND_STROKE:return Sn.FILL_AND_STROKE;case Tn.TEXT:return Sn.TEXT;case Tn.TEXT_OUTLINE:return Sn.TEXT_OUTLINE;case Tn.ALL:return Sn.ALL}},t.unpack=function(t){var n=[];return t&Sn.FILL&&n.push(Sn.FILL),t&Sn.STROKE&&n.push(Sn.STROKE),t&Sn.TEXT&&n.push(Sn.TEXT),t&Sn.TEXT_OUTLINE&&n.push(Sn.TEXT_OUTLINE),n},t.pack=function(t){for(var n=Sn.NONE,i=0,r=t.length;i<r;++i)n|=t[i];return n},t}(),Nn=function(t){function n(n,i,r,e,u,s){var h=t.call(this,gn.CHANGE_COLOR,i,n)||this;return h.target=r,h.color=e,h.alpha=u,h.blend=s,h}return B(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.target===i.target&&this.color===i.color&&this.alpha===i.alpha&&this.blend===i.blend},n.prototype.toRuntime=function(){return new Mn(this)},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.blend);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(this.target,",").concat(this.color,",").concat(this.alpha,",").concat(i,"]"))},n.deserialize=function(t,i){var r=jn.from(t),e=wn.toResource(1,t,i.resources),u=wn.toResource(6,t,i.resources);return new n(r,e,t[3],t[4],t[5],u)},n}(dn),In=function(t){function n(n){var i=t.call(this,n)||this;return i.brightness=rn.ofNumberOrNull(n.brightness),i}return B(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,nn)){var r=this.brightness(t,i,nn);this.set(t,n,i,r)}},n.prototype.set=function(t,n,i,r){var e=this.reset;if(null!=r){var u=this.toAdjusted;if(e&$t.COLOR_FILL){var s=tn.toBaseFill(t,n);t.fill.set(void 0,u(s.color,r),s.alpha)}e&$t.COLOR_STROKE&&(s=tn.toBaseStroke(t,n),t.stroke.set(void 0,u(s.color,r),s.alpha)),e&$t.COLOR_TEXT&&(s=tn.toBaseText(t,n),t.text.set(void 0,u(s.color,r),s.alpha)),e&$t.COLOR_TEXT_OUTLINE&&(s=tn.toBaseTextOutline(t,n),t.text.outline.set(void 0,u(s.color,r),s.alpha)),n.written|=e}},n.prototype.toAdjusted=function(t,n){return 0<=n?Qt.brighten(t,+n):Qt.darken(t,-n)},n}(Dn),Cn=function(t){function n(n,i,r){var e=t.call(this,gn.CHANGE_COLOR,i,n)||this;return e.brightness=r,e}return B(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.brightness===i.brightness},n.prototype.toRuntime=function(){return new In(this)},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=En.BRIGHTNESS,r=t.addResource(this.brightness);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(i,",").concat(r,"]"))},n.deserialize=function(t,i){return new n(jn.from(t),wn.toResource(1,t,i.resources),wn.toResource(4,t,i.resources))},n}(dn),An=function(t){function n(n){var i=t.call(this,n)||this;return i.color=rn.ofNumberOrNull(n.color),i.alpha=rn.ofNumberOrNull(n.alpha),i.blend=rn.ofNumberOrNull(n.blend),i}return B(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,nn)){var r=this.color(t,i,nn),e=this.alpha(t,i,nn),u=this.blend(t,i,nn);this.set(t,n,i,r,e,u)}},n}(Dn),Rn=function(t){function n(n,i,r,e,u){var s=t.call(this,gn.CHANGE_COLOR,i,n)||this;return s.color=r,s.alpha=e,s.blend=u,s}return B(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.color===i.color&&this.alpha===i.alpha&&this.blend===i.blend},n.prototype.toRuntime=function(){return new An(this)},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=En.CODE,r=t.addResource(this.color),e=t.addResource(this.alpha),u=t.addResource(this.blend);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(i,",").concat(r,",").concat(e,",").concat(u,"]"))},n.deserialize=function(t,i){return new n(jn.from(t),wn.toResource(1,t,i.resources),wn.toResource(4,t,i.resources),wn.toResource(5,t,i.resources),wn.toResource(6,t,i.resources))},n}(dn),Ln=function(t){function n(n){var i=t.call(this,n,$t.CURSOR)||this;return i.name=rn.ofStringOrNull(n.name),i}return B(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,nn)){var r=this.name(t,i,nn);null!=r&&(t.cursor=r,n.written|=this.reset)}},n}(un),yn=function(t){function n(n,i){var r=t.call(this,gn.CHANGE_CURSOR,n)||this;return r.name=i,r}return B(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.name===i.name},n.prototype.toRuntime=function(){return new Ln(this)},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.name);return t.addResource("[".concat(this.type,",").concat(n,",").concat(i,"]"))},n.deserialize=function(t,i){return new n(wn.toResource(1,t,i.resources),wn.toResource(2,t,i.resources))},n}(bn),kn=function(){function t(){}return t.prototype.format=function(t,n,i){return i.getHours()<12?"AM":"PM"},t}(),xn=function(){function t(){}return t.prototype.format=function(t,n,i){return i.getHours()<12?"am":"pm"},t}(),Bn=function(){function t(){}return t.prototype.format=function(t,n,i){return String(i.getDate())},t}(),_n=function(){function t(){}return t.prototype.format=function(t,n,i){return"".concat(0|t)},t}(),Pn=function(t){this.precision=null!=t?+t.substring(1,t.length):void 0},Un=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.format=function(t,n,i){return t.toExponential(this.precision)},n}(Pn),Fn=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.format=function(t,n,i){return t.toFixed(this.precision)},n}(Pn),Gn=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.format=function(t,n,i){var r=this.toAbs(t,n,i);return r<1e-24?this.Qt(t,1,""):r<1e-21?this.Qt(t,1e24,"y"):r<1e-18?this.Qt(t,1e21,"z"):r<1e-15?this.Qt(t,1e18,"a"):r<1e-12?this.Qt(t,1e15,"f"):r<1e-9?this.Qt(t,1e12,"p"):r<1e-6?this.Qt(t,1e9,"n"):r<.001?this.Qt(t,1e6,"μ"):r<1?this.Qt(t,1e3,"m"):r<1e3?this.Qt(t,1,""):r<1e6?this.Qt(t,.001,"k"):r<1e9?this.Qt(t,1e-6,"M"):r<1e12?this.Qt(t,1e-9,"G"):r<1e15?this.Qt(t,1e-12,"T"):r<1e18?this.Qt(t,1e-15,"P"):r<1e21?this.Qt(t,1e-18,"E"):r<1e24?this.Qt(t,1e-21,"Z"):this.Qt(t,1e-24,"Y")},n.prototype.toAbs=function(t,n,i){return Math.abs(t)},n.prototype.Qt=function(t,n,i){return"".concat((t*n).toFixed(this.precision)).concat(i)},n}(Pn),Hn=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.format=function(t,n,i){return t.toPrecision(this.precision)},n}(Pn),zn=function(){function t(){}return t.prototype.format=function(t,n,i){return String(i.getHours())},t}(),Vn=function(){function t(){}return t.prototype.format=function(t,n,i){return String(i.getHours()%12)},t}(),Wn=function(){function t(){}return t.prototype.format=function(t,n,i){return String(i.getMonth()+1)},t}(),Xn=function(){function t(){}return t.prototype.format=function(t,n,i){return String(i.getMinutes())},t}(),Kn=function(){function t(){}return t.prototype.format=function(t,n,i){return String(i.getMilliseconds())},t}(),Yn=function(){function t(){}return t.prototype.format=function(t,n,i){return"".concat(100*t|0,"%")},t}(),Jn=function(){function t(){}return t.prototype.format=function(t,n,i){return"".concat(0|t,"%")},t}(),Zn=function(){function t(t,n,i){this.length=t,this.character=n,this.node=i}return t.prototype.format=function(t,n,i){return qt(this.node.format(t,n,i),this.length,this.character)},t}(),qn=function(){function t(t){this.node=t}return t.prototype.format=function(t,n,i){var r=this.node.format(t,n,i);return 0<r.length&&"-"===r[0]?"(".concat(r.substring(1,r.length),")"):r},t}(),Qn=function(){function t(t){this.node=t}return t.prototype.format=function(t,n,i){var r=this.node.format(t,n,i);return 0<r.length&&"-"!==r[0]?"+".concat(r):r},t}(),$n=function(){function t(){}return t.prototype.format=function(t,n,i){return"".concat(Math.round(100*t),"%")},t}(),ti=function(){function t(){}return t.prototype.format=function(t,n,i){return"".concat(Math.round(t),"%")},t}(),ni=function(){function t(t,n,i,r,e,u,s){this.Y=t,this.M=n,this.D=i,this.H=r,this.m=e,this.s=u,this.mi=s}return t.prototype.format=function(t,n,i){if(n<1e3)return"".concat(this.s.format(t,n,i),".").concat(this.mi.format(t,n,i));if(n<6e4)return"".concat(this.m.format(t,n,i),":").concat(this.s.format(t,n,i));if(n<36e5)return"".concat(this.H.format(t,n,i),":").concat(this.m.format(t,n,i));if(n<864e5){var r=this.M.format(t,n,i),e=this.D.format(t,n,i);return"".concat(r,"/").concat(e," ").concat(this.H.format(t,n,i))}return n<2592e6?"".concat(this.M.format(t,n,i),"/").concat(this.D.format(t,n,i)):"".concat(this.Y.format(t,n,i),"/").concat(this.M.format(t,n,i))},t}(),ii=function(){function t(t){this.node=t}return t.prototype.format=function(t,n,i){var r=this.node.format(t,n,i);return 0<r.length&&"-"!==r[0]?" ".concat(r):r},t}(),ri=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.toAbs=function(t,n,i){return Math.abs(n)},n}(Gn),ei=function(){function t(t){this.str=t}return t.prototype.format=function(t,n,i){return this.str},t}(),ui=function(){function t(){}return t.prototype.format=function(t,n,i){return String(i.getFullYear())},t}(),si=function(){function t(){}return t.prototype.format=function(t,n,i){return String(i.getFullYear()%100)},t}(),hi=function(){function t(){}return t.prototype.format=function(t,n,i){var r=i.getTimezoneOffset(),e=r<=0?"+":"-",u=qt(String(Math.floor(Math.abs(r)/60)),2,"0"),s=qt(String(Math.floor(Math.abs(r)%60)),2,"0");return"".concat(e).concat(u,":").concat(s)},t}(),oi=function(){function t(){}return t.prototype.format=function(t,n,i){return"".concat(Math.round(t))},t}(),ai=function(){function t(){}return t.prototype.format=function(t,n,i){return String(i.getSeconds())},t}(),ci=void 0,fi=function(t,n,i){switch(t){case"_":return new Zn(n," ",i);case"-":return i;default:return new Zn(n,"0",i)}},li=function(t,n){switch(t){case"_":return new ii(n);case"+":return new Qn(n);case"(":return new qn(n);default:return n}},vi=function(){function t(t){var n=function(t){for(var n=0,i=!1,r=[],e=function(){var t=ci;return t?t.lastIndex=0:ci=t=/%(0|_|-|\+|\()?(\.\d+)?(Y(?:MD?)?|y(?:MD?)?|MD?|D|H(?:ms?)?|h(?:ms?)?|m(?:i|s)?|a|A|s(?:s?i|dt)?|z|%|f(?:si)?|e|g|d|r(?:d|p)|p|P|RP)/g,t}();;){var u=e.exec(t);if(null==u){n<t.length&&r.push(new ei(t.substring(n,t.length)));break}var s=u.index;n<s&&r.push(new ei(t.substring(n,s))),n=s+u[0].length;var h=u[0],o=u[1],a=u[2];switch(u[3]){case"Y":i=!0,r.push(new ui);break;case"YM":i=!0,r.push(new ui,new ei("/"),fi(o,2,new Wn));break;case"YMD":i=!0,r.push(new ui,new ei("/"),fi(o,2,new Wn),new ei("/"),fi(o,2,new Bn));break;case"y":i=!0,r.push(fi(o,2,new si));break;case"yM":i=!0,r.push(fi(o,2,new si),new ei("/"),fi(o,2,new Wn));break;case"yMD":r.push(fi(o,2,new si),new ei("/"),fi(o,2,new Wn),new ei("/"),fi(o,2,new Bn));break;case"M":i=!0,r.push(fi(o,2,new Wn));break;case"MD":i=!0,r.push(fi(o,2,new Wn),new ei("/"),fi(o,2,new Bn));break;case"D":i=!0,r.push(fi(o,2,new Bn));break;case"H":i=!0,r.push(fi(o,2,new zn));break;case"Hm":i=!0,r.push(fi(o,2,new zn),new ei(":"),fi(o,2,new Xn));break;case"Hms":i=!0,r.push(fi(o,2,new zn),new ei(":"),fi(o,2,new Xn),new ei(":"),fi(o,2,new ai));break;case"h":i=!0,r.push(fi(o,2,new Vn));break;case"hm":i=!0,r.push(fi(o,2,new Vn),new ei(":"),fi(o,2,new Xn));break;case"hms":i=!0,r.push(fi(o,2,new Vn),new ei(":"),fi(o,2,new Xn),new ei(":"),fi(o,2,new ai));break;case"m":i=!0,r.push(fi(o,2,new Xn));break;case"ms":i=!0,r.push(fi(o,2,new Xn),new ei(":"),fi(o,2,new ai));break;case"mi":i=!0,r.push(fi(o,3,new Kn));break;case"a":i=!0,r.push(new xn);break;case"A":i=!0,r.push(new kn);break;case"s":i=!0,r.push(fi(o,2,new ai));break;case"sdt":i=!0,r.push(new ni(new ui,fi(o,2,new Wn),fi(o,2,new Bn),fi(o,2,new zn),fi(o,2,new Xn),fi(o,2,new ai),fi(o,3,new Kn)));break;case"z":i=!0,r.push(new hi);break;case"%":r.push(new ei("%"));break;case"f":r.push(li(o,new Fn(a)));break;case"e":r.push(li(o,new Un(a)));break;case"g":r.push(li(o,new Hn(a)));break;case"rd":r.push(li(o,new oi));break;case"d":r.push(li(o,new _n));break;case"P":r.push(li(o,new Yn));break;case"p":r.push(li(o,new Jn));break;case"RP":r.push(li(o,new $n));break;case"rp":r.push(li(o,new ti));break;case"fsi":r.push(li(o,new Gn(a)));break;case"ssi":r.push(li(o,new ri(a)));break;default:r.push(new ei(h))}}return{nodes:r,date:i}}(t);this.date=n.date,this.nodes=n.nodes}return t.prototype.format=function(n,i){var r=this.nodes,e=t.DATE;null==e&&(e=new Date,t.DATE=e),this.date&&e.setTime(n);for(var u="",s=0,h=r.length;s<h;++s)u+=r[s].format(n,i,e);return u},t}(),bi=function(){function t(){}return t.create=function(t){return new vi(t)},t}(),di=function(t){function n(n){var i=t.call(this,n,$t.TEXT)||this;return i.number=rn.ofNumber(n.value),i.formatters=new Map,i}return B(n,t),n.prototype.getFormatter=function(t,n){var i=this.formatters,r=n.text.value,e=i.get(r);return void 0===e&&(e=this.newFormatter(r),i.set(r,e)),e},n.prototype.newFormatter=function(t){return 0<(t=t.trim()).length?bi.create(t):null},n.prototype.execute=function(t,n,i){if(this.condition(t,i,nn)){var r=this.number(t,i,nn),e=this.getFormatter(t,n);t.text.value=null!=e?e.format(r,0):String(r),n.written|=this.reset}},n}(un),gi=function(t){function n(n){var i=t.call(this,n,$t.TEXT)||this;return i.text=rn.ofString(n.value),i}return B(n,t),n.prototype.execute=function(t,n,i){this.condition(t,i,nn)&&(t.text.value=this.text(t,i,nn),n.written|=this.reset)},n}(un),mi={TEXT:0,NUMBER:1},wi=function(t){function n(n,i,r){var e=t.call(this,gn.CHANGE_TEXT,i,n)||this;return e.value=r,e}return B(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.value===i.value},n.prototype.toRuntime=function(){switch(this.subtype){case mi.TEXT:return new gi(this);case mi.NUMBER:return new di(this)}},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.value);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(i,"]"))},n.deserialize=function(t,i){var r=wn.toResource(1,t,i.resources),e=wn.toResource(3,t,i.resources);return new n(t[2],r,e)},n}(dn),Oi=function(){function t(t,n,i){this.$t=t,this.tn=i;var r=null==n?void 0:n.background;r&&(this.S=r.color,this.T=r.alpha)}return t.prototype.getTheme=function(){return this.$t},t.prototype.setTheme=function(t){this.$t=t},t.prototype.getColor=function(t){var n=this.S;if(void 0!==n){if(!ot(n))return n;var i=n(t);if(void 0!==i)return i}return this.$t.getBackgroundColor(t)},Object.defineProperty(t.prototype,"color",{get:function(){return this.S},set:function(t){this.S!==t&&(this.S=t,this.onChange())},enumerable:!1,configurable:!0}),t.prototype.getAlpha=function(t){var n=this.T;if(void 0!==n){if(!ot(n))return n;var i=n(t);if(void 0!==i)return i}return this.$t.getBackgroundAlpha(t)},Object.defineProperty(t.prototype,"alpha",{get:function(){return this.T},set:function(t){this.T!==t&&(this.T=t,this.onChange())},enumerable:!1,configurable:!0}),t.prototype.onChange=function(){var t=this.tn;null!=t&&t()},t}(),pi={NONE:0,TOP:1,RIGHT:2,BOTTOM:4,LEFT:8,TOP_RIGHT:3,TOP_BOTTOM:5,TOP_LEFT:9,RIGHT_BOTTOM:6,RIGHT_LEFT:10,BOTTOM_LEFT:12,NOT_TOP:14,NOT_RIGHT:13,NOT_BOTTOM:11,NOT_LEFT:7,ALL:15},Di=function(t,n){return at(t)?n[t]:t},Ei=function(){function t(t,n,i){this.$t=t,this.tn=i;var r=null==n?void 0:n.border;r&&(this.S=r.color,this.T=r.alpha,this.St=r.width,this.Tt=r.align,this.nn=Di(r.mask,pi))}return t.prototype.getTheme=function(){return this.$t},t.prototype.setTheme=function(t){this.$t=t},t.prototype.getColor=function(t){var n=this.S;if(void 0!==n){if(!ot(n))return n;var i=n(t);if(void 0!==i)return i}return this.$t.getBorderColor(t)},Object.defineProperty(t.prototype,"color",{get:function(){return this.S},set:function(t){this.S!==t&&(this.S=t,this.onChange())},enumerable:!1,configurable:!0}),t.prototype.getAlpha=function(t){var n=this.T;if(void 0!==n){if(!ot(n))return n;var i=n(t);if(void 0!==i)return i}return this.$t.getBorderAlpha(t)},Object.defineProperty(t.prototype,"alpha",{get:function(){return this.T},set:function(t){this.T!==t&&(this.T=t,this.onChange())},enumerable:!1,configurable:!0}),t.prototype.getWidth=function(t){var n=this.St;if(void 0!==n){if(!ot(n))return n;var i=n(t);if(void 0!==i)return i}return this.$t.getBorderWidth(t)},Object.defineProperty(t.prototype,"width",{get:function(){return this.St},set:function(t){this.St!==t&&(this.St=t,this.onChange())},enumerable:!1,configurable:!0}),t.prototype.getAlign=function(t){var n=this.Tt;if(void 0!==n){if(!ot(n))return n;var i=n(t);if(void 0!==i)return i}return this.$t.getBorderAlign(t)},Object.defineProperty(t.prototype,"align",{get:function(){return this.Tt},set:function(t){this.Tt!==t&&(this.Tt=t,this.onChange())},enumerable:!1,configurable:!0}),t.prototype.getMask=function(t){var n=this.nn;if(void 0!==n){if(!ot(n))return n;var i=n(t);if(void 0!==i)return i}return this.$t.getBorderMask(t)},Object.defineProperty(t.prototype,"mask",{get:function(){return this.nn},set:function(t){this.nn!==t&&(this.nn=t,this.onChange())},enumerable:!1,configurable:!0}),t.prototype.onChange=function(){var t=this.tn;null!=t&&t()},t}(),Mi={NONE:0,TOP_LEFT:1,TOP_RIGHT:2,BOTTOM_LEFT:4,BOTTOM_RIGHT:8,TOP:3,BOTTOM:12,LEFT:5,RIGHT:10,ALL:15},Si=function(){function t(t,n,i){this.$t=t,this.tn=i;var r=null==n?void 0:n.corner;r&&(mn(r)?(this.Zt=r,this.nn=void 0):(this.Zt=r.radius,this.nn=Di(r.mask,Mi)))}return t.prototype.getTheme=function(){return this.$t},t.prototype.setTheme=function(t){this.$t=t},t.prototype.getRadius=function(){var t;return null!==(t=this.Zt)&&void 0!==t?t:this.$t.getCornerRadius()},Object.defineProperty(t.prototype,"radius",{get:function(){return this.Zt},set:function(t){if(this.Zt!==t){this.Zt=t;var n=this.tn;null!=n&&n()}},enumerable:!1,configurable:!0}),t.prototype.getMask=function(){var t;return null!==(t=this.nn)&&void 0!==t?t:this.$t.getCornerMask()},Object.defineProperty(t.prototype,"mask",{get:function(){return this.nn},set:function(t){if(this.nn!==t){this.nn=t;var n=this.tn;null!=n&&n()}},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n){var i=!1;this.Zt!==t&&(this.Zt=t,i=!0),this.nn!==n&&(this.nn=n,i=!0);var r=this.tn;i&&null!=r&&r()},t}(),Ti={NONE:0,SELF:1,CHILDREN:2,BOTH:3},ji=function(){function t(t,n,i){this.$t=t,this.tn=i;var r=null==n?void 0:n.outline;r&&(this.S=r.color,this.T=r.alpha,this.St=r.width,this.rn=r.offset,this.Tt=r.align,this.nn=Di(r.mask,pi))}return t.prototype.getTheme=function(){return this.$t},t.prototype.setTheme=function(t){this.$t=t},t.prototype.getColor=function(t){var n=this.S;if(void 0!==n){if(!ot(n))return n;var i=n(t);if(void 0!==i)return i}return this.$t.getOutlineColor(t)},Object.defineProperty(t.prototype,"color",{get:function(){return this.S},set:function(t){if(this.S!==t){this.S=t;var n=this.tn;null!=n&&n()}},enumerable:!1,configurable:!0}),t.prototype.getAlpha=function(t){var n=this.T;if(void 0!==n){if(!ot(n))return n;var i=n(t);if(void 0!==i)return i}return this.$t.getOutlineAlpha(t)},Object.defineProperty(t.prototype,"alpha",{get:function(){return this.T},set:function(t){if(this.T!==t){this.T=t;var n=this.tn;null!=n&&n()}},enumerable:!1,configurable:!0}),t.prototype.getWidth=function(t){var n=this.St;if(void 0!==n){if(!ot(n))return n;var i=n(t);if(void 0!==i)return i}return this.$t.getOutlineWidth(t)},Object.defineProperty(t.prototype,"width",{get:function(){return this.St},set:function(t){if(this.St!==t){this.St=t;var n=this.tn;null!=n&&n()}},enumerable:!1,configurable:!0}),t.prototype.getOffset=function(t){var n=this.rn;if(void 0!==n){if(!ot(n))return n;var i=n(t);if(void 0!==i)return i}return this.$t.getOutlineOffset(t)},Object.defineProperty(t.prototype,"offset",{get:function(){return this.rn},set:function(t){if(this.rn!==t){this.rn=t;var n=this.tn;null!=n&&n()}},enumerable:!1,configurable:!0}),t.prototype.getAlign=function(t){var n=this.Tt;if(void 0!==n){if(!ot(n))return n;var i=n(t);if(void 0!==i)return i}return this.$t.getOutlineAlign(t)},Object.defineProperty(t.prototype,"align",{get:function(){return this.Tt},set:function(t){if(this.Tt!==t){this.Tt=t;var n=this.tn;null!=n&&n()}},enumerable:!1,configurable:!0}),t.prototype.getMask=function(t){var n=this.nn;if(void 0!==n){if(!ot(n))return n;var i=n(t);if(void 0!==i)return i}return this.$t.getOutlineMask(t)},Object.defineProperty(t.prototype,"mask",{get:function(){return this.nn},set:function(t){if(this.nn!==t){this.nn=t;var n=this.tn;null!=n&&n()}},enumerable:!1,configurable:!0}),t}(),Ni=function(){function t(t,n,i){this.$t=t,this.tn=i;var r=null==n?void 0:n.padding;null!=r&&(mn(r)?(this.en=r,this.un=r,this.sn=r,this.hn=r):(this.en=r.left,this.un=r.top,this.sn=r.right,this.hn=r.bottom))}return t.prototype.getTheme=function(){return this.$t},t.prototype.setTheme=function(t){this.$t=t},t.prototype.getCallback=function(){return this.tn},t.prototype.getLeft=function(){var t;return null!==(t=this.en)&&void 0!==t?t:this.$t.getPaddingLeft()},Object.defineProperty(t.prototype,"left",{get:function(){return this.en},set:function(t){this.en!==t&&(this.en=t,null!=this.tn&&this.tn())},enumerable:!1,configurable:!0}),t.prototype.getTop=function(){var t;return null!==(t=this.un)&&void 0!==t?t:this.$t.getPaddingTop()},Object.defineProperty(t.prototype,"top",{get:function(){return this.un},set:function(t){this.un!==t&&(this.un=t,null!=this.tn&&this.tn())},enumerable:!1,configurable:!0}),t.prototype.getRight=function(){var t;return null!==(t=this.sn)&&void 0!==t?t:this.$t.getPaddingRight()},Object.defineProperty(t.prototype,"right",{get:function(){return this.sn},set:function(t){this.sn!==t&&(this.sn=t,null!=this.tn&&this.tn())},enumerable:!1,configurable:!0}),t.prototype.getBottom=function(){var t;return null!==(t=this.hn)&&void 0!==t?t:this.$t.getPaddingBottom()},Object.defineProperty(t.prototype,"bottom",{get:function(){return this.hn},set:function(t){this.hn!==t&&(this.hn=t,null!=this.tn&&this.tn())},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n,i,r){null==n?(this.top=t,this.right=t,this.bottom=t,this.left=t):null==i?(this.top=t,this.right=n,this.bottom=t,this.left=n):null==r?(this.top=t,this.right=n,this.bottom=i,this.left=n):(this.top=t,this.right=n,this.bottom=i,this.left=r),null!=this.tn&&this.tn()},t}(),Ii=function(){function t(t,n){this.an=t,this.Z=n}return Object.defineProperty(t.prototype,"x",{get:function(){return this.an.x},set:function(t){var n=this.an,i=n.x;if(i!==t){n.x=t;var r=n.y;this.Z(t,r,i,r)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this.an.y},set:function(t){var n=this.an,i=n.y;if(i!==t){n.y=t;var r=n.x;this.Z(r,t,r,i)}},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n){var i=this.an,r=i.x,e=i.y;return r===t&&e===n||(i.set(t,n),this.Z(t,n,r,e)),this},t.prototype.copyFrom=function(t){var n=t.x,i=t.y,r=this.an,e=r.x,u=r.y;return e===n&&u===i||(r.copyFrom(t),this.Z(n,i,e,u)),this},t.prototype.copyTo=function(t){return t.copyFrom(this.an)},t.prototype.copy=function(){return this.copyFrom(arguments[0])},t.prototype.clone=function(n){return new t(this.an,n||this.Z)},t.prototype.equals=function(t){return this.an.equals(t)},t}(),Ci=function(t){function n(n,i,r){var e=t.call(this,n,i,r)||this;return e.St=100,e.cn=100,e.fn=0,e.ln=Mi.NONE,e.vn=!0,e.bn=1,e.dn=e.getBuffer("aVertexPosition"),e.gn=e.dn.data,e.mn=e.getBuffer("aTextureCoord"),e._uvs=e.mn.data,e.wn=e.getIndex(),e.On=e.wn.data,e}return B(n,t),Object.defineProperty(n.prototype,"width",{get:function(){return this.St},set:function(t){this.St!==t&&(this.St=t,this.vn=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"height",{get:function(){return this.cn},set:function(t){this.cn!==t&&(this.cn=t,this.vn=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"cornerRadius",{get:function(){return this.fn},set:function(t){this.fn!==t&&(this.fn=t,this.vn=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"cornerMask",{get:function(){return this.ln},set:function(t){this.ln!==t&&(this.ln=t,this.vn=!0)},enumerable:!1,configurable:!0}),n.prototype.getTables=function(){var t=n.TABLES;return null==t&&(t=this.newTables(n.N),n.TABLES=t),t},n.prototype.newTables=function(t){var n=1/(t-1)*.5;return[this.newTable(t,1,n),this.newTable(t,.5,n),this.newTable(t,0,n),this.newTable(t,1.5,n)]},n.prototype.newTable=function(t,n,i){for(var r=[],e=[],u=Math.PI,s=0,h=n;s<t;s+=1,h-=i){var o=h*u,a=+Math.cos(o),c=-Math.sin(o);r.push(a),e.push(c)}return{cos:r,sin:e}},n.N=4,n}(t.MeshGeometry),Ai=function(t){function n(){return t.call(this,new Float32Array(16*Ci.N),new Float32Array(16*Ci.N),new Uint16Array(3*(12*Ci.N-2)))||this}return B(n,t),n.prototype.fillVertices=function(t,n,i,r,e,u,s,h,o,a){for(var c=a.cos,f=a.sin,l=c[0],v=f[0],b=c[e-1],d=f[e-1],g=0;g<e;++g){var m=c[g],w=f[g],O=o,p=m*l+w*v;1e-4<p&&(O=Math.min(O,(1/p-1)*h));var D=m*b+w*d;1e-4<D&&(O=Math.min(O,(1/D-1)*h));var E=h+O;t[++i]=u+m*h,t[++i]=s+w*h,t[++i]=u+m*E,t[++i]=s+w*E,n[++r]=.5,n[++r]=.5,n[++r]=.5*(1+m),n[++r]=.5*(1+w)}},n.prototype.fillIndices=function(t,n,i,r){for(var e=0;e<r;++e)t[++i]=n+0,t[++i]=n+1,t[++i]=n+2,t[++i]=n+2,t[++i]=n+1,t[++i]=n+3,n+=2},n.prototype.fillIndicesEnd=function(t,n,i,r){for(var e=0,u=r-1;e<u;++e)t[++i]=n+0,t[++i]=n+1,t[++i]=n+2,t[++i]=n+2,t[++i]=n+1,t[++i]=n+3,n+=2;t[++i]=n+0,t[++i]=n+1,t[++i]=0,t[++i]=0,t[++i]=n+1,t[++i]=1,n+=2},n.prototype.update=function(t){var n=t.resolution;if(this.vn||this.bn!==n){this.vn=!1,this.bn=n;var i=this.gn,r=this._uvs,e=this.On,u=this.St,s=this.cn,h=Math.min(.5*u,.5*s,this.fn),o=1/n,a=h,c=u-h,f=u,l=h,v=s-h,b=s,d=this.ln,g=!(d&Mi.TOP_LEFT),m=!(d&Mi.TOP_RIGHT),w=!(d&Mi.BOTTOM_LEFT),O=!(d&Mi.BOTTOM_RIGHT),p=-1,D=-1,E=0,M=-1,S=Ci.N,T=S<<2,j=S<<1,N=6*S,I=this.getTables(),C=I[0],A=I[1],R=I[2],L=I[3];g?this.fillVertices(i,r,p,D,S,a,l,h,o,C):this.fillVertices(i,r,p,D,S,0,0,0,0,C),this.fillIndices(e,E,M,S),p+=T,D+=T,E+=j,M+=N,m?this.fillVertices(i,r,p,D,S,c,l,h,o,A):this.fillVertices(i,r,p,D,S,f,0,0,0,A),this.fillIndices(e,E,M,S),p+=T,D+=T,E+=j,M+=N,O?this.fillVertices(i,r,p,D,S,c,v,h,o,R):this.fillVertices(i,r,p,D,S,f,b,0,0,R),this.fillIndices(e,E,M,S),p+=T,D+=T,E+=j,M+=N,w?this.fillVertices(i,r,p,D,S,a,v,h,o,L):this.fillVertices(i,r,p,D,S,0,b,0,0,L),this.fillIndicesEnd(e,E,M,S),p+=T,D+=T,E+=j,M+=N,E=2;for(var y=1,k=4*S-1;y<k;y+=1,E+=2)e[++M]=0,e[++M]=E,e[++M]=E+2;this.dn.update(),this.mn.update(),this.wn.update()}},n}(Ci),Ri=function(n){function i(i){var r=n.call(this,new Ai,new t.MeshMaterial(i))||this;return i.on("update",(function(){rt.update(r)})),r}return B(i,n),Object.defineProperty(i.prototype,"width",{get:function(){return this.geometry.width},set:function(t){this.geometry.width=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"height",{get:function(){return this.geometry.height},set:function(t){this.geometry.height=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"cornerRadius",{get:function(){return this.geometry.cornerRadius},set:function(t){this.geometry.cornerRadius=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"cornerMask",{get:function(){return this.geometry.cornerMask},set:function(t){this.geometry.cornerMask=t},enumerable:!1,configurable:!0}),i.prototype._render=function(t){this.geometry.update(t),n.prototype._render.call(this,t)},i}(t.Mesh),Li=function(){function t(){}return t.prototype.get=function(t,n){var i=this.pn;return null==i&&((i=new Ri(n.getBackgroundTexture())).parent=t,this.pn=i),i},t.prototype.hide=function(){var t=this.pn;null!=t&&(t.visible=!1)},t.prototype.onReflow=function(t,n,i,r,e,u,s){var h=t.background,o=h.getColor(e);if(null!=o){var a=h.getAlpha(e);if(0<a){var c=this.get(t,r);c.tint=o,c.alpha=a,c.width=n,c.height=i,c.cornerRadius=u,c.cornerMask=s,c.visible=!0}else this.hide()}else this.hide()},t.prototype.render=function(t){var n;null===(n=this.pn)||void 0===n||n.render(t)},t.prototype.updateTransform=function(){var t;null===(t=this.pn)||void 0===t||t.updateTransform()},t}(),yi=function(t){function n(){var n=t.call(this,new Float32Array(32*Ci.N),new Float32Array(32*Ci.N),new Uint16Array(72*Ci.N))||this;return n.Dn=0,n.En=pi.NONE,n}return B(n,t),Object.defineProperty(n.prototype,"borderWidth",{get:function(){return this.Dn},set:function(t){this.Dn!==t&&(this.Dn=t,this.vn=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"borderMask",{get:function(){return this.En},set:function(t){this.En!==t&&(this.En=t,this.vn=!0)},enumerable:!1,configurable:!0}),n.prototype.fillVertices=function(t,n,i,r,e,u,s,h,o,a,c){for(var f=.5*a,l=h-f,v=h+f,b=c.cos,d=c.sin,g=b[0],m=d[0],w=b[e-1],O=d[e-1],p=u+(g+w)*l,D=s+(m+O)*l,E=0;E<e;++E){var M=b[E],S=d[E],T=o,j=o,N=M*g+S*m;if(1e-4<N){var I=1/N-1;T=Math.min(T,I*l),j=Math.min(j,I*v)}var C=M*w+S*O;if(1e-4<C){var A=1/C-1;T=Math.min(T,A*l),j=Math.min(j,A*v)}var R=l+T,L=v+j;0<l?(t[++i]=u+M*l,t[++i]=s+S*l,t[++i]=u+M*R,t[++i]=s+S*R):(t[++i]=p,t[++i]=D,t[++i]=p,t[++i]=D),t[++i]=u+M*v,t[++i]=s+S*v,t[++i]=u+M*L,t[++i]=s+S*L,n[++r]=.5*(1+M),n[++r]=.5*(1+S),n[++r]=.5,n[++r]=.5,n[++r]=.5,n[++r]=.5,n[++r]=.5*(1+M),n[++r]=.5*(1+S)}},n.prototype.fillIndices=function(t,n,i,r,e,u){for(var s=0,h=r-1;s<h;++s)t[++i]=n+0,t[++i]=n+1,t[++i]=n+4,t[++i]=n+4,t[++i]=n+1,t[++i]=n+5,n+=1,t[++i]=n+0,t[++i]=n+1,t[++i]=n+4,t[++i]=n+4,t[++i]=n+1,t[++i]=n+5,n+=1,t[++i]=n+0,t[++i]=n+1,t[++i]=n+4,t[++i]=n+4,t[++i]=n+1,t[++i]=n+5,n+=2;e?u?(t[++i]=n+0,t[++i]=n+1,t[++i]=0,t[++i]=0,t[++i]=n+1,t[++i]=1,n+=1,t[++i]=n+0,t[++i]=n+1,t[++i]=1,t[++i]=1,t[++i]=n+1,t[++i]=2,n+=1,t[++i]=n+0,t[++i]=n+1,t[++i]=2,t[++i]=2,t[++i]=n+1,t[++i]=3,n+=2):(t[++i]=n+0,t[++i]=n+1,t[++i]=n+4,t[++i]=n+4,t[++i]=n+1,t[++i]=n+5,n+=1,t[++i]=n+0,t[++i]=n+1,t[++i]=n+4,t[++i]=n+4,t[++i]=n+1,t[++i]=n+5,n+=1,t[++i]=n+0,t[++i]=n+1,t[++i]=n+4,t[++i]=n+4,t[++i]=n+1,t[++i]=n+5,n+=2):(t[++i]=n,t[++i]=n,t[++i]=n,t[++i]=n,t[++i]=n,t[++i]=n,n+=1,t[++i]=n,t[++i]=n,t[++i]=n,t[++i]=n,t[++i]=n,t[++i]=n,n+=1,t[++i]=n,t[++i]=n,t[++i]=n,t[++i]=n,t[++i]=n,t[++i]=n,n+=2)},n.prototype.update=function(t){var n=t.resolution;if(this.vn||this.bn!==n){this.vn=!1,this.bn=n;var i=this.gn,r=this._uvs,e=this.On,u=this.St,s=this.cn,h=this.Dn,o=Math.min(.5*u,.5*s,this.fn),a=1/n,c=o,f=u-o,l=u,v=o,b=s-o,d=s,g=this.En,m=!(g&pi.TOP),w=!(g&pi.BOTTOM),O=!(g&pi.LEFT),p=!(g&pi.RIGHT),D=this.ln,E=!(D&Mi.TOP_LEFT),M=!(D&Mi.TOP_RIGHT),S=!(D&Mi.BOTTOM_LEFT),T=!(D&Mi.BOTTOM_RIGHT),j=-1,N=-1,I=0,C=-1,A=Ci.N,R=A<<2,L=A<<3,y=18*A,k=this.getTables(),x=k[0],B=k[1],_=k[2],P=k[3];E?O||m?this.fillVertices(i,r,j,N,A,c,v,o,a,h,x):this.fillVertices(i,r,j,N,A,c,v,o,0,0,x):O||m?this.fillVertices(i,r,j,N,A,0,0,0,0,h,x):this.fillVertices(i,r,j,N,A,0,0,0,0,0,x),this.fillIndices(e,I,C,A,m,!1),j+=L,N+=L,I+=R,C+=y,M?m||p?this.fillVertices(i,r,j,N,A,f,v,o,a,h,B):this.fillVertices(i,r,j,N,A,f,v,o,0,0,B):m||p?this.fillVertices(i,r,j,N,A,l,0,0,0,h,B):this.fillVertices(i,r,j,N,A,l,0,0,0,0,B),this.fillIndices(e,I,C,A,p,!1),j+=L,N+=L,I+=R,C+=y,T?p||w?this.fillVertices(i,r,j,N,A,f,b,o,a,h,_):this.fillVertices(i,r,j,N,A,f,b,o,0,0,_):p||w?this.fillVertices(i,r,j,N,A,l,d,0,0,h,_):this.fillVertices(i,r,j,N,A,l,d,0,0,0,_),this.fillIndices(e,I,C,A,w,!1),j+=L,N+=L,I+=R,C+=y,S?w||O?this.fillVertices(i,r,j,N,A,c,b,o,a,h,P):this.fillVertices(i,r,j,N,A,c,b,o,0,0,P):w||O?this.fillVertices(i,r,j,N,A,0,d,0,0,h,P):this.fillVertices(i,r,j,N,A,0,d,0,0,0,P),this.fillIndices(e,I,C,A,O,!0),j+=L,N+=L,I+=R,C+=y,this.dn.update(),this.mn.update(),this.wn.update()}},n}(Ci),ki=function(n){function i(i){var r=n.call(this,new yi,new t.MeshMaterial(i))||this;return i.on("update",(function(){rt.update(r)})),r}return B(i,n),Object.defineProperty(i.prototype,"width",{get:function(){return this.geometry.width},set:function(t){this.geometry.width=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"height",{get:function(){return this.geometry.height},set:function(t){this.geometry.height=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"cornerRadius",{get:function(){return this.geometry.cornerRadius},set:function(t){this.geometry.cornerRadius=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"cornerMask",{get:function(){return this.geometry.cornerMask},set:function(t){this.geometry.cornerMask=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"borderWidth",{get:function(){return this.geometry.borderWidth},set:function(t){this.geometry.borderWidth=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"borderMask",{get:function(){return this.geometry.borderMask},set:function(t){this.geometry.borderMask=t},enumerable:!1,configurable:!0}),i.prototype._render=function(t){this.geometry.update(t),n.prototype._render.call(this,t)},i}(t.Mesh),xi=function(){function t(){}return t.prototype.get=function(t,n){var i=this.pn;return null==i&&((i=new ki(n.getBorderTexture())).parent=t,this.pn=i),i},t.prototype.hide=function(){var t=this.pn;null!=t&&(t.visible=!1)},t.prototype.onReflow=function(t,n,i,r,e,u,s){var h=t.border,o=h.getColor(e);if(null!=o){var a=h.getAlpha(e);if(0<a){var c=h.getWidth(e),f=h.getMask(e),l=this.get(t,r),v=(h.getAlign(e)-.5)*c;l.tint=o,l.alpha=a,l.x=-v,l.y=-v,l.width=n+2*v,l.height=i+2*v,l.cornerRadius=u,l.cornerMask=s,l.borderWidth=c,l.borderMask=f,l.visible=!0}else this.hide()}else this.hide()},t.prototype.render=function(t){var n;null===(n=this.pn)||void 0===n||n.render(t)},t.prototype.updateTransform=function(){var t;null===(t=this.pn)||void 0===t||t.updateTransform()},t}(),Bi=function(){function t(){}return t.prototype.get=function(t,n){var i=this.pn;return null==i&&((i=new ki(n.getBorderTexture())).parent=t,this.pn=i),i},t.prototype.hide=function(){var t=this.pn;null!=t&&(t.visible=!1)},t.prototype.onReflow=function(t,n,i,r,e,u,s){var h=t.outline,o=h.getColor(e);if(null!=o){var a=h.getAlpha(e);if(0<a){var c=h.getWidth(e),f=h.getMask(e),l=this.get(t,r),v=h.getOffset(e)+(h.getAlign(e)-.5)*c;l.tint=o,l.alpha=a,l.x=-v,l.y=-v,l.width=n+2*v,l.height=i+2*v,l.cornerRadius=u,l.cornerMask=s,l.borderWidth=c,l.borderMask=f,l.visible=!0}else this.hide()}else this.hide()},t.prototype.render=function(t){var n;null===(n=this.pn)||void 0===n||n.render(t)},t.prototype.updateTransform=function(){var t;null===(t=this.pn)||void 0===t||t.updateTransform()},t}(),_i=function(){function t(t){var n=new Li;this.Mn=n,t.snippet.add(n,!0);var i=new xi;this.Sn=i,t.snippet.add(i,!0);var r=new Bi;this.Tn=r,t.snippet.add(r,!1),t.reflowable.add(this)}return t.prototype.onReflow=function(t,n,i){var r=t.theme,e=t.state,u=t.corner,s=u.getRadius(),h=u.getMask();this.Mn.onReflow(t,n,i,r,e,s,h),this.Sn.onReflow(t,n,i,r,e,s,h),this.Tn.onReflow(t,n,i,r,e,s,h)},t}(),Pi={NONE:0,BEFORE:1,AFTER:2,BOTH:3},Ui={OPEN:0,CLOSE:1,PARENSESIS:2,ADD_OR_PLUS:3,SUB_OR_MINUS:4,PLUS:5,MINUS:6,ADD:7,SUB:8,MUL:9,DIV:10,MIN:11,MAX:12,COMMA:13,PARENT:14,SELF:15,PADDING:16,CURRENT:17,NUMBER:18},Fi=function(){function t(t){var n=this.toToken(t),i=0;do{i=this.toParensesis(n,i)}while(i<n.length);if(this.toUnary(n),this.toArithmetic(n,Ui.MUL,Ui.DIV),this.toArithmetic(n,Ui.ADD,Ui.SUB),1===n.length){var r=n[0];if(!mn(r))return void(this.jn=r)}throw new Error("Failed to parse '".concat(t,"'"))}return t.prototype.toParensesis=function(t,n){for(var i=t.length,r=n;r<i;++r)if(t[r]===Ui.OPEN){var e=r,u=Ui.PARENSESIS;if(0<r){var s=t[r-1];s!==Ui.MIN&&s!==Ui.MAX||(e-=1,u=s)}for(var h=r+1;h<i;++h){var o=t[h];if(o===Ui.CLOSE)return t[e]=[u,this.toComma(t,r+1,h)],t.splice(e+1,h-e),e+1;o===Ui.OPEN&&(h=this.toParensesis(t,h)-1,i=t.length)}throw new Error("Malformed parensesis")}return i},t.prototype.toCommaOf=function(t,n,i){var r=i-n;if(r<=0)return[Ui.NUMBER,0];if(r<=1)return t[n];for(var e=[],u=n;u<i;++u)e.push(t[u]);return[Ui.PARENSESIS,e]},t.prototype.toComma=function(t,n,i){for(var r=null,e=n,u=n;u<i;++u)t[u]===Ui.COMMA&&((r=r||[]).push(this.toCommaOf(t,e,u)),e=u+1);if(e<i){if(null==r){var s=[];for(u=e;u<i;++u)s.push(t[u]);return s}r.push(this.toCommaOf(t,e,i))}return r||[]},t.prototype.toUnaryNode=function(t){mn(t)||t[0]!==Ui.PARENSESIS&&t[0]!==Ui.MIN&&t[0]!==Ui.MAX||this.toUnary(t[1])},t.prototype.toUnary=function(t){for(var n=0,i=t.length;n<i;++n){var r=t[n];if(r===Ui.ADD_OR_PLUS||r===Ui.SUB_OR_MINUS)if(n<=0||mn(t[n-1])){if(!(n+1<i)||mn(t[n+1]))throw new Error("Malformed unary operator");var e=t.splice(n+1,1)[0],u=r===Ui.ADD_OR_PLUS?Ui.PLUS:Ui.MINUS;t[n]=[u,e],i=t.length,this.toUnaryNode(e)}else u=r===Ui.ADD_OR_PLUS?Ui.ADD:Ui.SUB,t[n]=u;else this.toUnaryNode(r),i=t.length}},t.prototype.toArithmeticNode=function(t,n,i){mn(t)||(t[0]===Ui.PARENSESIS||t[0]===Ui.MIN||t[0]===Ui.MAX?this.toArithmetic(t[1],n,i):t[0]===Ui.PLUS||t[0]===Ui.MINUS?this.toArithmeticNode(t[1],n,i):t[0]!==Ui.ADD&&t[0]!==Ui.SUB&&t[0]!==Ui.MUL&&t[0]!==Ui.DIV||(this.toArithmeticNode(t[1],n,i),this.toArithmeticNode(t[2],n,i)))},t.prototype.toArithmetic=function(t,n,i){for(var r=0,e=t.length;r<e;++r){var u=t[r];if(u===n||u===i){if(0<r&&r+1<e){var s=t[r-1],h=t[r+1];if(!mn(s)&&!mn(h)){t.splice(r,2),t[r-1]=[u,s,h],r-=1,e=t.length,this.toArithmeticNode(s,n,i),this.toArithmeticNode(h,n,i);continue}}throw new Error("Malformed operands for the operator ".concat(u))}this.toArithmeticNode(u,n,i),e=t.length}},t.prototype.toToken=function(n){for(var i=[];;){var r=t.TOKEN_REGEX.exec(n);if(null==r)break;var e=r[0],u=this.toTokenOperator(e);if(null!=u)i.push(u);else{var s=parseFloat(e);if(s!=s)throw new Error("Unexpected token '".concat(e,"' at ").concat(r.index," in '").concat(n,"'"));var h=this.toTokenLiteral(e);null!=h?i.push([h,.01*s]):i.push([Ui.NUMBER,s])}}return i},t.prototype.toTokenOperator=function(t){switch(t){case"+":return Ui.ADD_OR_PLUS;case"-":return Ui.SUB_OR_MINUS;case"*":return Ui.MUL;case"/":return Ui.DIV;case"(":return Ui.OPEN;case")":return Ui.CLOSE;case",":return Ui.COMMA;case"min":return Ui.MIN;case"max":return Ui.MAX}return null},t.prototype.toTokenLiteral=function(t){var n=t.length;if(0<n)switch(t[n-1]){case"%":return Ui.PARENT;case"s":return Ui.SELF;case"p":return Ui.PADDING;case"c":return Ui.CURRENT}return null},t.prototype.evaluate=function(t,n,i,r,e){switch(t[0]){case Ui.PARENSESIS:var u=t[1];return this.evaluate(u[u.length-1],n,i,r,e);case Ui.PLUS:return+this.evaluate(t[1],n,i,r,e);case Ui.MINUS:return-this.evaluate(t[1],n,i,r,e);case Ui.ADD:return this.evaluate(t[1],n,i,r,e)+this.evaluate(t[2],n,i,r,e);case Ui.SUB:return this.evaluate(t[1],n,i,r,e)-this.evaluate(t[2],n,i,r,e);case Ui.MUL:return this.evaluate(t[1],n,i,r,e)*this.evaluate(t[2],n,i,r,e);case Ui.DIV:return this.evaluate(t[1],n,i,r,e)/this.evaluate(t[2],n,i,r,e);case Ui.MIN:if(0<t[1].length){for(var s=t[1],h=this.evaluate(s[0],n,i,r,e),o=1,a=s.length;o<a;++o)h=Math.min(h,this.evaluate(s[o],n,i,r,e));return h}return 0;case Ui.MAX:if(0<t[1].length){for(s=t[1],h=this.evaluate(s[0],n,i,r,e),o=1,a=s.length;o<a;++o)h=Math.max(h,this.evaluate(s[o],n,i,r,e));return h}return 0;case Ui.PARENT:return t[1]*n;case Ui.SELF:return t[1]*i;case Ui.PADDING:return t[1]*r;case Ui.CURRENT:return t[1]*e;case Ui.NUMBER:return t[1]}return 0},t.prototype.calculate=function(t,n,i,r){return this.evaluate(this.jn,t,n,i,r)},t.TOKEN_REGEX=/(?:\+|-|\*|\/|\(|\)|min|max|,|(?:\d+(?:\.\d*)?[%psc]?))/g,t}(),Gi=function(t,n){return.5*(t-n)},Hi=function(t,n,i){return i},zi=function(t){return t},Vi=function(t,n,i){return t-i},Wi=function(){function t(){}return t.position=function(t){if(null==t||mn(t))return null;if(at(t)){switch(t){case"center":case"CENTER":return Gi;case"padding":case"PADDING":return Hi}var n=new Fi(t);return function(t,i,r,e){return n.calculate(t,i,r,e)}}if(ot(t))return t;var i=t;return function(t,n,r,e){return i.calculate(t,n,r,e)}},t.size=function(t){if(null==t||mn(t))return null;if(at(t)){switch(t){case"100%":case"maximized":case"MAXIMIZED":return zi;case"padding":case"PADDING":return Vi}var n=new Fi(t);return function(t,i,r,e){return n.calculate(t,i,r,e)}}if(ot(t))return t;var i=t;return function(t,n,r,e){return i.calculate(t,n,r,e)}},t}(),Xi=function(){function t(){}return t.isActivateKey=function(t){return"Space"===t.key||"Enter"===t.key||32===t.which||13===t.which},t.isArrowUpKey=function(t){return"ArrowUp"===t.key||38===t.which},t.isArrowDownKey=function(t){return"ArrowDown"===t.key||40===t.which},t.isArrowLeftKey=function(t){return"ArrowLeft"===t.key||37===t.which},t.isArrowRightKey=function(t){return"ArrowRight"===t.key||39===t.which},t.isCancelKey=function(t){return"Esc"===t.key||27===t.which},t.isFocusKey=function(t){return"Tab"===t.key||9===t.which},t.isUndoKey=function(t){return t.ctrlKey&&("z"===t.key||90===t.which)},t.isRedoKey=function(t){return t.ctrlKey&&("y"===t.key||89===t.which)},t.isSaveKey=function(t){return t.ctrlKey&&!t.shiftKey&&("s"===t.key||83===t.which)},t.isSaveAsKey=function(t){return t.ctrlKey&&t.shiftKey&&("S"===t.key||83===t.which)},t.isDeleteKey=function(t){return"Delete"===t.key||46===t.which},t.isSelectAllKey=function(t){return t.ctrlKey&&!t.shiftKey&&("a"===t.key||65===t.which)},t.isOkKey=function(t){return"Enter"===t.key||13===t.which},t.getFocusDirection=function(t){return!0!==t.shiftKey},t.toShortcut=function(t){if(at(t)){var n,i=t,r=i.indexOf("->"),e=void 0;0<=r?(e=i.substring(0,r).trim().toLowerCase(),n=i.substring(r+2).trim()):e=i.trim().toLowerCase();for(var u=!1,s=!1,h=!1,o="a",a=e.length,c=0,f=1;f<a;++f)if("+"===e.charAt(f)){var l=e.substring(c,f);switch(l){case"alt":u=!0;break;case"ctrl":s=!0;break;case"shift":h=!0;break;default:o=l}c=f+=1}return c!==f&&(o=e.substring(c,f)),function(t){var n=t.key;if(n.length<=1){t.shift&&(t.key=n.toUpperCase());var i=n.charCodeAt(0);t.which=97<=i&&i<=122?i-32:i}else switch(n){case"enter":t.key="Enter",t.which=13;break;case"space":t.key=" ",t.which=32;break;case"escape":t.key="Escape",t.which=27;break;case"f1":t.key="F1",t.which=112;break;case"f2":t.key="F2",t.which=113;break;case"f3":t.key="F3",t.which=114;break;case"f4":t.key="F4",t.which=115;break;case"f5":t.key="F5",t.which=116;break;case"f6":t.key="F6",t.which=117;break;case"f7":t.key="F7",t.which=118;break;case"f8":t.key="F8",t.which=119;break;case"f9":t.key="F9",t.which=120;break;case"f10":t.key="F10",t.which=121;break;case"f11":t.key="F11",t.which=122;break;case"f12":t.key="F12",t.which=123;break;case"capslock":t.key="CapsLock",t.shift?t.which=20:t.which=240;break;case"arrowup":t.key="ArrowUp",t.which=38;break;case"arrowdown":t.key="ArrowDown",t.which=40;break;case"arrowleft":t.key="ArrowLeft",t.which=37;break;case"arrowright":t.key="ArrowRight",t.which=39;break;case"insert":t.key="Insert",t.which=45;break;case"delete":t.key="Delete",t.which=46;break;case"pageup":t.key="PageUp",t.which=33;break;case"pagedown":t.key="PageDown",t.which=34;break;case"backspace":t.key="Backspace",t.which=8;break;case"colon":t.key=":",t.which=186;break;case"semicolon":t.key=";",t.which=187;break;case"pause":t.key="Pause",t.which=19;break;case"scrolllock":t.key="ScrollLock",t.which=145;break;case"tab":t.key="Tab",t.which=9;break;case"plus":t.key="+",t.which=187;break;case"minus":t.key="-",t.which=189}return t}({alt:u,ctrl:s,shift:h,key:o,which:0,event:n})}return t},t.toString=function(t){var n=[];return t.ctrl&&n.push("Ctrl"),t.shift&&n.push("Shift"),t.alt&&n.push("Alt"),n.push(t.key.toUpperCase()),n.join("+")},t.on=function(t,n,i){var r=this.toShortcut(n);document.body.addEventListener("keydown",(function(n){n.altKey!==r.alt||n.ctrlKey!==r.ctrl||n.shiftKey!==r.shift||n.key!==r.key&&n.which!==r.which||(t.state.isActionable&&(null!=r.event?t.emit(r.event):null!=i&&i(n)),n.preventDefault())}))},t.moveFocusVertically=function(n,i,r){if(i.state.isActionable){var e=t.isArrowUpKey(n),u=t.isArrowDownKey(n);if(e||u)return this.moveFocus(u,i,r)}return!1},t.moveFocusHorizontally=function(n,i,r){if(i.state.isActionable){var e=t.isArrowLeftKey(n),u=t.isArrowRightKey(n);if(e||u)return this.moveFocus(u,i,r)}return!1},t.moveFocus=function(t,n,i){var r,e=null!==(r=null==i?void 0:i.picked)&&void 0!==r?r:rt.getLayer(n);if(e){var u=e.getFocusController(),s=u.get();if(null!=s){var h=u.find(s,!1,s.state.isFocusRoot||t,t,n);if(null!=h)return u.focus(h),!0}}return!1},t}(),Ki=function(){function t(){}return Object.defineProperty(t,"touchable",{get:function(){return"ontouchstart"in document},enumerable:!1,configurable:!0}),Object.defineProperty(t,"tap",{get:function(){return"pointertap"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"down",{get:function(){return"pointerdown"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"enter",{get:function(){return"pointerenter"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"leave",{get:function(){return"pointerleave"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"move",{get:function(){return"pointermove"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"out",{get:function(){return"pointerout"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"over",{get:function(){return"pointerover"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"up",{get:function(){return"pointerup"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"upoutside",{get:function(){return"pointerupoutside"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"cancel",{get:function(){return"pointercancel"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"righttap",{get:function(){return"rightclick"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"rightdown",{get:function(){return"rightdown"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"rightup",{get:function(){return"rightup"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"rightupoutside",{get:function(){return"rightupoutside"},enumerable:!1,configurable:!0}),t.toGlobal=function(t,n,i){if("touches"in t){var r=t.changedTouches,e=r[r.length-1];null!=e?n.mapPositionToPoint(i,e.clientX,e.clientY):n.mapPositionToPoint(i,0,0)}else n.mapPositionToPoint(i,t.clientX,t.clientY);return i},t.onDblClick=function(t,n){var i=this;if(t.addEventListener("dblclick",(function(t){return n(t,!1)})),this.touchable){var r=0,e=0,u=0,s=0;t.addEventListener("touchstart",(function(t){if(0===r||2===r){var n=t.touches,i=n.length;if(i<=0)r=0;else{var s=n.item(i-1);null!=s?(r+=1,e=s.clientX,u=s.clientY):r=0}}else r=0})),t.addEventListener("touchend",(function(t){if(1===r||3===r){var h=t.changedTouches,o=h.length;if(o<=0)r=0;else{var a=h[o-1];if(null!=a){var c=e-a.clientX,f=u-a.clientY;i.CLICK_DISTANCE_THRESHOLD<=Math.abs(c)+Math.abs(f)?r=0:1===r?(s=t.timeStamp,r=2):t.timeStamp-s<i.DBLCLICK_INTERVAL_THRESHOLD?(r=0,n(t,!0)):(s=t.timeStamp,r=2)}else r=0}}else r=0})),t.addEventListener("touchcancel",(function(){r=0}))}},t.contains=function(t,n){for(var i=n;null!=i&&i!==t;)i=i.parent;return i===t},t.CLICK_DISTANCE_THRESHOLD=10,t.DBLCLICK_INTERVAL_THRESHOLD=333,t.LONG_CLICK_THRESHOLD=750,t}(),Yi=function(){function t(){this.Nn=!1}return Object.defineProperty(t.prototype,"isOff",{get:function(){return!this.Nn},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isOn",{get:function(){return this.Nn},enumerable:!1,configurable:!0}),t.prototype.toCoordinate=function(t){return this.Nn?"auto":t},t.prototype.from=function(t){return"auto"===t||"AUTO"===t?(this.Nn=!0,!0):(this.Nn=!1,!1)},t}(),Ji=function(){this.width=new Yi,this.height=new Yi},Zi=function(){function t(t){this.O=t,this.In=[],this.Cn=[],this.An=!0}return Object.defineProperty(t.prototype,"renderable",{get:function(){return this.An},set:function(t){this.An=t},enumerable:!1,configurable:!0}),t.prototype.add=function(t,n){(n?this.In:this.Cn).push(t),"parent"in t&&(t.parent=this.O)},t.prototype.addAt=function(t,n,i){var r=n?this.In:this.Cn;0===i?r.unshift(t):0<i&&i<r.length?r.splice(i,0,t):r.push(t),"parent"in t&&(t.parent=this.O)},t.prototype.remove=function(t,n){var i=n?this.In:this.Cn,r=i.indexOf(t);0<=r&&(i.splice(r,1),"parent"in t&&(t.parent=null))},t.prototype.render=function(t,n){if(this.An)for(var i=n?this.In:this.Cn,r=0,e=i.length;r<e;++r){var u=i[r];u.updateTransform(),u.render(t)}},t}(),qi=function(){function t(){this.Rn=[]}return t.prototype.add=function(t){this.Rn.push(t)},t.prototype.remove=function(t){var n=this.Rn,i=n.indexOf(t);0<=i&&n.splice(i,1)},t.prototype.onReflow=function(t,n,i){for(var r=this.Rn,e=0,u=r.length;e<u;++e)r[e].onReflow(t,n,i)},t}(),Qi=function(n){function i(t){var r,e,u,s,h,o,a,c,f,l=this,v=(l=n.call(this)||this).transform;l._=new Ii(v.position,(function(t,n,i,r){l.onMove(t,n,i,r)})),l.Ln=new Ii(v.scale,(function(t,n,i,r){l.onScale(t,n,i,r)})),l.yn=new Ii(v.skew,(function(t,n,i,r){l.onSkew(t,n,i,r)})),l.kn=t;var b=l.xn={};l.Bn=new Ji,l.vn=!0,l._n=!1,l.Pn=!1,l.Un=null,l.name=null!==(r=null==t?void 0:t.name)&&void 0!==r?r:"";var d=function(t){var n=null==t?void 0:t.theme;if(n)return at(n)?K.getInstance().get(n):n}(t)||l.getThemeDefault();l.$t=d,l.Fn=new Zi(l),l.Gn=new qi,l.Hn=Di(null!==(e=null==t?void 0:t.clear)&&void 0!==e?e:d.getClearType(),Pi),l.zn=new Ni(d,t,(function(){l.toParentResized(),l.toHierarchyDirty(),rt.update(l)}));var g=function(){l.toDirty(),rt.update(l)};l.Mn=new Oi(d,t,g),l.Sn=new Ei(d,t,g),l.Tn=new ji(d,t,g),l.qt=new Si(d,t,g);var m=v.position,w=null!==(u=null==t?void 0:t.x)&&void 0!==u?u:d.getX();mn(w)?m.x=w:(m.x=0,b.x=Wi.position(w));var O=null!==(s=null==t?void 0:t.y)&&void 0!==s?s:d.getY();mn(O)?m.y=O:(m.y=0,b.y=Wi.position(O));var p=null!==(h=null==t?void 0:t.width)&&void 0!==h?h:d.getWidth();l.Bn.width.from(p)?l.St=100:mn(p)?l.St=p:(l.St=100,b.width=Wi.size(p));var D=null!==(o=null==t?void 0:t.height)&&void 0!==o?o:d.getHeight();if(l.Bn.height.from(D)?l.cn=100:mn(D)?l.cn=D:(l.cn=100,b.height=Wi.size(D)),null!=t){var E=t.visible;null!=E&&(l.visible=E)}if(null!=t){var M=t.renderable;null!=M&&(l.renderable=M)}l.Mt=new ft((function(t,n){l.onStateChange(t,n)}));var S,T=Di(null!==(a=null==t?void 0:t.interactive)&&void 0!==a?a:d.getInteractive(),Ti);if(l.interactive=!!(T&Ti.SELF),l.interactiveChildren=!!(T&Ti.CHILDREN),null!=t){var j=t.on;if(null!=j)for(var N in j){var I=j[N];I&&l.on(N,I)}}if(l.Vn=null!==(c=null==t?void 0:t.title)&&void 0!==c?c:d.getTitle(),l.Kt=null!==(f=null==t?void 0:t.weight)&&void 0!==f?f:d.getWeight(),l.initReflowable(),l.Wn=function(){rt.update(l)},null!=t&&(S=t.shadow),void 0===S&&(S=d.getShadow()),S)if(at(S))switch(S){case"WEAK":l.shadow=d.newShadowWeak();break;case"DEFAULT":l.shadow=d.newShadow()}else l.shadow=S;l.on(Ki.over,(function(t){l.onOver(t)})),l.on(Ki.out,(function(t){l.onOut(t)})),l.on(Ki.down,(function(t){l.onDown(t)})),l.on(Ki.up,(function(t){l.onUp(t)})),l.on("added",(function(){l.toParentResized(),(l.isDirty()||l.hasDirty())&&l.toParentHasDirty(),l.Pn&&l.toParentHierarchyDirty();var t=l.parent;t instanceof i&&(l.state.parent=t.state),rt.update(l)})),l.on("removed",(function(){l.blur(!0),l.state.parent=null,rt.update(l)}));var C,A=function(t){if(t){var n=t.shortcut,i=t.shortcuts;if(null!=i||null!=n){var r=[];if(null!=n&&r.push(Xi.toShortcut(n)),null!=i)for(var e=0,u=i.length;e<u;++e)r.push(Xi.toShortcut(i[e]));return r}}}(t);if(l.Xn=A,null!=A)for(var R=function(t){l.onShortcut(t)},L=0,y=A.length;L<y;++L)Xi.on(l,A[L],R);if(l.init(t),d.newState(l.Mt),null!=t){var k=t.state;null!=k&&(at(k)?l.Mt.add(k):l.Mt.addAll(k))}if(null!=t){var x=t.parent;null!=x&&x.addChild(l)}if(null!=t){var B=t.children;if(null!=B)for(L=0,y=B.length;L<y;++L){var _=B[L];null!=_&&l.addChild(_)}}return null!=t&&(C=t.cursor,l.Kn=C),l.cursor=l.toCursor(C,l.Mt),l.emit("init",l),l}return B(i,n),i.prototype.toCursor=function(t,n){if(t)if(ot(t)){var i=t(n);if(void 0!==i)return i}else if(void 0!==t)return t;return this.theme.getCursor(n)},Object.defineProperty(i.prototype,"snippet",{get:function(){return this.Fn},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"reflowable",{get:function(){return this.Gn},enumerable:!1,configurable:!0}),i.prototype.initReflowable=function(){new _i(this)},i.prototype.onChildrenChange=function(){this.toHierarchyDirty(),n.prototype.onChildrenChange.call(this)},i.prototype.onShortcut=function(t){this.emit("shortcut",t,this)},i.prototype.init=function(t){},Object.defineProperty(i.prototype,"weight",{get:function(){return this.Kt},enumerable:!1,configurable:!0}),i.prototype.onMove=function(t,n,r,e){for(var u=this.children,s=0,h=u.length;s<h;++s){var o=u[s];o instanceof i&&o.onParentMove(t,n,r,e)}rt.update(this),this.emit("move",t,n,r,e,this)},i.prototype.resize=function(t,n){var i=this.St,r=this.cn,e=null!=t?t:i,u=null!=n?n:r,s=i!==e,h=r!==u;s&&(this.St=e),h&&(this.cn=u);var o,a=s||h;if(a&&this.onResize(e,u,i,r),s&&null!=(o=this.xn).x){var c=this._,f=this.getParentOfSize();f&&(this._.x=o.x(f.width,e,f.padding.getLeft(),c.x))}if(h&&null!=(o=this.xn).y){c=this._;var l=this.getParentOfSize();l&&(this._.y=o.y(l.height,u,l.padding.getTop(),c.y))}return a},i.prototype.getClearType=function(){return this.Hn},i.prototype.onResize=function(t,n,r,e){this.toDirty(),this.toHierarchyDirty();for(var u=this.zn,s=this.children,h=0,o=s.length;h<o;++h){var a=s[h];a instanceof i&&a.onParentResize(t,n,u)}rt.update(this),this.emit("resize",t,n,r,e,this)},i.prototype.onScale=function(t,n,i,r){rt.update(this),this.emit("scale",t,n,i,r,this)},i.prototype.onSkew=function(t,n,i,r){rt.update(this),this.emit("skew",t,n,i,r,this)},Object.defineProperty(i.prototype,"type",{get:function(){return this.getType()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"x",{get:function(){return this._.x},set:function(t){this.setX(t)},enumerable:!1,configurable:!0}),i.prototype.getX=function(){var t=this.xn;return null!=t.x?t.x:this._.x},i.prototype.setX=function(t){var n=this.xn;if(mn(t)){var i=this._;i.x!==t?(n.x=void 0,i.x=t):void 0!==n.x&&(n.x=void 0,this.toParentResized())}else{var r=Wi.position(t);n.x!==r&&(n.x=r,this.toParentResized())}},Object.defineProperty(i.prototype,"y",{get:function(){return this._.y},set:function(t){this.setY(t)},enumerable:!1,configurable:!0}),i.prototype.getY=function(){var t=this.xn;return null!=t.y?t.y:this._.y},i.prototype.setY=function(t){var n=this.xn;if(mn(t)){var i=this._;i.y!==t?(n.y=void 0,i.y=t):void 0!==n.y&&(n.y=void 0,this.toParentResized())}else{var r=Wi.position(t);n.y!==r&&(n.y=r,this.toParentResized())}},Object.defineProperty(i.prototype,"width",{get:function(){return this.St},set:function(t){this.setWidth(t)},enumerable:!1,configurable:!0}),i.prototype.getWidth=function(){return this.Bn.width.toCoordinate(this.xn.width||this.St)},i.prototype.setWidth=function(t){var n=this.Bn.width,i=n.isOn,r=n.from(t);if(n.isOn!==i&&(this.toHierarchyDirty(),rt.update(this)),!r){var e=this.xn;if(mn(t)){var u=this.St;if(u!==t){e.width=void 0,this.St=t;var s=this.cn;if(this.onResize(t,s,u,s),null!=e.x){var h=this._,o=this.getParentOfSize();o&&(h.x=e.x(o.width,t,o.padding.getLeft(),h.x))}}else void 0!==e.width&&(e.width=void 0,this.toParentResized())}else{var a=Wi.size(t);e.width!==a&&(e.width=a,this.toParentResized())}}},Object.defineProperty(i.prototype,"height",{get:function(){return this.cn},set:function(t){this.setHeight(t)},enumerable:!1,configurable:!0}),i.prototype.getHeight=function(){return this.Bn.height.toCoordinate(this.xn.height||this.cn)},i.prototype.setHeight=function(t){var n=this.Bn.height,i=n.isOn,r=n.from(t);if(n.isOn!==i&&(this.toHierarchyDirty(),rt.update(this)),!r){var e=this.xn;if(mn(t)){var u=this.cn;if(u!==t){e.height=void 0,this.cn=t;var s=this.St;if(this.onResize(s,t,s,u),null!=e.y){var h=this._,o=this.getParentOfSize();o&&(h.y=e.y(o.height,t,o.padding.getTop(),h.y))}}else void 0!==e.height&&(e.height=void 0,this.toParentResized())}else{var a=Wi.size(t);e.height!==a&&(e.height=a,this.toParentResized())}}},Object.defineProperty(i.prototype,"position",{get:function(){return this._},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"scale",{get:function(){return this.Ln},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"skew",{get:function(){return this.yn},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"padding",{get:function(){return this.zn},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"corner",{get:function(){return this.qt},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"background",{get:function(){return this.Mn},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"border",{get:function(){return this.Sn},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"outline",{get:function(){return this.Tn},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"unsafe",{get:function(){return this.transform},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"title",{get:function(){return this.Vn},set:function(t){this.Vn!==t&&(this.Vn=t,this.state.isHovered&&this.applyTitle())},enumerable:!1,configurable:!0}),i.prototype.applyTitle=function(){var t=rt.getLayer(this);t&&(t.view.title=this.Vn)},i.prototype.show=function(){return this.visible||(this.visible=!0,this.toParentHierarchyDirty(),rt.update(this)),this},i.prototype.isShown=function(){return this.visible},i.prototype.hide=function(){return this.visible&&(this.visible=!1,this.toParentHierarchyDirty(),this.blur(!0),rt.update(this)),this},i.prototype.isHidden=function(){return!this.visible},i.prototype.toDirty=function(){return!this.vn&&(this.vn=!0,this.toParentHasDirty(),!0)},i.prototype.toHasDirty=function(){return!this._n&&(this._n=!0,this.toParentHasDirty(),!0)},i.prototype.toParentHasDirty=function(){var t=this.parent;t instanceof i&&t.toHasDirty()},i.prototype.toHierarchyDirty=function(){return!this.Pn&&(this.Pn=!0,this.onHierarchyDirty(),this.toParentHierarchyDirty(),!0)},i.prototype.toParentHierarchyDirty=function(){var t=this.parent;t instanceof i&&t.toHierarchyDirty()},i.prototype.isHierarchyDirty=function(){return this.Pn},i.prototype.onHierarchyDirty=function(){},i.prototype.isDirty=function(){return this.vn},i.prototype.hasDirty=function(){return this._n},i.prototype.setFocused=function(t){if(this.state.isFocused!==t){var n=rt.getLayer(this);n&&n.getFocusController().set(this,t)}return this},i.prototype.focus=function(){return this.setFocused(!0)},i.prototype.blur=function(t){if(t){var n=rt.getLayer(this);if(n){var r=n.getFocusController().get();if(r instanceof i)for(var e=r;e;){if(e===this){r.setFocused(!1);break}e=e.parent}}}else this.setFocused(!1);return this},i.prototype.onStateChange=function(t,n){var r=this;this.toDirty(),rt.update(this),this.emit("statechange",t,n,this);for(var e=this.children,u=0,s=e.length;u<s;++u){var h=e[u];h instanceof i&&h.state.onParentChange(t,n)}t.isFocused?(n.isFocused||this.onFocus(),t.inDisabled&&!n.inDisabled&&setTimeout((function(){r.blur()}),0)):n.isFocused&&this.onBlur(),this.cursor=this.toCursor(this.Kn,t)},i.prototype.onChildFocus=function(t){var n=this.parent;n instanceof i&&n.onChildFocus(t)},i.prototype.onFocus=function(){var t=this.parent;t instanceof i&&t.onChildFocus(this)},i.prototype.onChildBlur=function(t){var n=this.parent;n instanceof i&&n.onChildBlur(t)},i.prototype.onBlur=function(){var t=this.parent;t instanceof i&&t.onChildBlur(this)},Object.defineProperty(i.prototype,"state",{get:function(){return this.Mt},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"options",{get:function(){return this.kn},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"theme",{get:function(){return this.$t},set:function(t){this.$t!==t&&(this.$t=t,this.zn.setTheme(t),this.Mn.setTheme(t),this.Sn.setTheme(t),this.Tn.setTheme(t),this.qt.setTheme(t),this.toDirty(),rt.update(this))},enumerable:!1,configurable:!0}),i.prototype.reflow=function(){var t=this.vn;t&&(this.onReflow(),this.vn=!1);var n=this._n,r=this.Pn;if(n||r){this._n=!1,this.Pn=!1;for(var e=this.children,u=0,s=e.length;u<s;++u){var h=e[u];h instanceof i&&h.reflow()}}(t||n||r)&&this.onRefit()},i.prototype.onRefit=function(){var t=this.Bn,n=t.width.isOn,i=t.height.isOn;if(n&&i){for(var r=0,e=0,u=0,s=(o=this.children).length;u<s;++u)(a=o[u]).visible&&(this.hasRefitableWidth(a)&&(r=Math.max(r,a.x+a.width)),this.hasRefitableHeight(a)&&(e=Math.max(e,a.y+a.height)));var h=this.padding;this.resize(r+h.getRight(),e+h.getBottom())}else if(n){for(r=0,u=0,s=(o=this.children).length;u<s;++u)(a=o[u]).visible&&this.hasRefitableWidth(a)&&(r=Math.max(r,a.x+a.width));this.resize(r+this.padding.getRight(),void 0)}else if(i){var o;for(e=0,u=0,s=(o=this.children).length;u<s;++u){var a;(a=o[u]).visible&&this.hasRefitableHeight(a)&&(e=Math.max(e,a.y+a.height))}this.resize(void 0,e+this.padding.getBottom())}},i.prototype.isRefitable=function(t){return t instanceof i},i.prototype.hasRefitableHeight=function(t){return this.isRefitable(t)&&!(t instanceof i&&ot(t.getHeight()))},i.prototype.hasRefitableWidth=function(t){return this.isRefitable(t)&&!(t instanceof i&&ot(t.getWidth()))},i.prototype.onReflow=function(){this.Gn.onReflow(this,this.St,this.cn)},Object.defineProperty(i.prototype,"shadow",{get:function(){return this.Un},set:function(t){var n=this.Un;if(n!==t){var i=this.Gn,r=this.Fn,e=this.Wn;null!=n&&(n.off("update",e),i.remove(n),r.remove(n,!0)),this.Un=t,null!=t&&(t.on("update",e),i.add(t),r.addAt(t,!0,0)),rt.update(this)}},enumerable:!1,configurable:!0}),i.prototype.toParentResized=function(){var t=this.getParentOfSize();t&&this.onParentResize(t.width,t.height,t.padding)},i.prototype.getParentOfSize=function(){var t=this.parent;return t instanceof i?t:rt.getLayer(this)},i.prototype.onParentResize=function(t,n,i){var r=this.xn,e=this.transform.position,u=e.x,s=e.y,h=this.St,o=this.cn,a=i.getLeft()+i.getRight(),c=i.getTop()+i.getBottom(),f=null!=r.width?r.width(t,h,a,h):h,l=null!=r.height?r.height(n,o,c,o):o;this.resize(f,l);var v=null!=r.x?r.x(t,this.St,i.getLeft(),u):u,b=null!=r.y?r.y(n,this.cn,i.getTop(),s):s;this.position.set(v,b)},i.prototype.onParentMove=function(t,n,i,r){},i.prototype.onWheel=function(t,n,i){return this.emit("wheel",t,n,i,this),!1},i.prototype.onKeyDown=function(t){return this.emit("keydown",t,this),!1},i.prototype.onKeyUp=function(t){return this.emit("keyup",t,this),!1},i.prototype.isEventTarget=function(t){var n=t.target;if(n===this)return!0;if(null!=n&&!(n instanceof i&&n.interactive)){for(var r=n.parent;null!=r&&!(r instanceof i&&r.interactive);)r=r.parent;return r===this}return!1},i.prototype.onDown=function(t){this.isEventTarget(t)&&this.onDownThis(t),this.emit("down",t,this)},i.prototype.onDownThis=function(n){if("touches"in n.data.originalEvent){var i=this.Yn||new t.Point;this.Yn=i,i.copyFrom(n.data.global)}else this.focusOnClosest()},i.prototype.onUp=function(t){this.isEventTarget(t)&&this.onUpThis(t),this.emit("up",t,this)},i.prototype.onUpThis=function(t){if("touches"in t.data.originalEvent){var n=this.Yn;if(n){var i=t.data.global,r=Math.abs(i.x-n.x),e=Math.abs(i.y-n.y),u=Ki.CLICK_DISTANCE_THRESHOLD;r<u&&e<u&&this.focusOnClosest()}}},i.prototype.focusOnClosest=function(){var t=rt.getLayer(this);if(t){var n=t.getFocusController();n.focus(n.findParent(this))}},i.prototype.onOver=function(t){this.state.isHovered=!0,t.target===this&&this.applyTitle(),this.emit("over",t,this)},i.prototype.onOut=function(t){this.state.isHovered=!1,this.emit("out",t,this)},i.prototype.onDblClick=function(t,n){return this.emit("dblclick",t,n,this),!1},i.prototype.render=function(t){if(this.visible&&0<this.worldAlpha&&this.renderable){var i=this.Fn;i.render(t,!0),n.prototype.render.call(this,t),i.render(t,!1)}},i.prototype.getThemeDefault=function(){return K.getInstance().get(this.getType())},i.prototype.getType=function(){return"DBase"},i.prototype._calculateBounds=function(){var t=this.transform.worldTransform,r=this._bounds,e=i.WORK_CONTAINS_POINT;e.set(0,0),t.apply(e,e),r.addPoint(e),e.set(this.St,this.cn),t.apply(e,e),r.addPoint(e),n.prototype._calculateBounds.call(this)},i.prototype.containsPoint=function(t){return this.containsGlobalPoint(t)||this.containsLocalPoint(this.worldTransform.applyInverse(t,i.WORK_CONTAINS_POINT))},i.prototype.containsGlobalPoint=function(t){return!1},i.prototype.containsLocalPoint=function(t){var n=t.x,i=t.y,r=this.St,e=this.cn;return 0<=n&&n<=r&&0<=i&&i<=e},i.prototype.getClippingRect=function(t,n){n.x=0,n.y=0,n.width=this.St,n.height=this.cn},i.prototype.destroy=function(){var t=this.xn;t.x=null,t.y=null,t.width=null,t.height=null;var i=this.Un;i&&(this.Un=null,i.destroy());for(var r=this.children,e=r.length-1;0<=e;--e)r[e].destroy();r.length=0,n.prototype.destroy.call(this)},i.WORK_CONTAINS_POINT=new t.Point,i}(t.Container),$i=function(t){function n(n){var i=t.call(this)||this;return i.parent=n,i}return B(n,t),n.prototype.render=function(n){this.updateTransform(),t.prototype.render.call(this,n)},n.prototype.onReflow=function(t,n,i){var r=t.corner,e=Math.max(0,r.getRadius()-.5),u=r.getMask(),s=u&Mi.TOP_LEFT?0:e,h=u&Mi.TOP_RIGHT?0:e,o=u&Mi.BOTTOM_LEFT?0:e,a=u&Mi.BOTTOM_RIGHT?0:e;this.clear(),this.beginFill(16777215,1),this.lineStyle(0,0,0,0,!1),s<=0&&h<=0&&o<=0&&a<=0?this.drawRect(0,0,n,i):(this.moveTo(0+s,0),0<h?this.arcTo(0+n,0,0+n,0+i,h):this.lineTo(0+n,0),0<a?this.arcTo(0+n,0+i,0,0+i,a):this.lineTo(0+n,0+i),0<o?this.arcTo(0,0+i,0,0,o):this.lineTo(0,0+i),0<s?this.arcTo(0,0,0+n,0,s):this.lineTo(0,0)),this.endFill()},n}(t.Graphics),tr={NONE:0,CTRL:1,SHIFT:2,ALT:4,AND:8,OR:16,NOT_NONE:23},nr=function(){function t(){}return t.from=function(t){var n="data"in t?t.data.originalEvent:t;return(n.ctrlKey?tr.CTRL:tr.NONE)|(n.altKey?tr.ALT:tr.NONE)|(n.shiftKey?tr.SHIFT:tr.NONE)},t.match=function(n,i){return i&tr.OR?!!(t.from(n)&i):t.from(n)===i},t}(),ir={OFF:0,ON:1,TOUCH:2},rr=function(){function n(){this.pointers=new Map,this.center=new t.Point,this.scale=0,this.time=0}return n.prototype.start=function(t){var n=t.data.originalEvent;"pointerId"in n&&this.pointers.set(n.pointerId,n),this.doUpdate(t)},n.prototype.isUpdatable=function(t){var n=t.data.originalEvent;return!("pointerId"in n)||this.pointers.has(n.pointerId)},n.prototype.update=function(t){var n=t.data.originalEvent;"pointerId"in n&&this.pointers.set(n.pointerId,n),this.doUpdate(t)},n.prototype.end=function(t){var n=!0,i=t.data.originalEvent;if("touches"in i)n=i.touches.length<=0;else if("pointerId"in i){var r=this.pointers;r.delete(i.pointerId),n=r.size<=0}return this.doUpdate(t),n},n.prototype.bind=function(t){var n=this.interactionManager;if(n){var i=this.onMove;i&&n.on(Ki.move,i);var r=this.onEnd;r&&(n.on(Ki.up,r),n.on(Ki.upoutside,r),n.on(Ki.cancel,r))}},n.prototype.unbind=function(){var t=this.interactionManager;if(t){var n=this.onMove;n&&t.off(Ki.move,n);var i=this.onEnd;i&&(t.off(Ki.up,i),t.off(Ki.upoutside,i),t.off(Ki.cancel,i))}},n.prototype.doUpdate=function(t){var n=this.interactionManager,i=this.center,r=t.data.originalEvent;if(this.scale=0,this.time=r.timeStamp,"touches"in r){var e=r.touches,u=e.length;if(0<u){for(var s=0,h=0,o=0,a=e.length;o<a;++o)s+=(f=e[o]).clientX,h+=f.clientY;if(s/=u,h/=u,n?n.mapPositionToPoint(i,s,h):i.set(s,h),1<u){var c=0;for(o=1,a=e.length;o<a;++o){var f,l=(f=e[o]).clientX-s,v=f.clientY-h;c=Math.max(c,l*l+v*v)}this.scale=Math.sqrt(c)}}}else if("pointerId"in r){var b=this.pointers,d=b.size;if(0<d){var g=0,m=0;if(b.forEach((function(t){g+=t.clientX,m+=t.clientY})),g/=d,m/=d,n?n.mapPositionToPoint(i,g,m):i.set(g,m),1<d){var w=0;b.forEach((function(t){var n=t.clientX-g,i=t.clientY-m;w=Math.max(w,n*n+i*i)})),this.scale=Math.sqrt(w)}}}else i.copyFrom(t.data.global)},n}(),er=function(){function t(){}return t.LINEAR=function(t){return t},t.ELASTIC=function(t){return t*(3*(1-t)*(1-t)+t*(3*(1-t)+t))},t.QUAD_IN_OUT=function(t){return t<.5?2*t*t:(4-2*t)*t-1},t}(),ur=function(t){function n(n){var i,r,e,u=this;(u=t.call(this)||this).R=null,u.Jn=null!==(i=null==n?void 0:n.target)&&void 0!==i?i:null,u.Zn=0,u.qn=null!==(r=null==n?void 0:n.duration)&&void 0!==r?r:200,u.Qn=1/Math.max(1,u.qn),u.$n=!1,u.ti=null==n?void 0:n.onTime,u.ni=function(){u.onTimeBase()},u.ii=null==n?void 0:n.onStart,u.ri=null==n?void 0:n.onEnd,u.ei=null!==(e=null==n?void 0:n.timing)&&void 0!==e?e:er.ELASTIC;var s=null==n?void 0:n.on;if(s)for(var h in s){var o=s[h];o&&u.on(h,o)}return u}return B(n,t),Object.defineProperty(n.prototype,"target",{get:function(){return this.Jn},set:function(t){this.Jn=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"duration",{get:function(){return this.qn},set:function(t){this.qn=t,this.Qn=1/Math.max(1,t)},enumerable:!1,configurable:!0}),n.prototype.start=function(t){void 0===t&&(t=!1),this.stop(),this.Zn=Date.now(),this.$n=t,this.R=window.setTimeout(this.ni,0),this.onStart(t);var n=this.qn,i=this.toTime(t?n:0);this.onTime(i,t,0)},n.prototype.onStart=function(t){var n=this.ii;null!=n&&n(t,this),this.emit("start",t,this)},n.prototype.onTime=function(t,n,i){var r=this.ti;null!=r&&r(t,n,i,this),this.emit("time",t,n,i,this)},n.prototype.onEnd=function(t){var n=this.ri;null!=n&&n(t,this),this.emit("end",t,this)},n.prototype.isStarted=function(){return null!=this.R},n.prototype.isReverse=function(){return this.$n},n.prototype.onTimeBase=function(){if(null!=this.R){this.R=null;var t=Date.now()-this.Zn,n=this.qn,i=this.$n;if(t<n){this.R=window.setTimeout(this.ni,0);var r=this.toTime(i?n-t:t);this.onTime(r,i,t)}else r=this.toTime(i?0:n),this.onTime(r,i,t),this.onEnd(i)}},n.prototype.toTime=function(t){return this.ei(t*this.Qn,this)},n.prototype.stop=function(){var t=this.R;null!=t&&(this.R=null,window.clearTimeout(t))},n.prototype.end=function(){var t=this.R;if(null!=t){this.R=null,window.clearTimeout(t);var n=this.$n,i=Date.now()-this.Zn,r=this.qn,e=this.toTime(n?0:r);this.onTime(e,n,i),this.onEnd(n)}},n}(t.utils.EventEmitter),sr=function(){function t(t,n,i,r){this.dx=t,this.dy=n,this.ds=i,this.dt=r}return t.prototype.set=function(t,n,i,r){this.dx=t,this.dy=n,this.ds=i,this.dt=r},t}(),hr=function(){function t(t,n,i){var r,e=this;this.si=[],this.hi=[],this.oi=0,this.ai=-1,this.ci=0,this.fi=0,this.li=0,this.vi=0,this.bi=0,this._t=0,this.di=new ur({onTime:function(t){e.onEase(t)},onEnd:function(){e.onEaseEnd()},timing:er.LINEAR,duration:333*(null!==(r=null==i?void 0:i.duration)&&void 0!==r?r:1)}),this.gi=t,this.ri=n}return t.prototype.onStart=function(){for(var n=this.si,i=n.length,r=t.HISTORY_CAPACITY;i<r;++i)n.push(new sr(0,0,1,0));this.oi=0,this.ai=-1,this.di.stop()},t.prototype.onMove=function(n,i,r,e){var u=t.HISTORY_CAPACITY,s=this.ai,h=(s+1)%u;this.ai=h;var o=this.oi;(h<s||0<=s&&s<o)&&(this.oi=(o+1)%u),this.si[h].set(n,i,r,e)},t.prototype.updateHistoriesSorted=function(t){var n=this.si,i=this.hi,r=this.oi,e=this.ai,u=n.length;if(e<0)return i.length=0,t;if(e<r){var s=t;i.length=0;for(var h=e;0<=h;--h){var o=n[h];if(!(s+o.dt<160))return s;s+=o.dt,i.push(o)}for(h=u-1;r<=h;--h){var a=n[h];if(!(s+a.dt<160))return s;s+=a.dt,i.push(a)}return s}for(s=t,i.length=0,h=e;r<=h;--h){var c=n[h];if(!(s+c.dt<160))return s;s+=c.dt,i.push(c)}return s},t.prototype.onEnd=function(t){this.updateHistoriesSorted(t);var n=this.hi,i=n.length;if(i<=0)return this.onEaseEnd();for(var r=0,e=0,u=0,s=0,h=0;h<i;++h){var o=n[h];r+=o.dx,e+=o.dy,u+=o.ds,s+=o.dt}if(s<=0)return this.onEaseEnd();var a=1/i;r*=a,e*=a,u*=a,s*=a,this.ci=r,this.fi=e,this.li=u,this.vi=s;var c=this.di,f=c.duration;this._t=-t/f,this.bi=f/s,c.start()},t.prototype.onEase=function(t){var n=this._t;this._t=t;var i=(1-.5*(t+n))*(t-n)*this.bi;this.gi(this.ci*i,this.fi*i,1+(this.li-1)*i,t)},t.prototype.onEaseEnd=function(){this.ri()},t.prototype.stop=function(){this.di.stop()},t.HISTORY_CAPACITY=5,t}(),or=function(){function t(t){var n,i,r,e=t.on;e&&(this.ii=e.start,this.gi=e.move,this.ri=e.end),this.wi=null!==(n=null==t?void 0:t.modifier)&&void 0!==n?n:tr.NONE;var u=t.checker,s=nr.match;this.Oi=null!==(i=null==u?void 0:u.start)&&void 0!==i?i:s,this.pi=null!==(r=null==u?void 0:u.move)&&void 0!==r?r:s,this.Di=t.easing,this.Ei=!!t.touch,this.Mi=[],this.Si=new Map;var h=t.bind;null!=h&&this.bind(h)}return t.prototype.newData=function(t){var n=this.Si,i=n.get(t);if(null!=i)return i;var r=this.Mi.pop();if(null!=r)return n.set(t,r),r;var e=new rr;return e.easing=this.newEasing(e),e.onMove=this.newOnMove(e),e.onEnd=this.newOnEnd(e),n.set(t,e),e},t.prototype.newEasing=function(t){var n=this,i=this.Di;if(null==i||!1!==i)return new hr((function(i,r,e,u){n.onEasingMove(i,r,e,u,t)}),(function(){n.onEasingEnd(t)}),this.toEasingOptions(i))},t.prototype.toEasingOptions=function(t){return null==t||!0===t?void 0:t},t.prototype.deleteData=function(t){var n=t.target;n&&this.Si.delete(n)&&(t.target=void 0,t.pointers.clear(),this.Mi.push(t))},t.prototype.bind=function(t){var n=this;return t.on(Ki.down,(function(i){n.onDown(t,i)})),this},t.prototype.isTouch=function(t){var n=t.data.originalEvent;return"touches"in n||"pointerId"in n&&"mouse"!==n.pointerType},t.prototype.onDown=function(t,n){var i;if((!this.Ei||this.isTouch(n))&&this.Oi(n,this.wi,t)){var r=rt.getLayer(t);if(null!=r)if(n.stopPropagation(),t.state.isGesturing)null===(i=this.Si.get(t))||void 0===i||i.start(n);else{var e=this.ii;null!=e&&e(t);var u=this.newData(t);u.target=t,t.state.isGesturing=!0;var s=r.renderer.plugins.interaction;u.interactionManager=s,u.start(n);var h=u.easing;h&&h.onStart(),u.bind(n)}}},t.prototype.newOnMove=function(t){var n=this;return function(i){n.onMove(i,t)}},t.prototype.newOnEnd=function(t){var n=this;return function(i){n.onEnd(i,t)}},t.prototype.onMove=function(t,n){var i=n.target;if(null!=i&&i.state.isGesturing&&n.isUpdatable(t)&&this.pi(t,this.wi,i)){var r=n.center,e=r.x,u=r.y,s=n.scale,h=n.time;n.update(t);var o=r.x,a=r.y,c=n.scale,f=o-e,l=a-u,v=n.time-h,b=1e-5,d=b<s&&b<c?c/s:1,g=n.easing;g&&g.onMove(f,l,d,v);var m=this.gi;null!=m&&(0===f&&0===l&&1===d||m(i,f,l,o,a,d))}},t.prototype.onEnd=function(t,n){var i=n.target;if(null!=i&&i.state.isGesturing&&n.end(t)){i.state.isGesturing=!1;var r=n.interactionManager;if(n.interactionManager=void 0,r){var e=n.onMove;e&&r.off(Ki.move,e);var u=n.onEnd;u&&(r.off(Ki.up,u),r.off(Ki.cancel,u))}var s=this.ri;null!=s&&s(i);var h=n.easing;h?h.onEnd(t.data.originalEvent.timeStamp-n.time):this.deleteData(n)}},t.prototype.onEasingMove=function(t,n,i,r,e){if(null!=e.target){var u=this.gi;if(null!=u&&(0!==t||0!==n||1!==i)){var s=e.center,h=s.x+t,o=s.y+n;s.set(h,o),u(e.target,t,n,h,o,i)}}},t.prototype.onEasingEnd=function(t){this.deleteData(t)},t.prototype.stop=function(t){var n,i=this.Si.get(t);null!=i&&(null===(n=i.easing)||void 0===n||n.stop(),this.deleteData(i))},t}(),ar=function(){function t(t,n,i,r,e,u){var s,h,o=this;this.O=t,this.Ti=i,this.ji=r;var a=Di(null!==(s=null==u?void 0:u.mode)&&void 0!==s?s:e.getGestureMode(),ir),c=Di(null!==(h=null==u?void 0:u.modifier)&&void 0!==h?h:e.getGestureModifier(),tr);a!==ir.ON&&a!==ir.TOUCH||(this.Ni=new or({touch:a===ir.TOUCH,modifier:c,checker:u&&u.checker,easing:{duration:null==u?void 0:u.duration},on:{start:function(){o.Ti.stop()},move:function(i,r,e,u,s,h){o.onGestureMove(n(t),r,e,u,s,h)}}}))}return t.prototype.onGestureMove=function(t,n,i,r,e,u){if(t){var s=this.Ti,h=t.scale,o=h.x,a=h.y,c=s.toNormalizedScale(o*u),f=s.toNormalizedScale(a*u),l=c/o,v=f/a,b=u<1?Math.max(l,v):Math.min(l,v);c=b*o,f=b*a;var d=r-n,g=e-i,m=t.position,w=(m.x-d)*b+r,O=(m.y-g)*b+e;this.ji(t,w,O,c,f)}},t.prototype.stop=function(){var t;null===(t=this.Ni)||void 0===t||t.stop(this.O)},t.prototype.onDown=function(t){var n;null===(n=this.Ni)||void 0===n||n.onDown(this.O,t)},t}(),cr=function(){function t(t,n,i,r,e){var u=this;this.O=t,this.Ii=n,this.ji=r,this.Ci=1,this.Ai=1,this.Ri=0,this.Li=0,this.yi=1,this.ki=1,this.xi=0,this.Bi=0,this.di=new ur({onTime:function(t){u.onTime(t)},duration:e}),this.Ti=i,this.qn=e}return t.prototype.onTime=function(t){var n=1-t,i=t,r=this.yi*n+this.Ci*i,e=this.ki*n+this.Ai*i,u=this.xi*n+this.Ri*i,s=this.Bi*n+this.Li*i,h=this.Ii(this.O);null!=h&&this.ji(h,u,s,r,e)},t.prototype.start=function(t,n,i,r,e,u,s){if(!1!==s&&this.Ti.stop(),null==u&&(u=this.qn),u<=0)this.ji(t,n,i,r,e);else{var h=t.position,o=t.scale;this.xi=h.x,this.Bi=h.y,this.yi=o.x,this.ki=o.y,this.Ri=n,this.Li=i,this.Ci=r,this.Ai=e,this.di.duration=u,this.di.start()}},t.prototype.stop=function(){this.di.stop()},t}(),fr=function(){function n(i,r,e){var u,s,h,o,a,c,f,l,v,b,d,g,m,w,O,p,D;this.O=i,this.Ii=r,this.ji=e&&e.constraint||n.CONSTRAINT,this._i=new t.Rectangle;var E=this.toTheme(e)||this.getThemeDefault(),M=null==e?void 0:e.zoom;this.Pi=new t.Point,this.Ui=null!==(u=null==M?void 0:M.min)&&void 0!==u?u:E.getZoomMin(),this.Fi=null!==(s=null==M?void 0:M.max)&&void 0!==s?s:E.getZoomMax(),this.Gi=null!==(h=null==M?void 0:M.keepRatio)&&void 0!==h?h:E.getZoomKeepRatio();var S=null==M?void 0:M.wheel;this.Hi=null!==(o=null==S?void 0:S.enable)&&void 0!==o?o:E.isWheelZoomEnabled(),this.zi=null!==(a=null==S?void 0:S.speed)&&void 0!==a?a:E.getWheelZoomSpeed(),this.Vi=Di(null!==(c=null==S?void 0:S.modifier)&&void 0!==c?c:E.getWheelZoomModifier(),tr),this.Wi=null!==(f=null==S?void 0:S.checker)&&void 0!==f?f:nr.match;var T=null==M?void 0:M.dblclick;this.Xi=null!==(l=null==T?void 0:T.enable)&&void 0!==l?l:E.isDblClickZoomEnabled(),this.Ki=null!==(v=null==T?void 0:T.amount)&&void 0!==v?v:E.getDblClickZoomSpeed(),this.Yi=Di(null!==(b=null==T?void 0:T.modifier)&&void 0!==b?b:E.getDblClickZoomModifier(),tr),this.Ji=null!==(d=null==T?void 0:T.checker)&&void 0!==d?d:nr.match,this.Zi=null!==(g=null==T?void 0:T.duration)&&void 0!==g?g:E.getDblClickZoomDuration();var j=null===(m=null==e?void 0:e.translation)||void 0===m?void 0:m.wheel;this.qi=null!==(w=null==j?void 0:j.enable)&&void 0!==w?w:E.isWheelTranslationEnabled(),this.Qi=null!==(O=null==j?void 0:j.speed)&&void 0!==O?O:E.getWheelTranslationSpeed(),this.$i=Di(null!==(p=null==j?void 0:j.modifier)&&void 0!==p?p:E.getWheelTranslationModifier(),tr),this.tr=null!==(D=null==j?void 0:j.checker)&&void 0!==D?D:nr.match,this.nr=new ar(i,r,this,this.ji,E,null==e?void 0:e.gesture),this.I=new cr(i,r,this,this.ji,this.Zi)}return Object.defineProperty(n.prototype,"gesture",{get:function(){return this.nr},enumerable:!1,configurable:!0}),n.prototype.stop=function(){this.nr.stop(),this.I.stop()},n.prototype.reset=function(t,n){var i=this.O,r=this.Ii(i);if(r){var e=r.getLocalBounds(this._i),u=.5*(i.width-e.width)-e.x,s=.5*(i.height-e.height)-e.y;this.I.start(r,u,s,1,1,t,n)}},n.prototype.fit=function(t,n){var i=this.O,r=this.Ii(i);if(r){var e=i.padding,u=i.width,s=i.height,h=r.getLocalBounds(this._i),o=h.x,a=h.y,c=h.width,f=h.height,l=(u-e.getLeft()-e.getRight())/c,v=(s-e.getTop()-e.getBottom())/f;if(this.Gi){var b=this.toNormalizedScale(Math.min(l,v));l=b,v=b}else l=this.toNormalizedScale(l),v=this.toNormalizedScale(v);var d=.5*(u-c*l)-o*l,g=.5*(s-f*v)-a*v;this.I.start(r,d,g,l,v,t,n)}},n.prototype.zoomIn=function(t,n){var i=this.Ii(this.O);if(i){var r=this.Ki,e=i.scale;this.zoom(e.x*r,e.y*r,t,n)}},n.prototype.zoomOut=function(t,n){var i=this.Ii(this.O);if(i){var r=1/this.Ki,e=i.scale;this.zoom(e.x*r,e.y*r,t,n)}},n.prototype.zoomAt=function(t,n,i,r,e,u){var s=this.Ii(this.O);if(s){var h=s.scale.x,o=s.scale.y,a=this.toNormalizedScale(i),c=this.toNormalizedScale(r),f=a/h,l=c/o,v=(s.position.x-t)*f+t,b=(s.position.y-n)*l+n;this.I.start(s,v,b,a,c,e,u)}},n.prototype.zoomAtGlobal=function(t,n,i,r,e,u){var s=this.Pi;s.set(t,n),this.toLocal(s,s),this.zoomAt(s.x,s.y,i,r,e,u)},n.prototype.zoom=function(t,n,i,r){var e=this.O;this.zoomAt(.5*e.width,.5*e.height,t,n,i,r)},Object.defineProperty(n.prototype,"scale",{get:function(){var n=this.Ii(this.O);return n?n.scale:new t.Point(1,1)},set:function(t){var n=this.Ii(this.O);if(n){var i=this.toNormalizedScale(t.x),r=this.toNormalizedScale(t.y),e=n.position;this.ji(n,e.x,e.y,i,r)}},enumerable:!1,configurable:!0}),n.prototype.moveTo=function(t,n,i,r){var e=this.Ii(this.O);if(e){var u=e.scale;this.I.start(e,t,n,u.x,u.y,i,r)}},Object.defineProperty(n.prototype,"position",{get:function(){var n=this.Ii(this.O);return n?n.position:new t.Point(0,0)},set:function(t){var n=this.Ii(this.O);if(n){var i=n.scale;this.ji(n,t.x,t.y,i.x,i.y)}},enumerable:!1,configurable:!0}),n.prototype.transform=function(t,n,i,r,e,u){var s=this.Ii(this.O);s&&this.I.start(s,t,n,i,r,e,u)},n.prototype.toLocal=function(t,n,i){return this.O.toLocal(t,void 0,n,i)},n.prototype.toGlobal=function(t,n,i){return this.O.toGlobal(t,n,i)},n.prototype.toNormalizedScale=function(t){return Math.min(this.Fi,Math.max(this.Ui,t))},n.prototype.onWheel=function(t,n,i){var r;if(this.Hi&&this.Wi(t,this.Vi,this.O)&&0!==n.deltaY&&(r=this.Ii(this.O))){var e=n.lowest*this.zi,u=1+n.deltaY*e,s=r.scale;return this.zoomAtGlobal(i.x,i.y,s.x*u,s.y*u,0),!0}if(this.qi&&this.tr(t,this.$i,this.O)&&(r=this.Ii(this.O))){this.stop(),e=n.lowest*this.Qi;var h=r.position,o=h.x-n.deltaX*e,a=h.y+n.deltaY*e;return s=r.scale,this.ji(r,o,a,s.x,s.y),!0}return!1},n.prototype.onDown=function(t){this.nr.onDown(t)},n.prototype.onDblClick=function(t,n){if(this.Xi&&this.Ji(t,this.Yi,this.O)){var i=this.Ii(this.O);if(i){var r=this.Pi;Ki.toGlobal(t,n,r);var e=this.Ki,u=i.scale;return this.zoomAtGlobal(r.x,r.y,u.x*e,u.y*e,this.Zi),!0}}return!1},n.prototype.toTheme=function(t){if(t&&t.theme){var n=t.theme;return at(n)?K.getInstance().get(n):n}return null},n.prototype.getThemeDefault=function(){return K.getInstance().get(this.getType())},n.prototype.getType=function(){return"DView"},n.CONSTRAINT=function(t,n,i,r,e){t.scale.set(r,e),t.position.set(n,i)},n}(),lr=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.init=function(n){var i,r=this;t.prototype.init.call(this,n),this.ir=null;var e=this.theme;this.rr=new fr(this,(function(){return r.ir}),null==n?void 0:n.view);var u=null==n?void 0:n.canvas;u&&(this.canvas=u),(null!==(i=null==n?void 0:n.mask)&&void 0!==i?i:e.isOverflowMaskEnabled())&&(this.mask=this.getOverflowMask())},n.prototype.getType=function(){return"DCanvasContainer"},n.prototype.onResize=function(n,i,r,e){t.prototype.onResize.call(this,n,i,r,e),this.updateContentSize(n,i,r,e)},Object.defineProperty(n.prototype,"canvas",{get:function(){return this.ir},set:function(t){var n=this.ir;null!=n&&(this.ir=null,this.removeChild(n),this.emit("unset",n,this),n.destroy()),this.ir=t,null!=t?(this.addChild(t),this.rr.reset(0),this.emit("set",t,this)):rt.update(this)},enumerable:!1,configurable:!0}),n.prototype.getOverflowMask=function(){return null==this.er&&(this.er=new $i(this),this.Gn.add(this.er),this.toDirty()),this.er},n.prototype.updateContentSize=function(t,n,i,r){var e=this.ir;if(null!=e){var u=e.x+.5*(t-i),s=e.y+.5*(n-r);e.position.set(u,s)}},Object.defineProperty(n.prototype,"view",{get:function(){return this.rr},enumerable:!1,configurable:!0}),n.prototype.onWheel=function(n,i,r){var e=this.rr.onWheel(n,i,r),u=t.prototype.onWheel.call(this,n,i,r);return e||u},n.prototype.onDblClick=function(n,i,r){if(!0!==r){var e=this.rr.onDblClick(n,i),u=t.prototype.onDblClick.call(this,n,i);return e||u}return t.prototype.onDblClick.call(this,n,i)},n.prototype.onDown=function(n,i){!0!==i&&this.rr.onDown(n),t.prototype.onDown.call(this,n)},n.prototype.destroy=function(){var n=this.er;null!=n&&(this.er=null,n.destroy()),this.mask=null,t.prototype.destroy.call(this)},n}(Qi),vr={DIAGRAM:0,PAGE:1,EXTENSION:1e3},br=function(){function t(t){this.ur=this.newSources(t)}return t.prototype.map=function(n,i,r){var e=this.ur;if(null==e)return!1;var u=n.id,s=u.toLowerCase(),h=s.length;if(h!==u.length)return!1;var o=e[0],a=o.length;if(0!==a&&0!==s.indexOf(o))return!1;var c=t.SPANS;c[0]=0,c[1]=a;for(var f=e.length,l=1;l<f;++l){var v=l<<1,b=e[l],d=b.length;if(0===d)c[v]=h,c[v+1]=h;else{var g=s.indexOf(b,c[v-1]);if(g<0)return!1;c[v]=g,c[v+1]=g+d}}if(null!=i){for(var m=i.length,w="",O=(l=0,f);l<O;++l){var p=l<m?i[l]:e[l],D=c[1+(v=l<<1)],E=c[v+2];w+=p+u.substring(D,l+1<O?E:h)}n.id=w}return 0<r.length&&(n.initial=r),!0},t.prototype.newSources=function(n){if(null==n)return null;var i=n.trim();return i.length<=0?null:i.toLowerCase().split(t.WILDCARD)},t.split=function(t){if(null==t)return null;var n=t.trim();return n.length<=0?null:n.split(this.WILDCARD)},t.WILDCARD="*",t.SPANS=[],t}(),dr=function(){function t(t,n,i,r,e){this.resources=t.resources,this.data=t.data||t.tags||t.resources,this.pieces=n,this.pieceData=i,this.mode=r,this.depth=e,this.sr=new Map,this.hr=new Map,this.ar=new Map,this.Pt=new Map,this.cr=new Map,this.lr=new Map,this.vr=new Map,this.br=new Map,this.dr=new Map,this.gr=new Map,this.mr=new Map,this.wr=new Map,this.Or=new Map,this.pr=new Map,this.Dr=new Map,this.Er=new Map}return t.prototype.getAction=function(t){return this.sr.get(t)},t.prototype.setAction=function(t,n){this.sr.set(t,n)},t.prototype.getFill=function(t){return this.hr.get(t)},t.prototype.setFill=function(t,n){this.hr.set(t,n)},t.prototype.getStroke=function(t){return this.ar.get(t)},t.prototype.setStroke=function(t,n){this.ar.set(t,n)},t.prototype.getData=function(t){return this.Pt.get(t)},t.prototype.setData=function(t,n){this.Pt.set(t,n)},t.prototype.getDataValue=function(t){return this.cr.get(t)},t.prototype.setDataValue=function(t,n){this.cr.set(t,n)},t.prototype.getDataMapping=function(t){return this.lr.get(t)},t.prototype.setDataMapping=function(t,n){this.lr.set(t,n)},t.prototype.getDataMapper=function(t){var n=this.vr,i=n.get(t);return void 0===i&&(i=new br(t),n.set(t,i)),i},t.prototype.getDataDestination=function(t){var n=this.br,i=n.get(t);return void 0===i&&(i=br.split(t),n.set(t,i)),i},t.prototype.getDataSystem=function(t){return this.dr.get(t)},t.prototype.setDataSystem=function(t,n){this.dr.set(t,n)},t.prototype.getRange=function(t){return this.gr.get(t)},t.prototype.setRange=function(t,n){this.gr.set(t,n)},t.prototype.getAlign=function(t){return this.mr.get(t)},t.prototype.setAlign=function(t,n){this.mr.set(t,n)},t.prototype.getMargin=function(t){return this.wr.get(t)},t.prototype.setMargin=function(t,n){this.wr.set(t,n)},t.prototype.getText=function(t){return this.Or.get(t)},t.prototype.setText=function(t,n){this.Or.set(t,n)},t.prototype.getTextOutline=function(t){return this.pr.get(t)},t.prototype.setTextOutline=function(t,n){this.pr.set(t,n)},t.prototype.getCapability=function(t){return this.Dr.get(t)},t.prototype.setCapability=function(t,n){this.Dr.set(t,n)},t.prototype.getExtension=function(t){return this.Er.get(t)},t.prototype.setExtension=function(t,n){this.Er.set(t,n)},t}(),gr={VIEWER:0,EDITOR_DATA_MAPPED:1,EDITOR:2},mr=function(){function t(){}return t.get=function(t){var n=this.mappings[t];return null!=n?n:wt.PRIMITIVE},t.contains=function(t,n){if(null!=t){var i=this.get(t.type),r=t.getCapability();return null!=r&&(i&=~r.removed,i|=r.added,i&=~r.locked),(i&n)===n}return!1},t.set=function(t,n){this.mappings[t]=n},t.mappings={},t}(),wr=function(){this.localTransform=new t.Matrix,this.internalTransform=new t.Matrix,this.internalTransformParentInverse=new t.Matrix,this.rotation=0,this.size=new t.Point},Or=function(t){return Math.abs(t)<.001?t<0?-.001:.001:t},pr=function(){function t(){}return t.prepare=function(t){var n=t.editor||new wr;t.editor=n,t.updateTransform();var i=t.parent;i instanceof pt?i.transform.internalTransform.copyTo(n.internalTransformParentInverse).invert():n.internalTransformParentInverse.identity(),t.transform.internalTransform.copyTo(n.internalTransform),n.rotation=t.transform.rotation,n.size.copyFrom(t.size),t.disallowOnTransformChange()},t.finalize=function(t){t.allowOnTransformChange(!0)},t.apply=function(t,n,i){var r=t.editor;if(null!=r){var e=r.localTransform;if(r.internalTransformParentInverse.copyTo(e).append(n).append(r.internalTransform),i)this.applyLocal(t,e);else{var u=r.size;this.applyLocal(t,e,u.x,u.y)}}},t.applyLocal=function(t,n,i,r){t.disallowUploadedUpdate();var e=n.a,u=n.b,s=n.c,h=n.d,o=n.tx,a=n.ty,c=t.transform,f=Math.atan2(-s,h),l=Math.atan2(+u,e);c.rotation=.5*(f+l);var v=.5*(l-f);c.skew.set(v,v);var b=c.pivot,d=b.x,g=b.y;if(c.position.set(o+(e*d+s*g),a+(u*d+h*g)),null!=i&&null!=r){var m=Math.sqrt(e*e+u*u),w=Math.sqrt(s*s+h*h);t.size.set(Or(i*m),Or(r*w))}t.allowUploadedUpdate()},t}(),Dr=function(){function n(n,i,r){this.shape=n,this.base=new t.Point(i,r);var e=n.size;this.shapeBase=new t.Point(e.x,e.y),this.transform=new t.Matrix,n.updateTransform(),n.transform.localTransform.copyTo(this.transform),this.capable=mr.contains(n,wt.POSITION)&&mr.contains(n,wt.WIDTH)&&mr.contains(n,wt.HEIGHT)&&mr.contains(n,wt.ROTATION)&&mr.contains(n,wt.SKEW)}return n.prototype.isCompatible=function(t){return this.shape===t},n.prototype.reset=function(t,n,i){this.base.set(n,i);var r=t.size;this.shapeBase.copyFrom(r),t.updateTransform(),t.transform.localTransform.copyTo(this.transform)},n.prototype.update=function(t,i,r,e,u){if(this.capable){var s=i/this.base.x,h=r/this.base.y,o=this.shapeBase,a=n.WORK_TRANSFORM;a.identity().append(this.transform).translate(-e,-u).scale(s,h).translate(+e,+u),t.disallowOnTransformChange(),pr.applyLocal(t,a,o.x,o.y),t.allowOnTransformChange(!1)}},n.WORK_TRANSFORM=new t.Matrix,n}(),Er=function(){function n(n,i,r,e){this.Mr=new t.Rectangle,this.Sr=new t.Rectangle,this.O=n,this.Tr=[],this.j=new t.Point(i,r),this.jr=e}return n.prototype.init=function(){},Object.defineProperty(n.prototype,"x",{get:function(){return this.j.x},set:function(t){var n=this.j;if(n.x!==t){var i=n.x;n.x=t,this.onChange(i,n.y)}},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"y",{get:function(){return this.j.y},set:function(t){var n=this.j;if(n.y!==t){var i=n.y;n.y=t,this.onChange(n.x,i)}},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n){var i=!1,r=this.j,e=r.x,u=r.y;return null!=t&&e!==t&&(i=!0,r.x=t),null!=n&&u!==n&&(i=!0,r.y=n),i&&this.onChange(e,u),this},n.prototype.clone=function(){var t=this.j;return new n(this.O,t.x,t.y,this.jr)},n.prototype.copy=function(){},n.prototype.copyFrom=function(t){var n=t.x,i=t.y,r=this.j,e=r.x,u=r.y;return e===n&&u===i||(r.x=n,r.y=i,this.onChange(e,u)),this},n.prototype.copyTo=function(t){return this.j.copyTo(t)},n.prototype.equals=function(t){return this.j.equals(t)},n.prototype.fit=function(){this.jr&&this.doFit()},n.prototype.doFit=function(){var t=this.O;t.disallowOnTransformChange();var n=this.calcRect(this.Sr),i=this.j;i.set(n.width,n.height),t.updateTransform();var r=t.transform,e=n.x+.5*n.width,u=n.y+.5*n.height,s=r.position,h=r.localTransform,o=h.a,a=h.b,c=h.c,f=h.d,l=r.pivot;s.set(s.x+(o*e+c*u)-(o*l.x+c*l.y),s.y+(a*e+f*u)-(a*l.x+f*l.y)),l.set(e,u),this.reset(t.children,this.Tr,i),t.allowOnTransformChange(!0)},n.prototype.reset=function(t,n,i){for(var r=0,e=Math.min(n.length,t.length);r<e;++r){var u=t[r],s=n[r];if(!s.isCompatible(u)){n.length=r;break}s.reset(u,i.x,i.y)}t.length<n.length&&(n.length=t.length)},n.prototype.calcRect=function(t){var n=this.O.children;if(n.length<=0)t.x=0,t.y=0,t.width=0,t.height=0;else{var i=this.Mr;n[0].getBoundsLocal(!1,t);for(var r=1,e=n.length;r<e;++r)n[r].getBoundsLocal(!1,i),t.enlarge(i)}return t},n.prototype.onChange=function(t,n){var i=this.O,r=this.j,e=i.transform.pivot;this.Nr(i.children,this.Tr,r.x,r.y,e.x,e.y,t,n),i.onSizeChange()},n.prototype.Nr=function(t,n,i,r,e,u,s,h){for(var o=0,a=Math.min(n.length,t.length);o<a;++o){var c=t[o];if(!(f=n[o]).isCompatible(c)){n.length=o;break}f.update(c,i,r,e,u)}for(o=n.length,a=t.length;o<a;++o){var f;c=t[o],(f=this.newLayout(c,s,h)).update(c,i,r,e,u),n.push(f)}n.length!==t.length&&(n.length=t.length)},n.prototype.newLayout=function(t,n,i){return t.layout||new Dr(t,n,i)},n}(),Mr=function(){function n(n,i,r,e,u){this.O=n,this._x=i,this._y=r,this.Ir=new t.Point(e,u)}return Object.defineProperty(n.prototype,"x",{get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this.onChange())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"y",{get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this.onChange())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"base",{get:function(){return this.Ir},enumerable:!1,configurable:!0}),n.prototype.init=function(){this.Ir.copyFrom(this),this.onChange()},n.prototype.clone=function(){var t=this.Ir;return new n(this.O,this._x,this._y,t.x,t.y)},n.prototype.set=function(t,n){var i=!1;return null!=t&&this._x!==t&&(this._x=t,i=!0),null!=n&&this._y!==n&&(this._y=n,i=!0),i&&this.onChange(),this},n.prototype.copyFrom=function(t){return t instanceof n&&this.Ir.copyFrom(t.base),this._x===t.x&&this._y===t.y||(this._x=t.x,this._y=t.y,this.onChange()),this},n.prototype.copyTo=function(t){return t instanceof n&&this.Ir.copyTo(t.base),t.set(this._x,this._y),t},n.prototype.equals=function(t){return t.x===this._x&&t.y===this._y},n.prototype.fit=function(){},n.prototype.onChange=function(){var t=this.Ir;this.O.transform.scale.set(this._x/t.x,this._y/t.y)},n}(),Sr=function(){function t(){}return Object.defineProperty(t.prototype,"enable",{get:function(){return!0},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return 16777215},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return 1},set:function(t){},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){},t.prototype.set=function(t,n,i){},t.prototype.clone=function(){return new t},t.prototype.toObject=function(){return{enable:!0,color:16777215,alpha:1}},t.prototype.serialize=function(t){return-1},t.prototype.deserialize=function(t,n){},t}(),Tr=function(){function t(){}return Object.defineProperty(t.prototype,"enable",{get:function(){return!1},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return 16777215},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return 1},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return 1},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"align",{get:function(){return 0},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"side",{get:function(){return Gt.NONE},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"style",{get:function(){return s.NONE},set:function(t){},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){},t.prototype.set=function(t,n,i,r,e,u,s){},t.prototype.clone=function(){return new t},t.prototype.toObject=function(){return{enable:!1,color:16777215,alpha:1,width:1,align:0,side:Gt.NONE,style:s.NONE}},t.prototype.serialize=function(t){return-1},t.prototype.deserialize=function(t,n){},t}(),jr=function(t){function n(n,i,r){var e=t.call(this,r)||this;e.Cr=n,e.Ar=i;var u=e.newData();return e.data=u,e.tag=u,e.size=e.newGroupSize(n,i),e.fill=e.newGroupFill(),e.stroke=e.newGroupStroke(),e.text=e.newGroupText(),e}return B(n,t),Object.defineProperty(n.prototype,"mode",{get:function(){return this.Cr},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"depth",{get:function(){return this.Ar},enumerable:!1,configurable:!0}),n.prototype.newGroupSize=function(t,n){var i=Y.SIZE_X,r=Y.SIZE_Y;return t!==gr.VIEWER?new Er(this,i,r,this.isGroupSizeFittable()):new Mr(this,i,r,i,r)},n.prototype.isGroupSizeFittable=function(){return!0},n.prototype.newData=function(){return new kt},n.prototype.newGroupFill=function(){return new Sr},n.prototype.newGroupStroke=function(){return new Tr},n.prototype.newGroupText=function(){return new Pt(this,Y.TEXT_VALUE,Y.TEXT_COLOR,Y.TEXT_ALPHA,Y.TEXT_FAMILY,Y.TEXT_SIZE)},n.prototype.getBoundsSize=function(){var t=this.size;return t instanceof Mr?t.base:t},n.prototype.onChildTransformChange=function(){t.prototype.onChildTransformChange.call(this),this.size.fit()},Object.defineProperty(n.prototype,"corner",{get:function(){return it.NONE},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"gradient",{get:function(){},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"radius",{get:function(){return 0},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"image",{get:function(){},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"points",{get:function(){},set:function(t){},enumerable:!1,configurable:!0}),n.prototype.containsAbs=function(t,n,i,r,e,u,s){return!1},n}(pt),Nr=function(t){function n(n,i,e,u){void 0===u&&(u=r.EMBEDDED);var s=t.call(this,i,e,u)||this;return s.Rr=n,s.Ar=e,s}return B(n,t),Object.defineProperty(n.prototype,"name",{get:function(){return this.Rr},enumerable:!1,configurable:!0}),n.prototype.isGroupSizeFittable=function(){return!1},n.prototype.newGroupSize=function(t,n){var i=Y.SIZE_X,r=Y.SIZE_Y;return t!==gr.VIEWER&&n<=0?new Er(this,i,r,this.isGroupSizeFittable()):new Mr(this,i,r,i,r)},n.prototype.clone=function(){for(var t=this.newClone().copy(this),n=this.children,i=0,r=n.length;i<r;++i){var e=n[i].clone();e.parent=t,t.children.push(e)}return t.onChildTransformChange(),t.toDirty(),t},n.prototype.newClone=function(){return new(0,this.constructor)(this.Rr,this.Cr,this.Ar,this.type)},n.prototype.serializeChildren=function(t){return[]},n.prototype.serializeImage=function(t){return-1},n.prototype.serializeGradient=function(t){return-1},n.prototype.serialize=function(n){var i=t.prototype.serialize.call(this,n);return i[15]=n.addPiece(this.Rr),i},n.prototype.addUuid=function(t){this.uuid=t.addUuid(this.uuid)},n.prototype.updateUuid=function(t){this.uuid=t.updateUuid(this.uuid)},n}(jr),Ir=function(){function t(t){this.Lr=t}return t.prototype.find=function(t){return this.getUuidToShape().get(t)},t.prototype.getUuidToShape=function(){var t=this.yr;return null==t&&(t=this.newUuidToShape(),this.yr=t),t},t.prototype.newUuidToShape=function(){var t=new Map;return this.fillUuidToShape(this.Lr,t),t},t.prototype.fillUuidToShape=function(t,n){for(var i=0,r=t.length;i<r;++i){var e=t[i];if(n.set(e.uuid,e),!(e instanceof Nr)){var u=e.children;0<u.length&&this.fillUuidToShape(u,n)}}},t}(),Cr=function(t,i){var e=n[t[0]]||n[r.NULL];if(null!=e){var u=e(t,i);if(null!=u)return u}throw new Error("Missing shape deserializers")},Ar=function(t,n){for(var i=[],r=0,e=t.length;r<e;++r)i.push(Cr(t[r],n));return 0<i.length?Promise.all(i).then((function(i){return Rr(t,i,new Ir(i),n),i})):null},Rr=function(t,n,r,e){for(var u=0,s=t.length;u<s;++u){var h=t[u],o=n[u],a=i[h[0]];a&&a(h,o,r,e),Rr(h[20],o.children,r,e)}},Lr=function(t,n,i,r){this.name=t,this.width=n,this.height=i,this.layer=r},yr=function(){function t(){this.V=new Map}return t.prototype.add=function(t,n,i,r,e,u){return this.V.set(t,{type:n,x:i,y:r,normal:this.toNormal(i,r,e,u)}),!0},t.prototype.toNormal=function(t,n,i,r){if(null!=i&&null!=r)return{x:i,y:r};var e=t*t+n*n;if(1e-5<e){var u=1/Math.sqrt(e);return{x:t*u,y:n*u}}return{x:0,y:0}},t.prototype.remove=function(t){var n=this.V,i=n.get(t);return null!=i?(n.delete(t),i):null},t.prototype.size=function(){return this.V.size},t.prototype.get=function(t,n){return this.V.get(n)||null},t.prototype.each=function(t,n){return this.V.forEach(n),this},t.prototype.contains=function(t){return this.V.has(t)},t.prototype.clear=function(){var t=this.V;return 0<t.size&&(t.clear(),!0)},t}(),kr={TAIL:1,HEAD:2,ALL:3},xr=function(){function t(){}return t.set=function(t,n){var i=this.kr;null==i&&(i=new Map,this.kr=i),i.set(t,n)},t.get=function(t){var n;return(null===(n=this.kr)||void 0===n?void 0:n.get(t))||this.getDefault()},t.getDefault=function(){var t=this.Br;return null==t&&(t=this.newDefault(),this.Br=t),t},t.newDefault=function(){var t=new yr,n=1/Math.sqrt(2);return t.add("TOP",kr.ALL,0,-.5,0,-1),t.add("LEFT",kr.ALL,-.5,0,-1,0),t.add("RIGHT",kr.ALL,.5,0,1,0),t.add("BOTTOM",kr.ALL,0,.5,0,1),t.add("CENTER",kr.ALL,0,0,0,0),t.add("TOP_LEFT",kr.ALL,-.5,-.5,-n,-n),t.add("TOP_RIGHT",kr.ALL,.5,-.5,n,-n),t.add("BOTTOM_LEFT",kr.ALL,-.5,.5,-n,n),t.add("BOTTOM_RIGHT",kr.ALL,.5,.5,n,n),t},t}(),Br=function(){function t(t){this.O=t,this._r=null,this.Pr=null}return Object.defineProperty(t.prototype,"shape",{get:function(){return this._r},set:function(t){this.set(t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"edge",{get:function(){return this.Pr},set:function(t){this.set(void 0,t)},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){return this.set(t.shape,t.edge)},t.prototype.set=function(t,n){var i=!1;return void 0!==t&&this._r!==t&&(this._r=t,i=!0),void 0!==n&&this.Pr!==n&&(this.Pr=n,i=!0),i&&this.O.onAcceptorChange(),this},t}(),_r=function(){function n(n,i){var r=this;this.O=n,this.Z=i,this.Ur=new Br(this),this.J=new t.ObservablePoint((function(){r.onLocalChange()}),void 0),this.Fr=0,this.Gr=0,this.Hr=new t.ObservablePoint((function(){r.onNormalChange()}),void 0),this.zr=0,this.Vr=0,this.Wr=0,this.Xr=0,this.Kr=!1,this.Yr=!1,this.Jr=!1,this.Zr=!1}return n.prototype.lock=function(){this.Xr+=1,1===this.Xr&&(this.Kr=!1,this.Yr=!1,this.Jr=!1,this.Zr=!1)},n.prototype.unlock=function(){if(this.Xr-=1,0===this.Xr){var t=!1;this.Yr&&(this.Fr+=1,this.Gr=this.Fr,t=!0),this.Jr&&(this.zr+=1,this.Vr=this.zr,t=!0),this.Zr&&(t=!0),this.Kr&&(this.Yr||(this.Fr+=1),this.Jr||(this.zr+=1),this.doFit()&&(t=!1)),t&&this.Z()}},Object.defineProperty(n.prototype,"parent",{get:function(){return this.O},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"acceptor",{get:function(){return this.Ur},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"local",{get:function(){return this.J},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"localId",{get:function(){return this.Gr},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"normal",{get:function(){return this.Hr},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"normalId",{get:function(){return this.Vr},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"margin",{get:function(){return this.Wr},set:function(t){this.Wr!==t&&(this.Wr=t,this.onOtherChange())},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u,s){this.lock(),this.Ur.set(t,n);var h=this.J;null!=r&&null!=e?h.set(r,e):null!=r?h.x=r:null!=e&&(h.y=e);var o=this.Hr;return null!=u&&null!=s?o.set(u,s):null!=u?o.x=u:null!=s&&(o.y=s),null!=i&&(this.margin=i),this.unlock(),this},n.prototype.copy=function(t){return this.lock(),this.Ur.copy(t.acceptor),this.J.copyFrom(t.local),this.Hr.copyFrom(t.normal),this.margin=t.margin,this.unlock(),this},n.prototype.serialize=function(t){var n=this.Ur,i=n.shape,r=i?i.uuid:null,e=n.edge,u=null!=e?t.addResource(e):-1,s=this.J,h=this.Hr;return t.addResource("[".concat(r,",").concat(u,",").concat(s.x,",").concat(s.y,",").concat(this.Wr,",").concat(h.x,",").concat(h.y,"]"))},n.prototype.deserialize=function(t,n,i){var r=i.resources;if(0<=t&&t<r.length){var e=i.getExtension(t);null==e&&(e=JSON.parse(r[t]),i.setExtension(t,e));var u=null,s=e[0];null!=s&&(u=n.find(s)||null),this.lock();var h=this.Ur;h.shape=u;var o=e[1];h.edge=0<=o&&o<r.length?r[o]:null,this.J.set(e[2],e[3]);var a=e[5],c=e[6],f=this.Hr;null!=a&&null!=c?f.set(a,c):f.set(1,0),this.margin=e[4]||0,this.unlock(),u&&u.connector.add(this)}},n.prototype.fit=function(t){return t&&(this.Fr+=1,this.zr+=1),this.doFit(),this},n.prototype.doFit=function(){var t=this.Fr,n=this.Gr!==t,i=this.zr,r=this.Vr!==i;if(n||r){this.Gr=t,this.Vr=i;var e=this.Ur,u=e.shape,s=e.edge;if(null!=u&&null!=s){var h=xr.get(u.type).get(u,s);if(h){var o=this.toAcceptorTransform(u),a=o.a,c=o.b,f=o.c,l=o.d,v=o.tx,b=o.ty;if(this.lock(),n){var d=u.size,g=u.transform.pivot,m=g.x+d.x*h.x,w=g.y+d.y*h.y;this.J.set(a*m+f*w+v,c*m+l*w+b)}if(r){var O=h.normal,p=O.x,D=O.y,E=a*p+f*D,M=c*p+l*D,S=E*E+M*M,T=this.Hr;if(1e-6<S){var j=1/Math.sqrt(S);T.set(E*j,M*j)}else T.set(p,D)}var N=this.Yr||this.Jr;return this.unlock(),N}}}return!1},n.prototype.toAcceptorTransform=function(i){var r;i.updateTransform();var e=this.O,u=e.parent;return u?(e.updateTransform(),(null!==(r=n.WORK_MATRIX)&&void 0!==r?r:n.WORK_MATRIX=new t.Matrix).copyFrom(u.transform.worldTransform).invert().append(i.transform.worldTransform)):i.transform.worldTransform},n.prototype.onAcceptorChange=function(){if(0<this.Xr)return this.Yr=!1,this.Jr=!1,void(this.Kr=!0);this.fit(!0)},n.prototype.onLocalChange=function(){0<this.Xr?this.Yr=!0:(this.Fr+=1,this.Gr=this.Fr,this.Z())},n.prototype.onNormalChange=function(){0<this.Xr?this.Jr=!0:(this.zr+=1,this.Vr=this.zr,this.Z())},n.prototype.onOtherChange=function(){0<this.Xr?this.Zr=!0:this.Z()},n.prototype.attach=function(){var t=this.Ur.shape;return t&&t.connector.add(this),this},n.prototype.detach=function(){var t=this.Ur.shape;return t&&t.connector.remove(this),this},n}(),Pr=function(){function t(t,n){var i=this;this.O=t,this.Xr=0,this.Ut=!1,this.Z=n;var r=function(){i.onChange()};this.qr=new _r(t,r),this.Qr=new _r(t,r)}return t.prototype.lock=function(){return this.Xr+=1,1===this.Xr&&(this.Ut=!1),this},t.prototype.unlock=function(){return this.Xr-=1,0===this.Xr&&this.Ut&&this.Z(),this},t.prototype.onChange=function(){0<this.Xr?this.Ut=!0:this.Z()},Object.defineProperty(t.prototype,"tail",{get:function(){return this.qr},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"head",{get:function(){return this.Qr},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){return this.lock(),this.qr.copy(t.tail),this.Qr.copy(t.head),this.unlock(),this},t.prototype.fit=function(t){return this.lock(),this.qr.fit(t),this.Qr.fit(t),this.unlock(),this},t.prototype.serialize=function(t){var n=this.qr.serialize(t),i=this.Qr.serialize(t);return t.addResource("[".concat(n,",").concat(i,"]"))},t.prototype.deserialize=function(t,n,i){var r=i.resources;if(0<=t&&t<r.length){var e=i.getExtension(t);null==e&&(e=JSON.parse(r[t]),i.setExtension(t,e)),this.lock(),this.qr.deserialize(e[0],n,i),this.Qr.deserialize(e[1],n,i),this.unlock()}},t.prototype.attach=function(){this.lock();var t=this.qr,n=this.Qr;return t.attach(),n.attach(),t.fit(!0),n.fit(!0),this.unlock(),this},t.prototype.detach=function(){return this.lock(),this.qr.detach(),this.Qr.detach(),this.unlock(),this},t}(),Ur=function(t,n){for(var i=0,r=t.length-1;i<=r;){var e=i+(r-i>>1),u=t[e];if(n<u)r=e-1;else{if(!(u<n))return e;i=e+1}}return-1},Fr=2*Math.PI,Gr=.5*Math.PI,Hr=function(t,n,i,r){return t*i+n*r},zr=function(t,n){return Math.sqrt(Hr(t,n,t,n))},Vr=function(t,n,i,r){return t*r-n*i},Wr=function(t,n,i,r,e,u,s,h,o,a){var c=a.center;c[0]=t,c[1]=n;var f=a.axis1;f[0]=i,f[1]=r;var l=a.axis2;l[0]=e,l[1]=u;var v=a.angle;return v[0]=s,v[1]=h,v[2]=o,a},Xr=function(t,n){var i=t.center,r=t.axis1,e=t.axis2,u=t.angle;return Wr(i[0],i[1],r[0],r[1],e[0],e[1],u[0],u[1],u[2],n)},Kr=function(t,n){for(var i=t.length,r=0;r<i;++r)n[r]=t[r];return n.length!==i&&(n.length=i),n},Yr=function(){function t(){}return t.set=function(t,n,i,r,e,u,s,h,o,a,c,f,l,v,b){for(var d=Math.max(Math.abs(n-i),Math.abs(s-h)),g=f?Math.max(1,Math.round(c*(d/Gr))):c,m=l?g+1:g,w=0;w<m;++w){var O=w/g,p=1-O,D=O,E=p*n+D*i,M=Math.cos(E),S=Math.sin(E),T=t[0]+M*r[0]+S*e[0],j=t[1]+M*r[1]+S*e[1],N=p*s+D*h,I=Math.cos(N),C=Math.sin(N),A=u[0]+I*o[0]+C*a[0],R=u[1]+I*o[1]+C*a[1],L=Gr*O,y=Math.cos(L),k=Math.sin(L),x=y*y,B=k*k,_=x*T+B*A,P=x*j+B*R;v[++b]=_,v[++b]=P}return b},t.interpolate=function(t,n,i,r,e,u,s,h){var o=h.values,a=h.segments;if(t<=2)return Kr(n,o),Kr(i,a),h;var c=this.WORK_P0||{center:[0,0],axis1:[0,0],axis2:[0,0],angle:[0,0,0]},f=this.WORK_P1||{center:[0,0],axis1:[0,0],axis2:[0,0],angle:[0,0,0]},l=this.WORK_P2||{center:[0,0],axis1:[0,0],axis2:[0,0],angle:[0,0,0]};this.WORK_P0=c,this.WORK_P1=f,this.WORK_P2=l;var v=-1,b=-1;if(e){r(0,t,n,c),Xr(c,f);for(var d=1;d<t;++d){if(r(d,t,n,l),0<=Ur(i,d)){var g=d-1<<1;o[++v]=n[g+0],o[++v]=n[g+1],a[++b]=v+1>>1}else v=this.set(f.center,f.angle[1],f.angle[2],f.axis1,f.axis2,l.center,l.angle[0],l.angle[1],l.axis1,l.axis2,u,s,!1,o,v);var m=f;f=l,l=m}0<=Ur(i,0)?(g=t-1<<1,o[++v]=n[g+0],o[++v]=n[g+1],a.unshift(0),b+=1):v=this.set(f.center,f.angle[1],f.angle[2],f.axis1,f.axis2,c.center,c.angle[0],c.angle[1],c.axis1,c.axis2,u,s,!1,o,v)}else{r(1,t,n,c),0<=Ur(i,1)?(o[++v]=n[0],o[++v]=n[1],a[++b]=1):v=this.set(c.center,c.angle[0],c.angle[1],c.axis1,c.axis2,c.center,c.angle[0],c.angle[1],c.axis1,c.axis2,u,s,!1,o,v),Xr(c,f),d=2;for(var w=t-1;d<w;++d)r(d,t,n,l),0<=Ur(i,d)?(g=d-1<<1,o[++v]=n[g+0],o[++v]=n[g+1],a[++b]=v+1>>1):v=this.set(f.center,f.angle[1],f.angle[2],f.axis1,f.axis2,l.center,l.angle[0],l.angle[1],l.axis1,l.axis2,u,s,!1,o,v),m=f,f=l,l=m;0<=Ur(i,t-1)?(g=t-2<<1,o[++v]=n[g+0],o[++v]=n[g+1],a[++b]=v+1>>1):v=this.set(f.center,f.angle[1],f.angle[2],f.axis1,f.axis2,f.center,f.angle[1],f.angle[2],f.axis1,f.axis2,u,s,!0,o,v)}return v+=1,o.length!==v&&(o.length=v),b+=1,a.length!==b&&(a.length=b),h},t.toCircle=function(t,n,i,r){var e=(0<t?t-1:n-1)<<1,u=t<<1,s=(t<n-1?t+1:0)<<1,h=i[e+0],o=i[e+1],a=i[u+0],c=i[u+1],f=i[s+0],l=i[s+1],v=a-h,b=c-o,d=f-a,g=l-c,m=h+.5*v,w=o+.5*b,O=a+.5*d,p=c+.5*g,D=-b,E=+v,M=-g,S=+d,T=Vr(D,E,M,S);if(Math.abs(T)<.001){if(0<=Hr(v,b,d,g)||n<=2){var j=.01,N=Math.sin(j),I=zr(v,b),C=zr(d,g);return Wr(a,c,0,0,d/N,g/N,-j*I/C,0,j,r)}T=.001}var A=(S*(O-m)+M*(w-p))/T,R=m+A*D,L=w+A*E,y=a-R,k=c-L,x=-k,B=+y,_=f-R,P=l-L,U=Math.atan2(Hr(x,B,_,P),Hr(y,k,_,P)),F=h-R,G=o-L,H=Math.atan2(Hr(x,B,F,G),Hr(y,k,F,G));return 0<H*U&&(Math.abs(H)<Math.abs(U)&&(0<U?U-=Fr:U+=Fr),Math.abs(U)<Math.abs(H)&&(0<H?H-=Fr:H+=Fr)),Wr(R,L,y,k,x,B,H,0,U,r)},t.toEllipse=function(t,n,i,r){var e=(0<t?t-1:n-1)<<1,u=t<<1,s=(t<n-1?t+1:0)<<1,h=i[e+0],o=i[e+1],a=i[u+0],c=i[u+1],f=i[s+0],l=i[s+1],v=h-a,b=o-c,d=f-a,g=l-c;if(n<=2){var m=.01,w=Math.sin(m);return Wr(a,c,0,0,d/w,g/w,-m,0,m,r)}for(var O=zr(v,b),p=zr(d,g),D=Hr(v,b,d,g)/(O*p),E=Math.acos(D),M=.5*E,S=.25*E,T=0,j=0,N=0,I=0,C=Math.max(O,p),A=Math.min(O,p),R=0;R<16;++R){var L=.5*M,y=E-L;T=C*Math.sin(L),j=C*Math.cos(L),N=A*Math.sin(y),1<(1-(I=A*Math.cos(y))/j)*(1-I/j)+N*N/(T*T)?M+=S:M-=S,S*=.5}var k=Math.asin(Math.min(N/T,1));if(O<p){var x=d/p,B=g/p,_=void 0,P=void 0;return 0<Vr(v,b,d,g)?(_=+B,P=-x):(_=-B,P=+x),Wr(z=a-(G=(U=-j*j/p)*x+(F=-j*T/p)*_),V=c-(H=U*B+F*P),G,H,f-z,l-V,-k,0,Gr,r)}var U,F,G,H,z,V,W=v/O,X=b/O;return _=void 0,P=void 0,Vr(v,b,d,g)<0?(_=+X,P=-W):(_=-X,P=+W),Wr(z=a-(G=(U=-j*j/O)*W+(F=-j*T/O)*_),V=c-(H=U*X+F*P),G,H,-(h-z),-(o-V),-Gr,0,k,r)},t.toHybrid=function(n,i,r,e){var u=t.toCircle(n,i,r,e),s=u.angle[0],h=u.angle[2],o=Math.min(s,h),a=Math.max(s,h);return o<-Gr||Gr<a?t.toEllipse(n,i,r,e):u},t}(),Jr=function(t,n,i,r,e){return Yr.interpolate(t,n,i,Yr.toHybrid,!!(r&F.CLOSED),Y.CURVE_SEGMENT_COUNT,!0,e),e.length=e.values.length>>1,e.style=r,e},Zr=function(t,n){if(2<=t.length){for(var i=t[0],r=t[1],e=i,u=r,s=2,h=t.length;s<h;s+=2){var o=t[s],a=t[s+1];i=Math.min(i,o),r=Math.min(r,a),e=Math.max(e,o),u=Math.max(u,a)}n[0]=i,n[1]=r,n[2]=e,n[3]=u}else n[0]=0,n[1]=0,n[2]=0,n[3]=0;return n},qr=function(){function n(n){var i=this;this.O=n,this.Xr=0,this.$r=!1,this.te=!1,this.ne=!1,this.Nt=J.NONE,this.j=new t.ObservablePoint((function(){i.onSizeChange()}),void 0,.15*Y.SIZE_X,.15*Y.SIZE_Y),this.C=this.newFill(),this.ie=0}return n.prototype.newFill=function(){return new Z(this,!0,Y.FILL_COLOR,1)},n.prototype.lock=function(){return this.Xr+=1,1===this.Xr&&(this.$r=!1,this.te=!1,this.ne=!1),this},n.prototype.unlock=function(){return this.Xr-=1,0===this.Xr&&(this.$r?this.onTypeChange():this.te?this.onSizeChange():this.ne&&this.onFillChange(),this.$r=!1,this.te=!1,this.ne=!1),this},Object.defineProperty(n.prototype,"type",{get:function(){return this.Nt},set:function(t){this.Nt!==t&&(this.Nt=t,this.onTypeChange())},enumerable:!1,configurable:!0}),n.prototype.onTypeChange=function(){0<this.Xr?this.$r=!0:this.O.onTypeChange()},Object.defineProperty(n.prototype,"size",{get:function(){return this.j},enumerable:!1,configurable:!0}),n.prototype.onSizeChange=function(){0<this.Xr?this.te=!0:this.O.onSizeChange()},Object.defineProperty(n.prototype,"transform",{get:function(){return this.updateTransform()},enumerable:!1,configurable:!0}),n.prototype.updateTransform=function(){var n=this.I;null==n&&(n=new t.Matrix,this.I=n);var i=this.O.parent,r=i.id;if(this.ie!==r){this.ie=r;var e=i.formatted;2<=e.length?this.toTransform(e.values,n):n.identity()}return n},n.prototype.toTransformMatrix=function(t,n,i,r,e){var u=t-i,s=n-r,h=u*u+s*s;if(1e-5<h){var o=1/Math.sqrt(h),a=u*o,c=s*o;e.set(c,-a,-a,-c,t,n)}else e.set(1,0,0,1,t,n);return e},Object.defineProperty(n.prototype,"fill",{get:function(){return this.C},enumerable:!1,configurable:!0}),n.prototype.onFillChange=function(){0<this.Xr?this.ne=!0:this.O.onFillChange()},n.prototype.updateUploaded=function(){this.onFillChange()},n.prototype.copy=function(t){var n=t.size;return this.set(t.type,n.x,n.y),this},n.prototype.set=function(t,n,i){return this.lock(),null!=t&&(this.type=t),this.size.set(n,i),this.unlock(),this},n.prototype.serialize=function(t){var n=this.j,i=this.C.serialize(t);return t.addResource("[".concat(this.Nt,",").concat(n.x,",").concat(n.y,",").concat(i,"]"))},n.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getExtension(t);null==r&&(r=JSON.parse(i[t]),n.setExtension(t,r)),this.lock(),this.type=r[0],this.j.set(r[1],r[2]),this.C.deserialize(r[3],n),this.unlock()}},n}(),Qr=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.toTransform=function(t,n){var i=t.length;return 4<=i?this.toTransformMatrix(t[i-2],t[i-1],t[i-4],t[i-3],n):(n.identity(),n)},n}(qr),$r=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.toTransform=function(t,n){return 4<=t.length?this.toTransformMatrix(t[0],t[1],t[2],t[3],n):(n.identity(),n)},n}(qr),te=function(){function t(t){this.O=t,this.Xr=0,this.$r=!1,this.te=!1,this.ne=!1,this.Qr=new Qr(this),this.qr=new $r(this)}return t.prototype.lock=function(){return this.Xr+=1,1===this.Xr&&(this.$r=!1,this.te=!1,this.ne=!1),this},t.prototype.unlock=function(){return this.Xr-=1,0===this.Xr&&(this.$r?this.onTypeChange():this.te?this.onSizeChange():this.ne&&this.onFillChange(),this.$r=!1,this.te=!1,this.ne=!1),this},Object.defineProperty(t.prototype,"parent",{get:function(){return this.O},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"head",{get:function(){return this.Qr},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tail",{get:function(){return this.qr},enumerable:!1,configurable:!0}),t.prototype.onTypeChange=function(){0<this.Xr?this.$r=!0:this.O.onMarkerTypeChange()},t.prototype.onSizeChange=function(){0<this.Xr?this.te=!0:this.O.onMarkerSizeChange()},t.prototype.onFillChange=function(){0<this.Xr?this.ne=!0:this.O.onMarkerFillChange()},t.prototype.copy=function(t){return this.lock(),this.Qr.copy(t.head),this.qr.copy(t.tail),this.unlock(),this},t.prototype.serialize=function(t){var n=this.Qr.serialize(t),i=this.qr.serialize(t);return t.addResource("[".concat(n,",").concat(i,"]"))},t.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getExtension(t);null==r&&(r=JSON.parse(i[t]),n.setExtension(t,r)),this.lock(),this.Qr.deserialize(r[0],n),this.qr.deserialize(r[1],n),this.unlock()}},t}(),ne=function(){function n(n){this.O=n,this.re=0,this.L=[],this.k=[];var i=n.size,r=i.x,e=i.y;this.ee=new t.Point(r,e),this.ue=new t.Point(r,e),this.R=0,this.B=F.NONE,this.se=-1}return Object.defineProperty(n.prototype,"length",{get:function(){return this.L.length>>1},enumerable:!1,configurable:!0}),n.prototype.toFitted=function(){this.he=void 0;var t=this.O.size;this.ue.copyFrom(t),this.ee.copyFrom(t)},n.prototype.fit=function(){var t=this.ue,n=this.O.size,i=n.x,r=n.y,e=1e-5;if(e<Math.abs(i-t.x)||e<Math.abs(r-t.y)){t.set(i,r);var u=this.ee,s=e<Math.abs(u.x),h=e<Math.abs(u.y);if(s||h){var o=s?i/u.x:1,a=h?r/u.y:1,c=this.L,f=this.he;if(null==f){f=[],this.he=f;for(var l=0,v=c.length;l<v;l+=2){var b=c[l],d=c[l+1];c[l]=b*o,c[l+1]=d*a,f.push(b,d)}}else for(l=0,v=c.length;l<v;l+=2)c[l]=f[l]*o,c[l+1]=f[l+1]*a;if(this.R===this.se){var g=this.oe;if(null!=g){var m=g.values,w=this.ae;if(null==w)for(w=[],this.ae=w,l=0,v=m.length;l<v;l+=2)b=m[l],d=m[l+1],m[l]=b*o,m[l+1]=d*a,w.push(b,d);else for(l=0,v=m.length;l<v;l+=2)m[l]=w[l]*o,m[l+1]=w[l+1]*a;var O=g.boundary,p=this.ce;if(null==p)for(p=[0,0,0,0],this.ce=p,l=0,v=O.length;l<v;l+=2)b=O[l],d=O[l+1],O[l]=b*o,O[l+1]=d*a,p[l]=b,p[l+1]=d;else for(l=0,v=O.length;l<v;l+=2)O[l]=p[l]*o,O[l+1]=p[l+1]*a;this.se+=1}}this.R+=1}}},Object.defineProperty(n.prototype,"id",{get:function(){return this.fit(),this.R},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"values",{get:function(){return this.fit(),this.L},set:function(t){this.set(t,void 0,void 0)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"segments",{get:function(){return this.k},set:function(t){this.set(void 0,t,void 0)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"style",{get:function(){return this.B},set:function(t){this.set(void 0,void 0,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"marker",{get:function(){var t=this.A;return null==t&&(t=this.newMarker(),this.A=t),t},enumerable:!1,configurable:!0}),n.prototype.getMarker=function(){return this.A},n.prototype.newMarker=function(){return new te(this)},n.prototype.onMarkerTypeChange=function(){var t=this.O;t.uploaded=void 0,t.toDirty()},n.prototype.onMarkerSizeChange=function(){this.O.updateUploaded()},n.prototype.onMarkerFillChange=function(){this.O.updateUploaded()},Object.defineProperty(n.prototype,"formatter",{get:function(){return this.fe||null},set:function(t){this.fe!==t&&(this.se=-1,this.fe=t,this.toDirty(!0))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"formatted",{get:function(){this.fit();var t=this.R,n=this.oe;if(this.se!==t){this.se=t;var i=this.B,r=this.fe;if(null==r&&i&F.CURVE&&(r=Jr),null!=r){null==n&&(n={length:0,values:[],segments:[],boundary:[0,0,0,0],style:F.NONE});var e=this.he,u=this.k;if(null!=e){r(e.length>>1,e,u,i,n),Zr(n.values,n.boundary);var s=n.values,h=s.splice(0);this.ae=h;var o=n.boundary,a=[o[0],o[1],o[2],o[3]];this.ce=a,this.toScaled(s,h,o,a)}else{var c=this.L;r(c.length>>1,c,u,i,n),Zr(n.values,n.boundary),this.ae=void 0,this.ce=void 0}}else n=void 0,this.ae=void 0,this.ce=void 0;this.oe=n}return n||this},enumerable:!1,configurable:!0}),n.prototype.toScaled=function(t,n,i,r){var e=this.ue,u=this.ee,s=1e-5,h=s<Math.abs(u.x),o=s<Math.abs(u.y);if(h||o){for(var a=h?e.x/u.x:1,c=o?e.y/u.y:1,f=0,l=n.length;f<l;f+=2)t[f]=n[f]*a,t[f+1]=n[f+1]*c;for(f=0,l=r.length;f<l;f+=2)i[f]=r[f]*a,i[f+1]=r[f+1]*c}},n.prototype.copy=function(t){this.set(t.values,t.segments,t.style);var n=t.getMarker();return n&&this.marker.copy(n),this},n.prototype.set=function(t,n,i){var r=!1,e=!1,u=this.B,s=u&F.FORMATTER_MASK,h=this.fe;if(null!=t){var o=this.L,a=this.re,c=t.length,f=Math.min(c,a);if(this.toFitted(),o!==t){for(var l=0;l<f;++l)o[l]=t[l];for(l=f;l<c;++l)o.push(t[l]);a!==c?(o.length=c,this.re=c,r=!0):null!=h||s?r=!0:e=!0}else a!==c?(this.re=c,r=!0):null!=h||s?r=!0:e=!0}if(null!=n){var v=this.k;if(v!==n){var b=n.length;for(f=Math.min(v.length,b),l=0;l<f;++l)v[l]=n[l];for(l=f;l<b;++l)v.push(n[l]);v.length!==b&&(v.length=b)}null!=h||s?r=!0:e=!0}return null!=i&&u!==i&&(s!==(i&F.FORMATTER_MASK)||(null!=h||s)&&(u&F.CLOSED)!=(i&F.CLOSED)?r=!0:e=!0,this.B=i),(e||r)&&this.toDirty(r),this},n.prototype.toDirty=function(t){if(t){this.R+=1;var n=this.O,i=n.uploaded;i?i.isCompatible(n)?n.updateUploaded():(n.uploaded=void 0,n.toDirty()):n.updateUploaded()}else this.R+=1,this.O.updateUploaded()},n.prototype.clone=function(t){return new n(t).copy(this)},n.prototype.toPoints=function(n){for(var i=[],r=this.values,e=0,u=r.length;e<u;e+=2){var s=new t.Point(r[e+0],r[e+1]);i.push(n.apply(s,s))}return i},n.prototype.serialize=function(t){var n=JSON.stringify(this.L),i=JSON.stringify(this.k),r=this.B,e=-1,u=this.A;return u&&(e=u.serialize(t)),t.addResource("[".concat(n,",").concat(i,",").concat(r,",").concat(e,"]"))},n.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getExtension(t);null==r&&(r=JSON.parse(i[t]),n.setExtension(t,r)),this.set(r[0],r[1],r[2]);var e=r[3];null!=e&&0<=e&&this.marker.deserialize(e,n)}},n.prototype.calcHitPointAbs=function(t,i,r,e,u,s,h,o){var a=this.formatted,c=a.length;if(2<=c){var f=a.values,l=a.segments,v=a.style,b=0,d=c;if(s){var g=n.WORK_RANGE;s(t,i,u,f,g),b=g[0],d=g[1]}for(var m=b,w=Math.min(d,c-1);m<w;++m){var O;if(Ur(l,m+1)<0&&h(t,i,f[0+(O=m<<1)],f[O+1],f[O+2],f[O+3],m,u,o))return!0}if(2<c&&c<=d&&v&F.CLOSED&&Ur(l,0)<0&&h(t,i,f[0+(O=(m=c-1)<<1)],f[O+1],f[0],f[1],m,u,o))return!0}return!1},n.WORK_RANGE=[0,0],n}(),ie=function(){function t(t,n){this.O=t,this.R=0,this.L=[],this.Xr=0,this.Ut=!1,this.Z=n}return t.prototype.lock=function(){this.Xr+=1,1===this.Xr&&(this.Ut=!1)},t.prototype.unlock=function(){this.Xr-=1,0===this.Xr&&(this.Ut&&this.onChange(),this.Ut=!1)},Object.defineProperty(t.prototype,"id",{get:function(){return this.R},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"values",{get:function(){return this.L},set:function(t){this.set(t)},enumerable:!1,configurable:!0}),t.prototype.set=function(t){if(null!=t){if(this.R+=1,this.L!==t){for(var n=t.length,i=this.L,r=0;r<n;++r)i[r]=t[r];i.length=n}this.onChange()}return this},t.prototype.copy=function(t){return this.set(t.values)},t.prototype.serialize=function(t){return t.addResource(JSON.stringify(this.L))},t.prototype.deserialize=function(t,n,i){var r=i.resources;if(0<=t&&t<r.length){var e=i.getExtension(t);null==e&&(e=JSON.parse(r[t]),i.setExtension(t,e)),this.set(e)}},t.prototype.onChange=function(){0<this.Xr?this.Ut=!0:this.Z()},t}(),re=function(t){function n(n){void 0===n&&(n=r.CONNECTOR_LINE);var i=t.call(this,n)||this;i.le=0,i.ve=0,i.be=0,i.de=0,i.ge=0,i.me=0,i.we=0,i.Xr=0,i.Ut=!1;var e=.5*Y.SIZE_X,u=.5*Y.SIZE_Y;i.gt=new ne(i).set([-e,-u,+e,+u]);var s=function(){i.onChange()};return i.Pr=new Pr(i,s),i.Oe=new ie(i,s),i}return B(n,t),n.prototype.lock=function(){this.Xr+=1,1===this.Xr&&(this.Ut=!1)},n.prototype.unlock=function(){this.Xr-=1,0===this.Xr&&(this.Ut&&this.onChange(),this.Ut=!1)},Object.defineProperty(n.prototype,"points",{get:function(){return this.gt},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"edge",{get:function(){return this.Pr},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"body",{get:function(){return this.Oe},enumerable:!1,configurable:!0}),n.prototype.onAttach=function(){t.prototype.onAttach.call(this),this.Pr.attach()},n.prototype.onDetach=function(){this.Pr.detach(),t.prototype.onDetach.call(this)},n.prototype.onChange=function(){var t;if(0<this.Xr)this.Ut=!0;else{var i=this.Pr,r=i.tail,e=r.localId,u=r.normalId,s=r.margin,h=i.head,o=h.localId,a=h.normalId,c=h.margin,f=this.Oe,l=f.id;if(this.le!==e||this.ve!==u||this.be!==s||this.de!==o||this.ge!==a||this.me!==c||this.we!==l){this.le=e,this.ve=u,this.be=s,this.de=o,this.ge=a,this.me=c,this.we;var v=this.transform,b=v.position,d=b.x,g=b.y,m=this.gt,w=m.values;this.fillPoints(r,s,h,c,f,d,g,w);var O=null!==(t=n.WORK_BOUNDARY)&&void 0!==t?t:n.WORK_BOUNDARY=[0,0,0,0];Zr(w,O);for(var p=.5*(O[2]+O[0]),D=.5*(O[3]+O[1]),E=O[2]-O[0],M=O[3]-O[1],S=0,T=w.length;S<T;S+=2)w[S+0]-=p,w[S+1]-=D;this.disallowUploadedUpdate(),b.set(d+p,g+D),v.scale.set(1,1),v.rotation=0,v.skew.set(0,0),this.size.set(E,M),m.toFitted(),m.set(w),this.allowUploadedUpdate()}}},n.prototype.fillPoints=function(t,n,i,r,e,u,s,h){var o=1e-6,a=t.local,c=a.x-u,f=a.y-s,l=i.local,v=l.x-u,b=l.y-s,d=e.values,g=d.length;if(h[0]=c,h[1]=f,0<g)for(var m=.5*(v+c),w=.5*(b+f),O=v-c,p=b-f,D=Math.atan2(p,O),E=Math.cos(D),M=Math.sin(D),S=Math.sqrt(O*O+p*p),T=0;T<g;T+=2){var j=d[T+0],N=d[T+1];h[T+2]=m+(E*j-M*N)*S,h[T+3]=w+(E*N+M*j)*S}if(h[2+g]=v,h[3+g]=b,0!==n&&o<(O=h[2]-c)*O+(p=h[3]-f)*p){var I=n/Math.sqrt(O*O+p*p);h[0]=c+O*I,h[1]=f+p*I}0!==r&&o<(O=h[0+g]-v)*O+(p=h[1+g]-b)*p&&(I=r/Math.sqrt(O*O+p*p),h[2+g]=v+O*I,h[3+g]=b+p*I),h.length=g+4},n.prototype.copy=function(i,r){return void 0===r&&(r=st.ALL),t.prototype.copy.call(this,i,r),i instanceof n&&(this.Pr.copy(i.edge),this.Oe.copy(i.body)),this},n.prototype.clone=function(){return new(0,this.constructor)(this.type).copy(this)},n.prototype.serialize=function(n){var i=t.prototype.serialize.call(this,n),r=this.Pr.serialize(n),e=this.Oe.serialize(n),u=this.gt.serialize(n);return i[15]=n.addResource("[".concat(r,",").concat(u,",").concat(e,"]")),i},n}(Xt),ee=function(){function t(){}return t.isConnector=function(t){return t instanceof re},t.newMapping=function(n,i,r){var e;null==r&&(r=null!==(e=t.pe)&&void 0!==e?e:t.pe=new Map).clear();for(var u=0,s=n.length;u<s;++u){var h=n[u],o=i[u];r.set(h,o),this.newMapping(h.children,o.children,r)}return r},t.moveAll=function(t,n,i,r,e){for(var u=0,s=i.length;u<s;++u){var h=i[u],o=r[u];if(this.isConnector(h)&&this.isConnector(o)){var a=h.edge,c=o.edge,f=a.head,l=f.acceptor.shape;if(l){null==e&&(e=this.newMapping(t,n));var v=e.get(l);if(v){var b=c.head;b.detach(),b.set(v),b.attach(),v.connector.remove(f)}}var d=a.tail,g=d.acceptor.shape;if(g){null==e&&(e=this.newMapping(t,n));var m=e.get(g);if(m){var w=c.tail;w.detach(),w.set(m),w.attach(),m.connector.remove(d)}}}e=this.moveAll(t,n,h.children,o.children,e)}return e},t.move=function(t,n){var i=t.children,r=n.children;this.moveAll(i,r,i,r)},t}(),ue=function(){function n(n,i,r,e,u){this.id=n,this.ref=0;var s=u.resolution;this.frame=new t.Rectangle(0,0,i*s,r*s),this.texture=new t.Texture(u,new t.Rectangle(0,0,1,1)),this.width=i,this.height=r,this.strokeWidth=e}return n.prototype.applyFrame=function(){var t=1/this.texture.baseTexture.resolution;this.texture.frame.x=this.frame.x*t,this.texture.frame.y=this.frame.y*t,this.texture.frame.width=this.width,this.texture.frame.height=this.height,this.texture.updateUvs(),this.texture.emit("update",this)},n.prototype.destroy=function(){this.texture.destroy()},n}(),se=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.render=function(t){},n}(ue),he=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.render=function(t){var n=this.frame;t.save(),t.fillStyle="#ffffff",t.fillRect(n.x-1,n.y-1,n.width+2,n.height+2),t.restore()},n}(ue),oe=function(){function n(n){var i=this.ir=document.createElement("canvas");i.width=i.height=256;var r=this.De=t.BaseTexture.from(i,{mipmap:t.MIPMAP_MODES.OFF,resolution:n});this.Ee={},this.Me=[],this.Se={empty:new se("empty",10,10,0,r),white:new he("white",10,10,0,r)},this.vn=!0}return n.prototype.updateFrames=function(t,n){for(var i=4,r=4,e=0,u=0,s=n.length;u<s;++u){var h=n[u];t<i+h.frame.width+4&&(i=4,r+=e+4,e=0),h.frame.x=0|i,h.frame.y=0|r,i+=h.frame.width+4,e=Math.max(e,h.frame.height)}for(var o=r+e+4,a=256;a<o;)a<<=1;return Math.min(4096,a)},n.prototype.renderFrames=function(t,n,i){var r=this.ir;r.width=t,r.height=n;var e=r.getContext("2d");if(null!=e)for(var u=0,s=i.length;u<s;++u)i[u].render(e)},n.prototype.applyFrames=function(t){for(var n=0,i=t.length;n<i;++n)t[n].applyFrame()},n.prototype.calcCanvasWidth=function(t){for(var n=128,i=t.length-1;0<=i;--i)for(var r=t[i],e=Math.max(r.frame.width,r.frame.height);n<e;)n<<=1;return Math.min(4096,n<<1)},n.prototype.cleanup=function(t){t.sort(n.ITEM_COMPARATOR);for(var i=t.length-1;0<=i;--i)if(0<t[i].ref)return void(t.length=i+1);t.length=0},n.prototype.begin=function(){for(var t=this.Me,n=0,i=t.length;n<i;++n)t[n].ref=0;this.vn=!1},n.prototype.end=function(){for(var t=this.Ee,n=this.Me,i=0,r=n.length;i<r;++i){var e=n[i];e.ref<=0&&(e.id in this.Se||e.destroy(),delete t[e.id],this.vn=!0)}},n.prototype.repack=function(t){if(!0===t||this.vn){this.vn=!1;var n=this.Me;this.cleanup(n);var i=this.calcCanvasWidth(n),r=this.updateFrames(i,n);this.renderFrames(i,r,n),this.De.setRealSize(i,r),this.applyFrames(n)}},n.prototype.get=function(t){var n=this.Ee[t];if(null!=n)return n.ref+=1,n;var i=this.Se[t];return null!=i?(this.set(t,i),i):null},n.prototype.set=function(t,n){var i=this.Ee[t];return n.ref+=1,this.Ee[t]=n,this.Me.push(n),this.vn=!0,i},n.prototype.toDirty=function(){this.vn=!0},n.prototype.getDefaultTexture=function(){return this.get("white").texture},n.prototype.getBaseTexture=function(){return this.De},n.prototype.release=function(t){var n=this.Ee,i=n[t];null!=i&&(i.ref-=1,i.ref<=0&&(i.id in this.Se||i.destroy(),delete n[t],this.vn=!0))},n.ITEM_COMPARATOR=function(t,n){return t.ref<=0?n.ref<=0?0:1:n.ref<=0||t.frame.height<n.frame.height?-1:n.frame.height<t.frame.height?1:t.frame.width-n.frame.width},n}(),ae=function(t){function n(n,i){var r=t.call(this,n.id,n.width/i.resolution,n.height/i.resolution,0,i)||this;return r.canvas=n.canvas,r}return B(n,t),n.prototype.render=function(t){var n=this.canvas;if(null!=n){var i=this.frame;t.drawImage(n,i.x,i.y,i.width,i.height)}},n}(ue),ce="!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~",fe=function(t,n){this.x=t,this.y=n},le=function(t,n,i,r,e){this.ref=1,this.life=10,this.character=t,this.x=0,this.y=0,this.width=i,this.height=r,this.advance=n,this.origin=new fe(0,0),this.type=e},ve={RESERVED:1,NON_BREAKING:2,SPACE:4,SPACE_R:5,SPACE_NB:6,SPACE_RNB:7,LETTER:8,LETTER_R:9,LETTER_NB:10,LETTER_RNB:11},be=function(){function t(){var t=this;this.Te=null,this.je=null,this.Ne=null,this.Ie=NaN,this.Ce=NaN,this.Ae=NaN,this.Re=NaN,this.Le=null,this.ye=null;var n=this.ir=document.createElement("canvas");n.width=64,n.height=64,this.ke=function(t){t.preventDefault()},this.xe=function(){t.restore()},this.Be=function(){t.destroy()},n.addEventListener("webglcontextlost",this.ke,!1),n.addEventListener("webglcontextrestored",this.xe,!1),window.addEventListener("unload",this.Be,!1)}return t.prototype.init=function(){var t=this.ir;if(null!=t&&(null==this.Te||this.Te.isContextLost())){var n={alpha:!0,antialias:!1,depth:!1,stencil:!1,premultipliedAlpha:!1},i=t.getContext("webgl",n)||t.getContext("experimental-webgl",n);this.Te=i,null!=i&&(i.clearColor(1,1,1,0),this.makeVertexBuffer(),this.makeUvBuffer(),this.makeShaders(),this.je=null)}return this},t.prototype.restore=function(){this.init()},t.prototype.getCanvas=function(){return this.ir},t.prototype.getShader=function(t,n,i){var r=i?t.createShader(t.FRAGMENT_SHADER):t.createShader(t.VERTEX_SHADER);return null==r||(t.shaderSource(r,n),t.compileShader(r),t.getShaderParameter(r,t.COMPILE_STATUS))?r:(console&&console.error("Failed to compile the shader: ".concat(t.getShaderInfoLog(r))),null)},t.prototype.makeShaders=function(){var t=this.Te;if(null!=t&&!0!==t.isContextLost()){var n=this.getShader(t,"\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nvarying mediump vec2 vTextureCoord;\nvoid main(void) {\n\tgl_Position = vec4(aVertexPosition, 0.0, 1.0);\n\tvTextureCoord = aTextureCoord;\n}\n",!1);if(null!=n){var i=this.getShader(t,"\nprecision mediump float;\n\nvarying mediump vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform vec2 uSize;\n\nfloat calcDistance( float x, float y, float dx, float dy ) {\n\tfloat xd = x + dx;\n\tfloat yd = y + dy;\n\tfloat u = xd / uSize.x;\n\tfloat v = yd / uSize.y;\n\tfloat ul = (xd - 1.0) / uSize.x;\n\tfloat vt = (yd - 1.0) / uSize.y;\n\n\tfloat m = texture2D(uSampler, vec2(u , v )).a;\n\tfloat l = texture2D(uSampler, vec2(ul, v )).a;\n\tfloat t = texture2D(uSampler, vec2(u , vt)).a;\n\tfloat ddx = -(0.5 - m) / (l - m);\n\tfloat ddy = -(0.5 - m) / (t - m);\n\tbool bl = min(l,m) < 0.5 && 0.5 <= max(l,m);\n\tbool bt = min(t,m) < 0.5 && 0.5 <= max(t,m);\n\treturn (\n\t\tbl ?\n\t\t(bt ?\n\t\t\tlength(vec2(dx + ddx * 0.5, dy + ddy * 0.5)) :\n\t\t\tlength(vec2(dx + ddx, dy))\n\t\t) :\n\t\t(bt ?\n\t\t\tlength(vec2(dx, dy + ddy)) :\n\t\t\t100.0\n\t\t)\n\t);\n}\n\nfloat calcDistancesY( float x, float y, float dx ) {\n\tfloat d = 100.0;\n\tfor( float dy=-6.0; dy<6.5; dy++ ) {\n\t\td = min( d, calcDistance( x, y, dx, dy ) );\n\t}\n\treturn d;\n}\n\nfloat calcDistances( float x, float y ) {\n\tfloat d = 100.0;\n\tfor( float dx=-6.0; dx<6.5; dx++ ) {\n\t\td = min( d, calcDistancesY( x, y, dx ) );\n\t}\n\treturn d;\n}\n\nvoid main(void) {\n\tfloat t = texture2D(uSampler, vTextureCoord).a;\n\tfloat x = vTextureCoord.x * uSize.x;\n\tfloat y = vTextureCoord.y * uSize.y;\n\tfloat d = min( 6.0, calcDistances( x, y ) ) / 12.0;\n\td = clamp( mix( 0.5 - d, 0.5 + d, step( 0.5, t ) ), 0.0, 1.0 );\n\tgl_FragColor = vec4(1.0, 1.0, 1.0, d);\n}\n",!0);if(null!=i){var r=this.Ne=t.createProgram();if(null!=r)return t.attachShader(r,n),t.attachShader(r,i),t.linkProgram(r),t.getProgramParameter(r,t.LINK_STATUS)?(t.deleteShader(n),t.deleteShader(i),t.useProgram(r),this.Ie=t.getAttribLocation(r,"aVertexPosition"),this.Ce=t.getAttribLocation(r,"aTextureCoord"),this.Ae=t.getUniformLocation(r,"uSampler"),this.Re=t.getUniformLocation(r,"uSize"),t.useProgram(null),r):(console&&console.error("Failed to link the program: ".concat(t.getError())),t.deleteShader(n),t.deleteShader(i),null);t.deleteShader(n),t.deleteShader(i)}else t.deleteShader(n)}}return null},t.prototype.destroyShaders=function(){var t=this.Te;if(null!=t&&!0!==t.isContextLost()){var n=this.Ne;null!=n&&(this.Ne=null,t.useProgram(null),t.deleteProgram(n))}},t.prototype.updateTexture=function(t){var n=this.Te,i=this.ir;if(null!=n&&!0!==n.isContextLost()&&null!=i){var r=t.width,e=t.height;i.width===r&&i.height===e||(i.width=r,i.height=e,n.viewport(0,0,r,e));var u=this.je;return null==u?(u=this.je=n.createTexture(),n.bindTexture(n.TEXTURE_2D,u),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,t),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.NEAREST),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.NEAREST),n.bindTexture(n.TEXTURE_2D,null)):(n.bindTexture(n.TEXTURE_2D,u),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,t),n.bindTexture(n.TEXTURE_2D,null)),u}return null},t.prototype.destroyTexture=function(){var t=this.Te,n=this.je;null!=t&&!0!==t.isContextLost()&&null!=n&&(this.je=null,t.bindTexture(t.TEXTURE_2D,null),t.deleteTexture(n))},t.prototype.makeVertexBuffer=function(){var t=this.Te;if(null!=t&&!0!==t.isContextLost()){var n=this.Le=t.createBuffer();return t.bindBuffer(t.ARRAY_BUFFER,n),t.bufferData(t.ARRAY_BUFFER,new Float32Array([-1,1,1,1,-1,-1,1,-1]),t.STATIC_DRAW),n}return null},t.prototype.destroyVertexBuffer=function(){var t=this.Te,n=this.Le;null!=t&&!0!==t.isContextLost()&&null!=n&&(this.Le=null,t.bindBuffer(t.ARRAY_BUFFER,null),t.deleteBuffer(n))},t.prototype.makeUvBuffer=function(){var t=this.Te;if(null!=t&&!0!==t.isContextLost()){var n=this.ye=t.createBuffer();return t.bindBuffer(t.ARRAY_BUFFER,n),t.bufferData(t.ARRAY_BUFFER,new Float32Array([0,0,1,0,0,1,1,1]),t.STATIC_DRAW),n}return null},t.prototype.destroyUvBuffer=function(){var t=this.Te,n=this.ye;null!=t&&!0!==t.isContextLost()&&null!=n&&(this.ye=null,t.bindBuffer(t.ARRAY_BUFFER,null),t.deleteBuffer(n))},t.prototype.render=function(){var t=this.Te,n=this.ir,i=this.Ne,r=this.Le,e=this.ye,u=this.je;if(null!=t&&!0!==t.isContextLost()&&null!=n&&null!=i&&null!=r&&null!=e&&null!=u){t.clear(t.COLOR_BUFFER_BIT),t.useProgram(i),t.bindBuffer(t.ARRAY_BUFFER,r);var s=this.Ie;t.enableVertexAttribArray(s),t.vertexAttribPointer(s,2,t.FLOAT,!1,0,0),t.bindBuffer(t.ARRAY_BUFFER,e);var h=this.Ce;t.enableVertexAttribArray(h),t.vertexAttribPointer(h,2,t.FLOAT,!1,0,0),t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,u),t.uniform1i(this.Ae,0),t.uniform2f(this.Re,n.width,n.height),t.drawArrays(t.TRIANGLE_STRIP,0,4),t.bindTexture(t.TEXTURE_2D,null),t.bindBuffer(t.ARRAY_BUFFER,null),t.useProgram(null)}},t.prototype.read=function(t){var n=this.Te,i=this.ir;if(null!=n&&!0!==n.isContextLost()&&null!=i){var r=i.width,e=i.height;t.width=r,t.height=e;var u=t.getContext("2d");null!=u&&u.drawImage(i,0,0)}},t.prototype.destroy=function(){this.destroyVertexBuffer(),this.destroyUvBuffer(),this.destroyShaders();var t=this.ir;null!=t&&(this.ir=null,t.removeEventListener("webglcontextlost",this.ke,!1),t.removeEventListener("webglcontextrestored",this.xe,!1),window.removeEventListener("unload",this.Be,!1));var n=this.Te;if(null!=n){this.Te=null;var i=n.getExtension("WEBGL_lose_context");null!=i&&i.loseContext()}},t.getInstance=function(){return null==t._e&&(t._e=new t),t._e},t._e=null,t}(),de=function(){function t(n){this.R="font-atlas:".concat(n),this.Pe=be.getInstance().init(),this.ir=document.createElement("canvas"),this.Ue={family:t.toFontFamily(n),size:32,italic:!1},this.Fe={},this.Ge=0,this.St=1,this.cn=1,this.vn=!0}return Object.defineProperty(t.prototype,"id",{get:function(){return this.R},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"font",{get:function(){return this.Ue},set:function(t){this.Ue.family=t.family,this.Ue.size=t.size,this.Ue.italic=t.italic},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.St},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.cn},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canvas",{get:function(){return this.ir},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"generator",{get:function(){return this.Pe},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"characters",{get:function(){return this.Fe},enumerable:!1,configurable:!0}),t.prototype.begin=function(){this.Ge=0;var t=this.Fe;for(var n in t)t[n].ref=0},t.prototype.end=function(){var t=this.Fe;for(var n in t){var i=t[n];i.ref<=0&&(i.life-=1,i.life<=0&&(delete t[n],this.vn=!0))}},t.prototype.addAscii=function(){this.addChar(" "," ",ve.SPACE_R),this.addChar("\t"," ",ve.SPACE_R),this.addChar("...","...",ve.LETTER_RNB);for(var t=0,n=ce.length;t<n;++t){var i=ce[t];this.addChar(i,i,ve.LETTER_RNB)}},t.prototype.addChar=function(t,n,i){var r=this.Fe;if(!this.isIgnored(n)){var e=r[t];null!=e?(e.ref<=0&&(this.Ge+=1),e.ref+=1):(r[t]=new le(n,0,1,1,i),this.Ge+=1,this.vn=!0)}},t.prototype.isIgnored=function(t){switch(t){case"\n":case"\r":case"\v":case"\f":case"…":return!0}return!1},t.prototype.add=function(t,n){void 0===n&&(n=ve.LETTER);for(var i=b.from(t);i.hasNext();){var r=i.next();this.addChar(r,r,n)}},t.prototype.get=function(t){return this.Fe[t]},t.prototype.update=function(){if(this.vn){var n=this.ir,i=this.Pe;if(null!=n&&null!=i){var r=n.getContext("2d");if(null!=r){this.vn=!1;var e=this.Ue,u=this.Fe,s=e.size+14,h=t.toPowerOf2(Math.ceil(Math.sqrt(this.Ge))*s);this.St=h;var o=(e.italic?"italic ":"")+e.size+"px "+e.family;r.font=o,r.textAlign="left",r.textBaseline="middle",r.lineWidth=0,r.lineCap="round",r.lineJoin="miter",r.miterLimit=0,r.fillStyle="#FFFFFF";var a=s>>1,c=0,f=0;for(var l in u){var v=u[l],b=r.measureText(v.character).width,d=Math.ceil(7+b+7),g=s;h<=c+d&&(c=0,f+=s),v.x=c,v.y=f,v.width=d,v.height=g,v.advance=b,v.origin.x=c+7,v.origin.y=f+a,c+=d}var m=this.cn=f+s;for(var l in n.width=h,n.height=m,r.font=o,r.textAlign="left",r.textBaseline="middle",r.lineWidth=0,r.lineCap="round",r.lineJoin="miter",r.miterLimit=4,r.fillStyle="#FFFFFF",r.clearRect(0,0,h,m),u)v=u[l],r.fillText(v.character,v.origin.x,v.origin.y);return i.updateTexture(n),i.render(),i.read(n),!0}}}return!1},Object.defineProperty(t.prototype,"length",{get:function(){return this.Ge},enumerable:!1,configurable:!0}),t.prototype.toJson=function(){return{width:this.St,height:this.cn,font:this.Ue,characters:this.Fe}},t.prototype.toString=function(){return JSON.stringify(this.toJson())},t.prototype.destroy=function(){null!=this.Pe&&(this.Pe=null),null!=this.ir&&(this.ir=null);var t=this.Fe;for(var n in t)delete t[n]},t.toFontFamily=function(n){return"auto"===n?t.getAutoFontFamily():n},t.toPowerOf2=function(t){for(var n=32;n<t;)n<<=1;return n},t.getAutoFontFamily=function(){return null==t.FONT_FAMILY_AUTO&&(t.FONT_FAMILY_AUTO=K.getInstance().get("DBase").getFontFamilly()),t.FONT_FAMILY_AUTO},t.FONT_FAMILY_AUTO=null,t}(),ge=function(){function t(){this.He={}}return t.prototype.begin=function(){var t=this.He;for(var n in t)t[n].begin()},t.prototype.end=function(){var t=this.He;for(var n in t){var i=t[n];0<i.length&&i.addAscii(),i.end(),i.length<=0&&(i.destroy(),delete t[n])}},t.prototype.add=function(t,n){var i=this.He[t];if(null!=i)i.add(n);else{var r=new de(t);r.add(n),this.He[t]=r}},t.prototype.get=function(t){var n=this.He[t];return null!=n?n:null},t.prototype.update=function(t){var n=this.He,i=t.getBaseTexture();for(var r in n){var e=n[r];if(e.update()){var u=e.id,s=t.get(u);if(null!=s){var h=e.width,o=e.height,a=i.resolution;s.frame.width=h,s.frame.height=o,s.width=h/a,s.height=o/a,t.toDirty()}else t.set(u,new ae(e,i))}}},t.prototype.destroy=function(){var t=this.He;for(var n in t)t[n].destroy();this.He={}},t}(),me=function(t){function n(n,i){var r=t.call(this,n.src,n.width/i.resolution,n.height/i.resolution,0,i)||this;return r.image=n,r}return B(n,t),n.prototype.render=function(t){var n=this.frame,i=n.x,r=n.y,e=n.width,u=n.height,s=this.image;t.drawImage(s,i,r,e,u),t.drawImage(s,0,0,1,u,i-1,r-1,1,u+2),t.drawImage(s,0,0,e,1,i,r-1,e,1),t.drawImage(s,e-1,0,1,u,i+e,r-1,1,u+2),t.drawImage(s,0,u-1,e,1,i,r+u,e,1)},n}(ue),we=function(t,n){this.texture=t,this.indexOffset=n},Oe=function(){function t(){this.index=0,this.baseTexture=null,this.units=[]}return t.prototype.begin=function(){this.index=0,this.baseTexture=null},t.prototype.push=function(t,n){if(this.index<this.units.length){var i=this.units[this.index];i.texture=t,i.indexOffset=n}else this.units.push(new we(t,n));this.index+=1},t.prototype.end=function(){this.units.length!==this.index&&(this.units.length=this.index)},t.prototype.destroy=function(){this.units.length=0},t}(),pe=function(){function n(t,n){var i=3*t,r=i;this.vertices=new Float32Array(2*r),this.ze=r,this.o=0,this.dn=null,this.clippings=new Float32Array(3*r),this.Ve=null,this.steps=new Float32Array(6*r),this.We=null,this.colorFills=new Float32Array(4*r),this.Xe=null,this.colorStrokes=new Float32Array(4*r),this.Ke=null,this.uvs=new Float32Array(2*r),this.mn=null;var e=r<=65535;this.indices=e?new Uint16Array(i):new Uint32Array(i),this.Ye=t,this.l=0,this.indexCountRequested=0,this.wn=null,this.Je=n,this.Ze=new Oe,this.qe=null}return n.prototype.updateVertices=function(){var t=this.dn;t&&t.update()},n.prototype.updateClippings=function(){var t=this.Ve;t&&t.update()},n.prototype.updateSteps=function(){var t=this.We;t&&t.update()},n.prototype.updateColorFills=function(){var t=this.Xe;t&&t.update()},n.prototype.updateColorStrokes=function(){var t=this.Ke;t&&t.update()},n.prototype.updateUvs=function(){var t=this.mn;t&&t.update()},n.prototype.updateIndices=function(){var t=this.wn;t&&t.update()},n.prototype.getGeometry=function(){var n=this.qe;return null==n&&(this.dn=new t.Buffer(this.vertices,!1,!1),this.Ve=new t.Buffer(this.clippings,!1,!1),this.We=new t.Buffer(this.steps,!1,!1),this.Xe=new t.Buffer(this.colorFills,!1,!1),this.Ke=new t.Buffer(this.colorStrokes,!1,!1),this.mn=new t.Buffer(this.uvs,!1,!1),this.wn=new t.Buffer(this.indices,!1,!0),this.qe=n=(new t.Geometry).addIndex(this.wn).addAttribute("aPosition",this.dn,2).addAttribute("aClipping",this.Ve,3).addAttribute("aStep",this.We,2).addAttribute("aAntialias",this.We,4).addAttribute("aColorFill",this.Xe,4).addAttribute("aColorStroke",this.Ke,4).addAttribute("aUv",this.mn,2)),n},n.prototype.upload=function(){this.Je.geometry.bind(this.getGeometry())},n.prototype.render=function(n){var i=this.Je;i.geometry.bind(this.getGeometry());var r=this.Ze.units,e=r.length;if(0<e){for(var u=t.DRAW_MODES.TRIANGLES,s=null,h=r[0],o=0,a=3*h.indexOffset,c=0,f=t.Texture.WHITE,l=0,v=e-1;l<v;++l)s=h,o=a,c=(a=3*(h=r[l+1]).indexOffset)-o,f=s.texture||t.Texture.WHITE,0<c&&f.valid&&(n.uniforms.sampler=i.texture.bind(f),i.geometry.draw(u,c,o));c=3*this.l-a,f=h.texture||t.Texture.WHITE,0<c&&f.valid&&(n.uniforms.sampler=i.texture.bind(f),i.geometry.draw(u,c,a))}},n.prototype.isCompatible=function(t,n,i,r){return n.getBuffer()===this&&n.getVertexOffset()===i&&n.getIndexOffset()===r&&n.isCompatible(t)},n.prototype.update=function(t,n,i){var u=this.Ze;u.begin();for(var s=0,h=0,o=t.get();null!=o&&null!=(a=o.uploaded)&&this.isCompatible(o,a,s,h);o=t.next())if(a.update(o),a.buildUnit(u),s+=a.getVertexCount(),h+=a.getIndexCount(),i)return t.next(),u.end(),this.o=s,this.l=h,0<u.units.length;for(;null!=o;o=t.next()){var a,c=e[o.type]||e[r.GROUP];if(null==c)break;if(null==(a=c(this,o,s,h,n)))break;if(a.buildUnit(u),s+=a.getVertexCount(),h+=a.getIndexCount(),i){t.next();break}}return u.end(),this.o=s,this.l=h,0<u.units.length},n.prototype.check=function(t,n,i,r){return this.indexCountRequested=r,t+i<=this.ze&&n+r<=this.Ye},n.prototype.destroy=function(){var t=this.qe;t&&t.destroy(),this.Ze.destroy()},n}(),De=[],Ee=function(){this.index=0,this.shapes=De,this.current=null},Me=function(){function t(){this.Qe=-1,this.$e=new Ee,this.Pt=[this.$e],this.tu=null}return t.prototype.reset=function(t,n){this.Qe=0;var i=this.Pt[0];return i.index=-1,i.shapes=n,i.current=null,this.$e=i,null!=t?(this.tu=t,t):this.next()},t.prototype.get=function(){return this.tu},t.prototype.next=function(){for(;;){var t=this.$e,n=t.index+=1,i=t.shapes,r=n<i.length?t.current=i[n]:t.current=null;if(null==r)return e=this.Qe-=1,u=this.Pt,0<=e?(h=u[e],this.$e=h,this.tu=h.current):this.tu=null;var e,u,s=r.children;if(!(0<s.length))return this.tu=r,r;if((e=this.Qe+=1)<(u=this.Pt).length)(h=u[e]).index=-1,h.shapes=s,h.current=null,this.$e=h;else{var h=new Ee;u.push(h),h.index=-1,h.shapes=s,h.current=null,this.$e=h}}},t}(),Se=function(n){function i(r){var e=n.call(this,r)||this;return i.SHADER=i.SHADER||t.Shader.from("\nattribute vec2 aPosition;\nattribute vec3 aClipping;\nattribute vec2 aStep;\nattribute vec4 aAntialias;\nattribute vec4 aColorFill;\nattribute vec4 aColorStroke;\nattribute vec2 aUv;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform mediump float shapeScale;\nuniform mediump float pixelScale;\nuniform mediump float antialiasWeight;\n\nvarying mediump vec3 vClipping;\nvarying mediump vec2 vStep;\nvarying mediump vec4 vAntialias;\nvarying mediump vec4 vColorFill;\nvarying mediump vec4 vColorStroke;\nvarying mediump vec2 vUv;\n\nvec2 toInverse( in vec2 v ) {\n\treturn vec2( -v.y, v.x );\n}\n\nvec2 toTransformedPosition( in vec2 v ) {\n\treturn (projectionMatrix * translationMatrix * vec3(v, 1.0)).xy;\n}\n\nvec4 toAntialias01( in vec4 antialias ) {\n\t// Taylor series of 1 / ( 1 - a ) = 1 + a + a^2 + ....\n\treturn 1.0 + min( vec4( 1.0 ), antialias * pixelScale );\n}\n\nvec4 toAntialias2( in vec4 antialias, in float strokeWidth ) {\n\tfloat x = min( 0.4, 0.4 / 12.0 * antialias.x * pixelScale * antialiasWeight );\n\tfloat w = clamp( strokeWidth / antialias.y, 0.0, 1.0 ) * 0.4;\n\tfloat p = w * antialias.z + antialias.w;\n\tfloat y = 0.5 - p;\n\tfloat z = 0.5 - p - w;\n\treturn vec4( y, z, y - max( 0.01, y - x ), z - max( 0.01, z - x ) );\n}\n\nvec2 toPosition3456( in float type, in vec2 p, in vec2 pprev, in vec2 pnext, in float strokeWidth, out float shift ) {\n\tvec2 d0 = p - pprev;\n\tvec2 d1 = pnext - p;\n\tfloat l0 = dot( d0, d0 );\n\tfloat l1 = dot( d1, d1 );\n\tvec2 nd0 = normalize( toInverse( d0 ) );\n\tvec2 nd1 = normalize( toInverse( d1 ) );\n\tvec2 nd2 = 0.00001 < l1 ? nd1 : vec2(0.0, 0.0);\n\tvec2 n0 = 0.00001 < l0 ? nd0 : nd2;\n\tvec2 n1 = 0.00001 < l1 ? nd1 : n0;\n\tvec2 n0i = toInverse( n0 );\n\tvec2 n1i = toInverse( n1 );\n\tfloat direction = sign( 4.5 - type );\n\n\t// Offset\n\tfloat cross = dot( n0i, n1 );\n\tfloat crossInverse = ( 0.00001 < abs( cross ) ? 1.0 / cross : 0.0 );\n\tfloat b = dot(n1 - n0, n0) * crossInverse;\n\tfloat offsetSize = direction * strokeWidth * 0.5;\n\tvec2 offset = n1 + n1i * b;\n\n\t// Miter\n\tvec2 pmiter = p + offsetSize * offset;\n\tfloat miterAngle0 = dot( n0i, pmiter - pprev );\n\tfloat miterAngle1 = dot( n1i, pmiter - pnext );\n\tfloat miterLength = dot( offset, offset );\n\tfloat miterSide = direction * cross;\n\n\t// Bevel\n\tvec2 n = ( type == 4.0 || type == 6.0 ? n1 : n0 );\n\tvec2 pbevel = p + offsetSize * n;\n\n\t//\n\tvec2 presult = (\n\t\t0.0 <= miterSide ?\n\t\t( miterAngle0 < 0.0 && 0.0 <= miterAngle1 ? pmiter : pbevel ) :\n\t\t( miterLength < 6.0 ? pmiter : pbevel )\n\t);\n\tvec2 ni = ( type == 4.0 || type == 6.0 ? n1i : n0i );\n\tshift = dot( ni, p - presult );\n\treturn toTransformedPosition( presult );\n}\n\nvec2 toStep3456( in float type ) {\n\treturn ( type < 4.5 ? vec2( 1.0, 0.0 ) : vec2( 0.0, 1.0 ) );\n}\n\nvec4 toAntialias3456( in float strokeWidth ) {\n\tfloat a = antialiasWeight / max( 0.0001, strokeWidth );\n\treturn toAntialias01( vec4( a, a, a, a ) );\n}\n\nfloat toDotAndDashScale( in float scale, in float strokeWidthScale ) {\n\treturn (\n\t\tscale == 4.0 || scale == 5.0 || scale == 6.0 || scale == 7.0 ?\n\t\tstrokeWidthScale : 1.0\n\t);\n}\n\nvec4 toColorStroke3456( in float shift, in float scale ) {\n\tfloat x = aColorFill.x + shift;\n\tfloat y = scale * aColorFill.y;\n\tfloat z = scale * aColorFill.z;\n\tfloat w = aColorFill.w;\n\treturn vec4( x, y, z, w );\n}\n\nfloat toStrokeWidthScale( in float scale ) {\n\treturn (\n\t\tscale == 3.0 || scale == 7.0 ?\n\t\tshapeScale : (\n\t\t\tscale == 1.0 || scale == 5.0 ?\n\t\t\tmin( 1.0, shapeScale ) : (\n\t\t\t\tscale == 2.0 || scale == 6.0 ?\n\t\t\t\tmax( 1.0, shapeScale ) : 1.0\n\t\t\t)\n\t\t)\n\t);\n}\n\nvec2 toStep01(in vec2 size, in vec2 weight, in vec2 strokeWidth) {\n\treturn weight / max(vec2(0.00001), vec2(1.0) - strokeWidth / size);\n}\n\nvec4 toAntialias01b(in vec2 size, in vec2 strokeWidth) {\n\treturn antialiasWeight / max(vec4(0.00001), vec4(size - strokeWidth, size));\n}\n\nvoid main(void) {\n\tvec2 p012 = toTransformedPosition( aPosition );\n\n\tfloat type = aClipping.z;\n\tfloat strokeWidthScale = toStrokeWidthScale( aStep.y );\n\tfloat strokeWidth = strokeWidthScale * aStep.x;\n\n\t// type === 0 or 1\n\tvec2 size01 = aAntialias.xy;\n\tvec2 weight01 = abs(aAntialias.zw - sign(aAntialias.zw));\n\tvec2 strokeWidth01 = step(vec2(0.0), aAntialias.zw) * strokeWidth;\n\tvec2 step01 = toStep01( size01, weight01, strokeWidth01 );\n\tvec4 a01 = toAntialias01( toAntialias01b( size01, strokeWidth01 ) );\n\n\t// type === 2\n\tvec4 a2 = toAntialias2( aAntialias, strokeWidth );\n\n\t// type === 3, 4, 5 or 6\n\tfloat shift3456 = 0.0;\n\tvec2 p3456 = toPosition3456( type, aPosition, aAntialias.xy, aAntialias.zw, strokeWidth, shift3456 );\n\tvec2 step3456 = toStep3456( type );\n\tvec4 a3456 = toAntialias3456( strokeWidth );\n\tvec4 colorStroke3456 = toColorStroke3456( shift3456, toDotAndDashScale( aStep.y, strokeWidthScale ) );\n\n\t//\n\tgl_Position = vec4( ( 2.5 < type ? p3456 : p012 ), 0.0, 1.0 );\n\tvAntialias = ( 1.5 < type ? ( 2.5 < type ? a3456 : a2 ) : a01 );\n\tvClipping = aClipping;\n\tvStep = ( 2.5 < type ? step3456 : step01 );\n\tvColorFill = ( 2.5 < type ? aColorStroke : aColorFill );\n\tvColorStroke = ( 2.5 < type ? colorStroke3456 : aColorStroke );\n\tvUv = aUv;\n}","\nvarying mediump vec3 vClipping;\nvarying mediump vec2 vStep;\nvarying mediump vec4 vAntialias;\nvarying mediump vec4 vColorFill;\nvarying mediump vec4 vColorStroke;\nvarying mediump vec2 vUv;\n\nuniform sampler2D sampler;\nuniform mediump float pixelScale;\n\nvoid main(void) {\n\tvec4 texture = texture2D(sampler, vUv);\n\tfloat type = vClipping.z;\n\tvec2 v0 = vStep;\n\tvec2 v1 = vClipping.xy;\n\tvec2 v2 = v0 * vAntialias.xy;\n\tvec2 v3 = v1 * vAntialias.zw;\n\tvec2 d01 = ( v0.x < v0.y ? vec2( v0.y, v2.y ) : vec2( v0.x, v2.x ) );\n\tvec2 d02 = ( v1.x < v1.y ? vec2( v1.y, v3.y ) : vec2( v1.x, v3.x ) );\n\tvec4 d0 = vec4( d01.x, d02.x, d01.y, d02.y );\n\tvec4 d1 = vec4( dot( v0, v0 ), dot( v1, v1 ), dot( v2, v2 ), dot( v3, v3 ) );\n\tvec4 d = ( type == 1.0 ? d1 : d0 );\n\tvec2 s = smoothstep( 1.0 - (d.zw - d.xy), vec2( 1.0 ), d.xy );\n\tvec4 color01 = texture * (vColorStroke * (s.x - s.y) + vColorFill * (1.0 - s.x));\n\n\tfloat l = vColorStroke.x;\n\tfloat lp0 = vColorStroke.y;\n\tfloat lp1 = vColorStroke.z;\n\tfloat lt = vColorStroke.w;\n\tfloat ld = 0.5 * pixelScale;\n\tfloat lm = mod( l, lp0 + lp1 );\n\tfloat ls0 = ( 0.0 < lp1 ? smoothstep( 0.0, ld, lm ) - smoothstep( lp0, lp0 + ld, lm ) : 1.0 );\n\tfloat ls1 = ( 0.0 <= lt ? smoothstep( 0.0, ld, l ) - smoothstep( lt - ld, lt, l ) : 1.0 );\n\tvec4 color3456 = color01 * ls0 * ls1;\n\n\tvec2 a0 = vAntialias.xy;\n\tvec2 a1 = vAntialias.zw;\n\tvec2 a2 = vec2( texture.a );\n\tvec2 a = smoothstep( a0 - a1, a0 + a1, a2 );\n\tvec4 color2 = a.x * vColorFill + ( a.y - a.x ) * vColorStroke;\n\tgl_FragColor = ( type == 2.0 ? color2 : (2.5 < type ? color3456 : color01) );\n}"),e.nu=i.SHADER,e.iu=new Me,e.ru=e.getBufferSizeMax(r),e}return B(i,n),i.prototype.getBufferSizeMax=function(t){var n=t.context,i=n.extensions;return 1<n.webGLVersion||i.uint32ElementIndex?1431655765:21845},i.prototype.updateAtlas=function(t,n,i,r,e){var u=t.imageSrc;if(null!=u){var s=n.get(u);if(null!=s)t.texture=s.texture;else{var h=t.image;if(null!=h){var o=new me(h,e);t.texture=o.texture,n.set(o.id,o)}else t.texture=r}}else t.texture=r;var a=t.text,c=a.value;0<c.length&&i.add(a.family,c)},i.prototype.updateAtlases=function(t,n,i,r,e){for(var u=0,s=t.length;u<s;++u){var h=t[u];this.updateAtlas(h,n,i,r,e);for(var o=h.children,a=0,c=o.length;a<c;++a){var f=o[a];this.updateAtlas(f,n,i,r,e),this.updateAtlases(f.children,n,i,r,e)}}},i.prototype.updateFontAtlas=function(t,n,i,r){var e=t.text,u=i.get(e.family);if(null!=u){var s=n.get(u.id);null!=s?(e.atlas=u,e.texture=s.texture):(e.atlas=void 0,e.texture=r)}else e.atlas=void 0,e.texture=r},i.prototype.updateFontAtlases=function(t,n,i,r){for(var e=0,u=t.length;e<u;++e){var s=t[e];this.updateFontAtlas(s,n,i,r);for(var h=s.children,o=0,a=h.length;o<a;++o){var c=h[o];this.updateFontAtlas(c,n,i,r),this.updateFontAtlases(c.children,n,i,r)}}},i.prototype.eu=function(n,i,r,e){var u=this.renderer,s=this.nu;if(null!=s&&(null!=i||0<r.length)){var h=u.resolution,o=n.getBuffers(),a=n.getAntialiasWeight(h);if(e){var c=n.getAtlas(h),f=n.getFontAtlases();c.begin(),f.begin();var l=c.getDefaultTexture(),v=c.getBaseTexture();this.updateAtlases(r,c,f,l,v),f.end(),f.update(c),this.updateFontAtlases(r,c,f,l),c.end(),c.repack(),this.updateBuffers(i,r,o,u,a)}s.uniforms.shapeScale=n.toShapeScale(),s.uniforms.pixelScale=n.toPixelScale(h),s.uniforms.antialiasWeight=a,s.uniforms.translationMatrix=n.worldTransform.toArray(!0),u.shader.bind(s,!1),u.state.setBlendMode(t.utils.correctBlendMode(t.BLEND_MODES.NORMAL,!0));var b=o.length;if(1<b)for(var d=0;d<b;++d)o[d].upload();for(d=0;d<b;++d)o[d].render(s)}},i.prototype.updateBuffers=function(t,n,i,r,e){var u=this.iu;u.reset(t,n);for(var s=0,h=0,o=5e3,a=this.ru;null!=u.get();){var c=null,f=!1;if(0<h?(c=new pe(h,r),i.splice(s,0,c),f=!0):s<i.length?(c=i[s],f=!1):(c=new pe(o,r),i.push(c),f=!1),c.update(u,e,f))h=0,s+=1;else{if(!((h=c.indexCountRequested)<=a))break;h=Math.ceil(h/o)*o,h=Math.min(h,a)}}if(s<i.length){for(var l=s,v=i.length;l<v;++l)i[l].destroy();i.length=s}},i.SHADER=null,i}(t.ObjectRenderer),Te=function(n){function i(){var i=n.call(this)||this;return i.uu=null,i.children=[],i._r=null,i.su=0,i.hu=-1,i.ou=null,i.au=new ge,i.cu=1,i.fu=NaN,i.lu=1,i.vu=NaN,i.bu=new t.Point,i.du=[],i}return B(i,n),i.prototype.calculateBounds=function(){this._bounds.clear()},i.prototype.onChildTransformChange=function(){},i.prototype.toDirty=function(){return this.su+=1},i.prototype.isDirty=function(){return this.hu<this.su},i.prototype.render=function(t){if(this.visible&&!(this.worldAlpha<=0)&&this.renderable){var n=this.su,i=this.hu;this.hu=n;var r=i<n,e=this.uu;null==e&&(e=this.uu=new Se(t)),t.batch.setObjectRenderer(e);var u=this.mask,s=this._r,h=this.children;u?(t.mask.push(this,u),e.eu(this,s,h,r),t.mask.pop(this)):e.eu(this,s,h,r)}},i.prototype.containsPoint=function(t){return!1},i.prototype.getFontAtlases=function(){return this.au},i.prototype.getAtlas=function(t){var n=this.ou;return null==n&&(n=new oe(t),this.ou=n),n},i.prototype.getBuffers=function(){return this.du},i.prototype.toShapeScale=function(){this.updateTransform();var t=this.transform,n=t._worldID;if(n!==this.vu){this.vu=n;var i=t.worldTransform,r=i.a,e=i.b;this.lu=1/Math.sqrt(r*r+e*e)}return this.lu},i.prototype.getShapeScale=function(){return this.lu},i.prototype.toPixelScale=function(t){var n=this.toShapeScale(),i=this.vu;return this.fu!==i&&(this.fu=i,this.cu=1/t*n),this.cu},i.prototype.getPixelScale=function(){return this.cu},i.prototype.getAntialiasWeight=function(t){return 1.25/t},i.prototype.hitTest=function(t,n){for(var i=this.bu,r=this.children,e=r.length-1;0<=e;--e){var u=r[e];if(u.visible){u.toLocal(t,void 0,i);var s=u.contains(i.x,i.y);if(null!=s&&(null==n||n(s)))return s}}return null},i.prototype.hitTestBBox=function(t,n){for(var i=this.bu,r=this.children,e=r.length-1;0<=e;--e){var u=r[e];if(u.visible&&(u.toLocal(t,void 0,i),u.containsBBox(i.x,i.y)&&(null==n||n(u))))return u}return null},i.prototype.destroy=function(){var t=this.du;if(null!=t)for(var i=0,r=t.length;i<r;++i)t[i].destroy();this.du.length=0;var e=this.children;for(i=e.length-1;0<=i;--i)e[i].destroy();e.length=0,n.prototype.destroy.call(this)},i}(t.DisplayObject),je=function(t){function n(n,i,e,u){void 0===u&&(u=r.EMBEDDED_LAYER);var s=t.call(this,i,e,u)||this;return s.Rr=n,s}return B(n,t),Object.defineProperty(n.prototype,"name",{get:function(){return this.Rr},enumerable:!1,configurable:!0}),n.prototype.newGroupFill=function(){return new Z(this,!1,16777215,1)},n.prototype.isGroupSizeFittable=function(){return!1},n.prototype.newGroupSize=function(t,n){var i=Y.SIZE_X,r=Y.SIZE_Y;return new Mr(this,i,r,i,r)},n.prototype.clone=function(){for(var t=this.newClone().copy(this),n=this.children,i=0,r=n.length;i<r;++i){var e=n[i].clone();e.parent=t,t.children.push(e)}return t.onChildTransformChange(),t.toDirty(),t.size.init(),t},n.prototype.newClone=function(){return new(0,this.constructor)(this.Rr,this.Cr,this.Ar,this.type)},n.prototype.serializeChildren=function(t){return[]},n.prototype.serializeImage=function(t){return-1},n.prototype.serializeGradient=function(t){return-1},n}(jr),Ne=function(){function t(){}return t.toLayers=function(t,n){var i=[],r=this.toLayer(t);if(r){var e=r.parent;if(e)for(var u=e.children,s=u.length,h=0,o=n.length;h<o;++h){var a=n[h];0<=a&&a<s&&i.push(u[a])}}return i},t.toLayer=function(t){for(var n=t.parent;null!=n;){if(n instanceof Te)return n;if(n instanceof je)return n;n=n.parent}return null},t.show=function(t){return!t.visible&&(t.visible=!0,!0)},t.showAll=function(t){for(var n=!1,i=0,r=t.length;i<r;++i){var e=t[i];e.visible||(e.visible=!0,n=!0)}return n},t.hide=function(t){return!!t.visible&&(t.visible=!1,!0)},t.hideAll=function(t){for(var n=!1,i=0,r=t.length;i<r;++i){var e=t[i];e.visible&&(e.visible=!1,n=!0)}return n},t.bringToFront=function(t){var n=t.parent;return!!n&&this.doBringToFront(t,n.children,0)},t.bringAllToFront=function(t){var n=t.length;if(0<n){var i=t[0].parent;if(i){for(var r=!1,e=i.children,u=0;u<n;++u){var s=t[n-1-u];this.doBringToFront(s,e,u)&&(r=!0)}return r}}return!1},t.doBringToFront=function(t,n,i){for(var r=n.length-1-i,e=r;0<=e;--e){var u=n[e];if(u===t){if(e!==r){for(var s=e+1;s<=r;++s)n[s-1]=n[s];return n[r]=u,!0}return!1}}return!1},t}(),Ie={NONE:0,DRAG:1,PINCH:2,ALL:3},Ce=t.interaction.InteractionEvent,Ae=function(n){function i(t){var i=n.call(this,t,$t.NONE)||this;return i.gu=new Map,i.mu=t.operationType,i.wu=t.scaleMin,i.Ou=t.scaleMax,i}return B(i,n),i.prototype.initialize=function(t,i){if(n.prototype.initialize.call(this,t,i),null==this.gu.get(t)){var r=Ne.toLayer(t);null!=r&&this.gu.set(t,r)}},i.prototype.onDown=function(t,i,r){if(n.prototype.onDown.call(this,t,i,r),r instanceof Ce){var e=this.gu.get(t),u=r.data.originalEvent.timeStamp;e&&this.condition(t,u,nn)&&this.getGestureUtil().onDown(e,r)}},i.prototype.getGestureUtil=function(){var t;return null!==(t=i.GESTURE_UTIL)&&void 0!==t?t:i.GESTURE_UTIL=this.newGestureUtil()},i.prototype.newGestureUtil=function(){var n=this,i=new t.Point;return new or({on:{move:function(t,r,e,u,s,h){n.onGestureMove(t,r,e,u,s,h,i)}}})},i.prototype.onGestureMove=function(t,n,i,r,e,u,s){var h=t.parent;if(h){var o=t.transform,a=this.mu,c=!1,f=1;if(a&Ie.PINCH){var l=o.scale,v=l.y,b=Math.min(this.Ou,Math.max(this.wu,v*u));f=b/v,l.set(b,b),c=!0}if(a&Ie.DRAG){h.toLocal(s.set(r,e),void 0,s);var d=s.x,g=s.y,m=r-n,w=e-i;h.toLocal(s.set(m,w),void 0,s);var O=s.x,p=s.y,D=o.position,E=(D.x-O)*f+d,M=(D.y-p)*f+g;D.set(E,M),c=!0}c&&rt.update(t)}},i.prototype.toSize=function(t,n){return"size"in t?n.copyFrom(t.size):n.set(t.width,t.height),n},i}(un),Re=t.interaction.InteractionEvent,Le=function(n){function i(t){var i=n.call(this,t,$t.NONE)||this;return i.mu=t.operationType,i.wu=t.scaleMin,i.Ou=t.scaleMax,i}return B(i,n),i.prototype.onDown=function(t,i,r){n.prototype.onDown.call(this,t,i,r),r instanceof Re&&this.condition(t,r.data.originalEvent.timeStamp,nn)&&this.getGestureUtil().onDown(t,r)},i.prototype.getGestureUtil=function(){var t;return null!==(t=i.GESTURE_UTIL)&&void 0!==t?t:i.GESTURE_UTIL=this.newGestureUtil()},i.prototype.newGestureUtil=function(){var n=this,i=new t.Point;return new or({on:{move:function(t,r,e,u,s,h){n.onGestureMove(t,r,e,u,s,h,i)}}})},i.prototype.onGestureMove=function(t,n,i,r,e,u,s){var h=t.parent;if(h){var o=t.transform,a=this.mu,c=!1,f=1;if(a&Ie.PINCH){var l=o.scale,v=l.y,b=Math.min(this.Ou,Math.max(this.wu,v*u));f=b/v,l.set(b,b),c=!0}if(a&Ie.DRAG){h.toLocal(s.set(r,e),void 0,s);var d=s.x,g=s.y,m=r-n,w=e-i;h.toLocal(s.set(m,w),void 0,s);var O=s.x,p=s.y,D=o.position,E=(D.x-O)*f+d,M=(D.y-p)*f+g;D.set(E,M),c=!0}c&&rt.update(t)}},i}(un),ye={SHAPE:0,LAYER:1},ke={INPUT_TEXT:0,INPUT_INTEGER:1,INPUT_REAL:2,EMIT_EVENT:3,WRITE_BOTH:4,WRITE_LOCAL:5,WRITE_REMOTE:6,HTML_ELEMENT:7,HTML_ELEMENT_WITHOUT_POINTER_EVENTS:8,SHOW_HIDE_LAYER:9,GESTURE_LAYER:10,GESTURE:11,EXECUTE:12},xe=function(t){function n(n,i,r,e,u){void 0===n&&(n=""),void 0===e&&(e=.05),void 0===u&&(u=20);var s=t.call(this,gn.GESTURE,n,i)||this;return s.operationType=r,s.scaleMin=e,s.scaleMax=u,s}return B(n,t),n.prototype.toRuntime=function(){switch(this.subtype){case ye.SHAPE:return new Le(this);case ye.LAYER:return new Ae(this)}},n.prototype.serialize=function(t){var n=t.addResource(this.condition);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(this.operationType,",").concat(this.scaleMin,",").concat(this.scaleMax,"]"))},n.deserialize=function(t,i){return new n(wn.toResource(1,t,i.resources),this.toSubType(t),t[3],t[4],t[5])},n.toSubType=function(t){if(t[0]!==gn.MISC)return t[2];switch(t[2]){case ke.GESTURE:return ye.SHAPE;case ke.GESTURE_LAYER:return ye.LAYER}},n}(dn),Be={INVISIBLE:"INVISIBLE",INTERACTIVE:"INTERACTIVE",DRAGGABLE:"DRAGGABLE",PINCHABLE:"PINCHABLE"},_e=function(t,n,i,r,e){var u,s,h,o=function(t,n){if(at(t))return t;var i=n.resources;return 0<=t&&t<=i.length?i[t]:""}(t[0],n),a=e?e(o,n):new je(o,n.mode,n.depth),c=t[1];null==c||2&c||(a.visible=!1,a.state.add(Be.INVISIBLE));var f=-.5*i+(t[2]||0),l=-.5*r+(t[3]||0);a.transform.position.set(f,l);var v=null!==(u=t[4])&&void 0!==u?u:i,b=null!==(s=t[5])&&void 0!==s?s:r;a.size.set(v,b),a.size.init();var d=t[6];if(null!=d&&a.fill.deserialize(d,n),n.mode===gr.VIEWER){var g=null!==(h=t[7])&&void 0!==h?h:1,m=1&g,w=2&g,O=4&g;if(w||O){var p=(w?Ie.DRAG:Ie.NONE)|(O?Ie.PINCH:Ie.NONE);a.action.add(new xe("",ye.LAYER,p))}(m||w||O)&&(a.interactive=!0)}return a},Pe=function(){function t(t,n){this.children=[],this.St=t,this.cn=n}return t.prototype.hasConnectors=function(t){for(var n=0,i=t.length;n<i;++n){var r=t[n];if(r instanceof re)return!0;var e=r.children;if(0<e.length&&this.hasConnectors(e))return!0}return!1},t.prototype.newHasConnectors=function(){for(var t=new Map,n=this.children,i=0,r=n.length;i<r;++i){var e=n[i];t.set(e,this.hasConnectors(e.children))}return t},t.prototype.copyTo=function(t){for(var n,i=null!==(n=this.pu)&&void 0!==n?n:this.pu=this.newHasConnectors(),r=this.children,e=t.children,u=0,s=r.length;u<s;++u){var h=r[u],o=h.clone();o.parent=t,e.push(o),i.get(h)&&ee.move(h,o)}t.onChildTransformChange(),t.toDirty(),t.onAttach()},t.prototype.deserialize=function(t,n){var i=t.length;if(0<i)for(var r=this.St,e=this.cn,u=0;u<i;++u)this.children.push(_e(t[u],n,r,e))},t}(),Ue=function(){function t(){}return t.toSimple=function(t){return{version:t.version,id:t.id,name:t.name,thumbnail:t.thumbnail,data:JSON.stringify({width:t.width,height:t.height,background:t.background,tile:t.tile,resources:t.resources,data:t.data||t.tags,pieces:t.pieces,layers:t.layers,items:t.items,snap:t.snap})}},t.toSerialized=function(t){if(!("items"in t)){var n=JSON.parse(t.data),i={version:t.version,id:t.id,name:t.name,width:n.width,height:n.height,background:n.background,tile:n.tile,resources:n.resources,data:n.data||n.tags,pieces:n.pieces,layers:n.layers,items:n.items,snap:n.snap,thumbnail:t.thumbnail};if(null==i.data){var r=t.tags;null!=r&&(i.data=JSON.parse(r))}if(null==i.pieces){var e=t.pieces;null!=e&&(i.pieces=JSON.parse(e))}return i}return t},t.newLayer=function(t,n,i){n.deserialize(t.layers,i);var r=t.items,e=Ar(r,i);return null!=e?e.then((function(t){for(var i=n.children,e=0,u=t.length;e<u;++e){var s=r[e],h=t[e];null!=(o=i[s[16]])&&(h.parent=o,h.uploaded=void 0,o.children.push(h))}for(e=0,u=i.length;e<u;++e){var o;(o=i[e]).onChildTransformChange(),o.toDirty();for(var a=o.children,c=0,f=a.length;c<f;++c)a[c].onAttach()}return t})):Promise.resolve([])},t.toPieceData=function(t,n,i){var r=new Map,e=new Map,u=function(){return r};return this.Du(t,n,r,e,i,0).then(u,u)},t.Du=function(t,n,i,r,e,u){var s=this,h=[];if(n&&0<n.length&&t)for(var o=function(o,a){var c=n[o],f=r.get(c);if(null!=f)h.push(f);else{var l=t.piece.getByName(c).then((function(n){return s.Eu(t,c,n,e,u+1,i,r)}),(function(){return null}));r.set(c,l),h.push(l)}},a=0,c=n.length;a<c;++a)o(a);return Promise.all(h)},t.Eu=function(t,n,i,r,e,u,s){var h=this,o=this.toSerialized(i),a=o.width,c=o.height,f=new Pe(a,c);u.set(n,new Lr(n,a,c,f));var l=o.pieces;return this.Du(t,l,u,s,r,e).then((function(){return h.newLayer(o,f,new dr(o,l,u,r,e))}))},t}(),Fe={},Ge=function(){function t(){}return t.isContainer=function(t){return t instanceof lr},t.isEmbedded=function(t){return t instanceof Nr},t.toContainer=function(t){for(var n=t;null!=n;){if(this.isContainer(n))return n;n=n.parent}return null},t.open=function(t,n,i,r){var e=Fe[n];if(null!=e)e(i,r,t);else switch(n){case vr.DIAGRAM:var u=this.toContainer(t);if(u){var s=u.controller;s&&s.getByName(i).then((function(t){u.set(Ue.toSerialized(t))}))}break;case vr.PAGE:r?window.open(i):window.location.href=i}},t.writeLocal=function(t,n,i,r,e){var u;void 0===e&&(e=Nt.FOUND);for(var s=t;null!=s;){if(this.isContainer(s))return(s.data.private.set(n,i,r,e)||s.data.protected.set(n,i,r,e)||!!s.data.set(n,i,r,e))&&(rt.update(s),!0);if(this.isEmbedded(s)&&(null===(u=s.data.getPrivate())||void 0===u?void 0:u.set(n,i,r,e)))return rt.update(s),!0;s=s.parent}return!1},t.writeRemote=function(t,n,i){var r=this.toContainer(t);return!!r&&r.data.remote.set(n,i)},t.emit=function(n,i,r,e){var u=t.toContainer(n);void 0===e?(n.emit(i,n),u&&u.shape.emit(i,n)):(n.emit(i,r,e,n),u&&u.shape.emit(i,r,e,n))},t}(),He=function(t){function n(n){var i=t.call(this,n,$t.NONE)||this;return i.name=rn.ofStringOrNull(n.name),i}return B(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,nn)){var r=this.name(t,i,nn);null!=r&&Ge.emit(t,r)}},n}(un),ze=function(t){function n(n,i){var r=t.call(this,gn.EMIT_EVENT,n)||this;return r.name=i,r}return B(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.name===i.name},n.prototype.toRuntime=function(){return new He(this)},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.name);return t.addResource("[".concat(this.type,",").concat(n,",").concat(i,"]"))},n.deserialize=function(t,i){return new n(wn.toResource(1,t,i.resources),wn.toResource(2,t,i.resources))},n}(bn),Ve=function(t){function n(n){var i=t.call(this,n,$t.NONE)||this;return i.target=rn.ofStringOrNull(n.target),i}return B(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,nn)){var r=this.target(t,i,nn);null!=r&&Ge.emit(t,r)}},n}(un),We={NO_POINTER_EVENTS:"NO_POINTER_EVENTS"},Xe=function(){function n(t){var n="http://www.w3.org/2000/svg",i=document.createElementNS(n,"svg");i.setAttribute("style","position: absolute;"),i.setAttribute("width","0px"),i.setAttribute("height","0px");var r=document.createElementNS(n,"defs"),e=document.createElementNS(n,"clipPath"),u="clipper_ex_".concat(Math.random().toString(32).substring(2));e.setAttribute("id",u),e.setAttribute("clipPathUnits","objectBoundingBox");var s=document.createElementNS(n,"path");this.Mu=s,this.Su="",s.setAttribute("clip-rule","evenodd"),e.appendChild(s),r.appendChild(e),i.appendChild(r),this.R=u,t.appendChild(i)}return Object.defineProperty(n.prototype,"id",{get:function(){return this.R},enumerable:!1,configurable:!0}),n.prototype.update=function(t,n,i){var r=this.toD(t,n,i);this.Su!=r&&(this.Mu.setAttribute("d",r),this.Su=r)},n.prototype.toD=function(i,r,e){var u,s;if(null==i)return"";var h=i.width,o=i.height,a=1e-4;if(h<a||o<a)return"";if(e.size<=0)return"M0,0 h1 v1 h-1z";var c=null!==(u=n.WORK_MATRIX)&&void 0!==u?u:n.WORK_MATRIX=new t.Matrix;null!=r?(c.copyFrom(r),c.invert()):c.identity(),c.translate(-i.x,-i.y),c.scale(1/h,1/o);for(var f=-1,l=2,v=-1,b=2,d="",g=c.a,m=c.b,w=c.c,O=c.d,p=c.tx,D=c.ty,E=null!==(s=n.WORK_RECTS)&&void 0!==s?s:n.WORK_RECTS=[],M=this.toRects(e,E),S=0;S<M;S+=4){var T=E[S+0],j=E[S+1],N=E[S+2],I=E[S+3],C=g*T+w*j+p,A=m*T+O*j+D,R=g*N+w*j+p,L=m*N+O*j+D,y=g*N+w*I+p,k=m*N+O*I+D,x=g*T+w*I+p,B=m*T+O*I+D;f=Math.min(f,C,R,y,x),l=Math.max(l,C,R,y,x),v=Math.min(v,A,L,k,B),b=Math.max(b,A,L,k,B);var _=C.toFixed(5),P=A.toFixed(5),U=R.toFixed(5),F=L.toFixed(5),G=y.toFixed(5),H=k.toFixed(5),z=x.toFixed(5),V=B.toFixed(5);d+=" M".concat(_,",").concat(P," L").concat(U,",").concat(F," L").concat(G,",").concat(H," L").concat(z,",").concat(V,"Z")}return"M".concat(f,",").concat(v," L").concat(l,",").concat(v," L").concat(l,",").concat(b," L").concat(f,",").concat(b,"Z")+d},n.prototype.toRects=function(t,n){for(var i=t.data,r=t.size<<2,e=0;e<r;e+=4){var u=i[e+0],s=i[e+1],h=i[e+2],o=i[e+3];u<h?(n[e+0]=u,n[e+2]=h):(n[e+0]=h,n[e+2]=u),s<o?(n[e+1]=s,n[e+3]=o):(n[e+1]=o,n[e+3]=s)}for(e=4;e<r;e+=4){u=n[e+0],s=n[e+1],h=n[e+2],o=n[e+3];for(var a=0;a<e;a+=4){var c=n[a+0],f=n[a+1],l=n[a+2],v=n[a+3],b=0,d=0;if(u<=c)if(h<=l){if(h<=c)continue;b=2,d=1}else d=3;else if(h<=l)b=3;else{if(l<=u)continue;b=1,d=2}var g,m,w=0,O=0;if(s<=f)if(o<=v){if(o<=f)continue;w=2,O=1}else O=3;else if(o<=v)w=3;else{if(v<=s)continue;w=1,O=2}if(4==(g=0===b||0===w?0:1===b||2===b?3===w?2:1:3===w?4:2)){e+4<r&&(n[e+0]=n[r+0],n[e+1]=n[r+1],n[e+2]=n[r+2],n[e+3]=n[r+3]),e-=4,r-=4;break}if(4!=(m=0===d||0===O?0:1===d||2===d?3===O?2:1:3===O?4:2))if(0===g)if(0===m){for(p=r-4;a<p;p-=4)n[p+4]=n[p+0],n[p+5]=n[p+1],n[p+6]=n[p+2],n[p+7]=n[p+3];0===d?(n[a+3]=s,n[a+4]=c,n[a+5]=o,n[a+6]=l,n[a+7]=v):(n[a+2]=u,n[a+4]=h,n[a+5]=f,n[a+6]=l,n[a+7]=v),e+=4,r+=4,a+=4}else 2===m&&(1===d?n[a+0]=h:2===d?n[a+2]=u:1===O?n[a+1]=o:2===O&&(n[a+3]=s));else if(1===g){for(p=r-4;a<p;p-=4)n[p+4]=n[p+0],n[p+5]=n[p+1],n[p+6]=n[p+2],n[p+7]=n[p+3];1===d?1===O?(n[a+0]=h,n[a+4]=c,n[a+5]=o,n[a+6]=h,n[a+7]=v):(n[a+0]=h,n[a+4]=c,n[a+5]=f,n[a+6]=h,n[a+7]=s):1===O?(n[a+2]=u,n[a+4]=u,n[a+5]=o,n[a+6]=l,n[a+7]=v):(n[a+2]=u,n[a+4]=u,n[a+5]=f,n[a+6]=l,n[a+7]=s),e+=4,r+=4,a+=4}else 2===g&&(1===b?(n[e+0]=l,u=l):2===b?(n[e+2]=c,h=c):1===w?(n[e+1]=v,s=v):2===w&&(n[e+3]=f,o=f));else{for(var p=a+4;p<r;p+=4)n[p-4]=n[p+0],n[p-3]=n[p+1],n[p-2]=n[p+2],n[p-1]=n[p+3];e-=4,r-=4,a-=4}}}return r},n}(),Ke=function(){function t(){this.Pt=[],this.j=0,this.Qe=0,this.vn=!0}return Object.defineProperty(t.prototype,"data",{get:function(){return this.Pt},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return this.j},enumerable:!1,configurable:!0}),t.prototype.isDirty=function(){return this.vn},t.prototype.toClean=function(){this.vn=!1},t.prototype.begin=function(){return this.Qe=0,this},t.prototype.end=function(){var t=this.Qe;this.j=t;var n=this.Pt,i=t<<2;return n.length!==i&&(n.length=i,this.vn=!0),this},t.prototype.add=function(t,n,i,r){var e=this.Qe<<2;this.Qe+=1;var u=this.Pt;return e<u.length?u[e+0]===t&&u[e+1]===n&&u[e+2]===i&&u[e+3]===r||(u[e+0]=t,u[e+1]=n,u[e+2]=i,u[e+3]=r,this.vn=!0):(u.push(t,n,i,r),this.vn=!0),this},t}(),Ye={CLICKED:0,DOUBLE_CLICKED:1,FOCUSED:2,ALWAYS:3},Je=function(){function n(t,n,i,r){var e=this;this.Jn=t,this.Tu=n;var u=this.toData(i,r);this.Pt=u,this.ju=!1,this.Nu=function(t){e.onElementFocus(t)},this.Iu=function(t){e.onBeforeFocus(t)},this.Cu=function(t){e.onAfterFocus(t)},this.Au=!1,this.Ru=!1,this.Lu=function(){e.doSelect()},this.yu=this.Pt.when===Ye.ALWAYS,this.ku=function(){e.updateElement(e.xu)}}return n.prototype.toData=function(t,n){var i,r;return{element:this.toElementData(t,null==n?void 0:n.element),clipper:this.toClipperData(t,null==n?void 0:n.clipper),before:this.toBeforeData(t,null==n?void 0:n.before),after:this.toAfterData(t,null==n?void 0:n.after),when:Di(null!==(i=null==n?void 0:n.when)&&void 0!==i?i:t.getWhen(),Ye),select:null!==(r=null==n?void 0:n.select)&&void 0!==r?r:t.getSelect()}},n.prototype.toElementData=function(t,n){var i,r;return{creator:null!==(i=null==n?void 0:n.creator)&&void 0!==i?i:t.getElementCreator(),styler:null!==(r=null==n?void 0:n.styler)&&void 0!==r?r:this.newElementStyler(t)}},n.prototype.newElementStyler=function(t){return function(n,i,r,e,u,s,h){return t.setElementStyle(n,i,r,e,u,s,h)}},n.prototype.toClipperData=function(t,n){var i,r,e;return{creator:null!==(i=null==n?void 0:n.creator)&&void 0!==i?i:t.getClipperCreator(),styler:null!==(r=null==n?void 0:n.styler)&&void 0!==r?r:this.newClipperStyler(t),extended:null!==(e=null==n?void 0:n.extended)&&void 0!==e?e:t.isClipperExEnabled()}},n.prototype.newClipperStyler=function(t){return function(n,i,r,e,u,s,h){return t.setClipperStyle(n,i,r,e,u,s,h)}},n.prototype.toBeforeData=function(t,n){var i,r;return{creator:null!==(i=null==n?void 0:n.creator)&&void 0!==i?i:t.getBeforeCreator(),styler:null!==(r=null==n?void 0:n.styler)&&void 0!==r?r:this.newBeforeStyler(t)}},n.prototype.newBeforeStyler=function(t){return function(n){t.setBeforeStyle(n)}},n.prototype.toAfterData=function(t,n){var i,r;return{creator:null!==(i=null==n?void 0:n.creator)&&void 0!==i?i:t.getAfterCreator(),styler:null!==(r=null==n?void 0:n.styler)&&void 0!==r?r:this.newAfterStyler(t)}},n.prototype.newAfterStyler=function(t){return function(n){t.setAfterStyle(n)}},Object.defineProperty(n.prototype,"element",{get:function(){var t;return null!==(t=this.Bu)&&void 0!==t?t:null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"when",{get:function(){return this.Pt.when},enumerable:!1,configurable:!0}),n.prototype.onDowning=function(t){switch(this.Ru=this.Au,this.when){case Ye.CLICKED:this.start();break;case Ye.FOCUSED:this.Jn.state.isFocused&&this.start()}},n.prototype.onDown=function(t){!this.Ru&&this.Au&&("data"in t?t.data.originalEvent.preventDefault():t.preventDefault())},n.prototype.onDblClick=function(t,n){switch(this.when){case Ye.DOUBLE_CLICKED:this.start()}},n.prototype.onFocus=function(){var t;switch(this.when){case Ye.FOCUSED:this.start();break;default:null===(t=this.Bu)||void 0===t||t.focus()}},n.prototype.onBlur=function(){var t;switch(this.when){case Ye.CLICKED:case Ye.DOUBLE_CLICKED:case Ye.FOCUSED:this.onEndByBlur(),this.cancel();break;default:null===(t=this.Bu)||void 0===t||t.blur()}},n.prototype.isStartable=function(){switch(this.when){case Ye.CLICKED:case Ye.DOUBLE_CLICKED:case Ye.FOCUSED:return this.Jn.state.isActionable;default:return!0}},n.prototype.start=function(){!this.Au&&this.isStartable()&&(this.Au=!0,this.Jn.worldVisible?this.doStart():this.yu=!0,rt.update(this.Jn))},n.prototype.isShown=function(){return this.ju},n.prototype.onRender=function(t){(this.yu||!this.ju&&this.when===Ye.ALWAYS)&&(this.yu=!1,this.doStart(t)),this.Au&&(this.Au=!1)},n.prototype.getElementRect=function(n){var i=this.an||new t.Point(0,0);this.an=i;var r=this._u||new t.Rectangle;return this._u=r,this.Tu.getElementRect(n,i,r)},n.prototype.getElementMatrix=function(){return this.Tu.getElementMatrix()},n.prototype.getClipperRect=function(n){var i=this.an||new t.Point(0,0);this.an=i;var r=this.Pu||new t.Rectangle;return this.Pu=r,this.Tu.getClipperRect(n,i,r)},n.prototype.fillClipperExRects=function(t,n){var i=this.Tu;return i.getClipperExRects&&i.getClipperExRects(n),n.isDirty()},n.prototype.doStart=function(t){var n,i;if(!this.ju){this.ju=!0;var r=this.xu;null!=r&&(this.xu=void 0,r.off("postrender",this.ku));var e=this.Jn;null==t&&(t=null===(n=rt.getLayer(e))||void 0===n?void 0:n.renderer),t&&(this.xu=t,t.on("postrender",this.ku)),this.onStart();var u=this.getClipper();if(u){var s=this.getBefore(u),h=this.getElement(u),o=this.getAfter(u),a=this.getClipperEx(u);if(h){var c=null!==(i=null==t?void 0:t.resolution)&&void 0!==i?i:rt.getResolution(e),f=this.getElementRect(c),l=this.getElementMatrix(),v=this.toClipperRectAdjusted(f,l,this.getClipperRect(c)),b=e.state,d=this.Tu.getPadding(),g=this.Pt;if(g.clipper.styler(u,b,d,f,l,v,a),g.element.styler(h,b,d,f,l,v,a),s&&g.before.styler(s),o&&g.after.styler(o),this.onElementAttached(h,s,o),a){var m=this.getClipperExRects();m&&this.fillClipperExRects(c,m)&&(a.update(f,l,m),m.toClean())}u.style.display="",b.isFocused&&this.toElementFocused(h),u.scrollTop=0,u.scrollLeft=0,this.Pt.select&&setTimeout(this.Lu,0)}}}},n.prototype.toElementFocused=function(t){t.focus({preventScroll:!0})},n.prototype.onStart=function(){this.Tu.onStart()},n.prototype.doSelect=function(){var t=this.Bu;t&&(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement)&&t.select()},n.prototype.cancel=function(){var t;if(this.ju){this.ju=!1;var n=this.xu;null!=n&&(this.xu=void 0,n.off("postrender",this.ku)),this.onCancel();var i=this.Jn,r=rt.getLayer(i);if(r){var e=r.view;switch(this.when){case Ye.CLICKED:case Ye.DOUBLE_CLICKED:case Ye.FOCUSED:document.activeElement===this.Bu&&e.focus()}var u=i.state,s=r.renderer.plugins.interaction;this.Tu.containsPoint(s.mouse.global)&&!u.isHovered&&(u.isHovered=!0,e.style.cursor=null!==(t=i.cursor)&&void 0!==t?t:""),r.update()}var h=this.Bu;null!=h&&this.onElementDetached(h,this.Uu,this.Fu);var o=this.Gu;null!=o&&(o.style.display="none")}},n.prototype.onCancel=function(){this.Tu.onCancel()},n.prototype.onElementAttached=function(t,n,i){null==n||n.addEventListener("focus",this.Iu),null==i||i.addEventListener("focus",this.Cu),t.addEventListener("focus",this.Nu,!0)},n.prototype.onElementDetached=function(t,n,i){null==n||n.removeEventListener("focus",this.Iu),null==i||i.removeEventListener("focus",this.Cu),t.removeEventListener("focus",this.Nu,!0)},n.prototype.getClipper=function(){var t=this.Gu;if(null==t){var n=rt.getLayer(this.Jn);t=n?this.Pt.clipper.creator(n.getElementContainer()):null,this.Gu=t}return t},n.prototype.getClipperEx=function(t){var n=this.Hu;return void 0===n&&(n=null!=this.getClipperExRects()?new Xe(t):null,this.Hu=n),n},n.prototype.getClipperExRects=function(){var t=this.zu;return void 0===t&&(t=this.Pt.clipper.extended?new Ke:null,this.zu=t),t},n.prototype.getElement=function(t){var n=this.Bu;return null==n&&(n=this.Pt.element.creator(t),this.Bu=n),n},n.prototype.getBefore=function(t){var n=this.Uu;return null==n&&(n=this.Pt.before.creator(t),this.Uu=n),n},n.prototype.getAfter=function(t){var n=this.Fu;return null==n&&(n=this.Pt.after.creator(t),this.Fu=n),n},n.prototype.onBeforeFocus=function(t){var n=this.Jn,i=rt.getLayer(n);if(i){var r=i.getFocusController(),e=r.find(n,!1,!1,!1);i.view.focus(),r.focus(e),t.preventDefault(),t.stopImmediatePropagation()}},n.prototype.onAfterFocus=function(t){var n=this.Jn,i=rt.getLayer(n);if(i){var r=i.getFocusController(),e=r.find(n,!1,!1,!0);i.view.focus(),r.focus(e),t.preventDefault(),t.stopImmediatePropagation()}},n.prototype.onElementFocus=function(t){if(this.when===Ye.ALWAYS){var n=this.Jn;n.state.isFocused||n.focus()}},n.prototype.onEndByBlur=function(){this.onEnd()},n.prototype.onEnd=function(){this.Tu.onEnd()},n.prototype.end=function(){this.onEnd(),this.cancel()},n.prototype.select=function(){return this.ju&&this.Pt.select&&this.doSelect(),this},n.prototype.toClipperRectAdjusted=function(t,n,i){if(i&&t&&null==n){var r=t.x,e=t.y,u=r+t.width,s=e+t.height,h=i.x,o=i.y,a=h+i.width,c=o+i.height,f=Math.min(Math.max(h,r),a),l=Math.min(Math.max(h,u),a),v=Math.min(Math.max(o,e),c),b=Math.min(Math.max(o,s),c);i.x=f,i.y=v,i.width=l-f,i.height=b-v}return i},n.prototype.updateElement=function(t){if(this.ju){var n=this.Jn;if(n.worldVisible){var i=this.Bu,r=this.Gu,e=this.Hu;if(i&&r){var u=t.resolution,s=this.getElementRect(u),h=this.getElementMatrix(),o=this.toClipperRectAdjusted(s,h,this.getClipperRect(u)),a=n.state,c=this.Tu.getPadding(),f=this.Pt;if(f.clipper.styler(r,a,c,s,h,o,e),f.element.styler(i,a,c,s,h,o,e),e){var l=this.getClipperExRects();l&&this.fillClipperExRects(u,l)&&(e.update(s,h,l),l.toClean())}}}else switch(this.when){case Ye.ALWAYS:(r=this.Gu)&&(r.style.display="none");break;default:this.cancel()}}},n.getClipperRect=function(t,n,i,r,e){for(var u=!0,s=0,h=0,o=0,a=0,c=t;c instanceof Qi;){c.getClippingRect(n,e),r.set(e.x,e.y),c.toGlobal(r,r,!1);var f=(r.x*i|0)/i,l=(r.y*i|0)/i;r.set(e.x+e.width,e.y+e.height),c.toGlobal(r,r,!0);var v=r.x,b=r.y,d=Math.min(f,v),g=Math.min(l,b),m=Math.max(f,v),w=Math.max(l,b);u?(u=!1,s=d,h=g,o=m,a=w):(s=Math.min(Math.max(s,d),m),h=Math.min(Math.max(h,g),w),o=Math.min(Math.max(o,d),m),a=Math.min(Math.max(a,g),w)),c=c.parent}return u?null:(e.x=s,e.y=h,e.width=o-s,e.height=a-h,e)},n}(),Ze=function(){function t(t){var n=t.transform,i=n.position;this.x=i.x,this.y=i.y;var r=t.size;this.sizeX=r.x,this.sizeY=r.y,this.rotation=n.rotation,this.actions=[],this.fill=t.fill.toObject(),this.stroke=t.stroke.toObject(),this.text=t.text.toObject(),this.cursor=t.cursor,this.reset=$t.NONE,this.written=$t.NONE,this.effect=NaN,this.isStateChanged=!1,this.interactive=!1}return t.prototype.initialize=function(t){t.disallowUploadedUpdate();for(var n=this.actions,i=0,r=n.length;i<r;++i)n[i].initialize(t,this);t.allowUploadedUpdate()},t.prototype.isActionable=function(){return 0<this.actions.length},t.prototype.onResize=function(t){for(var n=this.actions,i=0,r=n.length;i<r;++i)n[i].onResize(t,this)},t.prototype.onClick=function(t,n){var i=t.state;i.isActionable&&(i.isClicked=!0);for(var r=this.actions,e=0,u=r.length;e<u;++e)r[e].onClick(t,this,n)},t.prototype.onDblClick=function(t,n,i){var r=t.state;r.isActionable&&(r.isDblClicked=!0);for(var e=this.actions,u=0,s=e.length;u<s;++u)e[u].onDblClick(t,this,n,i);return!1},t.prototype.onOver=function(t,n){var i=t.state;if(!i.isHovered){i.isHovered=!0;for(var r=this.actions,e=0,u=r.length;e<u;++e)r[e].onOver(t,this,n)}},t.prototype.onOut=function(t,n){if(t.state.isHovered){t.state.isHovered=!1;for(var i=this.actions,r=0,e=i.length;r<e;++r)i[r].onOut(t,this,n)}},t.prototype.onDown=function(t,n){for(var i=this.actions,r=0,e=i.length;r<e;++r)i[r].onDowning(t,this,n);var u=t.state;if(!u.isDown)if(u.isPressed)for(u.addAll(lt.DOWN,ht.PRESSED),(h=rt.getLayer(t))&&(o=h.getFocusController()).focus(o.findParent(t)),r=0,e=i.length;r<e;++r){var s=i[r];s.onDown(t,this,n),s.onPressed(t,this,n)}else{var h,o;for(u.isDown=!1,(h=rt.getLayer(t))&&(o=h.getFocusController()).focus(o.findParent(t)),r=0,e=i.length;r<e;++r)i[r].onDown(t,this,n)}},t.prototype.onUp=function(t,n){var i=t.state;if(!i.isUp)if(i.isPressed){i.set(lt.UP,ht.PRESSED);for(var r=0,e=(s=this.actions).length;r<e;++r){var u=s[r];u.onUp(t,this,n),u.onUnpressed(t,this,n)}}else{var s;for(i.isUp=!0,r=0,e=(s=this.actions).length;r<e;++r)s[r].onUp(t,this,n)}},t.prototype.onUpOutside=function(t,n){var i=t.state;if(i.isPressed){i.set(lt.UP_OUTSIDE,ht.PRESSED);for(var r=0,e=(s=this.actions).length;r<e;++r){var u=s[r];u.onUpOutside(t,this,n),u.onUnpressed(t,this,n)}}else{var s;for(i.isUpOutside=!0,r=0,e=(s=this.actions).length;r<e;++r)s[r].onUpOutside(t,this,n)}},t.prototype.onMove=function(t,n){for(var i=this.actions,r=0,e=i.length;r<e;++r)i[r].onMove(t,this,n)},t.prototype.onKeyDown=function(t,n){Xi.isActivateKey(n)&&this.onDown(t,n);for(var i=this.actions,r=0,e=i.length;r<e;++r)i[r].onKeyDown(t,this,n);return!1},t.prototype.onKeyUp=function(t,n){if(Xi.isActivateKey(n)){var i=t.state;if(i.isPressed){var r=i.isUp;this.onUp(t,n),!r&&i.isUp&&this.onClick(t,n)}}for(var e=this.actions,u=0,s=e.length;u<s;++u)e[u].onKeyUp(t,this,n);return!1},t.prototype.onStateChange=function(t,n,i){this.isStateChanged=!0,rt.update(t),n.isFocused?i.isFocused||this.onFocus(t):i.isFocused&&this.onBlur(t)},t.prototype.onFocus=function(t){for(var n=this.actions,i=0,r=n.length;i<r;++i)n[i].onFocus(t,this)},t.prototype.onBlur=function(t){for(var n=this.actions,i=0,r=n.length;i<r;++i)n[i].onBlur(t,this)},t.prototype.onRightClick=function(t,n){var i=t.state;i.isActionable&&(i.isRightClicked=!0);for(var r=this.actions,e=0,u=r.length;e<u;++e)r[e].onRightClick(t,this,n)},t.prototype.onRightDown=function(t,n){for(var i=this.actions,r=0,e=i.length;r<e;++r)i[r].onRightDowning(t,this,n);var u=t.state;if(!u.isRightDown)if(u.isRightPressed)for(u.addAll(lt.RIGHT_DOWN,lt.RIGHT_PRESSED),(h=rt.getLayer(t))&&(o=h.getFocusController()).focus(o.findParent(t)),r=0,e=i.length;r<e;++r){var s=i[r];s.onRightDown(t,this,n),s.onRightPressed(t,this,n)}else{var h,o;for(u.isRightDown=!1,(h=rt.getLayer(t))&&(o=h.getFocusController()).focus(o.findParent(t)),r=0,e=i.length;r<e;++r)i[r].onRightDown(t,this,n)}},t.prototype.onRightUp=function(t,n){var i=t.state;if(!i.isRightUp)if(i.isRightPressed){i.set(lt.RIGHT_UP,lt.RIGHT_PRESSED);for(var r=0,e=(s=this.actions).length;r<e;++r){var u=s[r];u.onRightUp(t,this,n),u.onRightUnpressed(t,this,n)}}else{var s;for(i.isRightUp=!0,r=0,e=(s=this.actions).length;r<e;++r)s[r].onRightUp(t,this,n)}},t.prototype.onRightUpOutside=function(t,n){var i=t.state;if(i.isRightPressed){i.set(lt.RIGHT_UP_OUTSIDE,lt.RIGHT_PRESSED);for(var r=0,e=(s=this.actions).length;r<e;++r){var u=s[r];u.onRightUpOutside(t,this,n),u.onRightUnpressed(t,this,n)}}else{var s;for(i.isRightUpOutside=!0,r=0,e=(s=this.actions).length;r<e;++r)s[r].onRightUpOutside(t,this,n)}},t.prototype.update=function(n,i){var r=n.data,e=this.effect<=i;if(r.isChanged||this.isStateChanged||e){this.isStateChanged=!1,r.isChanged=!1,e&&(this.effect=NaN),n.disallowUploadedUpdate(),this.onUpdate(n,i),n.allowUploadedUpdate();var u=this.isStateChanged;n.state.removeAll(t.TRANSIENT_STATES),this.isStateChanged=u}},t.prototype.onRender=function(t,n,i){for(var r=this.actions,e=0,u=r.length;e<u;++e)r[e].onRender(t,this,n,i);this.update(t,n)},t.prototype.onUpdate=function(t,n){var i=this.actions;if(0<i.length){this.written=$t.NONE;for(var r=0,e=i.length;r<e;++r)i[r].execute(t,this,n);this.doReset(t)}},t.prototype.doReset=function(t){var n=~this.written&this.reset;if(n!==$t.NONE){if(n&$t.POSITION_X&&(t.transform.position.x=this.x),n&$t.POSITION_Y&&(t.transform.position.y=this.y),n&$t.VISIBILITY&&(t.visible=!0),n&$t.COLOR_FILL){var i=this.fill;t.fill.set(void 0,i.color,i.alpha)}if(n&$t.COLOR_STROKE){var r=this.stroke;t.stroke.set(void 0,r.color,r.alpha)}if(n&$t.COLOR_TEXT){var e=this.text;t.text.set(void 0,e.color,e.alpha)}if(n&$t.COLOR_TEXT_OUTLINE){var u=this.text.outline;t.text.outline.set(void 0,u.color,u.alpha)}n&$t.HEIGHT&&(t.size.y=this.sizeY),n&$t.WIDTH&&(t.size.x=this.sizeX),n&$t.ROTATION&&(t.transform.rotation=this.rotation),n&$t.TEXT&&(t.text.value=this.text.value),n&$t.CURSOR&&(t.cursor=this.cursor)}},t.TRANSIENT_STATES=[lt.CLICKED,lt.DBL_CLICKED,lt.DOWN,lt.UP,lt.UP_OUTSIDE,lt.RIGHT_CLICKED,lt.RIGHT_DOWN,lt.RIGHT_UP,lt.RIGHT_UP_OUTSIDE,lt.ACTIVATED,lt.DEACTIVATED],t}(),qe=function(t){function n(n){return void 0===n&&(n=r.RECTANGLE),t.call(this,n)||this}return B(n,t),n.prototype.clone=function(){return new n(this.type).copy(this)},n.prototype.containsAbs=function(n,i,r,e,u,s,h){return!!t.prototype.containsAbsBBox.call(this,n,i,r,e)&&Ht(this,n,i,r,e,u,s)},n}(Ut),Qe=function(t){function n(n){return void 0===n&&(n=r.RECTANGLE_PIVOTED),t.call(this,n)||this}return B(n,t),n.prototype.toHitTestData=function(n,i){var r=t.prototype.toHitTestData.call(this,n,i);return r.x-=r.width,r.y-=r.height,r},n}(qe),$e=function(t){function n(n){var i=t.call(this)||this;i.name=n,i.interactive=!1,i.reference=0;var r=i.newShape();return r.parent=i,i._r=r,i.interactives=[],i}return B(n,t),Object.defineProperty(n.prototype,"width",{get:function(){return this._r.size.x},set:function(t){this._r.size.x=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"height",{get:function(){return this._r.size.y},set:function(t){this._r.size.y=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"background",{get:function(){return this._r.fill},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"state",{get:function(){return this._r.state},enumerable:!1,configurable:!0}),n.prototype.newShape=function(){var t=new Qe;return t.fill.set(!1,16777215,1),t.stroke.set(!1),t.state.add(Be.INTERACTIVE),t},n.prototype.initialize=function(t){var n=this.interactives,i=this._r,r=i.state.is(Be.INTERACTIVE),e=i.state.is(Be.DRAGGABLE),u=i.state.is(Be.PINCHABLE);if(e||u){var s=new Ze(i);i.runtime=s;var h=(e?Ie.DRAG:Ie.NONE)|(u?Ie.PINCH:Ie.NONE);s.actions.push(new xe("",ye.LAYER,h).toRuntime()),t.push(i),s.initialize(i)}(r||e||u)&&(i.interactive=!0,n.push(i)),this.doInitialize(this.children,n)},n.prototype.doInitialize=function(t,n){for(var i=0,r=t.length;i<r;++i){var e=t[i],u=e.runtime;if(u)if(e.interactive||u.interactive)n.push(e);else{var s=e.cursor;null!=s&&0<s.length&&n.push(e)}var h=e.children;0<h.length&&this.doInitialize(h,n)}},n.prototype.update=function(t){this.doUpdate(this.children,t)},n.prototype.doUpdate=function(t,n){for(var i=0,r=t.length;i<r;++i){var e=t[i];e.update(n);var u=e.children;0<u.length&&this.doUpdate(u,n)}},n.prototype.hitTestInteractives=function(t){for(var n=this.bu,i=this.interactives,r=i.length-1;0<=r;--r){var e=i[r];if(e.visible&&(e.toLocal(t,void 0,n),null!=e.contains(n.x,n.y)))return e}return null},n.prototype.addUuid=function(t){for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].addUuid(t)},n.prototype.updateUuid=function(t){for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].updateUuid(t)},n.prototype.destroy=function(){if(!this._destroyed){for(var n=this.children,i=n.length-1;0<=i;--i)n[i].destroy();n.length=0,t.prototype.destroy.call(this)}},n.prototype.serialize=function(t,n,i){for(var r=this.children,e=0,u=r.length;e<u;++e){var s=r[e].serialize(n);s[16]=t,i.push(s)}var h=this._r,o=n.addResource(this.name||""),a=(this.visible?1:0)|(h.state.is(Be.INVISIBLE)?0:2),c=this.position,f=h.size,l=h.fill.serialize(n),v=h.state.is(Be.INTERACTIVE)?1:0,b=h.state.is(Be.DRAGGABLE)?2:0,d=h.state.is(Be.PINCHABLE)?4:0;return[o,a,c.x,c.y,f.x,f.y,l,v|b|d]},n.deserialize=function(t,i,r,e){var u,s,h,o=new n(this.deserializeName(t[0],i)),a=o._r,c=t[1];if(null!=c){var f=i.mode!==gr.VIEWER;!f||1&c||(o.visible=!1),2&c||(a.state.add(Be.INVISIBLE),f||(o.visible=!1))}var l=t[2],v=t[3];o.position.set(l,v);var b=null!==(u=t[4])&&void 0!==u?u:r,d=null!==(s=t[5])&&void 0!==s?s:e;a.size.set(b,d);var g=t[6];null!=g&&a.fill.deserialize(g,i);var m=null!==(h=t[7])&&void 0!==h?h:1;return a.state.set(Be.INTERACTIVE,!!(1&m)),a.state.set(Be.DRAGGABLE,!!(2&m)),a.state.set(Be.PINCHABLE,!!(4&m)),o},n.deserializeName=function(t,n){if(at(t))return t;var i=n.resources;return 0<=t&&t<=i.length?i[t]:""},n}(Te),tu=!1,nu=function(){return tu},iu=function(n){function i(t){var i=n.call(this)||this;return i.condition=rn.ofString(t.condition),i.utils=new Map,i}return B(i,n),i.prototype.getUtil=function(t,n){var i=this.utils,r=i.get(t);return null==r&&(r=this.newUtil(t,n),i.set(t,r)),r},i.prototype.newUtil=function(t,n){return new Je(t,this.newOperation(t,n),K.getInstance().get("DHtmlElement"),this.newUtilOptions(t,n))},i.prototype.newOperation=function(t,n){var i=this;return{getElementRect:function(r,e,u){return i.getElementRect(t,n,r,e,u)},getElementMatrix:function(){return i.getElementMatrix(t,n)},getClipperRect:function(r,e,u){return i.getClipperToRect(t,n,r,e,u)},getClipperExRects:function(n){i.getClipperExRects(t,n)},getPadding:function(){return i.getPadding(t,n)},containsPoint:function(r){return i.containsPoint(t,n,r)},onStart:function(){},onCancel:function(){},onEnd:function(){}}},i.prototype.newUtilOptions=function(t,n){return{element:{creator:this.newElementCreator(t,n)},when:this.toWhen(t,n),clipper:{extended:nu()}}},i.prototype.toWhen=function(t,n){var i=this.condition(t,Date.now(),nn);if(null!=i&&i in Ye)return Ye[i]},i.prototype.containsPoint=function(n,r,e){var u;if(n.visible){var s=null!==(u=i.WORK)&&void 0!==u?u:i.WORK=new t.Point;return n.toLocal(e,void 0,s),null!=n.contains(s.x,s.y)}return!1},i.prototype.getPadding=function(t,n){return null},i.prototype.getElementRect=function(t,n,i,r,e){var u=t.transform.pivot,s=t.size,h=s.x,o=s.y;return e.x=-.5*h+u.x,e.y=-.5*o+u.y,e.width=h,e.height=o,e},i.prototype.getElementMatrix=function(t,n){return t.updateTransform(),t.transform.worldTransform},i.prototype.getClipperToRect=function(t,n,i,r,e){var u=Ge.toContainer(t);return Je.getClipperRect(u,t,i,r,e)},i.prototype.getClipperExRects=function(t,n){n.begin();var i=t.root.parent;if(i instanceof $e){var r=i.parent;if(null!=r){var e=r.children,u=e.indexOf(i);if(0<=u)for(var s=u+1,h=e.length;s<h;++s){var o=e[s];if(o.visible){var a=o.width,c=o.height,f=o.transform.worldTransform,l=f.a,v=f.b,b=f.c,d=f.d,g=f.tx,m=f.ty;n.add(g,m,l*a+b*c+g,v*a+d*c+m)}}}}n.end()},i.prototype.onRender=function(t,n,i,r){this.getUtil(t,n).onRender(r)},i.prototype.onFocus=function(t,n){this.getUtil(t,n).onFocus()},i.prototype.onBlur=function(t,n){this.getUtil(t,n).onBlur()},i.prototype.onDowning=function(t,n,i){this.getUtil(t,n).onDowning(i)},i.prototype.onDown=function(t,n,i){this.getUtil(t,n).onDown(i)},i.prototype.onDblClick=function(t,n,i,r){this.getUtil(t,n).onDblClick(i,r)},i}(en),ru=function(t){function n(n){var i=t.call(this,n)||this;return i.elementCreator=rn.ofElementOrNull(n.value),i.noPointerEvent=n.subtype===ke.HTML_ELEMENT_WITHOUT_POINTER_EVENTS,i}return B(n,t),n.prototype.newUtil=function(n,i){return this.noPointerEvent&&n.state.add(We.NO_POINTER_EVENTS),t.prototype.newUtil.call(this,n,i)},n.prototype.newElementCreator=function(t,n){var i=this.elementCreator;if(i)return function(n){return i(t,Date.now(),nn,n)}},n}(iu),eu=function(t){function n(n,i,r,e){var u,s,h,o,a,c,f=this;(f=t.call(this,n,i,r,e)||this).Tu=i,f.Vu=function(t){f.onInputKeyDown(t)},f.Wu=function(){f.onInputChange()},f.Xu=function(t){f.onInputInput(t)},f.Ku=null!==(u=null==e?void 0:e.description)&&void 0!==u?u:"";var l=null==e?void 0:e.editing;return f.Yu=null!==(o=null!==(s=null==l?void 0:l.formatter)&&void 0!==s?s:null===(h=null==e?void 0:e.text)||void 0===h?void 0:h.formatter)&&void 0!==o?o:r.getEditingFormatter(),f.Ju=null!==(a=null==l?void 0:l.unformatter)&&void 0!==a?a:r.getEditingUnformatter(),f.Zu=null!==(c=null==l?void 0:l.validator)&&void 0!==c?c:r.getEditingValidator(),f}return B(n,t),n.prototype.onEnd=function(){t.prototype.onEnd.call(this),this.onInputChange()},n.prototype.onElementAttached=function(n,i,r){n.value=this.fromValue(this.Tu.getValue()),n.addEventListener("change",this.Wu),n.addEventListener("input",this.Xu),t.prototype.onElementAttached.call(this,n,i,r)},n.prototype.onElementDetached=function(n,i,r){t.prototype.onElementDetached.call(this,n,i,r),n.removeEventListener("change",this.Wu),n.removeEventListener("input",this.Xu)},n.prototype.onInputKeyDown=function(t){Xi.isOkKey(t)?(this.end(),this.Tu.onEnter()):Xi.isCancelKey(t)&&this.cancel()},n.prototype.toElementFocused=function(n){t.prototype.toElementFocused.call(this,n),n.scrollTop=0,n.scrollLeft=0},n.prototype.onInputChange=function(){if(this.isShown()){var t=this.element;if(null!=t){var n=this.Tu,i=this.toValue(t.value),r=n.getValue();r!==i&&n.onValueChange(i,r)}}},n.prototype.toValue=function(t){return this.Ju(t,this)},n.prototype.fromValue=function(t){return void 0!==t?this.Yu(t,this):""},n.prototype.onInputInput=function(t){var n=t.target;(n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement)&&this.Tu.onValueInput(this.toValue(n.value))},n.prototype.validate=function(){var t=this.Tu.getValue();if(void 0!==t){var n=this.Zu(t,this);if(this.qu!==n){this.qu=n;var i=this.Jn.state;i.isInvalid=null!=n,i.isHovered&&this.Tu.applyTitle()}return n}return null},n.prototype.applyTitle=function(){var t=this.qu;if(at(t)){var n=rt.getLayer(this.Jn);return n&&(n.view.title=t),!0}return!1},n}(Je),uu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.onElementAttached=function(n,i,r){n.addEventListener("keydown",this.Vu),t.prototype.onElementAttached.call(this,n,i,r)},n.prototype.onElementDetached=function(n,i,r){n.removeEventListener("keydown",this.Vu),t.prototype.onElementDetached.call(this,n,i,r)},n}(eu),su=function(t){function n(n,i,r,e){var u,s,h,o=this;return(o=t.call(this,n,i,r,e)||this).Qu=null!==(u=null==e?void 0:e.step)&&void 0!==u?u:r.getStep(),o.$u=null!==(s=null==e?void 0:e.min)&&void 0!==s?s:r.getMin(),o.ts=null!==(h=null==e?void 0:e.max)&&void 0!==h?h:r.getMax(),o}return B(n,t),Object.defineProperty(n.prototype,"step",{get:function(){return this.Qu},set:function(t){this.Qu!==t&&(this.Qu=t,this.onStepChange())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"min",{get:function(){return this.$u},set:function(t){this.$u!==t&&(this.$u=t,this.onMinChange())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"max",{get:function(){return this.ts},set:function(t){this.ts!==t&&(this.ts=t,this.onMaxChange())},enumerable:!1,configurable:!0}),n.prototype.toValue=function(n){var i=t.prototype.toValue.call(this,n);if(i==i){var r=this.$u;if(null!=r&&i<r)return r;var e=this.ts;return null!=e&&e<i?e:i}return 0},n.prototype.fromValue=function(t){return void 0!==t?this.Yu(t,this):"0"},n.prototype.onStepChange=function(){if(this.isShown()){var t=this.element;t&&this.updateStep(t)}},n.prototype.onMinChange=function(){if(this.isShown()){var t=this.element;t&&this.updateMin(t)}},n.prototype.onMaxChange=function(){if(this.isShown()){var t=this.element;t&&this.updateMax(t)}},n.prototype.updateStep=function(t){var n=this.step;t.step=null!=n?"".concat(n):"any"},n.prototype.updateMin=function(t){var n=this.min;null!=n?t.min="".concat(n):t.removeAttribute("min")},n.prototype.updateMax=function(t){var n=this.max;null!=n?t.max="".concat(n):t.removeAttribute("max")},n.prototype.onElementAttached=function(n,i,r){n.type="number",t.prototype.onElementAttached.call(this,n,i,r),this.updateStep(n),this.updateMin(n),this.updateMax(n)},n}(uu),hu={EMIT_EVENT:0,WRITE_BOTH:1,WRITE_LOCAL:2,WRITE_REMOTE:3},ou=function(){function t(){}return t.execute=function(t,n,i,r,e){switch(n){case hu.EMIT_EVENT:t.emit(i,t,r),Ge.emit(t,i,r,e);break;case hu.WRITE_LOCAL:Ge.writeLocal(t,i,r,e);break;case hu.WRITE_REMOTE:Ge.writeRemote(t,i,r);break;case hu.WRITE_BOTH:Ge.writeLocal(t,i,r,e),Ge.writeRemote(t,i,r)}},t}(),au=function(t){function n(n){var i=t.call(this,n)||this;return i.target=rn.ofStringOrNull(n.target),i.onInputAction=n.onInputAction,i}return B(n,t),n.prototype.newOperation=function(t,n){var i=this;return{getElementRect:function(r,e,u){return i.getElementRect(t,n,r,e,u)},getElementMatrix:function(){return i.getElementMatrix(t,n)},getClipperRect:function(r,e,u){return i.getClipperToRect(t,n,r,e,u)},getClipperExRects:function(n){i.getClipperExRects(t,n)},getPadding:function(){return i.getPadding(t,n)},containsPoint:function(r){return i.containsPoint(t,n,r)},onStart:function(){t.text.enable=!1},onCancel:function(){t.text.enable=!0},onEnd:function(){},getValue:function(){return i.getUtil(t,n).toValue(t.text.value)},onValueInput:function(t){},onValueChange:function(r,e){i.onValueChange(t,n,r,e)},onEnter:function(){},applyTitle:function(){}}},n.prototype.newElementCreator=function(t,n){},n.prototype.getPadding=function(t,n){return t.text.padding},n.prototype.onValueChange=function(t,n,i,r){t.text.value=this.getUtil(t,n).fromValue(i);var e=Date.now(),u=this.target(t,e,nn);null!=u&&ou.execute(t,this.onInputAction,u,i,e)},n}(iu),cu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n}(au),fu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n}(cu),lu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.newUtil=function(t,n){return new su(t,this.newOperation(t,n),K.getInstance().get("DInputInteger"),this.newUtilOptions(t,n))},n}(fu),vu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.newUtil=function(t,n){return new su(t,this.newOperation(t,n),K.getInstance().get("DInputReal"),this.newUtilOptions(t,n))},n}(fu),bu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.onElementAttached=function(n,i,r){n.type="text",t.prototype.onElementAttached.call(this,n,i,r)},n}(uu),du=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.newUtil=function(t,n){return new bu(t,this.newOperation(t,n),K.getInstance().get("DInputText"),this.newUtilOptions(t,n))},n}(cu),gu=function(t){function n(n){var i=t.call(this,n,$t.NONE)||this;return i.target=rn.ofStringOrNull(n.target),i.value=rn.ofUnknown(n.value),i}return B(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,nn)){var r=this.target(t,i,nn);null!=r&&this.write(t,r,this.value(t,i,nn),i)}},n}(un),mu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.write=function(t,n,i,r){Ge.writeLocal(t,n,i,r),Ge.writeRemote(t,n,i)},n}(gu),wu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.write=function(t,n,i,r){Ge.writeLocal(t,n,i,r)},n}(gu),Ou=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.write=function(t,n,i,r){Ge.writeRemote(t,n,i)},n}(gu),pu=function(t){function n(n,i,r,e,u){var s=t.call(this,gn.MISC,i,n)||this;return s.target=r,s.onInputAction=e,s.value=u,s}return B(n,t),n.prototype.toRuntime=function(){switch(this.subtype){case ke.INPUT_TEXT:return new du(this);case ke.INPUT_INTEGER:return new lu(this);case ke.INPUT_REAL:return new vu(this);case ke.EMIT_EVENT:return new Ve(this);case ke.WRITE_BOTH:return new mu(this);case ke.WRITE_LOCAL:return new wu(this);case ke.WRITE_REMOTE:return new Ou(this);case ke.HTML_ELEMENT:case ke.HTML_ELEMENT_WITHOUT_POINTER_EVENTS:return new ru(this)}},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.target),r=t.addResource(this.value);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(i,",").concat(this.onInputAction,",").concat(r,"]"))},n.deserialize=function(t,i){var r=i.resources,e=wn.toResource(1,t,r),u=wn.toResource(3,t,r),s=wn.toResource(5,t,r);return new n(t[2],e,u,t[4],s)},n}(dn),Du=function(t){function n(n){var i=t.call(this,n,$t.NONE)||this;return i.target=rn.ofUnknown(n.target),i}return B(n,t),n.prototype.execute=function(t,n,i){this.condition(t,i,nn)&&this.target(t,i,nn)},n}(un),Eu=function(t){function n(n,i){var r=t.call(this,gn.MISC,n,ke.EXECUTE)||this;return r.target=i,r}return B(n,t),n.prototype.toRuntime=function(){return new Du(this)},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.target);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(i,"]"))},n.deserialize=function(t,i){var r=i.resources;return new n(wn.toResource(1,t,r),wn.toResource(3,t,r))},n}(dn),Mu=function(t){function n(n,i){var r=t.call(this,n,$t.NONE)||this;return r.subtype=i,r.target=rn.ofStringOrNull(n.target),r.inNewWindow=n.inNewWindow,r}return B(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,nn)){var r=this.target(t,i,nn);null!=r&&Ge.open(t,this.subtype,r,this.inNewWindow)}},n}(un),Su={DIAGRAM_LEGACY:0,PAGE_LEGACY:1,PAGE_INPLACE_LEGACY:2,DIALOG_TEXT:3,DIALOG_INTEGER:4,DIALOG_REAL:5,DIALOG_BOOLEAN:6,DIALOG_DATE:7,DIALOG_TIME:8,DIALOG_DATETIME:9,DIAGRAM:10,PAGE:11,DIALOG:12,EXTENSION:vr.EXTENSION},Tu=function(t){function n(n,i,r,e){var u=t.call(this,gn.OPEN,i,n)||this;return u.target=r,u.inNewWindow=e,u}return B(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.target===i.target&&this.inNewWindow===i.inNewWindow},n.prototype.toRuntime=function(){switch(this.subtype){case Su.DIAGRAM:return new Mu(this,vr.DIAGRAM);case Su.PAGE:return new Mu(this,vr.PAGE)}},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.target),r=this.inNewWindow?1:0;return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(i,",").concat(r,"]"))},n.deserialize=function(t,i){var r=wn.toResource(1,t,i.resources),e=wn.toResource(3,t,i.resources);return new n(this.toSubType(t),r,e,this.inNewWindow(t))},n.toSubType=function(t){if(6!==t.length)return t[2];switch(t[2]){case Su.DIAGRAM_LEGACY:return Su.DIAGRAM;case Su.PAGE_LEGACY:case Su.PAGE_INPLACE_LEGACY:return Su.PAGE}},n.inNewWindow=function(t){if(6!==t.length)return!!t[4];switch(t[2]){case Su.DIAGRAM_LEGACY:return!1;case Su.PAGE_LEGACY:return!0;case Su.PAGE_INPLACE_LEGACY:return!1}},n}(dn),ju={TOP:0,TOP_LEFT:1,TOP_CENTER:2,TOP_RIGHT:3,LEFT:4,LEFT_TOP:5,LEFT_MIDDLE:6,LEFT_BOTTOM:7,RIGHT:8,RIGHT_TOP:9,RIGHT_MIDDLE:10,RIGHT_BOTTOM:11,BOTTOM:12,BOTTOM_LEFT:13,BOTTOM_CENTER:14,BOTTOM_RIGHT:15,OVER:16},Nu=function(){function t(){}return t.attach=function(t,n,i,r,e,u,s){var h=t.width,o=t.height,a=0;switch(s){case ju.LEFT:case ju.LEFT_TOP:case ju.LEFT_MIDDLE:case ju.LEFT_BOTTOM:(a=n.left-h-i)<i&&e-i<(a=n.right+i)+h&&(a=i);break;case ju.RIGHT:case ju.RIGHT_TOP:case ju.RIGHT_MIDDLE:case ju.RIGHT_BOTTOM:e-i<(a=n.right+i)+h&&(a=n.left-h-i)<i&&(a=e-h-i);break;case ju.TOP:case ju.TOP_LEFT:case ju.BOTTOM:case ju.BOTTOM_LEFT:a=this.adjust(n.left,h,i,e);break;case ju.TOP_RIGHT:case ju.BOTTOM_RIGHT:a=this.adjust(n.right-h,h,i,e);break;case ju.TOP_CENTER:case ju.BOTTOM_CENTER:case ju.OVER:a=this.adjust(.5*(n.left+n.right-h),h,i,e)}var c=0;switch(s){case ju.LEFT:case ju.LEFT_TOP:case ju.RIGHT:case ju.RIGHT_TOP:c=this.adjust(n.top,o,r,u);break;case ju.LEFT_MIDDLE:case ju.RIGHT_MIDDLE:case ju.OVER:c=this.adjust(.5*(n.top+n.bottom-o),o,r,u);break;case ju.LEFT_BOTTOM:case ju.RIGHT_BOTTOM:c=this.adjust(n.bottom,o,r,u);break;case ju.TOP:case ju.TOP_LEFT:case ju.TOP_RIGHT:case ju.TOP_CENTER:(c=n.top-o-r)<r&&u<(c=n.bottom+r)+o&&(c=r);break;case ju.BOTTOM:case ju.BOTTOM_LEFT:case ju.BOTTOM_RIGHT:case ju.BOTTOM_CENTER:u-r<(c=n.bottom+r)+o&&(c=n.top-o-r)<r&&(c=u-o-r)}t.position.set(a,c)},t.adjust=function(t,n,i,r){return t<i?r-i<t+n?.5*(r-n):i:r-i<t+n?r<n?.5*(r-n):r-n-i:t},t}(),Iu={NONE:0,ESC:1,CLICK_OUTSIDE:2},Cu={DIRTY:0,CLEAN:1},Au=function(){function n(t,n){var i;this.O=t,this.kn=n,n.enable&&(this.ns=this.newUtil()),this.Cr=Di(null!==(i=n.mode)&&void 0!==i?i:Cu.DIRTY,Cu),this.rs=!0,this.vn=!1}return Object.defineProperty(n.prototype,"parent",{get:function(){return this.O},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"mode",{get:function(){return this.Cr},set:function(t){this.Cr=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"constraint",{get:function(){var t,n,i=this.ji;return null==i&&(i=null!==(n=null===(t=this.kn)||void 0===t?void 0:t.constraint)&&void 0!==n?n:this.newConstraint(),this.ji=i),i},set:function(t){this.ji=t},enumerable:!1,configurable:!0}),n.prototype.newConstraint=function(){var t=this;return function(n,i,r,e){t.toConstrained(n,i,r,e)}},n.prototype.isDirty=function(){return this.vn},n.prototype.isClean=function(){return!this.vn},n.prototype.toClean=function(){this.vn&&(this.vn=!1)},n.prototype.newUtil=function(){var n=this,i=new t.Point,r=this.O,e=r.position;return new or({bind:r,checker:{start:function(t){if(t.target!==r)return!1;i.copyFrom(t.data.global),r.toLocal(i,void 0,i,!0);var n=i.x,e=i.y;return!(n<0||e<0||r.width<n||r.height<e)}},on:{start:function(){i.copyFrom(e)},move:function(t,u,s){i.set(i.x+u,i.y+s),n.vn||(n.vn=!0,r.setX(e.x),r.setY(e.y));var h=r.layer;null!=h&&n.constraint(r,h,i.x,i.y)}}})},n.prototype.toConstrained=function(i,r,e,u){var s,h=i.position;if(r){var o=i.getBounds(!1,null!==(s=n.WORK_BOUNDS)&&void 0!==s?s:n.WORK_BOUNDS=new t.Rectangle),a=o.x+e-h.x,c=o.y+u-h.y,f=Math.min(Math.max(0,a),r.width-o.width),l=Math.min(Math.max(0,c),r.height-o.height);h.set(e+f-a,u+l-c)}else h.set(e,u)},n}(),Ru={MODAL:0,MODELESS:1,MENU:2},Lu={MODAL:"MODAL",MODELESS:"MODELESS",MENU:"MENU"},yu=function(){function n(){}return n.apply=function(t,n){var i=this;t.on(Ki.down,(function(r){if(r.target===t){var e=i.point;e.copyFrom(r.data.global),t.toLocal(e,void 0,e,!0);var u=e.x,s=e.y;(u<0||s<0||t.width<u||t.height<s)&&setTimeout((function(){n(r)}),0)}}))},n.point=new t.Point,n}(),ku=function(){function t(t){this.es=null,this.us=null==(null==t?void 0:t.parent)?rt.last():null}return Object.defineProperty(t.prototype,"picked",{get:function(){return this.es},enumerable:!1,configurable:!0}),t.prototype.pick=function(t){var n=this.es;if(null==n){if(!(n=rt.getLayerOverlay(t))){var i=this.us;n=i?i.getLayerOverlay():rt.last().getLayerOverlay()}this.es=n}return n},t}(),xu=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return B(i,n),i.prototype.init=function(t){var i,r,e=this;n.prototype.init.call(this,t),this.ss=function(){e.onPrerender()},this.es=null;var u=this.theme,s=Di(null!==(i=null==t?void 0:t.mode)&&void 0!==i?i:u.getMode(),Ru);this.Cr=s,this.hs=null!==(r=null==t?void 0:t.sticky)&&void 0!==r?r:u.isSticky(s);var h=this.toCloseOn(s,u,t);switch(this.os=h,this.Tt=this.toAlign(s,u,t),this.cs=new ku,this.nr=new Au(this,this.toGestureOptions(s,u,t)),this.visible=!1,s){case Ru.MODAL:this.state.addAll(ht.FOCUS_ROOT,Lu.MODAL);break;case Ru.MODELESS:this.state.add(Lu.MODELESS);break;case Ru.MENU:this.state.addAll(ht.FOCUS_ROOT,Lu.MENU)}h&Iu.CLICK_OUTSIDE&&yu.apply(this,(function(){e.onCloseOn()}))},i.prototype.toCloseOn=function(t,n,i){var r=null==i?void 0:i.closeOn;if(null==r)return n.closeOn(t);if(Rt(r)){for(var e=Iu.NONE,u=0,s=r.length;u<s;++u)e|=Iu[r[u]];return e}return at(r)?Iu[r]:r},i.prototype.toAlign=function(t,n,i){var r=null==i?void 0:i.align;return null===r?null:void 0===r?n.getAlign(t):Di(r,ju)},Object.defineProperty(i.prototype,"mode",{get:function(){return this.Cr},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"align",{get:function(){return this.Tt},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"algin",{set:function(t){this.Tt=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"gesture",{get:function(){return this.nr},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"layer",{get:function(){return this.es},enumerable:!1,configurable:!0}),i.prototype.toGestureOptions=function(t,n,i){var r=null==i?void 0:i.gesture;return!0===r?{enable:!0,mode:n.getGestureMode(t)}:!1===r?{enable:!1,mode:n.getGestureMode(t)}:null!=r?(void 0===r.enable&&(r.enable=n.isGestureEnabled(t)),void 0===r.mode&&(r.mode=n.getGestureMode(t)),r):{enable:n.isGestureEnabled(t),mode:n.getGestureMode(t)}},i.prototype.onParentResize=function(t,i,r){if(this.isOpened()){var e=this.es;if(null!=e){var u=this.nr;if(u.isDirty()){var s=this.position;u.constraint(this,e,s.x,s.y)}}}n.prototype.onParentResize.call(this,t,i,r)},i.prototype.getAnimation=function(){var t,n,i=this,r=this.di;return void 0===r&&((r=null!==(n=null===(t=this.kn)||void 0===t?void 0:t.animation)&&void 0!==n?n:this.theme.newAnimation(this.Cr))&&(r.target=this,r.on("end",(function(t){i.onAnimationEnd(t)}))),this.di=r),r},i.prototype.onAnimationEnd=function(t){if(t)if(this.Cr===Ru.MODELESS)this.hide();else{var n=this.parent;n&&n.removeChild(this)}else{var i=rt.getLayer(this);if(i){var r=i.getFocusController();this.fs=r.get(),r.focus(this.findFirstFocusable(r)||this)}}},i.prototype.findFirstFocusable=function(t){return t.find(this,!1,!0,!0)},i.prototype.open=function(t){var n=this,i=this.ls;if(null==i){i=new Promise((function(t,i){n.vs=t,n.bs=i})),this.ls=i,this.gs=t;var r=null;switch(this.Cr){case Ru.MODAL:case Ru.MENU:(r=this.cs.pick(this)).stage.addChild(this);break;case Ru.MODELESS:r=rt.getLayer(this),this.show()}this.es=r;var e=this.nr;if(e.mode===Cu.CLEAN&&e.toClean(),null!=r)if(e.isClean()){var u=r.renderer,s=this.ss;this.hs?u.on("prerender",s):u.once("prerender",s)}else{var h=this.position;e.constraint(this,r,h.x,h.y)}this.onOpen()}return i},i.prototype.onPrerender=function(){var n,r=this.es;if(null!=r){var e=this.Tt,u=this.gs;if(null!=e&&null!=u){var s=this.Cr,h=u.getBounds(!1,null!==(n=i.WORK_BOUNDS)&&void 0!==n?n:i.WORK_BOUNDS=new t.Rectangle),o=this.theme;Nu.attach(this,h,o.getOffsetX(s),o.getOffsetY(s),r.width,r.height,e)}else this.position.set(.5*(r.width-this.width),.5*(r.height-this.height))}},i.prototype.onOpen=function(){this.emit("open",this);var t=this.getAnimation();t?t.start():this.Cr===Ru.MENU&&(this.visible=!0,this.onAnimationEnd(!1))},i.prototype.isOpened=function(){return null!=this.ls},i.prototype.close=function(){this.doReject()},i.prototype.doResolve=function(t){var n=this.vs;n&&(this.ls=void 0,this.vs=void 0,this.bs=void 0,this.onClose(),n(t))},i.prototype.doReject=function(t){var n=this.bs;n&&(this.ls=void 0,this.vs=void 0,this.bs=void 0,this.onClose(),n(t))},i.prototype.onClose=function(){var t=this.es,n=this.fs;if(null!=n)if(this.fs=null,t){var i=rt.getLayer(n);null!=i&&t!==i&&i.view.focus(),t.getFocusController().focus(n)}else this.blur(!0);else this.blur(!0);t&&(t.renderer.off("prerender",this.ss),this.es=null),this.gs=null;var r=this.getAnimation();r?r.start(!0):(this.visible=!1,this.onAnimationEnd(!0)),this.emit("close",this)},i.prototype.onKeyDown=function(t){return this.os&Iu.ESC&&Xi.isCancelKey(t)&&this.onCloseOn(),n.prototype.onKeyDown.call(this,t)},i.prototype.onCloseOn=function(){this.close()},i.prototype.containsGlobalPoint=function(t){switch(this.Cr){case Ru.MODAL:case Ru.MENU:return!0;case Ru.MODELESS:return n.prototype.containsGlobalPoint.call(this,t)}},i.prototype.getType=function(){return"DDialog"},i}(Qi),Bu={VERTICAL:0,HORIZONTAL:1},_u=function(t){function n(n){var i=t.call(this,n)||this;return i.visible=!1,i}return B(n,t),n.prototype.getType=function(){return"DLayoutSpace"},n}(Qi),Pu=function(t){return t instanceof Qi&&(t.visible||t instanceof _u)},Uu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.init=function(n){t.prototype.init.call(this,n);var i=this.theme;this.Wr=function(t,n){var i,r,e=null==n?void 0:n.margin;if(null!=e){if(mn(e))return{horizontal:e,vertical:e};var u=t.getMargin();return{horizontal:null!==(i=e.horizontal)&&void 0!==i?i:u,vertical:null!==(r=e.vertical)&&void 0!==r?r:u}}return{horizontal:u=t.getMargin(),vertical:u}}(i,n),this.Yt=function(t,n){var i=null==n?void 0:n.direction;return null!=i?at(i)?Bu[i]:i:t.getDirection()}(i,n),this.ws=function(t,n){var i=null==n?void 0:n.corner;if(null!=i&&!mn(i)){var r=i.adjust;if(null!=r)return r}return t.getCornerAdjust()}(i,n),this.Os=function(t,n){if(n){var i=n.row;if(null!=i)return i;var r=n.column;if(null!=r)return r}return t.getMultiplicity()}(i,n),this.$n=function(t,n){var i;return null!==(i=null==n?void 0:n.reverse)&&void 0!==i?i:t.getReverse()}(i,n)},Object.defineProperty(n.prototype,"margin",{get:function(){return this.Wr},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"multiplicity",{get:function(){return this.Os},enumerable:!1,configurable:!0}),n.prototype.getWeightTotal=function(){for(var t=this.children,n=0,i=this.Os,r=this.$n,e=0,u=t.length;e<u;){for(var s=-1,h=0;h<i&&e+h<u;++h){var o=t[r?u-1-(e+h):e+h];if(Pu(o)){var a=o.getClearType();if(0!==h&&a&Pi.BEFORE)break;if(s=Math.max(s,o.weight),a&&Pi.AFTER){h+=1;break}}else e+=1,h-=1}e+=h,0<=s&&(n+=s)}return n},n.prototype.getSpaceLeft=function(t,n){var i=this.children,r=this.Os,e=this.$n;if(this.Yt===Bu.VERTICAL){for(var u=t,s=0,h=0,o=i.length;h<o;){for(var a=0,c=-1,f=0;f<r&&h+f<o;++f){var l=i[e?o-1-(h+f):h+f];if(Pu(l)){var v=l.getClearType();if(0!==f&&v&Pi.BEFORE)break;if(a=(c=Math.max(c,l.weight))<0?Math.max(a,l.height+s):s,v&Pi.AFTER){f+=1;break}}else h+=1,f-=1}h+=f,u-=a,s=n}return Math.max(0,u)}for(u=t,s=0,h=0,o=i.length;h<o;){var b=0;for(c=-1,f=0;f<r&&h+f<o;++f)if(l=i[e?o-1-(h+f):h+f],Pu(l)){if(v=l.getClearType(),0!==f&&v&Pi.BEFORE)break;if(b=(c=Math.max(c,l.weight))<0?Math.max(b,l.width+s):s,v&Pi.AFTER){f+=1;break}}else h+=1,f-=1;h+=f,u-=b,s=n}return Math.max(0,u)},n.prototype.calcSpaceLeft=function(t,n,i,r){return t?0:this.getSpaceLeft(n-i,r)},n.prototype.onRefit=function(){var i=this.children,r=this.zn,e=r.getTop(),u=r.getBottom(),s=r.getLeft(),h=r.getRight(),o=this.Wr,a=o.vertical,c=o.horizontal,f=this.getWeightTotal(),l=this.Os,v=this.$n,b=this.Bn,d=null;if(this.ws){var g=4+(i.length<<1);(null==n.CORNER_ADJUST_WORK||n.CORNER_ADJUST_WORK.length<g)&&(n.CORNER_ADJUST_WORK=new Float32Array(g)),(d=n.CORNER_ADJUST_WORK)[0]=-2,d[1]=-2,d[g-2]=-3,d[g-1]=-3}if(this.Yt===Bu.VERTICAL){var m=0,w=e-a;if(0<f){for(var O=1/f,p=this.calcSpaceLeft(b.height.isOn,this.height,e+u,a),D=0,E=i.length;D<E;){for(var M=s-c,S=0,T=0;T<l&&D+T<E;++T){var j=i[v?E-1-(D+T):D+T];if(Pu(j)){var N=j.getClearType();if(0!==T&&N&Pi.BEFORE)break;if(j.position.set(c+M,a+w),0<=(F=j.weight)&&(j.height=p*(F*O)),M+=c+j.width,S=Math.max(S,j.height),N&Pi.AFTER){null!=d&&(d[0+(G=D+T+1<<1)]=T,d[G+1]=m),T+=1;break}null!=d&&(d[0+(G=D+T+1<<1)]=T,d[G+1]=m)}else null!=d&&(d[0+(G=D+T+1<<1)]=T-1,d[G+1]=m),D+=1,T-=1}w+=a+S,D+=T,m+=1}if(null!=d)for(D=0,E=i.length;D<E;++D)if(j=i[v?E-1-D:D],Pu(j)){var I=d[0+(H=2+(D<<1))],C=d[H+1],A=-2;if(!((N=j.getClearType())&Pi.BEFORE)){var R=this.findRowIndexPrevious(H,C,d);this.hasClearTypeAfter(i,R)||(A=d[R])}var L=-2;if(!(N&Pi.AFTER)){var y=this.findRowIndexNext(H,C,d);this.hasClearTypeBefore(i,y)||(L=d[y])}var k=this.countColumn(H,C,d);j.corner.mask=this.toCornerMaskColumn(A,I,L,k)}}else{for(D=0,E=i.length;D<E;){for(M=s-c,S=0,T=0;T<l&&D+T<E;++T)if(j=i[v?E-1-(D+T):D+T],Pu(j)){if(N=j.getClearType(),0!==T&&N&Pi.BEFORE)break;if(j.position.set(c+M,a+w),0<=(F=j.weight)&&(j.height=0),M+=c+j.width,S=Math.max(S,j.height),N&Pi.AFTER){null!=d&&(d[0+(G=D+T+1<<1)]=T,d[G+1]=m),T+=1;break}null!=d&&(d[0+(G=D+T+1<<1)]=T,d[G+1]=m)}else null!=d&&(d[0+(G=D+T+1<<1)]=T-1,d[G+1]=m),D+=1,T-=1;w+=a+S,D+=T,m+=1}if(null!=d)for(D=0,E=i.length;D<E;++D)j=i[v?E-1-D:D],Pu(j)&&(I=d[0+(H=2+(D<<1))],C=d[H+1],A=-2,(N=j.getClearType())&Pi.BEFORE||(R=this.findRowIndexPrevious(H,C,d),this.hasClearTypeAfter(i,R)||(A=d[R])),L=-2,N&Pi.AFTER||(y=this.findRowIndexNext(H,C,d),this.hasClearTypeBefore(i,y)||(L=d[y])),k=this.countColumn(H,C,d),j.corner.mask=this.toCornerMaskColumn(A,I,L,k))}}else{var x=0;if(M=s-c,0<f){for(O=1/f,p=this.calcSpaceLeft(b.width.isOn,this.width,s+h,c),D=0,E=i.length;D<E;){w=e-a;var B=0;for(T=0;T<l&&D+T<E;++T)if(j=i[v?E-1-(D+T):D+T],Pu(j)){if(N=j.getClearType(),0!==T&&N&Pi.BEFORE)break;if(j.position.set(c+M,a+w),0<=(F=j.weight)&&(j.width=p*(F*O)),B=Math.max(B,j.width),w+=a+j.height,N&Pi.AFTER){null!=d&&(d[0+(G=D+T+1<<1)]=x,d[G+1]=T),T+=1;break}null!=d&&(d[0+(G=D+T+1<<1)]=x,d[G+1]=T)}else null!=d&&(d[0+(G=D+T+1<<1)]=x,d[G+1]=T-1),D+=1,T-=1;M+=c+B,D+=T,x+=1}if(null!=d)for(D=0,E=i.length;D<E;++D)if(j=i[v?E-1-D:D],Pu(j)){I=d[0+(H=2+(D<<1))],C=d[H+1];var _=-2;(N=j.getClearType())&Pi.BEFORE||(R=this.findColumnIndexPrevious(H,I,d),this.hasClearTypeAfter(i,R)||(_=d[R+1]));var P=-2;N&Pi.AFTER||(y=this.findColumnIndexNext(H,I,d),this.hasClearTypeBefore(i,y)||(P=d[y+1]));var U=this.countRow(H,I,d);j.corner.mask=this.toCornerMaskRow(_,C,P,U)}}else{for(D=0,E=i.length;D<E;){for(w=e-a,B=0,T=0;T<l&&D+T<E;++T)if(j=i[v?E-1-(D+T):D+T],Pu(j)){var F;if(N=j.getClearType(),0!==T&&N&Pi.BEFORE)break;if(j.position.set(c+M,a+w),0<=(F=j.weight)&&(j.width=0),B=Math.max(B,j.width),w+=a+j.height,N&Pi.AFTER){null!=d&&(d[0+(G=D+T+1<<1)]=x,d[G+1]=T),T+=1;break}null!=d&&(d[0+(G=D+T+1<<1)]=x,d[G+1]=T)}else{var G;null!=d&&(d[0+(G=D+T+1<<1)]=x,d[G+1]=T-1),D+=1,T-=1}M+=c+B,D+=T,x+=1}if(null!=d)for(D=0,E=i.length;D<E;++D){var H;j=i[v?E-1-D:D],Pu(j)&&(I=d[0+(H=2+(D<<1))],C=d[H+1],_=-2,(N=j.getClearType())&Pi.BEFORE||(R=this.findColumnIndexPrevious(H,I,d),this.hasClearTypeAfter(i,R)||(_=d[R+1])),P=-2,N&Pi.AFTER||(y=this.findColumnIndexNext(H,I,d),this.hasClearTypeBefore(i,y)||(P=d[y+1])),U=this.countRow(H,I,d),j.corner.mask=this.toCornerMaskRow(_,C,P,U))}}}t.prototype.onRefit.call(this)},n.prototype.hasClearTypeBefore=function(t,n){return this.hasClearType(t,n,Pi.BEFORE)},n.prototype.hasClearTypeAfter=function(t,n){return this.hasClearType(t,n,Pi.AFTER)},n.prototype.hasClearType=function(t,n,i){if(2<=n){var r=n-2>>1;if(0<=r&&r<t.length){var e=t[r];if(e instanceof Qi)return!!(e.getClearType()&i)}}return!1},n.prototype.findColumnIndexPrevious=function(t,n,i){for(var r=t-2;0<=r;r-=2)if(i[r]!==n)return r;return 0},n.prototype.findColumnIndexNext=function(t,n,i){for(var r=t+2,e=i.length;r<e;r+=2){var u=i[r];if(u!==n){for(var s=r+2;s<e;s+=2)if(i[s]!==u)return s-2;return r}}return i.length-2},n.prototype.countRow=function(t,n,i){for(var r=t+2,e=i.length;r<e;r+=2)if(i[r]!==n)return i[r-2+1]+1;return 0},n.prototype.findRowIndexPrevious=function(t,n,i){for(var r=t-2;0<=r;r-=2)if(i[r+1]!==n)return r;return 0},n.prototype.findRowIndexNext=function(t,n,i){for(var r=t+2,e=i.length;r<e;r+=2){var u=i[r+1];if(u!==n){for(var s=r+2;s<e;s+=2)if(i[s+1]!==u)return s-2;return r}}return i.length-2},n.prototype.countColumn=function(t,n,i){for(var r=t+2,e=i.length;r<e;r+=2)if(i[r+1]!==n)return i[r-2+0]+1;return 0},n.prototype.toCornerMaskColumn=function(t,n,i,r){var e=Mi.NONE;return t+1<n&&0===n&&(e|=Mi.TOP_LEFT),i+1<n&&0===n&&(e|=Mi.BOTTOM_LEFT),t<n&&n+1===r&&(e|=Mi.TOP_RIGHT),i<n&&n+1===r&&(e|=Mi.BOTTOM_RIGHT),Mi.ALL&~e},n.prototype.toCornerMaskRow=function(t,n,i,r){var e=Mi.NONE;return t+1<n&&0===n&&(e|=Mi.TOP_LEFT),i+1<n&&0===n&&(e|=Mi.TOP_RIGHT),t<n&&n+1===r&&(e|=Mi.BOTTOM_LEFT),i<n&&n+1===r&&(e|=Mi.BOTTOM_RIGHT),Mi.ALL&~e},n.prototype.addSpace=function(t){return this.addChild(new _u(t))},n.prototype.getType=function(){return"DLayout"},n.CORNER_ADJUST_WORK=null,n}(Qi),Fu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DLayoutVertical"},n}(Uu),Gu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DDialogLayeredContent"},n}(Fu),Hu={CLICKED:0,DOUBLE_CLICKED:1},zu=function(){function t(t){this.$t=t}return t.prototype.getImageAlignHorizontal=function(){return this.$t.getSecondaryImageAlignHorizontal()},t.prototype.getImageAlignVertical=function(){return this.$t.getSecondaryImageAlignVertical()},t.prototype.getImageAlignWith=function(){return this.$t.getSecondaryImageAlignWith()},t.prototype.getImageMarginHorizontal=function(){return this.$t.getSecondaryImageMarginHorizontal()},t.prototype.getImageMarginVertial=function(){return this.$t.getSecondaryImageMarginVertial()},t.prototype.getImageTintColor=function(t){return this.$t.getSecondaryImageTintColor(t)},t.prototype.getImageTintAlpha=function(t){return this.$t.getSecondaryImageTintAlpha(t)},t.prototype.getImageSource=function(t){return this.$t.getSecondaryImageSource(t)},t}(),Vu=function(){function t(t){this.$t=t}return t.prototype.getImageAlignHorizontal=function(){return this.$t.getTertiaryImageAlignHorizontal()},t.prototype.getImageAlignVertical=function(){return this.$t.getTertiaryImageAlignVertical()},t.prototype.getImageAlignWith=function(){return this.$t.getTertiaryImageAlignWith()},t.prototype.getImageMarginHorizontal=function(){return this.$t.getTertiaryImageMarginHorizontal()},t.prototype.getImageMarginVertial=function(){return this.$t.getTertiaryImageMarginVertial()},t.prototype.getImageTintColor=function(t){return this.$t.getTertiaryImageTintColor(t)},t.prototype.getImageTintAlpha=function(t){return this.$t.getTertiaryImageTintAlpha(t)},t.prototype.getImageSource=function(t){return this.$t.getTertiaryImageSource(t)},t}(),Wu={LEFT:0,CENTER:1,RIGHT:2},Xu={TOP:0,MIDDLE:1,BOTTOM:2},Ku={TEXT:0,PADDING:1,BORDER:2},Yu=function(){function n(n,i,r,e){var u=this;this.O=n,this.$t=i,this.ps=r,this.bt=null,this.Tt=function(t,n){var i,r,e,u=null==n?void 0:n.align;return{with:Di(null!==(i=null==u?void 0:u.with)&&void 0!==i?i:t.getImageAlignWith(),Ku),vertical:Di(null!==(r=null==u?void 0:u.vertical)&&void 0!==r?r:t.getImageAlignVertical(),Xu),horizontal:Di(null!==(e=null==u?void 0:u.horizontal)&&void 0!==e?e:t.getImageAlignHorizontal(),Wu)}}(i,e),this.Wr=function(t,n){var i,r,e=null==n?void 0:n.margin;return{vertical:null!==(i=null==e?void 0:e.vertical)&&void 0!==i?i:t.getImageMarginVertial(),horizontal:null!==(r=null==e?void 0:e.horizontal)&&void 0!==r?r:t.getImageMarginHorizontal()}}(i,e),this.Ds=null==e?void 0:e.tint,this.Es=new t.Rectangle,this.Ms=null==e?void 0:e.source,this.Ss=null,this.Ts=function(){u.onUpdate()}}return Object.defineProperty(n.prototype,"image",{get:function(){return this.bt},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"align",{get:function(){return this.Tt},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"margin",{get:function(){return this.Wr},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"bound",{get:function(){return this.Es},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"source",{get:function(){return this.Ms},set:function(t){this.Ms!==t&&(this.Ms=t,this.onUpdate())},enumerable:!1,configurable:!0}),n.prototype.computeSource=function(){var t=this.Ms;if(void 0!==t){if(!ot(t))return t;var n=t(this.O.state);if(void 0!==n)return n}return this.$t.getImageSource(this.O.state)},n.prototype.onStateChange=function(t,n){this.updateTint()},n.prototype.updateBound=function(){var t=this.Es,n=this.bt;if(null!=n){n.updateTransform(),n.getLocalBounds(t);var i=t.left,r=t.top,e=t.right,u=t.bottom,s=n.localTransform,h=s.a,o=s.b,a=s.c,c=s.d,f=h*i+a*r,l=o*i+c*r,v=h*e+a*r,b=o*e+c*r,d=h*e+a*u,g=o*e+c*u,m=h*i+a*u,w=o*i+c*u,O=Math.min(f,v,d,m),p=Math.max(f,v,d,m),D=Math.min(l,b,g,w),E=Math.max(l,b,g,w);t.x=O+s.tx,t.y=D+s.ty,t.width=p-O,t.height=E-D}else t.x=0,t.y=0,t.width=0,t.height=0},n.prototype.isTintAware=function(t){return null!=t&&"tint"in t},n.prototype.toTintColor=function(t,n){var i=this.Ds;if(i){var r=i.color;if(void 0!==r){if(!ot(r))return r;var e=r(n);if(void 0!==e)return e}}return t.getImageTintColor(n)},n.prototype.toTintAlpha=function(t,n){var i=this.Ds;if(i){var r=i.alpha;if(void 0!==r){if(!ot(r))return r;var e=r(n);if(void 0!==e)return e}}return t.getImageTintAlpha(n)},n.prototype.updateTint=function(){var t=this.bt;if(t&&this.isTintAware(t)){var n=this.$t,i=this.O.state,r=this.toTintColor(n,i);if(null!=r){var e=!1;t.tint!==r&&(t.tint=r,e=!0);var u=this.toTintAlpha(n,i);return t.alpha!==u&&(t.alpha=u,e=!0),e}}return!1},n.prototype.updateSource=function(){var n=this.computeSource(),i=this.Ss;if(n!==i){this.Ss=n;var r,e=this.O,u=this.bt,s=this.Ts;if(n instanceof t.Texture)if(i instanceof t.Texture)i.off("update",s),u instanceof t.Sprite&&(u.texture=n,n.on("update",s));else{null!=u&&e.removeChild(u);var h=new t.Sprite(n);(r=e.getOverflowMask())&&(h.mask=r),n.on("update",s),e.addChild(h),this.bt=h}else i instanceof t.Texture?(i.off("update",s),null!=u&&(e.removeChild(u),u.destroy())):null!=u&&e.removeChild(u),null!=n&&((r=e.getOverflowMask())&&(n.mask=r),e.addChild(n)),this.bt=n;return!0}return!1},n.prototype.isRefitable=function(t){return null!=t&&t===this.bt},n.prototype.destroy=function(){var n=this.bt;if(n){this.bt=null;var i=this.Ss;i instanceof t.Texture&&(i.off("update",this.Ts,this),n.destroy())}},n.prototype.onUpdate=function(){this.O.toDirty(),rt.update(this.O)},n}(),Ju=function(){function t(){this.js=[],this.j=0,this.Wr=0}return t.prototype.clear=function(){this.js.length=0,this.j=0,this.Wr=0,this.Ns=void 0},t.prototype.add=function(t,n,i){this.js.push(t),this.j+=i+n,this.Wr=i},t.prototype.set=function(t){this.Ns=t},Object.defineProperty(t.prototype,"size",{get:function(){return this.j-(null===this.Ns?this.Wr:0)},enumerable:!1,configurable:!0}),t}(),Zu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.execute=function(t,n){var i=this.js,r=n-t;if(void 0!==this.Ns)for(var e=0,u=0,s=i.length;u<s;++u)r-=e+(h=i[u]).bound.height,h.image.y=r,e=h.margin.horizontal;else for(u=0,s=i.length;u<s;++u){var h;r-=(h=i[u]).margin.horizontal+h.bound.height,h.image.y=r}},n}(Ju),qu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.add=function(t,n,i){this.js.push(t),this.j=Math.max(this.size,n)},n.prototype.execute=function(t,n,i){for(var r=t+.5*(i-t-n),e=this.js,u=0,s=e.length;u<s;++u){var h=e[u];h.image.x=r-.5*h.bound.width}},n}(Ju),Qu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.execute=function(t){var n=this.js,i=t;if(void 0!==this.Ns)for(var r=0,e=n.length;r<e;++r)(u=n[r]).image.x=i,i+=u.bound.width+u.margin.horizontal;else for(r=0,e=n.length;r<e;++r){var u;i+=(u=n[r]).margin.horizontal,u.image.x=i,i+=u.bound.width}},n}(Ju),$u=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.add=function(t,n,i){this.js.push(t),this.j=Math.max(this.size,n)},n.prototype.execute=function(t,n,i){for(var r=t+.5*(i-t-n),e=this.js,u=0,s=e.length;u<s;++u){var h=e[u];h.image.y=r-.5*h.bound.height}},n}(Ju),ts=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.execute=function(t,n){var i=this.js,r=n-t;if(void 0!==this.Ns)for(var e=0,u=0,s=i.length;u<s;++u)r-=e+(h=i[u]).bound.width,h.image.x=r,e=h.margin.horizontal;else for(u=0,s=i.length;u<s;++u){var h;r-=(h=i[u]).margin.horizontal+h.bound.width,h.image.x=r}},n}(Ju),ns=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.execute=function(t){var n=this.js,i=t;if(void 0!==this.Ns)for(var r=0,e=0,u=n.length;e<u;++e)(s=n[e]).image.y=r+i,i+=s.bound.height,r=s.margin.vertical;else for(e=0,u=n.length;e<u;++e){var s;i+=(s=n[e]).margin.vertical,s.image.y=i,i+=s.bound.height}},n}(Ju),is=function(){function t(){this.left=new Qu,this.center=new qu,this.right=new ts,this.top=new ns,this.middle=new $u,this.bottom=new Zu}return t.prototype.clear=function(){this.left.clear(),this.center.clear(),this.right.clear(),this.top.clear(),this.middle.clear(),this.bottom.clear(),this.text=void 0},t.prototype.add=function(t){if(null!=t.image){var n=t.bound,i=n.width,r=n.height,e=t.margin,u=e.horizontal,s=e.vertical,h=t.align;switch(h.horizontal){case Wu.LEFT:this.left.add(t,i,u);break;case Wu.CENTER:this.center.add(t,i,u);break;case Wu.RIGHT:this.right.add(t,i,u)}switch(h.vertical){case Xu.TOP:this.top.add(t,r,s);break;case Xu.MIDDLE:this.middle.add(t,r,s);break;case Xu.BOTTOM:this.bottom.add(t,r,s)}}},t.prototype.set=function(t){this.left.set(t),this.center.set(t),this.right.set(t),this.top.set(t),this.middle.set(t),this.bottom.set(t),this.text=t},Object.defineProperty(t.prototype,"width",{get:function(){var t=this.text,n=this.left.size,i=this.center.size,r=this.right.size;return void 0!==t?null!==t?Math.max(n+t.width+r,i):Math.max(n+r,i):Math.max(n,r,i)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){var t=this.text,n=this.top.size,i=this.middle.size,r=this.bottom.size;return void 0!==t?null!==t?Math.max(n+t.height+r,i):Math.max(n+r,i):Math.max(n,r,i)},enumerable:!1,configurable:!0}),t.prototype.execute=function(t,n,i,r,e,u,s){var h=this.left,o=this.center,a=this.right,c=this.top,f=this.middle,l=this.bottom,v=this.text;if(void 0!==v){var b=h.size,d=a.size,g=c.size,m=l.size,w=0,O=0,p=0;switch(null!=v&&(O=v.width,p=v.height),e.horizontal){case Wu.LEFT:w=t+b;break;case Wu.CENTER:w=t+.5*(u-t-i-(b+O+d))+b;break;case Wu.RIGHT:w=u-i-d-O}var D=0;switch(e.vertical){case Xu.TOP:D=n+g;break;case Xu.MIDDLE:D=n+.5*(s-n-r-(g+p+m))+g;break;case Xu.BOTTOM:D=s-r-m-p}null!=v&&(v.position.set(w,D),v.setClippingDelta(b+d,g+m)),h.execute(w-b),o.execute(0,0,2*w+O),a.execute(0,w+O+d),c.execute(D-g),f.execute(0,0,2*D+p),l.execute(0,D+p+m)}else h.execute(t),o.execute(t,i,u),a.execute(i,u),c.execute(n),f.execute(n,r,s),l.execute(r,s)},t}(),rs=function(){function t(){this.text=new is,this.padding=new is,this.border=new is}return t.prototype.clear=function(){this.text.clear(),this.padding.clear(),this.border.clear()},t.prototype.add=function(t){if(t.image)switch(t.align.with){case Ku.TEXT:this.text.add(t);break;case Ku.PADDING:this.padding.add(t);break;case Ku.BORDER:this.border.add(t)}},t.prototype.set=function(t){this.text.set(t)},t.prototype.execute=function(t,n,i,r){var e=t.getLeft(),u=t.getTop(),s=t.getRight(),h=t.getBottom();null==i&&(i=e+this.width+s),null==r&&(r=u+this.height+h),this.border.execute(0,0,0,0,n,i,r),this.padding.execute(e,u,s,h,n,i,r),this.text.execute(e,u,s,h,n,i,r)},Object.defineProperty(t.prototype,"width",{get:function(){return Math.max(this.border.width,this.padding.width,this.text.width)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return Math.max(this.border.height,this.padding.height,this.text.height)},enumerable:!1,configurable:!0}),t}(),es=function(t){function n(n){var i=t.call(this)||this;return i.parent=n,i}return B(n,t),n.prototype.render=function(n){this.updateTransform(),t.prototype.render.call(this,n)},n.prototype.onReflow=function(t,n,i){this.clear(),this.beginFill(16777215,1),this.drawRect(0,0,n,i),this.endFill()},n}(t.Graphics),us=function(){function t(t,n,i,r){this.x=t,this.y=n,this.character=i,this.wrappable=r}return t.prototype.set=function(t,n,i,r){this.x=t,this.y=n,this.character=i,this.wrappable=r},t}(),ss=function(){function t(){this.count=0,this.countPerLine=0,this.width=0,this.height=0,this.characters=[],this.clipped=!1,this.x=0,this.y=0}return t.prototype.start=function(t,n){this.count=0,this.countPerLine=0,this.width=0,this.height=0,this.clipped=!1,this.x=0,this.y=.5*(t-n)},t.prototype.isPushable=function(t,n){return!(t<this.x+n.advance&&!(n.type&ve.SPACE))},t.prototype.isPushableAtNewLine=function(t,n,i){return this.y+1.5*n+.5*i<=t},t.prototype.push=function(t,n){var i=this.x;this.x+=t.advance;var r=this.y,e=this.count,u=this.characters;e<u.length?u[e].set(i,r,t,n):u.push(new us(i,r,t,n)),this.count+=1,this.countPerLine+=1},t.prototype.newLine=function(t){this.width=Math.max(this.width,this.x),this.x=0,this.y+=t,this.countPerLine=0},t.prototype.wordWrap=function(t){var n=this.countPerLine,i=this.characters;if(0<n){for(var r=this.count,e=r-1,u=r-n;u<e;--e){var s=i[e];if(s.wrappable){var h=s.character.advance,o=s.y+t;s.x=0,s.y=o;for(var a=e+1;a<r;++a)(s=i[a]).x=h,s.y=o,h+=s.character.advance;return this.x=h,this.y=o,this.countPerLine=r-e,!0}}var c=i[r-1];return c.x=0,c.y=c.y+t,this.x=c.character.advance,this.y=c.y,this.countPerLine=1,!1}return!1},t.prototype.pop=function(){var t=this.countPerLine,n=this.characters;if(0<t){var i=n[this.count-1];return this.x-=i.character.advance,this.count-=1,this.countPerLine-=1,!0}return!1},t.prototype.end=function(t,n){this.newLine(t),this.y-=.5*(t-n),this.height=this.y},t}(),hs={NONE:0,NORMAL:1,BREAK_ALL:2},os="\n",as=function(){function t(){}return t.measure=function(n,i,r){var e=t.RESULT||new ss;if(t.RESULT=e,null!=i){var u=b.from(n),s=i.font.height,h=r.lineHeight,o=r.enable,a=r.width,c=r.height,f=r.wordWrap;switch(e.start(h,s),f){case hs.BREAK_ALL:o?this.measure1(u,a,c,s,h,i,e):this.measure2(u,a,h,i,e);break;case hs.NORMAL:var l=this.newLineBreaker(n);l?o?this.measure1a(l,u,a,c,s,h,i,e):this.measure2a(l,u,a,h,i,e):o?this.measure1b(u,a,c,s,h,i,e):this.measure2b(u,a,h,i,e);break;default:o?this.measure3(u,a,h,i,e):this.measure4(u,h,i,e)}e.end(h,s)}else e.start(0,0),e.end(0,0);return e},t.measure1a=function(t,n,i,r,e,u,s,h){for(var o=t.next();n.hasNext();){var a=n.position,c=n.next();if(c===os)h.newLine(u);else{var f=s.get(c);if(null==f)continue;o=this.advance(a,o,t);var l=this.isWrappable1(a,o);h.isPushable(i,f)?h.push(f,l):h.isPushableAtNewLine(r,u,e)?(h.push(f,l),h.wordWrap(u)):this.measure5(n,i,u,s,h,!0)}}},t.measure1b=function(t,n,i,r,e,u,s){for(;t.hasNext();){var h=t.next();if(h===os)s.newLine(e);else{var o=u.get(h);if(null==o)continue;var a=this.isWrappable2(s,o);s.isPushable(n,o)?s.push(o,a):s.isPushableAtNewLine(i,e,r)?(s.push(o,a),s.wordWrap(e)):this.measure5(t,n,e,u,s,!0)}}},t.measure1=function(t,n,i,r,e,u,s){for(;t.hasNext();){var h=t.next();if(h===os)s.newLine(e);else{var o=u.get(h);if(null==o)continue;s.isPushable(n,o)?s.push(o,!0):s.isPushableAtNewLine(i,e,r)?(s.newLine(e),s.push(o,!0)):this.measure5(t,n,e,u,s,!0)}}},t.measure2a=function(t,n,i,r,e,u){for(var s=t.next();n.hasNext();){var h=n.position,o=n.next();if(o===os)u.newLine(r);else{var a=e.get(o);if(null==a)continue;s=this.advance(h,s,t);var c=this.isWrappable1(h,s);u.isPushable(i,a)?u.push(a,c):(u.push(a,c),u.wordWrap(r))}}},t.measure2b=function(t,n,i,r,e){for(;t.hasNext();){var u=t.next();if(u===os)e.newLine(i);else{var s=r.get(u);if(null==s)continue;var h=this.isWrappable2(e,s);e.isPushable(n,s)?e.push(s,h):(e.push(s,h),e.wordWrap(i))}}},t.measure2=function(t,n,i,r,e){for(;t.hasNext();){var u=t.next();if(u===os)e.newLine(i);else{var s=r.get(u);if(null==s)continue;e.isPushable(n,s)||e.newLine(i),e.push(s,!1)}}},t.measure3=function(t,n,i,r,e){for(;t.hasNext();){var u=t.next();if(u===os)e.newLine(i);else{var s=r.get(u);if(null==s)continue;e.isPushable(n,s)?e.push(s,!1):this.measure5(t,n,i,r,e,!1)}}},t.measure4=function(t,n,i,r){for(;t.hasNext();){var e=t.next();if(e===os)r.newLine(n);else{var u=i.get(e);if(null==u)continue;r.push(u,!1)}}},t.measure5=function(t,n,i,r,e,u){e.clipped=!0;var s=r.get("...");if(null!=s){for(;!e.isPushable(n,s)&&e.pop(););e.isPushable(n,s)&&e.push(s,!1)}if(u)t.close();else for(;t.hasNext();)if(t.next()===os){e.newLine(i);break}},t.isWrappable2=function(t,n){if(t.countPerLine<=0)return!1;var i=t.characters[t.count-1].character.type,r=n.type;return i&ve.SPACE?!(r&ve.SPACE||i&ve.NON_BREAKING):!(r&ve.SPACE||i&ve.NON_BREAKING&&r&ve.NON_BREAKING)},t.advance=function(t,n,i){return n.done||t<=n.value.end?n:n=i.next()},t.isWrappable1=function(t,n){if(n.done)return!1;var i=n.value;return i.start===t||i.end===t},t.newLineBreaker=function(t){return"css-line-break"in window?window["css-line-break"].LineBreaker(t,{lineBreak:"strict",wordBreak:"normal"}):null},t.RESULT=null,t}(),cs=function(t){function n(){var n=t.call(this,new Float32Array(64),new Float32Array(64),new Uint16Array(48))||this;return n.width=0,n.height=0,n.clipped=!1,n}return B(n,t),n.prototype.update=function(t,n,i){var r=this.getBuffer("aVertexPosition"),e=this.getBuffer("aTextureCoord"),u=this.getIndex(),s=as.measure(t,n,i),h=Math.ceil(s.count/8)<<3,o=h<<3;r.data.length<o&&(r.data=new Float32Array(o),e.data=new Float32Array(o));var a=6*h;u.data.length<a&&(u.data=new Uint16Array(a));var c=r.data,f=e.data,l=u.data;if(null!=n){for(var v=s.count,b=s.characters,d=0;d<v;++d){var g=b[d],m=g.x,w=g.y,O=g.character,p=n.width,D=n.height;this.writeCharacter(c,f,l,d,m,w,O,p,D)}d=v;for(var E=c.length>>3;d<E;++d)this.writeCharacterEmpty(c,f,l,d);this.width=s.width,this.height=s.height,this.clipped=s.clipped}else{for(d=0,E=c.length>>3;d<E;++d)this.writeCharacterEmpty(c,f,l,d);this.width=0,this.height=0,this.clipped=!1}r.update(),e.update(),u.update()},n.prototype.writeCharacter=function(t,n,i,r,e,u,s,h,o){var a=s.x,c=s.y,f=s.width,l=s.height,v=e+(a-s.origin.x),b=u,d=v+f,g=b+l,m=r<<3;t[m+0]=v,t[m+1]=b,t[m+2]=d,t[m+3]=b,t[m+4]=d,t[m+5]=g,t[m+6]=v,t[m+7]=g;var w=a/h,O=c/o,p=(a+f)/h,D=(c+l)/o;n[m+0]=w,n[m+1]=O,n[m+2]=p,n[m+3]=O,n[m+4]=p,n[m+5]=D,n[m+6]=w,n[m+7]=D;var E=6*r,M=r<<2;i[E+0]=M+0,i[E+1]=M+1,i[E+2]=M+3,i[E+3]=M+1,i[E+4]=M+2,i[E+5]=M+3},n.prototype.writeCharacterEmpty=function(t,n,i,r){var e=r<<3;t[e+0]=0,t[e+1]=0,t[e+2]=0,t[e+3]=0,t[e+4]=0,t[e+5]=0,t[e+6]=0,t[e+7]=0,n[e+0]=0,n[e+1]=0,n[e+2]=0,n[e+3]=0,n[e+4]=0,n[e+5]=0,n[e+6]=0,n[e+7]=0;var u=6*r,s=r<<2;i[u+0]=s+0,i[u+1]=s+1,i[u+2]=s+3,i[u+3]=s+1,i[u+4]=s+2,i[u+5]=s+3},n}(t.MeshGeometry),fs=function(){function t(t,n){var i,r,e,u,s,h,o,a,c,f;this.R=0,this.Is=-1;var l=this.getDefaultOptions();t?(this.Tt=null!==(i=t.align)&&void 0!==i?i:l.align,this.Cs=null!==(r=t.fontFamily)&&void 0!==r?r:l.fontFamily,this.As=null!==(e=t.fontSize)&&void 0!==e?e:l.fontSize,this.Rs=null!==(u=t.fontStyle)&&void 0!==u?u:l.fontStyle,this.Ls=null!==(s=t.fontVariant)&&void 0!==s?s:l.fontVariant,this.ys=null!==(h=t.fontWeight)&&void 0!==h?h:l.fontWeight,this.C=null!==(o=t.fill)&&void 0!==o?o:l.fill,this.Jt=null!==(a=t.clipping)&&void 0!==a?a:l.clipping,this.ks=Di(null!==(c=t.wordWrap)&&void 0!==c?c:l.wordWrap,hs),this.xs=null!==(f=t.lineHeight)&&void 0!==f?f:l.lineHeight):(this.Tt=l.align,this.Cs=l.fontFamily,this.As=l.fontSize,this.Rs=l.fontStyle,this.Ls=l.fontVariant,this.ys=l.fontWeight,this.C=l.fill,this.Jt=l.clipping,this.ks=Di(l.wordWrap,hs),this.xs=l.lineHeight),this.Bs=-1,this._s="",this.Ps="",this.Us=0,this.Z=n}return t.prototype.getDefaultOptions=function(){var n=t.DEFAULT_OPTIONS;return null==n&&(n=this.newDefaultOptions(),t.DEFAULT_OPTIONS=n),n},t.prototype.newDefaultOptions=function(){var t=K.getInstance().get("DBase");return{align:"left",fontFamily:t.getFontFamilly(),fontSize:t.getFontSize(),fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",fill:t.getColor(new ct),clipping:!0,wordWrap:hs.NONE,lineHeight:t.getLineHeight()}},Object.defineProperty(t.prototype,"id",{get:function(){return this.R},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"idApproved",{get:function(){return this.Is},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontId",{get:function(){return this.update(),this._s},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontIdApproved",{get:function(){return this.Ps},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fill",{get:function(){return this.C},set:function(t){this.C!==t&&(this.C=t,this.onChange())},enumerable:!1,configurable:!0}),t.prototype.onChange=function(){this.R+=1,this.Z()},Object.defineProperty(t.prototype,"fillApproved",{get:function(){return this.Us},enumerable:!1,configurable:!0}),t.prototype.approve=function(){this.update(),this.Is=this.R,this.Ps=this._s,this.Us=this.C},Object.defineProperty(t.prototype,"fontFamily",{get:function(){return this.Cs},set:function(t){this.Cs!==t&&(this.Cs=t,this.onChange())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontSize",{get:function(){return this.As},set:function(t){this.As!==t&&(this.As=t,this.onChange())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontStyle",{get:function(){return this.Rs},set:function(t){this.Rs!==t&&(this.Rs=t,this.onChange())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontVariant",{get:function(){return this.Ls},set:function(t){this.Ls!==t&&(this.Ls=t,this.onChange())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontWeight",{get:function(){return this.ys},set:function(t){this.ys!==t&&(this.ys=t,this.onChange())},enumerable:!1,configurable:!0}),t.prototype.update=function(){this.Bs!==this.R&&(this.Bs=this.R,this._s=this.newFontId())},t.prototype.newFontId=function(){return"".concat(this.Rs," ").concat(this.Ls," ").concat(this.ys," ").concat(this.As,"px ").concat(this.Cs)},Object.defineProperty(t.prototype,"clipping",{get:function(){return this.Jt},set:function(t){this.Jt!==t&&(this.Jt=t,this.onChange())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"wordWrap",{get:function(){return this.ks},set:function(t){this.ks!==t&&(this.ks=t,this.onChange())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lineHeight",{get:function(){return this.xs},set:function(t){this.xs!==t&&(this.xs=t,this.onChange())},enumerable:!1,configurable:!0}),t}(),ls=function(n){function i(i,r){var e=n.call(this,new cs,new t.MeshMaterial(t.Texture.EMPTY))||this;return e.B=new fs(r,(function(){e.vn=!0,e.Fs=!0,e.ou=null,e.Gs()})),e.Ns=i,e.Hs="",e.vn=!0,e.Fs=!0,e.ou=null,e.zs=0,e.St=0,e.cn=0,e.Jt={enable:!1,wordWrap:hs.NONE,width:0,height:0,lineHeight:0,delta:{width:0,height:0}},e.Gs(),e}return B(i,n),i.prototype.Gs=function(){var t=rt.getLayer(this);if(t){var n=this.B;if(this.vn){this.vn=!1;var i=this.Ns,r=this.Hs;this.Hs=i;var e=n.fontId,u=n.fontIdApproved,s=n.fontSize,h=n.fill,o=n.fillApproved;n.approve();var a=t.getDynamicFontAtlases();i===r&&e===u&&h===o||(a.add(e,s,h,i),a.remove(u,o,r))}}},Object.defineProperty(i.prototype,"text",{get:function(){return this.Ns},set:function(t){this.Ns!==t&&(this.Ns=t,this.vn=!0,this.Fs=!0,this.Gs())},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"width",{get:function(){return this.update(),Math.abs(this.scale.x)*this.geometry.width},set:function(t){this.update();var n=this.geometry.width;if(1e-4<n){var i=t/n;this.scale.x=0<=this.scale.x?+i:-i}},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"height",{get:function(){return this.update(),Math.abs(this.scale.y)*this.geometry.height},set:function(t){this.update();var n=this.geometry.height;if(1e-4<n){var i=t/n;this.scale.y=0<=this.scale.y?+i:-i}},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"clipped",{get:function(){return this.geometry.clipped},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"style",{get:function(){return this.B},enumerable:!1,configurable:!0}),i.prototype.update=function(){this.Gs();var t=this.ou;if(null==t){var n=rt.getLayer(this);if(n){var i=this.B;null!=(t=n.getDynamicFontAtlases().get(i.fontId,i.fill))&&(this.zs=t.getRevisionUpdate(),this.ou=t,this.texture=t.texture,this.Fs=!0)}}else{var r=t.getRevisionUpdate();r!==this.zs&&(this.zs=r,this.Fs=!0)}var e=this.B,u=this.Jt;this.updateClipping(e,u)&&(this.Fs=!0),this.Fs&&(this.Fs=!1,this.geometry.update(this.Ns,t,u))},i.prototype.updateClipping=function(t,n){var i=!1,r=t.clipping;n.enable!==r&&(n.enable=r,i=!0);var e=t.wordWrap;n.wordWrap!==e&&(n.wordWrap=e,i=!0);var u=t.lineHeight;if(n.lineHeight!==u&&(n.lineHeight=u,i=!0),r||e){var s=this.parent;if(s instanceof Qi){var h=s.width-s.padding.getLeft()-s.padding.getRight()-n.delta.width;n.width!==h&&(n.width=h,i=!0);var o=s.height-s.padding.getTop()-s.padding.getBottom()-n.delta.height;n.height!==o&&(n.height=o,i=!0)}}return i},i.prototype.setClippingDelta=function(t,n){var i=this.Jt.delta;i.width=t,i.height=n},i.prototype._calculateBounds=function(){this.update(),n.prototype._calculateBounds.call(this)},i.prototype._render=function(t){this.update(),n.prototype._render.call(this,t)},i}(t.Mesh),vs=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.init=function(n){var i,r,e,u;t.prototype.init.call(this,n);var s=this.theme;this.Vs=null!==(r=null===(i=null==n?void 0:n.text)||void 0===i?void 0:i.value)&&void 0!==r?r:s.newTextValue(),this.Ws=this.computeTextValue();var h=null==n?void 0:n.text;this.Xs=null==h?void 0:h.color,this.Ks=null==h?void 0:h.alpha,this.Ys=function(t,n,i){var r,e,u,s,h,o,a,c,f,l,v=null===(r=null==n?void 0:n.text)||void 0===r?void 0:r.style;return null!=v?{fill:null!==(e=v.fill)&&void 0!==e?e:t.getColor(i),fontSize:null!==(u=v.fontSize)&&void 0!==u?u:t.getFontSize(),fontFamily:null!==(s=v.fontFamily)&&void 0!==s?s:t.getFontFamilly(),fontWeight:null!==(h=v.fontWeight)&&void 0!==h?h:t.getFontWeight(),fontStyle:null!==(o=v.fontStyle)&&void 0!==o?o:t.getFontStyle(),fontVariant:null!==(a=v.fontVariant)&&void 0!==a?a:t.getFontVariant(),clipping:null!==(c=v.clipping)&&void 0!==c?c:t.getTextStyleClipping(),wordWrap:null!==(f=v.wordWrap)&&void 0!==f?f:t.getTextStyleWordWrap(),lineHeight:null!==(l=v.lineHeight)&&void 0!==l?l:t.getLineHeight()}:{fill:t.getColor(i),fontSize:t.getFontSize(),fontFamily:t.getFontFamilly(),fontWeight:t.getFontWeight(),fontStyle:t.getFontStyle(),fontVariant:t.getFontVariant(),clipping:t.getTextStyleClipping(),wordWrap:t.getTextStyleWordWrap(),lineHeight:t.getLineHeight()}}(s,n,this.state),this.ps=function(t,n){var i,r,e,u=null===(i=null==n?void 0:n.text)||void 0===i?void 0:i.align;return{vertical:Di(null!==(r=null==u?void 0:u.vertical)&&void 0!==r?r:t.getTextAlignVertical(),Xu),horizontal:Di(null!==(e=null==u?void 0:u.horizontal)&&void 0!==e?e:t.getTextAlignHorizontal(),Wu)}}(s,n),this.Js=null!==(e=null==h?void 0:h.formatter)&&void 0!==e?e:s.getTextFormatter(),this.Zs=!0,this.qs=null!==(u=null==n?void 0:n.mask)&&void 0!==u?u:s.isOverflowMaskEnabled(),this.onTextChange(),this.createOrUpdateText()},Object.defineProperty(n.prototype,"text",{get:function(){return this.Vs},set:function(t){this.Vs!==t&&(this.Vs=t,this.updateTextValue())},enumerable:!1,configurable:!0}),n.prototype.onTextChange=function(){},n.prototype.computeTextValue=function(){var t=this.Vs;if(void 0!==t){if(!ot(t))return t;var n=t(this.state);if(void 0!==n)return n}return this.theme.getTextValue(this.state)},n.prototype.createOrUpdateText=function(){var t=this.Ws;if(void 0!==t){var n=this.Js(t,this),i=this.Ns;if(null==i){if(0<n.length){var r=this.createText(n);r.visible=this.Zs,this.Ns=r,this.addChild(r),this.updateTextPosition(r);var e=this.getOverflowMask();e&&(r.mask=e),this.toDirty(),rt.update(this)}}else i.text=n,this.toDirty(),rt.update(this)}},n.prototype.createText=function(t){return new ls(t,this.Ys)},n.prototype.getOverflowMask=function(){return this.qs?(null==this.er&&(this.er=new es(this),this.Gn.add(this.er),this.toDirty()),this.er):null},n.prototype.updateTextPosition=function(t){var n=this.ps,i=this.zn,r=this.Bn,e=0,u=i.getLeft(),s=n.horizontal;if(r.width.isOn||s===Wu.LEFT)e=u;else{var h=this.width,o=t.width,a=i.getRight();e=s===Wu.CENTER?u+.5*(h-u-a-o):h-o-a}var c=0,f=i.getTop(),l=n.vertical;if(r.height.isOn||l===Xu.TOP)c=f;else{var v=this.height,b=t.height,d=i.getBottom();c=l===Xu.MIDDLE?f+.5*(v-f-d-b):v-b-d}t.position.set(e,c)},n.prototype.getTextColor=function(t,n){var i=this.Xs;if(void 0!==i){if(!ot(i))return i;var r=i(n);if(void 0!==r)return r}return t.getColor(n)},n.prototype.getTextAlpha=function(t,n){var i=this.Ks;if(void 0!==i){if(!ot(i))return i;var r=i(n);if(void 0!==r)return r}return t.getAlpha(n)},n.prototype.updateTextColor=function(t){var n=this.theme,i=this.state;t.style.fill=this.getTextColor(n,i),t.alpha=this.getTextAlpha(n,i)},n.prototype.updateTextValue=function(){var t=this.computeTextValue();this.Ws!==t&&(this.Ws=t,this.onTextChange(),this.createOrUpdateText())},n.prototype.updateText=function(){var t=this.Ns;t&&(this.updateTextValue(),this.updateTextPosition(t),this.updateTextColor(t))},n.prototype.showText=function(){var t=this.Ns;t&&(t.visible=!0),this.Zs=!0},n.prototype.hideText=function(){var t=this.Ns;t&&(t.visible=!1),this.Zs=!1},n.prototype.onReflow=function(){t.prototype.onReflow.call(this),this.updateText()},n.prototype.isRefitable=function(n){return t.prototype.isRefitable.call(this,n)||null!=n&&n===this.Ns},n.prototype.applyTitle=function(){var n=this.Ns;if(this.Vn.length<=0&&n&&"clipped"in n&&n.clipped){var i=rt.getLayer(this);i&&(i.view.title=n.text)}else t.prototype.applyTitle.call(this)},n.prototype.getType=function(){return"DTextBase"},n.prototype.destroy=function(){var n=this.Ns;n&&(this.Ns=null,n.destroy());var i=this.er;i&&(this.er=null,i.destroy()),t.prototype.destroy.call(this)},n}(Qi),bs=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.init=function(n){this.Qs=this.newImages(this.theme,n),t.prototype.init.call(this,n)},n.prototype.newImages=function(t,n){var i=[];return i.push(this.newImage(t,this.toImageOptions(t,null==n?void 0:n.image))),function(t){return!!t.getSecondaryImageSource}(t)&&i.push(this.newImage(new zu(t))),function(t){return!!t.getTertiaryImageSource}(t)&&i.push(this.newImage(new Vu(t))),i},n.prototype.toImageOptions=function(t,n){return n},n.prototype.newImage=function(t,n){return new Yu(this,t,this.ps,n)},Object.defineProperty(n.prototype,"image",{get:function(){return this.Qs[0].source},set:function(t){var n=this.Qs[0];n.source=t,n.updateSource()},enumerable:!1,configurable:!0}),n.prototype.onStateChange=function(n,i){t.prototype.onStateChange.call(this,n,i);for(var r=this.Qs,e=0,u=r.length;e<u;++e)r[e].onStateChange(n,i)},n.prototype.updateText=function(){this.updateTextValue(),this.updateTextAndImage()},n.prototype.updateTextAndImage=function(){for(var t,i=this.Qs,r=null!==(t=n.LAYOUTER)&&void 0!==t?t:n.LAYOUTER=new rs,e=0,u=i.length;e<u;++e){var s=i[e];s.updateSource(),s.updateTint(),s.updateBound(),r.add(s)}var h=this.Ns;null!=h?(this.updateTextColor(h),r.set(h)):r.set(null);var o=this.Bn;r.execute(this.zn,this.ps,o.width.isOn?null:this.width,o.height.isOn?null:this.height),r.clear()},n.prototype.isRefitable=function(n){if(t.prototype.isRefitable.call(this,n))return!0;for(var i=this.Qs,r=0,e=i.length;r<e;++r)if(i[r].isRefitable(n))return!0;return!1},n.prototype.getType=function(){return"DImageBase"},n.prototype.destroy=function(){for(var n=this.Qs,i=0,r=n.length;i<r;++i)n[i].destroy();t.prototype.destroy.call(this)},n}(vs),ds=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.init=function(n){var i,r,e=this;t.prototype.init.call(this,n);var u=this.theme;this.$s=null!==(i=null==n?void 0:n.toggle)&&void 0!==i?i:u.isToggle(),this.th=Di(null!==(r=null==n?void 0:n.when)&&void 0!==r?r:u.getWhen(),Hu),this.on(Ki.tap,(function(t){e.onClick(t)})),this.initOnPress();var s=null==n?void 0:n.group;s&&s.add(this)},n.prototype.onShortcut=function(n){this.state.isActionable&&this.activate(n),t.prototype.onShortcut.call(this,n)},Object.defineProperty(n.prototype,"isToggle",{get:function(){return!!this.$s},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isGrouped",{get:function(){return!!this.nh},set:function(t){this.nh=t},enumerable:!1,configurable:!0}),n.prototype.initOnPress=function(){var t=this,n=null,i=function(){t.state.isPressed=!1,null!=n&&(n.off(Ki.up,i),n.off(Ki.upoutside,i),n.off(Ki.cancel,i),n=null)};this.on(Ki.down,(function(){t.state.isPressed=!0;var r=rt.getLayer(t);r&&((n=r.renderer.plugins.interaction).on(Ki.up,i),n.on(Ki.upoutside,i),n.on(Ki.cancel,i))}))},n.prototype.getType=function(){return"DButton"},n.prototype.onClick=function(t){this.th===Hu.CLICKED&&this.state.isActionable&&this.activate(t)},n.prototype.onDblClick=function(n,i){return this.th===Hu.DOUBLE_CLICKED&&this.state.isActionable&&this.activate(n),t.prototype.onDblClick.call(this,n,i)},n.prototype.activate=function(t){this.$s?this.nh&&this.state.isActive||(this.onToggleStart(t),this.onToggleEnd(t)):this.onActivate(t)},n.prototype.onActivate=function(t){this.emit("active",this)},n.prototype.onInactivate=function(t){this.emit("inactive",this)},n.prototype.toggle=function(){this.state.isActionable&&this.$s&&(this.onToggleStart(),this.onToggleEnd())},n.prototype.onToggleStart=function(t){this.state.isActive=!this.state.isActive},n.prototype.onToggleEnd=function(t){this.state.isActive?this.onActivate(t):this.onInactivate(t)},n.prototype.onActivateKeyDown=function(t){this.state.isActionable&&(this.$s?this.onToggleStart(t):this.state.isPressed=!0)},n.prototype.onActivateKeyUp=function(t){this.state.isActionable&&(this.$s?this.onToggleEnd(t):(this.state.isPressed&&this.onActivate(t),this.state.isPressed=!1))},n.prototype.onKeyDown=function(n){return Xi.isActivateKey(n)&&this.onActivateKeyDown(n),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyUp=function(n){return Xi.isActivateKey(n)&&this.onActivateKeyUp(n),t.prototype.onKeyUp.call(this,n)},n.prototype.destroy=function(){var n,i;null===(i=null===(n=this.kn)||void 0===n?void 0:n.group)||void 0===i||i.remove(this),t.prototype.destroy.call(this)},n}(bs),gs=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DButton"},n}(ds),ms=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DButtonPrimary"},n}(gs),ws=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DLayoutHorizontal"},n}(Uu),Os=function(t){function n(n,i){var r=t.call(this,i)||this;r.O=n;var e=r.buttonOk,u=r.buttonCancel;return null==e&&null==u||(r.addChild(r.newButtonSpace()),u&&r.addChild(u),e&&r.addChild(e),r.addChild(r.newButtonSpace())),r}return B(n,t),Object.defineProperty(n.prototype,"buttonCancel",{get:function(){var t=this.ih;return void 0===t&&(t=this.newButtonCancel(),this.ih=t),t},enumerable:!1,configurable:!0}),n.prototype.newButtonCancel=function(){var t,n,i=this,r=null===(n=null===(t=this.kn)||void 0===t?void 0:t.button)||void 0===n?void 0:n.cancel;return void 0===r&&(r=this.theme.getButtonCancel()),null!=r?new ms({text:{value:r},on:{active:function(){i.O.cancel()}}}):null},Object.defineProperty(n.prototype,"buttonOk",{get:function(){var t=this.rh;return void 0===t&&(t=this.newButtonOk(),this.rh=t),t},enumerable:!1,configurable:!0}),n.prototype.newButtonOk=function(){var t,n,i=this,r=null===(n=null===(t=this.kn)||void 0===t?void 0:t.button)||void 0===n?void 0:n.ok;return void 0===r&&(r=this.theme.getButtonOk()),null!=r?null!=this.buttonCancel?new gs({text:{value:r},on:{active:function(){i.O.ok()}}}):new ms({text:{value:r},on:{active:function(){i.O.ok()}}}):null},n.prototype.newButtonSpace=function(){return new _u({weight:1})},n.prototype.getType=function(){return"DDialogLayeredFooter"},n}(ws),ps=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DButtonAmbient"},n}(gs),Ds=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DDialogLayeredHeaderButtonClose"},n}(ps),Es=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DDialogLayeredHeaderSeparator"},n}(bs),Ms=function(t){function n(n,i){var r=t.call(this,i)||this;r.O=n;var e=r.separator;e&&r.addChild(e);var u=r.buttonClose;return u&&(r.addChild(u),u.on("active",(function(){r.O.cancel()}))),r}return B(n,t),Object.defineProperty(n.prototype,"buttonClose",{get:function(){var t=this.eh;return void 0===t&&(t=this.newButtonClose(),this.eh=t),t},enumerable:!1,configurable:!0}),n.prototype.newButtonClose=function(){var t,n;return!1!==(null===(n=null===(t=this.kn)||void 0===t?void 0:t.button)||void 0===n?void 0:n.close)?new Ds:null},Object.defineProperty(n.prototype,"separator",{get:function(){var t=this.uh;return void 0===t&&(t=this.newSeparator(),this.uh=t),t},enumerable:!1,configurable:!0}),n.prototype.newSeparator=function(){var t;return!1!==(null===(t=this.kn)||void 0===t?void 0:t.separator)?new Es:null},n.prototype.getType=function(){return"DDialogLayeredHeader"},n}(bs),Ss=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.init=function(n){t.prototype.init.call(this,n),this.addChild(this.layout)},Object.defineProperty(n.prototype,"layout",{get:function(){var t=this.sh;return null==t&&(t=this.newLayout(),this.sh=t),t},enumerable:!1,configurable:!0}),n.prototype.newLayout=function(){return new Fu(this.toLayoutOptions(this.theme,this.kn))},n.prototype.toLayoutOptions=function(t,n){var i,r,e=null!==(r=null!==(i=null==n?void 0:n.layout)&&void 0!==i?i:t.getLayout())&&void 0!==r?r:this.newLayoutOptions(t,n);return void 0===e.children&&(e.children=this.newLayoutChildren(t,n)),e},n.prototype.newLayoutOptions=function(t,n){return{width:"padding",height:"auto",margin:0}},n.prototype.newLayoutChildren=function(t,n){return[this.header,this.content,this.footer]},Object.defineProperty(n.prototype,"header",{get:function(){var t=this.hh;return void 0===t&&(t=this.newHeader(),this.hh=t),t},enumerable:!1,configurable:!0}),n.prototype.newHeader=function(){var t=this.toHeaderOptions(this.theme,this.kn);return null!==t?new Ms(this,t):null},n.prototype.toHeaderOptions=function(t,n){if(n){var i=n.header;if(void 0!==i)return i}return t.getHeader()},Object.defineProperty(n.prototype,"content",{get:function(){var t=this.oh;return null==t&&(t=this.newContent(),this.oh=t),t},enumerable:!1,configurable:!0}),n.prototype.newContent=function(){return new Gu(this.toContentOptions(this.theme,this.kn))},n.prototype.toContentOptions=function(t,n){var i,r,e=null!==(r=null!==(i=null==n?void 0:n.content)&&void 0!==i?i:t.getContent())&&void 0!==r?r:{};return void 0===e.children&&(e.children=this.newContentChildren(t,n)),e},n.prototype.newContentChildren=function(t,n){return[]},Object.defineProperty(n.prototype,"footer",{get:function(){var t=this.ah;return void 0===t&&(t=this.newFooter(),this.ah=t),t},enumerable:!1,configurable:!0}),n.prototype.newFooter=function(){var t=this.toFooterOptions(this.theme,this.kn);return null!==t?new Os(this,t):null},n.prototype.toFooterOptions=function(t,n){if(n){var i=n.footer;if(void 0!==i)return i}return t.getFooter()},n.prototype.findFirstFocusable=function(t){return t.find(this.content,!1,!0,!0)},n.prototype.ok=function(){this.onOk(this.getResolvedValue())},n.prototype.onOk=function(t){this.doResolve(t),this.emit("ok",t,this)},n.prototype.cancel=function(){this.onCancel(this.getRejectReason())},n.prototype.onCancel=function(t){this.doReject(t),this.emit("cancel",t,this)},n.prototype.getRejectReason=function(){},n.prototype.getType=function(){return"DDialogLayered"},n}(xu),Ts=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.newContentChildren=function(n,i){var r=t.prototype.newContentChildren.call(this,n,i);return r.push(this.inputLayout),r},n.prototype.toInputMargin=function(t,n){var i,r;return null!==(r=null===(i=null==n?void 0:n.input)||void 0===i?void 0:i.margin)&&void 0!==r?r:t.getInputMargin()},Object.defineProperty(n.prototype,"inputLayout",{get:function(){var t=this.fh;return null==t&&(t=this.newInputLayout(),this.fh=t),t},enumerable:!1,configurable:!0}),n.prototype.newInputLayout=function(){var t=this.toInputMargin(this.theme,this.kn);return new ws({width:"padding",height:"auto",margin:0,children:[new _u({width:t}),this.input,new _u({width:t})]})},Object.defineProperty(n.prototype,"input",{get:function(){var t=this.lh;if(null==t){var n=this.kn;t=this.newInput(null==n?void 0:n.input),this.lh=t}return t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"value",{get:function(){return this.input.value},set:function(t){this.input.value=t},enumerable:!1,configurable:!0}),n.prototype.getResolvedValue=function(){return this.input.value},n.prototype.getType=function(){return"DDialogInput"},n}(Ss),js=function(t){function n(n){var i=t.call(this)||this;i.bh=[],i.dh=null,i.gh=function(t){i.active=t};var r=null==n?void 0:n.on;if(null!=r)for(var e in r){var u=r[e];u&&i.on(e,u)}return i.emit("init",i),i}return B(n,t),n.prototype.add=function(t){if(this.bh.indexOf(t)<0){this.bh.push(t),t.isGrouped=!0;var n=this.rs;null!=n&&(t.state.isEnabled=n),t.on("active",this.gh),t.state.isActive&&(this.active=t)}},Object.defineProperty(n.prototype,"active",{get:function(){return this.dh},set:function(t){if((null==t||t.isToggle)&&this.dh!==t){var n=this.dh;this.dh=null;for(var i=this.bh,r=0,e=i.length;r<e;++r){var u=i[r];u!==t&&u.isToggle&&u.state.isActive&&u.toggle()}this.emit("active",t,n,this)}},enumerable:!1,configurable:!0}),n.prototype.remove=function(t){var n=this.bh,i=n.indexOf(t);0<=i&&(n.splice(i,1),t.isGrouped=!1,t.off("active",this.gh),this.dh===t&&(this.active=null))},n.prototype.contains=function(t){return 0<=this.bh.indexOf(t)},n.prototype.clear=function(){for(var t=this.bh,n=0,i=t.length;n<i;++n)t[n].isGrouped=!1;t.length=0,this.active=null},n.prototype.size=function(){return this.bh.length},n.prototype.each=function(t){for(var n=this.bh,i=0,r=n.length;i<r&&!1!==t(n[i]);++i);},n.prototype.disable=function(){for(var t=this.bh,n=0,i=t.length;n<i;++n)t[n].state.isDisabled=!0;this.rs=!1},n.prototype.enable=function(){for(var t=this.bh,n=0,i=t.length;n<i;++n)t[n].state.isDisabled=!1;this.rs=!0},n.prototype.destroy=function(){this.clear()},n}(t.utils.EventEmitter),Ns=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DInputBooleanButtonOff"},n}(gs),Is=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DInputBooleanButtonOn"},n}(gs),Cs=function(t){function n(n){var i=t.call(this,n)||this;i.addChild(i.getButtonOff()),i.addChild(i.getButtonOn());var r=null==n?void 0:n.value;return null!=r&&(i.value=r),i.getButtonGroup().on("active",(function(){var t=i.value;i.emit("change",t,!t,i)})),i}return B(n,t),n.prototype.getButtonGroup=function(){var t=this.mh;return null==t&&(t=this.newButtonGroup(),this.mh=t),t},n.prototype.newButtonGroup=function(){return new js},n.prototype.getButtonOn=function(){var t=this.wh;return null==t&&(t=this.newButtonOn(),this.wh=t),t},n.prototype.newButtonOn=function(){return new Is({weight:1,group:this.getButtonGroup()})},n.prototype.getButtonOff=function(){var t=this.Oh;return null==t&&(t=this.newButtonOff(),this.Oh=t),t},n.prototype.newButtonOff=function(){return new Ns({weight:1,group:this.getButtonGroup(),state:ht.ACTIVE})},Object.defineProperty(n.prototype,"value",{get:function(){return this.getButtonOn().state.isActive},set:function(t){this.value!==t&&(t?this.getButtonOn().activate():this.getButtonOff().activate())},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DInputBoolean"},n}(ws),As=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.newInput=function(t){return new Cs(this.toInputOptions(t))},n.prototype.toInputOptions=function(t){return t?(void 0===t.weight&&(t.weight=1),t):{weight:1}},n.prototype.getType=function(){return"DDialogInputBoolean"},n}(Ts),Rs=function(t){function n(n){var i=t.call(this,n,$t.NONE)||this;return i.target=rn.ofStringOrNull(n.target),i.onInputAction=n.onInputAction,i.isOpened=!1,i.step=rn.ofNumberOrNull(n.step),i.min=rn.ofNumberOrNull(n.min),i.max=rn.ofNumberOrNull(n.max),i}return B(n,t),n.prototype.execute=function(t,n,i){var r=this;if(!this.isOpened&&this.condition(t,i,nn)){var e=this.target(t,i,nn);if(null!=e){var u=this.initial(t,i,nn),s=this.step(t,i,nn),h=this.min(t,i,nn),o=this.max(t,i,nn);this.isOpened=!0,setTimeout((function(){r.open(t,e,u,s,h,o).then((function(n){r.isOpened=!1,ou.execute(t,r.onInputAction,e,n,i)}),(function(){r.isOpened=!1}))}),0)}}},n}(un),Ls=function(t){function n(n){var i=t.call(this,n)||this;return i.initial=rn.ofBooleanOrFalse(n.initial),i}return B(n,t),n.prototype.open=function(t,i,r,e,u,s){var h=n.DIALOG;if(null==h)h=new As({header:{text:{value:i},button:{close:!1}}}),n.DIALOG=h;else{var o=h.header;o&&(o.text=i)}return h.value=r,h.open(t)},n}(Rs),ys=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getUtil=function(){var t=this.ns;return null==t&&(t=this.newUtil(),this.ns=t),t},n.prototype.newUtil=function(){return new Je(this,this.newOperation(),this.theme,this.kn)},n.prototype.newOperation=function(){var t=this;return{getElementRect:function(n,i,r){return t.getElementRect(n,i,r)},getElementMatrix:function(){return null},getClipperRect:function(n,i,r){return t.getClipperRect(n,i,r)},getPadding:function(){return t.padding},containsPoint:function(n){return t.containsPoint(n)},onStart:function(){},onCancel:function(){},onEnd:function(){}}},Object.defineProperty(n.prototype,"element",{get:function(){return this.getUtil().element},enumerable:!1,configurable:!0}),n.prototype.onDownThis=function(n){var i=this.getUtil();i.onDowning(n),t.prototype.onDownThis.call(this,n),i.onDown(n)},n.prototype.onDblClick=function(n,i){return this.getUtil().onDblClick(n,i),t.prototype.onDblClick.call(this,n,i)},n.prototype.onFocus=function(){t.prototype.onFocus.call(this),this.getUtil().onFocus()},n.prototype.onBlur=function(){t.prototype.onBlur.call(this),this.getUtil().onBlur()},n.prototype.start=function(){this.getUtil().start()},n.prototype.render=function(n){this.getUtil().onRender(n),t.prototype.render.call(this,n)},n.prototype.getElementRect=function(t,n,i){return n.set(0,0),this.toGlobal(n,n,!1),i.x=n.x,i.y=n.y,n.set(this.width,this.height),this.toGlobal(n,n,!0),i.width=n.x-i.x,i.height=n.y-i.y,i},n.prototype.getClipperRect=function(t,n,i){return Je.getClipperRect(this.parent,this,t,n,i)},n.prototype.cancel=function(){this.getUtil().cancel()},n.prototype.end=function(){this.getUtil().end()},n.prototype.select=function(){return this.getUtil().select(),this},n.prototype.onActivateKeyDown=function(t){this.state.isActionable&&(this.state.isPressed=!0)},n.prototype.onActivateKeyUp=function(t){this.state.isActionable&&(this.state.isPressed&&this.start(),this.state.isPressed=!1)},n.prototype.onKeyDown=function(n){return Xi.isActivateKey(n)&&this.onActivateKeyDown(n),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyUp=function(n){return Xi.isActivateKey(n)&&this.onActivateKeyUp(n),t.prototype.onKeyUp.call(this,n)},n.prototype.getType=function(){return"DHtmlElement"},n}(bs),ks=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.newOperation=function(){var t=this;return{getElementRect:function(n,i,r){return t.getElementRect(n,i,r)},getElementMatrix:function(){return null},getClipperRect:function(n,i,r){return t.getClipperRect(n,i,r)},getPadding:function(){return t.padding},containsPoint:function(n){return t.containsPoint(n)},onStart:function(){t.hideText()},onCancel:function(){t.showText()},onEnd:function(){},getValue:function(){return t.Ws},onValueInput:function(n){t.onValueInput(n)},onValueChange:function(n,i){t.text=n,t.onValueChange(n,i)},onEnter:function(){t.onEnter()},applyTitle:function(){t.applyTitle()}}},Object.defineProperty(n.prototype,"value",{get:function(){return this.Ws},set:function(t){this.text=t},enumerable:!1,configurable:!0}),n.prototype.onTextChange=function(){t.prototype.onTextChange.call(this),this.validate()},n.prototype.onValueChange=function(t,n){this.emit("change",t,n,this)},n.prototype.onValueInput=function(t){this.emit("input",t,this)},n.prototype.onEnter=function(){this.emit("enter",this)},n.prototype.validate=function(){return this.getUtil().validate()},n.prototype.applyTitle=function(){this.getUtil().applyTitle()||t.prototype.applyTitle.call(this)},n.prototype.getType=function(){return"DInput"},n}(ys),xs=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DInputInput"},n}(ks),Bs=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.newUtil=function(){return new su(this,this.newOperation(),this.theme,this.kn)},Object.defineProperty(n.prototype,"step",{get:function(){return this.getUtil().step},set:function(t){this.getUtil().step=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"min",{get:function(){return this.getUtil().min},set:function(t){this.getUtil().min=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"max",{get:function(){return this.getUtil().max},set:function(t){this.getUtil().max=t},enumerable:!1,configurable:!0}),n}(xs),_s=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DInputInteger"},n}(Bs),Ps=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.newInput=function(t){var n=this,i=new _s(this.toInputOptions(t));return i.on("enter",(function(){n.ok()})),i},n.prototype.toInputOptions=function(t){return t?(void 0===t.weight&&(t.weight=1),t):{weight:1}},n.prototype.getType=function(){return"DDialogInputInteger"},n}(Ts),Us=function(t){function n(n){var i=t.call(this,n)||this;return i.initial=rn.ofNumber(n.initial),i}return B(n,t),n.prototype.open=function(t,i,r,e,u,s){var h=n.DIALOG;if(null==h)h=new Ps({header:{text:{value:i},button:{close:!1}},input:{step:e,min:u,max:s,text:{value:r}}}),n.DIALOG=h;else{var o=h.header;o&&(o.text=i);var a=h.input;a.step=e,a.min=u,a.max=s,h.value=r}return h.open(t)},n}(Rs),Fs=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DInputReal"},n}(Bs),Gs=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.newInput=function(t){var n=this,i=new Fs(this.toInputOptions(t));return i.on("enter",(function(){n.ok()})),i},n.prototype.toInputOptions=function(t){return t?(void 0===t.weight&&(t.weight=1),t):{weight:1}},n.prototype.getType=function(){return"DDialogInputReal"},n}(Ts),Hs=function(t){function n(n){var i=t.call(this,n)||this;return i.initial=rn.ofNumber(n.initial),i}return B(n,t),n.prototype.open=function(t,i,r,e,u,s){var h=n.DIALOG;if(null==h)h=new Gs({header:{text:{value:i},button:{close:!1}},input:{step:e,min:u,max:s,text:{value:r}}}),n.DIALOG=h;else{var o=h.header;o&&(o.text=i);var a=h.input;a.step=e,a.min=u,a.max=s,h.value=r}return h.open(t)},n}(Rs),zs=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.newUtil=function(){return new bu(this,this.newOperation(),this.theme,this.kn)},n.prototype.getType=function(){return"DInputText"},n}(xs),Vs=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.newInput=function(t){var n=this,i=new zs(this.toInputOptions(t));return i.on("enter",(function(){n.ok()})),i},n.prototype.toInputOptions=function(t){return t?(void 0===t.weight&&(t.weight=1),t):{weight:1}},n.prototype.getType=function(){return"DDialogInputText"},n}(Ts),Ws=function(t){function n(n){var i=t.call(this,n)||this;return i.initial=rn.ofString(n.initial),i}return B(n,t),n.prototype.open=function(t,i,r,e,u,s){var h=n.DIALOG;if(null==h)h=new Vs({header:{text:{value:i},button:{close:!1}}}),n.DIALOG=h;else{var o=h.header;o&&(o.text=i)}return h.value=r,h.open(t)},n}(Rs),Xs=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DDialogFittedContent"},n}(Gu),Ks=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.newLayoutOptions=function(t,n){return{width:"auto",height:"auto",margin:0}},n.prototype.newContent=function(){return new Xs(this.toContentOptions(this.theme,this.kn))},n.prototype.getType=function(){return"DDialogFitted"},n}(Ss),Ys=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DPickerDatetimeButtonBack"},n}(ps),Js=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DPickerDatetimeButtonDate"},n}(ps),Zs=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DPickerDatetimeButtonNext"},n}(ps),qs=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DText"},n}(vs),Qs=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DPickerDatetimeLabel"},n}(qs),$s=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DPickerDatetimeLabelDate"},n}(qs),th=function(t){function n(n){var i=t.call(this,n)||this;return i.renderable=!1,i}return B(n,t),n.prototype.getType=function(){return"DPickerDatetimeSpace"},n}(Qi),nh={NONE:0,DATE:1,HOURS:2,MINUTES:4,SECONDS:8,TIME:14,ALL:15},ih=function(){function t(){}return t.from=function(t,n){var i=null==n?void 0:n.mask;if(null==i){if(at(t)){var r=K.getInstance().get(t);if(null!=r)return r.getMask()}else if(null!=t)return t.getMask();return nh.NONE}if(at(i))return nh[i];if(mn(i))return i;for(var e=nh.NONE,u=0,s=i.length;u<s;++u)e|=nh[i[u]];return e},t}(),rh=function(){function t(t,n){var i,r;this.ph=null!==(i=null==t?void 0:t.date)&&void 0!==i?i:null,this.Dh=null!==(r=null==t?void 0:t.inclusive)&&void 0!==r&&r,this.Z=n}return Object.defineProperty(t.prototype,"date",{get:function(){return this.ph},set:function(t){this.ph!==t&&(this.ph=t,this.Z())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inclusive",{get:function(){return this.Dh},set:function(t){this.Dh!==t&&(this.Dh=t,this.Z())},enumerable:!1,configurable:!0}),t}(),eh=function(){function t(t){this.O=t}return t.prototype.min=function(t){var n=this.O,i=n.lower,r=i.date,e=n.constant;if(null!=r){var u=n.mask;if(u&nh.DATE){if(r.getFullYear()<t.getFullYear())return e.hour.min;if(r.getMonth()<t.getMonth())return e.hour.min;if(r.getDate()<t.getDate())return e.hour.min}var s=r.getHours();return i.inclusive||u&nh.SECONDS&&r.getSeconds()<e.second.max||u&nh.MINUTES&&r.getMinutes()<e.minute.max?s:s+1}return e.hour.min},t.prototype.max=function(t){var n=this.O,i=n.upper,r=i.date,e=n.constant;if(null!=r){var u=n.mask;if(u&nh.DATE){if(t.getFullYear()<r.getFullYear())return e.hour.max;if(t.getMonth()<r.getMonth())return e.hour.max;if(t.getDate()<r.getDate())return e.hour.max}var s=r.getHours();return i.inclusive||u&nh.SECONDS&&e.second.min<r.getSeconds()||u&nh.MINUTES&&e.minute.min<r.getMinutes()?s:s-1}return e.hour.max},t}(),uh=function(){function t(t){this.O=t}return t.prototype.min=function(t){var n=this.O,i=n.lower,r=i.date,e=n.constant;if(null!=r){var u=n.mask;if(u&nh.DATE){if(r.getFullYear()<t.getFullYear())return e.minute.min;if(r.getMonth()<t.getMonth())return e.minute.min;if(r.getDate()<t.getDate())return e.minute.min}if(u&nh.HOURS&&r.getHours()<t.getHours())return e.minute.min;var s=r.getMinutes();return i.inclusive||u&nh.SECONDS&&r.getSeconds()<e.second.max?s:s+1}return e.minute.min},t.prototype.max=function(t){var n=this.O,i=n.upper,r=i.date,e=n.constant;if(null!=r){var u=n.mask;if(u&nh.DATE){if(t.getFullYear()<r.getFullYear())return e.minute.max;if(t.getMonth()<r.getMonth())return e.minute.max;if(t.getDate()<r.getDate())return e.minute.max}if(u&nh.HOURS&&t.getHours()<r.getHours())return e.minute.max;var s=r.getMinutes();return i.inclusive||u&nh.SECONDS&&e.second.min<r.getSeconds()?s:s-1}return e.minute.max},t}(),sh=function(){function t(t){this.O=t}return t.prototype.min=function(t){var n=this.O,i=n.lower,r=i.date,e=n.constant;if(null!=r){var u=n.mask;if(u&nh.DATE){if(r.getFullYear()<t.getFullYear())return e.second.min;if(r.getMonth()<t.getMonth())return e.second.min;if(r.getDate()<t.getDate())return e.second.min}return u&nh.HOURS&&r.getHours()<t.getHours()||u&nh.MINUTES&&r.getMinutes()<t.getMinutes()?e.second.min:r.getSeconds()+(i.inclusive?0:1)}return e.second.min},t.prototype.max=function(t){var n=this.O,i=n.upper,r=i.date,e=n.constant;if(null!=r){var u=n.mask;if(u&nh.DATE){if(t.getFullYear()<r.getFullYear())return e.second.max;if(t.getMonth()<r.getMonth())return e.second.max;if(t.getDate()<r.getDate())return e.second.max}return u&nh.HOURS&&t.getHours()<r.getHours()||u&nh.MINUTES&&t.getMinutes()<r.getMinutes()?e.second.max:r.getSeconds()-(i.inclusive?0:1)}return e.second.max},t}(),hh=function(){function t(t,n){this.constant=this.newConstant(),this.lower=new rh(t&&t.lower,n),this.upper=new rh(t&&t.upper,n),this.mask=nh.ALL,this.hours=new eh(this),this.minutes=new uh(this),this.seconds=new sh(this)}return t.prototype.newConstant=function(){return{second:{min:0,max:59},minute:{min:0,max:59},hour:{min:0,max:23}}},t.prototype.adjust=function(t){var n=this.test(t);if(n<0){var i=this.lower,r=i.date;if(r)return t.setTime(r.getTime()),i.inclusive||((e=this.mask)&nh.SECONDS?t.setSeconds(r.getSeconds()+1):e&nh.MINUTES?t.setMinutes(r.getMinutes()+1):e&nh.HOURS?t.setHours(r.getHours()+1):e&nh.DATE&&t.setDate(r.getDate()+1)),!0}else if(0<n){var e,u=this.upper,s=u.date;if(s)return t.setTime(s.getTime()),u.inclusive||((e=this.mask)&nh.SECONDS?t.setSeconds(s.getSeconds()-1):e&nh.MINUTES?t.setMinutes(s.getMinutes()-1):e&nh.HOURS?t.setHours(s.getHours()-1):e&nh.DATE&&t.setDate(s.getDate()-1)),!0}return!1},t.prototype.compare=function(t,n){var i=this.mask;if(i&nh.DATE){var r,e,u,s,h=t.getFullYear(),o=n.getFullYear();if(h!==o)return h<o?-1:1;if((r=t.getMonth())!==(e=n.getMonth()))return r<e?-1:1;if((u=t.getDate())!==(s=n.getDate()))return u<s?-1:1}if(i&nh.HOURS){var a=t.getHours(),c=n.getHours();if(a!==c)return a<c?-1:1}return i&nh.MINUTES&&(r=t.getMinutes())!==(e=n.getMinutes())?r<e?-1:1:i&nh.SECONDS&&(u=t.getSeconds())!==(s=n.getSeconds())?u<s?-1:1:0},t.prototype.test=function(t){var n=this.lower,i=n.date;if(null!=i){var r=this.compare(i,t);return n.inclusive?r<=0?0:-1:r<0?0:-1}var e=this.upper,u=e.date;return null!=u?(r=this.compare(t,u),e.inclusive?r<=0?0:1:r<0?0:1):0},t.prototype.contains=function(t){return 0===this.test(t)},t}(),oh=function(t,n,i){if(t){var r=t.date,e=t.inclusive;return{date:void 0!==r?r:n,inclusive:void 0!==e?e:i}}return{date:n,inclusive:i}},ah=function(t){function n(n){var i=t.call(this,n)||this;return i.onNewChange(),i}return B(n,t),n.prototype.init=function(n){var i,r=this;t.prototype.init.call(this,n);var e=this.theme;this.Eh=new Date;var u=this.Eh.getTime();this.Mh=new Date(u),this.Sh=new hh(function(t,n){return n?{lower:oh(n.lower,t.getLowerBound(),t.isLowerBoundInclusive()),upper:oh(n.upper,t.getUpperBound(),t.isUpperBoundInclusive())}:{lower:{date:t.getLowerBound(),inclusive:t.isLowerBoundInclusive()},upper:{date:t.getUpperBound(),inclusive:t.isUpperBoundInclusive()}}}(e,null==n?void 0:n.bounds),(function(){r.onNewChange()}));var s=null!==(i=null==n?void 0:n.margin)&&void 0!==i?i:e.getMargin();new Fu({parent:this,x:"padding",y:"padding",width:"auto",height:"auto",margin:s,children:this.newChildren(e,n,s)})},Object.defineProperty(n.prototype,"current",{get:function(){return this.Eh},set:function(t){this.Eh.getTime()!==t.getTime()&&(this.Eh=t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"new",{get:function(){return this.Mh},set:function(t){this.Mh.getTime()!==t.getTime()&&(this.Mh=t,this.onNewChange())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"bounds",{get:function(){return this.Sh},enumerable:!1,configurable:!0}),n.prototype.hasHours=function(){return null!=this.Th},n.prototype.hasMinutes=function(){return null!=this.jh},n.prototype.hasSeconds=function(){return null!=this.Nh},n.prototype.reset=function(){var t=this.Eh.getTime();this.Mh.setTime(t),this.onReset()},n.prototype.onReset=function(){this.onNewChange()},n.prototype.onNewChange=function(){var t=this.Mh,n=this.Sh;n.adjust(this.Mh);var i=this.Th;if(i){var r=n.hours;i.value=t.getHours(),i.min=r.min(t),i.max=r.max(t)}var e=this.jh;if(e){var u=n.minutes;e.value=t.getMinutes(),e.min=u.min(t),e.max=u.max(t)}var s=this.Nh;if(s){var h=n.seconds;s.value=t.getSeconds(),s.min=h.min(t),s.max=h.max(t)}},n.prototype.newChildren=function(t,n,i){var r=ih.from(t,n);return this.Sh.mask=r,this.Th=r&nh.HOURS?this.newInputHours(t,n):null,this.jh=r&nh.MINUTES?this.newInputMinutes(t,n):null,this.Nh=r&nh.SECONDS?this.newInputSeconds(t,n):null,[this.newTimeLayout(this.Th,this.jh,this.Nh,i)]},n.prototype.newTimeLayout=function(t,n,i,r){var e=this.newTimeLayoutChildren(t,n,i);return 0<e.length?new ws({width:this.getTimeLayoutWidth(),height:this.getTimeLayoutHeight(),margin:r,children:e}):null},n.prototype.getTimeLayoutWidth=function(){return"auto"},n.prototype.getTimeLayoutHeight=function(){return"auto"},n.prototype.newTimeLayoutChildren=function(t,n,i){var r=[];return null!=t&&r.push(t),null!=n&&(0<r.length&&r.push(this.newMinuteSeparator()),r.push(n)),null!=i&&(0<r.length&&r.push(this.newSecondSeparator()),r.push(i)),r},n.prototype.newMinuteSeparator=function(){return new qs({width:"auto",text:{value:this.getMinuteSeparator()}})},n.prototype.getMinuteSeparator=function(){return":"},n.prototype.newSecondSeparator=function(){return new qs({width:"auto",text:{value:this.getSecondSeparator()}})},n.prototype.getSecondSeparator=function(){return":"},n.prototype.adjustInputOptions=function(t,n,i){return null==n.step&&(n.step=1),null==n.min&&(n.min=0),null==n.max&&(n.max=i),n},n.prototype.newInputHours=function(t,n){var i,r=this,e=null!==(i=null==n?void 0:n.hours)&&void 0!==i?i:t.getHoursOptions(),u=this.Sh.constant.hour.max,s=new _s(this.adjustInputOptions(t,e,u));return s.on("change",(function(t){r.onHoursChange(t)})),s},n.prototype.onHoursChange=function(t){this.Mh.setHours(t),this.onNewChange()},n.prototype.newInputMinutes=function(t,n){var i=this,r=(null==n?void 0:n.minutes)||t.getMinutesOptions(),e=this.Sh.constant.minute.max,u=new _s(this.adjustInputOptions(t,r,e));return u.on("change",(function(t){i.onMinutesChange(t)})),u},n.prototype.onMinutesChange=function(t){this.Mh.setMinutes(t),this.onNewChange()},n.prototype.newInputSeconds=function(t,n){var i=this,r=(null==n?void 0:n.seconds)||t.getSecondsOptions(),e=this.Sh.constant.second.max,u=new _s(this.adjustInputOptions(t,r,e));return u.on("change",(function(t){i.onSecondsChange(t)})),u},n.prototype.onSecondsChange=function(t){this.Mh.setSeconds(t)},n.prototype.getType=function(){return"DPickerTime"},n}(Qi),ch=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.init=function(n){t.prototype.init.call(this,n),this.Ih=new Date(this.Eh.getTime())},n.prototype.newChildren=function(n,i,r){var e,u;this.Ch=this.newDateButtons(n,i),this.Ah=null!==(u=null===(e=null==i?void 0:i.date)||void 0===e?void 0:e.decorator)&&void 0!==u?u:n.getDateDecorator(),this.Rh=this.newLabel(n,i);var s=t.prototype.newChildren.call(this,n,i,r);return s.unshift(new ws({width:"100%",height:"auto",children:[this.newBackButton(n,i),this.Rh,this.newNextButton(n,i)]}),new ws({width:"auto",height:"auto",margin:r,children:this.newDateLabels(n,i)}),new Fu({width:"auto",height:"auto",margin:r,column:7,children:this.Ch})),s},Object.defineProperty(n.prototype,"page",{get:function(){return this.Ih},set:function(t){this.Ih.getTime()!==t.getTime()&&(this.Ih=t,this.onPageChange())},enumerable:!1,configurable:!0}),n.prototype.onReset=function(){this.Ih.setTime(this.Eh.getTime()),t.prototype.onReset.call(this)},n.prototype.next=function(){var t=this.Ih;t.setFullYear(t.getFullYear(),t.getMonth()+1,1),t.setHours(0,0,0,0),this.onPageChange()},n.prototype.back=function(){var t=this.Ih;t.setFullYear(t.getFullYear(),t.getMonth()-1,1),t.setHours(0,0,0,0),this.onPageChange()},n.prototype.onNewChange=function(){this.Sh.adjust(this.Ih),t.prototype.onNewChange.call(this),this.onPageChange()},n.prototype.onPageChange=function(){var t=this.Ch,n=this.Sh,i=this.Ih,r=this.Mh,e=new Date(i.getTime());e.setDate(1),e.setHours(0,0,0,0);for(var u=this.theme,s=(e.getDay()-u.getDayStart()+7)%7,h=0;h<s;++h)t[h].show();for(h=s;h<7;++h)t[h].hide();var o=this.Ah;e.setFullYear(e.getFullYear(),e.getMonth()+1,0);var a=e.getDate(),c=r.getFullYear()===e.getFullYear()&&r.getMonth()===e.getMonth()?r.getDate():0;for(h=0;h<a;++h)e.setDate(h+1),(f=t[h+7]).state.isActive=c===h+1,f.state.isDisabled=!n.contains(e),f.show(),o(e,f);for(h=a;h<31;++h){var f;(f=t[h+7]).state.isActive=!1,f.hide()}e.setTime(i.getTime()),this.Rh.text=e},n.prototype.adjustInputOptions=function(n,i,r){return null==i.weight&&(i.weight=1),t.prototype.adjustInputOptions.call(this,n,i,r)},n.prototype.getTimeLayoutWidth=function(){return"100%"},n.prototype.toLabelOptions=function(t,n){var i=n&&n.label||{};void 0===i.weight&&(i.weight=1),void 0===i.padding&&(i.padding=0);var r=i.text=i.text||{},e=r.align=r.align||{};return void 0===e.horizontal&&(e.horizontal="CENTER"),void 0===r.formatter&&(r.formatter=t.getLabelFormatter()),i},n.prototype.newLabel=function(t,n){return new Qs(this.toLabelOptions(t,n))},n.prototype.newBackButton=function(t,n){var i=this,r=null==n?void 0:n.back;if(void 0===r&&(r=t.getBackButtonOptions()),null!=r){var e=new Ys(r);return e.on("active",(function(){i.back()})),e}return null},n.prototype.newNextButton=function(t,n){var i=this,r=null==n?void 0:n.next;if(void 0===r&&(r=t.getNextButtonOptions()),null!=r){var e=new Zs(r);return e.on("active",(function(){i.next()})),e}return null},n.prototype.newDateLabels=function(t,n){for(var i=t.getDayLabels(),r=t.getDayStart(),e=[],u=0;u<7;++u){var s=i[(r+u)%7];e.push(this.newDateLabel(t,n,s))}return e},n.prototype.newDateLabel=function(t,n,i){return new $s({text:{value:i}})},n.prototype.newDateButtons=function(t,n){for(var i=[],r=0;r<7;++r)i.push(this.newSpace(t,n));for(r=1;r<=31;++r)i.push(this.newDateButton(t,n,r));return i},n.prototype.newSpace=function(t,n){return new th},n.prototype.newDateButton=function(t,n,i){var r=this;return new Js({text:{value:String(i)},on:{active:function(){r.onDateButtonClicked(i)}}})},n.prototype.onDateButtonClicked=function(t){var n=this.Mh;if(n.getDate()!==t){var i=this.Ih;n.setFullYear(i.getFullYear()),n.setMonth(i.getMonth()),n.setDate(t),this.onNewChange()}},n.prototype.getType=function(){return"DPickerDatetime"},n}(ah),fh=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.newContentChildren=function(n,i){var r=t.prototype.newContentChildren.call(this,n,i);return r.push(this.picker),r},Object.defineProperty(n.prototype,"current",{get:function(){return this.picker.current},set:function(t){this.picker.current=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"new",{get:function(){return this.picker.new},set:function(t){this.picker.new=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"page",{get:function(){return this.picker.new},set:function(t){this.picker.page=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"picker",{get:function(){var t,n=this.Lh;return null==n&&(n=new ch(null===(t=this.kn)||void 0===t?void 0:t.picker),this.Lh=n),n},enumerable:!1,configurable:!0}),n.prototype.getResolvedValue=function(){return this.picker.new},n.prototype.getType=function(){return"DDialogDatetime"},n}(Ks),lh=function(t){function n(n){var i=t.call(this,n)||this;return i.initial=rn.ofUnknown(n.initial),i}return B(n,t),n.prototype.open=function(t,i,r,e,u,s){var h=n.DIALOG;return null==h&&(h=new fh,n.DIALOG=h),h.new=h.current=this.toDate(r),h.open(t).then((function(t){return t.toISOString()}))},n.prototype.toDate=function(t){return at(t)||mn(t)?new Date(t):t instanceof Date?t:new Date},n}(Rs),vh=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.newContentChildren=function(n,i){var r=t.prototype.newContentChildren.call(this,n,i);return r.push(this.picker),r},Object.defineProperty(n.prototype,"current",{get:function(){return this.picker.current},set:function(t){this.picker.current=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"new",{get:function(){return this.picker.new},set:function(t){this.picker.new=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"picker",{get:function(){var t,n=this.Lh;return null==n&&(n=new ah(null===(t=this.kn)||void 0===t?void 0:t.picker),this.Lh=n),n},enumerable:!1,configurable:!0}),n.prototype.getResolvedValue=function(){return this.picker.new},n.prototype.getType=function(){return"DDialogTime"},n}(Ks),bh=function(t){return t!=t},dh=function(t){function n(n){var i=t.call(this,n)||this;return i.initial=rn.ofUnknown(n.initial),i}return B(n,t),n.prototype.open=function(t,i,r,e,u,s){var h=this,o=n.DIALOG;return null==o&&(o=new vh,n.DIALOG=o),o.new=o.current=this.toDate(r),o.open(t).then((function(t){return h.getFormatter().format(t.getTime(),0)}))},n.prototype.toDate=function(t){if(mn(t))return new Date(t);if(at(t)){var n=new Date,i=this.getPattern().exec(t);if(null!=i){var r=this.toHours(i[1]);null!=r&&n.setHours(r);var e=this.toMinutes(i[2]);null!=e&&n.setMinutes(e);var u=this.toSeconds(i[3]);null!=u&&n.setSeconds(u);var s=this.toMilliseconds(i[4]);null!=s&&n.setMilliseconds(s)}return n}return t instanceof Date?t:new Date},n.prototype.toHours=function(t){return this.toNumber(t,0,23)},n.prototype.toMinutes=function(t){return this.toNumber(t,0,59)},n.prototype.toSeconds=function(t){return this.toNumber(t,0,59)},n.prototype.toMilliseconds=function(t){var n=this.toNumber(t,0,999);if(null!=n){var i=t.length;return 1===i?100*n:2===i?10*n:n}return n},n.prototype.toNumber=function(t,n,i){if(null!=t){var r=+t;if(!bh(r))return Math.min(i,Math.max(n,r))}return null},n.prototype.getPattern=function(){var t=n.PATTERN;return null==t&&(t=this.newPattern(),n.PATTERN=t),t},n.prototype.newPattern=function(){return/^\s*(?:(\d+)(?::(\d+)(?::(\d+))?)?)?(?:\.(\d+))?\s*$/},n.prototype.getFormatter=function(){var t=n.FORMATTER;return null==t&&(t=this.newFormatter(),n.FORMATTER=t),t},n.prototype.newFormatter=function(){return bi.create("%Hm")},n}(Rs),gh=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DPickerDate"},n}(ch),mh=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.newContentChildren=function(n,i){var r=t.prototype.newContentChildren.call(this,n,i);return r.push(this.picker),r},Object.defineProperty(n.prototype,"current",{get:function(){return this.picker.current},set:function(t){this.picker.current=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"new",{get:function(){return this.picker.new},set:function(t){this.picker.new=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"page",{get:function(){return this.picker.new},set:function(t){this.picker.page=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"picker",{get:function(){var t,n=this.Lh;return null==n&&(n=new gh(null===(t=this.kn)||void 0===t?void 0:t.picker),this.Lh=n),n},enumerable:!1,configurable:!0}),n.prototype.getResolvedValue=function(){return this.picker.new},n.prototype.getType=function(){return"DDialogDate"},n}(Ks),wh=function(t){function n(n){var i=t.call(this,n)||this;return i.initial=rn.ofUnknown(n.initial),i}return B(n,t),n.prototype.open=function(t,i,r,e,u,s){var h=this,o=n.DIALOG;return null==o&&(o=new mh,n.DIALOG=o),o.new=o.current=this.toDate(r),o.open(t).then((function(t){return h.getFormatter().format(t.getTime(),0)}))},n.prototype.toDate=function(t){return at(t)||mn(t)?new Date(t):t instanceof Date?t:new Date},n.prototype.getFormatter=function(){var t=n.FORMATTER;return null==t&&(t=this.newFormatter(),n.FORMATTER=t),t},n.prototype.newFormatter=function(){return bi.create("%Y-%M-%D")},n}(Rs),Oh={TEXT:0,INTEGER:1,REAL:2,BOOLEAN:3,DATE:4,TIME:5,DATETIME:6,EXTENSION:1e3},ph=function(t){function n(n,i,r,e,u,s,h,o){var a=t.call(this,gn.OPEN,n,Su.DIALOG)||this;return a.target=i,a.onInputAction=r,a.initial=e,a.step=u,a.min=s,a.max=h,a.dialogType=o,a}return B(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.target===i.target&&this.dialogType===i.dialogType&&this.onInputAction===i.onInputAction&&this.initial===i.initial&&this.step===i.step&&this.min===i.min&&this.max===i.max},n.prototype.toRuntime=function(){switch(this.dialogType){case Oh.TEXT:return new Ws(this);case Oh.INTEGER:return new Us(this);case Oh.REAL:return new Hs(this);case Oh.BOOLEAN:return new Ls(this);case Oh.DATE:return new wh(this);case Oh.TIME:return new dh(this);case Oh.DATETIME:return new lh(this)}},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.target),r=t.addResource(this.initial),e=t.addResource(this.step),u=t.addResource(this.min),s=t.addResource(this.max);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(i,",").concat(this.onInputAction,",").concat(r,",").concat(this.dialogType,",").concat(e,",").concat(u,",").concat(s,"]"))},n.deserialize=function(t,i){var r=i.resources,e=wn.toResource(1,t,r),u=wn.toResource(3,t,r),s=wn.toResource(5,t,r),h=wn.toResource(7,t,r),o=wn.toResource(8,t,r),a=wn.toResource(9,t,r);return new n(e,u,t[4],s,h,o,a,this.toDialogType(t))},n.toDialogType=function(t){if(t[2]===Su.DIALOG)return t[6];switch(t[2]){case Su.DIALOG_TEXT:return Oh.TEXT;case Su.DIALOG_INTEGER:return Oh.INTEGER;case Su.DIALOG_REAL:return Oh.REAL;case Su.DIALOG_BOOLEAN:return Oh.BOOLEAN;case Su.DIALOG_DATE:return Oh.DATE;case Su.DIALOG_TIME:return Oh.TIME;case Su.DIALOG_DATETIME:return Oh.DATETIME}},n}(dn),Dh=function(){function t(){}return t.add=function(t){var n,i;(null!==(n=this.yh)&&void 0!==n?n:this.yh=new Map).set(t.type,t),(null!==(i=this.Pt)&&void 0!==i?i:this.Pt=[]).push(t)},t.get=function(t){var n=this.yh;if(null!=n)return n.get(t)},t.each=function(t){var n=this.Pt;if(null!=n)for(var i=0,r=n.length;i<r;++i)t(n[i])},t}(),Eh=function(t){function n(n){var i=t.call(this,n,$t.NONE)||this;i.target=rn.ofStringOrNull(n.target),i.argument=rn.ofUnknown(n.argument);var r=Dh.get(n.dialogType);return r&&(i.opener=r.opener),i}return B(n,t),n.prototype.execute=function(t,n,i){var r=this.opener;if(r&&this.condition(t,i,nn)){var e=this.target(t,i,nn);if(null!=e){var u=this.argument(t,i,nn);setTimeout((function(){r(e,u,t)}),0)}}},n}(un),Mh=function(t){function n(n,i,r,e){var u=t.call(this,gn.OPEN,n,Su.DIALOG)||this;return u.target=i,u.argument=r,u.dialogType=e,u}return B(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.target===i.target&&this.argument===i.argument&&this.dialogType===i.dialogType},n.prototype.toRuntime=function(){return new Eh(this)},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.target),r=t.addResource(this.argument);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(i,",0,-1,").concat(this.dialogType,",").concat(r,"]"))},n.deserialize=function(t,i){return new n(wn.toResource(1,t,i.resources),wn.toResource(3,t,i.resources),wn.toResource(7,t,i.resources),t[6])},n}(dn),Sh=function(){function t(){}return t.add=function(t){var n,i;(null!==(n=this.yh)&&void 0!==n?n:this.yh=new Map).set(t.type,t),(null!==(i=this.Pt)&&void 0!==i?i:this.Pt=[]).push(t),Fe[t.type]=t.opener},t.get=function(t){var n=this.yh;if(null!=n)return n.get(t)},t.each=function(t){var n=this.Pt;if(null!=n)for(var i=0,r=n.length;i<r;++i)t(n[i])},t}(),Th=function(t){function n(n,i,r,e){var u=t.call(this,gn.OPEN,i,n)||this;return u.target=r,u.inNewWindow=e,u}return B(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.target===i.target&&this.inNewWindow===i.inNewWindow},n.prototype.toRuntime=function(){return new Mu(this,this.subtype)},n.prototype.toLabel=function(){var t=this.getTheme().toTypeLabel(this.type),n=Sh.get(this.subtype);return"".concat(t,": ").concat(null!=n?n.label:"Unknown")},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.target),r=this.inNewWindow?1:0;return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(i,",").concat(r,"]"))},n.deserialize=function(t,i){var r=wn.toResource(1,t,i.resources),e=wn.toResource(3,t,i.resources);return new n(t[2],r,e,!!t[4])},n}(dn),jh={SHAPE_SHOW:0,SHAPE_HIDE:1,SHAPE:2,LAYER:3},Nh=function(t){function n(n){var i=t.call(this,n,$t.VISIBILITY)||this;return i.visibility=n.subtype===jh.SHAPE_SHOW,i}return B(n,t),n.prototype.execute=function(t,n,i){this.condition(t,i,nn)&&(t.visible=this.visibility,n.written|=this.reset)},n}(un),Ih=function(t){function n(n,i){return t.call(this,gn.SHOW_HIDE,i,n)||this}return B(n,t),n.prototype.toRuntime=function(){return new Nh(this)},n.prototype.serialize=function(t){var n=t.addResource(this.condition);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,"]"))},n.deserialize=function(t,i){var r=wn.toResource(1,t,i.resources);return new n(t[2],r)},n}(dn),Ch=function(t){function n(n){var i=t.call(this,n,$t.NONE)||this;return i.Pt=new Map,i.gu=n.layers,i.kh=n.bringToFront,i}return B(n,t),n.prototype.initialize=function(n,i){t.prototype.initialize.call(this,n,i);var r=this.Pt.get(n);null==r&&null!=(r=this.newData(n))&&this.Pt.set(n,r)},n.prototype.execute=function(t,n,i){var r=this.Pt.get(t);if(r){var e=this.condition(t,i,nn);if(r.condition!==e){r.condition=e;var u=r.layers;e?r.bringToFront?(Ne.bringAllToFront(u),Ne.showAll(u)):Ne.showAll(u):Ne.hideAll(u)}}},n.prototype.newData=function(t){var n=Ne.toLayers(t,this.gu);if(0<n.length)return{layers:n,bringToFront:this.kh,condition:null}},n}(un),Ah=function(t){function n(n,i,r){var e=t.call(this,gn.SHOW_HIDE,n,jh.LAYER)||this;return e.layers=i,e.bringToFront=r,e}return B(n,t),n.prototype.toRuntime=function(){return new Ch(this)},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=this.serializeLayers(t),r=this.bringToFront?1:0;return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(i,",").concat(r,"]"))},n.prototype.serializeLayers=function(t){for(var n=this.layers,i="[",r="",e=0,u=n.length;e<u;++e)i+=r+n[e],r=",";return i+="]",t.addResource(i)},n.deserialize=function(t,i){return new n(wn.toResource(1,t,i.resources),this.deserializeLayers(t[3],i),!!t[4])},n.deserializeLayers=function(t,n){var i=n.resources,r=i.length;return 0<=t&&t<r?JSON.parse(i[t]):[]},n}(dn),Rh=function(t){function n(n){return t.call(this,n,$t.VISIBILITY)||this}return B(n,t),n.prototype.initialize=function(n,i){t.prototype.initialize.call(this,n,i)},n.prototype.execute=function(t,n,i){t.visible=this.condition(t,i,nn),n.written|=this.reset},n}(un),Lh=function(t){function n(n){return t.call(this,gn.SHOW_HIDE,n,jh.SHAPE)||this}return B(n,t),n.prototype.toRuntime=function(){return new Rh(this)},n.prototype.serialize=function(t){var n=t.addResource(this.condition);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,"]"))},n.deserialize=function(t,i){return new n(wn.toResource(1,t,i.resources))},n}(dn),yh=function(t){function n(n,i){var r=t.call(this,n,i)||this;return r.amount=rn.ofNumber(n.amount),r}return B(n,t),n}(un),kh=function(t){function n(n){return t.call(this,n,$t.POSITION_X)||this}return B(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,nn)){var r=this.amount(t,i,nn);t.transform.position.x=r,n.written|=this.reset}},n}(yh),xh=function(t){function n(n){return t.call(this,n,$t.POSITION_Y)||this}return B(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,nn)){var r=this.amount(t,i,nn);t.transform.position.y=r,n.written|=this.reset}},n}(yh),Bh=function(t){function n(n){return t.call(this,n,$t.POSITION)||this}return B(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,nn)){var r=this.amount(t,i,nn),e=t.transform,u=e.position,s=!!(n.written&$t.POSITION_X),h=!!(n.written&$t.POSITION_Y),o=s?u.x:n.x,a=h?u.y:n.y;t.updateTransform();var c=e.localTransform;u.set(o-c.c*r,a-c.d*r),n.written|=this.reset}},n}(yh),_h=function(t){function n(n){return t.call(this,n,$t.POSITION)||this}return B(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,nn)){var r=this.amount(t,i,nn),e=t.transform,u=e.position,s=!!(n.written&$t.POSITION_X),h=!!(n.written&$t.POSITION_Y),o=s?u.x:n.x,a=h?u.y:n.y;t.updateTransform();var c=e.localTransform;u.set(o+c.a*r,a+c.b*r),n.written|=this.reset}},n}(yh),Ph=function(t){function n(n){return t.call(this,n,$t.POSITION_X)||this}return B(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,nn)){var r=this.amount(t,i,nn),e=!!(n.written&$t.POSITION_X),u=t.transform.position,s=e?u.x:n.x;u.x=s+r,n.written|=this.reset}},n}(yh),Uh=function(t){function n(n){return t.call(this,n,$t.POSITION_Y)||this}return B(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,nn)){var r=this.amount(t,i,nn),e=!!(n.written&$t.POSITION_Y),u=t.transform.position,s=e?u.y:n.y;u.y=s+r,n.written|=this.reset}},n}(yh),Fh=function(t){function n(n,i,r,e){var u=t.call(this,n,i,r)||this;return u.opetype=e,u}return B(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.opetype===i.opetype},n}(dn),Gh={RELATIVE_X:0,RELATIVE_Y:1,ABSOLUTE_X:2,ABSOLUTE_Y:3,FORWARD_OR_BACKWARD:4,LEFT_OR_RIGHT:5},Hh={RESIZE:0,MOVE:1,ROTATE:2},zh=function(t){function n(n,i,r){var e=t.call(this,gn.TRANSFORM,i,Hh.MOVE,n)||this;return e.amount=r,e}return B(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.amount===i.amount},n.prototype.toRuntime=function(){switch(this.opetype){case Gh.ABSOLUTE_X:return new kh(this);case Gh.ABSOLUTE_Y:return new xh(this);case Gh.FORWARD_OR_BACKWARD:return new Bh(this);case Gh.LEFT_OR_RIGHT:return new _h(this);case Gh.RELATIVE_X:return new Ph(this);case Gh.RELATIVE_Y:return new Uh(this)}},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.amount);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(this.opetype,",").concat(i,"]"))},n.deserialize=function(t,i){var r=wn.toResource(1,t,i.resources),e=wn.toResource(4,t,i.resources);return new n(t[3],r,e)},n}(Fh),Vh={RELATIVE_SIZE:0,RELATIVE_HEIGHT:1,RELATIVE_WIDTH:2,ABSOLUTE_SIZE:3,ABSOLUTE_HEIGHT:4,ABSOLUTE_WIDTH:5},Wh=function(t){function n(n,i){var r=t.call(this,n,i)||this;switch(n.opetype){case Vh.RELATIVE_SIZE:r.size=rn.ofNumberOrOne(n.amount);break;case Vh.ABSOLUTE_SIZE:r.size=rn.ofNumberOrOneHundred(n.amount);break;case Vh.RELATIVE_HEIGHT:r.size=rn.ofNumberOrOne(n.amount);break;case Vh.ABSOLUTE_HEIGHT:r.size=rn.ofNumberOrOneHundred(n.amount);break;case Vh.RELATIVE_WIDTH:r.size=rn.ofNumberOrOne(n.amount);break;case Vh.ABSOLUTE_WIDTH:r.size=rn.ofNumberOrOneHundred(n.amount);break;default:r.size=rn.ONE}return r}return B(n,t),n.prototype.adjustPosition=function(t,n,i,r,e,u){var s=(-.5+e)*i,h=(-.5+u)*r;t.updateTransform();var o=t.transform,a=o.position,c=o.localTransform,f=!!(n.written&$t.POSITION_X),l=!!(n.written&$t.POSITION_Y),v=f?a.x:n.x,b=l?a.y:n.y;n.written|=$t.POSITION,a.set(v+s*c.a+h*c.c,b+s*c.b+h*c.d)},n}(un),Xh=function(t){function n(n){var i=t.call(this,n,$t.HEIGHT|$t.POSITION)||this;return i.origin=n.originY,i}return B(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,nn)){var r=this.size(t,i,nn),e=t.size,u=n.written&$t.HEIGHT?e.y:n.sizeY;e.y=Or(r),n.written|=$t.HEIGHT,this.adjustPosition(t,n,0,u-e.y,.5,this.origin)}},n}(Wh),Kh=function(t){function n(n){var i=t.call(this,n,$t.HEIGHT|$t.POSITION)||this;return i.origin=n.originY,i}return B(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,nn)){var r=this.size(t,i,nn),e=t.size,u=n.written&$t.HEIGHT?e.y:n.sizeY;e.y=Or(u*r),n.written|=$t.HEIGHT,this.adjustPosition(t,n,0,u-e.y,.5,this.origin)}},n}(Wh),Yh=function(t){function n(n){var i=t.call(this,n,$t.SIZE|$t.POSITION)||this;return i.originX=n.originX,i.originY=n.originY,i}return B(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,nn)){var r=Or(this.size(t,i,nn)),e=t.size,u=!!(n.written&$t.WIDTH),s=!!(n.written&$t.HEIGHT),h=u?e.x:n.sizeX,o=s?e.y:n.sizeY;e.set(r,r),n.written|=$t.SIZE,this.adjustPosition(t,n,h-e.x,o-e.y,this.originX,this.originY)}},n}(Wh),Jh=function(t){function n(n){var i=t.call(this,n,$t.SIZE|$t.POSITION)||this;return i.originX=n.originX,i.originY=n.originY,i}return B(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,nn)){var r=this.size(t,i,nn),e=t.size,u=!!(n.written&$t.WIDTH),s=!!(n.written&$t.HEIGHT),h=u?e.x:n.sizeX,o=s?e.y:n.sizeY;e.set(Or(h*r),Or(o*r)),n.written|=$t.SIZE,this.adjustPosition(t,n,h-e.x,o-e.y,this.originX,this.originY)}},n}(Wh),Zh=function(t){function n(n){var i=t.call(this,n,$t.WIDTH|$t.POSITION)||this;return i.origin=n.originX,i}return B(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,nn)){var r=this.size(t,i,nn),e=t.size,u=n.written&$t.WIDTH?e.x:n.sizeX;e.x=Or(r),n.written|=$t.WIDTH,this.adjustPosition(t,n,u-e.x,0,this.origin,.5)}},n}(Wh),qh=function(t){function n(n){var i=t.call(this,n,$t.WIDTH|$t.POSITION)||this;return i.origin=n.originX,i}return B(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,nn)){var r=this.size(t,i,nn),e=t.size,u=n.written&$t.WIDTH?e.x:n.sizeX;e.x=Or(u*r),n.written|=$t.WIDTH,this.adjustPosition(t,n,u-e.x,0,this.origin,.5)}},n}(Wh),Qh=function(t){function n(n,i,r,e,u){var s=t.call(this,gn.TRANSFORM,i,Hh.RESIZE,n)||this;return s.originX=r,s.originY=e,s.amount=u,s}return B(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.originX===i.originX&&this.originY===i.originY&&this.amount===i.amount},n.prototype.toRuntime=function(){switch(this.opetype){case Vh.ABSOLUTE_HEIGHT:return new Xh(this);case Vh.ABSOLUTE_WIDTH:return new Zh(this);case Vh.ABSOLUTE_SIZE:return new Yh(this);case Vh.RELATIVE_HEIGHT:return new Kh(this);case Vh.RELATIVE_WIDTH:return new qh(this);case Vh.RELATIVE_SIZE:return new Jh(this)}},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.amount);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(this.opetype,",").concat(this.originX,",").concat(this.originY,",").concat(i,"]"))},n.deserialize=function(t,i){var r=wn.toResource(1,t,i.resources),e=wn.toResource(6,t,i.resources);return new n(t[3],r,t[4],t[5],e)},n}(Fh),$h=function(t){function n(n,i){var r=t.call(this,n,i)||this;return r.originX=n.originX,r.originY=n.originY,r.amount=rn.ofNumber("(".concat(n.amount,") * (Math.PI / 180)")),r}return B(n,t),n.prototype.adjustPosition=function(t,n,i,r,e,u){var s=!!(n.written&$t.WIDTH),h=!!(n.written&$t.HEIGHT),o=(-.5+e)*(s?t.size.x:n.sizeX),a=(-.5+u)*(h?t.size.y:n.sizeY),c=Math.sin(i)-Math.sin(r),f=Math.cos(i)-Math.cos(r),l=t.transform.position,v=!!(n.written&$t.POSITION_X),b=!!(n.written&$t.POSITION_Y),d=v?l.x:n.x,g=b?l.y:n.y;n.written|=$t.POSITION,l.set(d+o*f-a*c,g+o*c+a*f)},n}(un),to=function(t){function n(n){return t.call(this,n,$t.ROTATION|$t.POSITION)||this}return B(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,nn)){var r=this.amount(t,i,nn),e=t.transform,u=n.written&$t.ROTATION?e.rotation:n.rotation;e.rotation=r,n.written|=$t.ROTATION,this.adjustPosition(t,n,u,r,this.originX,this.originY)}},n}($h),no=function(t){function n(n){return t.call(this,n,$t.ROTATION|$t.POSITION)||this}return B(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,nn)){var r=this.amount(t,i,nn),e=t.transform,u=n.written&$t.ROTATION?e.rotation:n.rotation;e.rotation=u+r,n.written|=$t.ROTATION,this.adjustPosition(t,n,u,e.rotation,this.originX,this.originY)}},n}($h),io={RELATIVE:0,ABSOLUTE:1},ro=function(t){function n(n,i,r,e,u){var s=t.call(this,gn.TRANSFORM,i,Hh.ROTATE,n)||this;return s.originX=r,s.originY=e,s.amount=u,s}return B(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.originX===i.originX&&this.originY===i.originY&&this.amount===i.amount},n.prototype.toRuntime=function(){switch(this.opetype){case io.ABSOLUTE:return new to(this);case io.RELATIVE:return new no(this)}},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.amount);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(this.opetype,",").concat(this.originX,",").concat(this.originY,",").concat(i,"]"))},n.deserialize=function(t,i){var r=wn.toResource(1,t,i.resources),e=wn.toResource(6,t,i.resources);return new n(t[3],r,t[4],t[5],e)},n}(Fh),eo=function(t,n){switch(t[0]){case gn.SHOW_HIDE:switch(t[2]){case jh.SHAPE_SHOW:case jh.SHAPE_HIDE:return Ih.deserialize(t,n);case jh.SHAPE:return Lh.deserialize(t,n);case jh.LAYER:return Ah.deserialize(t,n)}break;case gn.BLINK:return On.deserialize(t,n);case gn.CHANGE_COLOR:case gn.CHANGE_COLOR_LEGACY:switch(t[3]){case En.COLOR_AND_ALPHA:case En.COLOR:case En.ALPHA:return Nn.deserialize(t,n);case En.CODE:return Rn.deserialize(t,n);case En.BRIGHTNESS:return Cn.deserialize(t,n)}break;case gn.CHANGE_TEXT:return wi.deserialize(t,n);case gn.CHANGE_CURSOR:return yn.deserialize(t,n);case gn.EMIT_EVENT:return ze.deserialize(t,n);case gn.OPEN:switch(t[2]){case Su.DIALOG_TEXT:case Su.DIALOG_INTEGER:case Su.DIALOG_REAL:case Su.DIALOG_BOOLEAN:case Su.DIALOG_DATE:case Su.DIALOG_TIME:case Su.DIALOG_DATETIME:case Su.DIALOG:return Oh.EXTENSION<=t[6]?Mh.deserialize(t,n):ph.deserialize(t,n);case Su.DIAGRAM_LEGACY:case Su.PAGE_LEGACY:case Su.PAGE_INPLACE_LEGACY:case Su.DIAGRAM:case Su.PAGE:return Tu.deserialize(t,n);default:if(Su.EXTENSION<=t[2])return Th.deserialize(t,n)}break;case gn.TRANSFORM:switch(t[2]){case Hh.MOVE:return zh.deserialize(t,n);case Hh.RESIZE:return Qh.deserialize(t,n);case Hh.ROTATE:return ro.deserialize(t,n)}break;case gn.GESTURE:return xe.deserialize(t,n);case gn.MISC:switch(t[2]){case ke.GESTURE:return xe.deserialize(t,n);case ke.SHOW_HIDE_LAYER:return Ah.deserialize(t,n);case ke.GESTURE_LAYER:return xe.deserialize(t,n);case ke.EXECUTE:return Eu.deserialize(t,n);default:return pu.deserialize(t,n)}}return null},uo={},so=function(t){try{var n=JSON.parse(t);return Rt(n)&&2<=n.length?n:null}catch(t){return null}},ho=function(t,n,i){var r=n.resources;if(0<=t&&t<r.length){var e=r[t];at(e)&&(i.gradient=function(t){var n=function(t){try{return JSON.parse(t)}catch(t){return null}}(t);if(!(null==n||n.length<7)){for(var i=n[0],r=[],e=1,u=n.length;e<u;e+=3)r.push({color:n[e+0],alpha:n[e+1],position:n[e+2]});return{points:r,direction:i}}}(e))}},oo={},ao=function(t){var n=oo[t];if(null!=n)return n instanceof HTMLImageElement?Promise.resolve(n):n;var i=new Promise((function(n,i){var r=document.createElement("img");r.onload=function(){oo[t]=r,n(r)},r.onabort=r.onerror=function(){i()},r.src=t}));return oo[t]=i,i},co=function(t,n,i){var r=n.resources;i.id=r[t[1]]||"";var e=i.transform;e.position.set(t[2],t[3]),e.rotation=t[6],e.skew.set(t[7],t[7]),e.pivot.set(t[21],t[22]),i.size.set(Or(t[4]),Or(t[5])),i.fill.deserialize(t[8],n),i.stroke.deserialize(t[9],n);var u=t[10];i.cursor=0<=u?r[u]:void 0,i.text.deserialize(t[11],n),i.data.deserialize(t[12],n),i.radius=t[13],i.corner=t[14];var s=t[23];i.interactive=!!(1&s);var h=i.state;h.isFocusable=!(2&s),h.isActive=!!(4&s);var o=t[24];i.shortcut=0<=o?r[o]:void 0;var a=t[25];i.title=0<=a?r[a]:void 0;var c=t[26];i.uuid=null!=c?c:0;var f=t[27],l=t[28],v=t[29];(null!=f&&f!==wt.NONE||null!=l&&l!==wt.NONE||null!=v&&v!==wt.NONE)&&i.capability.set(f,l,v);var b=function(t,n,i){if(0<t.length){for(var r=[],e=0,u=t.length;e<u;++e)r.push(Cr(t[e],n));return Promise.all(r).then((function(t){i.children=t;for(var n=0,r=t.length;n<r;++n)t[n].parent=i;return i.onChildTransformChange(),i.toDirty(),i}))}return null}(t[20],n,i);!function(t,n,i){for(var r=i.action,e=n.resources,u=0,s=t.length;u<s;++u){var h=t[u],o=n.getAction(h);if(null!=o)r.add(o);else{var a=e[h];if(null!=a){var c=so(a);if(null!=c&&0<c.length){var f=c[0],l=gn.EXTENSION<=f?uo[f]:eo;if(null!=l){var v=l(c,n);null!=v&&(n.setAction(h,v),r.add(v))}}}}}}(t[17],n,i),ho(t[19],n,i);var d=function(t,n,i){var r=n.resources;if(0<=t&&t<r.length){var e=r[t];if(at(e))return ao(e).then((function(t){return i.image=t,i}))}return null}(t[18],n,i);return null!=b?null!=d?Promise.all([b,d]).then((function(){return i})):b:null!=d?d:i},fo=function(t,n,i){i=i||new Kt;var r=co(t,n,i);i.points.deserialize(t[15],n);var e=i.points.style,u=F.NON_SCALING_MASK|F.DOTTED_MASK|F.DASHED_MASK,s=e&u;return s&&(i.points.style&=~u,i.stroke.style|=s),r},lo=function(){e[r.BAR]=Zt,n[r.BAR]=fo},vo={},bo=36,go=[0,0,0],mo=new t.Point,wo=function(t,n,i){var r=3*i-1;t[++r]=n,t[++r]=n+1,t[++r]=n+2,t[++r]=n+1,t[++r]=n+3,t[++r]=n+2,t[++r]=n+4,t[++r]=n+5,t[++r]=n+6,t[++r]=n+5,t[++r]=n+7,t[++r]=n+6,t[++r]=n+8,t[++r]=n+9,t[++r]=n+10,t[++r]=n+9,t[++r]=n+11,t[++r]=n+10,t[++r]=n+12,t[++r]=n+13,t[++r]=n+14,t[++r]=n+13,t[++r]=n+15,t[++r]=n+14,t[++r]=n+16,t[++r]=n+17,t[++r]=n+20,t[++r]=n+17,t[++r]=n+21,t[++r]=n+20,t[++r]=n+17,t[++r]=n+18,t[++r]=n+21,t[++r]=n+18,t[++r]=n+22,t[++r]=n+21,t[++r]=n+19,t[++r]=n+21,t[++r]=n+24,t[++r]=n+21,t[++r]=n+25,t[++r]=n+24,t[++r]=n+21,t[++r]=n+23,t[++r]=n+26,t[++r]=n+23,t[++r]=n+27,t[++r]=n+26,t[++r]=n+24,t[++r]=n+25,t[++r]=n+28,t[++r]=n+25,t[++r]=n+30,t[++r]=n+28,t[++r]=n+26,t[++r]=n+27,t[++r]=n+30,t[++r]=n+27,t[++r]=n+32,t[++r]=n+30,t[++r]=n+29,t[++r]=n+30,t[++r]=n+33,t[++r]=n+30,t[++r]=n+34,t[++r]=n+33,t[++r]=n+30,t[++r]=n+31,t[++r]=n+34,t[++r]=n+31,t[++r]=n+35,t[++r]=n+34},Oo=function(t,n,i,r,e,u,s,h,o,a,c){var f=s*h,l=.5*e+(0<=e?+f:-f),v=.5*u+(0<=u?+f:-f),b=Math.abs(l),d=Math.abs(v),g=o*Math.min(b,d),m=g/b,w=g/d,O=mo;O.set(i-l,r-v),a.apply(O,O);var D=O.x,E=O.y;O.set(i,r-v),a.apply(O,O);var M=O.x,S=O.y,T=M-D,j=S-E,N=m*T,I=m*j,C=D+N,A=E+I,R=M+T,L=S+j,y=R-N,k=L-I;O.set(i,r),a.apply(O,O);var x=O.x,B=O.y,_=x-M,P=B-S,U=w*_,F=w*P,G=M+U,H=S+F,z=G-T,V=H-j,W=z+N,X=V+I,K=G+T,Y=H+j,J=K-N,Z=Y-I,q=x-T,Q=B-j,$=x+T,tt=B+j,nt=x+_,it=B+P,rt=nt-U,et=it-F,ut=rt-T,st=et-j,ht=ut+N,ot=st+I,at=rt+T,ct=et+j,ft=at-N,lt=ct-I,vt=nt-T,bt=it-j,dt=vt+N,gt=bt+I,mt=nt+T,wt=it+j,Ot=mt-N,pt=wt-I;c[0]=p(D,E,C,A),c[1]=p(D,E,M,S),c[2]=p(D,E,q,Q);var Dt=2*n-1;t[++Dt]=D,t[++Dt]=E,t[++Dt]=C,t[++Dt]=A,t[++Dt]=z,t[++Dt]=V,t[++Dt]=W,t[++Dt]=X,t[++Dt]=y,t[++Dt]=k,t[++Dt]=R,t[++Dt]=L,t[++Dt]=J,t[++Dt]=Z,t[++Dt]=K,t[++Dt]=Y,t[++Dt]=ut,t[++Dt]=st,t[++Dt]=ht,t[++Dt]=ot,t[++Dt]=vt,t[++Dt]=bt,t[++Dt]=dt,t[++Dt]=gt,t[++Dt]=ft,t[++Dt]=lt,t[++Dt]=at,t[++Dt]=ct,t[++Dt]=Ot,t[++Dt]=pt,t[++Dt]=mt,t[++Dt]=wt,t[++Dt]=C,t[++Dt]=A,t[++Dt]=M,t[++Dt]=S,t[++Dt]=y,t[++Dt]=k,t[++Dt]=z,t[++Dt]=V,t[++Dt]=W,t[++Dt]=X,t[++Dt]=G,t[++Dt]=H,t[++Dt]=J,t[++Dt]=Z,t[++Dt]=K,t[++Dt]=Y,t[++Dt]=q,t[++Dt]=Q,t[++Dt]=x,t[++Dt]=B,t[++Dt]=x,t[++Dt]=B,t[++Dt]=$,t[++Dt]=tt,t[++Dt]=ut,t[++Dt]=st,t[++Dt]=ht,t[++Dt]=ot,t[++Dt]=rt,t[++Dt]=et,t[++Dt]=ft,t[++Dt]=lt,t[++Dt]=at,t[++Dt]=ct,t[++Dt]=dt,t[++Dt]=gt,t[++Dt]=nt,t[++Dt]=it,t[++Dt]=Ot,t[++Dt]=pt},po=function(t,n,i,r){var e=3*n-1,u=1-r[0]/r[1],s=1-r[0]/r[2];i&it.TOP_LEFT?(t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=1):(t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=u,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=s,t[++e]=0,t[++e]=u,t[++e]=s,t[++e]=0),i&it.TOP_RIGHT?(t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1):(t[++e]=u,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=u,t[++e]=s,t[++e]=0,t[++e]=1,t[++e]=s,t[++e]=0),i&it.BOTTOM_LEFT?(t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1):(t[++e]=1,t[++e]=s,t[++e]=0,t[++e]=u,t[++e]=s,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=u,t[++e]=1,t[++e]=0),i&it.BOTTOM_RIGHT?(t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=1):(t[++e]=u,t[++e]=s,t[++e]=0,t[++e]=1,t[++e]=s,t[++e]=0,t[++e]=u,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0),t[++e]=u,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=u,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=s,t[++e]=0,t[++e]=u,t[++e]=s,t[++e]=0,t[++e]=0,t[++e]=s,t[++e]=0,t[++e]=u,t[++e]=s,t[++e]=0,t[++e]=1,t[++e]=s,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=0,t[++e]=0,t[++e]=0,t[++e]=0,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=s,t[++e]=0,t[++e]=u,t[++e]=s,t[++e]=0,t[++e]=0,t[++e]=s,t[++e]=0,t[++e]=u,t[++e]=s,t[++e]=0,t[++e]=1,t[++e]=s,t[++e]=0,t[++e]=u,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=u,t[++e]=1,t[++e]=0},Do=function(t,n,i,r,e,u,s){var h,a,c,f,l,v,b,d,g,m,w,O,p=o(e),D=s[0],E=s[1],M=s[2],S=Math.max(0,1-s[0]/s[1]),T=Math.max(0,1-s[0]/s[2]);r&Gt.TOP?(h=2,a=1,c=1+T):(h=-2,a=-1,c=-1-T),r&Gt.RIGHT?(f=2,l=1,v=1+S):(f=-2,l=-1,v=-1-S),r&Gt.BOTTOM?(b=2,d=1,g=1+T):(b=-2,d=-1,g=-1-T),r&Gt.LEFT?(m=2,w=1,O=1+S):(m=-2,w=-1,O=-1-S);var j=6*n-1;u&it.TOP_LEFT?(t[++j]=i,t[++j]=p,t[++j]=D,t[++j]=D,t[++j]=m,t[++j]=h,t[++j]=i,t[++j]=p,t[++j]=D,t[++j]=D,t[++j]=w,t[++j]=h,t[++j]=i,t[++j]=p,t[++j]=D,t[++j]=D,t[++j]=m,t[++j]=a,t[++j]=i,t[++j]=p,t[++j]=D,t[++j]=D,t[++j]=w,t[++j]=a):(t[++j]=i,t[++j]=p,t[++j]=E,t[++j]=M,t[++j]=m,t[++j]=h,t[++j]=i,t[++j]=p,t[++j]=E,t[++j]=M,t[++j]=O,t[++j]=h,t[++j]=i,t[++j]=p,t[++j]=E,t[++j]=M,t[++j]=m,t[++j]=c,t[++j]=i,t[++j]=p,t[++j]=E,t[++j]=M,t[++j]=O,t[++j]=c),u&it.TOP_RIGHT?(t[++j]=i,t[++j]=p,t[++j]=D,t[++j]=D,t[++j]=l,t[++j]=h,t[++j]=i,t[++j]=p,t[++j]=D,t[++j]=D,t[++j]=f,t[++j]=h,t[++j]=i,t[++j]=p,t[++j]=D,t[++j]=D,t[++j]=l,t[++j]=a,t[++j]=i,t[++j]=p,t[++j]=D,t[++j]=D,t[++j]=f,t[++j]=a):(t[++j]=i,t[++j]=p,t[++j]=E,t[++j]=M,t[++j]=v,t[++j]=h,t[++j]=i,t[++j]=p,t[++j]=E,t[++j]=M,t[++j]=f,t[++j]=h,t[++j]=i,t[++j]=p,t[++j]=E,t[++j]=M,t[++j]=v,t[++j]=c,t[++j]=i,t[++j]=p,t[++j]=E,t[++j]=M,t[++j]=f,t[++j]=c),u&it.BOTTOM_LEFT?(t[++j]=i,t[++j]=p,t[++j]=D,t[++j]=D,t[++j]=m,t[++j]=d,t[++j]=i,t[++j]=p,t[++j]=D,t[++j]=D,t[++j]=w,t[++j]=d,t[++j]=i,t[++j]=p,t[++j]=D,t[++j]=D,t[++j]=m,t[++j]=b,t[++j]=i,t[++j]=p,t[++j]=D,t[++j]=D,t[++j]=w,t[++j]=b):(t[++j]=i,t[++j]=p,t[++j]=E,t[++j]=M,t[++j]=m,t[++j]=g,t[++j]=i,t[++j]=p,t[++j]=E,t[++j]=M,t[++j]=O,t[++j]=g,t[++j]=i,t[++j]=p,t[++j]=E,t[++j]=M,t[++j]=m,t[++j]=b,t[++j]=i,t[++j]=p,t[++j]=E,t[++j]=M,t[++j]=O,t[++j]=b),u&it.BOTTOM_RIGHT?(t[++j]=i,t[++j]=p,t[++j]=D,t[++j]=D,t[++j]=l,t[++j]=d,t[++j]=i,t[++j]=p,t[++j]=D,t[++j]=D,t[++j]=f,t[++j]=d,t[++j]=i,t[++j]=p,t[++j]=D,t[++j]=D,t[++j]=l,t[++j]=b,t[++j]=i,t[++j]=p,t[++j]=D,t[++j]=D,t[++j]=f,t[++j]=b):(t[++j]=i,t[++j]=p,t[++j]=E,t[++j]=M,t[++j]=v,t[++j]=g,t[++j]=i,t[++j]=p,t[++j]=E,t[++j]=M,t[++j]=f,t[++j]=g,t[++j]=i,t[++j]=p,t[++j]=E,t[++j]=M,t[++j]=v,t[++j]=b,t[++j]=i,t[++j]=p,t[++j]=E,t[++j]=M,t[++j]=f,t[++j]=b),t[++j]=i,t[++j]=p,t[++j]=E,t[++j]=M,t[++j]=O,t[++j]=h,t[++j]=i,t[++j]=p,t[++j]=E,t[++j]=M,t[++j]=w,t[++j]=h,t[++j]=i,t[++j]=p,t[++j]=E,t[++j]=M,t[++j]=v,t[++j]=h,t[++j]=i,t[++j]=p,t[++j]=E,t[++j]=M,t[++j]=m,t[++j]=c,t[++j]=i,t[++j]=p,t[++j]=E,t[++j]=M,t[++j]=O,t[++j]=c,t[++j]=i,t[++j]=p,t[++j]=E,t[++j]=M,t[++j]=w,t[++j]=c,t[++j]=i,t[++j]=p,t[++j]=E,t[++j]=M,t[++j]=v,t[++j]=c,t[++j]=i,t[++j]=p,t[++j]=E,t[++j]=M,t[++j]=f,t[++j]=c,t[++j]=i,t[++j]=p,t[++j]=E,t[++j]=M,t[++j]=m,t[++j]=a,t[++j]=i,t[++j]=p,t[++j]=E,t[++j]=M,t[++j]=w,t[++j]=a,t[++j]=i,t[++j]=p,t[++j]=E,t[++j]=M,t[++j]=l,t[++j]=d,t[++j]=i,t[++j]=p,t[++j]=E,t[++j]=M,t[++j]=f,t[++j]=d,t[++j]=i,t[++j]=p,t[++j]=E,t[++j]=M,t[++j]=m,t[++j]=g,t[++j]=i,t[++j]=p,t[++j]=E,t[++j]=M,t[++j]=O,t[++j]=g,t[++j]=i,t[++j]=p,t[++j]=E,t[++j]=M,t[++j]=d,t[++j]=g,t[++j]=i,t[++j]=p,t[++j]=E,t[++j]=M,t[++j]=v,t[++j]=g,t[++j]=i,t[++j]=p,t[++j]=E,t[++j]=M,t[++j]=f,t[++j]=g,t[++j]=i,t[++j]=p,t[++j]=E,t[++j]=M,t[++j]=O,t[++j]=b,t[++j]=i,t[++j]=p,t[++j]=E,t[++j]=M,t[++j]=d,t[++j]=b,t[++j]=i,t[++j]=p,t[++j]=E,t[++j]=M,t[++j]=v,t[++j]=b},Eo=function(t,n,i,r){var e=i.x0,u=i.x1,s=i.x2,h=i.x3,o=i.y0,a=i.y1,c=i.y2,f=i.y3,l=.5*(e+u),v=.5*(o+a),b=.5*(h+s),d=.5*(f+c),g=.5*r[0]/r[1],m=.5*r[0]/r[2],w=g*(u-e),O=g*(a-o),p=m*(h-e),D=m*(f-o),E=2*n-1;t[++E]=e,t[++E]=o,t[++E]=e+w,t[++E]=o+O,t[++E]=e+p,t[++E]=o+D,t[++E]=e+w+p,t[++E]=o+O+D,t[++E]=u-w,t[++E]=a-O,t[++E]=u,t[++E]=a,t[++E]=u-w+p,t[++E]=a-O+D,t[++E]=u+p,t[++E]=a+D,t[++E]=h-p,t[++E]=f-D,t[++E]=h+w-p,t[++E]=f+O-D,t[++E]=h,t[++E]=f,t[++E]=h+w,t[++E]=f+O,t[++E]=s-w-p,t[++E]=c-O-D,t[++E]=s-p,t[++E]=c-D,t[++E]=s-w,t[++E]=c-O,t[++E]=s,t[++E]=c,t[++E]=e+w,t[++E]=o+O,t[++E]=l,t[++E]=v,t[++E]=u-w,t[++E]=a-O,t[++E]=e+p,t[++E]=o+D,t[++E]=e+p+w,t[++E]=o+D+O,t[++E]=l+p,t[++E]=v+D,t[++E]=u+p-w,t[++E]=a+D-O,t[++E]=u+p,t[++E]=a+D;var M=.5*(e+s),S=.5*(o+c);t[++E]=.5*(e+h),t[++E]=.5*(o+f),t[++E]=M,t[++E]=S,t[++E]=M,t[++E]=S,t[++E]=.5*(u+s),t[++E]=.5*(a+c),t[++E]=h-p,t[++E]=f-D,t[++E]=h-p+w,t[++E]=f-D+O,t[++E]=b-p,t[++E]=d-D,t[++E]=s-p-w,t[++E]=c-D-O,t[++E]=s-p,t[++E]=c-D,t[++E]=h+w,t[++E]=f+O,t[++E]=b,t[++E]=d,t[++E]=s-w,t[++E]=c-O},Mo=function(t){function n(n,i,r,e){var u=t.call(this,n,i,r,e)||this;return u.radius=NaN,u.corner=NaN,u}return B(n,t),n.prototype.init=function(t){t.updateIndices(),wo(t.indices,this.vertexOffset,this.indexOffset)},n.prototype.update=function(t,n){this.updateVertexClippingStepAndUv(t,n),this.updateColorFill(t,n),this.updateColorStroke(t,n)},n.prototype.updateVertexClippingStepAndUv=function(t,n){var i=n.size,r=i.x,e=i.y,u=n.radius,s=r!==this.sizeX||e!==this.sizeY||u!==this.radius,h=z(n),o=this.transformLocalId!==h,a=n.stroke,c=a.align,f=a.enable?a.width:0,l=a.side,v=a.style,b=this.strokeAlign!==c||this.strokeWidth!==f||this.strokeSide!==l||this.strokeStyle!==v,d=n.corner,g=d!==this.corner,m=V(n),w=W(m),O=m!==this.texture||w!==this.textureTransformId,p=s||b;if(p||o||g||O){this.sizeX=r,this.sizeY=e,this.radius=u,this.transformLocalId=h,this.strokeAlign=c,this.strokeWidth=f,this.strokeSide=l,this.strokeStyle=v,this.corner=d,this.texture=m,this.textureTransformId=w;var D=this.vertexOffset;t.updateVertices(),Oo(t.vertices,D,0,0,r,e,c,f,u,n.transform.internalTransform,go),(p||g||o)&&(t.updateSteps(),Do(t.steps,D,f,l,v,d,go)),(p||g)&&(t.updateClippings(),po(t.clippings,D,d,go)),(p||O)&&(t.updateUvs(),Eo(t.uvs,D,X(m),go))}},n}(H),So=function(t,n,i,r,e){var s=M(n),h=4*s,o=2*s,a=bo+h,c=24+o;return t.check(i,r,a,c)?new u(t,i,r,a,c,[new Mo(i,r,a-h,c-o),new Jt(i+bo,r+24,h,o)]).init(n):null},To=function(t,n,i,r,e){return So(t,n,i,r)},jo=function(t,n,i,r,e,u){var s=-i+e;if(t<=s)return n<=(h=-r+e)&&u&it.TOP_LEFT?(a=t-s)*a+(c=n-h)*c<=e*e:(o=+r-e)<=n&&u&it.BOTTOM_LEFT?(a=t-s)*a+(c=n-o)*c<=e*e:-i<=t;var h,o,a,c,f=+i-e;return f<=t?n<=(h=-r+e)&&u&it.TOP_RIGHT?(a=t-f)*a+(c=n-h)*c<=e*e:(o=+r-e)<=n&&u&it.BOTTOM_RIGHT?(a=t-f)*a+(c=n-o)*c<=e*e:t<=+i:-r<=n&&n<=+r},No=function(t,n,i,r,e,u,s){var h=t.fill;if(h.enable||0<u){var o=t.radius*Math.min(r,e),a=t.corner;if(jo(n,i,r,e,o,a)){if(h.enable)return!0;var c=u*s,f=Math.max(0,r-c),l=Math.max(0,e-c),v=Math.max(0,o-c);if(!jo(n,i,f,l,v,a)){var b=t.stroke.side;if(b===Gt.ALL)return!0;if(n<=-f+v){var d=!!(b&Gt.LEFT);return i<=-l+v?!(!(g=!!(b&Gt.TOP))||!d)||(g?-f<=i:!!d&&n<=-f):+l-v<=i?!(!(m=!!(b&Gt.BOTTOM))||!d)||(m?+f<=i:!!d&&n<=-f):d}if(+f-v<=n){var g,m,w=!!(b&Gt.RIGHT);return i<=-l+v?!(!(g=!!(b&Gt.TOP))||!w)||(g?-f<=i:!!w&&+f<=n):+l-v<=i?!(!(m=!!(b&Gt.BOTTOM))||!w)||(m?+f<=i:!!w&&+f<=n):w}return i<=-l+v?!!(b&Gt.TOP):+l-v<=i&&!!(b&Gt.BOTTOM)}}}return!1},Io=function(t){function n(n){return void 0===n&&(n=r.RECTANGLE_ROUNDED),t.call(this,n)||this}return B(n,t),n.prototype.clone=function(){return new n(this.type).copy(this)},n.prototype.containsAbs=function(n,i,r,e,u,s,h){return!!t.prototype.containsAbsBBox.call(this,n,i,r,e)&&No(this,n,i,r,e,u,s)},n}(Ut),Co=function(t){function n(n){void 0===n&&(n=r.BUTTON);var i=t.call(this,n)||this;return i.$s=!1,i.nh=!1,i}return B(n,t),Object.defineProperty(n.prototype,"isToggle",{get:function(){return this.$s},set:function(t){this.$s=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isGrouped",{get:function(){return this.nh},set:function(t){this.nh=t},enumerable:!1,configurable:!0}),n.prototype.clone=function(){return new n(this.type).copy(this)},n.prototype.serialize=function(n){var i=t.prototype.serialize.call(this,n),r=this.$s?1:0,e=this.nh?2:0;return i[15]=n.addResource("[".concat(r|e,"]")),i},n}(Io),Ao=function(t,n,i){i=i||new Co;var r=n.resources,e=t[15];if(0<=e&&e<r.length){var u=n.getExtension(e);null==u&&(u=JSON.parse(r[e]),n.setExtension(e,u)),i.isToggle=!!(1&u[0]),i.isGrouped=!!(2&u[0])}return co(t,n,i)},Ro=function(t){function n(n){var i=t.call(this,$t.COLOR_FILL_AND_STROKE|$t.COLOR_TEXT|$t.COLOR_TEXT_OUTLINE|$t.CURSOR)||this,r=n.fill,e=r.color,u=i.toOnHovered(e),s=2*u;i.xh=e,i.Bh=Qt.toGrayscale(e),i._h=Qt.darken(e,s),i.Ph=Qt.darken(e,u);var h=r.alpha;i.Uh=h,i.Fh=.5*h;var o=n.stroke,a=o.color,c=i.toOnHovered(a),f=2*c;i.Gh=a,i.Hh=Qt.toGrayscale(a),i.zh=Qt.darken(a,f),i.Vh=Qt.darken(a,c);var l=o.alpha;i.Wh=l,i.Xh=.5*l;var v=n.text,b=v.color;i.Xs=b,i.Kh=Qt.toGrayscale(b);var d=v.alpha;i.Ks=d,i.Yh=.5*d;var g=v.outline,m=g.color;i.Jh=m,i.Zh=Qt.toGrayscale(m);var w=g.alpha;return i.qh=w,i.Qh=.5*w,i}return B(n,t),n.prototype.toOnHovered=function(t){var n,i=Qt.toLuma(t);return 128<=i?.15*(1-(n=(i-128)/127))+.03*n:-.15*(1-(n=(127-i)/127))-.175*n},n.prototype.execute=function(t,n,i){var r=t.state;t.fill.set(void 0,this.getFillColor(r),this.getFillAlpha(r)),t.stroke.set(void 0,this.getStrokeColor(r),this.getStrokeAlpha(r)),t.text.set(void 0,this.getTextColor(r),this.getTextAlpha(r)),t.text.outline.set(void 0,this.getTextOutlineColor(r),this.getTextOutlineAlpha(r)),t.cursor=this.getCursor(r),n.written|=this.reset},n.prototype.getFillColor=function(t){return t.inDisabled?this.Bh:t.isPressed||t.isActive?this._h:t.isFocused||t.isHovered?this.Ph:this.xh},n.prototype.getFillAlpha=function(t){return t.inDisabled?this.Fh:this.Uh},n.prototype.getStrokeColor=function(t){return t.inDisabled?this.Hh:t.isPressed||t.isActive?this.zh:t.isFocused||t.isHovered?this.Vh:this.Gh},n.prototype.getStrokeAlpha=function(t){return t.inDisabled?this.Xh:this.Wh},n.prototype.getTextColor=function(t){return t.inDisabled?this.Kh:this.Xs},n.prototype.getTextAlpha=function(t){return t.inDisabled?this.Yh:this.Ks},n.prototype.getTextOutlineColor=function(t){return t.inDisabled?this.Zh:this.Jh},n.prototype.getTextOutlineAlpha=function(t){return t.inDisabled?this.Qh:this.qh},n.prototype.getCursor=function(t){return t.isActionable?"pointer":""},n}(en),Lo=function(t){function n(n){var i=t.call(this,$t.COLOR_FILL_AND_STROKE|$t.COLOR_TEXT|$t.COLOR_TEXT_OUTLINE|$t.CURSOR)||this,r=n.fill,e=r.color;i.$h=e;var u=i.toOnHovered(e),s=2*u;i.no=Qt.darken(e,s),i.io=Qt.darken(e,u);var h=15197671;i.xh=h;var o=i.toOnHovered(h),a=2*o;i._h=Qt.darken(h,a),i.Ph=Qt.darken(h,o);var c=r.alpha;i.Uh=c,i.Fh=.5*c;var f=n.stroke,l=f.color;i.ro=l;var v=i.toOnHovered(l),b=2*v;i.eo=Qt.darken(l,b),i.uo=Qt.darken(l,v);var d=15197671;i.Gh=d;var g=i.toOnHovered(d),m=2*g;i.zh=Qt.darken(d,m),i.so=Qt.darken(d,g);var w=f.alpha;i.Wh=w,i.Xh=.5*w;var O=n.text,p=O.color;i.ho=p,i.Kh=Qt.toGrayscale(p),i.Xs=5197647;var D=O.alpha;i.Ks=D,i.Yh=.5*D;var E=O.outline,M=E.color;i.Jh=M,i.Zh=Qt.toGrayscale(M);var S=E.alpha;return i.qh=S,i.Qh=.5*S,i}return B(n,t),n.prototype.toOnHovered=function(t){var n,i=Qt.toLuma(t);return 128<=i?.15*(1-(n=(i-128)/127))+.03*n:-.15*(1-(n=(127-i)/127))-.175*n},n.prototype.execute=function(t,n,i){var r=t.state;t.fill.set(void 0,this.getFillColor(r),this.getFillAlpha(r)),t.stroke.set(void 0,this.getStrokeColor(r),this.getStrokeAlpha(r)),t.text.set(void 0,this.getTextColor(r),this.getTextAlpha(r)),t.text.outline.set(void 0,this.getTextOutlineColor(r),this.getTextOutlineAlpha(r)),t.cursor=this.getCursor(r),n.written|=this.reset},n.prototype.getFillColor=function(t){return t.inDisabled?this.xh:t.isActive?t.isPressed?this.no:t.isFocused||t.isHovered?this.io:this.$h:t.isPressed?this._h:t.isFocused||t.isHovered?this.Ph:this.xh},n.prototype.getFillAlpha=function(t){return t.inDisabled?this.Fh:this.Uh},n.prototype.getStrokeColor=function(t){return t.inDisabled?this.Gh:t.isActive?t.isPressed?this.eo:t.isFocused||t.isHovered?this.uo:this.ro:t.isPressed?this.zh:t.isFocused||t.isHovered?this.so:this.Gh},n.prototype.getStrokeAlpha=function(t){return t.inDisabled?this.Xh:this.Wh},n.prototype.getTextColor=function(t){return t.inDisabled?this.Kh:t.isActive?this.ho:this.Xs},n.prototype.getTextAlpha=function(t){return t.inDisabled?this.Yh:this.Ks},n.prototype.getTextOutlineColor=function(t){return t.inDisabled?this.Zh:this.Jh},n.prototype.getTextOutlineAlpha=function(t){return t.inDisabled?this.Qh:this.qh},n.prototype.getCursor=function(t){return t.isActionable?"pointer":""},n}(en),yo=function(t){function n(n){var i=t.call(this,n)||this;return n instanceof Co&&(i.$s=n.isToggle,i.nh=n.isGrouped),i}return B(n,t),n.prototype.isActionable=function(){return!0},n.prototype.initialize=function(n){this.actions.unshift(this.$s?new Lo(this):new Ro(this)),t.prototype.initialize.call(this,n)},n.prototype.onClick=function(n,i){var r=n.state,e=r.isClicked;r.lock(),t.prototype.onClick.call(this,n,i),!e&&r.isClicked&&(this.$s?r.isActive=!r.isActive:r.isActive||(r.isActivated=!0)),r.unlock()},n.prototype.onStateChange=function(n,i,r){t.prototype.onStateChange.call(this,n,i,r),this.$s&&this.nh&&i.is(lt.ACTIVATED)&&this.onActivated(n)},n.prototype.onActivated=function(t){var n=t.parent;if(null!=n)for(var i=n.children,r=0,e=i.length;r<e;++r){var u=i[r];u!==t&&u instanceof Co&&u.isToggle&&u.isGrouped&&(u.state.isActive=!1)}},n}(Ze),ko=function(){e[r.BUTTON]=To,n[r.BUTTON]=Ao,vo[r.BUTTON]=yo,mr.set(r.BUTTON,wt.PRIMITIVE|wt.STROKE_SIDE|wt.BORDER_RADIUS)},xo=[0,0],Bo=new t.Point,_o=function(t,n){var i=3*n-1;t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=0,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=0,t[++i]=1,t[++i]=0,t[++i]=0,t[++i]=1,t[++i]=1,t[++i]=0,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=0,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=1},Po=function(t,n,i){var r=3*i-1;t[++r]=n,t[++r]=n+1,t[++r]=n+3,t[++r]=n+1,t[++r]=n+4,t[++r]=n+3,t[++r]=n+1,t[++r]=n+2,t[++r]=n+4,t[++r]=n+2,t[++r]=n+5,t[++r]=n+4,t[++r]=n+3,t[++r]=n+4,t[++r]=n+6,t[++r]=n+4,t[++r]=n+7,t[++r]=n+6,t[++r]=n+4,t[++r]=n+5,t[++r]=n+7,t[++r]=n+5,t[++r]=n+8,t[++r]=n+7},Uo=function(t,n,i,r,e,u,s,h,o,a){var c=Bo,f=s*h,l=.5*e+(0<=e?+f:-f),v=.5*u+(0<=u?+f:-f);c.set(-l+i,-v+r),o.apply(c,c);var b=c.x,d=c.y;c.set(0+i,-v+r),o.apply(c,c);var g=c.x,m=c.y,w=g-b,O=m-d;c.set(i,r),o.apply(c,c);var D=c.x,E=c.y,M=D+(D-g),S=E+(E-m),T=D-w,j=E-O,N=2*n-1;t[++N]=b,t[++N]=d,t[++N]=g,t[++N]=m,t[++N]=g+w,t[++N]=m+O,t[++N]=T,t[++N]=j,t[++N]=D,t[++N]=E,t[++N]=D+w,t[++N]=E+O,t[++N]=M-w,t[++N]=S-O,t[++N]=M,t[++N]=S,t[++N]=M+w,t[++N]=S+O,a[0]=p(b,d,g,m),a[1]=p(b,d,T,j)},Fo=function(t,n,i,r,e,u){for(var s=o(e),h=6*i-1,a=3*i,c=0;c<9;c+=1,a+=3)t[++h]=r,t[++h]=s,t[++h]=u[0],t[++h]=u[1],t[++h]=1+n[a],t[++h]=1+n[a+1]},Go=function(t,n,i){var r=i.x0,e=i.x1,u=i.x2,s=i.x3,h=i.y0,o=i.y1,a=i.y2,c=i.y3,f=2*n-1;t[++f]=r,t[++f]=h,t[++f]=.5*(r+e),t[++f]=.5*(h+o),t[++f]=e,t[++f]=o,t[++f]=.5*(r+s),t[++f]=.5*(h+c),t[++f]=.5*(r+u),t[++f]=.5*(h+a),t[++f]=.5*(e+u),t[++f]=.5*(o+a),t[++f]=s,t[++f]=c,t[++f]=.5*(s+u),t[++f]=.5*(c+a),t[++f]=u,t[++f]=a},Ho=function(t){function n(n,i){return t.call(this,n,i,9,8)||this}return B(n,t),n.prototype.init=function(t){t.updateClippings(),t.updateIndices();var n=this.vertexOffset;_o(t.clippings,n),Po(t.indices,n,this.indexOffset)},n.prototype.update=function(t,n){this.updateVertexAndStep(t,n),this.updateColorFill(t,n),this.updateColorStroke(t,n),this.updateUv(t,n)},n.prototype.updateVertexAndStep=function(t,n){var i=n.size,r=i.x,e=i.y,u=r!==this.sizeX||e!==this.sizeY,s=z(n),h=this.transformLocalId!==s,o=n.stroke,a=o.align,c=o.enable?o.width:0,f=o.style,l=this.strokeAlign!==a||this.strokeWidth!==c||this.strokeStyle!==f;(u||h||l)&&(this.sizeX=r,this.sizeY=e,this.transformLocalId=s,this.strokeAlign=a,this.strokeWidth=c,this.strokeStyle=f,t.updateVertices(),t.updateSteps(),Uo(t.vertices,this.vertexOffset,0,0,r,e,a,c,n.transform.internalTransform,xo),Fo(t.steps,t.clippings,this.vertexOffset,c,f,xo))},n.prototype.updateUv=function(t,n){var i=V(n),r=W(i);if(i!==this.texture||r!==this.textureTransformId){this.texture=i,this.textureTransformId=r,t.updateUvs();var e=X(i);Go(t.uvs,this.vertexOffset,e)}},n}(H),zo=function(t,n,i,r,e){var s=M(n),h=4*s,o=2*s,a=9+h,c=8+o;return t.check(i,r,a,c)?new u(t,i,r,a,c,[new Ho(i,r),new Jt(i+9,r+8,h,o)]).init(n):null},Vo=function(t){function n(n){return void 0===n&&(n=r.CIRCLE),t.call(this,n)||this}return B(n,t),n.prototype.clone=function(){return new n(this.type).copy(this)},n.prototype.containsAbs=function(n,i,r,e,u,s,h){return!!t.prototype.containsAbsBBox.call(this,n,i,r,e)&&Ft(this,n,i,r,e,u,s)},n}(Ut),Wo=function(t,n,i){return co(t,n,i||new Vo)},Xo=function(){e[r.CIRCLE]=zo,n[r.CIRCLE]=Wo},Ko=new t.Point,Yo=function(t){return t?t.formatted.length:0},Jo=function(t){return 12*Math.ceil(Yo(t)/12)},Zo=function(t,n){return n?4*t+2:4*t},qo=function(t,n){return Zo(t,n)-2},Qo=function(t,n,i,r){for(var e=3*n-1,u=3*(n+i)-1,s=0;s<r;++s)t[++e]=1,t[++e]=0,t[++e]=3,t[++e]=0,t[++e]=1,t[++e]=5,t[++e]=1,t[++e]=0,t[++e]=4,t[++e]=0,t[++e]=1,t[++e]=6;for(;e<u;)t[++e]=1,t[++e]=0,t[++e]=3,t[++e]=0,t[++e]=1,t[++e]=5},$o=function(t,n,i,r){for(var e=3*i-1,u=3*(i+r)-1,s=n;e<u;)t[++e]=s+0,t[++e]=s+2,t[++e]=s+1,t[++e]=s+1,t[++e]=s+2,t[++e]=s+3,s+=2},ta=function(t,n,i,r,e,u){for(var s=1/Math.max(1e-5,u),h=e.x0,o=e.x1,a=e.x2,c=e.x3,f=e.y0,l=e.y1,v=e.y2,b=e.y3,d=o-h,g=l-f,m=a-c,w=v-b,O=(i<<1)-1,p=(i+r<<1)-1,D=(i<<2)-8;O<p;){var E=n[D+=8]*s;t[++O]=h+E*d,t[++O]=f+E*g,t[++O]=c+E*m,t[++O]=b+E*w}},na=function(t,n,i,r,e,u,s,h,o,a,c,f){var l=U;null==l&&(U=l=[]);for(var v=f.a,b=f.b,d=f.c,g=f.d,m=f.tx,w=f.ty,O=0;O<u;++O){var p=O<<1,D=h[p],E=h[p+1];l[p]=v*D+d*E+m,l[p+1]=b*D+g*E+w}return ra(t,n,i,r,e,u,s,l,o,a,c)},ia=function(t,n,i,r,e,u,s,h,o,a,c,f,l,v,b){n[++t]=s,n[++t]=h,r[++i]=o,r[++i]=a,r[++i]=c,r[++i]=f,r[++i]=l,r[++i]=v,u[e+=1]=b,n[++t]=s,n[++t]=h,r[++i]=o,r[++i]=a,r[++i]=c,r[++i]=f,r[++i]=l,r[++i]=v,u[e+=4]=b},ra=function(t,n,i,r,e,u,s,h,o,a,c){var f=o.length;if(0<f){if(s){for(var l=0,v=0,b=r,d=0,g=o[0],m=1;m<f;++m)2<=(d=o[m])-g&&(v=ua(t,n,i,b,-1,h,g,d,u,a,c,v),l=Math.max(l,v),b+=Zo(d-g,!1)),g=d;return 2<=(d=o[0]+u)-g?(v=ua(t,n,i,b,r+e-b,h,g,d,u,a,c,v),l=Math.max(l,v),b+=Zo(d-g,!1)):ea(t,n,i,b,r+e-b,h,g,d,u,a,c,v),l}for(l=0,v=0,b=r,2<=(d=o[0])&&(v=ua(t,n,i,b,-1,h,0,d,u,a,c,v),l=Math.max(l,v),b+=Zo(d,!1)),g=d,m=1;m<f;++m)2<=(d=o[m])-g&&(v=ua(t,n,i,b,-1,h,g,d,u,a,c,v),l=Math.max(l,v),b+=Zo(d-g,!1)),g=d;return 2<=(d=u)-g?(v=ua(t,n,i,b,r+e-b,h,g,d,u,a,c,v),l=Math.max(l,v),b+=Zo(d-g,!1)):ea(t,n,i,b,r+e-b,h,g,d,u,a,c,v),l}return s?sa(t,n,i,r,e,h,0,u,u,a,c):ua(t,n,i,r,e,h,0,u,u,a,c,0)},ea=function(t,n,i,r,e,u,s,h,a,c,f,l){if(0<=e)for(var v=o(f),b=(r<<1)-1,d=6*r-1,g=(r<<2)-1,m=(r+e<<1)-1,w=s%a<<1,O=u[w],p=u[w+1];b<m;)t[++b]=O,t[++b]=p,n[++d]=0,n[++d]=v,n[++d]=-1,n[++d]=0,n[++d]=1,n[++d]=0,i[++g]=l,i[++g]=0,i[++g]=0,i[++g]=l;return 0},ua=function(t,n,i,r,e,u,s,a,c,f,l,v){var b=o(l),d=s%c<<1,g=u[d],m=u[d+1],w=(s+1)%c<<1,O=u[w],D=u[w+1],E=g-(O-g),M=m-(D-m),S=(r<<1)-1,T=6*r-1,j=(r<<2)-1,N=0;ia(S,t,T,n,j,i,g,m,f,b,E,M,O,D,v),ia(S+=4,t,T+=12,n,j+=8,i,g,m,f,b,E,M,O,D,N),S+=4,T+=12,j+=8;for(var I=s+1,C=a-1;I<C;++I){E=g,M=m,g=O,m=D;var A=(I+1)%c<<1;O=u[A],D=u[A+1],N+=p(E,M,g,m),ia(S,t,T,n,j,i,g,m,f,b,E,M,O,D,N),ia(S+=4,t,T+=12,n,j+=8,i,g,m,f,b,E,M,O,D,N),S+=4,T+=12,j+=8}E=g,M=m,O=(g=O)+(g-E),D=(m=D)+(m-M),N+=p(E,M,g,m),ia(S,t,T,n,j,i,g,m,f,b,E,M,O,D,N),ia(S+=4,t,T+=12,n,j+=8,i,g,m,f,b,E,M,O,D,N),S+=4,T+=12,j+=8;var R=h(N,f,l,Ko),L=R.x,y=R.y,k=(r<<2)-1;for(I=k,C=k+8;I<C;I+=4)i[I+2]=L,i[I+3]=y,i[I+4]=v;for(I=k+8;I<j;I+=4)i[I+2]=L,i[I+3]=y,i[I+4]=N;if(0<=e)for(var x=(r+e<<1)-1;S<x;)t[++S]=g,t[++S]=m,n[++T]=0,n[++T]=b,n[++T]=E,n[++T]=M,n[++T]=O,n[++T]=D,i[++j]=N,i[++j]=L,i[++j]=y,i[++j]=N;return N},sa=function(t,n,i,r,e,u,s,a,c,f,l){for(var v=o(l),b=(a-1)%c<<1,d=0,g=0,m=u[b],w=u[b+1],O=s%c<<1,D=u[O],E=u[O+1],M=0,S=(r<<1)-1,T=6*r-1,j=(r<<2)-1,N=s;N<a;++N){d=m,g=w,m=D,w=E;var I=(N+1)%c<<1;D=u[I],E=u[I+1],M+=p(d,g,m,w),ia(S,t,T,n,j,i,m,w,f,v,d,g,D,E,M),ia(S+=4,t,T+=12,n,j+=8,i,m,w,f,v,d,g,D,E,M),S+=4,T+=12,j+=8}d=m,g=w,m=D,w=E;var C=(s+1)%c<<1;D=u[C],E=u[C+1],M+=p(d,g,m,w),ia(S,t,T,n,j,i,m,w,f,v,d,g,D,E,M),S+=4,T+=12,j+=8;var A=h(M,f,l,Ko),R=A.x,L=A.y;for(N=(r<<2)-1;N<j;N+=4)i[N+2]=R,i[N+3]=L,i[N+4]=-1;if(0<=e)for(var y=(r+e<<1)-1;S<y;)t[++S]=m,t[++S]=w,n[++T]=f,n[++T]=v,n[++T]=d,n[++T]=g,n[++T]=D,n[++T]=E,i[++j]=M,i[++j]=R,i[++j]=L,i[++j]=-1;return M},ha=function(t){function n(n,i,r,e){var u=t.call(this,n,i,r,e)||this;return u.pointId=-1,u.pointCount=0,u.pointsClosed=!1,u.length=1,u}return B(n,t),n.prototype.init=function(t){t.updateIndices(),$o(t.indices,this.vertexOffset,this.indexOffset,this.indexCount)},n.prototype.isCompatible=function(t){return Zo(Jo(t.points),!0)===this.vertexCount},n.prototype.update=function(t,n){this.updateLineClipping(t,n),this.updateLineVertexStepAndColorFill(t,n),this.updateColorStroke(t,n),this.updateLineUv(t,n)},n.prototype.updateLineClipping=function(t,n){var i=n.points;if(i){var r=i.formatted.length;this.pointCount!==r&&(this.pointCount=r,this.pointId=-1,t.updateClippings(),Qo(t.clippings,this.vertexOffset,this.vertexCount,r))}},n.prototype.updateLineVertexStepAndColorFill=function(t,n){var i=n.points;if(i){var r=i.id,e=i.formatted,u=!!(e.style&F.CLOSED),s=r!==this.pointId||u!==this.pointsClosed,h=n.stroke,o=h.enable?h.width:0,a=h.style,c=this.strokeWidth!==o||this.strokeStyle!==a,f=z(n),l=this.transformLocalId!==f;(s||l||c)&&(this.pointId=r,this.pointsClosed=u,this.strokeWidth=o,this.strokeStyle=a,this.transformLocalId=f,s&&(this.textureTransformId=NaN),t.updateVertices(),t.updateSteps(),t.updateColorFills(),this.length=na(t.vertices,t.steps,t.colorFills,this.vertexOffset,this.vertexCount,this.pointCount,this.pointsClosed,e.values,e.segments,o,a,n.transform.internalTransform))}},n.prototype.updateLineUv=function(t,n){var i=V(n),r=W(i);i===this.texture&&r===this.textureTransformId||(this.texture=i,this.textureTransformId=r,t.updateUvs(),ta(t.uvs,t.colorFills,this.vertexOffset,this.vertexCount,X(i),this.length))},n}(H),oa=[0,0,0],aa=new t.Point,ca=function(t,n){var i=3*n-1;t[++i]=0,t[++i]=0,t[++i]=0,t[++i]=1,t[++i]=0,t[++i]=0,t[++i]=1,t[++i]=0,t[++i]=0,t[++i]=0,t[++i]=1,t[++i]=0,t[++i]=0,t[++i]=1,t[++i]=0,t[++i]=1,t[++i]=0,t[++i]=0,t[++i]=1,t[++i]=0,t[++i]=0},fa=function(t,n,i){var r=3*i-1;t[++r]=n+0,t[++r]=n+1,t[++r]=n+2,t[++r]=n+0,t[++r]=n+3,t[++r]=n+4,t[++r]=n+0,t[++r]=n+5,t[++r]=n+6},la=function(t,n,i,r,e,u,s,h,o,a){var c=s*h,f=.5*e+(0<=e?+c:-c),l=.5*u+(0<=u?+c:-c),v=2*f*l/(f+Math.sqrt(f*f+4*l*l)),b=aa;b.set(i,r-l),o.apply(b,b);var d=b.x,g=b.y;b.set(i,r),o.apply(b,b);var m=b.x,w=b.y;b.set(i+f,r),o.apply(b,b);var O=m-d,D=w-g,E=b.x+O,M=b.y+D,S=m+(m-b.x)+O,T=w+(w-b.y)+D;b.set(i,r+l-v),o.apply(b,b);var j=b.x,N=b.y,I=m+O,C=w+D;a[0]=p(I,C,j,N),a[1]=p(E,M,I,C),a[2]=p(d,g,m,w);var A=(n<<1)-1;t[++A]=j,t[++A]=N,t[++A]=d,t[++A]=g,t[++A]=E,t[++A]=M,t[++A]=E,t[++A]=M,t[++A]=S,t[++A]=T,t[++A]=S,t[++A]=T,t[++A]=d,t[++A]=g},va=function(t,n,i,r,e,u,s){for(var h=o(u),a=s[0],c=6*i-1,f=3*i,l=0;l<r;l+=1,f+=3)t[++c]=e,t[++c]=h,t[++c]=a,t[++c]=a,t[++c]=1+n[f],t[++c]=1+n[f+1]},ba=function(t,n,i,r){var e=n.x0,u=n.x1,s=n.x2,h=n.x3,o=n.y0,a=n.y1,c=n.y2,f=n.y3,l=.5*(e+u),v=.5*(o+a),b=1-.5*r[0]/r[2],d=l+b*(h-e),g=v+b*(f-o),m=(i<<1)-1;t[++m]=d,t[++m]=g,t[++m]=l,t[++m]=v,t[++m]=s,t[++m]=c,t[++m]=s,t[++m]=c,t[++m]=h,t[++m]=f,t[++m]=h,t[++m]=f,t[++m]=l,t[++m]=v},da=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.updateColorFill=function(t,n){var i=n.points;if(null!=i){var r=i.getMarker();if(null!=r){var e=this.toMarker(r).fill,u=n.visible&&e.enable,s=e.color,h=u?e.alpha:0;s===this.colorFill&&h===this.alphaFill||(this.colorFill=s,this.alphaFill=h,t.updateColorFills(),G(s,h,this.vertexOffset,this.vertexCount,t.colorFills))}}},n}(H),ga=function(n){function i(t,i){var r=n.call(this,t,i,7,3)||this;return r.pointId=-1,r}return B(i,n),i.prototype.init=function(t){t.updateClippings(),t.updateIndices(),ca(t.clippings,this.vertexOffset),fa(t.indices,this.vertexOffset,this.indexOffset)},i.prototype.update=function(t,n){this.updateVertexStepAndUv(t,n),this.updateColorFill(t,n),this.updateColorStroke(t,n)},i.prototype.updateVertexStepAndUv=function(n,r){var e,u=r.points;if(null!=u){var s=u.getMarker();if(null!=s){var h=this.toMarker(s),o=h.size,a=o.x,c=o.y,f=a!==this.sizeX||c!==this.sizeY,l=z(r),v=this.transformLocalId!==l,b=r.stroke,d=b.align,g=b.enable?b.width:0,m=b.style,w=this.strokeAlign!==d||this.strokeWidth!==g||this.strokeStyle!==m,O=V(r),p=W(O),D=O!==this.texture||p!==this.textureTransformId,E=f||w,M=u.id,S=M!==this.pointId;if(E||v||D||S){this.sizeX=a,this.sizeY=c,this.transformLocalId=l,this.strokeAlign=d,this.strokeWidth=g,this.strokeStyle=m,this.texture=O,this.textureTransformId=p,this.pointId=M;var T=this.vertexOffset,j=null!==(e=i.WORK)&&void 0!==e?e:i.WORK=new t.Matrix;j.copyFrom(h.transform).prepend(r.transform.internalTransform),n.updateVertices(),la(n.vertices,T,0,0,a,c,d,g,j,oa),(E||v)&&(n.updateSteps(),va(n.steps,n.clippings,T,7,g,m,oa)),(E||D)&&(n.updateUvs(),ba(n.uvs,X(O),T,oa))}}}},i}(da),ma=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.toMarker=function(t){return t.head},n}(ga),wa=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.toMarker=function(t){return t.tail},n}(ga),Oa=function(n){function i(t,i){var r=n.call(this,t,i,9,8)||this;return r.pointId=-1,r}return B(i,n),i.prototype.init=function(t){t.updateClippings(),t.updateIndices();var n=this.vertexOffset;_o(t.clippings,n),Po(t.indices,n,this.indexOffset)},i.prototype.update=function(t,n){this.updateVertexAndStep(t,n),this.updateColorFill(t,n),this.updateColorStroke(t,n),this.updateUv(t,n)},i.prototype.updateVertexAndStep=function(n,r){var e,u=r.points;if(null!=u){var s=u.getMarker();if(null!=s){var h=this.toMarker(s),o=h.size,a=o.x,c=o.y,f=a!==this.sizeX||c!==this.sizeY,l=z(r),v=this.transformLocalId!==l,b=r.stroke,d=b.align,g=b.enable?b.width:0,m=b.style,w=this.strokeAlign!==d||this.strokeWidth!==g||this.strokeStyle!==m,O=u.id,p=O!==this.pointId;if(f||v||w||p){this.sizeX=a,this.sizeY=c,this.transformLocalId=l,this.strokeAlign=d,this.strokeWidth=g,this.strokeStyle=m,this.pointId=O;var D=null!==(e=i.WORK)&&void 0!==e?e:i.WORK=new t.Matrix;D.copyFrom(h.transform).prepend(r.transform.internalTransform),n.updateVertices(),n.updateSteps(),Uo(n.vertices,this.vertexOffset,0,0,a,c,d,g,D,xo),Fo(n.steps,n.clippings,this.vertexOffset,g,m,xo)}}}},i.prototype.updateUv=function(t,n){var i=V(n),r=W(i);if(i!==this.texture||r!==this.textureTransformId){this.texture=i,this.textureTransformId=r,t.updateUvs();var e=X(i);Go(t.uvs,this.vertexOffset,e)}},i}(da),pa=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.toMarker=function(t){return t.head},n}(Oa),Da=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.toMarker=function(t){return t.tail},n}(Oa),Ea=function(){function n(t,n){this.vertexOffset=t,this.indexOffset=n,this.vertexCount=0,this.indexCount=0,this.texture=null}return n.prototype.init=function(t){},n.prototype.isCompatible=function(t){return!0},n.prototype.update=function(t,n){this.texture=V(n)},n.prototype.buildUnit=function(n){var i=this.texture||t.Texture.WHITE,r=i.baseTexture;if(r!==n.baseTexture){n.baseTexture=r;var e=this.indexOffset;n.push(i,e)}},n}(),Ma=24,Sa=16,Ta=[0,0,0,0],ja=new t.Point,Na=function(t,n,i){var r=1-i[0],e=1-i[1],u=3*n-1;t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=e,t[++u]=0,t[++u]=0,t[++u]=e,t[++u]=0,t[++u]=0,t[++u]=e,t[++u]=0,t[++u]=0,t[++u]=e,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=r,t[++u]=0,t[++u]=0,t[++u]=r,t[++u]=0,t[++u]=0,t[++u]=r,t[++u]=0,t[++u]=0,t[++u]=r,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0},Ia=function(t,n,i){var r=3*i-1;t[++r]=n+0,t[++r]=n+1,t[++r]=n+4,t[++r]=n+4,t[++r]=n+1,t[++r]=n+2,t[++r]=n+4,t[++r]=n+2,t[++r]=n+5,t[++r]=n+5,t[++r]=n+2,t[++r]=n+3,t[++r]=n+8,t[++r]=n+6,t[++r]=n+9,t[++r]=n+9,t[++r]=n+6,t[++r]=n+7,t[++r]=n+9,t[++r]=n+7,t[++r]=n+10,t[++r]=n+10,t[++r]=n+7,t[++r]=n+11,t[++r]=n+12,t[++r]=n+16,t[++r]=n+13,t[++r]=n+13,t[++r]=n+16,t[++r]=n+17,t[++r]=n+13,t[++r]=n+17,t[++r]=n+14,t[++r]=n+14,t[++r]=n+17,t[++r]=n+15,t[++r]=n+18,t[++r]=n+20,t[++r]=n+21,t[++r]=n+18,t[++r]=n+21,t[++r]=n+22,t[++r]=n+18,t[++r]=n+22,t[++r]=n+19,t[++r]=n+19,t[++r]=n+22,t[++r]=n+23},Ca=function(t,n,i,r,e,u,s,h,o,a){var c=s*h,f=.5*e+(0<=e?+c:-c),l=.5*u+(0<=u?+c:-c),v=ja;v.set(i-f,r-l),o.apply(v,v);var b=v.x,d=v.y;v.set(i+f,r-l),o.apply(v,v);var g=v.x,m=v.y;v.set(i+f,r+l),o.apply(v,v);var w=v.x,O=v.y,D=b+(w-g),E=d+(O-m),M=.5*p(b,d,g,m),S=.5*p(g,m,w,O),T=1,j=1;M<=S?j=M/S:T=S/M,a[0]=T,a[1]=j,a[2]=M,a[3]=S;var N=T*(g-b)*.5,I=T*(m-d)*.5,C=j*(D-b)*.5,A=j*(E-d)*.5,R=(n<<1)-1;t[++R]=b,t[++R]=d,t[++R]=b+N,t[++R]=d+I,t[++R]=g-N,t[++R]=m-I,t[++R]=g,t[++R]=m,t[++R]=b+N+C,t[++R]=d+I+A,t[++R]=g-N+C,t[++R]=m-I+A,t[++R]=D+N-C,t[++R]=E+I-A,t[++R]=w-N-C,t[++R]=O-I-A,t[++R]=D,t[++R]=E,t[++R]=D+N,t[++R]=E+I,t[++R]=w-N,t[++R]=O-I,t[++R]=w,t[++R]=O,t[++R]=b,t[++R]=d,t[++R]=b+C,t[++R]=d+A,t[++R]=D-C,t[++R]=E-A,t[++R]=D,t[++R]=E,t[++R]=b+C+N,t[++R]=d+A+I,t[++R]=D-C+N,t[++R]=E-A+I,t[++R]=g+C-N,t[++R]=m+A-I,t[++R]=w-C-N,t[++R]=O-A-I,t[++R]=g,t[++R]=m,t[++R]=g+C,t[++R]=m+A,t[++R]=w-C,t[++R]=O-A,t[++R]=w,t[++R]=O},Aa=function(t,n,i,r,e,u){var s,h,a,c,f,l,v,b,d=o(e),g=u[0],m=u[1],w=Math.max(0,1-g),O=Math.max(0,1-m),p=u[2],D=u[3];r&Gt.TOP?(s=2,h=1+O):(s=-2,h=-1-O),r&Gt.RIGHT?(a=2,c=1+w):(a=-2,c=-1-w),r&Gt.BOTTOM?(f=2,l=1+O):(f=-2,l=-1-O),r&Gt.LEFT?(v=2,b=1+w):(v=-2,b=-1-w);var E=6*(t-1)-1;Ra(n,E+=6,i,d,p,D,v,s),Ra(n,E+=6,i,d,p,D,b,s),Ra(n,E+=6,i,d,p,D,c,s),Ra(n,E+=6,i,d,p,D,a,s),Ra(n,E+=6,i,d,p,D,b,h),Ra(n,E+=6,i,d,p,D,c,h),Ra(n,E+=6,i,d,p,D,b,l),Ra(n,E+=6,i,d,p,D,c,l),Ra(n,E+=6,i,d,p,D,v,f),Ra(n,E+=6,i,d,p,D,b,f),Ra(n,E+=6,i,d,p,D,c,f),Ra(n,E+=6,i,d,p,D,a,f),Ra(n,E+=6,i,d,p,D,v,s),Ra(n,E+=6,i,d,p,D,v,h),Ra(n,E+=6,i,d,p,D,v,l),Ra(n,E+=6,i,d,p,D,v,f),Ra(n,E+=6,i,d,p,D,b,h),Ra(n,E+=6,i,d,p,D,b,l),Ra(n,E+=6,i,d,p,D,c,h),Ra(n,E+=6,i,d,p,D,c,l),Ra(n,E+=6,i,d,p,D,a,s),Ra(n,E+=6,i,d,p,D,a,h),Ra(n,E+=6,i,d,p,D,a,l),Ra(n,E+=6,i,d,p,D,a,f)},Ra=function(t,n,i,r,e,u,s,h){t[++n]=i,t[++n]=r,t[++n]=e,t[++n]=u,t[++n]=s,t[++n]=h},La=function(t,n,i,r){var e=i.x0,u=i.y0,s=i.y1,h=i.x1,o=i.y2,a=i.x2,c=i.y3,f=i.x3,l=r[0],v=r[1],b=l*(h-e)*.5,d=l*(s-u)*.5,g=v*(f-e)*.5,m=v*(c-u)*.5,w=(n<<1)-1;t[++w]=e,t[++w]=u,t[++w]=e+b,t[++w]=u+d,t[++w]=h-b,t[++w]=s-d,t[++w]=h,t[++w]=s,t[++w]=e+b+g,t[++w]=u+d+m,t[++w]=h-b+g,t[++w]=s-d+m,t[++w]=f+b-g,t[++w]=c+d-m,t[++w]=a-b-g,t[++w]=o-d-m,t[++w]=f,t[++w]=c,t[++w]=f+b,t[++w]=c+d,t[++w]=a-b,t[++w]=o-d,t[++w]=a,t[++w]=o,t[++w]=e,t[++w]=u,t[++w]=e+g,t[++w]=u+m,t[++w]=f-g,t[++w]=c-m,t[++w]=f,t[++w]=c,t[++w]=e+g+b,t[++w]=u+m+d,t[++w]=f-g+b,t[++w]=c-m+d,t[++w]=h+g-b,t[++w]=s+m-d,t[++w]=a-g-b,t[++w]=o-m-d,t[++w]=h,t[++w]=s,t[++w]=h+g,t[++w]=s+m,t[++w]=a-g,t[++w]=o-m,t[++w]=a,t[++w]=o},ya=function(n){function i(t,i){var r=n.call(this,t,i,Ma,Sa)||this;return r.pointId=-1,r}return B(i,n),i.prototype.init=function(t){t.updateIndices(),Ia(t.indices,this.vertexOffset,this.indexOffset)},i.prototype.update=function(t,n){this.updateVertexClippingStepAndUv(t,n),this.updateColorFill(t,n),this.updateColorStroke(t,n)},i.prototype.updateVertexClippingStepAndUv=function(n,r){var e,u=r.points;if(null!=u){var s=u.getMarker();if(null!=s){var h=this.toMarker(s),o=h.size,a=o.x,c=o.y,f=a!==this.sizeX||c!==this.sizeY,l=z(r),v=this.transformLocalId!==l,b=r.stroke,d=b.align,g=b.enable?b.width:0,m=b.side,w=b.style,O=this.strokeAlign!==d||this.strokeWidth!==g||this.strokeSide!==m||this.strokeStyle!==w,p=V(r),D=W(p),E=p!==this.texture||D!==this.textureTransformId,M=f||O,S=u.id!==this.pointId;if(M||v||E||S){this.sizeX=a,this.sizeY=c,this.transformLocalId=l,this.strokeAlign=d,this.strokeWidth=g,this.strokeSide=m,this.strokeStyle=w,this.texture=p,this.textureTransformId=D;var T=this.vertexOffset,j=null!==(e=i.WORK)&&void 0!==e?e:i.WORK=new t.Matrix;j.copyFrom(h.transform).prepend(r.transform.internalTransform),n.updateVertices(),Ca(n.vertices,T,0,0,a,c,d,g,j,Ta),(M||v)&&(n.updateSteps(),Aa(T,n.steps,g,m,w,Ta)),M&&(n.updateClippings(),Na(n.clippings,T,Ta)),(M||E)&&(n.updateUvs(),La(n.uvs,T,X(p),Ta))}}}},i}(da),ka=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.toMarker=function(t){return t.tail},n}(ya),xa=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.toMarker=function(t){return t.head},n}(ya),Ba=function(t){switch(t){case J.NONE:return 0;case J.CIRCLE:return 9;case J.TRIANGLE:return 7;case J.RECTANGLE:return Ma}return 0},_a=function(t){switch(t){case J.NONE:return 0;case J.CIRCLE:return 8;case J.TRIANGLE:return 3;case J.RECTANGLE:return Sa}return 0},Pa=function(t,n,i){switch(t){case J.NONE:return new Ea(n,i);case J.CIRCLE:return new pa(n,i);case J.TRIANGLE:return new ma(n,i);case J.RECTANGLE:return new xa(n,i)}return new Ea(n,i)},Ua=function(t,n,i){switch(t){case J.NONE:return new Ea(n,i);case J.CIRCLE:return new Da(n,i);case J.TRIANGLE:return new wa(n,i);case J.RECTANGLE:return new ka(n,i)}return new Ea(n,i)},Fa=function(t,n,i,r,e){var s=n.points,h=Jo(s),o=Zo(h,!0),a=qo(h,!0),c=J.NONE,f=J.NONE;if(s&&s instanceof ne){var l=s.getMarker();l&&(c=l.tail.type,f=l.head.type)}var v=Ba(c),b=_a(c),d=i+o,g=r+a,m=Ba(f),w=_a(f),O=d+v,p=g+b,D=M(n),E=4*D,S=2*D,T=O+m,j=p+w,N=o+m+v+E,I=a+w+b+S;return t.check(i,r,N,I)?new u(t,i,r,N,I,[new ha(i,r,o,a),Ua(c,d,g),Pa(f,O,p),new Jt(T,j,E,S)]).init(n):null},Ga=function(){function t(t,n,i){this.oo=1e-6,this._x=t,this._y=n,this._z=0,this.L=i,i[0]=t,i[1]=n,this.index=0}return Object.defineProperty(t.prototype,"x",{get:function(){return this._x},set:function(t){if(0===this._z||this.oo<Math.abs(this._x-t)){this._x=t;var n=this.index,i=this.L;1===this._z?(i[n+0]=this._x,i[n+1]=this._y):(i[n+2]=this._x,i[n+3]=this._y,this.index+=2,this._z=1)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this._y},set:function(t){if(0===this._z||this.oo<Math.abs(this._y-t)){this._y=t;var n=this.index,i=this.L;2===this._z?(i[n+0]=this._x,i[n+1]=this._y):(i[n+2]=this._x,i[n+3]=this._y,this.index+=2,this._z=2)}},enumerable:!1,configurable:!0}),t.prototype.toAxis=function(t,n,i,r){var e=Math.abs(i),u=Math.abs(r),s=this.oo;if(e<s&&u<s)return Math.abs(t)<Math.abs(n)?0<=n?2:0:0<=t?1:3;var h=.2;return 0<=i?0<=r?h<e&&h<u?t<n?2:1:h<e?1:2:h<e&&h<u?t<-n?0:1:h<e?1:0:0<=r?h<e&&h<u?-t<n?2:3:h<e?3:2:h<e&&h<u?n<t?0:3:h<e?3:0},t.prototype.toTailAxis=function(t,n,i,r){return this.toAxis(t-this.x,n-this.y,i,r)},t.prototype.tail=function(t,n,i,r,e,u,s){switch(this.toTailAxis(t,n,i,r)){case 0:this.y-s<=n?(this.y-=Math.max(s,u),this.x=t):this.y=n;break;case 1:t<=this.x+s?(this.x+=Math.max(s,e),this.y=n):this.x=t;break;case 2:n<=this.y+s?(this.y+=Math.max(s,e),this.x=t):this.y=n;break;case 3:this.x-s<=t?(this.x-=Math.max(s,e),this.y=n):this.x=t}},t.prototype.middle=function(t,n){var i=t-this._x,r=n-this._y;Math.abs(i)<Math.abs(r)?this.y=n:this.x=t},t.prototype.toHeadAxis=function(t,n,i,r){return this.toAxis(this.x-t,this.y-n,i,r)},t.prototype.head=function(t,n,i,r,e,u,s){switch(this.toHeadAxis(t,n,i,r)){case 0:n-s<=this.y&&(this.y=n-Math.max(s,u)),this.x=t,this.y=n;break;case 1:this.x<=t+s&&(this.x=t+Math.max(s,e)),this.y=n,this.x=t;break;case 2:this.y<=n+s&&(this.y=n+Math.max(s,u)),this.x=t,this.y=n;break;case 3:t-s<=this.x&&(this.x=t-Math.max(s,e)),this.y=n,this.x=t}},t.prototype.margin=function(t,n){var i=this.L,r=this.index;if(0!==t&&2<=r){var e=i[0],u=i[1],s=(o=i[2]-e)*o+(a=i[3]-u)*a;if((c=this.oo)<s){var h=t/Math.sqrt(o*o+a*a);c<Math.abs(h-1)?(i[0]=e+o*h,i[1]=u+a*h):this.index-=2}}if(r=this.index,0!==n&&2<=r){var o,a,c,f=i[r+0],l=i[r+1];s=(o=i[r-2]-f)*o+(a=i[r-1]-l)*a,(c=this.oo)<s&&(h=n/Math.sqrt(o*o+a*a),c<Math.abs(h-1)?(i[r+0]=f+o*h,i[r+1]=l+a*h):this.index-=2)}i.length=this.index+2},t}(),Ha=function(t){function n(n){return void 0===n&&(n=r.CONNECTOR_ELBOW),t.call(this,n)||this}return B(n,t),n.prototype.fillPoints=function(t,n,i,r,e,u,s,h){var o=t.local,a=o.x,c=o.y,f=t.normal,l=f.x,v=f.y,b=i.local,d=b.x,g=b.y,m=i.normal,w=m.x,O=m.y,p=e.values,D=p.length,E=a-u,M=c-s,S=d-u,T=g-s,j=.5*(S+E),N=.5*(T+M),I=S-E,C=T-M,A=.5*Y.SIZE_X,R=.5*Y.SIZE_Y,L=1e-6;if(Math.abs(I)<L&&Math.abs(C)<L)h[0]=E,h[1]=M,h[2]=S,h[3]=T,h.length=4;else{var y=new Ga(E,M,h);if(0<D){var k=Math.atan2(C,I),x=Math.sqrt(I*I+C*C),B=Math.cos(k)*x,_=Math.sin(k)*x,P=p[0],U=p[1],F=j+B*P-_*U,G=N+B*U+_*P;y.tail(F,G,l,v,A,R,n);for(var H=2;H<D;H+=2){var z=p[H+0],V=p[H+1],W=j+B*z-_*V,X=N+B*V+_*z;y.middle(W,X)}y.head(S,T,w,O,A,R,r)}else y.tail(j,N,l,v,A,R,n),y.head(S,T,w,O,A,R,r);y.margin(n,r)}},n}(re),za=function(t,n,i){return co(t,n,i||new Ha)},Va=function(){function t(){}return t.from=function(t,n,i){var r=[],e=t.length;if(4<e){var u=1e-6,s=t[0],h=t[1];0!==n&&u<(c=(o=s-t[2])*o+(a=h-t[3])*a)&&(s+=o*(f=n/Math.sqrt(c)),h+=a*f);var o,a,c,f,l=t[e-2],v=t[e-1];0!==i&&u<(c=(o=l-t[e-4])*o+(a=v-t[e-3])*a)&&(l+=o*(f=i/Math.sqrt(c)),v+=a*f);for(var b=.5*(l+s),d=.5*(v+h),g=l-s,m=v-h,w=Math.atan2(m,g),O=Math.cos(w),p=Math.sin(w),D=g*g+m*m,E=u<D?1/Math.sqrt(D):1,M=2,S=e-2;M<S;M+=2){var T=t[M+0]-b,j=t[M+1]-d;r.push((O*T+p*j)*E,(O*j-p*T)*E)}}return r},t}(),Wa=function(t,n,i){return co(t,n,i||new re)},Xa=function(t,n,i,r){if(n instanceof re){var e=r.resources,u=t[15];if(0<=u&&u<e.length){var s=r.getExtension(u);null==s&&(s=JSON.parse(e[u]),r.setExtension(u,s)),n.lock();var h=n.points;h.deserialize(s[1],r);var o=n.edge;o.deserialize(s[0],i,r);var a=n.body,c=s[2];null!=c?a.deserialize(c,i,r):a.set(Va.from(h.values,o.tail.margin,o.head.margin)),n.unlock()}}},Ka=function(){e[r.CONNECTOR_ELBOW]=Fa,n[r.CONNECTOR_ELBOW]=za,i[r.CONNECTOR_ELBOW]=Xa,mr.set(r.CONNECTOR_ELBOW,wt.CONNECTOR)},Ya=function(){e[r.CONNECTOR_LINE]=Fa,n[r.CONNECTOR_LINE]=Wa,i[r.CONNECTOR_LINE]=Xa,mr.set(r.CONNECTOR_LINE,wt.CONNECTOR)},Ja=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.init=function(t){t.updateIndices(),Ia(t.indices,this.vertexOffset,this.indexOffset)},n.prototype.update=function(t,n){this.updateVertexClippingStepAndUv(t,n),this.updateColorFill(t,n),this.updateColorStroke(t,n)},n.prototype.updateVertexClippingStepAndUv=function(t,n){var i=n.size,r=i.x,e=i.y,u=r!==this.sizeX||e!==this.sizeY,s=z(n),h=this.transformLocalId!==s,o=n.stroke,a=o.align,c=o.enable?o.width:0,f=o.side,l=o.style,v=this.strokeAlign!==a||this.strokeWidth!==c||this.strokeSide!==f||this.strokeStyle!==l,b=V(n),d=W(b),g=b!==this.texture||d!==this.textureTransformId,m=u||v;if(m||h||g){this.sizeX=r,this.sizeY=e,this.transformLocalId=s,this.strokeAlign=a,this.strokeWidth=c,this.strokeSide=f,this.strokeStyle=l,this.texture=b,this.textureTransformId=d;var w=this.vertexOffset;t.updateVertices(),Ca(t.vertices,w,.5*r,.5*e,r,e,a,c,n.transform.internalTransform,Ta),(m||h)&&(t.updateSteps(),Aa(w,t.steps,c,f,l,Ta)),m&&(t.updateClippings(),Na(t.clippings,w,Ta)),(m||g)&&(t.updateUvs(),La(t.uvs,w,X(b),Ta))}},n}(H),Za=function(t,n,i,r,e){var s=M(n),h=4*s,o=2*s,a=Ma+h,c=Sa+o;return t.check(i,r,a,c)?new u(t,i,r,a,c,[new Ja(i,r,a-h,c-o),new Jt(i+Ma,r+Sa,h,o)]).init(n):null},qa=function(t,n,i,r){var e=M(n),s=4*e,h=2*e,o=s,a=h;return t.check(i,r,o,a)?new u(t,i,r,o,a,[new Jt(i,r,s,h)]).init(n):null},Qa=function(t,n){var i=t.data.getMapping();if(null!=i)for(var r=i.values,e=0,u=r.length;e<u;++e){var s=r[e],h=s[0],o=n.getDataMapper(h);if(null!=o){var a=t.children,c=n.getDataDestination(s[1]),f=s[2];$a(a,o,c,f)}}},$a=function(t,n,i,r){for(var e=0,u=t.length;e<u;++e){for(var s=t[e],h=s.data,o=0,a=h.size();o<a;++o){var c=h.get(o);c&&c.scope!==jt.PRIVATE&&n.map(c,i,r)}var f=s.children;0<f.length&&$a(f,n,i,r)}},tc=function(t,n,i){var r=n.pieces,e=t[15];if(r&&0<=e&&e<r.length){var u=n.pieceData;if(u){var s=r[e],h=u.get(s),o=i&&i(s,n);return h?function(t,n,i,r,e,u,s){var h=e.mode,o=e.depth;s=s||new Nr(t,h,o);var a=co(u,e,s),c=s.size,f=c.x,l=c.y;return s.size.set(n,i),r.copyTo(s),s.size.init(),s.size.set(f,l),h===gr.EDITOR?0<o&&Qa(s,e):Qa(s,e),a}(s,h.width,h.height,h.layer,n,t,o):function(t,n,i,r){var e=n.mode,u=n.depth;r=r||new Nr(t,e,u);var s=co(i,n,r),h=r.size,o=h.x,a=h.y,c=r.children,f=new je("missing",e,u),l=.5*o,v=.5*o;f.transform.position.set(-l,-v),f.size.set(o,a),f.size.init(),f.parent=r;var b=new qe;return b.stroke.color=16711680,b.transform.position.set(l,v),b.size.copyFrom(r.size),b.attach(f),c.push(f),r.onChildTransformChange(),r.toDirty(),r.onAttach(),r.size.init(),e===gr.EDITOR?0<u&&Qa(r,n):Qa(r,n),s}(s,n,t,o)}}return null},nc=function(){e[r.EMBEDDED]=qa,n[r.EMBEDDED]=tc,mr.set(r.EMBEDDED,wt.EMBEDDED),e[r.EMBEDDED_LAYER]=Za},ic=function(){function t(t){this.O=t}return Object.defineProperty(t.prototype,"enable",{get:function(){var t=this.O.children;return!(0<t.length)||t[t.length-1].fill.enable},set:function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].fill.enable=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){var t=this.O.children;return 0<t.length?t[t.length-1].fill.color:16777215},set:function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].fill.color=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){var t=this.O.children;return 0<t.length?t[t.length-1].fill.alpha:1},set:function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].fill.alpha=t},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].fill.copy(t)},t.prototype.set=function(t,n,i){for(var r=this.O.children,e=0,u=r.length;e<u;++e)r[e].fill.set(t,n,i)},t.prototype.clone=function(){return new t(this.O)},t.prototype.toObject=function(){var t=this.O.children;return 0<t.length?t[t.length-1].fill.toObject():{enable:!0,color:16777215,alpha:1}},t.prototype.serialize=function(t){return-1},t.prototype.deserialize=function(t,n){},t}(),rc=function(){function t(t){this.O=t}return Object.defineProperty(t.prototype,"length",{get:function(){var t=this.O.children;if(0<t.length){var n=t[t.length-1].points;if(null!=n)return n.length}return 0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"id",{get:function(){var t=this.O.children;if(0<t.length){var n=t[t.length-1].points;if(null!=n)return n.id}return 0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"values",{get:function(){var t=this.O.children;if(0<t.length){var n=t[t.length-1].points;if(null!=n)return n.values}return[]},set:function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i){var e=n[i].points;null!=e&&(e.values=t)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"segments",{get:function(){var t=this.O.children;if(0<t.length){var n=t[t.length-1].points;if(null!=n)return n.segments}return[]},set:function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i){var e=n[i].points;null!=e&&(e.segments=t)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"style",{get:function(){var t=this.O.children;if(0<t.length){var n=t[t.length-1].points;if(null!=n)return n.style}return F.NONE},set:function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i){var e=n[i].points;null!=e&&(e.style=t)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"marker",{get:function(){for(var t=this.O.children,n=0,i=t.length;n<i;++n){var r=t[n].points;if(null!=r)return r.marker}return Q.getInstance()},enumerable:!1,configurable:!0}),t.prototype.getMarker=function(){for(var t=this.O.children,n=0,i=t.length;n<i;++n){var r=t[n].points;if(null!=r)return r.getMarker()}},Object.defineProperty(t.prototype,"formatter",{get:function(){var t=this.O.children;if(0<t.length){var n=t[t.length-1].points;if(null!=n)return n.formatter}return null},set:function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i){var e=n[i].points;null!=e&&(e.formatter=t)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"formatted",{get:function(){var t=this.O.children;if(0<t.length){var n=t[t.length-1].points;if(null!=n)return n.formatted}return this},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i){var e=n[i].points;null!=e&&e.copy(t)}return this},t.prototype.set=function(t,n,i){for(var r=this.O.children,e=0,u=r.length;e<u;++e){var s=r[e].points;null!=s&&s.set(t,n,i)}return this},t.prototype.clone=function(n){return new t(n)},t.prototype.toPoints=function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i){var e=n[i].points;if(null!=e)return e.toPoints(t)}return[]},t.prototype.serialize=function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i){var e=n[i].points;if(null!=e)return e.serialize(t)}return-1},t}(),ec=function(){function t(t){this.O=t}return Object.defineProperty(t.prototype,"enable",{get:function(){var t=this.O.children;return 0<t.length&&t[t.length-1].stroke.enable},set:function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].stroke.enable=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){var t=this.O.children;return 0<t.length?t[t.length-1].stroke.color:16777215},set:function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].stroke.color=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){var t=this.O.children;return 0<t.length?t[t.length-1].stroke.alpha:1},set:function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].stroke.alpha=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){var t=this.O.children;return 0<t.length?t[t.length-1].stroke.width:1},set:function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].stroke.width=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"align",{get:function(){var t=this.O.children;return 0<t.length?t[t.length-1].stroke.align:1},set:function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].stroke.align=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"side",{get:function(){var t=this.O.children;return 0<t.length?t[t.length-1].stroke.side:1},set:function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].stroke.side=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"style",{get:function(){var t=this.O.children;return 0<t.length?t[t.length-1].stroke.style:s.NONE},set:function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].stroke.style=t},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].stroke.copy(t)},t.prototype.set=function(t,n,i,r,e){for(var u=this.O.children,s=0,h=u.length;s<h;++s)u[s].stroke.set(t,n,i,r,e)},t.prototype.clone=function(){return new t(this.O)},t.prototype.toObject=function(){var t=this.O.children;return 0<t.length?t[t.length-1].stroke.toObject():{enable:!1,color:16777215,alpha:1,width:1,align:0,side:Gt.NONE,style:s.NONE}},t.prototype.serialize=function(t){return-1},t.prototype.deserialize=function(t,n){},t}(),uc=function(t){function n(n,i){void 0===i&&(i=r.GROUP);var e=t.call(this,i)||this;e.Cr=n;var u=new kt;return e.data=u,e.tag=u,e.size=e.newGroupSize(n),e.fill=e.newGroupFill(),e.stroke=e.newGroupStroke(),e.text=e.newGroupText(),e.gt=e.newGroupPoints(),e}return B(n,t),Object.defineProperty(n.prototype,"mode",{get:function(){return this.Cr},enumerable:!1,configurable:!0}),n.prototype.newGroupSize=function(t){var n=Y.SIZE_X,i=Y.SIZE_Y;return t!==gr.VIEWER?new Er(this,n,i,this.isGroupSizeFittable()):new Mr(this,n,i,n,i)},n.prototype.isGroupSizeFittable=function(){return!0},n.prototype.newGroupFill=function(){return new ic(this)},n.prototype.newGroupStroke=function(){return new ec(this)},n.prototype.newGroupText=function(){return new Pt(this,Y.TEXT_VALUE,Y.TEXT_COLOR,Y.TEXT_ALPHA,Y.TEXT_FAMILY,Y.TEXT_SIZE)},n.prototype.newGroupPoints=function(){return new rc(this)},n.prototype.getBoundsSize=function(){var t=this.size;return t instanceof Mr?t.base:t},n.prototype.onChildTransformChange=function(){t.prototype.onChildTransformChange.call(this),this.size.fit()},Object.defineProperty(n.prototype,"corner",{get:function(){var t=this.children;return 0<t.length?t[t.length-1].corner:it.ALL},set:function(t){for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].corner=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"gradient",{get:function(){for(var t=this.children,n=t.length-1;0<=n;--n){var i=t[n].gradient;if(null!=i)return i}},set:function(t){for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].gradient=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"radius",{get:function(){var t=this.children;return 0<t.length?t[t.length-1].radius:.5},set:function(t){for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].radius=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"image",{get:function(){for(var t=this.children,n=t.length-1;0<=n;--n){var i=t[n].image;if(null!=i)return i}},set:function(t){for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].image=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"points",{get:function(){for(var t=this.children,n=t.length-1;0<=n;--n)if(null!=t[n].points)return this.gt},set:function(t){},enumerable:!1,configurable:!0}),n.prototype.clone=function(){for(var t=this.newClone().copy(this),n=this.children,i=0,r=n.length;i<r;++i){var e=n[i].clone();e.parent=t,t.children.push(e)}return t.onChildTransformChange(),t.toDirty(),t},n.prototype.newClone=function(){return new(0,this.constructor)(this.Cr,this.type)},n.prototype.containsAbs=function(t,n,i,r,e,u,s){return!1},n}(pt),sc=function(t,n,i){i=i||new uc(n.mode);var r=co(t,n,i);return i.size.init(),r},hc=function(){e[r.GROUP]=qa,n[r.GROUP]=sc,mr.set(r.GROUP,wt.GROUP)},oc=function(){function n(n,i,r){this.O=n,this.j=new t.Point(i,r)}return n.prototype.init=function(){},Object.defineProperty(n.prototype,"x",{get:function(){return this.j.x},set:function(t){var n=this.j;if(n.x!==t){var i=n.x;n.x=t,this.onChange(i,n.y)}},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"y",{get:function(){return this.j.y},set:function(t){var n=this.j;if(n.y!==t){var i=n.y;n.y=t,this.onChange(n.x,i)}},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n){var i=!1,r=this.j,e=r.x,u=r.y;return null!=t&&e!==t&&(i=!0,r.x=t),null!=n&&u!==n&&(i=!0,r.y=n),i&&this.onChange(e,u),this},n.prototype.clone=function(){var t=this.j;return new n(this.O,t.x,t.y)},n.prototype.copy=function(){},n.prototype.copyFrom=function(t){var n=t.x,i=t.y,r=this.j,e=r.x,u=r.y;return e===n&&u===i||(r.x=n,r.y=i,this.onChange(e,u)),this},n.prototype.copyTo=function(t){return this.j.copyTo(t)},n.prototype.equals=function(t){return this.j.equals(t)},n.prototype.fit=function(){},n.prototype.onChange=function(t,n){this.O.onSizeChange()},n}(),ac=function(t){function n(n,i){return void 0===i&&(i=r.GROUP_SHADOWED),t.call(this,n,i)||this}return B(n,t),n.prototype.newGroupSize=function(n){return n!==gr.VIEWER?new oc(this,Y.SIZE_X,Y.SIZE_Y):t.prototype.newGroupSize.call(this,n)},n}(uc),cc=function(t,n,i){i=i||new ac(n.mode);var r=co(t,n,i);return i.size.init(),r},fc=function(){e[r.GROUP_SHADOWED]=qa,n[r.GROUP_SHADOWED]=cc,mr.set(r.GROUP_SHADOWED,wt.GROUP)},lc=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.init=function(t){t.updateIndices(),Ia(t.indices,this.vertexOffset,this.indexOffset)},n.prototype.update=function(t,n){this.updateVertexClippingStepAndUv(t,n),this.updateColorFill(t,n),this.updateColorStroke(t,n)},n.prototype.updateVertexClippingStepAndUv=function(t,n){var i=n.size,r=i.x,e=i.y,u=r!==this.sizeX||e!==this.sizeY,s=z(n),h=this.transformLocalId!==s,o=n.stroke,a=o.align,c=o.enable?o.width:0,f=o.side,l=o.style,v=this.strokeAlign!==a||this.strokeWidth!==c||this.strokeSide!==f||this.strokeStyle!==l,b=V(n),d=W(b),g=b!==this.texture||d!==this.textureTransformId,m=u||v;if(m||h||g){this.sizeX=r,this.sizeY=e,this.transformLocalId=s,this.strokeAlign=a,this.strokeWidth=c,this.strokeSide=f,this.strokeStyle=l,this.texture=b,this.textureTransformId=d;var w=this.vertexOffset;t.updateVertices(),Ca(t.vertices,w,0,0,r,e,a,c,n.transform.internalTransform,Ta),(m||h)&&(t.updateSteps(),Aa(w,t.steps,c,f,l,Ta)),m&&(t.updateClippings(),Na(t.clippings,w,Ta)),(m||g)&&(t.updateUvs(),La(t.uvs,w,X(b),Ta))}},n}(H),vc=function(t,n,i,r,e){var s=M(n),h=4*s,o=2*s,a=Ma+h,c=Sa+o;return t.check(i,r,a,c)?new u(t,i,r,a,c,[new lc(i,r,a-h,c-o),new Jt(i+Ma,r+Sa,h,o)]).init(n):null},bc=function(t){function n(n,i){void 0===i&&(i=r.IMAGE);var e=t.call(this,i)||this;return null!=n&&(e.image=n,e.size.set(n.width,n.height)),e.fill.alpha=1,e}return B(n,t),n.prototype.clone=function(){return new n(this.image,this.type).copy(this)},n}(qe),dc=function(t,n,i){return co(t,n,i||new bc)},gc=function(){e[r.IMAGE]=vc,n[r.IMAGE]=dc},mc=[0,0],wc=new t.Point,Oc=function(t,n){for(var i=3*n-1,r=3*(n+9)-1;i<r;)t[++i]=0,t[++i]=0,t[++i]=2},pc=function(t,n,i){var r=3*i-1;t[++r]=n,t[++r]=n+1,t[++r]=n+3,t[++r]=n+1,t[++r]=n+4,t[++r]=n+3,t[++r]=n+1,t[++r]=n+2,t[++r]=n+4,t[++r]=n+2,t[++r]=n+5,t[++r]=n+4,t[++r]=n+3,t[++r]=n+4,t[++r]=n+6,t[++r]=n+4,t[++r]=n+7,t[++r]=n+6,t[++r]=n+4,t[++r]=n+5,t[++r]=n+7,t[++r]=n+5,t[++r]=n+8,t[++r]=n+7},Dc=function(t,n,i,r,e,u,s,h){var a=o(e),c=u/h[0],f=s/h[1],l=.5*(c+f),v=12,b=-1+i,d=6*n-1;t[++d]=r,t[++d]=a,t[++d]=l,t[++d]=v,t[++d]=b,t[++d]=0,t[++d]=r,t[++d]=a,t[++d]=f,t[++d]=v,t[++d]=b,t[++d]=0,t[++d]=r,t[++d]=a,t[++d]=l,t[++d]=v,t[++d]=b,t[++d]=0,t[++d]=r,t[++d]=a,t[++d]=c,t[++d]=v,t[++d]=b,t[++d]=0,t[++d]=r,t[++d]=a,t[++d]=l,t[++d]=v,t[++d]=b,t[++d]=0,t[++d]=r,t[++d]=a,t[++d]=c,t[++d]=v,t[++d]=b,t[++d]=0,t[++d]=r,t[++d]=a,t[++d]=l,t[++d]=v,t[++d]=b,t[++d]=0,t[++d]=r,t[++d]=a,t[++d]=f,t[++d]=v,t[++d]=b,t[++d]=0,t[++d]=r,t[++d]=a,t[++d]=f,t[++d]=v,t[++d]=b,t[++d]=0},Ec=function(t,n,i,r,e,u,s,h){var o=wc,a=.5*e,c=.5*u;o.set(i-a,r-c),s.apply(o,o);var f=o.x,l=o.y;o.set(i+a,r-c),s.apply(o,o);var v=o.x,b=o.y;o.set(i+a,r+c),s.apply(o,o);var d=o.x,g=o.y,m=f+(d-v),w=l+(g-b),O=(n<<1)-1;t[++O]=f,t[++O]=l,t[++O]=.5*(f+v),t[++O]=.5*(l+b),t[++O]=v,t[++O]=b,t[++O]=.5*(f+m),t[++O]=.5*(l+w),t[++O]=.5*(f+d),t[++O]=.5*(l+g),t[++O]=.5*(v+d),t[++O]=.5*(b+g),t[++O]=m,t[++O]=w,t[++O]=.5*(m+d),t[++O]=.5*(w+g),t[++O]=d,t[++O]=g,h[0]=.5*p(f,l,v,b),h[1]=.5*p(f,l,m,w)},Mc=function(t,n,i){var r=i.x0,e=i.y0,u=i.x1,s=i.y1,h=i.x2,o=i.y2,a=i.x3,c=i.y3,f=(n<<1)-1;t[++f]=r,t[++f]=e,t[++f]=.5*(u+r),t[++f]=.5*(s+e),t[++f]=u,t[++f]=s,t[++f]=.5*(r+a),t[++f]=.5*(e+c),t[++f]=.5*(r+h),t[++f]=.5*(e+o),t[++f]=.5*(u+h),t[++f]=.5*(s+o),t[++f]=a,t[++f]=c,t[++f]=.5*(a+h),t[++f]=.5*(c+o),t[++f]=h,t[++f]=o},Sc=function(t){function n(n,i){var r=t.call(this,n,i,9,8)||this;return r.textureWidth=-1,r.textureHeight=-1,r}return B(n,t),n.prototype.init=function(t){var n=this.vertexOffset;t.updateClippings(),t.updateIndices(),Oc(t.clippings,n),pc(t.indices,n,this.indexOffset)},n.prototype.update=function(t,n){this.updateVertexAndStep(t,n),this.updateColorFill(t,n),this.updateColorStroke(t,n),this.updateUv(t,n)},n.prototype.updateVertexAndStep=function(t,n){var i=n.size,r=i.x,e=i.y,u=r!==this.sizeX||e!==this.sizeY,s=z(n),h=this.transformLocalId!==s,o=n.stroke,a=o.align,c=o.enable?o.width:0,f=o.style,l=this.strokeAlign!==a||this.strokeWidth!==c||this.strokeStyle!==f,v=V(n),b=v.width*v.resolution,d=v.height*v.resolution,g=this.textureWidth!==b||this.textureHeight!==d;(u||h||l||g)&&(this.sizeX=r,this.sizeY=e,this.transformLocalId=s,this.strokeAlign=a,this.strokeWidth=c,this.strokeStyle=f,this.textureWidth=b,this.textureHeight=d,t.updateVertices(),Ec(t.vertices,this.vertexOffset,0,0,r,e,n.transform.internalTransform,mc),t.updateSteps(),Dc(t.steps,this.vertexOffset,a,c,f,b,d,mc))},n.prototype.updateUv=function(t,n){var i=V(n),r=W(i);i===this.texture&&r===this.textureTransformId||(this.texture=i,this.textureTransformId=r,t.updateUvs(),Mc(t.uvs,this.vertexOffset,X(i)))},n}(H),Tc=function(t,n,i,r,e){var s=M(n),h=4*s,o=2*s,a=9+h,c=8+o;return t.check(i,r,a,c)?new u(t,i,r,a,c,[new Sc(i,r),new Jt(i+9,r+8,h,o)]).init(n):null},jc=function(t){function n(n,i){return void 0===i&&(i=r.IMAGE_SDF),t.call(this,n,i)||this}return B(n,t),n.prototype.clone=function(){return new n(this.image,this.type).copy(this)},n}(bc),Nc=function(t,n,i){return co(t,n,i||new jc)},Ic=function(){function n(t,n,i,r){this.vertexOffset=t,this.indexOffset=n,this.vertexCount=i,this.indexCount=r,this.texture=null}return n.prototype.init=function(t){},n.prototype.isCompatible=function(t){return!0},n.prototype.update=function(t,n){this.texture=V(n)},n.prototype.buildUnit=function(n){var i=this.texture||t.Texture.WHITE,r=i.baseTexture;if(r!==n.baseTexture){n.baseTexture=r;var e=this.indexOffset;n.push(i,e)}},n}(),Cc=function(t,n,i,r,e){var s=M(n),h=4*s,o=2*s,a=h,c=o;return t.check(i,r,a,c)?new u(t,i,r,a,c,[new Ic(i,r,a-h,c-o),new Jt(i,r,h,o)]).init(n):null},Ac=function(t){function n(n){return void 0===n&&(n=r.LABEL),t.call(this,n)||this}return B(n,t),n.prototype.clone=function(){return new n(this.type).copy(this)},n}(Ut),Rc=function(t,n,i){return co(t,n,i||new Ac)},Lc=function(){e[r.LABEL]=Cc,n[r.LABEL]=Rc},yc=function(t){function n(n){void 0===n&&(n=r.LINE);var i=t.call(this,n)||this;return i.gt=new ne(i),i}return B(n,t),Object.defineProperty(n.prototype,"points",{get:function(){return this.gt},enumerable:!1,configurable:!0}),n.prototype.clone=function(){return new n(this.type).copy(this)},n.prototype.serialize=function(n){var i=t.prototype.serialize.call(this,n);return i[15]=this.gt.serialize(n),i},n}(Xt),kc=function(t,n,i){i=i||new yc;var r=co(t,n,i);i.points.deserialize(t[15],n);var e=i.points.style,u=F.NON_SCALING_MASK|F.DOTTED_MASK|F.DASHED_MASK,s=e&u;return s&&(i.points.style&=~u,i.stroke.style|=s),r},xc=function(){e[r.LINE]=Fa,n[r.LINE]=kc},Bc=function(t,n,i){for(var r=3*n,e=3*(n+i);r<e;r+=3)t[r+0]=0,t[r+1]=0,t[r+2]=0},_c=function(t,n,i){for(var r=2*n,e=2*(n+i);r<e;r+=2)t[r+0]=0,t[r+1]=0},Pc=function(t,n,i){for(var r=6*n,e=6*(n+i);r<e;r+=6)t[r+0]=0,t[r+1]=0,t[r+2]=0,t[r+3]=0,t[r+4]=0,t[r+5]=0},Uc=function(t,n,i){for(var r=2*n,e=2*(n+i);r<e;r+=2)t[r+0]=0,t[r+1]=0},Fc=function(t){return 12*Math.ceil(t/12)},Gc=function(t,n,i,r,e,u,s,h){if(u)if(i.isStaticColor()){var o=i.getColor(0,s);if(i.isStaticAlpha()){var a=i.getAlpha(0,h);G(o,a,t,n*r,e)}else for(var c=0,f=t;c<r;c+=1,f+=n)a=i.getAlpha(c,h),G(o,a,f,n,e)}else if(i.isStaticAlpha())for(a=i.getAlpha(0,h),c=0,f=t;c<r;c+=1,f+=n)o=i.getColor(c,s),G(o,a,f,n,e);else for(c=0,f=t;c<r;c+=1,f+=n)o=i.getColor(c,s),a=i.getAlpha(c,h),G(o,a,f,n,e);else if(i.isStaticColor())o=i.getColor(0,s),G(o,0,t,n*r,e);else for(c=0,f=t;c<r;c+=1,f+=n)o=i.getColor(c,s),G(o,0,f,n,e)},Hc=function(t){function n(n,i,r,e,u){var s=t.call(this,n,i,r,e)||this;return s.pointId=-1,s.pointCount=0,s.pointCountReserved=u,s.pointSizeId=-1,s.pointOffsetId=-1,s.pointFillId=-1,s.pointStrokeId=-1,s}return B(n,t),n.prototype.isCompatible=function(t){return Fc(Yo(t.points))===this.pointCountReserved},n.prototype.updateLineOfAnyColorFill=function(t,n,i,r){var e=i.fill,u=e.id,s=u!==this.pointFillId,h=n.fill,o=n.visible&&h.enable,a=h.color,c=o?h.alpha:0,f=a!==this.colorFill||c!==this.alphaFill;(s||f)&&(this.colorFill=a,this.alphaFill=c,this.pointFillId=u,t.updateColorFills(),Gc(this.vertexOffset,r,e,this.pointCountReserved,t.colorFills,o,a,c))},n.prototype.updateLineOfAnyColorStroke=function(t,n,i,r){var e=i.stroke,u=e.id,s=u!==this.pointStrokeId,h=n.stroke,o=n.visible&&h.enable,a=h.color,c=o?h.alpha:0,f=a!==this.colorStroke||c!==this.alphaStroke;(s||f)&&(this.colorStroke=a,this.alphaStroke=c,this.pointStrokeId=u,t.updateColorStrokes(),Gc(this.vertexOffset,r,e,this.pointCountReserved,t.colorStrokes,o,a,c))},n}(H),zc=function(t,n,i,r){for(var e=n+i,u=1;u<r;++u){for(var s=3*e,h=3*n,o=0;o<i;++o)t[s+0]=t[h+0],t[s+1]=t[h+1],t[s+2]=t[h+2],s+=3,h+=3;e+=i}},Vc=function(t,n,i,r,e){for(var u=n,s=i+r,h=1;h<e;++h){for(var o=3*s,a=3*i,c=0;c<r;++c)t[o+0]=t[a+0]+u,t[o+1]=t[a+1]+u,t[o+2]=t[a+2]+u,o+=3,a+=3;u+=n,s+=r}},Wc=function(t,n,i,r){for(var e=6*n,u=6*(n+i),s=1;s<r;++s)for(var h=e,o=0;o<i;++o)t[u+0]=t[h+0],t[u+1]=t[h+1],t[u+2]=t[h+2],t[u+3]=t[h+3],t[u+4]=t[h+4],t[u+5]=t[h+5],u+=6,h+=6},Xc=function(t,n,i,r){for(var e=n+i,u=1;u<r;++u){for(var s=e<<1,h=n<<1,o=0;o<i;++o)t[s]=t[h],t[s+1]=t[h+1],s+=2,h+=2;e+=i}},Kc=function(t,n,i,r,e,u,s){var h=n.a,o=n.b,a=n.c,c=n.d,f=e-1,l=i+f*r;if(s.isStaticX()&&s.isStaticY())for(var v=s.getX(0),b=s.getY(0);0<=f;--f){for(var d=h*(D=u[p=f<<1]+v)+a*(E=u[p+1]+b),g=o*D+c*E,m=l<<1,w=i<<1,O=0;O<r;++O)t[m]=t[w]+d,t[m+1]=t[w+1]+g,m+=2,w+=2;l-=r}else for(;0<=f;--f){var p,D,E;for(d=h*(D=u[p=f<<1]+s.getX(f))+a*(E=u[p+1]+s.getY(f)),g=o*D+c*E,m=l<<1,w=i<<1,O=0;O<r;++O)t[m]=t[w]+d,t[m+1]=t[w+1]+g,m+=2,w+=2;l-=r}},Yc=function(t){return mn(t)||null==t},Jc=function(t,n,i){return mn(n)?n:ot(n)?n(t):n?n[t%n.length]:i},Zc=function(){function t(t){this.O=t,this.R=0,this.S=null,this.T=null}return Object.defineProperty(t.prototype,"id",{get:function(){return this.R},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this.S},set:function(t){this.set(t,void 0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return this.T},set:function(t){this.set(void 0,t)},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n){var i=!1;void 0!==t&&this.S!==t&&(i=!0,this.S=t),void 0!==n&&this.T!==n&&(i=!0,this.T=n),i&&(this.R+=1,this.O.updateUploaded())},t.prototype.getColor=function(t,n){return Jc(t,this.S,n)},t.prototype.getAlpha=function(t,n){return Jc(t,this.T,n)},t.prototype.isStaticColor=function(){return Yc(this.S)},t.prototype.isStaticAlpha=function(){return Yc(this.T)},t.prototype.toDirty=function(){this.R+=1},t}(),qc=function(){function t(t,n,i){this.O=t,this.R=0,this._x=null,this._y=null,this.ao=n,this.co=i,this.fo=null,this.lo=0,this.vo=-1,this.bo=0}return Object.defineProperty(t.prototype,"id",{get:function(){return this.R},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"x",{get:function(){return this._x},set:function(t){this.set(t,void 0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this._y},set:function(t){this.set(void 0,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"limit",{get:function(){return this.fo},set:function(t){this.fo=t},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n){var i=!1;void 0!==t&&this._x!==t&&(i=!0,this._x=t),void 0!==n&&this._y!==n&&(i=!0,this._y=n),i&&(this.R+=1,this.O.updateUploaded())},t.prototype.getX=function(t){return Jc(t,this._x,this.ao)},t.prototype.getY=function(t){return Jc(t,this._y,this.co)},t.prototype.getLimit=function(){var t=this.fo;return null!=t?t:(this.updateLimitComputed(),this.lo)},t.prototype.updateLimitComputed=function(){var t=this.R,n=this.O.length;this.vo===t&&this.bo===n||(this.vo=t,this.bo=n,this.lo=Math.max(this.calcLimit(this._x,n,this.ao),this.calcLimit(this._y,n,this.co)))},t.prototype.calcLimit=function(t,n,i){if(mn(t))return Math.abs(t);if(ot(t)){if(0<n){for(var r=Math.abs(t(0)),e=1;e<n;++e)r=Math.max(r,Math.abs(t(e)));return r}return 0}if(null!=t){var u=t.length;if(0<u){for(r=t[0],e=1;e<u;++e)r=Math.max(r,Math.abs(t[e]));return r}return 0}return Math.abs(i)},t.prototype.isStaticX=function(){return Yc(this._x)},t.prototype.isStaticY=function(){return Yc(this._y)},t.prototype.toDirty=function(){this.R+=1},t}(),Qc=function(){function t(t){this.O=t,this.R=0,this.S=null,this.T=null}return Object.defineProperty(t.prototype,"id",{get:function(){return this.R},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this.S},set:function(t){this.set(t,void 0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return this.T},set:function(t){this.set(void 0,t)},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n){var i=!1;void 0!==t&&this.S!==t&&(i=!0,this.S=t),void 0!==n&&this.T!==n&&(i=!0,this.T=n),i&&(this.R+=1,this.O.updateUploaded())},t.prototype.getColor=function(t,n){return Jc(t,this.S,n)},t.prototype.getAlpha=function(t,n){return Jc(t,this.T,n)},t.prototype.isStaticColor=function(){return Yc(this.S)},t.prototype.isStaticAlpha=function(){return Yc(this.T)},t.prototype.toDirty=function(){this.R+=1},t}(),$c=function(){function n(t){this.O=t,this.L=[],this.do=0,this.k=[],this.j=new qc(this,Y.SIZE_X,Y.SIZE_Y),this.rn=new qc(this,0,0),this.C=new Zc(t),this.mo=new Qc(t),this.R=0}return Object.defineProperty(n.prototype,"length",{get:function(){return this.L.length>>1},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"id",{get:function(){return this.R},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"values",{get:function(){return this.L},set:function(t){this.set(t,void 0,void 0)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"segments",{get:function(){return this.k},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"style",{get:function(){return F.NONE},set:function(t){this.set(void 0,void 0,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"marker",{get:function(){var t=this.A;return null==t&&(t=Q.getInstance(),this.A=t),t},enumerable:!1,configurable:!0}),n.prototype.getMarker=function(){},Object.defineProperty(n.prototype,"size",{get:function(){return this.j},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"offset",{get:function(){return this.rn},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"fill",{get:function(){return this.C},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"stroke",{get:function(){return this.mo},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"formatter",{get:function(){return null},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"formatted",{get:function(){return this},enumerable:!1,configurable:!0}),n.prototype.copy=function(t){return this.set(t.values,t.segments,t.style)},n.prototype.set=function(t,n,i){var r=!1,e=!1;if(null!=t){var u=this.L,s=this.do,h=t.length;if(u!==t){for(var o=Math.min(s,h),a=0;a<o;++a)u[a]=t[a];for(a=o;a<h;++a)u.push(t[a]);s!==h?(u.length=h,this.do=h,r=!0):e=!0}else s!==h?(this.do=h,r=!0):e=!0}if(r){this.R+=1;var c=this.O,f=c.uploaded;f?f.isCompatible(c)?c.updateUploaded():(c.uploaded=void 0,c.toDirty()):c.updateUploaded()}else e&&(this.R+=1,this.O.updateUploaded());return this},n.prototype.updateUploaded=function(){this.O.updateUploaded()},n.prototype.clone=function(t){return new n(t).copy(this)},n.prototype.toPoints=function(n){for(var i=[],r=this.values,e=0,u=r.length;e<u;e+=2){var s=new t.Point(r[e+0],r[e+1]);i.push(n.apply(s,s))}return i},n.prototype.serialize=function(t){return t.addResource("[]")},n.prototype.calcHitPointAbs=function(t,i,r,e,u,s,h,o,a){var c=this.formatted,f=c.length,l=c.values,v=this.j,b=this.rn,d=0,g=f;if(h){var m=.5*v.getLimit(),w=b.getLimit(),O=n.WORK_RANGE;h(t,i,m,m,w,w,s,l,O),d=O[0],g=O[1]}for(var p=d,D=Math.min(g,f);p<D;++p){var E=p<<1,M=l[E],S=l[E+1];if(o(t,i,.5*v.getX(p),.5*v.getY(p),b.getX(p),b.getY(p),M,S,r,e,u,p,s,a))return!0}return!1},n.WORK_RANGE=[0,0],n}(),tf=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.init=function(t){t.updateClippings(),t.updateIndices();var n=t.clippings,i=t.indices,r=this.vertexOffset,e=this.indexOffset,u=this.pointCountReserved;0<u&&(_o(n,r),zc(n,r,9,u),Po(i,r,e),Vc(i,9,e,8,u))},n.prototype.update=function(t,n){var i=n.points;i instanceof $c&&(this.updateVertexAndStep(t,n,i),this.updateLineOfAnyColorFill(t,n,i,9),this.updateLineOfAnyColorStroke(t,n,i,9),this.updateUv(t,n))},n.prototype.updateVertexAndStep=function(t,n,i){var r=i.id,e=i.offset,u=e.id,s=r!==this.pointId||u!==this.pointOffsetId,h=i.size,o=h.id,a=o!==this.pointSizeId,c=n.size,f=c.x,l=c.y,v=f!==this.sizeX||l!==this.sizeY,b=z(n),d=this.transformLocalId!==b,g=n.stroke,m=g.align,w=g.enable?g.width:0,O=g.style,p=this.strokeAlign!==m||this.strokeWidth!==w||this.strokeStyle!==O;if(s||a||v||d||p){this.pointId=r;var D=i.formatted;this.pointCount=D.length,this.pointOffsetId=u,this.pointSizeId=o,this.sizeX=f,this.sizeY=l,this.transformLocalId=b,this.strokeWidth=w,this.strokeAlign=m,this.strokeStyle=O,t.updateVertices(),t.updateSteps();var E=this.pointCount,M=D.values,S=this.vertexOffset,T=t.vertices,j=t.steps,N=t.clippings,I=n.transform.internalTransform;if(0<E&&h.isStaticX()&&h.isStaticY()){var C=h.getX(0),A=h.getY(0);Uo(T,S,0,0,C,A,m,w,I,xo),Kc(T,I,S,9,E,M,e),Fo(j,N,S,w,O,xo),Wc(j,S,9,E)}else for(var R=0;R<E;++R){var L=R<<1,y=M[L]+e.getX(R),k=M[L+1]+e.getY(R),x=(C=h.getX(R),A=h.getY(R),S+9*R);Uo(T,x,y,k,C,A,m,w,I,xo),Fo(j,N,x,w,O,xo)}var B=S+9*E,_=9*(this.pointCountReserved-E);_c(T,B,_),Pc(j,B,_)}},n.prototype.updateUv=function(t,n){var i=V(n),r=W(i);if(i!==this.texture||r!==this.textureTransformId){this.texture=i,this.textureTransformId=r,t.updateUvs();var e=t.uvs,u=this.vertexOffset,s=X(i),h=this.pointCountReserved;0<h&&(Go(e,u,s),Xc(e,u,9,h))}},n}(Hc),nf=function(t,n,i,r,e,s,h,o){var a=M(n),c=4*a,f=2*a,l=n.points,v=Fc(Yo(l)),b=v*r,d=v*s,g=b+c,m=d+f;return t.check(i,e,g,m)?new u(t,i,e,g,m,[new o(i,e,b,d,v),new Jt(i+b,e+d,c,f)]).init(n):null},rf=function(t,n,i,r,e){return nf(t,n,i,9,r,8,0,tf)},ef=function(t){function n(n){void 0===n&&(n=r.LINE_OF_CIRCLES);var i=t.call(this,n)||this;return i.gt=new $c(i),i.wo=function(t,n,r,e,u,s,h,o,a,c,f){return i.containsPointAbs(t,n,r,e,u,s,h,o,a,c,f)},i}return B(n,t),Object.defineProperty(n.prototype,"points",{get:function(){return this.gt},enumerable:!1,configurable:!0}),n.prototype.clone=function(){return new n(this.type).copy(this)},n.prototype.containsAbs=function(t,n,i,r,e,u,s){var h=Wt(e,u,this.gt.size.getLimit());return!!this.containsAbsBBox(t,n,i+h,r+h)&&this.gt.calcHitPointAbs(t,n,e,u,s,h,null,this.wo,null)},n.prototype.containsPointAbs=function(n,i,r,e,u,s,h,o,a,c,f){return t.prototype.containsAbs.call(this,n-h-u,i-o-s,r,e,a,c,f)},n.prototype.calcHitPoint=function(t,n,i,r,e,u){var s=this.toHitTestData(t,n),h=(i||Wt)(s.strokeWidth,s.strokeScale,this.gt.size.getLimit());return!!this.containsAbsBBox(s.x,s.y,s.width+h,s.height+h)&&this.gt.calcHitPointAbs(s.x,s.y,s.strokeWidth,s.strokeScale,s.strokeAlign,h,r,e||this.wo,u)},n}(Vo),uf=function(t,n,i){return co(t,n,i||new ef)},sf=function(){e[r.LINE_OF_CIRCLES]=rf,n[r.LINE_OF_CIRCLES]=uf},hf=function(t){function n(n,i,r,e,u){var s=t.call(this,n,i,r,e,u)||this;return s.radius=NaN,s.corner=NaN,s}return B(n,t),n.prototype.init=function(t){t.updateIndices();var n=t.indices,i=this.vertexOffset,r=this.indexOffset,e=this.pointCountReserved;0<e&&(wo(n,i,r),Vc(n,bo,r,24,e))},n.prototype.update=function(t,n){var i=n.points;i instanceof $c&&(this.updateVertexClippingStepAndUv(t,n,i),this.updateLineOfAnyColorFill(t,n,i,bo),this.updateLineOfAnyColorStroke(t,n,i,bo))},n.prototype.updateVertexClippingStepAndUv=function(t,n,i){var r=i.id,e=i.offset,u=e.id,s=r!==this.pointId||u!==this.pointOffsetId,h=i.size,o=h.id,a=o!==this.pointSizeId,c=n.size,f=c.x,l=c.y,v=n.radius,b=f!==this.sizeX||l!==this.sizeY||v!==this.radius,d=z(n),g=this.transformLocalId!==d,m=n.stroke,w=m.align,O=m.enable?m.width:0,p=m.side,D=m.style,E=this.strokeAlign!==w||this.strokeWidth!==O||this.strokeSide!==p||this.strokeStyle!==D,M=n.corner,S=M!==this.corner,T=V(n),j=W(T),N=T!==this.texture||j!==this.textureTransformId,I=s||a||b||E;if(I||g||S||N){this.pointId=r;var C=i.formatted;this.pointCount=C.length,this.pointOffsetId=u,this.pointSizeId=o,this.sizeX=f,this.sizeY=l,this.radius=v,this.transformLocalId=d,this.strokeAlign=w,this.strokeWidth=O,this.strokeSide=p,this.strokeStyle=D,this.corner=M,this.texture=T,this.textureTransformId=j,t.updateVertices(),(I||g)&&t.updateSteps(),(I||S)&&t.updateClippings(),(I||N)&&t.updateUvs();var A=this.pointCount,R=C.values,L=this.vertexOffset,y=t.vertices,k=t.clippings,x=t.steps,B=t.uvs,_=n.transform.internalTransform,P=X(T);if(0<A&&h.isStaticX()&&h.isStaticY()){var U=h.getX(0),F=h.getY(0);Oo(y,L,0,0,U,F,w,O,v,_,go),Kc(y,_,L,bo,A,R,e),(I||g)&&(Do(x,L,O,p,D,M,go),Wc(x,L,bo,A)),(I||S)&&(po(k,L,M,go),zc(k,L,bo,A)),(I||N)&&(Eo(B,L,P,go),Xc(B,L,bo,A))}else for(var G=0;G<A;++G){var H=G<<1,K=R[H]+e.getX(G),Y=R[H+1]+e.getY(G),J=(U=h.getX(G),F=h.getY(G),L+G*bo);Oo(y,J,K,Y,U,F,w,O,v,_,go),(I||g)&&Do(x,J,O,p,D,M,go),(I||S)&&po(k,J,M,go),(I||N)&&Eo(B,J,P,go)}var Z=this.pointCountReserved,q=L+A*bo,Q=bo*(Z-A);_c(y,q,Q),Pc(x,q,Q),Bc(k,q,Q),Uc(B,q,Q)}},n}(Hc),of=function(t,n,i,r,e){return nf(t,n,i,bo,r,24,0,hf)},af=function(t){function n(n){void 0===n&&(n=r.LINE_OF_RECTANGLE_ROUNDEDS);var i=t.call(this,n)||this;return i.gt=new $c(i),i.wo=function(t,n,r,e,u,s,h,o,a,c,f){return i.containsPointAbs(t,n,r,e,u,s,h,o,a,c,f)},i}return B(n,t),Object.defineProperty(n.prototype,"points",{get:function(){return this.gt},enumerable:!1,configurable:!0}),n.prototype.clone=function(){return new n(this.type).copy(this)},n.prototype.containsAbs=function(t,n,i,r,e,u,s){var h=Wt(e,u,this.gt.size.getLimit());return!!this.containsAbsBBox(t,n,i+h,r+h)&&this.gt.calcHitPointAbs(t,n,h,e,u,s,null,this.wo,null)},n.prototype.containsPointAbs=function(n,i,r,e,u,s,h,o,a,c,f){return t.prototype.containsAbs.call(this,n-h-u,i-o-s,r,e,a,c,f)},n.prototype.calcHitPoint=function(t,n,i,r,e,u){var s=this.toHitTestData(t,n),h=(i||Wt)(s.strokeWidth,s.strokeScale,this.gt.size.getLimit());return!!this.containsAbsBBox(s.x,s.y,s.width+h,s.height+h)&&this.gt.calcHitPointAbs(s.x,s.y,s.strokeWidth,s.strokeScale,s.strokeAlign,h,r,e||this.wo,u)},n}(Io),cf=function(t,n,i){return co(t,n,i||new af)},ff=function(){e[r.LINE_OF_RECTANGLE_ROUNDEDS]=of,n[r.LINE_OF_RECTANGLE_ROUNDEDS]=cf,mr.set(r.LINE_OF_RECTANGLE_ROUNDEDS,wt.PRIMITIVE|wt.STROKE_SIDE|wt.BORDER_RADIUS)},lf=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.init=function(t){t.updateIndices();var n=t.indices,i=this.vertexOffset,r=this.indexOffset,e=this.pointCountReserved;0<e&&(Ia(n,i,r),Vc(n,Ma,r,Sa,e))},n.prototype.update=function(t,n){var i=n.points;i instanceof $c&&(this.updateVertexClippingStepAndUv(t,n,i),this.updateLineOfAnyColorFill(t,n,i,Ma),this.updateLineOfAnyColorStroke(t,n,i,Ma))},n.prototype.updateVertexClippingStepAndUv=function(t,n,i){var r=i.id,e=i.offset,u=e.id,s=r!==this.pointId||u!==this.pointOffsetId,h=i.size,o=h.id,a=o!==this.pointSizeId,c=n.size,f=c.x,l=c.y,v=f!==this.sizeX||l!==this.sizeY,b=z(n),d=this.transformLocalId!==b,g=n.stroke,m=g.align,w=g.enable?g.width:0,O=g.side,p=g.style,D=this.strokeAlign!==m||this.strokeWidth!==w||this.strokeSide!==O||this.strokeStyle!==p,E=V(n),M=W(E),S=E!==this.texture||M!==this.textureTransformId,T=s||a||v||D;if(T||d||S){this.pointId=r;var j=i.formatted;this.pointCount=j.length,this.pointOffsetId=u,this.pointSizeId=o,this.transformLocalId=b,this.strokeWidth=w,this.strokeAlign=m,this.strokeSide=O,this.strokeStyle=p,this.texture=E,this.textureTransformId=M,t.updateVertices(),(T||d)&&t.updateSteps(),T&&t.updateClippings(),(T||S)&&t.updateUvs();var N=this.pointCount,I=j.values,C=this.vertexOffset,A=t.vertices,R=t.clippings,L=t.steps,y=t.uvs,k=n.transform.internalTransform,x=X(E);if(0<N&&h.isStaticX()&&h.isStaticY()){var B=h.getX(0),_=h.getY(0);Ca(A,C,0,0,B,_,m,w,k,Ta),Kc(A,k,C,Ma,N,I,e),(T||d)&&(Aa(C,L,w,O,p,Ta),Wc(L,C,Ma,N)),T&&(Na(R,C,Ta),zc(R,C,Ma,N)),(T||S)&&(La(y,C,x,Ta),Xc(y,C,Ma,N))}else for(var P=0;P<N;++P){var U=P<<1,F=I[U]+e.getX(P),G=I[U+1]+e.getY(P),H=(B=h.getX(P),_=h.getY(P),C+P*Ma);Ca(A,H,F,G,B,_,m,w,k,Ta),(T||d)&&Aa(H,L,w,O,p,Ta),T&&Na(R,H,Ta),(T||S)&&La(y,H,x,Ta)}var K=this.pointCountReserved,Y=C+N*Ma,J=Ma*(K-N);_c(A,Y,J),Pc(L,Y,J),Bc(R,Y,J),Uc(y,Y,J)}},n}(Hc),vf=function(t,n,i,r,e){return nf(t,n,i,Ma,r,Sa,0,lf)},bf=function(t){function n(n){void 0===n&&(n=r.LINE_OF_RECTANGLES);var i=t.call(this,n)||this;return i.gt=new $c(i),i.wo=function(t,n,r,e,u,s,h,o,a,c,f){return i.containsPointAbs(t,n,r,e,u,s,h,o,a,c,f)},i}return B(n,t),Object.defineProperty(n.prototype,"points",{get:function(){return this.gt},enumerable:!1,configurable:!0}),n.prototype.clone=function(){return new n(this.type).copy(this)},n.prototype.containsAbs=function(t,n,i,r,e,u,s){var h=Wt(e,u,this.gt.size.getLimit());return!!this.containsAbsBBox(t,n,i+h,r+h)&&this.gt.calcHitPointAbs(t,n,e,u,s,h,null,this.wo,null)},n.prototype.containsPointAbs=function(n,i,r,e,u,s,h,o,a,c,f){return t.prototype.containsAbs.call(this,n-h-u,i-o-s,r,e,a,c,f)},n.prototype.calcHitPoint=function(t,n,i,r,e,u){var s=this.toHitTestData(t,n),h=(i||Wt)(s.strokeWidth,s.strokeScale,this.gt.size.getLimit());return!!this.containsAbsBBox(s.x,s.y,s.width+h,s.height+h)&&this.gt.calcHitPointAbs(s.x,s.y,s.strokeWidth,s.strokeScale,s.strokeAlign,h,r,e||this.wo,u)},n}(qe),df=function(t,n,i){return co(t,n,i||new bf)},gf=function(){e[r.LINE_OF_RECTANGLES]=vf,n[r.LINE_OF_RECTANGLES]=df,mr.set(r.LINE_OF_RECTANGLES,wt.PRIMITIVE|wt.STROKE_SIDE)},mf=22,wf=[0,0,0,0,0],Of=new t.Point,pf=function(t,n,i){var r=3*i-1;t[++r]=n+0,t[++r]=n+1,t[++r]=n+3,t[++r]=n+1,t[++r]=n+2,t[++r]=n+3,t[++r]=n+4,t[++r]=n+5,t[++r]=n+7,t[++r]=n+5,t[++r]=n+6,t[++r]=n+7,t[++r]=n+8,t[++r]=n+9,t[++r]=n+11,t[++r]=n+9,t[++r]=n+10,t[++r]=n+11,t[++r]=n+12,t[++r]=n+13,t[++r]=n+16,t[++r]=n+13,t[++r]=n+14,t[++r]=n+16,t[++r]=n+14,t[++r]=n+15,t[++r]=n+16,t[++r]=n+12,t[++r]=n+16,t[++r]=n+19,t[++r]=n+16,t[++r]=n+17,t[++r]=n+19,t[++r]=n+17,t[++r]=n+18,t[++r]=n+19,t[++r]=n+12,t[++r]=n+19,t[++r]=n+13,t[++r]=n+19,t[++r]=n+20,t[++r]=n+13,t[++r]=n+20,t[++r]=n+21,t[++r]=n+13},Df=function(t,n,i,r,e,u,s,h,o,a,c){var f=s*h,l=.5*e+(0<=e?+f:-f),v=.5*u+(0<=u?+f:-f),b=Math.sqrt(l*l+4*v*v),d=2*l*v/(l+b),g=d*o/(2*v),m=.5*(b-d)*o/b,w=g*b/(2*l),O=Of;O.set(i,r-v),a.apply(O,O);var D=O.x,E=O.y;O.set(i,r),a.apply(O,O);var M=O.x,S=O.y;O.set(i+l,r),a.apply(O,O);var T=M-D,j=S-E,N=O.x+T,I=O.y+j,C=M+(M-O.x)+T,A=S+(S-O.y)+j,R=N-D,L=I-E,y=D+m*R,k=E+m*L,x=N-g*R,B=I-g*L,_=w*(C-N),P=w*(A-I),U=N+_,F=I+P,G=C-_,H=A-P,z=D-C,V=E-A,W=C+g*z,X=A+g*V,K=D-m*z,Y=E-m*V;O.set(i,r+v-d),a.apply(O,O);var J=O.x,Z=O.y,q=D+o*(J-D),Q=E+o*(Z-E),$=N+o*(J-N),tt=I+o*(Z-I),nt=C+o*(J-C),it=A+o*(Z-A),rt=M+T,et=S+j;c[0]=p(rt,et,J,Z),c[1]=w,c[2]=g,c[3]=m,c[4]=1-.5*d/v;var ut=2*n-1;t[++ut]=q,t[++ut]=Q,t[++ut]=K,t[++ut]=Y,t[++ut]=D,t[++ut]=E,t[++ut]=y,t[++ut]=k,t[++ut]=$,t[++ut]=tt,t[++ut]=x,t[++ut]=B,t[++ut]=N,t[++ut]=I,t[++ut]=U,t[++ut]=F,t[++ut]=nt,t[++ut]=it,t[++ut]=G,t[++ut]=H,t[++ut]=C,t[++ut]=A,t[++ut]=W,t[++ut]=X,t[++ut]=J,t[++ut]=Z,t[++ut]=q,t[++ut]=Q,t[++ut]=y,t[++ut]=k,t[++ut]=x,t[++ut]=B,t[++ut]=$,t[++ut]=tt,t[++ut]=U,t[++ut]=F,t[++ut]=G,t[++ut]=H,t[++ut]=nt,t[++ut]=it,t[++ut]=W,t[++ut]=X,t[++ut]=K,t[++ut]=Y},Ef=function(t,n,i,r){var e=3*n-1,u=1-r;i&it.TOP?(t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1):(t[++e]=u,t[++e]=u,t[++e]=0,t[++e]=1,t[++e]=u,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=u,t[++e]=1,t[++e]=0),i&it.BOTTOM_RIGHT?(t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1):(t[++e]=u,t[++e]=u,t[++e]=0,t[++e]=1,t[++e]=u,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=u,t[++e]=1,t[++e]=0),i&it.BOTTOM_LEFT?(t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1):(t[++e]=u,t[++e]=u,t[++e]=0,t[++e]=1,t[++e]=u,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=u,t[++e]=1,t[++e]=0),t[++e]=0,t[++e]=0,t[++e]=0,t[++e]=u,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=u,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=u,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=0},Mf=function(t,n,i,r,e,u,s){for(var h=o(e),a=s[0],c=u*a,f=3*i,l=6*i-1,v=0;v<mf;v+=1,f+=3)t[++l]=r,t[++l]=h,.5<n[f+2]?(t[++l]=c,t[++l]=c,t[++l]=1+n[f],t[++l]=1+n[f+1]):(t[++l]=a,t[++l]=a,t[++l]=1+n[f],t[++l]=1+n[f+1])},Sf=function(t,n,i,r,e){var u=i.x0,s=i.x1,h=i.x2,o=i.x3,a=i.y0,c=i.y1,f=i.y2,l=i.y3,v=.5*(u+s),b=.5*(a+c),d=e[4],g=v+d*(o-u),m=b+d*(l-a),w=e[1],O=e[2],p=e[3],D=v+p*(o-v),E=b+p*(l-b),M=v+r*(g-v),S=b+r*(m-b),T=v+p*(h-v),j=b+p*(f-b),N=h+O*(v-h),I=f+O*(b-f),C=h+r*(g-h),A=f+r*(m-f),R=h+w*(o-h),L=f+w*(l-f),y=o+w*(h-o),k=l+w*(f-l),x=o+r*(g-o),B=l+r*(m-l),_=o+O*(v-o),P=l+O*(b-l),U=2*n-1;t[++U]=M,t[++U]=S,t[++U]=D,t[++U]=E,t[++U]=v,t[++U]=b,t[++U]=T,t[++U]=j,t[++U]=C,t[++U]=A,t[++U]=N,t[++U]=I,t[++U]=h,t[++U]=f,t[++U]=R,t[++U]=L,t[++U]=x,t[++U]=B,t[++U]=y,t[++U]=k,t[++U]=o,t[++U]=l,t[++U]=_,t[++U]=P,t[++U]=g,t[++U]=m,t[++U]=M,t[++U]=S,t[++U]=T,t[++U]=j,t[++U]=N,t[++U]=I,t[++U]=C,t[++U]=A,t[++U]=R,t[++U]=L,t[++U]=y,t[++U]=k,t[++U]=x,t[++U]=B,t[++U]=_,t[++U]=P,t[++U]=D,t[++U]=E},Tf=function(t){function n(n,i,r,e,u){var s=t.call(this,n,i,r,e,u)||this;return s.radius=NaN,s.corner=NaN,s}return B(n,t),n.prototype.init=function(t){t.updateIndices();var n=this.vertexOffset,i=this.indexOffset,r=this.pointCountReserved;0<r&&(pf(t.indices,n,i),Vc(t.indices,mf,i,15,r))},n.prototype.update=function(t,n){var i=n.points;i instanceof $c&&(this.updateVertexClippingStepAndUv(t,n,i),this.updateLineOfAnyColorFill(t,n,i,mf),this.updateLineOfAnyColorStroke(t,n,i,mf))},n.prototype.updateVertexClippingStepAndUv=function(t,n,i){var r=i.id,e=i.offset,u=e.id,s=r!==this.pointId||u!==this.pointOffsetId,h=i.size,o=h.id,a=o!==this.pointSizeId,c=n.size,f=c.x,l=c.y,v=f!==this.sizeX||l!==this.sizeY,b=n.radius,d=b!==this.radius,g=z(n),m=this.transformLocalId!==g,w=n.stroke,O=w.align,p=w.enable?w.width:0,D=w.style,E=this.strokeAlign!==O||this.strokeWidth!==p||this.strokeStyle!==D,M=n.corner,S=this.corner!==M,T=V(n),j=W(T),N=T!==this.texture||j!==this.textureTransformId,I=s||a||v||d||E;if(I||m||S||N){this.pointId=r;var C=i.formatted;this.pointCount=C.length,this.pointOffsetId=u,this.pointSizeId=o,this.sizeX=f,this.sizeY=l,this.radius=b,this.transformLocalId=g,this.strokeAlign=O,this.strokeWidth=p,this.strokeStyle=D,this.corner=M,this.texture=T,this.textureTransformId=j,t.updateVertices(),(I||S)&&t.updateClippings(),(I||m||S)&&t.updateSteps(),(I||N)&&t.updateUvs();var A=this.pointCount,R=C.values,L=this.vertexOffset,y=t.vertices,k=t.clippings,x=t.steps,B=t.uvs,_=n.transform.internalTransform,P=X(T);if(0<A&&h.isStaticX()&&h.isStaticY()){var U=h.getX(0),F=h.getY(0);Df(y,L,0,0,U,F,O,p,b,_,wf),Kc(y,_,L,mf,A,R,e),(I||S)&&(Ef(k,L,M,b),zc(k,L,mf,A)),(I||m||S)&&(Mf(x,k,L,p,D,b,wf),Wc(x,L,mf,A)),(I||N)&&(Sf(B,L,P,b,wf),Xc(B,L,mf,A))}else for(var G=0;G<A;++G){var H=G<<1,K=R[H]+e.getX(G),Y=R[H+1]+e.getY(G),J=(U=h.getX(G),F=h.getY(G),L+G*mf);Df(y,J,K,Y,U,F,O,p,b,_,wf),(I||S)&&Ef(k,J,M,b),(I||m||S)&&Mf(x,k,J,p,D,b,wf),(I||N)&&Sf(B,J,P,b,wf)}var Z=this.pointCountReserved,q=L+A*mf,Q=mf*(Z-A);_c(y,q,Q),Pc(x,q,Q),Bc(k,q,Q),Uc(B,q,Q)}},n}(Hc),jf=function(t,n,i,r,e){return nf(t,n,i,mf,r,15,0,Tf)},Nf=function(t,n,i,r,e,u,s,h,o,a,c,f,l,v,b,d,g){var m=u+f*(h-u)-r,w=s+f*(o-s)-e,O=Math.sqrt(m*m+w*w),p=1e-5;if(p<O){var D=1/O,E=m*D,M=w*D,S=(u+l*(a-u)-r)*D,T=(s+l*(c-s)-e)*D,j=E*T-S*M;if(p<Math.abs(j)){var N=1/j,I=n-r,C=i-e;if(function(t,n,i,r,e,u,s){if(t.fill.enable){if(n*n+i*i<=r*r)return!0}else if(0<u){var h=n*n+i*i;if(h<=r*r){var o=Math.max(0,r*(1-u*s/e));if(o*o<=h)return!0}}return!1}(t,(+T*I-S*C)*N,(-M*I+E*C)*N,O,v*b,d,g))return!0}}return!1},If=function(t,n,i,r,e,u,s){var h=2*e/r;if(zt(n,i,h,-e,+e)){var o=Math.sqrt(r*r+4*e*e),a=2*r*e/(r+o),c=t.radius,f=e-a,l=-e,v=+r,b=+e,d=-v,g=+b,m=0+0*c,w=l+c*(f-l),O=v+c*(0-v),p=b+c*(f-b),D=+p,E=-O,M=-h*n+w-i<=0,S=+h*n+w-i<=0,T=i<=p,j=t.corner;if(!M&&!S&&j&it.TOP){var N=.5*(o-a)*c/o;if(Nf(t,n,i,m,w,0,l,d,g,v,b,N,N,a,c,u,s))return!0}else if(!M&&!T&&j&it.BOTTOM_LEFT){if(Nf(t,n,i,E,D,d,g,v,b,0,l,(I=a*c/(2*e))*o/(2*r),I,a,c,u,s))return!0}else if(!S&&!T&&j&it.BOTTOM_RIGHT){var I;if(Nf(t,n,i,O,p,v,b,0,l,d,g,I=a*c/(2*e),I*o/(2*r),a,c,u,s))return!0}else{if(t.fill.enable)return!0;if(0<u){var C=u*s,A=e-a,R=A+(-e-A)*Math.max(0,a-C)/a;if(!zt(n,i,h,R,e-C))return!0}}}return!1},Cf=function(t){function n(n){return void 0===n&&(n=r.TRIANGLE_ROUNDED),t.call(this,n)||this}return B(n,t),n.prototype.clone=function(){return new n(this.type).copy(this)},n.prototype.containsAbs=function(n,i,r,e,u,s,h){return!!t.prototype.containsAbsBBox.call(this,n,i,r,e)&&If(this,n,i,r,e,u,s)},n}(Ut),Af=function(t){function n(n){void 0===n&&(n=r.LINE_OF_TRIANGLE_ROUNDEDS);var i=t.call(this,n)||this;return i.gt=new $c(i),i.wo=function(t,n,r,e,u,s,h,o,a,c,f){return i.containsPointAbs(t,n,r,e,u,s,h,o,a,c,f)},i}return B(n,t),Object.defineProperty(n.prototype,"points",{get:function(){return this.gt},enumerable:!1,configurable:!0}),n.prototype.clone=function(){return new n(this.type).copy(this)},n.prototype.containsAbs=function(t,n,i,r,e,u,s){var h=Wt(e,u,this.gt.size.getLimit());return!!this.containsAbsBBox(t,n,i+h,r+h)&&this.gt.calcHitPointAbs(t,n,e,u,s,h,null,this.wo,null)},n.prototype.containsPointAbs=function(n,i,r,e,u,s,h,o,a,c,f){return t.prototype.containsAbs.call(this,n-h-u,i-o-s,r,e,a,c,f)},n.prototype.calcHitPoint=function(t,n,i,r,e,u){var s=this.toHitTestData(t,n),h=(i||Wt)(s.strokeWidth,s.strokeScale,this.gt.size.getLimit());return!!this.containsAbsBBox(s.x,s.y,s.width+h,s.height+h)&&this.gt.calcHitPointAbs(s.x,s.y,s.strokeWidth,s.strokeScale,s.strokeAlign,h,r,e||this.wo,u)},n}(Cf),Rf=function(t,n,i){return co(t,n,i||new Af)},Lf=function(){e[r.LINE_OF_TRIANGLE_ROUNDEDS]=jf,n[r.LINE_OF_TRIANGLE_ROUNDEDS]=Rf,mr.set(r.LINE_OF_TRIANGLE_ROUNDEDS,wt.PRIMITIVE|wt.STROKE_SIDE|wt.BORDER_RADIUS)},yf=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.init=function(t){t.updateClippings(),t.updateIndices();var n=t.clippings,i=t.indices,r=this.vertexOffset,e=this.indexOffset,u=this.pointCountReserved;0<u&&(ca(n,r),zc(n,r,7,u),fa(i,r,e),Vc(i,7,e,3,u))},n.prototype.update=function(t,n){var i=n.points;i instanceof $c&&(this.updateVertexStepAndUvs(t,n,i),this.updateLineOfAnyColorFill(t,n,i,7),this.updateLineOfAnyColorStroke(t,n,i,7))},n.prototype.updateVertexStepAndUvs=function(t,n,i){var r=i.id,e=i.offset,u=e.id,s=r!==this.pointId||u!==this.pointOffsetId,h=i.size,o=h.id,a=o!==this.pointSizeId,c=n.size,f=c.x,l=c.y,v=f!==this.sizeX||l!==this.sizeY,b=z(n),d=this.transformLocalId!==b,g=n.stroke,m=g.align,w=g.enable?g.width:0,O=g.style,p=this.strokeAlign!==m||this.strokeWidth!==w||this.strokeStyle!==O,D=V(n),E=W(D),M=D!==this.texture||E!==this.textureTransformId,S=s||a||v||p;if(S||d||M){this.pointId=r;var T=i.formatted;this.pointCount=T.length,this.pointOffsetId=u,this.pointSizeId=o,this.sizeX=f,this.sizeY=l,this.transformLocalId=b,this.strokeAlign=m,this.strokeWidth=w,this.strokeStyle=O,t.updateVertices(),(S||d)&&t.updateSteps(),(S||M)&&t.updateUvs();var j=this.pointCount,N=T.values,I=this.vertexOffset,C=t.vertices,A=t.steps,R=t.clippings,L=t.uvs,y=X(D),k=n.transform.internalTransform;if(0<j&&h.isStaticX()&&h.isStaticY()){var x=h.getX(0),B=h.getY(0);la(C,I,0,0,x,B,m,w,k,oa),Kc(C,k,I,7,j,N,e),(S||d)&&(va(A,R,I,7,w,O,oa),Wc(A,I,7,j)),(S||M)&&(ba(L,y,I,oa),Xc(L,I,7,j))}else for(var _=0;_<j;++_){var P=_<<1,U=N[P]+e.getX(_),F=N[P+1]+e.getY(_),G=(x=h.getX(_),B=h.getY(_),I+7*_);la(C,G,U,F,x,B,m,w,k,oa),(S||d)&&va(A,R,G,7,w,O,oa),(S||M)&&ba(L,y,G,oa)}var H=I+7*j,K=7*(this.pointCountReserved-j);_c(C,H,K),Pc(A,H,K),Uc(L,H,K)}},n}(Hc),kf=function(t,n,i,r,e){return nf(t,n,i,7,r,3,0,yf)},xf=function(t){function n(n){return void 0===n&&(n=r.TRIANGLE),t.call(this,n)||this}return B(n,t),n.prototype.clone=function(){return new n(this.type).copy(this)},n.prototype.containsAbs=function(n,i,r,e,u,s,h){return!!t.prototype.containsAbsBBox.call(this,n,i,r,e)&&Vt(this,n,i,r,e,u,s)},n}(Ut),Bf=function(t){function n(n){void 0===n&&(n=r.LINE_OF_TRIANGLES);var i=t.call(this,n)||this;return i.gt=new $c(i),i.wo=function(t,n,r,e,u,s,h,o,a,c,f){return i.containsPointAbs(t,n,r,e,u,s,h,o,a,c,f)},i}return B(n,t),Object.defineProperty(n.prototype,"points",{get:function(){return this.gt},enumerable:!1,configurable:!0}),n.prototype.clone=function(){return new n(this.type).copy(this)},n.prototype.containsAbs=function(t,n,i,r,e,u,s){var h=Wt(e,u,this.gt.size.getLimit());return!!this.containsAbsBBox(t,n,i+h,r+h)&&this.gt.calcHitPointAbs(t,n,e,u,s,h,null,this.wo,null)},n.prototype.containsPointAbs=function(n,i,r,e,u,s,h,o,a,c,f){return t.prototype.containsAbs.call(this,n-h-u,i-o-s,r,e,a,c,f)},n.prototype.calcHitPoint=function(t,n,i,r,e,u){var s=this.toHitTestData(t,n),h=(i||Wt)(s.strokeWidth,s.strokeScale,this.gt.size.getLimit());return!!this.containsAbsBBox(s.x,s.y,s.width+h,s.height+h)&&this.gt.calcHitPointAbs(s.x,s.y,s.strokeWidth,s.strokeScale,s.strokeAlign,h,r,e||this.wo,u)},n}(xf),_f=function(t,n,i){return co(t,n,i||new Bf)},Pf=function(){e[r.LINE_OF_TRIANGLES]=kf,n[r.LINE_OF_TRIANGLES]=_f},Uf=function(t,n,i,r){return new u(t,i,r,0,0,[new Ea(i,r)]).init(n)},Ff=function(t){function n(n){return void 0===n&&(n=r.NULL),t.call(this,n)||this}return B(n,t),n.prototype.clone=function(){return new n(this.type).copy(this)},n}(Ut),Gf=function(t,n,i){return co(t,n,i||new Ff)},Hf=function(){e[r.NULL]=Uf,n[r.NULL]=Gf},zf=function(t,n,i){return co(t,n,i||new qe)},Vf=function(){e[r.RECTANGLE]=vc,n[r.RECTANGLE]=zf,mr.set(r.RECTANGLE,wt.PRIMITIVE|wt.STROKE_SIDE)},Wf=function(t,n,i){return co(t,n,i||new Qe)},Xf=function(t,n,i){return co(t,n,i||new Io)},Kf=function(){e[r.RECTANGLE_ROUNDED]=So,n[r.RECTANGLE_ROUNDED]=Xf,mr.set(r.RECTANGLE_ROUNDED,wt.PRIMITIVE|wt.STROKE_SIDE|wt.BORDER_RADIUS)},Yf=[0,0],Jf=new t.Point,Zf=function(t,n){var i=3*n-1;t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=0,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=0,t[++i]=1,t[++i]=0,t[++i]=0,t[++i]=1,t[++i]=1,t[++i]=0,t[++i]=1},qf=function(t,n,i){var r=3*i-1;t[++r]=n,t[++r]=n+1,t[++r]=n+3,t[++r]=n+1,t[++r]=n+4,t[++r]=n+3,t[++r]=n+1,t[++r]=n+2,t[++r]=n+4,t[++r]=n+2,t[++r]=n+5,t[++r]=n+4},Qf=function(t,n,i,r,e,u,s,h,o,a){var c=Jf,f=s*h,l=.5*e+(0<=e?+f:-f),v=.5*u+(0<=u?+f:-f);c.set(-l+i,-v+r),o.apply(c,c);var b=c.x,d=c.y;c.set(0+i,-v+r),o.apply(c,c);var g=c.x,m=c.y,w=g-b,O=m-d;c.set(i,r),o.apply(c,c);var D=c.x,E=c.y,M=D-w,S=E-O,T=2*n-1;t[++T]=b,t[++T]=d,t[++T]=g,t[++T]=m,t[++T]=g+w,t[++T]=m+O,t[++T]=M,t[++T]=S,t[++T]=D,t[++T]=E,t[++T]=D+w,t[++T]=E+O,a[0]=p(b,d,g,m),a[1]=p(b,d,M,S)},$f=function(t,n,i,r,e,u){for(var s=o(e),h=6*i-1,a=3*i,c=0;c<6;c+=1,a+=3)t[++h]=r,t[++h]=s,t[++h]=u[0],t[++h]=u[1],t[++h]=1+n[a],t[++h]=1+n[a+1]},tl=function(t,n,i){var r=i.x0,e=i.x1,u=i.x2,s=i.x3,h=i.y0,o=i.y1,a=i.y2,c=i.y3,f=2*n-1;t[++f]=r,t[++f]=h,t[++f]=.5*(r+e),t[++f]=.5*(h+o),t[++f]=e,t[++f]=o,t[++f]=.5*(r+s),t[++f]=.5*(h+c),t[++f]=.5*(r+u),t[++f]=.5*(h+a),t[++f]=.5*(e+u),t[++f]=.5*(o+a)},nl=function(t){function n(n,i){return t.call(this,n,i,6,4)||this}return B(n,t),n.prototype.init=function(t){t.updateClippings(),t.updateIndices();var n=this.vertexOffset;Zf(t.clippings,n),qf(t.indices,n,this.indexOffset)},n.prototype.update=function(t,n){this.updateVertexAndStep(t,n),this.updateColorFill(t,n),this.updateColorStroke(t,n),this.updateUv(t,n)},n.prototype.updateVertexAndStep=function(t,n){var i=n.size,r=i.x,e=i.y,u=r!==this.sizeX||e!==this.sizeY,s=z(n),h=this.transformLocalId!==s,o=n.stroke,a=o.align,c=o.enable?o.width:0,f=o.style,l=this.strokeAlign!==a||this.strokeWidth!==c||this.strokeStyle!==f;(u||h||l)&&(this.sizeX=r,this.sizeY=e,this.transformLocalId=s,this.strokeAlign=a,this.strokeWidth=c,this.strokeStyle=f,t.updateVertices(),t.updateSteps(),Qf(t.vertices,this.vertexOffset,0,0,r,e,a,c,n.transform.internalTransform,Yf),$f(t.steps,t.clippings,this.vertexOffset,c,f,Yf))},n.prototype.updateUv=function(t,n){var i=V(n),r=W(i);if(i!==this.texture||r!==this.textureTransformId){this.texture=i,this.textureTransformId=r,t.updateUvs();var e=X(i);tl(t.uvs,this.vertexOffset,e)}},n}(H),il=function(t,n,i,r,e){var s=M(n),h=4*s,o=2*s,a=6+h,c=4+o;return t.check(i,r,a,c)?new u(t,i,r,a,c,[new nl(i,r),new Jt(i+6,r+4,h,o)]).init(n):null},rl=function(t,n,i,r,e,u,s){return i<=0&&Ft(t,n,i,r,e,u,s)},el=function(t){function n(n){void 0===n&&(n=r.SEMICIRCLE);var i=t.call(this,n)||this;return i.stroke.side=Gt.ALL&~Gt.BOTTOM,i}return B(n,t),n.prototype.clone=function(){return new n(this.type).copy(this)},n.prototype.containsAbs=function(n,i,r,e,u,s,h){return!!t.prototype.containsAbsBBox.call(this,n,i,r,e)&&rl(this,n,i,r,e,u,s)},n}(Ut),ul=function(t,n,i){return co(t,n,i||new el)},sl=function(){e[r.SEMICIRCLE]=il,n[r.SEMICIRCLE]=ul},hl=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.init=function(t){t.updateClippings(),t.updateIndices(),ca(t.clippings,this.vertexOffset),fa(t.indices,this.vertexOffset,this.indexOffset)},n.prototype.update=function(t,n){this.updateVertexStepAndUv(t,n),this.updateColorFill(t,n),this.updateColorStroke(t,n)},n.prototype.updateVertexStepAndUv=function(t,n){var i=n.size,r=i.x,e=i.y,u=r!==this.sizeX||e!==this.sizeY,s=z(n),h=this.transformLocalId!==s,o=n.stroke,a=o.align,c=o.enable?o.width:0,f=o.style,l=this.strokeAlign!==a||this.strokeWidth!==c||this.strokeStyle!==f,v=V(n),b=W(v),d=v!==this.texture||b!==this.textureTransformId,g=u||l;if(g||h||d){this.sizeX=r,this.sizeY=e,this.transformLocalId=s,this.strokeAlign=a,this.strokeWidth=c,this.strokeStyle=f,this.texture=v,this.textureTransformId=b;var m=this.vertexOffset;t.updateVertices(),la(t.vertices,m,0,0,r,e,a,c,n.transform.internalTransform,oa),(g||h)&&(t.updateSteps(),va(t.steps,t.clippings,m,7,c,f,oa)),(g||d)&&(t.updateUvs(),ba(t.uvs,X(v),m,oa))}},n}(H),ol=function(t,n,i,r,e){var s=M(n),h=4*s,o=2*s,a=7+h,c=3+o;return t.check(i,r,a,c)?new u(t,i,r,a,c,[new hl(i,r,a-h,c-o),new Jt(i+7,r+3,h,o)]).init(n):null},al=function(t,n,i){return co(t,n,i||new xf)},cl=function(){e[r.TRIANGLE]=ol,n[r.TRIANGLE]=al},fl=function(t){function n(n,i,r,e){var u=t.call(this,n,i,r,e)||this;return u.radius=NaN,u.corner=NaN,u}return B(n,t),n.prototype.init=function(t){t.updateIndices(),pf(t.indices,this.vertexOffset,this.indexOffset)},n.prototype.update=function(t,n){this.updateVertexClippingStepAndUv(t,n),this.updateColorFill(t,n),this.updateColorStroke(t,n)},n.prototype.updateVertexClippingStepAndUv=function(t,n){var i=n.size,r=i.x,e=i.y,u=r!==this.sizeX||e!==this.sizeY,s=n.radius,h=s!==this.radius,o=z(n),a=this.transformLocalId!==o,c=n.stroke,f=c.align,l=c.enable?c.width:0,v=c.style,b=this.strokeAlign!==f||this.strokeWidth!==l||this.strokeStyle!==v,d=n.corner,g=d!==this.corner,m=V(n),w=W(m),O=m!==this.texture||w!==this.textureTransformId,p=u||h||b;if(p||a||g||O){this.sizeX=r,this.sizeY=e,this.radius=s,this.transformLocalId=o,this.strokeAlign=f,this.strokeWidth=l,this.strokeStyle=v,this.corner=d,this.texture=m,this.textureTransformId=w;var D=this.vertexOffset;t.updateVertices(),Df(t.vertices,D,0,0,r,e,f,l,s,n.transform.internalTransform,wf),(h||g)&&(t.updateClippings(),Ef(t.clippings,D,d,s)),(p||a||g)&&(t.updateSteps(),Mf(t.steps,t.clippings,D,l,v,n.radius,wf)),(p||O)&&(t.updateUvs(),Sf(t.uvs,D,X(m),s,wf))}},n}(H),ll=function(t,n,i,r,e){var s=M(n),h=4*s,o=2*s,a=mf+h,c=15+o;return t.check(i,r,a,c)?new u(t,i,r,a,c,[new fl(i,r,a-h,c-o),new Jt(i+mf,r+15,h,o)]).init(n):null},vl=function(t,n,i){return co(t,n,i||new Cf)},bl=function(){e[r.TRIANGLE_ROUNDED]=ll,n[r.TRIANGLE_ROUNDED]=vl,mr.set(r.TRIANGLE_ROUNDED,wt.PRIMITIVE|wt.STROKE_SIDE|wt.BORDER_RADIUS)},dl=function(){lo(),ko(),Xo(),Ka(),Ya(),nc(),fc(),hc(),gc(),e[r.IMAGE_SDF]=Tc,n[r.IMAGE_SDF]=Nc,Lc(),xc(),Hf(),e[r.RECTANGLE_PIVOTED]=Za,n[r.RECTANGLE_PIVOTED]=Wf,mr.set(r.RECTANGLE_PIVOTED,wt.PRIMITIVE|wt.STROKE_SIDE),Kf(),Vf(),sl(),bl(),cl(),sf(),ff(),gf(),Lf(),Pf()},gl=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DImage"},n}(bs),ml=function(t){function n(n){var i,r=this;return(r=t.call(this,n)||this).Rt=null!==(i=null==n?void 0:n.value)&&void 0!==i?i:null,r}return B(n,t),n.prototype.init=function(n){var i=this;t.prototype.init.call(this,n),this.on(Ki.tap,(function(t){i.onClick(t)}))},n.prototype.onClick=function(t){this.state.isActionable&&this.activate(t)},n.prototype.activate=function(t){this.onSelect(t)},Object.defineProperty(n.prototype,"value",{get:function(){return this.Rt},set:function(t){this.Rt=t},enumerable:!1,configurable:!0}),n.prototype.hasSelection=function(t){return t&&t.selection&&t.selection.add},n.prototype.getSelection=function(){for(var t=this.parent;t;){if(this.hasSelection(t))return t.selection;t=t.parent}return null},n.prototype.onSelect=function(t){this.emit("select",this.Rt,this);var n=this.getSelection();n&&n.add(this)},n.prototype.onKeyDown=function(n){return Xi.isActivateKey(n)&&this.onKeyDownActivate(n),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyDownActivate=function(t){return!(!this.state.isActionable||!this.state.isFocused||(this.activate(t),0))},n.prototype.getType=function(){return"DMenuItemBase"},n}(gl),wl=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getContext=function(){for(var t=this.parent;t;){if(t.getContext)return t.getContext();t=t.parent}return null},n.prototype.getCloseable=function(){for(var t=this.parent;t;){if(t.getCloseable)return t.getCloseable();t=t.parent}return null},n.prototype.getType=function(){return"DMenuItem"},n}(ml),Ol=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.init=function(n){t.prototype.init.call(this,n),this.initOnOver(n),this.initShortcuts(n)},n.prototype.initOnOver=function(t){var n=this;this.on(Ki.over,(function(){var t=n.getContext();null!=t&&n.parent instanceof Qi&&t.trim(n.getCloseable())}))},n.prototype.initShortcuts=function(t){var n=this.Xn;if(null!=n&&0<n.length){var i=n[0],r=Xi.toString(i);this.Oo=this.createText(r),this.snippet.add(this.Oo,!0)}else this.Oo=null;this.po=this.theme.getShortcutTextMargin()},n.prototype.updateShortcutText=function(){var t=this.Oo,n=this.po;if(null!=t&&null!=n){var i,r=this.Bn;i=r.width.isOn?n:this.width-t.width-n;var e,u=this.zn,s=u.getTop();e=r.height.isOn?s:s+.5*(this.height-s-u.getBottom()-t.height),t.position.set(i,e)}},n.prototype.updateTextColor=function(n){t.prototype.updateTextColor.call(this,n);var i=this.Oo;if(null!=i){var r=this.theme,e=this.state;i.style.fill=r.getShortcutColor(e),i.alpha=r.getShortcutAlpha(e)}},n.prototype.updateText=function(){t.prototype.updateText.call(this),this.updateShortcutText()},n.prototype.getType=function(){return"DMenuItemText"},n.prototype.onSelect=function(n){t.prototype.onSelect.call(this,n);var i=this.getCloseable();null!=i&&i.emit("select",this.value,this,i)},n.prototype.onShortcut=function(n){t.prototype.onShortcut.call(this,n),this.activate(n)},n}(wl),pl=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.init=function(n){t.prototype.init.call(this,n),(null==n?void 0:n.check)&&(this.state.isActive=!0)},n.prototype.getType=function(){return"DMenuItemCheck"},n.prototype.onSelect=function(n){this.state.isActive=!this.state.isActive,t.prototype.onSelect.call(this,n)},n}(Ol),Dl=function(t){return"check"in t},El={OPEN_LINK:0,OPEN_LINK_IN_NEW_WINDOW:1,COPY_LINK_ADDRESS:2},Ml=function(){function n(){}return n.addItemCreator=function(t){this.CREATORS.push(t)},n.setItemCreatorDefault=function(t){this.CREATOR_DEFAULT=t},n.setMenuCreator=function(t){this.MENU_CREATOR=t},n.newItemOf=function(t,n,i,r){for(var e=0,u=t.length;e<u;++e){var s=t[e](i,r);if(null!=s)return s}return n?n(i,r):null},n.newItem=function(t,n){return this.newItemOf(this.CREATORS,this.CREATOR_DEFAULT,t,n)},n.newItemsOf=function(n,i,r,e){for(var u=0,s=r.length;u<s;++u){var h=r[u];if(h instanceof t.DisplayObject)i.addChild(h);else if(null!=h){var o=n.newItem(h,e);if(null==o)throw new Error("No matching menu item creator found: ".concat(JSON.stringify(h)));i.addChild(o)}}},n.newItems=function(t,n,i){this.newItemsOf(this,t,n,i)},n.newMenu=function(t){if(null!=this.MENU_CREATOR)return this.MENU_CREATOR(t);throw new Error("Missing DMenu creator.")},n.CREATORS=[],n.CREATOR_DEFAULT=null,n}(),Sl=function(){function n(t,n){this.O=t,this.kn=n,this.rs=!0}return Object.defineProperty(n.prototype,"enable",{get:function(){return this.rs},set:function(t){this.rs=t},enumerable:!1,configurable:!0}),n.prototype.open=function(t){this.get().open(t)},n.prototype.get=function(){var t=this,n=this.Do;return null==n&&(n=this.toMenu(this.kn),this.Do=n,n.on("select",(function(n,i,r){t.onSelect(n,i,r)}))),n},n.prototype.toMenu=function(n){return n instanceof t.DisplayObject?n:this.newMenu(n)},n.prototype.newMenu=function(t){return Ml.newMenu(t)},n.prototype.onSelect=function(t,n,i){var r=this.O;switch(t){case El.OPEN_LINK:r.open(!1);break;case El.OPEN_LINK_IN_NEW_WINDOW:r.open(!0);break;case El.COPY_LINK_ADDRESS:r.copy()}},n}(),Tl={AUTO:0,THIS_WINDOW:1,NEW_WINDOW:2},jl=function(t){var n=document.getSelection();if(n){var i=document.createRange();i.selectNodeContents(t),n.removeAllRanges(),n.addRange(i)}return n},Nl=function(t){return t.clipboardData||window.clipboardData},Il=function(t){function n(){var n=t.call(this)||this,i=document.body;return i.addEventListener("copy",(function(t){t.target===i&&(t.preventDefault(),t.stopPropagation(),n.emit("copy",Nl(t)))})),i.addEventListener("cut",(function(t){t.target===i&&(t.preventDefault(),t.stopPropagation(),n.emit("cut",Nl(t)))})),i.addEventListener("paste",(function(t){t.target===i&&(t.preventDefault(),t.stopPropagation(),n.emit("paste",Nl(t)))})),n}return B(n,t),n.copy=function(t){var n=navigator.clipboard;n&&n.writeText?n.writeText(t):function(t,n){if("undefined"==typeof ClipboardEvent){var i=t.clipboardData;if(void 0!==i&&void 0!==i.setData)return i.setData("Text",n),!0}return!1}(window,t)||function(t){var n=document.createElement("div");n.setAttribute("style","-webkit-user-select: text !important"),n.textContent="Dummy",document.body.appendChild(n);var i=jl(n),r=!1;if(i){var e=function(i){if(i.target===n){var e=Nl(i);e.setData("text/plain",t),r=e.getData("text/plain")===t,i.preventDefault()}};document.addEventListener("copy",e);try{document.execCommand("copy")}finally{document.removeEventListener("copy",e)}i.removeAllRanges()}return document.body.removeChild(n),r}(t)||navigator.userAgent.indexOf("Edge")<0&&function(t){var n=document.createElement("div");n.setAttribute("style","-webkit-user-select: text !important");var i=document.createElement("span");i.innerText=t,(n.attachShadow?n.attachShadow({mode:"open"}):n).appendChild(i),document.body.appendChild(n);var r=jl(n);r&&(document.execCommand("copy"),r.removeAllRanges()),document.body.removeChild(n)}(t)},n}(t.utils.EventEmitter),Cl=t.interaction.InteractionEvent,Al=function(){function t(t){this.kn=t,this.Eo=null==t?void 0:t.url,this.Jn=this.toNormalizedTarget(null==t?void 0:t.target),this.Mo=null==t?void 0:t.checker,this.rs=!0}return Object.defineProperty(t.prototype,"enable",{get:function(){return this.rs},set:function(t){this.rs=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"url",{get:function(){return this.Eo},set:function(t){this.Eo=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"target",{get:function(){return this.Jn},set:function(t){this.Jn=this.toNormalizedTarget(t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"checker",{get:function(){return this.Mo},set:function(t){this.Mo=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"menu",{get:function(){var t=this.Do;return null==t&&(t=this.newMenu(),this.Do=t),t},enumerable:!1,configurable:!0}),t.prototype.newMenu=function(){var n=this.kn;if(n){var i=n.menu;if(i)return new Sl(this,i)}var r=t.MENU;return null==r&&(r=new Sl(this,K.getInstance().get("DLink").getMenuOptions()),t.MENU=r),r},t.prototype.toStringifiedUrl=function(t,n){var i=ot(t)?t():t;null!=i&&(at(i)?n(i):i.then((function(t){null!=t&&n(t)})))},t.prototype.toNormalizedUrl=function(n){var i=t.ANCHOR_ELEMENT||document.createElement("a");return t.ANCHOR_ELEMENT=i,i.href=n,i.href},t.prototype.toNormalizedTarget=function(t){return Di(null!=t?t:Tl.AUTO,Tl)},t.prototype.copy=function(){var t=this;this.toStringifiedUrl(this.Eo,(function(n){Il.copy(t.toNormalizedUrl(n))}))},t.prototype.open=function(t){var n=this;this.toStringifiedUrl(this.Eo,(function(i){var r=!0===t||!1===t?t:n.inNewWindow(t);n.check(i,r,(function(){n.exec(i,r)}))}))},t.prototype.check=function(t,n,i){var r=this.Mo;if(r){var e=r();!0===e?i():!1===e||e.then((function(t){t&&i()}))}else i()},t.prototype.exec=function(t,n){if(n){var i=document.createElement("a");i.href=t,i.target="_blank",i.style.display="none",i.rel="noopener noreferrer",document.body.appendChild(i),i.click(),setTimeout((function(){document.body.removeChild(i)}),100)}else window.location.href=t},t.prototype.inNewWindow=function(t){switch(this.Jn){case Tl.NEW_WINDOW:return!0;case Tl.THIS_WINDOW:return!1;case Tl.AUTO:if(null!=t){var n=t instanceof Cl?t.data.originalEvent:t;return n.ctrlKey||n.shiftKey||n.altKey||n.metaKey||"button"in n&&0!==n.button}return!1}},t.prototype.onClick=function(t,n){if(this.Jn===Tl.AUTO){var i=n.data.originalEvent;if("pointerType"in i&&"mouse"!==i.pointerType||"touches"in i){var r=this.menu;if(r.enable)return this.rs&&t.state.isActionable&&r.open(t),!0}}return!this.rs},t}(),Rl=function(){function t(){}return t.toStateOptions=function(t,n){if(n&&(t===Tl.NEW_WINDOW||"NEW_WINDOW"===t)){var i=n.state;null==i?n.state=ht.NEW_WINDOW:at(i)?i!==ht.NEW_WINDOW&&(n.state=[i,ht.NEW_WINDOW]):i.indexOf(ht.NEW_WINDOW)<0&&i.push(ht.NEW_WINDOW)}return n},t}(),Ll=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.toLinkOptions=function(t){if(t)return{url:this.toUrl(t.url),target:t.target,checker:this.toChecker(t.checker),menu:t.menu}},n.prototype.toUrl=function(t){var n=this;return at(t)||null==t?t:function(){return t(n)}},n.prototype.toChecker=function(t){var n=this;if(null!=t)return function(){return t(n)}},n.prototype.init=function(n){t.prototype.init.call(this,Rl.toStateOptions(null==n?void 0:n.target,n))},Object.defineProperty(n.prototype,"link",{get:function(){var t=this.So;return null==t&&(t=new Al(this.toLinkOptions(this.kn)),this.So=t),t},enumerable:!1,configurable:!0}),n.prototype.onClick=function(n){this.link.onClick(this,n)||t.prototype.onClick.call(this,n)},n.prototype.getType=function(){return"DMenuItemLink"},n.prototype.onSelect=function(n){t.prototype.onSelect.call(this,n),this.link.open(n)},n.prototype.open=function(t){this.link.open(t)},n.prototype.onShortcut=function(n){t.prototype.onShortcut.call(this,n),this.activate(n)},n}(Ol),yl=function(t){return"url"in t},kl=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return B(i,n),i.prototype.init=function(t){n.prototype.init.call(this,t),this.initHover(t)},i.prototype.initHover=function(t){var n=this;this.on(Ki.over,(function(){n.state.isActionable&&n.open()}))},i.prototype.toMenu=function(n){var i=null==n?void 0:n.menu;return i instanceof t.DisplayObject?i:this.newMenu(i)},i.prototype.newMenu=function(t){return Ml.newMenu(t)},Object.defineProperty(i.prototype,"menu",{get:function(){var t=this,n=this.Do;return null==n&&((n=this.toMenu(this.kn)).on("select",(function(n,i,r){t.onMenuSelect(n,i,r)})),this.Do=n),n},enumerable:!1,configurable:!0}),i.prototype.getType=function(){return"DMenuItemMenu"},i.prototype.open=function(){var t=this.menu;t.isHidden()&&this.onOpen(t)},i.prototype.onOpen=function(t){var n=this.getContext();null!=n&&t.open(this,this.getCloseable(),n)},i.prototype.close=function(){this.menu.close()},i.prototype.toggle=function(){var t=this.menu;t.isHidden()?this.onOpen(t):t.close()},i.prototype.onSelect=function(t){this.open(),n.prototype.onSelect.call(this,t)},i.prototype.onMenuSelect=function(t,n,i){var r=this.getCloseable();null!=r&&r.emit("select",t,n,r)},i.prototype.onKeyDown=function(t){return Xi.isArrowRightKey(t)&&this.onKeyDownArrowRight(t),n.prototype.onKeyDown.call(this,t)},i.prototype.onKeyDownArrowRight=function(t){return!(!this.state.isActionable||!this.state.isFocused||(this.onSelect(t),0))},i}(wl),xl=function(t){return"menu"in t},Bl=function(n,i){var r=n.menu;return r instanceof t.DisplayObject||(null==r.sticky&&(r.sticky=i),null==r.align&&(r.align=ju.RIGHT)),n},_l=function(t){function n(n){var i=t.call(this)||this;return n.snippet.add(i,!0),n.reflowable.add(i),i}return B(n,t),n.prototype.onReflow=function(t,n,i){var r=t.state,e=t.border,u=e.getWidth(r),s=e.getColor(r);if(null!=s){var h=e.getAlpha(r),o=e.getAlign(r),a=t.padding,c=.5*i;this.clear(),this.lineStyle(u,s,h,o),this.moveTo(a.getLeft(),c),this.lineTo(n-a.getRight(),c),this.visible=!0}else this.clear(),this.visible=!1},n}(t.Graphics),Pl=function(t){return"separator"in t},Ul=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.initReflowable=function(){new _l(this)},n.prototype.getType=function(){return"DMenuItemSeparator"},n}(ml),Fl=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DMenuItemSpace"},n}(_u),Gl=function(t){return"space"in t},Hl=function(){Ml.addItemCreator((function(t){return Dl(t)?new pl(t):null})),Ml.addItemCreator((function(t){return yl(t)?new Ll(t):null})),Ml.addItemCreator((function(t,n){return xl(t)?new kl(Bl(t,n)):null})),Ml.addItemCreator((function(t){return Pl(t)?new Ul(t):null})),Ml.addItemCreator((function(t){return Gl(t)?new Fl(t):null})),Ml.setItemCreatorDefault((function(t){return new Ol(t)}))},zl=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DMenuItemExpandableBody"},n}(Fu),Vl=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getSelection=function(){return null},n.prototype.getType=function(){return"DMenuItemExpandableHeader"},n}(ml),Wl=function(){function t(){}return t.addItemCreator=function(t){this.CREATORS.push(t)},t.setItemCreatorDefault=function(t){this.CREATOR_DEFAULT=t},t.newItem=function(t,n){return Ml.newItemOf(this.CREATORS,this.CREATOR_DEFAULT,t,n)||Ml.newItem(t,n)},t.newItems=function(t,n,i){Ml.newItemsOf(this,t,n,i)},t.CREATORS=[],t.CREATOR_DEFAULT=null,t}(),Xl=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return B(i,n),i.prototype.init=function(t){var i,r=this;n.prototype.init.call(this,t);var e=this.theme,u=this.toHeader(e,t);this.hh=u,u.on("select",(function(){r.toggle()})),this.addChild(u);var s=this.toBody(e,t);this.Oe=s;var h=null!==(i=null==t?void 0:t.sticky)&&void 0!==i&&i;this.newItems(s,h,e,t),this.addChild(s),this.state.isActive?this.onActivated():this.onDeactivated()},i.prototype.newItems=function(t,n,i,r){var e=null==r?void 0:r.items;null!=e&&Wl.newItems(t,e,n)},i.prototype.toHeader=function(n,i){return i?i.header instanceof t.DisplayObject?i.header:this.newHeader(n,i.header):this.newHeader(n)},i.prototype.newHeader=function(t,n){return new Vl(n)},i.prototype.toBody=function(n,i){var r=null==i?void 0:i.body;return r?r instanceof t.DisplayObject?r:this.newBody(n,r):this.newBody(n)},i.prototype.newBody=function(t,n){return new zl(n)},i.prototype.open=function(){this.state.isActive=!0},i.prototype.close=function(){this.state.isActive=!1},i.prototype.toggle=function(){this.state.isActive=!this.state.isActive},i.prototype.onActivated=function(){var t=this.Oe;t instanceof Qi?t.show():t.visible=!0},i.prototype.onDeactivated=function(){var t=this.Oe;t instanceof Qi?t.hide():t.visible=!1},i.prototype.onStateChange=function(t,i){n.prototype.onStateChange.call(this,t,i),t.isActive?i.isActive||this.onActivated():i.isActive&&this.onDeactivated()},i.prototype.onKeyDown=function(t){if(Xi.isArrowRightKey(t))this.state.isActionable&&!this.state.isActive&&(i=this.hh)instanceof Qi&&i.state.isFocused&&(this.state.isActive=!0);else if(Xi.isArrowLeftKey(t)){var i;if(this.state.isActionable&&this.state.isActive)return(i=this.hh)instanceof Qi?i.focus():this.focus(),this.state.isActive=!1,n.prototype.onKeyDown.call(this,t),!0}return n.prototype.onKeyDown.call(this,t)},i.prototype.getType=function(){return"DMenuItemExpandable"},i}(Fu),Kl=function(t){return"header"in t},Yl=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DMenuItemExpandableItemCheck"},n}(pl),Jl=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DMenuItemExpandableItemLink"},n}(Ll),Zl=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DMenuItemExpandableItemSeparator"},n}(Ul),ql=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DMenuItemExpandableItemSpace"},n}(Fl),Ql=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DMenuItemExpandableItemText"},n}(Ol),$l=function(){Ml.addItemCreator((function(t){return Kl(t)?new Xl(t):null})),Wl.addItemCreator((function(t){return Dl(t)?new Yl(t):null})),Wl.addItemCreator((function(t){return yl(t)?new Jl(t):null})),Wl.addItemCreator((function(t){return Pl(t)?new Zl(t):null})),Wl.addItemCreator((function(t){return Gl(t)?new ql(t):null})),Wl.setItemCreatorDefault((function(t){return new Ql(t)}))},tv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DMenuSidedItemCheck"},n}(pl),nv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getSelection=function(){return null},n.prototype.getType=function(){return"DMenuSidedItemLink"},n}(Ll),iv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.initHover=function(t){},n.prototype.onMenuSelect=function(n,i,r){t.prototype.onMenuSelect.call(this,n,i,r);var e=t.prototype.getSelection.call(this);e&&e.add(i)},n.prototype.onOpen=function(t){t.open(this,this)},n.prototype.getSelection=function(){return null},n.prototype.getType=function(){return"DMenuSidedItemMenu"},n}(kl),rv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DMenuSidedItemSeparator"},n}(Ul),ev=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DMenuSidedItemSpace"},n}(Fl),uv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DMenuSidedItemText"},n}(Ol),sv=function(){function t(){}return t.addItemCreator=function(t){this.CREATORS.push(t)},t.setItemCreatorDefault=function(t){this.CREATOR_DEFAULT=t},t.newItem=function(t,n){return Ml.newItemOf(this.CREATORS,this.CREATOR_DEFAULT,t,n)||Ml.newItem(t,n)},t.newItems=function(t,n,i){Ml.newItemsOf(this,t,n,i)},t.CREATORS=[],t.CREATOR_DEFAULT=null,t}(),hv=function(){sv.setItemCreatorDefault((function(t){return new uv(t)})),sv.addItemCreator((function(t){return Gl(t)?new ev(t):null})),sv.addItemCreator((function(t){return Pl(t)?new rv(t):null})),sv.addItemCreator((function(t,n){return xl(t)?new iv(Bl(t,n)):null})),sv.addItemCreator((function(t){return yl(t)?new nv(t):null})),sv.addItemCreator((function(t){return Dl(t)?new tv(t):null}))},ov=function(){function t(){}return t.addItemCreator=function(t){this.CREATORS.push(t)},t.setItemCreatorDefault=function(t){this.CREATOR_DEFAULT=t},t.newItem=function(t,n){return Ml.newItemOf(this.CREATORS,this.CREATOR_DEFAULT,t,n)||sv.newItem(t,n)},t.newItems=function(t,n,i){Ml.newItemsOf(this,t,n,i)},t.CREATORS=[],t.CREATOR_DEFAULT=null,t}(),av=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.newItems=function(t,n,i,r){null!=r&&null!=r.items&&ov.newItems(t,r.items,n)},n.prototype.getType=function(){return"DMenuSidedItemExpandable"},n}(Xl),cv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DMenuSidedItemExpandableItemCheck"},n}(Yl),fv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DMenuSidedItemExpandableItemLink"},n}(Ll),lv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DMenuItemExpandableItemMenu"},n}(kl),vv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.onOpen=function(t){t.open(this,this)},n.prototype.getType=function(){return"DMenuSidedItemExpandableItemMenu"},n}(lv),bv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DMenuSidedItemSeparator"},n}(Zl),dv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DMenuSidedItemExpandableItemSpace"},n}(ql),gv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DMenuSidedItemExpandableItemText"},n}(Ql),mv=function(){sv.addItemCreator((function(t){return Kl(t)?new av(t):null})),ov.addItemCreator((function(t){return Dl(t)?new cv(t):null})),ov.addItemCreator((function(t){return yl(t)?new fv(t):null})),ov.addItemCreator((function(t,n){return xl(t)?new vv(Bl(t,n)):null})),ov.addItemCreator((function(t){return Pl(t)?new bv(t):null})),ov.addItemCreator((function(t){return Gl(t)?new dv(t):null})),ov.setItemCreatorDefault((function(t){return new gv(t)}))},wv=function(){Hl(),$l(),hv(),mv()},Ov=function(){wv(),dl()},pv=function(){function t(){}return t.add=function(t,n){var i=this.To;null==i&&(i=new Map,this.To=i);var r=i.get(t);null==r?(r=[n],i.set(t,r)):r.push(n)},t.get=function(t){var n=this.To;if(null!=n)return n.get(t)},t}(),Dv=function(t){function n(n,i){return t.call(this,ke.EMIT_EVENT,n,i,hu.EMIT_EVENT,"")||this}return B(n,t),n}(pu),Ev=function(t){function n(n,i,r){return t.call(this,n,i,"",hu.EMIT_EVENT,r)||this}return B(n,t),n}(pu),Mv=function(t){function n(n,i,r,e){return t.call(this,n,i,r,e,"")||this}return B(n,t),n}(pu),Sv=function(t){function n(n,i,r,e){return t.call(this,n,i,r,hu.EMIT_EVENT,e)||this}return B(n,t),n}(pu),Tv=function(t,n){return n?ao(t).then((function(t){var n=be.getInstance().init();n.updateTexture(t),n.render();var i=document.createElement("canvas");return n.read(i),Tv(i.toDataURL(),!1)})):ao(t).then((function(t){return new jc(t)}))},jv=function(){function t(){}return t.from=function(t,n,i){var r=this,e=Ue.toSerialized(t),u=e.pieces;return Ue.toPieceData(n,u,i).then((function(t){return r.jo(e,i,u,t)}))},t.jo=function(t,n,i,r){var e=this,u=t.width,s=t.height,h=new Pe(u,s),o=new dr(t,i,r,n,1);return Ue.newLayer(t,h,o).then((function(){return e.create(t.name,u,s,h,n,0)}))},t.create=function(t,n,i,r,e,u){var s=new Nr(t,e,u);return s.size.set(n,i),r.copyTo(s),s.size.init(),s},t}(),Nv=function(t){return"data:image/svg+xml;base64,".concat(btoa(t))},Iv=function(t){return Math.round(100*t)/100},Cv=function(){function t(){}return t.add=function(t){var n,i,r;(null!==(n=this.yh)&&void 0!==n?n:this.yh=new Map).set(t.type,t),(null!==(i=this.Ee)&&void 0!==i?i:this.Ee=new Map).set(t.id,t),(null!==(r=this.Pt)&&void 0!==r?r:this.Pt=[]).push(t)},t.get=function(t){var n=this.yh;if(null!=n)return n.get(t)},t.getById=function(t){var n=this.Ee;if(null!=n)return n.get(t)},t.each=function(t){var n=this.Pt;if(null!=n)for(var i=0,r=n.length;i<r;++i)t(n[i])},t}(),Av=function(){function t(){}return t.toIndices=function(t){for(var n=[],i=0,r=t.length;i<r;++i)n.push(t[i].index);return n},t.toDepth=function(t){for(var n=0,i=t.parent;i instanceof pt;)n+=1,i=i.parent;return n},t.toSharedParent=function(t,n){if(this.toDepth(t)<this.toDepth(n)){for(var i=t.parent;i instanceof pt;){if(this.isParent(n,i))return i;i=i.parent}return i}for(var r=n.parent;r instanceof pt;){if(this.isParent(t,r))return r;r=r.parent}return r},t.toOfParent=function(t,n){for(var i=t.parent;i!==n&&i instanceof pt;)t=i,i=i.parent;return t},t.isParent=function(t,n){for(var i=t.parent;i instanceof pt;){if(i===n)return!0;i=i.parent}return!1},t.toSelected=function(t){for(var n=t;n instanceof pt;){if(n.selected)return n;n=n.parent}return null},t.findChildById=function(n,i,r){for(var e=n.children,u=0,s=e.length;u<s;++u){var h=e[u];if(h.id===i)return h;if(!0===r){var o=t.findChildById(h,i,r);if(null!=o)return o}}return null},t.findChildByType=function(n,i,r){for(var e=n.children,u=0,s=e.length;u<s;++u){var h=e[u];if(h.type===i)return h;if(!0===r){var o=t.findChildByType(h,i,r);if(null!=o)return o}}return null},t.findChild=function(n,i,r){for(var e=n.children,u=0,s=e.length;u<s;++u){var h=e[u];if(i(h))return h;if(!0===r){var o=t.findChild(h,i,r);if(null!=o)return o}}return null},t.findChildrenByType=function(n,i,r,e){e=e||[];for(var u=n.children,s=0,h=u.length;s<h;++s){var o=u[s];o.type===i&&e.push(o),!0===r&&t.findChildrenByType(o,i,r,e)}return e},t.findChildren=function(n,i,r,e){e=e||[];for(var u=n.children,s=0,h=u.length;s<h;++s){var o=u[s];i(o)&&e.push(o),!0===r&&t.findChildren(o,i,r,e)}return e},t.COMPARATOR_INDEX=function(t,n){return t.index-n.index},t}(),Rv=function(){function t(){}return t.delete=function(t,n,i){for(var r=t.children,e=r.length,u=0;u<e;++u)(o=r[u]).selected?o.index=e+u:o.index=u;if(r.sort(Av.COMPARATOR_INDEX),!0===i){for(u=e-1;0<=u;--u){if(!(o=r[u]).selected){var s=r.length-(u+1);if(0<s){var h=r.splice(u+1,s);return null!=n&&(n.length=0),t.onChildTransformChange(),t.toDirty(),h}return null!=n&&(n.length=0),null}o.index-=e,o.parent=null,o.selected=!1,o.uploaded=void 0,o.onDetach()}return 0<r.length?(h=r.splice(0,r.length),null!=n&&(n.length=0),t.onChildTransformChange(),t.toDirty(),h):(null!=n&&(n.length=0),null)}for(u=e-1;0<=u;--u){var o;if(!(o=r[u]).selected)return r.length=u+1,null!=n&&(n.length=0),t.onChildTransformChange(),t.toDirty(),null;o.parent=null,o.selected=!1,o.uploaded=void 0,o.onDetach()}return 0<r.length?(r.length=0,null!=n&&(n.length=0),t.onChildTransformChange(),t.toDirty()):null!=n&&(n.length=0),null},t}(),Lv=function(){function t(){}return t.from=function(t){if(at(t))return F[t];if(mn(t))return t;if(null!=t){for(var n=F.NONE,i=0,r=t.length;i<r;++i)n|=F[t[i]];return n}return F.NONE},t}(),yv=function(){function t(){this.resources=[],this.resourceToIndex=new Map,this.data=[],this.dataToIndex=new Map,this.pieces=[],this.pieceToIndex=new Map,this.uuids=new Set,this.uuidNext=0}return t.prototype.addResource=function(t){return this.No(t,this.resources,this.resourceToIndex)},t.prototype.addData=function(t){return this.No(t,this.data,this.dataToIndex)},t.prototype.addPiece=function(t){return this.No(t,this.pieces,this.pieceToIndex)},t.prototype.addUuid=function(t){if(0!==t){var n=this.uuids;return n.has(t)?0:(n.add(t),t)}return 0},t.prototype.updateUuid=function(t){var n=this.uuids;if(0!==t)return t;var i=this.newUuid();return n.add(i),i},t.prototype.newUuid=function(){for(var t=this.uuids,n=this.uuidNext;;)if(0!==(n+=1)&&!t.has(n))return this.uuidNext=n,n},t.prototype.No=function(t,n,i){var r=i.get(t);if(null!=r)return r;var e=n.length;return n.push(t),i.set(t,e),e},t}(),kv=function(t){function n(n,i){var r,e,u,s=this;return(s=t.call(this)||this).Io=null!==(r=null==i?void 0:i.visible)&&void 0!==r?r:n.isSnapGridVisible(),s.Co=s.Io,s.Ao=null!==(e=null==i?void 0:i.enable)&&void 0!==e?e:n.isSnapGridEnabled(),s.rs=s.Ao,s.Ro=null!==(u=null==i?void 0:i.size)&&void 0!==u?u:n.getSnapGridSize(),s.j=s.Ro,s}return B(n,t),Object.defineProperty(n.prototype,"visible",{get:function(){return this.Co},set:function(t){this.Co!==t&&(this.Co=t,this.emit("change",this))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"enable",{get:function(){return this.rs},set:function(t){this.rs!==t&&(this.rs=t,this.emit("change",this))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"size",{get:function(){return this.j},set:function(t){this.j!==t&&(this.j=t,this.emit("change",t,this))},enumerable:!1,configurable:!0}),n.prototype.snap=function(t,n){if(this.rs){var i=this.j;n.set(t,Math.round(t/i)*i)}},n.prototype.reset=function(){this.Co=this.Io,this.rs=this.Ao,this.j=this.Ro,this.emit("change",this)},n.prototype.serialize=function(){return[this.rs?1:0,this.Co?1:0,this.j]},n.prototype.deserialize=function(t){this.enable=!!t[0],2 in t?(this.visible=!!t[1],this.size=t[2]):(this.visible=!1,this.size=t[1])},n}(t.utils.EventEmitter),xv=function(){function t(){this.distance=NaN,this.result=0,this.threshold=10}return t.prototype.reset=function(t,n){this.distance=NaN,this.result=t,this.threshold=1e-4<n?10/n:10},t.prototype.set=function(t,n){var i=Math.abs(n-t);if(i<=this.threshold){var r=this.distance;(r!=r||i<r)&&(this.distance=i,this.result=n)}},t}(),Bv={HORIZONTAL:0,VERTICAL:1},_v=function(){function t(t,n){this.type=t,this.position=n}return t.prototype.serialize=function(){return[this.type,this.position]},t}(),Pv=function(t){function n(n,i){var r,e,u=this;return(u=t.call(this)||this).values=[],u.Io=null!==(r=null==i?void 0:i.visible)&&void 0!==r?r:n.isSnapTargetVisible(),u.Co=u.Io,u.Ao=null!==(e=null==i?void 0:i.enable)&&void 0!==e?e:n.isSnapTargetEnabled(),u.rs=u.Ao,u}return B(n,t),Object.defineProperty(n.prototype,"enable",{get:function(){return this.rs},set:function(t){this.rs!==t&&(this.rs=t,this.emit("change",this))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"visible",{get:function(){return this.Co},set:function(t){this.Co!==t&&(this.Co=t,this.emit("change",this))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"size",{get:function(){return this.values.length},enumerable:!1,configurable:!0}),n.prototype.add=function(t,n){null!=n?this.values.splice(n,0,t):this.values.push(t),this.emit("change",this)},n.prototype.remove=function(t){var n=this.values;0<=t&&t<n.length&&(n.splice(t,1),this.emit("change",this))},n.prototype.replace=function(t,n){var i=this.values;if(0<=t&&t<i.length){var r=i[t];return i[t]=n,this.emit("change",this),r}return null},n.prototype.swap=function(t,n){if(t!==n){var i=this.values,r=i[t];i[t]=i[n],i[n]=r,this.emit("change",this)}},n.prototype.snap=function(t,n,i,r){if(this.rs)for(var e=this.values,u=0,s=e.length;u<s;++u){var h=e[u];h.type===Bv.VERTICAL?i.set(t,h.position):r.set(n,h.position)}},n.prototype.reset=function(){this.rs=this.Ao,this.Co=this.Io,this.values.length=0,this.emit("change",this)},n.prototype.serialize=function(){for(var t=[],n=this.values,i=0,r=n.length;i<r;++i)t.push(n[i].serialize());return[this.rs?1:0,this.Co?1:0,t]},n.prototype.deserialize=function(t){this.rs=!!t[0],this.Co=!!t[1];var n=t[2],i=this.values;i.length=0;for(var r=0,e=n.length;r<e;++r){var u=n[r];i.push(new _v(u[0],u[1]))}this.emit("change",this)},n}(t.utils.EventEmitter),Uv=1e-5,Fv={NONE:0,TOP_LEFT:1,TOP_CENTER:2,TOP_RIGHT:3,MIDDLE_LEFT:4,MIDDLE_RIGHT:5,BOTTOM_LEFT:6,BOTTOM_CENTER:7,BOTTOM_RIGHT:8,ROTATION:9},Gv=function(n){function i(i,r,e){var u,s=this;return(s=n.call(this)||this).gt=[new t.Point,new t.Point,new t.Point,new t.Point,new t.Point],s.Lo=[new t.Point,new t.Point],s.yo=[1,1],s.ko=new t.Point,s.xo=new xv,s.Bo=new xv,s._o={distance:0,scale:new t.Point},s.Po=new t.Point,s.Uo=new t.Rectangle,s.Fo=new t.Point,s.grid=new kv(r,null==e?void 0:e.grid),s.target=new Pv(r,null==e?void 0:e.target),s.O=i,s.Ao=null!==(u=null==e?void 0:e.enable)&&void 0!==u?u:r.isSnapEnabled(),s.rs=s.Ao,s}return B(i,n),Object.defineProperty(i.prototype,"enable",{get:function(){return this.rs},set:function(t){this.rs!==t&&(this.rs=t,this.emit("change",this))},enumerable:!1,configurable:!0}),i.prototype.prepare=function(t){t.updateTransform();var n=t.transform.localTransform,i=t.width,r=t.height,e=this.gt;e[0].set(0,0),e[1].set(i,0),e[2].set(i,r),e[3].set(0,r),e[4].set(.5*i,.5*r),n.apply(e[0],e[0]),n.apply(e[1],e[1]),n.apply(e[2],e[2]),n.apply(e[3],e[3]),n.apply(e[4],e[4])},i.prototype.prepareForTranslate=function(t){this.rs&&this.prepare(t)},i.prototype.snap=function(t,n){var i=t.x,r=t.y,e=this.O.canvas,u=this.xo,s=this.Bo;if(null!=e){var h=Math.max(e.scale.x,e.scale.y);u.reset(i,h),s.reset(r,h),u.set(i,0),u.set(i,e.width),s.set(r,0),s.set(r,e.height)}else u.reset(i,1),s.reset(r,1);return this.target.snap(i,r,u,s),this.grid.snap(i,u),this.grid.snap(r,s),n.x=bh(u.distance)?NaN:u.result,n.y=bh(s.distance)?NaN:s.result,n},i.prototype.toSnapped=function(t,n){var i=t.x,r=t.y;if(this.rs){this.snap(t,n);var e=n.x,u=n.y;n.set(bh(e)?i:e,bh(u)?r:u)}else n.set(i,r);return n},i.prototype.toTranslationSnapped=function(t,n){var i=t.x,r=t.y,e=NaN,u=NaN;if(this.rs)for(var s=this.Po,h=this.gt,o=0,a=h.length;o<a;++o){var c=h[o];if(s.set(c.x+i,c.y+r),this.snap(s,s),!bh(s.x)){var f=s.x-c.x;(bh(e)||Math.abs(f-i)<Math.abs(e-i))&&(e=f)}if(!bh(s.y)){var l=s.y-c.y;(bh(u)||Math.abs(l-r)<Math.abs(u-r))&&(u=l)}}return n.x=bh(e)?i:e,n.y=bh(u)?r:u,n},i.prototype.prepareForRotate=function(t){},i.prototype.getGridSizeRotation=function(){return 5},i.prototype.toRadian=function(t){return t/180*Math.PI},i.prototype.toDegree=function(t){return t/Math.PI*180},i.prototype.toRotationSnapped=function(t,n){if(this.rs){var i=this.getGridSizeRotation(),r=t+n,e=Math.round(this.toDegree(r)),u=e%90;return Math.abs(u)<=i?this.toRadian(e-u)-t:90-i<=u?this.toRadian(e+(90-u))-t:u<=-90+i?this.toRadian(e-(90+u))-t:n}return n},i.prototype.calcNormalizedVector=function(t,n,i){var r=n.x-t.x,e=n.y-t.y,u=Math.sqrt(r*r+e*e);if(Uv<u){var s=1/u;i.x=r*s,i.y=e*s}else i.x=1,i.y=0;return u},i.prototype.prepareForScale=function(t,n){if(this.rs){this.prepare(t);var i=this.gt,r=this.Lo,e=this.yo;switch(n){case Fv.TOP_LEFT:e[0]=this.calcNormalizedVector(i[1],i[0],r[0]),e[1]=this.calcNormalizedVector(i[3],i[0],r[1]);break;case Fv.TOP_CENTER:e[0]=this.calcNormalizedVector(i[3],i[0],r[0]);break;case Fv.TOP_RIGHT:e[0]=this.calcNormalizedVector(i[0],i[1],r[0]),e[1]=this.calcNormalizedVector(i[2],i[1],r[1]);break;case Fv.MIDDLE_LEFT:e[0]=this.calcNormalizedVector(i[1],i[0],r[0]);break;case Fv.NONE:break;case Fv.MIDDLE_RIGHT:e[0]=this.calcNormalizedVector(i[0],i[1],r[0]);break;case Fv.BOTTOM_LEFT:e[0]=this.calcNormalizedVector(i[2],i[3],r[0]),e[1]=this.calcNormalizedVector(i[0],i[3],r[1]);break;case Fv.BOTTOM_CENTER:e[0]=this.calcNormalizedVector(i[0],i[3],r[0]);break;case Fv.BOTTOM_RIGHT:e[0]=this.calcNormalizedVector(i[3],i[2],r[0]),e[1]=this.calcNormalizedVector(i[1],i[2],r[1])}}},i.prototype.setScaleSnappedResult=function(t,n,i,r,e){if(Uv<n&&(bh(e.distance)||t<e.distance)){e.distance=t;var u=1+i/n;r?e.scale.x=u:e.scale.y=u}},i.prototype.calcScaleSnapped1D=function(t,n,i,r,e,u){var s=this.ko;t.apply(n,s);var h=s.x,o=s.y;this.snap(s,s);var a=s.x,c=s.y;if(!bh(a)){var f=Math.abs(i.x);if(Uv<f){var l=(a-h)/i.x,v=Math.abs(l),b=(a-n.x)/i.x;this.setScaleSnappedResult(v,r,b,e,u)}}if(!bh(c)){var d=Math.abs(i.y);if(Uv<d){var g=(c-o)/i.y,m=(v=Math.abs(g),(c-n.y)/i.y);this.setScaleSnappedResult(v,r,m,e,u)}}},i.prototype.calcScaleSnappedX=function(t,n,i,r,e){this.calcScaleSnapped1D(t,n,i,r,!0,e)},i.prototype.calcScaleSnappedY=function(t,n,i,r,e){this.calcScaleSnapped1D(t,n,i,r,!1,e)},i.prototype.calcScaleSnapped2D=function(t,n,i,r,e){var u=this.ko;t.apply(n,u);var s=u.x,h=u.y;this.snap(u,u);var o=u.x,a=u.y;if(bh(o)){if(bh(a))return;o=s}else bh(a)&&(a=h);var c=i[0].x*i[1].y-i[1].x*i[0].y;if(Uv<Math.abs(c)){var f=o-s,l=a-h,v=Math.abs(f*f+l*l);if(bh(e.distance)||v<e.distance){e.distance=v;var b=o-n.x,d=a-n.y,g=(+i[1].y*b-i[1].x*d)/c,m=(-i[0].y*b+i[0].x*d)/c;e.scale.set(1+g/r[0],1+m/r[1])}}},i.prototype.calcScaleSnappedXY=function(t,n,i,r,e,u,s){this.calcScaleSnapped2D(t,n,e,u,s),this.calcScaleSnappedX(t,r,e[0],u[0],s),this.calcScaleSnappedY(t,i,e[1],u[1],s)},i.prototype.toScaleSnapped=function(t,n,i,r){if(this.rs){var e=this.gt,u=this.Lo,s=this.yo,h=this._o;switch(h.distance=NaN,h.scale.set(r.x,r.y),n){case Fv.TOP_LEFT:this.calcScaleSnappedXY(t,e[0],e[1],e[3],u,s,h);break;case Fv.TOP_CENTER:this.calcScaleSnappedY(t,e[0],u[0],s[0],h),this.calcScaleSnappedY(t,e[1],u[0],s[0],h);break;case Fv.TOP_RIGHT:this.calcScaleSnappedXY(t,e[1],e[0],e[2],u,s,h);break;case Fv.MIDDLE_LEFT:this.calcScaleSnappedX(t,e[0],u[0],s[0],h),this.calcScaleSnappedX(t,e[3],u[0],s[0],h);break;case Fv.NONE:break;case Fv.MIDDLE_RIGHT:this.calcScaleSnappedX(t,e[1],u[0],s[0],h),this.calcScaleSnappedX(t,e[2],u[0],s[0],h);break;case Fv.BOTTOM_LEFT:this.calcScaleSnappedXY(t,e[3],e[2],e[0],u,s,h);break;case Fv.BOTTOM_CENTER:this.calcScaleSnappedY(t,e[2],u[0],s[0],h),this.calcScaleSnappedY(t,e[3],u[0],s[0],h);break;case Fv.BOTTOM_RIGHT:this.calcScaleSnappedXY(t,e[2],e[3],e[1],u,s,h)}if(!bh(h.distance)){if(r.copyFrom(h.scale),i)switch(n){case Fv.TOP_LEFT:case Fv.TOP_RIGHT:case Fv.BOTTOM_LEFT:case Fv.BOTTOM_RIGHT:r.x=r.y=Math.max(r.x,r.y);break;case Fv.TOP_CENTER:case Fv.BOTTOM_CENTER:r.x=r.y;break;case Fv.MIDDLE_LEFT:case Fv.MIDDLE_RIGHT:r.y=r.x}return!0}}return!1},i.prototype.reset=function(){this.enable=this.Ao,this.target.reset(),this.grid.reset()},i.prototype.serialize=function(){return[this.rs?1:0,this.target.serialize(),this.grid.serialize()]},i.prototype.deserialize=function(t){this.enable=!!t[0],this.target.deserialize(t[1]),this.grid.deserialize(t[2])},i}(t.utils.EventEmitter),Hv=function(t){function n(n,i,r){var e=t.call(this,n,i.width,i.height,0,r)||this;return e.Ns=i,e}return B(n,t),n.prototype.render=function(t){var n=this.frame;t.drawImage(this.Ns.canvas,n.x,n.y,n.width,n.height)},n}(ue),zv=function(){function t(){}return t.measure=function(t){var n=this.Go;null==n&&(n=new Map,this.Go=n);var i=n.get(t);if(null!=i)return i;var r=this.Ho;null==r&&((r=document.createElement("span")).innerText="|ÉqÅ",r.style.border="none",r.style.margin="0px",this.Ho=r);var e=this.zo;null==e&&((e=document.createElement("div")).style.display="inline-block",e.style.width="0px",e.style.height="0px",e.style.border="none",e.style.margin="0px",e.style.verticalAlign="baseline",this.zo=e);var u=this.Vo;null==u&&((u=document.createElement("div")).style.position="absolute",u.style.padding="0px",u.style.margin="0px",u.style.visibility="hidden",u.appendChild(r),u.appendChild(e),document.body.appendChild(u),this.Vo=u),r.style.font=t;var s=e.getBoundingClientRect().top,h=r.getBoundingClientRect();return i={ascent:s-h.top,descent:h.bottom-s},n.set(t,i),i},t}(),Vv=function(n,i,r,e){this.id=n,this.size=i,this.color=t.utils.hex2string(r),this.height=i+2*e;var u=zv.measure(n);this.ascent=u.ascent,this.descent=u.descent},Wv=function(){function n(n,i,r,e){this.R=n,this.ir=document.createElement("canvas"),this.Wo=null;var u=this.toPadding(i);this.zn=u,this.Ue=new Vv(n,i,r,u),this.Fe={},this.Ge=0,this.Xo=0,this.St=1,this.cn=1,this.Ko=0,this.Yo=0,this.je=t.Texture.from(this.ir,{mipmap:t.MIPMAP_MODES.OFF,resolution:e,scaleMode:t.SCALE_MODES.NEAREST});var s=this.Fe;this.No(" "," ",s,ve.SPACE_R),this.No("\t"," ",s,ve.SPACE_R),this.No("...","...",s,ve.LETTER_RNB);for(var h=0,o=ce.length;h<o;++h){var a=ce[h];this.No(a,a,s,ve.LETTER_RNB)}}return n.prototype.toPadding=function(t){return Math.max(3,Math.ceil(.2*t))},Object.defineProperty(n.prototype,"id",{get:function(){return this.R},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"font",{get:function(){return this.Ue},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"width",{get:function(){return this.St},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"height",{get:function(){return this.cn},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"canvas",{get:function(){return this.ir},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"characters",{get:function(){return this.Fe},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"texture",{get:function(){return this.je},enumerable:!1,configurable:!0}),n.prototype.No=function(t,n,i,r){if(!this.isIgnored(n)){var e=i[t];if(null!=e)e.type&ve.RESERVED||(0===e.ref&&(this.Xo-=1),e.ref+=1);else{var u=this.getAdvance(n),s=this.zn,h=Math.ceil(s+u+s),o=this.font.height;i[t]=new le(n,u,h,o,r),this.Ge+=1,this.Ko+=1}}},n.prototype.isIgnored=function(t){switch(t){case"\n":case"\r":case"\v":case"\f":case"…":return!0}return!1},n.prototype.Jo=function(t,n){var i=n[t];null!=i&&!(i.type&ve.RESERVED)&&0<i.ref&&(i.ref-=1,0===i.ref&&(this.Xo+=1))},n.prototype.Zo=function(){if(this.Ge>>1<=this.Xo){var t=this.Fe;for(var n in t)t[n].ref<=0&&delete t[n];this.Ge-=this.Xo,this.Ko+=1,this.Xo=0}},n.prototype.add=function(t,n){void 0===n&&(n=ve.LETTER);for(var i=this.Fe,r=b.from(t);r.hasNext();){var e=r.next();this.No(e,e,i,n)}},n.prototype.remove=function(t){for(var n=this.Fe,i=b.from(t);i.hasNext();)this.Jo(i.next(),n)},n.prototype.get=function(t){return this.Fe[t]},n.prototype.getAdvance=function(t){var n=this.getContext();return null!=n?n.measureText(t).width:0},n.prototype.getContext=function(){var t=this.Wo;if(null==t){var n=this.ir;if(null==n)return null;if(null==(t=this.Wo=n.getContext("2d",{alpha:!0})))return null}var i=this.Ue;return t.font!==i.id&&(t.font=i.id,i.id=t.font,t.textAlign="left",t.textBaseline="alphabetic",t.lineWidth=0,t.lineCap="round",t.lineJoin="miter",t.miterLimit=0,t.fillStyle=i.color,t.strokeStyle="#0000ff"),t},n.prototype.update=function(){if(this.Zo(),this.Yo<this.Ko){this.Yo=this.Ko;var t=this.ir;if(null!=t){var n=this.Ue,i=n.height,r=this.Fe,e=this.St=this.toPowerOf2(Math.ceil(Math.sqrt(this.Ge))*i),u=this.zn,s=Math.round(.5*(i-(n.ascent+n.descent))+n.ascent),h=0,o=0;for(var a in r)e<=h+(g=r[a]).width&&(h=0,o+=i),g.x=h,g.y=o,g.origin.x=h+u,g.origin.y=o+s,h+=g.width;var c=this.cn=o+i,f=this.je.baseTexture,l=f.resolution,v=Math.ceil(e*l),b=Math.ceil(c*l);t.width=v,t.height=b;var d=this.getContext();if(null!=d){for(var a in d.save(),d.scale(l,l),d.clearRect(0,0,e,c),r){var g=r[a];d.fillText(a,g.origin.x,g.origin.y)}d.restore()}return f.setRealSize(v,b),!0}}return!1},n.prototype.getRevision=function(){return this.Ko},n.prototype.getRevisionUpdate=function(){return this.Yo},Object.defineProperty(n.prototype,"length",{get:function(){return this.Ge},enumerable:!1,configurable:!0}),n.prototype.destroy=function(){null!=this.ir&&(this.ir=null);var t=this.Fe;for(var n in t)delete t[n]},n.prototype.toPowerOf2=function(t){for(var n=32;n<t;)n<<=1;return n},n}(),Xv=function(t){t.update()},Kv=function(t){t.forEach(Xv)},Yv=function(t){t.update()},Jv=function(t){t.forEach(Yv)},Zv=function(){function t(t){var n=this;this.He=new Map,this.bn=t.renderer.resolution,t.renderer.on("prerender",(function(){n.update()}))}return t.prototype.add=function(t,n,i,r){var e=this.He,u=e.get(t);null==u&&(u=new Map,e.set(t,u));var s=u.get(i);null==s&&(s=new Wv(t,n,i,this.bn),u.set(i,s)),s.add(r)},t.prototype.remove=function(t,n,i){var r=this.He.get(t);if(null!=r){var e=r.get(n);null!=e&&e.remove(i)}},t.prototype.get=function(t,n){var i=this.He.get(t);if(null==i)return null;var r=i.get(n);return null==r?null:r},t.prototype.update=function(){this.He.forEach(Kv)},t.prototype.destroy=function(){var t=this.He;t.forEach(Jv),t.clear()},t}(),qv=function(t){if("object"==typeof t&&"[object Object]"===Object.prototype.toString.call(t)){var n=Object.getPrototypeOf(t);return null==n||n===Object.prototype}return!1},Qv=function(){function t(t,n,i){var r=this;this.instance=null,this.newInstance=t,this.options=n,null!=i&&(i.state.isActive&&setTimeout((function(){r.get()}),0),i.on("active",(function(){r.get()})))}return t.prototype.get=function(){var t=this.instance;return null==t&&(t=new this.newInstance(this.options),this.instance=t),t},t}(),$v=function(t,n,i,r){for(var e=0,u=Math.floor(t.length/i)-1;e<=u;){var s=e+(u-e>>1),h=t[s*i+r];if(n<h)u=s-1;else{if(!(h<n))return s;e=s+1}}return Math.max(e,u)},tb=function(t){return Rt(t)?function(t){for(var n=[],i=0,r=t.length;i<r;++i)n[i]=t[i];return n}(t):qv(t)?function(t){var n={};for(var i in t)Object.hasOwnProperty.call(t,i)&&(n[i]=tb(t[i]));return n}(t):t},nb=function(t){if(null!=t){if(at(t))return t;if(mn(t))return String(t);if("name"in t)return t.name;if("label"in t)return t.label;if("id"in t)return t.id}return""},ib=function(t,n){if(null!=t){var i=tb(t);if(null!=n)for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)){var e=n[r];if(qv(e))if(Object.prototype.hasOwnProperty.call(i,r)){var u=i[r];qv(u)&&ib(u,e)}else i[r]=tb(e);else Object.prototype.hasOwnProperty.call(i,r)||(i[r]=e)}return i}return null!=n?tb(n):{}},rb=function(){function n(t,n,i){this.St=t,this.qo=n,this.Wr=i,this.Qo={},this.$o="",this.ta=0,this.na=0,this.cn=0}return Object.defineProperty(n.prototype,"width",{get:function(){return this.St},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"ratio",{get:function(){return this.qo},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"margin",{get:function(){return this.Wr},enumerable:!1,configurable:!0}),n.prototype.add=function(n,i,r,e){var u=this.Qo;if(!(n in u)){var s=this.Wr,h=this.ta,o=this.na;this.St<=h+i?(h=0,o=this.na+this.cn+s,this.cn=r,this.na=o):this.cn=Math.max(this.cn,r),this.ta=h+i+s,u[n]=new t.Rectangle(h,o,i,r);var a=this.qo;return this.$o+='<g transform="translate('.concat(h*a,",").concat(o*a,')">').concat(e,"</g>"),!0}return!1},n.prototype.has=function(t){return t in this.Qo},Object.defineProperty(n.prototype,"mappings",{get:function(){return this.build()},enumerable:!1,configurable:!0}),n.prototype.build=function(n){var i,r,e,u=this.ia;if(null==u||(null==n?void 0:n.force)){var s=null!==(r=null!==(i=null==n?void 0:n.resolution)&&void 0!==i?i:window.devicePixelRatio)&&void 0!==r?r:1,h=this.St,o=Math.pow(2,Math.ceil(Math.log(this.na+this.cn)/Math.LN2)),a=h*s,c=o*s,f=this.qo,l='width="'.concat(a,'"'),v='height="'.concat(c,'"'),b='viewBox="0 0 '.concat(h*f," ").concat(o*f,'"'),d=Nv("<svg ".concat(l," ").concat(v," ").concat(b," ").concat('xmlns="http://www.w3.org/2000/svg"',">").concat(this.$o,"</svg>")),g=null!==(e=null==n?void 0:n.scaling)&&void 0!==e?e:t.SCALE_MODES.NEAREST,m=t.BaseTexture.from(d,{resolution:s,scaleMode:g}),w=this.Qo;for(var O in u=this.ia={},w)u[O]=new t.Texture(m,w[O])}return u},n}(),eb=function(){function n(){}return n.toTexture=function(n,i,r,e){var u=n.transform.scale,s=t.RenderTexture.create({width:n.width*u.x,height:n.height*u.y,scaleMode:t.SCALE_MODES.LINEAR,resolution:i}),h=new t.Matrix(void 0,void 0,void 0,void 0,-n.position.x,-n.position.y),o=rt.getLayer(n);return o&&o.renderer.render(n,s,r,h,e),s},n.toPixels=function(t,n){var i=t.resolution,r=t.frame,e=Math.floor(r.width*i),u=Math.floor(r.height*i),s=new Uint8Array(4*e*u);n.renderTexture.bind(t);var h=n.gl;return h.readPixels(r.x*i,r.y*i,e,u,h.RGBA,h.UNSIGNED_BYTE,s),{width:e,height:u,array:s}},n.toCanvas=function(n,i,r){var e=n.width,u=n.height,s=n.array,h=new t.utils.CanvasRenderTarget(e,u,1),o=h.context.getImageData(0,0,e,u);if(r?o.data.set(s):t.Extract.arrayPostDivide(s,o.data),h.context.putImageData(o,0,0),null!=i&&1!==i){h.context.scale(i,i),h.context.drawImage(h.canvas,0,0);var a=Math.floor(e*i),c=Math.floor(u*i),f=h.context.getImageData(0,0,a,c);h.resize(a,c),h.context.putImageData(f,0,0)}return h},n.toBase64=function(t,n,i){return t.toDataURL(n,i)},n}(),ub=function(){function t(){}return t.downloadUrl=function(t,n){var i=document.createElement("a");"download"in i?(i.href=n,i.setAttribute("download",t),i.style.display="none",document.body.appendChild(i),i.click(),setTimeout((function(){document.body.removeChild(i)}),66)):window.open(n)||(location.href=n)},t.download=function(t,n,i){var r=new Blob(!1!==i?["\ufeff",n]:[n],{type:"text/plain"}),e=window.navigator;"msSaveBlob"in e?e.msSaveBlob(r,t):this.downloadUrl(t,URL.createObjectURL(r))},t}(),sb=function(){function t(){}return t.texture=function(t){var n,i=t.target,r=function(t){var n,i=t.target,r=t.resolution;if(null!=r){if(mn(r))return r;var e=i.transform.scale,u=Math.max(i.width*e.x,i.height*e.y);return Math.min(1,r.size/u)}return null!==(n=window.devicePixelRatio)&&void 0!==n?n:1}(t),e=null===(n=t.transform)||void 0===n?void 0:n.update;return eb.toTexture(i,r,t.clear,e)},t.pixels=function(t){var n=function(t){var n=t.renderer;if(n)return n;var i=t.application;if(i)return i.getLayerBase().renderer;var r=t.layer||rt.getLayer(t.target);if(r)return r.renderer;throw new Error("No renderer / application / layer found.")}(t),i=this.texture(t);try{return eb.toPixels(i,n)}finally{i&&i.destroy()}},t.canvas=function(t){var n,i,r=this.pixels(t),e=null===(i=null===(n=t.alpha)||void 0===n?void 0:n.premultiplied)||void 0===i?void 0:i.ignore,u=function(t,n){var i=n.scale;if(null!=i){if(mn(i))return i;var r=i.size;return Math.min(1,r/t.width,r/t.height)}}(r,t);return eb.toCanvas(r,u,e)},t.base64=function(t){var n=this.canvas(t);try{return eb.toBase64(n.canvas,t.format,t.quality)}finally{n&&n.destroy()}},t.file=function(t){ub.downloadUrl(t.filename,this.base64(t))},t}(),hb={TEXT:0,DATA_URL:1,BINARY_STRING:2,ARRAY_BUTTER:3,FILE:4},ob=function(){function t(t,n){this.lh=null,this.ra=t,this.ea=n}return t.prototype.open=function(){var t=this.getOrCreateInput();null!=t?t.click():this.onCancel()},t.prototype.getOrCreateInput=function(){var t=this;if("FileReader"in window&&null==this.lh){var n=document.createElement("input");this.lh=n,n.setAttribute("type","file"),n.setAttribute("style","display:none"),n.addEventListener("change",(function(i){t.onInputChange(n),n.value="",i.stopImmediatePropagation(),i.preventDefault()})),document.body.appendChild(n)}return this.lh},t.prototype.onInputChange=function(t){var n=this,i=t.files;if(null!=i&&0<i.length){var r=i[0];if(this.ra===hb.FILE)this.onOpen(r,r);else{var e=new FileReader;switch(e.onload=function(t){if(null!=t.target){var i=t.target;n.onOpen(i.result,r)}},e.onabort=function(t){n.onAboart(t)},this.ra){case hb.TEXT:e.readAsText(r);break;case hb.DATA_URL:e.readAsDataURL(r);break;case hb.BINARY_STRING:e.readAsBinaryString(r);break;case hb.ARRAY_BUTTER:e.readAsArrayBuffer(r);break;default:e.readAsText(r)}}}else this.onCancel()},t.prototype.onOpen=function(t,n){var i=this.ea;i.emit("open",t,n,i)},t.prototype.onAboart=function(t){var n=this.ea;n.emit("abort",t,n)},t.prototype.onCancel=function(){var t=this.ea;t.emit("cancel",t)},t}(),ab=function(){function t(){}return t.fromRgb=function(t){var n=(16711680&t)>>16,i=(65280&t)>>8,r=255&t|0,e=Math.max(n,i,r),u=e-Math.min(n,i,r),s=0;return 0<u&&(n===e?s=60*(i-r)/u:i===e?s=60*(r-n)/u+120:r===e&&(s=60*(n-i)/u+240),s<0&&(s+=360)),[s,u/e*255,e]},t.toRgb=function(t,n,i){var r=i-n/255*i,e=i-r,u=0,s=0,h=0;return t<=60?(u=i,s=t/60*e+r,h=r):t<=120?(u=(120-t)/60*e+r,s=i,h=r):t<=180?(u=r,s=i,h=(t-120)/60*e+r):t<=240?(u=r,s=(240-t)/60*e+r,h=i):t<=300?(u=(t-240)/60*e+r,s=r,h=i):(u=i,s=r,h=(360-t)/60*e+r),(u=Math.max(0,Math.min(255,u)))<<16|(s=Math.max(0,Math.min(255,s)))<<8|Math.max(0,Math.min(255,h))},t}(),cb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.onElementAttached=function(n,i,r){n.addEventListener("keydown",this.Vu),t.prototype.onElementAttached.call(this,n,i,r)},n.prototype.onElementDetached=function(n,i,r){n.removeEventListener("keydown",this.Vu),t.prototype.onElementDetached.call(this,n,i,r)},n.prototype.onInputKeyDown=function(t){Xi.isOkKey(t)&&this.Tu.onEnter()},n}(eu),fb=function(){function t(){}return t.create=function(t){var n=this.Gt;return t in n?"".concat(t," ").concat(++n[t]):(n[t]=1,"".concat(t," 1"))},t.Gt={},t}(),lb=function(){function t(){}return t.toCode=function(t,n){var i=t>>8&255,r=255&t;return"rgba(".concat(t>>16&255,",").concat(i,",").concat(r,",").concat(n,")")},t}(),vb=function(){function t(t,n,i){var r=this;this.ua=new Set,this.Mt=t,this.sa=n,this.ha=i,this.oa=null,this.aa=function(){r.update()}}return t.prototype.start=function(){return null==this.oa&&(this.oa=window.setTimeout(this.aa,this.sa)),this},t.prototype.stop=function(){var t=this.oa;return null!=t&&(this.oa=null,clearTimeout(t)),this},t.prototype.add=function(t){return this.ua.add(t),t.state.set(this.Mt,this.isOn(Date.now())),this},t.prototype.remove=function(t){return!!this.ua.delete(t)&&(t.state.remove(this.Mt),!0)},t.prototype.contains=function(t){return this.ua.has(t)},t.prototype.clear=function(){return this.ua.clear(),this},t.prototype.isOn=function(t){return Math.floor(t/this.ha)%2==0},t.prototype.update=function(){var t=Date.now(),n=this.isOn(t),i=this.Mt;this.ua.forEach((function(t){t.state.set(i,n)}));var r=this.ha;return this.oa=window.setTimeout(this.aa,r-t%r),this},t}(),bb=function(){function t(t){var n;this.qn=null!==(n=null==t?void 0:t.duration)&&void 0!==n?n:300,this.tu=null,this.ca=0,this.fa=null}return t.prototype.show=function(t,n){var i=this,r=this.fa;null!=r&&clearTimeout(r);var e=this.tu;if(t!==e){var u=this.qn,s=this.ca,h=Date.now(),o=s+u-h;!0===n||o<=0?this.update(h,t):this.fa=window.setTimeout((function(){i.update(Date.now(),t)}),o)}},t.prototype.update=function(t,n){var i=this.tu;i!==n&&(this.ca=t,null!=i&&i.hide(),this.tu=n,null!=n&&n.show())},t.prototype.hide=function(){this.show(null)},t}(),db=function(){function t(){this.la=null,this.va=0,this.xs=null,this.ba=null}return t.prototype.getNames=function(){var t=this.da;return null==t&&(t="onwheel"in document||9<=document.documentMode?["wheel"]:["mousewheel","DOMMouseScroll","MozMousePixelScroll"],this.da=t),t},t.prototype.on=function(t,n,i){void 0===i&&(i=!1);for(var r=this.getNames(),e=r.length-1;0<=e;--e){var u=r[e];t.addEventListener(u,n,i)}},t.prototype.off=function(t,n,i){void 0===i&&(i=!1);for(var r=this.getNames(),e=r.length-1;0<=e;--e){var u=r[e];t.removeEventListener(u,n,i)}},t.prototype.getLineHeight=function(){if(null==this.xs){var t=K.getInstance().get("DBase");this.xs=t.getLineHeight()}return this.xs},t.prototype.getPageHeight=function(){return null==this.ba&&(this.ba=12*this.getLineHeight()),this.ba},t.prototype.normalize=function(t){var n=0,i=0;if("detail"in t&&(i=-1*t.detail),"wheelDelta"in t&&(i=t.wheelDelta),"wheelDeltaY"in t&&(i=t.wheelDeltaY),"wheelDeltaX"in t&&(n=-1*t.wheelDeltaX),"axis"in t&&t.axis===t.HORIZONTAL_AXIS&&(n=-1*i,i=0),"deltaY"in t&&(i=-1*t.deltaY),"deltaX"in t&&(n=t.deltaX),0===i&&0===n)return null;var r=Math.max(Math.abs(i),Math.abs(n)),e=Date.now();this.va+200<=e&&(this.la=null),this.va=e;var u="mousewheel"===t.type&&r%120==0;(!this.la||r<this.la)&&(this.la=r,u&&(this.la/=40)),u&&(r/=40,n/=40,i/=40);var s=this.la;r=Math.floor(r/s),n=Math[1<=n?"floor":"ceil"](n/s),i=Math[1<=i?"floor":"ceil"](i/s);var h=t.deltaMode||0;if(0!==h){var o=1===h?this.getLineHeight():this.getPageHeight();r*=o,n*=o,i*=o}return{mode:h,delta:r,deltaX:n,deltaY:i,lowest:s}},t.getInstance=function(){return null==this.INSTANCE&&(this.INSTANCE=new t),this.INSTANCE},t}(),gb=function(t){function n(n){var i,r=this;return(r=t.call(this)||this).Jn=null!==(i=null==n?void 0:n.target)&&void 0!==i?i:null,r.$n=!1,r.Au=!1,r.ti=null==n?void 0:n.onTime,r.ii=null==n?void 0:n.onStart,r.ri=null==n?void 0:n.onEnd,r}return B(n,t),Object.defineProperty(n.prototype,"target",{get:function(){return this.Jn},set:function(t){this.Jn=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"duration",{get:function(){return 0},set:function(t){},enumerable:!1,configurable:!0}),n.prototype.start=function(t){void 0===t&&(t=!1),this.stop(),this.Au=!0,this.$n=t,this.onStart(t),this.Au&&(this.onTime(t?1:0,t,0),this.Au&&(this.onTime(t?0:1,t,0),this.Au||this.onEnd(t)))},n.prototype.onStart=function(t){var n=this.ii;null!=n&&n(t,this),this.emit("start",t,this)},n.prototype.onTime=function(t,n,i){var r=this.ti;null!=r&&r(t,n,i,this),this.emit("time",t,n,i,this)},n.prototype.onEnd=function(t){var n=this.ri;null!=n&&n(t,this),this.emit("end",t,this)},n.prototype.isStarted=function(){return this.Au},n.prototype.isReverse=function(){return this.$n},n.prototype.stop=function(){this.Au=!1},n.prototype.end=function(){if(this.Au){this.Au=!1;var t=this.$n,n=t?0:1;this.onTime(n,t,0),this.onEnd(t)}},n}(t.utils.EventEmitter),mb=function(t){function n(n){var i,r,e=this;(e=t.call(this,n)||this).ga=0,e.ma=0,e.wa=0,e.Oa=0,e.pa=null,e.es=null;var u=null==n?void 0:n.shift;return e.Da=null!==(i=null==u?void 0:u.x)&&void 0!==i?i:0,e.Ea=null!==(r=null==u?void 0:u.y)&&void 0!==r?r:15,e.ss=function(){e.onPrerender()},e.Ma=function(){e.onPostrender()},e}return B(n,t),n.prototype.stop=function(){this.Oa=0,this.removeEventListeners(),t.prototype.stop.call(this)},n.prototype.addEventListeners=function(t){var n=rt.getLayer(t);if(n){this.es=n;var i=n.renderer;i.on("prerender",this.ss),i.on("postrender",this.Ma)}},n.prototype.removeEventListeners=function(){var t=this.es;if(t){this.es=null;var n=t.renderer;n.off("prerender",this.ss),n.off("postrender",this.Ma)}},n.prototype.onStart=function(n){var i=this.pa=this.Jn;null!=i&&(this.Oa=0,this.removeEventListeners(),this.addEventListeners(i),n||(i.visible=!0),t.prototype.onStart.call(this,n))},n.prototype.onTime=function(n,i,r){if(null!=this.pa){var e=this.es;e?(this.Oa=n,t.prototype.onTime.call(this,n,i,r),e.update()):(this.Oa=n,t.prototype.onTime.call(this,n,i,r))}},n.prototype.onEnd=function(n){var i=this.pa;null!=i&&(this.removeEventListeners(),n&&(i.visible=!1),t.prototype.onEnd.call(this,n))},n.prototype.onPrerender=function(){var t=this.pa;if(null!=t){var n=this.Oa,i=t.unsafe.position;this.ga=i.x,this.ma=i.y,i.set(i.x-this.Da*(1-n),i.y-this.Ea*(1-n)),this.wa=t.alpha,t.alpha=n}},n.prototype.onPostrender=function(){var t=this.pa;null!=t&&(t.unsafe.position.set(this.ga,this.ma),t.alpha=this.wa)},n}(ur),wb=function(){function t(t){var n,i,r,e;mn(t)?(this.top=t,this.right=t,this.bottom=t,this.left=t):null!=t?(this.top=null!==(n=t.top)&&void 0!==n?n:6,this.right=null!==(i=t.right)&&void 0!==i?i:6,this.bottom=null!==(r=t.bottom)&&void 0!==r?r:6,this.left=null!==(e=t.left)&&void 0!==e?e:6):(this.top=6,this.right=6,this.bottom=6,this.left=6)}return t.prototype.getTheme=function(){throw new Error("Not supported")},t.prototype.setTheme=function(t){throw new Error("Not supported")},t.prototype.getTop=function(){return this.left},t.prototype.getRight=function(){return this.right},t.prototype.getBottom=function(){return this.bottom},t.prototype.getLeft=function(){return this.left},t.prototype.set=function(t,n,i,r){null==n?(this.top=t,this.right=t,this.bottom=t,this.left=t):null==i?(this.top=t,this.right=n,this.bottom=t,this.left=n):null==r?(this.top=t,this.right=n,this.bottom=i,this.left=n):(this.top=t,this.right=n,this.bottom=i,this.left=r)},t}(),Ob=function(){function t(t){var n,i=t.root;this.Sa=i,this.cs=t.overlay,this.zn=new wb(null==t?void 0:t.padding);var r=100,e=100;if(t)if(null!=t.width)r=t.width,e=null!=t.height?t.height:i.getBoundingClientRect().height;else if(null!=t.height)r=i.getBoundingClientRect().width,e=t.height;else{var u;r=(u=i.getBoundingClientRect()).width,e=u.height}else r=(u=i.getBoundingClientRect()).width,e=u.height;var s=null==t?void 0:t.background,h=0,o=!0;if(null!=s){var a=s.color;null!=a&&(h=a,o=!1)}var c=t.resolution,f=null!==(n=null==t?void 0:t.antialias)&&void 0!==n&&n;this.Ta={width:r,height:e,autoStart:!1,backgroundColor:h,transparent:o,resolution:c,antialias:f}}return t.prototype.getRootElement=function(){return this.Sa},t.prototype.setRootElement=function(t,n){if(this.Sa!==t&&(this.Sa=t,!1!==n)){var i=t.getBoundingClientRect(),r=this.Ta;r.width=i.width,r.height=i.height}return this},t.prototype.getWidth=function(){return this.Ta.width},t.prototype.setWidth=function(t){return this.Ta.width=t,this},t.prototype.getHeight=function(){return this.Ta.height},t.prototype.setHeight=function(t){return this.Ta.height=t,this},t.prototype.getPadding=function(){return this.zn},t.prototype.setPadding=function(t,n,i,r){var e=this.zn;return e.left=t,e.top=n,e.right=i,e.bottom=r,this},t.prototype.getBackgroundColor=function(){return this.Ta.backgroundColor},t.prototype.setBackgroundColor=function(t){return this.Ta.backgroundColor=t,this},t.prototype.getAntialias=function(){return this.Ta.antialias},t.prototype.setAntialias=function(t){return this.Ta.antialias=t,this},t.prototype.isOverlay=function(){return this.cs},t.prototype.getPixiApplicationOptions=function(){return this.Ta},t}(),pb=function(){function t(){}return t.prototype.isStorable=function(){return!0},t.prototype.isClear=function(){return!1},t.prototype.isClean=function(){return!1},t.prototype.execute=function(){return!0},t.prototype.merge=function(t){return!1},t.prototype.isMerged=function(){return!1},t.prototype.redo=function(){return!0},t.prototype.undo=function(){return!0},t.prototype.destroy=function(){},t}(),Db=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.isStorable=function(){return!1},n.prototype.isClear=function(){return!0},n}(pb),Eb=function(t){function n(){var n=t.call(this)||this;return n._=0,n.ja=[],n}return B(n,t),n.prototype.last=function(){var t=this.ja,n=t.length;return 0<n?t[n-1]:null},n.prototype.push=function(t){this.merge(t),this.execute(t)},n.prototype.merge=function(t){var n=this.ja,i=t.isClear(),r=t.isStorable();if(i||r){var e=i?n.length:this._;0<e&&(this.remove(e),this._=0,this.emit("change",this)),this.cleanup()}var u=n.length;0<u&&t.merge(n[u-1])},n.prototype.execute=function(t){return this.emit("executing",t,this),t.execute()?this.onSuccess(t):this.onFail(t)},n.prototype.onSuccess=function(t){t.isStorable()&&(t.isMerged()||this.ja.push(t),t.isClean()||this.emit("dirty",this)),this.emit("change",this),this.emit("executed",t,this)},n.prototype.onFail=function(t){t.destroy(),this.emit("change",this)},n.prototype.cleanup=function(){var t=this.ja,n=t.length-100;if(0<n)for(var i=0;i<n;++i)t[i].destroy(),t.shift()},n.prototype.remove=function(t){var n=this.ja;if(0<t){var i=Math.max(0,n.length-t);if(0<(t=n.length-i)){for(var r=i,e=n.length;r<e;++r)n[r].destroy();return n.splice(i,n.length-i),!0}}return!1},n.prototype.size=function(){return this.ja.length},n.prototype.clear=function(){this.push(new Db)},n.prototype.redo=function(){this.isRedoable()&&this.doRedo()},n.prototype.doRedo=function(){var t=this.ja;if(0<this._){var n=t[t.length-this._];this._-=1,this.emit("change",this),this.emit("redoing",n,this),!0===n.redo()?this.onRedoSuccess(n):this.onRedoFail(n)}},n.prototype.onRedoSuccess=function(t){t.isClean()||this.emit("dirty",this),this.emit("change",this),this.emit("redoed",t,this)},n.prototype.onRedoFail=function(t){this.emit("change",this)},n.prototype.isRedoable=function(){return 0<this._},n.prototype.undo=function(){this.isUndoable()&&this.doUndo()},n.prototype.doUndo=function(){var t=this.ja;if(this._<t.length){var n=t[t.length-1-this._];this._+=1,this.emit("change",this),this.emit("undoing",n,this),!0===n.undo()?this.onUndoSuccess(n):this.onUndoFail(n)}},n.prototype.onUndoSuccess=function(t){t.isClean()||this.emit("dirty",this),this.emit("change",this),this.emit("undoed",t,this)},n.prototype.onUndoFail=function(t){this.emit("change",this)},n.prototype.isUndoable=function(){return this._<this.ja.length},n}(t.utils.EventEmitter),Mb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.init=function(t,n,i){var r=this;t.addEventListener("keydown",(function(t){r.emit("keydown",t);var e=i.get();if(null!=e)for(var u=e;null!=u;){if(r.hasOnKeyDown(u)&&u.onKeyDown(t))return;u=u.parent}if(Xi.isFocusKey(t)){var s=Xi.getFocusDirection(t),h=null!=e?i.find(e,!1,e.state.isFocusRoot||s,s):i.find(n,!1,!0,s);null!=h&&(i.focus(h),t.preventDefault(),t.stopImmediatePropagation())}})),t.addEventListener("keyup",(function(t){r.emit("keyup",t);var n=i.get();if(null!=n)for(var e=n;null!=e;){if(r.hasOnKeyUp(e)&&e.onKeyUp(t))return;e=e.parent}}))},n.prototype.hasOnKeyDown=function(t){return"onKeyDown"in t},n.prototype.hasOnKeyUp=function(t){return"onKeyUp"in t},n}(t.utils.EventEmitter),Sb=function(){function t(){}return t.getKeyboardController=function(){return null==this.KEYBOARD&&(this.KEYBOARD=new Mb),this.KEYBOARD},t.setKeyboardController=function(t){var n=this.KEYBOARD;return this.KEYBOARD=t,n},t.getCommandController=function(){return null==this.COMMAND&&(this.COMMAND=new Eb),this.COMMAND},t.setCommandController=function(t){var n=this.COMMAND;return this.COMMAND=t,n},t.getDocumentController=function(){if(null==this.DOCUMENT)throw new Error("Not supported");return this.DOCUMENT},t.setDocumentController=function(t){var n=this.DOCUMENT;return this.DOCUMENT=t,n},t}(),Tb=function(n){function i(t,i){var r=n.call(this,i.getPixiApplicationOptions())||this;return r.Na=null,r.Ia=null,r.kn=i,r.q=!1,r.Co=!0,r.Ca=i.isOverlay(),r.zn=i.getPadding(),r.Aa=i.getRootElement(),r.Ra=5,r.La=r.newElementContainer(),r.application=t,r.ya=function(){null!=r.Na&&r.render()},r.initStage(),r.initView(),r.initRootElement(),r.initFocusHandling(),r.initResizeHandling(),r.initWheelHandling(),r.initDoubleClickHandling(),r}return B(i,n),i.prototype.newElementContainer=function(){var t=document.createElement("div");return t.setAttribute("style","position: absolute; top: 0; left: 0; width: 0; height: 0;margin: 0; padding: 0; outline: none;"),t},i.prototype.initStage=function(){var t=this.stage;t.layer=this,t.application=this.application,t.interactive=!0},i.prototype.initView=function(){var t=this.view.style;t.position="absolute",t.top="0",t.left="0",t.width="100%",t.height="100%",t.display="block",t.outline="none",t.webkitTapHighlightColor="rgba(255,255,255,0)",t.webkitUserSelect="none",t.setProperty("-khtml-user-select","none"),t.setProperty("-moz-user-select","none"),t.setProperty("-ms-user-select","none"),t.userSelect="none"},i.prototype.initRootElement=function(){var t=this,n=this.view,i=this.Ca,r=this.Aa,e=this.La,u=i?2:0,s=r.children;if(u<s.length){var h=s[u];r.insertBefore(n,h),r.insertBefore(e,h)}else r.appendChild(n),r.appendChild(e);if(i){var o=this.stage,a=o.onChildrenChange;o.onChildrenChange=function(){t.onStageDirty(),a.call(o)}}var c=r.style;r!==document.body&&"static"===window.getComputedStyle(r).position&&(c.position="relative"),c.margin="0",c.padding="0",c.overflow="hidden"},i.prototype.initFocusHandling=function(){var t=this.view,n=this.stage,i=this.getFocusController();t.setAttribute("tabindex","0"),Sb.getKeyboardController().init(t,n,i),this.renderer.plugins.interaction.on(Ki.down,(function(t){null!=t.target&&t.target!==n||i.clear()}))},i.prototype.initResizeHandling=function(){var t=this,n=function(){t.onResize()};window.addEventListener("resize",n),window.addEventListener("orientationchange",n)},i.prototype.onResize=function(){var t=this.Aa.getBoundingClientRect(),n=t.width,i=t.height;this.renderer.resize(n,i);for(var r=this.zn,e=this.stage.children,u=0,s=e.length;u<s;++u){var h=e[u];h instanceof Qi&&h.onParentResize(n,i,r)}this.update()},i.prototype.initWheelHandling=function(){var n=new t.Point,i=db.getInstance(),r=this.renderer.plugins.interaction;i.on(this.view,(function(t){var e=t;Ki.toGlobal(e,r,n);var u,s=r.hitTest(n),h=i.normalize(t);if(null!=h)for(;null!=s;){if(null!=(u=s)&&null!=u.onWheel&&s.onWheel(e,h,n)){e.preventDefault();break}s=s.parent}}))},i.prototype.initDoubleClickHandling=function(){var t=this.getFocusController(),n=this.renderer.plugins.interaction;Ki.onDblClick(this.view,(function(i){var r,e=t.get();if(null!=e)for(var u=e;null!=u&&(null==(r=u)||null==r.onDblClick||!u.onDblClick(i,n));)u=u.parent}))},i.prototype.lock=function(){this.q=!0},i.prototype.unlock=function(){this.q=!1},i.prototype.update=function(){this.q||null!=this.Na||(this.Na=requestAnimationFrame(this.ya))},i.prototype.onStageDirty=function(){this.Ca&&(0<this.stage.children.length?this.Co||(this.Co=!0,this.view.style.display="block"):this.Co&&(this.Co=!1,this.view.style.display="none"))},i.prototype.render=function(){this.reflow(),this.Na=null,n.prototype.render.call(this)},Object.defineProperty(i.prototype,"width",{get:function(){return this.screen.width},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"height",{get:function(){return this.screen.height},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"padding",{get:function(){return this.zn},enumerable:!1,configurable:!0}),i.prototype.reflow=function(){for(var t=this.stage.children,n=0,i=this.Ra;n<i;++n){for(var r=!1,e=0,u=t.length;e<u;++e){var s=t[e];s instanceof Qi&&(s.reflow(),r=r||s.isDirty()||s.hasDirty()||s.isHierarchyDirty())}if(!r)break}},i.prototype.getFocusController=function(){return this.application.getFocusController()},i.prototype.getRootElement=function(){return this.Aa},i.prototype.getElementContainer=function(){return this.La},i.prototype.getDynamicFontAtlases=function(){return null==this.Ia&&(this.Ia=new Zv(this)),this.Ia},i}(t.Application),jb=function(){function t(){this.fs=null}return t.prototype.focus=function(t){var n=this.fs;return n!==t?(null!=n&&(n.state.isFocused=!1),this.fs=t,this.isFocusable(t)&&(t.state.isFocused=!0),n):null},t.prototype.blur=function(t){return null!=t&&this.fs===t?(this.fs=null,t.state.isFocused=!1,t):null},t.prototype.clear=function(){return this.focus(null)},t.prototype.set=function(t,n){return n?this.focus(t):this.blur(t)},t.prototype.get=function(){return this.fs},t.prototype.findParent=function(t){for(var n=t;null!=n;){if(this.isFocusable(n))return n;n=n.parent}return null},t.prototype.find=function(t,n,i,r,e){if(r){if(null!=(o=this.findNext(t,n,i)))return o;if(this.isFocusRoot(t,e))return null;var u=t.parent;if(null!=u&&0<=(c=(a=u.children).indexOf(t))){var s=a.length;if(this.isFocusReverse(u)){for(var h=c-1;0<=h;--h)if(null!=(l=this.findNext(a[h],!0,!0)))return l;if(!this.isFocusRoot(u,e)&&null!=(l=this.find(u,!1,!1,!0,e)))return l;for(h=s-1;c<=h;--h)if(null!=(l=this.findNext(a[h],!0,!0)))return l}else{for(h=c+1;h<s;++h)if(null!=(l=this.findNext(a[h],!0,!0)))return l;if(!this.isFocusRoot(u,e)&&null!=(l=this.find(u,!1,!1,!0,e)))return l;for(h=0;h<=c;++h)if(null!=(l=this.findNext(a[h],!0,!0)))return l}}}else{var o;if(null!=(o=this.findPrevious(t,n,i)))return o;var a,c,f=t.parent;if(null!=f&&0<=(c=(a=f.children).indexOf(t)))if(s=a.length,this.isFocusReverse(f)){for(h=c+1;h<s;++h)if(null!=(l=this.findPrevious(a[h],!0,!0)))return l;if(!this.isFocusRoot(f,e)&&null!=(l=this.find(f,!0,!1,!1,e)))return l;for(h=0;h<=c;++h)if(null!=(l=this.findPrevious(a[h],!0,!0)))return l}else{for(h=c-1;0<=h;--h)if(null!=(l=this.findPrevious(a[h],!0,!0)))return l;if(!this.isFocusRoot(f,e)&&null!=(l=this.find(f,!0,!1,!1,e)))return l;for(h=s-1;c<=h;--h){var l;if(null!=(l=this.findPrevious(a[h],!0,!0)))return l}}}return null},t.prototype.findNext=function(t,n,i){if(n&&this.isFocusable(t))return t;if(i&&this.isFocusableContainer(t)&&t.visible){var r=t.children,e=r.length;if(this.isFocusReverse(t)){for(var u=e-1;0<=u;--u)if(null!=(s=this.findNext(r[u],!0,!0)))return s}else for(u=0;u<e;++u){var s;if(null!=(s=this.findNext(r[u],!0,!0)))return s}}return null},t.prototype.findPrevious=function(t,n,i){if(i&&this.isFocusableContainer(t)&&t.visible){var r=t.children,e=r.length;if(this.isFocusReverse(t)){for(var u=0;u<e;++u)if(null!=(s=this.findPrevious(r[u],!0,!0)))return s}else for(u=e-1;0<=u;--u){var s;if(null!=(s=this.findPrevious(r[u],!0,!0)))return s}}return n&&this.isFocusable(t)?t:null},t.prototype.isFocusable=function(t){return null!=t&&"state"in t&&t.state.inEnabled&&t.state.isFocusable&&t.visible},t.prototype.isFocusableContainer=function(t){return null!=t&&"children"in t},t.prototype.isFocusRoot=function(t,n){return t===n||null!=t&&"state"in t&&t.state.isFocusRoot&&t.visible},t.prototype.isFocusReverse=function(t){return null!=t&&"state"in t&&t.state.isFocusReverse},t}(),Nb=function(){function n(n){var i,r;rt.add(this);var e=this.toRootElement(n);this.Sa=e,this.initFocusHandling(e);var u=null!==(r=null!==(i=null==n?void 0:n.resolution)&&void 0!==i?i:window.devicePixelRatio)&&void 0!==r?r:1;this.bn=u,delete t.Renderer.__plugins.accessibility,this.kn=n;var s=this.newLayerBase(n);this.Ir=s,this.ka=!!(null==n?void 0:n.overlay),this.ka||(this.cs=s)}return Object.defineProperty(n.prototype,"stage",{get:function(){return this.Ir.stage},enumerable:!1,configurable:!0}),n.prototype.getRootElement=function(){return this.Sa},n.prototype.getResolution=function(){return this.bn},n.prototype.toRootElement=function(t){var n=null==t?void 0:t.root;if(null!=n){if(!at(n))return n;var i=document.querySelector(n);if(i)return i}return document.body},n.prototype.toLayerBaseOptions=function(t){var n=this.Sa,i=this.bn;return new Ob(t?{root:n,padding:t.padding,width:t.width,height:t.height,background:t.background,resolution:i,antialias:t.antialias,overlay:!1}:{root:n,resolution:i,overlay:!1})},n.prototype.getFocusController=function(){return null==this.xa&&(this.xa=new jb),this.xa},n.prototype.initFocusHandling=function(t){var n=this,i=!1,r=function(){i||n.getFocusController().clear()};t.addEventListener("focus",(function(){i=!0}),!0),t.addEventListener("blur",(function(){i=!1,setTimeout(r,0)}),!0)},n.prototype.newLayerBase=function(t){return new Tb(this,this.toLayerBaseOptions(t))},n.prototype.getLayerBase=function(){return this.Ir},n.prototype.toLayerOverlayOptions=function(t){var n=this.Sa,i=this.bn;return new Ob(t?{root:n,padding:t.padding,width:t.width,height:t.height,background:{color:null},resolution:i,antialias:t.antialias,overlay:!0}:{root:n,resolution:i,overlay:!0})},n.prototype.newLayerOverlay=function(t){return new Tb(this,this.toLayerOverlayOptions(t))},n.prototype.getLayerOverlay=function(){return this.ka?(null==this.cs&&(this.cs=this.newLayerOverlay(this.kn)),this.cs):this.Ir},n.prototype.update=function(){if(!this.ka)return this.Ir.update();this.Ir.update();var t=this.cs;t&&t.update()},n.prototype.render=function(){if(!this.ka)return this.Ir.render();this.Ir.render();var t=this.cs;t&&t.render()},n}(),Ib=function(){function t(t){this.Jn=t,this.un=0,this.sn=0,this.hn=0,this.en=0,t instanceof Ni&&(this.tn=t.getCallback())}return t.prototype.getTheme=function(){return this.Jn.getTheme()},t.prototype.setTheme=function(t){this.Jn.setTheme(t)},t.prototype.getLeft=function(){return this.Jn.getLeft()+this.en},t.prototype.adjLeft=function(t){if(this.en!==t){this.en=t;var n=this.tn;n&&n()}},Object.defineProperty(t.prototype,"left",{get:function(){return this.Jn.left},set:function(t){this.Jn.left=t},enumerable:!1,configurable:!0}),t.prototype.getTop=function(){return this.Jn.getTop()+this.un},t.prototype.adjTop=function(t){if(this.un!==t){this.un=t;var n=this.tn;n&&n()}},Object.defineProperty(t.prototype,"top",{get:function(){return this.Jn.top},set:function(t){this.Jn.top=t},enumerable:!1,configurable:!0}),t.prototype.getRight=function(){return this.Jn.getRight()+this.sn},t.prototype.adjRight=function(t){if(this.sn!==t){this.sn=t;var n=this.tn;n&&n()}},Object.defineProperty(t.prototype,"right",{get:function(){return this.Jn.right},set:function(t){this.Jn.right=t},enumerable:!1,configurable:!0}),t.prototype.getBottom=function(){return this.Jn.getBottom()+this.hn},t.prototype.adjBottom=function(t){if(this.hn!==t){this.hn=t;var n=this.tn;n&&n()}},Object.defineProperty(t.prototype,"bottom",{get:function(){return this.Jn.bottom},set:function(t){this.Jn.bottom=t},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n,i,r){var e=this.Jn;null==n?e.set(t):null==i?e.set(t,n):null==r?e.set(t,n,i):e.set(t,n,i,r)},t}(),Cb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DBoard"},n}(Qi),Ab=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DButtonCheck"},n}(ds),Rb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DButtonCheckRight"},n}(Ab),Lb=function(){function t(t,n,i,r,e){this.S=t,this.T=n,this._=i,this.tn=e,this.Ba=r}return t.prototype.set=function(t,n,i,r){this.S===t&&this.T===n&&this._===i&&this.Ba===r||(this.S=t,this.T=n,this._=i,this.Ba=r,this.tn(this))},Object.defineProperty(t.prototype,"color",{get:function(){return this.S},set:function(t){this.S!==t&&(this.S=t,this.tn(this))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return this.T},set:function(t){this.T!==t&&(this.T=t,this.tn(this))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"position",{get:function(){return this._},set:function(t){this._!==t&&(this._=t,this.tn(this))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selected",{get:function(){return this.Ba},set:function(t){this.Ba!==t&&(this.Ba=t,this.tn(this))},enumerable:!1,configurable:!0}),t.prototype.toObject=function(){return{color:this.S,alpha:this.T,position:this._}},t}(),yb=function(t,n){return t.position-n.position},kb=function(n){function i(){var t=n.call(this)||this,i=function(n){t.onChange(n)};t.Pa=i;var r=new Lb(16777215,1,0,!1,i),e=new Lb(8421504,1,1,!0,i);return t.gt=[r,e],t.Yt=-90,t.Ba=e,t.Ua=[0,0,0],t}return B(i,n),i.prototype.onChange=function(t){var n=t.selected&&this.Ba!==t;if(n){var i=this.Ba;null!=i&&(i.Ba=!1),this.Ba=t}this.gt.sort(yb),n&&this.emit("selectionchange",this.Ba,this),this.emit("change",this)},Object.defineProperty(i.prototype,"points",{get:function(){return this.gt},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"direction",{get:function(){return this.Yt},set:function(t){this.Yt!==t&&(this.Yt=t,this.emit("directionchange",t,this),this.emit("change",this))},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"selected",{get:function(){return this.Ba},enumerable:!1,configurable:!0}),i.prototype.size=function(){return this.gt.length},i.prototype.get=function(t){var n=this.gt;return 0<=t&&t<n.length?n[t]:null},i.prototype.addAt=function(n){for(var i=this.gt,r=null,e=0,u=i.length;e<u;++e){var s=i[e];if(n<=s.position){if(null==r)return this.add(s.color,s.alpha,n,!0);var h=s.position-r.position;if(.001<h){var o=t.utils.hex2rgb(s.color,this.Ua),a=o[0],c=o[1],f=o[2],l=t.utils.hex2rgb(r.color,this.Ua),v=l[0],b=l[1],d=l[2],g=(n-r.position)/h,m=a*g+v*(1-g),w=c*g+b*(1-g),O=f*g+d*(1-g),p=this.Ua;p[0]=m,p[1]=w,p[2]=O;var D=t.utils.rgb2hex(p),E=s.alpha*g+r.alpha*(1-g);return this.add(D,E,n,!0)}}r=s}return null!=r?this.add(r.color,r.alpha,n,!0):this.add(16777215,1,n,!0)},i.prototype.add=function(t,n,i,r){var e=this.Pa,u=new Lb(t,n,i,r,e);return this.gt.push(u),e(u),u},i.prototype.remove=function(t){var n=this.gt;if(2<n.length)for(var i=0,r=n.length;i<r;++i)if(n[i]===t){n.splice(i,1);var e=this.Ba===t;return e&&(this.Ba=i+1<r?n[i]:n[i-1]),e&&this.emit("selectionchange",this.Ba,this),this.emit("change",this),!0}return!1},i.prototype.reset=function(){var t=this.Yt;this.Yt=-90;var n=this.gt,i=this.Ba,r=i?n.indexOf(i):-1;n.length=0;var e=this.Pa;if(n.push(new Lb(16777215,0,0,!1,e)),n.push(new Lb(16777215,0,1,!1,e)),0<=r&&r<n.length)(u=n[r]).Ba=!0,this.Ba=u;else if(0<n.length){var u;(u=n[n.length-1]).Ba=!0,this.Ba=u}else this.Ba=null;return i!==this.Ba&&this.emit("selectionchange",this.Ba,this),t!==this.Yt&&this.emit("directionchange",this.Yt,this),this.emit("change",this),this},i.prototype.toObject=function(){for(var t=[],n=this.gt,i=0,r=n.length;i<r;++i)t.push(n[i].toObject());return{points:t,direction:this.Yt}},i.prototype.fromObject=function(t){var n=this.Yt;this.Yt=t.direction;var i=this.gt,r=this.Ba,e=r?i.indexOf(r):-1;i.length=0;for(var u=this.Pa,s=0,h=t.points.length;s<h;++s){var o=t.points[s],a=new Lb(o.color,o.alpha,o.position,!1,u);i.push(a)}return i.sort(yb),0<=e&&e<i.length?((a=i[e]).Ba=!0,this.Ba=a):0<i.length?((a=i[i.length-1]).Ba=!0,this.Ba=a):this.Ba=null,r!==this.Ba&&this.emit("selectionchange",this.Ba,this),n!==this.Yt&&this.emit("directionchange",this.Yt,this),this.emit("change",this),this},i}(t.utils.EventEmitter),xb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DInputLabel"},n}(qs),Bb=function(t){function n(n){var i=t.call(this,n)||this;i.addChild(i.Rh=new xb(null==n?void 0:n.label)),i.addChild(i.lh=i.createInput(null==n?void 0:n.input));var r=null==n?void 0:n.space;return null!=r&&i.addChild(new _u(r)),i}return B(n,t),Object.defineProperty(n.prototype,"input",{get:function(){return this.lh},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"label",{get:function(){return this.Rh},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DInputAndLabel"},n}(ws),_b=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.createInput=function(t){return new Fs(t)},n}(Bb),Pb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.createInput=function(t){return new zs(t)},n}(Bb),Ub=function(){function t(t,n,i){this.Fa=t,this.Ga=n,this.Ha=i}return Object.defineProperty(t.prototype,"color",{get:function(){return this.Fa.color},set:function(t){if(this.Fa.color!==t){var n=this.Ga;null!=n&&n(t)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return this.Fa.alpha},set:function(t){if(this.Fa.alpha!==t){var n=this.Ha;null!=n&&n(t)}},enumerable:!1,configurable:!0}),t}(),Fb=function(t){function n(n,i){var r=t.call(this)||this;return r.za=n,r.yt=i,r}return B(n,t),n.prototype.get=function(t){var n=this.za;return 0<=t&&t<n.length?n[n.length-1-t]:null},n.prototype.set=function(t,n){var i=this.za;if(0<=t&&t<i.length){var r=i[i.length-1-t];return i[i.length-1-t]={color:n.color,alpha:n.alpha},this.emit("change",this),r}return null},n.prototype.contains=function(t){for(var n=this.za,i=0,r=n.length;i<r;++i){var e=n[i];if(e.color===t.color&&e.alpha===t.alpha)return!0}return!1},n.prototype.add=function(t){var n=this.za;return n.push({color:t.color,alpha:t.alpha}),this.yt<n.length&&n.shift(),this.emit("change",this),this},n.prototype.pop=function(){var t=this.za.shift();return null!=t?(this.emit("change",this),t):null},n.prototype.size=function(){return this.za.length},n}(t.utils.EventEmitter),Gb=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return B(i,n),Object.defineProperty(i.prototype,"current",{get:function(){return this.Va},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"new",{get:function(){return this.Wa},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"recent",{get:function(){return this.Xa},enumerable:!1,configurable:!0}),i.prototype.init=function(r){var e=this;n.prototype.init.call(this,r),this.Ir=16711680,this.Ka={color:16777215,alpha:1},this.Wa=new Ub(this.Ka,(function(t){e.setColorNew(t)}),(function(t){e.setAlphaNew(t)})),this.tu={color:16777215,alpha:1},this.Va=new Ub(this.tu,(function(t){e.setColorCurrent(t)}),(function(t){e.setAlphaCurrent(t)}));var u=this.theme,s=this.zn,h=s.getTop(),o=s.getRight(),a=s.getBottom(),c=s.getLeft();this.Ya=new t.Point;var f=u.getMainWidth(),l=u.getMainHeight(),v=new t.Sprite(t.Texture.WHITE);this.Ja=v,v.x=c,v.y=h,v.width=f,v.height=l,v.interactive=!0,this.addChild(v);var b=new t.Sprite(u.getMainTexture());this.Za=b,b.x=c,b.y=h,b.tint=this.Ir,b.interactive=!1,this.addChild(b),this.qa=function(t){e.onMainMove(t)},this.Qa=function(t){e.onMainUp(t)},v.on(Ki.down,(function(t){e.onMainDown(t)}));var d=new t.Sprite(u.getBaseTexture());this.$a=d,d.x=c,d.y=v.y+v.height+u.getBaseMargin(),d.interactive=!0,this.addChild(d),this.tc=function(t){e.onBaseMove(t)},this.nc=function(t){e.onBaseUp(t)},d.on(Ki.down,(function(t){e.onBaseDown(t)}));var g=new t.Sprite(u.getAlphaCheckerboardTexture());this.ic=g,g.x=s.getLeft(),g.y=d.y+u.getBaseHeight()+u.getBaseMargin(),g.interactive=!1,this.addChild(g);var m=new t.Sprite(u.getAlphaTexture());m.tint=this.Ka.color,m.interactive=!0,g.addChild(m),this.rc=function(t){e.onAlphaMove(t)},this.ec=function(t){e.onAlphaUp(t)},m.on(Ki.down,(function(t){e.onAlphaDown(t)}));var w=new t.Sprite(u.getMainPointerTexture());this.uc=w,w.x=c,w.y=h,w.anchor.x=.5,w.anchor.y=.5,w.tint=u.getMainPointerColor(),w.alpha=u.getMainPointerAlpha(),w.interactive=!1,this.addChild(w);var O=new t.Sprite(u.getAlphaPointerTexture());this.sc=O,O.x=f,O.y=.5*g.height,O.tint=u.getAlphaPointerColor(),O.alpha=u.getAlphaPointerAlpha(),O.anchor.set(.5,.5),O.interactive=!1,g.addChild(O);var p=new t.Sprite(u.getBasePointerTexture());this.hc=p,p.x=0,p.y=.5*d.height,p.tint=u.getBasePointerColor(),p.alpha=u.getBasePointerAlpha(),p.anchor.set(.5,.5),p.interactive=!1,d.addChild(p),this.oc=[];var D=this.oc,E=u.getRecentColorCount(),M=u.getRecentColorWidth(),S=u.getRecentColorHeight(),T=.5*M,j=.5*S,N=u.getRecentColorMargin(),I=g.y+u.getAlphaHeight()+u.getRecentMargin(),C=u.getRecentCheckerboardTexture();null==i.RECENT_COLORS&&(i.RECENT_COLORS=new Fb(u.getRecents().slice(0),E));var A=this.Xa=i.RECENT_COLORS;A.on("change",(function(){e.onRecentChange()}));for(var R=function(n){var i=n.currentTarget;if(i instanceof t.Container){var r=i.children[0];r instanceof t.Sprite&&(e.setColorNew(r.tint),e.setAlphaNew(r.alpha))}},L=0;L<E;++L){var y=c+L*(M+N),k=new t.Sprite(C);k.x=y+T,k.y=I+j,k.anchor.x=.5,k.anchor.y=.5,k.buttonMode=!0,k.interactive=!0,k.on(Ki.tap,R),this.addChild(k);var x=new t.Sprite(t.Texture.WHITE),B=A.get(L);null!=B?(x.tint=B.color,x.alpha=B.alpha):(x.tint=16777215,x.alpha=0),x.width=M,x.height=S,x.anchor.x=.5,x.anchor.y=.5,x.interactive=!1,k.addChild(x),D.push(x)}var _=u.getInputMargin(),P=u.getInputLabelWidth(),U=I+S+_,F=.5*(f-_),G=new Pb({parent:this,x:c,y:U,width:F,label:{width:P,text:{value:"#"},interactive:Ti.NONE},input:{weight:1,text:{value:"FFFFFF"},on:{input:function(t){var n=Qt.fromCode(t);null!=n&&e.setColorNew(n)}}}});this.ac=G;var H=G.height,z=new _b({parent:this,x:c,y:U+H+_,width:F,label:{width:P,text:{value:"A"},interactive:Ti.NONE},input:{weight:1,text:{value:1},min:0,max:1,on:{input:function(t){e.setAlphaNew(t)}}}});this.cc=z;var V=.5*(F-P-_),W=H+_+H,X=c+.5*(f-_)+_,K=U+.5*(H+_+z.height-W),Y=new t.Sprite(u.getSampleCheckerboardTexture());this.fc=Y,Y.x=X,Y.y=K,Y.width=V,Y.height=W,Y.interactive=!1,this.addChild(Y);var J=this.tu,Z=new t.Sprite(t.Texture.WHITE);this.lc=Z,Z.x=X,Z.y=K,Z.tint=J.color,Z.alpha=J.alpha,Z.width=V,Z.height=W,Z.interactive=!0,Z.buttonMode=!0,Z.on(Ki.tap,(function(){e.setColorNew(J.color),e.setAlphaNew(J.alpha)})),this.addChild(Z);var q=new t.Sprite(u.getSampleCheckerboardTexture());this.vc=q,q.x=X+V,q.y=K,q.width=V,q.height=W,q.interactive=!1,this.addChild(q);var Q=new t.Sprite(t.Texture.WHITE);this.bc=Q,Q.x=X+V,Q.y=K,Q.tint=this.Ka.color,Q.alpha=this.Ka.alpha,Q.width=V,Q.height=W,Q.interactive=!1,this.addChild(Q),null!=r&&null!=r.width||(this.width=c+f+o),null!=r&&null!=r.height||(this.height=U+G.height+_+z.height+a)},i.prototype.onMainDown=function(t){this.onMainPick(t.data.global);var n=rt.getLayer(this);if(n){var i=n.stage;i.on(Ki.move,this.qa),i.on(Ki.up,this.Qa)}},i.prototype.onMainMove=function(t){this.onMainPick(t.data.global)},i.prototype.onMainUp=function(t){var n=rt.getLayer(this);if(n){var i=n.stage;i.off(Ki.move,this.qa),i.off(Ki.up,this.Qa)}},i.prototype.toMainHex=function(t,n,i,r){return Math.max(0,Math.min(255,255*n+i*(t>>r&255)))<<r},i.prototype.toMainColor=function(t,n,i,r,e){var u=.5*r,s=Math.max(0,Math.min(1,((n-u)*(1-i/e)+u)/r)),h=Math.max(0,Math.min(1,i/e)),o=Math.abs(.5*h-s),a=1-o-h;return this.toMainHex(t,a,o,16)|this.toMainHex(t,a,o,8)|this.toMainHex(t,a,o,0)},i.prototype.onMainPick=function(t){var n=this.Ya,i=this.zn,r=i.getLeft(),e=i.getTop(),u=this.theme,s=u.getMainWidth(),h=u.getMainHeight();this.toLocal(t,void 0,n);var o=Math.max(0,Math.min(s,n.x-r)),a=Math.max(0,Math.min(h,n.y-e));this.uc.position.set(r+o,e+a),this.onColorNew(this.toMainColor(this.Ir,o,a,s,h))},i.prototype.setColorCurrent=function(t){this.lc.tint=this.tu.color=t},i.prototype.setAlphaCurrent=function(t){this.lc.alpha=this.tu.alpha=t},i.prototype.setColorNew=function(t){var n=this.theme,i=n.getMainWidth(),r=n.getMainHeight(),e=this.zn,u=ab.fromRgb(t);this.Za.tint=this.Ir=ab.toRgb(u[0],255,255),this.hc.x=Math.max(0,Math.min(1,u[0]/360))*i;var s=Math.max(0,Math.min(1,u[1]/255)),h=Math.max(0,Math.min(1,1-u[2]/255)),o=this.uc;o.tint=h<.45?n.getMainPointerColor():16777215,o.position.set(e.getLeft()+s*i,e.getTop()+h*r),this.onColorNew(t)},i.prototype.onColorNew=function(t){var n=rt.getLayer(this);n&&n.lock(),this.bc.tint=this.Ka.color=t,this.ac.input.value=Qt.toCode(t),this.emit("newcolorchange",t,this),n&&(n.unlock(),n.update())},i.prototype.onBaseDown=function(t){this.onBasePick(t.data.global);var n=rt.getLayer(this);if(n){var i=n.stage;i.on(Ki.move,this.tc),i.on(Ki.up,this.nc)}},i.prototype.onBaseMove=function(t){this.onBasePick(t.data.global)},i.prototype.onBaseUp=function(t){var n=rt.getLayer(this);if(n){var i=n.stage;i.off(Ki.move,this.tc),i.off(Ki.up,this.nc)}},i.prototype.toBaseHex=function(t,n){return Math.max(0,Math.min(255,6*t*255))<<n},i.prototype.toBaseColor=function(t){return t<=.167?16711680+this.toBaseHex(t,8):t<=.333?(t=.333-t,65280+this.toBaseHex(t,16)):t<=.5?(t-=.333,65280+this.toBaseHex(t,0)):t<.667?(t=.667-t,255+this.toBaseHex(t,8)):t<.883?(t-=.667,255+this.toBaseHex(t,16)):(t=.883-t,16711680+this.toBaseHex(t,0))},i.prototype.onBasePick=function(t){var n=this.Ya,i=this.zn,r=this.theme.getMainWidth();this.toLocal(t,void 0,n);var e=Math.max(0,Math.min(r,n.x-i.getLeft()));this.hc.x=e,this.onColorBase(this.toBaseColor(e/r))},i.prototype.setColorBase=function(t){var n=this.theme.getMainWidth();this.hc.x=Math.max(0,Math.min(1,t/360))*n,this.onColorBase(ab.toRgb(t,255,255))},i.prototype.onColorBase=function(t){this.Za.tint=this.Ir=t;var n=this.uc,i=this.theme,r=i.getMainWidth(),e=i.getMainHeight(),u=this.zn;this.onColorNew(this.toMainColor(this.Ir,n.x-u.getLeft(),n.y-u.getTop(),r,e))},i.prototype.onAlphaDown=function(t){this.onAlphaPick(t.data.global);var n=rt.getLayer(this);if(n){var i=n.stage;i.on(Ki.move,this.rc),i.on(Ki.up,this.ec)}},i.prototype.onAlphaMove=function(t){this.onAlphaPick(t.data.global)},i.prototype.onAlphaUp=function(t){var n=rt.getLayer(this);if(n){var i=n.stage;i.off(Ki.move,this.rc),i.off(Ki.up,this.ec)}},i.prototype.onAlphaPick=function(t){var n=this.Ya,i=this.zn,r=this.theme.getMainWidth();this.toLocal(t,void 0,n);var e=Math.max(0,Math.min(r,n.x-i.getLeft()));this.sc.x=e,this.onAlphaNew(e/r)},i.prototype.setAlphaNew=function(t){var n=this.theme.getMainWidth();this.sc.x=Math.max(0,Math.min(1,t))*n,this.onAlphaNew(t)},i.prototype.onAlphaNew=function(t){var n=rt.getLayer(this);n&&n.lock(),this.bc.alpha=this.Ka.alpha=t,this.cc.input.value=Number(t.toFixed(2)),this.emit("newalphachange",t,this),n&&(n.unlock(),n.update())},i.prototype.onRecentChange=function(){for(var t=this.oc,n=this.Xa,i=0,r=t.length;i<r;++i){var e=t[i],u=n.get(i);null!=u?(e.tint=u.color,e.alpha=u.alpha):(e.tint=16777215,e.alpha=0)}},i.prototype.getType=function(){return"DPickerColor"},i.RECENT_COLORS=null,i}(Qi),Hb=function(t,n){if(t.direction!==n.direction)return!1;var i=t.points,r=n.points;if(i.length!==r.length)return!1;for(var e=0,u=i.length;e<u;++e){var s=i[e],h=r[e];if(s.color!==h.color||s.alpha!==h.alpha||s.position!==h.position)return!1}return!0},zb=function(t){function n(n,i){var r=t.call(this)||this;return r.za=n,r.yt=i,r}return B(n,t),n.prototype.getCapacity=function(){return this.yt},n.prototype.get=function(t){var n=this.za;return 0<=t&&t<n.length?n[n.length-1-t]:null},n.prototype.set=function(t,n){var i=this.za;if(0<=t&&t<i.length){var r=i[i.length-1-t];return i[i.length-1-t]=n,this.emit("change",this),r}return null},n.prototype.contains=function(t){for(var n=this.za,i=0,r=n.length;i<r;++i)if(Hb(n[i],t))return!0;return!1},n.prototype.add=function(t){var n=this.za;return n.push(t),this.yt<n.length&&n.shift(),this.emit("change",this),this},n.prototype.pop=function(){var t=this.za.shift();return null!=t?(this.emit("change",this),t):null},n.prototype.size=function(){return this.za.length},n}(t.utils.EventEmitter),Vb=function(n){function i(i,r,e,u,s,h,o,a){var c=n.call(this,o,a)||this;return c.interactive=!0,c.interactiveChildren=!1,c.cursor="pointer",c.dc=i,c.gn=r,c._uvs=e,c.gc=u,c.On=s,c.mc=-1,c.Ua=[0,0,0],c.wc=new t.Point,c.Oc=h,a.uniforms.uSampler.on("update",(function(){c.update(),rt.update(c)})),c.update(),c}return B(i,n),i.prototype.getRectangle=function(t){var n=this.Oc;return 0<=t&&t<n.length?n[t].rect:null},i.prototype.setRectangle=function(t,n,i,r,e){var u=this.Oc;if(0<=t&&t<u.length){var s=u[t].rect;s.x=n,s.y=i,s.width=r,s.height=e}},i.prototype.getData=function(t){var n=this.Oc;return 0<=t&&t<n.length?n[t].data:null},i.prototype.setData=function(t,n){var i=this.Oc;0<=t&&t<i.length&&(i[t].data=n)},i.prototype.getLastHitIndex=function(){return this.mc},i.prototype.setColors=function(t,n,i,r){n[t+0]=i[0],n[t+1]=i[1],n[t+2]=i[2],n[t+3]=r,n[t+4]=i[0],n[t+5]=i[1],n[t+6]=i[2],n[t+7]=r},i.prototype.setColorsHex=function(n,i,r,e){var u=t.utils.hex2rgb(r,this.Ua);this.setColors(n,i,u,e)},i.prototype.setColorsWhite=function(t,n){var i=this.Ua;i[0]=1,i[1]=1,i[2]=1,this.setColors(t,n,i,0)},i.prototype.setColorsPoint=function(t,n,i,r){var e=n.points[i];null!=e?this.setColorsHex(t,r,e.color,e.alpha):this.setColorsWhite(t,r)},i.prototype.setVertices=function(t,n,i,r){var e=r.y+r.height*i;n[t+0]=r.x,n[t+1]=e,n[t+2]=r.x+r.width,n[t+3]=e},i.prototype.setUvs=function(t,n,i,r){var e=r.x0+(r.x3-r.x0)*i,u=r.y0+(r.y3-r.y0)*i,s=r.x1+(r.x2-r.x1)*i,h=r.y1+(r.y2-r.y1)*i;n[t+0]=e,n[t+1]=u,n[t+2]=s,n[t+3]=h},i.prototype.newIndices=function(t,n,i,r){for(var e=0;e<i;++e)r[t+0]=n+0,r[t+1]=n+1,r[t+2]=n+2,r[t+3]=n+2,r[t+4]=n+1,r[t+5]=n+3,t+=6,n+=2;return r},i.prototype._calculateBounds=function(){var t=this.transform.worldTransform,n=this.Oc[0].rect,i=this._bounds,r=this.wc;r.set(n.x,n.y),t.apply(r,r),i.addPoint(r),r.set(n.x+n.width,n.y+n.height),t.apply(r,r),i.addPoint(r)},i.prototype.update=function(){var t=this.gn,n=this._uvs,i=this.gc,r=this.On,e=this.shader.uniforms.uSampler;null==e._uvs&&e.updateUvs();for(var u=e._uvs,s=0,h=0,o=0,a=0,c=this.Oc,f=0,l=c.length;f<l;++f){var v=c[f].data,b=c[f].rect;if(null==v)this.setVertices(s,t,0,b),this.setUvs(s,n,0,u),this.setColorsWhite(o,i),this.setVertices(s+4,t,1,b),this.setUvs(s,n,1,u),this.setColorsWhite(o+8,i),this.newIndices(a,h,1,r),s+=8,o+=16,h+=4,a+=6;else{this.setVertices(s,t,0,b),this.setUvs(s,n,0,u),this.setColorsPoint(o,v,0,i),s+=4,o+=8;for(var d=v.points.length,g=0,m=Math.min(d,this.dc);g<m;++g){var w=v.points[g];this.setVertices(s,t,w.position,b),this.setUvs(s,n,w.position,u),this.setColorsHex(o,i,w.color,w.alpha),s+=4,o+=8}this.setVertices(s,t,1,b),this.setUvs(s,n,1,u),this.setColorsPoint(o,v,d-1,i),s+=4,o+=8,this.newIndices(a,h,d+1,r),a+=6*(d+1),h+=2*(d+2)}}this.size=a;var O=this.geometry;O.getBuffer("aPosition").update(),O.getBuffer("aUv").update(),O.getBuffer("aColor").update(),O.getIndex().update()},i.prototype.containsPoint=function(t){for(var n=this.toLocal(t,void 0,this.wc),i=this.Oc,r=0,e=i.length;r<e;++r)if(i[r].rect.contains(n.x,n.y))return this.mc=r,!0;return!1},i.from=function(n,r,e,u){void 0===u&&(u=t.Texture.WHITE);for(var s=new Float32Array(n*(r+2)*2*2),h=new Float32Array(n*(r+2)*2*2),o=new Float32Array(n*(r+2)*2*4),a=new Uint16Array(n*(r+1)*6),c=[],f=0;f<n;++f)c.push({data:null,rect:new t.Rectangle});return new i(r,s,h,o,a,c,(new t.Geometry).addIndex(new t.Buffer(a,!1,!0)).addAttribute("aPosition",new t.Buffer(s,!1,!1),2).addAttribute("aUv",new t.Buffer(h,!1,!1),2).addAttribute("aColor",new t.Buffer(o,!1,!1),4),t.Shader.from("\nattribute vec2 aPosition;\nattribute vec2 aUv;\nattribute vec4 aColor;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\n\nvarying vec2 vUv;\nvarying vec4 vColor;\n\nvoid main(void) {\n\tvec3 position = vec3(aPosition.x, aPosition.y, 1.0);\n\tgl_Position = vec4((projectionMatrix * translationMatrix * position).xy, 0.0, 1.0);\n\tvUv = aUv;\n\tvColor = aColor;\n}\n","\nvarying vec2 vUv;\nvarying vec4 vColor;\n\nuniform sampler2D uSampler;\nuniform vec2 uCheckerColors;\n\nvoid main(void) {\n\tvec4 texture = texture2D(uSampler, vUv);\n\tfloat cy = step( 1.0, mod( gl_FragCoord.y / 10.0, 2.0 ) );\n\tfloat cx = step( 1.0, mod( gl_FragCoord.x / 10.0 + cy, 2.0 ) );\n\tfloat c = mix( uCheckerColors.x, uCheckerColors.y, cx );\n\tgl_FragColor = texture * vec4( mix( vec3( c ), vColor.xyz, vColor.a ), 1.0 );\n}",{uSampler:u,uCheckerColors:e}))},i}(t.Mesh),Wb=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return B(i,n),i.prototype.init=function(r){var e=this;n.prototype.init.call(this,r);var u=this.theme,s=this.zn,h=s.getTop(),o=s.getRight(),a=s.getBottom(),c=s.getLeft();this.bu=new t.Point;var f=u.getGradientPointsWidth(),l=u.getGradientPointsMargin(),v=new Gb({x:c+f+l,y:h});this.Lh=v,v.on("newcolorchange",(function(t){e.onAnchorColorChange(t)})),v.on("newalphachange",(function(t){e.onAnchorAlphaChange(t)})),this.addChild(v);var b=this.rr=Vb.from(17,10,u.getGradientCheckerColors());b.setRectangle(0,c,h,f,v.height),this.addChild(b),b.on(Ki.down,(function(t){0===b.getLastHitIndex()&&e.onViewDown(t)})),this.Dc=function(t){e.onAnchorDown(t)},this.Ec=function(t){e.onAnchorMove(t)},this.Mc=function(t){e.onAnchorUp(t)},this.Sc=[];var d=u.getGradientRecentColumn(),g=u.getGradientRecentWidth(),m=u.getGradientRecentMargin(),w=g+m,O=v.theme.getInputLabelWidth(),p=g*d+m*(d-1),D=u.getGradientDirectionMargin(),E=u.getGradientDirectionTexture(),M=v.x+v.width+D,S=new Fs({parent:this,x:M+O+5,y:h,width:p-2*(O+5),step:1,image:{source:E,align:{with:Ku.BORDER},margin:{horizontal:-E.width-5}},on:{change:function(t){e.Rt.Yt=t}}}),T=M,j=S.y+S.height+D;null==i.RECENT_COLOR_GRADIENT&&(i.RECENT_COLOR_GRADIENT=new zb(u.getGradientRecents(),u.getGradientRecentCount())),this.Xa=i.RECENT_COLOR_GRADIENT;for(var N=this.Xa,I=0,C=N.getCapacity();I<C;++I){var A=T+I%d*w,R=j+(I/d|0)*w;b.setRectangle(1+I,A,R,g,g)}N.on("change",(function(){e.onRecentUpdate()})),b.on(Ki.tap,(function(t){var n=b.getLastHitIndex();1<=n&&e.onRecentClick(b.getData(n))}));var L=new kb;this.Rt=L,L.on("change",(function(){e.updateAnchors(),b.update()})),L.on("selectionchange",(function(t){e.onAnchorSelect(t)})),L.on("directionchange",(function(t){S.value=t})),b.setData(0,L),b.update(),S.value=L.direction,this.updateAnchors();var y=L.selected;null!=y&&this.onAnchorSelect(y),null!=r&&null!=r.width||(this.width=c+f+l+v.width+D+(d-1)*m+d*g+o),null!=r&&null!=r.height||(this.height=h+v.height+a)},Object.defineProperty(i.prototype,"value",{get:function(){return this.Rt},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"recent",{get:function(){return this.Xa},enumerable:!1,configurable:!0}),i.prototype.onRecentClick=function(t){var n=this.Rt;null!=t?n.fromObject(t):n.reset()},i.prototype.onRecentUpdate=function(){for(var t=this.Xa,n=this.rr,i=0,r=t.size();i<r;++i)n.setData(1+i,t.get(i));n.update(),rt.update(this)},i.prototype.toAnchorPosition=function(t){var n=this.toLocal(t.data.global,void 0,this.bu);return Math.max(0,Math.min(1,(n.y-this.padding.getTop())/this.Lh.height))},i.prototype.onViewDown=function(t){this.Rt.addAt(this.toAnchorPosition(t)),this.onAnchorDragStart()},i.prototype.onAnchorDown=function(n){var i=n.target;if(i instanceof t.Sprite){var r=this.Rt,e=this.Sc.indexOf(i);0<=e&&e<r.points.length&&(r.points[e].selected=!0,this.onAnchorDragStart())}},i.prototype.onAnchorSelect=function(t){var n=this.Lh;n.current.color=t.color,n.current.alpha=t.alpha,n.new.color=t.color,n.new.alpha=t.alpha},i.prototype.onAnchorColorChange=function(t){var n=this.Rt;if(null!=n){var i=n.selected;null!=i&&(i.color=t)}},i.prototype.onAnchorAlphaChange=function(t){var n=this.Rt;if(null!=n){var i=n.selected;null!=i&&(i.alpha=t)}},i.prototype.onAnchorDragStart=function(){var t=rt.getLayer(this);if(t){var n=t.stage;n.on(Ki.move,this.Ec),n.on(Ki.up,this.Mc)}},i.prototype.onAnchorMove=function(t){var n=this.Rt;if(null!=n){var i=n.selected;null!=i&&(i.position=this.toAnchorPosition(t))}},i.prototype.onAnchorUp=function(t){var n=rt.getLayer(this);if(n){var i=n.stage;i.off(Ki.move,this.Ec),i.off(Ki.up,this.Mc)}},i.prototype.updateAnchors=function(){for(var n=this.theme,i=n.getGradientAnchorTexture(),r=n.getGradientAnchorOutlinedTexture(),e=n.getGradientPointsWidth(),u=this.Rt,s=u.points.length,h=this.Sc,o=h.length,a=o;a<s;++a){var c=new t.Sprite(i);c.anchor.set(.5,.5),c.cursor="pointer",c.interactive=!0,c.on(Ki.down,this.Dc),h.push(c),this.addChild(c)}for(a=o-1;s<=a;--a){var f=h[a];f.off(Ki.down,this.Dc),f.destroy()}h.length=s;var l=this.padding.getTop(),v=this.padding.getLeft()+e,b=this.Lh.height;for(a=0;a<s;++a){var d=u.points[a],g=h[a];g.tint=d.color,g.position.set(v,l+b*d.position),g.texture=d.selected?r:i}rt.update(this)},i.prototype.onKeyDown=function(t){if(Xi.isDeleteKey(t)){var i=this.Rt;if(null!=i){var r=i.selected;if(null!=r)return i.remove(r),n.prototype.onKeyDown.call(this,t),!0}}return n.prototype.onKeyDown.call(this,t)},i.prototype.getType=function(){return"DPickerColorGradient"},i.RECENT_COLOR_GRADIENT=null,i}(Qi),Xb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.newContentChildren=function(n,i){var r=t.prototype.newContentChildren.call(this,n,i);return r.push(this.picker),r},n.prototype.onOk=function(n){t.prototype.onOk.call(this,n);var i=this.picker,r=i.value,e=i.recent;e.contains(r)||e.add(r.toObject())},Object.defineProperty(n.prototype,"value",{get:function(){return this.picker.value},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"recent",{get:function(){return this.picker.recent},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"picker",{get:function(){var t,n=this.Lh;return null==n&&(n=new Wb(null===(t=this.kn)||void 0===t?void 0:t.picker),this.Lh=n),n},enumerable:!1,configurable:!0}),n.prototype.getResolvedValue=function(){return this.picker.value},n.prototype.onKeyDown=function(n){return this.picker.onKeyDown(n),t.prototype.onKeyDown.call(this,n)},n.prototype.getType=function(){return"DDialogColorGradient"},n}(Ks),Kb=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return B(i,n),i.prototype.init=function(i){var r;if(n.prototype.init.call(this,i),void 0===(null===(r=null==i?void 0:i.image)||void 0===r?void 0:r.source)){var e=this.theme,u=e.getViewBaseTexture();if(u instanceof t.Texture){var s=e.getCheckerColors(),h=Vb.from(1,10,s,u);this.rr=h,h.setRectangle(0,0,0,u.width,u.height),h.setData(0,this.Ws),h.update(),this.image=h}}},i.prototype.onActivate=function(t){var i=this;n.prototype.onActivate.call(this,t);var r=this.Ws,e=this.dialog;null!=r&&e.value.fromObject(r),e.open(this).then((function(t){i.onValueChange(t,i.toClone(r))}))},i.prototype.toClone=function(t){var n=new kb;return null!=t&&n.fromObject(t),n},i.prototype.onValueChange=function(t,n){var i=this.Ws;null!=i&&i.fromObject(t);var r=this.rr;null!=r&&r.update(),this.onTextChange(),this.createOrUpdateText(),rt.update(this),this.emit("change",t,n,this)},Object.defineProperty(i.prototype,"dialog",{get:function(){var t,n=this.Tc;if(null==n){var r=null===(t=this.kn)||void 0===t?void 0:t.dialog;r?n=this.newDialog(r):(null==i.DIALOG&&(i.DIALOG=this.newDialog({mode:"MENU",sticky:!0})),n=i.DIALOG),this.Tc=n}return n},enumerable:!1,configurable:!0}),i.prototype.newDialog=function(t){return new Xb(t)},Object.defineProperty(i.prototype,"value",{get:function(){return this.Ws},enumerable:!1,configurable:!0}),i.prototype.getType=function(){return"DButtonColorGradient"},i}(gs),Yb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.newContentChildren=function(n,i){var r=t.prototype.newContentChildren.call(this,n,i);return r.push(this.picker),r},n.prototype.onOk=function(n){t.prototype.onOk.call(this,n);var i=this.picker,r=i.recent;r.contains(i.new)||r.add(i.new)},Object.defineProperty(n.prototype,"current",{get:function(){return this.picker.current},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"new",{get:function(){return this.picker.new},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"recent",{get:function(){return this.picker.recent},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"picker",{get:function(){var t,n=this.Lh;return null==n&&(n=new Gb(null===(t=this.kn)||void 0===t?void 0:t.picker),this.Lh=n),n},enumerable:!1,configurable:!0}),n.prototype.getResolvedValue=function(){return this.picker.new},n.prototype.getType=function(){return"DDialogColor"},n}(Ks),Jb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.onActivate=function(n){var i=this;t.prototype.onActivate.call(this,n);var r=this.dialog,e=this.Ws;if(null!=e){var u=r.current;u.color=e.color,u.alpha=e.alpha;var s=r.new;s.color=e.color,s.alpha=e.alpha}r.open(this).then((function(){i.onValueChange(i.toClone(r.new),i.toClone(r.current))}))},n.prototype.toClone=function(t){return{color:t.color,alpha:t.alpha}},n.prototype.onValueChange=function(t,n){var i=this.Ws;null!=i&&(i.color=t.color,i.alpha=t.alpha),this.onColorChange(),this.emit("change",t,n,this)},n.prototype.toImageTintOptions=function(t){var n=this,i=function(){return n.Ws.color};return t?{color:t.color||i,alpha:t.alpha}:{color:i}},n.prototype.toImageOptions=function(t,n){return n?{source:n.source,tint:this.toImageTintOptions(n.tint),align:n.align,margin:n.margin}:{tint:this.toImageTintOptions()}},n.prototype.onColorChange=function(){this.Qs[0].updateTint()&&rt.update(this),this.updateTextForcibly()},n.prototype.updateTextForcibly=function(){this.onTextChange(),this.createOrUpdateText()},Object.defineProperty(n.prototype,"dialog",{get:function(){var t,i=this.Tc;if(null==i){var r=null===(t=this.kn)||void 0===t?void 0:t.dialog;r?i=this.newDialog(r):(null==n.DIALOG&&(n.DIALOG=this.newDialog({mode:"MENU",sticky:!0})),i=n.DIALOG),this.Tc=i}return i},enumerable:!1,configurable:!0}),n.prototype.newDialog=function(t){return new Yb(t)},Object.defineProperty(n.prototype,"value",{get:function(){var t=this.Rt;return null==t&&(t=this.newValue(),this.Rt=t),t},enumerable:!1,configurable:!0}),n.prototype.newValue=function(){var t=this,n=this.Ws;return new Ub(n,(function(i){n.color=i,t.onColorChange()}),(function(i){n.alpha=i,t.updateTextForcibly()}))},n.prototype.getType=function(){return"DButtonColor"},n}(gs),Zb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DButtonDanger"},n}(gs),qb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.onActivate=function(n){var i,r,e=this;t.prototype.onActivate.call(this,n);var u=null!==(r=null===(i=this.Ws)||void 0===i?void 0:i.getTime())&&void 0!==r?r:Date.now(),s=this.dialog;s.current=new Date(u),s.new=new Date(u),s.page=new Date(u),s.open(this).then((function(){e.onValueChange(s.new,s.current)}))},n.prototype.onValueChange=function(t,n){this.text=new Date(t.getTime()),this.emit("change",t,n,this)},Object.defineProperty(n.prototype,"dialog",{get:function(){var t,i=this.Tc;if(null==i){var r=null===(t=this.kn)||void 0===t?void 0:t.dialog;r?i=this.newDialog(r):(null==n.DIALOG&&(n.DIALOG=this.newDialog({mode:"MENU",sticky:!0})),i=n.DIALOG),this.Tc=i}return i},enumerable:!1,configurable:!0}),n.prototype.newDialog=function(t){return new mh(t)},Object.defineProperty(n.prototype,"value",{get:function(){var t;return null!==(t=this.Ws)&&void 0!==t?t:new Date},set:function(t){var n=this.Ws;void 0!==n&&n.getTime()===t.getTime()||(this.text=t)},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DButtonDate"},n}(gs),Qb=function(){function t(){}return t.format=function(t){var n=qt(String(t.getFullYear()),4,"0"),i=qt(String(t.getMonth()+1),2,"0"),r=qt(String(t.getDate()),2,"0");return"".concat(n,"/").concat(i,"/").concat(r)},t}(),$b=function(){function t(){}return t.format=function(t,n){var i="";return n&nh.HOURS&&(i+=qt(String(t.getHours()),2,"0")),n&nh.MINUTES&&(0<i.length&&(i+=":"),i+=qt(String(t.getMinutes()),2,"0")),n&nh.SECONDS&&(0<i.length&&(i+=":"),i+=qt(String(t.getSeconds()),2,"0")),i},t.toMask=function(t){return ih.from("DPickerTime",t)},t}(),td=function(){function t(){}return t.format=function(t,n){var i=$b.format(t,n);return 0<i.length?"".concat(Qb.format(t)," ").concat(i):"".concat(Qb.format(t))},t.toMask=function(t){return ih.from("DPickerDatetime",t)},t}(),nd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.onActivate=function(n){var i,r,e=this;t.prototype.onActivate.call(this,n);var u=null!==(r=null===(i=this.Ws)||void 0===i?void 0:i.getTime())&&void 0!==r?r:Date.now(),s=this.dialog;s.current=new Date(u),s.new=new Date(u),s.page=new Date(u),s.open(this).then((function(){e.onValueChange(s.new,s.current)}))},n.prototype.onValueChange=function(t,n){this.text=new Date(t.getTime()),this.emit("change",t,n,this)},n.prototype.getDatetimeMask=function(){var t,n,i=this.jc;return null==i&&(i=td.toMask(null===(n=null===(t=this.kn)||void 0===t?void 0:t.dialog)||void 0===n?void 0:n.picker),this.jc=i),i},Object.defineProperty(n.prototype,"dialog",{get:function(){var t,i=this.Tc;if(null==i){var r=null===(t=this.kn)||void 0===t?void 0:t.dialog;r?i=this.newDialog(r):(null==n.DIALOG&&(n.DIALOG=this.newDialog({mode:"MENU",sticky:!0})),i=n.DIALOG),this.Tc=i}return i},enumerable:!1,configurable:!0}),n.prototype.newDialog=function(t){return new fh(t)},Object.defineProperty(n.prototype,"value",{get:function(){var t;return null!==(t=this.Ws)&&void 0!==t?t:new Date},set:function(t){var n=this.Ws;void 0!==n&&n.getTime()===t.getTime()||(this.text=t)},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DButtonDatetime"},n}(gs),id=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getChecker=function(){var t,n,i=this.Mo;return void 0===i&&(i=null!==(n=null===(t=this.kn)||void 0===t?void 0:t.checker)&&void 0!==n?n:null,this.Mo=i),i},n.prototype.getOpener=function(){var t=this.gs;return null==t&&(t=this.newOpener(),this.gs=t),t},n.prototype.newOpener=function(){var t,n;return new ob(Di(null!==(n=null===(t=this.kn)||void 0===t?void 0:t.as)&&void 0!==n?n:hb.TEXT,hb),this)},n.prototype.onActivate=function(n){var i=this;t.prototype.onActivate.call(this,n),this.check((function(){i.open()}))},n.prototype.check=function(t){var n=this.getChecker();if(null!=n){var i=n();!0===i?t():!1===i||i.then((function(){t()}))}else t()},n.prototype.open=function(){this.getOpener().open()},n.prototype.getType=function(){return"DButtonFile"},n}(gs),rd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.onClick=function(n){this.link.onClick(this,n)||t.prototype.onClick.call(this,n)},Object.defineProperty(n.prototype,"link",{get:function(){var t=this.So;return null==t&&(t=new Al(this.kn),this.So=t),t},enumerable:!1,configurable:!0}),n.prototype.onActivate=function(n){t.prototype.onActivate.call(this,n),this.link.open(n)},n.prototype.open=function(t){this.link.open(t)},n.prototype.getType=function(){return"DButtonLink"},n}(ds),ed=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DButtonRadio"},n}(ds),ud=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DButtonRadioRight"},n}(ed),sd=function(t){function n(n){var i=t.call(this,n)||this,r=i.state,e=Sb.getCommandController();return r.isDisabled=!e.isRedoable(),e.on("change",(function(){r.isDisabled=!e.isRedoable()})),i}return B(n,t),n.prototype.onActivate=function(n){t.prototype.onActivate.call(this,n),Sb.getCommandController().redo()},n}(gs),hd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DButtonSecondary"},n}(gs),od={NONE:0,SINGLE:1,MULTIPLE:2},ad=function(t){function n(n,i){var r=t.call(this,i)||this;return r.Pt=n,r.on(Ki.tap,(function(t){r.onClick(t)})),r}return B(n,t),Object.defineProperty(n.prototype,"link",{get:function(){var t=this.So;return void 0===t&&(t=this.newLink(),this.So=t),t},enumerable:!1,configurable:!0}),n.prototype.newLink=function(){var t=this.Pt.accessor.link;return t?new Al(this.toLinkOptions(t)):null},n.prototype.onClick=function(t){var n;!0!==(null===(n=this.link)||void 0===n?void 0:n.onClick(this,t))&&this.state.isActionable&&this.activate(t)},n.prototype.activate=function(t){var n=this.Rt;void 0!==n&&this.onSelect(t,n)},n.prototype.toLinkOptions=function(t){return{url:this.toLinkUrl(t.toUrl),target:t.target,checker:this.toLinkChecker(t.checker)}},n.prototype.toLinkUrl=function(t){var n=this;return function(){var i=n.Rt;if(void 0!==i)return t(i)}},n.prototype.toLinkChecker=function(t){var n=this;if(t)return function(){var i=n.Rt;return null!=i&&t(i)}},Object.defineProperty(n.prototype,"value",{get:function(){return this.Rt},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"index",{get:function(){return this.Qe},enumerable:!1,configurable:!0}),n.prototype.onSelect=function(t,n){var i;this.emit("select",n,this);var r=this.Pt,e=r.selection;if(e.type!==od.MULTIPLE)e.clearAndAdd(n);else{var u=t&&"data"in t?t.data.originalEvent:t;if(null==u?void 0:u.ctrlKey)e.toggle(n);else if(null==u?void 0:u.shiftKey){var s=r.mapped,h=e.last;if(n===h)e.clearAndAdd(n);else{var o=!1,a=!1,c=[];s.each((function(t){if(o){if(a){if(c.unshift(t),t===n)return!1}else if(c.push(t),t===h)return!1}else t===n?(o=!0,a=!1,c.push(t)):t===h&&(o=!0,a=!0,c.push(t))})),e.clearAndAddAll(c)}}else e.clearAndAdd(n)}null===(i=this.So)||void 0===i||i.open(t)},n.prototype.set=function(t,n,i){var r=this.Pt,e=i||this.Rt!==t;if(e){this.Rt=t,this.Qe=n;var u=r.accessor;this.text=u.toLabel(t),this.title=u.toTitle(t)||"",this.image=u.toImage(t)}var s=this.state;s.lock(),s.set(ht.ACTIVE,r.selection.contains(t)),s.remove(ht.DISABLED),s.unlock(),e&&this.emit("set",t,n,this)},n.prototype.unset=function(){if(void 0!==this.Rt){this.Rt=void 0,this.Qe=void 0,this.text=void 0,this.title="",this.image=void 0;var t=this.state;t.lock(),t.add(ht.DISABLED),t.remove(ht.ACTIVE),t.unlock(),this.emit("unset",this)}},n.prototype.onKeyDown=function(n){return Xi.isActivateKey(n)&&this.onKeyDownActivate(n),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyDownActivate=function(t){return!(!this.state.isActionable||!this.state.isFocused||(this.activate(t),0))},n.prototype.getType=function(){return"DListItem"},n}(bs),cd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DDialogSelectListItem"},n}(ad),fd=function(){function t(t,n,i,r){this.Nc=0,this.Ic=!1,this.Cc=!1,this.Ac=-1,this.Rc=-1,this.Os=1,this.Lc=0,this.yc=0,this.kc=[],this.Pt=t,this.oh=n,this.xc=i,this.Bc=this.toNewItem(r),this._c=this.toInitItem(r)}return t.prototype.toNewItem=function(t){return(null==t?void 0:t.newItem)||this.newItem},t.prototype.toInitItem=function(t){return t?t.initItem||(!1!==t.stripe?this.initItem:this.initItemNoStriping):this.initItem},t.prototype.initItem=function(t,n,i){return t.state.isAlternated=n%2==1,t},t.prototype.initItemNoStriping=function(t,n,i){return t},Object.defineProperty(t.prototype,"multiplicity",{get:function(){return this.Os},enumerable:!1,configurable:!0}),t.prototype.lock=function(){this.Nc+=1,1===this.Nc&&(this.Ic=!1,this.Cc=!1)},t.prototype.unlock=function(t){this.Nc-=1,0===this.Nc&&(t&&this.Ic&&this.update(this.Cc),this.Ic=!1,this.Cc=!1)},t.prototype.update=function(t){var n=this;if(0<this.Nc)return this.Ic=!0,void(t&&(this.Cc=!0));var i=this.oh,r=i.parent;if(null!=r){var e=this.xc,u=e.children,s=r.height,h=this.Pt,o=this.toMapped(h),a=o.size(),c=this.Lc,f=this.yc,l=f-c,v=this.Bc,b=this._c,d=this.Ac,g=this.Rc;if(this.Ac<0){var m=void 0;0<u.length?m=u[0]:(m=b(v(h),c,h),e.addChild(m),f+=1,l+=1),d=Math.max(1,m.height),mn(m.getWidth())&&(g=Math.max(1,m.width)),this.Ac=d,this.Rc=g}var w=i.padding,O=w.getTop(),p=w.getBottom(),D=w.getLeft(),E=w.getRight(),M=Math.max(0,i.width-D-E),S=0<g?Math.max(1,Math.floor(M/g)):1;this.Os=S;var T=i!==e?e.transform.position.y:O,j=Math.ceil(a/S)*d,N=Math.max(s,O+j+p),I=Math.max(s-N,i.position.y),C=Math.floor((0-(I+T))*S/d),A=Math.floor((s-(I+T))*S/d),R=C-S;R%2!=0&&(R-=1);var L=A+S+S;L%2!=0&&(L+=1);var y=L-R;if(y<l&&l-2<=y&&(L=R+(y=l)),l<y){for(var k=l;k<y;++k){var x=c+k;m=b(v(h),x,h),e.addChild(m)}f=c+(l=y)}else if(y<l){for(k=l-1;y<=k;--k)e.removeChild(u[k]);f=c+(l=y)}this.Lc=R,this.yc=L;var B=R-c,_=Math.abs(B),P=u.length;if(0<_&&_<P){var U=this.kc;if(0<B){for(k=0;k<_;++k)m=u[k],this.reset(m),U.push(m);for(k=_;k<P;++k)u[k-_]=u[k];for(k=0;k<_;++k)u[P-_+k]=U[k]}else{for(k=0;k<_;++k)m=u[P-_+k],this.reset(m),U.push(m);for(k=P-_-1;0<=k;--k)u[k+_]=u[k];for(k=0;k<_;++k)u[k]=U[k]}U.length=0}var F=0,G=0;for(i===e&&(F=D,G=O),o.each((function(i,r){var e=u[r-R],s=r%S,h=Math.floor(r/S);e.position.set(F+s*g,G+h*d),n.set(e,i,r,t)}),R,R+P),k=0;R+k<0&&k<P;++k){m=u[k];var H=(V=R+k)%S,z=Math.floor(V/S);m.position.set(F+H*g,G+z*d),this.unset(m)}for(k=P-1;a<=R+k&&0<=k;--k){var V;m=u[k],H=(V=R+k)%S,z=Math.floor(V/S),m.position.set(F+H*g,G+z*d),this.unset(m)}this.lock(),i.position.y=I,i.height=N,i!==e&&(e.height=j),this.unlock(!1)}},t.prototype.set=function(t,n,i,r){t.set(n,i,r)},t.prototype.unset=function(t){t.unset()},t.prototype.reset=function(t){t.blur(!0);for(var n=t.children,i=0,r=n.length;i<r;++i){var e=n[i];if(e instanceof Qi){var u=e.state;u.lock(),u.isPressed=!1,u.isHovered=!1,u.unlock()}}return t.state.isHovered=!1,t},t.prototype.moveFocus=function(t,n,i,r){if(!i&&!r)return!1;var e=i&&Xi.isArrowUpKey(t),u=i&&Xi.isArrowDownKey(t),s=r&&Xi.isArrowLeftKey(t),h=r&&Xi.isArrowRightKey(t);if(!(e||u||s||h))return!1;if(!n.state.isActionable)return!1;var o=rt.getLayer(n);if(null==o)return!1;var a=o.getFocusController(),c=a.get();if(null==c)return!1;var f=this.xc;if(c.parent!==f)return!1;var l=c,v=l.index;if(null==v)return!1;var b=this.Os,d=this.Pt,g=this.toMapped(d).size(),m=v;if((s||h)&&(s?0<=m-1&&(m-=1):m+1<g&&(m+=1)),(e||u)&&(e?0<=m-b&&(m-=b):m+b<g&&(m+=b)),m===v)return!1;var w=f.children,O=w.indexOf(l);if(O<0)return!1;var p=O+(m-v);if(p<0||w.length<=p)return!1;var D=w[p];return a.focus(D),!0},t}(),ld=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.toMapped=function(t){return t.mapped},n.prototype.newItem=function(t){return new ad(t)},n}(fd),vd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.newItem=function(t){return new cd(t)},n}(ld),bd=function(){function t(t){this.O=t}return t.prototype.size=function(){var t=this.O;return t.before.length+t.items.length+t.after.length},t.prototype.each=function(t,n,i){var r=this.O,e=this.Pc(t,r.before,0,n,i);if(!(e<0)){var u=this.Pc(t,r.items,e,n,i);u<0||this.Pc(t,r.after,u,n,i)}},t.prototype.Pc=function(t,n,i,r,e){for(var u=i+n.length,s=null!=r?Math.max(i,r):i,h=null!=e?Math.min(u,e):u,o=s;o<h;++o)if(!1===t(n[o-i],o))return-1;return h},t}(),dd=function(t){function n(n,i,r){var e=t.call(this)||this;e.O=n,e.Uc=i,e.Fc=new Set;var u=null==r?void 0:r.on;if(u)for(var s in u){var h=u[s];h&&e.on(s,h)}return e}return B(n,t),Object.defineProperty(n.prototype,"type",{get:function(){return od.MULTIPLE},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"first",{get:function(){return this.get(0)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"last",{get:function(){return this.get(this.size()-1)},enumerable:!1,configurable:!0}),n.prototype.get=function(t){var n=this.Fc;if(0<=t&&t<n.size){var i=0,r=null;return n.forEach((function(n){i===t&&(r=n),i+=1})),r}return null},n.prototype.add=function(t){var n=this.Fc;return!n.has(t)&&(n.add(t),this.onChange(),!0)},n.prototype.remove=function(t){var n=this.Fc;return!!n.has(t)&&(n.delete(t),this.onChange(),!0)},n.prototype.toggle=function(t){var n=this.Fc;return n.has(t)?n.delete(t):n.add(t),this.onChange(),!0},n.prototype.clear=function(){var t=this.Fc;0<t.size&&(t.clear(),this.onChange())},n.prototype.clearAndAdd=function(t){var n=this.Fc;return 1===n.size?!n.has(t)&&(n.clear(),n.add(t),this.onChange(),!0):(n.clear(),n.add(t),this.onChange(),!0)},n.prototype.clearAndAddAll=function(t){for(var n=!1,i=new Set,r=this.Fc,e=0,u=t.length;e<u;++e){var s=t[e];r.has(s)||(n=!0),i.add(s)}return n||r.forEach((function(t){i.has(t)||(n=!0)})),n&&(this.Fc=i,this.onChange()),n},n.prototype.contains=function(t){return this.Fc.has(t)},n.prototype.size=function(){return this.Fc.size},n.prototype.isEmpty=function(){return this.size()<=0},n.prototype.each=function(t){var n=!1;this.Fc.forEach((function(i){n||!1===t(i)&&(n=!0)}))},n.prototype.toArray=function(){var t=[];return this.Fc.forEach((function(n){t.push(n)})),t},n.prototype.onChange=function(){this.O.update(),this.emit("change",this)},n.prototype.toItemIdMap=function(t,n,i){for(var r=0,e=t.length;r<e;++r){var u=t[r];i.set(n(u),u)}},n.prototype.toItemSet=function(t,n){for(var i=0,r=t.length;i<r;++i)n.add(t[i])},n.prototype.onItemChange=function(t,n,i){var r=this.Fc,e=new Set,u=this.Uc.toId;if(u){var s=new Map;this.toItemIdMap(t,u,s),this.toItemIdMap(n,u,s),this.toItemIdMap(i,u,s),r.forEach((function(t){var n=u(t),i=s.get(n);null!=i&&e.add(i)})),this.Fc=e,this.onChange()}else{var h=new Set;this.toItemSet(t,h),this.toItemSet(n,h),this.toItemSet(i,h),r.forEach((function(t){h.has(t)&&e.add(t)})),r.size!==e.size&&(this.Fc=e,this.onChange())}},n.prototype.newItems=function(t,n,i){for(var r=0,e=t.length;r<e;++r){var u=t[r];n.has(u)&&i.add(u)}return i},n}(t.utils.EventEmitter),gd=function(t){function n(n,i,r){var e=t.call(this)||this;e.O=n;var u=null==r?void 0:r.on;if(u)for(var s in u){var h=u[s];h&&e.on(s,h)}return e}return B(n,t),Object.defineProperty(n.prototype,"type",{get:function(){return od.NONE},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"first",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"last",{get:function(){return null},enumerable:!1,configurable:!0}),n.prototype.get=function(t){return null},n.prototype.add=function(t){return!1},n.prototype.remove=function(t){return!1},n.prototype.toggle=function(t){return!1},n.prototype.clear=function(){},n.prototype.clearAndAdd=function(t){return!1},n.prototype.clearAndAddAll=function(t){return!1},n.prototype.contains=function(t){return!1},n.prototype.size=function(){return 0},n.prototype.isEmpty=function(){return!0},n.prototype.each=function(t){},n.prototype.toArray=function(){return[]},n.prototype.onChange=function(){this.O.update(),this.emit("change",this)},n.prototype.onItemChange=function(t,n,i){},n}(t.utils.EventEmitter),md=function(t){function n(n,i,r){var e=t.call(this)||this;e.O=n,e.Uc=i,e.Gc=null;var u=null==r?void 0:r.on;if(u)for(var s in u){var h=u[s];h&&e.on(s,h)}return e}return B(n,t),Object.defineProperty(n.prototype,"type",{get:function(){return od.SINGLE},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"first",{get:function(){return this.Gc},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"last",{get:function(){return this.get(this.size()-1)},enumerable:!1,configurable:!0}),n.prototype.get=function(t){return 0===t?this.Gc:null},n.prototype.add=function(t){return this.Gc!==t&&(this.Gc=t,this.onChange(),!0)},n.prototype.remove=function(t){return this.Gc===t&&(this.Gc=null,this.onChange(),!0)},n.prototype.toggle=function(t){return this.Gc===t?this.Gc=null:this.Gc=t,this.onChange(),!0},n.prototype.clear=function(){null!=this.Gc&&(this.Gc=null,this.onChange())},n.prototype.clearAndAdd=function(t){return this.Gc!==t&&(this.Gc=t,this.onChange(),!0)},n.prototype.clearAndAddAll=function(t){var n=t.length;if(0<n){var i=t[n-1];if(this.Gc!==i)return this.Gc=i,this.onChange(),!0}else if(null!=this.Gc)return this.Gc=null,this.onChange(),!0;return!1},n.prototype.contains=function(t){return this.Gc===t},n.prototype.size=function(){return null!=this.Gc?1:0},n.prototype.isEmpty=function(){return this.size()<=0},n.prototype.each=function(t){var n=this.Gc;null!=n&&t(n)},n.prototype.toArray=function(){var t=this.Gc;return null!=t?[t]:[]},n.prototype.onChange=function(){this.O.update(),this.emit("change",this)},n.prototype.findById=function(t,n,i){for(var r=0,e=i.length;r<e;++r){var u=i[r];if(t===n(u))return u}return null},n.prototype.find=function(t,n){for(var i=0,r=n.length;i<r;++i){var e=n[i];if(t===e)return e}return null},n.prototype.onItemChange=function(t,n,i){var r=this.Gc;if(null!=r){var e=null,u=this.Uc.toId;if(u){var s=u(r);e=this.findById(s,u,t)||this.findById(s,u,n)||this.findById(s,u,i)}else e=this.find(r,t)||this.find(r,n)||this.find(r,i);r!==e&&(this.Gc=e,this.onChange())}},n}(t.utils.EventEmitter),wd=function(t){return t.image},Od=function(t){return t.title},pd=function(t){return t.url},Dd=function(){function t(t){this.toLabel=(null==t?void 0:t.toLabel)||nb,this.toTitle=(null==t?void 0:t.toTitle)||Od,this.toImage=(null==t?void 0:t.toImage)||wd,this.toId=null==t?void 0:t.toId,this.link=this.toLink(t)}return t.prototype.toLink=function(t){if(t){var n=t.link;if(n){var i=n.toUrl,r=n.target,e=n.checker;if(void 0!==i||void 0!==r||void 0!==e)return{toUrl:i||pd,target:r,checker:e}}}},t}(),Ed=function(){function t(t,n){this.O=t,n?(this.Uu=n.before||[],this.Fc=n.items||[],this.Fu=n.after||[]):(this.Uu=[],this.Fc=[],this.Fu=[]);var i=new Dd(n);this.Uc=i,this.Hc=this.toSelection(i,n),this.zc=new bd(this)}return t.prototype.toSelection=function(t,n){var i=null==n?void 0:n.selection;switch(null==i?void 0:i.type){case od.NONE:case"NONE":return new gd(this,t,i);case od.MULTIPLE:case"MULTIPLE":return new dd(this,t,i);default:return new md(this,t,i)}},Object.defineProperty(t.prototype,"before",{get:function(){return this.Uu},set:function(t){this.Uu=t,this.Hc.onItemChange(t,this.Fc,this.Fu),this.update()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"items",{get:function(){return this.Fc},set:function(t){this.Fc=t,this.Hc.onItemChange(this.Uu,t,this.Fu),this.update()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"after",{get:function(){return this.Fu},set:function(t){this.Fu=t,this.Hc.onItemChange(this.Uu,this.Fc,t),this.update()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mapped",{get:function(){return this.zc},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"accessor",{get:function(){return this.Uc},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selection",{get:function(){return this.Hc},enumerable:!1,configurable:!0}),t.prototype.update=function(t){this.O.update(t)},t.prototype.size=function(){return this.Fc.length},t.prototype.clear=function(){var t=this.Fc;return 0<t.length&&(t.length=0,this.onChange(),!0)},t.prototype.clearAndAdd=function(t){var n=this.Fc;return 1===n.length?n[0]!==t&&(n[0]=t,this.onChange(),!0):(n.length=0,n.push(t),this.onChange(),!0)},t.prototype.clearAndAddAll=function(t){var n=!1,i=this.Fc;if(0<i.length&&(i.length=0,n=!0),0<t.length){for(var r=0,e=t.length;r<e;++r)i.push(t[r]);n=!0}return!!n&&(this.onChange(),!0)},t.prototype.add=function(t,n){var i=this.Fc;return null==n?(i.push(t),this.onChange(),!0):0<=n&&n<i.length&&(i.splice(n,0,t),this.onChange(),!0)},t.prototype.addAll=function(t,n){if(0<t.length){var i=this.Fc,r=i.length;if(null==n){for(var e=0,u=t.length;e<u;++e)i.push(t[e]);return this.onChange(),!0}if(0<=n&&n<r){for(e=0,u=t.length;e<u;++e)i.splice(n+e,0,t[e]);return this.onChange(),!0}}return!1},t.prototype.get=function(t){var n=this.Fc;return 0<=t&&t<n.length?n[t]:null},t.prototype.set=function(t,n){var i=this.Fc;if(0<=t&&t<i.length){var r=i[t];return i[t]=n,this.onChange(),r}return null},t.prototype.remove=function(t){var n=this.Fc;if(0<=t&&t<n.length){var i=n.splice(t,1)[0];return this.onChange(),i}return null},t.prototype.each=function(t,n,i){for(var r=this.Fc,e=r.length,u=null!=n?Math.max(0,n):0,s=null!=i?Math.min(e,i):e,h=u;h<s&&!1!==t(r[h],h);++h);},t.prototype.onChange=function(){this.update()},t}(),Md=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.initReflowable=function(){},n.prototype.getType=function(){return"DContent"},n}(Qi),Sd=function(t){function n(n){var i,r,e=this;(e=t.call(this,n)||this).Vc=0,e.Wc=1,e.visible=!1,e.Xc=-1,e.Kc=!1,e.Yc=null,e.Jc=null!==(r=null===(i=null==n?void 0:n.fadeOut)||void 0===i?void 0:i.delay)&&void 0!==r?r:e.theme.getFadeOutDelay(),e.Zc=!0,e.qc=function(){e.onFadeOutTimeout()};var u=e.newThumb(null==n?void 0:n.thumb);return u.on("statechange",(function(t,n){e.onThumbStateChange(t,n)})),e.Qc=u,e.addChild(u),e}return B(n,t),Object.defineProperty(n.prototype,"thumb",{get:function(){return this.Qc},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"start",{get:function(){return this.Vc},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"end",{get:function(){return this.Wc},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r){i<1?(t=0,n=1):(t=Math.max(0,Math.min(1,t/i)),n=Math.max(t,Math.min(1,n/i))),this.Vc===t&&this.Wc===n||(this.Vc=t,this.Wc=n,this.onChange(r))},n.prototype.onChange=function(t){this.updateThumb(this.width,this.height),t&&(this.Zc=!0),this.Kc||(this.Kc=!0,rt.update(this))},n.prototype.touch=function(t){this.onChange(t)},n.prototype.isRegionVisible=function(){return 0<this.Vc||this.Wc<1},n.prototype.render=function(n){if(this.Kc)if(this.Kc=!1,!this.Zc&&this.isRegionVisible()){var i=this.Jc;0<=i&&(this.Xc=Date.now(),null==this.Yc&&(this.Yc=window.setTimeout(this.qc,i))),this.visible||(this.visible=!0)}else this.Jc<0&&this.visible&&(this.visible=!1);this.Zc&&(this.Zc=!1),t.prototype.render.call(this,n)},n.prototype.onResize=function(n,i,r,e){t.prototype.onResize.call(this,n,i,r,e),this.updateThumb(n,i)},n.prototype.onFadeOutTimeout=function(){this.Yc=null;var t=this.Jc,n=this.qc,i=this.state;if(i.isGesturing||i.onHovered||i.isHovered||i.isPressed)this.Yc=window.setTimeout(n,t);else{var r=this.Qc.state;if(r.isGesturing||r.isHovered||r.isPressed)this.Yc=window.setTimeout(n,t);else{var e=t-(Date.now()-this.Xc);0<e?this.Yc=window.setTimeout(n,e):this.visible&&(this.visible=!1,rt.update(this))}}},n.prototype.onThumbStateChange=function(t,n){t.isGesturing||t.isHovered||t.isPressed||(n.isGesturing||n.isHovered||n.isPressed)&&(this.Xc=Date.now())},n.prototype.onStateChange=function(n,i){t.prototype.onStateChange.call(this,n,i),n.isGesturing||n.isHovered||n.isPressed||(i.isGesturing||i.isHovered||i.isPressed)&&(this.Xc=Date.now())},n.prototype.getType=function(){return"DScrollBar"},n}(Qi),Td=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return B(i,n),i.prototype.init=function(i){var r=this;n.prototype.init.call(this,i);var e=new t.Point;this.Ni=new or({bind:this,on:{start:function(){e.copyFrom(r.position)},move:function(t,n,i){e.set(e.x+n,e.y+i),r.onGestureMove(e.x,e.y)}}})},i.prototype.getMinimumLength=function(){return this.theme.getThumbMinimumLength()},i.prototype.getType=function(){return"DScrollBarThumb"},i}(Qi),jd=function(t){function n(n){var i=t.call(this)||this;return n.snippet.add(i,!0),n.reflowable.add(i),i}return B(n,t),n.prototype.onReflow=function(t,n,i){this.clear();var r=t.state,e=t.border,u=e.getColor(r);if(null!=u){var s=e.getAlpha(r),h=e.getWidth(r),o=e.getAlign(r);this.beginFill(u,s),this.lineStyle(0,0,0,0),this.drawRect(0,o*(i-h),n,h),this.endFill(),this.visible=!0}else this.visible=!1},n}(t.Graphics),Nd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.onGestureMove=function(t,n){this.emit("regionmove",t,this)},n.prototype.initReflowable=function(){new jd(this)},n}(Td),Id=function(t){function n(n){var i=t.call(this,n)||this;return i.Qc.on("regionmove",(function(t){i.onThumbRegionMove(t)})),i}return B(n,t),n.prototype.onThumbRegionMove=function(t){var n=this.width;if(0<n){var i=this.Wc-this.Vc,r=Math.min(1-i,Math.max(0,t/n));this.Vc!==r&&this.emit("regionmove",r,this)}},n.prototype.onDownThis=function(n){t.prototype.onDownThis.call(this,n);var i=this.width;if(0<i){var r=this.Wc-this.Vc,e=n.data.getLocalPosition(this),u=Math.min(1-r,Math.max(0,e.x/i-.5*r));this.Vc!==u&&this.emit("regionmove",u,this)}},n.prototype.newThumb=function(t){return new Nd(t)},n.prototype.updateThumb=function(t,n){var i=this.Qc,r=Math.min(.5*t,i.getMinimumLength()),e=t-r,u=e*this.Vc,s=e*this.Wc+r-u;i.position.set(u,0),i.resize(s,n)},n}(Sd),Cd=function(t){function n(n){var i=t.call(this)||this;return n.snippet.add(i,!0),n.reflowable.add(i),i}return B(n,t),n.prototype.onReflow=function(t,n,i){this.clear();var r=t.state,e=t.border,u=e.getColor(r);if(null!=u){var s=e.getAlpha(r),h=e.getWidth(r),o=e.getAlign(r);this.beginFill(u,s),this.lineStyle(0,0,0,0),this.drawRect(o*(n-h),0,h,i),this.endFill(),this.visible=!0}else this.visible=!1},n}(t.Graphics),Ad=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.onGestureMove=function(t,n){this.emit("regionmove",n,this)},n.prototype.initReflowable=function(){new Cd(this)},n}(Td),Rd=function(t){function n(n){var i=t.call(this,n)||this;return i.Qc.on("regionmove",(function(t){i.onThumbRegionMove(t)})),i}return B(n,t),n.prototype.onThumbRegionMove=function(t){var n=this.height;if(0<n){var i=this.Wc-this.Vc,r=Math.min(1-i,Math.max(0,t/n));this.Vc!==r&&this.emit("regionmove",r,this)}},n.prototype.onDownThis=function(n){t.prototype.onDownThis.call(this,n);var i=this.height;if(0<i){var r=this.Wc-this.Vc,e=n.data.getLocalPosition(this),u=Math.min(1-r,Math.max(0,e.y/i-.5*r));this.Vc!==u&&this.emit("regionmove",u,this)}},n.prototype.newThumb=function(t){return new Ad(t)},n.prototype.updateThumb=function(t,n){var i=this.Qc,r=Math.min(.5*n,i.getMinimumLength()),e=n-r,u=e*this.Vc,s=e*this.Wc+r-u;i.position.set(0,u),i.resize(t,s)},n}(Sd),Ld=function(){function t(t,n,i){this.O=t,this.$c=i,this.q=0,this.tf=!1,this.vertical=new Rd(null==n?void 0:n.vertical),this.horizontal=new Id(null==n?void 0:n.horizontal)}return t.prototype.lock=function(){this.q+=1,1===this.q&&(this.tf=!1,this.nf=void 0)},t.prototype.unlock=function(t){this.q-=1,0===this.q&&(t&&this.tf&&this.update(this.nf),this.tf=!1,this.nf=void 0)},t.prototype.update=function(t){if(0<this.q)return this.tf=!0,void(null!=t&&(this.nf||(this.nf=t)));var n=this.O,i=n.width,r=n.height,e=n.content,u=-e.x,s=-e.y,h=this.vertical,o=h.width,a=this.getOffsetVerticalStart(o),c=this.getOffsetVerticalEnd(o);h.set(s,s+r,e.height,t),h.position.set(i-o,a),h.height=r-a-c;var f=this.horizontal,l=f.height,v=this.getOffsetHorizontalStart(l),b=this.getOffsetHorizontalEnd(l);f.set(u,u+i,e.width,t),f.position.set(v,r-l),f.width=i-v-b,this.$c(h.isRegionVisible()||f.isRegionVisible())},t.prototype.touch=function(t){this.vertical.touch(t),this.horizontal.touch(t)},t.prototype.getOffsetHorizontalStart=function(t){return.5*t},t.prototype.getOffsetHorizontalEnd=function(t){return.5*t},t.prototype.getOffsetVerticalStart=function(t){return.5*t},t.prototype.getOffsetVerticalEnd=function(t){return.5*t},t}(),yd=function(n){function i(t){var i,r=this,e=(r=n.call(this,t)||this).theme;(null!==(i=null==t?void 0:t.mask)&&void 0!==i?i:e.isOverflowMaskEnabled())&&(r.mask=r.getOverflowMask()),r.addChild(r.content);var u=r.scrollbar;return r.addChild(u.vertical),r.addChild(u.horizontal),u.update(),r.initGesture(e,t),r}return B(i,n),i.prototype.initGesture=function(n,i){var r,e,u=this,s=Di(null!==(e=null===(r=null==i?void 0:i.gesture)||void 0===r?void 0:r.mode)&&void 0!==e?e:n.getGestureMode(),ir);if(s===ir.ON||s===ir.TOUCH){var h=new t.Point,o=this.content;this.Ni=new or({bind:this,touch:s===ir.TOUCH,on:{start:function(){h.copyFrom(o.position)},move:function(t,n,i){h.set(h.x+n,h.y+i),o.position.set(u.toContentX(o,h.x),u.toContentY(o,h.y))}}})}},Object.defineProperty(i.prototype,"scrollbar",{get:function(){var t,n=this.if;return null==n&&(n=this.newScrollBar(null===(t=this.kn)||void 0===t?void 0:t.scrollbar),this.initScrollBar(n),this.if=n),n},enumerable:!1,configurable:!0}),i.prototype.newScrollBar=function(t){var n=this;return new Ld(this,t,(function(t){n.onScrollBarUpdate(t)}))},i.prototype.onScrollBarUpdate=function(t){var n=this.er;if(null!=n){var i=this.content;t?i.mask!==n&&(i.mask=n,rt.update(this)):i.mask&&(i.mask=null,rt.update(this))}},i.prototype.initScrollBar=function(t){var n=this;t.vertical.on("regionmove",(function(t){n.onScrollBarMoveY(t)})),t.horizontal.on("regionmove",(function(t){n.onScrollBarMoveX(t)}))},i.prototype.onScrollBarMoveX=function(t){var n=this.Ni;null!=n&&n.stop(this);var i=this.content;i.x=-i.width*t},i.prototype.onScrollBarMoveY=function(t){var n=this.Ni;null!=n&&n.stop(this);var i=this.content;i.y=-i.height*t},i.prototype.onOver=function(t){n.prototype.onOver.call(this,t),this.scrollbar.touch()},i.prototype.getType=function(){return"DPane"},Object.defineProperty(i.prototype,"content",{get:function(){var t=this.oh;return null==t&&(t=this.toContent(this.kn),this.initContent(t),this.oh=t),t},enumerable:!1,configurable:!0}),i.prototype.toContent=function(t){var n=null==t?void 0:t.content;return n?n instanceof Qi?n:this.newContent(n):this.newContent()},i.prototype.newContent=function(t){return new Md(t)},i.prototype.initContent=function(t){var n=this;t.on("move",(function(){n.onContentChange()})),t.on("resize",(function(){n.onContentChange()}))},i.prototype.getOverflowMask=function(){var t=this.er;return null==t&&(t=new $i(this),this.er=t,this.reflowable.add(t),this.toDirty()),t},i.prototype.onWheel=function(t,n,i){var r=this.content,e=this.getWheelContentX(r,n.deltaX*n.lowest),u=this.getWheelContentY(r,n.deltaY*n.lowest);if(r.x!==e||r.y!==u){var s=this.Ni;return null!=s&&s.stop(this),r.position.set(e,u),!0}return!1},i.prototype.getWheelContentX=function(t,n){if(0<n||n<0){var i=this.theme.getWheelSpeed();return this.toContentX(t,t.x-n*i)}return t.x},i.prototype.getWheelContentY=function(t,n){if(0<n||n<0){var i=this.theme.getWheelSpeed();return this.toContentY(t,t.y+n*i)}return t.y},i.prototype.toContentX=function(t,n){return Math.min(0,Math.max(this.width-t.width,n))},i.prototype.toContentY=function(t,n){return Math.min(0,Math.max(this.height-t.height,n))},i.prototype.isRefitable=function(t){return n.prototype.isRefitable.call(this,t)&&!(t instanceof Sd)},i.prototype.onResize=function(t,i,r,e){var u=this.scrollbar;u.lock(),n.prototype.onResize.call(this,t,i,r,e),u.update(),u.unlock(!0)},i.prototype.onContentChange=function(){this.scrollbar.update()},i.prototype.getFocusedChildClippingRect=function(t,n,i,r,e,u,s,h){return h.x=0,h.y=0,h.width=u,h.height=s,h},i.prototype.onChildFocus=function(r){var e=i.WORK_POINT||new t.Point;i.WORK_POINT=e;var u=this.content,s=u.x,h=u.y,o=u.width,a=u.height;e.set(0,0),r.toGlobal(e,e,!1),u.toLocal(e,void 0,e,!1);var c=s+Math.min(o,Math.max(0,e.x)),f=h+Math.min(a,Math.max(0,e.y));e.set(r.width,r.height),r.toGlobal(e,e,!0),u.toLocal(e,void 0,e,!0);var l=s+Math.min(o,Math.max(0,e.x)),v=h+Math.min(a,Math.max(0,e.y)),b=this.width,d=this.height,g=i.WORK_RECTANGLE||new t.Rectangle;i.WORK_RECTANGLE=g,this.getFocusedChildClippingRect(r,s,h,o,a,b,d,g);var m=g.x,w=g.y,O=m,p=w,D=m+g.width,E=w+g.height,M=null;c<O?l<=D&&(M=s+Math.min(O-c,D-l),M=Math.max(b-o,Math.min(0,M))):D<l&&(M=s-Math.min(c-O,l-D),M=Math.max(b-o,Math.min(0,M)));var S=null;f<p?v<=E&&(S=h+Math.min(p-f,E-v),S=Math.max(d-a,Math.min(0,S))):E<v&&(S=h-Math.min(f-p,v-E),S=Math.max(d-a,Math.min(0,S)));var T=u.position;null!=M?null!=S?T.set(M,S):T.x=M:null!=S&&(T.y=S),n.prototype.onChildFocus.call(this,r)},i.prototype.destroy=function(){var t=this.er;null!=t&&(this.er=null,t.destroy()),this.mask=null,n.prototype.destroy.call(this)},i}(Qi),kd=function(t){function n(n){var i=t.call(this,n)||this;return i.update(),i}return B(n,t),Object.defineProperty(n.prototype,"updater",{get:function(){var t=this.rf;return null==t&&(t=this.newUpdater(this.data,this.content,this.kn),this.rf=t),t},enumerable:!1,configurable:!0}),n.prototype.newUpdater=function(t,n,i){return new ld(t,n,n,null==i?void 0:i.updater)},Object.defineProperty(n.prototype,"data",{get:function(){var t=this.Pt;return null==t&&(t=this.toData(this.kn),this.Pt=t),t},enumerable:!1,configurable:!0}),n.prototype.toData=function(t){var n=t&&(t.data||t.items),i=null==t?void 0:t.selection;return null==n?i?new Ed(this,{selection:i}):new Ed(this):Rt(n)?new Ed(this,i?{items:n,selection:i}:{items:n}):"each"in n?n:i?(void 0===n.selection&&(n.selection=i),new Ed(this,n)):new Ed(this,n)},n.prototype.onContentChange=function(){t.prototype.onContentChange.call(this),this.update()},n.prototype.onResize=function(n,i,r,e){var u=this.updater;u.lock(),t.prototype.onResize.call(this,n,i,r,e),u.update(),u.unlock(!0)},Object.defineProperty(n.prototype,"selection",{get:function(){return this.data.selection},enumerable:!1,configurable:!0}),n.prototype.lock=function(){this.updater.lock()},n.prototype.unlock=function(t){this.updater.unlock(t)},n.prototype.update=function(t){this.updater.update(t)},n.prototype.onKeyDown=function(n){return this.updater.moveFocus(n,this,!0,!0),t.prototype.onKeyDown.call(this,n)},n.prototype.getType=function(){return"DList"},n}(yd),xd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.newUpdater=function(t,n,i){return new vd(t,n,n,null==i?void 0:i.updater)},n.prototype.getType=function(){return"DDialogSelectList"},n}(kd),Bd=function(t){function n(n){var i=t.call(this)||this;return i.ef=n||function(t){return Promise.resolve([])},i.R=0,i.uf=0,i}return B(n,t),n.prototype.create=function(t){var n=this,i=++this.R;this.ef(t[0]).then((function(t){n.R===i&&(n.uf=i,n.emit("success",n,t),n.emit("change",n))}),(function(){n.R===i&&(n.uf=i,n.emit("fail",n),n.emit("change",n))})),this.emit("change",this)},n.prototype.isDone=function(){return this.R===this.uf},n}(t.utils.EventEmitter),_d=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DInputSearch"},n}(zs),Pd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DNote"},n}(bs),Ud=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DNoteSmall"},n}(Pd),Fd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DNoteSmallError"},n}(Ud),Gd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DNoteSmallNoItemsFound"},n}(Ud),Hd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DNoteSmallSearching"},n}(Ud),zd=function(t){function n(n,i){var r=t.call(this)||this;return r.Jn=n,r.Rt=i.value,r.sf=i.filter,n.on("change",(function(){r.emit("change",r)})),n.on("success",(function(t,n){r.emit("success",r,r.toDismissable(n))})),n.on("fail",(function(){r.emit("fail",r)})),r}return B(n,t),n.prototype.toDismissValue=function(t){if(null!=t){var n=this.Rt;if(void 0!==n){var i=this.sf;if(null==i||i(n,t[0]))return n}}},n.prototype.toDismissable=function(t){var n=this.toDismissValue(this.hf);if(void 0===n)return t;for(var i=[],r=0,e=t.length;r<e;++r)i.push(t[r]);return i.push(n),i},n.prototype.create=function(t){this.hf=t,this.Jn.create(t)},n.prototype.isDone=function(){return this.Jn.isDone()},n}(t.utils.EventEmitter),Vd=function(t){function n(n){var i=t.call(this,n)||this;i.Rt=null;var r=new bb,e=i.search;return e.on("success",(function(t,n){0<n.length?r.hide():r.show(i.noteNoItemsFound),i.onSearched(n)})),e.on("fail",(function(){r.show(i.noteError),i.onSearched([])})),e.on("change",(function(){if(!e.isDone()){var t=i.noteSearching;t&&r.show(t)}})),i}return B(n,t),n.prototype.newContentChildren=function(n,i){var r=t.prototype.newContentChildren.call(this,n,i);return r.push(this.inputLayout,this.list),r},Object.defineProperty(n.prototype,"inputLayout",{get:function(){var t=this.fh;return null==t&&(t=this.newInputLayout(this.input,this.theme,this.kn),this.fh=t),t},enumerable:!1,configurable:!0}),n.prototype.newInputLayout=function(t,n,i){return new ws(this.toInputLayoutOptions(t,n,i))},n.prototype.toInputLayoutOptions=function(t,n,i){var r=this.toInputMargin(n,i);return{width:"padding",height:"auto",children:[new _u({width:r}),t,new _u({width:r})]}},Object.defineProperty(n.prototype,"input",{get:function(){var t=this.lh;return null==t&&(t=this.newInput(),this.lh=t),t},enumerable:!1,configurable:!0}),n.prototype.newInput=function(){var t=this,n=new _d(this.toInputOptions(this.theme,this.kn));return n.on("input",(function(n){t.search.create([n])})),n},n.prototype.toInputOptions=function(t,n){var i=(null==n?void 0:n.input)||{};return void 0===i.width&&void 0===i.weight&&(i.weight=1),i},n.prototype.toInputMargin=function(t,n){var i,r;return null!==(r=null===(i=null==n?void 0:n.input)||void 0===i?void 0:i.margin)&&void 0!==r?r:t.getInputMargin()},Object.defineProperty(n.prototype,"list",{get:function(){var t=this.Rn;return null==t&&(t=this.newList(),this.Rn=t),t},enumerable:!1,configurable:!0}),n.prototype.newList=function(){var t=this,n=new xd(this.toListOptions(this.theme,this.kn));return n.selection.on("change",(function(n){t.onListSelectionChange(n)})),n},n.prototype.onListSelectionChange=function(t){var n=t.first;if(null!=n){var i=this.kn;if(i){var r=i.dismiss;r&&n===r.value&&(n=null)}this.Rt=n,this.onOk(n)}},n.prototype.toListOptions=function(t,n){var i=(null==n?void 0:n.list)||{};return void 0===i.width&&(i.width="padding"),i},Object.defineProperty(n.prototype,"noteError",{get:function(){var t=this.af;return null==t&&(t=this.newNoteError(),this.af=t),t},enumerable:!1,configurable:!0}),n.prototype.newNoteError=function(){var t,n,i=null===(n=null===(t=this.kn)||void 0===t?void 0:t.note)||void 0===n?void 0:n.error;return null!==i?new Fd(this.toNoteOptions(this.list,i)):null},Object.defineProperty(n.prototype,"noteNoItemsFound",{get:function(){var t=this.cf;return null==t&&(t=this.newNoteNoItemsFound(),this.cf=t),t},enumerable:!1,configurable:!0}),n.prototype.newNoteNoItemsFound=function(){var t,n,i=null===(n=null===(t=this.kn)||void 0===t?void 0:t.note)||void 0===n?void 0:n.noItemsFound;return null!==i?new Gd(this.toNoteOptions(this.list,i)):null},Object.defineProperty(n.prototype,"noteSearching",{get:function(){var t=this.ff;return null==t&&(t=this.newNoteSearching(),this.ff=t),t},enumerable:!1,configurable:!0}),n.prototype.newNoteSearching=function(){var t,n,i=null===(n=null===(t=this.kn)||void 0===t?void 0:t.note)||void 0===n?void 0:n.searching;return null!=i?new Hd(this.toNoteOptions(this.list,i)):null},n.prototype.toNoteOptions=function(t,n){return null!=n?(null==n.parent&&(n.parent=t),null==n.visible&&(n.visible=!1),n):{parent:t,visible:!1}},Object.defineProperty(n.prototype,"search",{get:function(){var t=this.ef;return null==t&&(t=this.newSearch(),this.ef=t),t},enumerable:!1,configurable:!0}),n.prototype.newSearch=function(){var t=this.kn;if(t){var n=t.controller;if(n){var i=t.dismiss,r=n.search;return"create"in r?null!=i?new zd(r,i):r:null!=i?new zd(new Bd(r),i):new Bd(r)}}return new Bd},Object.defineProperty(n.prototype,"value",{get:function(){return this.Rt},enumerable:!1,configurable:!0}),n.prototype.onSearched=function(t){this.list.data.items=t},n.prototype.getResolvedValue=function(){return this.Rt},n.prototype.getType=function(){return"DDialogSelect"},n.prototype.onOpen=function(){t.prototype.onOpen.call(this),this.list.selection.clear(),this.search.create([this.input.value])},n.prototype.onOk=function(n){this.emit("select",n,this),t.prototype.onOk.call(this,n)},n.prototype.destroy=function(){var n=this.lh;n&&n.destroy();var i=this.af;i&&i.destroy();var r=this.cf;r&&(null==r||r.destroy());var e=this.ff;e&&(null==e||e.destroy());var u=this.Rn;u&&u.destroy(),t.prototype.destroy.call(this)},n}(Ss),Wd=function(t){return t.value},Xd=function(){},Kd=function(t){function n(n){var i,r,e=this;return(e=t.call(this,function(t){var n,i,r;if(t){var e,u=null===(n=t.text)||void 0===n?void 0:n.formatter;if(void 0!==u){if(!(e=t.dialog)||!("open"in e)){var s=(e=e||{}).item=e.item||{};void 0===(o=s.text=s.text||{}).formatter&&(o.formatter=u)}}else if(!(e=t.dialog)||!("open"in e)){var h=null===(r=null===(i=null==e?void 0:e.item)||void 0===i?void 0:i.text)||void 0===r?void 0:r.formatter;if(void 0!==h){var o=t.text||{};t.text=o,void 0===o.formatter&&(o.formatter=h)}}}return t}(n))||this).lf=null!==(i=null==n?void 0:n.getter)&&void 0!==i?i:Wd,e.vf=null!==(r=null==n?void 0:n.setter)&&void 0!==r?r:Xd,e}return B(n,t),n.prototype.onActivate=function(n){var i,r=this;t.prototype.onActivate.call(this,n);var e=this.dialog,u=null!==(i=this.Ws)&&void 0!==i?i:null;this.vf(e,u),e.open(this).then((function(){var t=r.lf(e);t!==u&&(r.text=t,r.emit("change",t,u,r))}))},Object.defineProperty(n.prototype,"dialog",{get:function(){var t,n=this.Tc;if(null==n){var i=null===(t=this.kn)||void 0===t?void 0:t.dialog;n=i&&"open"in i?i:new Vd(i),this.Tc=n}return n},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"value",{get:function(){var t;return null!==(t=this.Ws)&&void 0!==t?t:null},set:function(t){this.text=t},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DButtonSelect"},n}(gs),Yd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.onActivate=function(n){var i,r,e=this;t.prototype.onActivate.call(this,n);var u=null!==(r=null===(i=this.Ws)||void 0===i?void 0:i.getTime())&&void 0!==r?r:Date.now(),s=this.dialog;s.current=new Date(u),s.new=new Date(u),s.open(this).then((function(){e.onValueChange(s.new,s.current)}))},n.prototype.onValueChange=function(t,n){this.text=new Date(t.getTime()),this.emit("change",t,n,this)},n.prototype.getDatetimeMask=function(){var t,n,i=this.jc;return null==i&&(i=$b.toMask(null===(n=null===(t=this.kn)||void 0===t?void 0:t.dialog)||void 0===n?void 0:n.picker),this.jc=i),i},Object.defineProperty(n.prototype,"dialog",{get:function(){var t,i=this.Tc;if(null==i){var r=null===(t=this.kn)||void 0===t?void 0:t.dialog;r?i=this.newDialog(r):(null==n.DIALOG&&(n.DIALOG=this.newDialog({mode:"MENU",sticky:!0})),i=n.DIALOG),this.Tc=i}return i},enumerable:!1,configurable:!0}),n.prototype.newDialog=function(t){return new vh(t)},Object.defineProperty(n.prototype,"value",{get:function(){var t;return null!==(t=this.Ws)&&void 0!==t?t:new Date},set:function(t){var n=this.Ws;void 0!==n&&n.getTime()===t.getTime()||(this.text=t)},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DButtonTime"},n}(gs),Jd=function(t){function n(n){var i=t.call(this,n)||this,r=i.state,e=Sb.getCommandController();return r.isDisabled=!e.isUndoable(),e.on("change",(function(){r.isDisabled=!e.isUndoable()})),i}return B(n,t),n.prototype.onActivate=function(n){t.prototype.onActivate.call(this,n),Sb.getCommandController().undo()},n}(gs),Zd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DCanvas"},n}(Qi),qd={TOP:0,BOTTOM:1,LEFT:2,RIGHT:3},Qd={INSIDE:0,OUTSIDE:1},$d=function(){function t(t,n){var i,r;this.bf=null!==(i=null==n?void 0:n.coordinate)&&void 0!==i?i:0,this._=this.toPosition(t,n),this.df=this.toTickContainer(t,n),this.Rh=this.toLabel(t,n),this.zn=null!==(r=null==n?void 0:n.padding)&&void 0!==r?r:t.getPadding(),this.gf=this.toBar(t,n)}return Object.defineProperty(t.prototype,"coordinateIndex",{get:function(){return this.bf},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"padding",{get:function(){return this.zn},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"position",{get:function(){return this._},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bar",{get:function(){return this.gf},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tick",{get:function(){return this.df},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"label",{get:function(){return this.Rh},enumerable:!1,configurable:!0}),t.prototype.toPosition=function(t,n){var i=null==n?void 0:n.position;return at(i)?qd[i]:null!=i?i:t.getPosition()},t.prototype.toBar=function(t,n){var i;return{style:null!==(i=null==n?void 0:n.style)&&void 0!==i?i:t.getStyle(),stroke:this.toBarStroke(t,null==n?void 0:n.stroke)}},t.prototype.toTickContainer=function(t,n){var i,r=null==n?void 0:n.tick;return{enable:null!==(i=null==r?void 0:r.enable)&&void 0!==i?i:t.getTickEnable(),major:this.toTickMajor(t,r),minor:this.toMinorTick(t,r)}},t.prototype.toTickMajor=function(t,n){var i,r,e,u,s,h,o,a,c=null==n?void 0:n.major,f=null!==(r=null!==(i=null==c?void 0:c.position)&&void 0!==i?i:null==n?void 0:n.position)&&void 0!==r?r:t.getMajorTickPosition(),l=null==n?void 0:n.style,v=Lv.from(null!==(u=null!==(e=null==c?void 0:c.style)&&void 0!==e?e:l)&&void 0!==u?u:t.getMajorTickStyle()),b=null==n?void 0:n.stroke,d=this.toTickMajorStroke(t,null==c?void 0:c.stroke,b),g=null!==(s=null==c?void 0:c.count)&&void 0!==s?s:t.getMajorTickCount();return{count:g,capacity:null!==(h=null==c?void 0:c.capacity)&&void 0!==h?h:t.getMajorTickCapacity(g),step:null!==(o=null==c?void 0:c.step)&&void 0!==o?o:t.getMajorTickStep(),size:null!==(a=null==c?void 0:c.size)&&void 0!==a?a:t.getMajorTickSize(),position:this.toTickPosition(f),style:v,stroke:d,text:this.toMajorTickText(t,null==c?void 0:c.text),formatter:this.toMajorTickFormatter(t,c),gridline:this.toTickMajorGridline(t,null==c?void 0:c.gridline,l,b)}},t.prototype.toTickMajorGridline=function(t,n,i,r){var e,u,s,h=Lv.from(null!==(u=null!==(e=null==n?void 0:n.style)&&void 0!==e?e:i)&&void 0!==u?u:t.getMajorTickGridlineStyle());return{enable:null!==(s=null==n?void 0:n.enable)&&void 0!==s?s:t.getMajorTickGridlineEnable(),style:h,stroke:this.toTickMajorGridlineStroke(t,null==n?void 0:n.stroke,r)}},t.prototype.toTickPosition=function(t){var n=this._;if(t===Qd.OUTSIDE||"OUTSIDE"===t)switch(n){case qd.TOP:return $.BOTTOM;case qd.BOTTOM:return $.TOP;case qd.LEFT:return $.RIGHT;case qd.RIGHT:return $.LEFT;default:return $.TOP}else switch(n){case qd.TOP:return $.TOP;case qd.BOTTOM:return $.BOTTOM;case qd.LEFT:return $.LEFT;case qd.RIGHT:return $.RIGHT;default:return $.TOP}},t.prototype.toMinorTick=function(t,n){var i,r,e,u,s,h,o,a=null==n?void 0:n.minor,c=null!==(r=null!==(i=null==a?void 0:a.position)&&void 0!==i?i:null==n?void 0:n.position)&&void 0!==r?r:t.getMinorTickPosition(),f=Lv.from(null!==(u=null!==(e=null==a?void 0:a.style)&&void 0!==e?e:null==n?void 0:n.style)&&void 0!==u?u:t.getMinorTickStyle());return{count:null!==(s=null==a?void 0:a.count)&&void 0!==s?s:t.getMinorTickCount(),step:null!==(h=null==a?void 0:a.step)&&void 0!==h?h:t.getMinorTickStep(),size:null!==(o=null==a?void 0:a.size)&&void 0!==o?o:t.getMinorTickSize(),position:this.toTickPosition(c),style:f,stroke:this.toTickMinorStroke(t,null==a?void 0:a.stroke,null==n?void 0:n.stroke)}},t.prototype.toBarStroke=function(t,n){return this.toStroke(n,void 0,t.getStrokeEnable(),t.getStrokeColor(),t.getStrokeAlpha(),t.getStrokeWidth(),t.getStrokeAlign(),t.getStrokeSide(),t.getStrokeStyle())},t.prototype.toTickMajorStroke=function(t,n,i){return this.toStroke(n,i,t.getMajorTickStrokeEnable(),t.getMajorTickStrokeColor(),t.getMajorTickStrokeAlpha(),t.getMajorTickStrokeWidth(),t.getMajorTickStrokeAlign(),t.getMajorTickStrokeSide(),t.getMajorTickStrokeStyle())},t.prototype.toTickMajorGridlineStroke=function(t,n,i){return this.toStroke(n,i,t.getMajorTickGridlineStrokeEnable(),t.getMajorTickGridlineStrokeColor(),t.getMajorTickGridlineStrokeAlpha(),t.getMajorTickGridlineStrokeWidth(),t.getMajorTickGridlineStrokeAlign(),t.getMajorTickGridlineStrokeSide(),t.getMajorTickGridlineStrokeStyle())},t.prototype.toTickMinorStroke=function(t,n,i){return this.toStroke(n,i,t.getMinorTickStrokeEnable(),t.getMinorTickStrokeColor(),t.getMinorTickStrokeAlpha(),t.getMinorTickStrokeWidth(),t.getMinorTickStrokeAlign(),t.getMinorTickStrokeSide(),t.getMinorTickStrokeStyle())},t.prototype.toStroke=function(t,n,i,r,e,u,s,h,o){var a,c,f,l,v,b,d,g,m,w,O,p,D,E,M,S,T,j,N,I,C,A,R,L,y,k,x,B;return t?n?{enable:null!==(c=null!==(a=t.enable)&&void 0!==a?a:n.enable)&&void 0!==c?c:i,color:null!==(l=null!==(f=t.color)&&void 0!==f?f:n.color)&&void 0!==l?l:r,alpha:null!==(b=null!==(v=t.alpha)&&void 0!==v?v:n.alpha)&&void 0!==b?b:e,width:null!==(g=null!==(d=t.width)&&void 0!==d?d:n.width)&&void 0!==g?g:u,align:null!==(w=null!==(m=t.align)&&void 0!==m?m:n.align)&&void 0!==w?w:s,side:null!==(p=null!==(O=t.side)&&void 0!==O?O:n.side)&&void 0!==p?p:h,style:null!==(E=null!==(D=t.style)&&void 0!==D?D:n.style)&&void 0!==E?E:o}:{enable:null!==(M=t.enable)&&void 0!==M?M:i,color:null!==(S=t.color)&&void 0!==S?S:r,alpha:null!==(T=t.alpha)&&void 0!==T?T:e,width:null!==(j=t.width)&&void 0!==j?j:u,align:null!==(N=t.align)&&void 0!==N?N:s,side:null!==(I=t.side)&&void 0!==I?I:h,style:null!==(C=t.style)&&void 0!==C?C:o}:n?{enable:null!==(A=n.enable)&&void 0!==A?A:i,color:null!==(R=n.color)&&void 0!==R?R:r,alpha:null!==(L=n.alpha)&&void 0!==L?L:e,width:null!==(y=n.width)&&void 0!==y?y:u,align:null!==(k=n.align)&&void 0!==k?k:s,side:null!==(x=n.side)&&void 0!==x?x:h,style:null!==(B=n.style)&&void 0!==B?B:o}:{enable:i,color:r,alpha:e,width:u,align:s,side:h,style:o}},t.prototype.toMajorTickFormatter=function(t,n){var i=null==n?void 0:n.text;if(i){var r=i.format;if(null!=r)return bi.create(r);var e=i.formatter;if(e)return{format:e}}return bi.create(t.getMajorTickTextFormat())},t.prototype.toMajorTickText=function(t,n){return{format:(n=n||{}).format,color:this.toMajorTickTextColor(t,n.color),alpha:n.alpha,family:n.family,size:n.size,weight:n.weight,align:this.toMajorTickTextAlign(t,n.align),offset:this.toMajorTickTextOffset(t,n.offset),style:n.style,outline:this.toMajorTickTextOutline(t,n.outline),spacing:this.toMajorTickTextSpacing(t,n.spacing),direction:this.toTickMajorTextDirection(t,n.direction),padding:this.toMajorTickTextPadding(t,n.padding),clipping:n.clipping}},t.prototype.toMajorTickTextOutline=function(t,n){if(n)return{enable:n.enable,color:n.color,alpha:n.alpha,width:n.width}},t.prototype.toMajorTickTextAlign=function(t,n){var i,r,e=this._;return{horizontal:null!==(i=null==n?void 0:n.horizontal)&&void 0!==i?i:t.getMajorTickTextAlignHorizontal(e),vertical:null!==(r=null==n?void 0:n.vertical)&&void 0!==r?r:t.getMajorTickTextAlignVertical(e)}},t.prototype.toMajorTickTextOffset=function(t,n){if(n)return{horizontal:n.horizontal,vertical:n.vertical}},t.prototype.toMajorTickTextSpacing=function(t,n){if(n)return{horizontal:n.horizontal,vertical:n.vertical}},t.prototype.toMajorTickTextPadding=function(t,n){var i,r;return{horizontal:null!==(i=null==n?void 0:n.horizontal)&&void 0!==i?i:t.getMajorTickTextPaddingHorizontal(),vertical:null!==(r=null==n?void 0:n.vertical)&&void 0!==r?r:t.getMajorTickTextPaddingVertical()}},t.prototype.toTickMajorTextDirection=function(t,n){return null!=n?n:t.getMajorTickTextDirection()},t.prototype.toMajorTickTextColor=function(t,n){return null!=n?n:t.getMajorTickTextColor()},t.prototype.toLabel=function(t,n){var i=null==n?void 0:n.label;if(i)return{value:i.value,color:this.toLabelColor(t,i.color),alpha:i.alpha,family:i.family,size:i.size,weight:i.weight,align:this.toLabelAlign(t,i.align),offset:this.toLabelOffset(t,i.offset),style:i.style,outline:this.toLabelOutline(t,i.outline),spacing:this.toLabelSpacing(t,i.spacing),direction:this.toLabelDirection(t,i.direction),padding:this.toLabelPadding(t,i.padding),clipping:i.clipping}},t.prototype.toLabelOutline=function(t,n){if(n)return{enable:n.enable,color:n.color,alpha:n.alpha,width:n.width}},t.prototype.toLabelAlign=function(t,n){var i,r,e=this._;return{horizontal:null!==(i=null==n?void 0:n.horizontal)&&void 0!==i?i:t.getLabelAlignHorizontal(e),vertical:null!==(r=null==n?void 0:n.vertical)&&void 0!==r?r:t.getLabelAlignVertical(e)}},t.prototype.toLabelOffset=function(t,n){if(n)return{horizontal:n.horizontal,vertical:n.vertical}},t.prototype.toLabelSpacing=function(t,n){if(n)return{horizontal:n.horizontal,vertical:n.vertical}},t.prototype.toLabelPadding=function(t,n){var i,r;return{horizontal:null!==(i=null==n?void 0:n.horizontal)&&void 0!==i?i:t.getLabelPaddingHorizontal(),vertical:null!==(r=null==n?void 0:n.vertical)&&void 0!==r?r:t.getLabelPaddingVertical()}},t.prototype.toLabelDirection=function(t,n){return null!=n?n:t.getLabelDirection()},t.prototype.toLabelColor=function(t,n){return null!=n?n:t.getLabelColor()},t}(),tg=function(){function t(t){this.mf=t,this.Qe=0}return Object.defineProperty(t.prototype,"shape",{get:function(){var t=this._r;return null==t&&(t=this.newShape(),this._r=t),t},enumerable:!1,configurable:!0}),t.prototype.newShape=function(){var t,n=this.mf,i=n.bar,r=new Kt;return r.points.position=this.newShapePosition(),r.points.style=null!==(t=i.style)&&void 0!==t?t:F.NONE,r.stroke.copy(i.stroke),r.text.copy(n.label),r},t.prototype.newShapePosition=function(){switch(this.mf.position){case qd.LEFT:case qd.RIGHT:return $.TOP;default:return $.LEFT}},t.prototype.bind=function(t,n){this.xc=t,this.Qe=n,this.shape.attach(t.container)},t.prototype.unbind=function(){var t=this._r;null!=t&&t.detach(),this.Qe=0,this.xc=void 0},t.prototype.update=function(){var t=this.xc,n=this.Qe,i=this._r;if(null!=i&&null!=t){var r=t.plotArea,e=r.width,u=r.height,s=this.mf.padding*n;i.disallowUploadedUpdate();var h=i.transform.position,o=i.size;switch(this.mf.position){case qd.TOP:h.set(.5*e,0-s),o.set(e,0);break;case qd.BOTTOM:h.set(.5*e,u+s),o.set(e,0);break;case qd.LEFT:h.set(0-s,.5*u),o.set(0,u);break;case qd.RIGHT:h.set(e+s,.5*u),o.set(0,u)}return i.allowUploadedUpdate(),!0}return!1},t.prototype.destroy=function(){var t=this._r;null!=t&&t.destroy(),this.Qe=0,this.xc=void 0},t}(),ng=function(){function t(t){this.mf=t,this.Qe=0}return Object.defineProperty(t.prototype,"shapes",{get:function(){var t=this.Lr;return null==t&&(t=this.newShapes(),this.Lr=t),t},enumerable:!1,configurable:!0}),t.prototype.newShapes=function(){var t,n=[],i=this.mf.tick,r=i.major,e=r.gridline;if(i.enable&&e.enable)for(var u=r.capacity,s=null!==(t=e.style)&&void 0!==t?t:F.NONE,h=this.newShapePosition(),o=0;o<u;++o){var a=new Kt;a.points.position=h,a.points.style=s,a.stroke.copy(e.stroke),n.push(a)}return n},t.prototype.newShapePosition=function(){switch(this.mf.position){case qd.LEFT:case qd.RIGHT:return $.LEFT;default:return $.TOP}},t.prototype.bind=function(t,n){this.xc=t,this.Qe=n;for(var i=this.shapes,r=t.container,e=0,u=i.length;e<u;++e)i[e].attach(r)},t.prototype.unbind=function(){var t=this.Lr;if(null!=t)for(var n=0,i=t.length;n<i;++n)t[n].detach();this.Qe=0,this.xc=void 0},t.prototype.destroy=function(){var t=this.Lr;if(null!=t)for(var n=0,i=t.length;n<i;++n)t[n].destroy();this.Qe=0,this.xc=void 0},t}(),ig=function(){function t(t){this.mf=t,this.Qe=0,this.wf=new ng(t)}return Object.defineProperty(t.prototype,"shapes",{get:function(){var t=this.Lr;return null==t&&(t=this.newShapes(),this.Lr=t),t},enumerable:!1,configurable:!0}),t.prototype.newShapes=function(){var t,n=[],i=this.mf.tick;if(i.enable)for(var r=i.major,e=r.capacity,u=r.size,s=r.position,h=null!==(t=r.style)&&void 0!==t?t:F.NONE,o=0;o<e;++o){var a=new Kt;a.points.position=s,a.points.size=u,a.points.style=h,a.stroke.copy(r.stroke),a.text.copy(r.text),a.size.set(0,0),n.push(a)}return n},Object.defineProperty(t.prototype,"gridline",{get:function(){return this.wf},enumerable:!1,configurable:!0}),t.prototype.bind=function(t,n){this.xc=t,this.Qe=n,this.wf.bind(t,n);for(var i=this.shapes,r=t.container,e=0,u=i.length;e<u;++e)i[e].attach(r)},t.prototype.unbind=function(){var t=this.Lr;if(null!=t)for(var n=0,i=t.length;n<i;++n)t[n].detach();this.wf.unbind(),this.Qe=0,this.xc=void 0},t.prototype.destroy=function(){var t=this.Lr;if(null!=t)for(var n=0,i=t.length;n<i;++n)t[n].destroy();this.wf.destroy(),this.Qe=0,this.xc=void 0},t}(),rg=function(){function t(t){this.mf=t,this.Qe=0}return Object.defineProperty(t.prototype,"shapes",{get:function(){var t=this.Lr;return null==t&&(t=this.newShapes(),this.Lr=t),t},enumerable:!1,configurable:!0}),t.prototype.newShapes=function(){var t,n=[],i=this.mf.tick;if(i.enable)for(var r=i.minor,e=r.count,u=r.size,s=r.position,h=null!==(t=r.style)&&void 0!==t?t:F.NONE,o=0,a=(i.major.capacity+1)*e;o<a;++o){var c=new Kt;c.points.position=s,c.points.size=u,c.points.style=h,c.stroke.copy(r.stroke),c.size.set(0,0),n.push(c)}return n},t.prototype.bind=function(t,n){this.xc=t,this.Qe=n;for(var i=this.shapes,r=t.container,e=0,u=i.length;e<u;++e)i[e].attach(r)},t.prototype.unbind=function(){var t=this.Lr;if(null!=t)for(var n=0,i=t.length;n<i;++n)t[n].detach();this.Qe=0,this.xc=void 0},t.prototype.destroy=function(){var t=this.Lr;if(null!=t)for(var n=0,i=t.length;n<i;++n)t[n].destroy();this.Qe=0,this.xc=void 0},t}(),eg=function(){function t(t){this.mf=t,this.Qe=0,this.Of=new ig(t),this.pf=new rg(t),this.Df=[],this.Ef=[]}return Object.defineProperty(t.prototype,"major",{get:function(){return this.Of},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"minor",{get:function(){return this.pf},enumerable:!1,configurable:!0}),t.prototype.bind=function(t,n){this.xc=t,this.Qe=n,this.Of.bind(t,n),this.pf.bind(t,n)},t.prototype.unbind=function(){this.pf.unbind(),this.Of.unbind(),this.Qe=0,this.xc=void 0},t.prototype.update=function(){var t=this.xc,n=this.Of.shapes,i=this.pf.shapes;if(null!=t&&n&&i){var r=t.plotArea,e=r.getBoundsInContainer(),u=r.container.transform.localTransform,s=this.Of.gridline.shapes,h=this.mf,o=h.padding*this.Qe,a=void 0;switch(h.position){case qd.TOP:if(a=r.coordinate.x.get(h.coordinateIndex)){var c=a.unmap(a.transform.unmap(e.x)),f=a.unmap(a.transform.unmap(e.x+e.width)),l=r.height;return this.updateX(c,f,a,n,i,s,0-o,u,l)}break;case qd.BOTTOM:if(a=r.coordinate.x.get(h.coordinateIndex))return c=a.unmap(a.transform.unmap(e.x)),f=a.unmap(a.transform.unmap(e.x+e.width)),l=r.height,this.updateX(c,f,a,n,i,s,l+o,u,l);break;case qd.LEFT:if(a=r.coordinate.y.get(h.coordinateIndex)){c=a.unmap(a.transform.unmap(e.y)),f=a.unmap(a.transform.unmap(e.y+e.height));var v=r.width;return this.updateY(c,f,a,n,i,s,0-o,u,v)}break;case qd.RIGHT:if(a=r.coordinate.y.get(h.coordinateIndex))return c=a.unmap(a.transform.unmap(e.y)),f=a.unmap(a.transform.unmap(e.y+e.height)),v=r.width,this.updateY(c,f,a,n,i,s,v+o,u,v)}}return!1},t.prototype.updateX=function(t,n,i,r,e,u,s,h,o){var a=this.mf.tick,c=a.major,f=c.count,l=c.capacity,v=c.step,b=c.formatter,d=a.minor,g=d.count,m=(l+1)*g,w=d.step,O=this.Df,p=this.Ef;i.ticks(t,n,f,l,v,g,m,w,O,p);for(var D=h.a,E=h.tx,M=0;M<l;++M){var S=r[M],T=3*M,j=O[T+0];if(isNaN(j))S.visible=!1,u&&(u[M].visible=!1);else{var N=D*O[T+1]+E,I=O[T+2];if(S.disallowUploadedUpdate(),S.visible=!0,S.transform.position.set(N,s),S.text.value=b.format(j,I),S.allowUploadedUpdate(),M<u.length){var C=u[M];C.disallowUploadedUpdate(),C.visible=!0,C.transform.position.set(N,.5*o),C.size.set(0,o),C.allowUploadedUpdate()}}}for(M=0;M<m;++M){var A=e[M],R=3*M,L=p[R+0],y=p[R+1];isNaN(L)?A.visible=!1:(A.disallowUploadedUpdate(),A.visible=!0,A.transform.position.set(D*y+E,s),A.allowUploadedUpdate())}return!0},t.prototype.updateY=function(t,n,i,r,e,u,s,h,o){var a=this.mf.tick,c=a.major,f=c.count,l=c.capacity,v=c.step,b=c.formatter,d=a.minor,g=d.count,m=(l+1)*g,w=d.step,O=this.Df,p=this.Ef;i.ticks(t,n,f,l,v,g,m,w,O,p);for(var D=h.d,E=h.ty,M=0;M<l;++M){var S=r[M],T=3*M,j=O[T+0];if(isNaN(j))S.visible=!1,u&&(u[M].visible=!1);else{var N=D*O[T+1]+E,I=O[T+2];if(S.disallowUploadedUpdate(),S.visible=!0,S.transform.position.set(s,N),S.text.value=b.format(j,I),S.allowUploadedUpdate(),M<u.length){var C=u[M];C.disallowUploadedUpdate(),C.visible=!0,C.transform.position.set(.5*o,N),C.size.set(o,0),C.allowUploadedUpdate()}}}for(M=0;M<m;++M){var A=e[M],R=3*M,L=p[R+0],y=p[R+1];isNaN(L)?A.visible=!1:(A.disallowUploadedUpdate(),A.visible=!0,A.transform.position.set(s,D*y+E),A.allowUploadedUpdate())}return!0},t.prototype.destroy=function(){this.Of.destroy(),this.pf.destroy(),this.Qe=0,this.xc=void 0},t}(),ug=function(){function t(t){var n=this.toTheme(t);this.$t=n;var i=new $d(n,t);this.mf=i,this.Qe=0,this.gf=new tg(i),this.df=new eg(i)}return Object.defineProperty(t.prototype,"position",{get:function(){return this.mf.position},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bar",{get:function(){return this.gf},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tick",{get:function(){return this.df},enumerable:!1,configurable:!0}),t.prototype.bind=function(t,n){this.xc=t,this.Qe=n,this.gf.bind(t,n),this.df.bind(t,n)},t.prototype.unbind=function(){this.df.unbind(),this.gf.unbind(),this.Qe=0,this.xc=void 0},t.prototype.update=function(){var t=this.gf.update(),n=this.df.update();if(t||n){var i=this.xc;i&&rt.update(i.plotArea)}},t.prototype.onRender=function(){this.gf.update(),this.df.update()},t.prototype.destroy=function(){this.gf.destroy(),this.df.destroy(),this.xc=void 0},t.prototype.toTheme=function(t){return t&&t.theme||this.getThemeDefault()},t.prototype.getThemeDefault=function(){return K.getInstance().get(this.getType())},t.prototype.getType=function(){return"DChartAxisBase"},t}(),sg=function(){function t(t,n){this.Mf=t,this.xc=new Te,this.Rn=new Map;var i=n&&n.list;if(i)for(var r=0,e=i.length;r<e;++r)this.add(i[r])}return Object.defineProperty(t.prototype,"container",{get:function(){return this.xc},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"plotArea",{get:function(){return this.Mf},enumerable:!1,configurable:!0}),t.prototype.add=function(t){var n=this.Rn,i=n.get(t.position);null==i&&(i=[],n.set(t.position,i)),i.push(t),t.bind(this,i.length-1)},t.prototype.get=function(t,n){var i=this.Rn.get(Di(t,qd));return i&&0<=n&&n<i.length?i[n]:null},t.prototype.indexOf=function(t){var n=this.Rn.get(t.position);return n?n.indexOf(t):-1},t.prototype.clear=function(t){var n=this.Rn.get(Di(t,qd));if(n){for(var i=0,r=n.length;i<r;++i)n[i].destroy();n.length=0}return this},t.prototype.size=function(t){var n=this.Rn.get(Di(t,qd));return n?n.length:0},t.prototype.update=function(){this.Rn.forEach((function(t){for(var n=0,i=t.length;n<i;++n)t[n].update()}))},t.prototype.onRender=function(){this.Rn.forEach((function(t){for(var n=0,i=t.length;n<i;++n)t[n].onRender()}))},t.prototype.destroy=function(){this.Rn.forEach((function(t){for(var n=0,i=t.length;n<i;++n)t[n].destroy();t.length=0}))},t}(),hg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DChartAxisX"},n}(ug),og=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DChartAxisXDatetime"},n}(hg),ag=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DChartAxisY"},n}(ug),cg=[1095651,16667680,15778578,1858929],fg=[cg[0],Qt.brighten(cg[0],.4),cg[1],Qt.brighten(cg[1],.4),cg[2],Qt.brighten(cg[2],.4),cg[3],Qt.brighten(cg[3],.4)],lg=function(t){return fg[t%fg.length]},vg={X:0,Y:1},bg=function(){function t(t,n){this.xc=t,this.Yt=n,this.Rn=[]}return Object.defineProperty(t.prototype,"container",{get:function(){return this.xc},enumerable:!1,configurable:!0}),t.prototype.add=function(t,n){var i=this.Rn;return null==n?i.push(t):0<=n&&n<i.length?i.splice(n,0,t):i.push(t),t.bind(this,this.Yt),this},t.prototype.get=function(t){var n=this.Rn;return 0<=t&&t<n.length?n[t]:null},t.prototype.indexOf=function(t){return this.Rn.indexOf(t)},t.prototype.remove=function(t){var n=this.Rn;if(mn(t)){if(0<=(r=t)&&r<n.length){var i=n.splice(r,1)[0];return i.unbind(),i}}else{var r,e=t;if(0<=(r=n.indexOf(e)))return n.splice(r,1),e.unbind(),e}return null},t.prototype.clear=function(){for(var t=this.Rn,n=0,i=t.length;n<i;++n)t[n].unbind();return t.length=0,this},t.prototype.destroy=function(){return this.clear()},t.prototype.size=function(){return this.Rn.length},t.prototype.fit=function(t,n){for(var i=this.Rn,r=0,e=i.length;r<e;++r)i[r].fit(t,n);return this},t.prototype.mark=function(t,n){for(var i=this.Rn,r=0,e=i.length;r<e;++r)i[r].mark(t,n);return this},t.prototype.blend=function(t){for(var n=this.Rn,i=0,r=n.length;i<r;++i)n[i].blend(t);return this},t}(),dg=function(){function t(t,n){this.Mf=t;var i=new bg(this,vg.X);this._x=i;var r=new bg(this,vg.Y);if(this._y=r,n){var e=n.x;if(e)if(Rt(e))for(var u=0,s=e.length;u<s;++u)i.add(e[u]);else i.add(e);var h=n.y;if(h)if(Rt(h))for(u=0,s=h.length;u<s;++u)r.add(h[u]);else r.add(h)}}return Object.defineProperty(t.prototype,"x",{get:function(){return this._x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this._y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"plotArea",{get:function(){return this.Mf},enumerable:!1,configurable:!0}),t.prototype.fit=function(t,n,i,r){return this._x.fit(t,n),this._y.fit(i,r),this},t.prototype.mark=function(t,n,i,r){return this._x.mark(t,n),this._y.mark(i,r),this},t.prototype.blend=function(t){return this._x.blend(t),this._y.blend(t),this},t}(),gg=function(){function t(t){this.$t=this.toTheme(t)}return t.prototype.toMajorStep=function(t,n,i,r){return null==r?0<i?this.$t.toStep(t,n,i):-1:mn(r)?r:r(t,n,i)},t.prototype.toMinorStep=function(t,n,i){return null==i?0<=t?this.calcStepMinor(t,n):-1:mn(i)?i:i(t,n)},t.prototype.calcStepMinor=function(t,n){return t/(n+1)},t.prototype.calcTickMinorPositions=function(t,n,i,r,e,u,s){for(var h=0;h<n;h+=1){var o=i+(h+1)*t;r<=o&&o<=e&&(s[u++]=o)}},t.prototype.calculate=function(t,n,i,r,e,u,s,h,o,a,c){if(!(i<=0)){var f=c.transform,l=Math.min(t,n),v=Math.max(t,n),b=this.toMajorStep(l,v,i,e);if(b<=0){o[0]=l,o[1]=f.map(c.map(l)),o[2]=0;for(var d=1;d<r;++d)o[0+(A=3*d)]=NaN,o[A+1]=NaN,o[A+2]=NaN;for(d=0;d<s;++d)a[0+(R=3*d)]=NaN,a[R+1]=NaN,a[R+2]=NaN}else{var g=Math.floor(l/b)-1,m=Math.ceil(v/b)+1,w=f.map(c.map(l)),O=f.map(c.map(v)),p=Math.min(w,O)-.5,D=Math.max(w,O)+.5,E=this.toMinorStep(b,u,h),M=0,S=0;for(d=g;d<=m;++d){var T=d*b;if(M<r){var j=f.map(c.map(T));p<=j&&j<=D&&(o[0+(A=3*M)]=T,o[A+1]=j,o[A+2]=b,M+=1)}for(var N=0;N<u;N+=1)if(S<s){var I=T+(N+1)*E,C=f.map(c.map(I));p<=C&&C<=D&&(a[0+(R=3*S)]=I,a[R+1]=C,a[R+2]=E,S+=1)}}for(d=M;d<r;++d){var A;o[0+(A=3*d)]=NaN,o[A+1]=NaN,o[A+2]=NaN}for(d=S;d<s;++d){var R;a[0+(R=3*d)]=NaN,a[R+1]=NaN,a[R+2]=NaN}}}},t.prototype.toTheme=function(t){return t&&t.theme||this.getThemeDefault()},t.prototype.getThemeDefault=function(){return K.getInstance().get(this.getType())},t.prototype.getType=function(){return"DChartCoordinateTick"},t}(),mg=function(){function t(t){this.$t=this.toTheme(t),this.R=0,this.Sf=null==t?void 0:t.translation,this.Tf=0,this.jf=null==t?void 0:t.scaling,this.Ln=1,this.Nf=0,this.If=1}return Object.defineProperty(t.prototype,"id",{get:function(){return this.R},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"translate",{get:function(){return this.Tf},set:function(t){this.set(t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"scale",{get:function(){return this.Ln},set:function(t){this.set(void 0,t)},enumerable:!1,configurable:!0}),t.prototype.bind=function(t,n){this.set(0,n===vg.X?1:-1)},t.prototype.unbind=function(){},t.prototype.set=function(t,n){var i=!1;null!=t&&!1!==this.Sf&&this.Tf!==t&&(i=!0,this.Tf=t),null!=n&&!1!==this.jf&&this.Ln!==n&&(i=!0,this.Ln=n),i&&(this.R+=1,this.If=this.$t.isZero(this.Ln)?0:1/this.Ln,this.Nf=-this.Tf*this.If)},t.prototype.blend=function(t,n){var i=1-t,r=n.newTranslate*t+n.oldTranslate*i,e=n.newScale*t+n.oldScale*i;this.set(r,e)},t.prototype.map=function(t){return this.Tf+this.Ln*t},t.prototype.mapAll=function(t,n,i,r,e){for(var u=this.Tf,s=this.Ln,h=n+e;h<i;h+=r)t[h]=u+s*t[h]},t.prototype.unmap=function(t){return this.Nf+this.If*t},t.prototype.unmapAll=function(t,n,i,r,e){for(var u=this.Nf,s=this.If,h=n+e;h<i;h+=r)t[h]=u+s*t[h]},t.prototype.toTheme=function(t){return t&&t.theme||this.getThemeDefault()},t.prototype.getThemeDefault=function(){return K.getInstance().get(this.getType())},t.prototype.getType=function(){return"DChartCoordinateTransform"},t}(),wg=function(){function t(){this.oldTranslate=0,this.oldScale=1,this.newTranslate=0,this.newScale=1}return t.prototype.set=function(t,n){null!=t&&(this.newTranslate=t),null!=n&&(this.newScale=n)},t}(),Og=function(){function t(t,n){this.from=t,this.to=n}return t.prototype.set=function(t,n){return null!=t&&(this.from=t),null!=n&&(this.to=n),this},t.prototype.add=function(t,n){return bh(t)||(this.from=bh(this.from)?t:Math.min(this.from,t)),bh(n)||(this.to=bh(this.to)?n:Math.max(this.to,n)),this},t.prototype.clear=function(){return this.from=NaN,this.to=NaN,this},t}(),pg=function(){function t(t){this.R=0,this.Yt=vg.X,this.$t=this.toTheme(t),this.I=new mg(null==t?void 0:t.transform),this.df=new gg(null==t?void 0:t.tick),this.bu=new Og(NaN,NaN),this.Cf=new wg,this.It=null==t?void 0:t.from,this.Ct=null==t?void 0:t.to}return Object.defineProperty(t.prototype,"from",{get:function(){return this.It},set:function(t){this.It=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"to",{get:function(){return this.Ct},set:function(t){this.Ct=t},enumerable:!1,configurable:!0}),t.prototype.bind=function(t,n){this.xc=t,this.Yt=n,this.I.bind(t,n)},t.prototype.unbind=function(){this.xc=void 0,this.I.unbind()},t.prototype.fit=function(t,n){this.doFit(t,n,this.I)},t.prototype.mark=function(t,n){var i=this.Cf,r=this.I;i.oldTranslate=r.translate,i.oldScale=r.scale,this.doFit(t,n,i)},t.prototype.blend=function(t){this.I.blend(t,this.Cf)},t.prototype.doFit=function(t,n,i){var r=this.xc;if(r){var e=r.container.plotArea,u=e.padding,s=this.bu;switch(this.Yt){case vg.X:this.Af(u.getLeft(),e.width-u.getRight(),this.toFitDomain(t,n,e,s),i);break;case vg.Y:this.Af(e.height-u.getBottom(),u.getTop(),this.toFitRange(t,n,e,s),i)}}},t.prototype.toFitDomain=function(t,n,i,r){return null==t&&(t=this.It),null==n&&(n=this.Ct),null!=t&&null!=n||i.series.getDomain(this,r),r.set(t,n),r},t.prototype.toFitRange=function(t,n,i,r){return null==t&&(t=this.It),null==n&&(n=this.Ct),null!=t&&null!=n||i.series.getRange(this,r),r.set(t,n),r},t.prototype.Af=function(t,n,i,r){var e=i.from,u=i.to;if(!bh(e)&&!bh(u)){var s,h=u-e,o=t-e*(s=this.$t.isZero(h)?n<t?-1:1:(n-t)/h);r.set(o,s)}},Object.defineProperty(t.prototype,"id",{get:function(){return this.R},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"transform",{get:function(){return this.I},enumerable:!1,configurable:!0}),t.prototype.map=function(t){return t},t.prototype.mapAll=function(t,n,i,r,e){},t.prototype.unmap=function(t){return t},t.prototype.unmapAll=function(t,n,i,r,e){},t.prototype.ticks=function(t,n,i,r,e,u,s,h,o,a){this.df.calculate(t,n,i,r,e,u,s,h,o,a,this)},t.prototype.toTheme=function(t){return t&&t.theme||this.getThemeDefault()},t.prototype.getThemeDefault=function(){return K.getInstance().get(this.getType())},t.prototype.getType=function(){return"DChartCoordinate"},t}(),Dg=function(){function t(t){this.$t=this.toTheme(t)}return t.prototype.toMajorStep=function(t,n,i,r){return null==r?0<i?this.$t.toStep(t,n,i):-1:mn(r)?r:r(t,n,i)},t.prototype.toMinorStep=function(t,n,i){return null==i?0<=t?this.calcStepMinor(t,n):-1:mn(i)?i:i(t,n)},t.prototype.calcStepMinor=function(t,n){return t/(n+1)},t.prototype.calcTickMinorPositions=function(t,n,i,r,e,u,s){for(var h=0;h<n;h+=1){var o=i+(h+1)*t;r<=o&&o<=e&&(s[u++]=o)}},t.prototype.calculate=function(t,n,i,r,e,u,s,h,o,a,c){if(!(i<=0)){var f=c.transform,l=c.map(t),v=c.map(n),b=Math.min(l,v),d=Math.max(l,v),g=this.toMajorStep(b,d,i,e);if(g<=0){var m=Math.min(t,n);o[0]=m,o[1]=f.map(c.map(m)),o[2]=0;for(var w=1;w<i;++w)o[0+(N=3*w)]=NaN,o[N+1]=NaN,o[N+2]=NaN;for(w=0;w<s;++w)a[0+(I=3*w)]=NaN,a[I+1]=NaN,a[I+2]=NaN}else{var O=Math.floor(b/g)-1,p=Math.ceil(d/g)+1,D=this.toMinorStep(g,u,h),E=0,M=0;for(w=O;w<=p;++w){var S=w*g;E<r&&b<=S&&S<=d&&(o[0+(N=3*E)]=c.unmap(S),o[N+1]=f.map(S),o[N+2]=c.unmap(S-1),E+=1);for(var T=0;T<u;T+=1)if(M<s){var j=S+(T+1)*D;b<=j&&j<=d&&(a[0+(I=3*M)]=c.unmap(j),a[I+1]=f.map(j),a[I+2]=c.unmap(j-1),M+=1)}}for(w=E;w<r;++w){var N;o[0+(N=3*w)]=NaN,o[N+1]=NaN,o[N+2]=NaN}for(w=M;w<s;++w){var I;a[0+(I=3*w)]=NaN,a[I+1]=NaN,a[I+2]=NaN}}}},t.prototype.toTheme=function(t){return t&&t.theme||this.getThemeDefault()},t.prototype.getThemeDefault=function(){return K.getInstance().get(this.getType())},t.prototype.getType=function(){return"DChartCoordinateTick"},t}(),Eg=function(){function t(t){this.R=0,this.Yt=vg.X,this.$t=this.toTheme(t),this.I=new mg(null==t?void 0:t.transform),this.df=new Dg(null==t?void 0:t.tick),this.bu=new Og(NaN,NaN),this.Cf=new wg,this.It=null==t?void 0:t.from,this.Ct=null==t?void 0:t.to}return Object.defineProperty(t.prototype,"from",{get:function(){return this.It},set:function(t){this.It=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"to",{get:function(){return this.Ct},set:function(t){this.Ct=t},enumerable:!1,configurable:!0}),t.prototype.bind=function(t,n){this.xc=t,this.Yt=n},t.prototype.unbind=function(){this.xc=void 0},t.prototype.fit=function(t,n){this.doFit(t,n,this.I)},t.prototype.mark=function(t,n){var i=this.Cf,r=this.I;i.oldTranslate=r.translate,i.oldScale=r.scale,this.doFit(t,n,i)},t.prototype.blend=function(t){this.I.blend(t,this.Cf)},t.prototype.doFit=function(t,n,i){var r=this.xc;if(r){var e=r.container.plotArea,u=e.padding,s=this.bu;switch(this.Yt){case vg.X:this.Af(u.getLeft(),e.width-u.getRight(),this.toFitDomain(t,n,e,s),i);break;case vg.Y:this.Af(e.height-u.getBottom(),u.getTop(),this.toFitRange(t,n,e,s),i)}}},t.prototype.toFitDomain=function(t,n,i,r){return null==t&&(t=this.It),null==n&&(n=this.Ct),null!=t&&null!=n||i.series.getDomain(this,r),r.set(t,n),r},t.prototype.toFitRange=function(t,n,i,r){return null==t&&(t=this.It),null==n&&(n=this.Ct),null!=t&&null!=n||i.series.getRange(this,r),r.set(t,n),r},t.prototype.Af=function(t,n,i,r){var e=i.from,u=i.to;if(!bh(e)&&!bh(u)){var s,h=this.map(e),o=this.map(u)-h,a=t-h*(s=this.$t.isZero(o)?n<t?-1:1:(n-t)/o);r.set(a,s)}},Object.defineProperty(t.prototype,"id",{get:function(){return this.R},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"transform",{get:function(){return this.I},enumerable:!1,configurable:!0}),t.prototype.map=function(t){return Math.log(Math.max(0,t))/Math.LN10},t.prototype.mapAll=function(t,n,i,r,e){for(var u=1/Math.LN10,s=n+e;s<i;s+=r){var h=t[s];t[s]=Math.log(Math.max(0,h))*u}},t.prototype.unmap=function(t){return Math.pow(10,t)},t.prototype.unmapAll=function(t,n,i,r,e){for(var u=n+e;u<i;u+=r)t[u]=Math.pow(10,t[u])},t.prototype.ticks=function(t,n,i,r,e,u,s,h,o,a){this.df.calculate(t,n,i,r,e,u,s,h,o,a,this)},t.prototype.toTheme=function(t){return t&&t.theme||this.getThemeDefault()},t.prototype.getThemeDefault=function(){return K.getInstance().get(this.getType())},t.prototype.getType=function(){return"DChartCoordinate"},t}(),Mg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DChartLegendItem"},n}(Qi),Sg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DChartLegend"},n}(Qi),Tg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DChartOverview"},n}(Qi),jg=function(n){function i(i){var r=n.call(this)||this,e=r.transform;return r._=new Ii(e.position,i),r.Ln=new Ii(e.scale,i),r._i=new t.Rectangle,r}return B(i,n),Object.defineProperty(i.prototype,"position",{get:function(){return this._},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"scale",{get:function(){return this.Ln},enumerable:!1,configurable:!0}),i.prototype.getBounds=function(t,i){return this._lastBoundsID=-1,n.prototype.getBounds.call(this,t,i)},i.prototype.calculateBounds=function(){var t=this._bounds,n=this.bu,i=this._i,r=this.transform.worldTransform,e=0,u=0,s=0,h=0,o=this.children;if(0<o.length)for(var a=!0,c=0,f=o.length;c<f;++c){var l=o[c];l.visible&&(l.getBoundsInternal(!1,i),a?(a=!1,e=i.x,s=i.y,u=i.x+i.width,h=i.y+i.height):(e=Math.min(e,i.x),s=Math.min(s,i.y),u=Math.max(u,i.x+i.width),h=Math.max(h,i.y+i.height)))}t.clear(),n.set(e,s),r.apply(n,n),t.addPoint(n),n.set(u,h),r.apply(n,n),t.addPoint(n)},i}(Te),Ng=function(){function t(){this.shape=null,this.x=0,this.y=0,this.p0x=0,this.p0y=0,this.p1x=0,this.p1y=0,this.index=0,this.t=0,this.distance=0}return t.prototype.copyFrom=function(t){return this.shape=t.shape,this.x=t.x,this.y=t.y,this.p0x=t.p0x,this.p0y=t.p0y,this.p1x=t.p1x,this.p1y=t.p1y,this.index=t.index,this.t=t.t,this.distance=t.distance,this},t}(),Ig=function(){function t(t,n,i){this.enable=t,this.color=n,this.alpha=i}return t.from=function(n,i,r){var e,u,s;return new t(null!==(e=null==r?void 0:r.enable)&&void 0!==e?e:n.enable(i),null!==(u=null==r?void 0:r.color)&&void 0!==u?u:n.color(i),null!==(s=null==r?void 0:r.alpha)&&void 0!==s?s:n.alpha(i))},t}(),Cg=function(){function t(){}return t.from=function(t,n){return Rt(t)?function(n){return t[n%t.length]}:ot(t)?t:null!=t?function(){return t}:Rt(n)?function(t){return n[t%n.length]}:ot(n)?n:function(){return n}},t}(),Ag=function(t){this.enable=Cg.from(null==t?void 0:t.enable,!0),this.color=Cg.from(null==t?void 0:t.color,lg),this.alpha=Cg.from(null==t?void 0:t.alpha,Y.FILL_ALPHA)},Rg=function(){function t(t,n){this.outer=t,this.inner=n}return t.from=function(n,i,r){var e,u;return new t(null!==(e=null==r?void 0:r.outer)&&void 0!==e?e:n.outer(i),null!==(u=null==r?void 0:r.inner)&&void 0!==u?u:n.inner(i))},t}(),Lg=function(t){this.outer=Cg.from(null==t?void 0:t.outer,.2),this.inner=Cg.from(null==t?void 0:t.inner,.1)},yg=function(){function t(t,n){this.x=t,this.y=n}return t.from=function(n,i,r,e,u){var s,h;return new t(null!==(s=null==r?void 0:r.x)&&void 0!==s?s:null!=n.x?n.x(i):e,null!==(h=null==r?void 0:r.y)&&void 0!==h?h:null!=n.y?n.y(i):u)},t}(),kg=function(t){t&&(null!=t.x&&(this.x=Cg.from(t.x,0)),null!=t.y&&(this.y=Cg.from(t.y,0)))},xg=function(){function t(t,n,i,r,e,u,s){this.enable=t,this.color=n,this.alpha=i,this.width=r,this.align=e,this.side=u,this.style=s}return t.from=function(n,i,r){var e,u,s,h,o,a,c;return new t(null!==(e=null==r?void 0:r.enable)&&void 0!==e?e:n.enable(i),null!==(u=null==r?void 0:r.color)&&void 0!==u?u:n.color(i),null!==(s=null==r?void 0:r.alpha)&&void 0!==s?s:n.alpha(i),null!==(h=null==r?void 0:r.width)&&void 0!==h?h:n.width(i),null!==(o=null==r?void 0:r.align)&&void 0!==o?o:n.align(i),null!==(a=null==r?void 0:r.side)&&void 0!==a?a:n.side(i),null!==(c=null==r?void 0:r.style)&&void 0!==c?c:n.style(i))},t}(),Bg=function(t){this.enable=Cg.from(null==t?void 0:t.enable,!0),this.color=Cg.from(null==t?void 0:t.color,lg),this.alpha=Cg.from(null==t?void 0:t.alpha,Y.STROKE_ALPHA),this.width=Cg.from(null==t?void 0:t.width,Y.STROKE_WIDTH),this.align=Cg.from(null==t?void 0:t.width,Y.STROKE_ALIGN),this.side=Cg.from(null==t?void 0:t.side,Gt.ALL),this.style=Cg.from(null==t?void 0:t.style,s.NON_SCALING)},_g=function(){function t(t,n){var i;this.Mf=t,this.Rf=new Og(NaN,NaN),this.Lf=new Og(NaN,NaN),this.Hc=null!==(i=null==n?void 0:n.selection)&&void 0!==i?i:null,this.C=new Ag(null==n?void 0:n.fill),this.mo=new Bg(null==n?void 0:n.stroke),this.j=new kg(null==n?void 0:n.size),this.rn=new kg(null==n?void 0:n.offset),this.zn=new Lg(null==n?void 0:n.padding),this.Rn=[];var r=n&&n.list;if(r){var e=r.length;if(0<e){for(var u=0;u<e;++u)this.add(r[u]);this.update()}}}return t.prototype.newFill=function(t,n){return Ig.from(this.C,t,n)},t.prototype.newStroke=function(t,n){return xg.from(this.mo,t,n)},t.prototype.newSize=function(t,n,i,r){return yg.from(this.j,t,n,i,r)},t.prototype.newOffset=function(t,n,i,r){return yg.from(this.rn,t,n,i,r)},t.prototype.newPadding=function(t,n){return Rg.from(this.zn,t,n)},Object.defineProperty(t.prototype,"plotArea",{get:function(){return this.Mf},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selection",{get:function(){return this.Hc},enumerable:!1,configurable:!0}),t.prototype.update=function(){for(var t=this.Rn,n=0,i=t.length;n<i;++n)t[n].update();var r=this.Hc;r&&r.update()},t.prototype.add=function(t){var n=this.Rn;t.bind(this,n.length),n.push(t)},t.prototype.get=function(t){var n=this.Rn;return 0<=t&&t<n.length?n[t]:null},t.prototype.indexOf=function(t){return this.Rn.indexOf(t)},t.prototype.clear=function(){for(var t=this.Rn,n=0,i=t.length;n<i;++n)t[n].destroy();return t.length=0,this},t.prototype.size=function(){return this.Rn.length},t.prototype.destroy=function(){this.clear();var t=this.Hc;t&&t.unbind()},t.prototype.getDomain=function(t,n){n.clear();for(var i=this.Rn,r=0,e=i.length;r<e;++r){var u=i[r];if(u.coordinate.x===t){var s=u.domain;n.add(s.from,s.to)}}return n},t.prototype.getRange=function(t,n){n.clear();for(var i=this.Rn,r=0,e=i.length;r<e;++r){var u=i[r];if(u.coordinate.y===t){var s=u.range;n.add(s.from,s.to)}}return n},Object.defineProperty(t.prototype,"domain",{get:function(){var t=this.Rf;t.clear();for(var n=this.Rn,i=0,r=n.length;i<r;++i){var e=n[i].domain;t.add(e.from,e.to)}return t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"range",{get:function(){var t=this.Lf;t.clear();for(var n=this.Rn,i=0,r=n.length;i<r;++i){var e=n[i].range;t.add(e.from,e.to)}return t},enumerable:!1,configurable:!0}),t.prototype.hitTest=function(t,n){for(var i=this.Rn,r=i.length-1;0<=r;--r){var e=i[r];if(e.hitTest(t,n))return e}return null},t.prototype.calcHitPoint=function(n,i,r){var e=r,u=t.WORK_CALCHITPOINT,s=this.Rn,h=null;u.distance=1/0;for(var o=s.length-1;0<=o;--o){var a=s[o];if(a.calcHitPoint(n,i,e)&&e.distance<u.distance){h=a;var c=e;e=u,u=c}}return h&&u!==r&&r.copyFrom(u),h},t.WORK_CALCHITPOINT=new Ng,t}(),Pg=function(n){function i(t,i){var r=n.call(this,i)||this;return r.yf=t,r.kf=0,r.xf=1e3,r.Bf=null,r._f=function(){r.onBlend()},r}return B(i,n),i.prototype.init=function(i){var r,e=this;n.prototype.init.call(this,i);var u=new jg((function(){e.Pf=!0,e.Uf=!0,rt.update(e)}));this.xc=u,this.Ff=new dg(this,null==i?void 0:i.coordinate);var s=new _g(this,null==i?void 0:i.series);this.Gf=s;var h=new sg(this,null==i?void 0:i.axis);this.Hf=h,this.Pf=!0,this.Uf=!0,this.zf=new t.Rectangle,this.wc=new t.Point,this.addChild(u),this.addChild(h.container),this.rr=new fr(this,(function(){return u}),null==i?void 0:i.view);var o=s.selection;o&&o.bind(s),(null!==(r=null==i?void 0:i.mask)&&void 0!==r?r:this.theme.isOverflowMaskEnabled())&&(u.mask=this.getOverflowMask())},i.prototype.onResize=function(t,i,r,e){this.Pf=!0,this.Uf=!0,n.prototype.onResize.call(this,t,i,r,e)},i.prototype.getOverflowMask=function(){return null==this.er&&(this.er=new $i(this),this.reflowable.add(this.er),this.toDirty()),this.er},Object.defineProperty(i.prototype,"chart",{get:function(){return this.yf},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"coordinate",{get:function(){return this.Ff},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"series",{get:function(){return this.Gf},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"container",{get:function(){return this.xc},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"axis",{get:function(){return this.Hf},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"view",{get:function(){return this.rr},enumerable:!1,configurable:!0}),i.prototype.onWheel=function(t,i,r){var e=this.rr.onWheel(t,i,r),u=n.prototype.onWheel.call(this,t,i,r);return e||u},i.prototype.onDblClick=function(t,i){var r=this.rr.onDblClick(t,i),e=n.prototype.onDblClick.call(this,t,i);return r||e},i.prototype.onDown=function(t){this.rr.onDown(t),n.prototype.onDown.call(this,t)},i.prototype.render=function(t){if(this.Pf){this.Pf=!1,this.Hf.onRender();var i=this.Gf.selection;i&&i.onRender()}n.prototype.render.call(this,t)},i.prototype.destroy=function(){this.xc.destroy(),this.Gf.destroy(),this.Hf.destroy()},i.prototype.getType=function(){return"DChartPlotArea"},i.prototype.getBoundsInContainer=function(){var t=this.zf;if(this.Uf){this.Uf=!1;var n=this.container;n.updateTransform();var i=n.transform.localTransform,r=this.wc;r.set(0,0),i.applyInverse(r,r),t.x=r.x,t.y=r.y,r.set(this.width,this.height),i.applyInverse(r,r),t.width=r.x-t.x,t.height=r.y-t.y}return t},i.prototype.fit=function(t,n,i,r,e){var u=this.Ff,s=this.Hf,h=this.Gf;if(null!=t&&t<=0)u.fit(n,i,r,e),s.update(),h.update();else{this.xf=null!=t?t:200,this.kf=Date.now(),u.mark(n,i,r,e);var o=this.Bf;null!=o&&window.clearTimeout(o),this.Bf=window.setTimeout(this._f,0)}return this},i.prototype.onBlend=function(){var t=(Date.now()-this.kf)/this.xf;t<1?this.Bf=window.setTimeout(this._f,0):(this.Bf=null,t=1),this.Ff.blend(er.ELASTIC(t)),this.Hf.update(),this.Gf.update()},i}(Qi),Ug=function(){function t(t,n,i){this.It=t,this.Ct=n,this.Z=i}return Object.defineProperty(t.prototype,"from",{get:function(){return this.It},set:function(t){this.set(t,void 0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"to",{get:function(){return this.Ct},set:function(t){this.set(void 0,t)},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n){var i=!1;return null!=t&&this.It!==t&&(bh(this.It)&&bh(t)||(this.It=t,i=!0)),null!=n&&this.Ct!==n&&(bh(this.Ct)&&bh(n)||(this.Ct=n,i=!0)),i&&this.Z(),this},t.prototype.add=function(t,n){var i,r;return bh(t)||(i=bh(this.from)?t:Math.min(this.from,t)),bh(n)||(r=bh(this.to)?n:Math.max(this.to,n)),this.set(i,r)},t.prototype.clear=function(){return this.set(NaN,NaN)},t}(),Fg=function(){function t(t){var n,i,r,e=this.toTheme(t);this.$t=e;var u=(new ct).add(null!==(n=null==t?void 0:t.state)&&void 0!==n?n:ht.HOVERED);this.Mt=u,this.rs=null!==(i=null==t?void 0:t.enable)&&void 0!==i?i:e.isEnabled(u),this._r=null==t?void 0:t.shape,this.B=null!==(r=null==t?void 0:t.style)&&void 0!==r?r:this.setStyle}return t.prototype.bind=function(t){if(this.rs){var n=this._r||this.newShape(this.$t);this._r=n,n.attach(t.plotArea.axis.container),n.visible=!1}},t.prototype.unbind=function(){var t=this._r;t&&t.detach()},t.prototype.newShape=function(t){return t.newShape(this.Mt)},t.prototype.set=function(t,n,i){this.update(t,n);var r=this._r;r&&this.B(r,i)},t.prototype.setStyle=function(t,n){var i=n.shape;i&&(t.stroke.color=i.stroke.color)},t.prototype.unset=function(){var t=this._r;t&&(t.visible=!1)},t.prototype.toTheme=function(t){var n=null==t?void 0:t.theme;return at(n)?this.getTheme(n):null!=n?n:this.getTheme(this.getType())},t.prototype.getTheme=function(t){return K.getInstance().get(t)},t}(),Gg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.update=function(t,n){var i=this._r;if(i){var r=n.x,e=t.plotArea.height;return i.transform.position.set(r,.5*e),i.size.set(0,e),i.visible=this.isVisible(t,r),!0}return!1},n.prototype.isVisible=function(t,n){return 0<=n&&n<=t.plotArea.width},n.prototype.getType=function(){return"DChartSelectionGridlineX"},n}(Fg),Hg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.update=function(t,n){var i=this._r;if(i){var r=n.y,e=t.plotArea.width;return i.transform.position.set(.5*e,r),i.size.set(e,0),i.visible=this.isVisible(t,r),!0}return!1},n.prototype.isVisible=function(t,n){return 0<=n&&n<=t.plotArea.height},n.prototype.getType=function(){return"DChartSelectionGridlineY"},n}(Fg),zg=function(){function t(t){this._x=new Gg(null==t?void 0:t.x),this._y=new Hg(null==t?void 0:t.y)}return Object.defineProperty(t.prototype,"x",{get:function(){return this._x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this._y},enumerable:!1,configurable:!0}),t.prototype.bind=function(t){this._x.bind(t),this._y.bind(t)},t.prototype.unbind=function(){this._x.unbind(),this._y.unbind()},t.prototype.set=function(t,n,i){this._x.set(t,n,i),this._y.set(t,n,i)},t.prototype.unset=function(){this._x.unset(),this._y.unset()},t.prototype.update=function(t,n){var i=this._x.update(t,n),r=this._y.update(t,n);return i||r},t}(),Vg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.update=function(t,n){var i=this._r;return!!i&&(i.transform.position.copyFrom(n),i.visible=this.isVisible(t,n),!0)},n.prototype.isVisible=function(t,n){var i=n.x,r=n.y,e=t.plotArea;return 0<=i&&i<=e.width&&0<=r&&r<=e.height},n.prototype.getType=function(){return"DChartSelectionMarker"},n}(Fg),Wg={PREVIOUS:0,NEXT:1,CLOSER:2,INTERSECTION:3},Xg=function(n){function i(i){var r,e,u,s=this;(s=n.call(this)||this).xc=null,s.Gf=null,s.rs=null===(r=i.enable)||void 0===r||r,s.wf=new zg(i.gridline),s.A=new Vg(i.marker),s.Mt=null!==(e=i.state)&&void 0!==e?e:ht.HOVERED,s.Vf=null,s.Wf=null,s._=new t.Point,s.an=null!==(u=i.point)&&void 0!==u?u:Wg.CLOSER,s.bu=new t.Point;var h=i.on;if(h)for(var o in h){var a=h[o];a&&s.on(o,a)}return s}return B(i,n),i.prototype.bind=function(t){this.rs&&(this.xc=t,this.wf.bind(t),this.A.bind(t))},i.prototype.unbind=function(){this.A.unbind(),this.wf.unbind(),this.xc=null,this.Vf=null,this.Wf=null},Object.defineProperty(i.prototype,"series",{get:function(){return this.Gf},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"position",{get:function(){return this._},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"gridline",{get:function(){return this.wf},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"marker",{get:function(){return this.A},enumerable:!1,configurable:!0}),i.prototype.set=function(t,n){var i=this.xc,r=this.Vf=t.coordinate.x,e=this.Wf=t.coordinate.y;if(i&&r&&e){var u=i.plotArea.container.localTransform,s=this._,h=this.bu;if(n instanceof Ng){var o=n.x,a=n.y;switch(this.an){case Wg.PREVIOUS:o=n.p0x,a=n.p0y;break;case Wg.NEXT:o=n.p1x,a=n.p1y;break;case Wg.CLOSER:Math.abs(n.p0x-n.x)<Math.abs(n.p1x-n.x)?(o=n.p0x,a=n.p0y):(o=n.p1x,a=n.p1y)}h.set(o,a),u.apply(h,h),s.set(r.unmap(r.transform.unmap(o)),e.unmap(e.transform.unmap(a)))}else s.copyFrom(n.position),h.set(r.transform.map(r.map(s.x)),e.transform.map(e.map(s.y))),u.apply(h,h);this.wf.set(i,h,t),this.A.set(i,h,t),rt.update(i.plotArea)}var c=this.Gf;if(c!==t){var f=this.Mt;c&&c.state.remove(f),this.Gf=t,t.state.add(f)}this.emit("change",this)},i.prototype.setStyle=function(t,n){var i=n.shape;i&&(t.stroke.color=i.stroke.color)},i.prototype.unset=function(){var t=this.Gf;t&&(this.Gf=null,this.Vf=null,this.Wf=null,t.state.remove(this.Mt),this.wf.unset(),this.A.unset(),this.emit("change",this))},i.prototype.update=function(){var t=this.xc,n=this.Vf,i=this.Wf;if(t&&n&&i){var r=this._,e=this.bu;e.set(n.transform.map(n.map(r.x)),i.transform.map(i.map(r.y))),t.plotArea.container.localTransform.apply(e,e);var u=this.wf.update(t,e),s=this.A.update(t,e);return u||s}return!1},i}(t.utils.EventEmitter),Kg=function(t){function n(n){var i,r=this;(r=t.call(this)||this).xc=null;var e=Di(null!==(i=null==n?void 0:n.point)&&void 0!==i?i:Wg.CLOSER,Wg);r.Ba=r.newSelected(e,null==n?void 0:n.selected),r.Xf=r.newHovered(e,null==n?void 0:n.hovered);var u=null==n?void 0:n.on;if(null!=u)for(var s in u){var h=u[s];h&&r.on(s,h)}return r.Kf=function(t){r.onMove(t)},r.Yf=function(t){r.onClick(t)},r}return B(n,t),n.prototype.newSelected=function(t,n){return new Xg(this.toSubOptions(t,n,ht.ACTIVE))},n.prototype.newHovered=function(t,n){return new Xg(this.toSubOptions(t,n,ht.HOVERED))},n.prototype.toSubOptions=function(t,n,i){null==(n=n||{}).point&&(n.point=t),null==n.state&&(n.state=i);var r=n.gridline||{},e=r.x||{};null==e.state&&(e.state=i);var u=r.y||{};null==u.state&&(u.state=i);var s=n.marker||{};return null==s.state&&(s.state=i),n},n.prototype.onClick=function(t){var i=this.xc;if(i&&t.target===i.plotArea){var r=n.WORK_SELECT,e=t.data.global,u=i.calcHitPoint(e.x,e.y,r),s=this.Ba;u?s.set(u,r):s.unset()}},n.prototype.onMove=function(t){var i=this.xc;if(i){var r=this.Xf;if(t.target===i.plotArea){var e=n.WORK_SELECT,u=t.data.global,s=i.calcHitPoint(u.x,u.y,e);s?r.set(s,e):r.unset()}else r.unset()}},n.prototype.bind=function(t){this.xc=t,this.Ba.bind(t),this.Xf.bind(t);var n=t.plotArea;n.on(Ki.move,this.Kf),n.on(Ki.tap,this.Yf)},n.prototype.unbind=function(){var t=this.xc;this.xc=null,t&&t.plotArea.off(Ki.move,this.Kf),this.Ba.unbind(),this.Xf.unbind()},Object.defineProperty(n.prototype,"selected",{get:function(){return this.Ba},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"hovered",{get:function(){return this.Xf},enumerable:!1,configurable:!0}),n.prototype.update=function(){var t=this.Ba.update(),n=this.Xf.update();if(t||n){var i=this.xc;null!=i&&rt.update(i.plotArea)}},n.prototype.onRender=function(){this.Ba.update(),this.Xf.update()},n.WORK_SELECT=new Ng,n}(t.utils.EventEmitter),Yg=function(){function t(t,n){var i,r;this.O=t,this.Jf=null!==(i=null==n?void 0:n.x)&&void 0!==i?i:0,this.Zf=null!==(r=null==n?void 0:n.y)&&void 0!==r?r:0,this.qf=NaN,this.Qf=NaN,this.$f=NaN,this.tl=NaN}return Object.defineProperty(t.prototype,"x",{get:function(){var t=this.O.container;return t?t.plotArea.coordinate.x.get(this.Jf):null},set:function(t){var n=this.toIndexX(t);this.Jf!==n&&(this.Jf=n,this.qf=NaN,this.$f=NaN)},enumerable:!1,configurable:!0}),t.prototype.toIndexX=function(t){if(mn(t))return t;if(null!=t){var n=this.O.container;if(n)return n.plotArea.coordinate.x.indexOf(t)}return-1},Object.defineProperty(t.prototype,"y",{get:function(){var t=this.O.container;return t?t.plotArea.coordinate.y.get(this.Zf):null},set:function(t){var n=this.toIndexY(t);this.Zf!==n&&(this.Zf=n,this.Qf=NaN,this.tl=NaN)},enumerable:!1,configurable:!0}),t.prototype.toIndexY=function(t){if(mn(t))return t;if(null!=t){var n=this.O.container;if(n)return n.plotArea.coordinate.y.indexOf(t)}return-1},t.prototype.isDirty=function(t,n){var i=t.id,r=n.id,e=i!==this.qf,u=r!==this.Qf;return this.qf=i,this.Qf=r,e||u},t.prototype.isTransformDirty=function(t,n){var i=t.transform.id,r=n.transform.id,e=i!==this.$f,u=r!==this.tl;return this.$f=i,this.tl=r,e||u},t.prototype.reset=function(){this.qf=NaN,this.Qf=NaN},t.prototype.destroy=function(){this.reset()},t}(),Jg=function(t){function n(n){var i=t.call(this)||this;i.Ff=new Yg(i,null==n?void 0:n.coordinate),i.Qe=0,i.Rf=new Og(NaN,NaN),i.Lf=new Og(NaN,NaN),i.nl=NaN,i.il=!0,i.Mt=new ft((function(t,n){i.onStateChange(t,n)}));var r=null==n?void 0:n.on;if(null!=r)for(var e in r){var u=r[e];u&&i.on(e,u)}return i}return B(n,t),n.prototype.bind=function(t,n){this.xc=t,this.Ff.reset(),this.Qe=n;var i=t.plotArea.chart;return i&&(this.Mt.parent=i.state),this},n.prototype.unbind=function(){return this.xc=void 0,this},Object.defineProperty(n.prototype,"domain",{get:function(){return this.updateRegion(),this.Rf},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"range",{get:function(){return this.updateRegion(),this.Lf},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"container",{get:function(){return this.xc||null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"index",{get:function(){return this.Qe},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"coordinate",{get:function(){return this.Ff},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"state",{get:function(){return this.Mt},enumerable:!1,configurable:!0}),n.prototype.show=function(){return!0!==this.il&&(this.il=!0,this.onShow()),this},n.prototype.onShow=function(){var t=this.shape;null!=t&&(t.visible=!0)},n.prototype.isShown=function(){return this.il},n.prototype.hide=function(){return!1!==this.il&&(this.il=!1,this.onHide()),this},n.prototype.onHide=function(){var t=this.shape;null!=t&&(t.visible=!1)},n.prototype.isHidden=function(){return!this.il},n.prototype.destroy=function(){return this.xc=void 0,this.Ff.destroy(),this},n.prototype.hitTest=function(t,n){return!1},n.prototype.calcHitPoint=function(t,n,i){return!1},n.prototype.onStateChange=function(t,n){var i;this.toDirty();var r=null===(i=this.xc)||void 0===i?void 0:i.plotArea.chart;rt.update(r),this.emit("statechange",t,n,this)},n}(t.utils.EventEmitter),Zg=function(n){function i(t){var i=n.call(this,t)||this;return i.rl=null,i.kn=t,i.gt=t&&t.points||[],i.el=0,i.ul=NaN,i}return B(i,n),i.prototype.getSizeDefault=function(){return 10},i.prototype.getOffsetDefault=function(){return 0},i.prototype.bind=function(t,i){var r=this.rl;if(!r){(r=this.rl=this.newLineOfAny()).visible=this.il;var e=this.kn;this.initLine(r,e,t,i)}return r.attach(t.plotArea.container,i),this.ul=NaN,n.prototype.bind.call(this,t,i),this},i.prototype.initLine=function(t,n,i,r){var e=i.newFill(r,null==n?void 0:n.fill);this.C=e,t.fill.copy(e);var u=i.newStroke(r,null==n?void 0:n.stroke);this.mo=u,t.stroke.copy(u);var s=this.getSizeDefault(),h=i.newSize(r,null==n?void 0:n.size,s,s);this.j=h,t.points.size.set(h.x,h.y);var o=this.getOffsetDefault(),a=i.newOffset(r,n&&n.offset,o,o);this.rn=a,t.points.offset.set(a.x,a.y)},i.prototype.unbind=function(){var t=this.rl;return t&&t.detach(),n.prototype.unbind.call(this),this},Object.defineProperty(i.prototype,"shape",{get:function(){return this.rl},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"points",{get:function(){return this.gt},set:function(t){this.gt=t,this.el+=1},enumerable:!1,configurable:!0}),i.prototype.toDirty=function(){return this.el+=1,this},i.prototype.update=function(){var t=this.rl;if(t){var n=this.Ff,i=n.x,r=n.y;if(i&&r){var e=this.el,u=e!==this.ul,s=n.isDirty(i,r),h=n.isTransformDirty(i,r);(u||s||h)&&(this.ul=e,this.updateLine(t,i,r))}}return this},i.prototype.updateLine=function(t,n,r){for(var e=t.points.values,u=e.length,s=0,h=this.gt,o=NaN,a=NaN,c=NaN,f=NaN,l=0,v=h.length;l<v;l+=2){var b=h[l],d=h[l+1];null!=b&&null!=d&&(s<u?(e[s]=b,e[s+1]=d):e.push(b,d),s+=2,o!=o?(o=b,a=b,c=d,f=d):(o=Math.min(o,b),a=Math.max(a,b),c=Math.min(c,d),f=Math.max(f,d)))}e.length!==s&&(e.length=s),n.mapAll(e,0,s,2,0),r.mapAll(e,0,s,2,1),n.transform.mapAll(e,0,s,2,0),r.transform.mapAll(e,0,s,2,1),o!=o&&(o=0,a=0,c=0,f=0);var g=i.WORK_REGION||{xmin:0,xmax:0,ymin:0,ymax:0};i.WORK_REGION=g,this.adjustLineRegion(o,a,c,f,g),o=n.transform.map(n.map(g.xmin)),a=n.transform.map(n.map(g.xmax)),c=r.transform.map(r.map(g.ymin)),f=r.transform.map(r.map(g.ymax));var m=Math.abs(a-o),w=Math.abs(f-c),O=.5*(o+a),p=.5*(c+f);for(l=0,v=e.length;l<v;l+=2)e[l+0]-=O,e[l+1]-=p;t.disallowUploadedUpdate(),this.applyLine(t,n,r,m,w,O,p,e),t.allowUploadedUpdate(),rt.update(t)},i.prototype.adjustLineRegion=function(t,n,i,r,e){return e.xmin=t,e.xmax=n,e.ymin=i,e.ymax=r,e},i.prototype.applyLine=function(t,n,i,r,e,u,s,h){t.points.set(h),t.size.set(r,e),t.transform.position.set(u,s)},i.prototype.updateRegion=function(){var t=this.el;if(this.nl!==t){this.nl=t;var n=this.gt,i=this.Rf,r=this.Lf;i.clear(),r.clear(),this.calcRegion(n,i,r)}},i.prototype.calcRegion=function(t,n,i){for(var r=0,e=t.length;r<e;r+=2){var u=t[r];null!=u&&n.add(u,u);var s=t[r+1];null!=s&&i.add(s,s)}},i.prototype.destroy=function(){var t=this.rl;return t&&(this.rl=null,t.detach(),t.destroy()),this.gt.length=0,this.el=0,this.ul=NaN,n.prototype.destroy.call(this),this},i.prototype.hitTest=function(t,n){var r=this.rl;if(r){var e=i.WORK;return e.set(t,n),r.toLocal(e,void 0,e),null!=r.contains(e.x,e.y)}return!1},i.prototype.calcHitPoint=function(t,n,r){var e=this.rl;if(e){var u=i.WORK;return u.set(t,n),e.toLocal(u,void 0,u),r.shape=e,e.calcHitPoint(u.x,u.y,null,this.calcHitPointTestRange,this.calcHitPointHitTester,r)}return!1},i.prototype.calcHitPointTestRange=function(t,n,i,r,e,u,s,h,o){for(var a=$v(h,t+i+e,2,0),c=0,f=a-1,l=f<<1;0<=f;f-=1,l-=2)if(h[l]<=t-i){c=f;break}return o[0]=c,o[1]=c!==a?a:Math.min(h.length<<1,a+1),o},i.prototype.calcHitPointHitTester=function(t,n,i,r,e,u,s,h,o,a,c,f,l,v){var b=v.shape;if(b.containsPointAbs(t,n,i,r,e,u,s,h,o,a,c)){var d=b.transform,g=d.position,m=d.scale;v.x=v.p0x=v.p1x=g.x+m.x*s,v.y=v.p0y=v.p1y=g.y+m.y*h,v.t=l,v.index=f;var w=t-(s+e),O=n-(h+u);return v.distance=Math.sqrt(w*w+O*O),!0}return!1},i.WORK=new t.Point,i}(Jg),qg=function(t){function n(n){var i=t.call(this,n)||this;return i.sl=-1,i.hl=-1,i.ol=-1,i.al=-1,i.cl=!1!==(n&&n.size&&n.size.auto),i}return B(n,t),n.prototype.bind=function(n,i){return this.sl=-1,this.hl=-1,this.ol=-1,this.al=-1,t.prototype.bind.call(this,n,i),this},n.prototype.initLine=function(n,i,r,e){t.prototype.initLine.call(this,n,i,r,e),this.zn=r.newPadding(e,i&&i.padding)},n.prototype.newLineOfAny=function(){return new bf},n.prototype.getSizeDefault=function(){return 1},n.prototype.adjustLineRegion=function(n,i,r,e,u){return t.prototype.adjustLineRegion.call(this,n,i,Math.min(0,r),Math.max(0,e),u)},n.prototype.updateBarCountAndIndex=function(){if(this.hl<0||this.sl<0){var t=0,i=0,r=this.xc;if(r)for(var e=0,u=r.size();e<u;++e){var s=r.get(e);s===this&&(t=i),s instanceof n&&(i+=1)}return i=Math.max(1,i),this.sl=i,this.hl=t,!0}return!1},n.prototype.applyLine=function(n,i,r,e,u,s,h,o){var a=n.points,c=a.offset,f=a.size,l=this.j,v=this.rn,b=this.zn;if(l&&v&&b){var d=i.id,g=i.transform.id;if(this.updateBarCountAndIndex()||this.ol!==d||this.al!==g){var m=this.sl,w=this.hl;this.ol=d,this.al=g;var O=i.transform.map(i.map(0)),p=i.transform.map(i.map(l.x)),D=Math.abs(O-p)*(1-b.outer);if(m<=1)c.x=v.x,f.x=D;else{var E=D*(1-b.inner),M=E/m,S=M*(w+.5)+w*((D-E)/(m-1));c.x=v.x+S-.5*D,f.x=M}}}var T=f.y;Rt(T)||(T=[]);var j=T.length,N=c.y;Rt(N)||(N=[]);for(var I=N.length,C=0,A=r.transform.map(r.map(0))-h,R=0,L=o.length;R<L;R+=2,C+=1){var y=o[R+1]-A,k=Math.abs(y);C<j?T[C]=k:T.push(k);var x=-.5*y;C<I?N[C]=x:N.push(x)}T.length!==C&&(T.length=C),N.length!==C&&(N.length=C),c.y=N,f.y=T,t.prototype.applyLine.call(this,n,i,r,e,u,s,h,o)},n.prototype.calcSizeX=function(t){var n=this.gt;if(2<n.length)for(var i=n.length,r=n[i-2],e=i-4;0<=e;e-=2){var u=n[e];if(null!=r&&null!=u)return Math.abs(r-u);r=u}return t},n.prototype.calcRegion=function(n,i,r){t.prototype.calcRegion.call(this,n,i,r);var e=this.j;if(e){var u=e.x;this.cl&&(u=this.calcSizeX(u),e.x=u);var s=.5*u;i.set(i.from-s,i.to+s)}r.add(0,0)},n}(Zg),Qg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.newLineOfAny=function(){return new ef},n}(Zg),$g=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.newLineOfAny=function(){return new af},n}(Zg),tm=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.newLineOfAny=function(){return new bf},n}(Zg),nm=function(t){function n(n){var i=t.call(this,n)||this;return i.fl=0,i}return B(n,t),n.prototype.newLineOfAny=function(){return new Bf},n.prototype.applyLine=function(n,i,r,e,u,s,h,o){var a=this.j,c=this.rn;a&&c&&this.fl!==a.y&&(this.fl=a.y,n.points.offset.y=c.y-.2*a.y),t.prototype.applyLine.call(this,n,i,r,e,u,s,h,o)},n}(Zg),im=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.newLineOfAny=function(){return new Af},n}(nm),rm=function(n){function i(t){var i,r=this;return(r=n.call(this,t)||this).rl=null,r.kn=t,r.gt=null!==(i=null==t?void 0:t.points)&&void 0!==i?i:[],r.el=0,r.ul=NaN,r.ll=0,r.vl=0,r}return B(i,n),i.prototype.bind=function(t,i){var r,e=this.rl;if(!e){var u=t.newStroke(i,null===(r=this.kn)||void 0===r?void 0:r.stroke);this.mo=u,(e=new yc).stroke.copy(u),e.visible=this.il,this.rl=e}return e.attach(t.plotArea.container,i),this.ul=NaN,n.prototype.bind.call(this,t,i),this},i.prototype.unbind=function(){var t=this.rl;return t&&t.detach(),n.prototype.unbind.call(this),this},Object.defineProperty(i.prototype,"shape",{get:function(){return this.rl},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"points",{get:function(){return this.gt},set:function(t){this.gt=t,this.el+=1},enumerable:!1,configurable:!0}),i.prototype.toDirty=function(){return this.el+=1,this},i.prototype.update=function(){var t=this.rl;if(t){var n=this.Ff,i=n.x,r=n.y;if(i&&r){var e=this.el,u=e!==this.ul,s=n.isDirty(i,r),h=n.isTransformDirty(i,r);(u||s||h)&&(this.ul=e,this.updateLine(t,i,r,u||s))}}return this},i.prototype.updateLine=function(t,n,i,r){if(t.disallowUploadedUpdate(),r){for(var e=t.points.values,u=t.points.segments,s=e.length,h=u.length,o=0,a=0,c=this.gt,f=NaN,l=NaN,v=NaN,b=NaN,d=0,g=c.length;d<g;d+=2){var m=c[d],w=c[d+1];if(null!=m&&null!=w)o<s?(e[o]=m,e[o+1]=w):e.push(m,w),o+=2,f!=f?(f=m,l=m,v=w,b=w):(f=Math.min(f,m),l=Math.max(l,m),v=Math.min(v,w),b=Math.max(b,w));else{var O=(d>>1)-a;a<h?u[a]=O:u.push(O),a+=1}}e.length!==o&&(e.length=o),u.length!==a&&(u.length=a),n.mapAll(e,0,o,2,0),i.mapAll(e,0,o,2,1),f!=f&&(f=0,l=0,v=0,b=0),f=n.map(f),l=n.map(l),v=i.map(v),b=i.map(b);var p=Math.abs(l-f),D=Math.abs(b-v),E=.5*(f+l),M=.5*(v+b);for(d=0,g=e.length;d<g;d+=2)e[d+0]-=E,e[d+1]-=M;t.size.set(p,D),t.points.set(e,u),this.ll=E,this.vl=M}t.transform.position.set(n.transform.map(this.ll),i.transform.map(this.vl)),t.transform.scale.set(n.transform.scale,i.transform.scale),t.allowUploadedUpdate(),rt.update(t)},i.prototype.updateRegion=function(){var t=this.el;if(this.nl!==t){this.nl=t;var n=this.gt,i=this.Rf,r=this.Lf;if(i.clear(),r.clear(),null!=n)for(var e=0,u=n.length;e<u;e+=2){var s=n[e];null!=s&&i.add(s,s);var h=n[e+1];null!=h&&r.add(h,h)}}},i.prototype.destroy=function(){var t=this.rl;return t&&(this.rl=null,t.detach(),t.destroy()),this.gt.length=0,this.el=0,this.ul=NaN,n.prototype.destroy.call(this),this},i.prototype.hitTest=function(t,n){var r=this.rl;if(r){var e=i.WORK;return e.set(t,n),r.toLocal(e,void 0,e),null!=r.contains(e.x,e.y)}return!1},i.prototype.calcHitPoint=function(t,n,r){var e=this.rl;if(e){var u=i.WORK;return u.set(t,n),e.toLocal(u,void 0,u),r.shape=e,e.calcHitPoint(u.x,u.y,this.toThreshold,this.calcHitPointTestRange,this.calcHitPointHitTester,r)}return!1},i.prototype.toThreshold=function(t,n){return 1/0},i.prototype.calcHitPointTestRange=function(t,n,i,r,e){var u=$v(r,t,2,0);return e[0]=Math.max(0,u-1),e[1]=u,e},i.prototype.calcHitPointHitTester=function(t,n,i,r,e,u,s,h,o){if(i<=t&&t<e){var a=e-i;if(1e-4<Math.abs(a)){var c=(t-i)/a,f=t,l=r+c*(u-r),v=Math.abs(l-n);if(v<h){var b=o.shape.transform,d=b.position,g=d.x,m=d.y,w=b.scale,O=w.x,p=w.y;return o.x=g+O*f,o.y=m+p*l,o.p0x=g+O*i,o.p0y=m+p*r,o.p1x=g+O*e,o.p1y=m+p*u,o.t=c,o.index=s,o.distance=v,!0}}}return!1},i.WORK=new t.Point,i}(Jg),em=function(){function t(t,n,i,r){this.R=0,this.bl=NaN,this._a=t,this._b=n,this._x0=i,this._y0=r}return Object.defineProperty(t.prototype,"a",{get:function(){return this._a},set:function(t){this._a!==t&&(this.R+=1,this._a=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"b",{get:function(){return this._b},set:function(t){this._b!==t&&(this.R+=1,this._b=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"x0",{get:function(){return this._x0},set:function(t){this._x0!==t&&(this.R+=1,this._x0=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y0",{get:function(){return this._y0},set:function(t){this._y0!==t&&(this.R+=1,this._y0=t)},enumerable:!1,configurable:!0}),t.prototype.toDirty=function(){this.R+=1},t.prototype.isDirty=function(){return this.R!==this.bl},t.prototype.toClean=function(){this.bl=this.R},t.from=function(n){var i,r,e,u;return new t(null!==(i=null==n?void 0:n.a)&&void 0!==i?i:1,null!==(r=null==n?void 0:n.b)&&void 0!==r?r:1,null!==(e=null==n?void 0:n.x0)&&void 0!==e?e:0,null!==(u=null==n?void 0:n.y0)&&void 0!==u?u:0)},t}(),um=function(n){function i(t){var i=n.call(this,t)||this;return i.rl=null,i.kn=t,i.dl=NaN,i.ml=NaN,i.wl=em.from(t),i}return B(i,n),i.prototype.bind=function(t,i){var r,e=this.rl;if(!e){var u=t.newStroke(i,null===(r=this.kn)||void 0===r?void 0:r.stroke);this.mo=u,(e=new yc).stroke.copy(u),e.visible=this.il,this.rl=e}return e.attach(t.plotArea.container,i),this.wl.toDirty(),this.dl=NaN,this.ml=NaN,n.prototype.bind.call(this,t,i),this},i.prototype.unbind=function(){var t=this.rl;return t&&t.detach(),n.prototype.unbind.call(this),this},Object.defineProperty(i.prototype,"shape",{get:function(){return this.rl},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"parameters",{get:function(){return this.wl},enumerable:!1,configurable:!0}),i.prototype.toDirty=function(){return this.wl.toDirty(),this},i.prototype.update=function(){var t=this.rl,n=this.xc;if(t&&n){var i=n.plotArea,r=this.Ff,e=r.x,u=r.y;if(e&&u){var s=i.width,h=i.height,o=this.wl,a=o.isDirty(),c=r.isDirty(e,u),f=r.isTransformDirty(e,u),l=s!==this.dl||h!==this.ml;(a||c||f||l)&&(o.toClean(),this.dl=s,this.ml=h,this.updateLine(t,e,u,s,h))}}return this},i.prototype.updateLine=function(t,n,i,r,e){var u=t.points.values,s=t.points.segments,h=this.wl,o=h.a,a=h.b,c=h.x0,f=h.y0,l=Math.abs(o),v=Math.abs(a),b=NaN,d=NaN,g=NaN,m=NaN,w=1e-5;if(v<=l){var O=n.unmap(n.transform.unmap(0)),p=n.unmap(n.transform.unmap(r));b=Math.min(O,p),g=Math.max(O,p);var D=i.unmap(i.transform.unmap(0)),E=i.unmap(i.transform.unmap(e));if(d=Math.min(D,E),m=Math.max(D,E),w<v){var M=(N=a/o)*(D-f)+c,S=N*(E-f)+c,T=Math.min(M,S),j=Math.max(M,S);d=(I=1/N)*((b=Math.max(b,T))-c)+a*f,m=I*((g=Math.min(g,j))-c)+a*f}else b=c,g=c}else if(D=i.unmap(i.transform.unmap(0)),E=i.unmap(i.transform.unmap(e)),d=Math.min(D,E),m=Math.max(D,E),O=n.unmap(n.transform.unmap(0)),p=n.unmap(n.transform.unmap(r)),b=Math.min(O,p),g=Math.max(O,p),w<l){var N,I,C=(N=o/a)*(O-c)+f,A=N*(p-c)+f,R=Math.min(C,A),L=Math.max(C,A);b=(I=1/N)*((d=Math.max(d,R))-f)+o*c,g=I*((m=Math.min(m,L))-f)+o*c}else d=f,m=f;b=n.transform.map(n.map(b)),d=i.transform.map(i.map(d));var y=.5*(b+(g=n.transform.map(n.map(g)))),k=.5*(d+(m=i.transform.map(i.map(m)))),x=Math.abs(g-b),B=Math.abs(m-d);b-=y,d-=k,g-=y,m-=k,4!==u.length?(u.length=0,u.push(b,d,g,m)):(u[0]=b,u[1]=d,u[2]=g,u[3]=m),0<s.length&&(s.length=0),t.disallowUploadedUpdate(),t.points.set(u,s),t.size.set(x,B),t.points.toFitted(),t.transform.position.set(y,k),t.allowUploadedUpdate(),rt.update(t)},i.prototype.updateRegion=function(){},i.prototype.destroy=function(){var t=this.rl;return t&&(this.rl=null,t.detach(),t.destroy()),n.prototype.destroy.call(this),this},i.prototype.hitTest=function(t,n){var r=this.rl;if(r){var e=i.WORK;return e.set(t,n),r.toLocal(e,void 0,e),null!=r.contains(e.x,e.y)}return!1},i.prototype.calcHitPoint=function(t,n,r){var e=this.rl;if(e){var u=i.WORK;return u.set(t,n),e.toLocal(u,void 0,u),r.shape=e,e.calcHitPoint(u.x,u.y,this.toThreshold,null,this.calcHitPointHitTester,r)}return!1},i.prototype.toThreshold=function(t,n){return 1/0},i.prototype.calcHitPointHitTester=function(t,n,i,r,e,u,s,h,o){if(i<=t&&t<e){var a=e-i;if(1e-4<Math.abs(a)){var c=(t-i)/a,f=t,l=r+c*(u-r),v=Math.abs(l-n);if(v<h){var b=o.shape.transform,d=b.position,g=d.x,m=d.y,w=b.scale,O=w.x,p=w.y;return o.x=o.p0x=o.p1x=g+O*f,o.y=o.p0y=o.p1y=m+p*l,o.t=c,o.index=s,o.distance=v,!0}}}return!1},i.WORK=new t.Point,i}(Jg),sm=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.init=function(n){var i;t.prototype.init.call(this,n);var r=this.plotArea;this.addChild(r),(null!==(i=null==n?void 0:n.mask)&&void 0!==i?i:this.theme.isOverflowMaskEnabled())&&(r.axis.container.mask=this.getOverflowMask())},n.prototype.getOverflowMask=function(){return null==this.er&&(this.er=new $i(this),this.reflowable.add(this.er),this.toDirty()),this.er},Object.defineProperty(n.prototype,"plotArea",{get:function(){var t=this.Mf;return null==t&&(t=this.newPlotArea(),this.Mf=t),t},enumerable:!1,configurable:!0}),n.prototype.newPlotArea=function(){var t;return new Pg(this,null===(t=this.kn)||void 0===t?void 0:t.plotArea)},n.prototype.getType=function(){return"DChart"},n.prototype.destroy=function(){var n;this._destroyed||(null===(n=this.Mf)||void 0===n||n.destroy(),t.prototype.destroy.call(this))},n}(Qi),hm=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.isStorable=function(){return!1},n.prototype.isClear=function(){return!0},n}(pb),om=function(t){function n(n){var i=t.call(this)||this;return i.Rr=n,i}return B(n,t),Object.defineProperty(n.prototype,"name",{get:function(){return this.Rr},enumerable:!1,configurable:!0}),n.prototype.isStorable=function(){return!1},n.prototype.execute=function(){return Sb.getDocumentController().saveAs(this.Rr),!0},n}(pb),am=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.isStorable=function(){return!1},n.prototype.execute=function(){return Sb.getDocumentController().save(),!0},n}(pb),cm=function(t){function n(n,i){var r=t.call(this)||this;r.O=n;var e=null==i?void 0:i.on;if(e)for(var u in e){var s=e[u];s&&r.on(u,s)}return r}return B(n,t),n.prototype.createAsUrl=function(t){return null==t||mn(t)?this.create({size:t,extractor:function(t){return sb.base64({target:t})}}):this.create({size:t.size,cleanup:t.cleanup,extractor:function(t){return sb.base64({target:t})}})},n.prototype.createAsFile=function(t,n){at(t)?this.create({extractor:function(n){sb.file({target:n,filename:t})}}):null===t||mn(t)?this.create({size:t,extractor:function(t){sb.file({target:t,filename:n})}}):this.create({size:t.size,cleanup:t.cleanup,extractor:function(n){sb.file({target:n,filename:t.filename})}})},n.prototype.toScale=function(t,n){return null==t?1:t/rt.getResolution(n)/Math.max(n.width,n.height)},n.prototype.toCleanupSnap=function(t){if(null==t)return!0;var n=t.cleanup;return null==n||!0===n||!1!==n&&!1!==n.snap},n.prototype.toCleanupBackground=function(t){if(null==t)return!1;var n=t.cleanup;return null!=n&&!1!==n&&(!0===n||!0===n.background)},n.prototype.toCleanupReflow=function(t){if(null==t)return!0;var n=t.cleanup;return null==n||!0===n||!1!==n&&!1!==n.reflow},n.prototype.create=function(t){var n=this.O,i=n.canvas;if(i){var r=n.view,e=r.position,u=r.scale,s=e.x,h=e.y,o=u.x,a=u.y,c=this.toScale(t.size,i);r.transform(0,0,c,c,0);var f=void 0;if(this.toCleanupSnap(t)&&"snap"in i){var l=i.snap;null!=l&&((f=l.container).renderable?f.renderable=!1:f=void 0)}var v=void 0;if(this.toCleanupBackground(t)&&((v=i.snippet).renderable?v.renderable=!1:v=void 0),this.toCleanupReflow(t)){var b=rt.getLayer(i);b&&b.reflow()}this.emit("taking",i,this);var d=t.extractor(i);return this.emit("took",i,null,this),v&&(v.renderable=!0),null!=f&&(f.renderable=!0),r.transform(s,h,o,a,0),d}},n}(t.utils.EventEmitter),fm=function(t){function n(n){var i,r=this;return(r=t.call(this,n)||this).Ol=null,r.pl=null==n?void 0:n.tile,r.Dl=null==n?void 0:n.controller,r.El=null!==(i=null==n?void 0:n.ambient)&&void 0!==i?i:r.theme.isAmbient(),r.Ml=new cm(r,null==n?void 0:n.snapshot),r.Cr=r.toMode(n),r}return B(n,t),Object.defineProperty(n.prototype,"snapshot",{get:function(){return this.Ml},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"controller",{get:function(){return this.Dl||null},enumerable:!1,configurable:!0}),n.prototype.set=function(t){var n=this,i=this.Ol;if(i!==t){if(i&&(this.Ol=null,this.canvas&&(this.canvas=null),this.onUnset()),this.Ol=t,t){var r=this.newCanvas(t),e=t.pieces,u=this.Cr,s=Ue.toPieceData(this.Dl,e,u).then((function(i){return n.newLayer(t,r,u,e,i)}));return this.onSet(t,r),this.canvas=r,s}return Promise.resolve(null)}return Promise.resolve(this.canvas)},n.prototype.onSet=function(t,n){},n.prototype.newLayer=function(t,n,i,r,e){var u=this,s=new dr(t,r,e,i,0),h=Ue.newLayer(t,n.layer,s).then((function(t){return u.initLayer(n,t)}));if(this.El){var o=this.toCanvasBaseBackgroundOptions(t,this.theme,!1);this.background.color=o.color,this.background.alpha=o.alpha}return h},n.prototype.initLayer=function(t,n,i){return t.layer.init(),t.initialize(n,i),rt.update(this),this.emit("ready",this),t},n.prototype.toCanvasBaseOptions=function(t){var n,i=this.theme,r=this.El;return{name:t.name,width:t.width,height:t.height,background:this.toCanvasBaseBackgroundOptions(t,i,r),border:r?{color:null}:void 0,outline:r?{color:null}:void 0,shadow:r?null:i.getCanvasShadow(),tile:{factory:this.pl,mapping:null===(n=t.tile)||void 0===n?void 0:n.mapping},ambient:r}},n.prototype.toCanvasBaseBackgroundOptions=function(t,n,i){var r,e;if(i)return{color:null};var u=t.background;return{color:null!==(r=null==u?void 0:u.color)&&void 0!==r?r:n.getCanvasBackgroundColor(),alpha:null!==(e=null==u?void 0:u.alpha)&&void 0!==e?e:n.getCanvasBackgroundAlpha()}},n.prototype.onUnset=function(){},n.prototype.get=function(){return this.Ol},Object.defineProperty(n.prototype,"layer",{get:function(){var t=this.canvas;return t?t.layer.active:null},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DDiagramBase"},n}(lr),lm=function(){function t(t,n){this.Jn=t,this.Ir=n}return t.prototype.getTheme=function(){return this.Jn.getTheme()},t.prototype.setTheme=function(t){this.Jn.setTheme(t)},t.prototype.getBaseColor=function(){return this.Ir},t.prototype.setBaseColor=function(t){this.Ir=t},t.prototype.getColor=function(t){var n=this.Jn,i=this.Ir,r=n.getColor(t);return null!=i?null!=r?Qt.blend(i,r,n.getAlpha(t)):i:r},Object.defineProperty(t.prototype,"color",{get:function(){return this.Jn.color},set:function(t){this.Jn.color=t},enumerable:!1,configurable:!0}),t.prototype.getAlpha=function(t){return null!=this.Ir?1:this.Jn.getAlpha(t)},Object.defineProperty(t.prototype,"alpha",{get:function(){return this.Jn.alpha},set:function(t){this.Jn.alpha=t},enumerable:!1,configurable:!0}),t}(),vm=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),Object.defineProperty(n.prototype,"lon",{get:function(){return this.x},set:function(t){this.x=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"lat",{get:function(){return this.y},set:function(t){this.y=t},enumerable:!1,configurable:!0}),n.prototype.toObject=function(){return{lon:this.x,lat:this.y}},n}(t.ObservablePoint),bm=function(){function t(t,n,i,r,e,u){if(this.Sl=t,!0===n||!1===n)this.p=n,this.It=new vm(t,null,i,r),this.Ct=new vm(t,null,e,u);else if(null!=n){this.p=n.enable;var s=n.from,h=n.to;this.It=new vm(t,null,s.lon,s.lat),this.Ct=new vm(t,null,h.lon,h.lat)}else this.p=!1,this.It=new vm(t,null,-180,85.05112877980659),this.Ct=new vm(t,null,180,-85.05112877980659)}return Object.defineProperty(t.prototype,"enable",{get:function(){return this.p},set:function(t){this.p!==t&&(this.p=t,this.Sl())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"from",{get:function(){return this.It},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"to",{get:function(){return this.Ct},enumerable:!1,configurable:!0}),t.prototype.serialize=function(){return{enable:this.p,from:this.It.toObject(),to:this.Ct.toObject()}},t}(),dm=function(){function t(t,n){var i=this;this.ir=t,this.Tl=null==n?void 0:n.factory,this.Gt=new bm((function(){i.onMappingChange()}),null==n?void 0:n.mapping)}return t.prototype.init=function(){this.onMappingChange()},t.prototype.onMappingChange=function(){var t=this.Tl;if(t){var n,i=this.Gt;i.enable?(n=this.jl)?n.mapping=i:this.jl=t(this.ir).fit():(n=this.jl)&&(this.jl=void 0,n.destroy())}},Object.defineProperty(t.prototype,"pyramid",{get:function(){return this.jl},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"factory",{get:function(){return this.Tl},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mapping",{get:function(){return this.Gt},enumerable:!1,configurable:!0}),t.prototype.serialize=function(){return{mapping:this.Gt.serialize()}},t.prototype.destroy=function(){var t=this.jl;null!=t&&(this.jl=void 0,t.destroy())},t}(),gm=function(t){function n(n,i){var r=t.call(this)||this;return r.dh=null,r.St=n,r.cn=i,r.interactive=!1,r.interactiveChildren=!1,r}return B(n,t),n.prototype.init=function(){if(null==this.dh){var t=this.children,n=t.length;0<n&&(this.dh=t[n-1])}},Object.defineProperty(n.prototype,"active",{get:function(){return this.dh},set:function(t){this.dh!==t&&(null==t||0<=this.children.indexOf(t))&&(this.dh=t,this.onLayerChange())},enumerable:!1,configurable:!0}),n.prototype.create=function(t,n){var i=new $e(t);return this.attach(i,n),i},n.prototype.attach=function(t,n){this.addChild(t),!0===n&&(this.dh=t),this.onLayerChange(),rt.update(this)},n.prototype.attachAt=function(t,n,i){this.addChildAt(t,n),!0===i&&(this.dh=t),this.onLayerChange(),rt.update(this)},n.prototype.detach=function(t,n){var i=this.children,r=i.indexOf(t);0<=r&&(this.dh=n,i.splice(r,1),t.parent=void 0,this.onLayerChange(),rt.update(this))},n.prototype.delete=function(t,n){var i=this.children,r=i.indexOf(t);return 0<=r&&(i.splice(r,1),t.parent=void 0,this.dh===t&&(!0===n?r<i.length?this.dh=i[r]:0<i.length?this.dh=i[r-1]:this.dh=null:this.dh=null),this.onLayerChange(),rt.update(this)),r},n.prototype.get=function(t){var n=this.children[t];return null!=n?n:null},n.prototype.clear=function(){var t=this.children;if(0<t.length){for(var n=t.length-1;0<=n;--n){var i=t[n];i.parent=null,i.destroy()}t.length=0,this.onLayerChange(),rt.update(this)}},n.prototype.destroy=function(){this._destroyed||(this.clear(),t.prototype.destroy.call(this))},n.prototype.size=function(){return this.children.length},n.prototype.onLayerChange=function(){this.emit("change",this)},n.prototype.serialize=function(t,n){for(var i=[],r=this.children,e=0,u=r.length;e<u;++e)r[e].addUuid(t);for(e=0,u=r.length;e<u;++e)r[e].updateUuid(t);for(e=0,u=r.length;e<u;++e)i.push(r[e].serialize(e,t,n));return i},n.prototype.deserialize=function(t,n){var i=t.length;if(0<i){for(var r=this.St,e=this.cn,u=0;u<i;++u)this.addChild($e.deserialize(t[u],n,r,e));this.onLayerChange(),rt.update(this)}},n}(t.Container),mm=function(t){function n(n){var i=t.call(this,n)||this,r=i.theme;i.isAmbient(r,n)||(i.Mn=new lm(i.Mn,i.toBackgroundBase(r,n)));var e=new gm(i.width,i.height);i.es=e,i.addChild(e);var u=new dm(i,null==n?void 0:n.tile);return i.Nl=u,u.init(),i}return B(n,t),n.prototype.isAmbient=function(t,n){var i;return null!==(i=null==n?void 0:n.ambient)&&void 0!==i?i:t.isAmbient()},n.prototype.toBackgroundBase=function(t,n){var i,r;return null!==(r=null===(i=null==n?void 0:n.background)||void 0===i?void 0:i.base)&&void 0!==r?r:t.getBackgroundBase()},Object.defineProperty(n.prototype,"tile",{get:function(){return this.Nl},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"layer",{get:function(){return this.es},enumerable:!1,configurable:!0}),n.prototype.initialize=function(t,n){},n.prototype.destroy=function(){this._destroyed||(this.onDestroy(),t.prototype.destroy.call(this))},n.prototype.onDestroy=function(){this.Nl.destroy(),this.es.destroy()},n.prototype.hitTest=function(t,n){for(var i=this.es.children,r=i.length-1;0<=r;--r){var e=i[r];if(e.visible){var u=e.hitTest(t,n);if(null!=u)return u}}return null},n.prototype.getType=function(){return"DDiagramCanvasBase"},n}(Zd),wm=function(){function t(t){this.ir=t}return t.prototype.each=function(t,n){for(var i=this.ir.layer.children,r=0,e=i.length;r<e&&!1!==this.Pc(i[r].children,t,n);++r);return this},t.prototype.Pc=function(t,n,i){for(var r=0,e=t.length;r<e;++r){var u=t[r];if(!1===n(u))return!1;if(i||mr.contains(u,wt.CHILDREN)){var s=u.children;if(0<s.length&&!1===this.Pc(s,n,i))return!1}}},t}(),Om=function(){function t(){}return Object.defineProperty(t.prototype,"private",{get:function(){var t=this.Ht;return null==t&&(t=this.newPrivate(),this.Ht=t),t},enumerable:!1,configurable:!0}),t.prototype.newPrivate=function(){return new Lt},Object.defineProperty(t.prototype,"protected",{get:function(){var t=this.Il;return null==t&&(t=this.newProtected(),this.Il=t),t},enumerable:!1,configurable:!0}),t.prototype.newProtected=function(){return new Lt},Object.defineProperty(t.prototype,"extended",{get:function(){var t=this.Cl;return null==t&&(t=this.newExtended(),this.Cl=t),t},enumerable:!1,configurable:!0}),t.prototype.newExtended=function(){return new Lt},Object.defineProperty(t.prototype,"ids",{get:function(){var t=this.Pt;if(null==t)return[];var n=[];return t.forEach((function(t,i){n.push(i)})),n},enumerable:!1,configurable:!0}),t.prototype.each=function(t){var n=this.Pt;if(null==n)return null;var i=null;return n.forEach((function(n,r){null==i&&!1===t(r)&&(i=r)})),i},t.prototype.add=function(t,n){var i,r=null!==(i=this.Pt)&&void 0!==i?i:this.Pt=new Map,e=r.get(t);null==e?r.set(t,[n]):e.push(n)},t.prototype.set=function(t,n,i,r,e,u){var s=this.Pt;if(null==s)return!1;var h=s.get(t);if(null==h)return!1;var o=h.length;if(o<=0)return!1;for(var a=0;a<o;++a){var c=h[a];c.range.set(e,u),void 0!==i&&(c.time=i),void 0!==r&&(c.state=r),void 0!==n&&(c.value=n)}return!0},t.prototype.get=function(t){var n=this.Pt;if(null==n)return null;var i=n.get(t);return null==i?null:i},t.prototype.clear=function(t){var n=this.Pt;if(null==n)return!1;var i=n.get(t);if(null==i)return!1;var r=i.length;if(r<=0)return!1;for(var e=0;e<r;++e)i[e].clear();return!0},t.prototype.toDirty=function(t){var n=this.Pt;if(null==n)return!1;var i=n.get(t);if(null==i)return!1;var r=i.length;if(r<=0)return!1;for(var e=0;e<r;++e)i[e].toDirty();return!0},t.prototype.setAll=function(t,n,i,r,e,u){var s=this.Pt;if(null==s)return!1;var h=s.get(t);if(null==h)return!1;var o=h.length;if(o<=0)return!1;for(var a=0;a<o;++a){var c=h[a];c.range.set(e,u),void 0!==i&&(c.times=i),void 0!==r&&(c.states=r),void 0!==n&&(c.values=n)}return!0},t.prototype.setValue=function(t,n){var i=this.Pt;if(null==i)return!1;var r=i.get(t);if(null==r)return!1;var e=r.length;if(e<=0)return!1;for(var u=0;u<e;++u)r[u].value=n;return!0},t.prototype.setValues=function(t,n){var i=this.Pt;if(null==i)return!1;var r=i.get(t);if(null==r)return!1;var e=r.length;if(e<=0)return!1;for(var u=0;u<e;++u)r[u].values=n;return!0},t.prototype.setTime=function(t,n){var i=this.Pt;if(null==i)return!1;var r=i.get(t);if(null==r)return!1;var e=r.length;if(e<=0)return!1;for(var u=0;u<e;++u)r[u].time=n;return!0},t.prototype.setTimes=function(t,n){var i=this.Pt;if(null==i)return!1;var r=i.get(t);if(null==r)return!1;var e=r.length;if(e<=0)return!1;for(var u=0;u<e;++u)r[u].times=n;return!0},t.prototype.setState=function(t,n){var i=this.Pt;if(null==i)return!1;var r=i.get(t);if(null==r)return!1;var e=r.length;if(e<=0)return!1;for(var u=0;u<e;++u)r[u].state=n;return!0},t.prototype.setStates=function(t,n){var i=this.Pt;if(null==i)return!1;var r=i.get(t);if(null==r)return!1;var e=r.length;if(e<=0)return!1;for(var u=0;u<e;++u)r[u].states=n;return!0},t.prototype.setRange=function(t,n,i){var r=this.Pt;if(null==r)return!1;var e=r.get(t);if(null==e)return!1;var u=e.length;if(u<=0)return!1;for(var s=0;s<u;++s){var h=e[s].range;void 0!==n&&(null!==n?(h.type|=Et.FROM,h.from=n):h.type&=~Et.FROM),void 0!==i&&(null!==i?(h.type|=Et.TO,h.to=i):h.type&=~Et.TO)}return!0},t}(),pm=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n}(wm),Dm=function(){function t(t,n,i){var r=this;this.O=t;var e=i.controller;this.Dl=e;var u=function(){r.onChange()};e.grid.on("change",u),e.target.on("change",u);var s=new Te;s.visible=!1,this.xc=s,t.addChildAt(s,t.children.length-1),this.Al=this.toGrid(n,i.grid),this.Jn=this.toTarget(n,i.target)}return t.prototype.toGrid=function(t,n){var i;return{major:this.toGridMajor(t,null==n?void 0:n.major),minor:this.toGridMinor(t,null==n?void 0:n.minor),size:null!==(i=null==n?void 0:n.size)&&void 0!==i?i:t.getSnapGridSize()}},t.prototype.toGridMajor=function(t,n){var i,r,e,u,s;return{interval:null!==(i=null==n?void 0:n.interval)&&void 0!==i?i:t.getSnapGridMajorInterval(),color:null!==(r=null==n?void 0:n.color)&&void 0!==r?r:t.getSnapGridMajorColor(),alpha:null!==(e=null==n?void 0:n.alpha)&&void 0!==e?e:t.getSnapGridMajorAlpha(),width:null!==(u=null==n?void 0:n.width)&&void 0!==u?u:t.getSnapGridMajorWidth(),style:null!==(s=null==n?void 0:n.style)&&void 0!==s?s:t.getSnapGridMajorStyle()}},t.prototype.toGridMinor=function(t,n){var i,r,e,u;return{color:null!==(i=null==n?void 0:n.color)&&void 0!==i?i:t.getSnapGridMinorColor(),alpha:null!==(r=null==n?void 0:n.alpha)&&void 0!==r?r:t.getSnapGridMinorAlpha(),width:null!==(e=null==n?void 0:n.width)&&void 0!==e?e:t.getSnapGridMinorWidth(),style:null!==(u=null==n?void 0:n.style)&&void 0!==u?u:t.getSnapGridMinorStyle()}},t.prototype.toTarget=function(t,n){var i,r,e,u;return{color:null!==(i=null==n?void 0:n.color)&&void 0!==i?i:t.getSnapTargetColor(),alpha:null!==(r=null==n?void 0:n.alpha)&&void 0!==r?r:t.getSnapTargetAlpha(),width:null!==(e=null==n?void 0:n.width)&&void 0!==e?e:t.getSnapTargetWidth(),style:null!==(u=null==n?void 0:n.style)&&void 0!==u?u:t.getSnapTargetStyle()}},t.prototype.onChange=function(){var t=this.O;t.toDirty(),rt.update(t)},Object.defineProperty(t.prototype,"container",{get:function(){return this.xc},enumerable:!1,configurable:!0}),t.prototype.serialize=function(){return this.Dl.serialize()},t.prototype.onReflow=function(){var t=this.O,n=this.xc,i=this.Dl,r=i.grid.visible,e=i.target.visible;if(r||e){var u=t.width,s=t.height,h=.5*u,o=.5*s,a=$.TOP,c=$.LEFT,f=n.children,l=0;if(r){for(var v=this.Al,b=v.major,d=v.minor,g=b.interval,m=v.size(i.grid.size,u,s),w=m,O=1;w<u;w+=m,O+=1,l+=1){var p=O%g==0?b:d;this.update(n,f,l,w,o,a,u,s,p)}for(var D=m,E=1;D<s;D+=m,E+=1,l+=1)p=E%g==0?b:d,this.update(n,f,l,h,D,c,u,s,p)}if(e)for(var M=i.target.values,S=this.Jn,T=0,j=M.length;T<j;T+=1,l+=1){var N=M[T],I=N.position;N.type===Bv.VERTICAL?this.update(n,f,l,I,o,a,u,s,S):this.update(n,f,l,h,I,c,u,s,S)}for(T=l,j=f.length;T<j;++T)f[T].visible=!1;n.visible=!0}else n.visible=!1},t.prototype.update=function(t,n,i,r,e,u,s,h,o){var a=null;i<n.length?((a=n[i]).disallowUploadedUpdate(),a.points.position=u,a.transform.position.set(r,e),a.stroke.set(!0,o.color,o.alpha,o.width,void 0,void 0,o.style),a.size.set(s,h),a.visible=!0,a.allowUploadedUpdate()):((a=new Kt).disallowUploadedUpdate(),a.points.position=u,a.transform.position.set(r,e),a.stroke.set(!0,o.color,o.alpha,o.width,void 0,void 0,o.style),a.size.set(s,h),a.visible=!0,a.allowUploadedUpdate(),a.attach(t))},t}(),Em=function(t){function n(n){var i=t.call(this,n)||this;return i.Rl=i.toSnap(i.theme,n.snap),i}return B(n,t),n.prototype.toSnap=function(t,n){return n?new Dm(this,t,n):null},Object.defineProperty(n.prototype,"snap",{get:function(){return this.Rl},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"shape",{get:function(){var t=this._r;return null==t&&(t=this.newShape(),this._r=t),t},enumerable:!1,configurable:!0}),n.prototype.newShape=function(){return new pm(this)},n.prototype.serialize=function(t,n){var i,r=new yv,e=[],u=this.Mn,s=u.color,h=u.alpha;return{version:1,id:t,name:this.name,width:this.width,height:this.height,background:{color:mn(s)?s:16777215,alpha:mn(h)?h:0},tile:this.Nl.serialize(),resources:r.resources,data:r.data,pieces:r.pieces,layers:this.es.serialize(r,e),items:e,snap:null===(i=this.Rl)||void 0===i?void 0:i.serialize(),thumbnail:null==n?void 0:n.serialize()}},n.prototype.onReflow=function(){var n;t.prototype.onReflow.call(this),null===(n=this.Rl)||void 0===n||n.onReflow()},n.prototype.getType=function(){return"DDiagramCanvasEditor"},n}(mm),Mm=function(t){function n(n){var i=t.call(this,n)||this;return i.Pt=new Map,i}return B(n,t),n.prototype.add=function(t,n){var i=this.Pt,r=i.get(t);null==r?i.set(t,[n]):r.push(n)},n.prototype.get=function(t){var n=this.Pt.get(t);return n&&0<n.length?n[0]:null},n.prototype.getAll=function(t){return this.Pt.get(t)||[]},n}(wm),Sm=function(){function t(t,n){var i=this;this.O=t,this.L=[],this.ha=n,this.Ll=function(){i.onTime()}}return t.prototype.add=function(t){this.L.push(t)},t.prototype.start=function(){null==this.yl&&this.onTime()},t.prototype.getInterval=function(){var t=Date.now(),n=this.ha;return Math.max(0,n-t%n)},t.prototype.onTime=function(){var t=this.L;if(0<t.length){for(var n=Date.now()/this.ha,i=0,r=t.length;i<r;++i)t[i].value=n;rt.update(this.O)}this.yl=window.setTimeout(this.Ll,this.getInterval())},t.prototype.stop=function(){var t=this.yl;null!=t&&(clearTimeout(t),this.yl=void 0)},t}(),Tm=function(){function t(t){this.O=t,this.Pt=new Map}return t.prototype.add=function(t){var n=this.Pt,i=this.toNormalized(t),r=n.get(i);if(null!=r)return r;var e=new Sm(this.O,i);return n.set(i,e),e},t.prototype.toNormalized=function(t){return mn(t)?Math.max(1,Math.round(t)):1e3},t.prototype.start=function(){this.Pt.forEach((function(t){t.start()}))},t.prototype.stop=function(){this.Pt.forEach((function(t){t.stop()}))},t}(),jm="[]",Nm=function(){return 0},Im=function(){return[]},Cm=function(){return""},Am=function(){return{}},Rm=function(){return!1},Lm=function(n){function i(t){var i=n.call(this,t)||this;return i.Pt=new Om,i._r=new Mm(i),i.kl=new Tm(i),i.xl=[],i.Bl=new Set,i.aa=function(){rt.update(i)},i}return B(i,n),Object.defineProperty(i.prototype,"data",{get:function(){return this.Pt},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"shape",{get:function(){return this._r},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"ticker",{get:function(){return this.kl},enumerable:!1,configurable:!0}),i.prototype.initialize=function(t,n){var i=this,r=this.xl,e=this.Pt;this._l(t,null,null,n,new Map,new Map,new Map,this.kl,this._r,e,r);for(var u=this.es.children,s=u.length,h=0;h<s;++h)u[h].initialize(r);nn.isInitializing=!0;var o=Date.now();for(h=0;h<s;++h)u[h].update(o);nn.isInitializing=!1,e.extended.each((function(t){var n=Cv.getById(t);if(n){var r=n.start;r&&r(i)}})),this.kl.start()},i.prototype._l=function(t,n,i,r,e,u,s,h,o,a,c){for(var f=function(f,v){var b=t[f],d=b.id;0<d.length&&o.add(d,b),l.initData(b,n,i,r,e,u,h,a);var g=new(vo[b.type]||Ze)(b);b.runtime=g,l.initActions(b,g,s),g.initialize(b);var m=b.shortcut;null!=m&&Xi.on(b,m,(function(t){g.onClick(b,t)})),g.isActionable()&&c.push(b);var w=b.children;if(0<w.length){var O=n,p=i;b instanceof Nr&&(null==O&&(O=b),p=b),l._l(w,O,p,r,e,u,s,h,o,a,c)}},l=this,v=0,b=t.length;v<b;++v)f(v)},i.prototype.initData=function(t,n,i,r,e,u,s,h){for(var o=t.data,a=0,c=o.size();a<c;++a){var f=o.get(a);if(null!=f)switch(f.type){case Tt.BOOLEAN:case Tt.BOOLEAN_ARRAY:case Tt.NUMBER:case Tt.NUMBER_ARRAY:case Tt.STRING:case Tt.STRING_ARRAY:case Tt.OBJECT:case Tt.OBJECT_ARRAY:this.initDataValue(f,t,n,i,r,e,u,h);break;case Tt.TICKER:this.initDataTicker(f,u,s);break;default:this.initDataExtension(f,h)}}},i.prototype.initDataValue=function(t,n,i,r,e,u,s,h){if(t.scope===jt.PRIVATE)0<(o=t.id).length&&(r?r.data.private.add(o,t):h.private.add(o,t));else if(t.scope===jt.PROTECTED)0<(o=t.id).length&&h.protected.add(o,t);else{var o;e&&e(t,i||n),0<(o=t.id).length&&h.add(o,t)}var a=t.format,c=t.initial,f=u.get(t.type);null==f&&(f=new Map,u.set(t.type,f));var l=f.get(a);if(null!=l)t.formatter=l;else if(0<a.length){var v=this.calcFormatter(t,a,c);f.set(a,v),t.formatter=v}var b=s.get(t.type);null==b&&(b=new Map,s.set(t.type,b));var d=b.get(c);if(null!=d)t.value=d();else{var g=this.calcInitial(t,c);b.set(c,g),t.value=g()}},i.prototype.initDataTicker=function(t,n,i){var r=t.initial,e=n.get(t.type);null==e&&(e=new Map,n.set(t.type,e));var u=e.get(r);if(void 0!==u)t.value=0,i.add(u()).add(t);else{var s=this.calcInitial(t,r);e.set(r,s),t.value=0,i.add(s()).add(t)}},i.prototype.initDataExtension=function(t,n){var i=Cv.get(t.type);i&&(n.extended.add(i.id,t),t.value=i.initial)},i.prototype.initActions=function(t,n,i){var r=t.action.values,e=n.actions,u=pv.get(t.type);if(null!=u)for(var s=0,h=u.length;s<h;++s){var o=u[s];e.push(o),n.reset|=o.reset}for(s=0,h=r.length;s<h;++s){var a=r[s],c=i.get(a);null==c?null!=(c=a.toRuntime())&&(i.set(a,c),e.push(c),n.reset|=c.reset):(e.push(c),n.reset|=c.reset)}},i.prototype.calcFormatter=function(t,n,i){var r=this.toInitial(t);try{return Function("value","try {"+"return (".concat(n,");")+"} catch( e1 ) {try {"+"return (".concat(0<i.length?i:r,");")+"} catch( e2 ) {"+"return ".concat(r,";")+"}}")}catch(n){return this.toInitializer(t)}},i.prototype.calcInitial=function(t,n){if(n.length<=0)return this.toInitializer(t);try{return Function("try {"+"return (".concat(n,");")+"} catch( e ) {"+"return ".concat(this.toInitial(t),";")+"}")}catch(n){return this.toInitializer(t)}},i.prototype.toInitial=function(t){switch(t.type){case Tt.BOOLEAN:return"false";case Tt.BOOLEAN_ARRAY:return jm;case Tt.NUMBER:return"0";case Tt.NUMBER_ARRAY:return jm;case Tt.STRING:return'""';case Tt.STRING_ARRAY:return jm;case Tt.OBJECT:return"{}";case Tt.OBJECT_ARRAY:return jm;case Tt.TICKER:default:return"0"}},i.prototype.toInitializer=function(t){switch(t.type){case Tt.BOOLEAN:return Rm;case Tt.BOOLEAN_ARRAY:return Im;case Tt.NUMBER:return Nm;case Tt.NUMBER_ARRAY:return Im;case Tt.STRING:return Cm;case Tt.STRING_ARRAY:return Im;case Tt.OBJECT:return Am;case Tt.OBJECT_ARRAY:return Im;case Tt.TICKER:default:return Nm}},i.prototype.onDestroy=function(){var t=this;this.Pt.extended.each((function(n){var i=Cv.getById(n);if(i){var r=i.stop;r&&r(t)}})),this.kl.stop(),n.prototype.onDestroy.call(this)},i.prototype.hitTestInteractives=function(t){for(var n=this.es.children,i=n.length-1;0<=i;--i){var r=n[i];if(r.visible){var e=r.hitTestInteractives(t);if(null!=e)return e}}return null},i.prototype.onShapeMove=function(t){var n=this.hitTestInteractives(t.data.global);this.cursor=this.Kn=this.toShapeCursor(n);var i=rt.getLayer(this);if(i){var r=this.toShapeTitle(n),e=i.view;e.title!==r&&(e.title=r)}var u=this.Pl;if(this.Pl=n,n===u){if(null!=n){var s=n.runtime;s&&s.onMove(n,t)}}else this.onShapeOut(t,u,n),this.onShapeOver(t,n);return null!=n},i.prototype.toShapeCursor=function(t){if(null!=t)for(var n=t;;){var i=n.cursor;if(null!=i&&0<i.length)return i;var r=n.parent;if(!(r instanceof pt))break;n=r}return"auto"},i.prototype.toShapeTitle=function(t){if(null!=t)for(var n=t;;){var i=n.title;if(null!=i&&0<i.length)return i;var r=n.parent;if(!(r instanceof pt))break;n=r}return""},i.prototype.onShapeOut=function(t,n,i){for(;null!=n&&n!==i&&n instanceof pt;){var r=n.runtime;r&&r.onOut(n,t),n=n.parent}},i.prototype.onShapeOver=function(t,n,i){for(;null!=n&&n!==i&&n instanceof pt;){var r=n.runtime;r&&r.onOver(n,t),n=n.parent}},i.prototype.onShapeDown=function(t){var n=this.hitTestInteractives(t.data.global);if(this.Ul=n,n){this.Bl.add(n);for(var i=n;;){var r=i.runtime;r&&r.onDown(i,t);var e=i.parent;if(!(e instanceof pt))break;i=e}return!0}return!1},i.prototype.onShapeUp=function(t){var n=this.Bl,i=this.hitTestInteractives(t.data.global);if(i){n.delete(i);for(var r=i;;){var e=r.runtime;e&&e.onUp(r,t);var u=r.parent;if(!(u instanceof pt))break;r=u}}return this.onShapeCancel(t),null!=i},i.prototype.onShapeCancel=function(t){var n=this.Bl;return 0<n.size&&(n.forEach((function(n){for(var i=n;;){var r=i.runtime;r&&r.onUpOutside(i,t);var e=i.parent;if(!(e instanceof pt))break;i=e}})),n.clear(),!0)},i.prototype.onShapeClick=function(t){var n=this.hitTestInteractives(t.data.global);if(n&&this.Ul===n){for(var i=n;;){var r=i.runtime;r&&r.onClick(i,t);var e=i.parent;if(!(e instanceof pt))break;i=e}return!0}return!1},i.prototype.onShapeDblClick=function(n,r){var e,u=null!==(e=i.WORK_DBLCLICK)&&void 0!==e?e:i.WORK_DBLCLICK=new t.Point;Ki.toGlobal(n,r,u);var s=this.hitTestInteractives(u);if(s){for(var h=s;;){var o=h.runtime;o&&o.onDblClick(h,n,r);var a=h.parent;if(!(a instanceof pt))break;h=a}return!0}return!1},i.prototype.onShapeRightClick=function(t){var n=this.hitTestInteractives(t.data.global);if(n&&this.Ul===n){for(var i=n;;){var r=i.runtime;r&&r.onRightClick(i,t);var e=i.parent;if(!(e instanceof pt))break;i=e}return!0}return!1},i.prototype.onShapeRightDown=function(t){var n=this.hitTestInteractives(t.data.global);if(this.Ul=n,n){this.Bl.add(n);for(var i=n;;){var r=i.runtime;r&&r.onRightDown(i,t);var e=i.parent;if(!(e instanceof pt))break;i=e}return!0}return!1},i.prototype.onShapeRightUp=function(t){var n=this.Bl,i=this.hitTestInteractives(t.data.global);if(i){n.delete(i);for(var r=i;;){var e=r.runtime;e&&e.onRightUp(r,t);var u=r.parent;if(!(u instanceof pt))break;r=u}}return this.onShapeRightCancel(t),null!=i},i.prototype.onShapeRightCancel=function(t){var n=this.Bl;return 0<n.size&&(n.forEach((function(n){for(var i=n;;){var r=i.runtime;r&&r.onRightUpOutside(i,t);var e=i.parent;if(!(e instanceof pt))break;i=e}})),n.clear(),!0)},i.prototype.update=function(){var t=this.xl;if(0<t.length){for(var n=-1,i=Date.now(),r=0,e=t.length;r<e;++r){var u=t[r];u.update(i);var s=u.runtime;if(s){var h=s.effect;i<h&&(n=n<0?h:Math.min(n,h))}}0<=n&&window.setTimeout(this.aa,n-Date.now())}},i.prototype.onRender=function(t){var n=this.xl;if(0<n.length){for(var i=-1,r=Date.now(),e=0,u=n.length;e<u;++e){var s=n[e];s.onRender(r,t);var h=s.runtime;if(h){var o=h.effect;r<o&&(i=i<0?o:Math.min(i,o))}}0<=i&&window.setTimeout(this.aa,i-Date.now())}},i.prototype.getType=function(){return"DDiagramCanvas"},i}(mm),ym=function(){function t(t){this.Fl=t}return Object.defineProperty(t.prototype,"ids",{get:function(){var t=this.Fl.canvas;return null!=t?t.data.private.ids:[]},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n,i,r,e,u){var s=this.Fl.canvas;return null!=s&&s.data.private.set(t,n,i,r,e,u)},t.prototype.toDirty=function(t){var n=this.Fl.canvas;return null!=n&&n.data.private.toDirty(t)},t.prototype.each=function(t){var n=this.Fl.canvas;return null!=n?n.data.private.each(t):null},t}(),km=function(){function t(t){this.Fl=t}return Object.defineProperty(t.prototype,"ids",{get:function(){var t=this.Fl.canvas;return null!=t?t.data.protected.ids:[]},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n,i,r,e,u){var s=this.Fl.canvas;return null!=s&&s.data.protected.set(t,n,i,r,e,u)},t.prototype.toDirty=function(t){var n=this.Fl.canvas;return null!=n&&n.data.protected.toDirty(t)},t.prototype.each=function(t){var n=this.Fl.canvas;return null!=n?n.data.protected.each(t):null},t}(),xm=function(){function t(t){this.Dl=t&&t.controller}return t.prototype.set=function(t,n){var i=this.Dl;return!!i&&(i.write(t,n),!0)},t}(),Bm=function(){function t(t){this.Fl=t}return Object.defineProperty(t.prototype,"ids",{get:function(){var t=this.Fl.canvas;return null!=t?t.data.extended.ids:[]},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n,i,r,e,u){var s=this.Fl.canvas;return null!=s&&s.data.extended.set(t,n,i,r,e,u)},t.prototype.toDirty=function(t){var n=this.Fl.canvas;return null!=n&&n.data.extended.toDirty(t)},t.prototype.each=function(t){var n=this.Fl.canvas;return null!=n?n.data.extended.each(t):null},t}(),_m=function(){function t(t,n){this.Fl=t,this.Gl=n&&n.mapper||null,this.Hl=new xm(n&&n.remote),this.Ht=new ym(t),this.Il=new km(t),this.Cl=new Bm(t)}return t.prototype.update=function(){},Object.defineProperty(t.prototype,"mapper",{get:function(){return this.Gl},set:function(t){this.Gl=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"remote",{get:function(){return this.Hl},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"private",{get:function(){return this.Ht},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"protected",{get:function(){return this.Il},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"extended",{get:function(){return this.Cl},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ids",{get:function(){var t=this.Fl.canvas;return t?t.data.ids:[]},enumerable:!1,configurable:!0}),t.prototype.each=function(t){var n=this.Fl.canvas;return null!=n?n.data.each(t):null},t.prototype.set=function(t,n,i,r,e,u){var s=this.Fl.canvas;return null!=s&&s.data.set(t,n,i,r,e,u)},t.prototype.get=function(t){var n=this.Fl.canvas;return null!=n?n.data.get(t):null},t.prototype.clear=function(t){var n=this.Fl.canvas;return null!=n&&n.data.clear(t)},t.prototype.toDirty=function(t){var n=this.Fl.canvas;return null!=n&&n.data.toDirty(t)},t.prototype.setAll=function(t,n,i,r,e,u){var s=this.Fl.canvas;return null!=s&&s.data.setAll(t,n,i,r,e,u)},t.prototype.setValue=function(t,n){var i=this.Fl.canvas;return null!=i&&i.data.setValue(t,n)},t.prototype.setValues=function(t,n){var i=this.Fl.canvas;return null!=i&&i.data.setValues(t,n)},t.prototype.setTime=function(t,n){var i=this.Fl.canvas;return null!=i&&i.data.setTime(t,n)},t.prototype.setTimes=function(t,n){var i=this.Fl.canvas;return null!=i&&i.data.setTimes(t,n)},t.prototype.setState=function(t,n){var i=this.Fl.canvas;return null!=i&&i.data.setState(t,n)},t.prototype.setStates=function(t,n){var i=this.Fl.canvas;return null!=i&&i.data.setStates(t,n)},t.prototype.setRange=function(t,n,i){var r=this.Fl.canvas;return null!=r&&r.data.setRange(t,n,i)},t}(),Pm=function(){function t(t,n,i){this.Ml=t,this.rs=this.toIsEnabled(n,i),this.kn=this.toCreateAsUrlOptions(n,i)}return t.prototype.toIsEnabled=function(t,n){var i;return null!==(i=null==n?void 0:n.enable)&&void 0!==i?i:t.isThumbnailEnabled()},t.prototype.toSize=function(t,n){return void 0!==n?n:t.getThumbnailSize()},t.prototype.toCleanup=function(t,n){var i,r;return null==n||!0===n?{snap:!0,background:!0}:!1===n?{snap:!1,background:!1}:{snap:null===(i=n.snap)||void 0===i||i,background:null===(r=n.background)||void 0===r||r}},t.prototype.toCreateAsUrlOptions=function(t,n){return{size:this.toSize(t,null==n?void 0:n.size),cleanup:this.toCleanup(t,null==n?void 0:n.cleanup)}},Object.defineProperty(t.prototype,"enable",{get:function(){return this.rs},set:function(t){this.rs=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return this.kn.size},set:function(t){this.kn.size=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cleanup",{get:function(){return this.kn.cleanup},enumerable:!1,configurable:!0}),t.prototype.serialize=function(){if(this.rs)return this.Ml.createAsUrl(this.kn)},t}(),Um=function(t){function n(n){var i=t.call(this,n)||this;i.Ut=!1,i.Ut=!1,Sb.getCommandController().on("dirty",(function(){!0!==i.Ut&&(i.Ut=!0,i.emit("change",i))}));var r=i.theme;return i.zl=new Gv(i,r,null==n?void 0:n.snapper),i.Vl=new Pm(i.Ml,r,null==n?void 0:n.thumbnail),i}return B(n,t),Object.defineProperty(n.prototype,"thumbnail",{get:function(){return this.Vl},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"snapper",{get:function(){return this.zl},enumerable:!1,configurable:!0}),n.prototype.toMode=function(t){return(null==t?void 0:t.mapping)?gr.EDITOR_DATA_MAPPED:gr.EDITOR},n.prototype.newCanvas=function(t){return new Em(this.toCanvasOptions(t))},n.prototype.toCanvasOptions=function(t){var n=this.toCanvasBaseOptions(t),i=this.zl,r=n.snap;return null==r?n.snap={controller:i}:null==r.controller&&(r.controller=i),n},n.prototype.serialize=function(){var t=this.canvas,n=this.Ol;if(null!=t&&null!=n){this.emit("serializing",t,this);try{var i=t.serialize(n.id,this.Vl);return this.emit("serialized",t,null,this),i}catch(n){return this.emit("serialized",t,"exception",this),null}}return null},n.prototype.save=function(){var t=this,n=this.serialize();if(null!=n){var i=this.Dl;if(i){var r=Ue.toSimple(n);return this.emit("saving",r,this),i.save(r).then((function(i){t.Ut=!1,n.id=i,t.Ol=n,t.emit("change",t),t.emit("saved",null,t)}),(function(n){t.emit("saved",n,t)}))}return this.emit("saved","no-controller",this),Promise.reject()}return this.emit("saved",null,this),Promise.resolve()},n.prototype.saveAs=function(t){var n=this,i=this.serialize();if(null!=i){var r=this.Dl;if(r){i.id=void 0,i.name=t;var e=Ue.toSimple(i);return this.emit("saving",e,this),r.save(e).then((function(r){n.Ut=!1,i.id=r,n.Ol=i;var e=n.canvas;null!=e&&(e.name=t),n.emit("change",n),n.emit("saved",null,n)}),(function(t){n.emit("saved",t,n)}))}return this.emit("saved","no-controller",this),Promise.reject("no-controller")}return this.emit("saved",null,this),Promise.resolve()},n.prototype.delete=function(){var t=this,n=this.Ol;if(n&&null!=n.id){var i=this.Dl;return i?(this.emit("deleting",this),i.delete(n.id).then((function(){var n=t.set(null);return t.emit("deleted",null,t),n}),(function(n){return t.emit("deleted",n,t),Promise.reject(n)}))):(this.emit("deleted","no-controller",this),Promise.reject("no-controller"))}return this.set(null),this.emit("deleted",null,this),Promise.resolve(null)},n.prototype.create=function(t,n,i){return this.set({version:1,id:void 0,name:t,width:n,height:i,resources:[],data:[],layers:[["Default layer"]],items:[],snap:void 0})},n.prototype.onSet=function(n,i){t.prototype.onSet.call(this,n,i);var r=n.snap,e=this.zl;null!=r?e.deserialize(r):e.reset(),this.El&&(e.target.visible=!1,e.grid.visible=!1),this.Ut=!1,this.emit("change",this)},n.prototype.onUnset=function(){t.prototype.onUnset.call(this),this.Ut=!1,this.emit("change",this)},n.prototype.open=function(t){var n=this,i=this.Dl;return i?(this.emit("opening",this),i.get(t).then((function(t){var i=n.set(Ue.toSerialized(t));return n.emit("opened",null,n),i}),(function(t){return n.emit("opened",t,n),Promise.reject(t)}))):(this.emit("opened","no-controller",this),Promise.reject("no-controller"))},n.prototype.close=function(){return this.set(null)},n.prototype.isChanged=function(){return this.Ut||this.isNew()},n.prototype.isNew=function(){var t=this.Ol;return null!=t&&null==t.id},n.prototype.getName=function(){var t=this.Ol;return null!=t?t.name:null},n.prototype.getType=function(){return"DDiagramEditor"},n}(fm),Fm=function(t){function n(n){var i=t.call(this)||this;return i.Fl=n,i.aa=function(){rt.update(n)},i}return B(n,t),n.prototype.update=function(){var t=this.Fl.canvas;t&&t.update()},n.prototype.onRender=function(t){var n=this.Fl.canvas;n&&n.onRender(t)},n.prototype.get=function(t){var n=this.Fl.canvas;return n?n.shape.get(t):null},n.prototype.getAll=function(t){var n=this.Fl.canvas;return n?n.shape.getAll(t):[]},n.prototype.each=function(t,n){void 0===n&&(n=!1);var i=this.Fl.canvas;if(null!=i){var r=i.layer.children;if(n){for(e=r.length-1;0<=e;--e)for(h=(s=r[e].children).length-1;0<=h;--h)if(!1===t(a=s[h]))return a}else for(var e=0,u=r.length;e<u;++e)for(var s,h=0,o=(s=r[e].children).length;h<o;++h){var a;if(!1===t(a=s[h]))return a}}return null},n}(t.utils.EventEmitter),Gm=function(t){function n(n){var i=t.call(this,n)||this;i.on(Ki.move,(function(t){i.onShapeMove(t)})),i.on(Ki.up,(function(t){i.onShapeUp(t)})),i.on(Ki.upoutside,(function(t){i.onShapeCancel(t)})),i.on(Ki.cancel,(function(t){i.onShapeCancel(t)})),i.on(Ki.tap,(function(t){i.onShapeClick(t)})),i.on(Ki.righttap,(function(t){i.onShapeRightClick(t)})),i.on(Ki.rightdown,(function(t){i.onShapeRightDown(t)})),i.on(Ki.rightup,(function(t){i.onShapeRightUp(t)})),i.on(Ki.rightupoutside,(function(t){i.onShapeRightCancel(t)}));var r=new _m(i,n&&(n.data||n.tag));return i.data=r,i.tag=r,i.shape=new Fm(i),i}return B(n,t),n.prototype.initLayer=function(n,i,r){return t.prototype.initLayer.call(this,n,i,r||this.data.mapper)},n.prototype.toMode=function(t){return gr.VIEWER},n.prototype.newCanvas=function(t){return new Lm(this.toCanvasOptions(t))},n.prototype.toCanvasOptions=function(t){return this.toCanvasBaseOptions(t)},n.prototype.onDown=function(n){var i=this.canvas;i?t.prototype.onDown.call(this,n,i.onShapeDown(n)):t.prototype.onDown.call(this,n)},n.prototype.onShapeMove=function(t){var n=this.canvas;if(n){var i=t.target;i!==this&&i!==n||n.onShapeMove(t)}},n.prototype.onShapeUp=function(t){var n=this.canvas;if(n){var i=t.target;i!==this&&i!==n||n.onShapeUp(t)}},n.prototype.onShapeCancel=function(t){var n=this.canvas;if(n){var i=t.target;i!==this&&i!==n||n.onShapeCancel(t)}},n.prototype.onShapeClick=function(t){var n=this.canvas;if(n){var i=t.target;i!==this&&i!==n||n.onShapeClick(t)}},n.prototype.onShapeRightClick=function(t){var n=this.canvas;if(n){var i=t.target;i!==this&&i!==n||n.onShapeRightClick(t)}},n.prototype.onShapeRightDown=function(t){var n=this.canvas;n&&n.onShapeRightDown(t)},n.prototype.onShapeRightUp=function(t){var n=this.canvas;if(n){var i=t.target;i!==this&&i!==n||n.onShapeRightUp(t)}},n.prototype.onShapeRightCancel=function(t){var n=this.canvas;if(n){var i=t.target;i!==this&&i!==n||n.onShapeRightCancel(t)}},n.prototype.onDblClick=function(n,i){var r=this.canvas;return r?t.prototype.onDblClick.call(this,n,i,r.onShapeDblClick(n,i)):t.prototype.onDblClick.call(this,n,i)},n.prototype.render=function(n){this.shape.onRender(n),t.prototype.render.call(this,n)},n.prototype.getType=function(){return"DDiagram"},n}(fm),Hm=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DDialogConfirmMessage"},n}(gl),zm=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.newContentChildren=function(n,i){var r=t.prototype.newContentChildren.call(this,n,i);return r.push(this.message),r},n.prototype.toMessage=function(t,n){var i=null==n?void 0:n.message;return null!=i?at(i)||ot(i)?this.newMessage(this.toMessageOptions(i)):i instanceof Qi?i:this.newMessage(this.toMessageOptionsMerged(i,t.getMessage())):this.newMessage(this.toMessageOptions(t.getMessage()))},n.prototype.toMessageOptionsMerged=function(t,n){var i=t.text;return null==i&&(i={},t.text=i),void 0===i.value&&(i.value=n),t},n.prototype.toMessageOptions=function(t){return{text:{value:t}}},n.prototype.newMessage=function(t){return new Hm(t)},Object.defineProperty(n.prototype,"message",{get:function(){var t=this.Wl;return null==t&&(t=this.toMessage(this.theme,this.kn),this.Wl=t),t},enumerable:!1,configurable:!0}),n.prototype.getResolvedValue=function(){},n.prototype.getType=function(){return"DDialogConfirm"},n}(Ss),Vm=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DDialogConfirmDelete"},n}(zm),Wm=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DDialogConfirmDiscard"},n}(zm),Xm=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DDialogMessage"},n}(zm),Km=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DDialogProcessingMessage"},n}(Hm),Ym=function(t){function n(n){var i,r=this;(r=t.call(this,n)||this).Xl=!0,r.Zn=0;var e=null==n?void 0:n.delay;r.Kl=null!==(i=null==e?void 0:e.done)&&void 0!==i?i:r.theme.getDoneDelay();var u=null==e?void 0:e.close;return r.Yl=void 0!==u?u:r.theme.getCloseDelay(),r.Jl=r.message.text,r}return B(n,t),n.prototype.newMessage=function(t){return new Km(t)},n.prototype.onOpen=function(){this.Xl=!1,this.Zn=Date.now();var n=this.yl;null!=n&&clearTimeout(n);var i=this.Zl;null!=i&&clearTimeout(i);var r=this.message;r.text=this.Jl,r.state.removeAll(ht.SUCCEEDED,ht.FAILED);var e=this.ah;null!=e&&e.hide(),t.prototype.onOpen.call(this)},n.prototype.onDone=function(t){var n=this;null!=t?this.Zl=window.setTimeout((function(){n.close()}),t):this.close()},n.prototype.onResolved=function(t){null!=t&&(this.message.text=t),this.message.state.set(ht.SUCCEEDED,ht.FAILED);var n=this.Yl;if(null!=n)this.onDone(n);else{var i=this.ah;null!=i?i.show():this.close()}},n.prototype.onRejected=function(t){null!=t&&(this.message.text=t),this.message.state.set(ht.FAILED,ht.SUCCEEDED);var n=this.ah;null!=n?n.show():this.onDone(this.Yl)},n.prototype.resolve=function(t){var n=this;if(!this.Xl){this.Xl=!0;var i=Date.now()-this.Zn,r=this.Kl-i;0<r?this.yl=window.setTimeout((function(){n.yl=void 0,n.onResolved(t)}),r):this.onResolved(t)}},n.prototype.reject=function(t){var n=this;if(!this.Xl){this.Xl=!0;var i=Date.now()-this.Zn,r=this.Kl-i;0<r?this.yl=window.setTimeout((function(){n.yl=void 0,n.onRejected(t)}),r):this.onRejected(t)}},n.prototype.onCloseOn=function(){this.Xl&&t.prototype.onCloseOn.call(this)},n.prototype.getType=function(){return"DDialogProcessing"},n}(zm),Jm=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.onOpen=function(){var n=Sb.getDocumentController().getName();null!=n&&(this.input.value=n),t.prototype.onOpen.call(this)},n.prototype.onOk=function(n){t.prototype.onOk.call(this,n);var i=Sb.getCommandController();at(n)?i.push(new om(n)):n.then((function(t){i.push(new om(t))}))},n.prototype.getType=function(){return"DDialogSaveAs"},n}(Vs),Zm=function(){function t(t){this.ql=t,this.Ql=[]}return t.prototype.indexOf=function(t){return this.Ql.indexOf(t)},t.prototype.close=function(t){for(var n=this.Ql,i=Math.max(0,t),r=n.length-1;i<=r;--r)n[r].close()},t.prototype.add=function(t){this.Ql.push(t)},t.prototype.trim=function(t){this.close(this.indexOf(t)+1)},t.prototype.remove=function(t){var n=this.indexOf(t);0<=n&&(this.close(n+1),this.Ql.splice(n,1))},t}(),qm=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.init=function(n){var i,r,e,u=this;t.prototype.init.call(this,n),this.ss=function(){u.onPrerender()},this.Tt=Di(null!==(i=null==n?void 0:n.align)&&void 0!==i?i:ju.BOTTOM,ju),this.$l=null!==(r=null==n?void 0:n.fit)&&void 0!==r&&r,this.hs=null!==(e=null==n?void 0:n.sticky)&&void 0!==e&&e,this.tv=!1,this.ql=null,this.Wo=null,this.visible=!1,yu.apply(this,(function(){u.close()})),this.on("select",(function(){u.close()}));var s=null==n?void 0:n.items;s&&Ml.newItems(this,s,this.hs),this.cs=new ku(n)},n.prototype.findItem=function(t){for(var n=this.children,i=0,r=n.length;i<r;++i){var e=n[i];if(e instanceof wl&&e.value===t)return e}return null},n.prototype.getType=function(){return"DMenu"},n.prototype.getContext=function(){return this.Wo},n.prototype.getCloseable=function(){return this},n.prototype.open=function(n,i,r){if(this.isHidden()){var e=this.cs.pick(this);this.ql=n;for(var u=this.children,s=0,h=u.length;s<h;++s){var o=u[s];o instanceof Qi&&o.state.removeAll(ht.FOCUSED,ht.HOVERED)}var a=e.renderer,c=this.ss;if(this.hs?a.on("prerender",c):a.once("prerender",c),this.$l){var f=n.getBounds();null!=f&&(this.width=f.width)}this.tv=null!=r,r=r||new Zm(n),null!=i&&r.trim(i),r.add(this),this.Wo=r,e.stage.addChild(this),this.fs=e.getFocusController().get(),this.focus(),t.prototype.show.call(this),this.emit("open",this)}return this},n.prototype.onPrerender=function(){var t=this.ql;if(t){var n=t.getBounds();if(n){this.$l&&(this.width=n.width);var i=this.cs.picked;if(i){var r=this.theme;Nu.attach(this,n,r.getOffsetX(),r.getOffsetY(),i.width,i.height,this.Tt)}}}},n.prototype.close=function(){if(this.isShown()){var n=this.Wo;n&&n.remove(this);var i=this.cs.picked;i&&i.renderer.off("prerender",this.ss),this.ql=null;var r=this.fs;if(null!=r)if(this.fs=null,i){var e=rt.getLayer(r);null!=e&&i!==e&&e.view.focus(),i.getFocusController().focus(r)}else this.blur(!0);else this.blur(!0);t.prototype.hide.call(this);var u=this.parent;u&&u.removeChild(this),this.emit("close",this)}return this},n.prototype.onKeyDown=function(n){return Xi.moveFocusVertically(n,this,this.cs),this.state.isActionable&&(Xi.isArrowLeftKey(n)||Xi.isCancelKey(n))&&this.close(),t.prototype.onKeyDown.call(this,n)},n.prototype.containsGlobalPoint=function(t){return!this.tv},n}(Fu);Ml.setMenuCreator((function(t){return new qm(t)}));var Qm=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.onMenuSelect=function(t,n,i){this.emit("select",t,n,this)},n.prototype.onMenuClose=function(t){if(t){var n=this.nv;n&&t.off("select",n);var i=this.iv;i&&t.off("close",i)}},n.prototype.toMenu=function(t,n){var i=null==n?void 0:n.menu;return i instanceof qm?i:new qm(this.toMenuOptions(t,i))},n.prototype.toMenuOptions=function(t,n){return n?(null==n.fit&&(n.fit=!0),n):{fit:!0}},Object.defineProperty(n.prototype,"menu",{get:function(){var t=this.Do;return null==t&&(t=this.toMenu(this.theme,this.kn),this.Do=t),t},set:function(t){var n=this.Do;n!=t&&(this.Do=t,this.onMenuReplaced(t,n))},enumerable:!1,configurable:!0}),n.prototype.onMenuReplaced=function(t,n){null!=n&&this.onMenuClose(n)},n.prototype.getType=function(){return"DDropdownBase"},n.prototype.onKeyDown=function(n){return Xi.isArrowDownKey(n)&&this.onKeyDownArrowDown(n),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyDownArrowDown=function(t){return!(!this.state.isActionable||!this.state.isFocused||(this.activate(t),0))},n.prototype.onActivate=function(n){t.prototype.onActivate.call(this,n),this.open()},n.prototype.open=function(){var t=this,n=this.menu;if(n.isHidden()){var i=this.nv;null==i&&(i=function(n,i,r){t.onMenuSelect(n,i,r)},this.nv=i);var r=this.iv;null==r&&(r=function(){t.onMenuClose(t.Do)}),n.on("select",i),n.on("close",r),n.open(this),this.emit("open",n,this)}},n.prototype.close=function(){this.menu.close()},n}(ds),$m=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DDropdown"},n}(Qm),tw=function(t){function n(n){var i=t.call(this,n)||this;return i.on(Ki.down,(function(t){i.state.isActionable&&i.onSelect(t)})),i}return B(n,t),n.prototype.onSelect=function(t){this.emit("select",this)},n.prototype.onKeyDown=function(n){return Xi.isActivateKey(n)&&this.onKeyDownActivate(n),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyDownActivate=function(t){return!(!this.state.isActionable||!this.state.isFocused||(this.onSelect(t),0))},n.prototype.getType=function(){return"DExpandableHeader"},n}(gl),nw=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return B(i,n),i.prototype.init=function(t){var i=this;n.prototype.init.call(this,t);var r=this.theme,e=this.toHeader(r,t);this.hh=e,e.on("select",(function(){i.toggle()})),this.addChild(e);var u=this.toBody(r,t);this.Oe=u,this.addChild(u),this.state.isActive?this.onActivated():this.onDeactivated()},i.prototype.toHeader=function(n,i){return i&&i.header?i.header instanceof t.DisplayObject?i.header:this.newHeader(n,i.header):this.newHeader(n)},i.prototype.newHeader=function(t,n){return new tw(n)},i.prototype.toBody=function(t,n){return n.body},i.prototype.open=function(){this.state.isActive=!0},i.prototype.close=function(){this.state.isActive=!1},i.prototype.toggle=function(){this.state.isActive=!this.state.isActive},i.prototype.onActivated=function(){var t=this.Oe;t instanceof Qi?t.show():t.visible=!0},i.prototype.onDeactivated=function(){var t=this.Oe;t instanceof Qi?t.hide():t.visible=!1},i.prototype.onStateChange=function(t,i){n.prototype.onStateChange.call(this,t,i),t.isActive?i.isActive||this.onActivated():i.isActive&&this.onDeactivated()},i.prototype.getType=function(){return"DExpandable"},i}(Fu),iw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.createInput=function(t){return new _s(t)},n}(Bb),rw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.newUtil=function(){return new cb(this,this.newOperation(),this.theme,this.kn)},n.prototype.getType=function(){return"DInputTextArea"},n}(ks),ew=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DListItemAmbient"},n}(ad),uw=function(){function t(t){void 0===t&&(t=256),this.rv=t}return t.prototype.getTileSize=function(){return this.rv},t.prototype.lonLatToMeters=function(n,i){var r=t.CIRCUMFERENCE_HALF;return i.x=n.x*r/180,i.y=Math.log(Math.tan((90+n.y)*Math.PI/360))*r/Math.PI,i},t.prototype.metersToLonLat=function(n,i){var r=t.CIRCUMFERENCE_HALF;return i.x=n.x/r*180,i.y=360*Math.atan(Math.exp(n.y*Math.PI/r))/Math.PI-90,i},t.prototype.pixelsToMeters=function(n,i,r,e){var u=this.toResolution(i,r),s=t.CIRCUMFERENCE_HALF;return e.x=n.x*u-s,e.y=s-n.y*u,e},t.prototype.metersToPixels=function(n,i,r,e){var u=this.toResolution(i,r),s=t.CIRCUMFERENCE_HALF;return e.x=(n.x+s)/u,e.y=(s-n.y)/u,e},t.prototype.pixelsToTile=function(t,n,i){return i.x=Math.ceil(t.x/n)-1,i.y=Math.ceil(t.y/n)-1,i},t.prototype.metersToTile=function(n,i,r){var e=t.CIRCUMFERENCE_HALF,u=1<<i;return r.x=Math.ceil(.5*(n.x/e+1)*u)-1,r.y=Math.ceil(.5*(1-n.y/e)*u)-1,r},t.prototype.lonLatToTile=function(t,n,i){return this.metersToTile(this.lonLatToMeters(t,i),n,i)},t.prototype.lonLatToPixels=function(t,n,i,r){return this.metersToPixels(this.lonLatToMeters(t,r),n,i,r)},t.prototype.pixelsToLonLat=function(t,n,i,r){return this.metersToLonLat(this.pixelsToMeters(t,n,i,r),r)},t.prototype.tileToPixels=function(t,n,i){return i.x=t.x*n,i.y=t.y*n,i},t.prototype.tileToMeters=function(n,i,r){var e=this.toResolutionMeter(i),u=t.CIRCUMFERENCE_HALF;return r.x=n.x*e+u,r.y=u-n.y*e,r},t.prototype.toResolutionMeter=function(n){return 2*t.CIRCUMFERENCE_HALF/(1<<n)},t.prototype.toResolution=function(n,i){return 2*t.CIRCUMFERENCE_HALF/(i<<n)},t.prototype.toTileCount=function(t){return 1<<t},t.prototype.toTileCode=function(t,n,i){return(n<<t)+i},t.CIRCUMFERENCE_HALF=6378137*Math.PI,t}(),sw=function(){function t(){}return Object.defineProperty(t,"DEFAULT",{get:function(){return null==this.Br&&(this.Br=new uw),this.Br},enumerable:!1,configurable:!0}),t}(),hw=function(){function n(n,i,r,e,u,s){this.tx=i,this.ty=r;var h=new t.Sprite(t.Texture.EMPTY);h.parent=n,h.position.set(e,u),h.scale.set(s,s),this.ev=h}return n.prototype.load=function(n,i){var r=t.Texture.from(n,{resolution:1});this.ev.texture=r,r.valid?i():r.on("update",i)},n.prototype.transform=function(t,n,i){var r=this.ev;r.position.set(t,n),r.scale.set(i,i)},Object.defineProperty(n.prototype,"loaded",{get:function(){return this.ev.texture.valid},enumerable:!1,configurable:!0}),n.prototype.render=function(t){var n=this.ev;n.updateTransform(),n.render(t)},n.prototype.destroy=function(){var n=this.ev,i=n.texture,r=i.baseTexture.resource,e=null;r instanceof t.resources.BaseImageResource&&r.source instanceof HTMLImageElement&&(e=r.source),i.destroy(!0),n.destroy(),e&&(e.src="")},n}(),ow=function(){function n(t,n,i,r,e,u){var s=this;this.O=t,this.Ze=n,this.uv=u,this.sv=!1,this.hv=!0,this.ov=function(){s.onLoaded()},this.av=i,this._lon0=NaN,this._lat0=NaN,this._lon1=NaN,this._lat1=NaN,this.cv=new Map,this.fv=function(t){s.renderTile(t)},this.lv=NaN,this.vv=NaN,this.bv=NaN,this.dv=NaN,this.gv=function(t,n,i){s.deleteTile(t,n,i)},this.mv=function(t){s.destroyTile(t)},this.wv=function(t){t.loaded||(s.Ov=!1)},this.pv=e.toTileCount(i),this.Dv=1/this.pv,this.Ev=r.scale*this.Dv,this.rv=e.getTileSize()*r.scale,this.Gt=r,this.Ff=e,this.Ov=!0}return n.prototype.newTile=function(t,n,i,r,e){return new hw(this.O,t,n,i,r,e)},n.prototype.renderTile=function(t){t.render(this.Je)},Object.defineProperty(n.prototype,"tz",{get:function(){return this.av},enumerable:!1,configurable:!0}),n.prototype.render=function(t){this.Je=t,this.cv.forEach(this.fv)},n.prototype.move=function(t,i,r,e){var u=this._lon0,s=this._lat0,h=this._lon1,o=this._lat1;if(u!==t||s!==i||h!==r||o!==e){this._lon0=t,this._lat0=i,this._lon1=r,this._lat1=e;var a=this.av,c=this.Ff,f=n.WORK;f.set(t,i),c.lonLatToTile(f,a,f);var l=f.x,v=f.y;f.set(r,e),c.lonLatToTile(f,a,f);var b=f.x,d=f.y,g=this.pv,m=Math.max(0,l),w=Math.min(g-1,b),O=Math.max(0,v),p=Math.min(g-1,d),D=m-this.lv,E=w-this.vv,M=O-this.bv,S=p-this.dv,T=D!=D||D<0||1<D,j=E!=E||0<E||E<-1,N=M!=M||M<0||1<M,I=S!=S||0<S||S<-1;if(T||j||N||I){T?this.lv=m:m=this.lv,j?this.vv=w:w=this.vv,N?this.bv=O:O=this.bv,I?this.dv=p:p=this.dv,this.cv.forEach(this.gv);var C=m+w>>1,A=O+p>>1,R=Math.max(C-m,w-C),L=Math.max(A-O,p-A),y=Math.max(R,L);this.toOffset(f);var k=f.x,x=f.y;this.sv=!1,this.hv=!1,this.loadTile(a,C,A,k,x,f);for(var B=1;B<=y;++B){var _=C-B;m<=_&&this.loadTilesY(a,_,A,B,O,p,k,x,f);var P=C+B;P<=w&&this.loadTilesY(a,P,A,B,O,p,k,x,f);var U=A-B;O<=U&&this.loadTilesX(a,C,B-1,m,w,U,k,x,f);var F=A+B;F<=p&&this.loadTilesX(a,C,B-1,m,w,F,k,x,f)}this.hv=!0,this.sv&&this.onLoaded()}}},n.prototype.loadTilesX=function(t,n,i,r,e,u,s,h,o){this.loadTile(t,n,u,s,h,o);for(var a=1;a<=i;++a){var c=n-a;r<=c&&this.loadTile(t,c,u,s,h,o);var f=n+a;f<=e&&this.loadTile(t,f,u,s,h,o)}},n.prototype.loadTilesY=function(t,n,i,r,e,u,s,h,o){this.loadTile(t,n,i,s,h,o);for(var a=1;a<=r;++a){var c=i-a;e<=c&&this.loadTile(t,n,c,s,h,o);var f=i+a;f<=u&&this.loadTile(t,n,f,s,h,o)}},n.prototype.loadTile=function(t,n,i,r,e,u){var s=this.Ff.toTileCode(t,n,i),h=this.cv,o=h.get(s);null==o&&(this.toTilePosition(n,i,r,e,u),o=this.newTile(n,i,u.x,u.y,this.Ev),h.set(s,o),o.load(this.Ze(t,n,i),this.ov),this.Ov=!1)},n.prototype.toTilePosition=function(t,n,i,r,e){var u=this.rv,s=this.Dv;return e.set(t,n),this.Ff.tileToPixels(e,u,e),e.set(e.x*s+i,e.y*s+r),e},n.prototype.toOffset=function(t){var n=this.O,i=this.Gt,r=this.rv;return t.set(-i.x*r+.5*n.width,-i.y*r+.5*n.height),t},n.prototype.deleteTile=function(t,n,i){var r=t.tx,e=t.ty;(r<this.lv||this.vv<r||e<this.bv||this.dv<e)&&(i.delete(n),t.destroy())},n.prototype.destroy=function(){var t=this.cv;t.forEach(this.mv),t.clear()},n.prototype.destroyTile=function(t){t.destroy()},n.prototype.updateLoadingState=function(){this.Ov=!0,this.cv.forEach(this.wv)},n.prototype.onLoaded=function(){this.hv?this.uv():this.sv=!0},Object.defineProperty(n.prototype,"loaded",{get:function(){return this.Ov||this.updateLoadingState(),this.Ov},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"mapping",{get:function(){return this.Gt},set:function(t){var i=this,r=this.Ff,e=t.scale*this.Dv,u=r.getTileSize()*t.scale;this.Ev=e,this.rv=u,this.Gt=t;var s=n.WORK;this.toOffset(s);var h=s.x,o=s.y;this.cv.forEach((function(t){i.toTilePosition(t.tx,t.ty,h,o,s),t.transform(s.x,s.y,e)}))},enumerable:!1,configurable:!0}),n.WORK=new t.Point,n}(),aw=function(n){function i(t){var i=n.call(this)||this,r=t.canvas;i.ir=r,i.Ze=t.builder;var e=t.mapping;i.Gt=e;var u=t.coordinate;i.Ff=u,i.Mv=i.toMapping(r,e,u),i._z=NaN,i.av=NaN,i.Sv=t.plane.min,i.Tv=t.plane.max,i.jv=[],i.ov=function(){i.onLoaded()},i.Nv=function(){i.Iv=void 0,i.fit()},i.Cv=t.plane.throttle;var s=function(){i.fitThrottled()};return i.Av=s,r.on("scale",s),r.on("move",s),r.snippet.add(i,!0),i}return B(i,n),Object.defineProperty(i.prototype,"coordinate",{get:function(){return this.Ff},enumerable:!1,configurable:!0}),i.prototype.fitThrottled=function(){null==this.Iv&&(this.Iv=window.setTimeout(this.Nv,this.Cv))},i.prototype.toMapping=function(t,n,r){var e=i.WORK_LONLAT,u=r.getTileSize();e.set(n.from.lon,n.from.lat),r.lonLatToPixels(e,0,u,e);var s=e.x,h=e.y;e.set(n.to.lon,n.to.lat),r.lonLatToPixels(e,0,u,e);var o=e.x,a=e.y,c=Math.abs(o-s),f=Math.abs(a-h),l=1e-7,v=1;return l<c?v=l<f?Math.max(t.width/c,t.height/f):t.width/c:l<f&&(v=t.height/f),{scale:v,x:.5*(o+s)/u,y:.5*(a+h)/u}},Object.defineProperty(i.prototype,"mapping",{get:function(){return this.Gt},set:function(t){var n=this.Mv,i=this.toMapping(this.ir,t,this.Ff),r=1e-7;if(r<Math.abs(n.scale-i.scale)||r<Math.abs(n.x-i.x)||r<Math.abs(n.y-i.y)){this.Mv=i;for(var e=this.jv,u=0,s=e.length;u<s;++u){var h=e[u];h&&(h.mapping=i)}rt.update(this.ir),this.Av()}},enumerable:!1,configurable:!0}),i.prototype.newPlane=function(t){return new ow(this.ir,this.Ze,t,this.Mv,this.Ff,this.ov)},i.prototype.render=function(t){for(var n=this.av,i=this.jv,r=0;r<n;++r)null!=(e=i[r])&&e.render(t);for(r=i.length-1;n<r;--r){var e;null!=(e=i[r])&&e.render(t)}var u=i[n];null!=u&&u.render(t)},i.prototype.toTileZ=function(t){return Math.min(this.Tv,Math.max(this.Sv,Math.floor(t)))},i.prototype.updateTransform=function(){},i.prototype.toZ=function(t){return Math.log(this.Mv.scale*t)/Math.log(2)},i.prototype.move=function(t,n,i,r,e){var u=this.jv,s=this.toZ(t);if(this._z!==s){this._z=s;var h=this.toTileZ(s);if(this.av!==h){this.av=h;var o=u[h];null==o&&(o=this.newPlane(h),u[h]=o)}}var a=u[this.av];return null!=a&&a.move(n,i,r,e),this},i.prototype.fit=function(){var t=this.ir;if(null!=t){var n=t.parent;if(null!=n){var r=t.scale,e=r.x,u=r.y,s=t.x,h=t.y,o=this.Ff,a=this.Mv,c=o.getTileSize()*a.scale,f=a.x*c-(s/e+.5*t.width),l=f+n.width/e,v=a.y*c-(h/u+.5*t.height),b=v+n.height/u,d=i.WORK_LONLAT;d.set(f,v),o.pixelsToLonLat(d,0,c,d);var g=d.x,m=d.y;d.set(l,b),o.pixelsToLonLat(d,0,c,d);var w=d.x,O=d.y;this.move(e,g,m,w,O)}}return this},i.prototype.destroyPlanesBefore=function(t,n){for(var i=0;i<t;++i){var r=n[i];r&&(r.destroy(),n[i]=void 0)}},i.prototype.destroyPlanesAfter=function(t,n){for(var i=t+1,r=n.length;i<r;++i){var e=n[i];e&&(e.destroy(),n[i]=void 0)}},i.prototype.cleanup=function(){var t=this.av,n=this.jv,i=n[t];if(i&&i.loaded)return this.destroyPlanesBefore(t,n),void this.destroyPlanesAfter(t,n);for(var r=t+1,e=n.length;r<e;++r)if((u=n[r])&&u.loaded)return this.destroyPlanesBefore(t,n),void this.destroyPlanesAfter(r,n);for(r=t-1;0<=r;--r){var u;if((u=n[r])&&u.loaded)return void this.destroyPlanesBefore(r,n)}},i.prototype.onLoaded=function(){this.cleanup(),rt.update(this.ir)},i.prototype.destroy=function(){for(var t=this.jv,n=0,i=t.length;n<i;++n){var r=t[n];r&&(r.destroy(),t[n]=void 0)}var e=this.ir,u=this.Av;return e.off("scale",u),e.off("move",u),e.snippet.remove(this,!0),this},i.WORK_LONLAT=new t.Point,i}(t.utils.EventEmitter),cw=function(t,n,i){return"https://j.tile.openstreetmap.jp/".concat(t,"/").concat(n,"/").concat(i,".png")},fw=function(){function t(){}return t.toPlaneOptions=function(t){var n,i,r,e=t.plane;return{min:null!==(n=null==e?void 0:e.min)&&void 0!==n?n:this.MIN,max:null!==(i=null==e?void 0:e.max)&&void 0!==i?i:this.MAX,throttle:null!==(r=null==e?void 0:e.throttle)&&void 0!==r?r:this.THROTTLE}},t.from=function(t){return new aw({canvas:t.canvas,builder:t.builder||cw,mapping:t.canvas.tile.mapping,coordinate:t.coordinate||sw.DEFAULT,plane:this.toPlaneOptions(t)})},t.MIN=0,t.MAX=18,t.THROTTLE=333,t}(),lw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.toMenu=function(t,n){var i=null==n?void 0:n.menu;return i instanceof qm?i:new qm(this.toMenuOptions(t,i))},n.prototype.newMenu=function(t,n){return new qm(this.toMenuOptions(t,n))},n.prototype.toMenuOptions=function(t,n){return n?(null==n.fit&&(n.fit=!1),n):{fit:!1}},n.prototype.onActivate=function(n){t.prototype.onActivate.call(this,n),this.open()},n.prototype.open=function(){this.menu.open(this)},n.prototype.close=function(){this.menu.close()},Object.defineProperty(n.prototype,"menu",{get:function(){var t=this,n=this.Do;return null==n&&((n=this.toMenu(this.theme,this.kn)).on("select",(function(n,i,r){t.onMenuSelect(n,i,r)})),this.Do=n),n},enumerable:!1,configurable:!0}),n.prototype.onMenuSelect=function(t,n,i){this.emit("select",t,n,this);var r=this.parent;r&&r.emit("select",t,n,r)},n.prototype.onKeyDown=function(n){return Xi.isArrowDownKey(n)&&this.onKeyDownArrowDown(n),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyDownArrowDown=function(t){return!(!this.state.isActionable||!this.state.isFocused||(this.onActivate(t),0))},n.prototype.getType=function(){return"DMenuBarItem"},n}(gs),vw=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return B(i,n),i.prototype.init=function(t){n.prototype.init.call(this,t);var i=null==t?void 0:t.items;if(i)for(var r=0,e=i.length;r<e;++r){var u=this.toItem(i[r]);u&&this.addChild(u)}},i.prototype.toItem=function(n){return null==n?null:n instanceof t.DisplayObject?n:"space"in n?new _u(n):new lw(n)},i.prototype.onKeyDown=function(t){return Xi.moveFocusHorizontally(t,this),n.prototype.onKeyDown.call(this,t)},i.prototype.getType=function(){return"DMenuBar"},i}(ws),bw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.initReflowable=function(){},n.prototype.getType=function(){return"DMenuSidedContent"},n}(ws),dw={NONE:0,SINGLE:1,SINGLE_ONCE:2},gw=function(){return!0},mw=function(n){function i(t,i){var r,e,u,s=this;(s=n.call(this)||this).oh=t,s.Gc=null,s.vn=!0,s.Nt=Di(null!==(e=null!==(r=null==i?void 0:i.mode)&&void 0!==r?r:null==i?void 0:i.type)&&void 0!==e?e:dw.SINGLE_ONCE,dw),s.sf=null!==(u=null==i?void 0:i.filter)&&void 0!==u?u:s.getFilterDefault();var h=null==i?void 0:i.on;if(h)for(var o in h){var a=h[o];a&&s.on(o,a)}return s}return B(i,n),i.prototype.first=function(){return this.Gc},i.prototype.toDirty=function(){this.vn=!0},i.prototype.update=function(){this.vn&&(this.vn=!1,this.Gs(this.oh))},i.prototype.hasMenu=function(t){return t&&t.menu instanceof qm},i.prototype.Gs=function(n){for(var i=n.children,r=0,e=i.length;r<e;++r){var u=i[r];u instanceof ml&&u.state.isActive&&this.Rv(u,!1),u instanceof t.Container&&this.Gs(u),this.hasMenu(u)&&this.Gs(u.menu)}},i.prototype.add=function(t){this.update(),this.Rv(t,!0)},i.prototype.set=function(t){this.update(),this.Rv(t,!0)},i.prototype.get=function(t){return this.update(),this.Gc},i.prototype.getIndex=function(t){return null},i.prototype.size=function(){return this.Gc?1:0},i.prototype.isEmpty=function(){return null==this.Gc},i.prototype.remove=function(t){this.update(),this.Gc===t&&this.Rv(null,!0)},i.prototype.clear=function(){this.update(),this.Rv(null,!0)},i.prototype.getFilterDefault=function(){return gw},i.prototype.Rv=function(t,n){var i=this.Gc,r=this.Nt;r!==dw.NONE&&this.sf(t)&&i!==t&&(this.setState(i,r,!1),this.Gc=t,this.setState(t,r,!0),n&&this.emit("change",this))},i.prototype.setState=function(t,n,i){t&&(n===dw.SINGLE?t.state.isActive=i:i?t.state.addAll(ht.ACTIVE,ht.READ_ONLY):t.state.removeAll(ht.ACTIVE,ht.READ_ONLY))},i}(t.utils.EventEmitter),ww=function(t){function n(n){var i,r=this;r=t.call(this,n)||this;var e=new Zm(r);r.Wo=e,e.add(r);var u=null==n?void 0:n.items;if(null!=u){var s=null!==(i=null==n?void 0:n.sticky)&&void 0!==i&&i;r.newItems(u,s)}var h=null==n?void 0:n.selection;return r.Hc=h instanceof mw?h:r.newSelection(h),r}return B(n,t),n.prototype.newSelection=function(t){return new mw(this.content,t)},n.prototype.onHierarchyDirty=function(){var n=this.Hc;null!=n&&n.toDirty(),t.prototype.onHierarchyDirty.call(this)},n.prototype.newItems=function(t,n){sv.newItems(this.content,t,n)},n.prototype.newContent=function(t){return new bw(t)},Object.defineProperty(n.prototype,"selection",{get:function(){return this.Hc},enumerable:!1,configurable:!0}),n.prototype.getContext=function(){return this.Wo},n.prototype.getCloseable=function(){return this},n.prototype.open=function(){},n.prototype.close=function(){},n.prototype.onKeyDown=function(n){return Xi.moveFocusVertically(n,this),t.prototype.onKeyDown.call(this,n)},n.prototype.getType=function(){return"DMenuSided"},n}(yd),Ow=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DNoteError"},n}(Pd),pw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DNoteNoItemsFound"},n}(Pd),Dw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DNoteSearching"},n}(Pd),Ew=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n}(Qi),Mw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DPaginationButtonLast"},n}(ps),Sw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DPaginationButtonNext"},n}(ps),Tw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DPaginationButtonPage"},n}(ps),jw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DPaginationButtonPrevious"},n}(ps),Nw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DPaginationButtonTop"},n}(ps),Iw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DPaginationDots"},n}(bs),Cw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DPaginationPage"},n}(bs),Aw=function(t){function n(n){var i,r,e,u,s=this;s=t.call(this,n)||this,null!=n?(s.j=null!==(r=null!==(i=n.size)&&void 0!==i?i:n.total)&&void 0!==r?r:10,s.Rt=null!==(u=null!==(e=n.value)&&void 0!==e?e:n.selected)&&void 0!==u?u:0):(s.j=10,s.Rt=0);var h=s.buttonTop,o=s.buttonPrevious;null!=h&&s.addChild(h),null!=o&&s.addChild(o),null==h&&null==o||s.addChild(s.newSpace());var a=s.buttonPages0,c=a.length;s.addChild(a[c-1]),s.addChild(s.dots0);for(var f=c-2;0<=f;--f)s.addChild(a[f]);s.addChild(s.page);for(var l=s.buttonPages1,v=l.length,b=(f=0,v-1);f<b;++f)s.addChild(l[f]);s.addChild(s.dots1),s.addChild(l[v-1]);var d=s.buttonNext,g=s.buttonLast;return null==d&&null==g||s.addChild(s.newSpace()),null!=d&&s.addChild(d),null!=g&&s.addChild(g),s.update(),s}return B(n,t),n.prototype.newSpace=function(){var t,n,i;return new _u({width:null!==(i=null===(n=null===(t=this.kn)||void 0===t?void 0:t.button)||void 0===n?void 0:n.space)&&void 0!==i?i:this.theme.getButtonSpace()})},Object.defineProperty(n.prototype,"value",{get:function(){return this.Rt},set:function(t){0<=t&&t<this.j&&this.Rt!==t&&(this.Rt=t,this.update())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"selected",{get:function(){return this.value},set:function(t){this.value=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"size",{get:function(){return this.j},set:function(t){0<=t&&this.j!==t&&(this.j=t,this.Rt=0===t?-1:Math.max(0,Math.min(this.j-1,this.Rt)),this.update())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"total",{get:function(){return this.size},set:function(t){this.size=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"dots0",{get:function(){var t=this._dots0;return null==t&&(t=this.newDots(),this._dots0=t),t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"dots1",{get:function(){var t=this._dots1;return null==t&&(t=this.newDots(),this._dots1=t),t},enumerable:!1,configurable:!0}),n.prototype.newDots=function(){return new Iw},Object.defineProperty(n.prototype,"buttonLast",{get:function(){var t=this.Lv;return void 0===t&&(t=this.newButtonLast(),this.Lv=t),t},enumerable:!1,configurable:!0}),n.prototype.newButtonLast=function(){var t,n,i=this,r=null===(n=null===(t=this.kn)||void 0===t?void 0:t.button)||void 0===n?void 0:n.last;if(null!==r&&!1!==r&&void 0!==r){var e=new Mw(!0!==r?r:void 0);return e.on("active",(function(){i.onButtonLastActive()})),e}return null},n.prototype.onButtonLastActive=function(){this.moveTo(this.j-1)},n.prototype.moveTo=function(t){if(0<=t&&t<this.j&&this.Rt!==t){var n=this.Rt;this.Rt=t,this.emit("change",t,n,this),this.update()}},Object.defineProperty(n.prototype,"buttonNext",{get:function(){var t=this.yv;return void 0===t&&(t=this.newButtonNext(),this.yv=t),t},enumerable:!1,configurable:!0}),n.prototype.newButtonNext=function(){var t,n,i=this,r=null===(n=null===(t=this.kn)||void 0===t?void 0:t.button)||void 0===n?void 0:n.next;if(null!==r&&!1!==r){var e=new Sw(!0!==r?r:void 0);return e.on("active",(function(){i.onButtonNextActive()})),e}return null},n.prototype.onButtonNextActive=function(){this.moveTo(this.Rt+1)},Object.defineProperty(n.prototype,"buttonPrevious",{get:function(){var t=this.kv;return void 0===t&&(t=this.newButtonPrevious(),this.kv=t),t},enumerable:!1,configurable:!0}),n.prototype.newButtonPrevious=function(){var t,n,i=this,r=null===(n=null===(t=this.kn)||void 0===t?void 0:t.button)||void 0===n?void 0:n.previous;if(null!==r&&!1!==r){var e=new jw(!0!==r?r:void 0);return e.on("active",(function(){i.onButtonPreviousActive()})),e}return null},n.prototype.onButtonPreviousActive=function(){this.moveTo(this.Rt-1)},Object.defineProperty(n.prototype,"buttonTop",{get:function(){var t=this.xv;return void 0===t&&(t=this.newButtonTop(),this.xv=t),t},enumerable:!1,configurable:!0}),n.prototype.newButtonTop=function(){var t,n,i=this,r=null===(n=null===(t=this.kn)||void 0===t?void 0:t.button)||void 0===n?void 0:n.top;if(null!==r&&!1!==r&&void 0!==r){var e=new Nw(!0!==r?r:void 0);return e.on("active",(function(){i.onButtonTopActive()})),e}return null},n.prototype.onButtonTopActive=function(){this.moveTo(0)},n.prototype.newButtonPage=function(){var t,n,i=this,r=new Tw(null===(n=null===(t=this.kn)||void 0===t?void 0:t.button)||void 0===n?void 0:n.page);return r.on("active",(function(){i.onButtonPageActive(r)})),r},Object.defineProperty(n.prototype,"buttonPages0",{get:function(){var t=this._buttonPages0;return null==t&&(t=this.newButtonPages0(),this._buttonPages0=t),t},enumerable:!1,configurable:!0}),n.prototype.newButtonPages0=function(){return[this.newButtonPage(),this.newButtonPage(),this.newButtonPage(),this.newButtonPage()]},Object.defineProperty(n.prototype,"buttonPages1",{get:function(){var t=this._buttonPages1;return null==t&&(t=this.newButtonPages1(),this._buttonPages1=t),t},enumerable:!1,configurable:!0}),n.prototype.newButtonPages1=function(){return[this.newButtonPage(),this.newButtonPage(),this.newButtonPage(),this.newButtonPage()]},Object.defineProperty(n.prototype,"page",{get:function(){var t=this.Bv;return null==t&&(t=this.newPage(),this.Bv=t),t},enumerable:!1,configurable:!0}),n.prototype.newPage=function(){var t;return new Cw(null===(t=this.kn)||void 0===t?void 0:t.page)},n.prototype.onButtonPageActive=function(t){var n=t.text;mn(n)&&(this.moveTo(n-1),t.state.isFocused&&(t.state.isHovered=!1,this.page.focus()))},n.prototype.update=function(){var t=this.j,n=this.Rt;if(t<=0){null!=(o=this.buttonTop)&&(o.state.isEnabled=!1),null!=(a=this.buttonPrevious)&&(a.state.isEnabled=!1),this.hideDots(this.dots0);for(var i=0,r=(l=this.buttonPages0).length;i<r;++i)this.hidePage(l[i]);for(this.hidePage(this.page),i=0,r=(v=this.buttonPages1).length;i<r;++i)this.hidePage(v[i]);this.hideDots(this.dots1),null!=(c=this.buttonNext)&&(c.state.isEnabled=!1),(f=this.buttonLast)&&(f.state.isEnabled=!1)}else{var e=n-2,u=n+2;if(e<0)u-=e,e=0;else if(t<=u){var s=u-t+1;u-=s,e-=s}var h=!1;0<e&&(h=!0,e=Math.min(e+1,n));var o,a,c,f,l,v,b=!1;for(u<t-1&&(b=!0,u=Math.max(u-1,n)),null!=(o=this.buttonTop)&&(o.state.isEnabled=0<n),null!=(a=this.buttonPrevious)&&(a.state.isEnabled=0<n),h?this.showDots(this.dots0,1,e-1):this.hideDots(this.dots0),i=0,r=(l=this.buttonPages0).length;i<r;++i){var d=n-i-1,g=l[i];e<=d&&d<=u&&0<=d?this.showPage(g,d):h&&i===r-1?this.showPage(g,0):this.hidePage(g)}for(this.showPage(this.page,n),i=0,r=(v=this.buttonPages1).length;i<r;++i)d=n+i+1,g=v[i],e<=d&&d<=u&&d<t?this.showPage(g,d):b&&i===r-1?this.showPage(g,t-1):this.hidePage(g);b?this.showDots(this.dots1,u+1,t-2):this.hideDots(this.dots1),null!=(c=this.buttonNext)&&(c.state.isEnabled=n<t-1),null!=(f=this.buttonLast)&&(f.state.isEnabled=n<t-1)}},n.prototype.showPage=function(t,n){t.text=n+1,t.show()},n.prototype.hidePage=function(t){t.hide()},n.prototype.showDots=function(t,n,i){t.show()},n.prototype.hideDots=function(t){t.hide()},n.prototype.getType=function(){return"DPagination"},n}(ws),Rw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n}(Qi),Lw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n}(Qi),yw=function(t){function n(n){var i=t.call(this,n)||this;i.L=[];var r=null==n?void 0:n.values;return r&&(i.values=r),i}return B(n,t),n.prototype.onMenuSelect=function(n,i,r){if(t.prototype.onMenuSelect.call(this,n,i,r),i instanceof pl){var e=this.L,u=[],s=[];i.state.isActive?this.updateMenuItems(r,e,n,void 0,u,s):this.updateMenuItems(r,e,void 0,n,u,s),this.L=u,this.text=s,this.onValueChange(u,e,s)}},n.prototype.onMenuReplaced=function(n,i){t.prototype.onMenuReplaced.call(this,n,i);var r=this.L,e=[],u=[];this.updateMenuItems(n,r,void 0,void 0,e,u),this.L=e,this.text=u},n.prototype.onValueChange=function(t,n,i){this.emit("change",t,n,i,this)},n.prototype.open=function(){this.updateMenuItems(this.menu,this.L),t.prototype.open.call(this)},Object.defineProperty(n.prototype,"values",{get:function(){return this.L},set:function(t){var n=this.L;if(!this.isSameValues(t,n)){var i=[],r=[];this.updateMenuItems(this.menu,t,void 0,void 0,i,r),this.L=i,this.text=r}},enumerable:!1,configurable:!0}),n.prototype.isSameValues=function(t,n){if(t.length===n.length)for(var i=0,r=t.length;i<r;++i)if(n.indexOf(t[i])<0)return!1;return!1},n.prototype.updateMenuItems=function(t,n,i,r,e,u){for(var s=t.children,h=0,o=s.length;h<o;++h){var a=s[h];if(a instanceof kl)this.updateMenuItems(a.menu,n,i,r,e,u);else if(a instanceof pl){var c=a.value;void 0!==r&&r===c?a.state.isActive=!1:void 0!==i&&a.value===i||0<=n.indexOf(a.value)?(e&&e.push(a.value),u&&u.push(a),a.state.isActive=!0):a.state.isActive=!1}}},n.prototype.getType=function(){return"DSelectMultiple"},n}(Qm),kw=function(t){function n(n){var i=t.call(this,n)||this;i.Rt=null;var r=null==n?void 0:n.value;return null!=r&&(i.value=r),i}return B(n,t),n.prototype.onMenuSelect=function(n,i,r){t.prototype.onMenuSelect.call(this,n,i,r);var e=this.Rt;e!==n&&(this.Rt=n,this.text=i,this.onValueChange(n,e,i))},n.prototype.onMenuReplaced=function(n,i){t.prototype.onMenuReplaced.call(this,n,i);var r=this.Rt;if(null!=r){var e=this.findMenuItem(n,r);null!=e?(this.Rt=r,this.text=e):(this.Rt=null,this.text=null)}else this.Rt=null,this.text=null},n.prototype.onValueChange=function(t,n,i){this.emit("change",t,n,i,this)},n.prototype.findMenuItem=function(t,n){for(var i=t.children,r=0,e=i.length;r<e;++r){var u=i[r];if(u instanceof kl){var s=this.findMenuItem(u.menu,n);if(null!=s)return s}else if(u instanceof wl&&u.value===n)return u}return null},Object.defineProperty(n.prototype,"value",{get:function(){return this.Rt},set:function(t){if(this.Rt!==t){var n=this.findMenuItem(this.menu,t);null!=n?(this.Rt=t,this.text=n):(this.Rt=null,this.text=null)}},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DSelect"},n}(Qm),xw=function(t){function n(n,i,r,e,u){var s=t.call(this,n,i,r,i,r)||this;return s._v=e,s.Pv=u,s.Da=.5*i,s.Ea=.5*r,s.interactive=!1,s.interactiveChildren=!1,n.on("update",(function(){s.onTextureUpdate()})),s}return B(n,t),n.prototype.onTextureUpdate=function(){this.emit("update",this)},n.prototype.onReflow=function(t,n,i){var r=this.Da,e=this.Ea;this.x=-r+this._v,this.y=-e+this.Pv,this.width=r+n+r,this.height=e+i+e},n.prototype.render=function(n){var i=this.parent;if(i){var r=i.alpha;this.alpha=r*r*r}t.prototype.render.call(this,n)},n}(t.NineSlicePlane),Bw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.init=function(n){var i;t.prototype.init.call(this,n),this.Rt=null!==(i=null==n?void 0:n.value)&&void 0!==i?i:0},Object.defineProperty(n.prototype,"value",{get:function(){return this.Rt},set:function(t){this.Rt=t},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DSliderLabel"},n}(vs),_w=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DSliderThumb"},n}(gs),Pw=function(t){function n(n){var i,r,e=this;return(e=t.call(this,n)||this).Rt=null!==(i=null==n?void 0:n.value)&&void 0!==i?i:0,e.Uv=e.toRounder(n),e.Fv=null!==(r=null==n?void 0:n.delta)&&void 0!==r?r:1,e}return B(n,t),n.prototype.toRounder=function(t){var n,i=null==t?void 0:t.rounder;if(i)return i;var r=null!==(n=null==t?void 0:t.precision)&&void 0!==n?n:this.theme.getPrecision(),e=Math.pow(10,r);return function(t){return Math.round(t*e)/e}},Object.defineProperty(n.prototype,"value",{get:function(){return this.Rt},set:function(t){this.Rt=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rounder",{get:function(){return this.Uv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"delta",{get:function(){return this.Fv},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DSliderValue"},n}(vs),Uw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.init=function(n){var i=this;t.prototype.init.call(this,n),this.Gv=0,this.Hv=this.newTrack(n),this.addChild(this.Hv),this.zv=this.newTrackSelected(n),this.zv.state.isActive=!0,this.addChild(this.zv),this.Qc=this.newThumb(n),this.addChild(this.Qc),this.$u=this.newLabelMin(n),this.addChild(this.$u),this.ts=this.newLabelMax(n),this.addChild(this.ts),this.Rt=this.newValue(n),this.addChild(this.Rt),this.Hv.on(Ki.down,(function(t){i.Rt.visible=i.state.inEnabled,i.onTrackDown(t.data.global)})),this.zv.on(Ki.down,(function(t){i.Rt.visible=i.state.inEnabled,i.onTrackSelectedDown(t.data.global)})),this.Vv=function(t){i.onTrackUpBound(t),i.Rt.visible=!1},this.Wv=function(t){i.onTrackSelectedUpBound(t),i.Rt.visible=!1},this.Qc.on(Ki.down,(function(t){i.Rt.visible=!0,i.onThumbDown(t)})),this.Xv=function(t){i.onThumbMove(t)},this.Kv=function(t){i.onThumbUp(t),i.Rt.visible=!1},this.onValuesChange()},n.prototype.newThumb=function(t){return new _w(null==t?void 0:t.thumb)},n.prototype.newValue=function(t){return new Pw(this.toValueOptions(null==t?void 0:t.value))},n.prototype.toValueOptions=function(t){null==(t=t||{}).value&&(t.value=0);var n=t.text||{};return t.text=n,null==n.value&&(n.value=t.value),null==t.visible&&(t.visible=!1),t},n.prototype.newLabelMin=function(t){return new Bw(this.toLabelMinOptions(null==t?void 0:t.min))},n.prototype.toLabelMinOptions=function(t){null==(t=t||{}).value&&(t.value=0);var n=t.text||{};return t.text=n,null==n.value&&(n.value="".concat(t.value)),t},n.prototype.newLabelMax=function(t){return new Bw(this.toLabelMaxOptions(null==t?void 0:t.max))},n.prototype.toLabelMaxOptions=function(t){null==(t=t||{}).value&&(t.value=1);var n=t.text||{};return t.text=n,null==n.value&&(n.value="".concat(t.value)),t},n.prototype.getValueMargin=function(){return 14},n.prototype.onTrackDown=function(t){if(!this.state.inDisabled){var n=rt.getLayer(this);if(n){var i=n.renderer.plugins.interaction;this.Yv=i;var r=this.Vv;i.on(Ki.up,r),i.on(Ki.upoutside,r),i.on(Ki.cancel,r)}this.onPick(t)}},n.prototype.onTrackSelectedDown=function(t){if(!this.state.inDisabled){var n=rt.getLayer(this);if(n){var i=n.renderer.plugins.interaction;this.Yv=i;var r=this.Wv;i.on(Ki.up,r),i.on(Ki.upoutside,r),i.on(Ki.cancel,r)}this.onPick(t)}},n.prototype.onTrackUpBound=function(t){var n=this.Yv;if(n){this.Yv=void 0;var i=this.Vv;n.off(Ki.up,i),n.off(Ki.upoutside,i),n.off(Ki.cancel,i)}},n.prototype.onTrackSelectedUpBound=function(t){var n=this.Yv;if(n){this.Yv=void 0;var i=this.Wv;n.off(Ki.up,i),n.off(Ki.upoutside,i),n.off(Ki.cancel,i)}},n.prototype.onThumbMove=function(t){this.state.inDisabled||this.onPick(t.data.global)},n.prototype.onThumbDown=function(t){var n=rt.getLayer(this);if(n){var i=n.renderer.plugins.interaction;this.Yv=i;var r=this.Xv;i.on(Ki.move,r);var e=this.Kv;i.on(Ki.up,e),i.on(Ki.upoutside,e),i.on(Ki.cancel,e)}},n.prototype.onThumbUp=function(t){var n=this.Yv;if(n){this.Yv=void 0;var i=this.Xv;n.off(Ki.move,i);var r=this.Kv;n.off(Ki.up,r),n.off(Ki.upoutside,r),n.off(Ki.cancel,r)}},n.prototype.updateValue=function(){var t=this.$u.value,n=this.ts.value,i=this.Rt,r=i.rounder(t+this.Gv*(n-t)),e=i.value;r!==e&&(i.value=r,i.text=i.value,this.emit("change",r,e,this))},n.prototype.onResize=function(n,i,r,e){t.prototype.onResize.call(this,n,i,r,e),this.onValuesChange()},Object.defineProperty(n.prototype,"value",{get:function(){return this.Rt.value},set:function(t){t=Math.max(this.$u.value,Math.min(this.ts.value,t)),this.Rt.value!==t&&(this.Rt.value=t,this.onValuesChange())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"min",{get:function(){return this.$u.value},set:function(t){var n=this.$u;if(t=Math.min(this.ts.value,t),n.value!==t){var i=this.Rt;n.text=n.value=t,i.value=Math.max(t,i.value),this.onValuesChange()}},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"max",{get:function(){return this.ts.value},set:function(t){var n=this.ts;if(t=Math.max(this.$u.value,t),n.value!==t){var i=this.Rt;n.text=n.value=t,i.value=Math.min(t,i.value),this.onValuesChange()}},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DSlider"},n}(Qi),Fw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DSliderTrack"},n}(gs),Gw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DSliderTrackHorizontal"},n}(Fw),Hw=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return B(i,n),i.prototype.newTrack=function(t){return new Gw(null==t?void 0:t.track)},i.prototype.newTrackSelected=function(t){return new Gw(null==t?void 0:t.track)},i.prototype.toValueOptions=function(t){var i=this;return null==(t=n.prototype.toValueOptions.call(this,t)).y&&(t.y=function(t,n){return.5*t-n-i.getValueMargin()}),t},i.prototype.toLabelMinOptions=function(t){return null==(t=n.prototype.toLabelMinOptions.call(this,t)).x&&(t.x=function(t,n){return.5*-n}),null==t.y&&(t.y=function(t,n){return-n}),t},i.prototype.toLabelMaxOptions=function(t){return null==(t=n.prototype.toLabelMaxOptions.call(this,t)).x&&(t.x=function(t,n){return t-.5*n}),null==t.y&&(t.y=function(t,n){return-n}),t},i.prototype.onPick=function(n){var i=new t.Point(0,0);this.toLocal(n,void 0,i);var r=Math.max(0,Math.min(this.Hv.width,i.x));this.Gv=r/this.Hv.width,this.moveThumbPosition(r)},i.prototype.onValuesChange=function(){var t=this.$u.value,n=this.ts.value,i=this.Rt.value;this.Gv=(i-t)/(n-t);var r=this.Gv*this.Hv.width;this.moveThumbPosition(r)},i.prototype.moveThumbPosition=function(t){var n=this.Qc;n.x=t-.5*n.width,this.zv.width=t;var i=this.Rt;i.x=t-.5*i.width,this.updateValue()},i.prototype.onKeyDown=function(t){return Xi.isArrowRightKey(t)?this.value+=this.Rt.delta:Xi.isArrowLeftKey(t)&&(this.value-=this.Rt.delta),n.prototype.onKeyDown.call(this,t)},i.prototype.getType=function(){return"DSliderHorizontal"},i}(Uw),zw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DSliderTrackVertical"},n}(Fw),Vw=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return B(i,n),i.prototype.newTrack=function(t){return new zw(null==t?void 0:t.track)},i.prototype.newTrackSelected=function(t){return new zw(null==t?void 0:t.track)},i.prototype.toLabelMinOptions=function(t){null==(t=n.prototype.toLabelMinOptions.call(this,t)).x&&(t.x=function(t,n){return-n}),null==t.y&&(t.y=function(t,n){return t-.5*n});var i=t.text||{};t.text=i;var r=i.align||{};return i.align=r,null==r.horizontal&&(r.horizontal=Wu.RIGHT),t},i.prototype.toLabelMaxOptions=function(t){null==(t=n.prototype.toLabelMaxOptions.call(this,t)).x&&(t.x=function(t,n){return-n}),null==t.y&&(t.y=function(t,n){return.5*-n});var i=t.text||{};t.text=i;var r=i.align||{};return i.align=r,null==r.horizontal&&(r.horizontal=Wu.RIGHT),t},i.prototype.onPick=function(n){var i=new t.Point(0,0);this.toLocal(n,void 0,i);var r=this.height,e=Math.max(0,Math.min(r,i.y));this.Gv=(r-e)/r,this.moveThumbPosition(e)},i.prototype.onValuesChange=function(){var t=this.$u.value,n=this.ts.value,i=this.Rt.value;this.Gv=(i-t)/(n-t);var r=this.height*(1-this.Gv);this.moveThumbPosition(r)},i.prototype.moveThumbPosition=function(t){var n=this.Qc;n.y=t-.5*n.height;var i=this.zv;i.y=t,i.height=this.height-t;var r=this.Rt;r.y=t-r.height-this.getValueMargin(),this.updateValue()},i.prototype.onKeyDown=function(t){return Xi.isArrowUpKey(t)?this.value+=this.Rt.delta:Xi.isArrowDownKey(t)&&(this.value-=this.Rt.delta),n.prototype.onKeyDown.call(this,t)},i.prototype.getType=function(){return"DSliderVertical"},i}(Uw),Ww=function(){function t(){}return t.set=function(t,n,i,r,e){var u,s=this.toRenderable(n,i,r);t.renderable=s;var h=t.state;h.lock(),h.isDisabled=!s,!1!==e&&(h.isReadOnly=this.toReadOnly(n,i,r));var o=null===(u=r.state)||void 0===u?void 0:u.modifier;o&&o(n,i,t.state),h.unlock()},t.toReadOnly=function(t,n,i){var r=i.editing.enable;return!0!==r&&(!1===r||!r(t,n))},t.toRenderable=function(t,n,i){var r=i.renderable;return!0===r||!1!==r&&r(t,n)},t}(),Xw=function(t){function n(n,i,r,e){var u,s=this;return(s=t.call(this,e)||this).Jv=-1,s.Zv=n,s.qv=i,s.Z=r,s.Qv=null!==(u=null==e?void 0:e.sync)&&void 0!==u?u:s.theme.isSyncEnabled(),s}return B(n,t),n.prototype.onActivate=function(n){var i,r=this;t.prototype.onActivate.call(this,n);var e=this.qv.selecting,u=e.dialog;if(u){var s=null!==(i=this.Ws)&&void 0!==i?i:null;e.setter(u,s),u.open(this).then((function(){var t=e.getter(u);r.Qv?t!==s&&(r.text=t,r.onValueChange(t,s)):r.onValueChange(t,null)}))}},n.prototype.onValueChange=function(t,n){var i=this.$v;if(void 0!==i){var r=this.Jv,e=this.Zv;this.qv.setter(i,e,t),this.emit("change",t,n,this),this.Z(t,n,i,r,e,this)}},Object.defineProperty(n.prototype,"row",{get:function(){return this.$v},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.Jv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.Zv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.qv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"value",{get:function(){var t=this.Ws;return void 0!==t?t:null},set:function(t){this.text=t},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.$v=n,this.Jv=r,u?(this.Vs=t,this.Ws=t,this.onTextChange(),this.createOrUpdateText()):this.text=t,Ww.set(this,n,e,this.qv)},n.prototype.unset=function(){this.$v=void 0,this.Jv=-1},n.prototype.getType=function(){return"DTableBodyCellSelectDialog"},n}(gs),Kw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DTableBodyCellActionDialog"},n}(Xw),Yw=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.Jv=-1,u.Zv=n,u.qv=i,u.Z=r,u}return B(n,t),n.prototype.onMenuSelect=function(n,i,r){var e=this.$v;if(void 0!==e){var u=this.Jv,s=this.Zv;this.qv.setter(e,s,n),t.prototype.onMenuSelect.call(this,n,i,r),this.Z(n,null,e,u,s,this)}},n.prototype.onKeyDownArrowDown=function(t){return!1},Object.defineProperty(n.prototype,"row",{get:function(){return this.$v},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.Jv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.Zv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.qv},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.$v=n,this.Jv=r,this.text=t,Ww.set(this,n,e,this.qv)},n.prototype.unset=function(){this.$v=void 0,this.Jv=-1},n.prototype.getType=function(){return"DTableBodyCellActionMenu"},n}($m),Jw=function(t){function n(n,i,r,e){var u,s=this;return(s=t.call(this,e)||this).Jv=-1,s.Zv=n,s.qv=i,s.Z=r,s.Qv=null!==(u=null==e?void 0:e.sync)&&void 0!==u?u:s.theme.isSyncEnabled(),s}return B(n,t),n.prototype.onActivate=function(n){var i=this;t.prototype.onActivate.call(this,n);var r=this.qv.selecting.promise;r&&r().then((function(t){var n;if(i.Qv){var r=null!==(n=i.Ws)&&void 0!==n?n:null;t!==r&&(i.text=t,i.onValueChange(t,r))}else i.onValueChange(t,null)}))},n.prototype.onValueChange=function(t,n){var i=this.$v;if(void 0!==i){var r=this.Jv,e=this.Zv;this.qv.setter(i,e,t),this.emit("change",t,n,this),this.Z(t,n,i,r,e,this)}},Object.defineProperty(n.prototype,"row",{get:function(){return this.$v},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.Jv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.Zv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.qv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"value",{get:function(){var t=this.Ws;return void 0!==t?t:null},set:function(t){this.text=t},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.$v=n,this.Jv=r,u?(this.Vs=t,this.Ws=t,this.onTextChange(),this.createOrUpdateText()):this.text=t,Ww.set(this,n,e,this.qv)},n.prototype.unset=function(){this.$v=void 0,this.Jv=-1},n.prototype.getType=function(){return"DTableBodyCellSelectPromise"},n}(gs),Zw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DTableBodyCellActionPromise"},n}(Jw),qw=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.Jv=-1,u.Zv=n,u.qv=i,u.Z=r,u}return B(n,t),Object.defineProperty(n.prototype,"row",{get:function(){return this.$v},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.Jv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.Zv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.qv},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.$v=n,this.Jv=r,this.text=t,Ww.set(this,n,e,this.qv)},n.prototype.unset=function(){this.$v=void 0,this.Jv=-1},n.prototype.getType=function(){return"DTableBodyCellText"},n}(bs),Qw=function(t){function n(n,i,r,e){var u,s=this;return(s=t.call(this,n,i,r,e)||this).th=Di(null!==(u=null==e?void 0:e.when)&&void 0!==u?u:Hu.CLICKED,Hu),s.on(Ki.tap,(function(t){s.onClick(t)})),s}return B(n,t),n.prototype.onClick=function(t){this.th===Hu.CLICKED&&this.state.isActionable&&this.activate(t)},n.prototype.onDblClick=function(n,i){return this.th===Hu.DOUBLE_CLICKED&&this.state.isActionable&&this.activate(n),t.prototype.onDblClick.call(this,n,i)},n.prototype.activate=function(t){this.onActivate(t)},n.prototype.onActivate=function(t){this.emit("active",this);var n=this.$v;if(void 0!==n){var i=this.Jv,r=this.Zv;this.emit("change",null,null,this),this.Z(null,null,n,i,r,this)}},n.prototype.onActivateKeyDown=function(t){this.state.isActionable&&(this.state.isPressed=!0)},n.prototype.onActivateKeyUp=function(t){this.state.isActionable&&(this.state.isPressed&&this.onActivate(t),this.state.isPressed=!1)},n.prototype.onKeyDown=function(n){return Xi.isActivateKey(n)&&this.onActivateKeyDown(n),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyUp=function(n){return Xi.isActivateKey(n)&&this.onActivateKeyUp(n),t.prototype.onKeyUp.call(this,n)},n.prototype.getType=function(){return"DTableBodyCellButton"},n}(qw),$w={INDEX:0,TEXT:1,INTEGER:2,REAL:3,CHECK:4,CHECK_SINGLE:5,COLOR:6,BUTTON:7,SELECT:8,DATE:9,DATETIME:10,TIME:11,ACTION:12,LINK:13,TREE:14},tO=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.Jv=-1,u.Zv=n,u.qv=i,u.Z=r,u}return B(n,t),n.prototype.onActivate=function(n){t.prototype.onActivate.call(this,n),this.onValueChange(!0,!1)},n.prototype.onInactivate=function(n){t.prototype.onInactivate.call(this,n),this.onValueChange(!1,!0)},n.prototype.onValueChange=function(t,n){var i=this.$v;if(void 0!==i){var r=this.Jv,e=this.Zv,u=this.qv;u.setter(i,e,t),this.emit("change",t,n,this);var s=this.Z;s(t,n,i,r,e,this),t&&u.type===$w.CHECK_SINGLE&&this.onChangeSingle(r,e,u,s)}},n.prototype.onChangeSingle=function(t,n,i,r){var e=this,u=this.parent;if(u){var s=u.parent;if(s){var h=!1,o=i.getter,a=i.setter;s.data.each((function(i,u){return t===u||!o(i,n)||(a(i,n,!1),h=!0,r(!1,!0,i,u,n,e),!1)})),h&&s.update(!0)}}},Object.defineProperty(n.prototype,"row",{get:function(){return this.$v},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.Jv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.Zv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.qv},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.$v=n,this.Jv=r,this.state.isActive=!!t,Ww.set(this,n,e,this.qv)},n.prototype.unset=function(){this.$v=void 0,this.Jv=-1},n.prototype.getType=function(){return"DTableBodyCellCheck"},n}(Ab),nO=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.Jv=-1,u.Zv=n,u.qv=i,u.Z=r,u}return B(n,t),n.prototype.onValueChange=function(n,i){var r=this.$v;if(void 0!==r){var e=this.Jv,u=this.Zv;this.qv.setter(r,u,n),t.prototype.onValueChange.call(this,n,i),this.Z(n,i,r,e,u,this)}else t.prototype.onValueChange.call(this,n,i)},Object.defineProperty(n.prototype,"row",{get:function(){return this.$v},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.Jv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.Zv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.qv},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.$v=n,this.Jv=r;var s=this.value;if(mn(t))s.color=t,s.alpha=1;else if(at(t)){var h=Number(t);s.color=h==h?h:16777215,s.alpha=1}else if(null!=t){var o=t.color,a=t.alpha;s.color=mn(o)?o:16777215,s.alpha=mn(a)?a:1}else s.color=16777215,s.alpha=1;Ww.set(this,n,e,this.qv)},n.prototype.unset=function(){this.$v=void 0,this.Jv=-1},n.prototype.getType=function(){return"DTableBodyCellColor"},n}(Jb),iO=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.Jv=-1,u.Zv=n,u.qv=i,u.Z=r,u}return B(n,t),n.prototype.onValueChange=function(n,i){var r=this.$v;if(void 0!==r){var e=this.Jv,u=this.Zv;this.qv.setter(r,u,n),t.prototype.onValueChange.call(this,n,i),this.Z(n,i,r,e,u,this)}else t.prototype.onValueChange.call(this,n,i)},Object.defineProperty(n.prototype,"row",{get:function(){return this.$v},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.Jv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.Zv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.qv},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){if(this.$v=n,this.Jv=r,t instanceof Date)u?(this.Vs=t,this.Ws=t,this.onTextChange(),this.createOrUpdateText()):this.text=t;else if(mn(t)){var s=this.Ws;void 0===s?this.text=new Date(t):s.getTime()!==t&&(s.setTime(t),this.onTextChange(),this.createOrUpdateText())}Ww.set(this,n,e,this.qv)},n.prototype.unset=function(){this.$v=void 0,this.Jv=-1},n.prototype.getType=function(){return"DTableBodyCellDate"},n}(qb),rO=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.Jv=-1,u.Zv=n,u.qv=i,u.Z=r,u}return B(n,t),n.prototype.onValueChange=function(n,i){var r=this.$v;if(void 0!==r){var e=this.Jv,u=this.Zv;this.qv.setter(r,u,n),t.prototype.onValueChange.call(this,n,i),this.Z(n,i,r,e,u,this)}else t.prototype.onValueChange.call(this,n,i)},Object.defineProperty(n.prototype,"row",{get:function(){return this.$v},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.Jv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.Zv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.qv},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){if(this.$v=n,this.Jv=r,t instanceof Date)u?(this.Vs=t,this.Ws=t,this.onTextChange(),this.createOrUpdateText()):this.text=t;else if(mn(t)){var s=this.Ws;null==s?this.text=new Date(t):s.getTime()!==t&&(s.setTime(t),this.onTextChange(),this.createOrUpdateText())}Ww.set(this,n,e,this.qv)},n.prototype.unset=function(){this.$v=void 0,this.Jv=-1},n.prototype.getType=function(){return"DTableBodyCellDatetime"},n}(nd),eO=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.Jv=-1,u.Zv=n,u.qv=i,u.Z=r,u}return B(n,t),Object.defineProperty(n.prototype,"row",{get:function(){return this.$v},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.Jv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.Zv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.qv},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.$v=n,this.Jv=r,this.text=r,Ww.set(this,n,e,this.qv)},n.prototype.unset=function(){this.$v=void 0,this.Jv=-1},n.prototype.getType=function(){return"DTableBodyCellIndex"},n}(bs),uO=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.Jv=-1,u.Zv=n,u.qv=i,u.Z=r,u}return B(n,t),n.prototype.onValueChange=function(n,i){var r=this.$v;if(void 0!==r){var e=this.Jv,u=this.Zv;this.qv.setter(r,u,n),t.prototype.onValueChange.call(this,n,i),this.Z(n,i,r,e,u,this)}},Object.defineProperty(n.prototype,"row",{get:function(){return this.$v},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.Jv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.Zv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.qv},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.$v=n,this.Jv=r,this.text=Number(t),Ww.set(this,n,e,this.qv)},n.prototype.unset=function(){this.$v=void 0,this.Jv=-1},n.prototype.getType=function(){return"DTableBodyCellInputInteger"},n}(_s),sO=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.Jv=-1,u.Zv=n,u.qv=i,u.Z=r,u}return B(n,t),n.prototype.onValueChange=function(n,i){var r=this.$v;if(void 0!==r){var e=this.Jv,u=this.Zv;this.qv.setter(r,u,n),t.prototype.onValueChange.call(this,n,i),this.Z(n,i,r,e,u,this)}},Object.defineProperty(n.prototype,"row",{get:function(){return this.$v},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.Jv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.Zv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.qv},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.$v=n,this.Jv=r,this.text=Number(t),Ww.set(this,n,e,this.qv)},n.prototype.unset=function(){this.$v=void 0,this.Jv=-1},n.prototype.getType=function(){return"DTableBodyCellInputReal"},n}(Fs),hO=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.Jv=-1,u.Zv=n,u.qv=i,u.Z=r,u}return B(n,t),n.prototype.onValueChange=function(n,i){var r=this.$v;if(void 0!==r){var e=this.Jv,u=this.Zv;this.qv.setter(r,u,n),t.prototype.onValueChange.call(this,n,i),this.Z(n,i,r,e,u,this)}},Object.defineProperty(n.prototype,"row",{get:function(){return this.$v},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.Jv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.Zv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.qv},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.$v=n,this.Jv=r,this.text=String(t),Ww.set(this,n,e,this.qv)},n.prototype.unset=function(){this.$v=void 0,this.Jv=-1},n.prototype.getType=function(){return"DTableBodyCellInputText"},n}(zs),oO=function(t){function n(n){var i=t.call(this,n)||this;return i.zn=new Ib(i.zn),i}return B(n,t),Object.defineProperty(n.prototype,"padding",{get:function(){return this.zn},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DTableBodyCellInputTreeInput"},n}(zs),aO=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DTableBodyCellInputTreeMarker"},n}(ds),cO={START:"START",END:"END",FROZEN:"FROZEN",FROZEN_END:"FROZEN_END",SORTABLE:"SORTABLE",SORTED_ASCENDING:"SORTED_ASCENDING",SORTED_DESCENDING:"SORTED_DESCENDING",HAS_CHILDREN:"HAS_CHILDREN",OPENED:"OPENED",CHECKABLE:"CHECKABLE",SELECTABLE:"SELECTABLE"},fO=function(t){function n(n,i,r,e){var u=t.call(this,function(t){if(null!=t)return{weight:t.weight,width:t.width}}(e))||this;u.Jv=-1,u.Zv=n,u.qv=i,u.Z=r;var s=u.newInput(e);u.lh=s,u.addChild(s);var h=u.newMarker(e);return u.A=h,u.addChild(h),u}return B(n,t),n.prototype.newInput=function(t){return new oO(this.toInputOptions(t))},n.prototype.toInputOptions=function(t){var n=this;return{weight:1,text:null==t?void 0:t.text,editing:null==t?void 0:t.editing,when:null==t?void 0:t.when,cursor:null==t?void 0:t.cursor,on:{change:function(t,i){n.onInputChange(t,i)}}}},n.prototype.onInputChange=function(t,n){var i=this.$v;if(void 0!==i){var r=this.Jv,e=this.Zv;this.qv.setter(i,e,t),this.emit("change",t,n,this),this.Z(t,n,i,r,e,this)}},n.prototype.newMarker=function(t){var n=this;return new aO({visible:!1,on:{active:function(){n.onMarkerActive()}}})},n.prototype.onMarkerActive=function(){this.A.state.is(cO.HAS_CHILDREN)&&this.toggle()},Object.defineProperty(n.prototype,"row",{get:function(){return this.$v},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.Jv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.Zv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.qv},enumerable:!1,configurable:!0}),n.prototype.toggle=function(){var t=this.$v;if(void 0!==t){var n=this.parent;if(null!=n){var i=n.parent;if(null!=i){var r=i.data;r&&r.toggle&&(r.isExpanded(t)?r.collapse(t)&&(this.emit("collapse",this),r.emit("collapse",t,this)):r.expand(t)&&(this.emit("expand",this),r.emit("expand",t,this)))}}}},n.prototype.onRowSelect=function(t,n){return n.x<=this.position.x+this.lh.padding.getLeft()},n.prototype.set=function(t,n,i,r,e,u){this.$v=n,this.Jv=r;var s=this.lh;s.visible=!0,s.text=String(t);var h=this.A;if(mn(i)){var o=!!(1&i),a=!!(2&i),c=i>>2,f=h.state;f.lock(),f.set(cO.HAS_CHILDREN,a),f.set(ht.DISABLED,!a),f.set(cO.OPENED,o),f.unlock();var l=this.theme.getLevelPadding(c);h.width=l,a?h.show():h.hide(),s.padding.adjLeft(l)}else h.state.removeAll(cO.OPENED,cO.HAS_CHILDREN),h.hide(),s.padding.adjLeft(0);Ww.set(this.lh,n,e,this.qv)},n.prototype.unset=function(){this.$v=void 0,this.Jv=-1,this.lh.visible=!1,this.A.hide()},n.prototype.getType=function(){return"DTableBodyCellInputTree"},n}(Qi),lO=function(t,n){if(n)return{url:vO(t,n.url),target:n.target,checker:bO(t,n.checker),menu:n.menu}},vO=function(t,n){return at(n)||null==n?n:function(){var i=t.row;return void 0!==i?n(i,t.rowIndex,t.columnIndex,t):null}},bO=function(t,n){if(null!=n)return function(){var i=t.row;return void 0!==i&&n(i,t.rowIndex,t.columnIndex,t)}},dO=function(t){function n(n,i,r,e){var u;return t.call(this,n,i,r,Rl.toStateOptions(null===(u=null==e?void 0:e.link)||void 0===u?void 0:u.target,e))||this}return B(n,t),n.prototype.onClick=function(n){this.link.onClick(this,n)||t.prototype.onClick.call(this,n)},Object.defineProperty(n.prototype,"link",{get:function(){var t,n=this.So;return null==n&&(n=new Al(lO(this,null===(t=this.kn)||void 0===t?void 0:t.link)),this.So=n),n},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DTableBodyCellLink"},n.prototype.onActivate=function(n){t.prototype.onActivate.call(this,n),this.link.open(n)},n.prototype.open=function(t){this.link.open(t)},n}(Qw),gO=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.Jv=-1,u.Zv=n,u.qv=i,u.Z=r,u}return B(n,t),n.prototype.onValueChange=function(n,i,r){var e=this.$v;if(void 0!==e){var u=this.Jv,s=this.Zv;this.qv.setter(e,s,n),t.prototype.onValueChange.call(this,n,i,r),this.Z(n,i,e,u,s,this)}},n.prototype.onKeyDownArrowDown=function(t){return!1},Object.defineProperty(n.prototype,"row",{get:function(){return this.$v},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.Jv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.Zv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.qv},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.$v=n,this.Jv=r,this.value=t,Ww.set(this,n,e,this.qv)},n.prototype.unset=function(){this.$v=void 0,this.Jv=-1},n.prototype.getType=function(){return"DTableBodyCellSelectMenu"},n}(kw),mO=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.Jv=-1,u.Zv=n,u.qv=i,u.Z=r,u}return B(n,t),n.prototype.onValueChange=function(n,i,r){var e=this.$v;if(void 0!==e){var u=this.Jv,s=this.Zv;this.qv.setter(e,s,n),t.prototype.onValueChange.call(this,n,i,r),this.Z(n,i,e,u,s,this)}},n.prototype.onKeyDownArrowDown=function(t){return!1},Object.defineProperty(n.prototype,"row",{get:function(){return this.$v},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.Jv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.Zv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.qv},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.$v=n,this.Jv=r,this.values=t,Ww.set(this,n,e,this.qv)},n.prototype.unset=function(){this.$v=void 0,this.Jv=-1},n.prototype.getType=function(){return"DTableBodyCellSelectMultiple"},n}(yw),wO=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.Jv=-1,u.Zv=n,u.qv=i,u.Z=r,u}return B(n,t),n.prototype.onValueChange=function(n,i){var r=this.$v;if(void 0!==r){var e=this.Jv,u=this.Zv;this.qv.setter(r,u,n),t.prototype.onValueChange.call(this,n,i),this.Z(n,i,r,e,u,this)}else t.prototype.onValueChange.call(this,n,i)},Object.defineProperty(n.prototype,"row",{get:function(){return this.$v},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.Jv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.Zv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.qv},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){if(this.$v=n,this.Jv=r,t instanceof Date)u?(this.Vs=t,this.Ws=t,this.onTextChange(),this.createOrUpdateText()):this.text=t;else if(mn(t)){var s=this.Ws;null==s?this.text=new Date(t):s.getTime()!==t&&(s.setTime(t),this.onTextChange(),this.createOrUpdateText())}Ww.set(this,n,e,this.qv)},n.prototype.unset=function(){this.$v=void 0,this.Jv=-1},n.prototype.getType=function(){return"DTableBodyCellTime"},n}(Yd),OO=function(t){function n(n,i,r,e){var u,s=this;return(s=t.call(this,n,i,r,Rl.toStateOptions(null===(u=null==e?void 0:e.link)||void 0===u?void 0:u.target,e))||this).zn=new Ib(s.zn),s}return B(n,t),n.prototype.onClick=function(n){var i;!0!==(null===(i=this.link)||void 0===i?void 0:i.onClick(this,n))&&t.prototype.onClick.call(this,n)},Object.defineProperty(n.prototype,"link",{get:function(){var t=this.So;return void 0===t&&(t=this.newLink(),this.So=t),t},enumerable:!1,configurable:!0}),n.prototype.newLink=function(){var t,n=null===(t=this.kn)||void 0===t?void 0:t.link;return n?new Al(lO(this,n)):null},n.prototype.onActivate=function(n){var i;t.prototype.onActivate.call(this,n),this.state.is(cO.HAS_CHILDREN)?this.toggle():null===(i=this.link)||void 0===i||i.open(n)},n.prototype.toggle=function(){var t=this.$v;if(void 0!==t){var n=this.parent;if(null!=n){var i=n.parent;if(null!=i){var r=i.data;r&&r.toggle&&(r.isExpanded(t)?r.collapse(t)&&(this.emit("collapse",this),r.emit("collapse",t,this)):r.expand(t)&&(this.emit("expand",this),r.emit("expand",t,this)))}}}},n.prototype.onRowSelect=function(t,n){return n.x<=this.position.x+this.padding.getLeft()&&(this.toggle(),!0)},n.prototype.set=function(t,n,i,r,e,u){this.$v=n,this.Jv=r,this.text=t,Ww.set(this,n,e,this.qv,!1);var s=this.link,h=this.zn;if(mn(i)){var o=!!(1&i),a=!!(2&i),c=i>>2,f=this.state;f.lock(),f.set(cO.HAS_CHILDREN,a),f.set(cO.OPENED,o),f.unlock(),h.adjLeft(this.theme.getLevelPadding(c)),s&&(s.menu.enable=!a)}else this.state.removeAll(cO.OPENED,cO.HAS_CHILDREN),h.adjLeft(0),s&&(s.menu.enable=!1)},n.prototype.getType=function(){return"DTableBodyCellTree"},n}(Qw),pO={NONE:0,SINGLE:1,MULTIPLE:2},DO=function(t){function n(n){var i,r,e=this;return(e=t.call(this,n)||this).$n=!0,e.tb=null!==(i=n.frozen)&&void 0!==i?i:0,e.nb=null!==(r=n.columns)&&void 0!==r?r:[],e}return B(n,t),n.prototype.initCells=function(t,n,i){for(var r=this.toIndexEnd(n),e=n.length-1;0<=e;--e){var u=this.newCell(e,n[e],n,t),s=u.state;s.lock(!1),0===e&&s.add(cO.START),e===r&&s.add(cO.END),e<i&&s.add(cO.FROZEN),e===i-1&&s.add(cO.FROZEN_END),s.unlock(),this.addChild(u)}},n.prototype.toIndexEnd=function(t){for(var n=t.length,i=0;i<n;++i)if(void 0!==t[i].weight)return n-1;return n},n.prototype.onRefit=function(){t.prototype.onRefit.call(this),this.resetFrozenCellPosition()},n.prototype.updateFrozenCellPosition=function(t){for(var n=this.nb,i=this.children,r=i.length,e=this.tb,u=0;u<e;++u){var s=n[u];i[r-1-u].position.x=-t+s.offset}},n.prototype.resetFrozenCellPosition=function(){for(var t=this.nb,n=this.children,i=n.length,r=this.tb,e=this.getContentPositionX(),u=0;u<r;++u){var s=t[u],h=n[i-1-u];s.offset=h.position.x,h.position.x=-e+s.offset}},n.prototype.getClippingRect=function(n,i){t.prototype.getClippingRect.call(this,n,i);var r=this.tb;if(0<r){var e=n;if(e&&e.parent===this){var u=this.children,s=u.indexOf(e);if(0<=s&&r<=u.length-1-s){var h=u[s+1],o=h.position.x+h.width;i.x+=o,i.width-=o}}}},n.prototype.getType=function(){return"DTableRow"},n}(ws),EO=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.Qe=-1,u.ib=function(t,i,r,e,s){u.emit("change",t,i,r,e,s,u),n(t,i,r,e,s,u)},u.rb=r,u.state.isAlternated=!i,u.initCells(e,u.nb,u.tb),u}return B(n,t),n.prototype.newCell=function(t,n,i,r){var e=this.ib,u=this.rb,s=u.get(t);if(null==s&&(s=this.toCellOptions(t,n,r),u.set(t,s)),!1!==n.editing.enable)return this.newCellEditable(t,n,e,s);var h=this.newCellUnediable(t,n,e,s);return n.type!==$w.TREE&&(h.state.isReadOnly=!0),h},n.prototype.newCellEditable=function(t,n,i,r){switch(n.type){case $w.INDEX:return new eO(t,n,i,r);case $w.TEXT:return new hO(t,n,i,r);case $w.TREE:return new fO(t,n,i,r);case $w.INTEGER:return new uO(t,n,i,r);case $w.REAL:return new sO(t,n,i,r);case $w.CHECK:case $w.CHECK_SINGLE:return new tO(t,n,i,r);case $w.COLOR:return new nO(t,n,i,r);case $w.BUTTON:return new Qw(t,n,i,r);case $w.LINK:return new dO(t,n,i,r);case $w.SELECT:return this.newCellSelect(t,n,i,r);case $w.ACTION:return this.newCellAction(t,n,i,r);case $w.DATE:return new iO(t,n,i,r);case $w.DATETIME:return new rO(t,n,i,r);case $w.TIME:return new wO(t,n,i,r);default:return new qw(t,n,i,r)}},n.prototype.newCellUnediable=function(t,n,i,r){switch(n.type){case $w.INDEX:return new eO(t,n,i,r);case $w.TEXT:return new qw(t,n,i,r);case $w.TREE:return new OO(t,n,i,r);case $w.INTEGER:case $w.REAL:return new qw(t,n,i,r);case $w.CHECK:case $w.CHECK_SINGLE:return new tO(t,n,i,r);case $w.COLOR:return new nO(t,n,i,r);case $w.BUTTON:return new Qw(t,n,i,r);case $w.LINK:return new dO(t,n,i,r);case $w.SELECT:return this.newCellSelect(t,n,i,r);case $w.ACTION:return this.newCellAction(t,n,i,r);case $w.DATE:return new iO(t,n,i,r);case $w.DATETIME:return new rO(t,n,i,r);case $w.TIME:return new wO(t,n,i,r);default:return new qw(t,n,i,r)}},n.prototype.newCellSelect=function(t,n,i,r){var e=n.selecting;return null!=e.menu?new gO(t,n,i,r):null!=e.multiple?new mO(t,n,i,r):null!=e.dialog?new Xw(t,n,i,r):null!=e.promise?new Jw(t,n,i,r):new qw(t,n,i,r)},n.prototype.newCellAction=function(t,n,i,r){var e=n.selecting;return null!=e.menu?new Yw(t,n,i,r):null!=e.dialog?new Kw(t,n,i,r):null!=e.promise?new Zw(t,n,i,r):new qw(t,n,i,r)},n.prototype.toCellOptions=function(t,n,i){var r,e,u,s,h,o,a,c,f,l,v,b,d,g,m=ib(n.body,i.cell);m.weight=n.weight,m.width=n.width,null!==(r=m.state)&&void 0!==r||(m.state=n.state.initial);var w=n.formatter;null!=w&&(null!==(u=(p=null!==(e=m.text)&&void 0!==e?e:m.text={}).formatter)&&void 0!==u||(p.formatter=w));var O=n.align;if(null!=O){var p,D=null!==(h=(p=null!==(s=m.text)&&void 0!==s?s:m.text={}).align)&&void 0!==h?h:p.align={};null!==(o=D.horizontal)&&void 0!==o||(D.horizontal=O)}var E=n.editing;if(!1!==E.enable){var M=null!==(a=(g=m).editing)&&void 0!==a?a:g.editing={};null!==(c=M.formatter)&&void 0!==c||(M.formatter=E.formatter),null!==(f=M.unformatter)&&void 0!==f||(M.unformatter=E.unformatter),null!==(l=M.validator)&&void 0!==l||(M.validator=E.validator)}var S=n.link;void 0!==S&&(m.link=S);var T=n.selecting,j=null!==(v=T.menu)&&void 0!==v?v:T.multiple;return void 0!==j&&(m.menu=j),(null!==(d=null===(b=null==i?void 0:i.selection)||void 0===b?void 0:b.type)&&void 0!==d?d:pO.NONE)!==pO.NONE&&(m.when="DOUBLE_CLICKED",m.cursor=function(t){if(t.in(cO.SELECTABLE))return"pointer"}),m},n.prototype.getType=function(){return"DTableBodyRow"},Object.defineProperty(n.prototype,"value",{get:function(){return this.Rt},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"index",{get:function(){return this.Qe},enumerable:!1,configurable:!0}),n.prototype.isCell=function(t){return null!=t&&"set"in t},n.prototype.set=function(t,n,i,r){if(r||this.Rt!==t||this.Qe!==i){this.Rt=t,this.Qe=i;for(var e=this.children,u=e.length,s=this.nb,h=s.length,o=0;o<u;++o){var a=e[o],c=h-1-o,f=s[c];this.isCell(a)&&a.set(f.getter(t,c),t,n,i,c,r)}this.onSet(t,i)}},n.prototype.onSet=function(t,n){this.emit("set",t,n,this)},n.prototype.unset=function(){if(void 0!==this.Rt){this.Rt=void 0,this.Qe=-1;for(var t=this.children,n=t.length,i=0;i<n;++i){var r=t[i];this.isCell(r)&&r.unset()}this.onUnset()}},n.prototype.onUnset=function(){this.emit("unset",this)},n.prototype.getContentPositionX=function(){var t=this.parent;if(t){var n=t.parent;if(n)return n.position.x}return 0},n}(DO),MO=function(t){function n(n){var i=t.call(this)||this;return i.R=0,i.bl=-1,i.eb=!1,i.ub=-1,i.O=n,i.sf=null,i.sb=null,i}return B(n,t),Object.defineProperty(n.prototype,"id",{get:function(){return this.R},enumerable:!1,configurable:!0}),n.prototype.apply=function(){this.eb=!0,this.R+=1,this.O.update()},n.prototype.unapply=function(){this.eb&&(this.eb=!1,this.R+=1,this.O.update())},n.prototype.isApplied=function(){return this.eb},n.prototype.newFiltered=function(){var t=this.sf;if(null!=t){var n,i=[],r=this.O,e=r.sorter,u=r.rows;if(ot(t))if(n=e.indices)for(var s=0,h=n.length;s<h;++s)t(u[o=n[s]],o)&&i.push(s);else for(s=0,h=u.length;s<h;++s)t(u[s],s)&&i.push(s);else if(n=e.indices)for(s=0,h=n.length;s<h;++s){var o=n[s];t.test(u[o],o)&&i.push(s)}else for(s=0,h=u.length;s<h;++s)t.test(u[s],s)&&i.push(s);return i}return null},n.prototype.get=function(){return this.sf},n.prototype.set=function(t){this.sf!==t&&(this.sf=t)},n.prototype.toDirty=function(){this.R+=1},n.prototype.update=function(){this.R===this.bl&&this.O.sorter.id===this.ub||(this.bl=this.R,this.ub=this.O.sorter.id,this.eb?(this.sb=this.newFiltered(),this.emit("change",this)):null!=this.sb&&(this.sb=null,this.emit("change",this)))},Object.defineProperty(n.prototype,"indices",{get:function(){return this.update(),this.sb},enumerable:!1,configurable:!0}),n.prototype.map=function(t){var n=t,i=this.indices;if(i){var r=i.indexOf(n);if(!(0<=r))return null;n=r}return n},n.prototype.unmap=function(t){var n=t,i=this.indices;return i&&(n=i[n]),n},n}(t.utils.EventEmitter),SO=function(){function t(t){this.O=t}return t.prototype.map=function(t){var n=this.O,i=n.sorter.map(t);return null!=i?n.filter.map(i):null},t.prototype.unmap=function(t){var n=this.O;return n.sorter.unmap(n.filter.unmap(t))},t.prototype.size=function(){var t=this.O,n=t.filter.indices;return null!=n?n.length:t.size()},t.prototype.get=function(t){return this.O.get(this.unmap(t))},t.prototype.each=function(t,n,i){var r=this.O,e=r.rows,u=r.supplimentals,s=r.filter.indices,h=r.sorter.indices;if(n=null!=n?Math.max(0,n):0,s){var o=s.length;if(i=null!=i?Math.min(o,i):o,h)for(var a=n;a<i&&!1!==t(e[c=h[s[a]]],u?u[c]:null,a,c);++a);else for(a=n;a<i&&!1!==t(e[c=s[a]],u?u[c]:null,a,c);++a);}else if(o=e.length,i=null!=i?Math.min(o,i):o,h)for(a=n;a<i;++a){var c;if(!1===t(e[c=h[a]],u?u[c]:null,a,c))break}else for(a=n;a<i&&!1!==t(e[a],u?u[a]:null,a,a);++a);},t}(),TO=function(t,n){return t[0]-n[0]},jO=function(t){function n(n,i){var r,e=this;(e=t.call(this)||this).O=n,e.Nt=Di(null!==(r=null==i?void 0:i.type)&&void 0!==r?r:pO.NONE,pO),e.On=new Set;var u=null==i?void 0:i.on;if(u)for(var s in u){var h=u[s];h&&e.on(s,h)}return e}return B(n,t),Object.defineProperty(n.prototype,"parent",{get:function(){return this.O},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"type",{get:function(){return this.Nt},enumerable:!1,configurable:!0}),n.prototype.onChange=function(){this.O.update(),this.emit("change",this)},n.prototype.toggle=function(t){var n=this.On;n.has(t)?n.delete(t):n.add(t),this.onChange()},n.prototype.add=function(t){var n=this.On,i=n.size;n.add(t),i!==n.size&&this.onChange()},Object.defineProperty(n.prototype,"first",{get:function(){var t=this.On;if(0<t.size){var n=NaN;return t.forEach((function(t){n!=n&&(n=t)})),n}return null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"last",{get:function(){var t=this.On;if(0<t.size){var n=0;return t.forEach((function(t){n=t})),n}return null},enumerable:!1,configurable:!0}),n.prototype.addTo=function(t){var n=this.last;null!=n&&this.addRange(n,!1,t,!0)},n.prototype.addRange=function(t,n,i,r){var e=this.On,u=e.size;if(t<i)for(var s=i+(r?1:0),h=t+(n?0:1);h<s;++h)e.add(h);else for(s=t+(n?1:0),h=i+(r?0:1);h<s;++h)e.add(h);u!==e.size&&this.onChange()},n.prototype.addAll=function(t){for(var n=this.On,i=n.size,r=0,e=t.length;r<e;++r)n.add(t[r]);i!==n.size&&this.onChange()},n.prototype.contains=function(t){return this.On.has(t)},n.prototype.remove=function(t){this.On.delete(t)&&this.onChange()},n.prototype.clear=function(){var t=this.On;0<t.size&&(t.clear(),this.onChange())},n.prototype.clearAndAdd=function(t){var n=this.On;n.has(t)&&1===n.size||(n.clear(),n.add(t),this.onChange())},n.prototype.clearAndAddAll=function(t){var n=this.On;if(0<n.size||0<t.length){n.clear();for(var i=0,r=t.length;i<r;++i)n.add(t[i]);this.onChange()}},n.prototype.shift=function(t,n){var i=[],r=this.On;if(r.forEach((function(n){t<=n&&i.push(n)})),0<i.length){for(var e=0,u=i.length;e<u;++e)r.delete(i[e]);for(e=0,u=i.length;e<u;++e)r.add(i[e]+n);this.onChange()}},n.prototype.size=function(){return this.On.size},n.prototype.isEmpty=function(){return 0===this.On.size},n.prototype.each=function(t){var n=!1;this.On.forEach((function(i){n||!1===t(i)&&(n=!0)}))},Object.defineProperty(n.prototype,"indices",{get:function(){var t=[];return this.On.forEach((function(n){t.push(n)})),t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rows",{get:function(){var t=[],n=this.O;return this.On.forEach((function(i){t.push(n.get(i))})),t},enumerable:!1,configurable:!0}),n.prototype.toArray=function(){var t=[],n=this.O;return this.On.forEach((function(i){t.push([i,n.get(i)])})),t},n.prototype.toSortedArray=function(){return this.toArray().sort(TO)},n.prototype.toObject=function(){var t={},n=this.O;return this.On.forEach((function(i){t[i]=n.get(i)})),t},n.prototype.toMap=function(){var t=new Map,n=this.O;return this.On.forEach((function(i){t.set(i,n.get(i))})),t},n}(t.utils.EventEmitter),NO={ASCENDING:0,DESCENDING:1},IO=function(t){function n(n){var i=t.call(this)||this;return i.R=0,i.bl=-1,i.eb=!1,i.O=n,i.hb=null,i.ob=null,i.kt=NO.ASCENDING,i}return B(n,t),Object.defineProperty(n.prototype,"id",{get:function(){return this.R},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"order",{get:function(){return this.kt},set:function(t){this.kt=t},enumerable:!1,configurable:!0}),n.prototype.apply=function(){this.eb=!0,this.R+=1,this.O.update()},n.prototype.unapply=function(){this.eb&&(this.eb=!1,this.R+=1,this.O.update())},n.prototype.isApplied=function(){return this.eb},n.prototype.newSorted=function(){var t=this.hb;if(null!=t){for(var n=[],i=this.O.rows,r=0,e=i.length;r<e;++r)n.push(r);return n.sort(this.toComparator(i,t)),n}return null},n.prototype.toComparator=function(t,n){var i=this.kt;return ot(n)?i===NO.ASCENDING?function(i,r){return n(t[i],t[r],i,r)}:function(i,r){return n(t[r],t[i],r,i)}:i===NO.ASCENDING?function(i,r){return n.compare(t[i],t[r],i,r)}:function(i,r){return n.compare(t[r],t[i],r,i)}},n.prototype.get=function(){return this.hb},n.prototype.set=function(t){this.hb!==t&&(this.hb=t)},n.prototype.toDirty=function(){this.R+=1},n.prototype.update=function(){this.R!==this.bl&&(this.bl=this.R,this.eb?(this.ob=this.newSorted(),this.emit("change",this)):null!=this.ob&&(this.ob=null,this.emit("change",this)))},Object.defineProperty(n.prototype,"indices",{get:function(){return this.update(),this.ob},enumerable:!1,configurable:!0}),n.prototype.map=function(t){var n=t,i=this.indices;if(i){var r=i.indexOf(n);if(!(0<=r))return null;n=r}return n},n.prototype.unmap=function(t){var n=t,i=this.indices;return i&&(n=i[n]),n},n}(t.utils.EventEmitter),CO=function(n){function i(t){var i=n.call(this)||this;if(i.O=null,i.ab=i.toRows(null==t?void 0:t.rows),i.zc=new SO(i),i.Hc=i.toSelection(null==t?void 0:t.selection),i.sf=new MO(i),i.cb=new IO(i),t){var r=t.filter;r&&i.sf.set(r);var e=t.comparator;e&&i.cb.set(e);var u=t.on;if(u)for(var s in u){var h=u[s];h&&i.on(s,h)}}return i}return B(i,n),i.prototype.toSelection=function(n){return n instanceof t.utils.EventEmitter?n:ot(n)?n(this):this.newSelection(n)},i.prototype.newSelection=function(t){return new jO(this,t)},i.prototype.bind=function(t){this.O=t},i.prototype.toRows=function(t){var n=[];if(null!=t)for(var i=0,r=t.length;i<r;++i)n.push(t[i]);return n},Object.defineProperty(i.prototype,"rows",{get:function(){return this.ab},enumerable:!1,configurable:!0}),i.prototype.update=function(){var t=this.O;t&&t.update()},i.prototype.lock=function(){var t=this.O;t&&t.lock()},i.prototype.unlock=function(){var t=this.O;t&&(t.unlock(!1),t.update())},i.prototype.size=function(){return this.ab.length},i.prototype.clear=function(){var t=this.ab;0<t.length&&(t.length=0,this.lock(),this.Hc.clear(),this.cb.toDirty(),this.sf.toDirty(),this.unlock())},i.prototype.clearAndAdd=function(t){var n=this.ab;n.length=0,n.push(t),this.lock(),this.Hc.clear(),this.cb.toDirty(),this.sf.toDirty(),this.unlock()},i.prototype.clearAndAddAll=function(t){var n=this.ab;n.length=0;for(var i=0,r=t.length;i<r;++i)n.push(t[i]);this.lock(),this.Hc.clear(),this.cb.toDirty(),this.sf.toDirty(),this.unlock()},i.prototype.add=function(t,n){var i=this.ab,r=this.Hc,e=this.cb,u=this.sf;null==n?(i.push(t),this.lock(),e.toDirty(),u.toDirty(),this.unlock()):0<=n&&n<i.length&&(i.splice(n,0,t),this.lock(),r.shift(n,1),e.toDirty(),u.toDirty(),this.unlock())},i.prototype.addAll=function(t,n){var i=this.ab,r=i.length,e=this.Hc,u=this.cb,s=this.sf;if(null==n){for(var h=0,o=a=t.length;h<o;++h)i.push(t[h]);this.lock(),u.toDirty(),s.toDirty(),this.unlock()}else if(0<=n&&n<r){var a=t.length;for(h=0;h<a;++h)i.splice(n+h,0,t[h]);this.lock(),e.shift(n,a),u.toDirty(),s.toDirty(),this.unlock()}},i.prototype.get=function(t){var n=this.ab;return 0<=t&&t<n.length?n[t]:null},i.prototype.set=function(t,n){var i=this.ab;if(0<=t&&t<i.length){var r=i[t];return i[t]=n,this.lock(),this.cb.toDirty(),this.sf.toDirty(),this.unlock(),r}return null},i.prototype.remove=function(t){var n=this.ab;if(0<=t&&t<n.length){var i=n.splice(t,1)[0];return this.lock(),this.Hc.remove(t),this.cb.toDirty(),this.sf.toDirty(),this.unlock(),i}return null},i.prototype.each=function(t,n,i){var r=this.ab;n=null!=n?Math.max(0,n):0,i=null!=i?Math.min(r.length,i):r.length;for(var e=n;e<i&&!1!==t(r[e],e);++e);},Object.defineProperty(i.prototype,"selection",{get:function(){return this.Hc},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"filter",{get:function(){return this.sf},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"sorter",{get:function(){return this.cb},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"mapped",{get:function(){return this.zc},enumerable:!1,configurable:!0}),i}(t.utils.EventEmitter),AO=function(n){function i(t){var i,r=this;(r=n.call(this,t)||this).transform.position.y=null!==(i=t.offset)&&void 0!==i?i:0;var e=r.toData(t.data);r.Pt=e,e.bind(r);var u=r.theme,s=function(t,n,i){var r=n.columns||[],e=n.row;return null!=e?(null==e.height&&(e.height=t.getRowHeight()),void 0===e.columns&&(e.columns=r),null==e.frozen&&(e.frozen=n.frozen),void 0===e.selection?e.selection={type:i}:void 0===e.selection.type&&(e.selection.type=i)):e={columns:r,height:t.getRowHeight(),frozen:n.frozen,selection:{type:i}},e}(u,t,e.selection.type);return r.fb=s,r.lb=null!=s.height?s.height:u.getRowHeight(),r.nb=s.columns||[],r.vb=0,r.bb=0,r.gb=0,r.mb=!1,r.wb=!1,r.Ob=[],r.pb=function(t,n,i,r,u){e.emit("change",t,n,i,r,u,e)},r.rb=new Map,r.Pt.emit("init",r.Pt),r}return B(i,n),i.prototype.toData=function(t){return this.isData(t)?t:new CO(t)},i.prototype.isData=function(t){return null!=t&&"mapped"in t},i.prototype.onResize=function(t,i,r,e){n.prototype.onResize.call(this,t,i,r,e),this.update()},Object.defineProperty(i.prototype,"selection",{get:function(){return this.Pt.selection},enumerable:!1,configurable:!0}),i.prototype.lock=function(){this.gb+=1,1===this.gb&&(this.mb=!1,this.wb=!1)},i.prototype.unlock=function(t){this.gb-=1,0===this.gb&&(t&&this.mb&&this.update(this.wb),this.mb=!1,this.wb=!1)},i.prototype.update=function(t){if(0<this.gb)return this.mb=!0,void(t&&(this.wb=!0));var n=this.parent;if(null!=n){var i=n.parent;if(null!=i){var r=this.children,e=i.height,u=this.lb,s=this.Pt,h=s.mapped.size(),o=this.vb,a=this.bb,c=a-o,f=this.transform.position.y,l=f+h*u,v=Math.max(e,l),b=Math.max(e-v,n.position.y),d=-b/u,g=(e-(b+f))/u,m=Math.floor(d);m-=m%2==0?2:1;var w=Math.floor(g),O=(w+=(w-m)%2==1?3:2)-m;if(O<c&&c-2<=O&&(w=m+(O=c)),c<O){for(var p=c;p<O;++p){var D=o+p,E=this.newRow(D%2==0);this.addChild(E)}a=o+(c=O)}else if(O<c){for(p=c-1;O<=p;--p)this.removeChild(r[p]);a=o+(c=O)}this.vb=m,this.bb=w;var M=m-o,S=Math.abs(M),T=r.length;if(0<S&&S<T){var j=this.Ob;if(0<M){for(p=0;p<S;++p)j.push(this.resetRow(r[p]));for(p=S;p<T;++p)r[p-S]=r[p];for(p=0;p<S;++p)r[T-S+p]=j[p]}else{for(p=0;p<S;++p)j.push(this.resetRow(r[T-S+p]));for(p=T-S-1;0<=p;--p)r[p+S]=r[p];for(p=0;p<S;++p)r[p]=j[p]}j.length=0}var N=s.selection,I=N.type!==pO.NONE;for(s.mapped.each((function(n,i,e,s){var h=r[e-m];h.position.y=e*u;var o=h.state;o.lock(),o.set(cO.SELECTABLE,I),o.set(ht.ACTIVE,N.contains(s)),o.remove(ht.DISABLED),o.unlock(),h.set(n,i,s,t)}),m,m+T),p=0;m+p<0&&p<T;++p)(C=r[p]).position.y=(m+p)*u,(A=C.state).lock(),A.add(ht.DISABLED),A.removeAll(cO.SELECTABLE,ht.ACTIVE),A.unlock(),C.unset();for(p=T-1;h<=m+p&&0<=p;--p){var C,A;(C=r[p]).position.y=(m+p)*u,(A=C.state).lock(),A.add(ht.DISABLED),A.removeAll(cO.SELECTABLE,ht.ACTIVE),A.unlock(),C.unset()}this.lock(),n.position.y=b,n.height=v,this.height=l,this.unlock(!1),this.emit("update",d,g,this)}}},i.prototype.resetRow=function(t){t.blur(!0);for(var n=t.children,i=0,r=n.length;i<r;++i){var e=n[i];e instanceof Qi&&(e.state.isPressed=!1)}return t},i.prototype.newRow=function(t){return new EO(this.pb,t,this.rb,this.fb)},i.prototype.onParentMove=function(t,i,r,e){n.prototype.onParentMove.call(this,t,i,r,e),this.updateFrozenCellPosition(t)},i.prototype.updateFrozenCellPosition=function(t){var n=this.fb.frozen;if(null!=n&&0<n)for(var i=this.children,r=0,e=i.length;r<e;++r)i[r].updateFrozenCellPosition(t)},i.prototype.getClippingRect=function(t,i){n.prototype.getClippingRect.call(this,t,i);var r=this.parent;if(r){var e=-r.transform.position.y;i.y+=e,i.height-=e}},i.prototype.toRowIndexMapped=function(t){return 0<=this.parent.position.y+t.y?Math.floor(t.y/this.lb):-1},i.prototype.toRow=function(t){var n=t-this.vb,i=this.children;return 0<=n&&n<i.length?i[n]:null},i.prototype.toCell=function(t,n){for(var i=t.children,r=i.length,e=this.nb.length,u=0,s=Math.min(r,e);u<s;++u){var h=i[r-u-1],o=n.x-h.position.x;if(0<=o&&o<=h.width)return h}return null},i.prototype.onRowClick=function(t){if(this.state.isActionable){var n=i.WORK_ON_CLICK;n.copyFrom(t.data.global),this.toLocal(n,void 0,n,!1);var r=this.toRowIndexMapped(n);if(0<=r&&r<this.Pt.mapped.size()){var e=this.toRow(r);if(e){var u=this.toCell(e,n);if(u&&u.onRowSelect&&u.onRowSelect(t,n))return}this.onRowSelect(t,r)}}},i.prototype.onRowSelect=function(t,n){var i=this.Pt,r=i.selection,e=r.type===pO.SINGLE,u=!e,s=i.mapped.unmap(n),h=t.data.originalEvent,o=h.ctrlKey,a=h.shiftKey;if(e||r.isEmpty()||!u||!o&&!a)r.clearAndAdd(s);else if(o)r.toggle(s);else if(a){var c=r.last;if(null!=c){var f=i.sorter,l=i.filter,v=f.map(s),b=f.map(c);if(null!=v&&null!=b){var d=b+1,g=v+1;if(v<b&&(d=v,g=b),d<g){var m=[],w=l.indices,O=f.indices;if(w)if(O)for(var p=0,D=w.length;p<D;++p)d<=(E=w[p])&&E<g&&m.push(O[E]);else for(p=0,D=w.length;p<D;++p){var E;d<=(E=w[p])&&E<g&&m.push(E)}else if(O)for(p=d;p<g;++p)m.push(O[p]);else for(p=d;p<g;++p)m.push(p);r.addAll(m)}}}}},i.prototype.onDblClick=function(t,i){return n.prototype.onDblClick.call(this,t,i)},i.prototype.getType=function(){return"DTableBody"},Object.defineProperty(i.prototype,"data",{get:function(){return this.Pt},enumerable:!1,configurable:!0}),i.WORK_ON_CLICK=new t.Point,i}(Qi),RO=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DTableCategoryCell"},n}(gl),LO=function(t){function n(n){var i,r=this;r=t.call(this,n)||this;var e=null!==(i=n.offset)&&void 0!==i?i:0;return r.rn=e,r.transform.position.y=e,r.initCells(n,r.nb,r.tb),r}return B(n,t),n.prototype.onParentMove=function(n,i,r,e){t.prototype.onParentMove.call(this,n,i,r,e),this.transform.position.y=-i+this.rn,this.updateFrozenCellPosition(n)},n.prototype.getContentPositionX=function(){var t=this.parent;return t?t.position.x:0},n.prototype.newCell=function(t,n,i,r){return new RO(this.toCellOptions(t,n,r))},n.prototype.toCellOptions=function(t,n,i){var r=i.cell;if(r){r.weight=n.weight,r.width=n.width;var e=r.text||{};return r.text=e,e.value=e.value||n.label,r}return{weight:n.weight,width:n.width,text:{value:n.label}}},n.prototype.getType=function(){return"DTableCategory"},n}(DO),yO=function(t){function n(n){var i=t.call(this)||this;return i.R=0,i.bl=-1,i.eb=!1,i.O=n,i.sf=null,i.sb=null,i}return B(n,t),Object.defineProperty(n.prototype,"id",{get:function(){return this.R},enumerable:!1,configurable:!0}),n.prototype.apply=function(){this.eb=!0,this.R+=1,this.O.update()},n.prototype.unapply=function(){this.eb&&(this.eb=!1,this.R+=1,this.O.update())},n.prototype.isApplied=function(){return this.eb},n.prototype.isFiltered=function(t,n,i){return ot(i)?i(t,n):i.test(t,n)},n.prototype.hasFiltered=function(t,n,i){for(var r=this.O.accessor.toChildren,e=0,u=n.length;e<u;++e){var s=n[e];if(this.isFiltered(s,-1,i))return!0;var h=r(s);if(null!=h&&0<h.length&&this.hasFiltered(t,h,i))return!0}return!1},n.prototype.addAllToFiltered=function(t,n,i,r){for(var e=this.O.accessor.toChildren,u=0,s=n.length;u<s;++u){var h=n[u];i.push(r[0]),r[0]+=1;var o=e(h);null!=o&&0<o.length&&t.isOpened(h)&&this.addAllToFiltered(t,o,i,r)}},n.prototype.newFilteredSub=function(t,n,i,r,e){for(var u=!1,s=this.O.accessor.toChildren,h=0,o=n.length;h<o;++h){var a=n[h],c=e[0];e[0]+=1;var f=this.isFiltered(a,c,i),l=s(a);if(null!=l&&0<l.length)if(t.isOpened(a))if(f)r.push(c),u=!0,this.addAllToFiltered(t,l,r,e);else{var v=r.length;this.newFilteredSub(t,l,i,r,e)&&(r.splice(v,0,c),u=!0)}else(f||this.hasFiltered(t,l,i))&&(r.push(c),u=!0);else f&&(r.push(c),u=!0)}return u},n.prototype.newFiltered=function(){var t=this.sf;if(null!=t){var n=[],i=this.O,r=i.nodes;return r&&this.newFilteredSub(i,r,t,n,[0]),n}return null},n.prototype.get=function(){return this.sf},n.prototype.set=function(t){this.sf!==t&&(this.sf=t)},n.prototype.toDirty=function(){this.R+=1},n.prototype.update=function(){this.R!==this.bl&&(this.bl=this.R,this.eb?(this.sb=this.newFiltered(),this.emit("change",this)):null!=this.sb&&(this.sb=null,this.emit("change",this)))},Object.defineProperty(n.prototype,"indices",{get:function(){return this.update(),this.sb},enumerable:!1,configurable:!0}),n.prototype.map=function(t){var n=t,i=this.indices;if(i){var r=i.indexOf(n);if(!(0<=r))return null;n=r}return n},n.prototype.unmap=function(t){var n=t,i=this.indices;return i&&(n=i[n]),n},n}(t.utils.EventEmitter),kO=function(t){return t.parent},xO=function(t){return t.children},BO=function(t){var n,i;this.toParent=null!==(n=null==t?void 0:t.toParent)&&void 0!==n?n:kO,this.toChildren=null!==(i=null==t?void 0:t.toChildren)&&void 0!==i?i:xO},_O=function(t,n){return t[0]-n[0]},PO=function(t){function n(n,i){var r,e=this;(e=t.call(this)||this).O=n,e.Nt=Di(null!==(r=null==i?void 0:i.type)&&void 0!==r?r:pO.NONE,pO),e.ab=new Set;var u=null==i?void 0:i.on;if(u)for(var s in u){var h=u[s];h&&e.on(s,h)}return e}return B(n,t),Object.defineProperty(n.prototype,"parent",{get:function(){return this.O},enumerable:!1,configurable:!0}),n.prototype.onNodeChange=function(t){if(null!=t){var n=this.O.accessor.toChildren,i=this.ab,r=this.newRows(t,n,i,new Set);i.size!==r.size&&(this.ab=r,this.onChange())}else{var e=this.ab;0<e.size&&(e.clear(),this.onChange())}},n.prototype.newRows=function(t,n,i,r){for(var e=0,u=t.length;e<u;++e){var s=t[e];i.has(s)&&r.add(s);var h=n(s);null!=h&&this.newRows(h,n,i,r)}return r},Object.defineProperty(n.prototype,"indices",{get:function(){var t=this.ab,n=[];return this.O.each((function(i,r){t.has(i)&&n.push(r)})),n},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rows",{get:function(){var t=[];return this.ab.forEach((function(n){t.push(n)})),t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"type",{get:function(){return this.Nt},enumerable:!1,configurable:!0}),n.prototype.getFirst=function(){var t=this.ab;if(0<t.size){var n=null;return t.forEach((function(t){null==n&&(n=t)})),n}return null},n.prototype.getLast=function(){var t=this.ab;if(0<t.size){var n=null;return t.forEach((function(t){n=t})),n}return null},n.prototype.toIndex=function(t){var n=null;return this.O.each((function(i,r){return t!==i||(n=r,!1)})),n},Object.defineProperty(n.prototype,"first",{get:function(){var t=this.getFirst();return t?this.toIndex(t):null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"last",{get:function(){var t=this.getLast();return t?this.toIndex(t):null},enumerable:!1,configurable:!0}),n.prototype.onChange=function(){this.O.update(),this.emit("change",this)},n.prototype.toggle=function(t){var n=this.O.get(t);if(n){var i=this.ab;i.has(n)?i.delete(n):i.add(n),this.onChange()}},n.prototype.add=function(t){var n=this.O.get(t);if(n){var i=this.ab;i.has(n)||(i.add(n),this.onChange())}},n.prototype.addTo=function(t){var n=this.last;null!=n&&this.addRange(n,!1,t,!0)},n.prototype.addRange=function(t,n,i,r){var e=this.ab,u=e.size,s=this.O;t<i?s.each((function(t){e.add(t)}),t+(n?0:1),i+(r?1:0)):s.each((function(t){e.add(t)}),i+(r?0:1),t+(n?1:0)),u!==e.size&&this.onChange()},n.prototype.addAll=function(t){if(0<t.length){for(var n=this.ab,i=this.O,r=0,e=t.length;r<e;++r){var u=i.get(t[r]);u&&n.add(u)}this.onChange()}},n.prototype.contains=function(t){var n=this.O.get(t);return!!n&&this.ab.has(n)},n.prototype.remove=function(t){var n=this.O.get(t);if(n){var i=this.ab;i.has(n)&&(i.delete(n),this.onChange())}},n.prototype.clear=function(){var t=this.ab;0<t.size&&(t.clear(),this.onChange())},n.prototype.clearAndAdd=function(t){var n=this.O.get(t);if(n){var i=this.ab;i.has(n)?1<i.size&&(i.clear(),i.add(n),this.onChange()):(i.clear(),i.add(n),this.onChange())}},n.prototype.clearAndAddAll=function(t){var n=this.ab;if(0<n.size||0<t.length){n.clear();for(var i=this.O,r=0,e=t.length;r<e;++r){var u=i.get(t[r]);u&&n.add(u)}this.onChange()}},n.prototype.shift=function(t,n){},n.prototype.size=function(){return this.ab.size},n.prototype.isEmpty=function(){return this.ab.size<=0},n.prototype.each=function(t){var n=this.ab;this.O.each((function(i,r){return!n.has(i)||!1!==t(r)}))},n.prototype.toArray=function(){var t=this.ab,n=[];return this.O.each((function(i,r){t.has(i)&&n.push([r,i])})),n},n.prototype.toSortedArray=function(){return this.toArray().sort(_O)},n.prototype.toObject=function(){var t=this.ab,n={};return this.O.each((function(i,r){t.has(i)&&(n[r]=i)})),n},n.prototype.toMap=function(){var t=this.ab,n=new Map;return this.O.each((function(i,r){t.has(i)&&n.set(r,i)})),n},n}(t.utils.EventEmitter),UO=function(t){function n(){return t.call(this)||this}return B(n,t),Object.defineProperty(n.prototype,"id",{get:function(){return 0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"order",{get:function(){return NO.ASCENDING},set:function(t){},enumerable:!1,configurable:!0}),n.prototype.apply=function(){},n.prototype.unapply=function(){},n.prototype.isApplied=function(){return!1},n.prototype.get=function(){return null},n.prototype.set=function(t){},n.prototype.toDirty=function(){},n.prototype.update=function(){},Object.defineProperty(n.prototype,"indices",{get:function(){return null},enumerable:!1,configurable:!0}),n.prototype.map=function(t){return t},n.prototype.unmap=function(t){return t},n}(t.utils.EventEmitter),FO=function(n){function i(t){var i=n.call(this)||this;if(i.O=null,i.Uc=i.toAccessor(t),i.zc=new SO(i),i.ab=[],i.Db=!1,i.Eb=[],i.Mb=new WeakMap,i.$n=!!(null==t?void 0:t.reverse),i.Hc=i.toSelection(null==t?void 0:t.selection),i.sf=new yO(i),i.cb=new UO,t){var r=t.filter;r&&i.sf.set(r);var e=t.on;if(e)for(var u in e){var s=e[u];s&&i.on(u,s)}}return i.nodes=null==t?void 0:t.nodes,i}return B(i,n),i.prototype.toSelection=function(n){return n instanceof t.utils.EventEmitter?n:ot(n)?n(this):this.newSelection(n)},i.prototype.newSelection=function(t){return new PO(this,t)},i.prototype.toAccessor=function(t){return new BO(t)},i.prototype.bind=function(t){this.O=t},Object.defineProperty(i.prototype,"nodes",{get:function(){return this.Sb},set:function(t){this.Sb=t,this.Db=!0,this.Hc.onNodeChange(t),this.sf.toDirty(),this.update(!0)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"rows",{get:function(){return this.Db&&(this.Db=!1,this.updateRows(this.Sb)),this.ab},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"supplimentals",{get:function(){return this.Eb},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"accessor",{get:function(){return this.Uc},enumerable:!1,configurable:!0}),i.prototype.updateRows=function(t){var n=this.ab,i=this.Eb,r=this.Mb;if(null!=t){var e=this.newRows(t,0,0,n,i,r,this.$n,this.Uc.toChildren);e!==n.length&&(n.length=e,i.length=e)}else n.length=0,i.length=0},i.prototype.toSupplimental=function(t,n,i){return t<<2|(n?2:0)|(i?1:0)},i.prototype.newRows=function(t,n,i,r,e,u,s,h){for(var o=t.length,a=s?-1:1,c=s?o-1:0;0<=c&&c<o;c+=a){var f=t[c],l=h(f),v=u.has(f),b=this.toSupplimental(i,!!(l&&0<l.length),v);n<r.length?(r[n]=f,e[n]=b):(r.push(f),e.push(b)),n+=1,v&&l&&(n=this.newRows(l,n,i+1,r,e,u,s,h))}return n},i.prototype.update=function(t){var n=this.O;n&&n.update(t)},i.prototype.size=function(){return this.rows.length},i.prototype.get=function(t){var n=this.rows;return 0<=t&&t<n.length?n[t]:null},i.prototype.expand=function(t){var n=this.Mb;return!n.has(t)&&(n.set(t,1),this.Db=!0,this.sf.toDirty(),this.update(!0),!0)},i.prototype.collapse=function(t){var n=this.Mb;return!!n.has(t)&&(n.delete(t),this.Db=!0,this.sf.toDirty(),this.update(!0),!0)},i.prototype.isCollapsed=function(t){return!this.Mb.has(t)},i.prototype.isExpanded=function(t){return this.Mb.has(t)},i.prototype.toggle=function(t){return this.isExpanded(t)?this.collapse(t):this.expand(t)},i.prototype.open=function(t){return this.expand(t)},i.prototype.close=function(t){return this.collapse(t)},i.prototype.isOpened=function(t){return this.isExpanded(t)},i.prototype.each=function(t,n,i){var r=this.rows;n=null!=n?Math.max(0,n):0,i=null!=i?Math.min(r.length,i):r.length;for(var e=n;e<i&&!1!==t(r[e],e);++e);},Object.defineProperty(i.prototype,"selection",{get:function(){return this.Hc},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"filter",{get:function(){return this.sf},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"sorter",{get:function(){return this.cb},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"mapped",{get:function(){return this.zc},enumerable:!1,configurable:!0}),i}(t.utils.EventEmitter),GO=function(){function t(t,n){var i,r,e;this.O=t,this.rs=null!==(i=null==n?void 0:n.enable)&&void 0!==i&&i,this.Tb=null===(r=null==n?void 0:n.filterable)||void 0===r||r,this.jb=null===(e=null==n?void 0:n.emittable)||void 0===e||e}return Object.defineProperty(t.prototype,"isEnabled",{get:function(){return this.rs},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isFilterable",{get:function(){return this.Tb},set:function(t){this.Tb=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isEmittable",{get:function(){return this.jb},set:function(t){this.jb=t},enumerable:!1,configurable:!0}),t.prototype.newIteratee=function(t,n){var i=this.O,r=i.column,e=i.columnIndex;if(null!=r&&null!=e){var u=r.getter,s=r.setter;if(this.jb){var h=t.data;return function(t,i){return u(t,e)!==n&&(s(t,e,n),h.emit("change",n,!n,t,i,e,h),!0)}}return function(t){return u(t,e)!==n&&(s(t,e,n),!0)}}return null},t.prototype.execute=function(t){var n,i=null===(n=this.O.header)||void 0===n?void 0:n.table;if(i){var r=this.newIteratee(i,t);if(r){var e=!1;this.Tb?i.data.mapped.each((function(t,n,i,u){r(t,u)&&(e=!0)})):i.data.each((function(t,n){r(t,n)&&(e=!0)})),e&&i.body.update(!0)}}},t}(),HO=t.interaction.InteractionEvent,zO=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return B(i,n),i.prototype.init=function(t){null!=t?(this.hh=t.header,this.qv=t.column,this.Zv=t.columnIndex,this.Nb=new GO(this,t.check)):this.Nb=new GO(this),n.prototype.init.call(this,t),this.initOnClick(t)},Object.defineProperty(i.prototype,"column",{get:function(){return this.qv},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"columnIndex",{get:function(){return this.Zv},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"header",{get:function(){return this.hh},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"check",{get:function(){return this.Nb},enumerable:!1,configurable:!0}),i.prototype.initOnClick=function(t){var n=this,i=this.qv;if(i){var r=i.sorting.enable,e=this.Nb.isEnabled;if(e||r){this.on(Ki.tap,(function(t){n.onClick(t)}));var u=this.state;u.lock(),u.set(cO.SORTABLE,r),u.set(cO.CHECKABLE,e),u.unlock()}}},Object.defineProperty(i.prototype,"sorter",{get:function(){var t=this,n=this.cb;if(null==n){var i=this.hh;if(!i)return null;var r=i.table;if(!r)return null;n=r.data.sorter,this.cb=n,this.Ib=this.Ib||function(){t.onSorterChange()},n.on("change",this.Ib)}return n},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"comparator",{get:function(){var t=this.qv;return t&&t.sorting.comparator||null},enumerable:!1,configurable:!0}),i.prototype.onSorterChange=function(){var t=this.comparator;if(t){var n=this.cb;if(n){var i=cO.SORTED_ASCENDING,r=cO.SORTED_DESCENDING;n.isApplied()&&n.get()===t?n.order===NO.ASCENDING?this.state.set(i,r):this.state.set(r,i):this.state.removeAll(i,r)}}},i.prototype.toClickPosition=function(n){var i=this.Cb||new t.Point;return this.Cb=i,n.data.getLocalPosition(this,i).x},i.prototype.isCheckClicked=function(t){if(t instanceof HO&&this.Nb.isEnabled){if(!this.isSortable)return!0;var n=this.Qs[1];if(n&&null!=n.image){var i=this.toClickPosition(t),r=n.bound,e=n.margin.horizontal;return r.left-e<=i&&i<=r.right+e}}return!1},i.prototype.onClick=function(t){this.state.isActionable&&this.activate(t)},i.prototype.activate=function(t){this.onActivate(t)},i.prototype.onActivate=function(t){this.isCheckClicked(t)?(this.onToggleStart(),this.onToggleEnd()):(this.doSort(t),this.emit("active",this))},i.prototype.doSort=function(t){if(this.isSortable){var n=this.comparator;if(n){var i=this.sorter;i&&(i.get()===n?i.order===NO.ASCENDING?(i.order=NO.DESCENDING,i.apply()):(i.set(null),i.apply()):(i.set(n),i.order=NO.ASCENDING,i.apply()))}}},Object.defineProperty(i.prototype,"isSortable",{get:function(){var t=this.qv;return!!t&&t.sorting.enable},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"isToggle",{get:function(){return this.Nb.isEnabled},enumerable:!1,configurable:!0}),i.prototype.toggle=function(){this.state.isActionable&&this.isToggle&&(this.onToggleStart(),this.onToggleEnd())},i.prototype.onToggleStart=function(){this.state.isActive=!this.state.isActive},i.prototype.onToggleEnd=function(){this.state.isActive?(this.Nb.execute(!0),this.emit("active",this)):(this.Nb.execute(!1),this.emit("inactive",this))},i.prototype.onActivateKeyDown=function(t){this.state.isActionable&&(this.isToggle?this.onToggleStart():this.state.isPressed=!0)},i.prototype.onActivateKeyUp=function(t){this.state.isActionable&&(this.isToggle?this.onToggleEnd():(this.state.isPressed&&this.activate(t),this.state.isPressed=!1))},i.prototype.onKeyDown=function(t){return Xi.isActivateKey(t)&&this.onActivateKeyDown(t),n.prototype.onKeyDown.call(this,t)},i.prototype.onKeyUp=function(t){return Xi.isActivateKey(t)&&this.onActivateKeyUp(t),n.prototype.onKeyUp.call(this,t)},i.prototype.getType=function(){return"DTableHeaderCell"},i.prototype.destroy=function(){var t=this.cb,i=this.Ib;t&&i&&t.off("change",i),this.cb=void 0,this.Ib=void 0,n.prototype.destroy.call(this)},i}(gl),VO=function(t){function n(n){var i,r,e=this;(e=t.call(this,n)||this).Ab=null!==(i=n.table)&&void 0!==i?i:null;var u=null!==(r=n.offset)&&void 0!==r?r:0;return e.rn=u,e.transform.position.y=u,e.initCells(n,e.nb,e.tb),e}return B(n,t),Object.defineProperty(n.prototype,"table",{get:function(){return this.Ab},enumerable:!1,configurable:!0}),n.prototype.onParentMove=function(n,i,r,e){t.prototype.onParentMove.call(this,n,i,r,e),this.transform.position.y=-i+this.rn,this.updateFrozenCellPosition(n)},n.prototype.getContentPositionX=function(){var t=this.parent;return t?t.position.x:0},n.prototype.newCell=function(t,n,i,r){return new zO(this.toCellOptions(t,n,r))},n.prototype.toCellOptions=function(t,n,i){var r=n.header||i.cell;return null!=r?(void 0===r.weight&&(r.weight=n.weight),void 0===r.width&&(r.width=n.width),void 0===r.text?r.text={value:n.label}:void 0===r.text.value&&(r.text.value=n.label),void 0===r.header&&(r.header=this),void 0===r.column&&(r.column=n),void 0===r.columnIndex&&(r.columnIndex=t),r):{weight:n.weight,width:n.width,text:{value:n.label},header:this,column:n,columnIndex:t}},n.prototype.getType=function(){return"DTableHeader"},n}(DO),WO=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getOffsetVerticalStart=function(t){return.5*t+this.O.body.position.y},n}(Ld),XO=function(t,n){return t[n]},KO=function(t,n,i){t[n]=i},YO=function(){return""},JO=function(){},ZO=function(t){if(null!=t){var n=t.length;if(n<=1){var i=t[0];return function(t){return i in t}}return function(i){for(var r=0;r<n;++r){var e=t[r];if(!(e in i))return!1;i=i[e]}return!0}}return function(t,n){return n<t.length}},qO=function(t,n){return at(t)?ZO(n):null!=t&&t},QO=function(t,n){var i,r=t.editing,e=t.editable;return r?{enable:qO(null!==(i=r.enable)&&void 0!==i?i:e,n),formatter:r.formatter,unformatter:r.unformatter,validator:r.validator}:{enable:qO(e,n)}},$O=function(t,n){return function(i,r){var e=t(i,n),u=t(r,n);return e<u?-1:u<e?1:0}},tp=function(t,n,i){var r=i.sorting,e=i.sortable;return r?r.enable||e?{enable:!0,comparator:r.comparator||$O(t,n)}:{enable:!1}:e?{enable:!0,comparator:$O(t,n)}:{enable:!1}},np=function(t){return null==t?void 0:t instanceof qm?t:new qm(t)},ip=function(t){return null==t?void 0:"open"in t?t:new Vd(t)},rp=function(t){return t.value},ep=function(){},up=function(t){return t?{getter:t.getter||rp,setter:t.setter||ep,menu:np(t.menu),multiple:np(t.multiple),dialog:ip(t.dialog),promise:t.promise}:{getter:rp,setter:ep}},sp=function(t){var n=t.state;return null!=n?at(n)||Rt(n)?{initial:n,modifier:void 0}:{initial:void 0,modifier:n}:{initial:void 0,modifier:void 0}},hp=function(t,n){var i=t.renderable;return at(i)?ZO(n):null==i||i},op=function(t,n){var i,r=n.weight,e=n.width;null!=r?null!=e&&(e=void 0):null==e&&(r=1);var u=Di(null!==(i=n.type)&&void 0!==i?i:$w.TEXT,$w),s=function(t,n){var i=t.align;if(null!=i)return at(i)?Wu[i]:i;switch(n){case $w.TEXT:return Wu.LEFT;case $w.REAL:case $w.INTEGER:return Wu.RIGHT;case $w.BUTTON:case $w.INDEX:case $w.SELECT:case $w.ACTION:case $w.LINK:case $w.CHECK:case $w.CHECK_SINGLE:case $w.COLOR:return Wu.CENTER;default:return Wu.LEFT}}(n,u),h=n.label||"",o=function(t){return null!=t.path?t.path.split("."):null}(n),a=function(t,n,i){var r=t.getter;if(r)return r;switch(n){case $w.ACTION:case $w.LINK:return YO;default:return null==i?XO:function(t,n){if(t.length<=1){var i=t[0];return void 0===n?function(t){return t[i]}:function(t){return i in t?t[i]:n}}return void 0===n?function(n){for(var i=0,r=t.length-1;i<r;++i)n=n[t[i]];return n[t[t.length-1]]}:function(i){for(var r=0,e=t.length-1;r<e;++r)i=i[t[r]];var u=t[t.length-1];return u in i?i[u]:n}}(i,t.default)}}(n,u,o);return{weight:r,width:e,type:u,label:h,getter:a,setter:function(t,n,i){var r=t.setter;if(r)return r;switch(n){case $w.BUTTON:case $w.ACTION:case $w.LINK:return JO;default:return null==i?KO:function(t){if(t.length<=1){var n=t[0];return function(t,i,r){t[n]=r}}return function(n,i,r){for(var e=0,u=t.length-1;e<u;++e)n=n[t[e]]||{};n[t[t.length-1]]=r}}(i)}}(n,u,o),formatter:n.formatter,renderable:hp(n,o),align:s,state:sp(n),editing:QO(n,o),sorting:tp(a,t,n),header:n.header,body:n.body,selecting:up(n.selecting),category:n.category,frozen:n.frozen,offset:0,link:n.link}},ap=function(t){function n(n){var i=t.call(this,n)||this,r=i.content;r.setWidth(i.toContentWidth(n));var e=i.body;r.addChild(e),e.data.selection.type!==pO.NONE&&i.on(Ki.tap,(function(t){e.onRowClick(t)}));var u=i.header;u&&r.addChild(u);for(var s=i.categories,h=s.length-1;0<=h;--h)r.addChild(s[h]);return e.update(),i}return B(n,t),Object.defineProperty(n.prototype,"columns",{get:function(){var t=this.nb;if(null==t){var n=this.kn;t=n?function(t){for(var n=[],i=0,r=t.length;i<r;++i)n.push(op(i,t[i]));return n}(n.columns):[],this.nb=t}return t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"frozen",{get:function(){var t=this.tb;return null==t&&(t=function(t){for(var n=t.length-1;0<=n;--n)if(!0===t[n].frozen)return n+1;return 0}(this.columns),this.tb=t),t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"categories",{get:function(){var t=this.Rb;return null==t&&(t=this.newCategories(this.kn,this.columns,this.frozen),this.Rb=t),t},enumerable:!1,configurable:!0}),n.prototype.initContent=function(n){t.prototype.initContent.call(this,n),n.state.isFocusReverse=!0},n.prototype.onContentChange=function(){t.prototype.onContentChange.call(this),this.body.update()},n.prototype.onResize=function(n,i,r,e){var u=this.scrollbar;u.lock();var s=this.body;s.lock(),t.prototype.onResize.call(this,n,i,r,e),s.update(),s.unlock(!0),u.unlock(!0)},n.prototype.getCategoryCount=function(t){for(var n=0,i=0,r=t.length;i<r;++i){var e=t[i].category;if(null!=e){var u=at(e)?1:e.length;n=Math.max(n,u)}}return n},n.prototype.toCategoryLabel=function(t,n){if(n)if(at(n)){if(0===t)return n}else if(t<n.length)return n[t]},n.prototype.isSameCategory=function(t,n,i){if(null!=n){if(null!=i){if(at(n))return at(i)?0<t||n===i:0<t?i.length<=t:1===i.length&&n===i[0];if(at(i))return 0<t?n.length<=t:1===n.length&&n[0]===i;if(n.length<=t&&i.length<=t)return!0;if(i.length===n.length){for(var r=t,e=n.length;r<e;++r)if(n[r]!==i[r])return!1;return!0}return!1}return at(n)?0<t:n.length<=t}return null==i||(at(i)?0<t:i.length<=t)},n.prototype.toCategoryColumns=function(t,n,i){for(var r=[],e=null,u=null,s=0,h=n.length;s<h;++s){var o=n[s];s!==i&&u&&e&&this.isSameCategory(t,e.category,o.category)?null!=u.weight&&null!=o.weight?u.weight+=o.weight:null!=u.width&&null!=o.width?u.width+=o.width:(e=o,u={label:this.toCategoryLabel(t,o.category),weight:o.weight,width:o.width,offset:0},r.push(u)):(e=o,u={label:this.toCategoryLabel(t,o.category),weight:o.weight,width:o.width,offset:0},r.push(u))}return r},n.prototype.toCategoryOptions=function(t,n,i,r,e){return n?(void 0===n.columns&&(n.columns=this.toCategoryColumns(t,i,r)),null==n.frozen&&(n.frozen=r),null==n.offset&&(n.offset=e),n):{columns:this.toCategoryColumns(t,i,r),frozen:r,offset:e}},n.prototype.newCategories=function(t,n,i){for(var r=[],e=0,u=this.getCategoryCount(n)-1;0<=u;--u){var s=new LO(this.toCategoryOptions(u,null==t?void 0:t.category,n,i,e));r.push(s),e+=s.height}return r},n.prototype.onDblClick=function(n,i){var r=this.body.onDblClick(n,i);return t.prototype.onDblClick.call(this,n,i)||r},n.prototype.newScrollBar=function(t){var n=this;return new WO(this,t,(function(t){n.onScrollBarUpdate(t)}))},n.prototype.toContentWidth=function(t){var n=0,i=null==t?void 0:t.columns;if(i)for(var r=0,e=i.length;r<e;++r){var u=i[r].width;null!=u&&(n+=u)}return 0<n?function(t){return Math.max(t,n)}:"100%"},n.prototype.getHeaderOffset=function(){var t=this.Lb;return null==t&&(t=this.newHeaderOffset(),this.Lb=t),t},n.prototype.newHeaderOffset=function(){for(var t=0,n=this.categories,i=0,r=n.length;i<r;++i)t+=n[i].height;return t},Object.defineProperty(n.prototype,"header",{get:function(){var t=this.hh;return void 0===t&&(t=this.newHeader(this.kn,this.columns,this.frozen,this.getHeaderOffset()),this.hh=t),t},enumerable:!1,configurable:!0}),n.prototype.hasHeader=function(t){if(t)for(var n=t.columns,i=0,r=n.length;i<r;++i)if(null!=n[i].label)return!0;return!1},n.prototype.newHeader=function(t,n,i,r){return this.hasHeader(t)?new VO(this.toHeaderOptions(null==t?void 0:t.header,n,i,r)):null},n.prototype.toHeaderOptions=function(t,n,i,r){return t?(void 0===t.columns&&(t.columns=n),null==t.frozen&&(t.frozen=i),void 0===t.offset&&(t.offset=r),void 0===t.table&&(t.table=this),t):{columns:n,frozen:i,offset:r,table:this}},n.prototype.getBodyOffset=function(){var t=this.yb;return null==t&&(t=this.newBodyOffset(),this.yb=t),t},n.prototype.newBodyOffset=function(){var t,n;return this.getHeaderOffset()+(null!==(n=null===(t=this.header)||void 0===t?void 0:t.height)&&void 0!==n?n:0)},Object.defineProperty(n.prototype,"body",{get:function(){var t=this.Oe;return null==t&&(t=this.newBody(this.kn,this.columns,this.frozen,this.getBodyOffset()),this.Oe=t),t},enumerable:!1,configurable:!0}),n.prototype.newBody=function(t,n,i,r){return new AO(this.toBodyOptions(null==t?void 0:t.body,n,i,r,null==t?void 0:t.data))},n.prototype.toBodyOptions=function(t,n,i,r,e){return null!=t?(void 0===t.columns&&(t.columns=n),null==t.frozen&&(t.frozen=i),void 0===t.offset&&(t.offset=r),void 0===t.data&&void 0!==e&&(Rt(e)?t.data={rows:e}:t.data=e),void 0===t.height&&void 0===t.weight&&(t.weight=1),t):Rt(e)?{columns:n,frozen:i,offset:r,data:{rows:e},weight:1}:{columns:n,frozen:i,offset:r,data:e,weight:1}},Object.defineProperty(n.prototype,"data",{get:function(){return this.body.data},enumerable:!1,configurable:!0}),n.prototype.getFocusedChildClippingRect=function(n,i,r,e,u,s,h,o){t.prototype.getFocusedChildClippingRect.call(this,n,i,r,e,u,s,h,o);var a=this.toCell(n);if(a){var c=i+this.toFrozenCellX(a)-o.x;if(0<c&&(o.x+=c,o.width-=c),a.parent.parent===this.body){var f=this.getBodyOffset();o.y+=f,o.height-=f}}return o},n.prototype.toFrozenCellX=function(t){var n=this.frozen;if(0<n){var i=t.parent.children,r=i.indexOf(t);if(0<=r){var e=i.length;if(n<=e-1-r){var u=i[e-n];return u.position.x+u.width}}}return 0},n.prototype.onKeyDown=function(n){Xi.moveFocusHorizontally(n,this);var i=Xi.isArrowUpKey(n),r=Xi.isArrowDownKey(n);return(i||r)&&this.onKeyDownArrowUpOrDown(n,r),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyDownArrowUpOrDown=function(t,n){var i=rt.getLayer(this);if(null==i)return!1;var r=i.getFocusController(),e=r.get();if(null==e)return!1;var u=this.toCell(e);if(null==u)return!1;var s=u.parent;if(null==s)return!1;var h=r.find(s,!1,!1,n,this);if(null==h)return!1;var o=this.toCell(h);if(null==o)return!1;var a=o.parent;if(null==a)return!1;var c=s.children.indexOf(u);if(c<0)return!1;var f=a.children[c];if(null==f||f===u||!("state"in f))return!1;var l=r.find(f,!0,!0,n,this);return null!=l&&(r.focus(l),!0)},n.prototype.toCell=function(t){for(var n=t;null!=n;){var i=n.parent;if(i instanceof DO)return n instanceof Qi?n:null;n=i}return null},n.prototype.getType=function(){return"DTable"},n}(yd),cp=function(t){var n=t.text;if(at(n))return n;var i=t.label;if(at(i))return i;var r=t.name;return at(r)?r:void 0},fp=function(t){var n=t.title;if(at(n))return n},lp=function(t){return t.image},vp=function(t){return t.children},bp=function(t){return t.children=[]},dp=function(t){var n,i,r,e,u;this.toLabel=null!==(n=null==t?void 0:t.toLabel)&&void 0!==n?n:cp,this.toTitle=null!==(i=null==t?void 0:t.toTitle)&&void 0!==i?i:fp,this.toImage=null!==(r=null==t?void 0:t.toImage)&&void 0!==r?r:lp,this.toChildren=null!==(e=null==t?void 0:t.toChildren)&&void 0!==e?e:vp,this.newChildren=null!==(u=null==t?void 0:t.newChildren)&&void 0!==u?u:bp},gp={NONE:0,SINGLE:1,MULTIPLE:2},mp=function(){function t(t,n){this.O=t,this.Sb=[],this.kb=[],this.$n=n,this.vn=!1}return Object.defineProperty(t.prototype,"nodes",{get:function(){return this.update(),this.Sb},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"levels",{get:function(){return this.update(),this.kb},enumerable:!1,configurable:!0}),t.prototype.toDirty=function(){this.vn=!0},t.prototype.size=function(){return this.update(),this.Sb.length},t.prototype.each=function(t,n,i){this.update();for(var r=this.Sb,e=null!=n?Math.max(0,n):0,u=null!=i?Math.min(r.length,i):r.length,s=e;s<u&&!1!==t(r[s],s);++s);},t.prototype.update=function(){if(this.vn){this.vn=!1;var t=this.O,n=t.nodes,i=t.accessor.toChildren,r=this.Sb,e=this.kb,u=this.newNodes(t,n,0,0,r,e,this.$n,i);r.length!==u&&(r.length=u,e.length=u)}},t.prototype.newNodes=function(t,n,i,r,e,u,s,h){for(var o=n.length,a=s?-1:1,c=s?o-1:0;0<=c&&c<o;c+=a){var f=n[c];i<e.length?(e[i]=f,u[i]=r):(e.push(f),u.push(r)),i+=1;var l=h(f);l&&t.isExpanded(f)&&(i=this.newNodes(t,l,i,r+1,e,u,s,h))}return i},t}(),wp=function(t){function n(n,i){var r=t.call(this)||this;r.O=n,r.Sb=new Set;var e=null==i?void 0:i.on;if(e)for(var u in e){var s=e[u];s&&r.on(u,s)}return r}return B(n,t),Object.defineProperty(n.prototype,"type",{get:function(){return gp.MULTIPLE},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"first",{get:function(){var t=this.Sb;if(0<t.size){var n=null;return t.forEach((function(t){null==n&&(n=t)})),n}return null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"last",{get:function(){var t=this.Sb;if(0<t.size){var n=null;return t.forEach((function(t){n=t})),n}return null},enumerable:!1,configurable:!0}),n.prototype.get=function(t){var n=this.Sb;if(0<=t&&t<n.size){var i=0,r=null;return n.forEach((function(n){i===t&&(r=n),i+=1})),r}return null},n.prototype.add=function(t){var n=this.Sb;return!n.has(t)&&(n.add(t),this.onChange(),!0)},n.prototype.remove=function(t){var n=this.Sb;return!!n.has(t)&&(n.delete(t),this.onChange(),!0)},n.prototype.toggle=function(t){var n=this.Sb;return n.has(t)?n.delete(t):n.add(t),this.onChange(),!0},n.prototype.clear=function(){var t=this.Sb;return 0<t.size&&(t.clear(),this.onChange(),!0)},n.prototype.clearAndAdd=function(t){var n=this.Sb;return 1===n.size?!n.has(t)&&(n.clear(),n.add(t),this.onChange(),!0):(n.clear(),n.add(t),this.onChange(),!0)},n.prototype.clearAndAddAll=function(t){for(var n=!1,i=new Set,r=this.Sb,e=0,u=t.length;e<u;++e){var s=t[e];r.has(s)||(n=!0),i.add(s)}return n||r.forEach((function(t){i.has(t)||(n=!0)})),n&&(this.Sb=i,this.onChange()),n},n.prototype.contains=function(t){return this.Sb.has(t)},n.prototype.size=function(){return this.Sb.size},n.prototype.isEmpty=function(){return this.Sb.size<=0},n.prototype.each=function(t){var n=!1;this.Sb.forEach((function(i){n||!1===t(i)&&(n=!0)}))},n.prototype.toArray=function(){var t=[];return this.Sb.forEach((function(n){t.push(n)})),t},n.prototype.onChange=function(){this.O.update(),this.emit("change",this)},n.prototype.onNodeChange=function(t){var n=this.Sb;if(0<n.size){var i=this.newNodes(t,n,new Set);n.size!==i.size&&(this.Sb=i,this.onChange())}},n.prototype.newNodes=function(t,n,i){for(var r=this.O.accessor.toChildren,e=0,u=t.length;e<u;++e){var s=t[e];n.has(s)&&i.add(s);var h=r(s);h&&this.newNodes(h,n,i)}return i},n}(t.utils.EventEmitter),Op=function(t){function n(n,i){var r=t.call(this)||this;r.O=n,r.jn=null;var e=null==i?void 0:i.on;if(e)for(var u in e){var s=e[u];s&&r.on(u,s)}return r}return B(n,t),Object.defineProperty(n.prototype,"type",{get:function(){return gp.SINGLE},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"first",{get:function(){return this.jn},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"last",{get:function(){return this.jn},enumerable:!1,configurable:!0}),n.prototype.get=function(t){return 0===t?this.jn:null},n.prototype.add=function(t){return this.jn!==t&&(this.jn=t,this.onChange(),!0)},n.prototype.remove=function(t){return this.jn===t&&(this.jn=null,this.onChange(),!0)},n.prototype.toggle=function(t){return this.jn===t?this.jn=null:this.jn=t,this.onChange(),!0},n.prototype.clear=function(){return null!=this.jn&&(this.jn=null,this.onChange(),!0)},n.prototype.clearAndAdd=function(t){return this.jn!==t&&(this.jn=t,this.onChange(),!0)},n.prototype.clearAndAddAll=function(t){if(0<t.length){var n=t[t.length-1];return this.clearAndAdd(n)}return this.clear()},n.prototype.contains=function(t){return this.jn===t},n.prototype.size=function(){return null!=this.jn?1:0},n.prototype.isEmpty=function(){return null==this.jn},n.prototype.each=function(t){var n=this.jn;null!=n&&t(n)},n.prototype.toArray=function(){var t=this.jn;return null!=t?[t]:[]},n.prototype.onChange=function(){this.O.update(),this.emit("change",this)},n.prototype.onNodeChange=function(t){var n=this.jn;if(null!=n){var i=this.newNode(t,n);n!==i&&(this.jn=i,this.onChange())}},n.prototype.newNode=function(t,n){for(var i=this.O.accessor.toChildren,r=0,e=t.length;r<e;++r){var u=t[r];if(n===u)return u;var s=i(u);if(s){var h=this.newNode(s,n);if(null!=h)return h}}return null},n}(t.utils.EventEmitter),pp=function(t){function n(n,i){var r=t.call(this)||this;r.O=n;var e=null==i?void 0:i.on;if(e)for(var u in e){var s=e[u];s&&r.on(u,s)}return r}return B(n,t),Object.defineProperty(n.prototype,"type",{get:function(){return gp.NONE},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"first",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"last",{get:function(){return null},enumerable:!1,configurable:!0}),n.prototype.get=function(t){return null},n.prototype.add=function(t){return!1},n.prototype.remove=function(t){return!1},n.prototype.toggle=function(t){return!1},n.prototype.clear=function(){return!1},n.prototype.clearAndAdd=function(t){return!1},n.prototype.clearAndAddAll=function(t){return!1},n.prototype.contains=function(t){return!1},n.prototype.size=function(){return 0},n.prototype.isEmpty=function(){return!0},n.prototype.each=function(t){},n.prototype.toArray=function(){return[]},n.prototype.onNodeChange=function(t){},n}(t.utils.EventEmitter),Dp=function(){function t(t,n){this.O=t,this.xb=new WeakMap,this.Hc=this.toSelection(n),this.Uc=new dp(n);var i=new mp(this,!!(null==n?void 0:n.reverse));this.zc=i;var r=null==n?void 0:n.nodes;null!=r?(this.Sb=r,i.toDirty()):this.Sb=[]}return t.prototype.toSelection=function(t){var n=null==t?void 0:t.selection;switch(null==n?void 0:n.type){case gp.NONE:case"NONE":return new pp(this,n);case gp.MULTIPLE:case"MULTIPLE":return new wp(this,n);default:return new Op(this,n)}},Object.defineProperty(t.prototype,"nodes",{get:function(){return this.Sb},set:function(t){this.Sb=t,this.update(!0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mapped",{get:function(){return this.zc},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"accessor",{get:function(){return this.Uc},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selection",{get:function(){return this.Hc},enumerable:!1,configurable:!0}),t.prototype.update=function(t){t&&(this.zc.toDirty(),this.Hc.onNodeChange(this.Sb)),this.O.update(t)},t.prototype.toggle=function(t){var n=this.xb;return n.has(t)?n.delete(t):n.set(t,1),this.zc.toDirty(),this.update(),!0},t.prototype.expand=function(t){var n=this.xb;return!n.has(t)&&(n.set(t,1),this.zc.toDirty(),this.update(),!0)},t.prototype.collapse=function(t){var n=this.xb;return!!n.has(t)&&(n.delete(t),this.zc.toDirty(),this.update(),!0)},t.prototype.expandAll=function(){var t=!1,n=this.xb;return this.each((function(i){n.has(i)||(n.set(i,1),t=!0)})),!!t&&(this.zc.toDirty(),this.update(),!0)},t.prototype.collapseAll=function(){var t=!1,n=this.xb;return this.each((function(i){n.has(i)&&(n.delete(i),t=!0)})),!!t&&(this.zc.toDirty(),this.update(),!0)},t.prototype.isCollapsed=function(t){return!this.isExpanded(t)},t.prototype.isExpanded=function(t){return this.xb.has(t)},t.prototype.clear=function(){var t=this.Sb;return 0<t.length&&(t.length=0,this.zc.toDirty(),this.Hc.clear(),this.update(),!0)},t.prototype.remove=function(t){var n=!1;return this.each((function(i,r,e){return i!==t||(e.splice(r,1),n=!0,!1)})),!!n&&(this.zc.toDirty(),this.Hc.remove(t),this.update(),!0)},t.prototype.add=function(t,n){var i=!1;if(n){var r=this.Uc,e=r.toChildren(n);if(e)e.push(t),i=!0;else{var u=r.newChildren(n);u&&(u.push(t),i=!0)}}else{var s=this.Sb;s?s.push(t):this.Sb=[t],i=!0}return i&&(this.zc.toDirty(),this.update()),!0},t.prototype.addBefore=function(t,n){var i=!1;return this.each((function(r,e,u){return r!==n||(u.splice(e,0,t),i=!0,!1)})),i&&(this.zc.toDirty(),this.update()),i},t.prototype.addAfter=function(t,n){var i=!1;return this.each((function(r,e,u){return r!==n||(u.splice(e+1,0,t),i=!0,!1)})),i&&(this.zc.toDirty(),this.update()),i},t.prototype.each=function(t){var n=this.Sb;n&&this.Pc(n,null,t)},t.prototype.Pc=function(t,n,i){for(var r=this.Uc.toChildren,e=0,u=t.length;e<u;++e){var s=t[e];if(!1===i(s,e,t,n))return;var h=r(s);h&&this.Pc(h,s,i)}},t}(),Ep={HAS_CHILDREN:"HAS_CHILDREN",OPENED:"OPENED"},Mp=function(t){function n(n,i){var r=t.call(this,i)||this;return r.zn=new Ib(r.zn),r.Pt=n,r}return B(n,t),Object.defineProperty(n.prototype,"node",{get:function(){return this.jn},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"value",{get:function(){return this.jn},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"index",{get:function(){return this.Qe},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"data",{get:function(){return this.Pt},enumerable:!1,configurable:!0}),n.prototype.toggle=function(){var t=this.jn;void 0!==t&&this.Pt.toggle(t)},n.prototype.set=function(t,n,i){var r,e=this.Pt,u=i||this.jn!==t;if(u){this.jn=t,this.Qe=n;var s=e.accessor;this.text=s.toLabel(t),this.title=null!==(r=s.toTitle(t))&&void 0!==r?r:"",this.image=s.toImage(t)}var h=e.mapped.levels[n];this.zn.adjLeft(this.theme.getLevelPadding(h));var o=e.accessor.toChildren(t),a=!!(o&&0<o.length),c=this.state;c.lock(),c.set(ht.ACTIVE,e.selection.contains(t)),c.remove(ht.DISABLED),c.set(Ep.HAS_CHILDREN,a),c.set(Ep.OPENED,e.isExpanded(t)),c.unlock(),u&&this.emit("set",t,n,this)},n.prototype.unset=function(){if(void 0!==this.jn){this.jn=void 0,this.Qe=void 0,this.text=void 0,this.title="",this.image=void 0;var t=this.state;t.lock(),t.add(ht.DISABLED),t.remove(ht.ACTIVE),t.unlock(),this.emit("unset",this)}},n.prototype.onSelect=function(t,n){var i=this.Pt,r=i.selection;if(r.type!==gp.MULTIPLE)r.clearAndAdd(n);else{var e=t&&"data"in t?t.data.originalEvent:t;if(null==e?void 0:e.ctrlKey)r.toggle(n);else if(null==e?void 0:e.shiftKey){var u=i.mapped,s=r.last;if(n===s)r.clearAndAdd(n);else{var h=!1,o=!1,a=[];u.each((function(t){if(h){if(o){if(a.unshift(t),t===n)return!1}else if(a.push(t),t===s)return!1}else t===n?(h=!0,o=!1,a.push(t)):t===s&&(h=!0,o=!0,a.push(t))})),r.clearAndAddAll(a)}}else r.clearAndAdd(n)}},n.prototype.onKeyDown=function(n){var i;return Xi.isActivateKey(n)&&this.onKeyDownActivate(n),Xi.isArrowRightKey(n)&&void 0!==(i=this.jn)&&this.state.is(Ep.HAS_CHILDREN)&&this.Pt.expand(i),Xi.isArrowLeftKey(n)&&void 0!==(i=this.jn)&&this.state.is(Ep.HAS_CHILDREN)&&this.Pt.collapse(i),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyDownActivate=function(t){if(this.state.isActionable&&this.state.isFocused){var n=this.jn;return void 0!==n&&this.onSelect(t,n),!0}return!1},n.prototype.getType=function(){return"DTreeItemText"},n}(bs),Sp=function(t){function n(n,i){var r,e=this;return(e=t.call(this,n,i)||this).th=Di(null!==(r=null==i?void 0:i.when)&&void 0!==r?r:Hu.CLICKED,Hu),e.on(Ki.tap,(function(t){e.onClick(t)})),e}return B(n,t),n.prototype.onClick=function(t){this.th===Hu.CLICKED&&this.state.isActionable&&this.activate(t)},n.prototype.onDblClick=function(n,i){return this.th===Hu.DOUBLE_CLICKED&&this.activate(n),t.prototype.onDblClick.call(this,n,i)},n.prototype.activate=function(t){this.onActivate(t)},n.prototype.onActivate=function(t){this.emit("active",this)},n.prototype.onActivateKeyDown=function(t){this.state.isActionable&&(this.state.isPressed=!0)},n.prototype.onActivateKeyUp=function(t){this.state.isActionable&&(this.state.isPressed&&this.activate(t),this.state.isPressed=!1)},n.prototype.onKeyDown=function(n){return Xi.isActivateKey(n)&&this.onActivateKeyDown(n),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyUp=function(n){return Xi.isActivateKey(n)&&this.onActivateKeyUp(n),t.prototype.onKeyUp.call(this,n)},n.prototype.getType=function(){return"DTreeItemButton"},n}(Mp),Tp=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.onActivate=function(i){t.prototype.onActivate.call(this,i);var r=this.jn;void 0!==r&&(this.state.is(Ep.HAS_CHILDREN)?i&&"data"in i&&(this.toLocal(i.data.global,void 0,n.WORK_CONTAINS_POINT).x<=this.padding.getLeft()?this.toggle():this.onSelect(i,r)):this.onSelect(i,r))},n.prototype.getType=function(){return"DTreeItemNonEditable"},n}(Sp),jp=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.toMapped=function(t){return t.mapped},n.prototype.newItem=function(t){return new Tp(t)},n}(fd),Np=function(t){function n(n){var i=t.call(this,n)||this;return i.update(),i}return B(n,t),n.prototype.onContentChange=function(){t.prototype.onContentChange.call(this),this.update()},n.prototype.onResize=function(n,i,r,e){var u=this.updater;u.lock(),t.prototype.onResize.call(this,n,i,r,e),u.update(),u.unlock(!0)},Object.defineProperty(n.prototype,"updater",{get:function(){var t=this.rf;return null==t&&(t=this.newUpdater(this.data,this.content,this.kn),this.rf=t),t},enumerable:!1,configurable:!0}),n.prototype.newUpdater=function(t,n,i){return new jp(t,n,n,null==i?void 0:i.updater)},Object.defineProperty(n.prototype,"data",{get:function(){var t=this.Pt;return null==t&&(t=this.toData(this.kn),this.Pt=t),t},enumerable:!1,configurable:!0}),n.prototype.toData=function(t){var n=t&&(t.data||t.nodes||t.value)||[];return Rt(n)?new Dp(this,{nodes:n}):"add"in n?n:new Dp(this,n)},n.prototype.update=function(t){this.updater.update(t)},n.prototype.lock=function(){this.updater.lock()},n.prototype.unlock=function(t){this.updater.unlock(t)},Object.defineProperty(n.prototype,"selection",{get:function(){return this.data.selection},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"value",{get:function(){return this.data.nodes},set:function(t){this.data.nodes=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"nodes",{get:function(){return this.data.nodes},set:function(t){this.data.nodes=t},enumerable:!1,configurable:!0}),n.prototype.toggle=function(t){return this.data.toggle(t)},n.prototype.expand=function(t){return this.data.expand(t)},n.prototype.collapse=function(t){return this.data.collapse(t)},n.prototype.expandAll=function(){return this.data.expandAll()},n.prototype.collapseAll=function(){return this.data.collapseAll()},n.prototype.isCollapsed=function(t){return this.data.isCollapsed(t)},n.prototype.isExpanded=function(t){return this.data.isExpanded(t)},n.prototype.clear=function(){return this.data.clear()},n.prototype.remove=function(t){return this.data.remove(t)},n.prototype.add=function(t,n){return this.data.add(t,n)},n.prototype.addBefore=function(t,n){return this.data.addBefore(t,n)},n.prototype.addAfter=function(t,n){return this.data.addAfter(t,n)},n.prototype.each=function(t){return this.data.each(t)},n.prototype.onKeyDown=function(n){return this.updater.moveFocus(n,this,!0,!1),t.prototype.onKeyDown.call(this,n)},n.prototype.getType=function(){return"DTree"},n}(yd),Ip={__proto__:null,loadAll:Ov,loadMenuItemAll:wv,loadMenuItemExpandable:$l,loadMenuItem:Hl,loadMenuSidedItemExpandable:mv,loadMenuSidedItem:hv,deserializeActionValue:eo,EShapeActionBases:tn,EShapeActionEnvironment:nn,EShapeActionExpressions:rn,EShapeActionOpenDialogExtensions:Dh,EShapeActionOpenExtensions:Sh,EShapeActionOpenOpeners:Fe,EShapeActionRuntimeBase:en,EShapeActionRuntimeBlinkBrighten:hn,EShapeActionRuntimeBlinkColorFill:on,EShapeActionRuntimeBlinkColorStroke:an,EShapeActionRuntimeBlinkDarken:cn,EShapeActionRuntimeBlinkOpacity:fn,EShapeActionRuntimeBlinkVisibility:ln,EShapeActionRuntimeBlink:sn,EShapeActionRuntimeChangeColorBrightness:In,EShapeActionRuntimeChangeColorCode:An,EShapeActionRuntimeChangeColor:Mn,EShapeActionRuntimeChangeCursor:Ln,EShapeActionRuntimeChangeTextNumber:di,EShapeActionRuntimeChangeTextText:gi,EShapeActionRuntimeConditional:un,EShapeActionRuntimeEmitEvent:He,EShapeActionRuntimeGestureLayer:Ae,EShapeActionRuntimeGestureShape:Le,EShapeActionRuntimeMiscEmitEvent:Ve,EShapeActionRuntimeMiscExecute:Du,EShapeActionRuntimeMiscHtmlElement:ru,EShapeActionRuntimeMiscInputInput:cu,EShapeActionRuntimeMiscInputInteger:lu,EShapeActionRuntimeMiscInputNumber:fu,EShapeActionRuntimeMiscInputReal:vu,EShapeActionRuntimeMiscInputText:du,EShapeActionRuntimeMiscInput:au,EShapeActionRuntimeMiscWriteBoth:mu,EShapeActionRuntimeMiscWriteLocal:wu,EShapeActionRuntimeMiscWriteRemote:Ou,EShapeActionRuntimeMiscWrite:gu,EShapeActionRuntimeOpenDialogBoolean:Ls,EShapeActionRuntimeOpenDialogDate:wh,EShapeActionRuntimeOpenDialogDatetime:lh,EShapeActionRuntimeOpenDialogExtension:Eh,EShapeActionRuntimeOpenDialogInteger:Us,EShapeActionRuntimeOpenDialogReal:Hs,EShapeActionRuntimeOpenDialogText:Ws,EShapeActionRuntimeOpenDialogTime:dh,EShapeActionRuntimeOpenDialog:Rs,EShapeActionRuntimeOpen:Mu,EShapeActionRuntimeShowHideLayer:Ch,EShapeActionRuntimeShowHideShape:Rh,EShapeActionRuntimeShowHide:Nh,EShapeActionRuntimeTransformMoveAbsoluteX:kh,EShapeActionRuntimeTransformMoveAbsoluteY:xh,EShapeActionRuntimeTransformMoveForwardOrBackward:Bh,EShapeActionRuntimeTransformMoveLeftOrRight:_h,EShapeActionRuntimeTransformMoveRelativeX:Ph,EShapeActionRuntimeTransformMoveRelativeY:Uh,EShapeActionRuntimeTransformMove:yh,EShapeActionRuntimeTransformResizeHeightAbsolute:Xh,EShapeActionRuntimeTransformResizeHeightRelative:Kh,EShapeActionRuntimeTransformResizeSizeAbsolute:Yh,EShapeActionRuntimeTransformResizeSizeRelative:Jh,EShapeActionRuntimeTransformResizeWidthAbsolute:Zh,EShapeActionRuntimeTransformResizeWidthRelative:qh,EShapeActionRuntimeTransformResize:Wh,EShapeActionRuntimeTransformRotateAbsolute:to,EShapeActionRuntimeTransformRotateRelative:no,EShapeActionRuntimeTransformRotate:$h,EShapeActionRuntimes:pv,EShapeActionValueBase:bn,EShapeActionValueBlinkType:vn,EShapeActionValueBlink:On,EShapeActionValueChangeColorBrightness:Cn,EShapeActionValueChangeColorCode:Rn,EShapeActionValueChangeColorTarget:En,EShapeActionValueChangeColorTypeLegacy:Tn,EShapeActionValueChangeColorType:Sn,EShapeActionValueChangeColorTypes:jn,EShapeActionValueChangeColor:Nn,EShapeActionValueChangeCursor:yn,EShapeActionValueChangeTextType:mi,EShapeActionValueChangeText:wi,EShapeActionValueDeserializers:uo,EShapeActionValueEmitEvent:ze,EShapeActionValueGestureOperationType:Ie,EShapeActionValueGestureType:ye,EShapeActionValueGesture:xe,EShapeActionValueMiscEmitEvent:Dv,EShapeActionValueMiscExecute:Eu,EShapeActionValueMiscHtmlElement:Ev,EShapeActionValueMiscInput:Mv,EShapeActionValueMiscType:ke,EShapeActionValueMiscWrite:Sv,EShapeActionValueMisc:pu,EShapeActionValueOnInputAction:hu,EShapeActionValueOnInputActions:ou,EShapeActionValueOpenDialogExtension:Mh,EShapeActionValueOpenDialogType:Oh,EShapeActionValueOpenDialog:ph,EShapeActionValueOpenExtension:Th,EShapeActionValueOpenType:Su,EShapeActionValueOpen:Tu,EShapeActionValueOpetyped:Fh,EShapeActionValueShowHideLayer:Ah,EShapeActionValueShowHideShape:Lh,EShapeActionValueShowHideType:jh,EShapeActionValueShowHide:Ih,EShapeActionValueSubtyped:dn,EShapeActionValueTransformMoveType:Gh,EShapeActionValueTransformMove:zh,EShapeActionValueTransformResizeType:Vh,EShapeActionValueTransformResize:Qh,EShapeActionValueTransformRotateType:io,EShapeActionValueTransformRotate:ro,EShapeActionValueTransformType:Hh,EShapeActionValueType:gn,EShapeActionValues:wn,EShapeAction:et,EShapeActions:Ge,loadShapeAll:dl,loadShapeBar:lo,loadShapeButton:ko,loadShapeCircle:Xo,loadShapeClipperEx:function(){tu=!0},isShapeClipperExLoaded:nu,loadShapeConnectorElbow:Ka,loadShapeConnectorLine:Ya,loadShapeEmbedded:nc,loadShapeGroupShadowed:fc,loadShapeGroup:hc,loadShapeImage:gc,loadShapeLabel:Lc,loadShapeLineOfCircles:sf,loadShapeLineOfRectangleRoundeds:ff,loadShapeLineOfRectangles:gf,loadShapeLineOfTriangleRoundeds:Lf,loadShapeLineOfTriangles:Pf,loadShapeLine:xc,loadShapeNull:Hf,loadShapeRectangleRounded:Kf,loadShapeRectangle:Vf,loadShapeSemicircle:sl,loadShapeTriangleRounded:bl,loadShapeTriangle:cl,BAR_VERTEX_COUNT:4,BAR_INDEX_COUNT:2,buildBarClipping:c,buildBarIndex:f,buildBarVertexStepAndColorFill:l,buildBarUv:v,CIRCLE_VERTEX_COUNT:9,CIRCLE_INDEX_COUNT:8,CIRCLE_WORLD_SIZE:xo,buildCircleClipping:_o,buildCircleIndex:Po,buildCircleVertex:Uo,buildCircleStep:Fo,buildCircleUv:Go,buildColor:G,IMAGE_SDF_VERTEX_COUNT:9,IMAGE_SDF_INDEX_COUNT:8,IMAGE_SDF_WORLD_SIZE:mc,buildImageSdfClipping:Oc,buildImageSdfIndex:pc,buildImageSdfStep:Dc,buildImageSdfVertex:Ec,buildImageSdfUv:Mc,toLineOfAnyPointCount:Fc,buildLineOfAnyColor:Gc,toPointsCount:Yo,toLinePointCount:Jo,toLineVertexCount:Zo,toLineIndexCount:qo,buildLineClipping:Qo,buildLineIndex:$o,buildLineUv:ta,buildLineVertexStepAndColorFill:na,buildNullClipping:Bc,buildNullIndex:function(t,n,i,r){for(var e=3*i,u=3*(i+r);e<u;e+=3)t[e+0]=n,t[e+1]=n,t[e+2]=n},buildNullVertex:_c,buildNullStep:Pc,buildNullUv:Uc,RECTANGLE_ROUNDED_VERTEX_COUNT:bo,RECTANGLE_ROUNDED_INDEX_COUNT:24,RECTANGLE_ROUNDED_WORLD_SIZE:go,buildRectangleRoundedIndex:wo,buildRectangleRoundedVertex:Oo,buildRectangleRoundedClipping:po,buildRectangleRoundedStep:Do,buildRectangleRoundedUv:Eo,RECTANGLE_VERTEX_COUNT:Ma,RECTANGLE_INDEX_COUNT:Sa,RECTANGLE_WORLD_SIZE:Ta,buildRectangleClipping:Na,buildRectangleIndex:Ia,buildRectangleVertex:Ca,buildRectangleStep:Aa,buildRectangleUv:La,SEMICIRCLE_VERTEX_COUNT:6,SEMICIRCLE_INDEX_COUNT:4,SEMICIRCLE_WORLD_SIZE:Yf,buildSemicircleClipping:Zf,buildSemicircleIndex:qf,buildSemicircleVertex:Qf,buildSemicircleStep:$f,buildSemicircleUv:tl,TEXT_VERTEX_COUNT:4,TEXT_INDEX_COUNT:2,TEXT_FMIN:D,toTextBufferCount:M,buildTextClipping:S,buildTextIndex:T,buildTextStep:j,buildTextVertex:I,TRIANGLE_ROUNDED_VERTEX_COUNT:mf,TRIANGLE_ROUNDED_INDEX_COUNT:15,TRIANGLE_ROUNDED_WORLD_SIZE:wf,buildTriangleRoundedIndex:pf,buildTriangleRoundedVertex:Df,buildTriangleRoundedClipping:Ef,buildTriangleRoundedStep:Mf,buildTriangleRoundedUv:Sf,TRIANGLE_VERTEX_COUNT:7,TRIANGLE_INDEX_COUNT:3,TRIANGLE_WORLD_SIZE:oa,buildTriangleClipping:ca,buildTriangleIndex:fa,buildTriangleVertex:la,buildTriangleStep:va,buildTriangleUv:ba,BuilderBar:Yt,BuilderBase:H,BuilderCircle:Ho,BuilderImageSdf:Sc,BuilderLabel:Ic,BuilderLineOfAny:Hc,BuilderLineOfCircles:tf,BuilderLineOfRectangleRoundeds:hf,BuilderLineOfRectangles:lf,BuilderLineOfTriangleRoundeds:Tf,BuilderLineOfTriangles:yf,BuilderLine:ha,BuilderMarkerCircleHead:pa,BuilderMarkerCircleTail:Da,BuilderMarkerCircle:Oa,BuilderMarkerRectangleHead:xa,BuilderMarkerRectangleTail:ka,BuilderMarkerRectangle:ya,BuilderMarkerTriangleHead:ma,BuilderMarkerTriangleTail:wa,BuilderMarkerTriangle:ga,BuilderNull:Ea,BuilderRectanglePivoted:Ja,BuilderRectangleRounded:Mo,BuilderRectangle:lc,BuilderSemicircle:nl,BuilderText:Jt,BuilderTriangleRounded:fl,BuilderTriangle:hl,toTransformLocalId:z,toTexture:V,toTextureTransformId:W,toTextureUvs:X,copyClipping:zc,copyIndex:Vc,copyStep:Wc,copyUvs:Xc,copyVertex:Kc,createBarUploaded:Zt,createButtonUploaded:To,createCircleUploaded:zo,createRectanglePivotedUploaded:Za,createGroupUploaded:qa,createImageSdfUploaded:Tc,createImageSdf:Tv,createImage:function(t){return ao(t).then((function(t){return new bc(t)}))},createLabelUploaded:Cc,createLineOfAnyUploaded:nf,createLineOfCirclesUploaded:rf,createLineOfRectangleRoundedsUploaded:of,createLineOfRectanglesUploaded:vf,createLineOfTriangleRoundedsUploaded:jf,createLineOfTrianglesUploaded:kf,createLineUploaded:Fa,createLine:function(t,n,i,r){for(var e=Zr(t,[0,0,0,0]),u=.5*(e[2]+e[0]),s=.5*(e[3]+e[1]),h=e[2]-e[0],o=e[3]-e[1],a=[],c=0,f=t.length;c<f;c+=2)a.push(t[c]-u,t[c+1]-s);var l=new yc;return l.stroke.set(!0,void 0,void 0,i),l.transform.position.set(u,s),l.size.set(h,o),l.points.set(a,n,r),l},createNullUploaded:Uf,createRectangleRoundedUploaded:So,createRectangleUploaded:vc,createSemicircleUploaded:il,createTriangleRoundedUploaded:ll,createTriangleUploaded:ol,deserializeAll:Ar,deserializeBar:fo,deserializeBase:co,deserializeButton:Ao,deserializeCircle:Wo,deserializeConnectorElbow:za,deserializeConnectorLine:Wa,onDeserializedConnectorLine:Xa,deserializeEmbedded:tc,deserializeEmbeddedLayer:_e,deserializeGradient:ho,deserializeGroupShadowed:cc,deserializeGroup:sc,deserializeImageSdf:Nc,deserializeImage:dc,deserializeLabel:Rc,deserializeLineOfCircles:uf,deserializeLineOfRectangleRoundeds:cf,deserializeLineOfRectangles:df,deserializeLineOfTriangleRoundeds:Rf,deserializeLineOfTriangles:_f,deserializeLine:kc,deserializeNull:Gf,deserializeRectanglePivoted:Wf,deserializeRectangleRounded:Xf,deserializeRectangle:zf,deserializeSemicircle:ul,deserializeTriangleRounded:vl,deserializeTriangle:al,deserialize:Cr,EShapeBarPoints:tt,EShapeBarPosition:$,EShapeBar:Kt,EShapeBaseHitTestData:dt,EShapeBase:pt,EShapeButtonRuntimeActionToggle:Lo,EShapeButtonRuntimeAction:Ro,EShapeButtonRuntime:yo,EShapeButton:Co,EShapeCircle:Vo,EShapeConnectorElbowPointsFiller:Ga,EShapeConnectorElbow:Ha,EShapeConnectorLine:re,EShapeEmbeddedDatum:Lr,EShapeEmbeddedLayerContainer:Pe,EShapeEmbeddedLayer:je,EShapeEmbedded:Nr,EShapeEmbeddeds:jv,EShapeFillImpl:Z,EShapeGroupFillEditor:ic,EShapeGroupFillViewer:Sr,EShapeGroupPoints:rc,EShapeGroupShadowed:ac,EShapeGroupSizeEditor:Er,EShapeGroupSizeLayout:Dr,EShapeGroupSizeShadowed:oc,EShapeGroupSizeViewer:Mr,EShapeGroupStrokeEditor:ec,EShapeGroupStrokeViewer:Tr,EShapeGroupViewer:jr,EShapeGroup:uc,EShapeImageSdf:jc,EShapeImage:bc,EShapeLabel:Ac,EShapeLineBaseHitPart:nt,EShapeLineBase:Xt,EShapeLineOfAnyPointsFillImpl:Zc,EShapeLineOfAnyPointsImpl:$c,EShapeLineOfAnyPointsPointImpl:qc,EShapeLineOfAnyPointsStrokeImpl:Qc,EShapeLineOfCircles:ef,EShapeLineOfRectangleRoundeds:af,EShapeLineOfRectangles:bf,EShapeLineOfTriangleRoundeds:Af,EShapeLineOfTriangles:Bf,EShapeLinePoints:ne,EShapeLine:yc,EShapeNull:Ff,EShapePrimitive:Ut,EShapeRectanglePivoted:Qe,EShapeRectangleRounded:Io,EShapeRectangle:qe,EShapeSemicircle:el,EShapeStrokeImpl:Dt,EShapeTextAlignImpl:xt,EShapeTextImpl:Pt,EShapeTextOffsetImpl:Bt,EShapeTextOutlineImpl:_t,EShapeTriangleRounded:Cf,EShapeTriangle:xf,hitTestBBox:gt,hitTestCircle:Ft,hitTestSemicircle:rl,hitTestRectangleRounded:No,hitTestRectangle:Ht,hitTestTriangleRounded:If,hitTestTriangleFilled:zt,hitTestTriangle:Vt,isStatic:Yc,toComputed:Jc,toDash:h,toGradientImageUrl:function(t){for(var n=t.direction,i=t.points,r="",e=0,u=i.length;e<u;++e){var s=i[e],h=Qt.toCode(s.color),o=s.alpha,a=100*s.position;r+='<stop offset="'.concat(a,'%" stop-color="#').concat(h,'" stop-opacity="').concat(o,'" />')}var c=n*Math.PI/180,f=.5*Math.cos(c),l=-.5*Math.sin(c);return Nv('<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><defs>'+'<linearGradient id="o2glkm3aeu2oio" x1="'.concat(.5-f,'" x2="').concat(.5+f,'" y1="').concat(.5-l,'" y2="').concat(.5+l,'">')+r+'</linearGradient></defs><rect x="0" y="0" width="32" height="32" stroke="none" fill="url(#o2glkm3aeu2oio)" /></svg>')},toGradientSerialized:mt,toImageElement:ao,toLength:p,toResized:function(t,n,i,r,e){t.disallowUploadedUpdate();var u=t.transform.position;if(r){var s=Math.abs(i.x-n.x),h=Math.abs(i.y-n.y);if(e){var o=(f=Math.max(s,h))+f;t.size.set(Or(o),Or(o)),u.set(Iv(n.x),Iv(n.y))}else t.size.set(Or(s+s),Or(h+h)),u.set(Iv(n.x),Iv(n.y))}else if(e){s=i.x-n.x,h=i.y-n.y,o=Math.max(Math.abs(s),Math.abs(h));var a=n.x+(s<0?-o:+o),c=n.y+(h<0?-o:+o),f=.5*o,l=Math.min(n.x,a)+f,v=Math.min(n.y,c)+f;t.size.set(Or(o),Or(o)),u.set(Iv(l),Iv(v))}else{var b=Math.min(n.x,i.x),d=Math.min(n.y,i.y),g=Math.max(n.x,i.x)-b,m=Math.max(n.y,i.y)-d,w=.5*g,O=.5*m;t.size.set(Or(g),Or(m)),u.set(Iv(b+w),Iv(d+O))}t.allowUploadedUpdate()},toScaleInvariant:o,toSizeNormalized:Or,toSizeRounded:Iv,toThresholdDefault:Wt,EShapeAcceptorImpl:yr,EShapeAcceptorType:kr,EShapeAcceptors:xr,EShapeBufferUnitBuilder:Oe,EShapeBufferUnit:we,EShapeBuffer:pe,EShapeCapabilities:mr,EShapeCapability:wt,EShapeConnectorBodies:Va,EShapeConnectorBodyImpl:ie,EShapeConnectorContainerImpl:ut,EShapeConnectorEdgeAcceptorImpl:Br,EShapeConnectorEdgeContainerImpl:Pr,EShapeConnectorEdgeImpl:_r,EShapeConnectors:ee,EShapeContainer:Te,EShapeCopyPart:st,EShapeCorner:it,EShapeDataImpl:kt,EShapeDataMapperImpl:br,EShapeDataMappingImpl:At,EShapeDataScopedImpl:Lt,EShapeDataSystemImpl:yt,EShapeDataValueExtensions:Cv,EShapeDataValueImpl:Ct,EShapeDataValueOrder:St,EShapeDataValueRangeImpl:Mt,EShapeDataValueRangeType:Et,EShapeDataValueScope:jt,EShapeDataValueState:Nt,EShapeDataValueType:Tt,EShapeDefaults:Y,EShapeDeleter:Rv,EShapeDeserializers:n,EShapeOnDeserializeds:i,EShapeEditor:wr,EShapeLayerState:Be,toPointsBoundary:Zr,eShapePointsFormatterCurve:Jr,EShapePointsMarkerBase:qr,EShapePointsMarkerContainerImplNoop:Q,EShapePointsMarkerContainerImpl:te,EShapePointsMarkerHead:Qr,EShapePointsMarkerNoop:q,EShapePointsMarkerTail:$r,EShapePointsMarkerType:J,EShapePointsStyle:F,EShapePointsStyles:Lv,EShapeRendererIteratorDatum:Ee,EShapeRendererIterator:Me,EShapeRenderer:Se,EShapeResourceManagerDeserializationMode:gr,EShapeResourceManagerDeserialization:dr,EShapeResourceManagerSerialization:yv,EShapeRuntimeImpl:Ze,EShapeRuntimeReset:$t,EShapeRuntimes:vo,EShapeSearch:Av,EShapeStateSetImplObservable:vt,EShapeState:lt,EShapeStrokeSide:Gt,EShapeStrokeStyle:s,EShapeTextAlignHorizontal:m,EShapeTextAlignVertical:w,EShapeTextDirection:O,EShapeTextWeight:d,EShapeTextStyle:g,EShapeTransformImpl:bt,EShapeTransforms:pr,EShapeType:r,EShapeUploadedImpl:u,EShapeUploadeds:e,EShapeUuidMappingImpl:Ir,ESnapperGrid:kv,ESnapperResultScale:function(){this.distance=NaN,this.scale=new t.Point},ESnapperResult:xv,ESnapperTargetValueType:Bv,ESnapperTargetValue:_v,ESnapperTarget:Pv,ESnapperModifierAnchor:Fv,ESnapper:Gv,DThemes:K,FormatNodeA:kn,FormatNodea:xn,FormatNodeD:Bn,FormatNoded:_n,FormatNodee:Un,FormatNodef:Fn,FormatNodefsi:Gn,FormatNodeg:Hn,FormatNodeH:zn,FormatNodeh:Vn,FormatNodeM:Wn,FormatNodem:Xn,FormatNodemi:Kn,FormatNodeP:Yn,FormatNodep:Jn,FormatNodePadding:Zn,FormatNodeParenthesis:qn,FormatNodePlus:Qn,FormatNodePrecision:Pn,FormatNoderd:oi,FormatNodeRP:$n,FormatNoderp:ti,FormatNodesdt:ni,FormatNodeSpace:ii,FormatNodessi:ri,FormatNodeString:ei,FormatNodeY:ui,FormatNodey:si,FormatNodez:hi,FormatNodes:ai,DynamicAtlasItemEmpty:se,DynamicAtlasItemFontAtlas:ae,DynamicAtlasItemImage:me,DynamicAtlasItemText:Hv,DynamicAtlasItemWhite:he,DynamicAtlasItem:ue,DynamicAtlas:oe,DynamicFontAtlasCharacterOrigin:fe,DynamicFontAtlasCharacterType:ve,DynamicFontAtlasCharacter:le,DynamicFontAtlasFont:Vv,DynamicFontAtlas:Wv,DynamicFontAtlases:Zv,DynamicSDFFontAtlas:de,DynamicSDFFontAtlases:ge,DynamicSDFFontGenerator:be,isArray:Rt,isFunction:ot,isNaN:bh,isNumber:mn,isObject:qv,isString:at,Lazy:Qv,NumberFormatterImpl:vi,NumberFormatters:bi,toCeilingIndex:$v,toCloned:tb,toEnum:Di,toIndexOf:Ur,toLabel:nb,toMerged:ib,toPadded:qt,toString:function(t){return null!=t?String(t):""},toSvgTexture:function(n,i){return t.Texture.from(Nv(n),{resolution:i})},toSvgUrl:Nv,UtilAlpha:pn,UtilSvgAtlasBuilder:rb,UtilAttachAlign:ju,UtilAttach:Nu,UtilCharacterIterator:b,UtilClickOutside:yu,UtilClipboard:Il,UtilGestureData:rr,UtilGestureEasingHistory:sr,UtilGestureEasing:hr,UtilGestureMode:ir,UtilGestureModifier:tr,UtilGestureModifiers:nr,UtilGesture:or,UtilExtract:sb,UtilExtractor:eb,UtilFileDownloader:ub,UtilFileAs:hb,UtilFileOpener:ob,UtilFont:zv,UtilHsv:ab,UtilHtmlElementClipperExImpl:Xe,UtilHtmlElementClipperExRectsImpl:Ke,UtilHtmlElementWhen:Ye,UtilHtmlElement:Je,UtilInputInput:uu,UtilInputNumber:su,UtilInputTextArea:cb,UtilInputText:bu,UtilInput:eu,UtilKeyboardEvent:Xi,UtilName:fb,UtilOverlay:ku,UtilPointerEvent:Ki,UtilRgb:Qt,UtilRgba:lb,UtilStateBlinker:vb,UtilTransition:bb,UtilWheelEvent:db,DAlignHorizontal:Wu,DAlignVertical:Xu,DAlignWith:Ku,DAnimationBase:ur,DAnimationEmpty:gb,DAnimationFadeIn:mb,DAnimationTimings:er,DApplicationLayerOptions:Ob,DApplicationLayer:Tb,DApplicationPadding:wb,DApplication:Nb,DApplications:rt,DBaseAutoSet:Ji,DBaseAuto:Yi,DBaseBackgroundMeshGeometry:Ai,DBaseBackgroundMesh:Ri,DBaseBackgroundSnippet:Li,DBaseBackground:Oi,DBaseBorderMeshGeometry:yi,DBaseBorderMesh:ki,DBaseBorderSnippet:xi,DBaseBorder:Ei,DBaseCorner:Si,DBaseInteractive:Ti,DBaseMeshGeometry:Ci,DBaseOutlineSnippet:Bi,DBaseOutline:ji,DBaseOverflowMaskSimple:es,DBaseOverflowMask:$i,DBasePaddingAdjustable:Ib,DBasePadding:Ni,DBasePoint:Ii,DBaseReflowableContainer:qi,DBaseReflowableImpl:_i,DBaseSnippetContainer:Zi,DBaseStateSetImplObservable:ft,DBaseStateSetImpl:ct,DBaseState:ht,DBase:Qi,DBoard:Cb,DBorderMask:pi,DButtonAmbient:ps,DButtonBaseWhen:Hu,DButtonBase:ds,DButtonCheckRight:Rb,DButtonCheck:Ab,DButtonColorGradient:Kb,DButtonColor:Jb,DButtonDanger:Zb,DButtonDate:qb,DButtonDatetime:nd,DButtonFileAs:hb,DButtonFile:id,DButtonGroup:js,DButtonLink:rd,DButtonPrimary:ms,DButtonRadioRight:ud,DButtonRadio:ed,DButtonRedo:sd,DButtonSecondary:hd,DButtonSelect:Kd,DButtonTime:Yd,DButtonUndo:Jd,DButton:gs,DCanvasContainer:lr,DCanvas:Zd,DChartAxisBaseOptionParser:$d,DChartAxisBase:ug,DChartAxisContainerImpl:sg,DChartAxisPosition:qd,DChartAxisTickPosition:Qd,DChartAxisXDatetime:og,DChartAxisX:hg,DChartAxisY:ag,DChartColorSet1:function(t){return cg[t%cg.length]},DChartColorSet2:lg,DChartCoordinateContainerImpl:dg,DChartCoordinateContainerSubImpl:bg,DChartCoordinateDirection:vg,DChartCoordinateLinearTick:gg,DChartCoordinateLinear:pg,DChartCoordinateLogTick:Dg,DChartCoordinateLog:Eg,DChartCoordinateTransformImpl:mg,DChartCoordinateTransformMarkImpl:wg,DChartLegendItem:Mg,DChartLegend:Sg,DChartOverview:Tg,DChartPlotAreaContainer:jg,DChartPlotAreaImpl:Pg,DChartRegionImplObservable:Ug,DChartRegionImpl:Og,DChartSelectionGridlineContainerImpl:zg,DChartSelectionGridlineX:Gg,DChartSelectionGridlineY:Hg,DChartSelectionMarker:Vg,DChartSelectionShapeBase:Fg,DChartSelectionSimple:Kg,DChartSelectionSubImpl:Xg,DChartSelectionPoint:Wg,DChartSeriesBar:qg,DChartSeriesBaseCoordinateContainer:Yg,DChartSeriesBase:Jg,DChartSeriesContainerImpl:_g,DChartSeriesFillComputedImpl:Ig,DChartSeriesFillImpl:Ag,DChartSeriesLineOfAny:Zg,DChartSeriesLineOfCircles:Qg,DChartSeriesLineOfRectangleRoundeds:$g,DChartSeriesLineOfRectangles:tm,DChartSeriesLineOfTriangleRoundeds:im,DChartSeriesLineOfTriangles:nm,DChartSeriesLine:rm,DChartSeriesExpressionParametersImpl:em,DChartSeriesLinear:um,DChartSeriesPaddingComputedImpl:Rg,DChartSeriesPaddingImpl:Lg,DChartSeriesPointComputedImpl:yg,DChartSeriesPointImpl:kg,DChartSeriesScalars:Cg,DChartSeriesStrokeComputedImpl:xg,DChartSeriesStrokeImpl:Bg,DChartSeriesHitResult:Ng,DChart:sm,DColorGradientObservable:kb,DColorGradientPointObservable:Lb,DCommandBase:pb,DCommandClear:Db,DCommandCreate:hm,DCommandSaveAs:om,DCommandSave:am,DContent:Md,DControllerCommandImpl:Eb,DControllerFocusImpl:jb,DControllerKeyboard:Mb,DControllers:Sb,DCornerMask:Mi,DDiagramBaseControllerOpenType:vr,DDiagramBase:fm,DDiagramCanvasBase:mm,DDiagramCanvasBaseShapeImpl:wm,DDiagramCanvasDataImpl:Om,DDiagramCanvasEditorBackground:lm,DDiagramCanvasEditorShapeImpl:pm,DDiagramCanvasEditorSnap:Dm,DDiagramCanvasEditor:Em,DDiagramCanvasTileMappingImpl:bm,DDiagramCanvasTileMappingPointImpl:vm,DDiagramCanvasShapeImpl:Mm,DDiagramCanvasTickerImpl:Tm,DDiagramCanvasTile:dm,DDiagramCanvas:Lm,DDiagramDataImpl:_m,DDiagramDataPrivateImpl:ym,DDiagramDataRemoteImpl:xm,DDiagramEditorThumbnail:Pm,DDiagramEditor:Um,DDiagramLayerContainer:gm,DDiagramLayer:$e,DDiagramLayers:Ne,DDiagramSerializedVersion:1,DDiagramShape:Fm,DDiagramSnapshot:cm,DDiagramTicker:Sm,DDiagram:Gm,DDiagrams:Ue,DDialogAlign:ju,DDialogCloseOn:Iu,DDialogColorGradient:Xb,DDialogColor:Yb,DDialogConfirmDelete:Vm,DDialogConfirmDiscard:Wm,DDialogConfirmMessage:Hm,DDialogConfirm:zm,DDialogDate:mh,DDialogDatetime:fh,DDialogFittedContent:Xs,DDialogFitted:Ks,DDialogGestureImpl:Au,DDialogGestureMode:Cu,DDialogInputBoolean:As,DDialogInputInteger:Ps,DDialogInputReal:Gs,DDialogInputText:Vs,DDialogInput:Ts,DDialogLayeredContent:Gu,DDialogLayeredFooter:Os,DDialogLayeredHeaderButtonClose:Ds,DDialogLayeredHeaderSeparator:Es,DDialogLayeredHeader:Ms,DDialogLayered:Ss,DDialogMessage:Xm,DDialogMode:Ru,DDialogProcessingMessage:Km,DDialogProcessing:Ym,DDialogSaveAs:Jm,DDialogSelectListItemUpdater:vd,DDialogSelectListItem:cd,DDialogSelectList:xd,DDialogSelectSearhDismissableImpl:zd,DDialogSelectSearhImpl:Bd,DDialogSelect:Vd,DDialogState:Lu,DDialogTime:vh,DDialog:xu,DDropdownBase:Qm,DDropdown:$m,DDynamicTextGeometry:cs,DDynamicTextMeasureResultCharacter:us,DDynamicTextMeasureResult:ss,DDynamicTextMeasure:as,DDynamicTextStyleWordWrap:hs,DDynamicTextStyle:fs,DDynamicText:ls,DExpandableHeader:tw,DExpandable:nw,DHtmlElementState:We,DHtmlElement:ys,DImageBaseThemeWrapperSecondary:zu,DImageBaseThemeWrapperTertiary:Vu,DImageBase:bs,DImagePieceLayouterPartBottom:Zu,DImagePieceLayouterPartCenter:qu,DImagePieceLayouterPartContainer:is,DImagePieceLayouterPartLeft:Qu,DImagePieceLayouterPartMiddle:$u,DImagePieceLayouterPartRight:ts,DImagePieceLayouterPartTop:ns,DImagePieceLayouterPart:Ju,DImagePieceLayouter:rs,DImagePiece:Yu,DImage:gl,DInputAndLabel:Bb,DInputBooleanButtonOff:Ns,DInputBooleanButtonOn:Is,DInputBoolean:Cs,DInputInput:xs,DInputIntegerAndLabel:iw,DInputInteger:_s,DInputLabel:xb,DInputNumber:Bs,DInputRealAndLabel:_b,DInputReal:Fs,DInputSearch:_d,DInputTextAndLabel:Pb,DInputTextArea:rw,DInputText:zs,DInput:ks,DItemUpdater:fd,DLayoutClearType:Pi,DLayoutDirection:Bu,DLayoutHorizontal:ws,DLayoutSpace:_u,DLayoutVertical:Fu,DLayout:Uu,DLinkMenuItemId:El,DLinkMenu:Sl,DLinkTarget:Tl,DLink:Al,DLinks:Rl,DListDataImpl:Ed,DListDataMappedImpl:bd,DListDataSelectionMultiple:dd,DListDataSelectionNone:gd,DListDataSelectionSingle:md,DListDataSelectionType:od,DListItemAccessorImpl:Dd,DListItemAmbient:ew,DListItemUpdater:ld,DListItem:ad,DList:kd,DMapCoordinateEPSG3857:uw,DMapCoordinates:sw,DMapTilePlane:ow,DMapTilePyramidImpl:aw,DMapTileUrlBuilderKokudo:function(t,n,i){return 5<=t?"https://cyberjapandata.gsi.go.jp/xyz/pale/".concat(t,"/").concat(n,"/").concat(i,".png"):2<=t?"https://cyberjapandata.gsi.go.jp/xyz/std/".concat(t,"/").concat(n,"/").concat(i,".png"):"https://cyberjapandata.gsi.go.jp/xyz/earthhillshade/".concat(t,"/").concat(n,"/").concat(i,".png")},DMapTileUrlBuilderOsm:function(t,n,i){return"https://".concat("abc"[(n+i)%3],".tile.openstreetmap.org/").concat(t,"/").concat(n,"/").concat(i,".png")},DMapTileUrlBuilderOsmfj:cw,DMapTilePyramids:fw,DMapTile:hw,DMenuAlign:ju,DMenuBarItem:lw,DMenuBar:vw,DMenuContext:Zm,DMenuItemBase:ml,DMenuItemCheckIsCompatible:Dl,DMenuItemCheck:pl,DMenuItemExpandableBody:zl,DMenuItemExpandableHeader:Vl,DMenuItemExpandableIsCompatible:Kl,DMenuItemExpandableItemCheck:Yl,DMenuItemExpandableItemLink:Jl,DMenuItemExpandableItemMenu:lv,DMenuItemExpandableItemSeparator:Zl,DMenuItemExpandableItemSpace:ql,DMenuItemExpandableItemText:Ql,DMenuItemExpandable:Xl,DMenuItemExpandables:Wl,DMenuItemLinkIsCompatible:yl,DMenuItemLink:Ll,DMenuItemMenuIsCompatible:xl,DMenuItemMenuToSubMenuOptions:Bl,DMenuItemMenu:kl,DMenuItemSeparatorReflowable:_l,DMenuItemSeparatorIsCompatible:Pl,DMenuItemSeparator:Ul,DMenuItemSpaceIsCompatible:Gl,DMenuItemSpace:Fl,DMenuItemText:Ol,DMenuItem:wl,DMenuSidedContent:bw,DMenuSidedItemCheck:tv,DMenuSidedItemExpandableItemCheck:cv,DMenuSidedItemExpandableItemLink:fv,DMenuSidedItemExpandableItemMenu:vv,DMenuSidedItemExpandableItemSeparator:bv,DMenuSidedItemExpandableItemSpace:dv,DMenuSidedItemExpandableItemText:gv,DMenuSidedItemExpandable:av,DMenuSidedItemExpandables:ov,DMenuSidedItemLink:nv,DMenuSidedItemMenu:iv,DMenuSidedItemSeparator:rv,DMenuSidedItemSpace:ev,DMenuSidedItemText:uv,DMenuSidedSelectionType:dw,DMenuSidedSelection:mw,DMenuSided:ww,DMenuSideds:sv,DMenu:qm,DMenus:Ml,DNoteError:Ow,DNoteNoItemsFound:pw,DNoteSearching:Dw,DNoteSmallError:Fd,DNoteSmallNoItemsFound:Gd,DNoteSmallSearching:Hd,DNoteSmall:Ud,DNote:Pd,DNotification:Ew,DPaginationButtonLast:Mw,DPaginationButtonNext:Sw,DPaginationButtonPage:Tw,DPaginationButtonPrevious:jw,DPaginationButtonTop:Nw,DPaginationDots:Iw,DPaginationPage:Cw,DPagination:Aw,DPaneScrollBar:Ld,DPane:yd,DPickerColorAndAlpha:Ub,DPickerColorGradientRecent:zb,DPickerColorGradientView:Vb,DPickerColorGradient:Wb,DPickerColorRecent:Fb,DPickerColor:Gb,DPickerDate:gh,DPickerDates:Qb,DPickerDatetimeButtonBack:Ys,DPickerDatetimeButtonDate:Js,DPickerDatetimeButtonNext:Zs,DPickerDatetimeLabelDate:$s,DPickerDatetimeLabel:Qs,DPickerDatetimeMask:nh,DPickerDatetimeMasks:ih,DPickerDatetimeRange:Rw,DPickerDatetimeSpace:th,DPickerDatetime:ch,DPickerDatetimes:td,DPickerTimeBoundHours:eh,DPickerTimeBoundMinutes:uh,DPickerTimeBoundSeconds:sh,DPickerTimeBound:rh,DPickerTimeBounds:hh,DPickerTimeRange:Lw,DPickerTime:ah,DPickerTimes:$b,DScalarExpressionNodeType:Ui,DScalarExpression:Fi,DScalarFunctions:Wi,DScrollBarHorizontal:Id,DScrollBarThumbHorizontal:Nd,DScrollBarThumbReflowableHorizontal:jd,DScrollBarThumbReflowableVertical:Cd,DScrollBarThumbVertical:Ad,DScrollBarThumb:Td,DScrollBarVertical:Rd,DScrollBar:Sd,DSelectMultiple:yw,DSelect:kw,DShadowImpl:xw,DSliderHorizontal:Hw,DSliderLabel:Bw,DSliderThumb:_w,DSliderTrackHorizontal:Gw,DSliderTrackVertical:zw,DSliderTrack:Fw,DSliderValue:Pw,DSliderVertical:Vw,DSlider:Uw,DTableBodyCellActionDialog:Kw,DTableBodyCellActionMenu:Yw,DTableBodyCellActionPromise:Zw,DTableBodyCellButton:Qw,DTableBodyCellCheck:tO,DTableBodyCellColor:nO,DTableBodyCellDate:iO,DTableBodyCellDatetime:rO,DTableBodyCellIndex:eO,DTableBodyCellInputInteger:uO,DTableBodyCellInputReal:sO,DTableBodyCellInputText:hO,DTableBodyCellInputTreeInput:oO,DTableBodyCellInputTreeMarker:aO,DTableBodyCellInputTree:fO,toLinkOptions:lO,toUrl:vO,toChecker:bO,DTableBodyCellLink:dO,DTableBodyCellSelectDialog:Xw,DTableBodyCellSelectMenu:gO,DTableBodyCellSelectMultiple:mO,DTableBodyCellSelectPromise:Jw,DTableBodyCellText:qw,DTableBodyCellTime:wO,DTableBodyCellTree:OO,DTableBodyCells:Ww,DTableBodyRow:EO,DTableBody:AO,DTableCategoryCell:RO,DTableCategory:LO,DTableColumnType:$w,DTableDataListFilter:MO,DTableDataListMapped:SO,DTableDataListSelection:jO,DTableDataListSorter:IO,DTableDataList:CO,DTableDataSelectionType:pO,DTableDataOrder:NO,DTableDataTreeFilter:yO,DTableDataTreeItemAccessor:BO,DTableDataTreeSelectionImpl:PO,DTableDataTreeSorter:UO,DTableDataTree:FO,DTableHeaderCellCheck:GO,DTableHeaderCell:zO,DTableHeader:VO,DTableRow:DO,DTableScrollBar:WO,DTableState:cO,DTable:ap,DTextBase:vs,DText:qs,DTreeDataImpl:Dp,DTreeDataMappedImpl:mp,DTreeDataSelectionMultiple:wp,DTreeDataSelectionNone:pp,DTreeDataSelectionSingle:Op,DTreeDataSelectionType:gp,DTreeItemButton:Sp,DTreeItemNonEditable:Tp,DTreeItemState:Ep,DTreeItemText:Mp,DTreeItemUpdater:jp,DTreeNodeAccessorImpl:dp,DTree:Np,DViewGestureImpl:ar,DViewImpl:fr,DViewTransformImpl:cr};Ov();var Cp=window;Cp.wcardinal=Cp.wcardinal||{},Cp.wcardinal.ui=Ip}(PIXI);
9
+ !function(t){"use strict";var n={},i={},r={CIRCLE:0,RECTANGLE:1,RECTANGLE_ROUNDED:2,TRIANGLE:3,TRIANGLE_ROUNDED:4,LINE:5,IMAGE:6,IMAGE_SDF:7,GROUP:8,BAR:9,LABEL:10,NULL:11,GROUP_SHADOWED:12,LINE_OF_CIRCLES:13,LINE_OF_RECTANGLES:14,LINE_OF_RECTANGLE_ROUNDEDS:15,LINE_OF_TRIANGLES:16,LINE_OF_TRIANGLE_ROUNDEDS:17,EMBEDDED:18,EMBEDDED_LAYER:19,BUTTON:20,RECTANGLE_PIVOTED:21,CONNECTOR_LINE:22,CONNECTOR_ELBOW:23,SEMICIRCLE:24,EXTENSION:1e3},e={},u=function(){function t(t,n,i,r,e,u){this.buffer=t,this.i=u,this.u=n,this.h=i,this.o=r,this.l=e}return t.prototype.init=function(t){t.uploaded=this;for(var n=this.buffer,i=this.i,r=0,e=i.length;r<e;++r)i[r].init(n);return this.update(t),this},t.prototype.update=function(t){for(var n=this.buffer,i=this.i,r=0,e=i.length;r<e;++r)i[r].update(n,t)},t.prototype.isCompatible=function(t){for(var n=this.i,i=0,r=n.length;i<r;++i)if(!n[i].isCompatible(t))return!1;return!0},t.prototype.getBuffer=function(){return this.buffer},t.prototype.getVertexOffset=function(){return this.u},t.prototype.getVertexCount=function(){return this.o},t.prototype.getIndexOffset=function(){return this.h},t.prototype.getIndexCount=function(){return this.l},t.prototype.buildUnit=function(t){for(var n=this.i,i=0,r=n.length;i<r;++i)n[i].buildUnit(t)},t}(),s={NONE:0,NON_EXPANDING_WIDTH:2,NON_SHRINKING_WIDTH:4,NON_SCALING_DOT_AND_DASH:8,NON_SCALING:14,NON_SCALING_MASK:14,DOTTED:16,DOTTED_DENSELY:32,DOTTED_LOOSELY:64,DOTTED_MASK:112,DASHED:128,DASHED_DENSELY:256,DASHED_LOOSELY:512,DASHED_MASK:896},h=function(t,n,i,r){return i&s.DOTTED_MASK?i&s.DOTTED?r.set(n,n):i&s.DOTTED_DENSELY?r.set(n,.5*n):r.set(n,2*n):i&s.DASHED_MASK?i&s.DASHED?r.set(2*n,n):i&s.DASHED_DENSELY?r.set(2*n,.5*n):r.set(2*n,2*n):r.set(2*t,0),r},o=function(t){var n=t&s.NON_EXPANDING_WIDTH?1:0,i=t&s.NON_SHRINKING_WIDTH?2:0;return t&(s.DOTTED_MASK||s.DASHED_MASK)?n|i|(t&s.NON_SCALING_DOT_AND_DASH?4:0):n|i},a=new t.Point,c=function(t,n){var i=3*n-1;t[++i]=1,t[++i]=0,t[++i]=3,t[++i]=0,t[++i]=1,t[++i]=5,t[++i]=1,t[++i]=0,t[++i]=3,t[++i]=0,t[++i]=1,t[++i]=5},f=function(t,n,i){var r=3*i-1;t[++r]=n,t[++r]=n+2,t[++r]=n+1,t[++r]=n+1,t[++r]=n+2,t[++r]=n+3},l=function(t,n,i,r,e,u,s,c,f){var l=f.a,v=f.b,b=f.c,d=f.d,g=f.tx,m=f.ty,w=e[0],p=e[1],O=l*w+b*p+g,D=v*w+d*p+m,E=e[2],M=e[3],S=l*E+b*M+g,T=v*E+d*M+m,j=S-O,N=T-D,I=Math.sqrt(j*j+N*N),C=I;if(0<=u&&1e-5<I){var A=u/I;S=O+(j*=A),T=D+(N*=A),C=u}var R=O-j,L=D-N,y=S+j,k=T+N,x=o(c),B=h(C,s,c,a),_=B.x,P=B.y,U=(r<<1)-1,F=(r<<2)-1,G=6*r-1;t[++U]=O,t[++U]=D,t[++U]=O,t[++U]=D,n[++G]=s,n[++G]=x,n[++G]=R,n[++G]=L,n[++G]=S,n[++G]=T,n[++G]=s,n[++G]=x,n[++G]=R,n[++G]=L,n[++G]=S,n[++G]=T,i[++F]=0,i[++F]=_,i[++F]=P,i[++F]=C,i[++F]=0,i[++F]=_,i[++F]=P,i[++F]=C,t[++U]=S,t[++U]=T,t[++U]=S,t[++U]=T,n[++G]=s,n[++G]=x,n[++G]=O,n[++G]=D,n[++G]=y,n[++G]=k,n[++G]=s,n[++G]=x,n[++G]=O,n[++G]=D,n[++G]=y,n[++G]=k,i[++F]=C,i[++F]=_,i[++F]=P,i[++F]=C,i[++F]=C,i[++F]=_,i[++F]=P,i[++F]=C},v=function(t,n,i){var r=(n<<1)-1;t[++r]=i.x0,t[++r]=i.y0,t[++r]=i.x3,t[++r]=i.y3,t[++r]=i.x1,t[++r]=i.y1,t[++r]=i.x2,t[++r]=i.y2},b=function(){function t(){this.target="",this.position=0}return t.prototype.init=function(t){this.target=t,this.position=0},t.prototype.hasNext=function(){return this.position<this.target.length},t.prototype.findNextBreak=function(t,n){for(var i=t.length,r=n;r<i;++r){var e=t.charCodeAt(r);if(!this.isLowSurrogate(e)&&!this.isVariationSelector(e))return r}return i},t.prototype.isHighSurrogate=function(t){return 55296<=t&&t<=56319},t.prototype.isLowSurrogate=function(t){return 56320<=t&&t<=57343},t.prototype.isVariationSelector=function(t){return 65024<=t&&t<=65039},t.prototype.next=function(){var t=this.target,n=this.position,i=this.findNextBreak(t,n+1),r=t.substring(n,i);return this.position=i,r},t.prototype.advance=function(t){var n=this.target,i=this.position,r=this.findNextBreak(n,i+1);return n.substring(i,r)!==t&&(this.position=r,!0)},t.prototype.close=function(){var t=this.target.length;return this.position<t&&(this.position=t,!0)},t.from=function(n){null==t.v&&(t.v=new t);var i=t.v;return i.init(n),i},t.v=null,t}(),d={NORMAL:0,BOLD:1},g={NORMAL:0,ITALIC:1},m={LEFT:0,CENTER:1,RIGHT:2,OUTSIDE_LEFT:3,OUTSIDE_RIGHT:4},w={TOP:0,MIDDLE:1,BOTTOM:2,OUTSIDE_TOP:3,OUTSIDE_BOTTOM:4},p={LEFT_TO_RIGHT:0,TOP_TO_BOTTOM:1,BOTTOM_TO_TOP:2,RIGHT_TO_LEFT:3},O=function(t,n,i,r){var e=i-t,u=r-n;return Math.sqrt(e*e+u*u)},D=1e-5,E=new t.Point,M=function(t){return 12*Math.ceil(t.text.value.length/12)},S=function(t,n,i){for(var r=3*n-1,e=3*(n+i)-1;r<e;)t[++r]=0,t[++r]=0,t[++r]=2},T=function(t,n,i,r){for(var e=3*i-1,u=3*(i+r)-1,s=n;e<u;)t[++e]=s,t[++e]=s+1,t[++e]=s+3,t[++e]=s+1,t[++e]=s+2,t[++e]=s+3,s+=4},j=function(t,n,i,r,e,u,h,a,c){var f=6*n-1,l=6*(n+i)-1,v=o(s.NONE);if(null!=r)for(var b=r.font.size/(e*(a+c)*.5),g=h===d.NORMAL?0:.05;f<l;)t[++f]=u,t[++f]=v,t[++f]=b,t[++f]=1,t[++f]=0,t[++f]=g;else for(;f<l;)t[++f]=0,t[++f]=v,t[++f]=0,t[++f]=1,t[++f]=0,t[++f]=0},N=function(t,n,i,r,e,u,s,h,o,a,c,f,l,v,b,d,g,p,O,D,E){switch(t){case m.LEFT:switch(n){case w.TOP:E.x=o+g*(i+e)+O*(r+u),E.y=a+p*(i+e)+D*(r+u);break;case w.MIDDLE:E.x=.5*(o+b)+g*(i+e)+O*(r-.5*h),E.y=.5*(a+d)+p*(i+e)+D*(r-.5*h);break;case w.BOTTOM:E.x=b+g*(i+e)+O*(r-u-h),E.y=d+p*(i+e)+D*(r-u-h);break;case w.OUTSIDE_TOP:E.x=o+g*(i+e)+O*(r-u-h),E.y=a+p*(i+e)+D*(r-u-h);break;case w.OUTSIDE_BOTTOM:E.x=b+g*(i+e)+O*(r+u),E.y=d+p*(i+e)+D*(r+u)}break;case m.CENTER:switch(n){case w.TOP:E.x=.5*(o+c)+g*(i-.5*s)+O*(r+u),E.y=.5*(a+f)+p*(i-.5*s)+D*(r+u);break;case w.MIDDLE:E.x=.5*(o+l)+g*(i-.5*s)+O*(r-.5*h),E.y=.5*(a+v)+p*(i-.5*s)+D*(r-.5*h);break;case w.BOTTOM:E.x=.5*(b+l)+g*(i-.5*s)+O*(r-u-h),E.y=.5*(d+v)+p*(i-.5*s)+D*(r-u-h);break;case w.OUTSIDE_TOP:E.x=.5*(o+c)+g*(i-.5*s)+O*(r-u-h),E.y=.5*(a+f)+p*(i-.5*s)+D*(r-u-h);break;case w.OUTSIDE_BOTTOM:E.x=.5*(b+l)+g*(i-.5*s)+O*(r+u),E.y=.5*(d+v)+p*(i-.5*s)+D*(r+u)}break;case m.RIGHT:switch(n){case w.TOP:E.x=c+g*(i-e-s)+O*(r+u),E.y=f+p*(i-e-s)+D*(r+u);break;case w.MIDDLE:E.x=.5*(c+l)+g*(i-e-s)+O*(r-.5*h),E.y=.5*(f+v)+p*(i-e-s)+D*(r-.5*h);break;case w.BOTTOM:E.x=l+g*(i-e-s)+O*(r-u-h),E.y=v+p*(i-e-s)+D*(r-u-h);break;case w.OUTSIDE_TOP:E.x=c+g*(i-e-s)+O*(r-u-h),E.y=f+p*(i-e-s)+D*(r-u-h);break;case w.OUTSIDE_BOTTOM:E.x=l+g*(i-e-s)+O*(r+u),E.y=v+p*(i-e-s)+D*(r+u)}break;case m.OUTSIDE_LEFT:switch(n){case w.TOP:E.x=o+g*(i-e-s)+O*(r+u),E.y=a+p*(i-e-s)+D*(r+u);break;case w.MIDDLE:E.x=.5*(o+b)+g*(i-e-s)+O*(r-.5*h),E.y=.5*(a+d)+p*(i-e-s)+D*(r-.5*h);break;case w.BOTTOM:E.x=b+g*(i-e-s)+O*(r-u-h),E.y=d+p*(i-e-s)+D*(r-u-h);break;case w.OUTSIDE_TOP:E.x=o+g*(i-e-s)+O*(r-u-h),E.y=a+p*(i-e-s)+D*(r-u-h);break;case w.OUTSIDE_BOTTOM:E.x=b+g*(i-e-s)+O*(r+u),E.y=d+p*(i-e-s)+D*(r+u)}break;case m.OUTSIDE_RIGHT:switch(n){case w.TOP:E.x=c+g*(i+e)+O*(r+u),E.y=f+p*(i+e)+D*(r+u);break;case w.MIDDLE:E.x=.5*(c+l)+g*(i+e)+O*(r-.5*h),E.y=.5*(f+v)+p*(i+e)+D*(r-.5*h);break;case w.BOTTOM:E.x=l+g*(i+e)+O*(r-u-h),E.y=v+p*(i+e)+D*(r-u-h);break;case w.OUTSIDE_TOP:E.x=c+g*(i+e)+O*(r-u-h),E.y=f+p*(i+e)+D*(r-u-h);break;case w.OUTSIDE_BOTTOM:E.x=l+g*(i+e)+O*(r+u),E.y=v+p*(i+e)+D*(r+u)}}},I=function(t,n,i,r,e,u,s,h,o,a,c,f,l,v,d,M,S,T,j,I,R,L,y,x,B){var _=.5*s,P=.5*h,U=B.a,F=B.b,G=B.c,H=B.d,z=B.tx,V=B.ty,W=e-_,X=u-P,K=e+_,Y=u-P,J=e+_,Z=u+P,q=U*W+G*X+z,Q=F*W+H*X+V,$=U*K+G*Y+z,tt=F*K+H*Y+V,nt=U*J+G*Z+z,it=F*J+H*Z+V,rt=q+(nt-$),et=Q+(it-tt),ut=O(q,Q,$,tt),st=O(0,0,U,F),ht=1,ot=0;if(D<st){var at=1/st;ht=U*at,ot=F*at}var ct=O(q,Q,rt,et),ft=O(0,0,G,H),lt=0,vt=1;if(D<st){var bt=1/ft;lt=G*bt,vt=H*bt}var dt=E;switch(j){case p.LEFT_TO_RIGHT:break;case p.TOP_TO_BOTTOM:dt.set(lt,vt),lt=-ht,vt=-ot,ht=dt.x,ot=dt.y,dt.x=ft,ft=st,st=dt.x;break;case p.BOTTOM_TO_TOP:dt.set(lt,vt),lt=ht,vt=ot,ht=-dt.x,ot=-dt.y,dt.x=ft,ft=st,st=dt.x;break;case p.RIGHT_TO_LEFT:ht=-ht,ot=-ot,lt=-lt,vt=-vt}for(var gt=0,mt=0,wt=0,pt=a*ft,Ot=Math.max(0,a+T)*ft,Dt=0,Et=o.characters,Mt=b.from(c),St=0;Mt.hasNext();)"\n"!==(hn=Mt.next())?(0<St&&(Dt+=Math.max(0,St+S)),(an=Et[hn])?(St=an.advance,wt=an.height):St=0):(Dt+=St,St=0,gt=Math.max(gt,Dt),Dt=0,mt+=Ot);var Tt=a/o.font.size,jt=st*Tt,Nt=ft*Tt;Dt+=St,gt=Math.max(gt,Dt)*jt,Dt=0,wt*=Nt,mt+=pt;var It=0,Ct=0,At=NaN;switch(j){case p.LEFT_TO_RIGHT:if(N(l,v,d,M,I,R,gt,mt,q,Q,$,tt,nt,it,rt,et,ht,ot,lt,vt,dt),It=dt.x,Ct=dt.y,L)switch(l){case m.LEFT:case m.CENTER:case m.RIGHT:switch(v){case w.TOP:case w.MIDDLE:case w.BOTTOM:At=ut-2*I}}break;case p.TOP_TO_BOTTOM:if(N(function(t){switch(t){case w.TOP:return m.LEFT;case w.MIDDLE:return m.CENTER;case w.BOTTOM:return m.RIGHT;case w.OUTSIDE_TOP:return m.OUTSIDE_LEFT;case w.OUTSIDE_BOTTOM:return m.OUTSIDE_RIGHT}}(v),function(t){switch(t){case m.LEFT:return w.BOTTOM;case m.CENTER:return w.MIDDLE;case m.RIGHT:return w.TOP;case m.OUTSIDE_LEFT:return w.OUTSIDE_BOTTOM;case m.OUTSIDE_RIGHT:return w.OUTSIDE_TOP}}(l),M,d,R,I,gt,mt,$,tt,nt,it,rt,et,q,Q,ht,ot,lt,vt,dt),It=dt.x,Ct=dt.y,L)switch(v){case w.TOP:case w.MIDDLE:case w.BOTTOM:switch(l){case m.LEFT:case m.CENTER:case m.RIGHT:At=ct-2*R}}break;case p.BOTTOM_TO_TOP:if(N(function(t){switch(t){case w.TOP:return m.RIGHT;case w.MIDDLE:return m.CENTER;case w.BOTTOM:return m.LEFT;case w.OUTSIDE_TOP:return m.OUTSIDE_RIGHT;case w.OUTSIDE_BOTTOM:return m.OUTSIDE_LEFT}}(v),function(t){switch(t){case m.LEFT:return w.TOP;case m.CENTER:return w.MIDDLE;case m.RIGHT:return w.BOTTOM;case m.OUTSIDE_LEFT:return w.OUTSIDE_TOP;case m.OUTSIDE_RIGHT:return w.OUTSIDE_BOTTOM}}(l),M,d,R,I,gt,mt,rt,et,q,Q,$,tt,nt,it,ht,ot,lt,vt,dt),It=dt.x,Ct=dt.y,L)switch(v){case w.TOP:case w.MIDDLE:case w.BOTTOM:switch(l){case m.LEFT:case m.CENTER:case m.RIGHT:At=ct-2*R}}break;case p.RIGHT_TO_LEFT:if(N(function(t){switch(t){case m.LEFT:return m.RIGHT;case m.CENTER:return m.CENTER;case m.RIGHT:return m.LEFT;case m.OUTSIDE_LEFT:return m.OUTSIDE_RIGHT;case m.OUTSIDE_RIGHT:return m.OUTSIDE_LEFT}}(l),function(t){switch(t){case w.TOP:return w.BOTTOM;case w.MIDDLE:return w.MIDDLE;case w.BOTTOM:return w.TOP;case w.OUTSIDE_TOP:return w.OUTSIDE_BOTTOM;case w.OUTSIDE_BOTTOM:return w.OUTSIDE_TOP}}(v),d,M,I,R,gt,mt,nt,it,rt,et,q,Q,$,tt,ht,ot,lt,vt,dt),It=dt.x,Ct=dt.y,L)switch(l){case m.LEFT:case m.CENTER:case m.RIGHT:switch(v){case w.TOP:case w.MIDDLE:case w.BOTTOM:At=ut-2*I}}}if(At<gt){var Rt=.5*(gt-At);y[0]=It+ht*Rt,y[1]=Ct+ot*Rt,y[2]=ht,y[3]=ot,y[4]=lt,y[5]=vt,y[6]=At,y[7]=mt,y[8]=st,y[9]=ft}else y[0]=It,y[1]=Ct,y[2]=ht,y[3]=ot,y[4]=lt,y[5]=vt,y[6]=gt,y[7]=mt,y[8]=st,y[9]=ft;var Lt=x.x0,yt=x.x1,kt=x.x3,xt=x.y0,Bt=x.y1,_t=x.y3,Pt=yt-Lt,Ut=Bt-xt,Ft=kt-Lt,Gt=_t-xt,Ht=Ot*lt,zt=Ot*vt,Vt=jt*ht,Wt=jt*ot,Xt=.5*(wt-pt),Kt=Xt*lt,Yt=Xt*vt,Jt=f===g.NORMAL?0:.25*a,Zt=It-Kt+Jt*Vt,qt=Ct-Yt+Jt*Wt,Qt=It+Kt+pt*lt,$t=Ct+Yt+pt*vt,tn=Zt,nn=qt,rn=Qt,en=$t;Dt=0,St=0,Mt.position=0;for(var un=0,sn=2*i;Mt.hasNext();sn+=8){var hn;if("\n"!==(hn=Mt.next())){var on=Dt;0<St&&(Dt+=Math.max(0,St+S));var an,cn=Dt*Vt,fn=Dt*Wt;if(tn=Zt+cn,nn=qt+fn,rn=Qt+cn,en=$t+fn,un+=1,an=Et[hn]){var ln=an.advance;if(At<(Dt+ln)*jt){var vn=Et["..."];if(vn){if(1<un&&At<(Dt+vn.advance)*jt){sn-=8,un-=1;var bn=(Dt=on)*Vt,dn=Dt*Wt;tn=Zt+bn,nn=qt+dn,rn=Qt+bn,en=$t+dn}for(St=vn.advance,A(t,n,sn,vn,o,Vt,Wt,tn,nn,rn,en,Pt,Ut,Ft,Gt,Lt,xt),sn+=8;;sn+=8){if(!Mt.hasNext()||!Mt.advance("\n")){sn-=8;break}C(t,n,sn,tn,nn,rn,en,Lt,xt,kt,_t),un+=1}}else St=ln,C(t,n,sn,tn,nn,rn,en,Lt,xt,kt,_t)}else St=ln,A(t,n,sn,an,o,Vt,Wt,tn,nn,rn,en,Pt,Ut,Ft,Gt,Lt,xt)}else St=0,C(t,n,sn,tn,nn,rn,en,Lt,xt,kt,_t)}else Dt+=St,St=0,C(t,n,sn,tn=Zt+=Ht,nn=qt+=zt,rn=Qt+=Ht,en=$t+=zt,Lt,xt,kt,_t),k(t,ht,ot,un,sn,gt-Dt*jt,j,l,v),Dt=0,un=0}k(t,ht,ot,un,sn,gt-(Dt+=St)*jt,j,l,v);for(var gn=2*(i+r);sn<gn;sn+=2)t[sn+0]=It,t[sn+1]=Ct,n[sn+0]=Lt,n[sn+1]=xt},C=function(t,n,i,r,e,u,s,h,o,a,c){t[i+0]=r,t[i+1]=e,t[i+2]=r,t[i+3]=e,t[i+4]=u,t[i+5]=s,t[i+6]=u,t[i+7]=s,n[i+0]=h,n[i+1]=o,n[i+2]=h,n[i+3]=o,n[i+4]=a,n[i+5]=c,n[i+6]=a,n[i+7]=c},A=function(t,n,i,r,e,u,s,h,o,a,c,f,l,v,b,d,g){var m=r.x-r.origin.x,w=r.width,p=m*u,O=m*s,D=(m+w)*u,E=(m+w)*s;t[i+0]=h+p,t[i+1]=o+O,t[i+2]=h+D,t[i+3]=o+E,t[i+4]=a+D,t[i+5]=c+E,t[i+6]=a+p,t[i+7]=c+O;var M=r.x/e.width,S=r.y/e.height,T=(r.x+r.width)/e.width,j=(r.y+r.height)/e.height,N=f*M,I=l*M,C=f*T,A=l*T,R=v*S,L=b*S,y=v*j,k=b*j;n[i+0]=d+N+R,n[i+1]=g+I+L,n[i+2]=d+C+R,n[i+3]=g+A+L,n[i+4]=d+C+y,n[i+5]=g+A+k,n[i+6]=d+N+y,n[i+7]=g+I+k},R=function(t,n,i,r,e){for(var u=n-8*i-1,s=0;s<i;++s)t[++u]+=r,t[++u]+=e,t[++u]+=r,t[++u]+=e,t[++u]+=r,t[++u]+=e,t[++u]+=r,t[++u]+=e},L=function(t,n,i,r,e,u){R(t,n,i,(r*=.5)*e,r*u)},y=function(t,n,i,r,e,u){R(t,n,i,r*e,r*u)},k=function(t,n,i,r,e,u,s,h,o){if(D<u)switch(s){case p.LEFT_TO_RIGHT:switch(h){case m.OUTSIDE_RIGHT:case m.LEFT:break;case m.CENTER:L(t,e,r,u,n,i);break;case m.OUTSIDE_LEFT:case m.RIGHT:y(t,e,r,u,n,i)}break;case p.TOP_TO_BOTTOM:switch(o){case w.OUTSIDE_BOTTOM:case w.TOP:break;case w.MIDDLE:L(t,e,r,u,n,i);break;case w.OUTSIDE_TOP:case w.BOTTOM:y(t,e,r,u,n,i)}break;case p.BOTTOM_TO_TOP:switch(o){case w.OUTSIDE_BOTTOM:case w.TOP:y(t,e,r,u,n,i);break;case w.MIDDLE:L(t,e,r,u,n,i)}break;case p.RIGHT_TO_LEFT:switch(h){case m.OUTSIDE_RIGHT:case m.LEFT:y(t,e,r,u,n,i);break;case m.CENTER:L(t,e,r,u,n,i)}}},x=function(t,n){return(x=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(t,n)};function B(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}x(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}var _,P,U,F={NONE:0,CLOSED:1,NON_EXPANDING_WIDTH:2,NON_SHRINKING_WIDTH:4,NON_SCALING_DOT_AND_DASH:8,NON_SCALING_MASK:14,DOTTED:16,DOTTED_DENSELY:32,DOTTED_LOOSELY:64,DOTTED_MASK:112,DASHED:128,DASHED_DENSELY:256,DASHED_LOOSELY:512,DASHED_MASK:896,CURVE:1024,FORMATTER_MASK:1024},G=function(t,n,i,r,e){for(var u=(t>>16&255)/255*n,s=(t>>8&255)/255*n,h=(t>>0&255)/255*n,o=n,a=(i<<2)-1,c=(i+r<<2)-1;a<c;)e[++a]=u,e[++a]=s,e[++a]=h,e[++a]=o},H=function(){function n(t,n,i,r){this.vertexOffset=t,this.indexOffset=n,this.vertexCount=i,this.indexCount=r,this.sizeX=NaN,this.sizeY=NaN,this.transformLocalId=-1,this.strokeAlign=NaN,this.strokeWidth=NaN,this.strokeSide=NaN,this.strokeStyle=NaN,this.colorFill=NaN,this.alphaFill=-1,this.colorStroke=NaN,this.alphaStroke=-1,this.texture=null,this.textureTransformId=NaN}return n.prototype.isCompatible=function(t){return!0},n.prototype.updateColorFill=function(t,n){var i=n.fill,r=n.visible&&i.enable,e=i.color,u=r?i.alpha:0;e===this.colorFill&&u===this.alphaFill||(this.colorFill=e,this.alphaFill=u,t.updateColorFills(),G(e,u,this.vertexOffset,this.vertexCount,t.colorFills))},n.prototype.updateColorStroke=function(t,n){var i=n.stroke,r=n.visible&&i.enable&&0<i.width,e=i.color,u=r?i.alpha:0;e===this.colorStroke&&u===this.alphaStroke||(this.colorStroke=e,this.alphaStroke=u,t.updateColorStrokes(),G(e,u,this.vertexOffset,this.vertexCount,t.colorStrokes))},n.prototype.buildUnit=function(n){var i=this.texture||t.Texture.WHITE,r=i.baseTexture;if(r!==n.baseTexture){n.baseTexture=r;var e=this.indexOffset;n.push(i,e)}},n}(),z=function(t){return t.updateTransform(),t.transform.getLocalId()},V=function(n){return n.texture||t.Texture.WHITE},W=function(t){var n=t;return null==n._uvs&&t.updateUvs(),n._updateID},X=function(t){return t._uvs},K=function(){function t(){}return t.setDefaultThemeClass=function(t){this.DEFAULT_THEME_CLASS=t},t.getDefaultThemeClass=function(){return this.DEFAULT_THEME_CLASS},t.getInstance=function(){if(null==this.INSTANCE){var t=this.getDefaultThemeClass();if(null==t)throw new Error("No default theme class found");this.INSTANCE=new t}return this.INSTANCE},t.setInstance=function(t){var n=this.INSTANCE;return this.INSTANCE=t,n},t.get=function(t){return this.getInstance().get(t)},t.set=function(t,n){this.getInstance().set(t,n)},t.getClass=function(t){return this.getInstance().getClass(t)},t.setClass=function(t,n){this.getInstance().setClass(t,n)},t.getAtlas=function(){return this.getInstance().getAtlas()},t.DEFAULT_THEME_CLASS=null,t.INSTANCE=null,t}(),Y=function(){function t(){}return Object.defineProperty(t,"THEME",{get:function(){var t=this.g;if(null!=t)return t;var n=K.getInstance().get("EShape");return this.g=n,n},enumerable:!1,configurable:!0}),Object.defineProperty(t,"FILL_COLOR",{get:function(){return this.THEME.getFillColor()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"FILL_ALPHA",{get:function(){return this.THEME.getFillAlpha()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"STROKE_COLOR",{get:function(){return this.THEME.getStrokeColor()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"STROKE_ALPHA",{get:function(){return this.THEME.getStrokeAlpha()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"STROKE_WIDTH",{get:function(){return this.THEME.getStrokeWidth()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"STROKE_ALIGN",{get:function(){return this.THEME.getStrokeAlign()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"STROKE_SIDE",{get:function(){return this.THEME.getStrokeSide()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"STROKE_STYLE",{get:function(){return this.THEME.getStrokeStyle()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"TEXT_VALUE",{get:function(){return this.THEME.getTextValue()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"TEXT_COLOR",{get:function(){return this.THEME.getTextColor()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"TEXT_ALPHA",{get:function(){return this.THEME.getTextAlpha()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"TEXT_FAMILY",{get:function(){return this.THEME.getTextFamily()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"TEXT_SIZE",{get:function(){return this.THEME.getTextSize()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"RADIUS",{get:function(){return this.THEME.getRadius()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"SIZE_X",{get:function(){return this.THEME.getSizeX()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"SIZE_Y",{get:function(){return this.THEME.getSizeY()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"HIGHLIGHT_COLOR",{get:function(){return this.THEME.getHighlightColor()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"CURVE_SEGMENT_COUNT",{get:function(){return this.THEME.getCurveSegmentCount()},enumerable:!1,configurable:!0}),t}(),J={NONE:0,CIRCLE:1,TRIANGLE:2,RECTANGLE:3},Z=function(){function t(t,n,i,r){this.p=t,this.O=n,this.S=i,this.T=r}return Object.defineProperty(t.prototype,"enable",{get:function(){return this.O},set:function(t){this.O!==t&&(this.O=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this.S},set:function(t){this.S!==t&&(this.S=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return this.T},set:function(t){this.T!==t&&(this.T=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){t&&this.set(t.enable,t.color,t.alpha)},t.prototype.set=function(t,n,i){var r=!1;void 0!==t&&this.O!==t&&(this.O=t,r=!0),void 0!==n&&this.S!==n&&(this.S=n,r=!0),void 0!==i&&this.T!==i&&(this.T=i,r=!0),r&&this.p.updateUploaded()},t.prototype.clone=function(){return new t(this.p,this.O,this.S,this.T)},t.prototype.toObject=function(){return{enable:this.O,color:this.S,alpha:this.T}},t.prototype.serialize=function(t){var n="[".concat(this.O?1:0,",").concat(this.S,",").concat(this.T,"]");return t.addResource(n)},t.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getFill(t);if(null!=r)this.set(!!r[0],r[1],r[2]);else{var e=JSON.parse(i[t]);n.setFill(t,e),this.set(!!e[0],e[1],e[2])}}},t}(),q=function(){function n(){}return n.prototype.lock=function(){return this},n.prototype.unlock=function(){return this},Object.defineProperty(n.prototype,"type",{get:function(){return J.NONE},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"size",{get:function(){var n=this.j;return null==n&&(n=new t.Point,this.j=n),n},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"transform",{get:function(){var n=this.I;return null==n&&(n=new t.Matrix,this.I=n),n},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"fill",{get:function(){var t=this.C;return null==t&&(t=new Z(this,!0,Y.FILL_COLOR,1),this.C=t),t},enumerable:!1,configurable:!0}),n.prototype.updateUploaded=function(){},n.prototype.copy=function(t){return this},n.prototype.set=function(t,n,i){return this},n.prototype.serialize=function(t){return-1},n.prototype.deserialize=function(t,n){},n}(),Q=function(){function t(){this.A=new q}return t.prototype.lock=function(){return this},t.prototype.unlock=function(){return this},Object.defineProperty(t.prototype,"head",{get:function(){return this.A},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tail",{get:function(){return this.A},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){return this},t.prototype.serialize=function(t){return-1},t.prototype.deserialize=function(t,n){},t.getInstance=function(){var n=this.INSTANCE;return null==n&&(n=new t,this.INSTANCE=n),n},t}(),$={TOP:0,LEFT:1,RIGHT:2,BOTTOM:3},tt=function(){function n(t){this.p=t,this.R=0,this.L=[0,0,0,0],this.k=[],this.B=F.NONE,this.j=-1,this._=$.TOP,this.P=NaN,this.U=NaN,this.F=NaN,this.G=NaN}return n.prototype.getComputedSize=function(t,n,i,r){if(0<=t)return t;switch(n){case $.TOP:case $.BOTTOM:return Math.abs(r);case $.RIGHT:case $.LEFT:return Math.abs(i)}return 0},n.prototype.update=function(){var t=this.p.size,n=t.x,i=t.y,r=this._,e=this.j;if(this.P!==e||this.U!==n||this.F!==i||this.G!==r){this.R+=1,this.P=e,this.U=n,this.F=i,this.G=r;var u=.5*n,s=.5*i,h=this.getComputedSize(e,r,n,i),o=this.L;switch(r){case $.TOP:o[0]=0,o[1]=-s,o[2]=0,o[3]=-s+h;break;case $.RIGHT:o[0]=u,o[1]=0,o[2]=u-h,o[3]=0;break;case $.BOTTOM:o[0]=0,o[1]=s,o[2]=0,o[3]=s-h;break;case $.LEFT:o[0]=-u,o[1]=0,o[2]=-u+h,o[3]=0}}},Object.defineProperty(n.prototype,"length",{get:function(){return 2},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"id",{get:function(){return this.update(),this.R},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"values",{get:function(){return this.update(),this.L},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"segments",{get:function(){return this.k},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"size",{get:function(){return this.j},set:function(t){this.moveTo(void 0,t,void 0)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"position",{get:function(){return this._},set:function(t){this.moveTo(t,void 0,void 0)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"style",{get:function(){return this.B},set:function(t){this.moveTo(void 0,void 0,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"marker",{get:function(){var t=this.A;return null==t&&(t=Q.getInstance(),this.A=t),t},enumerable:!1,configurable:!0}),n.prototype.getMarker=function(){},Object.defineProperty(n.prototype,"formatter",{get:function(){return null},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"formatted",{get:function(){return this},enumerable:!1,configurable:!0}),n.prototype.copy=function(t){return t instanceof n?this.moveTo(t.position,t.size,t.style):this.moveTo(void 0,void 0,t.style)},n.prototype.set=function(t,n,i){var r,e;if(null!=t){var u=t[0];if(0===u){var s=t[1];r=s<=0?$.TOP:$.BOTTOM,e=Math.abs(t[3]-s)}else r=u<=0?$.LEFT:$.RIGHT,e=Math.abs(t[2]-u)}return this.moveTo(r,e,i)},n.prototype.moveTo=function(t,n,i){var r=!1;return null!=i&&this.B!==i&&(this.B=i,r=!0),null!=t&&this._!==t&&(this._=t,r=!0),null!=n&&this.j!==n&&(this.j=n,r=!0),r&&this.p.updateUploaded(),this},n.prototype.clone=function(t){return new n(t).copy(this)},n.prototype.toPoints=function(n){for(var i=[],r=this.values,e=0,u=r.length;e<u;e+=2){var s=new t.Point(r[e+0],r[e+1]);i.push(n.apply(s,s))}return i},n.prototype.serialize=function(t){return t.addResource("[".concat(this._,",").concat(this.j,",").concat(this.B,"]"))},n.prototype.deserialize=function(t,n){if(0<=t&&t<n.resources.length){var i=n.resources[t],r=JSON.parse(i);this.moveTo(r[0],r[1],r[2])}},n.prototype.calcHitPointAbs=function(t,n,i,r,e,u,s,h){if(2<=this.length){var o=this.L;if(s(t,n,o[0],o[1],o[2],o[3],0,e,h))return!0}return!1},n}(),nt={NONE:0,LINE:1,MARKER_TAIL:2,MARKER_HEAD:3,TEXT:4,CHILDREN:5},it={NONE:0,TOP_LEFT:1,TOP_RIGHT:2,BOTTOM_LEFT:4,BOTTOM_RIGHT:8,TOP:3,BOTTOM:12,LEFT:5,RIGHT:10,ALL:15},rt=function(){function t(){}return t.add=function(n){t.INSTANCES.push(n)},t.first=function(){var n=t.INSTANCES;if(0<n.length)return n[0];throw new Error("No application found.")},t.last=function(){var n=t.INSTANCES;if(0<n.length)return n[n.length-1];throw new Error("No application found.")},t.get=function(n){var i=t.INSTANCES;return 0<=n&&n<i.length?i[n]:null},t.indexOf=function(n){return t.INSTANCES.indexOf(n)},t.size=function(){return t.INSTANCES.length},t.getStage=function(t){for(var n=t;n.parent;)n=n.parent;return"application"in n&&"layer"in n?n:null},t.find=function(t){var n=this.getStage(t);return n?n.layer.application:null},t.getLayerBase=function(t){var n=this.getStage(t);return n?n.layer.application.getLayerBase():null},t.getLayerOverlay=function(t){var n=this.getStage(t);return n?n.layer.application.getLayerOverlay():null},t.getLayer=function(t){var n=this.getStage(t);return n?n.layer:null},t.getResolution=function(t){var n,i=this.getLayer(t);return i?i.renderer.resolution:null!==(n=window.devicePixelRatio)&&void 0!==n?n:1},t.update=function(n){if(n){var i=this.getStage(n);i&&i.layer.update()}else for(var r=t.INSTANCES,e=0,u=r.length;e<u;++e)r[e].update()},t.render=function(n){if(n){var i=this.getStage(n);i&&i.layer.render()}else for(var r=t.INSTANCES,e=0,u=r.length;e<u;++e)r[e].render()},t.INSTANCES=[],t}(),et=function(){function t(){this.values=[]}return t.prototype.add=function(t,n){var i=this.values;return null!=n?i.splice(n,0,t):i.push(t),this},t.prototype.addAll=function(t){for(var n=this.values,i=0,r=t.length;i<r;++i)n.push(t[i]);return this},t.prototype.clearAndAdd=function(t){return this.clear(),this.add(t),this},t.prototype.clearAndAddAll=function(t){return this.clear(),this.addAll(t),this},t.prototype.indexOf=function(t){for(var n=this.values,i=0,r=n.length;i<r;++i)if(n[i]===t)return i;for(i=0,r=n.length;i<r;++i)if(n[i].isEquals(t))return i;return-1},t.prototype.get=function(t){var n=this.values;return 0<=t||t<n.length?n[t]:null},t.prototype.set=function(t,n){var i=this.values;if(0<=t||t<i.length){var r=i[t];return i[t]=n,r}return null},t.prototype.remove=function(t){var n=this.values;return 0<=t||t<n.length?n.splice(t,1)[0]:null},t.prototype.clear=function(){return this.values.length=0,this},t.prototype.size=function(){return this.values.length},t.prototype.swap=function(t,n){var i=this.values,r=i[n];return i[n]=i[t],i[t]=r,this},t.prototype.serialize=function(t){for(var n=[],i=this.values,r=0,e=i.length;r<e;++r)n.push(i[r].serialize(t));return n},t}(),ut=function(){function t(t){this.p=t,this.V=new Set}return t.prototype.add=function(t){var n=this.V;return!n.has(t)&&(n.add(t),!0)},t.prototype.contains=function(t){return this.V.has(t)},t.prototype.size=function(){return this.V.size},t.prototype.remove=function(t){return this.V.delete(t)},t.prototype.clear=function(){return 0<this.V.size&&(this.V.clear(),!0)},t.prototype.copy=function(t){var n=this.V;return n.clear(),t.each((function(t){n.add(t)})),this},t.prototype.each=function(t){return this.V.forEach(t),this},t.prototype.fit=function(t){this.V.forEach(this.toOnFitBound(t))},t.prototype.toOnFitBound=function(t){var n;return t?(null==(n=this.W)&&(n=this.newOnFitBound(!0),this.W=n),n):(null==(n=this.K)&&(n=this.newOnFitBound(!1),this.K=n),n)},t.prototype.newOnFitBound=function(t){var n=this;return function(i){n.onFit(i,t)}},t.prototype.onFit=function(t,n){t.fit(n)},t.prototype.attach=function(){var t=this.p;return this.V.forEach((function(n){n.set(t)})),this},t.prototype.detach=function(){return this.V.forEach((function(t){t.set(null)})),this},t}(),st={NONE:0,TRANSFORM:1,SIZE:2,STYLE:4,ACTION:8,POINTS:16,STATE:32,IMAGE:64,DATA:128,TAG:128,CONNECTOR:256,CAPABILITY:512,ALL:1023},ht={HOVERED:"HOVERED",ACTIVE:"ACTIVE",FOCUSED:"FOCUSED",UNFOCUSABLE:"UNFOCUSABLE",FOCUS_ROOT:"FOCUS_ROOT",FOCUS_REVERSE:"FOCUS_REVERSE",READ_ONLY:"READ_ONLY",DISABLED:"DISABLED",GESTURING:"GESTURING",PRESSED:"PRESSED",INVALID:"INVALID",SUCCEEDED:"SUCCEEDED",FAILED:"FAILED",WARNED:"WARNED",CHANGED:"CHANGED",ALTERNATED:"ALTERNATED",NEW_WINDOW:"NEW_WINDOW"},ot=function(t){return"function"==typeof t},at=function(t){return"string"==typeof t||"[object String]"===Object.prototype.toString.call(t)},ct=function(){function t(){this.J=new Set,this.p=null}return t.prototype.is=function(t){return this.J.has(t)},t.prototype.in=function(t){return this.is(t)||this.under(t)},t.prototype.on=function(t){var n,i;return null!==(i=null===(n=this.p)||void 0===n?void 0:n.is(t))&&void 0!==i&&i},t.prototype.under=function(t){var n,i;return null!==(i=null===(n=this.p)||void 0===n?void 0:n.in(t))&&void 0!==i&&i},t.prototype.lock=function(t){return this},t.prototype.unlock=function(){return this},t.prototype.begin=function(){return this},t.prototype.end=function(){return this},t.prototype.checkAdded=function(t){return!this.J.has(t)},t.prototype.add=function(t){return this.checkAdded(t)&&(this.begin(),this.J.add(t),this.end()),this},t.prototype.checkAddeds=function(t){for(var n=this.J,i=0,r=t.length;i<r;++i)if(!n.has(t[i]))return!0;return!1},t.prototype.addAll=function(t){var n=at(t)?arguments:t;if(this.checkAddeds(n)){this.begin();for(var i=this.J,r=0,e=n.length;r<e;++r)i.add(n[r]);this.end()}return this},t.prototype.checkRemoved=function(t){return this.J.has(t)},t.prototype.remove=function(t){return this.checkRemoved(t)&&(this.begin(),this.J.delete(t),this.end()),this},t.prototype.checkRemoveds=function(t){for(var n=this.J,i=0,r=t.length;i<r;++i)if(n.has(t[i]))return!0;return!1},t.prototype.removeAll=function(t){var n=this,i=this.J;if(ot(t)){var r=!1;i.forEach((function(e){t(e)&&(r||(r=!0,n.begin()),i.delete(e))})),r&&this.end()}else{var e=at(t)?arguments:t;if(this.checkRemoveds(e)){this.begin();for(var u=0,s=e.length;u<s;++u)i.delete(e[u]);this.end()}}return this},t.prototype.clear=function(){var t=this.J;return 0<t.size&&(this.begin(),t.clear(),this.end()),this},t.prototype.set=function(t,n){if(!0===n)null!=t&&this.add(t);else if(!1===n)null!=t&&this.remove(t);else{var i=t,r=n;null!=i?null!=r?(this.checkAdded(i)||this.checkRemoved(r))&&(this.begin(),this.J.add(i).delete(r),this.end()):this.add(i):null!=r&&this.remove(r)}return this},t.prototype.setAll=function(t,n){if(!0===n)null!=t&&this.addAll(t);else if(!1===n)null!=t&&this.removeAll(t);else{var i=t,r=n;if(null!=i)if(null!=r){if(this.checkAddeds(i)||this.checkRemoveds(r)){this.begin();for(var e=this.J,u=0,s=i.length;u<s;++u)e.add(i[u]);for(u=0,s=r.length;u<s;++u)e.delete(r[u]);this.end()}}else this.addAll(i);else null!=r&&this.removeAll(r)}return this},t.prototype.each=function(t){return this.J.forEach((function(n){t(n)})),this},t.prototype.size=function(){return this.J.size},t.prototype.copy=function(n){if(n instanceof t){this.begin();var i=this.J;i.clear(),n.local.forEach((function(t){i.add(t)})),this.p=n.parent,this.end()}return this},Object.defineProperty(t.prototype,"local",{get:function(){return this.J},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){return this.p},set:function(t){this.p!==t&&(this.begin(),this.p=t,this.end())},enumerable:!1,configurable:!0}),t.prototype.onParentChange=function(t,n){this.p=n,this.begin(),this.p=t,this.end()},Object.defineProperty(t.prototype,"isHovered",{get:function(){return this.is(ht.HOVERED)},set:function(t){this.set(ht.HOVERED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inHovered",{get:function(){return this.in(ht.HOVERED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onHovered",{get:function(){return this.on(ht.HOVERED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underHovered",{get:function(){return this.under(ht.HOVERED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isActive",{get:function(){return this.is(ht.ACTIVE)},set:function(t){this.set(ht.ACTIVE,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inActive",{get:function(){return this.in(ht.ACTIVE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onActive",{get:function(){return this.on(ht.ACTIVE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underActive",{get:function(){return this.under(ht.ACTIVE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isPressed",{get:function(){return this.is(ht.PRESSED)},set:function(t){this.set(ht.PRESSED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inPressed",{get:function(){return this.in(ht.PRESSED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onPressed",{get:function(){return this.on(ht.PRESSED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underPressed",{get:function(){return this.under(ht.PRESSED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isReadOnly",{get:function(){return this.is(ht.READ_ONLY)},set:function(t){this.set(ht.READ_ONLY,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inReadOnly",{get:function(){return this.in(ht.READ_ONLY)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onReadOnly",{get:function(){return this.on(ht.READ_ONLY)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underReadOnly",{get:function(){return this.under(ht.READ_ONLY)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isEnabled",{get:function(){return!this.is(ht.DISABLED)},set:function(t){this.set(ht.DISABLED,!t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inEnabled",{get:function(){return!this.in(ht.DISABLED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onEnabled",{get:function(){return!this.on(ht.DISABLED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underEnabled",{get:function(){return!this.under(ht.DISABLED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isDisabled",{get:function(){return this.is(ht.DISABLED)},set:function(t){this.set(ht.DISABLED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inDisabled",{get:function(){return this.in(ht.DISABLED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onDisabled",{get:function(){return this.on(ht.DISABLED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underDisabled",{get:function(){return this.under(ht.DISABLED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isActionable",{get:function(){return!this.in(ht.DISABLED)&&!this.in(ht.READ_ONLY)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isGesturing",{get:function(){return this.is(ht.GESTURING)},set:function(t){this.set(ht.GESTURING,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inGesturing",{get:function(){return this.in(ht.GESTURING)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onGesturing",{get:function(){return this.on(ht.GESTURING)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underGesturing",{get:function(){return this.under(ht.GESTURING)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isFocused",{get:function(){return this.is(ht.FOCUSED)},set:function(t){this.set(ht.FOCUSED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inFocused",{get:function(){return this.in(ht.FOCUSED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onFocused",{get:function(){return this.on(ht.FOCUSED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underFocused",{get:function(){return this.under(ht.FOCUSED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isFocusRoot",{get:function(){return this.is(ht.FOCUS_ROOT)},set:function(t){this.set(ht.FOCUS_ROOT,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inFocusRoot",{get:function(){return this.in(ht.FOCUS_ROOT)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onFocusRoot",{get:function(){return this.on(ht.FOCUS_ROOT)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underFocusRoot",{get:function(){return this.under(ht.FOCUS_ROOT)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isFocusReverse",{get:function(){return this.is(ht.FOCUS_REVERSE)},set:function(t){this.set(ht.FOCUS_REVERSE,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inFocusReverse",{get:function(){return this.in(ht.FOCUS_REVERSE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onFocusReverse",{get:function(){return this.on(ht.FOCUS_REVERSE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underFocusReverse",{get:function(){return this.under(ht.FOCUS_REVERSE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isFocusable",{get:function(){return!this.is(ht.UNFOCUSABLE)},set:function(t){this.set(ht.UNFOCUSABLE,!t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inFocusable",{get:function(){return!this.in(ht.UNFOCUSABLE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onFocusable",{get:function(){return!this.on(ht.UNFOCUSABLE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underFocusable",{get:function(){return!this.under(ht.UNFOCUSABLE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isUnfocusable",{get:function(){return this.is(ht.UNFOCUSABLE)},set:function(t){this.set(ht.UNFOCUSABLE,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inUnfocusable",{get:function(){return this.in(ht.UNFOCUSABLE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onUnfocusable",{get:function(){return this.on(ht.UNFOCUSABLE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underUnfocusable",{get:function(){return this.under(ht.UNFOCUSABLE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isInvalid",{get:function(){return this.is(ht.INVALID)},set:function(t){this.set(ht.INVALID,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inInvalid",{get:function(){return this.in(ht.INVALID)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onInvalid",{get:function(){return this.on(ht.INVALID)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underInvalid",{get:function(){return this.on(ht.INVALID)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isSucceeded",{get:function(){return this.is(ht.SUCCEEDED)},set:function(t){this.set(ht.SUCCEEDED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inSucceeded",{get:function(){return this.in(ht.SUCCEEDED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onSucceeded",{get:function(){return this.on(ht.SUCCEEDED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underSucceeded",{get:function(){return this.under(ht.SUCCEEDED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isFailed",{get:function(){return this.is(ht.FAILED)},set:function(t){this.set(ht.FAILED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inFailed",{get:function(){return this.in(ht.FAILED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onFailed",{get:function(){return this.on(ht.FAILED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underFailed",{get:function(){return this.under(ht.FAILED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isWarned",{get:function(){return this.is(ht.WARNED)},set:function(t){this.set(ht.WARNED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inWarned",{get:function(){return this.in(ht.WARNED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onWarned",{get:function(){return this.on(ht.WARNED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underWarned",{get:function(){return this.on(ht.WARNED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isChanged",{get:function(){return this.is(ht.CHANGED)},set:function(t){this.set(ht.CHANGED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inChanged",{get:function(){return this.in(ht.CHANGED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onChanged",{get:function(){return this.on(ht.CHANGED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underChanged",{get:function(){return this.on(ht.CHANGED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isAlternated",{get:function(){return this.is(ht.ALTERNATED)},set:function(t){this.set(ht.ALTERNATED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inAlternated",{get:function(){return this.in(ht.ALTERNATED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onAlternated",{get:function(){return this.on(ht.ALTERNATED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underAlternated",{get:function(){return this.on(ht.ALTERNATED)},enumerable:!1,configurable:!0}),t.prototype.toObject=function(){var t=[];return this.J.forEach((function(n){t.push(n)})),{local:t}},t.prototype.toString=function(){return JSON.stringify(this.toObject())},t}(),ft=function(t){function n(n){var i=t.call(this)||this;return i.Z=n,i.q=0,i.$=!1,i.tt=!0,i}return B(n,t),n.prototype.lock=function(t){return this.q+=1,!1===t&&(this.tt=!1),this},n.prototype.unlock=function(){return this.q-=1,this.end()},Object.defineProperty(n.prototype,"saved",{get:function(){var t=this.nt;return null==t&&(t=new ct,this.nt=t),t},enumerable:!1,configurable:!0}),n.prototype.begin=function(){return this.tt&&!this.$&&(this.$=!0,this.saved.copy(this)),this},n.prototype.end=function(){return this.q<=0&&(this.tt=!0,this.$&&(this.$=!1,this.onChange(this,this.saved))),this},n.prototype.onChange=function(t,n){this.Z(t,n)},n}(ct),lt={CLICKED:"CLICKED",DBL_CLICKED:"DBL_CLICKED",DOWN:"DOWN",UP:"UP",UP_OUTSIDE:"UP_OUTSIDE",RIGHT_CLICKED:"RIGHT_CLICKED",RIGHT_DOWN:"RIGHT_DOWN",RIGHT_UP:"RIGHT_UP",RIGHT_UP_OUTSIDE:"RIGHT_UP_OUTSIDE",RIGHT_PRESSED:"RIGHT_PRESSED",ACTIVATED:"ACTIVATED",DEACTIVATED:"DEACTIVATED"},vt=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.onChange=function(n,i){n.isActive?i.isActive||this.J.add(lt.ACTIVATED).delete(lt.DEACTIVATED):i.isActive&&this.J.add(lt.DEACTIVATED).delete(lt.ACTIVATED),t.prototype.onChange.call(this,n,i)},Object.defineProperty(n.prototype,"isClicked",{get:function(){return this.is(lt.CLICKED)},set:function(t){this.set(lt.CLICKED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inClicked",{get:function(){return this.in(lt.CLICKED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onClicked",{get:function(){return this.on(lt.CLICKED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"underClicked",{get:function(){return this.under(lt.CLICKED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isDblClicked",{get:function(){return this.is(lt.DBL_CLICKED)},set:function(t){this.set(lt.DBL_CLICKED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inDblClicked",{get:function(){return this.in(lt.DBL_CLICKED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onDblClicked",{get:function(){return this.on(lt.DBL_CLICKED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"underDblClicked",{get:function(){return this.under(lt.DBL_CLICKED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isDown",{get:function(){return this.is(lt.DOWN)},set:function(t){this.set(lt.DOWN,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inDown",{get:function(){return this.in(lt.DOWN)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onDown",{get:function(){return this.on(lt.DOWN)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"underDown",{get:function(){return this.under(lt.DOWN)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isUp",{get:function(){return this.is(lt.UP)},set:function(t){this.set(lt.UP,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inUp",{get:function(){return this.in(lt.UP)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onUp",{get:function(){return this.on(lt.UP)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"underUp",{get:function(){return this.under(lt.UP)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isUpOutside",{get:function(){return this.is(lt.UP_OUTSIDE)},set:function(t){this.set(lt.UP_OUTSIDE,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inUpOutside",{get:function(){return this.in(lt.UP_OUTSIDE)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onUpOutside",{get:function(){return this.on(lt.UP_OUTSIDE)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"underUpOutside",{get:function(){return this.under(lt.UP_OUTSIDE)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isRightClicked",{get:function(){return this.is(lt.RIGHT_CLICKED)},set:function(t){this.set(lt.RIGHT_CLICKED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inRightClicked",{get:function(){return this.in(lt.RIGHT_CLICKED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onRightClicked",{get:function(){return this.on(lt.RIGHT_CLICKED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"underRightClicked",{get:function(){return this.under(lt.RIGHT_CLICKED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isRightDown",{get:function(){return this.is(lt.RIGHT_DOWN)},set:function(t){this.set(lt.RIGHT_DOWN,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inRightDown",{get:function(){return this.in(lt.RIGHT_DOWN)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onRightDown",{get:function(){return this.on(lt.RIGHT_DOWN)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"underRightDown",{get:function(){return this.under(lt.RIGHT_DOWN)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isRightUp",{get:function(){return this.is(lt.RIGHT_UP)},set:function(t){this.set(lt.RIGHT_UP,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inRightUp",{get:function(){return this.in(lt.RIGHT_UP)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onRightUp",{get:function(){return this.on(lt.RIGHT_UP)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"underRightUp",{get:function(){return this.under(lt.RIGHT_UP)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isRightUpOutside",{get:function(){return this.is(lt.RIGHT_UP_OUTSIDE)},set:function(t){this.set(lt.RIGHT_UP_OUTSIDE,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inRightUpOutside",{get:function(){return this.in(lt.RIGHT_UP_OUTSIDE)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onRightUpOutside",{get:function(){return this.on(lt.RIGHT_UP_OUTSIDE)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"underRightUpOutside",{get:function(){return this.under(lt.RIGHT_UP_OUTSIDE)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isRightPressed",{get:function(){return this.is(lt.RIGHT_PRESSED)},set:function(t){this.set(lt.RIGHT_PRESSED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inRightPressed",{get:function(){return this.in(lt.RIGHT_PRESSED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onRightPressed",{get:function(){return this.on(lt.RIGHT_PRESSED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"underRightPressed",{get:function(){return this.under(lt.RIGHT_PRESSED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isActivated",{get:function(){return this.is(lt.ACTIVATED)},set:function(t){this.set(lt.ACTIVATED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inActivated",{get:function(){return this.in(lt.ACTIVATED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onActivated",{get:function(){return this.on(lt.ACTIVATED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"underActivated",{get:function(){return this.under(lt.ACTIVATED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isDeactivated",{get:function(){return this.is(lt.DEACTIVATED)},set:function(t){this.set(lt.DEACTIVATED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inDeactivated",{get:function(){return this.in(lt.DEACTIVATED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onDeactivated",{get:function(){return this.on(lt.DEACTIVATED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"underDeactivated",{get:function(){return this.under(lt.DEACTIVATED)},enumerable:!1,configurable:!0}),n}(ft),bt=function(n){function i(i){var r=n.call(this)||this;return r.internalTransform=new t.Matrix,r.p=i,r}return B(i,n),i.prototype.onChange=function(){n.prototype.onChange.call(this),this.p.onTransformChange()},i.prototype.updateSkew=function(){n.prototype.updateSkew.call(this),this.p.onTransformChange()},i.prototype.getLocalIdCurrent=function(){return this._currentLocalID},i.prototype.getLocalId=function(){return this._localID},i.prototype.getParentId=function(){return this._parentID},i.prototype.getWorldId=function(){return this._worldID},i.prototype.updateTransform=function(t){var r=this._currentLocalID,e=this._worldID;n.prototype.updateTransform.call(this,t);var u=this._currentLocalID,s=this._worldID;if(r!==u){var h=this.localTransform,o=this.internalTransform;h.copyTo(o),t instanceof i&&o.prepend(t.internalTransform)}else e!==s&&(h=this.localTransform,o=this.internalTransform,t instanceof i&&(h.copyTo(o).prepend(t.internalTransform),this._currentLocalID+=1,this._localID=this._currentLocalID))},i}(t.Transform),dt=function(){function t(){this.x=0,this.y=0,this.width=0,this.height=0,this.strokeWidth=0,this.strokeScale=1,this.strokeAlign=0}return t.prototype.set=function(t,n,i,r,e,u,s){return this.x=t,this.y=n,this.width=i,this.height=r,this.strokeWidth=e,this.strokeScale=u,this.strokeAlign=s,this},t}(),gt=function(t,n,i,r){return-i<=t&&t<=+i&&-r<=n&&n<=+r},mt=function(t){for(var n=t.points,i="[".concat(t.direction),r=0,e=n.length,u=1;r<e;r+=1,u+=3){var s=n[r];i+=",".concat(s.color,",").concat(s.alpha,",").concat(s.position)}return i+"]"},wt={NONE:0,ID:1,POSITION:2,WIDTH:4,HEIGHT:8,ROTATION:16,SKEW:32,ALIGN:0,REPLACING:64,GROUPING:128,UNGROUPING:256,FILL:512,STROKE:1024,STROKE_SIDE:2048,BORDER_RADIUS:4096,TEXT:8192,TEXTURE:16384,TAG:32768,DATA:32768,DATA_MAPPING:1048576,ACTION:65536,CURSOR:131072,ORDER_IN_LAYER:262144,CHILDREN:524288,COORDINATE:62,SHAPE:1728,LAYER:262144,PRIMITIVE:1042175,GROUP:1042431,EMBEDDED:1417471,CONNECTOR:1041985,ALL:2097151},pt=function(){function t(){this.added=wt.NONE,this.removed=wt.NONE,this.locked=wt.NONE}return t.prototype.add=function(t){return this.removed&=~t,this.added|=t,this},t.prototype.remove=function(t){return this.added&=~t,this.removed|=t,this},t.prototype.lock=function(t){return this.locked|=t,this},t.prototype.unlock=function(t){return this.locked&=~t,this},t.prototype.clear=function(){return this.added=wt.NONE,this.removed=wt.NONE,this.locked=wt.NONE,this},t.prototype.set=function(t,n,i){return null!=t&&(this.added=t),null!=n&&(this.removed=n),null!=i&&(this.locked=i),this},t.prototype.copy=function(t){return this.added=t.added,this.removed=t.removed,this.locked=t.locked,this},t}(),Ot=function(n){function i(t){var i=n.call(this)||this;return i.id="",i.uuid=0,i.type=t,i.transform=i.newTransform(),i.it=0,i.rt=!1,i.action=new et,i.et=!0,i.ut=0,i.st=!1,i.ht=!1,i.ot=NaN,i.ct=NaN,i.ft=NaN,i.interactive=!1,i.parent=null,i.children=[],i.selected=!1,i.index=0,i.reference=0,i}return B(i,n),i.prototype.newTransform=function(){return new bt(this)},i.prototype.onSizeChange=function(){this.ot=NaN,this.ct=NaN,this.ft=NaN,this.lt(),this.updateUploaded();var t=this.vt;null!=t&&t.fit(!0);var n=this.runtime;null!=n&&n.onResize(this)},i.prototype.onTransformChange=function(){this.lt(),this.onParentTransformChange()},i.prototype.onParentTransformChange=function(){this.updateUploaded();var t=this.vt;null!=t&&t.fit(!0);for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].onParentTransformChange()},i.prototype.lt=function(){if(0===this.it){var t=this.parent;null!=t&&t.onChildTransformChange()}else this.rt=!0},i.prototype.disallowOnTransformChange=function(){this.it+=1,1===this.it&&(this.rt=!1)},i.prototype.allowOnTransformChange=function(t){this.it-=1,0===this.it&&this.rt&&(this.rt=!1,t&&this.onTransformChange())},i.prototype.onChildTransformChange=function(){},i.prototype.disallowUploadedUpdate=function(){this.ut+=1,1===this.ut&&(this.st=!1,this.ht=!1)},i.prototype.allowUploadedUpdate=function(){this.ut-=1,0===this.ut&&(this.ht?(this.ht=!1,this.st=!1,this.updateUploadedRecursively()):this.st&&(this.st=!1,this.updateUploaded()))},i.prototype.updateUploadedRecursively=function(){if(0===this.ut){this.updateUploaded();for(var t=this.children,n=0,i=t.length;n<i;++n)t[n].updateUploadedRecursively()}else this.ht=!0},i.prototype.updateUploaded=function(){if(0===this.ut){var t=this.uploaded;null!=t&&t.update(this)}else this.st=!0},Object.defineProperty(i.prototype,"image",{get:function(){return this.bt},set:function(t){this.bt=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"points",{get:function(){return this.gt},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"root",{get:function(){for(var t=this;t.parent instanceof i;)t=t.parent;return t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"connector",{get:function(){var t=this.vt;return null==t&&(t=new ut(this),this.vt=t),t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"visible",{get:function(){if(this.et){var t=this.parent;return!(t instanceof i)||t.visible}return!1},set:function(t){this.et!==t&&(this.et=t,this.updateUploadedRecursively())},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"worldVisible",{get:function(){if(this.et){var t=this.parent;return!t||t.worldVisible}return!1},enumerable:!1,configurable:!0}),i.prototype.toDirty=function(){var t=this.parent;null!=t&&t.toDirty()},i.prototype.attach=function(t,n){this.detach(),this.parent=t;var i=t.children;return null!=n&&0<=n&&n<i.length?i.splice(n,0,this):i.push(this),t.onChildTransformChange(),t.toDirty(),this.onAttach(),this},i.prototype.onAttach=function(){this.uploaded=void 0;var t=this.vt;t&&(t.attach(),t.fit(!0));for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].onAttach()},i.prototype.detach=function(){var t=this.parent;if(t){this.parent=null;var n=t.children,i=n.indexOf(this);0<=i&&(n.splice(i,1),t.onChildTransformChange(),t.toDirty(),this.onDetach())}return this},i.prototype.onDetach=function(){this.uploaded=void 0;var t=this.vt;t&&t.detach();for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].onDetach()},i.prototype.updateTransform=function(){var n=this.parent;n?(n.parent&&n.updateTransform(),this.transform.updateTransform(n.transform)):this.transform.updateTransform(t.Transform.IDENTITY)},i.prototype.serializeChildren=function(t){for(var n=this.children,i=[],r=0,e=n.length;r<e;++r){var u=n[r];i.push(u.serialize(t))}return i},i.prototype.serializeImage=function(t){var n=this.bt;return null!=n?t.addResource(n.src):-1},i.prototype.serializeGradient=function(t){var n=this.gradient;return null!=n?(null==n.serialized&&(n.serialized=mt(n)),t.addResource(n.serialized)):-1},i.prototype.serializeState=function(t){var n=this.state;return(this.interactive?1:0)|(n.isFocusable?0:2)|(n.isActive?4:0)},i.prototype.serialize=function(t){var n=this.transform,i=n.position,r=n.pivot,e=this.size,u=this.shortcut,s=null!=u?t.addResource(u):-1,h=this.cursor,o=null!=h?t.addResource(h):-1,a=this.title,c=null!=a?t.addResource(a):-1,f=wt.NONE,l=wt.NONE,v=wt.NONE,b=this.wt;return null!=b&&(f=b.added,l=b.removed,v=b.locked),[this.type,t.addResource(this.id),i.x,i.y,e.x,e.y,n.rotation,n.skew.x,this.fill.serialize(t),this.stroke.serialize(t),o,this.text.serialize(t),this.data.serialize(t),this.radius,this.corner,-1,-1,this.action.serialize(t),this.serializeImage(t),this.serializeGradient(t),this.serializeChildren(t),r.x,r.y,this.serializeState(t),s,c,this.uuid,f,l,v]},i.prototype.addUuid=function(t){this.uuid=t.addUuid(this.uuid);for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].addUuid(t)},i.prototype.updateUuid=function(t){this.uuid=t.updateUuid(this.uuid);for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].updateUuid(t)},i.prototype.getShapeScale=function(){var t=this.root.parent;return null!=t&&null!=t.getShapeScale?t.getShapeScale():1},i.prototype.getStrokeWidthScale=function(t){return t&s.NON_EXPANDING_WIDTH?t&s.NON_SHRINKING_WIDTH?this.getShapeScale():Math.min(1,this.getShapeScale()):t&s.NON_SHRINKING_WIDTH?Math.max(1,this.getShapeScale()):1},i.prototype.getHitTestSize=function(t){var n=this.size;return t.width=.5*n.x,t.height=.5*n.y,t},i.prototype.toHitTestData=function(t,n){var r,e=this.getHitTestSize(null!==(r=i.WORK_HIT_TEST_DATA)&&void 0!==r?r:i.WORK_HIT_TEST_DATA=new dt),u=e.width,s=e.height,h=this.transform.pivot,o=t-h.x,a=n-h.y,c=this.stroke,f=c.enable?c.width:0,l=this.getStrokeWidthScale(c.style),v=c.align,b=f*l*v;return e.set(0<=u?+o:-o,0<=s?+a:-a,Math.abs(u)+b,Math.abs(s)+b,f,l,v)},i.prototype.contains=function(t,n){var i=this.toHitTestData(t,n);return this.containsAbs(i.x,i.y,i.width,i.height,i.strokeWidth,i.strokeScale,i.strokeAlign)?this:this.containsText(t,n)||this.containsChildren(t,n)},i.prototype.containsText=function(t,n){var i=this.text;if(null!=i.atlas){var r=i.world;if(null!=r){var e=this.transform.internalTransform,u=e.a*t+e.c*n+e.tx-r[0],s=e.b*t+e.d*n+e.ty-r[1],h=r[2]*u+r[3]*s,o=r[4]*u+r[5]*s,a=r[6],c=r[7];if(0<=h&&h<=a&&0<=o&&o<=c)return this}}return null},i.prototype.containsChildren=function(t,n){for(var i=this.children,r=i.length-1;0<=r;--r){var e=i[r];e.updateTransform();var u=e.transform.localTransform,s=u.a,h=u.b,o=u.c,a=u.d,c=u.tx,f=u.ty,l=1/(s*a-o*h),v=(a*t-o*n+f*o-c*a)*l,b=(s*n-h*t-f*s+c*h)*l,d=e.contains(v,b);if(null!=d)return d}return null},i.prototype.containsBBox=function(t,n){var i=this.toHitTestData(t,n);return this.containsAbsBBox(i.x,i.y,i.width,i.height)},i.prototype.containsAbs=function(t,n,i,r,e,u,s){return this.containsAbsBBox(t,n,i,r)},i.prototype.containsAbsBBox=function(t,n,i,r){return gt(t,n,i,r)},i.prototype.select=function(t){return!1},i.prototype.toGlobal=function(t,n,i){return!0!==i&&this.updateTransform(),n.copyFrom(t),this.transform.worldTransform.apply(n,n),n},i.prototype.toLocal=function(n,i,r,e){return!0!==e&&this.updateTransform(),void 0===r&&(r=new t.Point),r.copyFrom(n),this.transform.worldTransform.applyInverse(r,r),r},i.prototype.getBounds=function(n,i){!0!==n&&this.updateTransform();var r=this._bounds||new t.Rectangle;this._bounds=r;var e=this.transform.getWorldId();return e!==this.ot&&(this.ot=e,this.Ot(this.transform.worldTransform,r)),i.copyFrom(r),i},i.prototype.getBoundsInternal=function(n,i){!0!==n&&this.updateTransform();var r=this.Dt||new t.Rectangle;this.Dt=r;var e=this.transform.getLocalIdCurrent();return e!==this.ct&&(this.ct=e,this.Ot(this.transform.internalTransform,r)),i.copyFrom(r),i},i.prototype.getBoundsLocal=function(n,i){!0!==n&&this.updateTransform();var r=this.Et||new t.Rectangle;this.Et=r;var e=this.transform.getLocalIdCurrent();return e!==this.ft&&(this.ft=e,this.Ot(this.transform.localTransform,r)),i.copyFrom(r),i},i.prototype.getBoundsSize=function(){return this.size},i.prototype.Ot=function(t,n){var i=this.transform.pivot,r=i.x,e=i.y,u=this.getBoundsSize(),s=.5*u.x,h=.5*u.y,o=t.a,a=t.b,c=t.c,f=t.d,l=-s+r,v=-h+e,b=o*l+c*v,d=a*l+f*v,g=o*(l=+s+r)+c*(v=-h+e),m=a*l+f*v,w=o*(l=-s+r)+c*(v=+h+e),p=a*l+f*v,O=o*(l=+s+r)+c*(v=+h+e),D=a*l+f*v,E=Math.min(b,g,w,O),M=Math.min(d,m,p,D),S=Math.max(b,g,w,O),T=Math.max(d,m,p,D);return n.x=E+t.tx,n.y=M+t.ty,n.width=S-E,n.height=T-M,n},i.prototype.destroy=function(){for(var t=this.children,n=t.length-1;0<=n;--n)t[n].destroy();t.length=0},i.prototype.onStateChange=function(t,n){var r=this.runtime;null!=r&&r.onStateChange(this,t,n);for(var e=this.children,u=0,s=e.length;u<s;++u){var h=e[u];h instanceof i&&h.state.onParentChange(t,n)}},Object.defineProperty(i.prototype,"state",{get:function(){var t=this,n=this.Mt;return null==n&&(n=new vt((function(n,i){t.onStateChange(n,i)})),this.Mt=n),n},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"capability",{get:function(){var t=this.wt;return null==t&&(t=new pt,this.wt=t),t},enumerable:!1,configurable:!0}),i.prototype.getCapability=function(){return this.wt},i.prototype.focus=function(){return this.setFocused(!0),this},i.prototype.blur=function(){return this.setFocused(!1),this},i.prototype.setFocused=function(t){if(this.state.isFocused!==t){var n=rt.getLayer(this);n&&n.getFocusController().set(this,t)}},i.prototype.onKeyDown=function(t){var n=this.runtime;return!!n&&n.onKeyDown(this,t)},i.prototype.onKeyUp=function(t){var n=this.runtime;return!!n&&n.onKeyUp(this,t)},i.prototype.update=function(t){var n=this.runtime;n&&n.update(this,t)},i.prototype.onRender=function(t,n){var i=this.runtime;i&&i.onRender(this,t,n)},i.prototype.updateRecursively=function(t){this.update(t);for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].update(t)},i.prototype.copy=function(t,n){if(void 0===n&&(n=st.ALL),this.id=t.id,this.uuid=t.uuid,n&st.TRANSFORM){var r=this.transform,e=t.transform;r.position.copyFrom(e.position),r.rotation=e.rotation,r.skew.copyFrom(e.skew),r.pivot.copyFrom(e.pivot),r.scale.copyFrom(e.scale)}if(n&st.SIZE&&this.size.copyFrom(t.size),n&st.STYLE&&(this.fill.copy(t.fill),this.stroke.copy(t.stroke),this.text.copy(t.text),this.radius=t.radius,this.corner=t.corner),n&st.DATA&&this.data.copy(t.data),n&st.IMAGE&&(this.image=t.image),n&st.ACTION&&(this.action.clearAndAddAll(t.action.values),this.interactive=t.interactive,this.cursor=t.cursor,this.shortcut=t.shortcut),n&st.POINTS){var u=t.points;if(null!=u){var s=this.points;null!=s&&s.copy(u)}}if(n&st.STATE&&this.state.lock(!1).copy(t.state).unlock(),n&st.CONNECTOR)if(t instanceof i){var h=t.vt;h?this.connector.copy(h):(o=this.vt)&&o.clear()}else{var o;(o=this.vt)&&o.clear()}if(n&st.CAPABILITY){var a=t.getCapability();if(null!=a)this.capability.copy(a);else{var c=this.wt;null!=c&&c.clear()}}return this},i}(t.utils.EventEmitter),Dt=function(){function t(t,n,i,r,e,u,s,h){this.p=t,this.O=n,this.S=i,this.T=r,this.St=e,this.Tt=u,this.jt=s,this.B=h}return Object.defineProperty(t.prototype,"enable",{get:function(){return this.O},set:function(t){this.O!==t&&(this.O=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this.S},set:function(t){this.S!==t&&(this.S=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return this.T},set:function(t){this.T!==t&&(this.T=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.St},set:function(t){this.St!==t&&(this.St=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"align",{get:function(){return this.Tt},set:function(t){this.Tt!==t&&(this.Tt=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"side",{get:function(){return this.jt},set:function(t){this.jt!==t&&(this.jt=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"style",{get:function(){return this.B},set:function(t){this.B!==t&&(this.B=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){t&&this.set(t.enable,t.color,t.alpha,t.width,t.align,t.side,t.style)},t.prototype.set=function(t,n,i,r,e,u,s){var h=!1;void 0!==t&&this.O!==t&&(this.O=t,h=!0),void 0!==n&&this.S!==n&&(this.S=n,h=!0),void 0!==i&&this.T!==i&&(this.T=i,h=!0),void 0!==r&&this.St!==r&&(this.St=r,h=!0),void 0!==e&&this.Tt!==e&&(this.Tt=e,h=!0),void 0!==u&&this.jt!==u&&(this.jt=u,h=!0),void 0!==s&&this.B!==s&&(this.B=s,h=!0),h&&this.p.updateUploaded()},t.prototype.clone=function(){return new t(this.p,this.O,this.S,this.T,this.St,this.Tt,this.jt,this.B)},t.prototype.toObject=function(){return{enable:this.O,color:this.S,alpha:this.T,width:this.St,align:this.Tt,side:this.jt,style:this.B}},t.prototype.serialize=function(t){var n=this.O?1:0,i="[".concat(n,",").concat(this.S,",").concat(this.T,",").concat(this.St,",").concat(this.Tt,",").concat(this.jt,",").concat(this.B,"]");return t.addResource(i)},t.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getStroke(t);if(null!=r)this.set(!!r[0],r[1],r[2],r[3],r[4],r[5],r[6]);else{var e=JSON.parse(i[t]);n.setStroke(t,e),this.set(!!e[0],e[1],e[2],e[3],e[4],e[5],e[6])}}},t}(),Et={NONE:0,FROM:1,TO:2,FROM_TO:3},Mt=function(){function t(){this.Nt=Et.NONE,this.It=0,this.Ct=1}return Object.defineProperty(t.prototype,"type",{get:function(){return this.Nt},set:function(t){if(this.Nt!==t){this.Nt=t;var n=this.parent;null!=n&&(n.isChanged=!0)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"from",{get:function(){return this.It},set:function(t){if(this.It!==t){this.It=t;var n=this.parent;null!=n&&(n.isChanged=!0)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"to",{get:function(){return this.Ct},set:function(t){if(this.Ct!==t){this.Ct=t;var n=this.parent;null!=n&&(n.isChanged=!0)}},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n){var i=!1;if(void 0!==t&&void 0!==n)if(null!==t&&null!==n){var r=this.Nt|Et.FROM|Et.TO;this.Nt===r&&this.It===t&&this.Ct===n||(this.Nt=r,this.It=t,this.Ct=n,i=!0)}else null!==t?(r=(this.Nt|Et.FROM)&~Et.TO,this.Nt===r&&this.It===t||(this.Nt=r,this.It=t,i=!0)):null!==n?(r=(this.Nt|Et.TO)&~Et.FROM,this.Nt===r&&this.It===t||(this.Nt=r,this.Ct=n,i=!0)):(r=this.Nt&~(Et.TO|Et.FROM),this.Nt!==r&&(this.Nt=r,i=!0));else void 0!==t?null!==t?(r=this.Nt|Et.FROM,this.Nt===r&&this.It===t||(this.Nt=r,this.It=t,i=!0)):(r=this.Nt&~Et.FROM,this.Nt!==r&&(this.Nt=r,i=!0)):void 0!==n&&(null!==n?(r=this.Nt|Et.TO,this.Nt===r&&this.Ct===n||(this.Nt=r,this.Ct=n,i=!0)):(r=this.Nt&~Et.TO,this.Nt!==r&&(this.Nt=r,i=!0)));if(i){var e=this.parent;null!=e&&(e.isChanged=!0)}return i},t.prototype.normalize=function(t){var n=this.Nt,i=this.It,r=this.Ct;switch(n){case Et.FROM_TO:return(t-i)/(r-i);case Et.FROM:return t-i;case Et.TO:return r-t;case Et.NONE:default:return t}},t.prototype.isEquals=function(t){return this.Nt===t.type&&this.It===t.from&&this.Ct===t.to},t.prototype.copy=function(t){return this.At(t.type,t.from,t.to)},t.prototype.At=function(t,n,i){var r=!1;if(this.Nt!==t&&(this.Nt=t,r=!0),this.It!==n&&(this.It=n,r=!0),this.Ct!==i&&(this.Ct=i,r=!0),r){var e=this.parent;null!=e&&(e.isChanged=!0)}return this},t.prototype.toObject=function(){return{type:this.type,from:this.from,to:this.to}},t.prototype.serialize=function(t){var n="[".concat(this.Nt,",").concat(this.It,",").concat(this.Ct,"]");return t.addResource(n)},t.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getRange(t);if(null!=r)this.At(r[0],r[1],r[2]);else{var e=JSON.parse(i[t]);n.setRange(t,e),this.At(e[0],e[1],e[2])}}},t}(),St={ASCENDING:0,DESCENDING:1},Tt={BOOLEAN:7,BOOLEAN_ARRAY:8,NUMBER:0,NUMBER_ARRAY:1,STRING:2,STRING_ARRAY:3,OBJECT:4,OBJECT_ARRAY:5,TICKER:6,EXTENSION:1e3},jt={PRIVATE:0,PUBLIC:1,PROTECTED:2},Nt={UNKNOWN:-1,FOUND:0,NOT_FOUND:1,BAD_REQUEST:2,SERVER_ERROR:3,SERVICE_UNAVAILABLE:4,FORBIDDEN:5,NOT_DEFINED:6},It=function(t,n){return t-n},Ct=function(){function t(){this.id="",this.as="",this.type=Tt.NUMBER,this.scope=jt.PUBLIC,this.initial="",this.format="",this.range=new Mt,this.Rt=0,this.Lt=0,this.Mt=Nt.UNKNOWN,this.yt=0,this.kt=St.ASCENDING}return Object.defineProperty(t.prototype,"parent",{get:function(){return this.p},set:function(t){this.p!==t&&(this.p=t,this.range.parent=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this.Rt},set:function(t){var n=this.formatter;null!=n&&(t=n(t));var i=this.yt;if(i<=0){if(this.Rt!==t){this.Rt=t;var r=this.parent;null!=r&&(r.isChanged=!0)}}else{var e=this.L;null==e&&(e=[],this.L=e),this.Rt=t;var u=this.kt;u===St.ASCENDING?e.push(t):e.unshift(t);var s=e.length-i;if(0<s)if(u===St.ASCENDING)for(var h=0;h<s;++h)e.shift();else e.length=i;var o=this.parent;null!=o&&(o.isChanged=!0)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nvalue",{get:function(){return this.range.normalize(this.Rt)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"values",{get:function(){var t=this.L;return null==t&&(t=[],this.L=t),t},set:function(t){var n=t.length;if(0<n){var i=this.yt;if(i<=0){var r=t[n-1];if(null!=(s=this.formatter)&&(r=s(r)),this.Rt!==r){this.Rt=r;var e=this.parent;null!=e&&(e.isChanged=!0)}}else{var u=this.L;null==u&&(u=[],this.L=u);var s,h=this.kt;if(null!=(s=this.formatter))if(this.Rt=s(t[n-1]),h===St.ASCENDING)for(var o=0;o<n;++o)u.push(s(t[o]));else for(o=0;o<n;++o)u.unshift(s(t[o]));else if(this.Rt=t[n-1],h===St.ASCENDING)for(o=0;o<n;++o)u.push(t[o]);else for(o=0;o<n;++o)u.unshift(t[o]);var a=u.length-i;if(0<a)if(h===St.ASCENDING)for(o=0;o<a;++o)u.shift();else u.length=i;var c=this.parent;null!=c&&(c.isChanged=!0)}}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"time",{get:function(){return this.Lt},set:function(t){var n=this.yt;if(n<=0){if(this.Lt!==t){this.Lt=t;var i=this.parent;null!=i&&(i.isChanged=!0)}}else{var r=this.xt;null==r&&(r=[],this.xt=r),this.Lt=t;var e=this.kt;e===St.ASCENDING?r.push(t):r.unshift(t);var u=r.length-n;if(0<u)if(e===St.ASCENDING)for(var s=0;s<u;++s)r.shift();else r.length=n;var h=this.parent;null!=h&&(h.isChanged=!0)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"times",{get:function(){var t=this.xt;return null==t&&(t=[],this.xt=t),t},set:function(t){var n=t.length;if(0<n){var i=this.yt;if(i<=0){var r=t[n-1];if(this.Lt!==r){this.Lt=r;var e=this.parent;null!=e&&(e.isChanged=!0)}}else{var u=this.xt;null==u&&(u=[],this.xt=u),this.Lt=t[n-1];var s=this.kt;if(s===St.ASCENDING)for(var h=0;h<n;++h)u.push(t[h]);else for(h=0;h<n;++h)u.unshift(t[h]);var o=u.length-i;if(0<o)if(s===St.ASCENDING)for(h=0;h<o;++h)u.shift();else u.length=i;var a=this.parent;null!=a&&(a.isChanged=!0)}}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"state",{get:function(){return this.Mt},set:function(t){var n=this.yt;if(n<=0){if(this.Mt!==t){this.Mt=t;var i=this.parent;null!=i&&(i.isChanged=!0)}}else{var r=this.Bt;null==r&&(r=[],this.Bt=r),this.Mt=t;var e=this.kt;e===St.ASCENDING?r.push(t):r.unshift(t);var u=r.length-n;if(0<u)if(e===St.ASCENDING)for(var s=0;s<u;++s)r.shift();else r.length=n;var h=this.parent;null!=h&&(h.isChanged=!0)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"states",{get:function(){var t=this.Bt;return null==t&&(t=[],this.Bt=t),t},set:function(t){var n=t.length;if(0<n){var i=this.yt;if(i<=0){var r=t[n-1];if(this.Mt!==r){this.Mt=r;var e=this.parent;null!=e&&(e.isChanged=!0)}}else{var u=this.Bt;null==u&&(u=[],this.Bt=u),this.Mt=t[n-1];var s=this.kt;if(s===St.ASCENDING)for(var h=0;h<n;++h)u.push(t[h]);else for(h=0;h<n;++h)u.unshift(t[h]);var o=u.length-i;if(0<o)if(s===St.ASCENDING)for(h=0;h<o;++h)u.shift();else u.length=i;var a=this.parent;null!=a&&(a.isChanged=!0)}}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"capacity",{get:function(){return this.yt},set:function(t){if(this.yt<t)this.yt=t;else if(t<this.yt){this.yt=t;var n=!1,i=this.kt,r=this.L;if(null!=r&&0<(s=r.length-t)){if(i===St.ASCENDING)for(var e=0;e<s;++e)r.shift();else r.length=t;n=!0}var u=this.xt;if(null!=u&&0<(s=u.length-t)){if(i===St.ASCENDING)for(e=0;e<s;++e)u.shift();else u.length=t;n=!0}var s,h=this.Bt;if(null!=h&&0<(s=h.length-t)){if(i===St.ASCENDING)for(e=0;e<s;++e)h.shift();else h.length=t;n=!0}if(n){var o=this.parent;null!=o&&(o.isChanged=!0)}}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"order",{get:function(){return this.kt},set:function(t){this.kt=t},enumerable:!1,configurable:!0}),t.prototype.remove=function(t){var n=!1,i=this.L;null!=i&&0<=t&&t<i.length&&(i.splice(t,1),n=!0);var r=this.xt;null!=r&&0<=t&&t<r.length&&(r.splice(t,1),n=!0);var e=this.Bt;if(null!=e&&0<=t&&t<e.length&&(e.splice(t,1),n=!0),n){var u=this.parent;null!=u&&(u.isChanged=!0)}},t.prototype.removeAll=function(t){var n=!1,i=t.slice(0).sort(It),r=i.length,e=this.L;if(null!=e)for(var u=r-1;0<=u;--u)0<=(o=i[u])&&o<e.length&&(e.splice(o,1),n=!0);var s=this.xt;if(null!=s)for(u=r-1;0<=u;--u)0<=(o=i[u])&&o<s.length&&(s.splice(o,1),n=!0);var h=this.Bt;if(null!=h)for(u=r-1;0<=u;--u){var o;0<=(o=i[u])&&o<h.length&&(h.splice(o,1),n=!0)}if(n){var a=this.parent;null!=a&&(a.isChanged=!0)}},t.prototype.clear=function(){var t=!1,n=this.L;null!=n&&(n.length=0,t=!0);var i=this.xt;null!=i&&(i.length=0,t=!0);var r=this.Bt;if(null!=r&&(r.length=0,t=!0),t){var e=this.parent;null!=e&&(e.isChanged=!0)}},t.prototype.toDirty=function(){var t=this.parent;null!=t&&(t.isChanged=!0)},t.prototype.copy=function(t){return this.id=t.id,this.as=t.as,this.type=t.type,this.scope=t.scope,this.initial=t.initial,this.format=t.format,this.formatter=t.formatter,this.range.copy(t.range),this.Rt=t.value,this.Lt=t.time,this.Mt=t.state,this.yt=t.capacity,this},t.prototype.isEquals=function(t){return this.id===t.id&&this.as===t.as&&this.type===t.type&&this.scope===t.scope&&this.initial===t.initial&&this.formatter===t.formatter&&this.range.isEquals(t.range)},t.prototype.serialize=function(t){var n=t.addData(this.id),i=t.addResource(this.as),r=t.addResource(this.initial),e=t.addResource(this.format.trim()),u=this.range.serialize(t);return t.addResource("[".concat(n,",").concat(r,",").concat(e,",").concat(u,",").concat(this.yt,",").concat(this.kt,",").concat(this.type,",").concat(this.scope,",").concat(i,"]"))},t.prototype.deserialize=function(t,n){var i,r,e=n.resources;if(0<=t&&t<e.length){var u=n.getDataValue(t);null==u&&(u=JSON.parse(e[t]),n.setDataValue(t,u)),this.id=n.data[u[0]]||"";var s=u[8];this.as=null!=s&&e[s]||"",this.type=null!==(i=u[6])&&void 0!==i?i:Tt.NUMBER,this.scope=null!==(r=u[7])&&void 0!==r?r:jt.PUBLIC,this.initial=e[u[1]]||"",this.format=e[u[2]]||"",this.range.deserialize(u[3],n),this.yt=u[4],this.kt=u[5]}return this},t}(),At=function(){function t(){this.values=[]}return t.prototype.add=function(t,n){var i=this.values;return null!=n?i.splice(n,0,t):i.push(t),this},t.prototype.addAll=function(t){for(var n=this.values,i=0,r=t.length;i<r;++i)n.push(t[i]);return this},t.prototype.clearAndAdd=function(t){return this.clear(),this.add(t),this},t.prototype.clearAndAddAll=function(t){return this.clear(),this.addAll(t),this},t.prototype.indexOf=function(t){for(var n=this.values,i=0,r=n.length;i<r;++i)if((e=n[i])===t)return i;for(i=0,r=n.length;i<r;++i){var e;if((e=n[i])[0]===t[0]&&e[1]===t[1]&&e[2]===t[2])return i}return-1},t.prototype.get=function(t){var n=this.values;return 0<=t||t<n.length?n[t]:null},t.prototype.set=function(t,n){var i=this.values;if(0<=t||t<i.length){var r=i[t];return i[t]=n,r}return null},t.prototype.remove=function(t){var n=this.values;return 0<=t||t<n.length?n.splice(t,1)[0]:null},t.prototype.clear=function(){return this.values.length=0,this},t.prototype.size=function(){return this.values.length},t.prototype.swap=function(t,n){var i=this.values,r=i[n];return i[n]=i[t],i[t]=r,this},t.prototype.copy=function(t){this.clearAndAddAll(t.values)},t.prototype.serialize=function(t){var n=this.values;if(n.length<=0)return-1;for(var i="[",r="",e=0,u=n.length;e<u;++e){var s=n[e],h=t.addResource(s[0]),o=t.addResource(s[1]),a=t.addResource(s[2]);i+="".concat(r).concat(h,",").concat(o,",").concat(a),r=","}return i+="]",t.addResource(i)},t.prototype.deserialize=function(t,n){var i=this.values;i.length=0;var r=n.resources,e=r.length;if(0<=t&&t<e){var u=n.getDataMapping(t);null==u&&(u=JSON.parse(r[t]),n.setDataMapping(t,u));for(var s=0,h=u.length;s<h;s+=3){var o=u[s],a=u[s+1],c=u[s+2];i.push([0<=o&&o<e?r[o]:"",0<=a&&a<e?r[a]:"",0<=c&&c<e?r[c]:""])}}},t}(),Rt=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},Lt=function(){function t(){}return Object.defineProperty(t.prototype,"ids",{get:function(){var t=this.Pt;if(null==t)return[];var n=[];return t.forEach((function(t,i){n.push(i)})),n},enumerable:!1,configurable:!0}),t.prototype.add=function(t,n){var i,r=null!==(i=this.Pt)&&void 0!==i?i:this.Pt=new Map,e=r.get(t);null==e?r.set(t,[n]):e.push(n)},t.prototype.set=function(t,n,i,r,e,u){var s=this.Pt;if(null==s)return!1;var h=s.get(t);if(null==h)return!1;var o=h.length;if(o<=0)return!1;for(var a=0;a<o;++a){var c=h[a];c.range.set(e,u),void 0!==i&&(c.time=i),void 0!==r&&(c.state=r),c.value=n}return!0},t.prototype.toDirty=function(t){var n=this.Pt;if(null==n)return!1;var i=n.get(t);if(null==i)return!1;var r=i.length;if(r<=0)return!1;for(var e=0;e<r;++e)i[e].toDirty();return!0},t.prototype.each=function(t){var n=this.Pt;if(null==n)return null;var i=null;return n.forEach((function(n,r){null==i&&!1===t(r)&&(i=r)})),i},t}(),yt=function(){function t(){this.Pt=new Map}return t.prototype.set=function(t,n){return this.Pt.set(t,n),this},t.prototype.get=function(t){var n;return null!==(n=this.Pt.get(t))&&void 0!==n?n:null},t.prototype.contains=function(t){return this.Pt.has(t)},t.prototype.remove=function(t){var n=this.Pt,i=n.get(t);return n.delete(t),null!=i?i:null},t.prototype.clear=function(){return this.Pt.clear(),this},t.prototype.size=function(){return this.Pt.size},t.prototype.each=function(t){var n=!1;return this.Pt.forEach((function(i,r){n||!1===t(i,r)&&(n=!0)})),this},t.prototype.copy=function(t){var n=this.Pt;return n.clear(),t.each((function(t,i){n.set(i,t)})),this},t.prototype.serialize=function(t){var n=this.Pt;if(n.size<=0)return-1;var i=[];return n.forEach((function(n,r){var e=t.addResource(n),u=t.addResource(r);i.push(u,e)})),t.addResource(JSON.stringify(i))},t.prototype.deserialize=function(t,n){var i=this.Pt;i.clear();var r=n.resources,e=r.length;if(0<=t&&t<e){var u=n.getDataSystem(t);null==u&&(u=JSON.parse(r[t]),n.setDataSystem(t,u));for(var s=0,h=u.length;s<h;s+=2){var o=u[s];if(0<=o&&o<e){var a=r[o],c=u[s+1];0<=c&&c<e&&i.set(a,r[c])}}}},t}(),kt=function(){function t(){this.L=[],this.Ut=!0}return Object.defineProperty(t.prototype,"values",{get:function(){return this.L},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isChanged",{get:function(){return this.Ut},set:function(t){this.Ut=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"id",{get:function(){var t=this.L;return 0<t.length?t[0].id:""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"as",{get:function(){var t=this.L;return 0<t.length?t[0].as:""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){var t=this.L;return 0<t.length?t[0].type:Tt.NUMBER},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"scope",{get:function(){var t=this.L;return 0<t.length?t[0].scope:jt.PRIVATE},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"initial",{get:function(){var t=this.L;return 0<t.length?t[0].initial:""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"format",{get:function(){var t=this.L;return 0<t.length?t[0].format:""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"range",{get:function(){var t=this.L;return 0<t.length?t[0].range:null!=_?_:_=new Mt},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){var t=this.L;return 0<t.length?t[0].value:0},set:function(t){var n=this.L;0<n.length&&(n[0].value=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nvalue",{get:function(){var t=this.L;return 0<t.length?t[0].nvalue:0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"time",{get:function(){var t=this.L;return 0<t.length?t[0].time:0},set:function(t){var n=this.L;0<n.length&&(n[0].time=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"state",{get:function(){var t=this.L;return 0<t.length?t[0].state:Nt.UNKNOWN},set:function(t){var n=this.L;0<n.length&&(n[0].state=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"capacity",{get:function(){var t=this.L;return 0<t.length?t[0].capacity:0},set:function(t){var n=this.L;0<n.length&&(n[0].capacity=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alias",{get:function(){var t=this.Ft;return null==t&&(t=this.newAlias(),this.Ft=t),t},enumerable:!1,configurable:!0}),t.prototype.newAlias=function(){var t=this.L,n=t.length;if(0<n){for(var i={},r=0;r<n;++r){var e=t[r];i[e.as||e.id]=e}return i}return null!=P?P:P={}},Object.defineProperty(t.prototype,"mapping",{get:function(){var t=this.Gt;return null==t&&(t=this.newMapping(),this.Gt=t),t},enumerable:!1,configurable:!0}),t.prototype.newMapping=function(){return new At},t.prototype.getMapping=function(){return this.Gt},Object.defineProperty(t.prototype,"private",{get:function(){var t=this.Ht;return null==t&&(t=this.newPrivate(),this.Ht=t),t},enumerable:!1,configurable:!0}),t.prototype.newPrivate=function(){return new Lt},t.prototype.getPrivate=function(){return this.Ht},Object.defineProperty(t.prototype,"system",{get:function(){var t=this.zt;return null==t&&(t=this.newSystem(),this.zt=t),t},enumerable:!1,configurable:!0}),t.prototype.newSystem=function(){return new yt},t.prototype.getSystem=function(){return this.zt},t.prototype.add=function(t,n){var i=this.L;t.parent=this,void 0===n?i.push(t):i.splice(n,0,t)},t.prototype.set=function(t,n){var i=this.L;if(0<=t&&t<i.length){var r=i[t];return n.parent=this,i[t]=n,r.parent=void 0,r}return null},t.prototype.remove=function(t){var n=this.L;0<=t&&t<n.length&&(n.splice(t,1)[0].parent=void 0)},t.prototype.indexOf=function(t){for(var n=this.L,i=n.length,r=0;r<i;++r)if(n[r]===t)return r;for(r=0;r<i;++r)if(n[r].isEquals(t))return r;for(r=0;r<i;++r)if(n[r].id===t.id)return r;return-1},t.prototype.get=function(t){var n=this.L;return 0<=t&&t<n.length?n[t]:null},t.prototype.size=function(){return this.L.length},t.prototype.swap=function(t,n){var i=this.L,r=i[n];i[n]=i[t],i[t]=r},t.prototype.copy=function(t){var n=this.L;n.length=0;for(var i=0,r=t.size();i<r;++i){var e=t.get(i);if(null!=e){var u=(new Ct).copy(e);u.parent=this,n.push(u)}}var s=t.getMapping();s&&this.mapping.copy(s);var h=t.getSystem();return h&&this.system.copy(h),this},t.prototype.serialize=function(t){for(var n=this.L,i=[],r=0,e=n.length;r<e;++r)i.push(n[r].serialize(t));var u,s=this.Gt;return null!=s?(i.push(s.serialize(t)),null!=(u=this.zt)?t.addResource("[".concat(JSON.stringify(i),",").concat(u.serialize(t),"]")):t.addResource("[".concat(JSON.stringify(i),"]"))):null!=(u=this.zt)?(i.push(-1),t.addResource("[".concat(JSON.stringify(i),",").concat(u.serialize(t),"]"))):t.addResource(JSON.stringify(i))},t.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getData(t);null==r&&(r=JSON.parse(i[t]),n.setData(t,r));var e=this.L;if(e.length=0,this.isMapped(r)){for(var u=r[0],s=u.length,h=0,o=s-1;h<o;++h){var a=u[h];(l=new Ct).parent=this,l.deserialize(a,n),e.push(l)}var c=u[s-1];0<=c&&this.mapping.deserialize(c,n);var f=r[1];null!=f&&0<=f&&this.system.deserialize(f,n)}else for(h=0,o=r.length;h<o;++h){var l;a=r[h],(l=new Ct).parent=this,l.deserialize(a,n),e.push(l)}}},t.prototype.isMapped=function(t){return 0<t.length&&Rt(t[0])},t}(),xt=function(){function t(t,n,i){this.p=t,this.Vt=n,this.Wt=i}return Object.defineProperty(t.prototype,"horizontal",{get:function(){return this.Vt},set:function(t){this.Vt!==t&&(this.Vt=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"vertical",{get:function(){return this.Wt},set:function(t){this.Wt!==t&&(this.Wt=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){t&&this.set(t.horizontal,t.vertical)},t.prototype.set=function(t,n){var i=!1;null!=t&&this.Vt!==t&&(this.Vt=t,i=!0),null!=n&&this.Wt!==n&&(this.Wt=n,i=!0),i&&this.p.updateUploaded()},t.prototype.toObject=function(){return{horizontal:this.Vt,vertical:this.Wt}},t.prototype.serialize=function(t){return t.addResource("[".concat(this.Vt,",").concat(this.Wt,"]"))},t.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getAlign(t);if(null!=r)this.set(r[0],r[1]);else{var e=JSON.parse(i[t]);n.setAlign(t,e),this.set(e[0],e[1])}}},t}(),Bt=function(){function t(t,n,i){this.p=t,this.Vt=n,this.Wt=i}return Object.defineProperty(t.prototype,"horizontal",{get:function(){return this.Vt},set:function(t){this.Vt!==t&&(this.Vt=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"vertical",{get:function(){return this.Wt},set:function(t){this.Wt!==t&&(this.Wt=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){t&&this.set(t.horizontal,t.vertical)},t.prototype.set=function(t,n){var i=!1;null!=t&&this.Vt!==t&&(this.Vt=t,i=!0),null!=n&&this.Wt!==n&&(this.Wt=n,i=!0),i&&this.p.updateUploaded()},t.prototype.toObject=function(){return{horizontal:this.Vt,vertical:this.Wt}},t.prototype.serialize=function(t){return t.addResource("[".concat(this.Vt,",").concat(this.Wt,"]"))},t.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getMargin(t);if(null!=r)this.set(r[0],r[1]);else{var e=JSON.parse(i[t]);n.setMargin(t,e),this.set(e[0],e[1])}}},t}(),_t=function(){function t(t,n,i,r,e){this.p=t,this.O=n,this.S=i,this.T=r,this.St=e}return Object.defineProperty(t.prototype,"enable",{get:function(){return this.O},set:function(t){this.O!==t&&(this.O=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this.S},set:function(t){this.S!==t&&(this.S=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return this.T},set:function(t){this.T!==t&&(this.T=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.St},set:function(t){this.St!==t&&(this.St=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){t&&this.set(t.enable,t.color,t.alpha,t.width)},t.prototype.set=function(t,n,i,r){var e=!1;void 0!==t&&this.O!==t&&(this.O=t,e=!0),void 0!==n&&this.S!==n&&(this.S=n,e=!0),void 0!==i&&this.T!==i&&(this.T=i,e=!0),void 0!==r&&this.St!==r&&(this.St=r,e=!0),e&&this.p.updateUploaded()},t.prototype.clone=function(){return new t(this.p,this.O,this.S,this.T,this.St)},t.prototype.toObject=function(){return{enable:this.O,color:this.S,alpha:this.T,width:this.St}},t.prototype.serialize=function(t){var n="[".concat(this.O?1:0,",").concat(this.S,",").concat(this.T,",").concat(this.St,"]");return t.addResource(n)},t.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getTextOutline(t);if(null!=r)this.set(!!r[0],r[1],r[2],r[3]);else{var e=JSON.parse(i[t]);n.setTextOutline(t,e),this.set(!!e[0],e[1],e[2],e[3])}}},t}(),Pt=function(){function t(t,n,i,r,e,u){this.p=t,this.O=!0,this.Rt=n,this.S=i,this.T=r,this.Xt=e,this.j=u,this.Kt=d.NORMAL,this.align=new xt(t,m.CENTER,w.MIDDLE),this.offset=new Bt(t,0,0),this.B=g.NORMAL,this.spacing=new Bt(t,0,0),this.outline=new _t(t,!1,16777215,1,.5),this.Yt=p.LEFT_TO_RIGHT,this.padding=new Bt(t,10,10),this.Jt=!1}return Object.defineProperty(t.prototype,"enable",{get:function(){return this.O},set:function(t){this.O!==t&&(this.O=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this.Rt},set:function(t){if(this.Rt!==t){this.Rt=t;var n=this.p,i=n.uploaded;if(null==i||!i.isCompatible(n))return this.atlas=void 0,void n.toDirty();var r=this.atlas,e=r&&r.characters;if(null==e)return this.atlas=void 0,void n.toDirty();for(var u=0,s=t.length;u<s;++u)if(!(t[u]in e))return this.atlas=void 0,void n.toDirty();n.updateUploaded()}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"family",{get:function(){return this.Xt},set:function(t){this.Xt!==t&&(this.Xt=t,this.p.toDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this.S},set:function(t){this.S!==t&&(this.S=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return this.T},set:function(t){this.T!==t&&(this.T=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return this.j},set:function(t){this.j!==t&&(this.j=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"weight",{get:function(){return this.Kt},set:function(t){this.Kt!==t&&(this.Kt=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"style",{get:function(){return this.B},set:function(t){this.B!==t&&(this.B=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"direction",{get:function(){return this.Yt},set:function(t){this.Yt!==t&&(this.Yt=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"clipping",{get:function(){return this.Jt},set:function(t){this.Jt!==t&&(this.Jt=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){return t&&(this.set(t.value,t.color,t.alpha,t.family,t.size,t.weight,t.style,t.direction,t.clipping),this.align.copy(t.align),this.offset.copy(t.offset),this.outline.copy(t.outline),this.spacing.copy(t.spacing),this.padding.copy(t.padding)),this},t.prototype.set=function(t,n,i,r,e,u,s,h,o){var a=!1,c=!1;return null!=t&&this.Rt!==t&&(this.Rt=t,a=!0),null!=n&&this.S!==n&&(this.S=n,c=!0),null!=i&&this.T!==i&&(this.T=i,c=!0),null!=r&&this.Xt!==r&&(this.Xt=r,a=!0),null!=e&&this.j!==e&&(this.j=e,c=!0),null!=u&&this.Kt!==u&&(this.Kt=u,c=!0),null!=s&&this.B!==s&&(this.B=s,c=!0),null!=h&&this.Yt!==h&&(this.Yt=h,c=!0),null!=o&&this.Jt!==o&&(this.Jt=o,c=!0),a?this.p.toDirty():c&&this.p.updateUploaded(),this},t.prototype.toObject=function(){return{value:this.Rt,color:this.S,alpha:this.T,family:this.Xt,size:this.j,weight:this.Kt,align:this.align.toObject(),offset:this.offset.toObject(),style:this.B,outline:this.outline.toObject(),direction:this.Yt,spacing:this.spacing.toObject(),padding:this.padding.toObject(),clipping:this.Jt}},t.prototype.serialize=function(t){var n=t.addResource(this.Rt),i=t.addResource(this.Xt),r=this.align.serialize(t),e=this.offset.serialize(t),u=this.outline.serialize(t),s=this.spacing.serialize(t),h=this.padding.serialize(t),o="[".concat(n,",").concat(this.S,",").concat(this.T,",").concat(i,",").concat(this.j,",")+"".concat(this.Kt,",").concat(r,",").concat(e,",").concat(this.B,",").concat(u,",")+"".concat(s,",").concat(this.Yt,",").concat(h,",").concat(this.Jt?1:0,"]");return t.addResource(o)},t.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getText(t);null==r&&(r=JSON.parse(i[t]),n.setText(t,r)),this.set(i[r[0]]||"",r[1],r[2],i[r[3]]||"auto",r[4],r[5],r[8],r[11],!!r[13]),this.align.deserialize(r[6],n),this.offset.deserialize(r[7],n),this.outline.deserialize(r[9],n),this.spacing.deserialize(r[10],n),this.padding.deserialize(r[12],n)}},t}(),Ut=function(n){function i(t){var i=n.call(this,t)||this;i.size=i.newSize(),i.fill=i.newFill(),i.stroke=i.newStroke(),i.Zt=Y.RADIUS,i.qt=it.ALL;var r=new kt;return i.data=r,i.tag=r,i.text=i.newText(),i}return B(i,n),i.prototype.newSize=function(){var n=this;return new t.ObservablePoint((function(){n.onSizeChange()}),void 0,Y.SIZE_X,Y.SIZE_Y)},i.prototype.newFill=function(){return new Z(this,!0,Y.FILL_COLOR,Y.FILL_ALPHA)},i.prototype.newStroke=function(){return new Dt(this,!0,Y.STROKE_COLOR,Y.STROKE_ALPHA,Y.STROKE_WIDTH,Y.STROKE_ALIGN,Y.STROKE_SIDE,Y.STROKE_STYLE)},i.prototype.newText=function(){return new Pt(this,Y.TEXT_VALUE,Y.TEXT_COLOR,Y.TEXT_ALPHA,Y.TEXT_FAMILY,Y.TEXT_SIZE)},Object.defineProperty(i.prototype,"corner",{get:function(){return this.qt},set:function(t){this.qt!==t&&(this.qt=t,this.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"radius",{get:function(){return this.Zt},set:function(t){this.Zt!==t&&(this.Zt=t,this.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"image",{get:function(){return this.bt},set:function(t){if(this.bt!==t){null!=t?(this.bt=t,this.imageSrc=t.src):(this.bt=void 0,this.imageSrc=void 0);var n=this.parent;null!=n&&n.toDirty()}},enumerable:!1,configurable:!0}),i}(Ot),Ft=function(t,n,i,r,e,u,s){if(t.fill.enable){if((c=n*n)*(o=e*e)+(f=i*i)*(h=r*r)<=h*o)return!0}else if(0<u){var h,o,a=u*s,c=n*n,f=i*i,l=Math.max(0,r-a),v=Math.max(0,e-a),b=l*l,d=v*v;if(b*d<=c*d+f*b&&c*(o=e*e)+f*(h=r*r)<=h*o)return!0}return!1},Gt={NONE:0,TOP:1,RIGHT:2,BOTTOM:4,LEFT:8,TOP_OR_LEFT:9,TOP_OR_RIGHT:3,BOTTOM_OR_LEFT:12,BOTTOM_OR_RIGHT:6,ALL:15},Ht=function(t,n,i,r,e,u,s){if(gt(n,i,r,e)){if(t.fill.enable)return!0;var h=t.stroke.side;if(0<u&&h!==Gt.NONE){var o=u*s,a=Math.max(0,r-o),c=Math.max(0,e-o);if(!gt(n,i,a,c))return!(h!==Gt.ALL&&!(n<=-a?i<=-c?h&Gt.TOP_OR_LEFT:+c<=i?h&Gt.BOTTOM_OR_LEFT:h&Gt.LEFT:+a<=n?i<=-c?h&Gt.TOP_OR_RIGHT:+c<=i?h&Gt.BOTTOM_OR_RIGHT:h&Gt.RIGHT:i<=-c?h&Gt.TOP:+c<=i&&h&Gt.BOTTOM))}}return!1},zt=function(t,n,i,r,e){return+i*t+r-n<=0&&-i*t+r-n<=0&&n<=e},Vt=function(t,n,i,r,e,u,s){var h=2*e/r;if(t.fill.enable){if(zt(n,i,h,-e,+e))return!0}else if(0<u){var o=u*s;if(zt(n,i,h,-e,+e)){var a=2*r*e/(r+Math.sqrt(r*r+4*e*e)),c=e-a,f=c+(-e-c)*Math.max(0,a-o)/a;if(!zt(n,i,h,f,e-o))return!0}}return!1},Wt=function(t,n,i){return.5*(i+t*n)},Xt=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getHitTestSize=function(n){var i=this.gt.formatted;if("boundary"in i){var r=i.boundary;n.width=Math.max(Math.abs(r[0]),Math.abs(r[2])),n.height=Math.max(Math.abs(r[1]),Math.abs(r[3]))}else t.prototype.getHitTestSize.call(this,n);return n},n.prototype.toMarkerSize=function(t){var n=0,i=t.getMarker();if(i){var r=i.head;if(r.type!==J.NONE){var e=r.size;n=Math.max(n,2*Math.max(Math.abs(e.x),Math.abs(e.y)))}var u=i.tail;u.type!==J.NONE&&(e=u.size,n=Math.max(n,2*Math.max(Math.abs(e.x),Math.abs(e.y))))}return n},n.prototype.containsAbsMarker=function(t,n,i,r,e,u){var s=t.type;if(s!==J.NONE){var h=t.transform,o=h.a,a=h.b,c=h.c,f=h.d,l=h.tx,v=h.ty,b=1/(o*f-c*a),d=(f*n-c*i+v*c-l*f)*b,g=(o*i-a*n-v*o+l*a)*b,m=t.size,w=.5*m.x,p=.5*m.y;w<0&&(w=-w,n=-n),p<0&&(p=-p,i=-i);var O=r*e*u;switch(w+=O,p+=O,s){case J.CIRCLE:return Ft(this,d,g,w,p,r,e);case J.TRIANGLE:return Vt(this,d,g,w,p,r,e);case J.RECTANGLE:return Ht(this,d,g,w,p,r,e)}}return!1},n.prototype.containsAbs=function(t,n,i,r,e,u,s){var h=this.gt,o=Wt(e,u,0),a=o+this.toMarkerSize(h);if(this.containsAbsBBox(t,n,i+a,r+a)){var c=h.getMarker();if(c){if(this.containsAbsMarker(c.head,t,n,e,u,s))return!0;if(this.containsAbsMarker(c.tail,t,n,e,u,s))return!0}var f=this.calcHitPointAbsHitTester;return h.calcHitPointAbs(t,n,i,r,o,null,f,null)}return!1},n.prototype.calcHitPart=function(t,n){var i=this.toHitTestData(t,n),r=i.strokeWidth,e=i.strokeScale,u=Wt(r,e,0),s=this.gt,h=u+this.toMarkerSize(s),o=i.x,a=i.y,c=i.width,f=i.height;if(this.containsAbsBBox(o,a,c+h,f+h)){var l=s.getMarker();if(l){var v=i.strokeAlign;if(this.containsAbsMarker(l.head,o,a,r,e,v))return nt.MARKER_HEAD;if(this.containsAbsMarker(l.tail,o,a,r,e,v))return nt.MARKER_TAIL}var b=this.calcHitPointAbsHitTester;if(s.calcHitPointAbs(o,a,c,f,u,null,b,null))return nt.LINE}return this.containsText(t,n)?nt.TEXT:this.containsChildren(t,n)?nt.CHILDREN:nt.NONE},n.prototype.calcHitPoint=function(t,n,i,r,e,u){var s=this.gt,h=this.toHitTestData(t,n),o=(i||Wt)(h.strokeWidth,h.strokeScale,0);return!!this.containsAbsBBox(h.x,h.y,h.width+o,h.height+o)&&s.calcHitPointAbs(h.x,h.y,h.width,h.height,o,r,e,u)},n.prototype.calcHitPointAbsHitTester=function(t,n,i,r,e,u,s,h,o){var a=e-i,c=u-r,f=t-i,l=n-r,v=a*a+c*c,b=a*f+c*l,d=f*f+l*l;if(1e-4<v){var g=Math.max(0,Math.min(1,b/v));if(v*g*g-2*b*g+d<h*h)return!0}return!1},n}(Ut),Kt=function(t){function n(n){void 0===n&&(n=r.BAR);var i=t.call(this,n)||this;return i.gt=new tt(i),i}return B(n,t),Object.defineProperty(n.prototype,"points",{get:function(){return this.gt},enumerable:!1,configurable:!0}),n.prototype.clone=function(){return new n(this.type).copy(this)},n.prototype.containsAbsBBox=function(n,i,r,e){var u=Math.max(0,this.gt.size);return t.prototype.containsAbsBBox.call(this,n,i,r+u,e+u)},n.prototype.serialize=function(n){var i=t.prototype.serialize.call(this,n);return i[15]=this.gt.serialize(n),i},n}(Xt),Yt=function(t){function n(n,i){var r=t.call(this,n,i,4,2)||this;return r.pointsId=NaN,r.pointsStyle=F.NONE,r}return B(n,t),n.prototype.init=function(t){var n=this.vertexOffset,i=this.indexOffset;t.updateClippings(),t.updateIndices(),c(t.clippings,n),f(t.indices,n,i)},n.prototype.update=function(t,n){this.updateVertexStepAndColorFill(t,n),this.updateColorStroke(t,n),this.updateUv(t,n)},n.prototype.updateVertexStepAndColorFill=function(t,n){if(n instanceof Kt){var i=n.size,r=i.x,e=i.y,u=r!==this.sizeX||e!==this.sizeY,s=n.stroke,h=s.enable?s.width:0,o=s.style,a=h!==this.strokeWidth||o!==this.strokeStyle,c=z(n),f=this.transformLocalId!==c,v=n.points,b=v.id,d=b!==this.pointsId,g=v.style,m=g!==this.pointsStyle;(u||f||a||d||m)&&(this.sizeX=r,this.sizeY=e,this.strokeWidth=h,this.strokeStyle=o,this.transformLocalId=c,this.pointsId=b,this.pointsStyle=g,d&&(this.textureTransformId=NaN),t.updateVertices(),t.updateSteps(),t.updateColorFills(),l(t.vertices,t.steps,t.colorFills,this.vertexOffset,v.values,v.size,h,o,n.transform.internalTransform))}},n.prototype.updateUv=function(t,n){var i=V(n),r=W(i);i===this.texture&&r===this.textureTransformId||(this.texture=i,this.textureTransformId=r,t.updateUvs(),v(t.uvs,this.vertexOffset,X(i)))},n}(H),Jt=function(){function n(t,n,i,r){this.vertexOffset=t,this.indexOffset=n,this.vertexCount=i,this.indexCount=r,this.sizeX=NaN,this.sizeY=NaN,this.transformLocalId=NaN,this.scaleX=1,this.scaleY=1,this.size=NaN,this.family="auto",this.value="",this.texture=null,this.textureTransformId=NaN,this.color=NaN,this.alpha=NaN,this.weight=NaN,this.style=NaN,this.alignHorizontal=NaN,this.alignVertical=NaN,this.offsetHorizontal=NaN,this.offsetVertical=NaN,this.outlineWidth=NaN,this.outlineColor=NaN,this.outlineAlpha=NaN,this.spacingHorizontal=NaN,this.spacingVertical=NaN,this.direction=NaN,this.paddingHorizontal=NaN,this.paddingVertical=NaN,this.clipping=!1}return n.prototype.init=function(t){var n=this.vertexCount;if(0<n){var i=this.vertexOffset;t.updateClippings(),S(t.clippings,i,n),t.updateIndices(),T(t.indices,i,this.indexOffset,this.indexCount)}},n.prototype.isCompatible=function(t){return 4*M(t)===this.vertexCount},n.prototype.update=function(t,n){if(0<this.vertexCount){var i=n.text.atlas;null!=i&&(this.updateVertex(t,n,i),this.updateColorFill(t,n),this.updateColorStroke(t,n),this.updateStep(t,n))}},n.prototype.updateVertex=function(n,i,r){var e=i.size,u=e.x,s=e.y,h=u!==this.sizeX||s!==this.sizeY,o=z(i),a=this.transformLocalId!==o,c=i.text,f=c.size,l=c.family,v=c.value,b=c.style,d=c.align.horizontal,g=c.align.vertical,m=c.offset.horizontal,w=c.offset.vertical,p=c.spacing.horizontal,O=c.spacing.vertical,D=c.direction,E=c.padding.horizontal,M=c.padding.vertical,S=c.clipping,T=c.texture||t.Texture.WHITE,j=W(T),N=v!==this.value||l!==this.family,C=f!==this.size,A=b!==this.style,R=d!==this.alignHorizontal||g!==this.alignVertical,L=m!==this.offsetHorizontal||w!==this.offsetVertical,y=p!==this.spacingHorizontal||O!==this.spacingVertical||E!==this.paddingHorizontal||M!==this.paddingVertical,k=D!==this.direction,x=this.clipping!==S,B=T!==this.texture||j!==this.textureTransformId;if(h||a||N||C||A||R||L||y||k||x||B){this.size=f,this.family=l,this.value=v,this.style=b,this.alignHorizontal=d,this.alignVertical=g,this.offsetHorizontal=m,this.offsetVertical=w,this.spacingHorizontal=p,this.spacingVertical=O,this.direction=D,this.paddingHorizontal=E,this.paddingVertical=M,this.clipping=S,this.texture=T,this.textureTransformId=j,C&&(this.weight=NaN),n.updateVertices(),n.updateUvs();var _=i.size,P=c.world;null==P&&(P=[0,0,0,0,0,0,0,0],c.world=P),I(n.vertices,n.uvs,this.vertexOffset,this.vertexCount,0,0,_.x,_.y,r,f,v,b,d,g,m,w,p,O,D,E,M,S,P,X(T),i.transform.internalTransform)}},n.prototype.updateColorFill=function(t,n){var i=n.text,r=i.color,e=n.visible&&i.enable?i.alpha:0;r===this.color&&e===this.alpha||(this.color=r,this.alpha=e,t.updateColorFills(),G(r,e,this.vertexOffset,this.vertexCount,t.colorFills))},n.prototype.updateColorStroke=function(t,n){var i=n.text,r=i.outline,e=r.color,u=n.visible&&i.enable?r.alpha:0;e===this.outlineColor&&u===this.outlineAlpha||(this.outlineColor=e,this.outlineAlpha=u,t.updateColorStrokes(),G(e,u,this.vertexOffset,this.vertexCount,t.colorStrokes))},n.prototype.updateStep=function(t,n){var i=n.text,r=i.outline,e=r.enable?r.width:0,u=e!==this.outlineWidth,s=i.weight,h=s!==this.weight,o=1,a=1,c=i.world;null!=c&&(o=c[8],a=c[9]);var f=D<Math.abs(this.scaleX-o)||D<Math.abs(this.scaleY-a);(h||u||f)&&(this.weight=s,this.outlineWidth=e,this.scaleX=o,this.scaleY=a,t.updateSteps(),j(t.steps,this.vertexOffset,this.vertexCount,i.atlas,i.size,e,s,this.scaleX,this.scaleY))},n.prototype.buildUnit=function(n){if(0<this.vertexCount){var i=this.texture||t.Texture.WHITE,r=i.baseTexture;r!==n.baseTexture&&(n.baseTexture=r,n.push(i,this.indexOffset))}},n}(),Zt=function(t,n,i,r,e){var s=M(n),h=4*s,o=2*s,a=4+h,c=2+o;return t.check(i,r,a,c)?new u(t,i,r,a,c,[new Yt(i,r),new Jt(i+4,r+2,h,o)]).init(n):null},qt=function(t,n,i){var r=t.length;if(n<r)return t;for(var e="",u=0,s=n-r;u<s;++u)e+=i;return e+t},Qt=function(){function t(){}return t.toCode=function(t){return qt(t.toString(16).toUpperCase(),6,"0")},t.fromCode=function(t){var n=t.trim().toLowerCase();if(6===n.length){var i=Number("0x".concat(n));if(i==i)return i}return null},t.fromRgb=function(t,n,i){return 255*t<<16|255*n<<8|255*i|0},t.blend=function(t,n,i){var r=t>>16&255,e=t>>8&255,u=255&(0|t),s=n>>16&255,h=n>>8&255,o=255&(0|n),a=Math.max(0,Math.min(1,i)),c=1-a;return Math.max(0,Math.min(255,r*c+s*a))<<16|Math.max(0,Math.min(255,e*c+h*a))<<8|0|Math.max(0,Math.min(255,u*c+o*a))},t.brighten=function(t,n){return 0<=n?this.blend(t,16777215,n):this.blend(t,0,-n)},t.darken=function(t,n){return 0<=n?this.blend(t,0,n):this.blend(t,16777215,-n)},t.toGrayscale=function(t){var n=this.toLuma(t);return n<<16|n<<8|n},t.toLuma=function(t){return.2126*(t>>16&255)+.7152*(t>>8&255)+.0722*(255&(0|t))&255},t}(),$t={NONE:0,POSITION_X:1,POSITION_Y:2,POSITION:3,ROTATION:4,COLOR_FILL:8,COLOR_STROKE:16,COLOR_FILL_AND_STROKE:24,COLOR_TEXT:32,COLOR_TEXT_OUTLINE:64,COLOR:120,VISIBILITY:128,HEIGHT:256,WIDTH:512,SIZE:768,TEXT:1024,CURSOR:2048},tn=function(){function t(){}return t.toBaseFill=function(t,n){return(n.written&$t.COLOR_FILL?t:n).fill},t.toBaseStroke=function(t,n){return(n.written&$t.COLOR_STROKE?t:n).stroke},t.toBaseText=function(t,n){return(n.written&$t.COLOR_TEXT?t:n).text},t.toBaseTextOutline=function(t,n){return(n.written&$t.COLOR_TEXT_OUTLINE?t:n).text.outline},t}(),nn={isInitializing:!1},rn=function(){function t(){}return t.from=function(t,n,i,r,e,u){if(t.trim().length<=0)return i;try{var s="try {with (shape) {with (state) {with (data.alias) {with (environment) {"+(e?"var result = (".concat(t,");")+"return (result != null ? ".concat(n,"(result) : null);"):"return ".concat(n,"(").concat(t,");"))+"}}}}} catch (e) {"+"return ".concat(r,";")+"}";return null==u?Function("shape","time","environment",s):Function("shape","time","environment",u,s)}catch(t){return i}},t.ofNumberOrNull=function(t){return this.from(t,"Number",this.NULL,"null",!0)},t.ofStringOrNull=function(t){return this.from(t,"String",this.NULL,"null",!0)},t.ofUnknown=function(t){return this.from(t,"",this.NULL,"null",!1)},t.ofNumber=function(t){return this.from(t,"Number",this.ZERO,"0",!1)},t.ofNumberOrOne=function(t){return this.from(t,"Number",this.ONE,"1",!1)},t.ofNumberOrOneHundred=function(t){return this.from(t,"Number",this.ONE_HUNDRED,"100",!1)},t.ofString=function(t){return this.from(t,"String",this.EMPTY,'""',!1)},t.ofBoolean=function(t){return this.from(t,"Boolean",this.TRUE,"true",!1)},t.ofBooleanOrTrue=function(t){return this.from(t,"Boolean",this.TRUE,"true",!1)},t.ofBooleanOrFalse=function(t){return this.from(t,"Boolean",this.FALSE,"false",!1)},t.ofElementOrNull=function(t){return this.from(t,"",void 0,"null",!1,"container")},t.NULL=function(){return null},t.ZERO=function(){return 0},t.ONE=function(){return 1},t.ONE_HUNDRED=function(){return 100},t.EMPTY=function(){return""},t.TRUE=function(){return!0},t.FALSE=function(){return!1},t}(),en=function(){function t(t){this.reset=t||$t.NONE}return t.prototype.initialize=function(t,n){},t.prototype.execute=function(t,n,i){},t.prototype.onResize=function(t,n){},t.prototype.onFocus=function(t,n){},t.prototype.onBlur=function(t,n){},t.prototype.onClick=function(t,n,i){},t.prototype.onDblClick=function(t,n,i,r){},t.prototype.onDowning=function(t,n,i){},t.prototype.onDown=function(t,n,i){},t.prototype.onMove=function(t,n,i){},t.prototype.onOver=function(t,n,i){},t.prototype.onOut=function(t,n,i){},t.prototype.onUp=function(t,n,i){},t.prototype.onUpOutside=function(t,n,i){},t.prototype.onPressed=function(t,n,i){},t.prototype.onUnpressed=function(t,n,i){},t.prototype.onKeyDown=function(t,n,i){},t.prototype.onKeyUp=function(t,n,i){},t.prototype.onRightClick=function(t,n,i){},t.prototype.onRightDowning=function(t,n,i){},t.prototype.onRightDown=function(t,n,i){},t.prototype.onRightUp=function(t,n,i){},t.prototype.onRightUpOutside=function(t,n,i){},t.prototype.onRightPressed=function(t,n,i){},t.prototype.onRightUnpressed=function(t,n,i){},t.prototype.onRender=function(t,n,i,r){},t}(),un=function(t){function n(n,i){var r=t.call(this,i)||this;return r.condition=rn.ofBoolean(n.condition),r}return B(n,t),n}(en),sn=function(t){function n(n,i){var r=t.call(this,n,i)||this;return r.interval=n.interval,r}return B(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,nn)){var r=this.interval,e=r<<1,u=i%e;u<r?(this.toOff(t,n),n.effect=i+(r-u)):(this.toOn(t,n),n.effect=i+(e-u))}},n.prototype.toOn=function(t,n){},n.prototype.toOff=function(t,n){},n}(un),hn=function(t){function n(n){return t.call(this,n,$t.COLOR)||this}return B(n,t),n.prototype.toOn=function(t,n){var i=tn.toBaseFill(t,n);t.fill.set(void 0,Qt.brighten(i.color,.5),i.alpha);var r=tn.toBaseStroke(t,n);t.stroke.set(void 0,Qt.brighten(r.color,.5),r.alpha);var e=tn.toBaseText(t,n);t.text.set(void 0,Qt.brighten(e.color,.5),e.alpha);var u=tn.toBaseTextOutline(t,n);t.text.outline.set(void 0,Qt.brighten(u.color,.5),u.alpha),n.written|=this.reset},n}(sn),on=function(t){function n(n){var i=t.call(this,n,$t.COLOR_FILL)||this;return i.color=n.color,i.alpha=n.alpha,i}return B(n,t),n.prototype.toOn=function(t,n){t.fill.set(void 0,this.color,this.alpha),n.written|=this.reset},n}(sn),an=function(t){function n(n){var i=t.call(this,n,$t.COLOR_STROKE)||this;return i.color=n.color,i.alpha=n.alpha,i}return B(n,t),n.prototype.toOn=function(t,n){t.stroke.set(void 0,this.color,this.alpha),n.written|=this.reset},n}(sn),cn=function(t){function n(n){return t.call(this,n,$t.COLOR)||this}return B(n,t),n.prototype.toOn=function(t,n){var i=tn.toBaseFill(t,n);t.fill.set(void 0,Qt.darken(i.color,.5),i.alpha);var r=tn.toBaseStroke(t,n);t.stroke.set(void 0,Qt.darken(r.color,.5),r.alpha);var e=tn.toBaseText(t,n);t.text.set(void 0,Qt.darken(e.color,.5),e.alpha);var u=tn.toBaseTextOutline(t,n);t.text.outline.set(void 0,Qt.darken(u.color,.5),u.alpha),n.written|=this.reset},n}(sn),fn=function(t){function n(n){return t.call(this,n,$t.COLOR_FILL_AND_STROKE)||this}return B(n,t),n.prototype.toOn=function(t,n){var i=tn.toBaseFill(t,n);t.fill.set(void 0,i.color,.5*i.alpha);var r=tn.toBaseStroke(t,n);t.stroke.set(void 0,r.color,.5*r.alpha),n.written|=this.reset},n}(sn),ln=function(t){function n(n){return t.call(this,n,$t.VISIBILITY)||this}return B(n,t),n.prototype.toOn=function(t,n){t.visible=!0,n.written|=this.reset},n.prototype.toOff=function(t,n){t.visible=!1,n.written|=this.reset},n}(sn),vn={VISIBILITY:0,BRIGHTEN:1,DARKEN:2,OPACITY:3,COLOR_FILL:4,COLOR_STROKE:5},bn=function(){function t(t,n){this.type=t,this.condition=n}return t.prototype.isEquals=function(t){return this.type===t.type&&this.condition===t.condition},t.prototype.toLabel=function(){return this.getTheme().toLabel(this)},t.prototype.getTheme=function(){var n;return null!==(n=t.THEME)&&void 0!==n?n:t.THEME=K.getInstance().get("EShapeActionValue")},t}(),dn=function(t){function n(n,i,r){var e=t.call(this,n,i)||this;return e.subtype=r,e}return B(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.subtype===i.subtype},n}(bn),gn={SHOW_HIDE:0,BLINK:1,TRANSFORM:2,OPEN:3,EMIT_EVENT:4,CHANGE_COLOR_LEGACY:5,CHANGE_TEXT:6,CHANGE_CURSOR:7,MISC:8,CHANGE_COLOR:9,GESTURE:10,EXTENSION:1e3},mn=function(t){return"number"==typeof t||"[object Number]"===Object.prototype.toString.call(t)},wn=function(){function t(){}return t.toResource=function(t,n,i){if(0<=t&&t<n.length){var r=n[t];if(mn(r)&&0<=r&&r<i.length)return i[r]}return""},t}(),pn=function(t){function n(n,i,r,e,u){var s=t.call(this,gn.BLINK,i,n)||this;return s.interval=r,s.color=e,s.alpha=u,s}return B(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.interval===i.interval&&this.color===i.color&&this.alpha===i.alpha},n.prototype.toRuntime=function(){switch(this.subtype){case vn.BRIGHTEN:return new hn(this);case vn.COLOR_FILL:return new on(this);case vn.COLOR_STROKE:return new an(this);case vn.DARKEN:return new cn(this);case vn.OPACITY:return new fn(this);case vn.VISIBILITY:return new ln(this)}},n.prototype.serialize=function(t){var n=t.addResource(this.condition);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(this.interval,",").concat(this.color,",").concat(this.alpha,"]"))},n.deserialize=function(t,i){var r=wn.toResource(1,t,i.resources);return new n(t[2],r,t[3],t[4],t[5])},n}(dn),On=function(){function t(){}return t.blend=function(t,n,i){var r=Math.max(0,Math.min(1,i));return Math.max(0,Math.min(1,t*(1-r)+n*r))},t}(),Dn=function(t){function n(n){return t.call(this,n,n.subtype<<3)||this}return B(n,t),n.prototype.set=function(t,n,i,r,e,u){var s=this.reset;if(null!=r){if(null!=e)if(null!=u){if(s&$t.COLOR_FILL){var h=tn.toBaseFill(t,n);t.fill.set(void 0,Qt.blend(h.color,r,u),On.blend(h.alpha,e,u))}s&$t.COLOR_STROKE&&(h=tn.toBaseStroke(t,n),t.stroke.set(void 0,Qt.blend(h.color,r,u),On.blend(h.alpha,e,u))),s&$t.COLOR_TEXT&&(h=tn.toBaseText(t,n),t.text.set(void 0,Qt.blend(h.color,r,u),On.blend(h.alpha,e,u))),s&$t.COLOR_TEXT_OUTLINE&&(h=tn.toBaseTextOutline(t,n),t.text.outline.set(void 0,Qt.blend(h.color,r,u),On.blend(h.alpha,e,u)))}else s&$t.COLOR_FILL&&t.fill.set(void 0,r,e),s&$t.COLOR_STROKE&&t.stroke.set(void 0,r,e),s&$t.COLOR_TEXT&&t.text.set(void 0,r,e),s&$t.COLOR_TEXT_OUTLINE&&t.text.outline.set(void 0,r,e);else null!=u?(s&$t.COLOR_FILL&&(h=tn.toBaseFill(t,n),t.fill.set(void 0,Qt.blend(h.color,r,u),h.alpha)),s&$t.COLOR_STROKE&&(h=tn.toBaseStroke(t,n),t.stroke.set(void 0,Qt.blend(h.color,r,u),h.alpha)),s&$t.COLOR_TEXT&&(h=tn.toBaseText(t,n),t.text.set(void 0,Qt.blend(h.color,r,u),h.alpha)),s&$t.COLOR_TEXT_OUTLINE&&(h=tn.toBaseTextOutline(t,n),t.text.outline.set(void 0,Qt.blend(h.color,r,u),h.alpha))):(s&$t.COLOR_FILL&&(h=tn.toBaseFill(t,n),t.fill.set(void 0,r,h.alpha)),s&$t.COLOR_STROKE&&(h=tn.toBaseStroke(t,n),t.stroke.set(void 0,r,h.alpha)),s&$t.COLOR_TEXT&&(h=tn.toBaseText(t,n),t.text.set(void 0,r,h.alpha)),s&$t.COLOR_TEXT_OUTLINE&&(h=tn.toBaseTextOutline(t,n),t.text.outline.set(void 0,r,h.alpha)));n.written|=s}else null!=e&&(null!=u?(s&$t.COLOR_FILL&&(h=tn.toBaseFill(t,n),t.fill.set(void 0,h.color,On.blend(h.alpha,e,u))),s&$t.COLOR_STROKE&&(h=tn.toBaseStroke(t,n),t.stroke.set(void 0,h.color,On.blend(h.alpha,e,u))),s&$t.COLOR_TEXT&&(h=tn.toBaseText(t,n),t.text.set(void 0,h.color,On.blend(h.alpha,e,u))),s&$t.COLOR_TEXT_OUTLINE&&(h=tn.toBaseTextOutline(t,n),t.text.outline.set(void 0,h.color,On.blend(h.alpha,e,u)))):(s&$t.COLOR_FILL&&(h=tn.toBaseFill(t,n),t.fill.set(void 0,h.color,e)),s&$t.COLOR_STROKE&&(h=tn.toBaseStroke(t,n),t.stroke.set(void 0,h.color,e)),s&$t.COLOR_TEXT&&(h=tn.toBaseText(t,n),t.text.set(void 0,h.color,e)),s&$t.COLOR_TEXT_OUTLINE&&(h=tn.toBaseTextOutline(t,n),t.text.outline.set(void 0,h.color,e))),n.written|=s)},n}(un),En={COLOR_AND_ALPHA:0,COLOR:1,ALPHA:2,CODE:3,BRIGHTNESS:4},Mn=function(t){function n(n){var i=t.call(this,n)||this;switch(n.target){case En.COLOR:i.color=n.color,i.alpha=null;break;case En.ALPHA:i.color=null,i.alpha=n.alpha;break;default:i.color=n.color,i.alpha=n.alpha}return i.blend=rn.ofNumberOrNull(n.blend),i}return B(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,nn)){var r=this.color,e=this.alpha,u=this.blend(t,i,nn);this.set(t,n,i,r,e,u)}},n}(Dn),Sn={NONE:0,FILL:1,STROKE:2,TEXT:4,TEXT_OUTLINE:8,FILL_AND_STROKE:3,ALL:15},Tn={FILL:0,STROKE:1,FILL_AND_STROKE:2,TEXT:3,TEXT_OUTLINE:4,ALL:5},jn=function(){function t(){}return t.from=function(t){if(t[0]===gn.CHANGE_COLOR)return t[2];switch(t[2]){case Tn.FILL:return Sn.FILL;case Tn.STROKE:return Sn.STROKE;case Tn.FILL_AND_STROKE:return Sn.FILL_AND_STROKE;case Tn.TEXT:return Sn.TEXT;case Tn.TEXT_OUTLINE:return Sn.TEXT_OUTLINE;case Tn.ALL:return Sn.ALL}},t.unpack=function(t){var n=[];return t&Sn.FILL&&n.push(Sn.FILL),t&Sn.STROKE&&n.push(Sn.STROKE),t&Sn.TEXT&&n.push(Sn.TEXT),t&Sn.TEXT_OUTLINE&&n.push(Sn.TEXT_OUTLINE),n},t.pack=function(t){for(var n=Sn.NONE,i=0,r=t.length;i<r;++i)n|=t[i];return n},t}(),Nn=function(t){function n(n,i,r,e,u,s){var h=t.call(this,gn.CHANGE_COLOR,i,n)||this;return h.target=r,h.color=e,h.alpha=u,h.blend=s,h}return B(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.target===i.target&&this.color===i.color&&this.alpha===i.alpha&&this.blend===i.blend},n.prototype.toRuntime=function(){return new Mn(this)},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.blend);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(this.target,",").concat(this.color,",").concat(this.alpha,",").concat(i,"]"))},n.deserialize=function(t,i){var r=jn.from(t),e=wn.toResource(1,t,i.resources),u=wn.toResource(6,t,i.resources);return new n(r,e,t[3],t[4],t[5],u)},n}(dn),In=function(t){function n(n){var i=t.call(this,n)||this;return i.brightness=rn.ofNumberOrNull(n.brightness),i}return B(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,nn)){var r=this.brightness(t,i,nn);this.set(t,n,i,r)}},n.prototype.set=function(t,n,i,r){var e=this.reset;if(null!=r){var u=this.toAdjusted;if(e&$t.COLOR_FILL){var s=tn.toBaseFill(t,n);t.fill.set(void 0,u(s.color,r),s.alpha)}e&$t.COLOR_STROKE&&(s=tn.toBaseStroke(t,n),t.stroke.set(void 0,u(s.color,r),s.alpha)),e&$t.COLOR_TEXT&&(s=tn.toBaseText(t,n),t.text.set(void 0,u(s.color,r),s.alpha)),e&$t.COLOR_TEXT_OUTLINE&&(s=tn.toBaseTextOutline(t,n),t.text.outline.set(void 0,u(s.color,r),s.alpha)),n.written|=e}},n.prototype.toAdjusted=function(t,n){return 0<=n?Qt.brighten(t,+n):Qt.darken(t,-n)},n}(Dn),Cn=function(t){function n(n,i,r){var e=t.call(this,gn.CHANGE_COLOR,i,n)||this;return e.brightness=r,e}return B(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.brightness===i.brightness},n.prototype.toRuntime=function(){return new In(this)},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=En.BRIGHTNESS,r=t.addResource(this.brightness);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(i,",").concat(r,"]"))},n.deserialize=function(t,i){return new n(jn.from(t),wn.toResource(1,t,i.resources),wn.toResource(4,t,i.resources))},n}(dn),An=function(t){function n(n){var i=t.call(this,n)||this;return i.color=rn.ofNumberOrNull(n.color),i.alpha=rn.ofNumberOrNull(n.alpha),i.blend=rn.ofNumberOrNull(n.blend),i}return B(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,nn)){var r=this.color(t,i,nn),e=this.alpha(t,i,nn),u=this.blend(t,i,nn);this.set(t,n,i,r,e,u)}},n}(Dn),Rn=function(t){function n(n,i,r,e,u){var s=t.call(this,gn.CHANGE_COLOR,i,n)||this;return s.color=r,s.alpha=e,s.blend=u,s}return B(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.color===i.color&&this.alpha===i.alpha&&this.blend===i.blend},n.prototype.toRuntime=function(){return new An(this)},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=En.CODE,r=t.addResource(this.color),e=t.addResource(this.alpha),u=t.addResource(this.blend);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(i,",").concat(r,",").concat(e,",").concat(u,"]"))},n.deserialize=function(t,i){return new n(jn.from(t),wn.toResource(1,t,i.resources),wn.toResource(4,t,i.resources),wn.toResource(5,t,i.resources),wn.toResource(6,t,i.resources))},n}(dn),Ln=function(t){function n(n){var i=t.call(this,n,$t.CURSOR)||this;return i.name=rn.ofStringOrNull(n.name),i}return B(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,nn)){var r=this.name(t,i,nn);null!=r&&(t.cursor=r,n.written|=this.reset)}},n}(un),yn=function(t){function n(n,i){var r=t.call(this,gn.CHANGE_CURSOR,n)||this;return r.name=i,r}return B(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.name===i.name},n.prototype.toRuntime=function(){return new Ln(this)},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.name);return t.addResource("[".concat(this.type,",").concat(n,",").concat(i,"]"))},n.deserialize=function(t,i){return new n(wn.toResource(1,t,i.resources),wn.toResource(2,t,i.resources))},n}(bn),kn=function(){function t(){}return t.prototype.format=function(t,n,i){return i.getHours()<12?"AM":"PM"},t}(),xn=function(){function t(){}return t.prototype.format=function(t,n,i){return i.getHours()<12?"am":"pm"},t}(),Bn=function(){function t(){}return t.prototype.format=function(t,n,i){return String(i.getDate())},t}(),_n=function(){function t(){}return t.prototype.format=function(t,n,i){return"".concat(0|t)},t}(),Pn=function(t){this.precision=null!=t?+t.substring(1,t.length):void 0},Un=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.format=function(t,n,i){return t.toExponential(this.precision)},n}(Pn),Fn=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.format=function(t,n,i){return t.toFixed(this.precision)},n}(Pn),Gn=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.format=function(t,n,i){var r=this.toAbs(t,n,i);return r<1e-24?this.Qt(t,1,""):r<1e-21?this.Qt(t,1e24,"y"):r<1e-18?this.Qt(t,1e21,"z"):r<1e-15?this.Qt(t,1e18,"a"):r<1e-12?this.Qt(t,1e15,"f"):r<1e-9?this.Qt(t,1e12,"p"):r<1e-6?this.Qt(t,1e9,"n"):r<.001?this.Qt(t,1e6,"μ"):r<1?this.Qt(t,1e3,"m"):r<1e3?this.Qt(t,1,""):r<1e6?this.Qt(t,.001,"k"):r<1e9?this.Qt(t,1e-6,"M"):r<1e12?this.Qt(t,1e-9,"G"):r<1e15?this.Qt(t,1e-12,"T"):r<1e18?this.Qt(t,1e-15,"P"):r<1e21?this.Qt(t,1e-18,"E"):r<1e24?this.Qt(t,1e-21,"Z"):this.Qt(t,1e-24,"Y")},n.prototype.toAbs=function(t,n,i){return Math.abs(t)},n.prototype.Qt=function(t,n,i){return"".concat((t*n).toFixed(this.precision)).concat(i)},n}(Pn),Hn=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.format=function(t,n,i){return t.toPrecision(this.precision)},n}(Pn),zn=function(){function t(){}return t.prototype.format=function(t,n,i){return String(i.getHours())},t}(),Vn=function(){function t(){}return t.prototype.format=function(t,n,i){return String(i.getHours()%12)},t}(),Wn=function(){function t(){}return t.prototype.format=function(t,n,i){return String(i.getMonth()+1)},t}(),Xn=function(){function t(){}return t.prototype.format=function(t,n,i){return String(i.getMinutes())},t}(),Kn=function(){function t(){}return t.prototype.format=function(t,n,i){return String(i.getMilliseconds())},t}(),Yn=function(){function t(){}return t.prototype.format=function(t,n,i){return"".concat(100*t|0,"%")},t}(),Jn=function(){function t(){}return t.prototype.format=function(t,n,i){return"".concat(0|t,"%")},t}(),Zn=function(){function t(t,n,i){this.length=t,this.character=n,this.node=i}return t.prototype.format=function(t,n,i){return qt(this.node.format(t,n,i),this.length,this.character)},t}(),qn=function(){function t(t){this.node=t}return t.prototype.format=function(t,n,i){var r=this.node.format(t,n,i);return 0<r.length&&"-"===r[0]?"(".concat(r.substring(1,r.length),")"):r},t}(),Qn=function(){function t(t){this.node=t}return t.prototype.format=function(t,n,i){var r=this.node.format(t,n,i);return 0<r.length&&"-"!==r[0]?"+".concat(r):r},t}(),$n=function(){function t(){}return t.prototype.format=function(t,n,i){return"".concat(Math.round(100*t),"%")},t}(),ti=function(){function t(){}return t.prototype.format=function(t,n,i){return"".concat(Math.round(t),"%")},t}(),ni=function(){function t(t,n,i,r,e,u,s){this.Y=t,this.M=n,this.D=i,this.H=r,this.m=e,this.s=u,this.mi=s}return t.prototype.format=function(t,n,i){if(n<1e3)return"".concat(this.s.format(t,n,i),".").concat(this.mi.format(t,n,i));if(n<6e4)return"".concat(this.m.format(t,n,i),":").concat(this.s.format(t,n,i));if(n<36e5)return"".concat(this.H.format(t,n,i),":").concat(this.m.format(t,n,i));if(n<864e5){var r=this.M.format(t,n,i),e=this.D.format(t,n,i);return"".concat(r,"/").concat(e," ").concat(this.H.format(t,n,i))}return n<2592e6?"".concat(this.M.format(t,n,i),"/").concat(this.D.format(t,n,i)):"".concat(this.Y.format(t,n,i),"/").concat(this.M.format(t,n,i))},t}(),ii=function(){function t(t){this.node=t}return t.prototype.format=function(t,n,i){var r=this.node.format(t,n,i);return 0<r.length&&"-"!==r[0]?" ".concat(r):r},t}(),ri=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.toAbs=function(t,n,i){return Math.abs(n)},n}(Gn),ei=function(){function t(t){this.str=t}return t.prototype.format=function(t,n,i){return this.str},t}(),ui=function(){function t(){}return t.prototype.format=function(t,n,i){return String(i.getFullYear())},t}(),si=function(){function t(){}return t.prototype.format=function(t,n,i){return String(i.getFullYear()%100)},t}(),hi=function(){function t(){}return t.prototype.format=function(t,n,i){var r=i.getTimezoneOffset(),e=r<=0?"+":"-",u=qt(String(Math.floor(Math.abs(r)/60)),2,"0"),s=qt(String(Math.floor(Math.abs(r)%60)),2,"0");return"".concat(e).concat(u,":").concat(s)},t}(),oi=function(){function t(){}return t.prototype.format=function(t,n,i){return"".concat(Math.round(t))},t}(),ai=function(){function t(){}return t.prototype.format=function(t,n,i){return String(i.getSeconds())},t}(),ci=void 0,fi=function(t,n,i){switch(t){case"_":return new Zn(n," ",i);case"-":return i;default:return new Zn(n,"0",i)}},li=function(t,n){switch(t){case"_":return new ii(n);case"+":return new Qn(n);case"(":return new qn(n);default:return n}},vi=function(){function t(t){var n=function(t){for(var n=0,i=!1,r=[],e=function(){var t=ci;return t?t.lastIndex=0:ci=t=/%(0|_|-|\+|\()?(\.\d+)?(Y(?:MD?)?|y(?:MD?)?|MD?|D|H(?:ms?)?|h(?:ms?)?|m(?:i|s)?|a|A|s(?:s?i|dt)?|z|%|f(?:si)?|e|g|d|r(?:d|p)|p|P|RP)/g,t}();;){var u=e.exec(t);if(null==u){n<t.length&&r.push(new ei(t.substring(n,t.length)));break}var s=u.index;n<s&&r.push(new ei(t.substring(n,s))),n=s+u[0].length;var h=u[0],o=u[1],a=u[2];switch(u[3]){case"Y":i=!0,r.push(new ui);break;case"YM":i=!0,r.push(new ui,new ei("/"),fi(o,2,new Wn));break;case"YMD":i=!0,r.push(new ui,new ei("/"),fi(o,2,new Wn),new ei("/"),fi(o,2,new Bn));break;case"y":i=!0,r.push(fi(o,2,new si));break;case"yM":i=!0,r.push(fi(o,2,new si),new ei("/"),fi(o,2,new Wn));break;case"yMD":r.push(fi(o,2,new si),new ei("/"),fi(o,2,new Wn),new ei("/"),fi(o,2,new Bn));break;case"M":i=!0,r.push(fi(o,2,new Wn));break;case"MD":i=!0,r.push(fi(o,2,new Wn),new ei("/"),fi(o,2,new Bn));break;case"D":i=!0,r.push(fi(o,2,new Bn));break;case"H":i=!0,r.push(fi(o,2,new zn));break;case"Hm":i=!0,r.push(fi(o,2,new zn),new ei(":"),fi(o,2,new Xn));break;case"Hms":i=!0,r.push(fi(o,2,new zn),new ei(":"),fi(o,2,new Xn),new ei(":"),fi(o,2,new ai));break;case"h":i=!0,r.push(fi(o,2,new Vn));break;case"hm":i=!0,r.push(fi(o,2,new Vn),new ei(":"),fi(o,2,new Xn));break;case"hms":i=!0,r.push(fi(o,2,new Vn),new ei(":"),fi(o,2,new Xn),new ei(":"),fi(o,2,new ai));break;case"m":i=!0,r.push(fi(o,2,new Xn));break;case"ms":i=!0,r.push(fi(o,2,new Xn),new ei(":"),fi(o,2,new ai));break;case"mi":i=!0,r.push(fi(o,3,new Kn));break;case"a":i=!0,r.push(new xn);break;case"A":i=!0,r.push(new kn);break;case"s":i=!0,r.push(fi(o,2,new ai));break;case"sdt":i=!0,r.push(new ni(new ui,fi(o,2,new Wn),fi(o,2,new Bn),fi(o,2,new zn),fi(o,2,new Xn),fi(o,2,new ai),fi(o,3,new Kn)));break;case"z":i=!0,r.push(new hi);break;case"%":r.push(new ei("%"));break;case"f":r.push(li(o,new Fn(a)));break;case"e":r.push(li(o,new Un(a)));break;case"g":r.push(li(o,new Hn(a)));break;case"rd":r.push(li(o,new oi));break;case"d":r.push(li(o,new _n));break;case"P":r.push(li(o,new Yn));break;case"p":r.push(li(o,new Jn));break;case"RP":r.push(li(o,new $n));break;case"rp":r.push(li(o,new ti));break;case"fsi":r.push(li(o,new Gn(a)));break;case"ssi":r.push(li(o,new ri(a)));break;default:r.push(new ei(h))}}return{nodes:r,date:i}}(t);this.date=n.date,this.nodes=n.nodes}return t.prototype.format=function(n,i){var r=this.nodes,e=t.DATE;null==e&&(e=new Date,t.DATE=e),this.date&&e.setTime(n);for(var u="",s=0,h=r.length;s<h;++s)u+=r[s].format(n,i,e);return u},t}(),bi=function(){function t(){}return t.create=function(t){return new vi(t)},t}(),di=function(t){function n(n){var i=t.call(this,n,$t.TEXT)||this;return i.number=rn.ofNumber(n.value),i.formatters=new Map,i}return B(n,t),n.prototype.getFormatter=function(t,n){var i=this.formatters,r=n.text.value,e=i.get(r);return void 0===e&&(e=this.newFormatter(r),i.set(r,e)),e},n.prototype.newFormatter=function(t){return 0<(t=t.trim()).length?bi.create(t):null},n.prototype.execute=function(t,n,i){if(this.condition(t,i,nn)){var r=this.number(t,i,nn),e=this.getFormatter(t,n);t.text.value=null!=e?e.format(r,0):String(r),n.written|=this.reset}},n}(un),gi=function(t){function n(n){var i=t.call(this,n,$t.TEXT)||this;return i.text=rn.ofString(n.value),i}return B(n,t),n.prototype.execute=function(t,n,i){this.condition(t,i,nn)&&(t.text.value=this.text(t,i,nn),n.written|=this.reset)},n}(un),mi={TEXT:0,NUMBER:1},wi=function(t){function n(n,i,r){var e=t.call(this,gn.CHANGE_TEXT,i,n)||this;return e.value=r,e}return B(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.value===i.value},n.prototype.toRuntime=function(){switch(this.subtype){case mi.TEXT:return new gi(this);case mi.NUMBER:return new di(this)}},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.value);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(i,"]"))},n.deserialize=function(t,i){var r=wn.toResource(1,t,i.resources),e=wn.toResource(3,t,i.resources);return new n(t[2],r,e)},n}(dn),pi=function(){function t(t,n,i){this.$t=t,this.tn=i;var r=null==n?void 0:n.background;r&&(this.S=r.color,this.T=r.alpha)}return t.prototype.getTheme=function(){return this.$t},t.prototype.setTheme=function(t){this.$t=t},t.prototype.getColor=function(t){var n=this.S;if(void 0!==n){if(!ot(n))return n;var i=n(t);if(void 0!==i)return i}return this.$t.getBackgroundColor(t)},Object.defineProperty(t.prototype,"color",{get:function(){return this.S},set:function(t){this.S!==t&&(this.S=t,this.onChange())},enumerable:!1,configurable:!0}),t.prototype.getAlpha=function(t){var n=this.T;if(void 0!==n){if(!ot(n))return n;var i=n(t);if(void 0!==i)return i}return this.$t.getBackgroundAlpha(t)},Object.defineProperty(t.prototype,"alpha",{get:function(){return this.T},set:function(t){this.T!==t&&(this.T=t,this.onChange())},enumerable:!1,configurable:!0}),t.prototype.onChange=function(){var t=this.tn;null!=t&&t()},t}(),Oi={NONE:0,TOP:1,RIGHT:2,BOTTOM:4,LEFT:8,TOP_RIGHT:3,TOP_BOTTOM:5,TOP_LEFT:9,RIGHT_BOTTOM:6,RIGHT_LEFT:10,BOTTOM_LEFT:12,NOT_TOP:14,NOT_RIGHT:13,NOT_BOTTOM:11,NOT_LEFT:7,ALL:15},Di=function(t,n){return at(t)?n[t]:t},Ei=function(){function t(t,n,i){this.$t=t,this.tn=i;var r=null==n?void 0:n.border;r&&(this.S=r.color,this.T=r.alpha,this.St=r.width,this.Tt=r.align,this.nn=Di(r.mask,Oi))}return t.prototype.getTheme=function(){return this.$t},t.prototype.setTheme=function(t){this.$t=t},t.prototype.getColor=function(t){var n=this.S;if(void 0!==n){if(!ot(n))return n;var i=n(t);if(void 0!==i)return i}return this.$t.getBorderColor(t)},Object.defineProperty(t.prototype,"color",{get:function(){return this.S},set:function(t){this.S!==t&&(this.S=t,this.onChange())},enumerable:!1,configurable:!0}),t.prototype.getAlpha=function(t){var n=this.T;if(void 0!==n){if(!ot(n))return n;var i=n(t);if(void 0!==i)return i}return this.$t.getBorderAlpha(t)},Object.defineProperty(t.prototype,"alpha",{get:function(){return this.T},set:function(t){this.T!==t&&(this.T=t,this.onChange())},enumerable:!1,configurable:!0}),t.prototype.getWidth=function(t){var n=this.St;if(void 0!==n){if(!ot(n))return n;var i=n(t);if(void 0!==i)return i}return this.$t.getBorderWidth(t)},Object.defineProperty(t.prototype,"width",{get:function(){return this.St},set:function(t){this.St!==t&&(this.St=t,this.onChange())},enumerable:!1,configurable:!0}),t.prototype.getAlign=function(t){var n=this.Tt;if(void 0!==n){if(!ot(n))return n;var i=n(t);if(void 0!==i)return i}return this.$t.getBorderAlign(t)},Object.defineProperty(t.prototype,"align",{get:function(){return this.Tt},set:function(t){this.Tt!==t&&(this.Tt=t,this.onChange())},enumerable:!1,configurable:!0}),t.prototype.getMask=function(t){var n=this.nn;if(void 0!==n){if(!ot(n))return n;var i=n(t);if(void 0!==i)return i}return this.$t.getBorderMask(t)},Object.defineProperty(t.prototype,"mask",{get:function(){return this.nn},set:function(t){this.nn!==t&&(this.nn=t,this.onChange())},enumerable:!1,configurable:!0}),t.prototype.onChange=function(){var t=this.tn;null!=t&&t()},t}(),Mi={NONE:0,TOP_LEFT:1,TOP_RIGHT:2,BOTTOM_LEFT:4,BOTTOM_RIGHT:8,TOP:3,BOTTOM:12,LEFT:5,RIGHT:10,ALL:15},Si=function(){function t(t,n,i){this.$t=t,this.tn=i;var r=null==n?void 0:n.corner;r&&(mn(r)?(this.Zt=r,this.nn=void 0):(this.Zt=r.radius,this.nn=Di(r.mask,Mi)))}return t.prototype.getTheme=function(){return this.$t},t.prototype.setTheme=function(t){this.$t=t},t.prototype.getRadius=function(){var t;return null!==(t=this.Zt)&&void 0!==t?t:this.$t.getCornerRadius()},Object.defineProperty(t.prototype,"radius",{get:function(){return this.Zt},set:function(t){if(this.Zt!==t){this.Zt=t;var n=this.tn;null!=n&&n()}},enumerable:!1,configurable:!0}),t.prototype.getMask=function(){var t;return null!==(t=this.nn)&&void 0!==t?t:this.$t.getCornerMask()},Object.defineProperty(t.prototype,"mask",{get:function(){return this.nn},set:function(t){if(this.nn!==t){this.nn=t;var n=this.tn;null!=n&&n()}},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n){var i=!1;this.Zt!==t&&(this.Zt=t,i=!0),this.nn!==n&&(this.nn=n,i=!0);var r=this.tn;i&&null!=r&&r()},t}(),Ti={NONE:0,SELF:1,CHILDREN:2,BOTH:3},ji=function(){function t(t,n,i){this.$t=t,this.tn=i;var r=null==n?void 0:n.outline;r&&(this.S=r.color,this.T=r.alpha,this.St=r.width,this.rn=r.offset,this.Tt=r.align,this.nn=Di(r.mask,Oi))}return t.prototype.getTheme=function(){return this.$t},t.prototype.setTheme=function(t){this.$t=t},t.prototype.getColor=function(t){var n=this.S;if(void 0!==n){if(!ot(n))return n;var i=n(t);if(void 0!==i)return i}return this.$t.getOutlineColor(t)},Object.defineProperty(t.prototype,"color",{get:function(){return this.S},set:function(t){if(this.S!==t){this.S=t;var n=this.tn;null!=n&&n()}},enumerable:!1,configurable:!0}),t.prototype.getAlpha=function(t){var n=this.T;if(void 0!==n){if(!ot(n))return n;var i=n(t);if(void 0!==i)return i}return this.$t.getOutlineAlpha(t)},Object.defineProperty(t.prototype,"alpha",{get:function(){return this.T},set:function(t){if(this.T!==t){this.T=t;var n=this.tn;null!=n&&n()}},enumerable:!1,configurable:!0}),t.prototype.getWidth=function(t){var n=this.St;if(void 0!==n){if(!ot(n))return n;var i=n(t);if(void 0!==i)return i}return this.$t.getOutlineWidth(t)},Object.defineProperty(t.prototype,"width",{get:function(){return this.St},set:function(t){if(this.St!==t){this.St=t;var n=this.tn;null!=n&&n()}},enumerable:!1,configurable:!0}),t.prototype.getOffset=function(t){var n=this.rn;if(void 0!==n){if(!ot(n))return n;var i=n(t);if(void 0!==i)return i}return this.$t.getOutlineOffset(t)},Object.defineProperty(t.prototype,"offset",{get:function(){return this.rn},set:function(t){if(this.rn!==t){this.rn=t;var n=this.tn;null!=n&&n()}},enumerable:!1,configurable:!0}),t.prototype.getAlign=function(t){var n=this.Tt;if(void 0!==n){if(!ot(n))return n;var i=n(t);if(void 0!==i)return i}return this.$t.getOutlineAlign(t)},Object.defineProperty(t.prototype,"align",{get:function(){return this.Tt},set:function(t){if(this.Tt!==t){this.Tt=t;var n=this.tn;null!=n&&n()}},enumerable:!1,configurable:!0}),t.prototype.getMask=function(t){var n=this.nn;if(void 0!==n){if(!ot(n))return n;var i=n(t);if(void 0!==i)return i}return this.$t.getOutlineMask(t)},Object.defineProperty(t.prototype,"mask",{get:function(){return this.nn},set:function(t){if(this.nn!==t){this.nn=t;var n=this.tn;null!=n&&n()}},enumerable:!1,configurable:!0}),t}(),Ni=function(){function t(t,n,i){this.$t=t,this.tn=i;var r=null==n?void 0:n.padding;null!=r&&(mn(r)?(this.en=r,this.un=r,this.sn=r,this.hn=r):(this.en=r.left,this.un=r.top,this.sn=r.right,this.hn=r.bottom))}return t.prototype.getTheme=function(){return this.$t},t.prototype.setTheme=function(t){this.$t=t},t.prototype.getCallback=function(){return this.tn},t.prototype.getLeft=function(){var t;return null!==(t=this.en)&&void 0!==t?t:this.$t.getPaddingLeft()},Object.defineProperty(t.prototype,"left",{get:function(){return this.en},set:function(t){this.en!==t&&(this.en=t,null!=this.tn&&this.tn())},enumerable:!1,configurable:!0}),t.prototype.getTop=function(){var t;return null!==(t=this.un)&&void 0!==t?t:this.$t.getPaddingTop()},Object.defineProperty(t.prototype,"top",{get:function(){return this.un},set:function(t){this.un!==t&&(this.un=t,null!=this.tn&&this.tn())},enumerable:!1,configurable:!0}),t.prototype.getRight=function(){var t;return null!==(t=this.sn)&&void 0!==t?t:this.$t.getPaddingRight()},Object.defineProperty(t.prototype,"right",{get:function(){return this.sn},set:function(t){this.sn!==t&&(this.sn=t,null!=this.tn&&this.tn())},enumerable:!1,configurable:!0}),t.prototype.getBottom=function(){var t;return null!==(t=this.hn)&&void 0!==t?t:this.$t.getPaddingBottom()},Object.defineProperty(t.prototype,"bottom",{get:function(){return this.hn},set:function(t){this.hn!==t&&(this.hn=t,null!=this.tn&&this.tn())},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n,i,r){null==n?(this.top=t,this.right=t,this.bottom=t,this.left=t):null==i?(this.top=t,this.right=n,this.bottom=t,this.left=n):null==r?(this.top=t,this.right=n,this.bottom=i,this.left=n):(this.top=t,this.right=n,this.bottom=i,this.left=r),null!=this.tn&&this.tn()},t}(),Ii=function(){function t(t,n){this.an=t,this.Z=n}return Object.defineProperty(t.prototype,"x",{get:function(){return this.an.x},set:function(t){var n=this.an,i=n.x;if(i!==t){n.x=t;var r=n.y;this.Z(t,r,i,r)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this.an.y},set:function(t){var n=this.an,i=n.y;if(i!==t){n.y=t;var r=n.x;this.Z(r,t,r,i)}},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n){var i=this.an,r=i.x,e=i.y;return r===t&&e===n||(i.set(t,n),this.Z(t,n,r,e)),this},t.prototype.copyFrom=function(t){var n=t.x,i=t.y,r=this.an,e=r.x,u=r.y;return e===n&&u===i||(r.copyFrom(t),this.Z(n,i,e,u)),this},t.prototype.copyTo=function(t){return t.copyFrom(this.an)},t.prototype.copy=function(){return this.copyFrom(arguments[0])},t.prototype.clone=function(n){return new t(this.an,n||this.Z)},t.prototype.equals=function(t){return this.an.equals(t)},t}(),Ci=function(t){function n(n,i,r){var e=t.call(this,n,i,r)||this;return e.St=100,e.cn=100,e.fn=0,e.ln=Mi.NONE,e.vn=!0,e.bn=1,e.dn=e.getBuffer("aVertexPosition"),e.gn=e.dn.data,e.mn=e.getBuffer("aTextureCoord"),e._uvs=e.mn.data,e.wn=e.getIndex(),e.pn=e.wn.data,e}return B(n,t),Object.defineProperty(n.prototype,"width",{get:function(){return this.St},set:function(t){this.St!==t&&(this.St=t,this.vn=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"height",{get:function(){return this.cn},set:function(t){this.cn!==t&&(this.cn=t,this.vn=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"cornerRadius",{get:function(){return this.fn},set:function(t){this.fn!==t&&(this.fn=t,this.vn=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"cornerMask",{get:function(){return this.ln},set:function(t){this.ln!==t&&(this.ln=t,this.vn=!0)},enumerable:!1,configurable:!0}),n.prototype.getTables=function(){var t=n.TABLES;return null==t&&(t=this.newTables(n.N),n.TABLES=t),t},n.prototype.newTables=function(t){var n=1/(t-1)*.5;return[this.newTable(t,1,n),this.newTable(t,.5,n),this.newTable(t,0,n),this.newTable(t,1.5,n)]},n.prototype.newTable=function(t,n,i){for(var r=[],e=[],u=Math.PI,s=0,h=n;s<t;s+=1,h-=i){var o=h*u,a=+Math.cos(o),c=-Math.sin(o);r.push(a),e.push(c)}return{cos:r,sin:e}},n.N=4,n}(t.MeshGeometry),Ai=function(t){function n(){return t.call(this,new Float32Array(16*Ci.N),new Float32Array(16*Ci.N),new Uint16Array(3*(12*Ci.N-2)))||this}return B(n,t),n.prototype.fillVertices=function(t,n,i,r,e,u,s,h,o,a){for(var c=a.cos,f=a.sin,l=c[0],v=f[0],b=c[e-1],d=f[e-1],g=0;g<e;++g){var m=c[g],w=f[g],p=o,O=m*l+w*v;1e-4<O&&(p=Math.min(p,(1/O-1)*h));var D=m*b+w*d;1e-4<D&&(p=Math.min(p,(1/D-1)*h));var E=h+p;t[++i]=u+m*h,t[++i]=s+w*h,t[++i]=u+m*E,t[++i]=s+w*E,n[++r]=.5,n[++r]=.5,n[++r]=.5*(1+m),n[++r]=.5*(1+w)}},n.prototype.fillIndices=function(t,n,i,r){for(var e=0;e<r;++e)t[++i]=n+0,t[++i]=n+1,t[++i]=n+2,t[++i]=n+2,t[++i]=n+1,t[++i]=n+3,n+=2},n.prototype.fillIndicesEnd=function(t,n,i,r){for(var e=0,u=r-1;e<u;++e)t[++i]=n+0,t[++i]=n+1,t[++i]=n+2,t[++i]=n+2,t[++i]=n+1,t[++i]=n+3,n+=2;t[++i]=n+0,t[++i]=n+1,t[++i]=0,t[++i]=0,t[++i]=n+1,t[++i]=1,n+=2},n.prototype.update=function(t){var n=t.resolution;if(this.vn||this.bn!==n){this.vn=!1,this.bn=n;var i=this.gn,r=this._uvs,e=this.pn,u=this.St,s=this.cn,h=Math.min(.5*u,.5*s,this.fn),o=1/n,a=h,c=u-h,f=u,l=h,v=s-h,b=s,d=this.ln,g=!(d&Mi.TOP_LEFT),m=!(d&Mi.TOP_RIGHT),w=!(d&Mi.BOTTOM_LEFT),p=!(d&Mi.BOTTOM_RIGHT),O=-1,D=-1,E=0,M=-1,S=Ci.N,T=S<<2,j=S<<1,N=6*S,I=this.getTables(),C=I[0],A=I[1],R=I[2],L=I[3];g?this.fillVertices(i,r,O,D,S,a,l,h,o,C):this.fillVertices(i,r,O,D,S,0,0,0,0,C),this.fillIndices(e,E,M,S),O+=T,D+=T,E+=j,M+=N,m?this.fillVertices(i,r,O,D,S,c,l,h,o,A):this.fillVertices(i,r,O,D,S,f,0,0,0,A),this.fillIndices(e,E,M,S),O+=T,D+=T,E+=j,M+=N,p?this.fillVertices(i,r,O,D,S,c,v,h,o,R):this.fillVertices(i,r,O,D,S,f,b,0,0,R),this.fillIndices(e,E,M,S),O+=T,D+=T,E+=j,M+=N,w?this.fillVertices(i,r,O,D,S,a,v,h,o,L):this.fillVertices(i,r,O,D,S,0,b,0,0,L),this.fillIndicesEnd(e,E,M,S),O+=T,D+=T,E+=j,M+=N,E=2;for(var y=1,k=4*S-1;y<k;y+=1,E+=2)e[++M]=0,e[++M]=E,e[++M]=E+2;this.dn.update(),this.mn.update(),this.wn.update()}},n}(Ci),Ri=function(n){function i(i){var r=n.call(this,new Ai,new t.MeshMaterial(i))||this;return i.on("update",(function(){rt.update(r)})),r}return B(i,n),Object.defineProperty(i.prototype,"width",{get:function(){return this.geometry.width},set:function(t){this.geometry.width=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"height",{get:function(){return this.geometry.height},set:function(t){this.geometry.height=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"cornerRadius",{get:function(){return this.geometry.cornerRadius},set:function(t){this.geometry.cornerRadius=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"cornerMask",{get:function(){return this.geometry.cornerMask},set:function(t){this.geometry.cornerMask=t},enumerable:!1,configurable:!0}),i.prototype._render=function(t){this.geometry.update(t),n.prototype._render.call(this,t)},i}(t.Mesh),Li=function(){function t(){}return t.prototype.get=function(t,n){var i=this.On;return null==i&&((i=new Ri(n.getBackgroundTexture())).parent=t,this.On=i),i},t.prototype.hide=function(){var t=this.On;null!=t&&(t.visible=!1)},t.prototype.onReflow=function(t,n,i,r,e,u,s){var h=t.background,o=h.getColor(e);if(null!=o){var a=h.getAlpha(e);if(0<a){var c=this.get(t,r);c.tint=o,c.alpha=a,c.width=n,c.height=i,c.cornerRadius=u,c.cornerMask=s,c.visible=!0}else this.hide()}else this.hide()},t.prototype.render=function(t){var n;null===(n=this.On)||void 0===n||n.render(t)},t.prototype.updateTransform=function(){var t;null===(t=this.On)||void 0===t||t.updateTransform()},t}(),yi=function(t){function n(){var n=t.call(this,new Float32Array(32*Ci.N),new Float32Array(32*Ci.N),new Uint16Array(72*Ci.N))||this;return n.Dn=0,n.En=Oi.NONE,n}return B(n,t),Object.defineProperty(n.prototype,"borderWidth",{get:function(){return this.Dn},set:function(t){this.Dn!==t&&(this.Dn=t,this.vn=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"borderMask",{get:function(){return this.En},set:function(t){this.En!==t&&(this.En=t,this.vn=!0)},enumerable:!1,configurable:!0}),n.prototype.fillVertices=function(t,n,i,r,e,u,s,h,o,a,c){for(var f=.5*a,l=h-f,v=h+f,b=c.cos,d=c.sin,g=b[0],m=d[0],w=b[e-1],p=d[e-1],O=u+(g+w)*l,D=s+(m+p)*l,E=0;E<e;++E){var M=b[E],S=d[E],T=o,j=o,N=M*g+S*m;if(1e-4<N){var I=1/N-1;T=Math.min(T,I*l),j=Math.min(j,I*v)}var C=M*w+S*p;if(1e-4<C){var A=1/C-1;T=Math.min(T,A*l),j=Math.min(j,A*v)}var R=l+T,L=v+j;0<l?(t[++i]=u+M*l,t[++i]=s+S*l,t[++i]=u+M*R,t[++i]=s+S*R):(t[++i]=O,t[++i]=D,t[++i]=O,t[++i]=D),t[++i]=u+M*v,t[++i]=s+S*v,t[++i]=u+M*L,t[++i]=s+S*L,n[++r]=.5*(1+M),n[++r]=.5*(1+S),n[++r]=.5,n[++r]=.5,n[++r]=.5,n[++r]=.5,n[++r]=.5*(1+M),n[++r]=.5*(1+S)}},n.prototype.fillIndices=function(t,n,i,r,e,u){for(var s=0,h=r-1;s<h;++s)t[++i]=n+0,t[++i]=n+1,t[++i]=n+4,t[++i]=n+4,t[++i]=n+1,t[++i]=n+5,n+=1,t[++i]=n+0,t[++i]=n+1,t[++i]=n+4,t[++i]=n+4,t[++i]=n+1,t[++i]=n+5,n+=1,t[++i]=n+0,t[++i]=n+1,t[++i]=n+4,t[++i]=n+4,t[++i]=n+1,t[++i]=n+5,n+=2;e?u?(t[++i]=n+0,t[++i]=n+1,t[++i]=0,t[++i]=0,t[++i]=n+1,t[++i]=1,n+=1,t[++i]=n+0,t[++i]=n+1,t[++i]=1,t[++i]=1,t[++i]=n+1,t[++i]=2,n+=1,t[++i]=n+0,t[++i]=n+1,t[++i]=2,t[++i]=2,t[++i]=n+1,t[++i]=3,n+=2):(t[++i]=n+0,t[++i]=n+1,t[++i]=n+4,t[++i]=n+4,t[++i]=n+1,t[++i]=n+5,n+=1,t[++i]=n+0,t[++i]=n+1,t[++i]=n+4,t[++i]=n+4,t[++i]=n+1,t[++i]=n+5,n+=1,t[++i]=n+0,t[++i]=n+1,t[++i]=n+4,t[++i]=n+4,t[++i]=n+1,t[++i]=n+5,n+=2):(t[++i]=n,t[++i]=n,t[++i]=n,t[++i]=n,t[++i]=n,t[++i]=n,n+=1,t[++i]=n,t[++i]=n,t[++i]=n,t[++i]=n,t[++i]=n,t[++i]=n,n+=1,t[++i]=n,t[++i]=n,t[++i]=n,t[++i]=n,t[++i]=n,t[++i]=n,n+=2)},n.prototype.update=function(t){var n=t.resolution;if(this.vn||this.bn!==n){this.vn=!1,this.bn=n;var i=this.gn,r=this._uvs,e=this.pn,u=this.St,s=this.cn,h=this.Dn,o=Math.min(.5*u,.5*s,this.fn),a=1/n,c=o,f=u-o,l=u,v=o,b=s-o,d=s,g=this.En,m=!(g&Oi.TOP),w=!(g&Oi.BOTTOM),p=!(g&Oi.LEFT),O=!(g&Oi.RIGHT),D=this.ln,E=!(D&Mi.TOP_LEFT),M=!(D&Mi.TOP_RIGHT),S=!(D&Mi.BOTTOM_LEFT),T=!(D&Mi.BOTTOM_RIGHT),j=-1,N=-1,I=0,C=-1,A=Ci.N,R=A<<2,L=A<<3,y=18*A,k=this.getTables(),x=k[0],B=k[1],_=k[2],P=k[3];E?p||m?this.fillVertices(i,r,j,N,A,c,v,o,a,h,x):this.fillVertices(i,r,j,N,A,c,v,o,0,0,x):p||m?this.fillVertices(i,r,j,N,A,0,0,0,0,h,x):this.fillVertices(i,r,j,N,A,0,0,0,0,0,x),this.fillIndices(e,I,C,A,m,!1),j+=L,N+=L,I+=R,C+=y,M?m||O?this.fillVertices(i,r,j,N,A,f,v,o,a,h,B):this.fillVertices(i,r,j,N,A,f,v,o,0,0,B):m||O?this.fillVertices(i,r,j,N,A,l,0,0,0,h,B):this.fillVertices(i,r,j,N,A,l,0,0,0,0,B),this.fillIndices(e,I,C,A,O,!1),j+=L,N+=L,I+=R,C+=y,T?O||w?this.fillVertices(i,r,j,N,A,f,b,o,a,h,_):this.fillVertices(i,r,j,N,A,f,b,o,0,0,_):O||w?this.fillVertices(i,r,j,N,A,l,d,0,0,h,_):this.fillVertices(i,r,j,N,A,l,d,0,0,0,_),this.fillIndices(e,I,C,A,w,!1),j+=L,N+=L,I+=R,C+=y,S?w||p?this.fillVertices(i,r,j,N,A,c,b,o,a,h,P):this.fillVertices(i,r,j,N,A,c,b,o,0,0,P):w||p?this.fillVertices(i,r,j,N,A,0,d,0,0,h,P):this.fillVertices(i,r,j,N,A,0,d,0,0,0,P),this.fillIndices(e,I,C,A,p,!0),j+=L,N+=L,I+=R,C+=y,this.dn.update(),this.mn.update(),this.wn.update()}},n}(Ci),ki=function(n){function i(i){var r=n.call(this,new yi,new t.MeshMaterial(i))||this;return i.on("update",(function(){rt.update(r)})),r}return B(i,n),Object.defineProperty(i.prototype,"width",{get:function(){return this.geometry.width},set:function(t){this.geometry.width=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"height",{get:function(){return this.geometry.height},set:function(t){this.geometry.height=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"cornerRadius",{get:function(){return this.geometry.cornerRadius},set:function(t){this.geometry.cornerRadius=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"cornerMask",{get:function(){return this.geometry.cornerMask},set:function(t){this.geometry.cornerMask=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"borderWidth",{get:function(){return this.geometry.borderWidth},set:function(t){this.geometry.borderWidth=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"borderMask",{get:function(){return this.geometry.borderMask},set:function(t){this.geometry.borderMask=t},enumerable:!1,configurable:!0}),i.prototype._render=function(t){this.geometry.update(t),n.prototype._render.call(this,t)},i}(t.Mesh),xi=function(){function t(){}return t.prototype.get=function(t,n){var i=this.On;return null==i&&((i=new ki(n.getBorderTexture())).parent=t,this.On=i),i},t.prototype.hide=function(){var t=this.On;null!=t&&(t.visible=!1)},t.prototype.onReflow=function(t,n,i,r,e,u,s){var h=t.border,o=h.getColor(e);if(null!=o){var a=h.getAlpha(e);if(0<a){var c=h.getWidth(e),f=h.getMask(e),l=this.get(t,r),v=(h.getAlign(e)-.5)*c;l.tint=o,l.alpha=a,l.x=-v,l.y=-v,l.width=n+2*v,l.height=i+2*v,l.cornerRadius=u,l.cornerMask=s,l.borderWidth=c,l.borderMask=f,l.visible=!0}else this.hide()}else this.hide()},t.prototype.render=function(t){var n;null===(n=this.On)||void 0===n||n.render(t)},t.prototype.updateTransform=function(){var t;null===(t=this.On)||void 0===t||t.updateTransform()},t}(),Bi=function(){function t(){}return t.prototype.get=function(t,n){var i=this.On;return null==i&&((i=new ki(n.getBorderTexture())).parent=t,this.On=i),i},t.prototype.hide=function(){var t=this.On;null!=t&&(t.visible=!1)},t.prototype.onReflow=function(t,n,i,r,e,u,s){var h=t.outline,o=h.getColor(e);if(null!=o){var a=h.getAlpha(e);if(0<a){var c=h.getWidth(e),f=h.getMask(e),l=this.get(t,r),v=h.getOffset(e)+(h.getAlign(e)-.5)*c;l.tint=o,l.alpha=a,l.x=-v,l.y=-v,l.width=n+2*v,l.height=i+2*v,l.cornerRadius=u,l.cornerMask=s,l.borderWidth=c,l.borderMask=f,l.visible=!0}else this.hide()}else this.hide()},t.prototype.render=function(t){var n;null===(n=this.On)||void 0===n||n.render(t)},t.prototype.updateTransform=function(){var t;null===(t=this.On)||void 0===t||t.updateTransform()},t}(),_i=function(){function t(t){var n=new Li;this.Mn=n,t.snippet.add(n,!0);var i=new xi;this.Sn=i,t.snippet.add(i,!0);var r=new Bi;this.Tn=r,t.snippet.add(r,!1),t.reflowable.add(this)}return t.prototype.onReflow=function(t,n,i){var r=t.theme,e=t.state,u=t.corner,s=u.getRadius(),h=u.getMask();this.Mn.onReflow(t,n,i,r,e,s,h),this.Sn.onReflow(t,n,i,r,e,s,h),this.Tn.onReflow(t,n,i,r,e,s,h)},t}(),Pi={NONE:0,BEFORE:1,AFTER:2,BOTH:3},Ui={OPEN:0,CLOSE:1,PARENSESIS:2,ADD_OR_PLUS:3,SUB_OR_MINUS:4,PLUS:5,MINUS:6,ADD:7,SUB:8,MUL:9,DIV:10,MIN:11,MAX:12,COMMA:13,PARENT:14,SELF:15,PADDING:16,CURRENT:17,NUMBER:18},Fi=function(){function t(t){var n=this.toToken(t),i=0;do{i=this.toParensesis(n,i)}while(i<n.length);if(this.toUnary(n),this.toArithmetic(n,Ui.MUL,Ui.DIV),this.toArithmetic(n,Ui.ADD,Ui.SUB),1===n.length){var r=n[0];if(!mn(r))return void(this.jn=r)}throw new Error("Failed to parse '".concat(t,"'"))}return t.prototype.toParensesis=function(t,n){for(var i=t.length,r=n;r<i;++r)if(t[r]===Ui.OPEN){var e=r,u=Ui.PARENSESIS;if(0<r){var s=t[r-1];s!==Ui.MIN&&s!==Ui.MAX||(e-=1,u=s)}for(var h=r+1;h<i;++h){var o=t[h];if(o===Ui.CLOSE)return t[e]=[u,this.toComma(t,r+1,h)],t.splice(e+1,h-e),e+1;o===Ui.OPEN&&(h=this.toParensesis(t,h)-1,i=t.length)}throw new Error("Malformed parensesis")}return i},t.prototype.toCommaOf=function(t,n,i){var r=i-n;if(r<=0)return[Ui.NUMBER,0];if(r<=1)return t[n];for(var e=[],u=n;u<i;++u)e.push(t[u]);return[Ui.PARENSESIS,e]},t.prototype.toComma=function(t,n,i){for(var r=null,e=n,u=n;u<i;++u)t[u]===Ui.COMMA&&((r=r||[]).push(this.toCommaOf(t,e,u)),e=u+1);if(e<i){if(null==r){var s=[];for(u=e;u<i;++u)s.push(t[u]);return s}r.push(this.toCommaOf(t,e,i))}return r||[]},t.prototype.toUnaryNode=function(t){mn(t)||t[0]!==Ui.PARENSESIS&&t[0]!==Ui.MIN&&t[0]!==Ui.MAX||this.toUnary(t[1])},t.prototype.toUnary=function(t){for(var n=0,i=t.length;n<i;++n){var r=t[n];if(r===Ui.ADD_OR_PLUS||r===Ui.SUB_OR_MINUS)if(n<=0||mn(t[n-1])){if(!(n+1<i)||mn(t[n+1]))throw new Error("Malformed unary operator");var e=t.splice(n+1,1)[0],u=r===Ui.ADD_OR_PLUS?Ui.PLUS:Ui.MINUS;t[n]=[u,e],i=t.length,this.toUnaryNode(e)}else u=r===Ui.ADD_OR_PLUS?Ui.ADD:Ui.SUB,t[n]=u;else this.toUnaryNode(r),i=t.length}},t.prototype.toArithmeticNode=function(t,n,i){mn(t)||(t[0]===Ui.PARENSESIS||t[0]===Ui.MIN||t[0]===Ui.MAX?this.toArithmetic(t[1],n,i):t[0]===Ui.PLUS||t[0]===Ui.MINUS?this.toArithmeticNode(t[1],n,i):t[0]!==Ui.ADD&&t[0]!==Ui.SUB&&t[0]!==Ui.MUL&&t[0]!==Ui.DIV||(this.toArithmeticNode(t[1],n,i),this.toArithmeticNode(t[2],n,i)))},t.prototype.toArithmetic=function(t,n,i){for(var r=0,e=t.length;r<e;++r){var u=t[r];if(u===n||u===i){if(0<r&&r+1<e){var s=t[r-1],h=t[r+1];if(!mn(s)&&!mn(h)){t.splice(r,2),t[r-1]=[u,s,h],r-=1,e=t.length,this.toArithmeticNode(s,n,i),this.toArithmeticNode(h,n,i);continue}}throw new Error("Malformed operands for the operator ".concat(u))}this.toArithmeticNode(u,n,i),e=t.length}},t.prototype.toToken=function(n){for(var i=[];;){var r=t.TOKEN_REGEX.exec(n);if(null==r)break;var e=r[0],u=this.toTokenOperator(e);if(null!=u)i.push(u);else{var s=parseFloat(e);if(s!=s)throw new Error("Unexpected token '".concat(e,"' at ").concat(r.index," in '").concat(n,"'"));var h=this.toTokenLiteral(e);null!=h?i.push([h,.01*s]):i.push([Ui.NUMBER,s])}}return i},t.prototype.toTokenOperator=function(t){switch(t){case"+":return Ui.ADD_OR_PLUS;case"-":return Ui.SUB_OR_MINUS;case"*":return Ui.MUL;case"/":return Ui.DIV;case"(":return Ui.OPEN;case")":return Ui.CLOSE;case",":return Ui.COMMA;case"min":return Ui.MIN;case"max":return Ui.MAX}return null},t.prototype.toTokenLiteral=function(t){var n=t.length;if(0<n)switch(t[n-1]){case"%":return Ui.PARENT;case"s":return Ui.SELF;case"p":return Ui.PADDING;case"c":return Ui.CURRENT}return null},t.prototype.evaluate=function(t,n,i,r,e){switch(t[0]){case Ui.PARENSESIS:var u=t[1];return this.evaluate(u[u.length-1],n,i,r,e);case Ui.PLUS:return+this.evaluate(t[1],n,i,r,e);case Ui.MINUS:return-this.evaluate(t[1],n,i,r,e);case Ui.ADD:return this.evaluate(t[1],n,i,r,e)+this.evaluate(t[2],n,i,r,e);case Ui.SUB:return this.evaluate(t[1],n,i,r,e)-this.evaluate(t[2],n,i,r,e);case Ui.MUL:return this.evaluate(t[1],n,i,r,e)*this.evaluate(t[2],n,i,r,e);case Ui.DIV:return this.evaluate(t[1],n,i,r,e)/this.evaluate(t[2],n,i,r,e);case Ui.MIN:if(0<t[1].length){for(var s=t[1],h=this.evaluate(s[0],n,i,r,e),o=1,a=s.length;o<a;++o)h=Math.min(h,this.evaluate(s[o],n,i,r,e));return h}return 0;case Ui.MAX:if(0<t[1].length){for(s=t[1],h=this.evaluate(s[0],n,i,r,e),o=1,a=s.length;o<a;++o)h=Math.max(h,this.evaluate(s[o],n,i,r,e));return h}return 0;case Ui.PARENT:return t[1]*n;case Ui.SELF:return t[1]*i;case Ui.PADDING:return t[1]*r;case Ui.CURRENT:return t[1]*e;case Ui.NUMBER:return t[1]}return 0},t.prototype.calculate=function(t,n,i,r){return this.evaluate(this.jn,t,n,i,r)},t.TOKEN_REGEX=/(?:\+|-|\*|\/|\(|\)|min|max|,|(?:\d+(?:\.\d*)?[%psc]?))/g,t}(),Gi=function(t,n){return.5*(t-n)},Hi=function(t,n,i){return i},zi=function(t){return t},Vi=function(t,n,i){return t-i},Wi=function(){function t(){}return t.position=function(t){if(null==t||mn(t))return null;if(at(t)){switch(t){case"center":case"CENTER":return Gi;case"padding":case"PADDING":return Hi}var n=new Fi(t);return function(t,i,r,e){return n.calculate(t,i,r,e)}}if(ot(t))return t;var i=t;return function(t,n,r,e){return i.calculate(t,n,r,e)}},t.size=function(t){if(null==t||mn(t))return null;if(at(t)){switch(t){case"100%":case"maximized":case"MAXIMIZED":return zi;case"padding":case"PADDING":return Vi}var n=new Fi(t);return function(t,i,r,e){return n.calculate(t,i,r,e)}}if(ot(t))return t;var i=t;return function(t,n,r,e){return i.calculate(t,n,r,e)}},t}(),Xi=function(){function t(){}return t.isActivateKey=function(t){return"Space"===t.key||"Enter"===t.key||32===t.which||13===t.which},t.isArrowUpKey=function(t){return"ArrowUp"===t.key||38===t.which},t.isArrowDownKey=function(t){return"ArrowDown"===t.key||40===t.which},t.isArrowLeftKey=function(t){return"ArrowLeft"===t.key||37===t.which},t.isArrowRightKey=function(t){return"ArrowRight"===t.key||39===t.which},t.isCancelKey=function(t){return"Esc"===t.key||27===t.which},t.isFocusKey=function(t){return"Tab"===t.key||9===t.which},t.isUndoKey=function(t){return t.ctrlKey&&("z"===t.key||90===t.which)},t.isRedoKey=function(t){return t.ctrlKey&&("y"===t.key||89===t.which)},t.isSaveKey=function(t){return t.ctrlKey&&!t.shiftKey&&("s"===t.key||83===t.which)},t.isSaveAsKey=function(t){return t.ctrlKey&&t.shiftKey&&("S"===t.key||83===t.which)},t.isDeleteKey=function(t){return"Delete"===t.key||46===t.which},t.isSelectAllKey=function(t){return t.ctrlKey&&!t.shiftKey&&("a"===t.key||65===t.which)},t.isOkKey=function(t){return"Enter"===t.key||13===t.which},t.getFocusDirection=function(t){return!0!==t.shiftKey},t.toShortcut=function(t){if(at(t)){var n,i=t,r=i.indexOf("->"),e=void 0;0<=r?(e=i.substring(0,r).trim().toLowerCase(),n=i.substring(r+2).trim()):e=i.trim().toLowerCase();for(var u=!1,s=!1,h=!1,o="a",a=e.length,c=0,f=1;f<a;++f)if("+"===e.charAt(f)){var l=e.substring(c,f);switch(l){case"alt":u=!0;break;case"ctrl":s=!0;break;case"shift":h=!0;break;default:o=l}c=f+=1}return c!==f&&(o=e.substring(c,f)),function(t){var n=t.key;if(n.length<=1){t.shift&&(t.key=n.toUpperCase());var i=n.charCodeAt(0);t.which=97<=i&&i<=122?i-32:i}else switch(n){case"enter":t.key="Enter",t.which=13;break;case"space":t.key=" ",t.which=32;break;case"escape":t.key="Escape",t.which=27;break;case"f1":t.key="F1",t.which=112;break;case"f2":t.key="F2",t.which=113;break;case"f3":t.key="F3",t.which=114;break;case"f4":t.key="F4",t.which=115;break;case"f5":t.key="F5",t.which=116;break;case"f6":t.key="F6",t.which=117;break;case"f7":t.key="F7",t.which=118;break;case"f8":t.key="F8",t.which=119;break;case"f9":t.key="F9",t.which=120;break;case"f10":t.key="F10",t.which=121;break;case"f11":t.key="F11",t.which=122;break;case"f12":t.key="F12",t.which=123;break;case"capslock":t.key="CapsLock",t.shift?t.which=20:t.which=240;break;case"arrowup":t.key="ArrowUp",t.which=38;break;case"arrowdown":t.key="ArrowDown",t.which=40;break;case"arrowleft":t.key="ArrowLeft",t.which=37;break;case"arrowright":t.key="ArrowRight",t.which=39;break;case"insert":t.key="Insert",t.which=45;break;case"delete":t.key="Delete",t.which=46;break;case"pageup":t.key="PageUp",t.which=33;break;case"pagedown":t.key="PageDown",t.which=34;break;case"backspace":t.key="Backspace",t.which=8;break;case"colon":t.key=":",t.which=186;break;case"semicolon":t.key=";",t.which=187;break;case"pause":t.key="Pause",t.which=19;break;case"scrolllock":t.key="ScrollLock",t.which=145;break;case"tab":t.key="Tab",t.which=9;break;case"plus":t.key="+",t.which=187;break;case"minus":t.key="-",t.which=189}return t}({alt:u,ctrl:s,shift:h,key:o,which:0,event:n})}return t},t.toString=function(t){var n=[];return t.ctrl&&n.push("Ctrl"),t.shift&&n.push("Shift"),t.alt&&n.push("Alt"),n.push(t.key.toUpperCase()),n.join("+")},t.on=function(t,n,i){var r=this.toShortcut(n);document.body.addEventListener("keydown",(function(n){n.altKey!==r.alt||n.ctrlKey!==r.ctrl||n.shiftKey!==r.shift||n.key!==r.key&&n.which!==r.which||(t.state.isActionable&&(null!=r.event?t.emit(r.event):null!=i&&i(n)),n.preventDefault())}))},t.moveFocusVertically=function(n,i,r){if(i.state.isActionable){var e=t.isArrowUpKey(n),u=t.isArrowDownKey(n);if(e||u)return this.moveFocus(u,i,r)}return!1},t.moveFocusHorizontally=function(n,i,r){if(i.state.isActionable){var e=t.isArrowLeftKey(n),u=t.isArrowRightKey(n);if(e||u)return this.moveFocus(u,i,r)}return!1},t.moveFocus=function(t,n,i){var r,e=null!==(r=null==i?void 0:i.picked)&&void 0!==r?r:rt.getLayer(n);if(e){var u=e.getFocusController(),s=u.get();if(null!=s){var h=u.find(s,!1,s.state.isFocusRoot||t,t,n);if(null!=h)return u.focus(h),!0}}return!1},t}(),Ki=function(){function t(){}return Object.defineProperty(t,"touchable",{get:function(){return"ontouchstart"in document},enumerable:!1,configurable:!0}),Object.defineProperty(t,"tap",{get:function(){return"pointertap"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"down",{get:function(){return"pointerdown"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"enter",{get:function(){return"pointerenter"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"leave",{get:function(){return"pointerleave"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"move",{get:function(){return"pointermove"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"out",{get:function(){return"pointerout"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"over",{get:function(){return"pointerover"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"up",{get:function(){return"pointerup"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"upoutside",{get:function(){return"pointerupoutside"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"cancel",{get:function(){return"pointercancel"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"righttap",{get:function(){return"rightclick"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"rightdown",{get:function(){return"rightdown"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"rightup",{get:function(){return"rightup"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"rightupoutside",{get:function(){return"rightupoutside"},enumerable:!1,configurable:!0}),t.toGlobal=function(t,n,i){if("touches"in t){var r=t.changedTouches,e=r[r.length-1];null!=e?n.mapPositionToPoint(i,e.clientX,e.clientY):n.mapPositionToPoint(i,0,0)}else n.mapPositionToPoint(i,t.clientX,t.clientY);return i},t.onDblClick=function(t,n){var i=this;if(t.addEventListener("dblclick",(function(t){return n(t,!1)})),this.touchable){var r=0,e=0,u=0,s=0;t.addEventListener("touchstart",(function(t){if(0===r||2===r){var n=t.touches,i=n.length;if(i<=0)r=0;else{var s=n.item(i-1);null!=s?(r+=1,e=s.clientX,u=s.clientY):r=0}}else r=0})),t.addEventListener("touchend",(function(t){if(1===r||3===r){var h=t.changedTouches,o=h.length;if(o<=0)r=0;else{var a=h[o-1];if(null!=a){var c=e-a.clientX,f=u-a.clientY;i.CLICK_DISTANCE_THRESHOLD<=Math.abs(c)+Math.abs(f)?r=0:1===r?(s=t.timeStamp,r=2):t.timeStamp-s<i.DBLCLICK_INTERVAL_THRESHOLD?(r=0,n(t,!0)):(s=t.timeStamp,r=2)}else r=0}}else r=0})),t.addEventListener("touchcancel",(function(){r=0}))}},t.contains=function(t,n){for(var i=n;null!=i&&i!==t;)i=i.parent;return i===t},t.CLICK_DISTANCE_THRESHOLD=10,t.DBLCLICK_INTERVAL_THRESHOLD=333,t.LONG_CLICK_THRESHOLD=750,t}(),Yi=function(){function t(){this.Nn=!1}return Object.defineProperty(t.prototype,"isOff",{get:function(){return!this.Nn},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isOn",{get:function(){return this.Nn},enumerable:!1,configurable:!0}),t.prototype.toCoordinate=function(t){return this.Nn?"auto":t},t.prototype.from=function(t){return"auto"===t||"AUTO"===t?(this.Nn=!0,!0):(this.Nn=!1,!1)},t}(),Ji=function(){this.width=new Yi,this.height=new Yi},Zi=function(){function t(t){this.p=t,this.In=[],this.Cn=[],this.An=!0}return Object.defineProperty(t.prototype,"renderable",{get:function(){return this.An},set:function(t){this.An=t},enumerable:!1,configurable:!0}),t.prototype.add=function(t,n){(n?this.In:this.Cn).push(t),"parent"in t&&(t.parent=this.p)},t.prototype.addAt=function(t,n,i){var r=n?this.In:this.Cn;0===i?r.unshift(t):0<i&&i<r.length?r.splice(i,0,t):r.push(t),"parent"in t&&(t.parent=this.p)},t.prototype.remove=function(t,n){var i=n?this.In:this.Cn,r=i.indexOf(t);0<=r&&(i.splice(r,1),"parent"in t&&(t.parent=null))},t.prototype.render=function(t,n){if(this.An)for(var i=n?this.In:this.Cn,r=0,e=i.length;r<e;++r){var u=i[r];u.updateTransform(),u.render(t)}},t}(),qi=function(){function t(){this.Rn=[]}return t.prototype.add=function(t){this.Rn.push(t)},t.prototype.remove=function(t){var n=this.Rn,i=n.indexOf(t);0<=i&&n.splice(i,1)},t.prototype.onReflow=function(t,n,i){for(var r=this.Rn,e=0,u=r.length;e<u;++e)r[e].onReflow(t,n,i)},t}(),Qi=function(n){function i(t){var r,e,u,s,h,o,a,c,f,l=this,v=(l=n.call(this)||this).transform;l._=new Ii(v.position,(function(t,n,i,r){l.onMove(t,n,i,r)})),l.Ln=new Ii(v.scale,(function(t,n,i,r){l.onScale(t,n,i,r)})),l.yn=new Ii(v.skew,(function(t,n,i,r){l.onSkew(t,n,i,r)})),l.kn=t;var b=l.xn={};l.Bn=new Ji,l.vn=!0,l._n=!1,l.Pn=!1,l.Un=null,l.name=null!==(r=null==t?void 0:t.name)&&void 0!==r?r:"";var d=function(t){var n=null==t?void 0:t.theme;if(n)return at(n)?K.getInstance().get(n):n}(t)||l.getThemeDefault();l.$t=d,l.Fn=new Zi(l),l.Gn=new qi,l.Hn=Di(null!==(e=null==t?void 0:t.clear)&&void 0!==e?e:d.getClearType(),Pi),l.zn=new Ni(d,t,(function(){l.toParentResized(),l.toHierarchyDirty(),rt.update(l)}));var g=function(){l.toDirty(),rt.update(l)};l.Mn=new pi(d,t,g),l.Sn=new Ei(d,t,g),l.Tn=new ji(d,t,g),l.qt=new Si(d,t,g);var m=v.position,w=null!==(u=null==t?void 0:t.x)&&void 0!==u?u:d.getX();mn(w)?m.x=w:(m.x=0,b.x=Wi.position(w));var p=null!==(s=null==t?void 0:t.y)&&void 0!==s?s:d.getY();mn(p)?m.y=p:(m.y=0,b.y=Wi.position(p));var O=null!==(h=null==t?void 0:t.width)&&void 0!==h?h:d.getWidth();l.Bn.width.from(O)?l.St=100:mn(O)?l.St=O:(l.St=100,b.width=Wi.size(O));var D=null!==(o=null==t?void 0:t.height)&&void 0!==o?o:d.getHeight();if(l.Bn.height.from(D)?l.cn=100:mn(D)?l.cn=D:(l.cn=100,b.height=Wi.size(D)),null!=t){var E=t.visible;null!=E&&(l.visible=E)}if(null!=t){var M=t.renderable;null!=M&&(l.renderable=M)}l.Mt=new ft((function(t,n){l.onStateChange(t,n)}));var S,T=Di(null!==(a=null==t?void 0:t.interactive)&&void 0!==a?a:d.getInteractive(),Ti);if(l.interactive=!!(T&Ti.SELF),l.interactiveChildren=!!(T&Ti.CHILDREN),null!=t){var j=t.on;if(null!=j)for(var N in j){var I=j[N];I&&l.on(N,I)}}if(l.Vn=null!==(c=null==t?void 0:t.title)&&void 0!==c?c:d.getTitle(),l.Kt=null!==(f=null==t?void 0:t.weight)&&void 0!==f?f:d.getWeight(),l.initReflowable(),l.Wn=function(){rt.update(l)},null!=t&&(S=t.shadow),void 0===S&&(S=d.getShadow()),S)if(at(S))switch(S){case"WEAK":l.shadow=d.newShadowWeak();break;case"DEFAULT":l.shadow=d.newShadow()}else l.shadow=S;l.on(Ki.over,(function(t){l.onOver(t)})),l.on(Ki.out,(function(t){l.onOut(t)})),l.on(Ki.down,(function(t){l.onDown(t)})),l.on(Ki.up,(function(t){l.onUp(t)})),l.on("added",(function(){l.toParentResized(),(l.isDirty()||l.hasDirty())&&l.toParentHasDirty(),l.Pn&&l.toParentHierarchyDirty();var t=l.parent;t instanceof i&&(l.state.parent=t.state),rt.update(l)})),l.on("removed",(function(){l.blur(!0),l.state.parent=null,rt.update(l)}));var C,A=function(t){if(t){var n=t.shortcut,i=t.shortcuts;if(null!=i||null!=n){var r=[];if(null!=n&&r.push(Xi.toShortcut(n)),null!=i)for(var e=0,u=i.length;e<u;++e)r.push(Xi.toShortcut(i[e]));return r}}}(t);if(l.Xn=A,null!=A)for(var R=function(t){l.onShortcut(t)},L=0,y=A.length;L<y;++L)Xi.on(l,A[L],R);if(l.init(t),d.newState(l.Mt),null!=t){var k=t.state;null!=k&&(at(k)?l.Mt.add(k):l.Mt.addAll(k))}if(null!=t){var x=t.parent;null!=x&&x.addChild(l)}if(null!=t){var B=t.children;if(null!=B)for(L=0,y=B.length;L<y;++L){var _=B[L];null!=_&&l.addChild(_)}}return null!=t&&(C=t.cursor,l.Kn=C),l.cursor=l.toCursor(C,l.Mt),l.emit("init",l),l}return B(i,n),i.prototype.toCursor=function(t,n){if(t)if(ot(t)){var i=t(n);if(void 0!==i)return i}else if(void 0!==t)return t;return this.theme.getCursor(n)},Object.defineProperty(i.prototype,"snippet",{get:function(){return this.Fn},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"reflowable",{get:function(){return this.Gn},enumerable:!1,configurable:!0}),i.prototype.initReflowable=function(){new _i(this)},i.prototype.onChildrenChange=function(){this.toHierarchyDirty(),n.prototype.onChildrenChange.call(this)},i.prototype.onShortcut=function(t){this.emit("shortcut",t,this)},i.prototype.init=function(t){},Object.defineProperty(i.prototype,"weight",{get:function(){return this.Kt},enumerable:!1,configurable:!0}),i.prototype.onMove=function(t,n,r,e){for(var u=this.children,s=0,h=u.length;s<h;++s){var o=u[s];o instanceof i&&o.onParentMove(t,n,r,e)}rt.update(this),this.emit("move",t,n,r,e,this)},i.prototype.resize=function(t,n){var i=this.St,r=this.cn,e=null!=t?t:i,u=null!=n?n:r,s=i!==e,h=r!==u;s&&(this.St=e),h&&(this.cn=u);var o,a=s||h;if(a&&this.onResize(e,u,i,r),s&&null!=(o=this.xn).x){var c=this._,f=this.getParentOfSize();f&&(this._.x=o.x(f.width,e,f.padding.getLeft(),c.x))}if(h&&null!=(o=this.xn).y){c=this._;var l=this.getParentOfSize();l&&(this._.y=o.y(l.height,u,l.padding.getTop(),c.y))}return a},i.prototype.getClearType=function(){return this.Hn},i.prototype.onResize=function(t,n,r,e){this.toDirty(),this.toHierarchyDirty();for(var u=this.zn,s=this.children,h=0,o=s.length;h<o;++h){var a=s[h];a instanceof i&&a.onParentResize(t,n,u)}rt.update(this),this.emit("resize",t,n,r,e,this)},i.prototype.onScale=function(t,n,i,r){rt.update(this),this.emit("scale",t,n,i,r,this)},i.prototype.onSkew=function(t,n,i,r){rt.update(this),this.emit("skew",t,n,i,r,this)},Object.defineProperty(i.prototype,"type",{get:function(){return this.getType()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"x",{get:function(){return this._.x},set:function(t){this.setX(t)},enumerable:!1,configurable:!0}),i.prototype.getX=function(){var t=this.xn;return null!=t.x?t.x:this._.x},i.prototype.setX=function(t){var n=this.xn;if(mn(t)){var i=this._;i.x!==t?(n.x=void 0,i.x=t):void 0!==n.x&&(n.x=void 0,this.toParentResized())}else{var r=Wi.position(t);n.x!==r&&(n.x=r,this.toParentResized())}},Object.defineProperty(i.prototype,"y",{get:function(){return this._.y},set:function(t){this.setY(t)},enumerable:!1,configurable:!0}),i.prototype.getY=function(){var t=this.xn;return null!=t.y?t.y:this._.y},i.prototype.setY=function(t){var n=this.xn;if(mn(t)){var i=this._;i.y!==t?(n.y=void 0,i.y=t):void 0!==n.y&&(n.y=void 0,this.toParentResized())}else{var r=Wi.position(t);n.y!==r&&(n.y=r,this.toParentResized())}},Object.defineProperty(i.prototype,"width",{get:function(){return this.St},set:function(t){this.setWidth(t)},enumerable:!1,configurable:!0}),i.prototype.getWidth=function(){return this.Bn.width.toCoordinate(this.xn.width||this.St)},i.prototype.setWidth=function(t){var n=this.Bn.width,i=n.isOn,r=n.from(t);if(n.isOn!==i&&(this.toHierarchyDirty(),rt.update(this)),!r){var e=this.xn;if(mn(t)){var u=this.St;if(u!==t){e.width=void 0,this.St=t;var s=this.cn;if(this.onResize(t,s,u,s),null!=e.x){var h=this._,o=this.getParentOfSize();o&&(h.x=e.x(o.width,t,o.padding.getLeft(),h.x))}}else void 0!==e.width&&(e.width=void 0,this.toParentResized())}else{var a=Wi.size(t);e.width!==a&&(e.width=a,this.toParentResized())}}},Object.defineProperty(i.prototype,"height",{get:function(){return this.cn},set:function(t){this.setHeight(t)},enumerable:!1,configurable:!0}),i.prototype.getHeight=function(){return this.Bn.height.toCoordinate(this.xn.height||this.cn)},i.prototype.setHeight=function(t){var n=this.Bn.height,i=n.isOn,r=n.from(t);if(n.isOn!==i&&(this.toHierarchyDirty(),rt.update(this)),!r){var e=this.xn;if(mn(t)){var u=this.cn;if(u!==t){e.height=void 0,this.cn=t;var s=this.St;if(this.onResize(s,t,s,u),null!=e.y){var h=this._,o=this.getParentOfSize();o&&(h.y=e.y(o.height,t,o.padding.getTop(),h.y))}}else void 0!==e.height&&(e.height=void 0,this.toParentResized())}else{var a=Wi.size(t);e.height!==a&&(e.height=a,this.toParentResized())}}},Object.defineProperty(i.prototype,"position",{get:function(){return this._},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"scale",{get:function(){return this.Ln},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"skew",{get:function(){return this.yn},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"padding",{get:function(){return this.zn},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"corner",{get:function(){return this.qt},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"background",{get:function(){return this.Mn},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"border",{get:function(){return this.Sn},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"outline",{get:function(){return this.Tn},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"unsafe",{get:function(){return this.transform},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"title",{get:function(){return this.Vn},set:function(t){this.Vn!==t&&(this.Vn=t,this.state.isHovered&&this.applyTitle())},enumerable:!1,configurable:!0}),i.prototype.applyTitle=function(){var t=rt.getLayer(this);t&&(t.view.title=this.Vn)},i.prototype.show=function(){return this.visible||(this.visible=!0,this.toParentHierarchyDirty(),rt.update(this)),this},i.prototype.isShown=function(){return this.visible},i.prototype.hide=function(){return this.visible&&(this.visible=!1,this.toParentHierarchyDirty(),this.blur(!0),rt.update(this)),this},i.prototype.isHidden=function(){return!this.visible},i.prototype.toDirty=function(){return!this.vn&&(this.vn=!0,this.toParentHasDirty(),!0)},i.prototype.toHasDirty=function(){return!this._n&&(this._n=!0,this.toParentHasDirty(),!0)},i.prototype.toParentHasDirty=function(){var t=this.parent;t instanceof i&&t.toHasDirty()},i.prototype.toHierarchyDirty=function(){return!this.Pn&&(this.Pn=!0,this.onHierarchyDirty(),this.toParentHierarchyDirty(),!0)},i.prototype.toParentHierarchyDirty=function(){var t=this.parent;t instanceof i&&t.toHierarchyDirty()},i.prototype.isHierarchyDirty=function(){return this.Pn},i.prototype.onHierarchyDirty=function(){},i.prototype.isDirty=function(){return this.vn},i.prototype.hasDirty=function(){return this._n},i.prototype.setFocused=function(t){if(this.state.isFocused!==t){var n=rt.getLayer(this);n&&n.getFocusController().set(this,t)}return this},i.prototype.focus=function(){return this.setFocused(!0)},i.prototype.blur=function(t){if(t){var n=rt.getLayer(this);if(n){var r=n.getFocusController().get();if(r instanceof i)for(var e=r;e;){if(e===this){r.setFocused(!1);break}e=e.parent}}}else this.setFocused(!1);return this},i.prototype.onStateChange=function(t,n){var r=this;this.toDirty(),rt.update(this),this.emit("statechange",t,n,this);for(var e=this.children,u=0,s=e.length;u<s;++u){var h=e[u];h instanceof i&&h.state.onParentChange(t,n)}t.isFocused?(n.isFocused||this.onFocus(),t.inDisabled&&!n.inDisabled&&setTimeout((function(){r.blur()}),0)):n.isFocused&&this.onBlur(),this.cursor=this.toCursor(this.Kn,t)},i.prototype.onChildFocus=function(t){var n=this.parent;n instanceof i&&n.onChildFocus(t)},i.prototype.onFocus=function(){var t=this.parent;t instanceof i&&t.onChildFocus(this)},i.prototype.onChildBlur=function(t){var n=this.parent;n instanceof i&&n.onChildBlur(t)},i.prototype.onBlur=function(){var t=this.parent;t instanceof i&&t.onChildBlur(this)},Object.defineProperty(i.prototype,"state",{get:function(){return this.Mt},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"options",{get:function(){return this.kn},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"theme",{get:function(){return this.$t},set:function(t){this.$t!==t&&(this.$t=t,this.zn.setTheme(t),this.Mn.setTheme(t),this.Sn.setTheme(t),this.Tn.setTheme(t),this.qt.setTheme(t),this.toDirty(),rt.update(this))},enumerable:!1,configurable:!0}),i.prototype.reflow=function(){var t=this.vn;t&&(this.onReflow(),this.vn=!1);var n=this._n,r=this.Pn;if(n||r){this._n=!1,this.Pn=!1;for(var e=this.children,u=0,s=e.length;u<s;++u){var h=e[u];h instanceof i&&h.reflow()}}(t||n||r)&&this.onRefit()},i.prototype.onRefit=function(){var t=this.Bn,n=t.width.isOn,i=t.height.isOn;if(n&&i){for(var r=0,e=0,u=0,s=(o=this.children).length;u<s;++u)(a=o[u]).visible&&(this.hasRefitableWidth(a)&&(r=Math.max(r,a.x+a.width)),this.hasRefitableHeight(a)&&(e=Math.max(e,a.y+a.height)));var h=this.padding;this.resize(r+h.getRight(),e+h.getBottom())}else if(n){for(r=0,u=0,s=(o=this.children).length;u<s;++u)(a=o[u]).visible&&this.hasRefitableWidth(a)&&(r=Math.max(r,a.x+a.width));this.resize(r+this.padding.getRight(),void 0)}else if(i){var o;for(e=0,u=0,s=(o=this.children).length;u<s;++u){var a;(a=o[u]).visible&&this.hasRefitableHeight(a)&&(e=Math.max(e,a.y+a.height))}this.resize(void 0,e+this.padding.getBottom())}},i.prototype.isRefitable=function(t){return t instanceof i},i.prototype.hasRefitableHeight=function(t){return this.isRefitable(t)&&!(t instanceof i&&ot(t.getHeight()))},i.prototype.hasRefitableWidth=function(t){return this.isRefitable(t)&&!(t instanceof i&&ot(t.getWidth()))},i.prototype.onReflow=function(){this.Gn.onReflow(this,this.St,this.cn)},Object.defineProperty(i.prototype,"shadow",{get:function(){return this.Un},set:function(t){var n=this.Un;if(n!==t){var i=this.Gn,r=this.Fn,e=this.Wn;null!=n&&(n.off("update",e),i.remove(n),r.remove(n,!0)),this.Un=t,null!=t&&(t.on("update",e),i.add(t),r.addAt(t,!0,0)),rt.update(this)}},enumerable:!1,configurable:!0}),i.prototype.toParentResized=function(){var t=this.getParentOfSize();t&&this.onParentResize(t.width,t.height,t.padding)},i.prototype.getParentOfSize=function(){var t=this.parent;return t instanceof i?t:rt.getLayer(this)},i.prototype.onParentResize=function(t,n,i){var r=this.xn,e=this.transform.position,u=e.x,s=e.y,h=this.St,o=this.cn,a=i.getLeft()+i.getRight(),c=i.getTop()+i.getBottom(),f=null!=r.width?r.width(t,h,a,h):h,l=null!=r.height?r.height(n,o,c,o):o;this.resize(f,l);var v=null!=r.x?r.x(t,this.St,i.getLeft(),u):u,b=null!=r.y?r.y(n,this.cn,i.getTop(),s):s;this.position.set(v,b)},i.prototype.onParentMove=function(t,n,i,r){},i.prototype.onWheel=function(t,n,i){return this.emit("wheel",t,n,i,this),!1},i.prototype.onKeyDown=function(t){return this.emit("keydown",t,this),!1},i.prototype.onKeyUp=function(t){return this.emit("keyup",t,this),!1},i.prototype.isEventTarget=function(t){var n=t.target;if(n===this)return!0;if(null!=n&&!(n instanceof i&&n.interactive)){for(var r=n.parent;null!=r&&!(r instanceof i&&r.interactive);)r=r.parent;return r===this}return!1},i.prototype.onDown=function(t){this.isEventTarget(t)&&this.onDownThis(t),this.emit("down",t,this)},i.prototype.onDownThis=function(n){if("touches"in n.data.originalEvent){var i=this.Yn||new t.Point;this.Yn=i,i.copyFrom(n.data.global)}else this.focusOnClosest()},i.prototype.onUp=function(t){this.isEventTarget(t)&&this.onUpThis(t),this.emit("up",t,this)},i.prototype.onUpThis=function(t){if("touches"in t.data.originalEvent){var n=this.Yn;if(n){var i=t.data.global,r=Math.abs(i.x-n.x),e=Math.abs(i.y-n.y),u=Ki.CLICK_DISTANCE_THRESHOLD;r<u&&e<u&&this.focusOnClosest()}}},i.prototype.focusOnClosest=function(){var t=rt.getLayer(this);if(t){var n=t.getFocusController();n.focus(n.findParent(this))}},i.prototype.onOver=function(t){this.state.isHovered=!0,t.target===this&&this.applyTitle(),this.emit("over",t,this)},i.prototype.onOut=function(t){this.state.isHovered=!1,this.emit("out",t,this)},i.prototype.onDblClick=function(t,n){return this.emit("dblclick",t,n,this),!1},i.prototype.render=function(t){if(this.visible&&0<this.worldAlpha&&this.renderable){var i=this.Fn;i.render(t,!0),n.prototype.render.call(this,t),i.render(t,!1)}},i.prototype.getThemeDefault=function(){return K.getInstance().get(this.getType())},i.prototype.getType=function(){return"DBase"},i.prototype._calculateBounds=function(){var t=this.transform.worldTransform,r=this._bounds,e=i.WORK_CONTAINS_POINT;e.set(0,0),t.apply(e,e),r.addPoint(e),e.set(this.St,this.cn),t.apply(e,e),r.addPoint(e),n.prototype._calculateBounds.call(this)},i.prototype.containsPoint=function(t){return this.containsGlobalPoint(t)||this.containsLocalPoint(this.worldTransform.applyInverse(t,i.WORK_CONTAINS_POINT))},i.prototype.containsGlobalPoint=function(t){return!1},i.prototype.containsLocalPoint=function(t){var n=t.x,i=t.y,r=this.St,e=this.cn;return 0<=n&&n<=r&&0<=i&&i<=e},i.prototype.getClippingRect=function(t,n){n.x=0,n.y=0,n.width=this.St,n.height=this.cn},i.prototype.destroy=function(){var t=this.xn;t.x=null,t.y=null,t.width=null,t.height=null;var i=this.Un;i&&(this.Un=null,i.destroy());for(var r=this.children,e=r.length-1;0<=e;--e)r[e].destroy();r.length=0,n.prototype.destroy.call(this)},i.WORK_CONTAINS_POINT=new t.Point,i}(t.Container),$i=function(t){function n(n){var i=t.call(this)||this;return i.parent=n,i}return B(n,t),n.prototype.render=function(n){this.updateTransform(),t.prototype.render.call(this,n)},n.prototype.onReflow=function(t,n,i){var r=t.corner,e=Math.max(0,r.getRadius()-.5),u=r.getMask(),s=u&Mi.TOP_LEFT?0:e,h=u&Mi.TOP_RIGHT?0:e,o=u&Mi.BOTTOM_LEFT?0:e,a=u&Mi.BOTTOM_RIGHT?0:e;this.clear(),this.beginFill(16777215,1),this.lineStyle(0,0,0,0,!1),s<=0&&h<=0&&o<=0&&a<=0?this.drawRect(0,0,n,i):(this.moveTo(0+s,0),0<h?this.arcTo(0+n,0,0+n,0+i,h):this.lineTo(0+n,0),0<a?this.arcTo(0+n,0+i,0,0+i,a):this.lineTo(0+n,0+i),0<o?this.arcTo(0,0+i,0,0,o):this.lineTo(0,0+i),0<s?this.arcTo(0,0,0+n,0,s):this.lineTo(0,0)),this.endFill()},n}(t.Graphics),tr={NONE:0,CTRL:1,SHIFT:2,ALT:4,AND:8,OR:16,NOT_NONE:23},nr=function(){function t(){}return t.from=function(t){var n="data"in t?t.data.originalEvent:t;return(n.ctrlKey?tr.CTRL:tr.NONE)|(n.altKey?tr.ALT:tr.NONE)|(n.shiftKey?tr.SHIFT:tr.NONE)},t.match=function(n,i){return i&tr.OR?!!(t.from(n)&i):t.from(n)===i},t}(),ir={OFF:0,ON:1,TOUCH:2},rr=function(){function n(){this.pointers=new Map,this.center=new t.Point,this.scale=0,this.time=0}return n.prototype.start=function(t){var n=t.data.originalEvent;"pointerId"in n&&this.pointers.set(n.pointerId,n),this.doUpdate(t)},n.prototype.isUpdatable=function(t){var n=t.data.originalEvent;return!("pointerId"in n)||this.pointers.has(n.pointerId)},n.prototype.update=function(t){var n=t.data.originalEvent;"pointerId"in n&&this.pointers.set(n.pointerId,n),this.doUpdate(t)},n.prototype.end=function(t){var n=!0,i=t.data.originalEvent;if("touches"in i)n=i.touches.length<=0;else if("pointerId"in i){var r=this.pointers;r.delete(i.pointerId),n=r.size<=0}return this.doUpdate(t),n},n.prototype.bind=function(t){var n=this.interactionManager;if(n){var i=this.onMove;i&&n.on(Ki.move,i);var r=this.onEnd;r&&(n.on(Ki.up,r),n.on(Ki.upoutside,r),n.on(Ki.cancel,r))}},n.prototype.unbind=function(){var t=this.interactionManager;if(t){var n=this.onMove;n&&t.off(Ki.move,n);var i=this.onEnd;i&&(t.off(Ki.up,i),t.off(Ki.upoutside,i),t.off(Ki.cancel,i))}},n.prototype.doUpdate=function(t){var n=this.interactionManager,i=this.center,r=t.data.originalEvent;if(this.scale=0,this.time=r.timeStamp,"touches"in r){var e=r.touches,u=e.length;if(0<u){for(var s=0,h=0,o=0,a=e.length;o<a;++o)s+=(f=e[o]).clientX,h+=f.clientY;if(s/=u,h/=u,n?n.mapPositionToPoint(i,s,h):i.set(s,h),1<u){var c=0;for(o=1,a=e.length;o<a;++o){var f,l=(f=e[o]).clientX-s,v=f.clientY-h;c=Math.max(c,l*l+v*v)}this.scale=Math.sqrt(c)}}}else if("pointerId"in r){var b=this.pointers,d=b.size;if(0<d){var g=0,m=0;if(b.forEach((function(t){g+=t.clientX,m+=t.clientY})),g/=d,m/=d,n?n.mapPositionToPoint(i,g,m):i.set(g,m),1<d){var w=0;b.forEach((function(t){var n=t.clientX-g,i=t.clientY-m;w=Math.max(w,n*n+i*i)})),this.scale=Math.sqrt(w)}}}else i.copyFrom(t.data.global)},n}(),er=function(){function t(){}return t.LINEAR=function(t){return t},t.ELASTIC=function(t){return t*(3*(1-t)*(1-t)+t*(3*(1-t)+t))},t.QUAD_IN_OUT=function(t){return t<.5?2*t*t:(4-2*t)*t-1},t}(),ur=function(t){function n(n){var i,r,e,u=this;(u=t.call(this)||this).R=null,u.Jn=null!==(i=null==n?void 0:n.target)&&void 0!==i?i:null,u.Zn=0,u.qn=null!==(r=null==n?void 0:n.duration)&&void 0!==r?r:200,u.Qn=1/Math.max(1,u.qn),u.$n=!1,u.ti=null==n?void 0:n.onTime,u.ni=function(){u.onTimeBase()},u.ii=null==n?void 0:n.onStart,u.ri=null==n?void 0:n.onEnd,u.ei=null!==(e=null==n?void 0:n.timing)&&void 0!==e?e:er.ELASTIC;var s=null==n?void 0:n.on;if(s)for(var h in s){var o=s[h];o&&u.on(h,o)}return u}return B(n,t),Object.defineProperty(n.prototype,"target",{get:function(){return this.Jn},set:function(t){this.Jn=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"duration",{get:function(){return this.qn},set:function(t){this.qn=t,this.Qn=1/Math.max(1,t)},enumerable:!1,configurable:!0}),n.prototype.start=function(t){void 0===t&&(t=!1),this.stop(),this.Zn=Date.now(),this.$n=t,this.R=window.setTimeout(this.ni,0),this.onStart(t);var n=this.qn,i=this.toTime(t?n:0);this.onTime(i,t,0)},n.prototype.onStart=function(t){var n=this.ii;null!=n&&n(t,this),this.emit("start",t,this)},n.prototype.onTime=function(t,n,i){var r=this.ti;null!=r&&r(t,n,i,this),this.emit("time",t,n,i,this)},n.prototype.onEnd=function(t){var n=this.ri;null!=n&&n(t,this),this.emit("end",t,this)},n.prototype.isStarted=function(){return null!=this.R},n.prototype.isReverse=function(){return this.$n},n.prototype.onTimeBase=function(){if(null!=this.R){this.R=null;var t=Date.now()-this.Zn,n=this.qn,i=this.$n;if(t<n){this.R=window.setTimeout(this.ni,0);var r=this.toTime(i?n-t:t);this.onTime(r,i,t)}else r=this.toTime(i?0:n),this.onTime(r,i,t),this.onEnd(i)}},n.prototype.toTime=function(t){return this.ei(t*this.Qn,this)},n.prototype.stop=function(){var t=this.R;null!=t&&(this.R=null,window.clearTimeout(t))},n.prototype.end=function(){var t=this.R;if(null!=t){this.R=null,window.clearTimeout(t);var n=this.$n,i=Date.now()-this.Zn,r=this.qn,e=this.toTime(n?0:r);this.onTime(e,n,i),this.onEnd(n)}},n}(t.utils.EventEmitter),sr=function(){function t(t,n,i,r){this.dx=t,this.dy=n,this.ds=i,this.dt=r}return t.prototype.set=function(t,n,i,r){this.dx=t,this.dy=n,this.ds=i,this.dt=r},t}(),hr=function(){function t(t,n,i){var r,e=this;this.si=[],this.hi=[],this.oi=0,this.ai=-1,this.ci=0,this.fi=0,this.li=0,this.vi=0,this.bi=0,this._t=0,this.di=new ur({onTime:function(t){e.onEase(t)},onEnd:function(){e.onEaseEnd()},timing:er.LINEAR,duration:333*(null!==(r=null==i?void 0:i.duration)&&void 0!==r?r:1)}),this.gi=t,this.ri=n}return t.prototype.onStart=function(){for(var n=this.si,i=n.length,r=t.HISTORY_CAPACITY;i<r;++i)n.push(new sr(0,0,1,0));this.oi=0,this.ai=-1,this.di.stop()},t.prototype.onMove=function(n,i,r,e){var u=t.HISTORY_CAPACITY,s=this.ai,h=(s+1)%u;this.ai=h;var o=this.oi;(h<s||0<=s&&s<o)&&(this.oi=(o+1)%u),this.si[h].set(n,i,r,e)},t.prototype.updateHistoriesSorted=function(t){var n=this.si,i=this.hi,r=this.oi,e=this.ai,u=n.length;if(e<0)return i.length=0,t;if(e<r){var s=t;i.length=0;for(var h=e;0<=h;--h){var o=n[h];if(!(s+o.dt<160))return s;s+=o.dt,i.push(o)}for(h=u-1;r<=h;--h){var a=n[h];if(!(s+a.dt<160))return s;s+=a.dt,i.push(a)}return s}for(s=t,i.length=0,h=e;r<=h;--h){var c=n[h];if(!(s+c.dt<160))return s;s+=c.dt,i.push(c)}return s},t.prototype.onEnd=function(t){this.updateHistoriesSorted(t);var n=this.hi,i=n.length;if(i<=0)return this.onEaseEnd();for(var r=0,e=0,u=0,s=0,h=0;h<i;++h){var o=n[h];r+=o.dx,e+=o.dy,u+=o.ds,s+=o.dt}if(s<=0)return this.onEaseEnd();var a=1/i;r*=a,e*=a,u*=a,s*=a,this.ci=r,this.fi=e,this.li=u,this.vi=s;var c=this.di,f=c.duration;this._t=-t/f,this.bi=f/s,c.start()},t.prototype.onEase=function(t){var n=this._t;this._t=t;var i=(1-.5*(t+n))*(t-n)*this.bi;this.gi(this.ci*i,this.fi*i,1+(this.li-1)*i,t)},t.prototype.onEaseEnd=function(){this.ri()},t.prototype.stop=function(){this.di.stop()},t.HISTORY_CAPACITY=5,t}(),or=function(){function t(t){var n,i,r,e=t.on;e&&(this.ii=e.start,this.gi=e.move,this.ri=e.end),this.wi=null!==(n=null==t?void 0:t.modifier)&&void 0!==n?n:tr.NONE;var u=t.checker,s=nr.match;this.pi=null!==(i=null==u?void 0:u.start)&&void 0!==i?i:s,this.Oi=null!==(r=null==u?void 0:u.move)&&void 0!==r?r:s,this.Di=t.easing,this.Ei=!!t.touch,this.Mi=[],this.Si=new Map;var h=t.bind;null!=h&&this.bind(h)}return t.prototype.newData=function(t){var n=this.Si,i=n.get(t);if(null!=i)return i;var r=this.Mi.pop();if(null!=r)return n.set(t,r),r;var e=new rr;return e.easing=this.newEasing(e),e.onMove=this.newOnMove(e),e.onEnd=this.newOnEnd(e),n.set(t,e),e},t.prototype.newEasing=function(t){var n=this,i=this.Di;if(null==i||!1!==i)return new hr((function(i,r,e,u){n.onEasingMove(i,r,e,u,t)}),(function(){n.onEasingEnd(t)}),this.toEasingOptions(i))},t.prototype.toEasingOptions=function(t){return null==t||!0===t?void 0:t},t.prototype.deleteData=function(t){var n=t.target;n&&this.Si.delete(n)&&(t.target=void 0,t.pointers.clear(),this.Mi.push(t))},t.prototype.bind=function(t){var n=this;return t.on(Ki.down,(function(i){n.onDown(t,i)})),this},t.prototype.isTouch=function(t){var n=t.data.originalEvent;return"touches"in n||"pointerId"in n&&"mouse"!==n.pointerType},t.prototype.onDown=function(t,n){var i;if((!this.Ei||this.isTouch(n))&&this.pi(n,this.wi,t)){var r=rt.getLayer(t);if(null!=r)if(n.stopPropagation(),t.state.isGesturing)null===(i=this.Si.get(t))||void 0===i||i.start(n);else{var e=this.ii;null!=e&&e(t);var u=this.newData(t);u.target=t,t.state.isGesturing=!0;var s=r.renderer.plugins.interaction;u.interactionManager=s,u.start(n);var h=u.easing;h&&h.onStart(),u.bind(n)}}},t.prototype.newOnMove=function(t){var n=this;return function(i){n.onMove(i,t)}},t.prototype.newOnEnd=function(t){var n=this;return function(i){n.onEnd(i,t)}},t.prototype.onMove=function(t,n){var i=n.target;if(null!=i&&i.state.isGesturing&&n.isUpdatable(t)&&this.Oi(t,this.wi,i)){var r=n.center,e=r.x,u=r.y,s=n.scale,h=n.time;n.update(t);var o=r.x,a=r.y,c=n.scale,f=o-e,l=a-u,v=n.time-h,b=1e-5,d=b<s&&b<c?c/s:1,g=n.easing;g&&g.onMove(f,l,d,v);var m=this.gi;null!=m&&(0===f&&0===l&&1===d||m(i,f,l,o,a,d))}},t.prototype.onEnd=function(t,n){var i=n.target;if(null!=i&&i.state.isGesturing&&n.end(t)){i.state.isGesturing=!1;var r=n.interactionManager;if(n.interactionManager=void 0,r){var e=n.onMove;e&&r.off(Ki.move,e);var u=n.onEnd;u&&(r.off(Ki.up,u),r.off(Ki.cancel,u))}var s=this.ri;null!=s&&s(i);var h=n.easing;h?h.onEnd(t.data.originalEvent.timeStamp-n.time):this.deleteData(n)}},t.prototype.onEasingMove=function(t,n,i,r,e){if(null!=e.target){var u=this.gi;if(null!=u&&(0!==t||0!==n||1!==i)){var s=e.center,h=s.x+t,o=s.y+n;s.set(h,o),u(e.target,t,n,h,o,i)}}},t.prototype.onEasingEnd=function(t){this.deleteData(t)},t.prototype.stop=function(t){var n,i=this.Si.get(t);null!=i&&(null===(n=i.easing)||void 0===n||n.stop(),this.deleteData(i))},t}(),ar=function(){function t(t,n,i,r,e,u){var s,h,o=this;this.p=t,this.Ti=i,this.ji=r;var a=Di(null!==(s=null==u?void 0:u.mode)&&void 0!==s?s:e.getGestureMode(),ir),c=Di(null!==(h=null==u?void 0:u.modifier)&&void 0!==h?h:e.getGestureModifier(),tr);a!==ir.ON&&a!==ir.TOUCH||(this.Ni=new or({touch:a===ir.TOUCH,modifier:c,checker:u&&u.checker,easing:{duration:null==u?void 0:u.duration},on:{start:function(){o.Ti.stop()},move:function(i,r,e,u,s,h){o.onGestureMove(n(t),r,e,u,s,h)}}}))}return t.prototype.onGestureMove=function(t,n,i,r,e,u){if(t){var s=this.Ti,h=t.scale,o=h.x,a=h.y,c=s.toNormalizedScale(o*u),f=s.toNormalizedScale(a*u),l=c/o,v=f/a,b=u<1?Math.max(l,v):Math.min(l,v);c=b*o,f=b*a;var d=r-n,g=e-i,m=t.position,w=(m.x-d)*b+r,p=(m.y-g)*b+e;this.ji(t,w,p,c,f)}},t.prototype.stop=function(){var t;null===(t=this.Ni)||void 0===t||t.stop(this.p)},t.prototype.onDown=function(t){var n;null===(n=this.Ni)||void 0===n||n.onDown(this.p,t)},t}(),cr=function(){function t(t,n,i,r,e){var u=this;this.p=t,this.Ii=n,this.ji=r,this.Ci=1,this.Ai=1,this.Ri=0,this.Li=0,this.yi=1,this.ki=1,this.xi=0,this.Bi=0,this.di=new ur({onTime:function(t){u.onTime(t)},duration:e}),this.Ti=i,this.qn=e}return t.prototype.onTime=function(t){var n=1-t,i=t,r=this.yi*n+this.Ci*i,e=this.ki*n+this.Ai*i,u=this.xi*n+this.Ri*i,s=this.Bi*n+this.Li*i,h=this.Ii(this.p);null!=h&&this.ji(h,u,s,r,e)},t.prototype.start=function(t,n,i,r,e,u,s){if(!1!==s&&this.Ti.stop(),null==u&&(u=this.qn),u<=0)this.ji(t,n,i,r,e);else{var h=t.position,o=t.scale;this.xi=h.x,this.Bi=h.y,this.yi=o.x,this.ki=o.y,this.Ri=n,this.Li=i,this.Ci=r,this.Ai=e,this.di.duration=u,this.di.start()}},t.prototype.stop=function(){this.di.stop()},t}(),fr=function(){function n(i,r,e){var u,s,h,o,a,c,f,l,v,b,d,g,m,w,p,O,D;this.p=i,this.Ii=r,this.ji=e&&e.constraint||n.CONSTRAINT,this._i=new t.Rectangle;var E=this.toTheme(e)||this.getThemeDefault(),M=null==e?void 0:e.zoom;this.Pi=new t.Point,this.Ui=null!==(u=null==M?void 0:M.min)&&void 0!==u?u:E.getZoomMin(),this.Fi=null!==(s=null==M?void 0:M.max)&&void 0!==s?s:E.getZoomMax(),this.Gi=null!==(h=null==M?void 0:M.keepRatio)&&void 0!==h?h:E.getZoomKeepRatio();var S=null==M?void 0:M.wheel;this.Hi=null!==(o=null==S?void 0:S.enable)&&void 0!==o?o:E.isWheelZoomEnabled(),this.zi=null!==(a=null==S?void 0:S.speed)&&void 0!==a?a:E.getWheelZoomSpeed(),this.Vi=Di(null!==(c=null==S?void 0:S.modifier)&&void 0!==c?c:E.getWheelZoomModifier(),tr),this.Wi=null!==(f=null==S?void 0:S.checker)&&void 0!==f?f:nr.match;var T=null==M?void 0:M.dblclick;this.Xi=null!==(l=null==T?void 0:T.enable)&&void 0!==l?l:E.isDblClickZoomEnabled(),this.Ki=null!==(v=null==T?void 0:T.amount)&&void 0!==v?v:E.getDblClickZoomSpeed(),this.Yi=Di(null!==(b=null==T?void 0:T.modifier)&&void 0!==b?b:E.getDblClickZoomModifier(),tr),this.Ji=null!==(d=null==T?void 0:T.checker)&&void 0!==d?d:nr.match,this.Zi=null!==(g=null==T?void 0:T.duration)&&void 0!==g?g:E.getDblClickZoomDuration();var j=null===(m=null==e?void 0:e.translation)||void 0===m?void 0:m.wheel;this.qi=null!==(w=null==j?void 0:j.enable)&&void 0!==w?w:E.isWheelTranslationEnabled(),this.Qi=null!==(p=null==j?void 0:j.speed)&&void 0!==p?p:E.getWheelTranslationSpeed(),this.$i=Di(null!==(O=null==j?void 0:j.modifier)&&void 0!==O?O:E.getWheelTranslationModifier(),tr),this.tr=null!==(D=null==j?void 0:j.checker)&&void 0!==D?D:nr.match,this.nr=new ar(i,r,this,this.ji,E,null==e?void 0:e.gesture),this.I=new cr(i,r,this,this.ji,this.Zi)}return Object.defineProperty(n.prototype,"gesture",{get:function(){return this.nr},enumerable:!1,configurable:!0}),n.prototype.stop=function(){this.nr.stop(),this.I.stop()},n.prototype.reset=function(t,n){var i=this.p,r=this.Ii(i);if(r){var e=r.getLocalBounds(this._i),u=.5*(i.width-e.width)-e.x,s=.5*(i.height-e.height)-e.y;this.I.start(r,u,s,1,1,t,n)}},n.prototype.fit=function(t,n){var i=this.p,r=this.Ii(i);if(r){var e=i.padding,u=i.width,s=i.height,h=r.getLocalBounds(this._i),o=h.x,a=h.y,c=h.width,f=h.height,l=(u-e.getLeft()-e.getRight())/c,v=(s-e.getTop()-e.getBottom())/f;if(this.Gi){var b=this.toNormalizedScale(Math.min(l,v));l=b,v=b}else l=this.toNormalizedScale(l),v=this.toNormalizedScale(v);var d=.5*(u-c*l)-o*l,g=.5*(s-f*v)-a*v;this.I.start(r,d,g,l,v,t,n)}},n.prototype.zoomIn=function(t,n){var i=this.Ii(this.p);if(i){var r=this.Ki,e=i.scale;this.zoom(e.x*r,e.y*r,t,n)}},n.prototype.zoomOut=function(t,n){var i=this.Ii(this.p);if(i){var r=1/this.Ki,e=i.scale;this.zoom(e.x*r,e.y*r,t,n)}},n.prototype.zoomAt=function(t,n,i,r,e,u){var s=this.Ii(this.p);if(s){var h=s.scale.x,o=s.scale.y,a=this.toNormalizedScale(i),c=this.toNormalizedScale(r),f=a/h,l=c/o,v=(s.position.x-t)*f+t,b=(s.position.y-n)*l+n;this.I.start(s,v,b,a,c,e,u)}},n.prototype.zoomAtGlobal=function(t,n,i,r,e,u){var s=this.Pi;s.set(t,n),this.toLocal(s,s),this.zoomAt(s.x,s.y,i,r,e,u)},n.prototype.zoom=function(t,n,i,r){var e=this.p;this.zoomAt(.5*e.width,.5*e.height,t,n,i,r)},Object.defineProperty(n.prototype,"scale",{get:function(){var n=this.Ii(this.p);return n?n.scale:new t.Point(1,1)},set:function(t){var n=this.Ii(this.p);if(n){var i=this.toNormalizedScale(t.x),r=this.toNormalizedScale(t.y),e=n.position;this.ji(n,e.x,e.y,i,r)}},enumerable:!1,configurable:!0}),n.prototype.moveTo=function(t,n,i,r){var e=this.Ii(this.p);if(e){var u=e.scale;this.I.start(e,t,n,u.x,u.y,i,r)}},Object.defineProperty(n.prototype,"position",{get:function(){var n=this.Ii(this.p);return n?n.position:new t.Point(0,0)},set:function(t){var n=this.Ii(this.p);if(n){var i=n.scale;this.ji(n,t.x,t.y,i.x,i.y)}},enumerable:!1,configurable:!0}),n.prototype.transform=function(t,n,i,r,e,u){var s=this.Ii(this.p);s&&this.I.start(s,t,n,i,r,e,u)},n.prototype.toLocal=function(t,n,i){return this.p.toLocal(t,void 0,n,i)},n.prototype.toGlobal=function(t,n,i){return this.p.toGlobal(t,n,i)},n.prototype.toNormalizedScale=function(t){return Math.min(this.Fi,Math.max(this.Ui,t))},n.prototype.onWheel=function(t,n,i){var r;if(this.Hi&&this.Wi(t,this.Vi,this.p)&&0!==n.deltaY&&(r=this.Ii(this.p))){var e=n.lowest*this.zi,u=1+n.deltaY*e,s=r.scale;return this.zoomAtGlobal(i.x,i.y,s.x*u,s.y*u,0),!0}if(this.qi&&this.tr(t,this.$i,this.p)&&(r=this.Ii(this.p))){this.stop(),e=n.lowest*this.Qi;var h=r.position,o=h.x-n.deltaX*e,a=h.y+n.deltaY*e;return s=r.scale,this.ji(r,o,a,s.x,s.y),!0}return!1},n.prototype.onDown=function(t){this.nr.onDown(t)},n.prototype.onDblClick=function(t,n){if(this.Xi&&this.Ji(t,this.Yi,this.p)){var i=this.Ii(this.p);if(i){var r=this.Pi;Ki.toGlobal(t,n,r);var e=this.Ki,u=i.scale;return this.zoomAtGlobal(r.x,r.y,u.x*e,u.y*e,this.Zi),!0}}return!1},n.prototype.toTheme=function(t){if(t&&t.theme){var n=t.theme;return at(n)?K.getInstance().get(n):n}return null},n.prototype.getThemeDefault=function(){return K.getInstance().get(this.getType())},n.prototype.getType=function(){return"DView"},n.CONSTRAINT=function(t,n,i,r,e){t.scale.set(r,e),t.position.set(n,i)},n}(),lr=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.init=function(n){var i,r=this;t.prototype.init.call(this,n),this.ir=null;var e=this.theme;this.rr=new fr(this,(function(){return r.ir}),null==n?void 0:n.view);var u=null==n?void 0:n.canvas;u&&(this.canvas=u),(null!==(i=null==n?void 0:n.mask)&&void 0!==i?i:e.isOverflowMaskEnabled())&&(this.mask=this.getOverflowMask())},n.prototype.getType=function(){return"DCanvasContainer"},n.prototype.onResize=function(n,i,r,e){t.prototype.onResize.call(this,n,i,r,e),this.updateContentSize(n,i,r,e)},Object.defineProperty(n.prototype,"canvas",{get:function(){return this.ir},set:function(t){var n=this.ir;null!=n&&(this.ir=null,this.removeChild(n),this.emit("unset",n,this),n.destroy()),this.ir=t,null!=t?(this.addChild(t),this.rr.reset(0),this.emit("set",t,this)):rt.update(this)},enumerable:!1,configurable:!0}),n.prototype.getOverflowMask=function(){return null==this.er&&(this.er=new $i(this),this.Gn.add(this.er),this.toDirty()),this.er},n.prototype.updateContentSize=function(t,n,i,r){var e=this.ir;if(null!=e){var u=e.x+.5*(t-i),s=e.y+.5*(n-r);e.position.set(u,s)}},Object.defineProperty(n.prototype,"view",{get:function(){return this.rr},enumerable:!1,configurable:!0}),n.prototype.onWheel=function(n,i,r){var e=this.rr.onWheel(n,i,r),u=t.prototype.onWheel.call(this,n,i,r);return e||u},n.prototype.onDblClick=function(n,i,r){if(!0!==r){var e=this.rr.onDblClick(n,i),u=t.prototype.onDblClick.call(this,n,i);return e||u}return t.prototype.onDblClick.call(this,n,i)},n.prototype.onDown=function(n,i){!0!==i&&this.rr.onDown(n),t.prototype.onDown.call(this,n)},n.prototype.destroy=function(){var n=this.er;null!=n&&(this.er=null,n.destroy()),this.mask=null,t.prototype.destroy.call(this)},n}(Qi),vr={DIAGRAM:0,PAGE:1,EXTENSION:1e3},br=function(){function t(t){this.ur=this.newSources(t)}return t.prototype.map=function(n,i,r){var e=this.ur;if(null==e)return!1;var u=n.id,s=u.toLowerCase(),h=s.length;if(h!==u.length)return!1;var o=e[0],a=o.length;if(0!==a&&0!==s.indexOf(o))return!1;var c=t.SPANS;c[0]=0,c[1]=a;for(var f=e.length,l=1;l<f;++l){var v=l<<1,b=e[l],d=b.length;if(0===d)c[v]=h,c[v+1]=h;else{var g=s.indexOf(b,c[v-1]);if(g<0)return!1;c[v]=g,c[v+1]=g+d}}if(null!=i){for(var m=i.length,w="",p=(l=0,f);l<p;++l){var O=l<m?i[l]:e[l],D=c[1+(v=l<<1)],E=c[v+2];w+=O+u.substring(D,l+1<p?E:h)}n.id=w}return 0<r.length&&(n.initial=r),!0},t.prototype.newSources=function(n){if(null==n)return null;var i=n.trim();return i.length<=0?null:i.toLowerCase().split(t.WILDCARD)},t.split=function(t){if(null==t)return null;var n=t.trim();return n.length<=0?null:n.split(this.WILDCARD)},t.WILDCARD="*",t.SPANS=[],t}(),dr=function(){function t(t,n,i,r,e){this.resources=t.resources,this.data=t.data||t.tags||t.resources,this.pieces=n,this.pieceData=i,this.mode=r,this.depth=e,this.sr=new Map,this.hr=new Map,this.ar=new Map,this.Pt=new Map,this.cr=new Map,this.lr=new Map,this.vr=new Map,this.br=new Map,this.dr=new Map,this.gr=new Map,this.mr=new Map,this.wr=new Map,this.pr=new Map,this.Or=new Map,this.Dr=new Map,this.Er=new Map}return t.prototype.getAction=function(t){return this.sr.get(t)},t.prototype.setAction=function(t,n){this.sr.set(t,n)},t.prototype.getFill=function(t){return this.hr.get(t)},t.prototype.setFill=function(t,n){this.hr.set(t,n)},t.prototype.getStroke=function(t){return this.ar.get(t)},t.prototype.setStroke=function(t,n){this.ar.set(t,n)},t.prototype.getData=function(t){return this.Pt.get(t)},t.prototype.setData=function(t,n){this.Pt.set(t,n)},t.prototype.getDataValue=function(t){return this.cr.get(t)},t.prototype.setDataValue=function(t,n){this.cr.set(t,n)},t.prototype.getDataMapping=function(t){return this.lr.get(t)},t.prototype.setDataMapping=function(t,n){this.lr.set(t,n)},t.prototype.getDataMapper=function(t){var n=this.vr,i=n.get(t);return void 0===i&&(i=new br(t),n.set(t,i)),i},t.prototype.getDataDestination=function(t){var n=this.br,i=n.get(t);return void 0===i&&(i=br.split(t),n.set(t,i)),i},t.prototype.getDataSystem=function(t){return this.dr.get(t)},t.prototype.setDataSystem=function(t,n){this.dr.set(t,n)},t.prototype.getRange=function(t){return this.gr.get(t)},t.prototype.setRange=function(t,n){this.gr.set(t,n)},t.prototype.getAlign=function(t){return this.mr.get(t)},t.prototype.setAlign=function(t,n){this.mr.set(t,n)},t.prototype.getMargin=function(t){return this.wr.get(t)},t.prototype.setMargin=function(t,n){this.wr.set(t,n)},t.prototype.getText=function(t){return this.pr.get(t)},t.prototype.setText=function(t,n){this.pr.set(t,n)},t.prototype.getTextOutline=function(t){return this.Or.get(t)},t.prototype.setTextOutline=function(t,n){this.Or.set(t,n)},t.prototype.getCapability=function(t){return this.Dr.get(t)},t.prototype.setCapability=function(t,n){this.Dr.set(t,n)},t.prototype.getExtension=function(t){return this.Er.get(t)},t.prototype.setExtension=function(t,n){this.Er.set(t,n)},t}(),gr={VIEWER:0,EDITOR_DATA_MAPPED:1,EDITOR:2},mr=function(){function t(){}return t.get=function(t){var n=this.mappings[t];return null!=n?n:wt.PRIMITIVE},t.contains=function(t,n){if(null!=t){var i=this.get(t.type),r=t.getCapability();return null!=r&&(i&=~r.removed,i|=r.added,i&=~r.locked),(i&n)===n}return!1},t.set=function(t,n){this.mappings[t]=n},t.mappings={},t}(),wr=function(){this.localTransform=new t.Matrix,this.internalTransform=new t.Matrix,this.internalTransformParentInverse=new t.Matrix,this.rotation=0,this.size=new t.Point},pr=function(t){return Math.abs(t)<.001?t<0?-.001:.001:t},Or=function(){function t(){}return t.prepare=function(t){var n=t.editor||new wr;t.editor=n,t.updateTransform();var i=t.parent;i instanceof Ot?i.transform.internalTransform.copyTo(n.internalTransformParentInverse).invert():n.internalTransformParentInverse.identity(),t.transform.internalTransform.copyTo(n.internalTransform),n.rotation=t.transform.rotation,n.size.copyFrom(t.size),t.disallowOnTransformChange()},t.finalize=function(t){t.allowOnTransformChange(!0)},t.apply=function(t,n,i){var r=t.editor;if(null!=r){var e=r.localTransform;if(r.internalTransformParentInverse.copyTo(e).append(n).append(r.internalTransform),i)this.applyLocal(t,e);else{var u=r.size;this.applyLocal(t,e,u.x,u.y)}}},t.applyLocal=function(t,n,i,r){t.disallowUploadedUpdate();var e=n.a,u=n.b,s=n.c,h=n.d,o=n.tx,a=n.ty,c=t.transform,f=Math.atan2(-s,h),l=Math.atan2(+u,e);c.rotation=.5*(f+l);var v=.5*(l-f);c.skew.set(v,v);var b=c.pivot,d=b.x,g=b.y;if(c.position.set(o+(e*d+s*g),a+(u*d+h*g)),null!=i&&null!=r){var m=Math.sqrt(e*e+u*u),w=Math.sqrt(s*s+h*h);t.size.set(pr(i*m),pr(r*w))}t.allowUploadedUpdate()},t}(),Dr=function(){function n(n,i,r){this.shape=n,this.base=new t.Point(i,r);var e=n.size;this.shapeBase=new t.Point(e.x,e.y),this.transform=new t.Matrix,n.updateTransform(),n.transform.localTransform.copyTo(this.transform),this.capable=mr.contains(n,wt.POSITION)&&mr.contains(n,wt.WIDTH)&&mr.contains(n,wt.HEIGHT)&&mr.contains(n,wt.ROTATION)&&mr.contains(n,wt.SKEW)}return n.prototype.isCompatible=function(t){return this.shape===t},n.prototype.reset=function(t,n,i){this.base.set(n,i);var r=t.size;this.shapeBase.copyFrom(r),t.updateTransform(),t.transform.localTransform.copyTo(this.transform)},n.prototype.update=function(t,i,r,e,u){if(this.capable){var s=i/this.base.x,h=r/this.base.y,o=this.shapeBase,a=n.WORK_TRANSFORM;a.identity().append(this.transform).translate(-e,-u).scale(s,h).translate(+e,+u),t.disallowOnTransformChange(),Or.applyLocal(t,a,o.x,o.y),t.allowOnTransformChange(!1)}},n.WORK_TRANSFORM=new t.Matrix,n}(),Er=function(){function n(n,i,r,e){this.Mr=new t.Rectangle,this.Sr=new t.Rectangle,this.p=n,this.Tr=[],this.j=new t.Point(i,r),this.jr=e}return n.prototype.init=function(){},Object.defineProperty(n.prototype,"x",{get:function(){return this.j.x},set:function(t){var n=this.j;if(n.x!==t){var i=n.x;n.x=t,this.onChange(i,n.y)}},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"y",{get:function(){return this.j.y},set:function(t){var n=this.j;if(n.y!==t){var i=n.y;n.y=t,this.onChange(n.x,i)}},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n){var i=!1,r=this.j,e=r.x,u=r.y;return null!=t&&e!==t&&(i=!0,r.x=t),null!=n&&u!==n&&(i=!0,r.y=n),i&&this.onChange(e,u),this},n.prototype.clone=function(){var t=this.j;return new n(this.p,t.x,t.y,this.jr)},n.prototype.copy=function(){},n.prototype.copyFrom=function(t){var n=t.x,i=t.y,r=this.j,e=r.x,u=r.y;return e===n&&u===i||(r.x=n,r.y=i,this.onChange(e,u)),this},n.prototype.copyTo=function(t){return this.j.copyTo(t)},n.prototype.equals=function(t){return this.j.equals(t)},n.prototype.fit=function(){this.jr&&this.doFit()},n.prototype.doFit=function(){var t=this.p;t.disallowOnTransformChange();var n=this.calcRect(this.Sr),i=this.j;i.set(n.width,n.height),t.updateTransform();var r=t.transform,e=n.x+.5*n.width,u=n.y+.5*n.height,s=r.position,h=r.localTransform,o=h.a,a=h.b,c=h.c,f=h.d,l=r.pivot;s.set(s.x+(o*e+c*u)-(o*l.x+c*l.y),s.y+(a*e+f*u)-(a*l.x+f*l.y)),l.set(e,u),this.reset(t.children,this.Tr,i),t.allowOnTransformChange(!0)},n.prototype.reset=function(t,n,i){for(var r=0,e=Math.min(n.length,t.length);r<e;++r){var u=t[r],s=n[r];if(!s.isCompatible(u)){n.length=r;break}s.reset(u,i.x,i.y)}t.length<n.length&&(n.length=t.length)},n.prototype.calcRect=function(t){var n=this.p.children;if(n.length<=0)t.x=0,t.y=0,t.width=0,t.height=0;else{var i=this.Mr;n[0].getBoundsLocal(!1,t);for(var r=1,e=n.length;r<e;++r)n[r].getBoundsLocal(!1,i),t.enlarge(i)}return t},n.prototype.onChange=function(t,n){var i=this.p,r=this.j,e=i.transform.pivot;this.Nr(i.children,this.Tr,r.x,r.y,e.x,e.y,t,n),i.onSizeChange()},n.prototype.Nr=function(t,n,i,r,e,u,s,h){for(var o=0,a=Math.min(n.length,t.length);o<a;++o){var c=t[o];if(!(f=n[o]).isCompatible(c)){n.length=o;break}f.update(c,i,r,e,u)}for(o=n.length,a=t.length;o<a;++o){var f;c=t[o],(f=this.newLayout(c,s,h)).update(c,i,r,e,u),n.push(f)}n.length!==t.length&&(n.length=t.length)},n.prototype.newLayout=function(t,n,i){return t.layout||new Dr(t,n,i)},n}(),Mr=function(){function n(n,i,r,e,u){this.p=n,this._x=i,this._y=r,this.Ir=new t.Point(e,u)}return Object.defineProperty(n.prototype,"x",{get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this.onChange())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"y",{get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this.onChange())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"base",{get:function(){return this.Ir},enumerable:!1,configurable:!0}),n.prototype.init=function(){this.Ir.copyFrom(this),this.onChange()},n.prototype.clone=function(){var t=this.Ir;return new n(this.p,this._x,this._y,t.x,t.y)},n.prototype.set=function(t,n){var i=!1;return null!=t&&this._x!==t&&(this._x=t,i=!0),null!=n&&this._y!==n&&(this._y=n,i=!0),i&&this.onChange(),this},n.prototype.copyFrom=function(t){return t instanceof n&&this.Ir.copyFrom(t.base),this._x===t.x&&this._y===t.y||(this._x=t.x,this._y=t.y,this.onChange()),this},n.prototype.copyTo=function(t){return t instanceof n&&this.Ir.copyTo(t.base),t.set(this._x,this._y),t},n.prototype.equals=function(t){return t.x===this._x&&t.y===this._y},n.prototype.fit=function(){},n.prototype.onChange=function(){var t=this.Ir;this.p.transform.scale.set(this._x/t.x,this._y/t.y)},n}(),Sr=function(){function t(){}return Object.defineProperty(t.prototype,"enable",{get:function(){return!0},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return 16777215},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return 1},set:function(t){},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){},t.prototype.set=function(t,n,i){},t.prototype.clone=function(){return new t},t.prototype.toObject=function(){return{enable:!0,color:16777215,alpha:1}},t.prototype.serialize=function(t){return-1},t.prototype.deserialize=function(t,n){},t}(),Tr=function(){function t(){}return Object.defineProperty(t.prototype,"enable",{get:function(){return!1},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return 16777215},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return 1},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return 1},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"align",{get:function(){return 0},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"side",{get:function(){return Gt.NONE},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"style",{get:function(){return s.NONE},set:function(t){},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){},t.prototype.set=function(t,n,i,r,e,u,s){},t.prototype.clone=function(){return new t},t.prototype.toObject=function(){return{enable:!1,color:16777215,alpha:1,width:1,align:0,side:Gt.NONE,style:s.NONE}},t.prototype.serialize=function(t){return-1},t.prototype.deserialize=function(t,n){},t}(),jr=function(t){function n(n,i,r){var e=t.call(this,r)||this;e.Cr=n,e.Ar=i;var u=e.newData();return e.data=u,e.tag=u,e.size=e.newGroupSize(n,i),e.fill=e.newGroupFill(),e.stroke=e.newGroupStroke(),e.text=e.newGroupText(),e}return B(n,t),Object.defineProperty(n.prototype,"mode",{get:function(){return this.Cr},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"depth",{get:function(){return this.Ar},enumerable:!1,configurable:!0}),n.prototype.newGroupSize=function(t,n){var i=Y.SIZE_X,r=Y.SIZE_Y;return t!==gr.VIEWER?new Er(this,i,r,this.isGroupSizeFittable()):new Mr(this,i,r,i,r)},n.prototype.isGroupSizeFittable=function(){return!0},n.prototype.newData=function(){return new kt},n.prototype.newGroupFill=function(){return new Sr},n.prototype.newGroupStroke=function(){return new Tr},n.prototype.newGroupText=function(){return new Pt(this,Y.TEXT_VALUE,Y.TEXT_COLOR,Y.TEXT_ALPHA,Y.TEXT_FAMILY,Y.TEXT_SIZE)},n.prototype.getBoundsSize=function(){var t=this.size;return t instanceof Mr?t.base:t},n.prototype.onChildTransformChange=function(){t.prototype.onChildTransformChange.call(this),this.size.fit()},Object.defineProperty(n.prototype,"corner",{get:function(){return it.NONE},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"gradient",{get:function(){},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"radius",{get:function(){return 0},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"image",{get:function(){},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"points",{get:function(){},set:function(t){},enumerable:!1,configurable:!0}),n.prototype.containsAbs=function(t,n,i,r,e,u,s){return!1},n}(Ot),Nr=function(t){function n(n,i,e,u){void 0===u&&(u=r.EMBEDDED);var s=t.call(this,i,e,u)||this;return s.Rr=n,s.Ar=e,s}return B(n,t),Object.defineProperty(n.prototype,"name",{get:function(){return this.Rr},enumerable:!1,configurable:!0}),n.prototype.isGroupSizeFittable=function(){return!1},n.prototype.newGroupSize=function(t,n){var i=Y.SIZE_X,r=Y.SIZE_Y;return t!==gr.VIEWER&&n<=0?new Er(this,i,r,this.isGroupSizeFittable()):new Mr(this,i,r,i,r)},n.prototype.clone=function(){for(var t=this.newClone().copy(this),n=this.children,i=0,r=n.length;i<r;++i){var e=n[i].clone();e.parent=t,t.children.push(e)}return t.onChildTransformChange(),t.toDirty(),t},n.prototype.newClone=function(){return new(0,this.constructor)(this.Rr,this.Cr,this.Ar,this.type)},n.prototype.serializeChildren=function(t){return[]},n.prototype.serializeImage=function(t){return-1},n.prototype.serializeGradient=function(t){return-1},n.prototype.serialize=function(n){var i=t.prototype.serialize.call(this,n);return i[15]=n.addPiece(this.Rr),i},n.prototype.addUuid=function(t){this.uuid=t.addUuid(this.uuid)},n.prototype.updateUuid=function(t){this.uuid=t.updateUuid(this.uuid)},n}(jr),Ir=function(){function t(t){this.Lr=t}return t.prototype.find=function(t){return this.getUuidToShape().get(t)},t.prototype.getUuidToShape=function(){var t=this.yr;return null==t&&(t=this.newUuidToShape(),this.yr=t),t},t.prototype.newUuidToShape=function(){var t=new Map;return this.fillUuidToShape(this.Lr,t),t},t.prototype.fillUuidToShape=function(t,n){for(var i=0,r=t.length;i<r;++i){var e=t[i];if(n.set(e.uuid,e),!(e instanceof Nr)){var u=e.children;0<u.length&&this.fillUuidToShape(u,n)}}},t}(),Cr=function(t,i){var e=n[t[0]]||n[r.NULL];if(null!=e){var u=e(t,i);if(null!=u)return u}throw new Error("Missing shape deserializers")},Ar=function(t,n){for(var i=[],r=0,e=t.length;r<e;++r)i.push(Cr(t[r],n));return 0<i.length?Promise.all(i).then((function(i){return Rr(t,i,new Ir(i),n),i})):null},Rr=function(t,n,r,e){for(var u=0,s=t.length;u<s;++u){var h=t[u],o=n[u],a=i[h[0]];a&&a(h,o,r,e),Rr(h[20],o.children,r,e)}},Lr=function(t,n,i,r){this.name=t,this.width=n,this.height=i,this.layer=r},yr=function(){function t(){this.V=new Map}return t.prototype.add=function(t,n,i,r,e,u){return this.V.set(t,{type:n,x:i,y:r,normal:this.toNormal(i,r,e,u)}),!0},t.prototype.toNormal=function(t,n,i,r){if(null!=i&&null!=r)return{x:i,y:r};var e=t*t+n*n;if(1e-5<e){var u=1/Math.sqrt(e);return{x:t*u,y:n*u}}return{x:0,y:0}},t.prototype.remove=function(t){var n=this.V,i=n.get(t);return null!=i?(n.delete(t),i):null},t.prototype.size=function(){return this.V.size},t.prototype.get=function(t,n){return this.V.get(n)||null},t.prototype.each=function(t,n){return this.V.forEach(n),this},t.prototype.contains=function(t){return this.V.has(t)},t.prototype.clear=function(){var t=this.V;return 0<t.size&&(t.clear(),!0)},t}(),kr={TAIL:1,HEAD:2,ALL:3},xr=function(){function t(){}return t.set=function(t,n){var i=this.kr;null==i&&(i=new Map,this.kr=i),i.set(t,n)},t.get=function(t){var n;return(null===(n=this.kr)||void 0===n?void 0:n.get(t))||this.getDefault()},t.getDefault=function(){var t=this.Br;return null==t&&(t=this.newDefault(),this.Br=t),t},t.newDefault=function(){var t=new yr,n=1/Math.sqrt(2);return t.add("TOP",kr.ALL,0,-.5,0,-1),t.add("LEFT",kr.ALL,-.5,0,-1,0),t.add("RIGHT",kr.ALL,.5,0,1,0),t.add("BOTTOM",kr.ALL,0,.5,0,1),t.add("CENTER",kr.ALL,0,0,0,0),t.add("TOP_LEFT",kr.ALL,-.5,-.5,-n,-n),t.add("TOP_RIGHT",kr.ALL,.5,-.5,n,-n),t.add("BOTTOM_LEFT",kr.ALL,-.5,.5,-n,n),t.add("BOTTOM_RIGHT",kr.ALL,.5,.5,n,n),t},t}(),Br=function(){function t(t){this.p=t,this._r=null,this.Pr=null}return Object.defineProperty(t.prototype,"shape",{get:function(){return this._r},set:function(t){this.set(t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"edge",{get:function(){return this.Pr},set:function(t){this.set(void 0,t)},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){return this.set(t.shape,t.edge)},t.prototype.set=function(t,n){var i=!1;return void 0!==t&&this._r!==t&&(this._r=t,i=!0),void 0!==n&&this.Pr!==n&&(this.Pr=n,i=!0),i&&this.p.onAcceptorChange(),this},t}(),_r=function(){function n(n,i){var r=this;this.p=n,this.Z=i,this.Ur=new Br(this),this.J=new t.ObservablePoint((function(){r.onLocalChange()}),void 0),this.Fr=0,this.Gr=0,this.Hr=new t.ObservablePoint((function(){r.onNormalChange()}),void 0),this.zr=0,this.Vr=0,this.Wr=0,this.Xr=0,this.Kr=!1,this.Yr=!1,this.Jr=!1,this.Zr=!1}return n.prototype.lock=function(){this.Xr+=1,1===this.Xr&&(this.Kr=!1,this.Yr=!1,this.Jr=!1,this.Zr=!1)},n.prototype.unlock=function(){if(this.Xr-=1,0===this.Xr){var t=!1;this.Yr&&(this.Fr+=1,this.Gr=this.Fr,t=!0),this.Jr&&(this.zr+=1,this.Vr=this.zr,t=!0),this.Zr&&(t=!0),this.Kr&&(this.Yr||(this.Fr+=1),this.Jr||(this.zr+=1),this.doFit()&&(t=!1)),t&&this.Z()}},Object.defineProperty(n.prototype,"parent",{get:function(){return this.p},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"acceptor",{get:function(){return this.Ur},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"local",{get:function(){return this.J},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"localId",{get:function(){return this.Gr},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"normal",{get:function(){return this.Hr},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"normalId",{get:function(){return this.Vr},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"margin",{get:function(){return this.Wr},set:function(t){this.Wr!==t&&(this.Wr=t,this.onOtherChange())},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u,s){this.lock(),this.Ur.set(t,n);var h=this.J;null!=r&&null!=e?h.set(r,e):null!=r?h.x=r:null!=e&&(h.y=e);var o=this.Hr;return null!=u&&null!=s?o.set(u,s):null!=u?o.x=u:null!=s&&(o.y=s),null!=i&&(this.margin=i),this.unlock(),this},n.prototype.copy=function(t){return this.lock(),this.Ur.copy(t.acceptor),this.J.copyFrom(t.local),this.Hr.copyFrom(t.normal),this.margin=t.margin,this.unlock(),this},n.prototype.serialize=function(t){var n=this.Ur,i=n.shape,r=i?i.uuid:null,e=n.edge,u=null!=e?t.addResource(e):-1,s=this.J,h=this.Hr;return t.addResource("[".concat(r,",").concat(u,",").concat(s.x,",").concat(s.y,",").concat(this.Wr,",").concat(h.x,",").concat(h.y,"]"))},n.prototype.deserialize=function(t,n,i){var r=i.resources;if(0<=t&&t<r.length){var e=i.getExtension(t);null==e&&(e=JSON.parse(r[t]),i.setExtension(t,e));var u=null,s=e[0];null!=s&&(u=n.find(s)||null),this.lock();var h=this.Ur;h.shape=u;var o=e[1];h.edge=0<=o&&o<r.length?r[o]:null,this.J.set(e[2],e[3]);var a=e[5],c=e[6],f=this.Hr;null!=a&&null!=c?f.set(a,c):f.set(1,0),this.margin=e[4]||0,this.unlock(),u&&u.connector.add(this)}},n.prototype.fit=function(t){return t&&(this.Fr+=1,this.zr+=1),this.doFit(),this},n.prototype.doFit=function(){var t=this.Fr,n=this.Gr!==t,i=this.zr,r=this.Vr!==i;if(n||r){this.Gr=t,this.Vr=i;var e=this.Ur,u=e.shape,s=e.edge;if(null!=u&&null!=s){var h=xr.get(u.type).get(u,s);if(h){var o=this.toAcceptorTransform(u),a=o.a,c=o.b,f=o.c,l=o.d,v=o.tx,b=o.ty;if(this.lock(),n){var d=u.size,g=u.transform.pivot,m=g.x+d.x*h.x,w=g.y+d.y*h.y;this.J.set(a*m+f*w+v,c*m+l*w+b)}if(r){var p=h.normal,O=p.x,D=p.y,E=a*O+f*D,M=c*O+l*D,S=E*E+M*M,T=this.Hr;if(1e-6<S){var j=1/Math.sqrt(S);T.set(E*j,M*j)}else T.set(O,D)}var N=this.Yr||this.Jr;return this.unlock(),N}}}return!1},n.prototype.toAcceptorTransform=function(i){var r;i.updateTransform();var e=this.p,u=e.parent;return u?(e.updateTransform(),(null!==(r=n.WORK_MATRIX)&&void 0!==r?r:n.WORK_MATRIX=new t.Matrix).copyFrom(u.transform.worldTransform).invert().append(i.transform.worldTransform)):i.transform.worldTransform},n.prototype.onAcceptorChange=function(){if(0<this.Xr)return this.Yr=!1,this.Jr=!1,void(this.Kr=!0);this.fit(!0)},n.prototype.onLocalChange=function(){0<this.Xr?this.Yr=!0:(this.Fr+=1,this.Gr=this.Fr,this.Z())},n.prototype.onNormalChange=function(){0<this.Xr?this.Jr=!0:(this.zr+=1,this.Vr=this.zr,this.Z())},n.prototype.onOtherChange=function(){0<this.Xr?this.Zr=!0:this.Z()},n.prototype.attach=function(){var t=this.Ur.shape;return t&&t.connector.add(this),this},n.prototype.detach=function(){var t=this.Ur.shape;return t&&t.connector.remove(this),this},n}(),Pr=function(){function t(t,n){var i=this;this.p=t,this.Xr=0,this.Ut=!1,this.Z=n;var r=function(){i.onChange()};this.qr=new _r(t,r),this.Qr=new _r(t,r)}return t.prototype.lock=function(){return this.Xr+=1,1===this.Xr&&(this.Ut=!1),this},t.prototype.unlock=function(){return this.Xr-=1,0===this.Xr&&this.Ut&&this.Z(),this},t.prototype.onChange=function(){0<this.Xr?this.Ut=!0:this.Z()},Object.defineProperty(t.prototype,"tail",{get:function(){return this.qr},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"head",{get:function(){return this.Qr},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){return this.lock(),this.qr.copy(t.tail),this.Qr.copy(t.head),this.unlock(),this},t.prototype.fit=function(t){return this.lock(),this.qr.fit(t),this.Qr.fit(t),this.unlock(),this},t.prototype.serialize=function(t){var n=this.qr.serialize(t),i=this.Qr.serialize(t);return t.addResource("[".concat(n,",").concat(i,"]"))},t.prototype.deserialize=function(t,n,i){var r=i.resources;if(0<=t&&t<r.length){var e=i.getExtension(t);null==e&&(e=JSON.parse(r[t]),i.setExtension(t,e)),this.lock(),this.qr.deserialize(e[0],n,i),this.Qr.deserialize(e[1],n,i),this.unlock()}},t.prototype.attach=function(){this.lock();var t=this.qr,n=this.Qr;return t.attach(),n.attach(),t.fit(!0),n.fit(!0),this.unlock(),this},t.prototype.detach=function(){return this.lock(),this.qr.detach(),this.Qr.detach(),this.unlock(),this},t}(),Ur=function(t,n){for(var i=0,r=t.length-1;i<=r;){var e=i+(r-i>>1),u=t[e];if(n<u)r=e-1;else{if(!(u<n))return e;i=e+1}}return-1},Fr=2*Math.PI,Gr=.5*Math.PI,Hr=function(t,n,i,r){return t*i+n*r},zr=function(t,n){return Math.sqrt(Hr(t,n,t,n))},Vr=function(t,n,i,r){return t*r-n*i},Wr=function(t,n,i,r,e,u,s,h,o,a){var c=a.center;c[0]=t,c[1]=n;var f=a.axis1;f[0]=i,f[1]=r;var l=a.axis2;l[0]=e,l[1]=u;var v=a.angle;return v[0]=s,v[1]=h,v[2]=o,a},Xr=function(t,n){var i=t.center,r=t.axis1,e=t.axis2,u=t.angle;return Wr(i[0],i[1],r[0],r[1],e[0],e[1],u[0],u[1],u[2],n)},Kr=function(t,n){for(var i=t.length,r=0;r<i;++r)n[r]=t[r];return n.length!==i&&(n.length=i),n},Yr=function(){function t(){}return t.set=function(t,n,i,r,e,u,s,h,o,a,c,f,l,v,b){for(var d=Math.max(Math.abs(n-i),Math.abs(s-h)),g=f?Math.max(1,Math.round(c*(d/Gr))):c,m=l?g+1:g,w=0;w<m;++w){var p=w/g,O=1-p,D=p,E=O*n+D*i,M=Math.cos(E),S=Math.sin(E),T=t[0]+M*r[0]+S*e[0],j=t[1]+M*r[1]+S*e[1],N=O*s+D*h,I=Math.cos(N),C=Math.sin(N),A=u[0]+I*o[0]+C*a[0],R=u[1]+I*o[1]+C*a[1],L=Gr*p,y=Math.cos(L),k=Math.sin(L),x=y*y,B=k*k,_=x*T+B*A,P=x*j+B*R;v[++b]=_,v[++b]=P}return b},t.interpolate=function(t,n,i,r,e,u,s,h){var o=h.values,a=h.segments;if(t<=2)return Kr(n,o),Kr(i,a),h;var c=this.WORK_P0||{center:[0,0],axis1:[0,0],axis2:[0,0],angle:[0,0,0]},f=this.WORK_P1||{center:[0,0],axis1:[0,0],axis2:[0,0],angle:[0,0,0]},l=this.WORK_P2||{center:[0,0],axis1:[0,0],axis2:[0,0],angle:[0,0,0]};this.WORK_P0=c,this.WORK_P1=f,this.WORK_P2=l;var v=-1,b=-1;if(e){r(0,t,n,c),Xr(c,f);for(var d=1;d<t;++d){if(r(d,t,n,l),0<=Ur(i,d)){var g=d-1<<1;o[++v]=n[g+0],o[++v]=n[g+1],a[++b]=v+1>>1}else v=this.set(f.center,f.angle[1],f.angle[2],f.axis1,f.axis2,l.center,l.angle[0],l.angle[1],l.axis1,l.axis2,u,s,!1,o,v);var m=f;f=l,l=m}0<=Ur(i,0)?(g=t-1<<1,o[++v]=n[g+0],o[++v]=n[g+1],a.unshift(0),b+=1):v=this.set(f.center,f.angle[1],f.angle[2],f.axis1,f.axis2,c.center,c.angle[0],c.angle[1],c.axis1,c.axis2,u,s,!1,o,v)}else{r(1,t,n,c),0<=Ur(i,1)?(o[++v]=n[0],o[++v]=n[1],a[++b]=1):v=this.set(c.center,c.angle[0],c.angle[1],c.axis1,c.axis2,c.center,c.angle[0],c.angle[1],c.axis1,c.axis2,u,s,!1,o,v),Xr(c,f),d=2;for(var w=t-1;d<w;++d)r(d,t,n,l),0<=Ur(i,d)?(g=d-1<<1,o[++v]=n[g+0],o[++v]=n[g+1],a[++b]=v+1>>1):v=this.set(f.center,f.angle[1],f.angle[2],f.axis1,f.axis2,l.center,l.angle[0],l.angle[1],l.axis1,l.axis2,u,s,!1,o,v),m=f,f=l,l=m;0<=Ur(i,t-1)?(g=t-2<<1,o[++v]=n[g+0],o[++v]=n[g+1],a[++b]=v+1>>1):v=this.set(f.center,f.angle[1],f.angle[2],f.axis1,f.axis2,f.center,f.angle[1],f.angle[2],f.axis1,f.axis2,u,s,!0,o,v)}return v+=1,o.length!==v&&(o.length=v),b+=1,a.length!==b&&(a.length=b),h},t.toCircle=function(t,n,i,r){var e=(0<t?t-1:n-1)<<1,u=t<<1,s=(t<n-1?t+1:0)<<1,h=i[e+0],o=i[e+1],a=i[u+0],c=i[u+1],f=i[s+0],l=i[s+1],v=a-h,b=c-o,d=f-a,g=l-c,m=h+.5*v,w=o+.5*b,p=a+.5*d,O=c+.5*g,D=-b,E=+v,M=-g,S=+d,T=Vr(D,E,M,S);if(Math.abs(T)<.001){if(0<=Hr(v,b,d,g)||n<=2){var j=.01,N=Math.sin(j),I=zr(v,b),C=zr(d,g);return Wr(a,c,0,0,d/N,g/N,-j*I/C,0,j,r)}T=.001}var A=(S*(p-m)+M*(w-O))/T,R=m+A*D,L=w+A*E,y=a-R,k=c-L,x=-k,B=+y,_=f-R,P=l-L,U=Math.atan2(Hr(x,B,_,P),Hr(y,k,_,P)),F=h-R,G=o-L,H=Math.atan2(Hr(x,B,F,G),Hr(y,k,F,G));return 0<H*U&&(Math.abs(H)<Math.abs(U)&&(0<U?U-=Fr:U+=Fr),Math.abs(U)<Math.abs(H)&&(0<H?H-=Fr:H+=Fr)),Wr(R,L,y,k,x,B,H,0,U,r)},t.toEllipse=function(t,n,i,r){var e=(0<t?t-1:n-1)<<1,u=t<<1,s=(t<n-1?t+1:0)<<1,h=i[e+0],o=i[e+1],a=i[u+0],c=i[u+1],f=i[s+0],l=i[s+1],v=h-a,b=o-c,d=f-a,g=l-c;if(n<=2){var m=.01,w=Math.sin(m);return Wr(a,c,0,0,d/w,g/w,-m,0,m,r)}for(var p=zr(v,b),O=zr(d,g),D=Hr(v,b,d,g)/(p*O),E=Math.acos(D),M=.5*E,S=.25*E,T=0,j=0,N=0,I=0,C=Math.max(p,O),A=Math.min(p,O),R=0;R<16;++R){var L=.5*M,y=E-L;T=C*Math.sin(L),j=C*Math.cos(L),N=A*Math.sin(y),1<(1-(I=A*Math.cos(y))/j)*(1-I/j)+N*N/(T*T)?M+=S:M-=S,S*=.5}var k=Math.asin(Math.min(N/T,1));if(p<O){var x=d/O,B=g/O,_=void 0,P=void 0;return 0<Vr(v,b,d,g)?(_=+B,P=-x):(_=-B,P=+x),Wr(z=a-(G=(U=-j*j/O)*x+(F=-j*T/O)*_),V=c-(H=U*B+F*P),G,H,f-z,l-V,-k,0,Gr,r)}var U,F,G,H,z,V,W=v/p,X=b/p;return _=void 0,P=void 0,Vr(v,b,d,g)<0?(_=+X,P=-W):(_=-X,P=+W),Wr(z=a-(G=(U=-j*j/p)*W+(F=-j*T/p)*_),V=c-(H=U*X+F*P),G,H,-(h-z),-(o-V),-Gr,0,k,r)},t.toHybrid=function(n,i,r,e){var u=t.toCircle(n,i,r,e),s=u.angle[0],h=u.angle[2],o=Math.min(s,h),a=Math.max(s,h);return o<-Gr||Gr<a?t.toEllipse(n,i,r,e):u},t}(),Jr=function(t,n,i,r,e){return Yr.interpolate(t,n,i,Yr.toHybrid,!!(r&F.CLOSED),Y.CURVE_SEGMENT_COUNT,!0,e),e.length=e.values.length>>1,e.style=r,e},Zr=function(t,n){if(2<=t.length){for(var i=t[0],r=t[1],e=i,u=r,s=2,h=t.length;s<h;s+=2){var o=t[s],a=t[s+1];i=Math.min(i,o),r=Math.min(r,a),e=Math.max(e,o),u=Math.max(u,a)}n[0]=i,n[1]=r,n[2]=e,n[3]=u}else n[0]=0,n[1]=0,n[2]=0,n[3]=0;return n},qr=function(){function n(n){var i=this;this.p=n,this.Xr=0,this.$r=!1,this.te=!1,this.ne=!1,this.Nt=J.NONE,this.j=new t.ObservablePoint((function(){i.onSizeChange()}),void 0,.15*Y.SIZE_X,.15*Y.SIZE_Y),this.C=this.newFill(),this.ie=0}return n.prototype.newFill=function(){return new Z(this,!0,Y.FILL_COLOR,1)},n.prototype.lock=function(){return this.Xr+=1,1===this.Xr&&(this.$r=!1,this.te=!1,this.ne=!1),this},n.prototype.unlock=function(){return this.Xr-=1,0===this.Xr&&(this.$r?this.onTypeChange():this.te?this.onSizeChange():this.ne&&this.onFillChange(),this.$r=!1,this.te=!1,this.ne=!1),this},Object.defineProperty(n.prototype,"type",{get:function(){return this.Nt},set:function(t){this.Nt!==t&&(this.Nt=t,this.onTypeChange())},enumerable:!1,configurable:!0}),n.prototype.onTypeChange=function(){0<this.Xr?this.$r=!0:this.p.onTypeChange()},Object.defineProperty(n.prototype,"size",{get:function(){return this.j},enumerable:!1,configurable:!0}),n.prototype.onSizeChange=function(){0<this.Xr?this.te=!0:this.p.onSizeChange()},Object.defineProperty(n.prototype,"transform",{get:function(){return this.updateTransform()},enumerable:!1,configurable:!0}),n.prototype.updateTransform=function(){var n=this.I;null==n&&(n=new t.Matrix,this.I=n);var i=this.p.parent,r=i.id;if(this.ie!==r){this.ie=r;var e=i.formatted;2<=e.length?this.toTransform(e.values,n):n.identity()}return n},n.prototype.toTransformMatrix=function(t,n,i,r,e){var u=t-i,s=n-r,h=u*u+s*s;if(1e-5<h){var o=1/Math.sqrt(h),a=u*o,c=s*o;e.set(c,-a,-a,-c,t,n)}else e.set(1,0,0,1,t,n);return e},Object.defineProperty(n.prototype,"fill",{get:function(){return this.C},enumerable:!1,configurable:!0}),n.prototype.onFillChange=function(){0<this.Xr?this.ne=!0:this.p.onFillChange()},n.prototype.updateUploaded=function(){this.onFillChange()},n.prototype.copy=function(t){var n=t.size;return this.set(t.type,n.x,n.y),this},n.prototype.set=function(t,n,i){return this.lock(),null!=t&&(this.type=t),this.size.set(n,i),this.unlock(),this},n.prototype.serialize=function(t){var n=this.j,i=this.C.serialize(t);return t.addResource("[".concat(this.Nt,",").concat(n.x,",").concat(n.y,",").concat(i,"]"))},n.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getExtension(t);null==r&&(r=JSON.parse(i[t]),n.setExtension(t,r)),this.lock(),this.type=r[0],this.j.set(r[1],r[2]),this.C.deserialize(r[3],n),this.unlock()}},n}(),Qr=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.toTransform=function(t,n){var i=t.length;return 4<=i?this.toTransformMatrix(t[i-2],t[i-1],t[i-4],t[i-3],n):(n.identity(),n)},n}(qr),$r=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.toTransform=function(t,n){return 4<=t.length?this.toTransformMatrix(t[0],t[1],t[2],t[3],n):(n.identity(),n)},n}(qr),te=function(){function t(t){this.p=t,this.Xr=0,this.$r=!1,this.te=!1,this.ne=!1,this.Qr=new Qr(this),this.qr=new $r(this)}return t.prototype.lock=function(){return this.Xr+=1,1===this.Xr&&(this.$r=!1,this.te=!1,this.ne=!1),this},t.prototype.unlock=function(){return this.Xr-=1,0===this.Xr&&(this.$r?this.onTypeChange():this.te?this.onSizeChange():this.ne&&this.onFillChange(),this.$r=!1,this.te=!1,this.ne=!1),this},Object.defineProperty(t.prototype,"parent",{get:function(){return this.p},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"head",{get:function(){return this.Qr},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tail",{get:function(){return this.qr},enumerable:!1,configurable:!0}),t.prototype.onTypeChange=function(){0<this.Xr?this.$r=!0:this.p.onMarkerTypeChange()},t.prototype.onSizeChange=function(){0<this.Xr?this.te=!0:this.p.onMarkerSizeChange()},t.prototype.onFillChange=function(){0<this.Xr?this.ne=!0:this.p.onMarkerFillChange()},t.prototype.copy=function(t){return this.lock(),this.Qr.copy(t.head),this.qr.copy(t.tail),this.unlock(),this},t.prototype.serialize=function(t){var n=this.Qr.serialize(t),i=this.qr.serialize(t);return t.addResource("[".concat(n,",").concat(i,"]"))},t.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getExtension(t);null==r&&(r=JSON.parse(i[t]),n.setExtension(t,r)),this.lock(),this.Qr.deserialize(r[0],n),this.qr.deserialize(r[1],n),this.unlock()}},t}(),ne=function(){function n(n){this.p=n,this.re=0,this.L=[],this.k=[];var i=n.size,r=i.x,e=i.y;this.ee=new t.Point(r,e),this.ue=new t.Point(r,e),this.R=0,this.B=F.NONE,this.se=-1}return Object.defineProperty(n.prototype,"length",{get:function(){return this.L.length>>1},enumerable:!1,configurable:!0}),n.prototype.toFitted=function(){this.he=void 0;var t=this.p.size;this.ue.copyFrom(t),this.ee.copyFrom(t)},n.prototype.fit=function(){var t=this.ue,n=this.p.size,i=n.x,r=n.y,e=1e-5;if(e<Math.abs(i-t.x)||e<Math.abs(r-t.y)){t.set(i,r);var u=this.ee,s=e<Math.abs(u.x),h=e<Math.abs(u.y);if(s||h){var o=s?i/u.x:1,a=h?r/u.y:1,c=this.L,f=this.he;if(null==f){f=[],this.he=f;for(var l=0,v=c.length;l<v;l+=2){var b=c[l],d=c[l+1];c[l]=b*o,c[l+1]=d*a,f.push(b,d)}}else for(l=0,v=c.length;l<v;l+=2)c[l]=f[l]*o,c[l+1]=f[l+1]*a;if(this.R===this.se){var g=this.oe;if(null!=g){var m=g.values,w=this.ae;if(null==w)for(w=[],this.ae=w,l=0,v=m.length;l<v;l+=2)b=m[l],d=m[l+1],m[l]=b*o,m[l+1]=d*a,w.push(b,d);else for(l=0,v=m.length;l<v;l+=2)m[l]=w[l]*o,m[l+1]=w[l+1]*a;var p=g.boundary,O=this.ce;if(null==O)for(O=[0,0,0,0],this.ce=O,l=0,v=p.length;l<v;l+=2)b=p[l],d=p[l+1],p[l]=b*o,p[l+1]=d*a,O[l]=b,O[l+1]=d;else for(l=0,v=p.length;l<v;l+=2)p[l]=O[l]*o,p[l+1]=O[l+1]*a;this.se+=1}}this.R+=1}}},Object.defineProperty(n.prototype,"id",{get:function(){return this.fit(),this.R},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"values",{get:function(){return this.fit(),this.L},set:function(t){this.set(t,void 0,void 0)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"segments",{get:function(){return this.k},set:function(t){this.set(void 0,t,void 0)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"style",{get:function(){return this.B},set:function(t){this.set(void 0,void 0,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"marker",{get:function(){var t=this.A;return null==t&&(t=this.newMarker(),this.A=t),t},enumerable:!1,configurable:!0}),n.prototype.getMarker=function(){return this.A},n.prototype.newMarker=function(){return new te(this)},n.prototype.onMarkerTypeChange=function(){var t=this.p;t.uploaded=void 0,t.toDirty()},n.prototype.onMarkerSizeChange=function(){this.p.updateUploaded()},n.prototype.onMarkerFillChange=function(){this.p.updateUploaded()},Object.defineProperty(n.prototype,"formatter",{get:function(){return this.fe||null},set:function(t){this.fe!==t&&(this.se=-1,this.fe=t,this.toDirty(!0))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"formatted",{get:function(){this.fit();var t=this.R,n=this.oe;if(this.se!==t){this.se=t;var i=this.B,r=this.fe;if(null==r&&i&F.CURVE&&(r=Jr),null!=r){null==n&&(n={length:0,values:[],segments:[],boundary:[0,0,0,0],style:F.NONE});var e=this.he,u=this.k;if(null!=e){r(e.length>>1,e,u,i,n),Zr(n.values,n.boundary);var s=n.values,h=s.splice(0);this.ae=h;var o=n.boundary,a=[o[0],o[1],o[2],o[3]];this.ce=a,this.toScaled(s,h,o,a)}else{var c=this.L;r(c.length>>1,c,u,i,n),Zr(n.values,n.boundary),this.ae=void 0,this.ce=void 0}}else n=void 0,this.ae=void 0,this.ce=void 0;this.oe=n}return n||this},enumerable:!1,configurable:!0}),n.prototype.toScaled=function(t,n,i,r){var e=this.ue,u=this.ee,s=1e-5,h=s<Math.abs(u.x),o=s<Math.abs(u.y);if(h||o){for(var a=h?e.x/u.x:1,c=o?e.y/u.y:1,f=0,l=n.length;f<l;f+=2)t[f]=n[f]*a,t[f+1]=n[f+1]*c;for(f=0,l=r.length;f<l;f+=2)i[f]=r[f]*a,i[f+1]=r[f+1]*c}},n.prototype.copy=function(t){this.set(t.values,t.segments,t.style);var n=t.getMarker();return n&&this.marker.copy(n),this},n.prototype.set=function(t,n,i){var r=!1,e=!1,u=this.B,s=u&F.FORMATTER_MASK,h=this.fe;if(null!=t){var o=this.L,a=this.re,c=t.length,f=Math.min(c,a);if(this.toFitted(),o!==t){for(var l=0;l<f;++l)o[l]=t[l];for(l=f;l<c;++l)o.push(t[l]);a!==c?(o.length=c,this.re=c,r=!0):null!=h||s?r=!0:e=!0}else a!==c?(this.re=c,r=!0):null!=h||s?r=!0:e=!0}if(null!=n){var v=this.k;if(v!==n){var b=n.length;for(f=Math.min(v.length,b),l=0;l<f;++l)v[l]=n[l];for(l=f;l<b;++l)v.push(n[l]);v.length!==b&&(v.length=b)}null!=h||s?r=!0:e=!0}return null!=i&&u!==i&&(s!==(i&F.FORMATTER_MASK)||(null!=h||s)&&(u&F.CLOSED)!=(i&F.CLOSED)?r=!0:e=!0,this.B=i),(e||r)&&this.toDirty(r),this},n.prototype.toDirty=function(t){if(t){this.R+=1;var n=this.p,i=n.uploaded;i?i.isCompatible(n)?n.updateUploaded():(n.uploaded=void 0,n.toDirty()):n.updateUploaded()}else this.R+=1,this.p.updateUploaded()},n.prototype.clone=function(t){return new n(t).copy(this)},n.prototype.toPoints=function(n){for(var i=[],r=this.values,e=0,u=r.length;e<u;e+=2){var s=new t.Point(r[e+0],r[e+1]);i.push(n.apply(s,s))}return i},n.prototype.serialize=function(t){var n=JSON.stringify(this.L),i=JSON.stringify(this.k),r=this.B,e=-1,u=this.A;return u&&(e=u.serialize(t)),t.addResource("[".concat(n,",").concat(i,",").concat(r,",").concat(e,"]"))},n.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getExtension(t);null==r&&(r=JSON.parse(i[t]),n.setExtension(t,r)),this.set(r[0],r[1],r[2]);var e=r[3];null!=e&&0<=e&&this.marker.deserialize(e,n)}},n.prototype.calcHitPointAbs=function(t,i,r,e,u,s,h,o){var a=this.formatted,c=a.length;if(2<=c){var f=a.values,l=a.segments,v=a.style,b=0,d=c;if(s){var g=n.WORK_RANGE;s(t,i,u,f,g),b=g[0],d=g[1]}for(var m=b,w=Math.min(d,c-1);m<w;++m){var p;if(Ur(l,m+1)<0&&h(t,i,f[0+(p=m<<1)],f[p+1],f[p+2],f[p+3],m,u,o))return!0}if(2<c&&c<=d&&v&F.CLOSED&&Ur(l,0)<0&&h(t,i,f[0+(p=(m=c-1)<<1)],f[p+1],f[0],f[1],m,u,o))return!0}return!1},n.WORK_RANGE=[0,0],n}(),ie=function(){function t(t,n){this.p=t,this.R=0,this.L=[],this.Xr=0,this.Ut=!1,this.Z=n}return t.prototype.lock=function(){this.Xr+=1,1===this.Xr&&(this.Ut=!1)},t.prototype.unlock=function(){this.Xr-=1,0===this.Xr&&(this.Ut&&this.onChange(),this.Ut=!1)},Object.defineProperty(t.prototype,"id",{get:function(){return this.R},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"values",{get:function(){return this.L},set:function(t){this.set(t)},enumerable:!1,configurable:!0}),t.prototype.set=function(t){if(null!=t){if(this.R+=1,this.L!==t){for(var n=t.length,i=this.L,r=0;r<n;++r)i[r]=t[r];i.length=n}this.onChange()}return this},t.prototype.copy=function(t){return this.set(t.values)},t.prototype.serialize=function(t){return t.addResource(JSON.stringify(this.L))},t.prototype.deserialize=function(t,n,i){var r=i.resources;if(0<=t&&t<r.length){var e=i.getExtension(t);null==e&&(e=JSON.parse(r[t]),i.setExtension(t,e)),this.set(e)}},t.prototype.onChange=function(){0<this.Xr?this.Ut=!0:this.Z()},t}(),re=function(t){function n(n){void 0===n&&(n=r.CONNECTOR_LINE);var i=t.call(this,n)||this;i.le=0,i.ve=0,i.be=0,i.de=0,i.ge=0,i.me=0,i.we=0,i.Xr=0,i.Ut=!1;var e=.5*Y.SIZE_X,u=.5*Y.SIZE_Y;i.gt=new ne(i).set([-e,-u,+e,+u]);var s=function(){i.onChange()};return i.Pr=new Pr(i,s),i.pe=new ie(i,s),i}return B(n,t),n.prototype.lock=function(){this.Xr+=1,1===this.Xr&&(this.Ut=!1)},n.prototype.unlock=function(){this.Xr-=1,0===this.Xr&&(this.Ut&&this.onChange(),this.Ut=!1)},Object.defineProperty(n.prototype,"points",{get:function(){return this.gt},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"edge",{get:function(){return this.Pr},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"body",{get:function(){return this.pe},enumerable:!1,configurable:!0}),n.prototype.onAttach=function(){t.prototype.onAttach.call(this),this.Pr.attach()},n.prototype.onDetach=function(){this.Pr.detach(),t.prototype.onDetach.call(this)},n.prototype.onChange=function(){var t;if(0<this.Xr)this.Ut=!0;else{var i=this.Pr,r=i.tail,e=r.localId,u=r.normalId,s=r.margin,h=i.head,o=h.localId,a=h.normalId,c=h.margin,f=this.pe,l=f.id;if(this.le!==e||this.ve!==u||this.be!==s||this.de!==o||this.ge!==a||this.me!==c||this.we!==l){this.le=e,this.ve=u,this.be=s,this.de=o,this.ge=a,this.me=c,this.we;var v=this.transform,b=v.position,d=b.x,g=b.y,m=this.gt,w=m.values;this.fillPoints(r,s,h,c,f,d,g,w);var p=null!==(t=n.WORK_BOUNDARY)&&void 0!==t?t:n.WORK_BOUNDARY=[0,0,0,0];Zr(w,p);for(var O=.5*(p[2]+p[0]),D=.5*(p[3]+p[1]),E=p[2]-p[0],M=p[3]-p[1],S=0,T=w.length;S<T;S+=2)w[S+0]-=O,w[S+1]-=D;this.disallowUploadedUpdate(),b.set(d+O,g+D),v.scale.set(1,1),v.rotation=0,v.skew.set(0,0),this.size.set(E,M),m.toFitted(),m.set(w),this.allowUploadedUpdate()}}},n.prototype.fillPoints=function(t,n,i,r,e,u,s,h){var o=1e-6,a=t.local,c=a.x-u,f=a.y-s,l=i.local,v=l.x-u,b=l.y-s,d=e.values,g=d.length;if(h[0]=c,h[1]=f,0<g)for(var m=.5*(v+c),w=.5*(b+f),p=v-c,O=b-f,D=Math.atan2(O,p),E=Math.cos(D),M=Math.sin(D),S=Math.sqrt(p*p+O*O),T=0;T<g;T+=2){var j=d[T+0],N=d[T+1];h[T+2]=m+(E*j-M*N)*S,h[T+3]=w+(E*N+M*j)*S}if(h[2+g]=v,h[3+g]=b,0!==n&&o<(p=h[2]-c)*p+(O=h[3]-f)*O){var I=n/Math.sqrt(p*p+O*O);h[0]=c+p*I,h[1]=f+O*I}0!==r&&o<(p=h[0+g]-v)*p+(O=h[1+g]-b)*O&&(I=r/Math.sqrt(p*p+O*O),h[2+g]=v+p*I,h[3+g]=b+O*I),h.length=g+4},n.prototype.copy=function(i,r){return void 0===r&&(r=st.ALL),t.prototype.copy.call(this,i,r),i instanceof n&&(this.Pr.copy(i.edge),this.pe.copy(i.body)),this},n.prototype.clone=function(){return new(0,this.constructor)(this.type).copy(this)},n.prototype.serialize=function(n){var i=t.prototype.serialize.call(this,n),r=this.Pr.serialize(n),e=this.pe.serialize(n),u=this.gt.serialize(n);return i[15]=n.addResource("[".concat(r,",").concat(u,",").concat(e,"]")),i},n}(Xt),ee=function(){function t(){}return t.isConnector=function(t){return t instanceof re},t.newMapping=function(n,i,r){var e;null==r&&(r=null!==(e=t.Oe)&&void 0!==e?e:t.Oe=new Map).clear();for(var u=0,s=n.length;u<s;++u){var h=n[u],o=i[u];r.set(h,o),this.newMapping(h.children,o.children,r)}return r},t.moveAll=function(t,n,i,r,e){for(var u=0,s=i.length;u<s;++u){var h=i[u],o=r[u];if(this.isConnector(h)&&this.isConnector(o)){var a=h.edge,c=o.edge,f=a.head,l=f.acceptor.shape;if(l){null==e&&(e=this.newMapping(t,n));var v=e.get(l);if(v){var b=c.head;b.detach(),b.set(v),b.attach(),v.connector.remove(f)}}var d=a.tail,g=d.acceptor.shape;if(g){null==e&&(e=this.newMapping(t,n));var m=e.get(g);if(m){var w=c.tail;w.detach(),w.set(m),w.attach(),m.connector.remove(d)}}}e=this.moveAll(t,n,h.children,o.children,e)}return e},t.move=function(t,n){var i=t.children,r=n.children;this.moveAll(i,r,i,r)},t}(),ue=function(){function n(n,i,r,e,u){this.id=n,this.ref=0;var s=u.resolution;this.frame=new t.Rectangle(0,0,i*s,r*s),this.texture=new t.Texture(u,new t.Rectangle(0,0,1,1)),this.width=i,this.height=r,this.strokeWidth=e}return n.prototype.applyFrame=function(){var t=1/this.texture.baseTexture.resolution;this.texture.frame.x=this.frame.x*t,this.texture.frame.y=this.frame.y*t,this.texture.frame.width=this.width,this.texture.frame.height=this.height,this.texture.updateUvs(),this.texture.emit("update",this)},n.prototype.destroy=function(){this.texture.destroy()},n}(),se=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.render=function(t){},n}(ue),he=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.render=function(t){var n=this.frame;t.save(),t.fillStyle="#ffffff",t.fillRect(n.x-1,n.y-1,n.width+2,n.height+2),t.restore()},n}(ue),oe=function(){function n(n){var i=this.ir=document.createElement("canvas");i.width=i.height=256;var r=this.De=t.BaseTexture.from(i,{mipmap:t.MIPMAP_MODES.OFF,resolution:n});this.Ee={},this.Me=[],this.Se={empty:new se("empty",10,10,0,r),white:new he("white",10,10,0,r)},this.vn=!0}return n.prototype.updateFrames=function(t,n){for(var i=4,r=4,e=0,u=0,s=n.length;u<s;++u){var h=n[u];t<i+h.frame.width+4&&(i=4,r+=e+4,e=0),h.frame.x=0|i,h.frame.y=0|r,i+=h.frame.width+4,e=Math.max(e,h.frame.height)}for(var o=r+e+4,a=256;a<o;)a<<=1;return Math.min(4096,a)},n.prototype.renderFrames=function(t,n,i){var r=this.ir;r.width=t,r.height=n;var e=r.getContext("2d");if(null!=e)for(var u=0,s=i.length;u<s;++u)i[u].render(e)},n.prototype.applyFrames=function(t){for(var n=0,i=t.length;n<i;++n)t[n].applyFrame()},n.prototype.calcCanvasWidth=function(t){for(var n=128,i=t.length-1;0<=i;--i)for(var r=t[i],e=Math.max(r.frame.width,r.frame.height);n<e;)n<<=1;return Math.min(4096,n<<1)},n.prototype.cleanup=function(t){t.sort(n.ITEM_COMPARATOR);for(var i=t.length-1;0<=i;--i)if(0<t[i].ref)return void(t.length=i+1);t.length=0},n.prototype.begin=function(){for(var t=this.Me,n=0,i=t.length;n<i;++n)t[n].ref=0;this.vn=!1},n.prototype.end=function(){for(var t=this.Ee,n=this.Me,i=0,r=n.length;i<r;++i){var e=n[i];e.ref<=0&&(e.id in this.Se||e.destroy(),delete t[e.id],this.vn=!0)}},n.prototype.repack=function(t){if(!0===t||this.vn){this.vn=!1;var n=this.Me;this.cleanup(n);var i=this.calcCanvasWidth(n),r=this.updateFrames(i,n);this.renderFrames(i,r,n),this.De.setRealSize(i,r),this.applyFrames(n)}},n.prototype.get=function(t){var n=this.Ee[t];if(null!=n)return n.ref+=1,n;var i=this.Se[t];return null!=i?(this.set(t,i),i):null},n.prototype.set=function(t,n){var i=this.Ee[t];return n.ref+=1,this.Ee[t]=n,this.Me.push(n),this.vn=!0,i},n.prototype.toDirty=function(){this.vn=!0},n.prototype.getDefaultTexture=function(){return this.get("white").texture},n.prototype.getBaseTexture=function(){return this.De},n.prototype.release=function(t){var n=this.Ee,i=n[t];null!=i&&(i.ref-=1,i.ref<=0&&(i.id in this.Se||i.destroy(),delete n[t],this.vn=!0))},n.ITEM_COMPARATOR=function(t,n){return t.ref<=0?n.ref<=0?0:1:n.ref<=0||t.frame.height<n.frame.height?-1:n.frame.height<t.frame.height?1:t.frame.width-n.frame.width},n}(),ae=function(t){function n(n,i){var r=t.call(this,n.id,n.width/i.resolution,n.height/i.resolution,0,i)||this;return r.canvas=n.canvas,r}return B(n,t),n.prototype.render=function(t){var n=this.canvas;if(null!=n){var i=this.frame;t.drawImage(n,i.x,i.y,i.width,i.height)}},n}(ue),ce="!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~",fe=function(t,n){this.x=t,this.y=n},le=function(t,n,i,r,e){this.ref=1,this.life=10,this.character=t,this.x=0,this.y=0,this.width=i,this.height=r,this.advance=n,this.origin=new fe(0,0),this.type=e},ve={RESERVED:1,NON_BREAKING:2,SPACE:4,SPACE_R:5,SPACE_NB:6,SPACE_RNB:7,LETTER:8,LETTER_R:9,LETTER_NB:10,LETTER_RNB:11},be=function(){function t(){var t=this;this.Te=null,this.je=null,this.Ne=null,this.Ie=NaN,this.Ce=NaN,this.Ae=NaN,this.Re=NaN,this.Le=null,this.ye=null;var n=this.ir=document.createElement("canvas");n.width=64,n.height=64,this.ke=function(t){t.preventDefault()},this.xe=function(){t.restore()},this.Be=function(){t.destroy()},n.addEventListener("webglcontextlost",this.ke,!1),n.addEventListener("webglcontextrestored",this.xe,!1),window.addEventListener("unload",this.Be,!1)}return t.prototype.init=function(){var t=this.ir;if(null!=t&&(null==this.Te||this.Te.isContextLost())){var n={alpha:!0,antialias:!1,depth:!1,stencil:!1,premultipliedAlpha:!1},i=t.getContext("webgl",n)||t.getContext("experimental-webgl",n);this.Te=i,null!=i&&(i.clearColor(1,1,1,0),this.makeVertexBuffer(),this.makeUvBuffer(),this.makeShaders(),this.je=null)}return this},t.prototype.restore=function(){this.init()},t.prototype.getCanvas=function(){return this.ir},t.prototype.getShader=function(t,n,i){var r=i?t.createShader(t.FRAGMENT_SHADER):t.createShader(t.VERTEX_SHADER);return null==r||(t.shaderSource(r,n),t.compileShader(r),t.getShaderParameter(r,t.COMPILE_STATUS))?r:(console&&console.error("Failed to compile the shader: ".concat(t.getShaderInfoLog(r))),null)},t.prototype.makeShaders=function(){var t=this.Te;if(null!=t&&!0!==t.isContextLost()){var n=this.getShader(t,"\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nvarying mediump vec2 vTextureCoord;\nvoid main(void) {\n\tgl_Position = vec4(aVertexPosition, 0.0, 1.0);\n\tvTextureCoord = aTextureCoord;\n}\n",!1);if(null!=n){var i=this.getShader(t,"\nprecision mediump float;\n\nvarying mediump vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform vec2 uSize;\n\nfloat calcDistance( float x, float y, float dx, float dy ) {\n\tfloat xd = x + dx;\n\tfloat yd = y + dy;\n\tfloat u = xd / uSize.x;\n\tfloat v = yd / uSize.y;\n\tfloat ul = (xd - 1.0) / uSize.x;\n\tfloat vt = (yd - 1.0) / uSize.y;\n\n\tfloat m = texture2D(uSampler, vec2(u , v )).a;\n\tfloat l = texture2D(uSampler, vec2(ul, v )).a;\n\tfloat t = texture2D(uSampler, vec2(u , vt)).a;\n\tfloat ddx = -(0.5 - m) / (l - m);\n\tfloat ddy = -(0.5 - m) / (t - m);\n\tbool bl = min(l,m) < 0.5 && 0.5 <= max(l,m);\n\tbool bt = min(t,m) < 0.5 && 0.5 <= max(t,m);\n\treturn (\n\t\tbl ?\n\t\t(bt ?\n\t\t\tlength(vec2(dx + ddx * 0.5, dy + ddy * 0.5)) :\n\t\t\tlength(vec2(dx + ddx, dy))\n\t\t) :\n\t\t(bt ?\n\t\t\tlength(vec2(dx, dy + ddy)) :\n\t\t\t100.0\n\t\t)\n\t);\n}\n\nfloat calcDistancesY( float x, float y, float dx ) {\n\tfloat d = 100.0;\n\tfor( float dy=-6.0; dy<6.5; dy++ ) {\n\t\td = min( d, calcDistance( x, y, dx, dy ) );\n\t}\n\treturn d;\n}\n\nfloat calcDistances( float x, float y ) {\n\tfloat d = 100.0;\n\tfor( float dx=-6.0; dx<6.5; dx++ ) {\n\t\td = min( d, calcDistancesY( x, y, dx ) );\n\t}\n\treturn d;\n}\n\nvoid main(void) {\n\tfloat t = texture2D(uSampler, vTextureCoord).a;\n\tfloat x = vTextureCoord.x * uSize.x;\n\tfloat y = vTextureCoord.y * uSize.y;\n\tfloat d = min( 6.0, calcDistances( x, y ) ) / 12.0;\n\td = clamp( mix( 0.5 - d, 0.5 + d, step( 0.5, t ) ), 0.0, 1.0 );\n\tgl_FragColor = vec4(1.0, 1.0, 1.0, d);\n}\n",!0);if(null!=i){var r=this.Ne=t.createProgram();if(null!=r)return t.attachShader(r,n),t.attachShader(r,i),t.linkProgram(r),t.getProgramParameter(r,t.LINK_STATUS)?(t.deleteShader(n),t.deleteShader(i),t.useProgram(r),this.Ie=t.getAttribLocation(r,"aVertexPosition"),this.Ce=t.getAttribLocation(r,"aTextureCoord"),this.Ae=t.getUniformLocation(r,"uSampler"),this.Re=t.getUniformLocation(r,"uSize"),t.useProgram(null),r):(console&&console.error("Failed to link the program: ".concat(t.getError())),t.deleteShader(n),t.deleteShader(i),null);t.deleteShader(n),t.deleteShader(i)}else t.deleteShader(n)}}return null},t.prototype.destroyShaders=function(){var t=this.Te;if(null!=t&&!0!==t.isContextLost()){var n=this.Ne;null!=n&&(this.Ne=null,t.useProgram(null),t.deleteProgram(n))}},t.prototype.updateTexture=function(t){var n=this.Te,i=this.ir;if(null!=n&&!0!==n.isContextLost()&&null!=i){var r=t.width,e=t.height;i.width===r&&i.height===e||(i.width=r,i.height=e,n.viewport(0,0,r,e));var u=this.je;return null==u?(u=this.je=n.createTexture(),n.bindTexture(n.TEXTURE_2D,u),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,t),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.NEAREST),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.NEAREST),n.bindTexture(n.TEXTURE_2D,null)):(n.bindTexture(n.TEXTURE_2D,u),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,t),n.bindTexture(n.TEXTURE_2D,null)),u}return null},t.prototype.destroyTexture=function(){var t=this.Te,n=this.je;null!=t&&!0!==t.isContextLost()&&null!=n&&(this.je=null,t.bindTexture(t.TEXTURE_2D,null),t.deleteTexture(n))},t.prototype.makeVertexBuffer=function(){var t=this.Te;if(null!=t&&!0!==t.isContextLost()){var n=this.Le=t.createBuffer();return t.bindBuffer(t.ARRAY_BUFFER,n),t.bufferData(t.ARRAY_BUFFER,new Float32Array([-1,1,1,1,-1,-1,1,-1]),t.STATIC_DRAW),n}return null},t.prototype.destroyVertexBuffer=function(){var t=this.Te,n=this.Le;null!=t&&!0!==t.isContextLost()&&null!=n&&(this.Le=null,t.bindBuffer(t.ARRAY_BUFFER,null),t.deleteBuffer(n))},t.prototype.makeUvBuffer=function(){var t=this.Te;if(null!=t&&!0!==t.isContextLost()){var n=this.ye=t.createBuffer();return t.bindBuffer(t.ARRAY_BUFFER,n),t.bufferData(t.ARRAY_BUFFER,new Float32Array([0,0,1,0,0,1,1,1]),t.STATIC_DRAW),n}return null},t.prototype.destroyUvBuffer=function(){var t=this.Te,n=this.ye;null!=t&&!0!==t.isContextLost()&&null!=n&&(this.ye=null,t.bindBuffer(t.ARRAY_BUFFER,null),t.deleteBuffer(n))},t.prototype.render=function(){var t=this.Te,n=this.ir,i=this.Ne,r=this.Le,e=this.ye,u=this.je;if(null!=t&&!0!==t.isContextLost()&&null!=n&&null!=i&&null!=r&&null!=e&&null!=u){t.clear(t.COLOR_BUFFER_BIT),t.useProgram(i),t.bindBuffer(t.ARRAY_BUFFER,r);var s=this.Ie;t.enableVertexAttribArray(s),t.vertexAttribPointer(s,2,t.FLOAT,!1,0,0),t.bindBuffer(t.ARRAY_BUFFER,e);var h=this.Ce;t.enableVertexAttribArray(h),t.vertexAttribPointer(h,2,t.FLOAT,!1,0,0),t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,u),t.uniform1i(this.Ae,0),t.uniform2f(this.Re,n.width,n.height),t.drawArrays(t.TRIANGLE_STRIP,0,4),t.bindTexture(t.TEXTURE_2D,null),t.bindBuffer(t.ARRAY_BUFFER,null),t.useProgram(null)}},t.prototype.read=function(t){var n=this.Te,i=this.ir;if(null!=n&&!0!==n.isContextLost()&&null!=i){var r=i.width,e=i.height;t.width=r,t.height=e;var u=t.getContext("2d");null!=u&&u.drawImage(i,0,0)}},t.prototype.destroy=function(){this.destroyVertexBuffer(),this.destroyUvBuffer(),this.destroyShaders();var t=this.ir;null!=t&&(this.ir=null,t.removeEventListener("webglcontextlost",this.ke,!1),t.removeEventListener("webglcontextrestored",this.xe,!1),window.removeEventListener("unload",this.Be,!1));var n=this.Te;if(null!=n){this.Te=null;var i=n.getExtension("WEBGL_lose_context");null!=i&&i.loseContext()}},t.getInstance=function(){return null==t._e&&(t._e=new t),t._e},t._e=null,t}(),de=function(){function t(n){this.R="font-atlas:".concat(n),this.Pe=be.getInstance().init(),this.ir=document.createElement("canvas"),this.Ue={family:t.toFontFamily(n),size:32,italic:!1},this.Fe={},this.Ge=0,this.St=1,this.cn=1,this.vn=!0}return Object.defineProperty(t.prototype,"id",{get:function(){return this.R},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"font",{get:function(){return this.Ue},set:function(t){this.Ue.family=t.family,this.Ue.size=t.size,this.Ue.italic=t.italic},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.St},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.cn},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canvas",{get:function(){return this.ir},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"generator",{get:function(){return this.Pe},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"characters",{get:function(){return this.Fe},enumerable:!1,configurable:!0}),t.prototype.begin=function(){this.Ge=0;var t=this.Fe;for(var n in t)t[n].ref=0},t.prototype.end=function(){var t=this.Fe;for(var n in t){var i=t[n];i.ref<=0&&(i.life-=1,i.life<=0&&(delete t[n],this.vn=!0))}},t.prototype.addAscii=function(){this.addChar(" "," ",ve.SPACE_R),this.addChar("\t"," ",ve.SPACE_R),this.addChar("...","...",ve.LETTER_RNB);for(var t=0,n=ce.length;t<n;++t){var i=ce[t];this.addChar(i,i,ve.LETTER_RNB)}},t.prototype.addChar=function(t,n,i){var r=this.Fe;if(!this.isIgnored(n)){var e=r[t];null!=e?(e.ref<=0&&(this.Ge+=1),e.ref+=1):(r[t]=new le(n,0,1,1,i),this.Ge+=1,this.vn=!0)}},t.prototype.isIgnored=function(t){switch(t){case"\n":case"\r":case"\v":case"\f":case"…":return!0}return!1},t.prototype.add=function(t,n){void 0===n&&(n=ve.LETTER);for(var i=b.from(t);i.hasNext();){var r=i.next();this.addChar(r,r,n)}},t.prototype.get=function(t){return this.Fe[t]},t.prototype.update=function(){if(this.vn){var n=this.ir,i=this.Pe;if(null!=n&&null!=i){var r=n.getContext("2d");if(null!=r){this.vn=!1;var e=this.Ue,u=this.Fe,s=e.size+14,h=t.toPowerOf2(Math.ceil(Math.sqrt(this.Ge))*s);this.St=h;var o=(e.italic?"italic ":"")+e.size+"px "+e.family;r.font=o,r.textAlign="left",r.textBaseline="middle",r.lineWidth=0,r.lineCap="round",r.lineJoin="miter",r.miterLimit=0,r.fillStyle="#FFFFFF";var a=s>>1,c=0,f=0;for(var l in u){var v=u[l],b=r.measureText(v.character).width,d=Math.ceil(7+b+7),g=s;h<=c+d&&(c=0,f+=s),v.x=c,v.y=f,v.width=d,v.height=g,v.advance=b,v.origin.x=c+7,v.origin.y=f+a,c+=d}var m=this.cn=f+s;for(var l in n.width=h,n.height=m,r.font=o,r.textAlign="left",r.textBaseline="middle",r.lineWidth=0,r.lineCap="round",r.lineJoin="miter",r.miterLimit=4,r.fillStyle="#FFFFFF",r.clearRect(0,0,h,m),u)v=u[l],r.fillText(v.character,v.origin.x,v.origin.y);return i.updateTexture(n),i.render(),i.read(n),!0}}}return!1},Object.defineProperty(t.prototype,"length",{get:function(){return this.Ge},enumerable:!1,configurable:!0}),t.prototype.toJson=function(){return{width:this.St,height:this.cn,font:this.Ue,characters:this.Fe}},t.prototype.toString=function(){return JSON.stringify(this.toJson())},t.prototype.destroy=function(){null!=this.Pe&&(this.Pe=null),null!=this.ir&&(this.ir=null);var t=this.Fe;for(var n in t)delete t[n]},t.toFontFamily=function(n){return"auto"===n?t.getAutoFontFamily():n},t.toPowerOf2=function(t){for(var n=32;n<t;)n<<=1;return n},t.getAutoFontFamily=function(){return null==t.FONT_FAMILY_AUTO&&(t.FONT_FAMILY_AUTO=K.getInstance().get("DBase").getFontFamilly()),t.FONT_FAMILY_AUTO},t.FONT_FAMILY_AUTO=null,t}(),ge=function(){function t(){this.He={}}return t.prototype.begin=function(){var t=this.He;for(var n in t)t[n].begin()},t.prototype.end=function(){var t=this.He;for(var n in t){var i=t[n];0<i.length&&i.addAscii(),i.end(),i.length<=0&&(i.destroy(),delete t[n])}},t.prototype.add=function(t,n){var i=this.He[t];if(null!=i)i.add(n);else{var r=new de(t);r.add(n),this.He[t]=r}},t.prototype.get=function(t){var n=this.He[t];return null!=n?n:null},t.prototype.update=function(t){var n=this.He,i=t.getBaseTexture();for(var r in n){var e=n[r];if(e.update()){var u=e.id,s=t.get(u);if(null!=s){var h=e.width,o=e.height,a=i.resolution;s.frame.width=h,s.frame.height=o,s.width=h/a,s.height=o/a,t.toDirty()}else t.set(u,new ae(e,i))}}},t.prototype.destroy=function(){var t=this.He;for(var n in t)t[n].destroy();this.He={}},t}(),me=function(t){function n(n,i){var r=t.call(this,n.src,n.width/i.resolution,n.height/i.resolution,0,i)||this;return r.image=n,r}return B(n,t),n.prototype.render=function(t){var n=this.frame,i=n.x,r=n.y,e=n.width,u=n.height,s=this.image;t.drawImage(s,i,r,e,u),t.drawImage(s,0,0,1,u,i-1,r-1,1,u+2),t.drawImage(s,0,0,e,1,i,r-1,e,1),t.drawImage(s,e-1,0,1,u,i+e,r-1,1,u+2),t.drawImage(s,0,u-1,e,1,i,r+u,e,1)},n}(ue),we=function(t,n){this.texture=t,this.indexOffset=n},pe=function(){function t(){this.index=0,this.baseTexture=null,this.units=[]}return t.prototype.begin=function(){this.index=0,this.baseTexture=null},t.prototype.push=function(t,n){if(this.index<this.units.length){var i=this.units[this.index];i.texture=t,i.indexOffset=n}else this.units.push(new we(t,n));this.index+=1},t.prototype.end=function(){this.units.length!==this.index&&(this.units.length=this.index)},t.prototype.destroy=function(){this.units.length=0},t}(),Oe=function(){function n(t,n){var i=3*t,r=i;this.vertices=new Float32Array(2*r),this.ze=r,this.o=0,this.dn=null,this.clippings=new Float32Array(3*r),this.Ve=null,this.steps=new Float32Array(6*r),this.We=null,this.colorFills=new Float32Array(4*r),this.Xe=null,this.colorStrokes=new Float32Array(4*r),this.Ke=null,this.uvs=new Float32Array(2*r),this.mn=null;var e=r<=65535;this.indices=e?new Uint16Array(i):new Uint32Array(i),this.Ye=t,this.l=0,this.indexCountRequested=0,this.wn=null,this.Je=n,this.Ze=new pe,this.qe=null}return n.prototype.updateVertices=function(){var t=this.dn;t&&t.update()},n.prototype.updateClippings=function(){var t=this.Ve;t&&t.update()},n.prototype.updateSteps=function(){var t=this.We;t&&t.update()},n.prototype.updateColorFills=function(){var t=this.Xe;t&&t.update()},n.prototype.updateColorStrokes=function(){var t=this.Ke;t&&t.update()},n.prototype.updateUvs=function(){var t=this.mn;t&&t.update()},n.prototype.updateIndices=function(){var t=this.wn;t&&t.update()},n.prototype.getGeometry=function(){var n=this.qe;return null==n&&(this.dn=new t.Buffer(this.vertices,!1,!1),this.Ve=new t.Buffer(this.clippings,!1,!1),this.We=new t.Buffer(this.steps,!1,!1),this.Xe=new t.Buffer(this.colorFills,!1,!1),this.Ke=new t.Buffer(this.colorStrokes,!1,!1),this.mn=new t.Buffer(this.uvs,!1,!1),this.wn=new t.Buffer(this.indices,!1,!0),this.qe=n=(new t.Geometry).addIndex(this.wn).addAttribute("aPosition",this.dn,2).addAttribute("aClipping",this.Ve,3).addAttribute("aStep",this.We,2).addAttribute("aAntialias",this.We,4).addAttribute("aColorFill",this.Xe,4).addAttribute("aColorStroke",this.Ke,4).addAttribute("aUv",this.mn,2)),n},n.prototype.upload=function(){this.Je.geometry.bind(this.getGeometry())},n.prototype.render=function(n){var i=this.Je;i.geometry.bind(this.getGeometry());var r=this.Ze.units,e=r.length;if(0<e){for(var u=t.DRAW_MODES.TRIANGLES,s=null,h=r[0],o=0,a=3*h.indexOffset,c=0,f=t.Texture.WHITE,l=0,v=e-1;l<v;++l)s=h,o=a,c=(a=3*(h=r[l+1]).indexOffset)-o,f=s.texture||t.Texture.WHITE,0<c&&f.valid&&(n.uniforms.sampler=i.texture.bind(f),i.geometry.draw(u,c,o));c=3*this.l-a,f=h.texture||t.Texture.WHITE,0<c&&f.valid&&(n.uniforms.sampler=i.texture.bind(f),i.geometry.draw(u,c,a))}},n.prototype.isCompatible=function(t,n,i,r){return n.getBuffer()===this&&n.getVertexOffset()===i&&n.getIndexOffset()===r&&n.isCompatible(t)},n.prototype.update=function(t,n,i){var u=this.Ze;u.begin();for(var s=0,h=0,o=t.get();null!=o&&null!=(a=o.uploaded)&&this.isCompatible(o,a,s,h);o=t.next())if(a.update(o),a.buildUnit(u),s+=a.getVertexCount(),h+=a.getIndexCount(),i)return t.next(),u.end(),this.o=s,this.l=h,0<u.units.length;for(;null!=o;o=t.next()){var a,c=e[o.type]||e[r.GROUP];if(null==c)break;if(null==(a=c(this,o,s,h,n)))break;if(a.buildUnit(u),s+=a.getVertexCount(),h+=a.getIndexCount(),i){t.next();break}}return u.end(),this.o=s,this.l=h,0<u.units.length},n.prototype.check=function(t,n,i,r){return this.indexCountRequested=r,t+i<=this.ze&&n+r<=this.Ye},n.prototype.destroy=function(){var t=this.qe;t&&t.destroy(),this.Ze.destroy()},n}(),De=[],Ee=function(){this.index=0,this.shapes=De,this.current=null},Me=function(){function t(){this.Qe=-1,this.$e=new Ee,this.Pt=[this.$e],this.tu=null}return t.prototype.reset=function(t,n){this.Qe=0;var i=this.Pt[0];return i.index=-1,i.shapes=n,i.current=null,this.$e=i,null!=t?(this.tu=t,t):this.next()},t.prototype.get=function(){return this.tu},t.prototype.next=function(){for(;;){var t=this.$e,n=t.index+=1,i=t.shapes,r=n<i.length?t.current=i[n]:t.current=null;if(null==r)return e=this.Qe-=1,u=this.Pt,0<=e?(h=u[e],this.$e=h,this.tu=h.current):this.tu=null;var e,u,s=r.children;if(!(0<s.length))return this.tu=r,r;if((e=this.Qe+=1)<(u=this.Pt).length)(h=u[e]).index=-1,h.shapes=s,h.current=null,this.$e=h;else{var h=new Ee;u.push(h),h.index=-1,h.shapes=s,h.current=null,this.$e=h}}},t}(),Se=function(n){function i(r){var e=n.call(this,r)||this;return i.SHADER=i.SHADER||t.Shader.from("\nattribute vec2 aPosition;\nattribute vec3 aClipping;\nattribute vec2 aStep;\nattribute vec4 aAntialias;\nattribute vec4 aColorFill;\nattribute vec4 aColorStroke;\nattribute vec2 aUv;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform mediump float shapeScale;\nuniform mediump float pixelScale;\nuniform mediump float antialiasWeight;\n\nvarying mediump vec3 vClipping;\nvarying mediump vec2 vStep;\nvarying mediump vec4 vAntialias;\nvarying mediump vec4 vColorFill;\nvarying mediump vec4 vColorStroke;\nvarying mediump vec2 vUv;\n\nvec2 toInverse( in vec2 v ) {\n\treturn vec2( -v.y, v.x );\n}\n\nvec2 toTransformedPosition( in vec2 v ) {\n\treturn (projectionMatrix * translationMatrix * vec3(v, 1.0)).xy;\n}\n\nvec4 toAntialias01( in vec4 antialias ) {\n\t// Taylor series of 1 / ( 1 - a ) = 1 + a + a^2 + ....\n\treturn 1.0 + min( vec4( 1.0 ), antialias * pixelScale );\n}\n\nvec4 toAntialias2( in vec4 antialias, in float strokeWidth ) {\n\tfloat x = min( 0.4, 0.4 / 12.0 * antialias.x * pixelScale * antialiasWeight );\n\tfloat w = clamp( strokeWidth / antialias.y, 0.0, 1.0 ) * 0.4;\n\tfloat p = w * antialias.z + antialias.w;\n\tfloat y = 0.5 - p;\n\tfloat z = 0.5 - p - w;\n\treturn vec4( y, z, y - max( 0.01, y - x ), z - max( 0.01, z - x ) );\n}\n\nvec2 toPosition3456( in float type, in vec2 p, in vec2 pprev, in vec2 pnext, in float strokeWidth, out float shift ) {\n\tvec2 d0 = p - pprev;\n\tvec2 d1 = pnext - p;\n\tfloat l0 = dot( d0, d0 );\n\tfloat l1 = dot( d1, d1 );\n\tvec2 nd0 = normalize( toInverse( d0 ) );\n\tvec2 nd1 = normalize( toInverse( d1 ) );\n\tvec2 nd2 = 0.00001 < l1 ? nd1 : vec2(0.0, 0.0);\n\tvec2 n0 = 0.00001 < l0 ? nd0 : nd2;\n\tvec2 n1 = 0.00001 < l1 ? nd1 : n0;\n\tvec2 n0i = toInverse( n0 );\n\tvec2 n1i = toInverse( n1 );\n\tfloat direction = sign( 4.5 - type );\n\n\t// Offset\n\tfloat cross = dot( n0i, n1 );\n\tfloat crossInverse = ( 0.00001 < abs( cross ) ? 1.0 / cross : 0.0 );\n\tfloat b = dot(n1 - n0, n0) * crossInverse;\n\tfloat offsetSize = direction * strokeWidth * 0.5;\n\tvec2 offset = n1 + n1i * b;\n\n\t// Miter\n\tvec2 pmiter = p + offsetSize * offset;\n\tfloat miterAngle0 = dot( n0i, pmiter - pprev );\n\tfloat miterAngle1 = dot( n1i, pmiter - pnext );\n\tfloat miterLength = dot( offset, offset );\n\tfloat miterSide = direction * cross;\n\n\t// Bevel\n\tvec2 n = ( type == 4.0 || type == 6.0 ? n1 : n0 );\n\tvec2 pbevel = p + offsetSize * n;\n\n\t//\n\tvec2 presult = (\n\t\t0.0 <= miterSide ?\n\t\t( miterAngle0 < 0.0 && 0.0 <= miterAngle1 ? pmiter : pbevel ) :\n\t\t( miterLength < 6.0 ? pmiter : pbevel )\n\t);\n\tvec2 ni = ( type == 4.0 || type == 6.0 ? n1i : n0i );\n\tshift = dot( ni, p - presult );\n\treturn toTransformedPosition( presult );\n}\n\nvec2 toStep3456( in float type ) {\n\treturn ( type < 4.5 ? vec2( 1.0, 0.0 ) : vec2( 0.0, 1.0 ) );\n}\n\nvec4 toAntialias3456( in float strokeWidth ) {\n\tfloat a = antialiasWeight / max( 0.0001, strokeWidth );\n\treturn toAntialias01( vec4( a, a, a, a ) );\n}\n\nfloat toDotAndDashScale( in float scale, in float strokeWidthScale ) {\n\treturn (\n\t\tscale == 4.0 || scale == 5.0 || scale == 6.0 || scale == 7.0 ?\n\t\tstrokeWidthScale : 1.0\n\t);\n}\n\nvec4 toColorStroke3456( in float shift, in float scale ) {\n\tfloat x = aColorFill.x + shift;\n\tfloat y = scale * aColorFill.y;\n\tfloat z = scale * aColorFill.z;\n\tfloat w = aColorFill.w;\n\treturn vec4( x, y, z, w );\n}\n\nfloat toStrokeWidthScale( in float scale ) {\n\treturn (\n\t\tscale == 3.0 || scale == 7.0 ?\n\t\tshapeScale : (\n\t\t\tscale == 1.0 || scale == 5.0 ?\n\t\t\tmin( 1.0, shapeScale ) : (\n\t\t\t\tscale == 2.0 || scale == 6.0 ?\n\t\t\t\tmax( 1.0, shapeScale ) : 1.0\n\t\t\t)\n\t\t)\n\t);\n}\n\nvec2 toStep01(in vec2 size, in vec2 weight, in vec2 strokeWidth) {\n\treturn weight / max(vec2(0.00001), vec2(1.0) - strokeWidth / size);\n}\n\nvec4 toAntialias01b(in vec2 size, in vec2 strokeWidth) {\n\treturn antialiasWeight / max(vec4(0.00001), vec4(size - strokeWidth, size));\n}\n\nvoid main(void) {\n\tvec2 p012 = toTransformedPosition( aPosition );\n\n\tfloat type = aClipping.z;\n\tfloat strokeWidthScale = toStrokeWidthScale( aStep.y );\n\tfloat strokeWidth = strokeWidthScale * aStep.x;\n\n\t// type === 0 or 1\n\tvec2 size01 = aAntialias.xy;\n\tvec2 weight01 = abs(aAntialias.zw - sign(aAntialias.zw));\n\tvec2 strokeWidth01 = step(vec2(0.0), aAntialias.zw) * strokeWidth;\n\tvec2 step01 = toStep01( size01, weight01, strokeWidth01 );\n\tvec4 a01 = toAntialias01( toAntialias01b( size01, strokeWidth01 ) );\n\n\t// type === 2\n\tvec4 a2 = toAntialias2( aAntialias, strokeWidth );\n\n\t// type === 3, 4, 5 or 6\n\tfloat shift3456 = 0.0;\n\tvec2 p3456 = toPosition3456( type, aPosition, aAntialias.xy, aAntialias.zw, strokeWidth, shift3456 );\n\tvec2 step3456 = toStep3456( type );\n\tvec4 a3456 = toAntialias3456( strokeWidth );\n\tvec4 colorStroke3456 = toColorStroke3456( shift3456, toDotAndDashScale( aStep.y, strokeWidthScale ) );\n\n\t//\n\tgl_Position = vec4( ( 2.5 < type ? p3456 : p012 ), 0.0, 1.0 );\n\tvAntialias = ( 1.5 < type ? ( 2.5 < type ? a3456 : a2 ) : a01 );\n\tvClipping = aClipping;\n\tvStep = ( 2.5 < type ? step3456 : step01 );\n\tvColorFill = ( 2.5 < type ? aColorStroke : aColorFill );\n\tvColorStroke = ( 2.5 < type ? colorStroke3456 : aColorStroke );\n\tvUv = aUv;\n}","\nvarying mediump vec3 vClipping;\nvarying mediump vec2 vStep;\nvarying mediump vec4 vAntialias;\nvarying mediump vec4 vColorFill;\nvarying mediump vec4 vColorStroke;\nvarying mediump vec2 vUv;\n\nuniform sampler2D sampler;\nuniform mediump float pixelScale;\n\nvoid main(void) {\n\tvec4 texture = texture2D(sampler, vUv);\n\tfloat type = vClipping.z;\n\tvec2 v0 = vStep;\n\tvec2 v1 = vClipping.xy;\n\tvec2 v2 = v0 * vAntialias.xy;\n\tvec2 v3 = v1 * vAntialias.zw;\n\tvec2 d01 = ( v0.x < v0.y ? vec2( v0.y, v2.y ) : vec2( v0.x, v2.x ) );\n\tvec2 d02 = ( v1.x < v1.y ? vec2( v1.y, v3.y ) : vec2( v1.x, v3.x ) );\n\tvec4 d0 = vec4( d01.x, d02.x, d01.y, d02.y );\n\tvec4 d1 = vec4( dot( v0, v0 ), dot( v1, v1 ), dot( v2, v2 ), dot( v3, v3 ) );\n\tvec4 d = ( type == 1.0 ? d1 : d0 );\n\tvec2 s = smoothstep( 1.0 - (d.zw - d.xy), vec2( 1.0 ), d.xy );\n\tvec4 color01 = texture * (vColorStroke * (s.x - s.y) + vColorFill * (1.0 - s.x));\n\n\tfloat l = vColorStroke.x;\n\tfloat lp0 = vColorStroke.y;\n\tfloat lp1 = vColorStroke.z;\n\tfloat lt = vColorStroke.w;\n\tfloat ld = 0.5 * pixelScale;\n\tfloat lm = mod( l, lp0 + lp1 );\n\tfloat ls0 = ( 0.0 < lp1 ? smoothstep( 0.0, ld, lm ) - smoothstep( lp0, lp0 + ld, lm ) : 1.0 );\n\tfloat ls1 = ( 0.0 <= lt ? smoothstep( 0.0, ld, l ) - smoothstep( lt - ld, lt, l ) : 1.0 );\n\tvec4 color3456 = color01 * ls0 * ls1;\n\n\tvec2 a0 = vAntialias.xy;\n\tvec2 a1 = vAntialias.zw;\n\tvec2 a2 = vec2( texture.a );\n\tvec2 a = smoothstep( a0 - a1, a0 + a1, a2 );\n\tvec4 color2 = a.x * vColorFill + ( a.y - a.x ) * vColorStroke;\n\tgl_FragColor = ( type == 2.0 ? color2 : (2.5 < type ? color3456 : color01) );\n}"),e.nu=i.SHADER,e.iu=new Me,e.ru=e.getBufferSizeMax(r),e}return B(i,n),i.prototype.getBufferSizeMax=function(t){var n=t.context,i=n.extensions;return 1<n.webGLVersion||i.uint32ElementIndex?1431655765:21845},i.prototype.updateAtlas=function(t,n,i,r,e){var u=t.imageSrc;if(null!=u){var s=n.get(u);if(null!=s)t.texture=s.texture;else{var h=t.image;if(null!=h){var o=new me(h,e);t.texture=o.texture,n.set(o.id,o)}else t.texture=r}}else t.texture=r;var a=t.text,c=a.value;0<c.length&&i.add(a.family,c)},i.prototype.updateAtlases=function(t,n,i,r,e){for(var u=0,s=t.length;u<s;++u){var h=t[u];this.updateAtlas(h,n,i,r,e);for(var o=h.children,a=0,c=o.length;a<c;++a){var f=o[a];this.updateAtlas(f,n,i,r,e),this.updateAtlases(f.children,n,i,r,e)}}},i.prototype.updateFontAtlas=function(t,n,i,r){var e=t.text,u=i.get(e.family);if(null!=u){var s=n.get(u.id);null!=s?(e.atlas=u,e.texture=s.texture):(e.atlas=void 0,e.texture=r)}else e.atlas=void 0,e.texture=r},i.prototype.updateFontAtlases=function(t,n,i,r){for(var e=0,u=t.length;e<u;++e){var s=t[e];this.updateFontAtlas(s,n,i,r);for(var h=s.children,o=0,a=h.length;o<a;++o){var c=h[o];this.updateFontAtlas(c,n,i,r),this.updateFontAtlases(c.children,n,i,r)}}},i.prototype.eu=function(n,i,r,e){var u=this.renderer,s=this.nu;if(null!=s&&(null!=i||0<r.length)){var h=u.resolution,o=n.getBuffers(),a=n.getAntialiasWeight(h);if(e){var c=n.getAtlas(h),f=n.getFontAtlases();c.begin(),f.begin();var l=c.getDefaultTexture(),v=c.getBaseTexture();this.updateAtlases(r,c,f,l,v),f.end(),f.update(c),this.updateFontAtlases(r,c,f,l),c.end(),c.repack(),this.updateBuffers(i,r,o,u,a)}s.uniforms.shapeScale=n.toShapeScale(),s.uniforms.pixelScale=n.toPixelScale(h),s.uniforms.antialiasWeight=a,s.uniforms.translationMatrix=n.worldTransform.toArray(!0),u.shader.bind(s,!1),u.state.setBlendMode(t.utils.correctBlendMode(t.BLEND_MODES.NORMAL,!0));var b=o.length;if(1<b)for(var d=0;d<b;++d)o[d].upload();for(d=0;d<b;++d)o[d].render(s)}},i.prototype.updateBuffers=function(t,n,i,r,e){var u=this.iu;u.reset(t,n);for(var s=0,h=0,o=5e3,a=this.ru;null!=u.get();){var c=null,f=!1;if(0<h?(c=new Oe(h,r),i.splice(s,0,c),f=!0):s<i.length?(c=i[s],f=!1):(c=new Oe(o,r),i.push(c),f=!1),c.update(u,e,f))h=0,s+=1;else{if(!((h=c.indexCountRequested)<=a))break;h=Math.ceil(h/o)*o,h=Math.min(h,a)}}if(s<i.length){for(var l=s,v=i.length;l<v;++l)i[l].destroy();i.length=s}},i.SHADER=null,i}(t.ObjectRenderer),Te=function(n){function i(){var i=n.call(this)||this;return i.uu=null,i.children=[],i._r=null,i.su=0,i.hu=-1,i.ou=null,i.au=new ge,i.cu=1,i.fu=NaN,i.lu=1,i.vu=NaN,i.bu=new t.Point,i.du=[],i}return B(i,n),i.prototype.calculateBounds=function(){this._bounds.clear()},i.prototype.onChildTransformChange=function(){},i.prototype.toDirty=function(){return this.su+=1},i.prototype.isDirty=function(){return this.hu<this.su},i.prototype.render=function(t){if(this.visible&&!(this.worldAlpha<=0)&&this.renderable){var n=this.su,i=this.hu;this.hu=n;var r=i<n,e=this.uu;null==e&&(e=this.uu=new Se(t)),t.batch.setObjectRenderer(e);var u=this.mask,s=this._r,h=this.children;u?(t.mask.push(this,u),e.eu(this,s,h,r),t.mask.pop(this)):e.eu(this,s,h,r)}},i.prototype.containsPoint=function(t){return!1},i.prototype.getFontAtlases=function(){return this.au},i.prototype.getAtlas=function(t){var n=this.ou;return null==n&&(n=new oe(t),this.ou=n),n},i.prototype.getBuffers=function(){return this.du},i.prototype.toShapeScale=function(){this.updateTransform();var t=this.transform,n=t._worldID;if(n!==this.vu){this.vu=n;var i=t.worldTransform,r=i.a,e=i.b;this.lu=1/Math.sqrt(r*r+e*e)}return this.lu},i.prototype.getShapeScale=function(){return this.lu},i.prototype.toPixelScale=function(t){var n=this.toShapeScale(),i=this.vu;return this.fu!==i&&(this.fu=i,this.cu=1/t*n),this.cu},i.prototype.getPixelScale=function(){return this.cu},i.prototype.getAntialiasWeight=function(t){return 1.25/t},i.prototype.hitTest=function(t,n){for(var i=this.bu,r=this.children,e=r.length-1;0<=e;--e){var u=r[e];if(u.visible){u.toLocal(t,void 0,i);var s=u.contains(i.x,i.y);if(null!=s&&(null==n||n(s)))return s}}return null},i.prototype.hitTestBBox=function(t,n){for(var i=this.bu,r=this.children,e=r.length-1;0<=e;--e){var u=r[e];if(u.visible&&(u.toLocal(t,void 0,i),u.containsBBox(i.x,i.y)&&(null==n||n(u))))return u}return null},i.prototype.destroy=function(){var t=this.du;if(null!=t)for(var i=0,r=t.length;i<r;++i)t[i].destroy();this.du.length=0;var e=this.children;for(i=e.length-1;0<=i;--i)e[i].destroy();e.length=0,n.prototype.destroy.call(this)},i}(t.DisplayObject),je=function(t){function n(n,i,e,u){void 0===u&&(u=r.EMBEDDED_LAYER);var s=t.call(this,i,e,u)||this;return s.Rr=n,s}return B(n,t),Object.defineProperty(n.prototype,"name",{get:function(){return this.Rr},enumerable:!1,configurable:!0}),n.prototype.newGroupFill=function(){return new Z(this,!1,16777215,1)},n.prototype.isGroupSizeFittable=function(){return!1},n.prototype.newGroupSize=function(t,n){var i=Y.SIZE_X,r=Y.SIZE_Y;return new Mr(this,i,r,i,r)},n.prototype.clone=function(){for(var t=this.newClone().copy(this),n=this.children,i=0,r=n.length;i<r;++i){var e=n[i].clone();e.parent=t,t.children.push(e)}return t.onChildTransformChange(),t.toDirty(),t.size.init(),t},n.prototype.newClone=function(){return new(0,this.constructor)(this.Rr,this.Cr,this.Ar,this.type)},n.prototype.serializeChildren=function(t){return[]},n.prototype.serializeImage=function(t){return-1},n.prototype.serializeGradient=function(t){return-1},n}(jr),Ne=function(){function t(){}return t.toLayers=function(t,n){var i=[],r=this.toLayer(t);if(r){var e=r.parent;if(e)for(var u=e.children,s=u.length,h=0,o=n.length;h<o;++h){var a=n[h];0<=a&&a<s&&i.push(u[a])}}return i},t.toLayer=function(t){for(var n=t.parent;null!=n;){if(n instanceof Te)return n;if(n instanceof je)return n;n=n.parent}return null},t.show=function(t){return!t.visible&&(t.visible=!0,!0)},t.showAll=function(t){for(var n=!1,i=0,r=t.length;i<r;++i){var e=t[i];e.visible||(e.visible=!0,n=!0)}return n},t.hide=function(t){return!!t.visible&&(t.visible=!1,!0)},t.hideAll=function(t){for(var n=!1,i=0,r=t.length;i<r;++i){var e=t[i];e.visible&&(e.visible=!1,n=!0)}return n},t.bringToFront=function(t){var n=t.parent;return!!n&&this.doBringToFront(t,n.children,0)},t.bringAllToFront=function(t){var n=t.length;if(0<n){var i=t[0].parent;if(i){for(var r=!1,e=i.children,u=0;u<n;++u){var s=t[n-1-u];this.doBringToFront(s,e,u)&&(r=!0)}return r}}return!1},t.doBringToFront=function(t,n,i){for(var r=n.length-1-i,e=r;0<=e;--e){var u=n[e];if(u===t){if(e!==r){for(var s=e+1;s<=r;++s)n[s-1]=n[s];return n[r]=u,!0}return!1}}return!1},t}(),Ie={NONE:0,DRAG:1,PINCH:2,ALL:3},Ce=t.interaction.InteractionEvent,Ae=function(n){function i(t){var i=n.call(this,t,$t.NONE)||this;return i.gu=new Map,i.mu=t.operationType,i.wu=t.scaleMin,i.pu=t.scaleMax,i}return B(i,n),i.prototype.initialize=function(t,i){if(n.prototype.initialize.call(this,t,i),null==this.gu.get(t)){var r=Ne.toLayer(t);null!=r&&this.gu.set(t,r)}},i.prototype.onDown=function(t,i,r){if(n.prototype.onDown.call(this,t,i,r),r instanceof Ce){var e=this.gu.get(t),u=r.data.originalEvent.timeStamp;e&&this.condition(t,u,nn)&&this.getGestureUtil().onDown(e,r)}},i.prototype.getGestureUtil=function(){var t;return null!==(t=i.GESTURE_UTIL)&&void 0!==t?t:i.GESTURE_UTIL=this.newGestureUtil()},i.prototype.newGestureUtil=function(){var n=this,i=new t.Point;return new or({on:{move:function(t,r,e,u,s,h){n.onGestureMove(t,r,e,u,s,h,i)}}})},i.prototype.onGestureMove=function(t,n,i,r,e,u,s){var h=t.parent;if(h){var o=t.transform,a=this.mu,c=!1,f=1;if(a&Ie.PINCH){var l=o.scale,v=l.y,b=Math.min(this.pu,Math.max(this.wu,v*u));f=b/v,l.set(b,b),c=!0}if(a&Ie.DRAG){h.toLocal(s.set(r,e),void 0,s);var d=s.x,g=s.y,m=r-n,w=e-i;h.toLocal(s.set(m,w),void 0,s);var p=s.x,O=s.y,D=o.position,E=(D.x-p)*f+d,M=(D.y-O)*f+g;D.set(E,M),c=!0}c&&rt.update(t)}},i.prototype.toSize=function(t,n){return"size"in t?n.copyFrom(t.size):n.set(t.width,t.height),n},i}(un),Re=t.interaction.InteractionEvent,Le=function(n){function i(t){var i=n.call(this,t,$t.NONE)||this;return i.mu=t.operationType,i.wu=t.scaleMin,i.pu=t.scaleMax,i}return B(i,n),i.prototype.onDown=function(t,i,r){n.prototype.onDown.call(this,t,i,r),r instanceof Re&&this.condition(t,r.data.originalEvent.timeStamp,nn)&&this.getGestureUtil().onDown(t,r)},i.prototype.getGestureUtil=function(){var t;return null!==(t=i.GESTURE_UTIL)&&void 0!==t?t:i.GESTURE_UTIL=this.newGestureUtil()},i.prototype.newGestureUtil=function(){var n=this,i=new t.Point;return new or({on:{move:function(t,r,e,u,s,h){n.onGestureMove(t,r,e,u,s,h,i)}}})},i.prototype.onGestureMove=function(t,n,i,r,e,u,s){var h=t.parent;if(h){var o=t.transform,a=this.mu,c=!1,f=1;if(a&Ie.PINCH){var l=o.scale,v=l.y,b=Math.min(this.pu,Math.max(this.wu,v*u));f=b/v,l.set(b,b),c=!0}if(a&Ie.DRAG){h.toLocal(s.set(r,e),void 0,s);var d=s.x,g=s.y,m=r-n,w=e-i;h.toLocal(s.set(m,w),void 0,s);var p=s.x,O=s.y,D=o.position,E=(D.x-p)*f+d,M=(D.y-O)*f+g;D.set(E,M),c=!0}c&&rt.update(t)}},i}(un),ye={SHAPE:0,LAYER:1},ke={INPUT_TEXT:0,INPUT_INTEGER:1,INPUT_REAL:2,EMIT_EVENT:3,WRITE_BOTH:4,WRITE_LOCAL:5,WRITE_REMOTE:6,HTML_ELEMENT:7,HTML_ELEMENT_WITHOUT_POINTER_EVENTS:8,SHOW_HIDE_LAYER:9,GESTURE_LAYER:10,GESTURE:11,EXECUTE:12},xe=function(t){function n(n,i,r,e,u){void 0===n&&(n=""),void 0===e&&(e=.05),void 0===u&&(u=20);var s=t.call(this,gn.GESTURE,n,i)||this;return s.operationType=r,s.scaleMin=e,s.scaleMax=u,s}return B(n,t),n.prototype.toRuntime=function(){switch(this.subtype){case ye.SHAPE:return new Le(this);case ye.LAYER:return new Ae(this)}},n.prototype.serialize=function(t){var n=t.addResource(this.condition);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(this.operationType,",").concat(this.scaleMin,",").concat(this.scaleMax,"]"))},n.deserialize=function(t,i){return new n(wn.toResource(1,t,i.resources),this.toSubType(t),t[3],t[4],t[5])},n.toSubType=function(t){if(t[0]!==gn.MISC)return t[2];switch(t[2]){case ke.GESTURE:return ye.SHAPE;case ke.GESTURE_LAYER:return ye.LAYER}},n}(dn),Be={INVISIBLE:"INVISIBLE",INTERACTIVE:"INTERACTIVE",DRAGGABLE:"DRAGGABLE",PINCHABLE:"PINCHABLE"},_e=function(t,n,i,r,e){var u,s,h,o=function(t,n){if(at(t))return t;var i=n.resources;return 0<=t&&t<=i.length?i[t]:""}(t[0],n),a=e?e(o,n):new je(o,n.mode,n.depth),c=t[1];null==c||2&c||(a.visible=!1,a.state.add(Be.INVISIBLE));var f=-.5*i+(t[2]||0),l=-.5*r+(t[3]||0);a.transform.position.set(f,l);var v=null!==(u=t[4])&&void 0!==u?u:i,b=null!==(s=t[5])&&void 0!==s?s:r;a.size.set(v,b),a.size.init();var d=t[6];if(null!=d&&a.fill.deserialize(d,n),n.mode===gr.VIEWER){var g=null!==(h=t[7])&&void 0!==h?h:1,m=1&g,w=2&g,p=4&g;if(w||p){var O=(w?Ie.DRAG:Ie.NONE)|(p?Ie.PINCH:Ie.NONE);a.action.add(new xe("",ye.LAYER,O))}(m||w||p)&&(a.interactive=!0)}return a},Pe=function(){function t(t,n){this.children=[],this.St=t,this.cn=n}return t.prototype.hasConnectors=function(t){for(var n=0,i=t.length;n<i;++n){var r=t[n];if(r instanceof re)return!0;var e=r.children;if(0<e.length&&this.hasConnectors(e))return!0}return!1},t.prototype.newHasConnectors=function(){for(var t=new Map,n=this.children,i=0,r=n.length;i<r;++i){var e=n[i];t.set(e,this.hasConnectors(e.children))}return t},t.prototype.copyTo=function(t){for(var n,i=null!==(n=this.Ou)&&void 0!==n?n:this.Ou=this.newHasConnectors(),r=this.children,e=t.children,u=0,s=r.length;u<s;++u){var h=r[u],o=h.clone();o.parent=t,e.push(o),i.get(h)&&ee.move(h,o)}t.onChildTransformChange(),t.toDirty(),t.onAttach()},t.prototype.deserialize=function(t,n){var i=t.length;if(0<i)for(var r=this.St,e=this.cn,u=0;u<i;++u)this.children.push(_e(t[u],n,r,e))},t}(),Ue=function(){function t(){}return t.toSimple=function(t){return{version:t.version,id:t.id,name:t.name,thumbnail:t.thumbnail,data:JSON.stringify({width:t.width,height:t.height,background:t.background,tile:t.tile,resources:t.resources,data:t.data||t.tags,pieces:t.pieces,layers:t.layers,items:t.items,snap:t.snap})}},t.toSerialized=function(t){if(!("items"in t)){var n=JSON.parse(t.data),i={version:t.version,id:t.id,name:t.name,width:n.width,height:n.height,background:n.background,tile:n.tile,resources:n.resources,data:n.data||n.tags,pieces:n.pieces,layers:n.layers,items:n.items,snap:n.snap,thumbnail:t.thumbnail};if(null==i.data){var r=t.tags;null!=r&&(i.data=JSON.parse(r))}if(null==i.pieces){var e=t.pieces;null!=e&&(i.pieces=JSON.parse(e))}return i}return t},t.newLayer=function(t,n,i){n.deserialize(t.layers,i);var r=t.items,e=Ar(r,i);return null!=e?e.then((function(t){for(var i=n.children,e=0,u=t.length;e<u;++e){var s=r[e],h=t[e];null!=(o=i[s[16]])&&(h.parent=o,h.uploaded=void 0,o.children.push(h))}for(e=0,u=i.length;e<u;++e){var o;(o=i[e]).onChildTransformChange(),o.toDirty();for(var a=o.children,c=0,f=a.length;c<f;++c)a[c].onAttach()}return t})):Promise.resolve([])},t.toPieceData=function(t,n,i){var r=new Map,e=new Map,u=function(){return r};return this.Du(t,n,r,e,i,0).then(u,u)},t.Du=function(t,n,i,r,e,u){var s=this,h=[];if(n&&0<n.length&&t)for(var o=function(o,a){var c=n[o],f=r.get(c);if(null!=f)h.push(f);else{var l=t.piece.getByName(c).then((function(n){return s.Eu(t,c,n,e,u+1,i,r)}),(function(){return null}));r.set(c,l),h.push(l)}},a=0,c=n.length;a<c;++a)o(a);return Promise.all(h)},t.Eu=function(t,n,i,r,e,u,s){var h=this,o=this.toSerialized(i),a=o.width,c=o.height,f=new Pe(a,c);u.set(n,new Lr(n,a,c,f));var l=o.pieces;return this.Du(t,l,u,s,r,e).then((function(){return h.newLayer(o,f,new dr(o,l,u,r,e))}))},t}(),Fe={},Ge=function(){function t(){}return t.isContainer=function(t){return t instanceof lr},t.isEmbedded=function(t){return t instanceof Nr},t.toContainer=function(t){for(var n=t;null!=n;){if(this.isContainer(n))return n;n=n.parent}return null},t.open=function(t,n,i,r){var e=Fe[n];if(null!=e)e(i,r,t);else switch(n){case vr.DIAGRAM:var u=this.toContainer(t);if(u){var s=u.controller;s&&s.getByName(i).then((function(t){u.set(Ue.toSerialized(t))}))}break;case vr.PAGE:r?window.open(i):window.location.href=i}},t.writeLocal=function(t,n,i,r,e){var u;void 0===e&&(e=Nt.FOUND);for(var s=t;null!=s;){if(this.isContainer(s))return(s.data.private.set(n,i,r,e)||s.data.protected.set(n,i,r,e)||!!s.data.set(n,i,r,e))&&(rt.update(s),!0);if(this.isEmbedded(s)&&(null===(u=s.data.getPrivate())||void 0===u?void 0:u.set(n,i,r,e)))return rt.update(s),!0;s=s.parent}return!1},t.writeRemote=function(t,n,i){var r=this.toContainer(t);return!!r&&r.data.remote.set(n,i)},t.emit=function(n,i,r,e){var u=t.toContainer(n);void 0===e?(n.emit(i,n),u&&u.shape.emit(i,n)):(n.emit(i,r,e,n),u&&u.shape.emit(i,r,e,n))},t}(),He=function(t){function n(n){var i=t.call(this,n,$t.NONE)||this;return i.name=rn.ofStringOrNull(n.name),i}return B(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,nn)){var r=this.name(t,i,nn);null!=r&&Ge.emit(t,r)}},n}(un),ze=function(t){function n(n,i){var r=t.call(this,gn.EMIT_EVENT,n)||this;return r.name=i,r}return B(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.name===i.name},n.prototype.toRuntime=function(){return new He(this)},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.name);return t.addResource("[".concat(this.type,",").concat(n,",").concat(i,"]"))},n.deserialize=function(t,i){return new n(wn.toResource(1,t,i.resources),wn.toResource(2,t,i.resources))},n}(bn),Ve=function(t){function n(n){var i=t.call(this,n,$t.NONE)||this;return i.target=rn.ofStringOrNull(n.target),i}return B(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,nn)){var r=this.target(t,i,nn);null!=r&&Ge.emit(t,r)}},n}(un),We={NO_POINTER_EVENTS:"NO_POINTER_EVENTS"},Xe=function(){function n(t){var n="http://www.w3.org/2000/svg",i=document.createElementNS(n,"svg");i.setAttribute("style","position: absolute;"),i.setAttribute("width","0px"),i.setAttribute("height","0px");var r=document.createElementNS(n,"defs"),e=document.createElementNS(n,"clipPath"),u="clipper_ex_".concat(Math.random().toString(32).substring(2));e.setAttribute("id",u),e.setAttribute("clipPathUnits","objectBoundingBox");var s=document.createElementNS(n,"path");this.Mu=s,this.Su="",s.setAttribute("clip-rule","evenodd"),e.appendChild(s),r.appendChild(e),i.appendChild(r),this.R=u,t.appendChild(i)}return Object.defineProperty(n.prototype,"id",{get:function(){return this.R},enumerable:!1,configurable:!0}),n.prototype.update=function(t,n,i){var r=this.toD(t,n,i);this.Su!=r&&(this.Mu.setAttribute("d",r),this.Su=r)},n.prototype.toD=function(i,r,e){var u,s;if(null==i)return"";var h=i.width,o=i.height,a=1e-4;if(h<a||o<a)return"";if(e.size<=0)return"M0,0 h1 v1 h-1z";var c=null!==(u=n.WORK_MATRIX)&&void 0!==u?u:n.WORK_MATRIX=new t.Matrix;null!=r?(c.copyFrom(r),c.invert()):c.identity(),c.translate(-i.x,-i.y),c.scale(1/h,1/o);for(var f=-1,l=2,v=-1,b=2,d="",g=c.a,m=c.b,w=c.c,p=c.d,O=c.tx,D=c.ty,E=null!==(s=n.WORK_RECTS)&&void 0!==s?s:n.WORK_RECTS=[],M=this.toRects(e,E),S=0;S<M;S+=4){var T=E[S+0],j=E[S+1],N=E[S+2],I=E[S+3],C=g*T+w*j+O,A=m*T+p*j+D,R=g*N+w*j+O,L=m*N+p*j+D,y=g*N+w*I+O,k=m*N+p*I+D,x=g*T+w*I+O,B=m*T+p*I+D;f=Math.min(f,C,R,y,x),l=Math.max(l,C,R,y,x),v=Math.min(v,A,L,k,B),b=Math.max(b,A,L,k,B);var _=C.toFixed(5),P=A.toFixed(5),U=R.toFixed(5),F=L.toFixed(5),G=y.toFixed(5),H=k.toFixed(5),z=x.toFixed(5),V=B.toFixed(5);d+=" M".concat(_,",").concat(P," L").concat(U,",").concat(F," L").concat(G,",").concat(H," L").concat(z,",").concat(V,"Z")}return"M".concat(f,",").concat(v," L").concat(l,",").concat(v," L").concat(l,",").concat(b," L").concat(f,",").concat(b,"Z")+d},n.prototype.toRects=function(t,n){for(var i=t.data,r=t.size<<2,e=0;e<r;e+=4){var u=i[e+0],s=i[e+1],h=i[e+2],o=i[e+3];u<h?(n[e+0]=u,n[e+2]=h):(n[e+0]=h,n[e+2]=u),s<o?(n[e+1]=s,n[e+3]=o):(n[e+1]=o,n[e+3]=s)}for(e=4;e<r;e+=4){u=n[e+0],s=n[e+1],h=n[e+2],o=n[e+3];for(var a=0;a<e;a+=4){var c=n[a+0],f=n[a+1],l=n[a+2],v=n[a+3],b=0,d=0;if(u<=c)if(h<=l){if(h<=c)continue;b=2,d=1}else d=3;else if(h<=l)b=3;else{if(l<=u)continue;b=1,d=2}var g,m,w=0,p=0;if(s<=f)if(o<=v){if(o<=f)continue;w=2,p=1}else p=3;else if(o<=v)w=3;else{if(v<=s)continue;w=1,p=2}if(4==(g=0===b||0===w?0:1===b||2===b?3===w?2:1:3===w?4:2)){e+4<r&&(n[e+0]=n[r+0],n[e+1]=n[r+1],n[e+2]=n[r+2],n[e+3]=n[r+3]),e-=4,r-=4;break}if(4!=(m=0===d||0===p?0:1===d||2===d?3===p?2:1:3===p?4:2))if(0===g)if(0===m){for(O=r-4;a<O;O-=4)n[O+4]=n[O+0],n[O+5]=n[O+1],n[O+6]=n[O+2],n[O+7]=n[O+3];0===d?(n[a+3]=s,n[a+4]=c,n[a+5]=o,n[a+6]=l,n[a+7]=v):(n[a+2]=u,n[a+4]=h,n[a+5]=f,n[a+6]=l,n[a+7]=v),e+=4,r+=4,a+=4}else 2===m&&(1===d?n[a+0]=h:2===d?n[a+2]=u:1===p?n[a+1]=o:2===p&&(n[a+3]=s));else if(1===g){for(O=r-4;a<O;O-=4)n[O+4]=n[O+0],n[O+5]=n[O+1],n[O+6]=n[O+2],n[O+7]=n[O+3];1===d?1===p?(n[a+0]=h,n[a+4]=c,n[a+5]=o,n[a+6]=h,n[a+7]=v):(n[a+0]=h,n[a+4]=c,n[a+5]=f,n[a+6]=h,n[a+7]=s):1===p?(n[a+2]=u,n[a+4]=u,n[a+5]=o,n[a+6]=l,n[a+7]=v):(n[a+2]=u,n[a+4]=u,n[a+5]=f,n[a+6]=l,n[a+7]=s),e+=4,r+=4,a+=4}else 2===g&&(1===b?(n[e+0]=l,u=l):2===b?(n[e+2]=c,h=c):1===w?(n[e+1]=v,s=v):2===w&&(n[e+3]=f,o=f));else{for(var O=a+4;O<r;O+=4)n[O-4]=n[O+0],n[O-3]=n[O+1],n[O-2]=n[O+2],n[O-1]=n[O+3];e-=4,r-=4,a-=4}}}return r},n}(),Ke=function(){function t(){this.Pt=[],this.j=0,this.Qe=0,this.vn=!0}return Object.defineProperty(t.prototype,"data",{get:function(){return this.Pt},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return this.j},enumerable:!1,configurable:!0}),t.prototype.isDirty=function(){return this.vn},t.prototype.toClean=function(){this.vn=!1},t.prototype.begin=function(){return this.Qe=0,this},t.prototype.end=function(){var t=this.Qe;this.j=t;var n=this.Pt,i=t<<2;return n.length!==i&&(n.length=i,this.vn=!0),this},t.prototype.add=function(t,n,i,r){var e=this.Qe<<2;this.Qe+=1;var u=this.Pt;return e<u.length?u[e+0]===t&&u[e+1]===n&&u[e+2]===i&&u[e+3]===r||(u[e+0]=t,u[e+1]=n,u[e+2]=i,u[e+3]=r,this.vn=!0):(u.push(t,n,i,r),this.vn=!0),this},t}(),Ye={CLICKED:0,DOUBLE_CLICKED:1,FOCUSED:2,ALWAYS:3},Je=function(){function n(t,n,i,r){var e=this;this.Jn=t,this.Tu=n;var u=this.toData(i,r);this.Pt=u,this.ju=!1,this.Nu=function(t){e.onElementFocus(t)},this.Iu=function(t){e.onBeforeFocus(t)},this.Cu=function(t){e.onAfterFocus(t)},this.Au=!1,this.Ru=!1,this.Lu=function(){e.doSelect()},this.yu=this.Pt.when===Ye.ALWAYS,this.ku=function(){e.updateElement(e.xu)}}return n.prototype.toData=function(t,n){var i,r;return{element:this.toElementData(t,null==n?void 0:n.element),clipper:this.toClipperData(t,null==n?void 0:n.clipper),before:this.toBeforeData(t,null==n?void 0:n.before),after:this.toAfterData(t,null==n?void 0:n.after),when:Di(null!==(i=null==n?void 0:n.when)&&void 0!==i?i:t.getWhen(),Ye),select:null!==(r=null==n?void 0:n.select)&&void 0!==r?r:t.getSelect()}},n.prototype.toElementData=function(t,n){var i,r;return{creator:null!==(i=null==n?void 0:n.creator)&&void 0!==i?i:t.getElementCreator(),styler:null!==(r=null==n?void 0:n.styler)&&void 0!==r?r:this.newElementStyler(t)}},n.prototype.newElementStyler=function(t){return function(n,i,r,e,u,s,h){return t.setElementStyle(n,i,r,e,u,s,h)}},n.prototype.toClipperData=function(t,n){var i,r,e;return{creator:null!==(i=null==n?void 0:n.creator)&&void 0!==i?i:t.getClipperCreator(),styler:null!==(r=null==n?void 0:n.styler)&&void 0!==r?r:this.newClipperStyler(t),extended:null!==(e=null==n?void 0:n.extended)&&void 0!==e?e:t.isClipperExEnabled()}},n.prototype.newClipperStyler=function(t){return function(n,i,r,e,u,s,h){return t.setClipperStyle(n,i,r,e,u,s,h)}},n.prototype.toBeforeData=function(t,n){var i,r;return{creator:null!==(i=null==n?void 0:n.creator)&&void 0!==i?i:t.getBeforeCreator(),styler:null!==(r=null==n?void 0:n.styler)&&void 0!==r?r:this.newBeforeStyler(t)}},n.prototype.newBeforeStyler=function(t){return function(n){t.setBeforeStyle(n)}},n.prototype.toAfterData=function(t,n){var i,r;return{creator:null!==(i=null==n?void 0:n.creator)&&void 0!==i?i:t.getAfterCreator(),styler:null!==(r=null==n?void 0:n.styler)&&void 0!==r?r:this.newAfterStyler(t)}},n.prototype.newAfterStyler=function(t){return function(n){t.setAfterStyle(n)}},Object.defineProperty(n.prototype,"element",{get:function(){var t;return null!==(t=this.Bu)&&void 0!==t?t:null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"when",{get:function(){return this.Pt.when},enumerable:!1,configurable:!0}),n.prototype.onDowning=function(t){switch(this.Ru=this.Au,this.when){case Ye.CLICKED:this.start();break;case Ye.FOCUSED:this.Jn.state.isFocused&&this.start()}},n.prototype.onDown=function(t){!this.Ru&&this.Au&&("data"in t?t.data.originalEvent.preventDefault():t.preventDefault())},n.prototype.onDblClick=function(t,n){switch(this.when){case Ye.DOUBLE_CLICKED:this.start()}},n.prototype.onFocus=function(){var t;switch(this.when){case Ye.FOCUSED:this.start();break;default:null===(t=this.Bu)||void 0===t||t.focus()}},n.prototype.onBlur=function(){var t;switch(this.when){case Ye.CLICKED:case Ye.DOUBLE_CLICKED:case Ye.FOCUSED:this.onEndByBlur(),this.cancel();break;default:null===(t=this.Bu)||void 0===t||t.blur()}},n.prototype.isStartable=function(){switch(this.when){case Ye.CLICKED:case Ye.DOUBLE_CLICKED:case Ye.FOCUSED:return this.Jn.state.isActionable;default:return!0}},n.prototype.start=function(){!this.Au&&this.isStartable()&&(this.Au=!0,this.Jn.worldVisible?this.doStart():this.yu=!0,rt.update(this.Jn))},n.prototype.isShown=function(){return this.ju},n.prototype.onRender=function(t){(this.yu||!this.ju&&this.when===Ye.ALWAYS)&&(this.yu=!1,this.doStart(t)),this.Au&&(this.Au=!1)},n.prototype.getElementRect=function(n){var i=this.an||new t.Point(0,0);this.an=i;var r=this._u||new t.Rectangle;return this._u=r,this.Tu.getElementRect(n,i,r)},n.prototype.getElementMatrix=function(){return this.Tu.getElementMatrix()},n.prototype.getClipperRect=function(n){var i=this.an||new t.Point(0,0);this.an=i;var r=this.Pu||new t.Rectangle;return this.Pu=r,this.Tu.getClipperRect(n,i,r)},n.prototype.fillClipperExRects=function(t,n){var i=this.Tu;return i.getClipperExRects&&i.getClipperExRects(n),n.isDirty()},n.prototype.doStart=function(t){var n,i;if(!this.ju){this.ju=!0;var r=this.xu;null!=r&&(this.xu=void 0,r.off("postrender",this.ku));var e=this.Jn;null==t&&(t=null===(n=rt.getLayer(e))||void 0===n?void 0:n.renderer),t&&(this.xu=t,t.on("postrender",this.ku)),this.onStart();var u=this.getClipper();if(u){var s=this.getBefore(u),h=this.getElement(u),o=this.getAfter(u),a=this.getClipperEx(u);if(h){var c=null!==(i=null==t?void 0:t.resolution)&&void 0!==i?i:rt.getResolution(e),f=this.getElementRect(c),l=this.getElementMatrix(),v=this.toClipperRectAdjusted(f,l,this.getClipperRect(c)),b=e.state,d=this.Tu.getPadding(),g=this.Pt;if(g.clipper.styler(u,b,d,f,l,v,a),g.element.styler(h,b,d,f,l,v,a),s&&g.before.styler(s),o&&g.after.styler(o),this.onElementAttached(h,s,o),a){var m=this.getClipperExRects();m&&this.fillClipperExRects(c,m)&&(a.update(f,l,m),m.toClean())}u.style.display="",b.isFocused&&this.toElementFocused(h),u.scrollTop=0,u.scrollLeft=0,this.Pt.select&&setTimeout(this.Lu,0)}}}},n.prototype.toElementFocused=function(t){t.focus({preventScroll:!0})},n.prototype.onStart=function(){this.Tu.onStart()},n.prototype.doSelect=function(){var t=this.Bu;t&&(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement)&&t.select()},n.prototype.cancel=function(){var t;if(this.ju){this.ju=!1;var n=this.xu;null!=n&&(this.xu=void 0,n.off("postrender",this.ku)),this.onCancel();var i=this.Jn,r=rt.getLayer(i);if(r){var e=r.view;switch(this.when){case Ye.CLICKED:case Ye.DOUBLE_CLICKED:case Ye.FOCUSED:document.activeElement===this.Bu&&e.focus()}var u=i.state,s=r.renderer.plugins.interaction;this.Tu.containsPoint(s.mouse.global)&&!u.isHovered&&(u.isHovered=!0,e.style.cursor=null!==(t=i.cursor)&&void 0!==t?t:""),r.update()}var h=this.Bu;null!=h&&this.onElementDetached(h,this.Uu,this.Fu);var o=this.Gu;null!=o&&(o.style.display="none")}},n.prototype.onCancel=function(){this.Tu.onCancel()},n.prototype.onElementAttached=function(t,n,i){null==n||n.addEventListener("focus",this.Iu),null==i||i.addEventListener("focus",this.Cu),t.addEventListener("focus",this.Nu,!0)},n.prototype.onElementDetached=function(t,n,i){null==n||n.removeEventListener("focus",this.Iu),null==i||i.removeEventListener("focus",this.Cu),t.removeEventListener("focus",this.Nu,!0)},n.prototype.getClipper=function(){var t=this.Gu;if(null==t){var n=rt.getLayer(this.Jn);t=n?this.Pt.clipper.creator(n.getElementContainer()):null,this.Gu=t}return t},n.prototype.getClipperEx=function(t){var n=this.Hu;return void 0===n&&(n=null!=this.getClipperExRects()?new Xe(t):null,this.Hu=n),n},n.prototype.getClipperExRects=function(){var t=this.zu;return void 0===t&&(t=this.Pt.clipper.extended?new Ke:null,this.zu=t),t},n.prototype.getElement=function(t){var n=this.Bu;return null==n&&(n=this.Pt.element.creator(t),this.Bu=n),n},n.prototype.getBefore=function(t){var n=this.Uu;return null==n&&(n=this.Pt.before.creator(t),this.Uu=n),n},n.prototype.getAfter=function(t){var n=this.Fu;return null==n&&(n=this.Pt.after.creator(t),this.Fu=n),n},n.prototype.onBeforeFocus=function(t){var n=this.Jn,i=rt.getLayer(n);if(i){var r=i.getFocusController(),e=r.find(n,!1,!1,!1);i.view.focus(),r.focus(e),t.preventDefault(),t.stopImmediatePropagation()}},n.prototype.onAfterFocus=function(t){var n=this.Jn,i=rt.getLayer(n);if(i){var r=i.getFocusController(),e=r.find(n,!1,!1,!0);i.view.focus(),r.focus(e),t.preventDefault(),t.stopImmediatePropagation()}},n.prototype.onElementFocus=function(t){if(this.when===Ye.ALWAYS){var n=this.Jn;n.state.isFocused||n.focus()}},n.prototype.onEndByBlur=function(){this.onEnd()},n.prototype.onEnd=function(){this.Tu.onEnd()},n.prototype.end=function(){this.onEnd(),this.cancel()},n.prototype.select=function(){return this.ju&&this.Pt.select&&this.doSelect(),this},n.prototype.toClipperRectAdjusted=function(t,n,i){if(i&&t&&null==n){var r=t.x,e=t.y,u=r+t.width,s=e+t.height,h=i.x,o=i.y,a=h+i.width,c=o+i.height,f=Math.min(Math.max(h,r),a),l=Math.min(Math.max(h,u),a),v=Math.min(Math.max(o,e),c),b=Math.min(Math.max(o,s),c);i.x=f,i.y=v,i.width=l-f,i.height=b-v}return i},n.prototype.updateElement=function(t){if(this.ju){var n=this.Jn;if(n.worldVisible){var i=this.Bu,r=this.Gu,e=this.Hu;if(i&&r){var u=t.resolution,s=this.getElementRect(u),h=this.getElementMatrix(),o=this.toClipperRectAdjusted(s,h,this.getClipperRect(u)),a=n.state,c=this.Tu.getPadding(),f=this.Pt;if(f.clipper.styler(r,a,c,s,h,o,e),f.element.styler(i,a,c,s,h,o,e),e){var l=this.getClipperExRects();l&&this.fillClipperExRects(u,l)&&(e.update(s,h,l),l.toClean())}}}else switch(this.when){case Ye.ALWAYS:(r=this.Gu)&&(r.style.display="none");break;default:this.cancel()}}},n.getClipperRect=function(t,n,i,r,e){for(var u=!0,s=0,h=0,o=0,a=0,c=t;c instanceof Qi;){c.getClippingRect(n,e),r.set(e.x,e.y),c.toGlobal(r,r,!1);var f=(r.x*i|0)/i,l=(r.y*i|0)/i;r.set(e.x+e.width,e.y+e.height),c.toGlobal(r,r,!0);var v=r.x,b=r.y,d=Math.min(f,v),g=Math.min(l,b),m=Math.max(f,v),w=Math.max(l,b);u?(u=!1,s=d,h=g,o=m,a=w):(s=Math.min(Math.max(s,d),m),h=Math.min(Math.max(h,g),w),o=Math.min(Math.max(o,d),m),a=Math.min(Math.max(a,g),w)),c=c.parent}return u?null:(e.x=s,e.y=h,e.width=o-s,e.height=a-h,e)},n}(),Ze=function(){function t(t){var n=t.transform,i=n.position;this.x=i.x,this.y=i.y;var r=t.size;this.sizeX=r.x,this.sizeY=r.y,this.rotation=n.rotation,this.actions=[],this.fill=t.fill.toObject(),this.stroke=t.stroke.toObject(),this.text=t.text.toObject(),this.cursor=t.cursor,this.reset=$t.NONE,this.written=$t.NONE,this.effect=NaN,this.isStateChanged=!1,this.interactive=!1}return t.prototype.initialize=function(t){t.disallowUploadedUpdate();for(var n=this.actions,i=0,r=n.length;i<r;++i)n[i].initialize(t,this);t.allowUploadedUpdate()},t.prototype.isActionable=function(){return 0<this.actions.length},t.prototype.onResize=function(t){for(var n=this.actions,i=0,r=n.length;i<r;++i)n[i].onResize(t,this)},t.prototype.onClick=function(t,n){var i=t.state;i.isActionable&&(i.isClicked=!0);for(var r=this.actions,e=0,u=r.length;e<u;++e)r[e].onClick(t,this,n)},t.prototype.onDblClick=function(t,n,i){var r=t.state;r.isActionable&&(r.isDblClicked=!0);for(var e=this.actions,u=0,s=e.length;u<s;++u)e[u].onDblClick(t,this,n,i);return!1},t.prototype.onOver=function(t,n){var i=t.state;if(!i.isHovered){i.isHovered=!0;for(var r=this.actions,e=0,u=r.length;e<u;++e)r[e].onOver(t,this,n)}},t.prototype.onOut=function(t,n){if(t.state.isHovered){t.state.isHovered=!1;for(var i=this.actions,r=0,e=i.length;r<e;++r)i[r].onOut(t,this,n)}},t.prototype.onDown=function(t,n){for(var i=this.actions,r=0,e=i.length;r<e;++r)i[r].onDowning(t,this,n);var u=t.state;if(!u.isDown)if(u.isPressed)for(u.addAll(lt.DOWN,ht.PRESSED),(h=rt.getLayer(t))&&(o=h.getFocusController()).focus(o.findParent(t)),r=0,e=i.length;r<e;++r){var s=i[r];s.onDown(t,this,n),s.onPressed(t,this,n)}else{var h,o;for(u.isDown=!1,(h=rt.getLayer(t))&&(o=h.getFocusController()).focus(o.findParent(t)),r=0,e=i.length;r<e;++r)i[r].onDown(t,this,n)}},t.prototype.onUp=function(t,n){var i=t.state;if(!i.isUp)if(i.isPressed){i.set(lt.UP,ht.PRESSED);for(var r=0,e=(s=this.actions).length;r<e;++r){var u=s[r];u.onUp(t,this,n),u.onUnpressed(t,this,n)}}else{var s;for(i.isUp=!0,r=0,e=(s=this.actions).length;r<e;++r)s[r].onUp(t,this,n)}},t.prototype.onUpOutside=function(t,n){var i=t.state;if(i.isPressed){i.set(lt.UP_OUTSIDE,ht.PRESSED);for(var r=0,e=(s=this.actions).length;r<e;++r){var u=s[r];u.onUpOutside(t,this,n),u.onUnpressed(t,this,n)}}else{var s;for(i.isUpOutside=!0,r=0,e=(s=this.actions).length;r<e;++r)s[r].onUpOutside(t,this,n)}},t.prototype.onMove=function(t,n){for(var i=this.actions,r=0,e=i.length;r<e;++r)i[r].onMove(t,this,n)},t.prototype.onKeyDown=function(t,n){Xi.isActivateKey(n)&&this.onDown(t,n);for(var i=this.actions,r=0,e=i.length;r<e;++r)i[r].onKeyDown(t,this,n);return!1},t.prototype.onKeyUp=function(t,n){if(Xi.isActivateKey(n)){var i=t.state;if(i.isPressed){var r=i.isUp;this.onUp(t,n),!r&&i.isUp&&this.onClick(t,n)}}for(var e=this.actions,u=0,s=e.length;u<s;++u)e[u].onKeyUp(t,this,n);return!1},t.prototype.onStateChange=function(t,n,i){this.isStateChanged=!0,rt.update(t),n.isFocused?i.isFocused||this.onFocus(t):i.isFocused&&this.onBlur(t)},t.prototype.onFocus=function(t){for(var n=this.actions,i=0,r=n.length;i<r;++i)n[i].onFocus(t,this)},t.prototype.onBlur=function(t){for(var n=this.actions,i=0,r=n.length;i<r;++i)n[i].onBlur(t,this)},t.prototype.onRightClick=function(t,n){var i=t.state;i.isActionable&&(i.isRightClicked=!0);for(var r=this.actions,e=0,u=r.length;e<u;++e)r[e].onRightClick(t,this,n)},t.prototype.onRightDown=function(t,n){for(var i=this.actions,r=0,e=i.length;r<e;++r)i[r].onRightDowning(t,this,n);var u=t.state;if(!u.isRightDown)if(u.isRightPressed)for(u.addAll(lt.RIGHT_DOWN,lt.RIGHT_PRESSED),(h=rt.getLayer(t))&&(o=h.getFocusController()).focus(o.findParent(t)),r=0,e=i.length;r<e;++r){var s=i[r];s.onRightDown(t,this,n),s.onRightPressed(t,this,n)}else{var h,o;for(u.isRightDown=!1,(h=rt.getLayer(t))&&(o=h.getFocusController()).focus(o.findParent(t)),r=0,e=i.length;r<e;++r)i[r].onRightDown(t,this,n)}},t.prototype.onRightUp=function(t,n){var i=t.state;if(!i.isRightUp)if(i.isRightPressed){i.set(lt.RIGHT_UP,lt.RIGHT_PRESSED);for(var r=0,e=(s=this.actions).length;r<e;++r){var u=s[r];u.onRightUp(t,this,n),u.onRightUnpressed(t,this,n)}}else{var s;for(i.isRightUp=!0,r=0,e=(s=this.actions).length;r<e;++r)s[r].onRightUp(t,this,n)}},t.prototype.onRightUpOutside=function(t,n){var i=t.state;if(i.isRightPressed){i.set(lt.RIGHT_UP_OUTSIDE,lt.RIGHT_PRESSED);for(var r=0,e=(s=this.actions).length;r<e;++r){var u=s[r];u.onRightUpOutside(t,this,n),u.onRightUnpressed(t,this,n)}}else{var s;for(i.isRightUpOutside=!0,r=0,e=(s=this.actions).length;r<e;++r)s[r].onRightUpOutside(t,this,n)}},t.prototype.update=function(n,i){var r=n.data,e=this.effect<=i;if(r.isChanged||this.isStateChanged||e){this.isStateChanged=!1,r.isChanged=!1,e&&(this.effect=NaN),n.disallowUploadedUpdate(),this.onUpdate(n,i),n.allowUploadedUpdate();var u=this.isStateChanged;n.state.removeAll(t.TRANSIENT_STATES),this.isStateChanged=u}},t.prototype.onRender=function(t,n,i){for(var r=this.actions,e=0,u=r.length;e<u;++e)r[e].onRender(t,this,n,i);this.update(t,n)},t.prototype.onUpdate=function(t,n){var i=this.actions;if(0<i.length){this.written=$t.NONE;for(var r=0,e=i.length;r<e;++r)i[r].execute(t,this,n);this.doReset(t)}},t.prototype.doReset=function(t){var n=~this.written&this.reset;if(n!==$t.NONE){if(n&$t.POSITION_X&&(t.transform.position.x=this.x),n&$t.POSITION_Y&&(t.transform.position.y=this.y),n&$t.VISIBILITY&&(t.visible=!0),n&$t.COLOR_FILL){var i=this.fill;t.fill.set(void 0,i.color,i.alpha)}if(n&$t.COLOR_STROKE){var r=this.stroke;t.stroke.set(void 0,r.color,r.alpha)}if(n&$t.COLOR_TEXT){var e=this.text;t.text.set(void 0,e.color,e.alpha)}if(n&$t.COLOR_TEXT_OUTLINE){var u=this.text.outline;t.text.outline.set(void 0,u.color,u.alpha)}n&$t.HEIGHT&&(t.size.y=this.sizeY),n&$t.WIDTH&&(t.size.x=this.sizeX),n&$t.ROTATION&&(t.transform.rotation=this.rotation),n&$t.TEXT&&(t.text.value=this.text.value),n&$t.CURSOR&&(t.cursor=this.cursor)}},t.TRANSIENT_STATES=[lt.CLICKED,lt.DBL_CLICKED,lt.DOWN,lt.UP,lt.UP_OUTSIDE,lt.RIGHT_CLICKED,lt.RIGHT_DOWN,lt.RIGHT_UP,lt.RIGHT_UP_OUTSIDE,lt.ACTIVATED,lt.DEACTIVATED],t}(),qe=function(t){function n(n){return void 0===n&&(n=r.RECTANGLE),t.call(this,n)||this}return B(n,t),n.prototype.clone=function(){return new n(this.type).copy(this)},n.prototype.containsAbs=function(n,i,r,e,u,s,h){return!!t.prototype.containsAbsBBox.call(this,n,i,r,e)&&Ht(this,n,i,r,e,u,s)},n}(Ut),Qe=function(t){function n(n){return void 0===n&&(n=r.RECTANGLE_PIVOTED),t.call(this,n)||this}return B(n,t),n.prototype.toHitTestData=function(n,i){var r=t.prototype.toHitTestData.call(this,n,i);return r.x-=r.width,r.y-=r.height,r},n}(qe),$e=function(t){function n(n){var i=t.call(this)||this;i.name=n,i.interactive=!1,i.reference=0;var r=i.newShape();return r.parent=i,i._r=r,i.interactives=[],i}return B(n,t),Object.defineProperty(n.prototype,"width",{get:function(){return this._r.size.x},set:function(t){this._r.size.x=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"height",{get:function(){return this._r.size.y},set:function(t){this._r.size.y=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"background",{get:function(){return this._r.fill},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"state",{get:function(){return this._r.state},enumerable:!1,configurable:!0}),n.prototype.newShape=function(){var t=new Qe;return t.fill.set(!1,16777215,1),t.stroke.set(!1),t.state.add(Be.INTERACTIVE),t},n.prototype.initialize=function(t){var n=this.interactives,i=this._r,r=i.state.is(Be.INTERACTIVE),e=i.state.is(Be.DRAGGABLE),u=i.state.is(Be.PINCHABLE);if(e||u){var s=new Ze(i);i.runtime=s;var h=(e?Ie.DRAG:Ie.NONE)|(u?Ie.PINCH:Ie.NONE);s.actions.push(new xe("",ye.LAYER,h).toRuntime()),t.push(i),s.initialize(i)}(r||e||u)&&(i.interactive=!0,n.push(i)),this.doInitialize(this.children,n)},n.prototype.doInitialize=function(t,n){for(var i=0,r=t.length;i<r;++i){var e=t[i],u=e.runtime;if(u)if(e.interactive||u.interactive)n.push(e);else{var s=e.cursor;null!=s&&0<s.length&&n.push(e)}var h=e.children;0<h.length&&this.doInitialize(h,n)}},n.prototype.update=function(t){this.doUpdate(this.children,t)},n.prototype.doUpdate=function(t,n){for(var i=0,r=t.length;i<r;++i){var e=t[i];e.update(n);var u=e.children;0<u.length&&this.doUpdate(u,n)}},n.prototype.hitTestInteractives=function(t){for(var n=this.bu,i=this.interactives,r=i.length-1;0<=r;--r){var e=i[r];if(e.visible&&(e.toLocal(t,void 0,n),null!=e.contains(n.x,n.y)))return e}return null},n.prototype.addUuid=function(t){for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].addUuid(t)},n.prototype.updateUuid=function(t){for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].updateUuid(t)},n.prototype.destroy=function(){if(!this._destroyed){for(var n=this.children,i=n.length-1;0<=i;--i)n[i].destroy();n.length=0,t.prototype.destroy.call(this)}},n.prototype.serialize=function(t,n,i){for(var r=this.children,e=0,u=r.length;e<u;++e){var s=r[e].serialize(n);s[16]=t,i.push(s)}var h=this._r,o=n.addResource(this.name||""),a=(this.visible?1:0)|(h.state.is(Be.INVISIBLE)?0:2),c=this.position,f=h.size,l=h.fill.serialize(n),v=h.state.is(Be.INTERACTIVE)?1:0,b=h.state.is(Be.DRAGGABLE)?2:0,d=h.state.is(Be.PINCHABLE)?4:0;return[o,a,c.x,c.y,f.x,f.y,l,v|b|d]},n.deserialize=function(t,i,r,e){var u,s,h,o=new n(this.deserializeName(t[0],i)),a=o._r,c=t[1];if(null!=c){var f=i.mode!==gr.VIEWER;!f||1&c||(o.visible=!1),2&c||(a.state.add(Be.INVISIBLE),f||(o.visible=!1))}var l=t[2],v=t[3];o.position.set(l,v);var b=null!==(u=t[4])&&void 0!==u?u:r,d=null!==(s=t[5])&&void 0!==s?s:e;a.size.set(b,d);var g=t[6];null!=g&&a.fill.deserialize(g,i);var m=null!==(h=t[7])&&void 0!==h?h:1;return a.state.set(Be.INTERACTIVE,!!(1&m)),a.state.set(Be.DRAGGABLE,!!(2&m)),a.state.set(Be.PINCHABLE,!!(4&m)),o},n.deserializeName=function(t,n){if(at(t))return t;var i=n.resources;return 0<=t&&t<=i.length?i[t]:""},n}(Te),tu=!1,nu=function(){return tu},iu=function(n){function i(t){var i=n.call(this)||this;return i.condition=rn.ofString(t.condition),i.utils=new Map,i}return B(i,n),i.prototype.getUtil=function(t,n){var i=this.utils,r=i.get(t);return null==r&&(r=this.newUtil(t,n),i.set(t,r)),r},i.prototype.newUtil=function(t,n){return new Je(t,this.newOperation(t,n),K.getInstance().get("DHtmlElement"),this.newUtilOptions(t,n))},i.prototype.newOperation=function(t,n){var i=this;return{getElementRect:function(r,e,u){return i.getElementRect(t,n,r,e,u)},getElementMatrix:function(){return i.getElementMatrix(t,n)},getClipperRect:function(r,e,u){return i.getClipperToRect(t,n,r,e,u)},getClipperExRects:function(n){i.getClipperExRects(t,n)},getPadding:function(){return i.getPadding(t,n)},containsPoint:function(r){return i.containsPoint(t,n,r)},onStart:function(){},onCancel:function(){},onEnd:function(){}}},i.prototype.newUtilOptions=function(t,n){return{element:{creator:this.newElementCreator(t,n)},when:this.toWhen(t,n),clipper:{extended:nu()}}},i.prototype.toWhen=function(t,n){var i=this.condition(t,Date.now(),nn);if(null!=i&&i in Ye)return Ye[i]},i.prototype.containsPoint=function(n,r,e){var u;if(n.visible){var s=null!==(u=i.WORK)&&void 0!==u?u:i.WORK=new t.Point;return n.toLocal(e,void 0,s),null!=n.contains(s.x,s.y)}return!1},i.prototype.getPadding=function(t,n){return null},i.prototype.getElementRect=function(t,n,i,r,e){var u=t.transform.pivot,s=t.size,h=s.x,o=s.y;return e.x=-.5*h+u.x,e.y=-.5*o+u.y,e.width=h,e.height=o,e},i.prototype.getElementMatrix=function(t,n){return t.updateTransform(),t.transform.worldTransform},i.prototype.getClipperToRect=function(t,n,i,r,e){var u=Ge.toContainer(t);return Je.getClipperRect(u,t,i,r,e)},i.prototype.getClipperExRects=function(t,n){n.begin();var i=t.root.parent;if(i instanceof $e){var r=i.parent;if(null!=r){var e=r.children,u=e.indexOf(i);if(0<=u)for(var s=u+1,h=e.length;s<h;++s){var o=e[s];if(o.visible){var a=o.width,c=o.height,f=o.transform.worldTransform,l=f.a,v=f.b,b=f.c,d=f.d,g=f.tx,m=f.ty;n.add(g,m,l*a+b*c+g,v*a+d*c+m)}}}}n.end()},i.prototype.onRender=function(t,n,i,r){this.getUtil(t,n).onRender(r)},i.prototype.onFocus=function(t,n){this.getUtil(t,n).onFocus()},i.prototype.onBlur=function(t,n){this.getUtil(t,n).onBlur()},i.prototype.onDowning=function(t,n,i){this.getUtil(t,n).onDowning(i)},i.prototype.onDown=function(t,n,i){this.getUtil(t,n).onDown(i)},i.prototype.onDblClick=function(t,n,i,r){this.getUtil(t,n).onDblClick(i,r)},i}(en),ru=function(t){function n(n){var i=t.call(this,n)||this;return i.elementCreator=rn.ofElementOrNull(n.value),i.noPointerEvent=n.subtype===ke.HTML_ELEMENT_WITHOUT_POINTER_EVENTS,i}return B(n,t),n.prototype.newUtil=function(n,i){return this.noPointerEvent&&n.state.add(We.NO_POINTER_EVENTS),t.prototype.newUtil.call(this,n,i)},n.prototype.newElementCreator=function(t,n){var i=this.elementCreator;if(i)return function(n){return i(t,Date.now(),nn,n)}},n}(iu),eu=function(t){function n(n,i,r,e){var u,s,h,o,a,c,f=this;(f=t.call(this,n,i,r,e)||this).Tu=i,f.Vu=function(t){f.onInputKeyDown(t)},f.Wu=function(){f.onInputChange()},f.Xu=function(t){f.onInputInput(t)},f.Ku=null!==(u=null==e?void 0:e.description)&&void 0!==u?u:"";var l=null==e?void 0:e.editing;return f.Yu=null!==(o=null!==(s=null==l?void 0:l.formatter)&&void 0!==s?s:null===(h=null==e?void 0:e.text)||void 0===h?void 0:h.formatter)&&void 0!==o?o:r.getEditingFormatter(),f.Ju=null!==(a=null==l?void 0:l.unformatter)&&void 0!==a?a:r.getEditingUnformatter(),f.Zu=null!==(c=null==l?void 0:l.validator)&&void 0!==c?c:r.getEditingValidator(),f}return B(n,t),n.prototype.onEnd=function(){t.prototype.onEnd.call(this),this.onInputChange()},n.prototype.onElementAttached=function(n,i,r){n.value=this.fromValue(this.Tu.getValue()),n.addEventListener("change",this.Wu),n.addEventListener("input",this.Xu),t.prototype.onElementAttached.call(this,n,i,r)},n.prototype.onElementDetached=function(n,i,r){t.prototype.onElementDetached.call(this,n,i,r),n.removeEventListener("change",this.Wu),n.removeEventListener("input",this.Xu)},n.prototype.onInputKeyDown=function(t){Xi.isOkKey(t)?(this.end(),this.Tu.onEnter()):Xi.isCancelKey(t)&&this.cancel()},n.prototype.toElementFocused=function(n){t.prototype.toElementFocused.call(this,n),n.scrollTop=0,n.scrollLeft=0},n.prototype.onInputChange=function(){if(this.isShown()){var t=this.element;if(null!=t){var n=this.Tu,i=this.toValue(t.value),r=n.getValue();r!==i&&n.onValueChange(i,r)}}},n.prototype.toValue=function(t){return this.Ju(t,this)},n.prototype.fromValue=function(t){return void 0!==t?this.Yu(t,this):""},n.prototype.onInputInput=function(t){var n=t.target;(n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement)&&this.Tu.onValueInput(this.toValue(n.value))},n.prototype.validate=function(){var t=this.Tu.getValue();if(void 0!==t){var n=this.Zu(t,this);if(this.qu!==n){this.qu=n;var i=this.Jn.state;i.isInvalid=null!=n,i.isHovered&&this.Tu.applyTitle()}return n}return null},n.prototype.applyTitle=function(){var t=this.qu;if(at(t)){var n=rt.getLayer(this.Jn);return n&&(n.view.title=t),!0}return!1},n}(Je),uu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.onElementAttached=function(n,i,r){n.addEventListener("keydown",this.Vu),t.prototype.onElementAttached.call(this,n,i,r)},n.prototype.onElementDetached=function(n,i,r){n.removeEventListener("keydown",this.Vu),t.prototype.onElementDetached.call(this,n,i,r)},n}(eu),su=function(t){function n(n,i,r,e){var u,s,h,o=this;return(o=t.call(this,n,i,r,e)||this).Qu=null!==(u=null==e?void 0:e.step)&&void 0!==u?u:r.getStep(),o.$u=null!==(s=null==e?void 0:e.min)&&void 0!==s?s:r.getMin(),o.ts=null!==(h=null==e?void 0:e.max)&&void 0!==h?h:r.getMax(),o}return B(n,t),Object.defineProperty(n.prototype,"step",{get:function(){return this.Qu},set:function(t){this.Qu!==t&&(this.Qu=t,this.onStepChange())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"min",{get:function(){return this.$u},set:function(t){this.$u!==t&&(this.$u=t,this.onMinChange())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"max",{get:function(){return this.ts},set:function(t){this.ts!==t&&(this.ts=t,this.onMaxChange())},enumerable:!1,configurable:!0}),n.prototype.toValue=function(n){var i=t.prototype.toValue.call(this,n);if(i==i){var r=this.$u;if(null!=r&&i<r)return r;var e=this.ts;return null!=e&&e<i?e:i}return 0},n.prototype.fromValue=function(t){return void 0!==t?this.Yu(t,this):"0"},n.prototype.onStepChange=function(){if(this.isShown()){var t=this.element;t&&this.updateStep(t)}},n.prototype.onMinChange=function(){if(this.isShown()){var t=this.element;t&&this.updateMin(t)}},n.prototype.onMaxChange=function(){if(this.isShown()){var t=this.element;t&&this.updateMax(t)}},n.prototype.updateStep=function(t){var n=this.step;t.step=null!=n?"".concat(n):"any"},n.prototype.updateMin=function(t){var n=this.min;null!=n?t.min="".concat(n):t.removeAttribute("min")},n.prototype.updateMax=function(t){var n=this.max;null!=n?t.max="".concat(n):t.removeAttribute("max")},n.prototype.onElementAttached=function(n,i,r){n.type="number",t.prototype.onElementAttached.call(this,n,i,r),this.updateStep(n),this.updateMin(n),this.updateMax(n)},n}(uu),hu={EMIT_EVENT:0,WRITE_BOTH:1,WRITE_LOCAL:2,WRITE_REMOTE:3},ou=function(){function t(){}return t.execute=function(t,n,i,r,e){switch(n){case hu.EMIT_EVENT:t.emit(i,t,r),Ge.emit(t,i,r,e);break;case hu.WRITE_LOCAL:Ge.writeLocal(t,i,r,e);break;case hu.WRITE_REMOTE:Ge.writeRemote(t,i,r);break;case hu.WRITE_BOTH:Ge.writeLocal(t,i,r,e),Ge.writeRemote(t,i,r)}},t}(),au=function(t){function n(n){var i=t.call(this,n)||this;return i.target=rn.ofStringOrNull(n.target),i.onInputAction=n.onInputAction,i}return B(n,t),n.prototype.newOperation=function(t,n){var i=this;return{getElementRect:function(r,e,u){return i.getElementRect(t,n,r,e,u)},getElementMatrix:function(){return i.getElementMatrix(t,n)},getClipperRect:function(r,e,u){return i.getClipperToRect(t,n,r,e,u)},getClipperExRects:function(n){i.getClipperExRects(t,n)},getPadding:function(){return i.getPadding(t,n)},containsPoint:function(r){return i.containsPoint(t,n,r)},onStart:function(){t.text.enable=!1},onCancel:function(){t.text.enable=!0},onEnd:function(){},getValue:function(){return i.getUtil(t,n).toValue(t.text.value)},onValueInput:function(t){},onValueChange:function(r,e){i.onValueChange(t,n,r,e)},onEnter:function(){},applyTitle:function(){}}},n.prototype.newElementCreator=function(t,n){},n.prototype.getPadding=function(t,n){return t.text.padding},n.prototype.onValueChange=function(t,n,i,r){t.text.value=this.getUtil(t,n).fromValue(i);var e=Date.now(),u=this.target(t,e,nn);null!=u&&ou.execute(t,this.onInputAction,u,i,e)},n}(iu),cu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n}(au),fu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n}(cu),lu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.newUtil=function(t,n){return new su(t,this.newOperation(t,n),K.getInstance().get("DInputInteger"),this.newUtilOptions(t,n))},n}(fu),vu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.newUtil=function(t,n){return new su(t,this.newOperation(t,n),K.getInstance().get("DInputReal"),this.newUtilOptions(t,n))},n}(fu),bu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.onElementAttached=function(n,i,r){n.type="text",t.prototype.onElementAttached.call(this,n,i,r)},n}(uu),du=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.newUtil=function(t,n){return new bu(t,this.newOperation(t,n),K.getInstance().get("DInputText"),this.newUtilOptions(t,n))},n}(cu),gu=function(t){function n(n){var i=t.call(this,n,$t.NONE)||this;return i.target=rn.ofStringOrNull(n.target),i.value=rn.ofUnknown(n.value),i}return B(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,nn)){var r=this.target(t,i,nn);null!=r&&this.write(t,r,this.value(t,i,nn),i)}},n}(un),mu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.write=function(t,n,i,r){Ge.writeLocal(t,n,i,r),Ge.writeRemote(t,n,i)},n}(gu),wu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.write=function(t,n,i,r){Ge.writeLocal(t,n,i,r)},n}(gu),pu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.write=function(t,n,i,r){Ge.writeRemote(t,n,i)},n}(gu),Ou=function(t){function n(n,i,r,e,u){var s=t.call(this,gn.MISC,i,n)||this;return s.target=r,s.onInputAction=e,s.value=u,s}return B(n,t),n.prototype.toRuntime=function(){switch(this.subtype){case ke.INPUT_TEXT:return new du(this);case ke.INPUT_INTEGER:return new lu(this);case ke.INPUT_REAL:return new vu(this);case ke.EMIT_EVENT:return new Ve(this);case ke.WRITE_BOTH:return new mu(this);case ke.WRITE_LOCAL:return new wu(this);case ke.WRITE_REMOTE:return new pu(this);case ke.HTML_ELEMENT:case ke.HTML_ELEMENT_WITHOUT_POINTER_EVENTS:return new ru(this)}},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.target),r=t.addResource(this.value);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(i,",").concat(this.onInputAction,",").concat(r,"]"))},n.deserialize=function(t,i){var r=i.resources,e=wn.toResource(1,t,r),u=wn.toResource(3,t,r),s=wn.toResource(5,t,r);return new n(t[2],e,u,t[4],s)},n}(dn),Du=function(t){function n(n){var i=t.call(this,n,$t.NONE)||this;return i.target=rn.ofUnknown(n.target),i}return B(n,t),n.prototype.execute=function(t,n,i){this.condition(t,i,nn)&&this.target(t,i,nn)},n}(un),Eu=function(t){function n(n,i){var r=t.call(this,gn.MISC,n,ke.EXECUTE)||this;return r.target=i,r}return B(n,t),n.prototype.toRuntime=function(){return new Du(this)},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.target);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(i,"]"))},n.deserialize=function(t,i){var r=i.resources;return new n(wn.toResource(1,t,r),wn.toResource(3,t,r))},n}(dn),Mu=function(t){function n(n,i){var r=t.call(this,n,$t.NONE)||this;return r.subtype=i,r.target=rn.ofStringOrNull(n.target),r.inNewWindow=n.inNewWindow,r}return B(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,nn)){var r=this.target(t,i,nn);null!=r&&Ge.open(t,this.subtype,r,this.inNewWindow)}},n}(un),Su={DIAGRAM_LEGACY:0,PAGE_LEGACY:1,PAGE_INPLACE_LEGACY:2,DIALOG_TEXT:3,DIALOG_INTEGER:4,DIALOG_REAL:5,DIALOG_BOOLEAN:6,DIALOG_DATE:7,DIALOG_TIME:8,DIALOG_DATETIME:9,DIAGRAM:10,PAGE:11,DIALOG:12,EXTENSION:vr.EXTENSION},Tu=function(t){function n(n,i,r,e){var u=t.call(this,gn.OPEN,i,n)||this;return u.target=r,u.inNewWindow=e,u}return B(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.target===i.target&&this.inNewWindow===i.inNewWindow},n.prototype.toRuntime=function(){switch(this.subtype){case Su.DIAGRAM:return new Mu(this,vr.DIAGRAM);case Su.PAGE:return new Mu(this,vr.PAGE)}},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.target),r=this.inNewWindow?1:0;return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(i,",").concat(r,"]"))},n.deserialize=function(t,i){var r=wn.toResource(1,t,i.resources),e=wn.toResource(3,t,i.resources);return new n(this.toSubType(t),r,e,this.inNewWindow(t))},n.toSubType=function(t){if(6!==t.length)return t[2];switch(t[2]){case Su.DIAGRAM_LEGACY:return Su.DIAGRAM;case Su.PAGE_LEGACY:case Su.PAGE_INPLACE_LEGACY:return Su.PAGE}},n.inNewWindow=function(t){if(6!==t.length)return!!t[4];switch(t[2]){case Su.DIAGRAM_LEGACY:return!1;case Su.PAGE_LEGACY:return!0;case Su.PAGE_INPLACE_LEGACY:return!1}},n}(dn),ju={TOP:0,TOP_LEFT:1,TOP_CENTER:2,TOP_RIGHT:3,LEFT:4,LEFT_TOP:5,LEFT_MIDDLE:6,LEFT_BOTTOM:7,RIGHT:8,RIGHT_TOP:9,RIGHT_MIDDLE:10,RIGHT_BOTTOM:11,BOTTOM:12,BOTTOM_LEFT:13,BOTTOM_CENTER:14,BOTTOM_RIGHT:15,OVER:16},Nu=function(){function t(){}return t.attach=function(t,n,i,r,e,u,s){var h=t.width,o=t.height,a=0;switch(s){case ju.LEFT:case ju.LEFT_TOP:case ju.LEFT_MIDDLE:case ju.LEFT_BOTTOM:(a=n.left-h-i)<i&&e-i<(a=n.right+i)+h&&(a=i);break;case ju.RIGHT:case ju.RIGHT_TOP:case ju.RIGHT_MIDDLE:case ju.RIGHT_BOTTOM:e-i<(a=n.right+i)+h&&(a=n.left-h-i)<i&&(a=e-h-i);break;case ju.TOP:case ju.TOP_LEFT:case ju.BOTTOM:case ju.BOTTOM_LEFT:a=this.adjust(n.left,h,i,e);break;case ju.TOP_RIGHT:case ju.BOTTOM_RIGHT:a=this.adjust(n.right-h,h,i,e);break;case ju.TOP_CENTER:case ju.BOTTOM_CENTER:case ju.OVER:a=this.adjust(.5*(n.left+n.right-h),h,i,e)}var c=0;switch(s){case ju.LEFT:case ju.LEFT_TOP:case ju.RIGHT:case ju.RIGHT_TOP:c=this.adjust(n.top,o,r,u);break;case ju.LEFT_MIDDLE:case ju.RIGHT_MIDDLE:case ju.OVER:c=this.adjust(.5*(n.top+n.bottom-o),o,r,u);break;case ju.LEFT_BOTTOM:case ju.RIGHT_BOTTOM:c=this.adjust(n.bottom,o,r,u);break;case ju.TOP:case ju.TOP_LEFT:case ju.TOP_RIGHT:case ju.TOP_CENTER:(c=n.top-o-r)<r&&u<(c=n.bottom+r)+o&&(c=r);break;case ju.BOTTOM:case ju.BOTTOM_LEFT:case ju.BOTTOM_RIGHT:case ju.BOTTOM_CENTER:u-r<(c=n.bottom+r)+o&&(c=n.top-o-r)<r&&(c=u-o-r)}t.position.set(a,c)},t.adjust=function(t,n,i,r){return t<i?r-i<t+n?.5*(r-n):i:r-i<t+n?r<n?.5*(r-n):r-n-i:t},t}(),Iu={NONE:0,ESC:1,CLICK_OUTSIDE:2},Cu={DIRTY:0,CLEAN:1},Au=function(){function n(t,n){var i;this.p=t,this.kn=n,n.enable&&(this.ns=this.newUtil()),this.Cr=Di(null!==(i=n.mode)&&void 0!==i?i:Cu.DIRTY,Cu),this.rs=!0,this.vn=!1}return Object.defineProperty(n.prototype,"parent",{get:function(){return this.p},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"mode",{get:function(){return this.Cr},set:function(t){this.Cr=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"constraint",{get:function(){var t,n,i=this.ji;return null==i&&(i=null!==(n=null===(t=this.kn)||void 0===t?void 0:t.constraint)&&void 0!==n?n:this.newConstraint(),this.ji=i),i},set:function(t){this.ji=t},enumerable:!1,configurable:!0}),n.prototype.newConstraint=function(){var t=this;return function(n,i,r,e){t.toConstrained(n,i,r,e)}},n.prototype.isDirty=function(){return this.vn},n.prototype.isClean=function(){return!this.vn},n.prototype.toClean=function(){this.vn&&(this.vn=!1)},n.prototype.newUtil=function(){var n=this,i=new t.Point,r=this.p,e=r.position;return new or({bind:r,checker:{start:function(t){if(t.target!==r)return!1;i.copyFrom(t.data.global),r.toLocal(i,void 0,i,!0);var n=i.x,e=i.y;return!(n<0||e<0||r.width<n||r.height<e)}},on:{start:function(){i.copyFrom(e)},move:function(t,u,s){i.set(i.x+u,i.y+s),n.vn||(n.vn=!0,r.setX(e.x),r.setY(e.y));var h=r.layer;null!=h&&n.constraint(r,h,i.x,i.y)}}})},n.prototype.toConstrained=function(i,r,e,u){var s,h=i.position;if(r){var o=i.getBounds(!1,null!==(s=n.WORK_BOUNDS)&&void 0!==s?s:n.WORK_BOUNDS=new t.Rectangle),a=o.x+e-h.x,c=o.y+u-h.y,f=Math.min(Math.max(0,a),r.width-o.width),l=Math.min(Math.max(0,c),r.height-o.height);h.set(e+f-a,u+l-c)}else h.set(e,u)},n}(),Ru={MODAL:0,MODELESS:1,MENU:2},Lu={MODAL:"MODAL",MODELESS:"MODELESS",MENU:"MENU"},yu=function(){function n(){}return n.apply=function(t,n){var i=this;t.on(Ki.down,(function(r){if(r.target===t){var e=i.point;e.copyFrom(r.data.global),t.toLocal(e,void 0,e,!0);var u=e.x,s=e.y;(u<0||s<0||t.width<u||t.height<s)&&setTimeout((function(){n(r)}),0)}}))},n.point=new t.Point,n}(),ku=function(){function t(t){this.es=null,this.us=null==(null==t?void 0:t.parent)?rt.last():null}return Object.defineProperty(t.prototype,"picked",{get:function(){return this.es},enumerable:!1,configurable:!0}),t.prototype.pick=function(t){var n=this.es;if(null==n){if(!(n=rt.getLayerOverlay(t))){var i=this.us;n=i?i.getLayerOverlay():rt.last().getLayerOverlay()}this.es=n}return n},t}(),xu=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return B(i,n),i.prototype.init=function(t){var i,r,e=this;n.prototype.init.call(this,t),this.ss=function(){e.onPrerender()},this.es=null;var u=this.theme,s=Di(null!==(i=null==t?void 0:t.mode)&&void 0!==i?i:u.getMode(),Ru);this.Cr=s,this.hs=null!==(r=null==t?void 0:t.sticky)&&void 0!==r?r:u.isSticky(s);var h=this.toCloseOn(s,u,t);switch(this.os=h,this.Tt=this.toAlign(s,u,t),this.cs=new ku,this.nr=new Au(this,this.toGestureOptions(s,u,t)),this.visible=!1,s){case Ru.MODAL:this.state.addAll(ht.FOCUS_ROOT,Lu.MODAL);break;case Ru.MODELESS:this.state.add(Lu.MODELESS);break;case Ru.MENU:this.state.addAll(ht.FOCUS_ROOT,Lu.MENU)}h&Iu.CLICK_OUTSIDE&&yu.apply(this,(function(){e.onCloseOn()}))},i.prototype.toCloseOn=function(t,n,i){var r=null==i?void 0:i.closeOn;if(null==r)return n.closeOn(t);if(Rt(r)){for(var e=Iu.NONE,u=0,s=r.length;u<s;++u)e|=Iu[r[u]];return e}return at(r)?Iu[r]:r},i.prototype.toAlign=function(t,n,i){var r=null==i?void 0:i.align;return null===r?null:void 0===r?n.getAlign(t):Di(r,ju)},Object.defineProperty(i.prototype,"mode",{get:function(){return this.Cr},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"align",{get:function(){return this.Tt},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"algin",{set:function(t){this.Tt=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"gesture",{get:function(){return this.nr},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"layer",{get:function(){return this.es},enumerable:!1,configurable:!0}),i.prototype.toGestureOptions=function(t,n,i){var r=null==i?void 0:i.gesture;return!0===r?{enable:!0,mode:n.getGestureMode(t)}:!1===r?{enable:!1,mode:n.getGestureMode(t)}:null!=r?(void 0===r.enable&&(r.enable=n.isGestureEnabled(t)),void 0===r.mode&&(r.mode=n.getGestureMode(t)),r):{enable:n.isGestureEnabled(t),mode:n.getGestureMode(t)}},i.prototype.onParentResize=function(t,i,r){if(this.isOpened()){var e=this.es;if(null!=e){var u=this.nr;if(u.isDirty()){var s=this.position;u.constraint(this,e,s.x,s.y)}}}n.prototype.onParentResize.call(this,t,i,r)},i.prototype.getAnimation=function(){var t,n,i=this,r=this.di;return void 0===r&&((r=null!==(n=null===(t=this.kn)||void 0===t?void 0:t.animation)&&void 0!==n?n:this.theme.newAnimation(this.Cr))&&(r.target=this,r.on("end",(function(t){i.onAnimationEnd(t)}))),this.di=r),r},i.prototype.onAnimationEnd=function(t){if(t)if(this.Cr===Ru.MODELESS)this.hide();else{var n=this.parent;n&&n.removeChild(this)}else{var i=rt.getLayer(this);if(i){var r=i.getFocusController();this.fs=r.get(),r.focus(this.findFirstFocusable(r)||this)}}},i.prototype.findFirstFocusable=function(t){return t.find(this,!1,!0,!0)},i.prototype.open=function(t){var n=this,i=this.ls;if(null==i){i=new Promise((function(t,i){n.vs=t,n.bs=i})),this.ls=i,this.gs=t;var r=null;switch(this.Cr){case Ru.MODAL:case Ru.MENU:(r=this.cs.pick(this)).stage.addChild(this);break;case Ru.MODELESS:r=rt.getLayer(this),this.show()}this.es=r;var e=this.nr;if(e.mode===Cu.CLEAN&&e.toClean(),null!=r)if(e.isClean()){var u=r.renderer,s=this.ss;this.hs?u.on("prerender",s):u.once("prerender",s)}else{var h=this.position;e.constraint(this,r,h.x,h.y)}this.onOpen()}return i},i.prototype.onPrerender=function(){var n,r=this.es;if(null!=r){var e=this.Tt,u=this.gs;if(null!=e&&null!=u){var s=this.Cr,h=u.getBounds(!1,null!==(n=i.WORK_BOUNDS)&&void 0!==n?n:i.WORK_BOUNDS=new t.Rectangle),o=this.theme;Nu.attach(this,h,o.getOffsetX(s),o.getOffsetY(s),r.width,r.height,e)}else this.position.set(.5*(r.width-this.width),.5*(r.height-this.height))}},i.prototype.onOpen=function(){this.emit("open",this);var t=this.getAnimation();t?t.start():this.Cr===Ru.MENU&&(this.visible=!0,this.onAnimationEnd(!1))},i.prototype.isOpened=function(){return null!=this.ls},i.prototype.close=function(){this.doReject()},i.prototype.doResolve=function(t){var n=this.vs;n&&(this.ls=void 0,this.vs=void 0,this.bs=void 0,this.onClose(),n(t))},i.prototype.doReject=function(t){var n=this.bs;n&&(this.ls=void 0,this.vs=void 0,this.bs=void 0,this.onClose(),n(t))},i.prototype.onClose=function(){var t=this.es,n=this.fs;if(null!=n)if(this.fs=null,t){var i=rt.getLayer(n);null!=i&&t!==i&&i.view.focus(),t.getFocusController().focus(n)}else this.blur(!0);else this.blur(!0);t&&(t.renderer.off("prerender",this.ss),this.es=null),this.gs=null;var r=this.getAnimation();r?r.start(!0):(this.visible=!1,this.onAnimationEnd(!0)),this.emit("close",this)},i.prototype.onKeyDown=function(t){return this.os&Iu.ESC&&Xi.isCancelKey(t)&&this.onCloseOn(),n.prototype.onKeyDown.call(this,t)},i.prototype.onCloseOn=function(){this.close()},i.prototype.containsGlobalPoint=function(t){switch(this.Cr){case Ru.MODAL:case Ru.MENU:return!0;case Ru.MODELESS:return n.prototype.containsGlobalPoint.call(this,t)}},i.prototype.getType=function(){return"DDialog"},i}(Qi),Bu={VERTICAL:0,HORIZONTAL:1},_u=function(t){function n(n){var i=t.call(this,n)||this;return i.visible=!1,i}return B(n,t),n.prototype.getType=function(){return"DLayoutSpace"},n}(Qi),Pu=function(t){return t instanceof Qi&&(t.visible||t instanceof _u)},Uu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.init=function(n){t.prototype.init.call(this,n);var i=this.theme;this.Wr=function(t,n){var i,r,e=null==n?void 0:n.margin;if(null!=e){if(mn(e))return{horizontal:e,vertical:e};var u=t.getMargin();return{horizontal:null!==(i=e.horizontal)&&void 0!==i?i:u,vertical:null!==(r=e.vertical)&&void 0!==r?r:u}}return{horizontal:u=t.getMargin(),vertical:u}}(i,n),this.Yt=function(t,n){var i=null==n?void 0:n.direction;return null!=i?at(i)?Bu[i]:i:t.getDirection()}(i,n),this.ws=function(t,n){var i=null==n?void 0:n.corner;if(null!=i&&!mn(i)){var r=i.adjust;if(null!=r)return r}return t.getCornerAdjust()}(i,n),this.ps=function(t,n){if(n){var i=n.row;if(null!=i)return i;var r=n.column;if(null!=r)return r}return t.getMultiplicity()}(i,n),this.$n=function(t,n){var i;return null!==(i=null==n?void 0:n.reverse)&&void 0!==i?i:t.getReverse()}(i,n)},Object.defineProperty(n.prototype,"margin",{get:function(){return this.Wr},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"multiplicity",{get:function(){return this.ps},enumerable:!1,configurable:!0}),n.prototype.getWeightTotal=function(){for(var t=this.children,n=0,i=this.ps,r=this.$n,e=0,u=t.length;e<u;){for(var s=-1,h=0;h<i&&e+h<u;++h){var o=t[r?u-1-(e+h):e+h];if(Pu(o)){var a=o.getClearType();if(0!==h&&a&Pi.BEFORE)break;if(s=Math.max(s,o.weight),a&&Pi.AFTER){h+=1;break}}else e+=1,h-=1}e+=h,0<=s&&(n+=s)}return n},n.prototype.getSpaceLeft=function(t,n){var i=this.children,r=this.ps,e=this.$n;if(this.Yt===Bu.VERTICAL){for(var u=t,s=0,h=0,o=i.length;h<o;){for(var a=0,c=-1,f=0;f<r&&h+f<o;++f){var l=i[e?o-1-(h+f):h+f];if(Pu(l)){var v=l.getClearType();if(0!==f&&v&Pi.BEFORE)break;if(a=(c=Math.max(c,l.weight))<0?Math.max(a,l.height+s):s,v&Pi.AFTER){f+=1;break}}else h+=1,f-=1}h+=f,u-=a,s=n}return Math.max(0,u)}for(u=t,s=0,h=0,o=i.length;h<o;){var b=0;for(c=-1,f=0;f<r&&h+f<o;++f)if(l=i[e?o-1-(h+f):h+f],Pu(l)){if(v=l.getClearType(),0!==f&&v&Pi.BEFORE)break;if(b=(c=Math.max(c,l.weight))<0?Math.max(b,l.width+s):s,v&Pi.AFTER){f+=1;break}}else h+=1,f-=1;h+=f,u-=b,s=n}return Math.max(0,u)},n.prototype.calcSpaceLeft=function(t,n,i,r){return t?0:this.getSpaceLeft(n-i,r)},n.prototype.onRefit=function(){var i=this.children,r=this.zn,e=r.getTop(),u=r.getBottom(),s=r.getLeft(),h=r.getRight(),o=this.Wr,a=o.vertical,c=o.horizontal,f=this.getWeightTotal(),l=this.ps,v=this.$n,b=this.Bn,d=null;if(this.ws){var g=4+(i.length<<1);(null==n.CORNER_ADJUST_WORK||n.CORNER_ADJUST_WORK.length<g)&&(n.CORNER_ADJUST_WORK=new Float32Array(g)),(d=n.CORNER_ADJUST_WORK)[0]=-2,d[1]=-2,d[g-2]=-3,d[g-1]=-3}if(this.Yt===Bu.VERTICAL){var m=0,w=e-a;if(0<f){for(var p=1/f,O=this.calcSpaceLeft(b.height.isOn,this.height,e+u,a),D=0,E=i.length;D<E;){for(var M=s-c,S=0,T=0;T<l&&D+T<E;++T){var j=i[v?E-1-(D+T):D+T];if(Pu(j)){var N=j.getClearType();if(0!==T&&N&Pi.BEFORE)break;if(j.position.set(c+M,a+w),0<=(F=j.weight)&&(j.height=O*(F*p)),M+=c+j.width,S=Math.max(S,j.height),N&Pi.AFTER){null!=d&&(d[0+(G=D+T+1<<1)]=T,d[G+1]=m),T+=1;break}null!=d&&(d[0+(G=D+T+1<<1)]=T,d[G+1]=m)}else null!=d&&(d[0+(G=D+T+1<<1)]=T-1,d[G+1]=m),D+=1,T-=1}w+=a+S,D+=T,m+=1}if(null!=d)for(D=0,E=i.length;D<E;++D)if(j=i[v?E-1-D:D],Pu(j)){var I=d[0+(H=2+(D<<1))],C=d[H+1],A=-2;if(!((N=j.getClearType())&Pi.BEFORE)){var R=this.findRowIndexPrevious(H,C,d);this.hasClearTypeAfter(i,R)||(A=d[R])}var L=-2;if(!(N&Pi.AFTER)){var y=this.findRowIndexNext(H,C,d);this.hasClearTypeBefore(i,y)||(L=d[y])}var k=this.countColumn(H,C,d);j.corner.mask=this.toCornerMaskColumn(A,I,L,k)}}else{for(D=0,E=i.length;D<E;){for(M=s-c,S=0,T=0;T<l&&D+T<E;++T)if(j=i[v?E-1-(D+T):D+T],Pu(j)){if(N=j.getClearType(),0!==T&&N&Pi.BEFORE)break;if(j.position.set(c+M,a+w),0<=(F=j.weight)&&(j.height=0),M+=c+j.width,S=Math.max(S,j.height),N&Pi.AFTER){null!=d&&(d[0+(G=D+T+1<<1)]=T,d[G+1]=m),T+=1;break}null!=d&&(d[0+(G=D+T+1<<1)]=T,d[G+1]=m)}else null!=d&&(d[0+(G=D+T+1<<1)]=T-1,d[G+1]=m),D+=1,T-=1;w+=a+S,D+=T,m+=1}if(null!=d)for(D=0,E=i.length;D<E;++D)j=i[v?E-1-D:D],Pu(j)&&(I=d[0+(H=2+(D<<1))],C=d[H+1],A=-2,(N=j.getClearType())&Pi.BEFORE||(R=this.findRowIndexPrevious(H,C,d),this.hasClearTypeAfter(i,R)||(A=d[R])),L=-2,N&Pi.AFTER||(y=this.findRowIndexNext(H,C,d),this.hasClearTypeBefore(i,y)||(L=d[y])),k=this.countColumn(H,C,d),j.corner.mask=this.toCornerMaskColumn(A,I,L,k))}}else{var x=0;if(M=s-c,0<f){for(p=1/f,O=this.calcSpaceLeft(b.width.isOn,this.width,s+h,c),D=0,E=i.length;D<E;){w=e-a;var B=0;for(T=0;T<l&&D+T<E;++T)if(j=i[v?E-1-(D+T):D+T],Pu(j)){if(N=j.getClearType(),0!==T&&N&Pi.BEFORE)break;if(j.position.set(c+M,a+w),0<=(F=j.weight)&&(j.width=O*(F*p)),B=Math.max(B,j.width),w+=a+j.height,N&Pi.AFTER){null!=d&&(d[0+(G=D+T+1<<1)]=x,d[G+1]=T),T+=1;break}null!=d&&(d[0+(G=D+T+1<<1)]=x,d[G+1]=T)}else null!=d&&(d[0+(G=D+T+1<<1)]=x,d[G+1]=T-1),D+=1,T-=1;M+=c+B,D+=T,x+=1}if(null!=d)for(D=0,E=i.length;D<E;++D)if(j=i[v?E-1-D:D],Pu(j)){I=d[0+(H=2+(D<<1))],C=d[H+1];var _=-2;(N=j.getClearType())&Pi.BEFORE||(R=this.findColumnIndexPrevious(H,I,d),this.hasClearTypeAfter(i,R)||(_=d[R+1]));var P=-2;N&Pi.AFTER||(y=this.findColumnIndexNext(H,I,d),this.hasClearTypeBefore(i,y)||(P=d[y+1]));var U=this.countRow(H,I,d);j.corner.mask=this.toCornerMaskRow(_,C,P,U)}}else{for(D=0,E=i.length;D<E;){for(w=e-a,B=0,T=0;T<l&&D+T<E;++T)if(j=i[v?E-1-(D+T):D+T],Pu(j)){var F;if(N=j.getClearType(),0!==T&&N&Pi.BEFORE)break;if(j.position.set(c+M,a+w),0<=(F=j.weight)&&(j.width=0),B=Math.max(B,j.width),w+=a+j.height,N&Pi.AFTER){null!=d&&(d[0+(G=D+T+1<<1)]=x,d[G+1]=T),T+=1;break}null!=d&&(d[0+(G=D+T+1<<1)]=x,d[G+1]=T)}else{var G;null!=d&&(d[0+(G=D+T+1<<1)]=x,d[G+1]=T-1),D+=1,T-=1}M+=c+B,D+=T,x+=1}if(null!=d)for(D=0,E=i.length;D<E;++D){var H;j=i[v?E-1-D:D],Pu(j)&&(I=d[0+(H=2+(D<<1))],C=d[H+1],_=-2,(N=j.getClearType())&Pi.BEFORE||(R=this.findColumnIndexPrevious(H,I,d),this.hasClearTypeAfter(i,R)||(_=d[R+1])),P=-2,N&Pi.AFTER||(y=this.findColumnIndexNext(H,I,d),this.hasClearTypeBefore(i,y)||(P=d[y+1])),U=this.countRow(H,I,d),j.corner.mask=this.toCornerMaskRow(_,C,P,U))}}}t.prototype.onRefit.call(this)},n.prototype.hasClearTypeBefore=function(t,n){return this.hasClearType(t,n,Pi.BEFORE)},n.prototype.hasClearTypeAfter=function(t,n){return this.hasClearType(t,n,Pi.AFTER)},n.prototype.hasClearType=function(t,n,i){if(2<=n){var r=n-2>>1;if(0<=r&&r<t.length){var e=t[r];if(e instanceof Qi)return!!(e.getClearType()&i)}}return!1},n.prototype.findColumnIndexPrevious=function(t,n,i){for(var r=t-2;0<=r;r-=2)if(i[r]!==n)return r;return 0},n.prototype.findColumnIndexNext=function(t,n,i){for(var r=t+2,e=i.length;r<e;r+=2){var u=i[r];if(u!==n){for(var s=r+2;s<e;s+=2)if(i[s]!==u)return s-2;return r}}return i.length-2},n.prototype.countRow=function(t,n,i){for(var r=t+2,e=i.length;r<e;r+=2)if(i[r]!==n)return i[r-2+1]+1;return 0},n.prototype.findRowIndexPrevious=function(t,n,i){for(var r=t-2;0<=r;r-=2)if(i[r+1]!==n)return r;return 0},n.prototype.findRowIndexNext=function(t,n,i){for(var r=t+2,e=i.length;r<e;r+=2){var u=i[r+1];if(u!==n){for(var s=r+2;s<e;s+=2)if(i[s+1]!==u)return s-2;return r}}return i.length-2},n.prototype.countColumn=function(t,n,i){for(var r=t+2,e=i.length;r<e;r+=2)if(i[r+1]!==n)return i[r-2+0]+1;return 0},n.prototype.toCornerMaskColumn=function(t,n,i,r){var e=Mi.NONE;return t+1<n&&0===n&&(e|=Mi.TOP_LEFT),i+1<n&&0===n&&(e|=Mi.BOTTOM_LEFT),t<n&&n+1===r&&(e|=Mi.TOP_RIGHT),i<n&&n+1===r&&(e|=Mi.BOTTOM_RIGHT),Mi.ALL&~e},n.prototype.toCornerMaskRow=function(t,n,i,r){var e=Mi.NONE;return t+1<n&&0===n&&(e|=Mi.TOP_LEFT),i+1<n&&0===n&&(e|=Mi.TOP_RIGHT),t<n&&n+1===r&&(e|=Mi.BOTTOM_LEFT),i<n&&n+1===r&&(e|=Mi.BOTTOM_RIGHT),Mi.ALL&~e},n.prototype.addSpace=function(t){return this.addChild(new _u(t))},n.prototype.getType=function(){return"DLayout"},n.CORNER_ADJUST_WORK=null,n}(Qi),Fu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DLayoutVertical"},n}(Uu),Gu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DDialogLayeredContent"},n}(Fu),Hu={CLICKED:0,DOUBLE_CLICKED:1},zu=function(){function t(t){this.$t=t}return t.prototype.getImageAlignHorizontal=function(){return this.$t.getSecondaryImageAlignHorizontal()},t.prototype.getImageAlignVertical=function(){return this.$t.getSecondaryImageAlignVertical()},t.prototype.getImageAlignWith=function(){return this.$t.getSecondaryImageAlignWith()},t.prototype.getImageMarginHorizontal=function(){return this.$t.getSecondaryImageMarginHorizontal()},t.prototype.getImageMarginVertial=function(){return this.$t.getSecondaryImageMarginVertial()},t.prototype.getImageTintColor=function(t){return this.$t.getSecondaryImageTintColor(t)},t.prototype.getImageTintAlpha=function(t){return this.$t.getSecondaryImageTintAlpha(t)},t.prototype.getImageSource=function(t){return this.$t.getSecondaryImageSource(t)},t}(),Vu=function(){function t(t){this.$t=t}return t.prototype.getImageAlignHorizontal=function(){return this.$t.getTertiaryImageAlignHorizontal()},t.prototype.getImageAlignVertical=function(){return this.$t.getTertiaryImageAlignVertical()},t.prototype.getImageAlignWith=function(){return this.$t.getTertiaryImageAlignWith()},t.prototype.getImageMarginHorizontal=function(){return this.$t.getTertiaryImageMarginHorizontal()},t.prototype.getImageMarginVertial=function(){return this.$t.getTertiaryImageMarginVertial()},t.prototype.getImageTintColor=function(t){return this.$t.getTertiaryImageTintColor(t)},t.prototype.getImageTintAlpha=function(t){return this.$t.getTertiaryImageTintAlpha(t)},t.prototype.getImageSource=function(t){return this.$t.getTertiaryImageSource(t)},t}(),Wu={LEFT:0,CENTER:1,RIGHT:2},Xu={TOP:0,MIDDLE:1,BOTTOM:2},Ku={TEXT:0,PADDING:1,BORDER:2},Yu=function(){function n(n,i,r,e){var u=this;this.p=n,this.$t=i,this.Os=r,this.bt=null,this.Tt=function(t,n){var i,r,e,u=null==n?void 0:n.align;return{with:Di(null!==(i=null==u?void 0:u.with)&&void 0!==i?i:t.getImageAlignWith(),Ku),vertical:Di(null!==(r=null==u?void 0:u.vertical)&&void 0!==r?r:t.getImageAlignVertical(),Xu),horizontal:Di(null!==(e=null==u?void 0:u.horizontal)&&void 0!==e?e:t.getImageAlignHorizontal(),Wu)}}(i,e),this.Wr=function(t,n){var i,r,e=null==n?void 0:n.margin;return{vertical:null!==(i=null==e?void 0:e.vertical)&&void 0!==i?i:t.getImageMarginVertial(),horizontal:null!==(r=null==e?void 0:e.horizontal)&&void 0!==r?r:t.getImageMarginHorizontal()}}(i,e),this.Ds=null==e?void 0:e.tint,this.Es=new t.Rectangle,this.Ms=null==e?void 0:e.source,this.Ss=null,this.Ts=function(){u.onUpdate()}}return Object.defineProperty(n.prototype,"image",{get:function(){return this.bt},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"align",{get:function(){return this.Tt},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"margin",{get:function(){return this.Wr},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"bound",{get:function(){return this.Es},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"source",{get:function(){return this.Ms},set:function(t){this.Ms!==t&&(this.Ms=t,this.onUpdate())},enumerable:!1,configurable:!0}),n.prototype.computeSource=function(){var t=this.Ms;if(void 0!==t){if(!ot(t))return t;var n=t(this.p.state);if(void 0!==n)return n}return this.$t.getImageSource(this.p.state)},n.prototype.onStateChange=function(t,n){this.updateTint()},n.prototype.updateBound=function(){var t=this.Es,n=this.bt;if(null!=n){n.updateTransform(),n.getLocalBounds(t);var i=t.left,r=t.top,e=t.right,u=t.bottom,s=n.localTransform,h=s.a,o=s.b,a=s.c,c=s.d,f=h*i+a*r,l=o*i+c*r,v=h*e+a*r,b=o*e+c*r,d=h*e+a*u,g=o*e+c*u,m=h*i+a*u,w=o*i+c*u,p=Math.min(f,v,d,m),O=Math.max(f,v,d,m),D=Math.min(l,b,g,w),E=Math.max(l,b,g,w);t.x=p+s.tx,t.y=D+s.ty,t.width=O-p,t.height=E-D}else t.x=0,t.y=0,t.width=0,t.height=0},n.prototype.isTintAware=function(t){return null!=t&&"tint"in t},n.prototype.toTintColor=function(t,n){var i=this.Ds;if(i){var r=i.color;if(void 0!==r){if(!ot(r))return r;var e=r(n);if(void 0!==e)return e}}return t.getImageTintColor(n)},n.prototype.toTintAlpha=function(t,n){var i=this.Ds;if(i){var r=i.alpha;if(void 0!==r){if(!ot(r))return r;var e=r(n);if(void 0!==e)return e}}return t.getImageTintAlpha(n)},n.prototype.updateTint=function(){var t=this.bt;if(t&&this.isTintAware(t)){var n=this.$t,i=this.p.state,r=this.toTintColor(n,i);if(null!=r){var e=!1;t.tint!==r&&(t.tint=r,e=!0);var u=this.toTintAlpha(n,i);return t.alpha!==u&&(t.alpha=u,e=!0),e}}return!1},n.prototype.updateSource=function(){var n=this.computeSource(),i=this.Ss;if(n!==i){this.Ss=n;var r,e=this.p,u=this.bt,s=this.Ts;if(n instanceof t.Texture)if(i instanceof t.Texture)i.off("update",s),u instanceof t.Sprite&&(u.texture=n,n.on("update",s));else{null!=u&&e.removeChild(u);var h=new t.Sprite(n);(r=e.getOverflowMask())&&(h.mask=r),n.on("update",s),e.addChild(h),this.bt=h}else i instanceof t.Texture?(i.off("update",s),null!=u&&(e.removeChild(u),u.destroy())):null!=u&&e.removeChild(u),null!=n&&((r=e.getOverflowMask())&&(n.mask=r),e.addChild(n)),this.bt=n;return!0}return!1},n.prototype.isRefitable=function(t){return null!=t&&t===this.bt},n.prototype.destroy=function(){var n=this.bt;if(n){this.bt=null;var i=this.Ss;i instanceof t.Texture&&(i.off("update",this.Ts,this),n.destroy())}},n.prototype.onUpdate=function(){this.p.toDirty(),rt.update(this.p)},n}(),Ju=function(){function t(){this.js=[],this.j=0,this.Wr=0}return t.prototype.clear=function(){this.js.length=0,this.j=0,this.Wr=0,this.Ns=void 0},t.prototype.add=function(t,n,i){this.js.push(t),this.j+=i+n,this.Wr=i},t.prototype.set=function(t){this.Ns=t},Object.defineProperty(t.prototype,"size",{get:function(){return this.j-(null===this.Ns?this.Wr:0)},enumerable:!1,configurable:!0}),t}(),Zu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.execute=function(t,n){var i=this.js,r=n-t;if(void 0!==this.Ns)for(var e=0,u=0,s=i.length;u<s;++u)r-=e+(h=i[u]).bound.height,h.image.y=r,e=h.margin.horizontal;else for(u=0,s=i.length;u<s;++u){var h;r-=(h=i[u]).margin.horizontal+h.bound.height,h.image.y=r}},n}(Ju),qu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.add=function(t,n,i){this.js.push(t),this.j=Math.max(this.size,n)},n.prototype.execute=function(t,n,i){for(var r=t+.5*(i-t-n),e=this.js,u=0,s=e.length;u<s;++u){var h=e[u];h.image.x=r-.5*h.bound.width}},n}(Ju),Qu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.execute=function(t){var n=this.js,i=t;if(void 0!==this.Ns)for(var r=0,e=n.length;r<e;++r)(u=n[r]).image.x=i,i+=u.bound.width+u.margin.horizontal;else for(r=0,e=n.length;r<e;++r){var u;i+=(u=n[r]).margin.horizontal,u.image.x=i,i+=u.bound.width}},n}(Ju),$u=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.add=function(t,n,i){this.js.push(t),this.j=Math.max(this.size,n)},n.prototype.execute=function(t,n,i){for(var r=t+.5*(i-t-n),e=this.js,u=0,s=e.length;u<s;++u){var h=e[u];h.image.y=r-.5*h.bound.height}},n}(Ju),ts=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.execute=function(t,n){var i=this.js,r=n-t;if(void 0!==this.Ns)for(var e=0,u=0,s=i.length;u<s;++u)r-=e+(h=i[u]).bound.width,h.image.x=r,e=h.margin.horizontal;else for(u=0,s=i.length;u<s;++u){var h;r-=(h=i[u]).margin.horizontal+h.bound.width,h.image.x=r}},n}(Ju),ns=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.execute=function(t){var n=this.js,i=t;if(void 0!==this.Ns)for(var r=0,e=0,u=n.length;e<u;++e)(s=n[e]).image.y=r+i,i+=s.bound.height,r=s.margin.vertical;else for(e=0,u=n.length;e<u;++e){var s;i+=(s=n[e]).margin.vertical,s.image.y=i,i+=s.bound.height}},n}(Ju),is=function(){function t(){this.left=new Qu,this.center=new qu,this.right=new ts,this.top=new ns,this.middle=new $u,this.bottom=new Zu}return t.prototype.clear=function(){this.left.clear(),this.center.clear(),this.right.clear(),this.top.clear(),this.middle.clear(),this.bottom.clear(),this.text=void 0},t.prototype.add=function(t){if(null!=t.image){var n=t.bound,i=n.width,r=n.height,e=t.margin,u=e.horizontal,s=e.vertical,h=t.align;switch(h.horizontal){case Wu.LEFT:this.left.add(t,i,u);break;case Wu.CENTER:this.center.add(t,i,u);break;case Wu.RIGHT:this.right.add(t,i,u)}switch(h.vertical){case Xu.TOP:this.top.add(t,r,s);break;case Xu.MIDDLE:this.middle.add(t,r,s);break;case Xu.BOTTOM:this.bottom.add(t,r,s)}}},t.prototype.set=function(t){this.left.set(t),this.center.set(t),this.right.set(t),this.top.set(t),this.middle.set(t),this.bottom.set(t),this.text=t},Object.defineProperty(t.prototype,"width",{get:function(){var t=this.text,n=this.left.size,i=this.center.size,r=this.right.size;return void 0!==t?null!==t?Math.max(n+t.width+r,i):Math.max(n+r,i):Math.max(n,r,i)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){var t=this.text,n=this.top.size,i=this.middle.size,r=this.bottom.size;return void 0!==t?null!==t?Math.max(n+t.height+r,i):Math.max(n+r,i):Math.max(n,r,i)},enumerable:!1,configurable:!0}),t.prototype.execute=function(t,n,i,r,e,u,s){var h=this.left,o=this.center,a=this.right,c=this.top,f=this.middle,l=this.bottom,v=this.text;if(void 0!==v){var b=h.size,d=a.size,g=c.size,m=l.size,w=0,p=0,O=0;switch(null!=v&&(p=v.width,O=v.height),e.horizontal){case Wu.LEFT:w=t+b;break;case Wu.CENTER:w=t+.5*(u-t-i-(b+p+d))+b;break;case Wu.RIGHT:w=u-i-d-p}var D=0;switch(e.vertical){case Xu.TOP:D=n+g;break;case Xu.MIDDLE:D=n+.5*(s-n-r-(g+O+m))+g;break;case Xu.BOTTOM:D=s-r-m-O}null!=v&&(v.position.set(w,D),v.setClippingDelta(b+d,g+m)),h.execute(w-b),o.execute(0,0,2*w+p),a.execute(0,w+p+d),c.execute(D-g),f.execute(0,0,2*D+O),l.execute(0,D+O+m)}else h.execute(t),o.execute(t,i,u),a.execute(i,u),c.execute(n),f.execute(n,r,s),l.execute(r,s)},t}(),rs=function(){function t(){this.text=new is,this.padding=new is,this.border=new is}return t.prototype.clear=function(){this.text.clear(),this.padding.clear(),this.border.clear()},t.prototype.add=function(t){if(t.image)switch(t.align.with){case Ku.TEXT:this.text.add(t);break;case Ku.PADDING:this.padding.add(t);break;case Ku.BORDER:this.border.add(t)}},t.prototype.set=function(t){this.text.set(t)},t.prototype.execute=function(t,n,i,r){var e=t.getLeft(),u=t.getTop(),s=t.getRight(),h=t.getBottom();null==i&&(i=e+this.width+s),null==r&&(r=u+this.height+h),this.border.execute(0,0,0,0,n,i,r),this.padding.execute(e,u,s,h,n,i,r),this.text.execute(e,u,s,h,n,i,r)},Object.defineProperty(t.prototype,"width",{get:function(){return Math.max(this.border.width,this.padding.width,this.text.width)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return Math.max(this.border.height,this.padding.height,this.text.height)},enumerable:!1,configurable:!0}),t}(),es=function(t){function n(n){var i=t.call(this)||this;return i.parent=n,i}return B(n,t),n.prototype.render=function(n){this.updateTransform(),t.prototype.render.call(this,n)},n.prototype.onReflow=function(t,n,i){this.clear(),this.beginFill(16777215,1),this.drawRect(0,0,n,i),this.endFill()},n}(t.Graphics),us=function(){function t(t,n,i,r){this.x=t,this.y=n,this.character=i,this.wrappable=r}return t.prototype.set=function(t,n,i,r){this.x=t,this.y=n,this.character=i,this.wrappable=r},t}(),ss=function(){function t(){this.count=0,this.countPerLine=0,this.width=0,this.height=0,this.characters=[],this.clipped=!1,this.x=0,this.y=0}return t.prototype.start=function(t,n){this.count=0,this.countPerLine=0,this.width=0,this.height=0,this.clipped=!1,this.x=0,this.y=.5*(t-n)},t.prototype.isPushable=function(t,n){return!(t<this.x+n.advance&&!(n.type&ve.SPACE))},t.prototype.isPushableAtNewLine=function(t,n,i){return this.y+1.5*n+.5*i<=t},t.prototype.push=function(t,n){var i=this.x;this.x+=t.advance;var r=this.y,e=this.count,u=this.characters;e<u.length?u[e].set(i,r,t,n):u.push(new us(i,r,t,n)),this.count+=1,this.countPerLine+=1},t.prototype.newLine=function(t){this.width=Math.max(this.width,this.x),this.x=0,this.y+=t,this.countPerLine=0},t.prototype.wordWrap=function(t){var n=this.countPerLine,i=this.characters;if(0<n){for(var r=this.count,e=r-1,u=r-n;u<e;--e){var s=i[e];if(s.wrappable){var h=s.character.advance,o=s.y+t;s.x=0,s.y=o;for(var a=e+1;a<r;++a)(s=i[a]).x=h,s.y=o,h+=s.character.advance;return this.x=h,this.y=o,this.countPerLine=r-e,!0}}var c=i[r-1];return c.x=0,c.y=c.y+t,this.x=c.character.advance,this.y=c.y,this.countPerLine=1,!1}return!1},t.prototype.pop=function(){var t=this.countPerLine,n=this.characters;if(0<t){var i=n[this.count-1];return this.x-=i.character.advance,this.count-=1,this.countPerLine-=1,!0}return!1},t.prototype.end=function(t,n){this.newLine(t),this.y-=.5*(t-n),this.height=this.y},t}(),hs={NONE:0,NORMAL:1,BREAK_ALL:2},os="\n",as=function(){function t(){}return t.measure=function(n,i,r){var e=t.RESULT||new ss;if(t.RESULT=e,null!=i){var u=b.from(n),s=i.font.height,h=r.lineHeight,o=r.enable,a=r.width,c=r.height,f=r.wordWrap;switch(e.start(h,s),f){case hs.BREAK_ALL:o?this.measure1(u,a,c,s,h,i,e):this.measure2(u,a,h,i,e);break;case hs.NORMAL:var l=this.newLineBreaker(n);l?o?this.measure1a(l,u,a,c,s,h,i,e):this.measure2a(l,u,a,h,i,e):o?this.measure1b(u,a,c,s,h,i,e):this.measure2b(u,a,h,i,e);break;default:o?this.measure3(u,a,h,i,e):this.measure4(u,h,i,e)}e.end(h,s)}else e.start(0,0),e.end(0,0);return e},t.measure1a=function(t,n,i,r,e,u,s,h){for(var o=t.next();n.hasNext();){var a=n.position,c=n.next();if(c===os)h.newLine(u);else{var f=s.get(c);if(null==f)continue;o=this.advance(a,o,t);var l=this.isWrappable1(a,o);h.isPushable(i,f)?h.push(f,l):h.isPushableAtNewLine(r,u,e)?(h.push(f,l),h.wordWrap(u)):this.measure5(n,i,u,s,h,!0)}}},t.measure1b=function(t,n,i,r,e,u,s){for(;t.hasNext();){var h=t.next();if(h===os)s.newLine(e);else{var o=u.get(h);if(null==o)continue;var a=this.isWrappable2(s,o);s.isPushable(n,o)?s.push(o,a):s.isPushableAtNewLine(i,e,r)?(s.push(o,a),s.wordWrap(e)):this.measure5(t,n,e,u,s,!0)}}},t.measure1=function(t,n,i,r,e,u,s){for(;t.hasNext();){var h=t.next();if(h===os)s.newLine(e);else{var o=u.get(h);if(null==o)continue;s.isPushable(n,o)?s.push(o,!0):s.isPushableAtNewLine(i,e,r)?(s.newLine(e),s.push(o,!0)):this.measure5(t,n,e,u,s,!0)}}},t.measure2a=function(t,n,i,r,e,u){for(var s=t.next();n.hasNext();){var h=n.position,o=n.next();if(o===os)u.newLine(r);else{var a=e.get(o);if(null==a)continue;s=this.advance(h,s,t);var c=this.isWrappable1(h,s);u.isPushable(i,a)?u.push(a,c):(u.push(a,c),u.wordWrap(r))}}},t.measure2b=function(t,n,i,r,e){for(;t.hasNext();){var u=t.next();if(u===os)e.newLine(i);else{var s=r.get(u);if(null==s)continue;var h=this.isWrappable2(e,s);e.isPushable(n,s)?e.push(s,h):(e.push(s,h),e.wordWrap(i))}}},t.measure2=function(t,n,i,r,e){for(;t.hasNext();){var u=t.next();if(u===os)e.newLine(i);else{var s=r.get(u);if(null==s)continue;e.isPushable(n,s)||e.newLine(i),e.push(s,!1)}}},t.measure3=function(t,n,i,r,e){for(;t.hasNext();){var u=t.next();if(u===os)e.newLine(i);else{var s=r.get(u);if(null==s)continue;e.isPushable(n,s)?e.push(s,!1):this.measure5(t,n,i,r,e,!1)}}},t.measure4=function(t,n,i,r){for(;t.hasNext();){var e=t.next();if(e===os)r.newLine(n);else{var u=i.get(e);if(null==u)continue;r.push(u,!1)}}},t.measure5=function(t,n,i,r,e,u){e.clipped=!0;var s=r.get("...");if(null!=s){for(;!e.isPushable(n,s)&&e.pop(););e.isPushable(n,s)&&e.push(s,!1)}if(u)t.close();else for(;t.hasNext();)if(t.next()===os){e.newLine(i);break}},t.isWrappable2=function(t,n){if(t.countPerLine<=0)return!1;var i=t.characters[t.count-1].character.type,r=n.type;return i&ve.SPACE?!(r&ve.SPACE||i&ve.NON_BREAKING):!(r&ve.SPACE||i&ve.NON_BREAKING&&r&ve.NON_BREAKING)},t.advance=function(t,n,i){return n.done||t<=n.value.end?n:n=i.next()},t.isWrappable1=function(t,n){if(n.done)return!1;var i=n.value;return i.start===t||i.end===t},t.newLineBreaker=function(t){return"css-line-break"in window?window["css-line-break"].LineBreaker(t,{lineBreak:"strict",wordBreak:"normal"}):null},t.RESULT=null,t}(),cs=function(t){function n(){var n=t.call(this,new Float32Array(64),new Float32Array(64),new Uint16Array(48))||this;return n.width=0,n.height=0,n.clipped=!1,n}return B(n,t),n.prototype.update=function(t,n,i){var r=this.getBuffer("aVertexPosition"),e=this.getBuffer("aTextureCoord"),u=this.getIndex(),s=as.measure(t,n,i),h=Math.ceil(s.count/8)<<3,o=h<<3;r.data.length<o&&(r.data=new Float32Array(o),e.data=new Float32Array(o));var a=6*h;u.data.length<a&&(u.data=new Uint16Array(a));var c=r.data,f=e.data,l=u.data;if(null!=n){for(var v=s.count,b=s.characters,d=0;d<v;++d){var g=b[d],m=g.x,w=g.y,p=g.character,O=n.width,D=n.height;this.writeCharacter(c,f,l,d,m,w,p,O,D)}d=v;for(var E=c.length>>3;d<E;++d)this.writeCharacterEmpty(c,f,l,d);this.width=s.width,this.height=s.height,this.clipped=s.clipped}else{for(d=0,E=c.length>>3;d<E;++d)this.writeCharacterEmpty(c,f,l,d);this.width=0,this.height=0,this.clipped=!1}r.update(),e.update(),u.update()},n.prototype.writeCharacter=function(t,n,i,r,e,u,s,h,o){var a=s.x,c=s.y,f=s.width,l=s.height,v=e+(a-s.origin.x),b=u,d=v+f,g=b+l,m=r<<3;t[m+0]=v,t[m+1]=b,t[m+2]=d,t[m+3]=b,t[m+4]=d,t[m+5]=g,t[m+6]=v,t[m+7]=g;var w=a/h,p=c/o,O=(a+f)/h,D=(c+l)/o;n[m+0]=w,n[m+1]=p,n[m+2]=O,n[m+3]=p,n[m+4]=O,n[m+5]=D,n[m+6]=w,n[m+7]=D;var E=6*r,M=r<<2;i[E+0]=M+0,i[E+1]=M+1,i[E+2]=M+3,i[E+3]=M+1,i[E+4]=M+2,i[E+5]=M+3},n.prototype.writeCharacterEmpty=function(t,n,i,r){var e=r<<3;t[e+0]=0,t[e+1]=0,t[e+2]=0,t[e+3]=0,t[e+4]=0,t[e+5]=0,t[e+6]=0,t[e+7]=0,n[e+0]=0,n[e+1]=0,n[e+2]=0,n[e+3]=0,n[e+4]=0,n[e+5]=0,n[e+6]=0,n[e+7]=0;var u=6*r,s=r<<2;i[u+0]=s+0,i[u+1]=s+1,i[u+2]=s+3,i[u+3]=s+1,i[u+4]=s+2,i[u+5]=s+3},n}(t.MeshGeometry),fs=function(){function t(t,n){var i,r,e,u,s,h,o,a,c,f;this.R=0,this.Is=-1;var l=this.getDefaultOptions();t?(this.Tt=null!==(i=t.align)&&void 0!==i?i:l.align,this.Cs=null!==(r=t.fontFamily)&&void 0!==r?r:l.fontFamily,this.As=null!==(e=t.fontSize)&&void 0!==e?e:l.fontSize,this.Rs=null!==(u=t.fontStyle)&&void 0!==u?u:l.fontStyle,this.Ls=null!==(s=t.fontVariant)&&void 0!==s?s:l.fontVariant,this.ys=null!==(h=t.fontWeight)&&void 0!==h?h:l.fontWeight,this.C=null!==(o=t.fill)&&void 0!==o?o:l.fill,this.Jt=null!==(a=t.clipping)&&void 0!==a?a:l.clipping,this.ks=Di(null!==(c=t.wordWrap)&&void 0!==c?c:l.wordWrap,hs),this.xs=null!==(f=t.lineHeight)&&void 0!==f?f:l.lineHeight):(this.Tt=l.align,this.Cs=l.fontFamily,this.As=l.fontSize,this.Rs=l.fontStyle,this.Ls=l.fontVariant,this.ys=l.fontWeight,this.C=l.fill,this.Jt=l.clipping,this.ks=Di(l.wordWrap,hs),this.xs=l.lineHeight),this.Bs=-1,this._s="",this.Ps="",this.Us=0,this.Z=n}return t.prototype.getDefaultOptions=function(){var n=t.DEFAULT_OPTIONS;return null==n&&(n=this.newDefaultOptions(),t.DEFAULT_OPTIONS=n),n},t.prototype.newDefaultOptions=function(){var t=K.getInstance().get("DBase");return{align:"left",fontFamily:t.getFontFamilly(),fontSize:t.getFontSize(),fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",fill:t.getColor(new ct),clipping:!0,wordWrap:hs.NONE,lineHeight:t.getLineHeight()}},Object.defineProperty(t.prototype,"id",{get:function(){return this.R},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"idApproved",{get:function(){return this.Is},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontId",{get:function(){return this.update(),this._s},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontIdApproved",{get:function(){return this.Ps},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fill",{get:function(){return this.C},set:function(t){this.C!==t&&(this.C=t,this.onChange())},enumerable:!1,configurable:!0}),t.prototype.onChange=function(){this.R+=1,this.Z()},Object.defineProperty(t.prototype,"fillApproved",{get:function(){return this.Us},enumerable:!1,configurable:!0}),t.prototype.approve=function(){this.update(),this.Is=this.R,this.Ps=this._s,this.Us=this.C},Object.defineProperty(t.prototype,"fontFamily",{get:function(){return this.Cs},set:function(t){this.Cs!==t&&(this.Cs=t,this.onChange())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontSize",{get:function(){return this.As},set:function(t){this.As!==t&&(this.As=t,this.onChange())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontStyle",{get:function(){return this.Rs},set:function(t){this.Rs!==t&&(this.Rs=t,this.onChange())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontVariant",{get:function(){return this.Ls},set:function(t){this.Ls!==t&&(this.Ls=t,this.onChange())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontWeight",{get:function(){return this.ys},set:function(t){this.ys!==t&&(this.ys=t,this.onChange())},enumerable:!1,configurable:!0}),t.prototype.update=function(){this.Bs!==this.R&&(this.Bs=this.R,this._s=this.newFontId())},t.prototype.newFontId=function(){return"".concat(this.Rs," ").concat(this.Ls," ").concat(this.ys," ").concat(this.As,"px ").concat(this.Cs)},Object.defineProperty(t.prototype,"clipping",{get:function(){return this.Jt},set:function(t){this.Jt!==t&&(this.Jt=t,this.onChange())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"wordWrap",{get:function(){return this.ks},set:function(t){this.ks!==t&&(this.ks=t,this.onChange())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lineHeight",{get:function(){return this.xs},set:function(t){this.xs!==t&&(this.xs=t,this.onChange())},enumerable:!1,configurable:!0}),t}(),ls=function(n){function i(i,r){var e=n.call(this,new cs,new t.MeshMaterial(t.Texture.EMPTY))||this;return e.B=new fs(r,(function(){e.vn=!0,e.Fs=!0,e.ou=null,e.Gs()})),e.Ns=i,e.Hs="",e.vn=!0,e.Fs=!0,e.ou=null,e.zs=0,e.St=0,e.cn=0,e.Jt={enable:!1,wordWrap:hs.NONE,width:0,height:0,lineHeight:0,delta:{width:0,height:0}},e.Gs(),e}return B(i,n),i.prototype.Gs=function(){var t=rt.getLayer(this);if(t){var n=this.B;if(this.vn){this.vn=!1;var i=this.Ns,r=this.Hs;this.Hs=i;var e=n.fontId,u=n.fontIdApproved,s=n.fontSize,h=n.fill,o=n.fillApproved;n.approve();var a=t.getDynamicFontAtlases();i===r&&e===u&&h===o||(a.add(e,s,h,i),a.remove(u,o,r))}}},Object.defineProperty(i.prototype,"text",{get:function(){return this.Ns},set:function(t){this.Ns!==t&&(this.Ns=t,this.vn=!0,this.Fs=!0,this.Gs())},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"width",{get:function(){return this.update(),Math.abs(this.scale.x)*this.geometry.width},set:function(t){this.update();var n=this.geometry.width;if(1e-4<n){var i=t/n;this.scale.x=0<=this.scale.x?+i:-i}},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"height",{get:function(){return this.update(),Math.abs(this.scale.y)*this.geometry.height},set:function(t){this.update();var n=this.geometry.height;if(1e-4<n){var i=t/n;this.scale.y=0<=this.scale.y?+i:-i}},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"clipped",{get:function(){return this.geometry.clipped},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"style",{get:function(){return this.B},enumerable:!1,configurable:!0}),i.prototype.update=function(){this.Gs();var t=this.ou;if(null==t){var n=rt.getLayer(this);if(n){var i=this.B;null!=(t=n.getDynamicFontAtlases().get(i.fontId,i.fill))&&(this.zs=t.getRevisionUpdate(),this.ou=t,this.texture=t.texture,this.Fs=!0)}}else{var r=t.getRevisionUpdate();r!==this.zs&&(this.zs=r,this.Fs=!0)}var e=this.B,u=this.Jt;this.updateClipping(e,u)&&(this.Fs=!0),this.Fs&&(this.Fs=!1,this.geometry.update(this.Ns,t,u))},i.prototype.updateClipping=function(t,n){var i=!1,r=t.clipping;n.enable!==r&&(n.enable=r,i=!0);var e=t.wordWrap;n.wordWrap!==e&&(n.wordWrap=e,i=!0);var u=t.lineHeight;if(n.lineHeight!==u&&(n.lineHeight=u,i=!0),r||e){var s=this.parent;if(s instanceof Qi){var h=s.width-s.padding.getLeft()-s.padding.getRight()-n.delta.width;n.width!==h&&(n.width=h,i=!0);var o=s.height-s.padding.getTop()-s.padding.getBottom()-n.delta.height;n.height!==o&&(n.height=o,i=!0)}}return i},i.prototype.setClippingDelta=function(t,n){var i=this.Jt.delta;i.width=t,i.height=n},i.prototype._calculateBounds=function(){this.update(),n.prototype._calculateBounds.call(this)},i.prototype._render=function(t){this.update(),n.prototype._render.call(this,t)},i}(t.Mesh),vs=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.init=function(n){var i,r,e,u;t.prototype.init.call(this,n);var s=this.theme;this.Vs=null!==(r=null===(i=null==n?void 0:n.text)||void 0===i?void 0:i.value)&&void 0!==r?r:s.newTextValue(),this.Ws=this.computeTextValue();var h=null==n?void 0:n.text;this.Xs=null==h?void 0:h.color,this.Ks=null==h?void 0:h.alpha,this.Ys=function(t,n,i){var r,e,u,s,h,o,a,c,f,l,v=null===(r=null==n?void 0:n.text)||void 0===r?void 0:r.style;return null!=v?{fill:null!==(e=v.fill)&&void 0!==e?e:t.getColor(i),fontSize:null!==(u=v.fontSize)&&void 0!==u?u:t.getFontSize(),fontFamily:null!==(s=v.fontFamily)&&void 0!==s?s:t.getFontFamilly(),fontWeight:null!==(h=v.fontWeight)&&void 0!==h?h:t.getFontWeight(),fontStyle:null!==(o=v.fontStyle)&&void 0!==o?o:t.getFontStyle(),fontVariant:null!==(a=v.fontVariant)&&void 0!==a?a:t.getFontVariant(),clipping:null!==(c=v.clipping)&&void 0!==c?c:t.getTextStyleClipping(),wordWrap:null!==(f=v.wordWrap)&&void 0!==f?f:t.getTextStyleWordWrap(),lineHeight:null!==(l=v.lineHeight)&&void 0!==l?l:t.getLineHeight()}:{fill:t.getColor(i),fontSize:t.getFontSize(),fontFamily:t.getFontFamilly(),fontWeight:t.getFontWeight(),fontStyle:t.getFontStyle(),fontVariant:t.getFontVariant(),clipping:t.getTextStyleClipping(),wordWrap:t.getTextStyleWordWrap(),lineHeight:t.getLineHeight()}}(s,n,this.state),this.Os=function(t,n){var i,r,e,u=null===(i=null==n?void 0:n.text)||void 0===i?void 0:i.align;return{vertical:Di(null!==(r=null==u?void 0:u.vertical)&&void 0!==r?r:t.getTextAlignVertical(),Xu),horizontal:Di(null!==(e=null==u?void 0:u.horizontal)&&void 0!==e?e:t.getTextAlignHorizontal(),Wu)}}(s,n),this.Js=null!==(e=null==h?void 0:h.formatter)&&void 0!==e?e:s.getTextFormatter(),this.Zs=!0,this.qs=null!==(u=null==n?void 0:n.mask)&&void 0!==u?u:s.isOverflowMaskEnabled(),this.onTextChange(),this.createOrUpdateText()},Object.defineProperty(n.prototype,"text",{get:function(){return this.Vs},set:function(t){this.Vs!==t&&(this.Vs=t,this.updateTextValue())},enumerable:!1,configurable:!0}),n.prototype.onTextChange=function(){},n.prototype.computeTextValue=function(){var t=this.Vs;if(void 0!==t){if(!ot(t))return t;var n=t(this.state);if(void 0!==n)return n}return this.theme.getTextValue(this.state)},n.prototype.createOrUpdateText=function(){var t=this.Ws;if(void 0!==t){var n=this.Js(t,this),i=this.Ns;if(null==i){if(0<n.length){var r=this.createText(n);r.visible=this.Zs,this.Ns=r,this.addChild(r),this.updateTextPosition(r);var e=this.getOverflowMask();e&&(r.mask=e),this.toDirty(),rt.update(this)}}else i.text=n,this.toDirty(),rt.update(this)}},n.prototype.createText=function(t){return new ls(t,this.Ys)},n.prototype.getOverflowMask=function(){return this.qs?(null==this.er&&(this.er=new es(this),this.Gn.add(this.er),this.toDirty()),this.er):null},n.prototype.updateTextPosition=function(t){var n=this.Os,i=this.zn,r=this.Bn,e=0,u=i.getLeft(),s=n.horizontal;if(r.width.isOn||s===Wu.LEFT)e=u;else{var h=this.width,o=t.width,a=i.getRight();e=s===Wu.CENTER?u+.5*(h-u-a-o):h-o-a}var c=0,f=i.getTop(),l=n.vertical;if(r.height.isOn||l===Xu.TOP)c=f;else{var v=this.height,b=t.height,d=i.getBottom();c=l===Xu.MIDDLE?f+.5*(v-f-d-b):v-b-d}t.position.set(e,c)},n.prototype.getTextColor=function(t,n){var i=this.Xs;if(void 0!==i){if(!ot(i))return i;var r=i(n);if(void 0!==r)return r}return t.getColor(n)},n.prototype.getTextAlpha=function(t,n){var i=this.Ks;if(void 0!==i){if(!ot(i))return i;var r=i(n);if(void 0!==r)return r}return t.getAlpha(n)},n.prototype.updateTextColor=function(t){var n=this.theme,i=this.state;t.style.fill=this.getTextColor(n,i),t.alpha=this.getTextAlpha(n,i)},n.prototype.updateTextValue=function(){var t=this.computeTextValue();this.Ws!==t&&(this.Ws=t,this.onTextChange(),this.createOrUpdateText())},n.prototype.updateText=function(){var t=this.Ns;t&&(this.updateTextValue(),this.updateTextPosition(t),this.updateTextColor(t))},n.prototype.showText=function(){var t=this.Ns;t&&(t.visible=!0),this.Zs=!0},n.prototype.hideText=function(){var t=this.Ns;t&&(t.visible=!1),this.Zs=!1},n.prototype.onReflow=function(){t.prototype.onReflow.call(this),this.updateText()},n.prototype.isRefitable=function(n){return t.prototype.isRefitable.call(this,n)||null!=n&&n===this.Ns},n.prototype.applyTitle=function(){var n=this.Ns;if(this.Vn.length<=0&&n&&"clipped"in n&&n.clipped){var i=rt.getLayer(this);i&&(i.view.title=n.text)}else t.prototype.applyTitle.call(this)},n.prototype.getType=function(){return"DTextBase"},n.prototype.destroy=function(){var n=this.Ns;n&&(this.Ns=null,n.destroy());var i=this.er;i&&(this.er=null,i.destroy()),t.prototype.destroy.call(this)},n}(Qi),bs=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.init=function(n){this.Qs=this.newImages(this.theme,n),t.prototype.init.call(this,n)},n.prototype.newImages=function(t,n){var i=[];return i.push(this.newImage(t,this.toImageOptions(t,null==n?void 0:n.image))),function(t){return!!t.getSecondaryImageSource}(t)&&i.push(this.newImage(new zu(t))),function(t){return!!t.getTertiaryImageSource}(t)&&i.push(this.newImage(new Vu(t))),i},n.prototype.toImageOptions=function(t,n){return n},n.prototype.newImage=function(t,n){return new Yu(this,t,this.Os,n)},Object.defineProperty(n.prototype,"image",{get:function(){return this.Qs[0].source},set:function(t){var n=this.Qs[0];n.source=t,n.updateSource()},enumerable:!1,configurable:!0}),n.prototype.onStateChange=function(n,i){t.prototype.onStateChange.call(this,n,i);for(var r=this.Qs,e=0,u=r.length;e<u;++e)r[e].onStateChange(n,i)},n.prototype.updateText=function(){this.updateTextValue(),this.updateTextAndImage()},n.prototype.updateTextAndImage=function(){for(var t,i=this.Qs,r=null!==(t=n.LAYOUTER)&&void 0!==t?t:n.LAYOUTER=new rs,e=0,u=i.length;e<u;++e){var s=i[e];s.updateSource(),s.updateTint(),s.updateBound(),r.add(s)}var h=this.Ns;null!=h?(this.updateTextColor(h),r.set(h)):r.set(null);var o=this.Bn;r.execute(this.zn,this.Os,o.width.isOn?null:this.width,o.height.isOn?null:this.height),r.clear()},n.prototype.isRefitable=function(n){if(t.prototype.isRefitable.call(this,n))return!0;for(var i=this.Qs,r=0,e=i.length;r<e;++r)if(i[r].isRefitable(n))return!0;return!1},n.prototype.getType=function(){return"DImageBase"},n.prototype.destroy=function(){for(var n=this.Qs,i=0,r=n.length;i<r;++i)n[i].destroy();t.prototype.destroy.call(this)},n}(vs),ds=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.init=function(n){var i,r,e=this;t.prototype.init.call(this,n);var u=this.theme;this.$s=null!==(i=null==n?void 0:n.toggle)&&void 0!==i?i:u.isToggle(),this.th=Di(null!==(r=null==n?void 0:n.when)&&void 0!==r?r:u.getWhen(),Hu),this.on(Ki.tap,(function(t){e.onClick(t)})),this.initOnPress();var s=null==n?void 0:n.group;s&&s.add(this)},n.prototype.onShortcut=function(n){this.state.isActionable&&this.activate(n),t.prototype.onShortcut.call(this,n)},Object.defineProperty(n.prototype,"isToggle",{get:function(){return!!this.$s},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isGrouped",{get:function(){return!!this.nh},set:function(t){this.nh=t},enumerable:!1,configurable:!0}),n.prototype.initOnPress=function(){var t=this,n=null,i=function(){t.state.isPressed=!1,null!=n&&(n.off(Ki.up,i),n.off(Ki.upoutside,i),n.off(Ki.cancel,i),n=null)};this.on(Ki.down,(function(){t.state.isPressed=!0;var r=rt.getLayer(t);r&&((n=r.renderer.plugins.interaction).on(Ki.up,i),n.on(Ki.upoutside,i),n.on(Ki.cancel,i))}))},n.prototype.getType=function(){return"DButton"},n.prototype.onClick=function(t){this.th===Hu.CLICKED&&this.state.isActionable&&this.activate(t)},n.prototype.onDblClick=function(n,i){return this.th===Hu.DOUBLE_CLICKED&&this.state.isActionable&&this.activate(n),t.prototype.onDblClick.call(this,n,i)},n.prototype.activate=function(t){this.$s?this.nh&&this.state.isActive||(this.onToggleStart(t),this.onToggleEnd(t)):this.onActivate(t)},n.prototype.onActivate=function(t){this.emit("active",this)},n.prototype.onInactivate=function(t){this.emit("inactive",this)},n.prototype.toggle=function(){this.state.isActionable&&this.$s&&(this.onToggleStart(),this.onToggleEnd())},n.prototype.onToggleStart=function(t){this.state.isActive=!this.state.isActive},n.prototype.onToggleEnd=function(t){this.state.isActive?this.onActivate(t):this.onInactivate(t)},n.prototype.onActivateKeyDown=function(t){this.state.isActionable&&(this.$s?this.onToggleStart(t):this.state.isPressed=!0)},n.prototype.onActivateKeyUp=function(t){this.state.isActionable&&(this.$s?this.onToggleEnd(t):(this.state.isPressed&&this.onActivate(t),this.state.isPressed=!1))},n.prototype.onKeyDown=function(n){return Xi.isActivateKey(n)&&this.onActivateKeyDown(n),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyUp=function(n){return Xi.isActivateKey(n)&&this.onActivateKeyUp(n),t.prototype.onKeyUp.call(this,n)},n.prototype.destroy=function(){var n,i;null===(i=null===(n=this.kn)||void 0===n?void 0:n.group)||void 0===i||i.remove(this),t.prototype.destroy.call(this)},n}(bs),gs=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DButton"},n}(ds),ms=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DButtonPrimary"},n}(gs),ws=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DLayoutHorizontal"},n}(Uu),ps=function(t){function n(n,i){var r=t.call(this,i)||this;r.p=n;var e=r.buttonOk,u=r.buttonCancel;return null==e&&null==u||(r.addChild(r.newButtonSpace()),u&&r.addChild(u),e&&r.addChild(e),r.addChild(r.newButtonSpace())),r}return B(n,t),Object.defineProperty(n.prototype,"buttonCancel",{get:function(){var t=this.ih;return void 0===t&&(t=this.newButtonCancel(),this.ih=t),t},enumerable:!1,configurable:!0}),n.prototype.newButtonCancel=function(){var t,n,i=this,r=null===(n=null===(t=this.kn)||void 0===t?void 0:t.button)||void 0===n?void 0:n.cancel;return void 0===r&&(r=this.theme.getButtonCancel()),null!=r?new ms({text:{value:r},on:{active:function(){i.p.cancel()}}}):null},Object.defineProperty(n.prototype,"buttonOk",{get:function(){var t=this.rh;return void 0===t&&(t=this.newButtonOk(),this.rh=t),t},enumerable:!1,configurable:!0}),n.prototype.newButtonOk=function(){var t,n,i=this,r=null===(n=null===(t=this.kn)||void 0===t?void 0:t.button)||void 0===n?void 0:n.ok;return void 0===r&&(r=this.theme.getButtonOk()),null!=r?null!=this.buttonCancel?new gs({text:{value:r},on:{active:function(){i.p.ok()}}}):new ms({text:{value:r},on:{active:function(){i.p.ok()}}}):null},n.prototype.newButtonSpace=function(){return new _u({weight:1})},n.prototype.getType=function(){return"DDialogLayeredFooter"},n}(ws),Os=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DButtonAmbient"},n}(gs),Ds=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DDialogLayeredHeaderButtonClose"},n}(Os),Es=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DDialogLayeredHeaderSeparator"},n}(bs),Ms=function(t){function n(n,i){var r=t.call(this,i)||this;r.p=n;var e=r.separator;e&&r.addChild(e);var u=r.buttonClose;return u&&(r.addChild(u),u.on("active",(function(){r.p.cancel()}))),r}return B(n,t),Object.defineProperty(n.prototype,"buttonClose",{get:function(){var t=this.eh;return void 0===t&&(t=this.newButtonClose(),this.eh=t),t},enumerable:!1,configurable:!0}),n.prototype.newButtonClose=function(){var t,n;return!1!==(null===(n=null===(t=this.kn)||void 0===t?void 0:t.button)||void 0===n?void 0:n.close)?new Ds:null},Object.defineProperty(n.prototype,"separator",{get:function(){var t=this.uh;return void 0===t&&(t=this.newSeparator(),this.uh=t),t},enumerable:!1,configurable:!0}),n.prototype.newSeparator=function(){var t;return!1!==(null===(t=this.kn)||void 0===t?void 0:t.separator)?new Es:null},n.prototype.getType=function(){return"DDialogLayeredHeader"},n}(bs),Ss=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.init=function(n){t.prototype.init.call(this,n),this.addChild(this.layout)},Object.defineProperty(n.prototype,"layout",{get:function(){var t=this.sh;return null==t&&(t=this.newLayout(),this.sh=t),t},enumerable:!1,configurable:!0}),n.prototype.newLayout=function(){return new Fu(this.toLayoutOptions(this.theme,this.kn))},n.prototype.toLayoutOptions=function(t,n){var i,r,e=null!==(r=null!==(i=null==n?void 0:n.layout)&&void 0!==i?i:t.getLayout())&&void 0!==r?r:this.newLayoutOptions(t,n);return void 0===e.children&&(e.children=this.newLayoutChildren(t,n)),e},n.prototype.newLayoutOptions=function(t,n){return{width:"padding",height:"auto",margin:0}},n.prototype.newLayoutChildren=function(t,n){return[this.header,this.content,this.footer]},Object.defineProperty(n.prototype,"header",{get:function(){var t=this.hh;return void 0===t&&(t=this.newHeader(),this.hh=t),t},enumerable:!1,configurable:!0}),n.prototype.newHeader=function(){var t=this.toHeaderOptions(this.theme,this.kn);return null!==t?new Ms(this,t):null},n.prototype.toHeaderOptions=function(t,n){if(n){var i=n.header;if(void 0!==i)return i}return t.getHeader()},Object.defineProperty(n.prototype,"content",{get:function(){var t=this.oh;return null==t&&(t=this.newContent(),this.oh=t),t},enumerable:!1,configurable:!0}),n.prototype.newContent=function(){return new Gu(this.toContentOptions(this.theme,this.kn))},n.prototype.toContentOptions=function(t,n){var i,r,e=null!==(r=null!==(i=null==n?void 0:n.content)&&void 0!==i?i:t.getContent())&&void 0!==r?r:{};return void 0===e.children&&(e.children=this.newContentChildren(t,n)),e},n.prototype.newContentChildren=function(t,n){return[]},Object.defineProperty(n.prototype,"footer",{get:function(){var t=this.ah;return void 0===t&&(t=this.newFooter(),this.ah=t),t},enumerable:!1,configurable:!0}),n.prototype.newFooter=function(){var t=this.toFooterOptions(this.theme,this.kn);return null!==t?new ps(this,t):null},n.prototype.toFooterOptions=function(t,n){if(n){var i=n.footer;if(void 0!==i)return i}return t.getFooter()},n.prototype.findFirstFocusable=function(t){return t.find(this.content,!1,!0,!0)},n.prototype.ok=function(){this.onOk(this.getResolvedValue())},n.prototype.onOk=function(t){this.doResolve(t),this.emit("ok",t,this)},n.prototype.cancel=function(){this.onCancel(this.getRejectReason())},n.prototype.onCancel=function(t){this.doReject(t),this.emit("cancel",t,this)},n.prototype.getRejectReason=function(){},n.prototype.getType=function(){return"DDialogLayered"},n}(xu),Ts=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.newContentChildren=function(n,i){var r=t.prototype.newContentChildren.call(this,n,i);return r.push(this.inputLayout),r},n.prototype.toInputMargin=function(t,n){var i,r;return null!==(r=null===(i=null==n?void 0:n.input)||void 0===i?void 0:i.margin)&&void 0!==r?r:t.getInputMargin()},Object.defineProperty(n.prototype,"inputLayout",{get:function(){var t=this.fh;return null==t&&(t=this.newInputLayout(),this.fh=t),t},enumerable:!1,configurable:!0}),n.prototype.newInputLayout=function(){var t=this.toInputMargin(this.theme,this.kn);return new ws({width:"padding",height:"auto",margin:0,children:[new _u({width:t}),this.input,new _u({width:t})]})},Object.defineProperty(n.prototype,"input",{get:function(){var t=this.lh;if(null==t){var n=this.kn;t=this.newInput(null==n?void 0:n.input),this.lh=t}return t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"value",{get:function(){return this.input.value},set:function(t){this.input.value=t},enumerable:!1,configurable:!0}),n.prototype.getResolvedValue=function(){return this.input.value},n.prototype.getType=function(){return"DDialogInput"},n}(Ss),js=function(t){function n(n){var i=t.call(this)||this;i.bh=[],i.dh=null,i.gh=function(t){i.active=t};var r=null==n?void 0:n.on;if(null!=r)for(var e in r){var u=r[e];u&&i.on(e,u)}return i.emit("init",i),i}return B(n,t),n.prototype.add=function(t){if(this.bh.indexOf(t)<0){this.bh.push(t),t.isGrouped=!0;var n=this.rs;null!=n&&(t.state.isEnabled=n),t.on("active",this.gh),t.state.isActive&&(this.active=t)}},Object.defineProperty(n.prototype,"active",{get:function(){return this.dh},set:function(t){if((null==t||t.isToggle)&&this.dh!==t){var n=this.dh;this.dh=null;for(var i=this.bh,r=0,e=i.length;r<e;++r){var u=i[r];u!==t&&u.isToggle&&u.state.isActive&&u.toggle()}this.emit("active",t,n,this)}},enumerable:!1,configurable:!0}),n.prototype.remove=function(t){var n=this.bh,i=n.indexOf(t);0<=i&&(n.splice(i,1),t.isGrouped=!1,t.off("active",this.gh),this.dh===t&&(this.active=null))},n.prototype.contains=function(t){return 0<=this.bh.indexOf(t)},n.prototype.clear=function(){for(var t=this.bh,n=0,i=t.length;n<i;++n)t[n].isGrouped=!1;t.length=0,this.active=null},n.prototype.size=function(){return this.bh.length},n.prototype.each=function(t){for(var n=this.bh,i=0,r=n.length;i<r&&!1!==t(n[i]);++i);},n.prototype.disable=function(){for(var t=this.bh,n=0,i=t.length;n<i;++n)t[n].state.isDisabled=!0;this.rs=!1},n.prototype.enable=function(){for(var t=this.bh,n=0,i=t.length;n<i;++n)t[n].state.isDisabled=!1;this.rs=!0},n.prototype.destroy=function(){this.clear()},n}(t.utils.EventEmitter),Ns=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DInputBooleanButtonOff"},n}(gs),Is=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DInputBooleanButtonOn"},n}(gs),Cs=function(t){function n(n){var i=t.call(this,n)||this;i.addChild(i.getButtonOff()),i.addChild(i.getButtonOn());var r=null==n?void 0:n.value;return null!=r&&(i.value=r),i.getButtonGroup().on("active",(function(){var t=i.value;i.emit("change",t,!t,i)})),i}return B(n,t),n.prototype.getButtonGroup=function(){var t=this.mh;return null==t&&(t=this.newButtonGroup(),this.mh=t),t},n.prototype.newButtonGroup=function(){return new js},n.prototype.getButtonOn=function(){var t=this.wh;return null==t&&(t=this.newButtonOn(),this.wh=t),t},n.prototype.newButtonOn=function(){return new Is({weight:1,group:this.getButtonGroup()})},n.prototype.getButtonOff=function(){var t=this.ph;return null==t&&(t=this.newButtonOff(),this.ph=t),t},n.prototype.newButtonOff=function(){return new Ns({weight:1,group:this.getButtonGroup(),state:ht.ACTIVE})},Object.defineProperty(n.prototype,"value",{get:function(){return this.getButtonOn().state.isActive},set:function(t){this.value!==t&&(t?this.getButtonOn().activate():this.getButtonOff().activate())},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DInputBoolean"},n}(ws),As=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.newInput=function(t){return new Cs(this.toInputOptions(t))},n.prototype.toInputOptions=function(t){return t?(void 0===t.weight&&(t.weight=1),t):{weight:1}},n.prototype.getType=function(){return"DDialogInputBoolean"},n}(Ts),Rs=function(t){function n(n){var i=t.call(this,n,$t.NONE)||this;return i.target=rn.ofStringOrNull(n.target),i.onInputAction=n.onInputAction,i.isOpened=!1,i.step=rn.ofNumberOrNull(n.step),i.min=rn.ofNumberOrNull(n.min),i.max=rn.ofNumberOrNull(n.max),i}return B(n,t),n.prototype.execute=function(t,n,i){var r=this;if(!this.isOpened&&this.condition(t,i,nn)){var e=this.target(t,i,nn);if(null!=e){var u=this.initial(t,i,nn),s=this.step(t,i,nn),h=this.min(t,i,nn),o=this.max(t,i,nn);this.isOpened=!0,setTimeout((function(){r.open(t,e,u,s,h,o).then((function(n){r.isOpened=!1,ou.execute(t,r.onInputAction,e,n,i)}),(function(){r.isOpened=!1}))}),0)}}},n}(un),Ls=function(t){function n(n){var i=t.call(this,n)||this;return i.initial=rn.ofBooleanOrFalse(n.initial),i}return B(n,t),n.prototype.open=function(t,i,r,e,u,s){var h=n.DIALOG;if(null==h)h=new As({header:{text:{value:i},button:{close:!1}}}),n.DIALOG=h;else{var o=h.header;o&&(o.text=i)}return h.value=r,h.open(t)},n}(Rs),ys=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getUtil=function(){var t=this.ns;return null==t&&(t=this.newUtil(),this.ns=t),t},n.prototype.newUtil=function(){return new Je(this,this.newOperation(),this.theme,this.kn)},n.prototype.newOperation=function(){var t=this;return{getElementRect:function(n,i,r){return t.getElementRect(n,i,r)},getElementMatrix:function(){return null},getClipperRect:function(n,i,r){return t.getClipperRect(n,i,r)},getPadding:function(){return t.padding},containsPoint:function(n){return t.containsPoint(n)},onStart:function(){},onCancel:function(){},onEnd:function(){}}},Object.defineProperty(n.prototype,"element",{get:function(){return this.getUtil().element},enumerable:!1,configurable:!0}),n.prototype.onDownThis=function(n){var i=this.getUtil();i.onDowning(n),t.prototype.onDownThis.call(this,n),i.onDown(n)},n.prototype.onDblClick=function(n,i){return this.getUtil().onDblClick(n,i),t.prototype.onDblClick.call(this,n,i)},n.prototype.onFocus=function(){t.prototype.onFocus.call(this),this.getUtil().onFocus()},n.prototype.onBlur=function(){t.prototype.onBlur.call(this),this.getUtil().onBlur()},n.prototype.start=function(){this.getUtil().start()},n.prototype.render=function(n){this.getUtil().onRender(n),t.prototype.render.call(this,n)},n.prototype.getElementRect=function(t,n,i){return n.set(0,0),this.toGlobal(n,n,!1),i.x=n.x,i.y=n.y,n.set(this.width,this.height),this.toGlobal(n,n,!0),i.width=n.x-i.x,i.height=n.y-i.y,i},n.prototype.getClipperRect=function(t,n,i){return Je.getClipperRect(this.parent,this,t,n,i)},n.prototype.cancel=function(){this.getUtil().cancel()},n.prototype.end=function(){this.getUtil().end()},n.prototype.select=function(){return this.getUtil().select(),this},n.prototype.onActivateKeyDown=function(t){this.state.isActionable&&(this.state.isPressed=!0)},n.prototype.onActivateKeyUp=function(t){this.state.isActionable&&(this.state.isPressed&&this.start(),this.state.isPressed=!1)},n.prototype.onKeyDown=function(n){return Xi.isActivateKey(n)&&this.onActivateKeyDown(n),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyUp=function(n){return Xi.isActivateKey(n)&&this.onActivateKeyUp(n),t.prototype.onKeyUp.call(this,n)},n.prototype.getType=function(){return"DHtmlElement"},n}(bs),ks=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.newOperation=function(){var t=this;return{getElementRect:function(n,i,r){return t.getElementRect(n,i,r)},getElementMatrix:function(){return null},getClipperRect:function(n,i,r){return t.getClipperRect(n,i,r)},getPadding:function(){return t.padding},containsPoint:function(n){return t.containsPoint(n)},onStart:function(){t.hideText()},onCancel:function(){t.showText()},onEnd:function(){},getValue:function(){return t.Ws},onValueInput:function(n){t.onValueInput(n)},onValueChange:function(n,i){t.text=n,t.onValueChange(n,i)},onEnter:function(){t.onEnter()},applyTitle:function(){t.applyTitle()}}},Object.defineProperty(n.prototype,"value",{get:function(){return this.Ws},set:function(t){this.text=t},enumerable:!1,configurable:!0}),n.prototype.onTextChange=function(){t.prototype.onTextChange.call(this),this.validate()},n.prototype.onValueChange=function(t,n){this.emit("change",t,n,this)},n.prototype.onValueInput=function(t){this.emit("input",t,this)},n.prototype.onEnter=function(){this.emit("enter",this)},n.prototype.validate=function(){return this.getUtil().validate()},n.prototype.applyTitle=function(){this.getUtil().applyTitle()||t.prototype.applyTitle.call(this)},n.prototype.getType=function(){return"DInput"},n}(ys),xs=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DInputInput"},n}(ks),Bs=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.newUtil=function(){return new su(this,this.newOperation(),this.theme,this.kn)},Object.defineProperty(n.prototype,"step",{get:function(){return this.getUtil().step},set:function(t){this.getUtil().step=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"min",{get:function(){return this.getUtil().min},set:function(t){this.getUtil().min=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"max",{get:function(){return this.getUtil().max},set:function(t){this.getUtil().max=t},enumerable:!1,configurable:!0}),n}(xs),_s=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DInputInteger"},n}(Bs),Ps=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.newInput=function(t){var n=this,i=new _s(this.toInputOptions(t));return i.on("enter",(function(){n.ok()})),i},n.prototype.toInputOptions=function(t){return t?(void 0===t.weight&&(t.weight=1),t):{weight:1}},n.prototype.getType=function(){return"DDialogInputInteger"},n}(Ts),Us=function(t){function n(n){var i=t.call(this,n)||this;return i.initial=rn.ofNumber(n.initial),i}return B(n,t),n.prototype.open=function(t,i,r,e,u,s){var h=n.DIALOG;if(null==h)h=new Ps({header:{text:{value:i},button:{close:!1}},input:{step:e,min:u,max:s,text:{value:r}}}),n.DIALOG=h;else{var o=h.header;o&&(o.text=i);var a=h.input;a.step=e,a.min=u,a.max=s,h.value=r}return h.open(t)},n}(Rs),Fs=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DInputReal"},n}(Bs),Gs=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.newInput=function(t){var n=this,i=new Fs(this.toInputOptions(t));return i.on("enter",(function(){n.ok()})),i},n.prototype.toInputOptions=function(t){return t?(void 0===t.weight&&(t.weight=1),t):{weight:1}},n.prototype.getType=function(){return"DDialogInputReal"},n}(Ts),Hs=function(t){function n(n){var i=t.call(this,n)||this;return i.initial=rn.ofNumber(n.initial),i}return B(n,t),n.prototype.open=function(t,i,r,e,u,s){var h=n.DIALOG;if(null==h)h=new Gs({header:{text:{value:i},button:{close:!1}},input:{step:e,min:u,max:s,text:{value:r}}}),n.DIALOG=h;else{var o=h.header;o&&(o.text=i);var a=h.input;a.step=e,a.min=u,a.max=s,h.value=r}return h.open(t)},n}(Rs),zs=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.newUtil=function(){return new bu(this,this.newOperation(),this.theme,this.kn)},n.prototype.getType=function(){return"DInputText"},n}(xs),Vs=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.newInput=function(t){var n=this,i=new zs(this.toInputOptions(t));return i.on("enter",(function(){n.ok()})),i},n.prototype.toInputOptions=function(t){return t?(void 0===t.weight&&(t.weight=1),t):{weight:1}},n.prototype.getType=function(){return"DDialogInputText"},n}(Ts),Ws=function(t){function n(n){var i=t.call(this,n)||this;return i.initial=rn.ofString(n.initial),i}return B(n,t),n.prototype.open=function(t,i,r,e,u,s){var h=n.DIALOG;if(null==h)h=new Vs({header:{text:{value:i},button:{close:!1}}}),n.DIALOG=h;else{var o=h.header;o&&(o.text=i)}return h.value=r,h.open(t)},n}(Rs),Xs=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DDialogFittedContent"},n}(Gu),Ks=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.newLayoutOptions=function(t,n){return{width:"auto",height:"auto",margin:0}},n.prototype.newContent=function(){return new Xs(this.toContentOptions(this.theme,this.kn))},n.prototype.getType=function(){return"DDialogFitted"},n}(Ss),Ys=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DPickerDatetimeButtonBack"},n}(Os),Js=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DPickerDatetimeButtonDate"},n}(Os),Zs=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DPickerDatetimeButtonNext"},n}(Os),qs=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DText"},n}(vs),Qs=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DPickerDatetimeLabel"},n}(qs),$s=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DPickerDatetimeLabelDate"},n}(qs),th=function(t){function n(n){var i=t.call(this,n)||this;return i.renderable=!1,i}return B(n,t),n.prototype.getType=function(){return"DPickerDatetimeSpace"},n}(Qi),nh={NONE:0,DATE:1,HOURS:2,MINUTES:4,SECONDS:8,TIME:14,ALL:15},ih=function(){function t(){}return t.from=function(t,n){var i=null==n?void 0:n.mask;if(null==i){if(at(t)){var r=K.getInstance().get(t);if(null!=r)return r.getMask()}else if(null!=t)return t.getMask();return nh.NONE}if(at(i))return nh[i];if(mn(i))return i;for(var e=nh.NONE,u=0,s=i.length;u<s;++u)e|=nh[i[u]];return e},t}(),rh=function(){function t(t,n){var i,r;this.Oh=null!==(i=null==t?void 0:t.date)&&void 0!==i?i:null,this.Dh=null!==(r=null==t?void 0:t.inclusive)&&void 0!==r&&r,this.Z=n}return Object.defineProperty(t.prototype,"date",{get:function(){return this.Oh},set:function(t){this.Oh!==t&&(this.Oh=t,this.Z())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inclusive",{get:function(){return this.Dh},set:function(t){this.Dh!==t&&(this.Dh=t,this.Z())},enumerable:!1,configurable:!0}),t}(),eh=function(){function t(t){this.p=t}return t.prototype.min=function(t){var n=this.p,i=n.lower,r=i.date,e=n.constant;if(null!=r){var u=n.mask;if(u&nh.DATE){if(r.getFullYear()<t.getFullYear())return e.hour.min;if(r.getMonth()<t.getMonth())return e.hour.min;if(r.getDate()<t.getDate())return e.hour.min}var s=r.getHours();return i.inclusive||u&nh.SECONDS&&r.getSeconds()<e.second.max||u&nh.MINUTES&&r.getMinutes()<e.minute.max?s:s+1}return e.hour.min},t.prototype.max=function(t){var n=this.p,i=n.upper,r=i.date,e=n.constant;if(null!=r){var u=n.mask;if(u&nh.DATE){if(t.getFullYear()<r.getFullYear())return e.hour.max;if(t.getMonth()<r.getMonth())return e.hour.max;if(t.getDate()<r.getDate())return e.hour.max}var s=r.getHours();return i.inclusive||u&nh.SECONDS&&e.second.min<r.getSeconds()||u&nh.MINUTES&&e.minute.min<r.getMinutes()?s:s-1}return e.hour.max},t}(),uh=function(){function t(t){this.p=t}return t.prototype.min=function(t){var n=this.p,i=n.lower,r=i.date,e=n.constant;if(null!=r){var u=n.mask;if(u&nh.DATE){if(r.getFullYear()<t.getFullYear())return e.minute.min;if(r.getMonth()<t.getMonth())return e.minute.min;if(r.getDate()<t.getDate())return e.minute.min}if(u&nh.HOURS&&r.getHours()<t.getHours())return e.minute.min;var s=r.getMinutes();return i.inclusive||u&nh.SECONDS&&r.getSeconds()<e.second.max?s:s+1}return e.minute.min},t.prototype.max=function(t){var n=this.p,i=n.upper,r=i.date,e=n.constant;if(null!=r){var u=n.mask;if(u&nh.DATE){if(t.getFullYear()<r.getFullYear())return e.minute.max;if(t.getMonth()<r.getMonth())return e.minute.max;if(t.getDate()<r.getDate())return e.minute.max}if(u&nh.HOURS&&t.getHours()<r.getHours())return e.minute.max;var s=r.getMinutes();return i.inclusive||u&nh.SECONDS&&e.second.min<r.getSeconds()?s:s-1}return e.minute.max},t}(),sh=function(){function t(t){this.p=t}return t.prototype.min=function(t){var n=this.p,i=n.lower,r=i.date,e=n.constant;if(null!=r){var u=n.mask;if(u&nh.DATE){if(r.getFullYear()<t.getFullYear())return e.second.min;if(r.getMonth()<t.getMonth())return e.second.min;if(r.getDate()<t.getDate())return e.second.min}return u&nh.HOURS&&r.getHours()<t.getHours()||u&nh.MINUTES&&r.getMinutes()<t.getMinutes()?e.second.min:r.getSeconds()+(i.inclusive?0:1)}return e.second.min},t.prototype.max=function(t){var n=this.p,i=n.upper,r=i.date,e=n.constant;if(null!=r){var u=n.mask;if(u&nh.DATE){if(t.getFullYear()<r.getFullYear())return e.second.max;if(t.getMonth()<r.getMonth())return e.second.max;if(t.getDate()<r.getDate())return e.second.max}return u&nh.HOURS&&t.getHours()<r.getHours()||u&nh.MINUTES&&t.getMinutes()<r.getMinutes()?e.second.max:r.getSeconds()-(i.inclusive?0:1)}return e.second.max},t}(),hh=function(){function t(t,n){this.constant=this.newConstant(),this.lower=new rh(t&&t.lower,n),this.upper=new rh(t&&t.upper,n),this.mask=nh.ALL,this.hours=new eh(this),this.minutes=new uh(this),this.seconds=new sh(this)}return t.prototype.newConstant=function(){return{second:{min:0,max:59},minute:{min:0,max:59},hour:{min:0,max:23}}},t.prototype.adjust=function(t){var n=this.test(t);if(n<0){var i=this.lower,r=i.date;if(r)return t.setTime(r.getTime()),i.inclusive||((e=this.mask)&nh.SECONDS?t.setSeconds(r.getSeconds()+1):e&nh.MINUTES?t.setMinutes(r.getMinutes()+1):e&nh.HOURS?t.setHours(r.getHours()+1):e&nh.DATE&&t.setDate(r.getDate()+1)),!0}else if(0<n){var e,u=this.upper,s=u.date;if(s)return t.setTime(s.getTime()),u.inclusive||((e=this.mask)&nh.SECONDS?t.setSeconds(s.getSeconds()-1):e&nh.MINUTES?t.setMinutes(s.getMinutes()-1):e&nh.HOURS?t.setHours(s.getHours()-1):e&nh.DATE&&t.setDate(s.getDate()-1)),!0}return!1},t.prototype.compare=function(t,n){var i=this.mask;if(i&nh.DATE){var r,e,u,s,h=t.getFullYear(),o=n.getFullYear();if(h!==o)return h<o?-1:1;if((r=t.getMonth())!==(e=n.getMonth()))return r<e?-1:1;if((u=t.getDate())!==(s=n.getDate()))return u<s?-1:1}if(i&nh.HOURS){var a=t.getHours(),c=n.getHours();if(a!==c)return a<c?-1:1}return i&nh.MINUTES&&(r=t.getMinutes())!==(e=n.getMinutes())?r<e?-1:1:i&nh.SECONDS&&(u=t.getSeconds())!==(s=n.getSeconds())?u<s?-1:1:0},t.prototype.test=function(t){var n=this.lower,i=n.date;if(null!=i){var r=this.compare(i,t);return n.inclusive?r<=0?0:-1:r<0?0:-1}var e=this.upper,u=e.date;return null!=u?(r=this.compare(t,u),e.inclusive?r<=0?0:1:r<0?0:1):0},t.prototype.contains=function(t){return 0===this.test(t)},t}(),oh=function(t,n,i){if(t){var r=t.date,e=t.inclusive;return{date:void 0!==r?r:n,inclusive:void 0!==e?e:i}}return{date:n,inclusive:i}},ah=function(t){function n(n){var i=t.call(this,n)||this;return i.onNewChange(),i}return B(n,t),n.prototype.init=function(n){var i,r=this;t.prototype.init.call(this,n);var e=this.theme;this.Eh=new Date;var u=this.Eh.getTime();this.Mh=new Date(u),this.Sh=new hh(function(t,n){return n?{lower:oh(n.lower,t.getLowerBound(),t.isLowerBoundInclusive()),upper:oh(n.upper,t.getUpperBound(),t.isUpperBoundInclusive())}:{lower:{date:t.getLowerBound(),inclusive:t.isLowerBoundInclusive()},upper:{date:t.getUpperBound(),inclusive:t.isUpperBoundInclusive()}}}(e,null==n?void 0:n.bounds),(function(){r.onNewChange()}));var s=null!==(i=null==n?void 0:n.margin)&&void 0!==i?i:e.getMargin();new Fu({parent:this,x:"padding",y:"padding",width:"auto",height:"auto",margin:s,children:this.newChildren(e,n,s)})},Object.defineProperty(n.prototype,"current",{get:function(){return this.Eh},set:function(t){this.Eh.getTime()!==t.getTime()&&(this.Eh=t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"new",{get:function(){return this.Mh},set:function(t){this.Mh.getTime()!==t.getTime()&&(this.Mh=t,this.onNewChange())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"bounds",{get:function(){return this.Sh},enumerable:!1,configurable:!0}),n.prototype.hasHours=function(){return null!=this.Th},n.prototype.hasMinutes=function(){return null!=this.jh},n.prototype.hasSeconds=function(){return null!=this.Nh},n.prototype.reset=function(){var t=this.Eh.getTime();this.Mh.setTime(t),this.onReset()},n.prototype.onReset=function(){this.onNewChange()},n.prototype.onNewChange=function(){var t=this.Mh,n=this.Sh;n.adjust(this.Mh);var i=this.Th;if(i){var r=n.hours;i.value=t.getHours(),i.min=r.min(t),i.max=r.max(t)}var e=this.jh;if(e){var u=n.minutes;e.value=t.getMinutes(),e.min=u.min(t),e.max=u.max(t)}var s=this.Nh;if(s){var h=n.seconds;s.value=t.getSeconds(),s.min=h.min(t),s.max=h.max(t)}},n.prototype.newChildren=function(t,n,i){var r=ih.from(t,n);return this.Sh.mask=r,this.Th=r&nh.HOURS?this.newInputHours(t,n):null,this.jh=r&nh.MINUTES?this.newInputMinutes(t,n):null,this.Nh=r&nh.SECONDS?this.newInputSeconds(t,n):null,[this.newTimeLayout(this.Th,this.jh,this.Nh,i)]},n.prototype.newTimeLayout=function(t,n,i,r){var e=this.newTimeLayoutChildren(t,n,i);return 0<e.length?new ws({width:this.getTimeLayoutWidth(),height:this.getTimeLayoutHeight(),margin:r,children:e}):null},n.prototype.getTimeLayoutWidth=function(){return"auto"},n.prototype.getTimeLayoutHeight=function(){return"auto"},n.prototype.newTimeLayoutChildren=function(t,n,i){var r=[];return null!=t&&r.push(t),null!=n&&(0<r.length&&r.push(this.newMinuteSeparator()),r.push(n)),null!=i&&(0<r.length&&r.push(this.newSecondSeparator()),r.push(i)),r},n.prototype.newMinuteSeparator=function(){return new qs({width:"auto",text:{value:this.getMinuteSeparator()}})},n.prototype.getMinuteSeparator=function(){return":"},n.prototype.newSecondSeparator=function(){return new qs({width:"auto",text:{value:this.getSecondSeparator()}})},n.prototype.getSecondSeparator=function(){return":"},n.prototype.adjustInputOptions=function(t,n,i){return null==n.step&&(n.step=1),null==n.min&&(n.min=0),null==n.max&&(n.max=i),n},n.prototype.newInputHours=function(t,n){var i,r=this,e=null!==(i=null==n?void 0:n.hours)&&void 0!==i?i:t.getHoursOptions(),u=this.Sh.constant.hour.max,s=new _s(this.adjustInputOptions(t,e,u));return s.on("change",(function(t){r.onHoursChange(t)})),s},n.prototype.onHoursChange=function(t){this.Mh.setHours(t),this.onNewChange()},n.prototype.newInputMinutes=function(t,n){var i=this,r=(null==n?void 0:n.minutes)||t.getMinutesOptions(),e=this.Sh.constant.minute.max,u=new _s(this.adjustInputOptions(t,r,e));return u.on("change",(function(t){i.onMinutesChange(t)})),u},n.prototype.onMinutesChange=function(t){this.Mh.setMinutes(t),this.onNewChange()},n.prototype.newInputSeconds=function(t,n){var i=this,r=(null==n?void 0:n.seconds)||t.getSecondsOptions(),e=this.Sh.constant.second.max,u=new _s(this.adjustInputOptions(t,r,e));return u.on("change",(function(t){i.onSecondsChange(t)})),u},n.prototype.onSecondsChange=function(t){this.Mh.setSeconds(t)},n.prototype.getType=function(){return"DPickerTime"},n}(Qi),ch=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.init=function(n){t.prototype.init.call(this,n),this.Ih=new Date(this.Eh.getTime())},n.prototype.newChildren=function(n,i,r){var e,u;this.Ch=this.newDateButtons(n,i),this.Ah=null!==(u=null===(e=null==i?void 0:i.date)||void 0===e?void 0:e.decorator)&&void 0!==u?u:n.getDateDecorator(),this.Rh=this.newLabel(n,i);var s=t.prototype.newChildren.call(this,n,i,r);return s.unshift(new ws({width:"100%",height:"auto",children:[this.newBackButton(n,i),this.Rh,this.newNextButton(n,i)]}),new ws({width:"auto",height:"auto",margin:r,children:this.newDateLabels(n,i)}),new Fu({width:"auto",height:"auto",margin:r,column:7,children:this.Ch})),s},Object.defineProperty(n.prototype,"page",{get:function(){return this.Ih},set:function(t){this.Ih.getTime()!==t.getTime()&&(this.Ih=t,this.onPageChange())},enumerable:!1,configurable:!0}),n.prototype.onReset=function(){this.Ih.setTime(this.Eh.getTime()),t.prototype.onReset.call(this)},n.prototype.next=function(){var t=this.Ih;t.setFullYear(t.getFullYear(),t.getMonth()+1,1),t.setHours(0,0,0,0),this.onPageChange()},n.prototype.back=function(){var t=this.Ih;t.setFullYear(t.getFullYear(),t.getMonth()-1,1),t.setHours(0,0,0,0),this.onPageChange()},n.prototype.onNewChange=function(){this.Sh.adjust(this.Ih),t.prototype.onNewChange.call(this),this.onPageChange()},n.prototype.onPageChange=function(){var t=this.Ch,n=this.Sh,i=this.Ih,r=this.Mh,e=new Date(i.getTime());e.setDate(1),e.setHours(0,0,0,0);for(var u=this.theme,s=(e.getDay()-u.getDayStart()+7)%7,h=0;h<s;++h)t[h].show();for(h=s;h<7;++h)t[h].hide();var o=this.Ah;e.setFullYear(e.getFullYear(),e.getMonth()+1,0);var a=e.getDate(),c=r.getFullYear()===e.getFullYear()&&r.getMonth()===e.getMonth()?r.getDate():0;for(h=0;h<a;++h)e.setDate(h+1),(f=t[h+7]).state.isActive=c===h+1,f.state.isDisabled=!n.contains(e),f.show(),o(e,f);for(h=a;h<31;++h){var f;(f=t[h+7]).state.isActive=!1,f.hide()}e.setTime(i.getTime()),this.Rh.text=e},n.prototype.adjustInputOptions=function(n,i,r){return null==i.weight&&(i.weight=1),t.prototype.adjustInputOptions.call(this,n,i,r)},n.prototype.getTimeLayoutWidth=function(){return"100%"},n.prototype.toLabelOptions=function(t,n){var i=n&&n.label||{};void 0===i.weight&&(i.weight=1),void 0===i.padding&&(i.padding=0);var r=i.text=i.text||{},e=r.align=r.align||{};return void 0===e.horizontal&&(e.horizontal="CENTER"),void 0===r.formatter&&(r.formatter=t.getLabelFormatter()),i},n.prototype.newLabel=function(t,n){return new Qs(this.toLabelOptions(t,n))},n.prototype.newBackButton=function(t,n){var i=this,r=null==n?void 0:n.back;if(void 0===r&&(r=t.getBackButtonOptions()),null!=r){var e=new Ys(r);return e.on("active",(function(){i.back()})),e}return null},n.prototype.newNextButton=function(t,n){var i=this,r=null==n?void 0:n.next;if(void 0===r&&(r=t.getNextButtonOptions()),null!=r){var e=new Zs(r);return e.on("active",(function(){i.next()})),e}return null},n.prototype.newDateLabels=function(t,n){for(var i=t.getDayLabels(),r=t.getDayStart(),e=[],u=0;u<7;++u){var s=i[(r+u)%7];e.push(this.newDateLabel(t,n,s))}return e},n.prototype.newDateLabel=function(t,n,i){return new $s({text:{value:i}})},n.prototype.newDateButtons=function(t,n){for(var i=[],r=0;r<7;++r)i.push(this.newSpace(t,n));for(r=1;r<=31;++r)i.push(this.newDateButton(t,n,r));return i},n.prototype.newSpace=function(t,n){return new th},n.prototype.newDateButton=function(t,n,i){var r=this;return new Js({text:{value:String(i)},on:{active:function(){r.onDateButtonClicked(i)}}})},n.prototype.onDateButtonClicked=function(t){var n=this.Mh;if(n.getDate()!==t){var i=this.Ih;n.setFullYear(i.getFullYear()),n.setMonth(i.getMonth()),n.setDate(t),this.onNewChange()}},n.prototype.getType=function(){return"DPickerDatetime"},n}(ah),fh=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.newContentChildren=function(n,i){var r=t.prototype.newContentChildren.call(this,n,i);return r.push(this.picker),r},Object.defineProperty(n.prototype,"current",{get:function(){return this.picker.current},set:function(t){this.picker.current=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"new",{get:function(){return this.picker.new},set:function(t){this.picker.new=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"page",{get:function(){return this.picker.new},set:function(t){this.picker.page=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"picker",{get:function(){var t,n=this.Lh;return null==n&&(n=new ch(null===(t=this.kn)||void 0===t?void 0:t.picker),this.Lh=n),n},enumerable:!1,configurable:!0}),n.prototype.getResolvedValue=function(){return this.picker.new},n.prototype.getType=function(){return"DDialogDatetime"},n}(Ks),lh=function(t){function n(n){var i=t.call(this,n)||this;return i.initial=rn.ofUnknown(n.initial),i}return B(n,t),n.prototype.open=function(t,i,r,e,u,s){var h=n.DIALOG;return null==h&&(h=new fh,n.DIALOG=h),h.new=h.current=this.toDate(r),h.open(t).then((function(t){return t.toISOString()}))},n.prototype.toDate=function(t){return at(t)||mn(t)?new Date(t):t instanceof Date?t:new Date},n}(Rs),vh=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.newContentChildren=function(n,i){var r=t.prototype.newContentChildren.call(this,n,i);return r.push(this.picker),r},Object.defineProperty(n.prototype,"current",{get:function(){return this.picker.current},set:function(t){this.picker.current=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"new",{get:function(){return this.picker.new},set:function(t){this.picker.new=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"picker",{get:function(){var t,n=this.Lh;return null==n&&(n=new ah(null===(t=this.kn)||void 0===t?void 0:t.picker),this.Lh=n),n},enumerable:!1,configurable:!0}),n.prototype.getResolvedValue=function(){return this.picker.new},n.prototype.getType=function(){return"DDialogTime"},n}(Ks),bh=function(t){return t!=t},dh=function(t){function n(n){var i=t.call(this,n)||this;return i.initial=rn.ofUnknown(n.initial),i}return B(n,t),n.prototype.open=function(t,i,r,e,u,s){var h=this,o=n.DIALOG;return null==o&&(o=new vh,n.DIALOG=o),o.new=o.current=this.toDate(r),o.open(t).then((function(t){return h.getFormatter().format(t.getTime(),0)}))},n.prototype.toDate=function(t){if(mn(t))return new Date(t);if(at(t)){var n=new Date,i=this.getPattern().exec(t);if(null!=i){var r=this.toHours(i[1]);null!=r&&n.setHours(r);var e=this.toMinutes(i[2]);null!=e&&n.setMinutes(e);var u=this.toSeconds(i[3]);null!=u&&n.setSeconds(u);var s=this.toMilliseconds(i[4]);null!=s&&n.setMilliseconds(s)}return n}return t instanceof Date?t:new Date},n.prototype.toHours=function(t){return this.toNumber(t,0,23)},n.prototype.toMinutes=function(t){return this.toNumber(t,0,59)},n.prototype.toSeconds=function(t){return this.toNumber(t,0,59)},n.prototype.toMilliseconds=function(t){var n=this.toNumber(t,0,999);if(null!=n){var i=t.length;return 1===i?100*n:2===i?10*n:n}return n},n.prototype.toNumber=function(t,n,i){if(null!=t){var r=+t;if(!bh(r))return Math.min(i,Math.max(n,r))}return null},n.prototype.getPattern=function(){var t=n.PATTERN;return null==t&&(t=this.newPattern(),n.PATTERN=t),t},n.prototype.newPattern=function(){return/^\s*(?:(\d+)(?::(\d+)(?::(\d+))?)?)?(?:\.(\d+))?\s*$/},n.prototype.getFormatter=function(){var t=n.FORMATTER;return null==t&&(t=this.newFormatter(),n.FORMATTER=t),t},n.prototype.newFormatter=function(){return bi.create("%Hm")},n}(Rs),gh=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DPickerDate"},n}(ch),mh=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.newContentChildren=function(n,i){var r=t.prototype.newContentChildren.call(this,n,i);return r.push(this.picker),r},Object.defineProperty(n.prototype,"current",{get:function(){return this.picker.current},set:function(t){this.picker.current=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"new",{get:function(){return this.picker.new},set:function(t){this.picker.new=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"page",{get:function(){return this.picker.new},set:function(t){this.picker.page=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"picker",{get:function(){var t,n=this.Lh;return null==n&&(n=new gh(null===(t=this.kn)||void 0===t?void 0:t.picker),this.Lh=n),n},enumerable:!1,configurable:!0}),n.prototype.getResolvedValue=function(){return this.picker.new},n.prototype.getType=function(){return"DDialogDate"},n}(Ks),wh=function(t){function n(n){var i=t.call(this,n)||this;return i.initial=rn.ofUnknown(n.initial),i}return B(n,t),n.prototype.open=function(t,i,r,e,u,s){var h=this,o=n.DIALOG;return null==o&&(o=new mh,n.DIALOG=o),o.new=o.current=this.toDate(r),o.open(t).then((function(t){return h.getFormatter().format(t.getTime(),0)}))},n.prototype.toDate=function(t){return at(t)||mn(t)?new Date(t):t instanceof Date?t:new Date},n.prototype.getFormatter=function(){var t=n.FORMATTER;return null==t&&(t=this.newFormatter(),n.FORMATTER=t),t},n.prototype.newFormatter=function(){return bi.create("%Y-%M-%D")},n}(Rs),ph={TEXT:0,INTEGER:1,REAL:2,BOOLEAN:3,DATE:4,TIME:5,DATETIME:6,EXTENSION:1e3},Oh=function(t){function n(n,i,r,e,u,s,h,o){var a=t.call(this,gn.OPEN,n,Su.DIALOG)||this;return a.target=i,a.onInputAction=r,a.initial=e,a.step=u,a.min=s,a.max=h,a.dialogType=o,a}return B(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.target===i.target&&this.dialogType===i.dialogType&&this.onInputAction===i.onInputAction&&this.initial===i.initial&&this.step===i.step&&this.min===i.min&&this.max===i.max},n.prototype.toRuntime=function(){switch(this.dialogType){case ph.TEXT:return new Ws(this);case ph.INTEGER:return new Us(this);case ph.REAL:return new Hs(this);case ph.BOOLEAN:return new Ls(this);case ph.DATE:return new wh(this);case ph.TIME:return new dh(this);case ph.DATETIME:return new lh(this)}},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.target),r=t.addResource(this.initial),e=t.addResource(this.step),u=t.addResource(this.min),s=t.addResource(this.max);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(i,",").concat(this.onInputAction,",").concat(r,",").concat(this.dialogType,",").concat(e,",").concat(u,",").concat(s,"]"))},n.deserialize=function(t,i){var r=i.resources,e=wn.toResource(1,t,r),u=wn.toResource(3,t,r),s=wn.toResource(5,t,r),h=wn.toResource(7,t,r),o=wn.toResource(8,t,r),a=wn.toResource(9,t,r);return new n(e,u,t[4],s,h,o,a,this.toDialogType(t))},n.toDialogType=function(t){if(t[2]===Su.DIALOG)return t[6];switch(t[2]){case Su.DIALOG_TEXT:return ph.TEXT;case Su.DIALOG_INTEGER:return ph.INTEGER;case Su.DIALOG_REAL:return ph.REAL;case Su.DIALOG_BOOLEAN:return ph.BOOLEAN;case Su.DIALOG_DATE:return ph.DATE;case Su.DIALOG_TIME:return ph.TIME;case Su.DIALOG_DATETIME:return ph.DATETIME}},n}(dn),Dh=function(){function t(){}return t.add=function(t){var n,i;(null!==(n=this.yh)&&void 0!==n?n:this.yh=new Map).set(t.type,t),(null!==(i=this.Pt)&&void 0!==i?i:this.Pt=[]).push(t)},t.get=function(t){var n=this.yh;if(null!=n)return n.get(t)},t.each=function(t){var n=this.Pt;if(null!=n)for(var i=0,r=n.length;i<r;++i)t(n[i])},t}(),Eh=function(t){function n(n){var i=t.call(this,n,$t.NONE)||this;i.target=rn.ofStringOrNull(n.target),i.argument=rn.ofUnknown(n.argument);var r=Dh.get(n.dialogType);return r&&(i.opener=r.opener),i}return B(n,t),n.prototype.execute=function(t,n,i){var r=this.opener;if(r&&this.condition(t,i,nn)){var e=this.target(t,i,nn);if(null!=e){var u=this.argument(t,i,nn);setTimeout((function(){r(e,u,t)}),0)}}},n}(un),Mh=function(t){function n(n,i,r,e){var u=t.call(this,gn.OPEN,n,Su.DIALOG)||this;return u.target=i,u.argument=r,u.dialogType=e,u}return B(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.target===i.target&&this.argument===i.argument&&this.dialogType===i.dialogType},n.prototype.toRuntime=function(){return new Eh(this)},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.target),r=t.addResource(this.argument);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(i,",0,-1,").concat(this.dialogType,",").concat(r,"]"))},n.deserialize=function(t,i){return new n(wn.toResource(1,t,i.resources),wn.toResource(3,t,i.resources),wn.toResource(7,t,i.resources),t[6])},n}(dn),Sh=function(){function t(){}return t.add=function(t){var n,i;(null!==(n=this.yh)&&void 0!==n?n:this.yh=new Map).set(t.type,t),(null!==(i=this.Pt)&&void 0!==i?i:this.Pt=[]).push(t),Fe[t.type]=t.opener},t.get=function(t){var n=this.yh;if(null!=n)return n.get(t)},t.each=function(t){var n=this.Pt;if(null!=n)for(var i=0,r=n.length;i<r;++i)t(n[i])},t}(),Th=function(t){function n(n,i,r,e){var u=t.call(this,gn.OPEN,i,n)||this;return u.target=r,u.inNewWindow=e,u}return B(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.target===i.target&&this.inNewWindow===i.inNewWindow},n.prototype.toRuntime=function(){return new Mu(this,this.subtype)},n.prototype.toLabel=function(){var t=this.getTheme().toTypeLabel(this.type),n=Sh.get(this.subtype);return"".concat(t,": ").concat(null!=n?n.label:"Unknown")},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.target),r=this.inNewWindow?1:0;return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(i,",").concat(r,"]"))},n.deserialize=function(t,i){var r=wn.toResource(1,t,i.resources),e=wn.toResource(3,t,i.resources);return new n(t[2],r,e,!!t[4])},n}(dn),jh={SHAPE_SHOW:0,SHAPE_HIDE:1,SHAPE:2,LAYER:3},Nh=function(t){function n(n){var i=t.call(this,n,$t.VISIBILITY)||this;return i.visibility=n.subtype===jh.SHAPE_SHOW,i}return B(n,t),n.prototype.execute=function(t,n,i){this.condition(t,i,nn)&&(t.visible=this.visibility,n.written|=this.reset)},n}(un),Ih=function(t){function n(n,i){return t.call(this,gn.SHOW_HIDE,i,n)||this}return B(n,t),n.prototype.toRuntime=function(){return new Nh(this)},n.prototype.serialize=function(t){var n=t.addResource(this.condition);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,"]"))},n.deserialize=function(t,i){var r=wn.toResource(1,t,i.resources);return new n(t[2],r)},n}(dn),Ch=function(t){function n(n){var i=t.call(this,n,$t.NONE)||this;return i.Pt=new Map,i.gu=n.layers,i.kh=n.bringToFront,i}return B(n,t),n.prototype.initialize=function(n,i){t.prototype.initialize.call(this,n,i);var r=this.Pt.get(n);null==r&&null!=(r=this.newData(n))&&this.Pt.set(n,r)},n.prototype.execute=function(t,n,i){var r=this.Pt.get(t);if(r){var e=this.condition(t,i,nn);if(r.condition!==e){r.condition=e;var u=r.layers;e?r.bringToFront?(Ne.bringAllToFront(u),Ne.showAll(u)):Ne.showAll(u):Ne.hideAll(u)}}},n.prototype.newData=function(t){var n=Ne.toLayers(t,this.gu);if(0<n.length)return{layers:n,bringToFront:this.kh,condition:null}},n}(un),Ah=function(t){function n(n,i,r){var e=t.call(this,gn.SHOW_HIDE,n,jh.LAYER)||this;return e.layers=i,e.bringToFront=r,e}return B(n,t),n.prototype.toRuntime=function(){return new Ch(this)},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=this.serializeLayers(t),r=this.bringToFront?1:0;return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(i,",").concat(r,"]"))},n.prototype.serializeLayers=function(t){for(var n=this.layers,i="[",r="",e=0,u=n.length;e<u;++e)i+=r+n[e],r=",";return i+="]",t.addResource(i)},n.deserialize=function(t,i){return new n(wn.toResource(1,t,i.resources),this.deserializeLayers(t[3],i),!!t[4])},n.deserializeLayers=function(t,n){var i=n.resources,r=i.length;return 0<=t&&t<r?JSON.parse(i[t]):[]},n}(dn),Rh=function(t){function n(n){return t.call(this,n,$t.VISIBILITY)||this}return B(n,t),n.prototype.initialize=function(n,i){t.prototype.initialize.call(this,n,i)},n.prototype.execute=function(t,n,i){t.visible=this.condition(t,i,nn),n.written|=this.reset},n}(un),Lh=function(t){function n(n){return t.call(this,gn.SHOW_HIDE,n,jh.SHAPE)||this}return B(n,t),n.prototype.toRuntime=function(){return new Rh(this)},n.prototype.serialize=function(t){var n=t.addResource(this.condition);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,"]"))},n.deserialize=function(t,i){return new n(wn.toResource(1,t,i.resources))},n}(dn),yh=function(t){function n(n,i){var r=t.call(this,n,i)||this;return r.amount=rn.ofNumber(n.amount),r}return B(n,t),n}(un),kh=function(t){function n(n){return t.call(this,n,$t.POSITION_X)||this}return B(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,nn)){var r=this.amount(t,i,nn);t.transform.position.x=r,n.written|=this.reset}},n}(yh),xh=function(t){function n(n){return t.call(this,n,$t.POSITION_Y)||this}return B(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,nn)){var r=this.amount(t,i,nn);t.transform.position.y=r,n.written|=this.reset}},n}(yh),Bh=function(t){function n(n){return t.call(this,n,$t.POSITION)||this}return B(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,nn)){var r=this.amount(t,i,nn),e=t.transform,u=e.position,s=!!(n.written&$t.POSITION_X),h=!!(n.written&$t.POSITION_Y),o=s?u.x:n.x,a=h?u.y:n.y;t.updateTransform();var c=e.localTransform;u.set(o-c.c*r,a-c.d*r),n.written|=this.reset}},n}(yh),_h=function(t){function n(n){return t.call(this,n,$t.POSITION)||this}return B(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,nn)){var r=this.amount(t,i,nn),e=t.transform,u=e.position,s=!!(n.written&$t.POSITION_X),h=!!(n.written&$t.POSITION_Y),o=s?u.x:n.x,a=h?u.y:n.y;t.updateTransform();var c=e.localTransform;u.set(o+c.a*r,a+c.b*r),n.written|=this.reset}},n}(yh),Ph=function(t){function n(n){return t.call(this,n,$t.POSITION_X)||this}return B(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,nn)){var r=this.amount(t,i,nn),e=!!(n.written&$t.POSITION_X),u=t.transform.position,s=e?u.x:n.x;u.x=s+r,n.written|=this.reset}},n}(yh),Uh=function(t){function n(n){return t.call(this,n,$t.POSITION_Y)||this}return B(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,nn)){var r=this.amount(t,i,nn),e=!!(n.written&$t.POSITION_Y),u=t.transform.position,s=e?u.y:n.y;u.y=s+r,n.written|=this.reset}},n}(yh),Fh=function(t){function n(n,i,r,e){var u=t.call(this,n,i,r)||this;return u.opetype=e,u}return B(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.opetype===i.opetype},n}(dn),Gh={RELATIVE_X:0,RELATIVE_Y:1,ABSOLUTE_X:2,ABSOLUTE_Y:3,FORWARD_OR_BACKWARD:4,LEFT_OR_RIGHT:5},Hh={RESIZE:0,MOVE:1,ROTATE:2},zh=function(t){function n(n,i,r){var e=t.call(this,gn.TRANSFORM,i,Hh.MOVE,n)||this;return e.amount=r,e}return B(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.amount===i.amount},n.prototype.toRuntime=function(){switch(this.opetype){case Gh.ABSOLUTE_X:return new kh(this);case Gh.ABSOLUTE_Y:return new xh(this);case Gh.FORWARD_OR_BACKWARD:return new Bh(this);case Gh.LEFT_OR_RIGHT:return new _h(this);case Gh.RELATIVE_X:return new Ph(this);case Gh.RELATIVE_Y:return new Uh(this)}},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.amount);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(this.opetype,",").concat(i,"]"))},n.deserialize=function(t,i){var r=wn.toResource(1,t,i.resources),e=wn.toResource(4,t,i.resources);return new n(t[3],r,e)},n}(Fh),Vh={RELATIVE_SIZE:0,RELATIVE_HEIGHT:1,RELATIVE_WIDTH:2,ABSOLUTE_SIZE:3,ABSOLUTE_HEIGHT:4,ABSOLUTE_WIDTH:5},Wh=function(t){function n(n,i){var r=t.call(this,n,i)||this;switch(n.opetype){case Vh.RELATIVE_SIZE:r.size=rn.ofNumberOrOne(n.amount);break;case Vh.ABSOLUTE_SIZE:r.size=rn.ofNumberOrOneHundred(n.amount);break;case Vh.RELATIVE_HEIGHT:r.size=rn.ofNumberOrOne(n.amount);break;case Vh.ABSOLUTE_HEIGHT:r.size=rn.ofNumberOrOneHundred(n.amount);break;case Vh.RELATIVE_WIDTH:r.size=rn.ofNumberOrOne(n.amount);break;case Vh.ABSOLUTE_WIDTH:r.size=rn.ofNumberOrOneHundred(n.amount);break;default:r.size=rn.ONE}return r}return B(n,t),n.prototype.adjustPosition=function(t,n,i,r,e,u){var s=(-.5+e)*i,h=(-.5+u)*r;t.updateTransform();var o=t.transform,a=o.position,c=o.localTransform,f=!!(n.written&$t.POSITION_X),l=!!(n.written&$t.POSITION_Y),v=f?a.x:n.x,b=l?a.y:n.y;n.written|=$t.POSITION,a.set(v+s*c.a+h*c.c,b+s*c.b+h*c.d)},n}(un),Xh=function(t){function n(n){var i=t.call(this,n,$t.HEIGHT|$t.POSITION)||this;return i.origin=n.originY,i}return B(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,nn)){var r=this.size(t,i,nn),e=t.size,u=n.written&$t.HEIGHT?e.y:n.sizeY;e.y=pr(r),n.written|=$t.HEIGHT,this.adjustPosition(t,n,0,u-e.y,.5,this.origin)}},n}(Wh),Kh=function(t){function n(n){var i=t.call(this,n,$t.HEIGHT|$t.POSITION)||this;return i.origin=n.originY,i}return B(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,nn)){var r=this.size(t,i,nn),e=t.size,u=n.written&$t.HEIGHT?e.y:n.sizeY;e.y=pr(u*r),n.written|=$t.HEIGHT,this.adjustPosition(t,n,0,u-e.y,.5,this.origin)}},n}(Wh),Yh=function(t){function n(n){var i=t.call(this,n,$t.SIZE|$t.POSITION)||this;return i.originX=n.originX,i.originY=n.originY,i}return B(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,nn)){var r=pr(this.size(t,i,nn)),e=t.size,u=!!(n.written&$t.WIDTH),s=!!(n.written&$t.HEIGHT),h=u?e.x:n.sizeX,o=s?e.y:n.sizeY;e.set(r,r),n.written|=$t.SIZE,this.adjustPosition(t,n,h-e.x,o-e.y,this.originX,this.originY)}},n}(Wh),Jh=function(t){function n(n){var i=t.call(this,n,$t.SIZE|$t.POSITION)||this;return i.originX=n.originX,i.originY=n.originY,i}return B(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,nn)){var r=this.size(t,i,nn),e=t.size,u=!!(n.written&$t.WIDTH),s=!!(n.written&$t.HEIGHT),h=u?e.x:n.sizeX,o=s?e.y:n.sizeY;e.set(pr(h*r),pr(o*r)),n.written|=$t.SIZE,this.adjustPosition(t,n,h-e.x,o-e.y,this.originX,this.originY)}},n}(Wh),Zh=function(t){function n(n){var i=t.call(this,n,$t.WIDTH|$t.POSITION)||this;return i.origin=n.originX,i}return B(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,nn)){var r=this.size(t,i,nn),e=t.size,u=n.written&$t.WIDTH?e.x:n.sizeX;e.x=pr(r),n.written|=$t.WIDTH,this.adjustPosition(t,n,u-e.x,0,this.origin,.5)}},n}(Wh),qh=function(t){function n(n){var i=t.call(this,n,$t.WIDTH|$t.POSITION)||this;return i.origin=n.originX,i}return B(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,nn)){var r=this.size(t,i,nn),e=t.size,u=n.written&$t.WIDTH?e.x:n.sizeX;e.x=pr(u*r),n.written|=$t.WIDTH,this.adjustPosition(t,n,u-e.x,0,this.origin,.5)}},n}(Wh),Qh=function(t){function n(n,i,r,e,u){var s=t.call(this,gn.TRANSFORM,i,Hh.RESIZE,n)||this;return s.originX=r,s.originY=e,s.amount=u,s}return B(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.originX===i.originX&&this.originY===i.originY&&this.amount===i.amount},n.prototype.toRuntime=function(){switch(this.opetype){case Vh.ABSOLUTE_HEIGHT:return new Xh(this);case Vh.ABSOLUTE_WIDTH:return new Zh(this);case Vh.ABSOLUTE_SIZE:return new Yh(this);case Vh.RELATIVE_HEIGHT:return new Kh(this);case Vh.RELATIVE_WIDTH:return new qh(this);case Vh.RELATIVE_SIZE:return new Jh(this)}},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.amount);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(this.opetype,",").concat(this.originX,",").concat(this.originY,",").concat(i,"]"))},n.deserialize=function(t,i){var r=wn.toResource(1,t,i.resources),e=wn.toResource(6,t,i.resources);return new n(t[3],r,t[4],t[5],e)},n}(Fh),$h=function(t){function n(n,i){var r=t.call(this,n,i)||this;return r.originX=n.originX,r.originY=n.originY,r.amount=rn.ofNumber("(".concat(n.amount,") * (Math.PI / 180)")),r}return B(n,t),n.prototype.adjustPosition=function(t,n,i,r,e,u){var s=!!(n.written&$t.WIDTH),h=!!(n.written&$t.HEIGHT),o=(-.5+e)*(s?t.size.x:n.sizeX),a=(-.5+u)*(h?t.size.y:n.sizeY),c=Math.sin(i)-Math.sin(r),f=Math.cos(i)-Math.cos(r),l=t.transform.position,v=!!(n.written&$t.POSITION_X),b=!!(n.written&$t.POSITION_Y),d=v?l.x:n.x,g=b?l.y:n.y;n.written|=$t.POSITION,l.set(d+o*f-a*c,g+o*c+a*f)},n}(un),to=function(t){function n(n){return t.call(this,n,$t.ROTATION|$t.POSITION)||this}return B(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,nn)){var r=this.amount(t,i,nn),e=t.transform,u=n.written&$t.ROTATION?e.rotation:n.rotation;e.rotation=r,n.written|=$t.ROTATION,this.adjustPosition(t,n,u,r,this.originX,this.originY)}},n}($h),no=function(t){function n(n){return t.call(this,n,$t.ROTATION|$t.POSITION)||this}return B(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,nn)){var r=this.amount(t,i,nn),e=t.transform,u=n.written&$t.ROTATION?e.rotation:n.rotation;e.rotation=u+r,n.written|=$t.ROTATION,this.adjustPosition(t,n,u,e.rotation,this.originX,this.originY)}},n}($h),io={RELATIVE:0,ABSOLUTE:1},ro=function(t){function n(n,i,r,e,u){var s=t.call(this,gn.TRANSFORM,i,Hh.ROTATE,n)||this;return s.originX=r,s.originY=e,s.amount=u,s}return B(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.originX===i.originX&&this.originY===i.originY&&this.amount===i.amount},n.prototype.toRuntime=function(){switch(this.opetype){case io.ABSOLUTE:return new to(this);case io.RELATIVE:return new no(this)}},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.amount);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(this.opetype,",").concat(this.originX,",").concat(this.originY,",").concat(i,"]"))},n.deserialize=function(t,i){var r=wn.toResource(1,t,i.resources),e=wn.toResource(6,t,i.resources);return new n(t[3],r,t[4],t[5],e)},n}(Fh),eo=function(t,n){switch(t[0]){case gn.SHOW_HIDE:switch(t[2]){case jh.SHAPE_SHOW:case jh.SHAPE_HIDE:return Ih.deserialize(t,n);case jh.SHAPE:return Lh.deserialize(t,n);case jh.LAYER:return Ah.deserialize(t,n)}break;case gn.BLINK:return pn.deserialize(t,n);case gn.CHANGE_COLOR:case gn.CHANGE_COLOR_LEGACY:switch(t[3]){case En.COLOR_AND_ALPHA:case En.COLOR:case En.ALPHA:return Nn.deserialize(t,n);case En.CODE:return Rn.deserialize(t,n);case En.BRIGHTNESS:return Cn.deserialize(t,n)}break;case gn.CHANGE_TEXT:return wi.deserialize(t,n);case gn.CHANGE_CURSOR:return yn.deserialize(t,n);case gn.EMIT_EVENT:return ze.deserialize(t,n);case gn.OPEN:switch(t[2]){case Su.DIALOG_TEXT:case Su.DIALOG_INTEGER:case Su.DIALOG_REAL:case Su.DIALOG_BOOLEAN:case Su.DIALOG_DATE:case Su.DIALOG_TIME:case Su.DIALOG_DATETIME:case Su.DIALOG:return ph.EXTENSION<=t[6]?Mh.deserialize(t,n):Oh.deserialize(t,n);case Su.DIAGRAM_LEGACY:case Su.PAGE_LEGACY:case Su.PAGE_INPLACE_LEGACY:case Su.DIAGRAM:case Su.PAGE:return Tu.deserialize(t,n);default:if(Su.EXTENSION<=t[2])return Th.deserialize(t,n)}break;case gn.TRANSFORM:switch(t[2]){case Hh.MOVE:return zh.deserialize(t,n);case Hh.RESIZE:return Qh.deserialize(t,n);case Hh.ROTATE:return ro.deserialize(t,n)}break;case gn.GESTURE:return xe.deserialize(t,n);case gn.MISC:switch(t[2]){case ke.GESTURE:return xe.deserialize(t,n);case ke.SHOW_HIDE_LAYER:return Ah.deserialize(t,n);case ke.GESTURE_LAYER:return xe.deserialize(t,n);case ke.EXECUTE:return Eu.deserialize(t,n);default:return Ou.deserialize(t,n)}}return null},uo={},so=function(t){try{var n=JSON.parse(t);return Rt(n)&&2<=n.length?n:null}catch(t){return null}},ho=function(t,n,i){var r=n.resources;if(0<=t&&t<r.length){var e=r[t];at(e)&&(i.gradient=function(t){var n=function(t){try{return JSON.parse(t)}catch(t){return null}}(t);if(!(null==n||n.length<7)){for(var i=n[0],r=[],e=1,u=n.length;e<u;e+=3)r.push({color:n[e+0],alpha:n[e+1],position:n[e+2]});return{points:r,direction:i}}}(e))}},oo={},ao=function(t){var n=oo[t];if(null!=n)return n instanceof HTMLImageElement?Promise.resolve(n):n;var i=new Promise((function(n,i){var r=document.createElement("img");r.onload=function(){oo[t]=r,n(r)},r.onabort=r.onerror=function(){i()},r.src=t}));return oo[t]=i,i},co=function(t,n,i){var r=n.resources;i.id=r[t[1]]||"";var e=i.transform;e.position.set(t[2],t[3]),e.rotation=t[6],e.skew.set(t[7],t[7]),e.pivot.set(t[21],t[22]),i.size.set(pr(t[4]),pr(t[5])),i.fill.deserialize(t[8],n),i.stroke.deserialize(t[9],n);var u=t[10];i.cursor=0<=u?r[u]:void 0,i.text.deserialize(t[11],n),i.data.deserialize(t[12],n),i.radius=t[13],i.corner=t[14];var s=t[23];i.interactive=!!(1&s);var h=i.state;h.isFocusable=!(2&s),h.isActive=!!(4&s);var o=t[24];i.shortcut=0<=o?r[o]:void 0;var a=t[25];i.title=0<=a?r[a]:void 0;var c=t[26];i.uuid=null!=c?c:0;var f=t[27],l=t[28],v=t[29];(null!=f&&f!==wt.NONE||null!=l&&l!==wt.NONE||null!=v&&v!==wt.NONE)&&i.capability.set(f,l,v);var b=function(t,n,i){if(0<t.length){for(var r=[],e=0,u=t.length;e<u;++e)r.push(Cr(t[e],n));return Promise.all(r).then((function(t){i.children=t;for(var n=0,r=t.length;n<r;++n)t[n].parent=i;return i.onChildTransformChange(),i.toDirty(),i}))}return null}(t[20],n,i);!function(t,n,i){for(var r=i.action,e=n.resources,u=0,s=t.length;u<s;++u){var h=t[u],o=n.getAction(h);if(null!=o)r.add(o);else{var a=e[h];if(null!=a){var c=so(a);if(null!=c&&0<c.length){var f=c[0],l=gn.EXTENSION<=f?uo[f]:eo;if(null!=l){var v=l(c,n);null!=v&&(n.setAction(h,v),r.add(v))}}}}}}(t[17],n,i),ho(t[19],n,i);var d=function(t,n,i){var r=n.resources;if(0<=t&&t<r.length){var e=r[t];if(at(e))return ao(e).then((function(t){return i.image=t,i}))}return null}(t[18],n,i);return null!=b?null!=d?Promise.all([b,d]).then((function(){return i})):b:null!=d?d:i},fo=function(t,n,i){i=i||new Kt;var r=co(t,n,i);i.points.deserialize(t[15],n);var e=i.points.style,u=F.NON_SCALING_MASK|F.DOTTED_MASK|F.DASHED_MASK,s=e&u;return s&&(i.points.style&=~u,i.stroke.style|=s),r},lo=function(){e[r.BAR]=Zt,n[r.BAR]=fo},vo={},bo=36,go=[0,0,0],mo=new t.Point,wo=function(t,n,i){var r=3*i-1;t[++r]=n,t[++r]=n+1,t[++r]=n+2,t[++r]=n+1,t[++r]=n+3,t[++r]=n+2,t[++r]=n+4,t[++r]=n+5,t[++r]=n+6,t[++r]=n+5,t[++r]=n+7,t[++r]=n+6,t[++r]=n+8,t[++r]=n+9,t[++r]=n+10,t[++r]=n+9,t[++r]=n+11,t[++r]=n+10,t[++r]=n+12,t[++r]=n+13,t[++r]=n+14,t[++r]=n+13,t[++r]=n+15,t[++r]=n+14,t[++r]=n+16,t[++r]=n+17,t[++r]=n+20,t[++r]=n+17,t[++r]=n+21,t[++r]=n+20,t[++r]=n+17,t[++r]=n+18,t[++r]=n+21,t[++r]=n+18,t[++r]=n+22,t[++r]=n+21,t[++r]=n+19,t[++r]=n+21,t[++r]=n+24,t[++r]=n+21,t[++r]=n+25,t[++r]=n+24,t[++r]=n+21,t[++r]=n+23,t[++r]=n+26,t[++r]=n+23,t[++r]=n+27,t[++r]=n+26,t[++r]=n+24,t[++r]=n+25,t[++r]=n+28,t[++r]=n+25,t[++r]=n+30,t[++r]=n+28,t[++r]=n+26,t[++r]=n+27,t[++r]=n+30,t[++r]=n+27,t[++r]=n+32,t[++r]=n+30,t[++r]=n+29,t[++r]=n+30,t[++r]=n+33,t[++r]=n+30,t[++r]=n+34,t[++r]=n+33,t[++r]=n+30,t[++r]=n+31,t[++r]=n+34,t[++r]=n+31,t[++r]=n+35,t[++r]=n+34},po=function(t,n,i,r,e,u,s,h,o,a,c){var f=s*h,l=.5*e+(0<=e?+f:-f),v=.5*u+(0<=u?+f:-f),b=Math.abs(l),d=Math.abs(v),g=o*Math.min(b,d),m=g/b,w=g/d,p=mo;p.set(i-l,r-v),a.apply(p,p);var D=p.x,E=p.y;p.set(i,r-v),a.apply(p,p);var M=p.x,S=p.y,T=M-D,j=S-E,N=m*T,I=m*j,C=D+N,A=E+I,R=M+T,L=S+j,y=R-N,k=L-I;p.set(i,r),a.apply(p,p);var x=p.x,B=p.y,_=x-M,P=B-S,U=w*_,F=w*P,G=M+U,H=S+F,z=G-T,V=H-j,W=z+N,X=V+I,K=G+T,Y=H+j,J=K-N,Z=Y-I,q=x-T,Q=B-j,$=x+T,tt=B+j,nt=x+_,it=B+P,rt=nt-U,et=it-F,ut=rt-T,st=et-j,ht=ut+N,ot=st+I,at=rt+T,ct=et+j,ft=at-N,lt=ct-I,vt=nt-T,bt=it-j,dt=vt+N,gt=bt+I,mt=nt+T,wt=it+j,pt=mt-N,Ot=wt-I;c[0]=O(D,E,C,A),c[1]=O(D,E,M,S),c[2]=O(D,E,q,Q);var Dt=2*n-1;t[++Dt]=D,t[++Dt]=E,t[++Dt]=C,t[++Dt]=A,t[++Dt]=z,t[++Dt]=V,t[++Dt]=W,t[++Dt]=X,t[++Dt]=y,t[++Dt]=k,t[++Dt]=R,t[++Dt]=L,t[++Dt]=J,t[++Dt]=Z,t[++Dt]=K,t[++Dt]=Y,t[++Dt]=ut,t[++Dt]=st,t[++Dt]=ht,t[++Dt]=ot,t[++Dt]=vt,t[++Dt]=bt,t[++Dt]=dt,t[++Dt]=gt,t[++Dt]=ft,t[++Dt]=lt,t[++Dt]=at,t[++Dt]=ct,t[++Dt]=pt,t[++Dt]=Ot,t[++Dt]=mt,t[++Dt]=wt,t[++Dt]=C,t[++Dt]=A,t[++Dt]=M,t[++Dt]=S,t[++Dt]=y,t[++Dt]=k,t[++Dt]=z,t[++Dt]=V,t[++Dt]=W,t[++Dt]=X,t[++Dt]=G,t[++Dt]=H,t[++Dt]=J,t[++Dt]=Z,t[++Dt]=K,t[++Dt]=Y,t[++Dt]=q,t[++Dt]=Q,t[++Dt]=x,t[++Dt]=B,t[++Dt]=x,t[++Dt]=B,t[++Dt]=$,t[++Dt]=tt,t[++Dt]=ut,t[++Dt]=st,t[++Dt]=ht,t[++Dt]=ot,t[++Dt]=rt,t[++Dt]=et,t[++Dt]=ft,t[++Dt]=lt,t[++Dt]=at,t[++Dt]=ct,t[++Dt]=dt,t[++Dt]=gt,t[++Dt]=nt,t[++Dt]=it,t[++Dt]=pt,t[++Dt]=Ot},Oo=function(t,n,i,r){var e=3*n-1,u=1-r[0]/r[1],s=1-r[0]/r[2];i&it.TOP_LEFT?(t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=1):(t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=u,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=s,t[++e]=0,t[++e]=u,t[++e]=s,t[++e]=0),i&it.TOP_RIGHT?(t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1):(t[++e]=u,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=u,t[++e]=s,t[++e]=0,t[++e]=1,t[++e]=s,t[++e]=0),i&it.BOTTOM_LEFT?(t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1):(t[++e]=1,t[++e]=s,t[++e]=0,t[++e]=u,t[++e]=s,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=u,t[++e]=1,t[++e]=0),i&it.BOTTOM_RIGHT?(t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=1):(t[++e]=u,t[++e]=s,t[++e]=0,t[++e]=1,t[++e]=s,t[++e]=0,t[++e]=u,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0),t[++e]=u,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=u,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=s,t[++e]=0,t[++e]=u,t[++e]=s,t[++e]=0,t[++e]=0,t[++e]=s,t[++e]=0,t[++e]=u,t[++e]=s,t[++e]=0,t[++e]=1,t[++e]=s,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=0,t[++e]=0,t[++e]=0,t[++e]=0,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=s,t[++e]=0,t[++e]=u,t[++e]=s,t[++e]=0,t[++e]=0,t[++e]=s,t[++e]=0,t[++e]=u,t[++e]=s,t[++e]=0,t[++e]=1,t[++e]=s,t[++e]=0,t[++e]=u,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=u,t[++e]=1,t[++e]=0},Do=function(t,n,i,r,e,u,s){var h,a,c,f,l,v,b,d,g,m,w,p,O=o(e),D=s[0],E=s[1],M=s[2],S=Math.max(0,1-s[0]/s[1]),T=Math.max(0,1-s[0]/s[2]);r&Gt.TOP?(h=2,a=1,c=1+T):(h=-2,a=-1,c=-1-T),r&Gt.RIGHT?(f=2,l=1,v=1+S):(f=-2,l=-1,v=-1-S),r&Gt.BOTTOM?(b=2,d=1,g=1+T):(b=-2,d=-1,g=-1-T),r&Gt.LEFT?(m=2,w=1,p=1+S):(m=-2,w=-1,p=-1-S);var j=6*n-1;u&it.TOP_LEFT?(t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=m,t[++j]=h,t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=w,t[++j]=h,t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=m,t[++j]=a,t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=w,t[++j]=a):(t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=m,t[++j]=h,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=p,t[++j]=h,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=m,t[++j]=c,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=p,t[++j]=c),u&it.TOP_RIGHT?(t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=l,t[++j]=h,t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=f,t[++j]=h,t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=l,t[++j]=a,t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=f,t[++j]=a):(t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=v,t[++j]=h,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=f,t[++j]=h,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=v,t[++j]=c,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=f,t[++j]=c),u&it.BOTTOM_LEFT?(t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=m,t[++j]=d,t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=w,t[++j]=d,t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=m,t[++j]=b,t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=w,t[++j]=b):(t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=m,t[++j]=g,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=p,t[++j]=g,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=m,t[++j]=b,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=p,t[++j]=b),u&it.BOTTOM_RIGHT?(t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=l,t[++j]=d,t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=f,t[++j]=d,t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=l,t[++j]=b,t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=f,t[++j]=b):(t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=v,t[++j]=g,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=f,t[++j]=g,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=v,t[++j]=b,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=f,t[++j]=b),t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=p,t[++j]=h,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=w,t[++j]=h,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=v,t[++j]=h,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=m,t[++j]=c,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=p,t[++j]=c,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=w,t[++j]=c,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=v,t[++j]=c,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=f,t[++j]=c,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=m,t[++j]=a,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=w,t[++j]=a,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=l,t[++j]=d,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=f,t[++j]=d,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=m,t[++j]=g,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=p,t[++j]=g,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=d,t[++j]=g,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=v,t[++j]=g,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=f,t[++j]=g,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=p,t[++j]=b,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=d,t[++j]=b,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=v,t[++j]=b},Eo=function(t,n,i,r){var e=i.x0,u=i.x1,s=i.x2,h=i.x3,o=i.y0,a=i.y1,c=i.y2,f=i.y3,l=.5*(e+u),v=.5*(o+a),b=.5*(h+s),d=.5*(f+c),g=.5*r[0]/r[1],m=.5*r[0]/r[2],w=g*(u-e),p=g*(a-o),O=m*(h-e),D=m*(f-o),E=2*n-1;t[++E]=e,t[++E]=o,t[++E]=e+w,t[++E]=o+p,t[++E]=e+O,t[++E]=o+D,t[++E]=e+w+O,t[++E]=o+p+D,t[++E]=u-w,t[++E]=a-p,t[++E]=u,t[++E]=a,t[++E]=u-w+O,t[++E]=a-p+D,t[++E]=u+O,t[++E]=a+D,t[++E]=h-O,t[++E]=f-D,t[++E]=h+w-O,t[++E]=f+p-D,t[++E]=h,t[++E]=f,t[++E]=h+w,t[++E]=f+p,t[++E]=s-w-O,t[++E]=c-p-D,t[++E]=s-O,t[++E]=c-D,t[++E]=s-w,t[++E]=c-p,t[++E]=s,t[++E]=c,t[++E]=e+w,t[++E]=o+p,t[++E]=l,t[++E]=v,t[++E]=u-w,t[++E]=a-p,t[++E]=e+O,t[++E]=o+D,t[++E]=e+O+w,t[++E]=o+D+p,t[++E]=l+O,t[++E]=v+D,t[++E]=u+O-w,t[++E]=a+D-p,t[++E]=u+O,t[++E]=a+D;var M=.5*(e+s),S=.5*(o+c);t[++E]=.5*(e+h),t[++E]=.5*(o+f),t[++E]=M,t[++E]=S,t[++E]=M,t[++E]=S,t[++E]=.5*(u+s),t[++E]=.5*(a+c),t[++E]=h-O,t[++E]=f-D,t[++E]=h-O+w,t[++E]=f-D+p,t[++E]=b-O,t[++E]=d-D,t[++E]=s-O-w,t[++E]=c-D-p,t[++E]=s-O,t[++E]=c-D,t[++E]=h+w,t[++E]=f+p,t[++E]=b,t[++E]=d,t[++E]=s-w,t[++E]=c-p},Mo=function(t){function n(n,i,r,e){var u=t.call(this,n,i,r,e)||this;return u.radius=NaN,u.corner=NaN,u}return B(n,t),n.prototype.init=function(t){t.updateIndices(),wo(t.indices,this.vertexOffset,this.indexOffset)},n.prototype.update=function(t,n){this.updateVertexClippingStepAndUv(t,n),this.updateColorFill(t,n),this.updateColorStroke(t,n)},n.prototype.updateVertexClippingStepAndUv=function(t,n){var i=n.size,r=i.x,e=i.y,u=n.radius,s=r!==this.sizeX||e!==this.sizeY||u!==this.radius,h=z(n),o=this.transformLocalId!==h,a=n.stroke,c=a.align,f=a.enable?a.width:0,l=a.side,v=a.style,b=this.strokeAlign!==c||this.strokeWidth!==f||this.strokeSide!==l||this.strokeStyle!==v,d=n.corner,g=d!==this.corner,m=V(n),w=W(m),p=m!==this.texture||w!==this.textureTransformId,O=s||b;if(O||o||g||p){this.sizeX=r,this.sizeY=e,this.radius=u,this.transformLocalId=h,this.strokeAlign=c,this.strokeWidth=f,this.strokeSide=l,this.strokeStyle=v,this.corner=d,this.texture=m,this.textureTransformId=w;var D=this.vertexOffset;t.updateVertices(),po(t.vertices,D,0,0,r,e,c,f,u,n.transform.internalTransform,go),(O||g||o)&&(t.updateSteps(),Do(t.steps,D,f,l,v,d,go)),(O||g)&&(t.updateClippings(),Oo(t.clippings,D,d,go)),(O||p)&&(t.updateUvs(),Eo(t.uvs,D,X(m),go))}},n}(H),So=function(t,n,i,r,e){var s=M(n),h=4*s,o=2*s,a=bo+h,c=24+o;return t.check(i,r,a,c)?new u(t,i,r,a,c,[new Mo(i,r,a-h,c-o),new Jt(i+bo,r+24,h,o)]).init(n):null},To=function(t,n,i,r,e){return So(t,n,i,r)},jo=function(t,n,i,r,e,u){var s=-i+e;if(t<=s)return n<=(h=-r+e)&&u&it.TOP_LEFT?(a=t-s)*a+(c=n-h)*c<=e*e:(o=+r-e)<=n&&u&it.BOTTOM_LEFT?(a=t-s)*a+(c=n-o)*c<=e*e:-i<=t;var h,o,a,c,f=+i-e;return f<=t?n<=(h=-r+e)&&u&it.TOP_RIGHT?(a=t-f)*a+(c=n-h)*c<=e*e:(o=+r-e)<=n&&u&it.BOTTOM_RIGHT?(a=t-f)*a+(c=n-o)*c<=e*e:t<=+i:-r<=n&&n<=+r},No=function(t,n,i,r,e,u,s){var h=t.fill;if(h.enable||0<u){var o=t.radius*Math.min(r,e),a=t.corner;if(jo(n,i,r,e,o,a)){if(h.enable)return!0;var c=u*s,f=Math.max(0,r-c),l=Math.max(0,e-c),v=Math.max(0,o-c);if(!jo(n,i,f,l,v,a)){var b=t.stroke.side;if(b===Gt.ALL)return!0;if(n<=-f+v){var d=!!(b&Gt.LEFT);return i<=-l+v?!(!(g=!!(b&Gt.TOP))||!d)||(g?-f<=i:!!d&&n<=-f):+l-v<=i?!(!(m=!!(b&Gt.BOTTOM))||!d)||(m?+f<=i:!!d&&n<=-f):d}if(+f-v<=n){var g,m,w=!!(b&Gt.RIGHT);return i<=-l+v?!(!(g=!!(b&Gt.TOP))||!w)||(g?-f<=i:!!w&&+f<=n):+l-v<=i?!(!(m=!!(b&Gt.BOTTOM))||!w)||(m?+f<=i:!!w&&+f<=n):w}return i<=-l+v?!!(b&Gt.TOP):+l-v<=i&&!!(b&Gt.BOTTOM)}}}return!1},Io=function(t){function n(n){return void 0===n&&(n=r.RECTANGLE_ROUNDED),t.call(this,n)||this}return B(n,t),n.prototype.clone=function(){return new n(this.type).copy(this)},n.prototype.containsAbs=function(n,i,r,e,u,s,h){return!!t.prototype.containsAbsBBox.call(this,n,i,r,e)&&No(this,n,i,r,e,u,s)},n}(Ut),Co=function(t){function n(n){void 0===n&&(n=r.BUTTON);var i=t.call(this,n)||this;return i.$s=!1,i.nh=!1,i}return B(n,t),Object.defineProperty(n.prototype,"isToggle",{get:function(){return this.$s},set:function(t){this.$s=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isGrouped",{get:function(){return this.nh},set:function(t){this.nh=t},enumerable:!1,configurable:!0}),n.prototype.clone=function(){return new n(this.type).copy(this)},n.prototype.serialize=function(n){var i=t.prototype.serialize.call(this,n),r=this.$s?1:0,e=this.nh?2:0;return i[15]=n.addResource("[".concat(r|e,"]")),i},n}(Io),Ao=function(t,n,i){i=i||new Co;var r=n.resources,e=t[15];if(0<=e&&e<r.length){var u=n.getExtension(e);null==u&&(u=JSON.parse(r[e]),n.setExtension(e,u)),i.isToggle=!!(1&u[0]),i.isGrouped=!!(2&u[0])}return co(t,n,i)},Ro=function(t){function n(n){var i=t.call(this,$t.COLOR_FILL_AND_STROKE|$t.COLOR_TEXT|$t.COLOR_TEXT_OUTLINE|$t.CURSOR)||this,r=n.fill,e=r.color,u=i.toOnHovered(e),s=2*u;i.xh=e,i.Bh=Qt.toGrayscale(e),i._h=Qt.darken(e,s),i.Ph=Qt.darken(e,u);var h=r.alpha;i.Uh=h,i.Fh=.5*h;var o=n.stroke,a=o.color,c=i.toOnHovered(a),f=2*c;i.Gh=a,i.Hh=Qt.toGrayscale(a),i.zh=Qt.darken(a,f),i.Vh=Qt.darken(a,c);var l=o.alpha;i.Wh=l,i.Xh=.5*l;var v=n.text,b=v.color;i.Xs=b,i.Kh=Qt.toGrayscale(b);var d=v.alpha;i.Ks=d,i.Yh=.5*d;var g=v.outline,m=g.color;i.Jh=m,i.Zh=Qt.toGrayscale(m);var w=g.alpha;return i.qh=w,i.Qh=.5*w,i}return B(n,t),n.prototype.toOnHovered=function(t){var n,i=Qt.toLuma(t);return 128<=i?.15*(1-(n=(i-128)/127))+.03*n:-.15*(1-(n=(127-i)/127))-.175*n},n.prototype.execute=function(t,n,i){var r=t.state;t.fill.set(void 0,this.getFillColor(r),this.getFillAlpha(r)),t.stroke.set(void 0,this.getStrokeColor(r),this.getStrokeAlpha(r)),t.text.set(void 0,this.getTextColor(r),this.getTextAlpha(r)),t.text.outline.set(void 0,this.getTextOutlineColor(r),this.getTextOutlineAlpha(r)),t.cursor=this.getCursor(r),n.written|=this.reset},n.prototype.getFillColor=function(t){return t.inDisabled?this.Bh:t.isPressed||t.isActive?this._h:t.isFocused||t.isHovered?this.Ph:this.xh},n.prototype.getFillAlpha=function(t){return t.inDisabled?this.Fh:this.Uh},n.prototype.getStrokeColor=function(t){return t.inDisabled?this.Hh:t.isPressed||t.isActive?this.zh:t.isFocused||t.isHovered?this.Vh:this.Gh},n.prototype.getStrokeAlpha=function(t){return t.inDisabled?this.Xh:this.Wh},n.prototype.getTextColor=function(t){return t.inDisabled?this.Kh:this.Xs},n.prototype.getTextAlpha=function(t){return t.inDisabled?this.Yh:this.Ks},n.prototype.getTextOutlineColor=function(t){return t.inDisabled?this.Zh:this.Jh},n.prototype.getTextOutlineAlpha=function(t){return t.inDisabled?this.Qh:this.qh},n.prototype.getCursor=function(t){return t.isActionable?"pointer":""},n}(en),Lo=function(t){function n(n){var i=t.call(this,$t.COLOR_FILL_AND_STROKE|$t.COLOR_TEXT|$t.COLOR_TEXT_OUTLINE|$t.CURSOR)||this,r=n.fill,e=r.color;i.$h=e;var u=i.toOnHovered(e),s=2*u;i.no=Qt.darken(e,s),i.io=Qt.darken(e,u);var h=15197671;i.xh=h;var o=i.toOnHovered(h),a=2*o;i._h=Qt.darken(h,a),i.Ph=Qt.darken(h,o);var c=r.alpha;i.Uh=c,i.Fh=.5*c;var f=n.stroke,l=f.color;i.ro=l;var v=i.toOnHovered(l),b=2*v;i.eo=Qt.darken(l,b),i.uo=Qt.darken(l,v);var d=15197671;i.Gh=d;var g=i.toOnHovered(d),m=2*g;i.zh=Qt.darken(d,m),i.so=Qt.darken(d,g);var w=f.alpha;i.Wh=w,i.Xh=.5*w;var p=n.text,O=p.color;i.ho=O,i.Kh=Qt.toGrayscale(O),i.Xs=5197647;var D=p.alpha;i.Ks=D,i.Yh=.5*D;var E=p.outline,M=E.color;i.Jh=M,i.Zh=Qt.toGrayscale(M);var S=E.alpha;return i.qh=S,i.Qh=.5*S,i}return B(n,t),n.prototype.toOnHovered=function(t){var n,i=Qt.toLuma(t);return 128<=i?.15*(1-(n=(i-128)/127))+.03*n:-.15*(1-(n=(127-i)/127))-.175*n},n.prototype.execute=function(t,n,i){var r=t.state;t.fill.set(void 0,this.getFillColor(r),this.getFillAlpha(r)),t.stroke.set(void 0,this.getStrokeColor(r),this.getStrokeAlpha(r)),t.text.set(void 0,this.getTextColor(r),this.getTextAlpha(r)),t.text.outline.set(void 0,this.getTextOutlineColor(r),this.getTextOutlineAlpha(r)),t.cursor=this.getCursor(r),n.written|=this.reset},n.prototype.getFillColor=function(t){return t.inDisabled?this.xh:t.isActive?t.isPressed?this.no:t.isFocused||t.isHovered?this.io:this.$h:t.isPressed?this._h:t.isFocused||t.isHovered?this.Ph:this.xh},n.prototype.getFillAlpha=function(t){return t.inDisabled?this.Fh:this.Uh},n.prototype.getStrokeColor=function(t){return t.inDisabled?this.Gh:t.isActive?t.isPressed?this.eo:t.isFocused||t.isHovered?this.uo:this.ro:t.isPressed?this.zh:t.isFocused||t.isHovered?this.so:this.Gh},n.prototype.getStrokeAlpha=function(t){return t.inDisabled?this.Xh:this.Wh},n.prototype.getTextColor=function(t){return t.inDisabled?this.Kh:t.isActive?this.ho:this.Xs},n.prototype.getTextAlpha=function(t){return t.inDisabled?this.Yh:this.Ks},n.prototype.getTextOutlineColor=function(t){return t.inDisabled?this.Zh:this.Jh},n.prototype.getTextOutlineAlpha=function(t){return t.inDisabled?this.Qh:this.qh},n.prototype.getCursor=function(t){return t.isActionable?"pointer":""},n}(en),yo=function(t){function n(n){var i=t.call(this,n)||this;return n instanceof Co&&(i.$s=n.isToggle,i.nh=n.isGrouped),i}return B(n,t),n.prototype.isActionable=function(){return!0},n.prototype.initialize=function(n){this.actions.unshift(this.$s?new Lo(this):new Ro(this)),t.prototype.initialize.call(this,n)},n.prototype.onClick=function(n,i){var r=n.state,e=r.isClicked;r.lock(),t.prototype.onClick.call(this,n,i),!e&&r.isClicked&&(this.$s?r.isActive=!r.isActive:r.isActive||(r.isActivated=!0)),r.unlock()},n.prototype.onStateChange=function(n,i,r){t.prototype.onStateChange.call(this,n,i,r),this.$s&&this.nh&&i.is(lt.ACTIVATED)&&this.onActivated(n)},n.prototype.onActivated=function(t){var n=t.parent;if(null!=n)for(var i=n.children,r=0,e=i.length;r<e;++r){var u=i[r];u!==t&&u instanceof Co&&u.isToggle&&u.isGrouped&&(u.state.isActive=!1)}},n}(Ze),ko=function(){e[r.BUTTON]=To,n[r.BUTTON]=Ao,vo[r.BUTTON]=yo,mr.set(r.BUTTON,wt.PRIMITIVE|wt.STROKE_SIDE|wt.BORDER_RADIUS)},xo=[0,0],Bo=new t.Point,_o=function(t,n){var i=3*n-1;t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=0,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=0,t[++i]=1,t[++i]=0,t[++i]=0,t[++i]=1,t[++i]=1,t[++i]=0,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=0,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=1},Po=function(t,n,i){var r=3*i-1;t[++r]=n,t[++r]=n+1,t[++r]=n+3,t[++r]=n+1,t[++r]=n+4,t[++r]=n+3,t[++r]=n+1,t[++r]=n+2,t[++r]=n+4,t[++r]=n+2,t[++r]=n+5,t[++r]=n+4,t[++r]=n+3,t[++r]=n+4,t[++r]=n+6,t[++r]=n+4,t[++r]=n+7,t[++r]=n+6,t[++r]=n+4,t[++r]=n+5,t[++r]=n+7,t[++r]=n+5,t[++r]=n+8,t[++r]=n+7},Uo=function(t,n,i,r,e,u,s,h,o,a){var c=Bo,f=s*h,l=.5*e+(0<=e?+f:-f),v=.5*u+(0<=u?+f:-f);c.set(-l+i,-v+r),o.apply(c,c);var b=c.x,d=c.y;c.set(0+i,-v+r),o.apply(c,c);var g=c.x,m=c.y,w=g-b,p=m-d;c.set(i,r),o.apply(c,c);var D=c.x,E=c.y,M=D+(D-g),S=E+(E-m),T=D-w,j=E-p,N=2*n-1;t[++N]=b,t[++N]=d,t[++N]=g,t[++N]=m,t[++N]=g+w,t[++N]=m+p,t[++N]=T,t[++N]=j,t[++N]=D,t[++N]=E,t[++N]=D+w,t[++N]=E+p,t[++N]=M-w,t[++N]=S-p,t[++N]=M,t[++N]=S,t[++N]=M+w,t[++N]=S+p,a[0]=O(b,d,g,m),a[1]=O(b,d,T,j)},Fo=function(t,n,i,r,e,u){for(var s=o(e),h=6*i-1,a=3*i,c=0;c<9;c+=1,a+=3)t[++h]=r,t[++h]=s,t[++h]=u[0],t[++h]=u[1],t[++h]=1+n[a],t[++h]=1+n[a+1]},Go=function(t,n,i){var r=i.x0,e=i.x1,u=i.x2,s=i.x3,h=i.y0,o=i.y1,a=i.y2,c=i.y3,f=2*n-1;t[++f]=r,t[++f]=h,t[++f]=.5*(r+e),t[++f]=.5*(h+o),t[++f]=e,t[++f]=o,t[++f]=.5*(r+s),t[++f]=.5*(h+c),t[++f]=.5*(r+u),t[++f]=.5*(h+a),t[++f]=.5*(e+u),t[++f]=.5*(o+a),t[++f]=s,t[++f]=c,t[++f]=.5*(s+u),t[++f]=.5*(c+a),t[++f]=u,t[++f]=a},Ho=function(t){function n(n,i){return t.call(this,n,i,9,8)||this}return B(n,t),n.prototype.init=function(t){t.updateClippings(),t.updateIndices();var n=this.vertexOffset;_o(t.clippings,n),Po(t.indices,n,this.indexOffset)},n.prototype.update=function(t,n){this.updateVertexAndStep(t,n),this.updateColorFill(t,n),this.updateColorStroke(t,n),this.updateUv(t,n)},n.prototype.updateVertexAndStep=function(t,n){var i=n.size,r=i.x,e=i.y,u=r!==this.sizeX||e!==this.sizeY,s=z(n),h=this.transformLocalId!==s,o=n.stroke,a=o.align,c=o.enable?o.width:0,f=o.style,l=this.strokeAlign!==a||this.strokeWidth!==c||this.strokeStyle!==f;(u||h||l)&&(this.sizeX=r,this.sizeY=e,this.transformLocalId=s,this.strokeAlign=a,this.strokeWidth=c,this.strokeStyle=f,t.updateVertices(),t.updateSteps(),Uo(t.vertices,this.vertexOffset,0,0,r,e,a,c,n.transform.internalTransform,xo),Fo(t.steps,t.clippings,this.vertexOffset,c,f,xo))},n.prototype.updateUv=function(t,n){var i=V(n),r=W(i);if(i!==this.texture||r!==this.textureTransformId){this.texture=i,this.textureTransformId=r,t.updateUvs();var e=X(i);Go(t.uvs,this.vertexOffset,e)}},n}(H),zo=function(t,n,i,r,e){var s=M(n),h=4*s,o=2*s,a=9+h,c=8+o;return t.check(i,r,a,c)?new u(t,i,r,a,c,[new Ho(i,r),new Jt(i+9,r+8,h,o)]).init(n):null},Vo=function(t){function n(n){return void 0===n&&(n=r.CIRCLE),t.call(this,n)||this}return B(n,t),n.prototype.clone=function(){return new n(this.type).copy(this)},n.prototype.containsAbs=function(n,i,r,e,u,s,h){return!!t.prototype.containsAbsBBox.call(this,n,i,r,e)&&Ft(this,n,i,r,e,u,s)},n}(Ut),Wo=function(t,n,i){return co(t,n,i||new Vo)},Xo=function(){e[r.CIRCLE]=zo,n[r.CIRCLE]=Wo},Ko=new t.Point,Yo=function(t){return t?t.formatted.length:0},Jo=function(t){return 12*Math.ceil(Yo(t)/12)},Zo=function(t,n){return n?4*t+2:4*t},qo=function(t,n){return Zo(t,n)-2},Qo=function(t,n,i,r){for(var e=3*n-1,u=3*(n+i)-1,s=0;s<r;++s)t[++e]=1,t[++e]=0,t[++e]=3,t[++e]=0,t[++e]=1,t[++e]=5,t[++e]=1,t[++e]=0,t[++e]=4,t[++e]=0,t[++e]=1,t[++e]=6;for(;e<u;)t[++e]=1,t[++e]=0,t[++e]=3,t[++e]=0,t[++e]=1,t[++e]=5},$o=function(t,n,i,r){for(var e=3*i-1,u=3*(i+r)-1,s=n;e<u;)t[++e]=s+0,t[++e]=s+2,t[++e]=s+1,t[++e]=s+1,t[++e]=s+2,t[++e]=s+3,s+=2},ta=function(t,n,i,r,e,u){for(var s=1/Math.max(1e-5,u),h=e.x0,o=e.x1,a=e.x2,c=e.x3,f=e.y0,l=e.y1,v=e.y2,b=e.y3,d=o-h,g=l-f,m=a-c,w=v-b,p=(i<<1)-1,O=(i+r<<1)-1,D=(i<<2)-8;p<O;){var E=n[D+=8]*s;t[++p]=h+E*d,t[++p]=f+E*g,t[++p]=c+E*m,t[++p]=b+E*w}},na=function(t,n,i,r,e,u,s,h,o,a,c,f){var l=U;null==l&&(U=l=[]);for(var v=f.a,b=f.b,d=f.c,g=f.d,m=f.tx,w=f.ty,p=0;p<u;++p){var O=p<<1,D=h[O],E=h[O+1];l[O]=v*D+d*E+m,l[O+1]=b*D+g*E+w}return ra(t,n,i,r,e,u,s,l,o,a,c)},ia=function(t,n,i,r,e,u,s,h,o,a,c,f,l,v,b){n[++t]=s,n[++t]=h,r[++i]=o,r[++i]=a,r[++i]=c,r[++i]=f,r[++i]=l,r[++i]=v,u[e+=1]=b,n[++t]=s,n[++t]=h,r[++i]=o,r[++i]=a,r[++i]=c,r[++i]=f,r[++i]=l,r[++i]=v,u[e+=4]=b},ra=function(t,n,i,r,e,u,s,h,o,a,c){var f=o.length;if(0<f){if(s){for(var l=0,v=0,b=r,d=0,g=o[0],m=1;m<f;++m)2<=(d=o[m])-g&&(v=ua(t,n,i,b,-1,h,g,d,u,a,c,v),l=Math.max(l,v),b+=Zo(d-g,!1)),g=d;return 2<=(d=o[0]+u)-g?(v=ua(t,n,i,b,r+e-b,h,g,d,u,a,c,v),l=Math.max(l,v),b+=Zo(d-g,!1)):ea(t,n,i,b,r+e-b,h,g,d,u,a,c,v),l}for(l=0,v=0,b=r,2<=(d=o[0])&&(v=ua(t,n,i,b,-1,h,0,d,u,a,c,v),l=Math.max(l,v),b+=Zo(d,!1)),g=d,m=1;m<f;++m)2<=(d=o[m])-g&&(v=ua(t,n,i,b,-1,h,g,d,u,a,c,v),l=Math.max(l,v),b+=Zo(d-g,!1)),g=d;return 2<=(d=u)-g?(v=ua(t,n,i,b,r+e-b,h,g,d,u,a,c,v),l=Math.max(l,v),b+=Zo(d-g,!1)):ea(t,n,i,b,r+e-b,h,g,d,u,a,c,v),l}return s?sa(t,n,i,r,e,h,0,u,u,a,c):ua(t,n,i,r,e,h,0,u,u,a,c,0)},ea=function(t,n,i,r,e,u,s,h,a,c,f,l){if(0<=e)for(var v=o(f),b=(r<<1)-1,d=6*r-1,g=(r<<2)-1,m=(r+e<<1)-1,w=s%a<<1,p=u[w],O=u[w+1];b<m;)t[++b]=p,t[++b]=O,n[++d]=0,n[++d]=v,n[++d]=-1,n[++d]=0,n[++d]=1,n[++d]=0,i[++g]=l,i[++g]=0,i[++g]=0,i[++g]=l;return 0},ua=function(t,n,i,r,e,u,s,a,c,f,l,v){var b=o(l),d=s%c<<1,g=u[d],m=u[d+1],w=(s+1)%c<<1,p=u[w],D=u[w+1],E=g-(p-g),M=m-(D-m),S=(r<<1)-1,T=6*r-1,j=(r<<2)-1,N=0;ia(S,t,T,n,j,i,g,m,f,b,E,M,p,D,v),ia(S+=4,t,T+=12,n,j+=8,i,g,m,f,b,E,M,p,D,N),S+=4,T+=12,j+=8;for(var I=s+1,C=a-1;I<C;++I){E=g,M=m,g=p,m=D;var A=(I+1)%c<<1;p=u[A],D=u[A+1],N+=O(E,M,g,m),ia(S,t,T,n,j,i,g,m,f,b,E,M,p,D,N),ia(S+=4,t,T+=12,n,j+=8,i,g,m,f,b,E,M,p,D,N),S+=4,T+=12,j+=8}E=g,M=m,p=(g=p)+(g-E),D=(m=D)+(m-M),N+=O(E,M,g,m),ia(S,t,T,n,j,i,g,m,f,b,E,M,p,D,N),ia(S+=4,t,T+=12,n,j+=8,i,g,m,f,b,E,M,p,D,N),S+=4,T+=12,j+=8;var R=h(N,f,l,Ko),L=R.x,y=R.y,k=(r<<2)-1;for(I=k,C=k+8;I<C;I+=4)i[I+2]=L,i[I+3]=y,i[I+4]=v;for(I=k+8;I<j;I+=4)i[I+2]=L,i[I+3]=y,i[I+4]=N;if(0<=e)for(var x=(r+e<<1)-1;S<x;)t[++S]=g,t[++S]=m,n[++T]=0,n[++T]=b,n[++T]=E,n[++T]=M,n[++T]=p,n[++T]=D,i[++j]=N,i[++j]=L,i[++j]=y,i[++j]=N;return N},sa=function(t,n,i,r,e,u,s,a,c,f,l){for(var v=o(l),b=(a-1)%c<<1,d=0,g=0,m=u[b],w=u[b+1],p=s%c<<1,D=u[p],E=u[p+1],M=0,S=(r<<1)-1,T=6*r-1,j=(r<<2)-1,N=s;N<a;++N){d=m,g=w,m=D,w=E;var I=(N+1)%c<<1;D=u[I],E=u[I+1],M+=O(d,g,m,w),ia(S,t,T,n,j,i,m,w,f,v,d,g,D,E,M),ia(S+=4,t,T+=12,n,j+=8,i,m,w,f,v,d,g,D,E,M),S+=4,T+=12,j+=8}d=m,g=w,m=D,w=E;var C=(s+1)%c<<1;D=u[C],E=u[C+1],M+=O(d,g,m,w),ia(S,t,T,n,j,i,m,w,f,v,d,g,D,E,M),S+=4,T+=12,j+=8;var A=h(M,f,l,Ko),R=A.x,L=A.y;for(N=(r<<2)-1;N<j;N+=4)i[N+2]=R,i[N+3]=L,i[N+4]=-1;if(0<=e)for(var y=(r+e<<1)-1;S<y;)t[++S]=m,t[++S]=w,n[++T]=f,n[++T]=v,n[++T]=d,n[++T]=g,n[++T]=D,n[++T]=E,i[++j]=M,i[++j]=R,i[++j]=L,i[++j]=-1;return M},ha=function(t){function n(n,i,r,e){var u=t.call(this,n,i,r,e)||this;return u.pointId=-1,u.pointCount=0,u.pointsClosed=!1,u.length=1,u}return B(n,t),n.prototype.init=function(t){t.updateIndices(),$o(t.indices,this.vertexOffset,this.indexOffset,this.indexCount)},n.prototype.isCompatible=function(t){return Zo(Jo(t.points),!0)===this.vertexCount},n.prototype.update=function(t,n){this.updateLineClipping(t,n),this.updateLineVertexStepAndColorFill(t,n),this.updateColorStroke(t,n),this.updateLineUv(t,n)},n.prototype.updateLineClipping=function(t,n){var i=n.points;if(i){var r=i.formatted.length;this.pointCount!==r&&(this.pointCount=r,this.pointId=-1,t.updateClippings(),Qo(t.clippings,this.vertexOffset,this.vertexCount,r))}},n.prototype.updateLineVertexStepAndColorFill=function(t,n){var i=n.points;if(i){var r=i.id,e=i.formatted,u=!!(e.style&F.CLOSED),s=r!==this.pointId||u!==this.pointsClosed,h=n.stroke,o=h.enable?h.width:0,a=h.style,c=this.strokeWidth!==o||this.strokeStyle!==a,f=z(n),l=this.transformLocalId!==f;(s||l||c)&&(this.pointId=r,this.pointsClosed=u,this.strokeWidth=o,this.strokeStyle=a,this.transformLocalId=f,s&&(this.textureTransformId=NaN),t.updateVertices(),t.updateSteps(),t.updateColorFills(),this.length=na(t.vertices,t.steps,t.colorFills,this.vertexOffset,this.vertexCount,this.pointCount,this.pointsClosed,e.values,e.segments,o,a,n.transform.internalTransform))}},n.prototype.updateLineUv=function(t,n){var i=V(n),r=W(i);i===this.texture&&r===this.textureTransformId||(this.texture=i,this.textureTransformId=r,t.updateUvs(),ta(t.uvs,t.colorFills,this.vertexOffset,this.vertexCount,X(i),this.length))},n}(H),oa=[0,0,0],aa=new t.Point,ca=function(t,n){var i=3*n-1;t[++i]=0,t[++i]=0,t[++i]=0,t[++i]=1,t[++i]=0,t[++i]=0,t[++i]=1,t[++i]=0,t[++i]=0,t[++i]=0,t[++i]=1,t[++i]=0,t[++i]=0,t[++i]=1,t[++i]=0,t[++i]=1,t[++i]=0,t[++i]=0,t[++i]=1,t[++i]=0,t[++i]=0},fa=function(t,n,i){var r=3*i-1;t[++r]=n+0,t[++r]=n+1,t[++r]=n+2,t[++r]=n+0,t[++r]=n+3,t[++r]=n+4,t[++r]=n+0,t[++r]=n+5,t[++r]=n+6},la=function(t,n,i,r,e,u,s,h,o,a){var c=s*h,f=.5*e+(0<=e?+c:-c),l=.5*u+(0<=u?+c:-c),v=2*f*l/(f+Math.sqrt(f*f+4*l*l)),b=aa;b.set(i,r-l),o.apply(b,b);var d=b.x,g=b.y;b.set(i,r),o.apply(b,b);var m=b.x,w=b.y;b.set(i+f,r),o.apply(b,b);var p=m-d,D=w-g,E=b.x+p,M=b.y+D,S=m+(m-b.x)+p,T=w+(w-b.y)+D;b.set(i,r+l-v),o.apply(b,b);var j=b.x,N=b.y,I=m+p,C=w+D;a[0]=O(I,C,j,N),a[1]=O(E,M,I,C),a[2]=O(d,g,m,w);var A=(n<<1)-1;t[++A]=j,t[++A]=N,t[++A]=d,t[++A]=g,t[++A]=E,t[++A]=M,t[++A]=E,t[++A]=M,t[++A]=S,t[++A]=T,t[++A]=S,t[++A]=T,t[++A]=d,t[++A]=g},va=function(t,n,i,r,e,u,s){for(var h=o(u),a=s[0],c=6*i-1,f=3*i,l=0;l<r;l+=1,f+=3)t[++c]=e,t[++c]=h,t[++c]=a,t[++c]=a,t[++c]=1+n[f],t[++c]=1+n[f+1]},ba=function(t,n,i,r){var e=n.x0,u=n.x1,s=n.x2,h=n.x3,o=n.y0,a=n.y1,c=n.y2,f=n.y3,l=.5*(e+u),v=.5*(o+a),b=1-.5*r[0]/r[2],d=l+b*(h-e),g=v+b*(f-o),m=(i<<1)-1;t[++m]=d,t[++m]=g,t[++m]=l,t[++m]=v,t[++m]=s,t[++m]=c,t[++m]=s,t[++m]=c,t[++m]=h,t[++m]=f,t[++m]=h,t[++m]=f,t[++m]=l,t[++m]=v},da=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.updateColorFill=function(t,n){var i=n.points;if(null!=i){var r=i.getMarker();if(null!=r){var e=this.toMarker(r).fill,u=n.visible&&e.enable,s=e.color,h=u?e.alpha:0;s===this.colorFill&&h===this.alphaFill||(this.colorFill=s,this.alphaFill=h,t.updateColorFills(),G(s,h,this.vertexOffset,this.vertexCount,t.colorFills))}}},n}(H),ga=function(n){function i(t,i){var r=n.call(this,t,i,7,3)||this;return r.pointId=-1,r}return B(i,n),i.prototype.init=function(t){t.updateClippings(),t.updateIndices(),ca(t.clippings,this.vertexOffset),fa(t.indices,this.vertexOffset,this.indexOffset)},i.prototype.update=function(t,n){this.updateVertexStepAndUv(t,n),this.updateColorFill(t,n),this.updateColorStroke(t,n)},i.prototype.updateVertexStepAndUv=function(n,r){var e,u=r.points;if(null!=u){var s=u.getMarker();if(null!=s){var h=this.toMarker(s),o=h.size,a=o.x,c=o.y,f=a!==this.sizeX||c!==this.sizeY,l=z(r),v=this.transformLocalId!==l,b=r.stroke,d=b.align,g=b.enable?b.width:0,m=b.style,w=this.strokeAlign!==d||this.strokeWidth!==g||this.strokeStyle!==m,p=V(r),O=W(p),D=p!==this.texture||O!==this.textureTransformId,E=f||w,M=u.id,S=M!==this.pointId;if(E||v||D||S){this.sizeX=a,this.sizeY=c,this.transformLocalId=l,this.strokeAlign=d,this.strokeWidth=g,this.strokeStyle=m,this.texture=p,this.textureTransformId=O,this.pointId=M;var T=this.vertexOffset,j=null!==(e=i.WORK)&&void 0!==e?e:i.WORK=new t.Matrix;j.copyFrom(h.transform).prepend(r.transform.internalTransform),n.updateVertices(),la(n.vertices,T,0,0,a,c,d,g,j,oa),(E||v)&&(n.updateSteps(),va(n.steps,n.clippings,T,7,g,m,oa)),(E||D)&&(n.updateUvs(),ba(n.uvs,X(p),T,oa))}}}},i}(da),ma=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.toMarker=function(t){return t.head},n}(ga),wa=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.toMarker=function(t){return t.tail},n}(ga),pa=function(n){function i(t,i){var r=n.call(this,t,i,9,8)||this;return r.pointId=-1,r}return B(i,n),i.prototype.init=function(t){t.updateClippings(),t.updateIndices();var n=this.vertexOffset;_o(t.clippings,n),Po(t.indices,n,this.indexOffset)},i.prototype.update=function(t,n){this.updateVertexAndStep(t,n),this.updateColorFill(t,n),this.updateColorStroke(t,n),this.updateUv(t,n)},i.prototype.updateVertexAndStep=function(n,r){var e,u=r.points;if(null!=u){var s=u.getMarker();if(null!=s){var h=this.toMarker(s),o=h.size,a=o.x,c=o.y,f=a!==this.sizeX||c!==this.sizeY,l=z(r),v=this.transformLocalId!==l,b=r.stroke,d=b.align,g=b.enable?b.width:0,m=b.style,w=this.strokeAlign!==d||this.strokeWidth!==g||this.strokeStyle!==m,p=u.id,O=p!==this.pointId;if(f||v||w||O){this.sizeX=a,this.sizeY=c,this.transformLocalId=l,this.strokeAlign=d,this.strokeWidth=g,this.strokeStyle=m,this.pointId=p;var D=null!==(e=i.WORK)&&void 0!==e?e:i.WORK=new t.Matrix;D.copyFrom(h.transform).prepend(r.transform.internalTransform),n.updateVertices(),n.updateSteps(),Uo(n.vertices,this.vertexOffset,0,0,a,c,d,g,D,xo),Fo(n.steps,n.clippings,this.vertexOffset,g,m,xo)}}}},i.prototype.updateUv=function(t,n){var i=V(n),r=W(i);if(i!==this.texture||r!==this.textureTransformId){this.texture=i,this.textureTransformId=r,t.updateUvs();var e=X(i);Go(t.uvs,this.vertexOffset,e)}},i}(da),Oa=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.toMarker=function(t){return t.head},n}(pa),Da=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.toMarker=function(t){return t.tail},n}(pa),Ea=function(){function n(t,n){this.vertexOffset=t,this.indexOffset=n,this.vertexCount=0,this.indexCount=0,this.texture=null}return n.prototype.init=function(t){},n.prototype.isCompatible=function(t){return!0},n.prototype.update=function(t,n){this.texture=V(n)},n.prototype.buildUnit=function(n){var i=this.texture||t.Texture.WHITE,r=i.baseTexture;if(r!==n.baseTexture){n.baseTexture=r;var e=this.indexOffset;n.push(i,e)}},n}(),Ma=24,Sa=16,Ta=[0,0,0,0],ja=new t.Point,Na=function(t,n,i){var r=1-i[0],e=1-i[1],u=3*n-1;t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=e,t[++u]=0,t[++u]=0,t[++u]=e,t[++u]=0,t[++u]=0,t[++u]=e,t[++u]=0,t[++u]=0,t[++u]=e,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=r,t[++u]=0,t[++u]=0,t[++u]=r,t[++u]=0,t[++u]=0,t[++u]=r,t[++u]=0,t[++u]=0,t[++u]=r,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0},Ia=function(t,n,i){var r=3*i-1;t[++r]=n+0,t[++r]=n+1,t[++r]=n+4,t[++r]=n+4,t[++r]=n+1,t[++r]=n+2,t[++r]=n+4,t[++r]=n+2,t[++r]=n+5,t[++r]=n+5,t[++r]=n+2,t[++r]=n+3,t[++r]=n+8,t[++r]=n+6,t[++r]=n+9,t[++r]=n+9,t[++r]=n+6,t[++r]=n+7,t[++r]=n+9,t[++r]=n+7,t[++r]=n+10,t[++r]=n+10,t[++r]=n+7,t[++r]=n+11,t[++r]=n+12,t[++r]=n+16,t[++r]=n+13,t[++r]=n+13,t[++r]=n+16,t[++r]=n+17,t[++r]=n+13,t[++r]=n+17,t[++r]=n+14,t[++r]=n+14,t[++r]=n+17,t[++r]=n+15,t[++r]=n+18,t[++r]=n+20,t[++r]=n+21,t[++r]=n+18,t[++r]=n+21,t[++r]=n+22,t[++r]=n+18,t[++r]=n+22,t[++r]=n+19,t[++r]=n+19,t[++r]=n+22,t[++r]=n+23},Ca=function(t,n,i,r,e,u,s,h,o,a){var c=s*h,f=.5*e+(0<=e?+c:-c),l=.5*u+(0<=u?+c:-c),v=ja;v.set(i-f,r-l),o.apply(v,v);var b=v.x,d=v.y;v.set(i+f,r-l),o.apply(v,v);var g=v.x,m=v.y;v.set(i+f,r+l),o.apply(v,v);var w=v.x,p=v.y,D=b+(w-g),E=d+(p-m),M=.5*O(b,d,g,m),S=.5*O(g,m,w,p),T=1,j=1;M<=S?j=M/S:T=S/M,a[0]=T,a[1]=j,a[2]=M,a[3]=S;var N=T*(g-b)*.5,I=T*(m-d)*.5,C=j*(D-b)*.5,A=j*(E-d)*.5,R=(n<<1)-1;t[++R]=b,t[++R]=d,t[++R]=b+N,t[++R]=d+I,t[++R]=g-N,t[++R]=m-I,t[++R]=g,t[++R]=m,t[++R]=b+N+C,t[++R]=d+I+A,t[++R]=g-N+C,t[++R]=m-I+A,t[++R]=D+N-C,t[++R]=E+I-A,t[++R]=w-N-C,t[++R]=p-I-A,t[++R]=D,t[++R]=E,t[++R]=D+N,t[++R]=E+I,t[++R]=w-N,t[++R]=p-I,t[++R]=w,t[++R]=p,t[++R]=b,t[++R]=d,t[++R]=b+C,t[++R]=d+A,t[++R]=D-C,t[++R]=E-A,t[++R]=D,t[++R]=E,t[++R]=b+C+N,t[++R]=d+A+I,t[++R]=D-C+N,t[++R]=E-A+I,t[++R]=g+C-N,t[++R]=m+A-I,t[++R]=w-C-N,t[++R]=p-A-I,t[++R]=g,t[++R]=m,t[++R]=g+C,t[++R]=m+A,t[++R]=w-C,t[++R]=p-A,t[++R]=w,t[++R]=p},Aa=function(t,n,i,r,e,u){var s,h,a,c,f,l,v,b,d=o(e),g=u[0],m=u[1],w=Math.max(0,1-g),p=Math.max(0,1-m),O=u[2],D=u[3];r&Gt.TOP?(s=2,h=1+p):(s=-2,h=-1-p),r&Gt.RIGHT?(a=2,c=1+w):(a=-2,c=-1-w),r&Gt.BOTTOM?(f=2,l=1+p):(f=-2,l=-1-p),r&Gt.LEFT?(v=2,b=1+w):(v=-2,b=-1-w);var E=6*(t-1)-1;Ra(n,E+=6,i,d,O,D,v,s),Ra(n,E+=6,i,d,O,D,b,s),Ra(n,E+=6,i,d,O,D,c,s),Ra(n,E+=6,i,d,O,D,a,s),Ra(n,E+=6,i,d,O,D,b,h),Ra(n,E+=6,i,d,O,D,c,h),Ra(n,E+=6,i,d,O,D,b,l),Ra(n,E+=6,i,d,O,D,c,l),Ra(n,E+=6,i,d,O,D,v,f),Ra(n,E+=6,i,d,O,D,b,f),Ra(n,E+=6,i,d,O,D,c,f),Ra(n,E+=6,i,d,O,D,a,f),Ra(n,E+=6,i,d,O,D,v,s),Ra(n,E+=6,i,d,O,D,v,h),Ra(n,E+=6,i,d,O,D,v,l),Ra(n,E+=6,i,d,O,D,v,f),Ra(n,E+=6,i,d,O,D,b,h),Ra(n,E+=6,i,d,O,D,b,l),Ra(n,E+=6,i,d,O,D,c,h),Ra(n,E+=6,i,d,O,D,c,l),Ra(n,E+=6,i,d,O,D,a,s),Ra(n,E+=6,i,d,O,D,a,h),Ra(n,E+=6,i,d,O,D,a,l),Ra(n,E+=6,i,d,O,D,a,f)},Ra=function(t,n,i,r,e,u,s,h){t[++n]=i,t[++n]=r,t[++n]=e,t[++n]=u,t[++n]=s,t[++n]=h},La=function(t,n,i,r){var e=i.x0,u=i.y0,s=i.y1,h=i.x1,o=i.y2,a=i.x2,c=i.y3,f=i.x3,l=r[0],v=r[1],b=l*(h-e)*.5,d=l*(s-u)*.5,g=v*(f-e)*.5,m=v*(c-u)*.5,w=(n<<1)-1;t[++w]=e,t[++w]=u,t[++w]=e+b,t[++w]=u+d,t[++w]=h-b,t[++w]=s-d,t[++w]=h,t[++w]=s,t[++w]=e+b+g,t[++w]=u+d+m,t[++w]=h-b+g,t[++w]=s-d+m,t[++w]=f+b-g,t[++w]=c+d-m,t[++w]=a-b-g,t[++w]=o-d-m,t[++w]=f,t[++w]=c,t[++w]=f+b,t[++w]=c+d,t[++w]=a-b,t[++w]=o-d,t[++w]=a,t[++w]=o,t[++w]=e,t[++w]=u,t[++w]=e+g,t[++w]=u+m,t[++w]=f-g,t[++w]=c-m,t[++w]=f,t[++w]=c,t[++w]=e+g+b,t[++w]=u+m+d,t[++w]=f-g+b,t[++w]=c-m+d,t[++w]=h+g-b,t[++w]=s+m-d,t[++w]=a-g-b,t[++w]=o-m-d,t[++w]=h,t[++w]=s,t[++w]=h+g,t[++w]=s+m,t[++w]=a-g,t[++w]=o-m,t[++w]=a,t[++w]=o},ya=function(n){function i(t,i){var r=n.call(this,t,i,Ma,Sa)||this;return r.pointId=-1,r}return B(i,n),i.prototype.init=function(t){t.updateIndices(),Ia(t.indices,this.vertexOffset,this.indexOffset)},i.prototype.update=function(t,n){this.updateVertexClippingStepAndUv(t,n),this.updateColorFill(t,n),this.updateColorStroke(t,n)},i.prototype.updateVertexClippingStepAndUv=function(n,r){var e,u=r.points;if(null!=u){var s=u.getMarker();if(null!=s){var h=this.toMarker(s),o=h.size,a=o.x,c=o.y,f=a!==this.sizeX||c!==this.sizeY,l=z(r),v=this.transformLocalId!==l,b=r.stroke,d=b.align,g=b.enable?b.width:0,m=b.side,w=b.style,p=this.strokeAlign!==d||this.strokeWidth!==g||this.strokeSide!==m||this.strokeStyle!==w,O=V(r),D=W(O),E=O!==this.texture||D!==this.textureTransformId,M=f||p,S=u.id!==this.pointId;if(M||v||E||S){this.sizeX=a,this.sizeY=c,this.transformLocalId=l,this.strokeAlign=d,this.strokeWidth=g,this.strokeSide=m,this.strokeStyle=w,this.texture=O,this.textureTransformId=D;var T=this.vertexOffset,j=null!==(e=i.WORK)&&void 0!==e?e:i.WORK=new t.Matrix;j.copyFrom(h.transform).prepend(r.transform.internalTransform),n.updateVertices(),Ca(n.vertices,T,0,0,a,c,d,g,j,Ta),(M||v)&&(n.updateSteps(),Aa(T,n.steps,g,m,w,Ta)),M&&(n.updateClippings(),Na(n.clippings,T,Ta)),(M||E)&&(n.updateUvs(),La(n.uvs,T,X(O),Ta))}}}},i}(da),ka=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.toMarker=function(t){return t.tail},n}(ya),xa=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.toMarker=function(t){return t.head},n}(ya),Ba=function(t){switch(t){case J.NONE:return 0;case J.CIRCLE:return 9;case J.TRIANGLE:return 7;case J.RECTANGLE:return Ma}return 0},_a=function(t){switch(t){case J.NONE:return 0;case J.CIRCLE:return 8;case J.TRIANGLE:return 3;case J.RECTANGLE:return Sa}return 0},Pa=function(t,n,i){switch(t){case J.NONE:return new Ea(n,i);case J.CIRCLE:return new Oa(n,i);case J.TRIANGLE:return new ma(n,i);case J.RECTANGLE:return new xa(n,i)}return new Ea(n,i)},Ua=function(t,n,i){switch(t){case J.NONE:return new Ea(n,i);case J.CIRCLE:return new Da(n,i);case J.TRIANGLE:return new wa(n,i);case J.RECTANGLE:return new ka(n,i)}return new Ea(n,i)},Fa=function(t,n,i,r,e){var s=n.points,h=Jo(s),o=Zo(h,!0),a=qo(h,!0),c=J.NONE,f=J.NONE;if(s&&s instanceof ne){var l=s.getMarker();l&&(c=l.tail.type,f=l.head.type)}var v=Ba(c),b=_a(c),d=i+o,g=r+a,m=Ba(f),w=_a(f),p=d+v,O=g+b,D=M(n),E=4*D,S=2*D,T=p+m,j=O+w,N=o+m+v+E,I=a+w+b+S;return t.check(i,r,N,I)?new u(t,i,r,N,I,[new ha(i,r,o,a),Ua(c,d,g),Pa(f,p,O),new Jt(T,j,E,S)]).init(n):null},Ga=function(){function t(t,n,i){this.oo=1e-6,this._x=t,this._y=n,this._z=0,this.L=i,i[0]=t,i[1]=n,this.index=0}return Object.defineProperty(t.prototype,"x",{get:function(){return this._x},set:function(t){if(0===this._z||this.oo<Math.abs(this._x-t)){this._x=t;var n=this.index,i=this.L;1===this._z?(i[n+0]=this._x,i[n+1]=this._y):(i[n+2]=this._x,i[n+3]=this._y,this.index+=2,this._z=1)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this._y},set:function(t){if(0===this._z||this.oo<Math.abs(this._y-t)){this._y=t;var n=this.index,i=this.L;2===this._z?(i[n+0]=this._x,i[n+1]=this._y):(i[n+2]=this._x,i[n+3]=this._y,this.index+=2,this._z=2)}},enumerable:!1,configurable:!0}),t.prototype.toAxis=function(t,n,i,r){var e=Math.abs(i),u=Math.abs(r),s=this.oo;if(e<s&&u<s)return Math.abs(t)<Math.abs(n)?0<=n?2:0:0<=t?1:3;var h=.2;return 0<=i?0<=r?h<e&&h<u?t<n?2:1:h<e?1:2:h<e&&h<u?t<-n?0:1:h<e?1:0:0<=r?h<e&&h<u?-t<n?2:3:h<e?3:2:h<e&&h<u?n<t?0:3:h<e?3:0},t.prototype.toTailAxis=function(t,n,i,r){return this.toAxis(t-this.x,n-this.y,i,r)},t.prototype.tail=function(t,n,i,r,e,u,s){switch(this.toTailAxis(t,n,i,r)){case 0:this.y-s<=n?(this.y-=Math.max(s,u),this.x=t):this.y=n;break;case 1:t<=this.x+s?(this.x+=Math.max(s,e),this.y=n):this.x=t;break;case 2:n<=this.y+s?(this.y+=Math.max(s,e),this.x=t):this.y=n;break;case 3:this.x-s<=t?(this.x-=Math.max(s,e),this.y=n):this.x=t}},t.prototype.middle=function(t,n){var i=t-this._x,r=n-this._y;Math.abs(i)<Math.abs(r)?this.y=n:this.x=t},t.prototype.toHeadAxis=function(t,n,i,r){return this.toAxis(this.x-t,this.y-n,i,r)},t.prototype.head=function(t,n,i,r,e,u,s){switch(this.toHeadAxis(t,n,i,r)){case 0:n-s<=this.y&&(this.y=n-Math.max(s,u)),this.x=t,this.y=n;break;case 1:this.x<=t+s&&(this.x=t+Math.max(s,e)),this.y=n,this.x=t;break;case 2:this.y<=n+s&&(this.y=n+Math.max(s,u)),this.x=t,this.y=n;break;case 3:t-s<=this.x&&(this.x=t-Math.max(s,e)),this.y=n,this.x=t}},t.prototype.margin=function(t,n){var i=this.L,r=this.index;if(0!==t&&2<=r){var e=i[0],u=i[1],s=(o=i[2]-e)*o+(a=i[3]-u)*a;if((c=this.oo)<s){var h=t/Math.sqrt(o*o+a*a);c<Math.abs(h-1)?(i[0]=e+o*h,i[1]=u+a*h):this.index-=2}}if(r=this.index,0!==n&&2<=r){var o,a,c,f=i[r+0],l=i[r+1];s=(o=i[r-2]-f)*o+(a=i[r-1]-l)*a,(c=this.oo)<s&&(h=n/Math.sqrt(o*o+a*a),c<Math.abs(h-1)?(i[r+0]=f+o*h,i[r+1]=l+a*h):this.index-=2)}i.length=this.index+2},t}(),Ha=function(t){function n(n){return void 0===n&&(n=r.CONNECTOR_ELBOW),t.call(this,n)||this}return B(n,t),n.prototype.fillPoints=function(t,n,i,r,e,u,s,h){var o=t.local,a=o.x,c=o.y,f=t.normal,l=f.x,v=f.y,b=i.local,d=b.x,g=b.y,m=i.normal,w=m.x,p=m.y,O=e.values,D=O.length,E=a-u,M=c-s,S=d-u,T=g-s,j=.5*(S+E),N=.5*(T+M),I=S-E,C=T-M,A=.5*Y.SIZE_X,R=.5*Y.SIZE_Y,L=1e-6;if(Math.abs(I)<L&&Math.abs(C)<L)h[0]=E,h[1]=M,h[2]=S,h[3]=T,h.length=4;else{var y=new Ga(E,M,h);if(0<D){var k=Math.atan2(C,I),x=Math.sqrt(I*I+C*C),B=Math.cos(k)*x,_=Math.sin(k)*x,P=O[0],U=O[1],F=j+B*P-_*U,G=N+B*U+_*P;y.tail(F,G,l,v,A,R,n);for(var H=2;H<D;H+=2){var z=O[H+0],V=O[H+1],W=j+B*z-_*V,X=N+B*V+_*z;y.middle(W,X)}y.head(S,T,w,p,A,R,r)}else y.tail(j,N,l,v,A,R,n),y.head(S,T,w,p,A,R,r);y.margin(n,r)}},n}(re),za=function(t,n,i){return co(t,n,i||new Ha)},Va=function(){function t(){}return t.from=function(t,n,i){var r=[],e=t.length;if(4<e){var u=1e-6,s=t[0],h=t[1];0!==n&&u<(c=(o=s-t[2])*o+(a=h-t[3])*a)&&(s+=o*(f=n/Math.sqrt(c)),h+=a*f);var o,a,c,f,l=t[e-2],v=t[e-1];0!==i&&u<(c=(o=l-t[e-4])*o+(a=v-t[e-3])*a)&&(l+=o*(f=i/Math.sqrt(c)),v+=a*f);for(var b=.5*(l+s),d=.5*(v+h),g=l-s,m=v-h,w=Math.atan2(m,g),p=Math.cos(w),O=Math.sin(w),D=g*g+m*m,E=u<D?1/Math.sqrt(D):1,M=2,S=e-2;M<S;M+=2){var T=t[M+0]-b,j=t[M+1]-d;r.push((p*T+O*j)*E,(p*j-O*T)*E)}}return r},t}(),Wa=function(t,n,i){return co(t,n,i||new re)},Xa=function(t,n,i,r){if(n instanceof re){var e=r.resources,u=t[15];if(0<=u&&u<e.length){var s=r.getExtension(u);null==s&&(s=JSON.parse(e[u]),r.setExtension(u,s)),n.lock();var h=n.points;h.deserialize(s[1],r);var o=n.edge;o.deserialize(s[0],i,r);var a=n.body,c=s[2];null!=c?a.deserialize(c,i,r):a.set(Va.from(h.values,o.tail.margin,o.head.margin)),n.unlock()}}},Ka=function(){e[r.CONNECTOR_ELBOW]=Fa,n[r.CONNECTOR_ELBOW]=za,i[r.CONNECTOR_ELBOW]=Xa,mr.set(r.CONNECTOR_ELBOW,wt.CONNECTOR)},Ya=function(){e[r.CONNECTOR_LINE]=Fa,n[r.CONNECTOR_LINE]=Wa,i[r.CONNECTOR_LINE]=Xa,mr.set(r.CONNECTOR_LINE,wt.CONNECTOR)},Ja=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.init=function(t){t.updateIndices(),Ia(t.indices,this.vertexOffset,this.indexOffset)},n.prototype.update=function(t,n){this.updateVertexClippingStepAndUv(t,n),this.updateColorFill(t,n),this.updateColorStroke(t,n)},n.prototype.updateVertexClippingStepAndUv=function(t,n){var i=n.size,r=i.x,e=i.y,u=r!==this.sizeX||e!==this.sizeY,s=z(n),h=this.transformLocalId!==s,o=n.stroke,a=o.align,c=o.enable?o.width:0,f=o.side,l=o.style,v=this.strokeAlign!==a||this.strokeWidth!==c||this.strokeSide!==f||this.strokeStyle!==l,b=V(n),d=W(b),g=b!==this.texture||d!==this.textureTransformId,m=u||v;if(m||h||g){this.sizeX=r,this.sizeY=e,this.transformLocalId=s,this.strokeAlign=a,this.strokeWidth=c,this.strokeSide=f,this.strokeStyle=l,this.texture=b,this.textureTransformId=d;var w=this.vertexOffset;t.updateVertices(),Ca(t.vertices,w,.5*r,.5*e,r,e,a,c,n.transform.internalTransform,Ta),(m||h)&&(t.updateSteps(),Aa(w,t.steps,c,f,l,Ta)),m&&(t.updateClippings(),Na(t.clippings,w,Ta)),(m||g)&&(t.updateUvs(),La(t.uvs,w,X(b),Ta))}},n}(H),Za=function(t,n,i,r,e){var s=M(n),h=4*s,o=2*s,a=Ma+h,c=Sa+o;return t.check(i,r,a,c)?new u(t,i,r,a,c,[new Ja(i,r,a-h,c-o),new Jt(i+Ma,r+Sa,h,o)]).init(n):null},qa=function(t,n,i,r){var e=M(n),s=4*e,h=2*e,o=s,a=h;return t.check(i,r,o,a)?new u(t,i,r,o,a,[new Jt(i,r,s,h)]).init(n):null},Qa=function(t,n){var i=t.data.getMapping();if(null!=i)for(var r=i.values,e=0,u=r.length;e<u;++e){var s=r[e],h=s[0],o=n.getDataMapper(h);if(null!=o){var a=t.children,c=n.getDataDestination(s[1]),f=s[2];$a(a,o,c,f)}}},$a=function(t,n,i,r){for(var e=0,u=t.length;e<u;++e){for(var s=t[e],h=s.data,o=0,a=h.size();o<a;++o){var c=h.get(o);c&&c.scope!==jt.PRIVATE&&n.map(c,i,r)}var f=s.children;0<f.length&&$a(f,n,i,r)}},tc=function(t,n,i){var r=n.pieces,e=t[15];if(r&&0<=e&&e<r.length){var u=n.pieceData;if(u){var s=r[e],h=u.get(s),o=i&&i(s,n);return h?function(t,n,i,r,e,u,s){var h=e.mode,o=e.depth;s=s||new Nr(t,h,o);var a=co(u,e,s),c=s.size,f=c.x,l=c.y;return s.size.set(n,i),r.copyTo(s),s.size.init(),s.size.set(f,l),h===gr.EDITOR?0<o&&Qa(s,e):Qa(s,e),a}(s,h.width,h.height,h.layer,n,t,o):function(t,n,i,r){var e=n.mode,u=n.depth;r=r||new Nr(t,e,u);var s=co(i,n,r),h=r.size,o=h.x,a=h.y,c=r.children,f=new je("missing",e,u),l=.5*o,v=.5*o;f.transform.position.set(-l,-v),f.size.set(o,a),f.size.init(),f.parent=r;var b=new qe;return b.stroke.color=16711680,b.transform.position.set(l,v),b.size.copyFrom(r.size),b.attach(f),c.push(f),r.onChildTransformChange(),r.toDirty(),r.onAttach(),r.size.init(),e===gr.EDITOR?0<u&&Qa(r,n):Qa(r,n),s}(s,n,t,o)}}return null},nc=function(){e[r.EMBEDDED]=qa,n[r.EMBEDDED]=tc,mr.set(r.EMBEDDED,wt.EMBEDDED),e[r.EMBEDDED_LAYER]=Za},ic=function(){function t(t){this.p=t}return Object.defineProperty(t.prototype,"enable",{get:function(){var t=this.p.children;return!(0<t.length)||t[t.length-1].fill.enable},set:function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i)n[i].fill.enable=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){var t=this.p.children;return 0<t.length?t[t.length-1].fill.color:16777215},set:function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i)n[i].fill.color=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){var t=this.p.children;return 0<t.length?t[t.length-1].fill.alpha:1},set:function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i)n[i].fill.alpha=t},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i)n[i].fill.copy(t)},t.prototype.set=function(t,n,i){for(var r=this.p.children,e=0,u=r.length;e<u;++e)r[e].fill.set(t,n,i)},t.prototype.clone=function(){return new t(this.p)},t.prototype.toObject=function(){var t=this.p.children;return 0<t.length?t[t.length-1].fill.toObject():{enable:!0,color:16777215,alpha:1}},t.prototype.serialize=function(t){return-1},t.prototype.deserialize=function(t,n){},t}(),rc=function(){function t(t){this.p=t}return Object.defineProperty(t.prototype,"length",{get:function(){var t=this.p.children;if(0<t.length){var n=t[t.length-1].points;if(null!=n)return n.length}return 0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"id",{get:function(){var t=this.p.children;if(0<t.length){var n=t[t.length-1].points;if(null!=n)return n.id}return 0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"values",{get:function(){var t=this.p.children;if(0<t.length){var n=t[t.length-1].points;if(null!=n)return n.values}return[]},set:function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i){var e=n[i].points;null!=e&&(e.values=t)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"segments",{get:function(){var t=this.p.children;if(0<t.length){var n=t[t.length-1].points;if(null!=n)return n.segments}return[]},set:function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i){var e=n[i].points;null!=e&&(e.segments=t)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"style",{get:function(){var t=this.p.children;if(0<t.length){var n=t[t.length-1].points;if(null!=n)return n.style}return F.NONE},set:function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i){var e=n[i].points;null!=e&&(e.style=t)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"marker",{get:function(){for(var t=this.p.children,n=0,i=t.length;n<i;++n){var r=t[n].points;if(null!=r)return r.marker}return Q.getInstance()},enumerable:!1,configurable:!0}),t.prototype.getMarker=function(){for(var t=this.p.children,n=0,i=t.length;n<i;++n){var r=t[n].points;if(null!=r)return r.getMarker()}},Object.defineProperty(t.prototype,"formatter",{get:function(){var t=this.p.children;if(0<t.length){var n=t[t.length-1].points;if(null!=n)return n.formatter}return null},set:function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i){var e=n[i].points;null!=e&&(e.formatter=t)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"formatted",{get:function(){var t=this.p.children;if(0<t.length){var n=t[t.length-1].points;if(null!=n)return n.formatted}return this},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i){var e=n[i].points;null!=e&&e.copy(t)}return this},t.prototype.set=function(t,n,i){for(var r=this.p.children,e=0,u=r.length;e<u;++e){var s=r[e].points;null!=s&&s.set(t,n,i)}return this},t.prototype.clone=function(n){return new t(n)},t.prototype.toPoints=function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i){var e=n[i].points;if(null!=e)return e.toPoints(t)}return[]},t.prototype.serialize=function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i){var e=n[i].points;if(null!=e)return e.serialize(t)}return-1},t}(),ec=function(){function t(t){this.p=t}return Object.defineProperty(t.prototype,"enable",{get:function(){var t=this.p.children;return 0<t.length&&t[t.length-1].stroke.enable},set:function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i)n[i].stroke.enable=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){var t=this.p.children;return 0<t.length?t[t.length-1].stroke.color:16777215},set:function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i)n[i].stroke.color=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){var t=this.p.children;return 0<t.length?t[t.length-1].stroke.alpha:1},set:function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i)n[i].stroke.alpha=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){var t=this.p.children;return 0<t.length?t[t.length-1].stroke.width:1},set:function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i)n[i].stroke.width=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"align",{get:function(){var t=this.p.children;return 0<t.length?t[t.length-1].stroke.align:1},set:function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i)n[i].stroke.align=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"side",{get:function(){var t=this.p.children;return 0<t.length?t[t.length-1].stroke.side:1},set:function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i)n[i].stroke.side=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"style",{get:function(){var t=this.p.children;return 0<t.length?t[t.length-1].stroke.style:s.NONE},set:function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i)n[i].stroke.style=t},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i)n[i].stroke.copy(t)},t.prototype.set=function(t,n,i,r,e){for(var u=this.p.children,s=0,h=u.length;s<h;++s)u[s].stroke.set(t,n,i,r,e)},t.prototype.clone=function(){return new t(this.p)},t.prototype.toObject=function(){var t=this.p.children;return 0<t.length?t[t.length-1].stroke.toObject():{enable:!1,color:16777215,alpha:1,width:1,align:0,side:Gt.NONE,style:s.NONE}},t.prototype.serialize=function(t){return-1},t.prototype.deserialize=function(t,n){},t}(),uc=function(t){function n(n,i){void 0===i&&(i=r.GROUP);var e=t.call(this,i)||this;e.Cr=n;var u=new kt;return e.data=u,e.tag=u,e.size=e.newGroupSize(n),e.fill=e.newGroupFill(),e.stroke=e.newGroupStroke(),e.text=e.newGroupText(),e.gt=e.newGroupPoints(),e}return B(n,t),Object.defineProperty(n.prototype,"mode",{get:function(){return this.Cr},enumerable:!1,configurable:!0}),n.prototype.newGroupSize=function(t){var n=Y.SIZE_X,i=Y.SIZE_Y;return t!==gr.VIEWER?new Er(this,n,i,this.isGroupSizeFittable()):new Mr(this,n,i,n,i)},n.prototype.isGroupSizeFittable=function(){return!0},n.prototype.newGroupFill=function(){return new ic(this)},n.prototype.newGroupStroke=function(){return new ec(this)},n.prototype.newGroupText=function(){return new Pt(this,Y.TEXT_VALUE,Y.TEXT_COLOR,Y.TEXT_ALPHA,Y.TEXT_FAMILY,Y.TEXT_SIZE)},n.prototype.newGroupPoints=function(){return new rc(this)},n.prototype.getBoundsSize=function(){var t=this.size;return t instanceof Mr?t.base:t},n.prototype.onChildTransformChange=function(){t.prototype.onChildTransformChange.call(this),this.size.fit()},Object.defineProperty(n.prototype,"corner",{get:function(){var t=this.children;return 0<t.length?t[t.length-1].corner:it.ALL},set:function(t){for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].corner=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"gradient",{get:function(){for(var t=this.children,n=t.length-1;0<=n;--n){var i=t[n].gradient;if(null!=i)return i}},set:function(t){for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].gradient=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"radius",{get:function(){var t=this.children;return 0<t.length?t[t.length-1].radius:.5},set:function(t){for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].radius=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"image",{get:function(){for(var t=this.children,n=t.length-1;0<=n;--n){var i=t[n].image;if(null!=i)return i}},set:function(t){for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].image=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"points",{get:function(){for(var t=this.children,n=t.length-1;0<=n;--n)if(null!=t[n].points)return this.gt},set:function(t){},enumerable:!1,configurable:!0}),n.prototype.clone=function(){for(var t=this.newClone().copy(this),n=this.children,i=0,r=n.length;i<r;++i){var e=n[i].clone();e.parent=t,t.children.push(e)}return t.onChildTransformChange(),t.toDirty(),t},n.prototype.newClone=function(){return new(0,this.constructor)(this.Cr,this.type)},n.prototype.containsAbs=function(t,n,i,r,e,u,s){return!1},n}(Ot),sc=function(t,n,i){i=i||new uc(n.mode);var r=co(t,n,i);return i.size.init(),r},hc=function(){e[r.GROUP]=qa,n[r.GROUP]=sc,mr.set(r.GROUP,wt.GROUP)},oc=function(){function n(n,i,r){this.p=n,this.j=new t.Point(i,r)}return n.prototype.init=function(){},Object.defineProperty(n.prototype,"x",{get:function(){return this.j.x},set:function(t){var n=this.j;if(n.x!==t){var i=n.x;n.x=t,this.onChange(i,n.y)}},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"y",{get:function(){return this.j.y},set:function(t){var n=this.j;if(n.y!==t){var i=n.y;n.y=t,this.onChange(n.x,i)}},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n){var i=!1,r=this.j,e=r.x,u=r.y;return null!=t&&e!==t&&(i=!0,r.x=t),null!=n&&u!==n&&(i=!0,r.y=n),i&&this.onChange(e,u),this},n.prototype.clone=function(){var t=this.j;return new n(this.p,t.x,t.y)},n.prototype.copy=function(){},n.prototype.copyFrom=function(t){var n=t.x,i=t.y,r=this.j,e=r.x,u=r.y;return e===n&&u===i||(r.x=n,r.y=i,this.onChange(e,u)),this},n.prototype.copyTo=function(t){return this.j.copyTo(t)},n.prototype.equals=function(t){return this.j.equals(t)},n.prototype.fit=function(){},n.prototype.onChange=function(t,n){this.p.onSizeChange()},n}(),ac=function(t){function n(n,i){return void 0===i&&(i=r.GROUP_SHADOWED),t.call(this,n,i)||this}return B(n,t),n.prototype.newGroupSize=function(n){return n!==gr.VIEWER?new oc(this,Y.SIZE_X,Y.SIZE_Y):t.prototype.newGroupSize.call(this,n)},n}(uc),cc=function(t,n,i){i=i||new ac(n.mode);var r=co(t,n,i);return i.size.init(),r},fc=function(){e[r.GROUP_SHADOWED]=qa,n[r.GROUP_SHADOWED]=cc,mr.set(r.GROUP_SHADOWED,wt.GROUP)},lc=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.init=function(t){t.updateIndices(),Ia(t.indices,this.vertexOffset,this.indexOffset)},n.prototype.update=function(t,n){this.updateVertexClippingStepAndUv(t,n),this.updateColorFill(t,n),this.updateColorStroke(t,n)},n.prototype.updateVertexClippingStepAndUv=function(t,n){var i=n.size,r=i.x,e=i.y,u=r!==this.sizeX||e!==this.sizeY,s=z(n),h=this.transformLocalId!==s,o=n.stroke,a=o.align,c=o.enable?o.width:0,f=o.side,l=o.style,v=this.strokeAlign!==a||this.strokeWidth!==c||this.strokeSide!==f||this.strokeStyle!==l,b=V(n),d=W(b),g=b!==this.texture||d!==this.textureTransformId,m=u||v;if(m||h||g){this.sizeX=r,this.sizeY=e,this.transformLocalId=s,this.strokeAlign=a,this.strokeWidth=c,this.strokeSide=f,this.strokeStyle=l,this.texture=b,this.textureTransformId=d;var w=this.vertexOffset;t.updateVertices(),Ca(t.vertices,w,0,0,r,e,a,c,n.transform.internalTransform,Ta),(m||h)&&(t.updateSteps(),Aa(w,t.steps,c,f,l,Ta)),m&&(t.updateClippings(),Na(t.clippings,w,Ta)),(m||g)&&(t.updateUvs(),La(t.uvs,w,X(b),Ta))}},n}(H),vc=function(t,n,i,r,e){var s=M(n),h=4*s,o=2*s,a=Ma+h,c=Sa+o;return t.check(i,r,a,c)?new u(t,i,r,a,c,[new lc(i,r,a-h,c-o),new Jt(i+Ma,r+Sa,h,o)]).init(n):null},bc=function(t){function n(n,i){void 0===i&&(i=r.IMAGE);var e=t.call(this,i)||this;return null!=n&&(e.image=n,e.size.set(n.width,n.height)),e.fill.alpha=1,e}return B(n,t),n.prototype.clone=function(){return new n(this.image,this.type).copy(this)},n}(qe),dc=function(t,n,i){return co(t,n,i||new bc)},gc=function(){e[r.IMAGE]=vc,n[r.IMAGE]=dc},mc=[0,0],wc=new t.Point,pc=function(t,n){for(var i=3*n-1,r=3*(n+9)-1;i<r;)t[++i]=0,t[++i]=0,t[++i]=2},Oc=function(t,n,i){var r=3*i-1;t[++r]=n,t[++r]=n+1,t[++r]=n+3,t[++r]=n+1,t[++r]=n+4,t[++r]=n+3,t[++r]=n+1,t[++r]=n+2,t[++r]=n+4,t[++r]=n+2,t[++r]=n+5,t[++r]=n+4,t[++r]=n+3,t[++r]=n+4,t[++r]=n+6,t[++r]=n+4,t[++r]=n+7,t[++r]=n+6,t[++r]=n+4,t[++r]=n+5,t[++r]=n+7,t[++r]=n+5,t[++r]=n+8,t[++r]=n+7},Dc=function(t,n,i,r,e,u,s,h){var a=o(e),c=u/h[0],f=s/h[1],l=.5*(c+f),v=12,b=-1+i,d=6*n-1;t[++d]=r,t[++d]=a,t[++d]=l,t[++d]=v,t[++d]=b,t[++d]=0,t[++d]=r,t[++d]=a,t[++d]=f,t[++d]=v,t[++d]=b,t[++d]=0,t[++d]=r,t[++d]=a,t[++d]=l,t[++d]=v,t[++d]=b,t[++d]=0,t[++d]=r,t[++d]=a,t[++d]=c,t[++d]=v,t[++d]=b,t[++d]=0,t[++d]=r,t[++d]=a,t[++d]=l,t[++d]=v,t[++d]=b,t[++d]=0,t[++d]=r,t[++d]=a,t[++d]=c,t[++d]=v,t[++d]=b,t[++d]=0,t[++d]=r,t[++d]=a,t[++d]=l,t[++d]=v,t[++d]=b,t[++d]=0,t[++d]=r,t[++d]=a,t[++d]=f,t[++d]=v,t[++d]=b,t[++d]=0,t[++d]=r,t[++d]=a,t[++d]=f,t[++d]=v,t[++d]=b,t[++d]=0},Ec=function(t,n,i,r,e,u,s,h){var o=wc,a=.5*e,c=.5*u;o.set(i-a,r-c),s.apply(o,o);var f=o.x,l=o.y;o.set(i+a,r-c),s.apply(o,o);var v=o.x,b=o.y;o.set(i+a,r+c),s.apply(o,o);var d=o.x,g=o.y,m=f+(d-v),w=l+(g-b),p=(n<<1)-1;t[++p]=f,t[++p]=l,t[++p]=.5*(f+v),t[++p]=.5*(l+b),t[++p]=v,t[++p]=b,t[++p]=.5*(f+m),t[++p]=.5*(l+w),t[++p]=.5*(f+d),t[++p]=.5*(l+g),t[++p]=.5*(v+d),t[++p]=.5*(b+g),t[++p]=m,t[++p]=w,t[++p]=.5*(m+d),t[++p]=.5*(w+g),t[++p]=d,t[++p]=g,h[0]=.5*O(f,l,v,b),h[1]=.5*O(f,l,m,w)},Mc=function(t,n,i){var r=i.x0,e=i.y0,u=i.x1,s=i.y1,h=i.x2,o=i.y2,a=i.x3,c=i.y3,f=(n<<1)-1;t[++f]=r,t[++f]=e,t[++f]=.5*(u+r),t[++f]=.5*(s+e),t[++f]=u,t[++f]=s,t[++f]=.5*(r+a),t[++f]=.5*(e+c),t[++f]=.5*(r+h),t[++f]=.5*(e+o),t[++f]=.5*(u+h),t[++f]=.5*(s+o),t[++f]=a,t[++f]=c,t[++f]=.5*(a+h),t[++f]=.5*(c+o),t[++f]=h,t[++f]=o},Sc=function(t){function n(n,i){var r=t.call(this,n,i,9,8)||this;return r.textureWidth=-1,r.textureHeight=-1,r}return B(n,t),n.prototype.init=function(t){var n=this.vertexOffset;t.updateClippings(),t.updateIndices(),pc(t.clippings,n),Oc(t.indices,n,this.indexOffset)},n.prototype.update=function(t,n){this.updateVertexAndStep(t,n),this.updateColorFill(t,n),this.updateColorStroke(t,n),this.updateUv(t,n)},n.prototype.updateVertexAndStep=function(t,n){var i=n.size,r=i.x,e=i.y,u=r!==this.sizeX||e!==this.sizeY,s=z(n),h=this.transformLocalId!==s,o=n.stroke,a=o.align,c=o.enable?o.width:0,f=o.style,l=this.strokeAlign!==a||this.strokeWidth!==c||this.strokeStyle!==f,v=V(n),b=v.width*v.resolution,d=v.height*v.resolution,g=this.textureWidth!==b||this.textureHeight!==d;(u||h||l||g)&&(this.sizeX=r,this.sizeY=e,this.transformLocalId=s,this.strokeAlign=a,this.strokeWidth=c,this.strokeStyle=f,this.textureWidth=b,this.textureHeight=d,t.updateVertices(),Ec(t.vertices,this.vertexOffset,0,0,r,e,n.transform.internalTransform,mc),t.updateSteps(),Dc(t.steps,this.vertexOffset,a,c,f,b,d,mc))},n.prototype.updateUv=function(t,n){var i=V(n),r=W(i);i===this.texture&&r===this.textureTransformId||(this.texture=i,this.textureTransformId=r,t.updateUvs(),Mc(t.uvs,this.vertexOffset,X(i)))},n}(H),Tc=function(t,n,i,r,e){var s=M(n),h=4*s,o=2*s,a=9+h,c=8+o;return t.check(i,r,a,c)?new u(t,i,r,a,c,[new Sc(i,r),new Jt(i+9,r+8,h,o)]).init(n):null},jc=function(t){function n(n,i){return void 0===i&&(i=r.IMAGE_SDF),t.call(this,n,i)||this}return B(n,t),n.prototype.clone=function(){return new n(this.image,this.type).copy(this)},n}(bc),Nc=function(t,n,i){return co(t,n,i||new jc)},Ic=function(){function n(t,n,i,r){this.vertexOffset=t,this.indexOffset=n,this.vertexCount=i,this.indexCount=r,this.texture=null}return n.prototype.init=function(t){},n.prototype.isCompatible=function(t){return!0},n.prototype.update=function(t,n){this.texture=V(n)},n.prototype.buildUnit=function(n){var i=this.texture||t.Texture.WHITE,r=i.baseTexture;if(r!==n.baseTexture){n.baseTexture=r;var e=this.indexOffset;n.push(i,e)}},n}(),Cc=function(t,n,i,r,e){var s=M(n),h=4*s,o=2*s,a=h,c=o;return t.check(i,r,a,c)?new u(t,i,r,a,c,[new Ic(i,r,a-h,c-o),new Jt(i,r,h,o)]).init(n):null},Ac=function(t){function n(n){return void 0===n&&(n=r.LABEL),t.call(this,n)||this}return B(n,t),n.prototype.clone=function(){return new n(this.type).copy(this)},n}(Ut),Rc=function(t,n,i){return co(t,n,i||new Ac)},Lc=function(){e[r.LABEL]=Cc,n[r.LABEL]=Rc},yc=function(t){function n(n){void 0===n&&(n=r.LINE);var i=t.call(this,n)||this;return i.gt=new ne(i),i}return B(n,t),Object.defineProperty(n.prototype,"points",{get:function(){return this.gt},enumerable:!1,configurable:!0}),n.prototype.clone=function(){return new n(this.type).copy(this)},n.prototype.serialize=function(n){var i=t.prototype.serialize.call(this,n);return i[15]=this.gt.serialize(n),i},n}(Xt),kc=function(t,n,i){i=i||new yc;var r=co(t,n,i);i.points.deserialize(t[15],n);var e=i.points.style,u=F.NON_SCALING_MASK|F.DOTTED_MASK|F.DASHED_MASK,s=e&u;return s&&(i.points.style&=~u,i.stroke.style|=s),r},xc=function(){e[r.LINE]=Fa,n[r.LINE]=kc},Bc=function(t,n,i){for(var r=3*n,e=3*(n+i);r<e;r+=3)t[r+0]=0,t[r+1]=0,t[r+2]=0},_c=function(t,n,i){for(var r=2*n,e=2*(n+i);r<e;r+=2)t[r+0]=0,t[r+1]=0},Pc=function(t,n,i){for(var r=6*n,e=6*(n+i);r<e;r+=6)t[r+0]=0,t[r+1]=0,t[r+2]=0,t[r+3]=0,t[r+4]=0,t[r+5]=0},Uc=function(t,n,i){for(var r=2*n,e=2*(n+i);r<e;r+=2)t[r+0]=0,t[r+1]=0},Fc=function(t){return 12*Math.ceil(t/12)},Gc=function(t,n,i,r,e,u,s,h){if(u)if(i.isStaticColor()){var o=i.getColor(0,s);if(i.isStaticAlpha()){var a=i.getAlpha(0,h);G(o,a,t,n*r,e)}else for(var c=0,f=t;c<r;c+=1,f+=n)a=i.getAlpha(c,h),G(o,a,f,n,e)}else if(i.isStaticAlpha())for(a=i.getAlpha(0,h),c=0,f=t;c<r;c+=1,f+=n)o=i.getColor(c,s),G(o,a,f,n,e);else for(c=0,f=t;c<r;c+=1,f+=n)o=i.getColor(c,s),a=i.getAlpha(c,h),G(o,a,f,n,e);else if(i.isStaticColor())o=i.getColor(0,s),G(o,0,t,n*r,e);else for(c=0,f=t;c<r;c+=1,f+=n)o=i.getColor(c,s),G(o,0,f,n,e)},Hc=function(t){function n(n,i,r,e,u){var s=t.call(this,n,i,r,e)||this;return s.pointId=-1,s.pointCount=0,s.pointCountReserved=u,s.pointSizeId=-1,s.pointOffsetId=-1,s.pointFillId=-1,s.pointStrokeId=-1,s}return B(n,t),n.prototype.isCompatible=function(t){return Fc(Yo(t.points))===this.pointCountReserved},n.prototype.updateLineOfAnyColorFill=function(t,n,i,r){var e=i.fill,u=e.id,s=u!==this.pointFillId,h=n.fill,o=n.visible&&h.enable,a=h.color,c=o?h.alpha:0,f=a!==this.colorFill||c!==this.alphaFill;(s||f)&&(this.colorFill=a,this.alphaFill=c,this.pointFillId=u,t.updateColorFills(),Gc(this.vertexOffset,r,e,this.pointCountReserved,t.colorFills,o,a,c))},n.prototype.updateLineOfAnyColorStroke=function(t,n,i,r){var e=i.stroke,u=e.id,s=u!==this.pointStrokeId,h=n.stroke,o=n.visible&&h.enable,a=h.color,c=o?h.alpha:0,f=a!==this.colorStroke||c!==this.alphaStroke;(s||f)&&(this.colorStroke=a,this.alphaStroke=c,this.pointStrokeId=u,t.updateColorStrokes(),Gc(this.vertexOffset,r,e,this.pointCountReserved,t.colorStrokes,o,a,c))},n}(H),zc=function(t,n,i,r){for(var e=n+i,u=1;u<r;++u){for(var s=3*e,h=3*n,o=0;o<i;++o)t[s+0]=t[h+0],t[s+1]=t[h+1],t[s+2]=t[h+2],s+=3,h+=3;e+=i}},Vc=function(t,n,i,r,e){for(var u=n,s=i+r,h=1;h<e;++h){for(var o=3*s,a=3*i,c=0;c<r;++c)t[o+0]=t[a+0]+u,t[o+1]=t[a+1]+u,t[o+2]=t[a+2]+u,o+=3,a+=3;u+=n,s+=r}},Wc=function(t,n,i,r){for(var e=6*n,u=6*(n+i),s=1;s<r;++s)for(var h=e,o=0;o<i;++o)t[u+0]=t[h+0],t[u+1]=t[h+1],t[u+2]=t[h+2],t[u+3]=t[h+3],t[u+4]=t[h+4],t[u+5]=t[h+5],u+=6,h+=6},Xc=function(t,n,i,r){for(var e=n+i,u=1;u<r;++u){for(var s=e<<1,h=n<<1,o=0;o<i;++o)t[s]=t[h],t[s+1]=t[h+1],s+=2,h+=2;e+=i}},Kc=function(t,n,i,r,e,u,s){var h=n.a,o=n.b,a=n.c,c=n.d,f=e-1,l=i+f*r;if(s.isStaticX()&&s.isStaticY())for(var v=s.getX(0),b=s.getY(0);0<=f;--f){for(var d=h*(D=u[O=f<<1]+v)+a*(E=u[O+1]+b),g=o*D+c*E,m=l<<1,w=i<<1,p=0;p<r;++p)t[m]=t[w]+d,t[m+1]=t[w+1]+g,m+=2,w+=2;l-=r}else for(;0<=f;--f){var O,D,E;for(d=h*(D=u[O=f<<1]+s.getX(f))+a*(E=u[O+1]+s.getY(f)),g=o*D+c*E,m=l<<1,w=i<<1,p=0;p<r;++p)t[m]=t[w]+d,t[m+1]=t[w+1]+g,m+=2,w+=2;l-=r}},Yc=function(t){return mn(t)||null==t},Jc=function(t,n,i){return mn(n)?n:ot(n)?n(t):n?n[t%n.length]:i},Zc=function(){function t(t){this.p=t,this.R=0,this.S=null,this.T=null}return Object.defineProperty(t.prototype,"id",{get:function(){return this.R},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this.S},set:function(t){this.set(t,void 0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return this.T},set:function(t){this.set(void 0,t)},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n){var i=!1;void 0!==t&&this.S!==t&&(i=!0,this.S=t),void 0!==n&&this.T!==n&&(i=!0,this.T=n),i&&(this.R+=1,this.p.updateUploaded())},t.prototype.getColor=function(t,n){return Jc(t,this.S,n)},t.prototype.getAlpha=function(t,n){return Jc(t,this.T,n)},t.prototype.isStaticColor=function(){return Yc(this.S)},t.prototype.isStaticAlpha=function(){return Yc(this.T)},t.prototype.toDirty=function(){this.R+=1},t}(),qc=function(){function t(t,n,i){this.p=t,this.R=0,this._x=null,this._y=null,this.ao=n,this.co=i,this.fo=null,this.lo=0,this.vo=-1,this.bo=0}return Object.defineProperty(t.prototype,"id",{get:function(){return this.R},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"x",{get:function(){return this._x},set:function(t){this.set(t,void 0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this._y},set:function(t){this.set(void 0,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"limit",{get:function(){return this.fo},set:function(t){this.fo=t},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n){var i=!1;void 0!==t&&this._x!==t&&(i=!0,this._x=t),void 0!==n&&this._y!==n&&(i=!0,this._y=n),i&&(this.R+=1,this.p.updateUploaded())},t.prototype.getX=function(t){return Jc(t,this._x,this.ao)},t.prototype.getY=function(t){return Jc(t,this._y,this.co)},t.prototype.getLimit=function(){var t=this.fo;return null!=t?t:(this.updateLimitComputed(),this.lo)},t.prototype.updateLimitComputed=function(){var t=this.R,n=this.p.length;this.vo===t&&this.bo===n||(this.vo=t,this.bo=n,this.lo=Math.max(this.calcLimit(this._x,n,this.ao),this.calcLimit(this._y,n,this.co)))},t.prototype.calcLimit=function(t,n,i){if(mn(t))return Math.abs(t);if(ot(t)){if(0<n){for(var r=Math.abs(t(0)),e=1;e<n;++e)r=Math.max(r,Math.abs(t(e)));return r}return 0}if(null!=t){var u=t.length;if(0<u){for(r=t[0],e=1;e<u;++e)r=Math.max(r,Math.abs(t[e]));return r}return 0}return Math.abs(i)},t.prototype.isStaticX=function(){return Yc(this._x)},t.prototype.isStaticY=function(){return Yc(this._y)},t.prototype.toDirty=function(){this.R+=1},t}(),Qc=function(){function t(t){this.p=t,this.R=0,this.S=null,this.T=null}return Object.defineProperty(t.prototype,"id",{get:function(){return this.R},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this.S},set:function(t){this.set(t,void 0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return this.T},set:function(t){this.set(void 0,t)},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n){var i=!1;void 0!==t&&this.S!==t&&(i=!0,this.S=t),void 0!==n&&this.T!==n&&(i=!0,this.T=n),i&&(this.R+=1,this.p.updateUploaded())},t.prototype.getColor=function(t,n){return Jc(t,this.S,n)},t.prototype.getAlpha=function(t,n){return Jc(t,this.T,n)},t.prototype.isStaticColor=function(){return Yc(this.S)},t.prototype.isStaticAlpha=function(){return Yc(this.T)},t.prototype.toDirty=function(){this.R+=1},t}(),$c=function(){function n(t){this.p=t,this.L=[],this.do=0,this.k=[],this.j=new qc(this,Y.SIZE_X,Y.SIZE_Y),this.rn=new qc(this,0,0),this.C=new Zc(t),this.mo=new Qc(t),this.R=0}return Object.defineProperty(n.prototype,"length",{get:function(){return this.L.length>>1},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"id",{get:function(){return this.R},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"values",{get:function(){return this.L},set:function(t){this.set(t,void 0,void 0)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"segments",{get:function(){return this.k},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"style",{get:function(){return F.NONE},set:function(t){this.set(void 0,void 0,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"marker",{get:function(){var t=this.A;return null==t&&(t=Q.getInstance(),this.A=t),t},enumerable:!1,configurable:!0}),n.prototype.getMarker=function(){},Object.defineProperty(n.prototype,"size",{get:function(){return this.j},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"offset",{get:function(){return this.rn},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"fill",{get:function(){return this.C},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"stroke",{get:function(){return this.mo},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"formatter",{get:function(){return null},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"formatted",{get:function(){return this},enumerable:!1,configurable:!0}),n.prototype.copy=function(t){return this.set(t.values,t.segments,t.style)},n.prototype.set=function(t,n,i){var r=!1,e=!1;if(null!=t){var u=this.L,s=this.do,h=t.length;if(u!==t){for(var o=Math.min(s,h),a=0;a<o;++a)u[a]=t[a];for(a=o;a<h;++a)u.push(t[a]);s!==h?(u.length=h,this.do=h,r=!0):e=!0}else s!==h?(this.do=h,r=!0):e=!0}if(r){this.R+=1;var c=this.p,f=c.uploaded;f?f.isCompatible(c)?c.updateUploaded():(c.uploaded=void 0,c.toDirty()):c.updateUploaded()}else e&&(this.R+=1,this.p.updateUploaded());return this},n.prototype.updateUploaded=function(){this.p.updateUploaded()},n.prototype.clone=function(t){return new n(t).copy(this)},n.prototype.toPoints=function(n){for(var i=[],r=this.values,e=0,u=r.length;e<u;e+=2){var s=new t.Point(r[e+0],r[e+1]);i.push(n.apply(s,s))}return i},n.prototype.serialize=function(t){return t.addResource("[]")},n.prototype.calcHitPointAbs=function(t,i,r,e,u,s,h,o,a){var c=this.formatted,f=c.length,l=c.values,v=this.j,b=this.rn,d=0,g=f;if(h){var m=.5*v.getLimit(),w=b.getLimit(),p=n.WORK_RANGE;h(t,i,m,m,w,w,s,l,p),d=p[0],g=p[1]}for(var O=d,D=Math.min(g,f);O<D;++O){var E=O<<1,M=l[E],S=l[E+1];if(o(t,i,.5*v.getX(O),.5*v.getY(O),b.getX(O),b.getY(O),M,S,r,e,u,O,s,a))return!0}return!1},n.WORK_RANGE=[0,0],n}(),tf=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.init=function(t){t.updateClippings(),t.updateIndices();var n=t.clippings,i=t.indices,r=this.vertexOffset,e=this.indexOffset,u=this.pointCountReserved;0<u&&(_o(n,r),zc(n,r,9,u),Po(i,r,e),Vc(i,9,e,8,u))},n.prototype.update=function(t,n){var i=n.points;i instanceof $c&&(this.updateVertexAndStep(t,n,i),this.updateLineOfAnyColorFill(t,n,i,9),this.updateLineOfAnyColorStroke(t,n,i,9),this.updateUv(t,n))},n.prototype.updateVertexAndStep=function(t,n,i){var r=i.id,e=i.offset,u=e.id,s=r!==this.pointId||u!==this.pointOffsetId,h=i.size,o=h.id,a=o!==this.pointSizeId,c=n.size,f=c.x,l=c.y,v=f!==this.sizeX||l!==this.sizeY,b=z(n),d=this.transformLocalId!==b,g=n.stroke,m=g.align,w=g.enable?g.width:0,p=g.style,O=this.strokeAlign!==m||this.strokeWidth!==w||this.strokeStyle!==p;if(s||a||v||d||O){this.pointId=r;var D=i.formatted;this.pointCount=D.length,this.pointOffsetId=u,this.pointSizeId=o,this.sizeX=f,this.sizeY=l,this.transformLocalId=b,this.strokeWidth=w,this.strokeAlign=m,this.strokeStyle=p,t.updateVertices(),t.updateSteps();var E=this.pointCount,M=D.values,S=this.vertexOffset,T=t.vertices,j=t.steps,N=t.clippings,I=n.transform.internalTransform;if(0<E&&h.isStaticX()&&h.isStaticY()){var C=h.getX(0),A=h.getY(0);Uo(T,S,0,0,C,A,m,w,I,xo),Kc(T,I,S,9,E,M,e),Fo(j,N,S,w,p,xo),Wc(j,S,9,E)}else for(var R=0;R<E;++R){var L=R<<1,y=M[L]+e.getX(R),k=M[L+1]+e.getY(R),x=(C=h.getX(R),A=h.getY(R),S+9*R);Uo(T,x,y,k,C,A,m,w,I,xo),Fo(j,N,x,w,p,xo)}var B=S+9*E,_=9*(this.pointCountReserved-E);_c(T,B,_),Pc(j,B,_)}},n.prototype.updateUv=function(t,n){var i=V(n),r=W(i);if(i!==this.texture||r!==this.textureTransformId){this.texture=i,this.textureTransformId=r,t.updateUvs();var e=t.uvs,u=this.vertexOffset,s=X(i),h=this.pointCountReserved;0<h&&(Go(e,u,s),Xc(e,u,9,h))}},n}(Hc),nf=function(t,n,i,r,e,s,h,o){var a=M(n),c=4*a,f=2*a,l=n.points,v=Fc(Yo(l)),b=v*r,d=v*s,g=b+c,m=d+f;return t.check(i,e,g,m)?new u(t,i,e,g,m,[new o(i,e,b,d,v),new Jt(i+b,e+d,c,f)]).init(n):null},rf=function(t,n,i,r,e){return nf(t,n,i,9,r,8,0,tf)},ef=function(t){function n(n){void 0===n&&(n=r.LINE_OF_CIRCLES);var i=t.call(this,n)||this;return i.gt=new $c(i),i.wo=function(t,n,r,e,u,s,h,o,a,c,f){return i.containsPointAbs(t,n,r,e,u,s,h,o,a,c,f)},i}return B(n,t),Object.defineProperty(n.prototype,"points",{get:function(){return this.gt},enumerable:!1,configurable:!0}),n.prototype.clone=function(){return new n(this.type).copy(this)},n.prototype.containsAbs=function(t,n,i,r,e,u,s){var h=Wt(e,u,this.gt.size.getLimit());return!!this.containsAbsBBox(t,n,i+h,r+h)&&this.gt.calcHitPointAbs(t,n,e,u,s,h,null,this.wo,null)},n.prototype.containsPointAbs=function(n,i,r,e,u,s,h,o,a,c,f){return t.prototype.containsAbs.call(this,n-h-u,i-o-s,r,e,a,c,f)},n.prototype.calcHitPoint=function(t,n,i,r,e,u){var s=this.toHitTestData(t,n),h=(i||Wt)(s.strokeWidth,s.strokeScale,this.gt.size.getLimit());return!!this.containsAbsBBox(s.x,s.y,s.width+h,s.height+h)&&this.gt.calcHitPointAbs(s.x,s.y,s.strokeWidth,s.strokeScale,s.strokeAlign,h,r,e||this.wo,u)},n}(Vo),uf=function(t,n,i){return co(t,n,i||new ef)},sf=function(){e[r.LINE_OF_CIRCLES]=rf,n[r.LINE_OF_CIRCLES]=uf},hf=function(t){function n(n,i,r,e,u){var s=t.call(this,n,i,r,e,u)||this;return s.radius=NaN,s.corner=NaN,s}return B(n,t),n.prototype.init=function(t){t.updateIndices();var n=t.indices,i=this.vertexOffset,r=this.indexOffset,e=this.pointCountReserved;0<e&&(wo(n,i,r),Vc(n,bo,r,24,e))},n.prototype.update=function(t,n){var i=n.points;i instanceof $c&&(this.updateVertexClippingStepAndUv(t,n,i),this.updateLineOfAnyColorFill(t,n,i,bo),this.updateLineOfAnyColorStroke(t,n,i,bo))},n.prototype.updateVertexClippingStepAndUv=function(t,n,i){var r=i.id,e=i.offset,u=e.id,s=r!==this.pointId||u!==this.pointOffsetId,h=i.size,o=h.id,a=o!==this.pointSizeId,c=n.size,f=c.x,l=c.y,v=n.radius,b=f!==this.sizeX||l!==this.sizeY||v!==this.radius,d=z(n),g=this.transformLocalId!==d,m=n.stroke,w=m.align,p=m.enable?m.width:0,O=m.side,D=m.style,E=this.strokeAlign!==w||this.strokeWidth!==p||this.strokeSide!==O||this.strokeStyle!==D,M=n.corner,S=M!==this.corner,T=V(n),j=W(T),N=T!==this.texture||j!==this.textureTransformId,I=s||a||b||E;if(I||g||S||N){this.pointId=r;var C=i.formatted;this.pointCount=C.length,this.pointOffsetId=u,this.pointSizeId=o,this.sizeX=f,this.sizeY=l,this.radius=v,this.transformLocalId=d,this.strokeAlign=w,this.strokeWidth=p,this.strokeSide=O,this.strokeStyle=D,this.corner=M,this.texture=T,this.textureTransformId=j,t.updateVertices(),(I||g)&&t.updateSteps(),(I||S)&&t.updateClippings(),(I||N)&&t.updateUvs();var A=this.pointCount,R=C.values,L=this.vertexOffset,y=t.vertices,k=t.clippings,x=t.steps,B=t.uvs,_=n.transform.internalTransform,P=X(T);if(0<A&&h.isStaticX()&&h.isStaticY()){var U=h.getX(0),F=h.getY(0);po(y,L,0,0,U,F,w,p,v,_,go),Kc(y,_,L,bo,A,R,e),(I||g)&&(Do(x,L,p,O,D,M,go),Wc(x,L,bo,A)),(I||S)&&(Oo(k,L,M,go),zc(k,L,bo,A)),(I||N)&&(Eo(B,L,P,go),Xc(B,L,bo,A))}else for(var G=0;G<A;++G){var H=G<<1,K=R[H]+e.getX(G),Y=R[H+1]+e.getY(G),J=(U=h.getX(G),F=h.getY(G),L+G*bo);po(y,J,K,Y,U,F,w,p,v,_,go),(I||g)&&Do(x,J,p,O,D,M,go),(I||S)&&Oo(k,J,M,go),(I||N)&&Eo(B,J,P,go)}var Z=this.pointCountReserved,q=L+A*bo,Q=bo*(Z-A);_c(y,q,Q),Pc(x,q,Q),Bc(k,q,Q),Uc(B,q,Q)}},n}(Hc),of=function(t,n,i,r,e){return nf(t,n,i,bo,r,24,0,hf)},af=function(t){function n(n){void 0===n&&(n=r.LINE_OF_RECTANGLE_ROUNDEDS);var i=t.call(this,n)||this;return i.gt=new $c(i),i.wo=function(t,n,r,e,u,s,h,o,a,c,f){return i.containsPointAbs(t,n,r,e,u,s,h,o,a,c,f)},i}return B(n,t),Object.defineProperty(n.prototype,"points",{get:function(){return this.gt},enumerable:!1,configurable:!0}),n.prototype.clone=function(){return new n(this.type).copy(this)},n.prototype.containsAbs=function(t,n,i,r,e,u,s){var h=Wt(e,u,this.gt.size.getLimit());return!!this.containsAbsBBox(t,n,i+h,r+h)&&this.gt.calcHitPointAbs(t,n,h,e,u,s,null,this.wo,null)},n.prototype.containsPointAbs=function(n,i,r,e,u,s,h,o,a,c,f){return t.prototype.containsAbs.call(this,n-h-u,i-o-s,r,e,a,c,f)},n.prototype.calcHitPoint=function(t,n,i,r,e,u){var s=this.toHitTestData(t,n),h=(i||Wt)(s.strokeWidth,s.strokeScale,this.gt.size.getLimit());return!!this.containsAbsBBox(s.x,s.y,s.width+h,s.height+h)&&this.gt.calcHitPointAbs(s.x,s.y,s.strokeWidth,s.strokeScale,s.strokeAlign,h,r,e||this.wo,u)},n}(Io),cf=function(t,n,i){return co(t,n,i||new af)},ff=function(){e[r.LINE_OF_RECTANGLE_ROUNDEDS]=of,n[r.LINE_OF_RECTANGLE_ROUNDEDS]=cf,mr.set(r.LINE_OF_RECTANGLE_ROUNDEDS,wt.PRIMITIVE|wt.STROKE_SIDE|wt.BORDER_RADIUS)},lf=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.init=function(t){t.updateIndices();var n=t.indices,i=this.vertexOffset,r=this.indexOffset,e=this.pointCountReserved;0<e&&(Ia(n,i,r),Vc(n,Ma,r,Sa,e))},n.prototype.update=function(t,n){var i=n.points;i instanceof $c&&(this.updateVertexClippingStepAndUv(t,n,i),this.updateLineOfAnyColorFill(t,n,i,Ma),this.updateLineOfAnyColorStroke(t,n,i,Ma))},n.prototype.updateVertexClippingStepAndUv=function(t,n,i){var r=i.id,e=i.offset,u=e.id,s=r!==this.pointId||u!==this.pointOffsetId,h=i.size,o=h.id,a=o!==this.pointSizeId,c=n.size,f=c.x,l=c.y,v=f!==this.sizeX||l!==this.sizeY,b=z(n),d=this.transformLocalId!==b,g=n.stroke,m=g.align,w=g.enable?g.width:0,p=g.side,O=g.style,D=this.strokeAlign!==m||this.strokeWidth!==w||this.strokeSide!==p||this.strokeStyle!==O,E=V(n),M=W(E),S=E!==this.texture||M!==this.textureTransformId,T=s||a||v||D;if(T||d||S){this.pointId=r;var j=i.formatted;this.pointCount=j.length,this.pointOffsetId=u,this.pointSizeId=o,this.transformLocalId=b,this.strokeWidth=w,this.strokeAlign=m,this.strokeSide=p,this.strokeStyle=O,this.texture=E,this.textureTransformId=M,t.updateVertices(),(T||d)&&t.updateSteps(),T&&t.updateClippings(),(T||S)&&t.updateUvs();var N=this.pointCount,I=j.values,C=this.vertexOffset,A=t.vertices,R=t.clippings,L=t.steps,y=t.uvs,k=n.transform.internalTransform,x=X(E);if(0<N&&h.isStaticX()&&h.isStaticY()){var B=h.getX(0),_=h.getY(0);Ca(A,C,0,0,B,_,m,w,k,Ta),Kc(A,k,C,Ma,N,I,e),(T||d)&&(Aa(C,L,w,p,O,Ta),Wc(L,C,Ma,N)),T&&(Na(R,C,Ta),zc(R,C,Ma,N)),(T||S)&&(La(y,C,x,Ta),Xc(y,C,Ma,N))}else for(var P=0;P<N;++P){var U=P<<1,F=I[U]+e.getX(P),G=I[U+1]+e.getY(P),H=(B=h.getX(P),_=h.getY(P),C+P*Ma);Ca(A,H,F,G,B,_,m,w,k,Ta),(T||d)&&Aa(H,L,w,p,O,Ta),T&&Na(R,H,Ta),(T||S)&&La(y,H,x,Ta)}var K=this.pointCountReserved,Y=C+N*Ma,J=Ma*(K-N);_c(A,Y,J),Pc(L,Y,J),Bc(R,Y,J),Uc(y,Y,J)}},n}(Hc),vf=function(t,n,i,r,e){return nf(t,n,i,Ma,r,Sa,0,lf)},bf=function(t){function n(n){void 0===n&&(n=r.LINE_OF_RECTANGLES);var i=t.call(this,n)||this;return i.gt=new $c(i),i.wo=function(t,n,r,e,u,s,h,o,a,c,f){return i.containsPointAbs(t,n,r,e,u,s,h,o,a,c,f)},i}return B(n,t),Object.defineProperty(n.prototype,"points",{get:function(){return this.gt},enumerable:!1,configurable:!0}),n.prototype.clone=function(){return new n(this.type).copy(this)},n.prototype.containsAbs=function(t,n,i,r,e,u,s){var h=Wt(e,u,this.gt.size.getLimit());return!!this.containsAbsBBox(t,n,i+h,r+h)&&this.gt.calcHitPointAbs(t,n,e,u,s,h,null,this.wo,null)},n.prototype.containsPointAbs=function(n,i,r,e,u,s,h,o,a,c,f){return t.prototype.containsAbs.call(this,n-h-u,i-o-s,r,e,a,c,f)},n.prototype.calcHitPoint=function(t,n,i,r,e,u){var s=this.toHitTestData(t,n),h=(i||Wt)(s.strokeWidth,s.strokeScale,this.gt.size.getLimit());return!!this.containsAbsBBox(s.x,s.y,s.width+h,s.height+h)&&this.gt.calcHitPointAbs(s.x,s.y,s.strokeWidth,s.strokeScale,s.strokeAlign,h,r,e||this.wo,u)},n}(qe),df=function(t,n,i){return co(t,n,i||new bf)},gf=function(){e[r.LINE_OF_RECTANGLES]=vf,n[r.LINE_OF_RECTANGLES]=df,mr.set(r.LINE_OF_RECTANGLES,wt.PRIMITIVE|wt.STROKE_SIDE)},mf=22,wf=[0,0,0,0,0],pf=new t.Point,Of=function(t,n,i){var r=3*i-1;t[++r]=n+0,t[++r]=n+1,t[++r]=n+3,t[++r]=n+1,t[++r]=n+2,t[++r]=n+3,t[++r]=n+4,t[++r]=n+5,t[++r]=n+7,t[++r]=n+5,t[++r]=n+6,t[++r]=n+7,t[++r]=n+8,t[++r]=n+9,t[++r]=n+11,t[++r]=n+9,t[++r]=n+10,t[++r]=n+11,t[++r]=n+12,t[++r]=n+13,t[++r]=n+16,t[++r]=n+13,t[++r]=n+14,t[++r]=n+16,t[++r]=n+14,t[++r]=n+15,t[++r]=n+16,t[++r]=n+12,t[++r]=n+16,t[++r]=n+19,t[++r]=n+16,t[++r]=n+17,t[++r]=n+19,t[++r]=n+17,t[++r]=n+18,t[++r]=n+19,t[++r]=n+12,t[++r]=n+19,t[++r]=n+13,t[++r]=n+19,t[++r]=n+20,t[++r]=n+13,t[++r]=n+20,t[++r]=n+21,t[++r]=n+13},Df=function(t,n,i,r,e,u,s,h,o,a,c){var f=s*h,l=.5*e+(0<=e?+f:-f),v=.5*u+(0<=u?+f:-f),b=Math.sqrt(l*l+4*v*v),d=2*l*v/(l+b),g=d*o/(2*v),m=.5*(b-d)*o/b,w=g*b/(2*l),p=pf;p.set(i,r-v),a.apply(p,p);var D=p.x,E=p.y;p.set(i,r),a.apply(p,p);var M=p.x,S=p.y;p.set(i+l,r),a.apply(p,p);var T=M-D,j=S-E,N=p.x+T,I=p.y+j,C=M+(M-p.x)+T,A=S+(S-p.y)+j,R=N-D,L=I-E,y=D+m*R,k=E+m*L,x=N-g*R,B=I-g*L,_=w*(C-N),P=w*(A-I),U=N+_,F=I+P,G=C-_,H=A-P,z=D-C,V=E-A,W=C+g*z,X=A+g*V,K=D-m*z,Y=E-m*V;p.set(i,r+v-d),a.apply(p,p);var J=p.x,Z=p.y,q=D+o*(J-D),Q=E+o*(Z-E),$=N+o*(J-N),tt=I+o*(Z-I),nt=C+o*(J-C),it=A+o*(Z-A),rt=M+T,et=S+j;c[0]=O(rt,et,J,Z),c[1]=w,c[2]=g,c[3]=m,c[4]=1-.5*d/v;var ut=2*n-1;t[++ut]=q,t[++ut]=Q,t[++ut]=K,t[++ut]=Y,t[++ut]=D,t[++ut]=E,t[++ut]=y,t[++ut]=k,t[++ut]=$,t[++ut]=tt,t[++ut]=x,t[++ut]=B,t[++ut]=N,t[++ut]=I,t[++ut]=U,t[++ut]=F,t[++ut]=nt,t[++ut]=it,t[++ut]=G,t[++ut]=H,t[++ut]=C,t[++ut]=A,t[++ut]=W,t[++ut]=X,t[++ut]=J,t[++ut]=Z,t[++ut]=q,t[++ut]=Q,t[++ut]=y,t[++ut]=k,t[++ut]=x,t[++ut]=B,t[++ut]=$,t[++ut]=tt,t[++ut]=U,t[++ut]=F,t[++ut]=G,t[++ut]=H,t[++ut]=nt,t[++ut]=it,t[++ut]=W,t[++ut]=X,t[++ut]=K,t[++ut]=Y},Ef=function(t,n,i,r){var e=3*n-1,u=1-r;i&it.TOP?(t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1):(t[++e]=u,t[++e]=u,t[++e]=0,t[++e]=1,t[++e]=u,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=u,t[++e]=1,t[++e]=0),i&it.BOTTOM_RIGHT?(t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1):(t[++e]=u,t[++e]=u,t[++e]=0,t[++e]=1,t[++e]=u,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=u,t[++e]=1,t[++e]=0),i&it.BOTTOM_LEFT?(t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1):(t[++e]=u,t[++e]=u,t[++e]=0,t[++e]=1,t[++e]=u,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=u,t[++e]=1,t[++e]=0),t[++e]=0,t[++e]=0,t[++e]=0,t[++e]=u,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=u,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=u,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=0},Mf=function(t,n,i,r,e,u,s){for(var h=o(e),a=s[0],c=u*a,f=3*i,l=6*i-1,v=0;v<mf;v+=1,f+=3)t[++l]=r,t[++l]=h,.5<n[f+2]?(t[++l]=c,t[++l]=c,t[++l]=1+n[f],t[++l]=1+n[f+1]):(t[++l]=a,t[++l]=a,t[++l]=1+n[f],t[++l]=1+n[f+1])},Sf=function(t,n,i,r,e){var u=i.x0,s=i.x1,h=i.x2,o=i.x3,a=i.y0,c=i.y1,f=i.y2,l=i.y3,v=.5*(u+s),b=.5*(a+c),d=e[4],g=v+d*(o-u),m=b+d*(l-a),w=e[1],p=e[2],O=e[3],D=v+O*(o-v),E=b+O*(l-b),M=v+r*(g-v),S=b+r*(m-b),T=v+O*(h-v),j=b+O*(f-b),N=h+p*(v-h),I=f+p*(b-f),C=h+r*(g-h),A=f+r*(m-f),R=h+w*(o-h),L=f+w*(l-f),y=o+w*(h-o),k=l+w*(f-l),x=o+r*(g-o),B=l+r*(m-l),_=o+p*(v-o),P=l+p*(b-l),U=2*n-1;t[++U]=M,t[++U]=S,t[++U]=D,t[++U]=E,t[++U]=v,t[++U]=b,t[++U]=T,t[++U]=j,t[++U]=C,t[++U]=A,t[++U]=N,t[++U]=I,t[++U]=h,t[++U]=f,t[++U]=R,t[++U]=L,t[++U]=x,t[++U]=B,t[++U]=y,t[++U]=k,t[++U]=o,t[++U]=l,t[++U]=_,t[++U]=P,t[++U]=g,t[++U]=m,t[++U]=M,t[++U]=S,t[++U]=T,t[++U]=j,t[++U]=N,t[++U]=I,t[++U]=C,t[++U]=A,t[++U]=R,t[++U]=L,t[++U]=y,t[++U]=k,t[++U]=x,t[++U]=B,t[++U]=_,t[++U]=P,t[++U]=D,t[++U]=E},Tf=function(t){function n(n,i,r,e,u){var s=t.call(this,n,i,r,e,u)||this;return s.radius=NaN,s.corner=NaN,s}return B(n,t),n.prototype.init=function(t){t.updateIndices();var n=this.vertexOffset,i=this.indexOffset,r=this.pointCountReserved;0<r&&(Of(t.indices,n,i),Vc(t.indices,mf,i,15,r))},n.prototype.update=function(t,n){var i=n.points;i instanceof $c&&(this.updateVertexClippingStepAndUv(t,n,i),this.updateLineOfAnyColorFill(t,n,i,mf),this.updateLineOfAnyColorStroke(t,n,i,mf))},n.prototype.updateVertexClippingStepAndUv=function(t,n,i){var r=i.id,e=i.offset,u=e.id,s=r!==this.pointId||u!==this.pointOffsetId,h=i.size,o=h.id,a=o!==this.pointSizeId,c=n.size,f=c.x,l=c.y,v=f!==this.sizeX||l!==this.sizeY,b=n.radius,d=b!==this.radius,g=z(n),m=this.transformLocalId!==g,w=n.stroke,p=w.align,O=w.enable?w.width:0,D=w.style,E=this.strokeAlign!==p||this.strokeWidth!==O||this.strokeStyle!==D,M=n.corner,S=this.corner!==M,T=V(n),j=W(T),N=T!==this.texture||j!==this.textureTransformId,I=s||a||v||d||E;if(I||m||S||N){this.pointId=r;var C=i.formatted;this.pointCount=C.length,this.pointOffsetId=u,this.pointSizeId=o,this.sizeX=f,this.sizeY=l,this.radius=b,this.transformLocalId=g,this.strokeAlign=p,this.strokeWidth=O,this.strokeStyle=D,this.corner=M,this.texture=T,this.textureTransformId=j,t.updateVertices(),(I||S)&&t.updateClippings(),(I||m||S)&&t.updateSteps(),(I||N)&&t.updateUvs();var A=this.pointCount,R=C.values,L=this.vertexOffset,y=t.vertices,k=t.clippings,x=t.steps,B=t.uvs,_=n.transform.internalTransform,P=X(T);if(0<A&&h.isStaticX()&&h.isStaticY()){var U=h.getX(0),F=h.getY(0);Df(y,L,0,0,U,F,p,O,b,_,wf),Kc(y,_,L,mf,A,R,e),(I||S)&&(Ef(k,L,M,b),zc(k,L,mf,A)),(I||m||S)&&(Mf(x,k,L,O,D,b,wf),Wc(x,L,mf,A)),(I||N)&&(Sf(B,L,P,b,wf),Xc(B,L,mf,A))}else for(var G=0;G<A;++G){var H=G<<1,K=R[H]+e.getX(G),Y=R[H+1]+e.getY(G),J=(U=h.getX(G),F=h.getY(G),L+G*mf);Df(y,J,K,Y,U,F,p,O,b,_,wf),(I||S)&&Ef(k,J,M,b),(I||m||S)&&Mf(x,k,J,O,D,b,wf),(I||N)&&Sf(B,J,P,b,wf)}var Z=this.pointCountReserved,q=L+A*mf,Q=mf*(Z-A);_c(y,q,Q),Pc(x,q,Q),Bc(k,q,Q),Uc(B,q,Q)}},n}(Hc),jf=function(t,n,i,r,e){return nf(t,n,i,mf,r,15,0,Tf)},Nf=function(t,n,i,r,e,u,s,h,o,a,c,f,l,v,b,d,g){var m=u+f*(h-u)-r,w=s+f*(o-s)-e,p=Math.sqrt(m*m+w*w),O=1e-5;if(O<p){var D=1/p,E=m*D,M=w*D,S=(u+l*(a-u)-r)*D,T=(s+l*(c-s)-e)*D,j=E*T-S*M;if(O<Math.abs(j)){var N=1/j,I=n-r,C=i-e;if(function(t,n,i,r,e,u,s){if(t.fill.enable){if(n*n+i*i<=r*r)return!0}else if(0<u){var h=n*n+i*i;if(h<=r*r){var o=Math.max(0,r*(1-u*s/e));if(o*o<=h)return!0}}return!1}(t,(+T*I-S*C)*N,(-M*I+E*C)*N,p,v*b,d,g))return!0}}return!1},If=function(t,n,i,r,e,u,s){var h=2*e/r;if(zt(n,i,h,-e,+e)){var o=Math.sqrt(r*r+4*e*e),a=2*r*e/(r+o),c=t.radius,f=e-a,l=-e,v=+r,b=+e,d=-v,g=+b,m=0+0*c,w=l+c*(f-l),p=v+c*(0-v),O=b+c*(f-b),D=+O,E=-p,M=-h*n+w-i<=0,S=+h*n+w-i<=0,T=i<=O,j=t.corner;if(!M&&!S&&j&it.TOP){var N=.5*(o-a)*c/o;if(Nf(t,n,i,m,w,0,l,d,g,v,b,N,N,a,c,u,s))return!0}else if(!M&&!T&&j&it.BOTTOM_LEFT){if(Nf(t,n,i,E,D,d,g,v,b,0,l,(I=a*c/(2*e))*o/(2*r),I,a,c,u,s))return!0}else if(!S&&!T&&j&it.BOTTOM_RIGHT){var I;if(Nf(t,n,i,p,O,v,b,0,l,d,g,I=a*c/(2*e),I*o/(2*r),a,c,u,s))return!0}else{if(t.fill.enable)return!0;if(0<u){var C=u*s,A=e-a,R=A+(-e-A)*Math.max(0,a-C)/a;if(!zt(n,i,h,R,e-C))return!0}}}return!1},Cf=function(t){function n(n){return void 0===n&&(n=r.TRIANGLE_ROUNDED),t.call(this,n)||this}return B(n,t),n.prototype.clone=function(){return new n(this.type).copy(this)},n.prototype.containsAbs=function(n,i,r,e,u,s,h){return!!t.prototype.containsAbsBBox.call(this,n,i,r,e)&&If(this,n,i,r,e,u,s)},n}(Ut),Af=function(t){function n(n){void 0===n&&(n=r.LINE_OF_TRIANGLE_ROUNDEDS);var i=t.call(this,n)||this;return i.gt=new $c(i),i.wo=function(t,n,r,e,u,s,h,o,a,c,f){return i.containsPointAbs(t,n,r,e,u,s,h,o,a,c,f)},i}return B(n,t),Object.defineProperty(n.prototype,"points",{get:function(){return this.gt},enumerable:!1,configurable:!0}),n.prototype.clone=function(){return new n(this.type).copy(this)},n.prototype.containsAbs=function(t,n,i,r,e,u,s){var h=Wt(e,u,this.gt.size.getLimit());return!!this.containsAbsBBox(t,n,i+h,r+h)&&this.gt.calcHitPointAbs(t,n,e,u,s,h,null,this.wo,null)},n.prototype.containsPointAbs=function(n,i,r,e,u,s,h,o,a,c,f){return t.prototype.containsAbs.call(this,n-h-u,i-o-s,r,e,a,c,f)},n.prototype.calcHitPoint=function(t,n,i,r,e,u){var s=this.toHitTestData(t,n),h=(i||Wt)(s.strokeWidth,s.strokeScale,this.gt.size.getLimit());return!!this.containsAbsBBox(s.x,s.y,s.width+h,s.height+h)&&this.gt.calcHitPointAbs(s.x,s.y,s.strokeWidth,s.strokeScale,s.strokeAlign,h,r,e||this.wo,u)},n}(Cf),Rf=function(t,n,i){return co(t,n,i||new Af)},Lf=function(){e[r.LINE_OF_TRIANGLE_ROUNDEDS]=jf,n[r.LINE_OF_TRIANGLE_ROUNDEDS]=Rf,mr.set(r.LINE_OF_TRIANGLE_ROUNDEDS,wt.PRIMITIVE|wt.STROKE_SIDE|wt.BORDER_RADIUS)},yf=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.init=function(t){t.updateClippings(),t.updateIndices();var n=t.clippings,i=t.indices,r=this.vertexOffset,e=this.indexOffset,u=this.pointCountReserved;0<u&&(ca(n,r),zc(n,r,7,u),fa(i,r,e),Vc(i,7,e,3,u))},n.prototype.update=function(t,n){var i=n.points;i instanceof $c&&(this.updateVertexStepAndUvs(t,n,i),this.updateLineOfAnyColorFill(t,n,i,7),this.updateLineOfAnyColorStroke(t,n,i,7))},n.prototype.updateVertexStepAndUvs=function(t,n,i){var r=i.id,e=i.offset,u=e.id,s=r!==this.pointId||u!==this.pointOffsetId,h=i.size,o=h.id,a=o!==this.pointSizeId,c=n.size,f=c.x,l=c.y,v=f!==this.sizeX||l!==this.sizeY,b=z(n),d=this.transformLocalId!==b,g=n.stroke,m=g.align,w=g.enable?g.width:0,p=g.style,O=this.strokeAlign!==m||this.strokeWidth!==w||this.strokeStyle!==p,D=V(n),E=W(D),M=D!==this.texture||E!==this.textureTransformId,S=s||a||v||O;if(S||d||M){this.pointId=r;var T=i.formatted;this.pointCount=T.length,this.pointOffsetId=u,this.pointSizeId=o,this.sizeX=f,this.sizeY=l,this.transformLocalId=b,this.strokeAlign=m,this.strokeWidth=w,this.strokeStyle=p,t.updateVertices(),(S||d)&&t.updateSteps(),(S||M)&&t.updateUvs();var j=this.pointCount,N=T.values,I=this.vertexOffset,C=t.vertices,A=t.steps,R=t.clippings,L=t.uvs,y=X(D),k=n.transform.internalTransform;if(0<j&&h.isStaticX()&&h.isStaticY()){var x=h.getX(0),B=h.getY(0);la(C,I,0,0,x,B,m,w,k,oa),Kc(C,k,I,7,j,N,e),(S||d)&&(va(A,R,I,7,w,p,oa),Wc(A,I,7,j)),(S||M)&&(ba(L,y,I,oa),Xc(L,I,7,j))}else for(var _=0;_<j;++_){var P=_<<1,U=N[P]+e.getX(_),F=N[P+1]+e.getY(_),G=(x=h.getX(_),B=h.getY(_),I+7*_);la(C,G,U,F,x,B,m,w,k,oa),(S||d)&&va(A,R,G,7,w,p,oa),(S||M)&&ba(L,y,G,oa)}var H=I+7*j,K=7*(this.pointCountReserved-j);_c(C,H,K),Pc(A,H,K),Uc(L,H,K)}},n}(Hc),kf=function(t,n,i,r,e){return nf(t,n,i,7,r,3,0,yf)},xf=function(t){function n(n){return void 0===n&&(n=r.TRIANGLE),t.call(this,n)||this}return B(n,t),n.prototype.clone=function(){return new n(this.type).copy(this)},n.prototype.containsAbs=function(n,i,r,e,u,s,h){return!!t.prototype.containsAbsBBox.call(this,n,i,r,e)&&Vt(this,n,i,r,e,u,s)},n}(Ut),Bf=function(t){function n(n){void 0===n&&(n=r.LINE_OF_TRIANGLES);var i=t.call(this,n)||this;return i.gt=new $c(i),i.wo=function(t,n,r,e,u,s,h,o,a,c,f){return i.containsPointAbs(t,n,r,e,u,s,h,o,a,c,f)},i}return B(n,t),Object.defineProperty(n.prototype,"points",{get:function(){return this.gt},enumerable:!1,configurable:!0}),n.prototype.clone=function(){return new n(this.type).copy(this)},n.prototype.containsAbs=function(t,n,i,r,e,u,s){var h=Wt(e,u,this.gt.size.getLimit());return!!this.containsAbsBBox(t,n,i+h,r+h)&&this.gt.calcHitPointAbs(t,n,e,u,s,h,null,this.wo,null)},n.prototype.containsPointAbs=function(n,i,r,e,u,s,h,o,a,c,f){return t.prototype.containsAbs.call(this,n-h-u,i-o-s,r,e,a,c,f)},n.prototype.calcHitPoint=function(t,n,i,r,e,u){var s=this.toHitTestData(t,n),h=(i||Wt)(s.strokeWidth,s.strokeScale,this.gt.size.getLimit());return!!this.containsAbsBBox(s.x,s.y,s.width+h,s.height+h)&&this.gt.calcHitPointAbs(s.x,s.y,s.strokeWidth,s.strokeScale,s.strokeAlign,h,r,e||this.wo,u)},n}(xf),_f=function(t,n,i){return co(t,n,i||new Bf)},Pf=function(){e[r.LINE_OF_TRIANGLES]=kf,n[r.LINE_OF_TRIANGLES]=_f},Uf=function(t,n,i,r){return new u(t,i,r,0,0,[new Ea(i,r)]).init(n)},Ff=function(t){function n(n){return void 0===n&&(n=r.NULL),t.call(this,n)||this}return B(n,t),n.prototype.clone=function(){return new n(this.type).copy(this)},n}(Ut),Gf=function(t,n,i){return co(t,n,i||new Ff)},Hf=function(){e[r.NULL]=Uf,n[r.NULL]=Gf},zf=function(t,n,i){return co(t,n,i||new qe)},Vf=function(){e[r.RECTANGLE]=vc,n[r.RECTANGLE]=zf,mr.set(r.RECTANGLE,wt.PRIMITIVE|wt.STROKE_SIDE)},Wf=function(t,n,i){return co(t,n,i||new Qe)},Xf=function(t,n,i){return co(t,n,i||new Io)},Kf=function(){e[r.RECTANGLE_ROUNDED]=So,n[r.RECTANGLE_ROUNDED]=Xf,mr.set(r.RECTANGLE_ROUNDED,wt.PRIMITIVE|wt.STROKE_SIDE|wt.BORDER_RADIUS)},Yf=[0,0],Jf=new t.Point,Zf=function(t,n){var i=3*n-1;t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=0,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=0,t[++i]=1,t[++i]=0,t[++i]=0,t[++i]=1,t[++i]=1,t[++i]=0,t[++i]=1},qf=function(t,n,i){var r=3*i-1;t[++r]=n,t[++r]=n+1,t[++r]=n+3,t[++r]=n+1,t[++r]=n+4,t[++r]=n+3,t[++r]=n+1,t[++r]=n+2,t[++r]=n+4,t[++r]=n+2,t[++r]=n+5,t[++r]=n+4},Qf=function(t,n,i,r,e,u,s,h,o,a){var c=Jf,f=s*h,l=.5*e+(0<=e?+f:-f),v=.5*u+(0<=u?+f:-f);c.set(-l+i,-v+r),o.apply(c,c);var b=c.x,d=c.y;c.set(0+i,-v+r),o.apply(c,c);var g=c.x,m=c.y,w=g-b,p=m-d;c.set(i,r),o.apply(c,c);var D=c.x,E=c.y,M=D-w,S=E-p,T=2*n-1;t[++T]=b,t[++T]=d,t[++T]=g,t[++T]=m,t[++T]=g+w,t[++T]=m+p,t[++T]=M,t[++T]=S,t[++T]=D,t[++T]=E,t[++T]=D+w,t[++T]=E+p,a[0]=O(b,d,g,m),a[1]=O(b,d,M,S)},$f=function(t,n,i,r,e,u){for(var s=o(e),h=6*i-1,a=3*i,c=0;c<6;c+=1,a+=3)t[++h]=r,t[++h]=s,t[++h]=u[0],t[++h]=u[1],t[++h]=1+n[a],t[++h]=1+n[a+1]},tl=function(t,n,i){var r=i.x0,e=i.x1,u=i.x2,s=i.x3,h=i.y0,o=i.y1,a=i.y2,c=i.y3,f=2*n-1;t[++f]=r,t[++f]=h,t[++f]=.5*(r+e),t[++f]=.5*(h+o),t[++f]=e,t[++f]=o,t[++f]=.5*(r+s),t[++f]=.5*(h+c),t[++f]=.5*(r+u),t[++f]=.5*(h+a),t[++f]=.5*(e+u),t[++f]=.5*(o+a)},nl=function(t){function n(n,i){return t.call(this,n,i,6,4)||this}return B(n,t),n.prototype.init=function(t){t.updateClippings(),t.updateIndices();var n=this.vertexOffset;Zf(t.clippings,n),qf(t.indices,n,this.indexOffset)},n.prototype.update=function(t,n){this.updateVertexAndStep(t,n),this.updateColorFill(t,n),this.updateColorStroke(t,n),this.updateUv(t,n)},n.prototype.updateVertexAndStep=function(t,n){var i=n.size,r=i.x,e=i.y,u=r!==this.sizeX||e!==this.sizeY,s=z(n),h=this.transformLocalId!==s,o=n.stroke,a=o.align,c=o.enable?o.width:0,f=o.style,l=this.strokeAlign!==a||this.strokeWidth!==c||this.strokeStyle!==f;(u||h||l)&&(this.sizeX=r,this.sizeY=e,this.transformLocalId=s,this.strokeAlign=a,this.strokeWidth=c,this.strokeStyle=f,t.updateVertices(),t.updateSteps(),Qf(t.vertices,this.vertexOffset,0,0,r,e,a,c,n.transform.internalTransform,Yf),$f(t.steps,t.clippings,this.vertexOffset,c,f,Yf))},n.prototype.updateUv=function(t,n){var i=V(n),r=W(i);if(i!==this.texture||r!==this.textureTransformId){this.texture=i,this.textureTransformId=r,t.updateUvs();var e=X(i);tl(t.uvs,this.vertexOffset,e)}},n}(H),il=function(t,n,i,r,e){var s=M(n),h=4*s,o=2*s,a=6+h,c=4+o;return t.check(i,r,a,c)?new u(t,i,r,a,c,[new nl(i,r),new Jt(i+6,r+4,h,o)]).init(n):null},rl=function(t,n,i,r,e,u,s){return i<=0&&Ft(t,n,i,r,e,u,s)},el=function(t){function n(n){void 0===n&&(n=r.SEMICIRCLE);var i=t.call(this,n)||this;return i.stroke.side=Gt.ALL&~Gt.BOTTOM,i}return B(n,t),n.prototype.clone=function(){return new n(this.type).copy(this)},n.prototype.containsAbs=function(n,i,r,e,u,s,h){return!!t.prototype.containsAbsBBox.call(this,n,i,r,e)&&rl(this,n,i,r,e,u,s)},n}(Ut),ul=function(t,n,i){return co(t,n,i||new el)},sl=function(){e[r.SEMICIRCLE]=il,n[r.SEMICIRCLE]=ul},hl=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.init=function(t){t.updateClippings(),t.updateIndices(),ca(t.clippings,this.vertexOffset),fa(t.indices,this.vertexOffset,this.indexOffset)},n.prototype.update=function(t,n){this.updateVertexStepAndUv(t,n),this.updateColorFill(t,n),this.updateColorStroke(t,n)},n.prototype.updateVertexStepAndUv=function(t,n){var i=n.size,r=i.x,e=i.y,u=r!==this.sizeX||e!==this.sizeY,s=z(n),h=this.transformLocalId!==s,o=n.stroke,a=o.align,c=o.enable?o.width:0,f=o.style,l=this.strokeAlign!==a||this.strokeWidth!==c||this.strokeStyle!==f,v=V(n),b=W(v),d=v!==this.texture||b!==this.textureTransformId,g=u||l;if(g||h||d){this.sizeX=r,this.sizeY=e,this.transformLocalId=s,this.strokeAlign=a,this.strokeWidth=c,this.strokeStyle=f,this.texture=v,this.textureTransformId=b;var m=this.vertexOffset;t.updateVertices(),la(t.vertices,m,0,0,r,e,a,c,n.transform.internalTransform,oa),(g||h)&&(t.updateSteps(),va(t.steps,t.clippings,m,7,c,f,oa)),(g||d)&&(t.updateUvs(),ba(t.uvs,X(v),m,oa))}},n}(H),ol=function(t,n,i,r,e){var s=M(n),h=4*s,o=2*s,a=7+h,c=3+o;return t.check(i,r,a,c)?new u(t,i,r,a,c,[new hl(i,r,a-h,c-o),new Jt(i+7,r+3,h,o)]).init(n):null},al=function(t,n,i){return co(t,n,i||new xf)},cl=function(){e[r.TRIANGLE]=ol,n[r.TRIANGLE]=al},fl=function(t){function n(n,i,r,e){var u=t.call(this,n,i,r,e)||this;return u.radius=NaN,u.corner=NaN,u}return B(n,t),n.prototype.init=function(t){t.updateIndices(),Of(t.indices,this.vertexOffset,this.indexOffset)},n.prototype.update=function(t,n){this.updateVertexClippingStepAndUv(t,n),this.updateColorFill(t,n),this.updateColorStroke(t,n)},n.prototype.updateVertexClippingStepAndUv=function(t,n){var i=n.size,r=i.x,e=i.y,u=r!==this.sizeX||e!==this.sizeY,s=n.radius,h=s!==this.radius,o=z(n),a=this.transformLocalId!==o,c=n.stroke,f=c.align,l=c.enable?c.width:0,v=c.style,b=this.strokeAlign!==f||this.strokeWidth!==l||this.strokeStyle!==v,d=n.corner,g=d!==this.corner,m=V(n),w=W(m),p=m!==this.texture||w!==this.textureTransformId,O=u||h||b;if(O||a||g||p){this.sizeX=r,this.sizeY=e,this.radius=s,this.transformLocalId=o,this.strokeAlign=f,this.strokeWidth=l,this.strokeStyle=v,this.corner=d,this.texture=m,this.textureTransformId=w;var D=this.vertexOffset;t.updateVertices(),Df(t.vertices,D,0,0,r,e,f,l,s,n.transform.internalTransform,wf),(h||g)&&(t.updateClippings(),Ef(t.clippings,D,d,s)),(O||a||g)&&(t.updateSteps(),Mf(t.steps,t.clippings,D,l,v,n.radius,wf)),(O||p)&&(t.updateUvs(),Sf(t.uvs,D,X(m),s,wf))}},n}(H),ll=function(t,n,i,r,e){var s=M(n),h=4*s,o=2*s,a=mf+h,c=15+o;return t.check(i,r,a,c)?new u(t,i,r,a,c,[new fl(i,r,a-h,c-o),new Jt(i+mf,r+15,h,o)]).init(n):null},vl=function(t,n,i){return co(t,n,i||new Cf)},bl=function(){e[r.TRIANGLE_ROUNDED]=ll,n[r.TRIANGLE_ROUNDED]=vl,mr.set(r.TRIANGLE_ROUNDED,wt.PRIMITIVE|wt.STROKE_SIDE|wt.BORDER_RADIUS)},dl=function(){lo(),ko(),Xo(),Ka(),Ya(),nc(),fc(),hc(),gc(),e[r.IMAGE_SDF]=Tc,n[r.IMAGE_SDF]=Nc,Lc(),xc(),Hf(),e[r.RECTANGLE_PIVOTED]=Za,n[r.RECTANGLE_PIVOTED]=Wf,mr.set(r.RECTANGLE_PIVOTED,wt.PRIMITIVE|wt.STROKE_SIDE),Kf(),Vf(),sl(),bl(),cl(),sf(),ff(),gf(),Lf(),Pf()},gl=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DImage"},n}(bs),ml=function(t){function n(n){var i,r=this;return(r=t.call(this,n)||this).Rt=null!==(i=null==n?void 0:n.value)&&void 0!==i?i:null,r}return B(n,t),n.prototype.init=function(n){var i=this;t.prototype.init.call(this,n),this.on(Ki.tap,(function(t){i.onClick(t)}))},n.prototype.onClick=function(t){this.state.isActionable&&this.activate(t)},n.prototype.activate=function(t){this.onSelect(t)},Object.defineProperty(n.prototype,"value",{get:function(){return this.Rt},set:function(t){this.Rt=t},enumerable:!1,configurable:!0}),n.prototype.hasSelection=function(t){return t&&t.selection&&t.selection.add},n.prototype.getSelection=function(){for(var t=this.parent;t;){if(this.hasSelection(t))return t.selection;t=t.parent}return null},n.prototype.onSelect=function(t){this.emit("select",this.Rt,this);var n=this.getSelection();n&&n.add(this)},n.prototype.onKeyDown=function(n){return Xi.isActivateKey(n)&&this.onKeyDownActivate(n),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyDownActivate=function(t){return!(!this.state.isActionable||!this.state.isFocused||(this.activate(t),0))},n.prototype.getType=function(){return"DMenuItemBase"},n}(gl),wl=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getContext=function(){for(var t=this.parent;t;){if(t.getContext)return t.getContext();t=t.parent}return null},n.prototype.getCloseable=function(){for(var t=this.parent;t;){if(t.getCloseable)return t.getCloseable();t=t.parent}return null},n.prototype.getType=function(){return"DMenuItem"},n}(ml),pl=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.init=function(n){t.prototype.init.call(this,n),this.initOnOver(n),this.initShortcuts(n)},n.prototype.initOnOver=function(t){var n=this;this.on(Ki.over,(function(){var t=n.getContext();null!=t&&n.parent instanceof Qi&&t.trim(n.getCloseable())}))},n.prototype.initShortcuts=function(t){var n=this.Xn;if(null!=n&&0<n.length){var i=n[0],r=Xi.toString(i);this.po=this.createText(r),this.snippet.add(this.po,!0)}else this.po=null;this.Oo=this.theme.getShortcutTextMargin()},n.prototype.updateShortcutText=function(){var t=this.po,n=this.Oo;if(null!=t&&null!=n){var i,r=this.Bn;i=r.width.isOn?n:this.width-t.width-n;var e,u=this.zn,s=u.getTop();e=r.height.isOn?s:s+.5*(this.height-s-u.getBottom()-t.height),t.position.set(i,e)}},n.prototype.updateTextColor=function(n){t.prototype.updateTextColor.call(this,n);var i=this.po;if(null!=i){var r=this.theme,e=this.state;i.style.fill=r.getShortcutColor(e),i.alpha=r.getShortcutAlpha(e)}},n.prototype.updateText=function(){t.prototype.updateText.call(this),this.updateShortcutText()},n.prototype.getType=function(){return"DMenuItemText"},n.prototype.onSelect=function(n){t.prototype.onSelect.call(this,n);var i=this.getCloseable();null!=i&&i.emit("select",this.value,this,i)},n.prototype.onShortcut=function(n){t.prototype.onShortcut.call(this,n),this.activate(n)},n}(wl),Ol=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.init=function(n){t.prototype.init.call(this,n),(null==n?void 0:n.check)&&(this.state.isActive=!0)},n.prototype.getType=function(){return"DMenuItemCheck"},n.prototype.onSelect=function(n){this.state.isActive=!this.state.isActive,t.prototype.onSelect.call(this,n)},n}(pl),Dl=function(t){return"check"in t},El={OPEN_LINK:0,OPEN_LINK_IN_NEW_WINDOW:1,COPY_LINK_ADDRESS:2},Ml=function(){function n(){}return n.addItemCreator=function(t){this.CREATORS.push(t)},n.setItemCreatorDefault=function(t){this.CREATOR_DEFAULT=t},n.setMenuCreator=function(t){this.MENU_CREATOR=t},n.newItemOf=function(t,n,i,r){for(var e=0,u=t.length;e<u;++e){var s=t[e](i,r);if(null!=s)return s}return n?n(i,r):null},n.newItem=function(t,n){return this.newItemOf(this.CREATORS,this.CREATOR_DEFAULT,t,n)},n.newItemsOf=function(n,i,r,e){for(var u=0,s=r.length;u<s;++u){var h=r[u];if(h instanceof t.DisplayObject)i.addChild(h);else if(null!=h){var o=n.newItem(h,e);if(null==o)throw new Error("No matching menu item creator found: ".concat(JSON.stringify(h)));i.addChild(o)}}},n.newItems=function(t,n,i){this.newItemsOf(this,t,n,i)},n.newMenu=function(t){if(null!=this.MENU_CREATOR)return this.MENU_CREATOR(t);throw new Error("Missing DMenu creator.")},n.CREATORS=[],n.CREATOR_DEFAULT=null,n}(),Sl=function(){function n(t,n){this.p=t,this.kn=n,this.rs=!0}return Object.defineProperty(n.prototype,"enable",{get:function(){return this.rs},set:function(t){this.rs=t},enumerable:!1,configurable:!0}),n.prototype.open=function(t){this.get().open(t)},n.prototype.get=function(){var t=this,n=this.Do;return null==n&&(n=this.toMenu(this.kn),this.Do=n,n.on("select",(function(n,i,r){t.onSelect(n,i,r)}))),n},n.prototype.toMenu=function(n){return n instanceof t.DisplayObject?n:this.newMenu(n)},n.prototype.newMenu=function(t){return Ml.newMenu(t)},n.prototype.onSelect=function(t,n,i){var r=this.p;switch(t){case El.OPEN_LINK:r.open(!1);break;case El.OPEN_LINK_IN_NEW_WINDOW:r.open(!0);break;case El.COPY_LINK_ADDRESS:r.copy()}},n}(),Tl={AUTO:0,THIS_WINDOW:1,NEW_WINDOW:2},jl=function(t){var n=document.getSelection();if(n){var i=document.createRange();i.selectNodeContents(t),n.removeAllRanges(),n.addRange(i)}return n},Nl=function(t){return t.clipboardData||window.clipboardData},Il=function(t){function n(){var n=t.call(this)||this,i=document.body;return i.addEventListener("copy",(function(t){t.target===i&&(t.preventDefault(),t.stopPropagation(),n.emit("copy",Nl(t)))})),i.addEventListener("cut",(function(t){t.target===i&&(t.preventDefault(),t.stopPropagation(),n.emit("cut",Nl(t)))})),i.addEventListener("paste",(function(t){t.target===i&&(t.preventDefault(),t.stopPropagation(),n.emit("paste",Nl(t)))})),n}return B(n,t),n.copy=function(t){var n=navigator.clipboard;n&&n.writeText?n.writeText(t):function(t,n){if("undefined"==typeof ClipboardEvent){var i=t.clipboardData;if(void 0!==i&&void 0!==i.setData)return i.setData("Text",n),!0}return!1}(window,t)||function(t){var n=document.createElement("div");n.setAttribute("style","-webkit-user-select: text !important"),n.textContent="Dummy",document.body.appendChild(n);var i=jl(n),r=!1;if(i){var e=function(i){if(i.target===n){var e=Nl(i);e.setData("text/plain",t),r=e.getData("text/plain")===t,i.preventDefault()}};document.addEventListener("copy",e);try{document.execCommand("copy")}finally{document.removeEventListener("copy",e)}i.removeAllRanges()}return document.body.removeChild(n),r}(t)||navigator.userAgent.indexOf("Edge")<0&&function(t){var n=document.createElement("div");n.setAttribute("style","-webkit-user-select: text !important");var i=document.createElement("span");i.innerText=t,(n.attachShadow?n.attachShadow({mode:"open"}):n).appendChild(i),document.body.appendChild(n);var r=jl(n);r&&(document.execCommand("copy"),r.removeAllRanges()),document.body.removeChild(n)}(t)},n}(t.utils.EventEmitter),Cl=t.interaction.InteractionEvent,Al=function(){function t(t){this.kn=t,this.Eo=null==t?void 0:t.url,this.Jn=this.toNormalizedTarget(null==t?void 0:t.target),this.Mo=null==t?void 0:t.checker,this.rs=!0}return Object.defineProperty(t.prototype,"enable",{get:function(){return this.rs},set:function(t){this.rs=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"url",{get:function(){return this.Eo},set:function(t){this.Eo=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"target",{get:function(){return this.Jn},set:function(t){this.Jn=this.toNormalizedTarget(t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"checker",{get:function(){return this.Mo},set:function(t){this.Mo=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"menu",{get:function(){var t=this.Do;return null==t&&(t=this.newMenu(),this.Do=t),t},enumerable:!1,configurable:!0}),t.prototype.newMenu=function(){var n=this.kn;if(n){var i=n.menu;if(i)return new Sl(this,i)}var r=t.MENU;return null==r&&(r=new Sl(this,K.getInstance().get("DLink").getMenuOptions()),t.MENU=r),r},t.prototype.toStringifiedUrl=function(t,n){var i=ot(t)?t():t;null!=i&&(at(i)?n(i):i.then((function(t){null!=t&&n(t)})))},t.prototype.toNormalizedUrl=function(n){var i=t.ANCHOR_ELEMENT||document.createElement("a");return t.ANCHOR_ELEMENT=i,i.href=n,i.href},t.prototype.toNormalizedTarget=function(t){return Di(null!=t?t:Tl.AUTO,Tl)},t.prototype.copy=function(){var t=this;this.toStringifiedUrl(this.Eo,(function(n){Il.copy(t.toNormalizedUrl(n))}))},t.prototype.open=function(t){var n=this;this.toStringifiedUrl(this.Eo,(function(i){var r=!0===t||!1===t?t:n.inNewWindow(t);n.check(i,r,(function(){n.exec(i,r)}))}))},t.prototype.check=function(t,n,i){var r=this.Mo;if(r){var e=r();!0===e?i():!1===e||e.then((function(t){t&&i()}))}else i()},t.prototype.exec=function(t,n){if(n){var i=document.createElement("a");i.href=t,i.target="_blank",i.style.display="none",i.rel="noopener noreferrer",document.body.appendChild(i),i.click(),setTimeout((function(){document.body.removeChild(i)}),100)}else window.location.href=t},t.prototype.inNewWindow=function(t){switch(this.Jn){case Tl.NEW_WINDOW:return!0;case Tl.THIS_WINDOW:return!1;case Tl.AUTO:if(null!=t){var n=t instanceof Cl?t.data.originalEvent:t;return n.ctrlKey||n.shiftKey||n.altKey||n.metaKey||"button"in n&&0!==n.button}return!1}},t.prototype.onClick=function(t,n){if(this.Jn===Tl.AUTO){var i=n.data.originalEvent;if("pointerType"in i&&"mouse"!==i.pointerType||"touches"in i){var r=this.menu;if(r.enable)return this.rs&&t.state.isActionable&&r.open(t),!0}}return!this.rs},t}(),Rl=function(){function t(){}return t.toStateOptions=function(t,n){if(n&&(t===Tl.NEW_WINDOW||"NEW_WINDOW"===t)){var i=n.state;null==i?n.state=ht.NEW_WINDOW:at(i)?i!==ht.NEW_WINDOW&&(n.state=[i,ht.NEW_WINDOW]):i.indexOf(ht.NEW_WINDOW)<0&&i.push(ht.NEW_WINDOW)}return n},t}(),Ll=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.toLinkOptions=function(t){if(t)return{url:this.toUrl(t.url),target:t.target,checker:this.toChecker(t.checker),menu:t.menu}},n.prototype.toUrl=function(t){var n=this;return at(t)||null==t?t:function(){return t(n)}},n.prototype.toChecker=function(t){var n=this;if(null!=t)return function(){return t(n)}},n.prototype.init=function(n){t.prototype.init.call(this,Rl.toStateOptions(null==n?void 0:n.target,n))},Object.defineProperty(n.prototype,"link",{get:function(){var t=this.So;return null==t&&(t=new Al(this.toLinkOptions(this.kn)),this.So=t),t},enumerable:!1,configurable:!0}),n.prototype.onClick=function(n){this.link.onClick(this,n)||t.prototype.onClick.call(this,n)},n.prototype.getType=function(){return"DMenuItemLink"},n.prototype.onSelect=function(n){t.prototype.onSelect.call(this,n),this.link.open(n)},n.prototype.open=function(t){this.link.open(t)},n.prototype.onShortcut=function(n){t.prototype.onShortcut.call(this,n),this.activate(n)},n}(pl),yl=function(t){return"url"in t},kl=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return B(i,n),i.prototype.init=function(t){n.prototype.init.call(this,t),this.initHover(t)},i.prototype.initHover=function(t){var n=this;this.on(Ki.over,(function(){n.state.isActionable&&n.open()}))},i.prototype.toMenu=function(n){var i=null==n?void 0:n.menu;return i instanceof t.DisplayObject?i:this.newMenu(i)},i.prototype.newMenu=function(t){return Ml.newMenu(t)},Object.defineProperty(i.prototype,"menu",{get:function(){var t=this,n=this.Do;return null==n&&((n=this.toMenu(this.kn)).on("select",(function(n,i,r){t.onMenuSelect(n,i,r)})),this.Do=n),n},enumerable:!1,configurable:!0}),i.prototype.getType=function(){return"DMenuItemMenu"},i.prototype.open=function(){var t=this.menu;t.isHidden()&&this.onOpen(t)},i.prototype.onOpen=function(t){var n=this.getContext();null!=n&&t.open(this,this.getCloseable(),n)},i.prototype.close=function(){this.menu.close()},i.prototype.toggle=function(){var t=this.menu;t.isHidden()?this.onOpen(t):t.close()},i.prototype.onSelect=function(t){this.open(),n.prototype.onSelect.call(this,t)},i.prototype.onMenuSelect=function(t,n,i){var r=this.getCloseable();null!=r&&r.emit("select",t,n,r)},i.prototype.onKeyDown=function(t){return Xi.isArrowRightKey(t)&&this.onKeyDownArrowRight(t),n.prototype.onKeyDown.call(this,t)},i.prototype.onKeyDownArrowRight=function(t){return!(!this.state.isActionable||!this.state.isFocused||(this.onSelect(t),0))},i}(wl),xl=function(t){return"menu"in t},Bl=function(n,i){var r=n.menu;return r instanceof t.DisplayObject||(null==r.sticky&&(r.sticky=i),null==r.align&&(r.align=ju.RIGHT)),n},_l=function(t){function n(n){var i=t.call(this)||this;return n.snippet.add(i,!0),n.reflowable.add(i),i}return B(n,t),n.prototype.onReflow=function(t,n,i){var r=t.state,e=t.border,u=e.getWidth(r),s=e.getColor(r);if(null!=s){var h=e.getAlpha(r),o=e.getAlign(r),a=t.padding,c=.5*i;this.clear(),this.lineStyle(u,s,h,o),this.moveTo(a.getLeft(),c),this.lineTo(n-a.getRight(),c),this.visible=!0}else this.clear(),this.visible=!1},n}(t.Graphics),Pl=function(t){return"separator"in t},Ul=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.initReflowable=function(){new _l(this)},n.prototype.getType=function(){return"DMenuItemSeparator"},n}(ml),Fl=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DMenuItemSpace"},n}(_u),Gl=function(t){return"space"in t},Hl=function(){Ml.addItemCreator((function(t){return Dl(t)?new Ol(t):null})),Ml.addItemCreator((function(t){return yl(t)?new Ll(t):null})),Ml.addItemCreator((function(t,n){return xl(t)?new kl(Bl(t,n)):null})),Ml.addItemCreator((function(t){return Pl(t)?new Ul(t):null})),Ml.addItemCreator((function(t){return Gl(t)?new Fl(t):null})),Ml.setItemCreatorDefault((function(t){return new pl(t)}))},zl=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DMenuItemExpandableBody"},n}(Fu),Vl=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getSelection=function(){return null},n.prototype.getType=function(){return"DMenuItemExpandableHeader"},n}(ml),Wl=function(){function t(){}return t.addItemCreator=function(t){this.CREATORS.push(t)},t.setItemCreatorDefault=function(t){this.CREATOR_DEFAULT=t},t.newItem=function(t,n){return Ml.newItemOf(this.CREATORS,this.CREATOR_DEFAULT,t,n)||Ml.newItem(t,n)},t.newItems=function(t,n,i){Ml.newItemsOf(this,t,n,i)},t.CREATORS=[],t.CREATOR_DEFAULT=null,t}(),Xl=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return B(i,n),i.prototype.init=function(t){var i,r=this;n.prototype.init.call(this,t);var e=this.theme,u=this.toHeader(e,t);this.hh=u,u.on("select",(function(){r.toggle()})),this.addChild(u);var s=this.toBody(e,t);this.pe=s;var h=null!==(i=null==t?void 0:t.sticky)&&void 0!==i&&i;this.newItems(s,h,e,t),this.addChild(s),this.state.isActive?this.onActivated():this.onDeactivated()},i.prototype.newItems=function(t,n,i,r){var e=null==r?void 0:r.items;null!=e&&Wl.newItems(t,e,n)},i.prototype.toHeader=function(n,i){return i?i.header instanceof t.DisplayObject?i.header:this.newHeader(n,i.header):this.newHeader(n)},i.prototype.newHeader=function(t,n){return new Vl(n)},i.prototype.toBody=function(n,i){var r=null==i?void 0:i.body;return r?r instanceof t.DisplayObject?r:this.newBody(n,r):this.newBody(n)},i.prototype.newBody=function(t,n){return new zl(n)},i.prototype.open=function(){this.state.isActive=!0},i.prototype.close=function(){this.state.isActive=!1},i.prototype.toggle=function(){this.state.isActive=!this.state.isActive},i.prototype.onActivated=function(){var t=this.pe;t instanceof Qi?t.show():t.visible=!0},i.prototype.onDeactivated=function(){var t=this.pe;t instanceof Qi?t.hide():t.visible=!1},i.prototype.onStateChange=function(t,i){n.prototype.onStateChange.call(this,t,i),t.isActive?i.isActive||this.onActivated():i.isActive&&this.onDeactivated()},i.prototype.onKeyDown=function(t){if(Xi.isArrowRightKey(t))this.state.isActionable&&!this.state.isActive&&(i=this.hh)instanceof Qi&&i.state.isFocused&&(this.state.isActive=!0);else if(Xi.isArrowLeftKey(t)){var i;if(this.state.isActionable&&this.state.isActive)return(i=this.hh)instanceof Qi?i.focus():this.focus(),this.state.isActive=!1,n.prototype.onKeyDown.call(this,t),!0}return n.prototype.onKeyDown.call(this,t)},i.prototype.getType=function(){return"DMenuItemExpandable"},i}(Fu),Kl=function(t){return"header"in t},Yl=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DMenuItemExpandableItemCheck"},n}(Ol),Jl=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DMenuItemExpandableItemLink"},n}(Ll),Zl=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DMenuItemExpandableItemSeparator"},n}(Ul),ql=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DMenuItemExpandableItemSpace"},n}(Fl),Ql=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DMenuItemExpandableItemText"},n}(pl),$l=function(){Ml.addItemCreator((function(t){return Kl(t)?new Xl(t):null})),Wl.addItemCreator((function(t){return Dl(t)?new Yl(t):null})),Wl.addItemCreator((function(t){return yl(t)?new Jl(t):null})),Wl.addItemCreator((function(t){return Pl(t)?new Zl(t):null})),Wl.addItemCreator((function(t){return Gl(t)?new ql(t):null})),Wl.setItemCreatorDefault((function(t){return new Ql(t)}))},tv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DMenuSidedItemCheck"},n}(Ol),nv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getSelection=function(){return null},n.prototype.getType=function(){return"DMenuSidedItemLink"},n}(Ll),iv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.initHover=function(t){},n.prototype.onMenuSelect=function(n,i,r){t.prototype.onMenuSelect.call(this,n,i,r);var e=t.prototype.getSelection.call(this);e&&e.add(i)},n.prototype.onOpen=function(t){t.open(this,this)},n.prototype.getSelection=function(){return null},n.prototype.getType=function(){return"DMenuSidedItemMenu"},n}(kl),rv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DMenuSidedItemSeparator"},n}(Ul),ev=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DMenuSidedItemSpace"},n}(Fl),uv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DMenuSidedItemText"},n}(pl),sv=function(){function t(){}return t.addItemCreator=function(t){this.CREATORS.push(t)},t.setItemCreatorDefault=function(t){this.CREATOR_DEFAULT=t},t.newItem=function(t,n){return Ml.newItemOf(this.CREATORS,this.CREATOR_DEFAULT,t,n)||Ml.newItem(t,n)},t.newItems=function(t,n,i){Ml.newItemsOf(this,t,n,i)},t.CREATORS=[],t.CREATOR_DEFAULT=null,t}(),hv=function(){sv.setItemCreatorDefault((function(t){return new uv(t)})),sv.addItemCreator((function(t){return Gl(t)?new ev(t):null})),sv.addItemCreator((function(t){return Pl(t)?new rv(t):null})),sv.addItemCreator((function(t,n){return xl(t)?new iv(Bl(t,n)):null})),sv.addItemCreator((function(t){return yl(t)?new nv(t):null})),sv.addItemCreator((function(t){return Dl(t)?new tv(t):null}))},ov=function(){function t(){}return t.addItemCreator=function(t){this.CREATORS.push(t)},t.setItemCreatorDefault=function(t){this.CREATOR_DEFAULT=t},t.newItem=function(t,n){return Ml.newItemOf(this.CREATORS,this.CREATOR_DEFAULT,t,n)||sv.newItem(t,n)},t.newItems=function(t,n,i){Ml.newItemsOf(this,t,n,i)},t.CREATORS=[],t.CREATOR_DEFAULT=null,t}(),av=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.newItems=function(t,n,i,r){null!=r&&null!=r.items&&ov.newItems(t,r.items,n)},n.prototype.getType=function(){return"DMenuSidedItemExpandable"},n}(Xl),cv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DMenuSidedItemExpandableItemCheck"},n}(Yl),fv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DMenuSidedItemExpandableItemLink"},n}(Ll),lv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DMenuItemExpandableItemMenu"},n}(kl),vv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.onOpen=function(t){t.open(this,this)},n.prototype.getType=function(){return"DMenuSidedItemExpandableItemMenu"},n}(lv),bv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DMenuSidedItemSeparator"},n}(Zl),dv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DMenuSidedItemExpandableItemSpace"},n}(ql),gv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DMenuSidedItemExpandableItemText"},n}(Ql),mv=function(){sv.addItemCreator((function(t){return Kl(t)?new av(t):null})),ov.addItemCreator((function(t){return Dl(t)?new cv(t):null})),ov.addItemCreator((function(t){return yl(t)?new fv(t):null})),ov.addItemCreator((function(t,n){return xl(t)?new vv(Bl(t,n)):null})),ov.addItemCreator((function(t){return Pl(t)?new bv(t):null})),ov.addItemCreator((function(t){return Gl(t)?new dv(t):null})),ov.setItemCreatorDefault((function(t){return new gv(t)}))},wv=function(){Hl(),$l(),hv(),mv()},pv=function(){wv(),dl()},Ov=function(){function t(){}return t.add=function(t,n){var i=this.To;null==i&&(i=new Map,this.To=i);var r=i.get(t);null==r?(r=[n],i.set(t,r)):r.push(n)},t.get=function(t){var n=this.To;if(null!=n)return n.get(t)},t}(),Dv=function(t){function n(n,i){return t.call(this,ke.EMIT_EVENT,n,i,hu.EMIT_EVENT,"")||this}return B(n,t),n}(Ou),Ev=function(t){function n(n,i,r){return t.call(this,n,i,"",hu.EMIT_EVENT,r)||this}return B(n,t),n}(Ou),Mv=function(t){function n(n,i,r,e){return t.call(this,n,i,r,e,"")||this}return B(n,t),n}(Ou),Sv=function(t){function n(n,i,r,e){return t.call(this,n,i,r,hu.EMIT_EVENT,e)||this}return B(n,t),n}(Ou),Tv=function(t,n){return n?ao(t).then((function(t){var n=be.getInstance().init();n.updateTexture(t),n.render();var i=document.createElement("canvas");return n.read(i),Tv(i.toDataURL(),!1)})):ao(t).then((function(t){return new jc(t)}))},jv=function(){function t(){}return t.from=function(t,n,i){var r=this,e=Ue.toSerialized(t),u=e.pieces;return Ue.toPieceData(n,u,i).then((function(t){return r.jo(e,i,u,t)}))},t.jo=function(t,n,i,r){var e=this,u=t.width,s=t.height,h=new Pe(u,s),o=new dr(t,i,r,n,1);return Ue.newLayer(t,h,o).then((function(){return e.create(t.name,u,s,h,n,0)}))},t.create=function(t,n,i,r,e,u){var s=new Nr(t,e,u);return s.size.set(n,i),r.copyTo(s),s.size.init(),s},t}(),Nv=function(t){return"data:image/svg+xml;base64,".concat(btoa(t))},Iv=function(t){return Math.round(100*t)/100},Cv=function(){function t(){}return t.add=function(t){var n,i,r;(null!==(n=this.yh)&&void 0!==n?n:this.yh=new Map).set(t.type,t),(null!==(i=this.Ee)&&void 0!==i?i:this.Ee=new Map).set(t.id,t),(null!==(r=this.Pt)&&void 0!==r?r:this.Pt=[]).push(t)},t.get=function(t){var n=this.yh;if(null!=n)return n.get(t)},t.getById=function(t){var n=this.Ee;if(null!=n)return n.get(t)},t.each=function(t){var n=this.Pt;if(null!=n)for(var i=0,r=n.length;i<r;++i)t(n[i])},t}(),Av=function(){function t(){}return t.toIndices=function(t){for(var n=[],i=0,r=t.length;i<r;++i)n.push(t[i].index);return n},t.toDepth=function(t){for(var n=0,i=t.parent;i instanceof Ot;)n+=1,i=i.parent;return n},t.toSharedParent=function(t,n){if(this.toDepth(t)<this.toDepth(n)){for(var i=t.parent;i instanceof Ot;){if(this.isParent(n,i))return i;i=i.parent}return i}for(var r=n.parent;r instanceof Ot;){if(this.isParent(t,r))return r;r=r.parent}return r},t.toOfParent=function(t,n){for(var i=t.parent;i!==n&&i instanceof Ot;)t=i,i=i.parent;return t},t.isParent=function(t,n){for(var i=t.parent;i instanceof Ot;){if(i===n)return!0;i=i.parent}return!1},t.toSelected=function(t){for(var n=t;n instanceof Ot;){if(n.selected)return n;n=n.parent}return null},t.findChildById=function(n,i,r){for(var e=n.children,u=0,s=e.length;u<s;++u){var h=e[u];if(h.id===i)return h;if(!0===r){var o=t.findChildById(h,i,r);if(null!=o)return o}}return null},t.findChildByType=function(n,i,r){for(var e=n.children,u=0,s=e.length;u<s;++u){var h=e[u];if(h.type===i)return h;if(!0===r){var o=t.findChildByType(h,i,r);if(null!=o)return o}}return null},t.findChild=function(n,i,r){for(var e=n.children,u=0,s=e.length;u<s;++u){var h=e[u];if(i(h))return h;if(!0===r){var o=t.findChild(h,i,r);if(null!=o)return o}}return null},t.findChildrenByType=function(n,i,r,e){e=e||[];for(var u=n.children,s=0,h=u.length;s<h;++s){var o=u[s];o.type===i&&e.push(o),!0===r&&t.findChildrenByType(o,i,r,e)}return e},t.findChildren=function(n,i,r,e){e=e||[];for(var u=n.children,s=0,h=u.length;s<h;++s){var o=u[s];i(o)&&e.push(o),!0===r&&t.findChildren(o,i,r,e)}return e},t.COMPARATOR_INDEX=function(t,n){return t.index-n.index},t}(),Rv=function(){function t(){}return t.delete=function(t,n,i){for(var r=t.children,e=r.length,u=0;u<e;++u)(o=r[u]).selected?o.index=e+u:o.index=u;if(r.sort(Av.COMPARATOR_INDEX),!0===i){for(u=e-1;0<=u;--u){if(!(o=r[u]).selected){var s=r.length-(u+1);if(0<s){var h=r.splice(u+1,s);return null!=n&&(n.length=0),t.onChildTransformChange(),t.toDirty(),h}return null!=n&&(n.length=0),null}o.index-=e,o.parent=null,o.selected=!1,o.uploaded=void 0,o.onDetach()}return 0<r.length?(h=r.splice(0,r.length),null!=n&&(n.length=0),t.onChildTransformChange(),t.toDirty(),h):(null!=n&&(n.length=0),null)}for(u=e-1;0<=u;--u){var o;if(!(o=r[u]).selected)return r.length=u+1,null!=n&&(n.length=0),t.onChildTransformChange(),t.toDirty(),null;o.parent=null,o.selected=!1,o.uploaded=void 0,o.onDetach()}return 0<r.length?(r.length=0,null!=n&&(n.length=0),t.onChildTransformChange(),t.toDirty()):null!=n&&(n.length=0),null},t}(),Lv=function(){function t(){}return t.from=function(t){if(at(t))return F[t];if(mn(t))return t;if(null!=t){for(var n=F.NONE,i=0,r=t.length;i<r;++i)n|=F[t[i]];return n}return F.NONE},t}(),yv=function(){function t(){this.resources=[],this.resourceToIndex=new Map,this.data=[],this.dataToIndex=new Map,this.pieces=[],this.pieceToIndex=new Map,this.uuids=new Set,this.uuidNext=0}return t.prototype.addResource=function(t){return this.No(t,this.resources,this.resourceToIndex)},t.prototype.addData=function(t){return this.No(t,this.data,this.dataToIndex)},t.prototype.addPiece=function(t){return this.No(t,this.pieces,this.pieceToIndex)},t.prototype.addUuid=function(t){if(0!==t){var n=this.uuids;return n.has(t)?0:(n.add(t),t)}return 0},t.prototype.updateUuid=function(t){var n=this.uuids;if(0!==t)return t;var i=this.newUuid();return n.add(i),i},t.prototype.newUuid=function(){for(var t=this.uuids,n=this.uuidNext;;)if(0!==(n+=1)&&!t.has(n))return this.uuidNext=n,n},t.prototype.No=function(t,n,i){var r=i.get(t);if(null!=r)return r;var e=n.length;return n.push(t),i.set(t,e),e},t}(),kv=function(t){function n(n,i){var r,e,u,s=this;return(s=t.call(this)||this).Io=null!==(r=null==i?void 0:i.visible)&&void 0!==r?r:n.isSnapGridVisible(),s.Co=s.Io,s.Ao=null!==(e=null==i?void 0:i.enable)&&void 0!==e?e:n.isSnapGridEnabled(),s.rs=s.Ao,s.Ro=null!==(u=null==i?void 0:i.size)&&void 0!==u?u:n.getSnapGridSize(),s.j=s.Ro,s}return B(n,t),Object.defineProperty(n.prototype,"visible",{get:function(){return this.Co},set:function(t){this.Co!==t&&(this.Co=t,this.emit("change",this))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"enable",{get:function(){return this.rs},set:function(t){this.rs!==t&&(this.rs=t,this.emit("change",this))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"size",{get:function(){return this.j},set:function(t){this.j!==t&&(this.j=t,this.emit("change",t,this))},enumerable:!1,configurable:!0}),n.prototype.snap=function(t,n){if(this.rs){var i=this.j;n.set(t,Math.round(t/i)*i)}},n.prototype.reset=function(){this.Co=this.Io,this.rs=this.Ao,this.j=this.Ro,this.emit("change",this)},n.prototype.serialize=function(){return[this.rs?1:0,this.Co?1:0,this.j]},n.prototype.deserialize=function(t){this.enable=!!t[0],2 in t?(this.visible=!!t[1],this.size=t[2]):(this.visible=!1,this.size=t[1])},n}(t.utils.EventEmitter),xv=function(){function t(){this.distance=NaN,this.result=0,this.threshold=10}return t.prototype.reset=function(t,n){this.distance=NaN,this.result=t,this.threshold=1e-4<n?10/n:10},t.prototype.set=function(t,n){var i=Math.abs(n-t);if(i<=this.threshold){var r=this.distance;(r!=r||i<r)&&(this.distance=i,this.result=n)}},t}(),Bv={HORIZONTAL:0,VERTICAL:1},_v=function(){function t(t,n){this.type=t,this.position=n}return t.prototype.serialize=function(){return[this.type,this.position]},t}(),Pv=function(t){function n(n,i){var r,e,u=this;return(u=t.call(this)||this).values=[],u.Io=null!==(r=null==i?void 0:i.visible)&&void 0!==r?r:n.isSnapTargetVisible(),u.Co=u.Io,u.Ao=null!==(e=null==i?void 0:i.enable)&&void 0!==e?e:n.isSnapTargetEnabled(),u.rs=u.Ao,u}return B(n,t),Object.defineProperty(n.prototype,"enable",{get:function(){return this.rs},set:function(t){this.rs!==t&&(this.rs=t,this.emit("change",this))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"visible",{get:function(){return this.Co},set:function(t){this.Co!==t&&(this.Co=t,this.emit("change",this))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"size",{get:function(){return this.values.length},enumerable:!1,configurable:!0}),n.prototype.add=function(t,n){null!=n?this.values.splice(n,0,t):this.values.push(t),this.emit("change",this)},n.prototype.remove=function(t){var n=this.values;0<=t&&t<n.length&&(n.splice(t,1),this.emit("change",this))},n.prototype.replace=function(t,n){var i=this.values;if(0<=t&&t<i.length){var r=i[t];return i[t]=n,this.emit("change",this),r}return null},n.prototype.swap=function(t,n){if(t!==n){var i=this.values,r=i[t];i[t]=i[n],i[n]=r,this.emit("change",this)}},n.prototype.snap=function(t,n,i,r){if(this.rs)for(var e=this.values,u=0,s=e.length;u<s;++u){var h=e[u];h.type===Bv.VERTICAL?i.set(t,h.position):r.set(n,h.position)}},n.prototype.reset=function(){this.rs=this.Ao,this.Co=this.Io,this.values.length=0,this.emit("change",this)},n.prototype.serialize=function(){for(var t=[],n=this.values,i=0,r=n.length;i<r;++i)t.push(n[i].serialize());return[this.rs?1:0,this.Co?1:0,t]},n.prototype.deserialize=function(t){this.rs=!!t[0],this.Co=!!t[1];var n=t[2],i=this.values;i.length=0;for(var r=0,e=n.length;r<e;++r){var u=n[r];i.push(new _v(u[0],u[1]))}this.emit("change",this)},n}(t.utils.EventEmitter),Uv=1e-5,Fv={NONE:0,TOP_LEFT:1,TOP_CENTER:2,TOP_RIGHT:3,MIDDLE_LEFT:4,MIDDLE_RIGHT:5,BOTTOM_LEFT:6,BOTTOM_CENTER:7,BOTTOM_RIGHT:8,ROTATION:9},Gv=function(n){function i(i,r,e){var u,s=this;return(s=n.call(this)||this).gt=[new t.Point,new t.Point,new t.Point,new t.Point,new t.Point],s.Lo=[new t.Point,new t.Point],s.yo=[1,1],s.ko=new t.Point,s.xo=new xv,s.Bo=new xv,s._o={distance:0,scale:new t.Point},s.Po=new t.Point,s.Uo=new t.Rectangle,s.Fo=new t.Point,s.grid=new kv(r,null==e?void 0:e.grid),s.target=new Pv(r,null==e?void 0:e.target),s.p=i,s.Ao=null!==(u=null==e?void 0:e.enable)&&void 0!==u?u:r.isSnapEnabled(),s.rs=s.Ao,s}return B(i,n),Object.defineProperty(i.prototype,"enable",{get:function(){return this.rs},set:function(t){this.rs!==t&&(this.rs=t,this.emit("change",this))},enumerable:!1,configurable:!0}),i.prototype.prepare=function(t){t.updateTransform();var n=t.transform.localTransform,i=t.width,r=t.height,e=this.gt;e[0].set(0,0),e[1].set(i,0),e[2].set(i,r),e[3].set(0,r),e[4].set(.5*i,.5*r),n.apply(e[0],e[0]),n.apply(e[1],e[1]),n.apply(e[2],e[2]),n.apply(e[3],e[3]),n.apply(e[4],e[4])},i.prototype.prepareForTranslate=function(t){this.rs&&this.prepare(t)},i.prototype.snap=function(t,n){var i=t.x,r=t.y,e=this.p.canvas,u=this.xo,s=this.Bo;if(null!=e){var h=Math.max(e.scale.x,e.scale.y);u.reset(i,h),s.reset(r,h),u.set(i,0),u.set(i,e.width),s.set(r,0),s.set(r,e.height)}else u.reset(i,1),s.reset(r,1);return this.target.snap(i,r,u,s),this.grid.snap(i,u),this.grid.snap(r,s),n.x=bh(u.distance)?NaN:u.result,n.y=bh(s.distance)?NaN:s.result,n},i.prototype.toSnapped=function(t,n){var i=t.x,r=t.y;if(this.rs){this.snap(t,n);var e=n.x,u=n.y;n.set(bh(e)?i:e,bh(u)?r:u)}else n.set(i,r);return n},i.prototype.toTranslationSnapped=function(t,n){var i=t.x,r=t.y,e=NaN,u=NaN;if(this.rs)for(var s=this.Po,h=this.gt,o=0,a=h.length;o<a;++o){var c=h[o];if(s.set(c.x+i,c.y+r),this.snap(s,s),!bh(s.x)){var f=s.x-c.x;(bh(e)||Math.abs(f-i)<Math.abs(e-i))&&(e=f)}if(!bh(s.y)){var l=s.y-c.y;(bh(u)||Math.abs(l-r)<Math.abs(u-r))&&(u=l)}}return n.x=bh(e)?i:e,n.y=bh(u)?r:u,n},i.prototype.prepareForRotate=function(t){},i.prototype.getGridSizeRotation=function(){return 5},i.prototype.toRadian=function(t){return t/180*Math.PI},i.prototype.toDegree=function(t){return t/Math.PI*180},i.prototype.toRotationSnapped=function(t,n){if(this.rs){var i=this.getGridSizeRotation(),r=t+n,e=Math.round(this.toDegree(r)),u=e%90;return Math.abs(u)<=i?this.toRadian(e-u)-t:90-i<=u?this.toRadian(e+(90-u))-t:u<=-90+i?this.toRadian(e-(90+u))-t:n}return n},i.prototype.calcNormalizedVector=function(t,n,i){var r=n.x-t.x,e=n.y-t.y,u=Math.sqrt(r*r+e*e);if(Uv<u){var s=1/u;i.x=r*s,i.y=e*s}else i.x=1,i.y=0;return u},i.prototype.prepareForScale=function(t,n){if(this.rs){this.prepare(t);var i=this.gt,r=this.Lo,e=this.yo;switch(n){case Fv.TOP_LEFT:e[0]=this.calcNormalizedVector(i[1],i[0],r[0]),e[1]=this.calcNormalizedVector(i[3],i[0],r[1]);break;case Fv.TOP_CENTER:e[0]=this.calcNormalizedVector(i[3],i[0],r[0]);break;case Fv.TOP_RIGHT:e[0]=this.calcNormalizedVector(i[0],i[1],r[0]),e[1]=this.calcNormalizedVector(i[2],i[1],r[1]);break;case Fv.MIDDLE_LEFT:e[0]=this.calcNormalizedVector(i[1],i[0],r[0]);break;case Fv.NONE:break;case Fv.MIDDLE_RIGHT:e[0]=this.calcNormalizedVector(i[0],i[1],r[0]);break;case Fv.BOTTOM_LEFT:e[0]=this.calcNormalizedVector(i[2],i[3],r[0]),e[1]=this.calcNormalizedVector(i[0],i[3],r[1]);break;case Fv.BOTTOM_CENTER:e[0]=this.calcNormalizedVector(i[0],i[3],r[0]);break;case Fv.BOTTOM_RIGHT:e[0]=this.calcNormalizedVector(i[3],i[2],r[0]),e[1]=this.calcNormalizedVector(i[1],i[2],r[1])}}},i.prototype.setScaleSnappedResult=function(t,n,i,r,e){if(Uv<n&&(bh(e.distance)||t<e.distance)){e.distance=t;var u=1+i/n;r?e.scale.x=u:e.scale.y=u}},i.prototype.calcScaleSnapped1D=function(t,n,i,r,e,u){var s=this.ko;t.apply(n,s);var h=s.x,o=s.y;this.snap(s,s);var a=s.x,c=s.y;if(!bh(a)){var f=Math.abs(i.x);if(Uv<f){var l=(a-h)/i.x,v=Math.abs(l),b=(a-n.x)/i.x;this.setScaleSnappedResult(v,r,b,e,u)}}if(!bh(c)){var d=Math.abs(i.y);if(Uv<d){var g=(c-o)/i.y,m=(v=Math.abs(g),(c-n.y)/i.y);this.setScaleSnappedResult(v,r,m,e,u)}}},i.prototype.calcScaleSnappedX=function(t,n,i,r,e){this.calcScaleSnapped1D(t,n,i,r,!0,e)},i.prototype.calcScaleSnappedY=function(t,n,i,r,e){this.calcScaleSnapped1D(t,n,i,r,!1,e)},i.prototype.calcScaleSnapped2D=function(t,n,i,r,e){var u=this.ko;t.apply(n,u);var s=u.x,h=u.y;this.snap(u,u);var o=u.x,a=u.y;if(bh(o)){if(bh(a))return;o=s}else bh(a)&&(a=h);var c=i[0].x*i[1].y-i[1].x*i[0].y;if(Uv<Math.abs(c)){var f=o-s,l=a-h,v=Math.abs(f*f+l*l);if(bh(e.distance)||v<e.distance){e.distance=v;var b=o-n.x,d=a-n.y,g=(+i[1].y*b-i[1].x*d)/c,m=(-i[0].y*b+i[0].x*d)/c;e.scale.set(1+g/r[0],1+m/r[1])}}},i.prototype.calcScaleSnappedXY=function(t,n,i,r,e,u,s){this.calcScaleSnapped2D(t,n,e,u,s),this.calcScaleSnappedX(t,r,e[0],u[0],s),this.calcScaleSnappedY(t,i,e[1],u[1],s)},i.prototype.toScaleSnapped=function(t,n,i,r){if(this.rs){var e=this.gt,u=this.Lo,s=this.yo,h=this._o;switch(h.distance=NaN,h.scale.set(r.x,r.y),n){case Fv.TOP_LEFT:this.calcScaleSnappedXY(t,e[0],e[1],e[3],u,s,h);break;case Fv.TOP_CENTER:this.calcScaleSnappedY(t,e[0],u[0],s[0],h),this.calcScaleSnappedY(t,e[1],u[0],s[0],h);break;case Fv.TOP_RIGHT:this.calcScaleSnappedXY(t,e[1],e[0],e[2],u,s,h);break;case Fv.MIDDLE_LEFT:this.calcScaleSnappedX(t,e[0],u[0],s[0],h),this.calcScaleSnappedX(t,e[3],u[0],s[0],h);break;case Fv.NONE:break;case Fv.MIDDLE_RIGHT:this.calcScaleSnappedX(t,e[1],u[0],s[0],h),this.calcScaleSnappedX(t,e[2],u[0],s[0],h);break;case Fv.BOTTOM_LEFT:this.calcScaleSnappedXY(t,e[3],e[2],e[0],u,s,h);break;case Fv.BOTTOM_CENTER:this.calcScaleSnappedY(t,e[2],u[0],s[0],h),this.calcScaleSnappedY(t,e[3],u[0],s[0],h);break;case Fv.BOTTOM_RIGHT:this.calcScaleSnappedXY(t,e[2],e[3],e[1],u,s,h)}if(!bh(h.distance)){if(r.copyFrom(h.scale),i)switch(n){case Fv.TOP_LEFT:case Fv.TOP_RIGHT:case Fv.BOTTOM_LEFT:case Fv.BOTTOM_RIGHT:r.x=r.y=Math.max(r.x,r.y);break;case Fv.TOP_CENTER:case Fv.BOTTOM_CENTER:r.x=r.y;break;case Fv.MIDDLE_LEFT:case Fv.MIDDLE_RIGHT:r.y=r.x}return!0}}return!1},i.prototype.reset=function(){this.enable=this.Ao,this.target.reset(),this.grid.reset()},i.prototype.serialize=function(){return[this.rs?1:0,this.target.serialize(),this.grid.serialize()]},i.prototype.deserialize=function(t){this.enable=!!t[0],this.target.deserialize(t[1]),this.grid.deserialize(t[2])},i}(t.utils.EventEmitter),Hv=function(t){function n(n,i,r){var e=t.call(this,n,i.width,i.height,0,r)||this;return e.Ns=i,e}return B(n,t),n.prototype.render=function(t){var n=this.frame;t.drawImage(this.Ns.canvas,n.x,n.y,n.width,n.height)},n}(ue),zv=function(){function t(){}return t.measure=function(t){var n=this.Go;null==n&&(n=new Map,this.Go=n);var i=n.get(t);if(null!=i)return i;var r=this.Ho;null==r&&((r=document.createElement("span")).innerText="|ÉqÅ",r.style.border="none",r.style.margin="0px",this.Ho=r);var e=this.zo;null==e&&((e=document.createElement("div")).style.display="inline-block",e.style.width="0px",e.style.height="0px",e.style.border="none",e.style.margin="0px",e.style.verticalAlign="baseline",this.zo=e);var u=this.Vo;null==u&&((u=document.createElement("div")).style.position="absolute",u.style.padding="0px",u.style.margin="0px",u.style.visibility="hidden",u.appendChild(r),u.appendChild(e),document.body.appendChild(u),this.Vo=u),r.style.font=t;var s=e.getBoundingClientRect().top,h=r.getBoundingClientRect();return i={ascent:s-h.top,descent:h.bottom-s},n.set(t,i),i},t}(),Vv=function(n,i,r,e){this.id=n,this.size=i,this.color=t.utils.hex2string(r),this.height=i+2*e;var u=zv.measure(n);this.ascent=u.ascent,this.descent=u.descent},Wv=function(){function n(n,i,r,e){this.R=n,this.ir=document.createElement("canvas"),this.Wo=null;var u=this.toPadding(i);this.zn=u,this.Ue=new Vv(n,i,r,u),this.Fe={},this.Ge=0,this.Xo=0,this.St=1,this.cn=1,this.Ko=0,this.Yo=0,this.je=t.Texture.from(this.ir,{mipmap:t.MIPMAP_MODES.OFF,resolution:e,scaleMode:t.SCALE_MODES.NEAREST});var s=this.Fe;this.No(" "," ",s,ve.SPACE_R),this.No("\t"," ",s,ve.SPACE_R),this.No("...","...",s,ve.LETTER_RNB);for(var h=0,o=ce.length;h<o;++h){var a=ce[h];this.No(a,a,s,ve.LETTER_RNB)}}return n.prototype.toPadding=function(t){return Math.max(3,Math.ceil(.2*t))},Object.defineProperty(n.prototype,"id",{get:function(){return this.R},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"font",{get:function(){return this.Ue},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"width",{get:function(){return this.St},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"height",{get:function(){return this.cn},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"canvas",{get:function(){return this.ir},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"characters",{get:function(){return this.Fe},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"texture",{get:function(){return this.je},enumerable:!1,configurable:!0}),n.prototype.No=function(t,n,i,r){if(!this.isIgnored(n)){var e=i[t];if(null!=e)e.type&ve.RESERVED||(0===e.ref&&(this.Xo-=1),e.ref+=1);else{var u=this.getAdvance(n),s=this.zn,h=Math.ceil(s+u+s),o=this.font.height;i[t]=new le(n,u,h,o,r),this.Ge+=1,this.Ko+=1}}},n.prototype.isIgnored=function(t){switch(t){case"\n":case"\r":case"\v":case"\f":case"…":return!0}return!1},n.prototype.Jo=function(t,n){var i=n[t];null!=i&&!(i.type&ve.RESERVED)&&0<i.ref&&(i.ref-=1,0===i.ref&&(this.Xo+=1))},n.prototype.Zo=function(){if(this.Ge>>1<=this.Xo){var t=this.Fe;for(var n in t)t[n].ref<=0&&delete t[n];this.Ge-=this.Xo,this.Ko+=1,this.Xo=0}},n.prototype.add=function(t,n){void 0===n&&(n=ve.LETTER);for(var i=this.Fe,r=b.from(t);r.hasNext();){var e=r.next();this.No(e,e,i,n)}},n.prototype.remove=function(t){for(var n=this.Fe,i=b.from(t);i.hasNext();)this.Jo(i.next(),n)},n.prototype.get=function(t){return this.Fe[t]},n.prototype.getAdvance=function(t){var n=this.getContext();return null!=n?n.measureText(t).width:0},n.prototype.getContext=function(){var t=this.Wo;if(null==t){var n=this.ir;if(null==n)return null;if(null==(t=this.Wo=n.getContext("2d",{alpha:!0})))return null}var i=this.Ue;return t.font!==i.id&&(t.font=i.id,i.id=t.font,t.textAlign="left",t.textBaseline="alphabetic",t.lineWidth=0,t.lineCap="round",t.lineJoin="miter",t.miterLimit=0,t.fillStyle=i.color,t.strokeStyle="#0000ff"),t},n.prototype.update=function(){if(this.Zo(),this.Yo<this.Ko){this.Yo=this.Ko;var t=this.ir;if(null!=t){var n=this.Ue,i=n.height,r=this.Fe,e=this.St=this.toPowerOf2(Math.ceil(Math.sqrt(this.Ge))*i),u=this.zn,s=Math.round(.5*(i-(n.ascent+n.descent))+n.ascent),h=0,o=0;for(var a in r)e<=h+(g=r[a]).width&&(h=0,o+=i),g.x=h,g.y=o,g.origin.x=h+u,g.origin.y=o+s,h+=g.width;var c=this.cn=o+i,f=this.je.baseTexture,l=f.resolution,v=Math.ceil(e*l),b=Math.ceil(c*l);t.width=v,t.height=b;var d=this.getContext();if(null!=d){for(var a in d.save(),d.scale(l,l),d.clearRect(0,0,e,c),r){var g=r[a];d.fillText(a,g.origin.x,g.origin.y)}d.restore()}return f.setRealSize(v,b),!0}}return!1},n.prototype.getRevision=function(){return this.Ko},n.prototype.getRevisionUpdate=function(){return this.Yo},Object.defineProperty(n.prototype,"length",{get:function(){return this.Ge},enumerable:!1,configurable:!0}),n.prototype.destroy=function(){null!=this.ir&&(this.ir=null);var t=this.Fe;for(var n in t)delete t[n]},n.prototype.toPowerOf2=function(t){for(var n=32;n<t;)n<<=1;return n},n}(),Xv=function(t){t.update()},Kv=function(t){t.forEach(Xv)},Yv=function(t){t.update()},Jv=function(t){t.forEach(Yv)},Zv=function(){function t(t){var n=this;this.He=new Map,this.bn=t.renderer.resolution,t.renderer.on("prerender",(function(){n.update()}))}return t.prototype.add=function(t,n,i,r){var e=this.He,u=e.get(t);null==u&&(u=new Map,e.set(t,u));var s=u.get(i);null==s&&(s=new Wv(t,n,i,this.bn),u.set(i,s)),s.add(r)},t.prototype.remove=function(t,n,i){var r=this.He.get(t);if(null!=r){var e=r.get(n);null!=e&&e.remove(i)}},t.prototype.get=function(t,n){var i=this.He.get(t);if(null==i)return null;var r=i.get(n);return null==r?null:r},t.prototype.update=function(){this.He.forEach(Kv)},t.prototype.destroy=function(){var t=this.He;t.forEach(Jv),t.clear()},t}(),qv=function(t){if("object"==typeof t&&"[object Object]"===Object.prototype.toString.call(t)){var n=Object.getPrototypeOf(t);return null==n||n===Object.prototype}return!1},Qv=function(){function t(t,n,i){var r=this;this.instance=null,this.newInstance=t,this.options=n,null!=i&&(i.state.isActive&&setTimeout((function(){r.get()}),0),i.on("active",(function(){r.get()})))}return t.prototype.get=function(){var t=this.instance;return null==t&&(t=new this.newInstance(this.options),this.instance=t),t},t}(),$v=function(t,n,i,r){for(var e=0,u=Math.floor(t.length/i)-1;e<=u;){var s=e+(u-e>>1),h=t[s*i+r];if(n<h)u=s-1;else{if(!(h<n))return s;e=s+1}}return Math.max(e,u)},tb=function(t){return Rt(t)?function(t){for(var n=[],i=0,r=t.length;i<r;++i)n[i]=t[i];return n}(t):qv(t)?function(t){var n={};for(var i in t)Object.hasOwnProperty.call(t,i)&&(n[i]=tb(t[i]));return n}(t):t},nb=function(t){if(null!=t){if(at(t))return t;if(mn(t))return String(t);if("name"in t)return t.name;if("label"in t)return t.label;if("id"in t)return t.id}return""},ib=function(t,n){if(null!=t){var i=tb(t);if(null!=n)for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)){var e=n[r];if(qv(e))if(Object.prototype.hasOwnProperty.call(i,r)){var u=i[r];qv(u)&&ib(u,e)}else i[r]=tb(e);else Object.prototype.hasOwnProperty.call(i,r)||(i[r]=e)}return i}return null!=n?tb(n):{}},rb=function(){function n(t,n,i){this.St=t,this.qo=n,this.Wr=i,this.Qo={},this.$o="",this.ta=0,this.na=0,this.cn=0}return Object.defineProperty(n.prototype,"width",{get:function(){return this.St},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"ratio",{get:function(){return this.qo},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"margin",{get:function(){return this.Wr},enumerable:!1,configurable:!0}),n.prototype.add=function(n,i,r,e){var u=this.Qo;if(!(n in u)){var s=this.Wr,h=this.ta,o=this.na;this.St<=h+i?(h=0,o=this.na+this.cn+s,this.cn=r,this.na=o):this.cn=Math.max(this.cn,r),this.ta=h+i+s,u[n]=new t.Rectangle(h,o,i,r);var a=this.qo;return this.$o+='<g transform="translate('.concat(h*a,",").concat(o*a,')">').concat(e,"</g>"),!0}return!1},n.prototype.has=function(t){return t in this.Qo},Object.defineProperty(n.prototype,"mappings",{get:function(){return this.build()},enumerable:!1,configurable:!0}),n.prototype.build=function(n){var i,r,e,u=this.ia;if(null==u||(null==n?void 0:n.force)){var s=null!==(r=null!==(i=null==n?void 0:n.resolution)&&void 0!==i?i:window.devicePixelRatio)&&void 0!==r?r:1,h=this.St,o=Math.pow(2,Math.ceil(Math.log(this.na+this.cn)/Math.LN2)),a=h*s,c=o*s,f=this.qo,l='width="'.concat(a,'"'),v='height="'.concat(c,'"'),b='viewBox="0 0 '.concat(h*f," ").concat(o*f,'"'),d=Nv("<svg ".concat(l," ").concat(v," ").concat(b," ").concat('xmlns="http://www.w3.org/2000/svg"',">").concat(this.$o,"</svg>")),g=null!==(e=null==n?void 0:n.scaling)&&void 0!==e?e:t.SCALE_MODES.NEAREST,m=t.BaseTexture.from(d,{resolution:s,scaleMode:g}),w=this.Qo;for(var p in u=this.ia={},w)u[p]=new t.Texture(m,w[p])}return u},n}(),eb=function(){function n(){}return n.toTexture=function(n,i,r,e){var u=n.transform.scale,s=t.RenderTexture.create({width:n.width*u.x,height:n.height*u.y,scaleMode:t.SCALE_MODES.LINEAR,resolution:i}),h=new t.Matrix(void 0,void 0,void 0,void 0,-n.position.x,-n.position.y),o=rt.getLayer(n);return o&&o.renderer.render(n,s,r,h,e),s},n.toPixels=function(t,n){var i=t.resolution,r=t.frame,e=Math.floor(r.width*i),u=Math.floor(r.height*i),s=new Uint8Array(4*e*u);n.renderTexture.bind(t);var h=n.gl;return h.readPixels(r.x*i,r.y*i,e,u,h.RGBA,h.UNSIGNED_BYTE,s),{width:e,height:u,array:s}},n.toCanvas=function(n,i,r){var e=n.width,u=n.height,s=n.array,h=new t.utils.CanvasRenderTarget(e,u,1),o=h.context.getImageData(0,0,e,u);if(r?o.data.set(s):t.Extract.arrayPostDivide(s,o.data),h.context.putImageData(o,0,0),null!=i&&1!==i){h.context.scale(i,i),h.context.drawImage(h.canvas,0,0);var a=Math.floor(e*i),c=Math.floor(u*i),f=h.context.getImageData(0,0,a,c);h.resize(a,c),h.context.putImageData(f,0,0)}return h},n.toBase64=function(t,n,i){return t.toDataURL(n,i)},n}(),ub=function(){function t(){}return t.downloadUrl=function(t,n){var i=document.createElement("a");"download"in i?(i.href=n,i.setAttribute("download",t),i.style.display="none",document.body.appendChild(i),i.click(),setTimeout((function(){document.body.removeChild(i)}),66)):window.open(n)||(location.href=n)},t.download=function(t,n,i){var r=new Blob(!1!==i?["\ufeff",n]:[n],{type:"text/plain"}),e=window.navigator;"msSaveBlob"in e?e.msSaveBlob(r,t):this.downloadUrl(t,URL.createObjectURL(r))},t}(),sb=function(){function t(){}return t.texture=function(t){var n,i=t.target,r=function(t){var n,i=t.target,r=t.resolution;if(null!=r){if(mn(r))return r;var e=i.transform.scale,u=Math.max(i.width*e.x,i.height*e.y);return Math.min(1,r.size/u)}return null!==(n=window.devicePixelRatio)&&void 0!==n?n:1}(t),e=null===(n=t.transform)||void 0===n?void 0:n.update;return eb.toTexture(i,r,t.clear,e)},t.pixels=function(t){var n=function(t){var n=t.renderer;if(n)return n;var i=t.application;if(i)return i.getLayerBase().renderer;var r=t.layer||rt.getLayer(t.target);if(r)return r.renderer;throw new Error("No renderer / application / layer found.")}(t),i=this.texture(t);try{return eb.toPixels(i,n)}finally{i&&i.destroy()}},t.canvas=function(t){var n,i,r=this.pixels(t),e=null===(i=null===(n=t.alpha)||void 0===n?void 0:n.premultiplied)||void 0===i?void 0:i.ignore,u=function(t,n){var i=n.scale;if(null!=i){if(mn(i))return i;var r=i.size;return Math.min(1,r/t.width,r/t.height)}}(r,t);return eb.toCanvas(r,u,e)},t.base64=function(t){var n=this.canvas(t);try{return eb.toBase64(n.canvas,t.format,t.quality)}finally{n&&n.destroy()}},t.file=function(t){ub.downloadUrl(t.filename,this.base64(t))},t}(),hb={TEXT:0,DATA_URL:1,BINARY_STRING:2,ARRAY_BUTTER:3,FILE:4},ob=function(){function t(t,n){this.lh=null,this.ra=t,this.ea=n}return t.prototype.open=function(){var t=this.getOrCreateInput();null!=t?t.click():this.onCancel()},t.prototype.getOrCreateInput=function(){var t=this;if("FileReader"in window&&null==this.lh){var n=document.createElement("input");this.lh=n,n.setAttribute("type","file"),n.setAttribute("style","display:none"),n.addEventListener("change",(function(i){t.onInputChange(n),n.value="",i.stopImmediatePropagation(),i.preventDefault()})),document.body.appendChild(n)}return this.lh},t.prototype.onInputChange=function(t){var n=this,i=t.files;if(null!=i&&0<i.length){var r=i[0];if(this.ra===hb.FILE)this.onOpen(r,r);else{var e=new FileReader;switch(e.onload=function(t){if(null!=t.target){var i=t.target;n.onOpen(i.result,r)}},e.onabort=function(t){n.onAboart(t)},this.ra){case hb.TEXT:e.readAsText(r);break;case hb.DATA_URL:e.readAsDataURL(r);break;case hb.BINARY_STRING:e.readAsBinaryString(r);break;case hb.ARRAY_BUTTER:e.readAsArrayBuffer(r);break;default:e.readAsText(r)}}}else this.onCancel()},t.prototype.onOpen=function(t,n){var i=this.ea;i.emit("open",t,n,i)},t.prototype.onAboart=function(t){var n=this.ea;n.emit("abort",t,n)},t.prototype.onCancel=function(){var t=this.ea;t.emit("cancel",t)},t}(),ab=function(){function t(){}return t.fromRgb=function(t){var n=(16711680&t)>>16,i=(65280&t)>>8,r=255&t|0,e=Math.max(n,i,r),u=e-Math.min(n,i,r),s=0;return 0<u&&(n===e?s=60*(i-r)/u:i===e?s=60*(r-n)/u+120:r===e&&(s=60*(n-i)/u+240),s<0&&(s+=360)),[s,u/e*255,e]},t.toRgb=function(t,n,i){var r=i-n/255*i,e=i-r,u=0,s=0,h=0;return t<=60?(u=i,s=t/60*e+r,h=r):t<=120?(u=(120-t)/60*e+r,s=i,h=r):t<=180?(u=r,s=i,h=(t-120)/60*e+r):t<=240?(u=r,s=(240-t)/60*e+r,h=i):t<=300?(u=(t-240)/60*e+r,s=r,h=i):(u=i,s=r,h=(360-t)/60*e+r),(u=Math.max(0,Math.min(255,u)))<<16|(s=Math.max(0,Math.min(255,s)))<<8|Math.max(0,Math.min(255,h))},t}(),cb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.onElementAttached=function(n,i,r){n.addEventListener("keydown",this.Vu),t.prototype.onElementAttached.call(this,n,i,r)},n.prototype.onElementDetached=function(n,i,r){n.removeEventListener("keydown",this.Vu),t.prototype.onElementDetached.call(this,n,i,r)},n.prototype.onInputKeyDown=function(t){Xi.isOkKey(t)&&this.Tu.onEnter()},n}(eu),fb=function(){function t(){}return t.create=function(t){var n=this.Gt;return t in n?"".concat(t," ").concat(++n[t]):(n[t]=1,"".concat(t," 1"))},t.Gt={},t}(),lb=function(){function t(){}return t.toCode=function(t,n){var i=t>>8&255,r=255&t;return"rgba(".concat(t>>16&255,",").concat(i,",").concat(r,",").concat(n,")")},t}(),vb=function(){function t(t,n,i){var r=this;this.ua=new Set,this.Mt=t,this.sa=n,this.ha=i,this.oa=null,this.aa=function(){r.update()}}return t.prototype.start=function(){return null==this.oa&&(this.oa=window.setTimeout(this.aa,this.sa)),this},t.prototype.stop=function(){var t=this.oa;return null!=t&&(this.oa=null,clearTimeout(t)),this},t.prototype.add=function(t){return this.ua.add(t),t.state.set(this.Mt,this.isOn(Date.now())),this},t.prototype.remove=function(t){return!!this.ua.delete(t)&&(t.state.remove(this.Mt),!0)},t.prototype.contains=function(t){return this.ua.has(t)},t.prototype.clear=function(){return this.ua.clear(),this},t.prototype.isOn=function(t){return Math.floor(t/this.ha)%2==0},t.prototype.update=function(){var t=Date.now(),n=this.isOn(t),i=this.Mt;this.ua.forEach((function(t){t.state.set(i,n)}));var r=this.ha;return this.oa=window.setTimeout(this.aa,r-t%r),this},t}(),bb=function(){function t(t){var n;this.qn=null!==(n=null==t?void 0:t.duration)&&void 0!==n?n:300,this.tu=null,this.ca=0,this.fa=null}return t.prototype.show=function(t,n){var i=this,r=this.fa;null!=r&&clearTimeout(r);var e=this.tu;if(t!==e){var u=this.qn,s=this.ca,h=Date.now(),o=s+u-h;!0===n||o<=0?this.update(h,t):this.fa=window.setTimeout((function(){i.update(Date.now(),t)}),o)}},t.prototype.update=function(t,n){var i=this.tu;i!==n&&(this.ca=t,null!=i&&i.hide(),this.tu=n,null!=n&&n.show())},t.prototype.hide=function(){this.show(null)},t}(),db=function(){function t(){this.la=null,this.va=0,this.xs=null,this.ba=null}return t.prototype.getNames=function(){var t=this.da;return null==t&&(t="onwheel"in document||9<=document.documentMode?["wheel"]:["mousewheel","DOMMouseScroll","MozMousePixelScroll"],this.da=t),t},t.prototype.on=function(t,n,i){void 0===i&&(i=!1);for(var r=this.getNames(),e=r.length-1;0<=e;--e){var u=r[e];t.addEventListener(u,n,i)}},t.prototype.off=function(t,n,i){void 0===i&&(i=!1);for(var r=this.getNames(),e=r.length-1;0<=e;--e){var u=r[e];t.removeEventListener(u,n,i)}},t.prototype.getLineHeight=function(){if(null==this.xs){var t=K.getInstance().get("DBase");this.xs=t.getLineHeight()}return this.xs},t.prototype.getPageHeight=function(){return null==this.ba&&(this.ba=12*this.getLineHeight()),this.ba},t.prototype.normalize=function(t){var n=0,i=0;if("detail"in t&&(i=-1*t.detail),"wheelDelta"in t&&(i=t.wheelDelta),"wheelDeltaY"in t&&(i=t.wheelDeltaY),"wheelDeltaX"in t&&(n=-1*t.wheelDeltaX),"axis"in t&&t.axis===t.HORIZONTAL_AXIS&&(n=-1*i,i=0),"deltaY"in t&&(i=-1*t.deltaY),"deltaX"in t&&(n=t.deltaX),0===i&&0===n)return null;var r=Math.max(Math.abs(i),Math.abs(n)),e=Date.now();this.va+200<=e&&(this.la=null),this.va=e;var u="mousewheel"===t.type&&r%120==0;(!this.la||r<this.la)&&(this.la=r,u&&(this.la/=40)),u&&(r/=40,n/=40,i/=40);var s=this.la;r=Math.floor(r/s),n=Math[1<=n?"floor":"ceil"](n/s),i=Math[1<=i?"floor":"ceil"](i/s);var h=t.deltaMode||0;if(0!==h){var o=1===h?this.getLineHeight():this.getPageHeight();r*=o,n*=o,i*=o}return{mode:h,delta:r,deltaX:n,deltaY:i,lowest:s}},t.getInstance=function(){return null==this.INSTANCE&&(this.INSTANCE=new t),this.INSTANCE},t}(),gb=function(t){function n(n){var i,r=this;return(r=t.call(this)||this).Jn=null!==(i=null==n?void 0:n.target)&&void 0!==i?i:null,r.$n=!1,r.Au=!1,r.ti=null==n?void 0:n.onTime,r.ii=null==n?void 0:n.onStart,r.ri=null==n?void 0:n.onEnd,r}return B(n,t),Object.defineProperty(n.prototype,"target",{get:function(){return this.Jn},set:function(t){this.Jn=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"duration",{get:function(){return 0},set:function(t){},enumerable:!1,configurable:!0}),n.prototype.start=function(t){void 0===t&&(t=!1),this.stop(),this.Au=!0,this.$n=t,this.onStart(t),this.Au&&(this.onTime(t?1:0,t,0),this.Au&&(this.onTime(t?0:1,t,0),this.Au||this.onEnd(t)))},n.prototype.onStart=function(t){var n=this.ii;null!=n&&n(t,this),this.emit("start",t,this)},n.prototype.onTime=function(t,n,i){var r=this.ti;null!=r&&r(t,n,i,this),this.emit("time",t,n,i,this)},n.prototype.onEnd=function(t){var n=this.ri;null!=n&&n(t,this),this.emit("end",t,this)},n.prototype.isStarted=function(){return this.Au},n.prototype.isReverse=function(){return this.$n},n.prototype.stop=function(){this.Au=!1},n.prototype.end=function(){if(this.Au){this.Au=!1;var t=this.$n,n=t?0:1;this.onTime(n,t,0),this.onEnd(t)}},n}(t.utils.EventEmitter),mb=function(t){function n(n){var i,r,e=this;(e=t.call(this,n)||this).ga=0,e.ma=0,e.wa=0,e.pa=0,e.Oa=null,e.es=null;var u=null==n?void 0:n.shift;return e.Da=null!==(i=null==u?void 0:u.x)&&void 0!==i?i:0,e.Ea=null!==(r=null==u?void 0:u.y)&&void 0!==r?r:15,e.ss=function(){e.onPrerender()},e.Ma=function(){e.onPostrender()},e}return B(n,t),n.prototype.stop=function(){this.pa=0,this.removeEventListeners(),t.prototype.stop.call(this)},n.prototype.addEventListeners=function(t){var n=rt.getLayer(t);if(n){this.es=n;var i=n.renderer;i.on("prerender",this.ss),i.on("postrender",this.Ma)}},n.prototype.removeEventListeners=function(){var t=this.es;if(t){this.es=null;var n=t.renderer;n.off("prerender",this.ss),n.off("postrender",this.Ma)}},n.prototype.onStart=function(n){var i=this.Oa=this.Jn;null!=i&&(this.pa=0,this.removeEventListeners(),this.addEventListeners(i),n||(i.visible=!0),t.prototype.onStart.call(this,n))},n.prototype.onTime=function(n,i,r){if(null!=this.Oa){var e=this.es;e?(this.pa=n,t.prototype.onTime.call(this,n,i,r),e.update()):(this.pa=n,t.prototype.onTime.call(this,n,i,r))}},n.prototype.onEnd=function(n){var i=this.Oa;null!=i&&(this.removeEventListeners(),n&&(i.visible=!1),t.prototype.onEnd.call(this,n))},n.prototype.onPrerender=function(){var t=this.Oa;if(null!=t){var n=this.pa,i=t.unsafe.position;this.ga=i.x,this.ma=i.y,i.set(i.x-this.Da*(1-n),i.y-this.Ea*(1-n)),this.wa=t.alpha,t.alpha=n}},n.prototype.onPostrender=function(){var t=this.Oa;null!=t&&(t.unsafe.position.set(this.ga,this.ma),t.alpha=this.wa)},n}(ur),wb=function(){function t(t){var n,i,r,e;mn(t)?(this.top=t,this.right=t,this.bottom=t,this.left=t):null!=t?(this.top=null!==(n=t.top)&&void 0!==n?n:6,this.right=null!==(i=t.right)&&void 0!==i?i:6,this.bottom=null!==(r=t.bottom)&&void 0!==r?r:6,this.left=null!==(e=t.left)&&void 0!==e?e:6):(this.top=6,this.right=6,this.bottom=6,this.left=6)}return t.prototype.getTheme=function(){throw new Error("Not supported")},t.prototype.setTheme=function(t){throw new Error("Not supported")},t.prototype.getTop=function(){return this.left},t.prototype.getRight=function(){return this.right},t.prototype.getBottom=function(){return this.bottom},t.prototype.getLeft=function(){return this.left},t.prototype.set=function(t,n,i,r){null==n?(this.top=t,this.right=t,this.bottom=t,this.left=t):null==i?(this.top=t,this.right=n,this.bottom=t,this.left=n):null==r?(this.top=t,this.right=n,this.bottom=i,this.left=n):(this.top=t,this.right=n,this.bottom=i,this.left=r)},t}(),pb=function(){function t(t){var n,i=t.root;this.Sa=i,this.cs=t.overlay,this.zn=new wb(null==t?void 0:t.padding);var r=100,e=100;if(t)if(null!=t.width)r=t.width,e=null!=t.height?t.height:i.getBoundingClientRect().height;else if(null!=t.height)r=i.getBoundingClientRect().width,e=t.height;else{var u;r=(u=i.getBoundingClientRect()).width,e=u.height}else r=(u=i.getBoundingClientRect()).width,e=u.height;var s=null==t?void 0:t.background,h=0,o=!0;if(null!=s){var a=s.color;null!=a&&(h=a,o=!1)}var c=t.resolution,f=null!==(n=null==t?void 0:t.antialias)&&void 0!==n&&n;this.Ta={width:r,height:e,autoStart:!1,backgroundColor:h,transparent:o,resolution:c,antialias:f}}return t.prototype.getRootElement=function(){return this.Sa},t.prototype.setRootElement=function(t,n){if(this.Sa!==t&&(this.Sa=t,!1!==n)){var i=t.getBoundingClientRect(),r=this.Ta;r.width=i.width,r.height=i.height}return this},t.prototype.getWidth=function(){return this.Ta.width},t.prototype.setWidth=function(t){return this.Ta.width=t,this},t.prototype.getHeight=function(){return this.Ta.height},t.prototype.setHeight=function(t){return this.Ta.height=t,this},t.prototype.getPadding=function(){return this.zn},t.prototype.setPadding=function(t,n,i,r){var e=this.zn;return e.left=t,e.top=n,e.right=i,e.bottom=r,this},t.prototype.getBackgroundColor=function(){return this.Ta.backgroundColor},t.prototype.setBackgroundColor=function(t){return this.Ta.backgroundColor=t,this},t.prototype.getAntialias=function(){return this.Ta.antialias},t.prototype.setAntialias=function(t){return this.Ta.antialias=t,this},t.prototype.isOverlay=function(){return this.cs},t.prototype.getPixiApplicationOptions=function(){return this.Ta},t}(),Ob=function(){function t(){}return t.prototype.isStorable=function(){return!0},t.prototype.isClear=function(){return!1},t.prototype.isClean=function(){return!1},t.prototype.execute=function(){return!0},t.prototype.merge=function(t){return!1},t.prototype.isMerged=function(){return!1},t.prototype.redo=function(){return!0},t.prototype.undo=function(){return!0},t.prototype.destroy=function(){},t}(),Db=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.isStorable=function(){return!1},n.prototype.isClear=function(){return!0},n}(Ob),Eb=function(t){function n(){var n=t.call(this)||this;return n._=0,n.ja=[],n}return B(n,t),n.prototype.last=function(){var t=this.ja,n=t.length;return 0<n?t[n-1]:null},n.prototype.push=function(t){this.merge(t),this.execute(t)},n.prototype.merge=function(t){var n=this.ja,i=t.isClear(),r=t.isStorable();if(i||r){var e=i?n.length:this._;0<e&&(this.remove(e),this._=0,this.emit("change",this)),this.cleanup()}var u=n.length;0<u&&t.merge(n[u-1])},n.prototype.execute=function(t){return this.emit("executing",t,this),t.execute()?this.onSuccess(t):this.onFail(t)},n.prototype.onSuccess=function(t){t.isStorable()&&(t.isMerged()||this.ja.push(t),t.isClean()||this.emit("dirty",this)),this.emit("change",this),this.emit("executed",t,this)},n.prototype.onFail=function(t){t.destroy(),this.emit("change",this)},n.prototype.cleanup=function(){var t=this.ja,n=t.length-100;if(0<n)for(var i=0;i<n;++i)t[i].destroy(),t.shift()},n.prototype.remove=function(t){var n=this.ja;if(0<t){var i=Math.max(0,n.length-t);if(0<(t=n.length-i)){for(var r=i,e=n.length;r<e;++r)n[r].destroy();return n.splice(i,n.length-i),!0}}return!1},n.prototype.size=function(){return this.ja.length},n.prototype.clear=function(){this.push(new Db)},n.prototype.redo=function(){this.isRedoable()&&this.doRedo()},n.prototype.doRedo=function(){var t=this.ja;if(0<this._){var n=t[t.length-this._];this._-=1,this.emit("change",this),this.emit("redoing",n,this),!0===n.redo()?this.onRedoSuccess(n):this.onRedoFail(n)}},n.prototype.onRedoSuccess=function(t){t.isClean()||this.emit("dirty",this),this.emit("change",this),this.emit("redoed",t,this)},n.prototype.onRedoFail=function(t){this.emit("change",this)},n.prototype.isRedoable=function(){return 0<this._},n.prototype.undo=function(){this.isUndoable()&&this.doUndo()},n.prototype.doUndo=function(){var t=this.ja;if(this._<t.length){var n=t[t.length-1-this._];this._+=1,this.emit("change",this),this.emit("undoing",n,this),!0===n.undo()?this.onUndoSuccess(n):this.onUndoFail(n)}},n.prototype.onUndoSuccess=function(t){t.isClean()||this.emit("dirty",this),this.emit("change",this),this.emit("undoed",t,this)},n.prototype.onUndoFail=function(t){this.emit("change",this)},n.prototype.isUndoable=function(){return this._<this.ja.length},n}(t.utils.EventEmitter),Mb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.init=function(t,n,i){var r=this;t.addEventListener("keydown",(function(t){r.emit("keydown",t);var e=i.get();if(null!=e)for(var u=e;null!=u;){if(r.hasOnKeyDown(u)&&u.onKeyDown(t))return;u=u.parent}if(Xi.isFocusKey(t)){var s=Xi.getFocusDirection(t),h=null!=e?i.find(e,!1,e.state.isFocusRoot||s,s):i.find(n,!1,!0,s);null!=h&&(i.focus(h),t.preventDefault(),t.stopImmediatePropagation())}})),t.addEventListener("keyup",(function(t){r.emit("keyup",t);var n=i.get();if(null!=n)for(var e=n;null!=e;){if(r.hasOnKeyUp(e)&&e.onKeyUp(t))return;e=e.parent}}))},n.prototype.hasOnKeyDown=function(t){return"onKeyDown"in t},n.prototype.hasOnKeyUp=function(t){return"onKeyUp"in t},n}(t.utils.EventEmitter),Sb=function(){function t(){}return t.getKeyboardController=function(){return null==this.KEYBOARD&&(this.KEYBOARD=new Mb),this.KEYBOARD},t.setKeyboardController=function(t){var n=this.KEYBOARD;return this.KEYBOARD=t,n},t.getCommandController=function(){return null==this.COMMAND&&(this.COMMAND=new Eb),this.COMMAND},t.setCommandController=function(t){var n=this.COMMAND;return this.COMMAND=t,n},t.getDocumentController=function(){if(null==this.DOCUMENT)throw new Error("Not supported");return this.DOCUMENT},t.setDocumentController=function(t){var n=this.DOCUMENT;return this.DOCUMENT=t,n},t}(),Tb=function(n){function i(t,i){var r=n.call(this,i.getPixiApplicationOptions())||this;return r.Na=null,r.Ia=null,r.kn=i,r.q=!1,r.Co=!0,r.Ca=i.isOverlay(),r.zn=i.getPadding(),r.Aa=i.getRootElement(),r.Ra=5,r.La=r.newElementContainer(),r.application=t,r.ya=function(){null!=r.Na&&r.render()},r.initStage(),r.initView(),r.initRootElement(),r.initFocusHandling(),r.initResizeHandling(),r.initWheelHandling(),r.initDoubleClickHandling(),r}return B(i,n),i.prototype.newElementContainer=function(){var t=document.createElement("div");return t.setAttribute("style","position: absolute; top: 0; left: 0; width: 0; height: 0;margin: 0; padding: 0; outline: none;"),t},i.prototype.initStage=function(){var t=this.stage;t.layer=this,t.application=this.application,t.interactive=!0},i.prototype.initView=function(){var t=this.view.style;t.position="absolute",t.top="0",t.left="0",t.width="100%",t.height="100%",t.display="block",t.outline="none",t.webkitTapHighlightColor="rgba(255,255,255,0)",t.webkitUserSelect="none",t.setProperty("-khtml-user-select","none"),t.setProperty("-moz-user-select","none"),t.setProperty("-ms-user-select","none"),t.userSelect="none"},i.prototype.initRootElement=function(){var t=this,n=this.view,i=this.Ca,r=this.Aa,e=this.La,u=i?2:0,s=r.children;if(u<s.length){var h=s[u];r.insertBefore(n,h),r.insertBefore(e,h)}else r.appendChild(n),r.appendChild(e);if(i){var o=this.stage,a=o.onChildrenChange;o.onChildrenChange=function(){t.onStageDirty(),a.call(o)}}var c=r.style;r!==document.body&&"static"===window.getComputedStyle(r).position&&(c.position="relative"),c.margin="0",c.padding="0",c.overflow="hidden"},i.prototype.initFocusHandling=function(){var t=this.view,n=this.stage,i=this.getFocusController();t.setAttribute("tabindex","0"),Sb.getKeyboardController().init(t,n,i),this.renderer.plugins.interaction.on(Ki.down,(function(t){null!=t.target&&t.target!==n||i.clear()}))},i.prototype.initResizeHandling=function(){var t=this,n=function(){t.onResize()};window.addEventListener("resize",n),window.addEventListener("orientationchange",n)},i.prototype.onResize=function(){var t=this.Aa.getBoundingClientRect(),n=t.width,i=t.height;this.renderer.resize(n,i);for(var r=this.zn,e=this.stage.children,u=0,s=e.length;u<s;++u){var h=e[u];h instanceof Qi&&h.onParentResize(n,i,r)}this.update()},i.prototype.initWheelHandling=function(){var n=new t.Point,i=db.getInstance(),r=this.renderer.plugins.interaction;i.on(this.view,(function(t){var e=t;Ki.toGlobal(e,r,n);var u,s=r.hitTest(n),h=i.normalize(t);if(null!=h)for(;null!=s;){if(null!=(u=s)&&null!=u.onWheel&&s.onWheel(e,h,n)){e.preventDefault();break}s=s.parent}}))},i.prototype.initDoubleClickHandling=function(){var t=this.getFocusController(),n=this.renderer.plugins.interaction;Ki.onDblClick(this.view,(function(i){var r,e=t.get();if(null!=e)for(var u=e;null!=u&&(null==(r=u)||null==r.onDblClick||!u.onDblClick(i,n));)u=u.parent}))},i.prototype.lock=function(){this.q=!0},i.prototype.unlock=function(){this.q=!1},i.prototype.update=function(){this.q||null!=this.Na||(this.Na=requestAnimationFrame(this.ya))},i.prototype.onStageDirty=function(){this.Ca&&(0<this.stage.children.length?this.Co||(this.Co=!0,this.view.style.display="block"):this.Co&&(this.Co=!1,this.view.style.display="none"))},i.prototype.render=function(){this.reflow(),this.Na=null,n.prototype.render.call(this)},Object.defineProperty(i.prototype,"width",{get:function(){return this.screen.width},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"height",{get:function(){return this.screen.height},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"padding",{get:function(){return this.zn},enumerable:!1,configurable:!0}),i.prototype.reflow=function(){for(var t=this.stage.children,n=0,i=this.Ra;n<i;++n){for(var r=!1,e=0,u=t.length;e<u;++e){var s=t[e];s instanceof Qi&&(s.reflow(),r=r||s.isDirty()||s.hasDirty()||s.isHierarchyDirty())}if(!r)break}},i.prototype.getFocusController=function(){return this.application.getFocusController()},i.prototype.getRootElement=function(){return this.Aa},i.prototype.getElementContainer=function(){return this.La},i.prototype.getDynamicFontAtlases=function(){return null==this.Ia&&(this.Ia=new Zv(this)),this.Ia},i}(t.Application),jb=function(){function t(){this.fs=null}return t.prototype.focus=function(t){var n=this.fs;return n!==t?(null!=n&&(n.state.isFocused=!1),this.fs=t,this.isFocusable(t)&&(t.state.isFocused=!0),n):null},t.prototype.blur=function(t){return null!=t&&this.fs===t?(this.fs=null,t.state.isFocused=!1,t):null},t.prototype.clear=function(){return this.focus(null)},t.prototype.set=function(t,n){return n?this.focus(t):this.blur(t)},t.prototype.get=function(){return this.fs},t.prototype.findParent=function(t){for(var n=t;null!=n;){if(this.isFocusable(n))return n;n=n.parent}return null},t.prototype.find=function(t,n,i,r,e){if(r){if(null!=(o=this.findNext(t,n,i)))return o;if(this.isFocusRoot(t,e))return null;var u=t.parent;if(null!=u&&0<=(c=(a=u.children).indexOf(t))){var s=a.length;if(this.isFocusReverse(u)){for(var h=c-1;0<=h;--h)if(null!=(l=this.findNext(a[h],!0,!0)))return l;if(!this.isFocusRoot(u,e)&&null!=(l=this.find(u,!1,!1,!0,e)))return l;for(h=s-1;c<=h;--h)if(null!=(l=this.findNext(a[h],!0,!0)))return l}else{for(h=c+1;h<s;++h)if(null!=(l=this.findNext(a[h],!0,!0)))return l;if(!this.isFocusRoot(u,e)&&null!=(l=this.find(u,!1,!1,!0,e)))return l;for(h=0;h<=c;++h)if(null!=(l=this.findNext(a[h],!0,!0)))return l}}}else{var o;if(null!=(o=this.findPrevious(t,n,i)))return o;var a,c,f=t.parent;if(null!=f&&0<=(c=(a=f.children).indexOf(t)))if(s=a.length,this.isFocusReverse(f)){for(h=c+1;h<s;++h)if(null!=(l=this.findPrevious(a[h],!0,!0)))return l;if(!this.isFocusRoot(f,e)&&null!=(l=this.find(f,!0,!1,!1,e)))return l;for(h=0;h<=c;++h)if(null!=(l=this.findPrevious(a[h],!0,!0)))return l}else{for(h=c-1;0<=h;--h)if(null!=(l=this.findPrevious(a[h],!0,!0)))return l;if(!this.isFocusRoot(f,e)&&null!=(l=this.find(f,!0,!1,!1,e)))return l;for(h=s-1;c<=h;--h){var l;if(null!=(l=this.findPrevious(a[h],!0,!0)))return l}}}return null},t.prototype.findNext=function(t,n,i){if(n&&this.isFocusable(t))return t;if(i&&this.isFocusableContainer(t)&&t.visible){var r=t.children,e=r.length;if(this.isFocusReverse(t)){for(var u=e-1;0<=u;--u)if(null!=(s=this.findNext(r[u],!0,!0)))return s}else for(u=0;u<e;++u){var s;if(null!=(s=this.findNext(r[u],!0,!0)))return s}}return null},t.prototype.findPrevious=function(t,n,i){if(i&&this.isFocusableContainer(t)&&t.visible){var r=t.children,e=r.length;if(this.isFocusReverse(t)){for(var u=0;u<e;++u)if(null!=(s=this.findPrevious(r[u],!0,!0)))return s}else for(u=e-1;0<=u;--u){var s;if(null!=(s=this.findPrevious(r[u],!0,!0)))return s}}return n&&this.isFocusable(t)?t:null},t.prototype.isFocusable=function(t){return null!=t&&"state"in t&&t.state.inEnabled&&t.state.isFocusable&&t.visible},t.prototype.isFocusableContainer=function(t){return null!=t&&"children"in t},t.prototype.isFocusRoot=function(t,n){return t===n||null!=t&&"state"in t&&t.state.isFocusRoot&&t.visible},t.prototype.isFocusReverse=function(t){return null!=t&&"state"in t&&t.state.isFocusReverse},t}(),Nb=function(){function n(n){var i,r;rt.add(this);var e=this.toRootElement(n);this.Sa=e,this.initFocusHandling(e);var u=null!==(r=null!==(i=null==n?void 0:n.resolution)&&void 0!==i?i:window.devicePixelRatio)&&void 0!==r?r:1;this.bn=u,delete t.Renderer.__plugins.accessibility,this.kn=n;var s=this.newLayerBase(n);this.Ir=s,this.ka=!!(null==n?void 0:n.overlay),this.ka||(this.cs=s)}return Object.defineProperty(n.prototype,"stage",{get:function(){return this.Ir.stage},enumerable:!1,configurable:!0}),n.prototype.getRootElement=function(){return this.Sa},n.prototype.getResolution=function(){return this.bn},n.prototype.toRootElement=function(t){var n=null==t?void 0:t.root;if(null!=n){if(!at(n))return n;var i=document.querySelector(n);if(i)return i}return document.body},n.prototype.toLayerBaseOptions=function(t){var n=this.Sa,i=this.bn;return new pb(t?{root:n,padding:t.padding,width:t.width,height:t.height,background:t.background,resolution:i,antialias:t.antialias,overlay:!1}:{root:n,resolution:i,overlay:!1})},n.prototype.getFocusController=function(){return null==this.xa&&(this.xa=new jb),this.xa},n.prototype.initFocusHandling=function(t){var n=this,i=!1,r=function(){i||n.getFocusController().clear()};t.addEventListener("focus",(function(){i=!0}),!0),t.addEventListener("blur",(function(){i=!1,setTimeout(r,0)}),!0)},n.prototype.newLayerBase=function(t){return new Tb(this,this.toLayerBaseOptions(t))},n.prototype.getLayerBase=function(){return this.Ir},n.prototype.toLayerOverlayOptions=function(t){var n=this.Sa,i=this.bn;return new pb(t?{root:n,padding:t.padding,width:t.width,height:t.height,background:{color:null},resolution:i,antialias:t.antialias,overlay:!0}:{root:n,resolution:i,overlay:!0})},n.prototype.newLayerOverlay=function(t){return new Tb(this,this.toLayerOverlayOptions(t))},n.prototype.getLayerOverlay=function(){return this.ka?(null==this.cs&&(this.cs=this.newLayerOverlay(this.kn)),this.cs):this.Ir},n.prototype.update=function(){if(!this.ka)return this.Ir.update();this.Ir.update();var t=this.cs;t&&t.update()},n.prototype.render=function(){if(!this.ka)return this.Ir.render();this.Ir.render();var t=this.cs;t&&t.render()},n}(),Ib=function(){function t(t){this.Jn=t,this.un=0,this.sn=0,this.hn=0,this.en=0,t instanceof Ni&&(this.tn=t.getCallback())}return t.prototype.getTheme=function(){return this.Jn.getTheme()},t.prototype.setTheme=function(t){this.Jn.setTheme(t)},t.prototype.getLeft=function(){return this.Jn.getLeft()+this.en},t.prototype.adjLeft=function(t){if(this.en!==t){this.en=t;var n=this.tn;n&&n()}},Object.defineProperty(t.prototype,"left",{get:function(){return this.Jn.left},set:function(t){this.Jn.left=t},enumerable:!1,configurable:!0}),t.prototype.getTop=function(){return this.Jn.getTop()+this.un},t.prototype.adjTop=function(t){if(this.un!==t){this.un=t;var n=this.tn;n&&n()}},Object.defineProperty(t.prototype,"top",{get:function(){return this.Jn.top},set:function(t){this.Jn.top=t},enumerable:!1,configurable:!0}),t.prototype.getRight=function(){return this.Jn.getRight()+this.sn},t.prototype.adjRight=function(t){if(this.sn!==t){this.sn=t;var n=this.tn;n&&n()}},Object.defineProperty(t.prototype,"right",{get:function(){return this.Jn.right},set:function(t){this.Jn.right=t},enumerable:!1,configurable:!0}),t.prototype.getBottom=function(){return this.Jn.getBottom()+this.hn},t.prototype.adjBottom=function(t){if(this.hn!==t){this.hn=t;var n=this.tn;n&&n()}},Object.defineProperty(t.prototype,"bottom",{get:function(){return this.Jn.bottom},set:function(t){this.Jn.bottom=t},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n,i,r){var e=this.Jn;null==n?e.set(t):null==i?e.set(t,n):null==r?e.set(t,n,i):e.set(t,n,i,r)},t}(),Cb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DBoard"},n}(Qi),Ab=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DButtonCheck"},n}(ds),Rb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DButtonCheckRight"},n}(Ab),Lb=function(){function t(t,n,i,r,e){this.S=t,this.T=n,this._=i,this.tn=e,this.Ba=r}return t.prototype.set=function(t,n,i,r){this.S===t&&this.T===n&&this._===i&&this.Ba===r||(this.S=t,this.T=n,this._=i,this.Ba=r,this.tn(this))},Object.defineProperty(t.prototype,"color",{get:function(){return this.S},set:function(t){this.S!==t&&(this.S=t,this.tn(this))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return this.T},set:function(t){this.T!==t&&(this.T=t,this.tn(this))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"position",{get:function(){return this._},set:function(t){this._!==t&&(this._=t,this.tn(this))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selected",{get:function(){return this.Ba},set:function(t){this.Ba!==t&&(this.Ba=t,this.tn(this))},enumerable:!1,configurable:!0}),t.prototype.toObject=function(){return{color:this.S,alpha:this.T,position:this._}},t}(),yb=function(t,n){return t.position-n.position},kb=function(n){function i(){var t=n.call(this)||this,i=function(n){t.onChange(n)};t.Pa=i;var r=new Lb(16777215,1,0,!1,i),e=new Lb(8421504,1,1,!0,i);return t.gt=[r,e],t.Yt=-90,t.Ba=e,t.Ua=[0,0,0],t}return B(i,n),i.prototype.onChange=function(t){var n=t.selected&&this.Ba!==t;if(n){var i=this.Ba;null!=i&&(i.Ba=!1),this.Ba=t}this.gt.sort(yb),n&&this.emit("selectionchange",this.Ba,this),this.emit("change",this)},Object.defineProperty(i.prototype,"points",{get:function(){return this.gt},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"direction",{get:function(){return this.Yt},set:function(t){this.Yt!==t&&(this.Yt=t,this.emit("directionchange",t,this),this.emit("change",this))},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"selected",{get:function(){return this.Ba},enumerable:!1,configurable:!0}),i.prototype.size=function(){return this.gt.length},i.prototype.get=function(t){var n=this.gt;return 0<=t&&t<n.length?n[t]:null},i.prototype.addAt=function(n){for(var i=this.gt,r=null,e=0,u=i.length;e<u;++e){var s=i[e];if(n<=s.position){if(null==r)return this.add(s.color,s.alpha,n,!0);var h=s.position-r.position;if(.001<h){var o=t.utils.hex2rgb(s.color,this.Ua),a=o[0],c=o[1],f=o[2],l=t.utils.hex2rgb(r.color,this.Ua),v=l[0],b=l[1],d=l[2],g=(n-r.position)/h,m=a*g+v*(1-g),w=c*g+b*(1-g),p=f*g+d*(1-g),O=this.Ua;O[0]=m,O[1]=w,O[2]=p;var D=t.utils.rgb2hex(O),E=s.alpha*g+r.alpha*(1-g);return this.add(D,E,n,!0)}}r=s}return null!=r?this.add(r.color,r.alpha,n,!0):this.add(16777215,1,n,!0)},i.prototype.add=function(t,n,i,r){var e=this.Pa,u=new Lb(t,n,i,r,e);return this.gt.push(u),e(u),u},i.prototype.remove=function(t){var n=this.gt;if(2<n.length)for(var i=0,r=n.length;i<r;++i)if(n[i]===t){n.splice(i,1);var e=this.Ba===t;return e&&(this.Ba=i+1<r?n[i]:n[i-1]),e&&this.emit("selectionchange",this.Ba,this),this.emit("change",this),!0}return!1},i.prototype.reset=function(){var t=this.Yt;this.Yt=-90;var n=this.gt,i=this.Ba,r=i?n.indexOf(i):-1;n.length=0;var e=this.Pa;if(n.push(new Lb(16777215,0,0,!1,e)),n.push(new Lb(16777215,0,1,!1,e)),0<=r&&r<n.length)(u=n[r]).Ba=!0,this.Ba=u;else if(0<n.length){var u;(u=n[n.length-1]).Ba=!0,this.Ba=u}else this.Ba=null;return i!==this.Ba&&this.emit("selectionchange",this.Ba,this),t!==this.Yt&&this.emit("directionchange",this.Yt,this),this.emit("change",this),this},i.prototype.toObject=function(){for(var t=[],n=this.gt,i=0,r=n.length;i<r;++i)t.push(n[i].toObject());return{points:t,direction:this.Yt}},i.prototype.fromObject=function(t){var n=this.Yt;this.Yt=t.direction;var i=this.gt,r=this.Ba,e=r?i.indexOf(r):-1;i.length=0;for(var u=this.Pa,s=0,h=t.points.length;s<h;++s){var o=t.points[s],a=new Lb(o.color,o.alpha,o.position,!1,u);i.push(a)}return i.sort(yb),0<=e&&e<i.length?((a=i[e]).Ba=!0,this.Ba=a):0<i.length?((a=i[i.length-1]).Ba=!0,this.Ba=a):this.Ba=null,r!==this.Ba&&this.emit("selectionchange",this.Ba,this),n!==this.Yt&&this.emit("directionchange",this.Yt,this),this.emit("change",this),this},i}(t.utils.EventEmitter),xb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DInputLabel"},n}(qs),Bb=function(t){function n(n){var i=t.call(this,n)||this;i.addChild(i.Rh=new xb(null==n?void 0:n.label)),i.addChild(i.lh=i.createInput(null==n?void 0:n.input));var r=null==n?void 0:n.space;return null!=r&&i.addChild(new _u(r)),i}return B(n,t),Object.defineProperty(n.prototype,"input",{get:function(){return this.lh},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"label",{get:function(){return this.Rh},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DInputAndLabel"},n}(ws),_b=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.createInput=function(t){return new Fs(t)},n}(Bb),Pb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.createInput=function(t){return new zs(t)},n}(Bb),Ub=function(){function t(t,n,i){this.Fa=t,this.Ga=n,this.Ha=i}return Object.defineProperty(t.prototype,"color",{get:function(){return this.Fa.color},set:function(t){if(this.Fa.color!==t){var n=this.Ga;null!=n&&n(t)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return this.Fa.alpha},set:function(t){if(this.Fa.alpha!==t){var n=this.Ha;null!=n&&n(t)}},enumerable:!1,configurable:!0}),t}(),Fb=function(t){function n(n,i){var r=t.call(this)||this;return r.za=n,r.yt=i,r}return B(n,t),n.prototype.get=function(t){var n=this.za;return 0<=t&&t<n.length?n[n.length-1-t]:null},n.prototype.set=function(t,n){var i=this.za;if(0<=t&&t<i.length){var r=i[i.length-1-t];return i[i.length-1-t]={color:n.color,alpha:n.alpha},this.emit("change",this),r}return null},n.prototype.contains=function(t){for(var n=this.za,i=0,r=n.length;i<r;++i){var e=n[i];if(e.color===t.color&&e.alpha===t.alpha)return!0}return!1},n.prototype.add=function(t){var n=this.za;return n.push({color:t.color,alpha:t.alpha}),this.yt<n.length&&n.shift(),this.emit("change",this),this},n.prototype.pop=function(){var t=this.za.shift();return null!=t?(this.emit("change",this),t):null},n.prototype.size=function(){return this.za.length},n}(t.utils.EventEmitter),Gb=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return B(i,n),Object.defineProperty(i.prototype,"current",{get:function(){return this.Va},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"new",{get:function(){return this.Wa},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"recent",{get:function(){return this.Xa},enumerable:!1,configurable:!0}),i.prototype.init=function(r){var e=this;n.prototype.init.call(this,r),this.Ir=16711680,this.Ka={color:16777215,alpha:1},this.Wa=new Ub(this.Ka,(function(t){e.setColorNew(t)}),(function(t){e.setAlphaNew(t)})),this.tu={color:16777215,alpha:1},this.Va=new Ub(this.tu,(function(t){e.setColorCurrent(t)}),(function(t){e.setAlphaCurrent(t)}));var u=this.theme,s=this.zn,h=s.getTop(),o=s.getRight(),a=s.getBottom(),c=s.getLeft();this.Ya=new t.Point;var f=u.getMainWidth(),l=u.getMainHeight(),v=new t.Sprite(t.Texture.WHITE);this.Ja=v,v.x=c,v.y=h,v.width=f,v.height=l,v.interactive=!0,this.addChild(v);var b=new t.Sprite(u.getMainTexture());this.Za=b,b.x=c,b.y=h,b.tint=this.Ir,b.interactive=!1,this.addChild(b),this.qa=function(t){e.onMainMove(t)},this.Qa=function(t){e.onMainUp(t)},v.on(Ki.down,(function(t){e.onMainDown(t)}));var d=new t.Sprite(u.getBaseTexture());this.$a=d,d.x=c,d.y=v.y+v.height+u.getBaseMargin(),d.interactive=!0,this.addChild(d),this.tc=function(t){e.onBaseMove(t)},this.nc=function(t){e.onBaseUp(t)},d.on(Ki.down,(function(t){e.onBaseDown(t)}));var g=new t.Sprite(u.getAlphaCheckerboardTexture());this.ic=g,g.x=s.getLeft(),g.y=d.y+u.getBaseHeight()+u.getBaseMargin(),g.interactive=!1,this.addChild(g);var m=new t.Sprite(u.getAlphaTexture());m.tint=this.Ka.color,m.interactive=!0,g.addChild(m),this.rc=function(t){e.onAlphaMove(t)},this.ec=function(t){e.onAlphaUp(t)},m.on(Ki.down,(function(t){e.onAlphaDown(t)}));var w=new t.Sprite(u.getMainPointerTexture());this.uc=w,w.x=c,w.y=h,w.anchor.x=.5,w.anchor.y=.5,w.tint=u.getMainPointerColor(),w.alpha=u.getMainPointerAlpha(),w.interactive=!1,this.addChild(w);var p=new t.Sprite(u.getAlphaPointerTexture());this.sc=p,p.x=f,p.y=.5*g.height,p.tint=u.getAlphaPointerColor(),p.alpha=u.getAlphaPointerAlpha(),p.anchor.set(.5,.5),p.interactive=!1,g.addChild(p);var O=new t.Sprite(u.getBasePointerTexture());this.hc=O,O.x=0,O.y=.5*d.height,O.tint=u.getBasePointerColor(),O.alpha=u.getBasePointerAlpha(),O.anchor.set(.5,.5),O.interactive=!1,d.addChild(O),this.oc=[];var D=this.oc,E=u.getRecentColorCount(),M=u.getRecentColorWidth(),S=u.getRecentColorHeight(),T=.5*M,j=.5*S,N=u.getRecentColorMargin(),I=g.y+u.getAlphaHeight()+u.getRecentMargin(),C=u.getRecentCheckerboardTexture();null==i.RECENT_COLORS&&(i.RECENT_COLORS=new Fb(u.getRecents().slice(0),E));var A=this.Xa=i.RECENT_COLORS;A.on("change",(function(){e.onRecentChange()}));for(var R=function(n){var i=n.currentTarget;if(i instanceof t.Container){var r=i.children[0];r instanceof t.Sprite&&(e.setColorNew(r.tint),e.setAlphaNew(r.alpha))}},L=0;L<E;++L){var y=c+L*(M+N),k=new t.Sprite(C);k.x=y+T,k.y=I+j,k.anchor.x=.5,k.anchor.y=.5,k.buttonMode=!0,k.interactive=!0,k.on(Ki.tap,R),this.addChild(k);var x=new t.Sprite(t.Texture.WHITE),B=A.get(L);null!=B?(x.tint=B.color,x.alpha=B.alpha):(x.tint=16777215,x.alpha=0),x.width=M,x.height=S,x.anchor.x=.5,x.anchor.y=.5,x.interactive=!1,k.addChild(x),D.push(x)}var _=u.getInputMargin(),P=u.getInputLabelWidth(),U=I+S+_,F=.5*(f-_),G=new Pb({parent:this,x:c,y:U,width:F,label:{width:P,text:{value:"#"},interactive:Ti.NONE},input:{weight:1,text:{value:"FFFFFF"},on:{input:function(t){var n=Qt.fromCode(t);null!=n&&e.setColorNew(n)}}}});this.ac=G;var H=G.height,z=new _b({parent:this,x:c,y:U+H+_,width:F,label:{width:P,text:{value:"A"},interactive:Ti.NONE},input:{weight:1,text:{value:1},min:0,max:1,on:{input:function(t){e.setAlphaNew(t)}}}});this.cc=z;var V=.5*(F-P-_),W=H+_+H,X=c+.5*(f-_)+_,K=U+.5*(H+_+z.height-W),Y=new t.Sprite(u.getSampleCheckerboardTexture());this.fc=Y,Y.x=X,Y.y=K,Y.width=V,Y.height=W,Y.interactive=!1,this.addChild(Y);var J=this.tu,Z=new t.Sprite(t.Texture.WHITE);this.lc=Z,Z.x=X,Z.y=K,Z.tint=J.color,Z.alpha=J.alpha,Z.width=V,Z.height=W,Z.interactive=!0,Z.buttonMode=!0,Z.on(Ki.tap,(function(){e.setColorNew(J.color),e.setAlphaNew(J.alpha)})),this.addChild(Z);var q=new t.Sprite(u.getSampleCheckerboardTexture());this.vc=q,q.x=X+V,q.y=K,q.width=V,q.height=W,q.interactive=!1,this.addChild(q);var Q=new t.Sprite(t.Texture.WHITE);this.bc=Q,Q.x=X+V,Q.y=K,Q.tint=this.Ka.color,Q.alpha=this.Ka.alpha,Q.width=V,Q.height=W,Q.interactive=!1,this.addChild(Q),null!=r&&null!=r.width||(this.width=c+f+o),null!=r&&null!=r.height||(this.height=U+G.height+_+z.height+a)},i.prototype.onMainDown=function(t){this.onMainPick(t.data.global);var n=rt.getLayer(this);if(n){var i=n.stage;i.on(Ki.move,this.qa),i.on(Ki.up,this.Qa)}},i.prototype.onMainMove=function(t){this.onMainPick(t.data.global)},i.prototype.onMainUp=function(t){var n=rt.getLayer(this);if(n){var i=n.stage;i.off(Ki.move,this.qa),i.off(Ki.up,this.Qa)}},i.prototype.toMainHex=function(t,n,i,r){return Math.max(0,Math.min(255,255*n+i*(t>>r&255)))<<r},i.prototype.toMainColor=function(t,n,i,r,e){var u=.5*r,s=Math.max(0,Math.min(1,((n-u)*(1-i/e)+u)/r)),h=Math.max(0,Math.min(1,i/e)),o=Math.abs(.5*h-s),a=1-o-h;return this.toMainHex(t,a,o,16)|this.toMainHex(t,a,o,8)|this.toMainHex(t,a,o,0)},i.prototype.onMainPick=function(t){var n=this.Ya,i=this.zn,r=i.getLeft(),e=i.getTop(),u=this.theme,s=u.getMainWidth(),h=u.getMainHeight();this.toLocal(t,void 0,n);var o=Math.max(0,Math.min(s,n.x-r)),a=Math.max(0,Math.min(h,n.y-e));this.uc.position.set(r+o,e+a),this.onColorNew(this.toMainColor(this.Ir,o,a,s,h))},i.prototype.setColorCurrent=function(t){this.lc.tint=this.tu.color=t},i.prototype.setAlphaCurrent=function(t){this.lc.alpha=this.tu.alpha=t},i.prototype.setColorNew=function(t){var n=this.theme,i=n.getMainWidth(),r=n.getMainHeight(),e=this.zn,u=ab.fromRgb(t);this.Za.tint=this.Ir=ab.toRgb(u[0],255,255),this.hc.x=Math.max(0,Math.min(1,u[0]/360))*i;var s=Math.max(0,Math.min(1,u[1]/255)),h=Math.max(0,Math.min(1,1-u[2]/255)),o=this.uc;o.tint=h<.45?n.getMainPointerColor():16777215,o.position.set(e.getLeft()+s*i,e.getTop()+h*r),this.onColorNew(t)},i.prototype.onColorNew=function(t){var n=rt.getLayer(this);n&&n.lock(),this.bc.tint=this.Ka.color=t,this.ac.input.value=Qt.toCode(t),this.emit("newcolorchange",t,this),n&&(n.unlock(),n.update())},i.prototype.onBaseDown=function(t){this.onBasePick(t.data.global);var n=rt.getLayer(this);if(n){var i=n.stage;i.on(Ki.move,this.tc),i.on(Ki.up,this.nc)}},i.prototype.onBaseMove=function(t){this.onBasePick(t.data.global)},i.prototype.onBaseUp=function(t){var n=rt.getLayer(this);if(n){var i=n.stage;i.off(Ki.move,this.tc),i.off(Ki.up,this.nc)}},i.prototype.toBaseHex=function(t,n){return Math.max(0,Math.min(255,6*t*255))<<n},i.prototype.toBaseColor=function(t){return t<=.167?16711680+this.toBaseHex(t,8):t<=.333?(t=.333-t,65280+this.toBaseHex(t,16)):t<=.5?(t-=.333,65280+this.toBaseHex(t,0)):t<.667?(t=.667-t,255+this.toBaseHex(t,8)):t<.883?(t-=.667,255+this.toBaseHex(t,16)):(t=.883-t,16711680+this.toBaseHex(t,0))},i.prototype.onBasePick=function(t){var n=this.Ya,i=this.zn,r=this.theme.getMainWidth();this.toLocal(t,void 0,n);var e=Math.max(0,Math.min(r,n.x-i.getLeft()));this.hc.x=e,this.onColorBase(this.toBaseColor(e/r))},i.prototype.setColorBase=function(t){var n=this.theme.getMainWidth();this.hc.x=Math.max(0,Math.min(1,t/360))*n,this.onColorBase(ab.toRgb(t,255,255))},i.prototype.onColorBase=function(t){this.Za.tint=this.Ir=t;var n=this.uc,i=this.theme,r=i.getMainWidth(),e=i.getMainHeight(),u=this.zn;this.onColorNew(this.toMainColor(this.Ir,n.x-u.getLeft(),n.y-u.getTop(),r,e))},i.prototype.onAlphaDown=function(t){this.onAlphaPick(t.data.global);var n=rt.getLayer(this);if(n){var i=n.stage;i.on(Ki.move,this.rc),i.on(Ki.up,this.ec)}},i.prototype.onAlphaMove=function(t){this.onAlphaPick(t.data.global)},i.prototype.onAlphaUp=function(t){var n=rt.getLayer(this);if(n){var i=n.stage;i.off(Ki.move,this.rc),i.off(Ki.up,this.ec)}},i.prototype.onAlphaPick=function(t){var n=this.Ya,i=this.zn,r=this.theme.getMainWidth();this.toLocal(t,void 0,n);var e=Math.max(0,Math.min(r,n.x-i.getLeft()));this.sc.x=e,this.onAlphaNew(e/r)},i.prototype.setAlphaNew=function(t){var n=this.theme.getMainWidth();this.sc.x=Math.max(0,Math.min(1,t))*n,this.onAlphaNew(t)},i.prototype.onAlphaNew=function(t){var n=rt.getLayer(this);n&&n.lock(),this.bc.alpha=this.Ka.alpha=t,this.cc.input.value=Number(t.toFixed(2)),this.emit("newalphachange",t,this),n&&(n.unlock(),n.update())},i.prototype.onRecentChange=function(){for(var t=this.oc,n=this.Xa,i=0,r=t.length;i<r;++i){var e=t[i],u=n.get(i);null!=u?(e.tint=u.color,e.alpha=u.alpha):(e.tint=16777215,e.alpha=0)}},i.prototype.getType=function(){return"DPickerColor"},i.RECENT_COLORS=null,i}(Qi),Hb=function(t,n){if(t.direction!==n.direction)return!1;var i=t.points,r=n.points;if(i.length!==r.length)return!1;for(var e=0,u=i.length;e<u;++e){var s=i[e],h=r[e];if(s.color!==h.color||s.alpha!==h.alpha||s.position!==h.position)return!1}return!0},zb=function(t){function n(n,i){var r=t.call(this)||this;return r.za=n,r.yt=i,r}return B(n,t),n.prototype.getCapacity=function(){return this.yt},n.prototype.get=function(t){var n=this.za;return 0<=t&&t<n.length?n[n.length-1-t]:null},n.prototype.set=function(t,n){var i=this.za;if(0<=t&&t<i.length){var r=i[i.length-1-t];return i[i.length-1-t]=n,this.emit("change",this),r}return null},n.prototype.contains=function(t){for(var n=this.za,i=0,r=n.length;i<r;++i)if(Hb(n[i],t))return!0;return!1},n.prototype.add=function(t){var n=this.za;return n.push(t),this.yt<n.length&&n.shift(),this.emit("change",this),this},n.prototype.pop=function(){var t=this.za.shift();return null!=t?(this.emit("change",this),t):null},n.prototype.size=function(){return this.za.length},n}(t.utils.EventEmitter),Vb=function(n){function i(i,r,e,u,s,h,o,a){var c=n.call(this,o,a)||this;return c.interactive=!0,c.interactiveChildren=!1,c.cursor="pointer",c.dc=i,c.gn=r,c._uvs=e,c.gc=u,c.pn=s,c.mc=-1,c.Ua=[0,0,0],c.wc=new t.Point,c.Oc=h,a.uniforms.uSampler.on("update",(function(){c.update(),rt.update(c)})),c.update(),c}return B(i,n),i.prototype.getRectangle=function(t){var n=this.Oc;return 0<=t&&t<n.length?n[t].rect:null},i.prototype.setRectangle=function(t,n,i,r,e){var u=this.Oc;if(0<=t&&t<u.length){var s=u[t].rect;s.x=n,s.y=i,s.width=r,s.height=e}},i.prototype.getData=function(t){var n=this.Oc;return 0<=t&&t<n.length?n[t].data:null},i.prototype.setData=function(t,n){var i=this.Oc;0<=t&&t<i.length&&(i[t].data=n)},i.prototype.getLastHitIndex=function(){return this.mc},i.prototype.setColors=function(t,n,i,r){n[t+0]=i[0],n[t+1]=i[1],n[t+2]=i[2],n[t+3]=r,n[t+4]=i[0],n[t+5]=i[1],n[t+6]=i[2],n[t+7]=r},i.prototype.setColorsHex=function(n,i,r,e){var u=t.utils.hex2rgb(r,this.Ua);this.setColors(n,i,u,e)},i.prototype.setColorsWhite=function(t,n){var i=this.Ua;i[0]=1,i[1]=1,i[2]=1,this.setColors(t,n,i,0)},i.prototype.setColorsPoint=function(t,n,i,r){var e=n.points[i];null!=e?this.setColorsHex(t,r,e.color,e.alpha):this.setColorsWhite(t,r)},i.prototype.setVertices=function(t,n,i,r){var e=r.y+r.height*i;n[t+0]=r.x,n[t+1]=e,n[t+2]=r.x+r.width,n[t+3]=e},i.prototype.setUvs=function(t,n,i,r){var e=r.x0+(r.x3-r.x0)*i,u=r.y0+(r.y3-r.y0)*i,s=r.x1+(r.x2-r.x1)*i,h=r.y1+(r.y2-r.y1)*i;n[t+0]=e,n[t+1]=u,n[t+2]=s,n[t+3]=h},i.prototype.newIndices=function(t,n,i,r){for(var e=0;e<i;++e)r[t+0]=n+0,r[t+1]=n+1,r[t+2]=n+2,r[t+3]=n+2,r[t+4]=n+1,r[t+5]=n+3,t+=6,n+=2;return r},i.prototype._calculateBounds=function(){var t=this.transform.worldTransform,n=this.Oc[0].rect,i=this._bounds,r=this.wc;r.set(n.x,n.y),t.apply(r,r),i.addPoint(r),r.set(n.x+n.width,n.y+n.height),t.apply(r,r),i.addPoint(r)},i.prototype.update=function(){var t=this.gn,n=this._uvs,i=this.gc,r=this.pn,e=this.shader.uniforms.uSampler;null==e._uvs&&e.updateUvs();for(var u=e._uvs,s=0,h=0,o=0,a=0,c=this.Oc,f=0,l=c.length;f<l;++f){var v=c[f].data,b=c[f].rect;if(null==v)this.setVertices(s,t,0,b),this.setUvs(s,n,0,u),this.setColorsWhite(o,i),this.setVertices(s+4,t,1,b),this.setUvs(s,n,1,u),this.setColorsWhite(o+8,i),this.newIndices(a,h,1,r),s+=8,o+=16,h+=4,a+=6;else{this.setVertices(s,t,0,b),this.setUvs(s,n,0,u),this.setColorsPoint(o,v,0,i),s+=4,o+=8;for(var d=v.points.length,g=0,m=Math.min(d,this.dc);g<m;++g){var w=v.points[g];this.setVertices(s,t,w.position,b),this.setUvs(s,n,w.position,u),this.setColorsHex(o,i,w.color,w.alpha),s+=4,o+=8}this.setVertices(s,t,1,b),this.setUvs(s,n,1,u),this.setColorsPoint(o,v,d-1,i),s+=4,o+=8,this.newIndices(a,h,d+1,r),a+=6*(d+1),h+=2*(d+2)}}this.size=a;var p=this.geometry;p.getBuffer("aPosition").update(),p.getBuffer("aUv").update(),p.getBuffer("aColor").update(),p.getIndex().update()},i.prototype.containsPoint=function(t){for(var n=this.toLocal(t,void 0,this.wc),i=this.Oc,r=0,e=i.length;r<e;++r)if(i[r].rect.contains(n.x,n.y))return this.mc=r,!0;return!1},i.from=function(n,r,e,u){void 0===u&&(u=t.Texture.WHITE);for(var s=new Float32Array(n*(r+2)*2*2),h=new Float32Array(n*(r+2)*2*2),o=new Float32Array(n*(r+2)*2*4),a=new Uint16Array(n*(r+1)*6),c=[],f=0;f<n;++f)c.push({data:null,rect:new t.Rectangle});return new i(r,s,h,o,a,c,(new t.Geometry).addIndex(new t.Buffer(a,!1,!0)).addAttribute("aPosition",new t.Buffer(s,!1,!1),2).addAttribute("aUv",new t.Buffer(h,!1,!1),2).addAttribute("aColor",new t.Buffer(o,!1,!1),4),t.Shader.from("\nattribute vec2 aPosition;\nattribute vec2 aUv;\nattribute vec4 aColor;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\n\nvarying vec2 vUv;\nvarying vec4 vColor;\n\nvoid main(void) {\n\tvec3 position = vec3(aPosition.x, aPosition.y, 1.0);\n\tgl_Position = vec4((projectionMatrix * translationMatrix * position).xy, 0.0, 1.0);\n\tvUv = aUv;\n\tvColor = aColor;\n}\n","\nvarying vec2 vUv;\nvarying vec4 vColor;\n\nuniform sampler2D uSampler;\nuniform vec2 uCheckerColors;\n\nvoid main(void) {\n\tvec4 texture = texture2D(uSampler, vUv);\n\tfloat cy = step( 1.0, mod( gl_FragCoord.y / 10.0, 2.0 ) );\n\tfloat cx = step( 1.0, mod( gl_FragCoord.x / 10.0 + cy, 2.0 ) );\n\tfloat c = mix( uCheckerColors.x, uCheckerColors.y, cx );\n\tgl_FragColor = texture * vec4( mix( vec3( c ), vColor.xyz, vColor.a ), 1.0 );\n}",{uSampler:u,uCheckerColors:e}))},i}(t.Mesh),Wb=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return B(i,n),i.prototype.init=function(r){var e=this;n.prototype.init.call(this,r);var u=this.theme,s=this.zn,h=s.getTop(),o=s.getRight(),a=s.getBottom(),c=s.getLeft();this.bu=new t.Point;var f=u.getGradientPointsWidth(),l=u.getGradientPointsMargin(),v=new Gb({x:c+f+l,y:h});this.Lh=v,v.on("newcolorchange",(function(t){e.onAnchorColorChange(t)})),v.on("newalphachange",(function(t){e.onAnchorAlphaChange(t)})),this.addChild(v);var b=this.rr=Vb.from(17,10,u.getGradientCheckerColors());b.setRectangle(0,c,h,f,v.height),this.addChild(b),b.on(Ki.down,(function(t){0===b.getLastHitIndex()&&e.onViewDown(t)})),this.Dc=function(t){e.onAnchorDown(t)},this.Ec=function(t){e.onAnchorMove(t)},this.Mc=function(t){e.onAnchorUp(t)},this.Sc=[];var d=u.getGradientRecentColumn(),g=u.getGradientRecentWidth(),m=u.getGradientRecentMargin(),w=g+m,p=v.theme.getInputLabelWidth(),O=g*d+m*(d-1),D=u.getGradientDirectionMargin(),E=u.getGradientDirectionTexture(),M=v.x+v.width+D,S=new Fs({parent:this,x:M+p+5,y:h,width:O-2*(p+5),step:1,image:{source:E,align:{with:Ku.BORDER},margin:{horizontal:-E.width-5}},on:{change:function(t){e.Rt.Yt=t}}}),T=M,j=S.y+S.height+D;null==i.RECENT_COLOR_GRADIENT&&(i.RECENT_COLOR_GRADIENT=new zb(u.getGradientRecents(),u.getGradientRecentCount())),this.Xa=i.RECENT_COLOR_GRADIENT;for(var N=this.Xa,I=0,C=N.getCapacity();I<C;++I){var A=T+I%d*w,R=j+(I/d|0)*w;b.setRectangle(1+I,A,R,g,g)}N.on("change",(function(){e.onRecentUpdate()})),b.on(Ki.tap,(function(t){var n=b.getLastHitIndex();1<=n&&e.onRecentClick(b.getData(n))}));var L=new kb;this.Rt=L,L.on("change",(function(){e.updateAnchors(),b.update()})),L.on("selectionchange",(function(t){e.onAnchorSelect(t)})),L.on("directionchange",(function(t){S.value=t})),b.setData(0,L),b.update(),S.value=L.direction,this.updateAnchors();var y=L.selected;null!=y&&this.onAnchorSelect(y),null!=r&&null!=r.width||(this.width=c+f+l+v.width+D+(d-1)*m+d*g+o),null!=r&&null!=r.height||(this.height=h+v.height+a)},Object.defineProperty(i.prototype,"value",{get:function(){return this.Rt},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"recent",{get:function(){return this.Xa},enumerable:!1,configurable:!0}),i.prototype.onRecentClick=function(t){var n=this.Rt;null!=t?n.fromObject(t):n.reset()},i.prototype.onRecentUpdate=function(){for(var t=this.Xa,n=this.rr,i=0,r=t.size();i<r;++i)n.setData(1+i,t.get(i));n.update(),rt.update(this)},i.prototype.toAnchorPosition=function(t){var n=this.toLocal(t.data.global,void 0,this.bu);return Math.max(0,Math.min(1,(n.y-this.padding.getTop())/this.Lh.height))},i.prototype.onViewDown=function(t){this.Rt.addAt(this.toAnchorPosition(t)),this.onAnchorDragStart()},i.prototype.onAnchorDown=function(n){var i=n.target;if(i instanceof t.Sprite){var r=this.Rt,e=this.Sc.indexOf(i);0<=e&&e<r.points.length&&(r.points[e].selected=!0,this.onAnchorDragStart())}},i.prototype.onAnchorSelect=function(t){var n=this.Lh;n.current.color=t.color,n.current.alpha=t.alpha,n.new.color=t.color,n.new.alpha=t.alpha},i.prototype.onAnchorColorChange=function(t){var n=this.Rt;if(null!=n){var i=n.selected;null!=i&&(i.color=t)}},i.prototype.onAnchorAlphaChange=function(t){var n=this.Rt;if(null!=n){var i=n.selected;null!=i&&(i.alpha=t)}},i.prototype.onAnchorDragStart=function(){var t=rt.getLayer(this);if(t){var n=t.stage;n.on(Ki.move,this.Ec),n.on(Ki.up,this.Mc)}},i.prototype.onAnchorMove=function(t){var n=this.Rt;if(null!=n){var i=n.selected;null!=i&&(i.position=this.toAnchorPosition(t))}},i.prototype.onAnchorUp=function(t){var n=rt.getLayer(this);if(n){var i=n.stage;i.off(Ki.move,this.Ec),i.off(Ki.up,this.Mc)}},i.prototype.updateAnchors=function(){for(var n=this.theme,i=n.getGradientAnchorTexture(),r=n.getGradientAnchorOutlinedTexture(),e=n.getGradientPointsWidth(),u=this.Rt,s=u.points.length,h=this.Sc,o=h.length,a=o;a<s;++a){var c=new t.Sprite(i);c.anchor.set(.5,.5),c.cursor="pointer",c.interactive=!0,c.on(Ki.down,this.Dc),h.push(c),this.addChild(c)}for(a=o-1;s<=a;--a){var f=h[a];f.off(Ki.down,this.Dc),f.destroy()}h.length=s;var l=this.padding.getTop(),v=this.padding.getLeft()+e,b=this.Lh.height;for(a=0;a<s;++a){var d=u.points[a],g=h[a];g.tint=d.color,g.position.set(v,l+b*d.position),g.texture=d.selected?r:i}rt.update(this)},i.prototype.onKeyDown=function(t){if(Xi.isDeleteKey(t)){var i=this.Rt;if(null!=i){var r=i.selected;if(null!=r)return i.remove(r),n.prototype.onKeyDown.call(this,t),!0}}return n.prototype.onKeyDown.call(this,t)},i.prototype.getType=function(){return"DPickerColorGradient"},i.RECENT_COLOR_GRADIENT=null,i}(Qi),Xb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.newContentChildren=function(n,i){var r=t.prototype.newContentChildren.call(this,n,i);return r.push(this.picker),r},n.prototype.onOk=function(n){t.prototype.onOk.call(this,n);var i=this.picker,r=i.value,e=i.recent;e.contains(r)||e.add(r.toObject())},Object.defineProperty(n.prototype,"value",{get:function(){return this.picker.value},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"recent",{get:function(){return this.picker.recent},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"picker",{get:function(){var t,n=this.Lh;return null==n&&(n=new Wb(null===(t=this.kn)||void 0===t?void 0:t.picker),this.Lh=n),n},enumerable:!1,configurable:!0}),n.prototype.getResolvedValue=function(){return this.picker.value},n.prototype.onKeyDown=function(n){return this.picker.onKeyDown(n),t.prototype.onKeyDown.call(this,n)},n.prototype.getType=function(){return"DDialogColorGradient"},n}(Ks),Kb=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return B(i,n),i.prototype.init=function(i){var r;if(n.prototype.init.call(this,i),void 0===(null===(r=null==i?void 0:i.image)||void 0===r?void 0:r.source)){var e=this.theme,u=e.getViewBaseTexture();if(u instanceof t.Texture){var s=e.getCheckerColors(),h=Vb.from(1,10,s,u);this.rr=h,h.setRectangle(0,0,0,u.width,u.height),h.setData(0,this.Ws),h.update(),this.image=h}}},i.prototype.onActivate=function(t){var i=this;n.prototype.onActivate.call(this,t);var r=this.Ws,e=this.dialog;null!=r&&e.value.fromObject(r),e.open(this).then((function(t){i.onValueChange(t,i.toClone(r))}))},i.prototype.toClone=function(t){var n=new kb;return null!=t&&n.fromObject(t),n},i.prototype.onValueChange=function(t,n){var i=this.Ws;null!=i&&i.fromObject(t);var r=this.rr;null!=r&&r.update(),this.onTextChange(),this.createOrUpdateText(),rt.update(this),this.emit("change",t,n,this)},Object.defineProperty(i.prototype,"dialog",{get:function(){var t,n=this.Tc;if(null==n){var r=null===(t=this.kn)||void 0===t?void 0:t.dialog;r?n=this.newDialog(r):(null==i.DIALOG&&(i.DIALOG=this.newDialog({mode:"MENU",sticky:!0})),n=i.DIALOG),this.Tc=n}return n},enumerable:!1,configurable:!0}),i.prototype.newDialog=function(t){return new Xb(t)},Object.defineProperty(i.prototype,"value",{get:function(){return this.Ws},enumerable:!1,configurable:!0}),i.prototype.getType=function(){return"DButtonColorGradient"},i}(gs),Yb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.newContentChildren=function(n,i){var r=t.prototype.newContentChildren.call(this,n,i);return r.push(this.picker),r},n.prototype.onOk=function(n){t.prototype.onOk.call(this,n);var i=this.picker,r=i.recent;r.contains(i.new)||r.add(i.new)},Object.defineProperty(n.prototype,"current",{get:function(){return this.picker.current},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"new",{get:function(){return this.picker.new},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"recent",{get:function(){return this.picker.recent},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"picker",{get:function(){var t,n=this.Lh;return null==n&&(n=new Gb(null===(t=this.kn)||void 0===t?void 0:t.picker),this.Lh=n),n},enumerable:!1,configurable:!0}),n.prototype.getResolvedValue=function(){return this.picker.new},n.prototype.getType=function(){return"DDialogColor"},n}(Ks),Jb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.onActivate=function(n){var i=this;t.prototype.onActivate.call(this,n);var r=this.dialog,e=this.Ws;if(null!=e){var u=r.current;u.color=e.color,u.alpha=e.alpha;var s=r.new;s.color=e.color,s.alpha=e.alpha}r.open(this).then((function(){i.onValueChange(i.toClone(r.new),i.toClone(r.current))}))},n.prototype.toClone=function(t){return{color:t.color,alpha:t.alpha}},n.prototype.onValueChange=function(t,n){var i=this.Ws;null!=i&&(i.color=t.color,i.alpha=t.alpha),this.onColorChange(),this.emit("change",t,n,this)},n.prototype.toImageTintOptions=function(t){var n=this,i=function(){return n.Ws.color};return t?{color:t.color||i,alpha:t.alpha}:{color:i}},n.prototype.toImageOptions=function(t,n){return n?{source:n.source,tint:this.toImageTintOptions(n.tint),align:n.align,margin:n.margin}:{tint:this.toImageTintOptions()}},n.prototype.onColorChange=function(){this.Qs[0].updateTint()&&rt.update(this),this.updateTextForcibly()},n.prototype.updateTextForcibly=function(){this.onTextChange(),this.createOrUpdateText()},Object.defineProperty(n.prototype,"dialog",{get:function(){var t,i=this.Tc;if(null==i){var r=null===(t=this.kn)||void 0===t?void 0:t.dialog;r?i=this.newDialog(r):(null==n.DIALOG&&(n.DIALOG=this.newDialog({mode:"MENU",sticky:!0})),i=n.DIALOG),this.Tc=i}return i},enumerable:!1,configurable:!0}),n.prototype.newDialog=function(t){return new Yb(t)},Object.defineProperty(n.prototype,"value",{get:function(){var t=this.Rt;return null==t&&(t=this.newValue(),this.Rt=t),t},enumerable:!1,configurable:!0}),n.prototype.newValue=function(){var t=this,n=this.Ws;return new Ub(n,(function(i){n.color=i,t.onColorChange()}),(function(i){n.alpha=i,t.updateTextForcibly()}))},n.prototype.getType=function(){return"DButtonColor"},n}(gs),Zb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DButtonDanger"},n}(gs),qb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.onActivate=function(n){var i,r,e=this;t.prototype.onActivate.call(this,n);var u=null!==(r=null===(i=this.Ws)||void 0===i?void 0:i.getTime())&&void 0!==r?r:Date.now(),s=this.dialog;s.current=new Date(u),s.new=new Date(u),s.page=new Date(u),s.open(this).then((function(){e.onValueChange(s.new,s.current)}))},n.prototype.onValueChange=function(t,n){this.text=new Date(t.getTime()),this.emit("change",t,n,this)},Object.defineProperty(n.prototype,"dialog",{get:function(){var t,i=this.Tc;if(null==i){var r=null===(t=this.kn)||void 0===t?void 0:t.dialog;r?i=this.newDialog(r):(null==n.DIALOG&&(n.DIALOG=this.newDialog({mode:"MENU",sticky:!0})),i=n.DIALOG),this.Tc=i}return i},enumerable:!1,configurable:!0}),n.prototype.newDialog=function(t){return new mh(t)},Object.defineProperty(n.prototype,"value",{get:function(){var t;return null!==(t=this.Ws)&&void 0!==t?t:new Date},set:function(t){var n=this.Ws;void 0!==n&&n.getTime()===t.getTime()||(this.text=t)},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DButtonDate"},n}(gs),Qb=function(){function t(){}return t.format=function(t){var n=qt(String(t.getFullYear()),4,"0"),i=qt(String(t.getMonth()+1),2,"0"),r=qt(String(t.getDate()),2,"0");return"".concat(n,"/").concat(i,"/").concat(r)},t}(),$b=function(){function t(){}return t.format=function(t,n){var i="";return n&nh.HOURS&&(i+=qt(String(t.getHours()),2,"0")),n&nh.MINUTES&&(0<i.length&&(i+=":"),i+=qt(String(t.getMinutes()),2,"0")),n&nh.SECONDS&&(0<i.length&&(i+=":"),i+=qt(String(t.getSeconds()),2,"0")),i},t.toMask=function(t){return ih.from("DPickerTime",t)},t}(),td=function(){function t(){}return t.format=function(t,n){var i=$b.format(t,n);return 0<i.length?"".concat(Qb.format(t)," ").concat(i):"".concat(Qb.format(t))},t.toMask=function(t){return ih.from("DPickerDatetime",t)},t}(),nd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.onActivate=function(n){var i,r,e=this;t.prototype.onActivate.call(this,n);var u=null!==(r=null===(i=this.Ws)||void 0===i?void 0:i.getTime())&&void 0!==r?r:Date.now(),s=this.dialog;s.current=new Date(u),s.new=new Date(u),s.page=new Date(u),s.open(this).then((function(){e.onValueChange(s.new,s.current)}))},n.prototype.onValueChange=function(t,n){this.text=new Date(t.getTime()),this.emit("change",t,n,this)},n.prototype.getDatetimeMask=function(){var t,n,i=this.jc;return null==i&&(i=td.toMask(null===(n=null===(t=this.kn)||void 0===t?void 0:t.dialog)||void 0===n?void 0:n.picker),this.jc=i),i},Object.defineProperty(n.prototype,"dialog",{get:function(){var t,i=this.Tc;if(null==i){var r=null===(t=this.kn)||void 0===t?void 0:t.dialog;r?i=this.newDialog(r):(null==n.DIALOG&&(n.DIALOG=this.newDialog({mode:"MENU",sticky:!0})),i=n.DIALOG),this.Tc=i}return i},enumerable:!1,configurable:!0}),n.prototype.newDialog=function(t){return new fh(t)},Object.defineProperty(n.prototype,"value",{get:function(){var t;return null!==(t=this.Ws)&&void 0!==t?t:new Date},set:function(t){var n=this.Ws;void 0!==n&&n.getTime()===t.getTime()||(this.text=t)},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DButtonDatetime"},n}(gs),id=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getChecker=function(){var t,n,i=this.Mo;return void 0===i&&(i=null!==(n=null===(t=this.kn)||void 0===t?void 0:t.checker)&&void 0!==n?n:null,this.Mo=i),i},n.prototype.getOpener=function(){var t=this.gs;return null==t&&(t=this.newOpener(),this.gs=t),t},n.prototype.newOpener=function(){var t,n;return new ob(Di(null!==(n=null===(t=this.kn)||void 0===t?void 0:t.as)&&void 0!==n?n:hb.TEXT,hb),this)},n.prototype.onActivate=function(n){var i=this;t.prototype.onActivate.call(this,n),this.check((function(){i.open()}))},n.prototype.check=function(t){var n=this.getChecker();if(null!=n){var i=n();!0===i?t():!1===i||i.then((function(){t()}))}else t()},n.prototype.open=function(){this.getOpener().open()},n.prototype.getType=function(){return"DButtonFile"},n}(gs),rd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.onClick=function(n){this.link.onClick(this,n)||t.prototype.onClick.call(this,n)},Object.defineProperty(n.prototype,"link",{get:function(){var t=this.So;return null==t&&(t=new Al(this.kn),this.So=t),t},enumerable:!1,configurable:!0}),n.prototype.onActivate=function(n){t.prototype.onActivate.call(this,n),this.link.open(n)},n.prototype.open=function(t){this.link.open(t)},n.prototype.getType=function(){return"DButtonLink"},n}(ds),ed=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DButtonRadio"},n}(ds),ud=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DButtonRadioRight"},n}(ed),sd=function(t){function n(n){var i=t.call(this,n)||this,r=i.state,e=Sb.getCommandController();return r.isDisabled=!e.isRedoable(),e.on("change",(function(){r.isDisabled=!e.isRedoable()})),i}return B(n,t),n.prototype.onActivate=function(n){t.prototype.onActivate.call(this,n),Sb.getCommandController().redo()},n}(gs),hd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DButtonSecondary"},n}(gs),od={NONE:0,SINGLE:1,MULTIPLE:2},ad=function(t){function n(n,i){var r=t.call(this,i)||this;return r.Pt=n,r.on(Ki.tap,(function(t){r.onClick(t)})),r}return B(n,t),Object.defineProperty(n.prototype,"link",{get:function(){var t=this.So;return void 0===t&&(t=this.newLink(),this.So=t),t},enumerable:!1,configurable:!0}),n.prototype.newLink=function(){var t=this.Pt.accessor.link;return t?new Al(this.toLinkOptions(t)):null},n.prototype.onClick=function(t){var n;!0!==(null===(n=this.link)||void 0===n?void 0:n.onClick(this,t))&&this.state.isActionable&&this.activate(t)},n.prototype.activate=function(t){var n=this.Rt;void 0!==n&&this.onSelect(t,n)},n.prototype.toLinkOptions=function(t){return{url:this.toLinkUrl(t.toUrl),target:t.target,checker:this.toLinkChecker(t.checker)}},n.prototype.toLinkUrl=function(t){var n=this;return function(){var i=n.Rt;if(void 0!==i)return t(i)}},n.prototype.toLinkChecker=function(t){var n=this;if(t)return function(){var i=n.Rt;return null!=i&&t(i)}},Object.defineProperty(n.prototype,"value",{get:function(){return this.Rt},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"index",{get:function(){return this.Qe},enumerable:!1,configurable:!0}),n.prototype.onSelect=function(t,n){var i;this.emit("select",n,this);var r=this.Pt,e=r.selection;if(e.type!==od.MULTIPLE)e.clearAndAdd(n);else{var u=t&&"data"in t?t.data.originalEvent:t;if(null==u?void 0:u.ctrlKey)e.toggle(n);else if(null==u?void 0:u.shiftKey){var s=r.mapped,h=e.last;if(n===h)e.clearAndAdd(n);else{var o=!1,a=!1,c=[];s.each((function(t){if(o){if(a){if(c.unshift(t),t===n)return!1}else if(c.push(t),t===h)return!1}else t===n?(o=!0,a=!1,c.push(t)):t===h&&(o=!0,a=!0,c.push(t))})),e.clearAndAddAll(c)}}else e.clearAndAdd(n)}null===(i=this.So)||void 0===i||i.open(t)},n.prototype.set=function(t,n,i){var r=this.Pt,e=i||this.Rt!==t;if(e){this.Rt=t,this.Qe=n;var u=r.accessor;this.text=u.toLabel(t),this.title=u.toTitle(t)||"",this.image=u.toImage(t)}var s=this.state;s.lock(),s.set(ht.ACTIVE,r.selection.contains(t)),s.remove(ht.DISABLED),s.unlock(),e&&this.emit("set",t,n,this)},n.prototype.unset=function(){if(void 0!==this.Rt){this.Rt=void 0,this.Qe=void 0,this.text=void 0,this.title="",this.image=void 0;var t=this.state;t.lock(),t.add(ht.DISABLED),t.remove(ht.ACTIVE),t.unlock(),this.emit("unset",this)}},n.prototype.onKeyDown=function(n){return Xi.isActivateKey(n)&&this.onKeyDownActivate(n),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyDownActivate=function(t){return!(!this.state.isActionable||!this.state.isFocused||(this.activate(t),0))},n.prototype.getType=function(){return"DListItem"},n}(bs),cd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DDialogSelectListItem"},n}(ad),fd=function(){function t(t,n,i,r){this.Nc=0,this.Ic=!1,this.Cc=!1,this.Ac=-1,this.Rc=-1,this.ps=1,this.Lc=0,this.yc=0,this.kc=[],this.Pt=t,this.oh=n,this.xc=i,this.Bc=this.toNewItem(r),this._c=this.toInitItem(r)}return t.prototype.toNewItem=function(t){return(null==t?void 0:t.newItem)||this.newItem},t.prototype.toInitItem=function(t){return t?t.initItem||(!1!==t.stripe?this.initItem:this.initItemNoStriping):this.initItem},t.prototype.initItem=function(t,n,i){return t.state.isAlternated=n%2==1,t},t.prototype.initItemNoStriping=function(t,n,i){return t},Object.defineProperty(t.prototype,"multiplicity",{get:function(){return this.ps},enumerable:!1,configurable:!0}),t.prototype.lock=function(){this.Nc+=1,1===this.Nc&&(this.Ic=!1,this.Cc=!1)},t.prototype.unlock=function(t){this.Nc-=1,0===this.Nc&&(t&&this.Ic&&this.update(this.Cc),this.Ic=!1,this.Cc=!1)},t.prototype.update=function(t){var n=this;if(0<this.Nc)return this.Ic=!0,void(t&&(this.Cc=!0));var i=this.oh,r=i.parent;if(null!=r){var e=this.xc,u=e.children,s=r.height,h=this.Pt,o=this.toMapped(h),a=o.size(),c=this.Lc,f=this.yc,l=f-c,v=this.Bc,b=this._c,d=this.Ac,g=this.Rc;if(this.Ac<0){var m=void 0;0<u.length?m=u[0]:(m=b(v(h),c,h),e.addChild(m),f+=1,l+=1),d=Math.max(1,m.height),mn(m.getWidth())&&(g=Math.max(1,m.width)),this.Ac=d,this.Rc=g}var w=i.padding,p=w.getTop(),O=w.getBottom(),D=w.getLeft(),E=w.getRight(),M=Math.max(0,i.width-D-E),S=0<g?Math.max(1,Math.floor(M/g)):1;this.ps=S;var T=i!==e?e.transform.position.y:p,j=Math.ceil(a/S)*d,N=Math.max(s,p+j+O),I=Math.max(s-N,i.position.y),C=Math.floor((0-(I+T))*S/d),A=Math.floor((s-(I+T))*S/d),R=C-S;R%2!=0&&(R-=1);var L=A+S+S;L%2!=0&&(L+=1);var y=L-R;if(y<l&&l-2<=y&&(L=R+(y=l)),l<y){for(var k=l;k<y;++k){var x=c+k;m=b(v(h),x,h),e.addChild(m)}f=c+(l=y)}else if(y<l){for(k=l-1;y<=k;--k)e.removeChild(u[k]);f=c+(l=y)}this.Lc=R,this.yc=L;var B=R-c,_=Math.abs(B),P=u.length;if(0<_&&_<P){var U=this.kc;if(0<B){for(k=0;k<_;++k)m=u[k],this.reset(m),U.push(m);for(k=_;k<P;++k)u[k-_]=u[k];for(k=0;k<_;++k)u[P-_+k]=U[k]}else{for(k=0;k<_;++k)m=u[P-_+k],this.reset(m),U.push(m);for(k=P-_-1;0<=k;--k)u[k+_]=u[k];for(k=0;k<_;++k)u[k]=U[k]}U.length=0}var F=0,G=0;for(i===e&&(F=D,G=p),o.each((function(i,r){var e=u[r-R],s=r%S,h=Math.floor(r/S);e.position.set(F+s*g,G+h*d),n.set(e,i,r,t)}),R,R+P),k=0;R+k<0&&k<P;++k){m=u[k];var H=(V=R+k)%S,z=Math.floor(V/S);m.position.set(F+H*g,G+z*d),this.unset(m)}for(k=P-1;a<=R+k&&0<=k;--k){var V;m=u[k],H=(V=R+k)%S,z=Math.floor(V/S),m.position.set(F+H*g,G+z*d),this.unset(m)}this.lock(),i.position.y=I,i.height=N,i!==e&&(e.height=j),this.unlock(!1)}},t.prototype.set=function(t,n,i,r){t.set(n,i,r)},t.prototype.unset=function(t){t.unset()},t.prototype.reset=function(t){t.blur(!0);for(var n=t.children,i=0,r=n.length;i<r;++i){var e=n[i];if(e instanceof Qi){var u=e.state;u.lock(),u.isPressed=!1,u.isHovered=!1,u.unlock()}}return t.state.isHovered=!1,t},t.prototype.moveFocus=function(t,n,i,r){if(!i&&!r)return!1;var e=i&&Xi.isArrowUpKey(t),u=i&&Xi.isArrowDownKey(t),s=r&&Xi.isArrowLeftKey(t),h=r&&Xi.isArrowRightKey(t);if(!(e||u||s||h))return!1;if(!n.state.isActionable)return!1;var o=rt.getLayer(n);if(null==o)return!1;var a=o.getFocusController(),c=a.get();if(null==c)return!1;var f=this.xc;if(c.parent!==f)return!1;var l=c,v=l.index;if(null==v)return!1;var b=this.ps,d=this.Pt,g=this.toMapped(d).size(),m=v;if((s||h)&&(s?0<=m-1&&(m-=1):m+1<g&&(m+=1)),(e||u)&&(e?0<=m-b&&(m-=b):m+b<g&&(m+=b)),m===v)return!1;var w=f.children,p=w.indexOf(l);if(p<0)return!1;var O=p+(m-v);if(O<0||w.length<=O)return!1;var D=w[O];return a.focus(D),!0},t}(),ld=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.toMapped=function(t){return t.mapped},n.prototype.newItem=function(t){return new ad(t)},n}(fd),vd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.newItem=function(t){return new cd(t)},n}(ld),bd=function(){function t(t){this.p=t}return t.prototype.size=function(){var t=this.p;return t.before.length+t.items.length+t.after.length},t.prototype.each=function(t,n,i){var r=this.p,e=this.Pc(t,r.before,0,n,i);if(!(e<0)){var u=this.Pc(t,r.items,e,n,i);u<0||this.Pc(t,r.after,u,n,i)}},t.prototype.Pc=function(t,n,i,r,e){for(var u=i+n.length,s=null!=r?Math.max(i,r):i,h=null!=e?Math.min(u,e):u,o=s;o<h;++o)if(!1===t(n[o-i],o))return-1;return h},t}(),dd=function(t){function n(n,i,r){var e=t.call(this)||this;e.p=n,e.Uc=i,e.Fc=new Set;var u=null==r?void 0:r.on;if(u)for(var s in u){var h=u[s];h&&e.on(s,h)}return e}return B(n,t),Object.defineProperty(n.prototype,"type",{get:function(){return od.MULTIPLE},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"first",{get:function(){return this.get(0)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"last",{get:function(){return this.get(this.size()-1)},enumerable:!1,configurable:!0}),n.prototype.get=function(t){var n=this.Fc;if(0<=t&&t<n.size){var i=0,r=null;return n.forEach((function(n){i===t&&(r=n),i+=1})),r}return null},n.prototype.add=function(t){var n=this.Fc;return!n.has(t)&&(n.add(t),this.onChange(),!0)},n.prototype.remove=function(t){var n=this.Fc;return!!n.has(t)&&(n.delete(t),this.onChange(),!0)},n.prototype.toggle=function(t){var n=this.Fc;return n.has(t)?n.delete(t):n.add(t),this.onChange(),!0},n.prototype.clear=function(){var t=this.Fc;0<t.size&&(t.clear(),this.onChange())},n.prototype.clearAndAdd=function(t){var n=this.Fc;return 1===n.size?!n.has(t)&&(n.clear(),n.add(t),this.onChange(),!0):(n.clear(),n.add(t),this.onChange(),!0)},n.prototype.clearAndAddAll=function(t){for(var n=!1,i=new Set,r=this.Fc,e=0,u=t.length;e<u;++e){var s=t[e];r.has(s)||(n=!0),i.add(s)}return n||r.forEach((function(t){i.has(t)||(n=!0)})),n&&(this.Fc=i,this.onChange()),n},n.prototype.contains=function(t){return this.Fc.has(t)},n.prototype.size=function(){return this.Fc.size},n.prototype.isEmpty=function(){return this.size()<=0},n.prototype.each=function(t){var n=!1;this.Fc.forEach((function(i){n||!1===t(i)&&(n=!0)}))},n.prototype.toArray=function(){var t=[];return this.Fc.forEach((function(n){t.push(n)})),t},n.prototype.onChange=function(){this.p.update(),this.emit("change",this)},n.prototype.toItemIdMap=function(t,n,i){for(var r=0,e=t.length;r<e;++r){var u=t[r];i.set(n(u),u)}},n.prototype.toItemSet=function(t,n){for(var i=0,r=t.length;i<r;++i)n.add(t[i])},n.prototype.onItemChange=function(t,n,i){var r=this.Fc,e=new Set,u=this.Uc.toId;if(u){var s=new Map;this.toItemIdMap(t,u,s),this.toItemIdMap(n,u,s),this.toItemIdMap(i,u,s),r.forEach((function(t){var n=u(t),i=s.get(n);null!=i&&e.add(i)})),this.Fc=e,this.onChange()}else{var h=new Set;this.toItemSet(t,h),this.toItemSet(n,h),this.toItemSet(i,h),r.forEach((function(t){h.has(t)&&e.add(t)})),r.size!==e.size&&(this.Fc=e,this.onChange())}},n.prototype.newItems=function(t,n,i){for(var r=0,e=t.length;r<e;++r){var u=t[r];n.has(u)&&i.add(u)}return i},n}(t.utils.EventEmitter),gd=function(t){function n(n,i,r){var e=t.call(this)||this;e.p=n;var u=null==r?void 0:r.on;if(u)for(var s in u){var h=u[s];h&&e.on(s,h)}return e}return B(n,t),Object.defineProperty(n.prototype,"type",{get:function(){return od.NONE},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"first",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"last",{get:function(){return null},enumerable:!1,configurable:!0}),n.prototype.get=function(t){return null},n.prototype.add=function(t){return!1},n.prototype.remove=function(t){return!1},n.prototype.toggle=function(t){return!1},n.prototype.clear=function(){},n.prototype.clearAndAdd=function(t){return!1},n.prototype.clearAndAddAll=function(t){return!1},n.prototype.contains=function(t){return!1},n.prototype.size=function(){return 0},n.prototype.isEmpty=function(){return!0},n.prototype.each=function(t){},n.prototype.toArray=function(){return[]},n.prototype.onChange=function(){this.p.update(),this.emit("change",this)},n.prototype.onItemChange=function(t,n,i){},n}(t.utils.EventEmitter),md=function(t){function n(n,i,r){var e=t.call(this)||this;e.p=n,e.Uc=i,e.Gc=null;var u=null==r?void 0:r.on;if(u)for(var s in u){var h=u[s];h&&e.on(s,h)}return e}return B(n,t),Object.defineProperty(n.prototype,"type",{get:function(){return od.SINGLE},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"first",{get:function(){return this.Gc},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"last",{get:function(){return this.get(this.size()-1)},enumerable:!1,configurable:!0}),n.prototype.get=function(t){return 0===t?this.Gc:null},n.prototype.add=function(t){return this.Gc!==t&&(this.Gc=t,this.onChange(),!0)},n.prototype.remove=function(t){return this.Gc===t&&(this.Gc=null,this.onChange(),!0)},n.prototype.toggle=function(t){return this.Gc===t?this.Gc=null:this.Gc=t,this.onChange(),!0},n.prototype.clear=function(){null!=this.Gc&&(this.Gc=null,this.onChange())},n.prototype.clearAndAdd=function(t){return this.Gc!==t&&(this.Gc=t,this.onChange(),!0)},n.prototype.clearAndAddAll=function(t){var n=t.length;if(0<n){var i=t[n-1];if(this.Gc!==i)return this.Gc=i,this.onChange(),!0}else if(null!=this.Gc)return this.Gc=null,this.onChange(),!0;return!1},n.prototype.contains=function(t){return this.Gc===t},n.prototype.size=function(){return null!=this.Gc?1:0},n.prototype.isEmpty=function(){return this.size()<=0},n.prototype.each=function(t){var n=this.Gc;null!=n&&t(n)},n.prototype.toArray=function(){var t=this.Gc;return null!=t?[t]:[]},n.prototype.onChange=function(){this.p.update(),this.emit("change",this)},n.prototype.findById=function(t,n,i){for(var r=0,e=i.length;r<e;++r){var u=i[r];if(t===n(u))return u}return null},n.prototype.find=function(t,n){for(var i=0,r=n.length;i<r;++i){var e=n[i];if(t===e)return e}return null},n.prototype.onItemChange=function(t,n,i){var r=this.Gc;if(null!=r){var e=null,u=this.Uc.toId;if(u){var s=u(r);e=this.findById(s,u,t)||this.findById(s,u,n)||this.findById(s,u,i)}else e=this.find(r,t)||this.find(r,n)||this.find(r,i);r!==e&&(this.Gc=e,this.onChange())}},n}(t.utils.EventEmitter),wd=function(t){return t.image},pd=function(t){return t.title},Od=function(t){return t.url},Dd=function(){function t(t){this.toLabel=(null==t?void 0:t.toLabel)||nb,this.toTitle=(null==t?void 0:t.toTitle)||pd,this.toImage=(null==t?void 0:t.toImage)||wd,this.toId=null==t?void 0:t.toId,this.link=this.toLink(t)}return t.prototype.toLink=function(t){if(t){var n=t.link;if(n){var i=n.toUrl,r=n.target,e=n.checker;if(void 0!==i||void 0!==r||void 0!==e)return{toUrl:i||Od,target:r,checker:e}}}},t}(),Ed=function(){function t(t,n){this.p=t,n?(this.Uu=n.before||[],this.Fc=n.items||[],this.Fu=n.after||[]):(this.Uu=[],this.Fc=[],this.Fu=[]);var i=new Dd(n);this.Uc=i,this.Hc=this.toSelection(i,n),this.zc=new bd(this)}return t.prototype.toSelection=function(t,n){var i=null==n?void 0:n.selection;switch(null==i?void 0:i.type){case od.NONE:case"NONE":return new gd(this,t,i);case od.MULTIPLE:case"MULTIPLE":return new dd(this,t,i);default:return new md(this,t,i)}},Object.defineProperty(t.prototype,"before",{get:function(){return this.Uu},set:function(t){this.Uu=t,this.Hc.onItemChange(t,this.Fc,this.Fu),this.update()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"items",{get:function(){return this.Fc},set:function(t){this.Fc=t,this.Hc.onItemChange(this.Uu,t,this.Fu),this.update()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"after",{get:function(){return this.Fu},set:function(t){this.Fu=t,this.Hc.onItemChange(this.Uu,this.Fc,t),this.update()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mapped",{get:function(){return this.zc},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"accessor",{get:function(){return this.Uc},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selection",{get:function(){return this.Hc},enumerable:!1,configurable:!0}),t.prototype.update=function(t){this.p.update(t)},t.prototype.size=function(){return this.Fc.length},t.prototype.clear=function(){var t=this.Fc;return 0<t.length&&(t.length=0,this.onChange(),!0)},t.prototype.clearAndAdd=function(t){var n=this.Fc;return 1===n.length?n[0]!==t&&(n[0]=t,this.onChange(),!0):(n.length=0,n.push(t),this.onChange(),!0)},t.prototype.clearAndAddAll=function(t){var n=!1,i=this.Fc;if(0<i.length&&(i.length=0,n=!0),0<t.length){for(var r=0,e=t.length;r<e;++r)i.push(t[r]);n=!0}return!!n&&(this.onChange(),!0)},t.prototype.add=function(t,n){var i=this.Fc;return null==n?(i.push(t),this.onChange(),!0):0<=n&&n<i.length&&(i.splice(n,0,t),this.onChange(),!0)},t.prototype.addAll=function(t,n){if(0<t.length){var i=this.Fc,r=i.length;if(null==n){for(var e=0,u=t.length;e<u;++e)i.push(t[e]);return this.onChange(),!0}if(0<=n&&n<r){for(e=0,u=t.length;e<u;++e)i.splice(n+e,0,t[e]);return this.onChange(),!0}}return!1},t.prototype.get=function(t){var n=this.Fc;return 0<=t&&t<n.length?n[t]:null},t.prototype.set=function(t,n){var i=this.Fc;if(0<=t&&t<i.length){var r=i[t];return i[t]=n,this.onChange(),r}return null},t.prototype.remove=function(t){var n=this.Fc;if(0<=t&&t<n.length){var i=n.splice(t,1)[0];return this.onChange(),i}return null},t.prototype.each=function(t,n,i){for(var r=this.Fc,e=r.length,u=null!=n?Math.max(0,n):0,s=null!=i?Math.min(e,i):e,h=u;h<s&&!1!==t(r[h],h);++h);},t.prototype.onChange=function(){this.update()},t}(),Md=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.initReflowable=function(){},n.prototype.getType=function(){return"DContent"},n}(Qi),Sd=function(t){function n(n){var i,r,e=this;(e=t.call(this,n)||this).Vc=0,e.Wc=1,e.visible=!1,e.Xc=-1,e.Kc=!1,e.Yc=null,e.Jc=null!==(r=null===(i=null==n?void 0:n.fadeOut)||void 0===i?void 0:i.delay)&&void 0!==r?r:e.theme.getFadeOutDelay(),e.Zc=!0,e.qc=function(){e.onFadeOutTimeout()};var u=e.newThumb(null==n?void 0:n.thumb);return u.on("statechange",(function(t,n){e.onThumbStateChange(t,n)})),e.Qc=u,e.addChild(u),e}return B(n,t),Object.defineProperty(n.prototype,"thumb",{get:function(){return this.Qc},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"start",{get:function(){return this.Vc},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"end",{get:function(){return this.Wc},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r){i<1?(t=0,n=1):(t=Math.max(0,Math.min(1,t/i)),n=Math.max(t,Math.min(1,n/i))),this.Vc===t&&this.Wc===n||(this.Vc=t,this.Wc=n,this.onChange(r))},n.prototype.onChange=function(t){this.updateThumb(this.width,this.height),t&&(this.Zc=!0),this.Kc||(this.Kc=!0,rt.update(this))},n.prototype.touch=function(t){this.onChange(t)},n.prototype.isRegionVisible=function(){return 0<this.Vc||this.Wc<1},n.prototype.render=function(n){if(this.Kc)if(this.Kc=!1,!this.Zc&&this.isRegionVisible()){var i=this.Jc;0<=i&&(this.Xc=Date.now(),null==this.Yc&&(this.Yc=window.setTimeout(this.qc,i))),this.visible||(this.visible=!0)}else this.Jc<0&&this.visible&&(this.visible=!1);this.Zc&&(this.Zc=!1),t.prototype.render.call(this,n)},n.prototype.onResize=function(n,i,r,e){t.prototype.onResize.call(this,n,i,r,e),this.updateThumb(n,i)},n.prototype.onFadeOutTimeout=function(){this.Yc=null;var t=this.Jc,n=this.qc,i=this.state;if(i.isGesturing||i.onHovered||i.isHovered||i.isPressed)this.Yc=window.setTimeout(n,t);else{var r=this.Qc.state;if(r.isGesturing||r.isHovered||r.isPressed)this.Yc=window.setTimeout(n,t);else{var e=t-(Date.now()-this.Xc);0<e?this.Yc=window.setTimeout(n,e):this.visible&&(this.visible=!1,rt.update(this))}}},n.prototype.onThumbStateChange=function(t,n){t.isGesturing||t.isHovered||t.isPressed||(n.isGesturing||n.isHovered||n.isPressed)&&(this.Xc=Date.now())},n.prototype.onStateChange=function(n,i){t.prototype.onStateChange.call(this,n,i),n.isGesturing||n.isHovered||n.isPressed||(i.isGesturing||i.isHovered||i.isPressed)&&(this.Xc=Date.now())},n.prototype.getType=function(){return"DScrollBar"},n}(Qi),Td=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return B(i,n),i.prototype.init=function(i){var r=this;n.prototype.init.call(this,i);var e=new t.Point;this.Ni=new or({bind:this,on:{start:function(){e.copyFrom(r.position)},move:function(t,n,i){e.set(e.x+n,e.y+i),r.onGestureMove(e.x,e.y)}}})},i.prototype.getMinimumLength=function(){return this.theme.getThumbMinimumLength()},i.prototype.getType=function(){return"DScrollBarThumb"},i}(Qi),jd=function(t){function n(n){var i=t.call(this)||this;return n.snippet.add(i,!0),n.reflowable.add(i),i}return B(n,t),n.prototype.onReflow=function(t,n,i){this.clear();var r=t.state,e=t.border,u=e.getColor(r);if(null!=u){var s=e.getAlpha(r),h=e.getWidth(r),o=e.getAlign(r);this.beginFill(u,s),this.lineStyle(0,0,0,0),this.drawRect(0,o*(i-h),n,h),this.endFill(),this.visible=!0}else this.visible=!1},n}(t.Graphics),Nd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.onGestureMove=function(t,n){this.emit("regionmove",t,this)},n.prototype.initReflowable=function(){new jd(this)},n}(Td),Id=function(t){function n(n){var i=t.call(this,n)||this;return i.Qc.on("regionmove",(function(t){i.onThumbRegionMove(t)})),i}return B(n,t),n.prototype.onThumbRegionMove=function(t){var n=this.width;if(0<n){var i=this.Wc-this.Vc,r=Math.min(1-i,Math.max(0,t/n));this.Vc!==r&&this.emit("regionmove",r,this)}},n.prototype.onDownThis=function(n){t.prototype.onDownThis.call(this,n);var i=this.width;if(0<i){var r=this.Wc-this.Vc,e=n.data.getLocalPosition(this),u=Math.min(1-r,Math.max(0,e.x/i-.5*r));this.Vc!==u&&this.emit("regionmove",u,this)}},n.prototype.newThumb=function(t){return new Nd(t)},n.prototype.updateThumb=function(t,n){var i=this.Qc,r=Math.min(.5*t,i.getMinimumLength()),e=t-r,u=e*this.Vc,s=e*this.Wc+r-u;i.position.set(u,0),i.resize(s,n)},n}(Sd),Cd=function(t){function n(n){var i=t.call(this)||this;return n.snippet.add(i,!0),n.reflowable.add(i),i}return B(n,t),n.prototype.onReflow=function(t,n,i){this.clear();var r=t.state,e=t.border,u=e.getColor(r);if(null!=u){var s=e.getAlpha(r),h=e.getWidth(r),o=e.getAlign(r);this.beginFill(u,s),this.lineStyle(0,0,0,0),this.drawRect(o*(n-h),0,h,i),this.endFill(),this.visible=!0}else this.visible=!1},n}(t.Graphics),Ad=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.onGestureMove=function(t,n){this.emit("regionmove",n,this)},n.prototype.initReflowable=function(){new Cd(this)},n}(Td),Rd=function(t){function n(n){var i=t.call(this,n)||this;return i.Qc.on("regionmove",(function(t){i.onThumbRegionMove(t)})),i}return B(n,t),n.prototype.onThumbRegionMove=function(t){var n=this.height;if(0<n){var i=this.Wc-this.Vc,r=Math.min(1-i,Math.max(0,t/n));this.Vc!==r&&this.emit("regionmove",r,this)}},n.prototype.onDownThis=function(n){t.prototype.onDownThis.call(this,n);var i=this.height;if(0<i){var r=this.Wc-this.Vc,e=n.data.getLocalPosition(this),u=Math.min(1-r,Math.max(0,e.y/i-.5*r));this.Vc!==u&&this.emit("regionmove",u,this)}},n.prototype.newThumb=function(t){return new Ad(t)},n.prototype.updateThumb=function(t,n){var i=this.Qc,r=Math.min(.5*n,i.getMinimumLength()),e=n-r,u=e*this.Vc,s=e*this.Wc+r-u;i.position.set(0,u),i.resize(t,s),i.updateTransform()},n}(Sd),Ld=function(){function t(t,n,i){this.p=t,this.$c=i,this.q=0,this.tf=!1,this.vertical=new Rd(null==n?void 0:n.vertical),this.horizontal=new Id(null==n?void 0:n.horizontal)}return t.prototype.lock=function(){this.q+=1,1===this.q&&(this.tf=!1,this.nf=void 0)},t.prototype.unlock=function(t){this.q-=1,0===this.q&&(t&&this.tf&&this.update(this.nf),this.tf=!1,this.nf=void 0)},t.prototype.update=function(t){if(0<this.q)return this.tf=!0,void(null!=t&&(this.nf||(this.nf=t)));var n=this.p,i=n.width,r=n.height,e=n.content,u=-e.x,s=-e.y,h=this.vertical,o=h.width,a=this.getOffsetVerticalStart(o),c=this.getOffsetVerticalEnd(o);h.set(s,s+r,e.height,t),h.position.set(i-o,a),h.height=r-a-c;var f=this.horizontal,l=f.height,v=this.getOffsetHorizontalStart(l),b=this.getOffsetHorizontalEnd(l);f.set(u,u+i,e.width,t),f.position.set(v,r-l),f.width=i-v-b,this.$c(h.isRegionVisible()||f.isRegionVisible())},t.prototype.touch=function(t){this.vertical.touch(t),this.horizontal.touch(t)},t.prototype.getOffsetHorizontalStart=function(t){return.5*t},t.prototype.getOffsetHorizontalEnd=function(t){return.5*t},t.prototype.getOffsetVerticalStart=function(t){return.5*t},t.prototype.getOffsetVerticalEnd=function(t){return.5*t},t}(),yd=function(n){function i(t){var i,r=this,e=(r=n.call(this,t)||this).theme;(null!==(i=null==t?void 0:t.mask)&&void 0!==i?i:e.isOverflowMaskEnabled())&&(r.mask=r.getOverflowMask()),r.addChild(r.content);var u=r.scrollbar;return r.addChild(u.vertical),r.addChild(u.horizontal),u.update(),r.initGesture(e,t),r}return B(i,n),i.prototype.initGesture=function(n,i){var r,e,u=this,s=Di(null!==(e=null===(r=null==i?void 0:i.gesture)||void 0===r?void 0:r.mode)&&void 0!==e?e:n.getGestureMode(),ir);if(s===ir.ON||s===ir.TOUCH){var h=new t.Point,o=this.content;this.Ni=new or({bind:this,touch:s===ir.TOUCH,on:{start:function(){h.copyFrom(o.position)},move:function(t,n,i){h.set(h.x+n,h.y+i),o.position.set(u.toContentX(o,h.x),u.toContentY(o,h.y))}}})}},Object.defineProperty(i.prototype,"scrollbar",{get:function(){var t,n=this.if;return null==n&&(n=this.newScrollBar(null===(t=this.kn)||void 0===t?void 0:t.scrollbar),this.initScrollBar(n),this.if=n),n},enumerable:!1,configurable:!0}),i.prototype.newScrollBar=function(t){var n=this;return new Ld(this,t,(function(t){n.onScrollBarUpdate(t)}))},i.prototype.onScrollBarUpdate=function(t){var n=this.er;if(null!=n){var i=this.content;t?i.mask!==n&&(i.mask=n,rt.update(this)):i.mask&&(i.mask=null,rt.update(this))}},i.prototype.initScrollBar=function(t){var n=this;t.vertical.on("regionmove",(function(t){n.onScrollBarMoveY(t)})),t.horizontal.on("regionmove",(function(t){n.onScrollBarMoveX(t)}))},i.prototype.onScrollBarMoveX=function(t){var n=this.Ni;null!=n&&n.stop(this);var i=this.content;i.x=-i.width*t},i.prototype.onScrollBarMoveY=function(t){var n=this.Ni;null!=n&&n.stop(this);var i=this.content;i.y=-i.height*t},i.prototype.onOver=function(t){n.prototype.onOver.call(this,t),this.scrollbar.touch()},i.prototype.getType=function(){return"DPane"},Object.defineProperty(i.prototype,"content",{get:function(){var t=this.oh;return null==t&&(t=this.toContent(this.kn),this.initContent(t),this.oh=t),t},enumerable:!1,configurable:!0}),i.prototype.toContent=function(t){var n=null==t?void 0:t.content;return n?n instanceof Qi?n:this.newContent(n):this.newContent()},i.prototype.newContent=function(t){return new Md(t)},i.prototype.initContent=function(t){var n=this;t.on("move",(function(){n.onContentChange()})),t.on("resize",(function(){n.onContentChange()}))},i.prototype.getOverflowMask=function(){var t=this.er;return null==t&&(t=new $i(this),this.er=t,this.reflowable.add(t),this.toDirty()),t},i.prototype.onWheel=function(t,n,i){var r=this.content,e=this.getWheelContentX(r,n.deltaX*n.lowest),u=this.getWheelContentY(r,n.deltaY*n.lowest);if(r.x!==e||r.y!==u){var s=this.Ni;return null!=s&&s.stop(this),r.position.set(e,u),!0}return!1},i.prototype.getWheelContentX=function(t,n){if(0<n||n<0){var i=this.theme.getWheelSpeed();return this.toContentX(t,t.x-n*i)}return t.x},i.prototype.getWheelContentY=function(t,n){if(0<n||n<0){var i=this.theme.getWheelSpeed();return this.toContentY(t,t.y+n*i)}return t.y},i.prototype.toContentX=function(t,n){return Math.min(0,Math.max(this.width-t.width,n))},i.prototype.toContentY=function(t,n){return Math.min(0,Math.max(this.height-t.height,n))},i.prototype.isRefitable=function(t){return n.prototype.isRefitable.call(this,t)&&!(t instanceof Sd)},i.prototype.onResize=function(t,i,r,e){var u=this.scrollbar;u.lock(),n.prototype.onResize.call(this,t,i,r,e),u.update(),u.unlock(!0)},i.prototype.onContentChange=function(){this.scrollbar.update()},i.prototype.getFocusedChildClippingRect=function(t,n,i,r,e,u,s,h){return h.x=0,h.y=0,h.width=u,h.height=s,h},i.prototype.onChildFocus=function(r){var e=i.WORK_POINT||new t.Point;i.WORK_POINT=e;var u=this.content,s=u.x,h=u.y,o=u.width,a=u.height;e.set(0,0),r.toGlobal(e,e,!1),u.toLocal(e,void 0,e,!1);var c=s+Math.min(o,Math.max(0,e.x)),f=h+Math.min(a,Math.max(0,e.y));e.set(r.width,r.height),r.toGlobal(e,e,!0),u.toLocal(e,void 0,e,!0);var l=s+Math.min(o,Math.max(0,e.x)),v=h+Math.min(a,Math.max(0,e.y)),b=this.width,d=this.height,g=i.WORK_RECTANGLE||new t.Rectangle;i.WORK_RECTANGLE=g,this.getFocusedChildClippingRect(r,s,h,o,a,b,d,g);var m=g.x,w=g.y,p=m,O=w,D=m+g.width,E=w+g.height,M=null;c<p?l<=D&&(M=s+Math.min(p-c,D-l),M=Math.max(b-o,Math.min(0,M))):D<l&&(M=s-Math.min(c-p,l-D),M=Math.max(b-o,Math.min(0,M)));var S=null;f<O?v<=E&&(S=h+Math.min(O-f,E-v),S=Math.max(d-a,Math.min(0,S))):E<v&&(S=h-Math.min(f-O,v-E),S=Math.max(d-a,Math.min(0,S)));var T=u.position;null!=M?null!=S?T.set(M,S):T.x=M:null!=S&&(T.y=S),n.prototype.onChildFocus.call(this,r)},i.prototype.destroy=function(){var t=this.er;null!=t&&(this.er=null,t.destroy()),this.mask=null,n.prototype.destroy.call(this)},i}(Qi),kd=function(t){function n(n){var i=t.call(this,n)||this;return i.update(),i}return B(n,t),Object.defineProperty(n.prototype,"updater",{get:function(){var t=this.rf;return null==t&&(t=this.newUpdater(this.data,this.content,this.kn),this.rf=t),t},enumerable:!1,configurable:!0}),n.prototype.newUpdater=function(t,n,i){return new ld(t,n,n,null==i?void 0:i.updater)},Object.defineProperty(n.prototype,"data",{get:function(){var t=this.Pt;return null==t&&(t=this.toData(this.kn),this.Pt=t),t},enumerable:!1,configurable:!0}),n.prototype.toData=function(t){var n=t&&(t.data||t.items),i=null==t?void 0:t.selection;return null==n?i?new Ed(this,{selection:i}):new Ed(this):Rt(n)?new Ed(this,i?{items:n,selection:i}:{items:n}):"each"in n?n:i?(void 0===n.selection&&(n.selection=i),new Ed(this,n)):new Ed(this,n)},n.prototype.onContentChange=function(){t.prototype.onContentChange.call(this),this.update()},n.prototype.onResize=function(n,i,r,e){var u=this.updater;u.lock(),t.prototype.onResize.call(this,n,i,r,e),u.update(),u.unlock(!0)},Object.defineProperty(n.prototype,"selection",{get:function(){return this.data.selection},enumerable:!1,configurable:!0}),n.prototype.lock=function(){this.updater.lock()},n.prototype.unlock=function(t){this.updater.unlock(t)},n.prototype.update=function(t){this.updater.update(t)},n.prototype.onKeyDown=function(n){return this.updater.moveFocus(n,this,!0,!0),t.prototype.onKeyDown.call(this,n)},n.prototype.getType=function(){return"DList"},n}(yd),xd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.newUpdater=function(t,n,i){return new vd(t,n,n,null==i?void 0:i.updater)},n.prototype.getType=function(){return"DDialogSelectList"},n}(kd),Bd=function(t){function n(n){var i=t.call(this)||this;return i.ef=n||function(t){return Promise.resolve([])},i.R=0,i.uf=0,i}return B(n,t),n.prototype.create=function(t){var n=this,i=++this.R;this.ef(t[0]).then((function(t){n.R===i&&(n.uf=i,n.emit("success",n,t),n.emit("change",n))}),(function(){n.R===i&&(n.uf=i,n.emit("fail",n),n.emit("change",n))})),this.emit("change",this)},n.prototype.isDone=function(){return this.R===this.uf},n}(t.utils.EventEmitter),_d=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DInputSearch"},n}(zs),Pd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DNote"},n}(bs),Ud=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DNoteSmall"},n}(Pd),Fd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DNoteSmallError"},n}(Ud),Gd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DNoteSmallNoItemsFound"},n}(Ud),Hd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DNoteSmallSearching"},n}(Ud),zd=function(t){function n(n,i){var r=t.call(this)||this;return r.Jn=n,r.Rt=i.value,r.sf=i.filter,n.on("change",(function(){r.emit("change",r)})),n.on("success",(function(t,n){r.emit("success",r,r.toDismissable(n))})),n.on("fail",(function(){r.emit("fail",r)})),r}return B(n,t),n.prototype.toDismissValue=function(t){if(null!=t){var n=this.Rt;if(void 0!==n){var i=this.sf;if(null==i||i(n,t[0]))return n}}},n.prototype.toDismissable=function(t){var n=this.toDismissValue(this.hf);if(void 0===n)return t;for(var i=[],r=0,e=t.length;r<e;++r)i.push(t[r]);return i.push(n),i},n.prototype.create=function(t){this.hf=t,this.Jn.create(t)},n.prototype.isDone=function(){return this.Jn.isDone()},n}(t.utils.EventEmitter),Vd=function(t){function n(n){var i=t.call(this,n)||this;i.Rt=null;var r=new bb,e=i.search;return e.on("success",(function(t,n){0<n.length?r.hide():r.show(i.noteNoItemsFound),i.onSearched(n)})),e.on("fail",(function(){r.show(i.noteError),i.onSearched([])})),e.on("change",(function(){if(!e.isDone()){var t=i.noteSearching;t&&r.show(t)}})),i}return B(n,t),n.prototype.newContentChildren=function(n,i){var r=t.prototype.newContentChildren.call(this,n,i);return r.push(this.inputLayout,this.list),r},Object.defineProperty(n.prototype,"inputLayout",{get:function(){var t=this.fh;return null==t&&(t=this.newInputLayout(this.input,this.theme,this.kn),this.fh=t),t},enumerable:!1,configurable:!0}),n.prototype.newInputLayout=function(t,n,i){return new ws(this.toInputLayoutOptions(t,n,i))},n.prototype.toInputLayoutOptions=function(t,n,i){var r=this.toInputMargin(n,i);return{width:"padding",height:"auto",children:[new _u({width:r}),t,new _u({width:r})]}},Object.defineProperty(n.prototype,"input",{get:function(){var t=this.lh;return null==t&&(t=this.newInput(),this.lh=t),t},enumerable:!1,configurable:!0}),n.prototype.newInput=function(){var t=this,n=new _d(this.toInputOptions(this.theme,this.kn));return n.on("input",(function(n){t.search.create([n])})),n},n.prototype.toInputOptions=function(t,n){var i=(null==n?void 0:n.input)||{};return void 0===i.width&&void 0===i.weight&&(i.weight=1),i},n.prototype.toInputMargin=function(t,n){var i,r;return null!==(r=null===(i=null==n?void 0:n.input)||void 0===i?void 0:i.margin)&&void 0!==r?r:t.getInputMargin()},Object.defineProperty(n.prototype,"list",{get:function(){var t=this.Rn;return null==t&&(t=this.newList(),this.Rn=t),t},enumerable:!1,configurable:!0}),n.prototype.newList=function(){var t=this,n=new xd(this.toListOptions(this.theme,this.kn));return n.selection.on("change",(function(n){t.onListSelectionChange(n)})),n},n.prototype.onListSelectionChange=function(t){var n=t.first;if(null!=n){var i=this.kn;if(i){var r=i.dismiss;r&&n===r.value&&(n=null)}this.Rt=n,this.onOk(n)}},n.prototype.toListOptions=function(t,n){var i=(null==n?void 0:n.list)||{};return void 0===i.width&&(i.width="padding"),i},Object.defineProperty(n.prototype,"noteError",{get:function(){var t=this.af;return null==t&&(t=this.newNoteError(),this.af=t),t},enumerable:!1,configurable:!0}),n.prototype.newNoteError=function(){var t,n,i=null===(n=null===(t=this.kn)||void 0===t?void 0:t.note)||void 0===n?void 0:n.error;return null!==i?new Fd(this.toNoteOptions(this.list,i)):null},Object.defineProperty(n.prototype,"noteNoItemsFound",{get:function(){var t=this.cf;return null==t&&(t=this.newNoteNoItemsFound(),this.cf=t),t},enumerable:!1,configurable:!0}),n.prototype.newNoteNoItemsFound=function(){var t,n,i=null===(n=null===(t=this.kn)||void 0===t?void 0:t.note)||void 0===n?void 0:n.noItemsFound;return null!==i?new Gd(this.toNoteOptions(this.list,i)):null},Object.defineProperty(n.prototype,"noteSearching",{get:function(){var t=this.ff;return null==t&&(t=this.newNoteSearching(),this.ff=t),t},enumerable:!1,configurable:!0}),n.prototype.newNoteSearching=function(){var t,n,i=null===(n=null===(t=this.kn)||void 0===t?void 0:t.note)||void 0===n?void 0:n.searching;return null!=i?new Hd(this.toNoteOptions(this.list,i)):null},n.prototype.toNoteOptions=function(t,n){return null!=n?(null==n.parent&&(n.parent=t),null==n.visible&&(n.visible=!1),n):{parent:t,visible:!1}},Object.defineProperty(n.prototype,"search",{get:function(){var t=this.ef;return null==t&&(t=this.newSearch(),this.ef=t),t},enumerable:!1,configurable:!0}),n.prototype.newSearch=function(){var t=this.kn;if(t){var n=t.controller;if(n){var i=t.dismiss,r=n.search;return"create"in r?null!=i?new zd(r,i):r:null!=i?new zd(new Bd(r),i):new Bd(r)}}return new Bd},Object.defineProperty(n.prototype,"value",{get:function(){return this.Rt},enumerable:!1,configurable:!0}),n.prototype.onSearched=function(t){this.list.data.items=t},n.prototype.getResolvedValue=function(){return this.Rt},n.prototype.getType=function(){return"DDialogSelect"},n.prototype.onOpen=function(){t.prototype.onOpen.call(this),this.list.selection.clear(),this.search.create([this.input.value])},n.prototype.onOk=function(n){this.emit("select",n,this),t.prototype.onOk.call(this,n)},n.prototype.destroy=function(){var n=this.lh;n&&n.destroy();var i=this.af;i&&i.destroy();var r=this.cf;r&&(null==r||r.destroy());var e=this.ff;e&&(null==e||e.destroy());var u=this.Rn;u&&u.destroy(),t.prototype.destroy.call(this)},n}(Ss),Wd=function(t){return t.value},Xd=function(){},Kd=function(t){function n(n){var i,r,e=this;return(e=t.call(this,function(t){var n,i,r;if(t){var e,u=null===(n=t.text)||void 0===n?void 0:n.formatter;if(void 0!==u){if(!(e=t.dialog)||!("open"in e)){var s=(e=e||{}).item=e.item||{};void 0===(o=s.text=s.text||{}).formatter&&(o.formatter=u)}}else if(!(e=t.dialog)||!("open"in e)){var h=null===(r=null===(i=null==e?void 0:e.item)||void 0===i?void 0:i.text)||void 0===r?void 0:r.formatter;if(void 0!==h){var o=t.text||{};t.text=o,void 0===o.formatter&&(o.formatter=h)}}}return t}(n))||this).lf=null!==(i=null==n?void 0:n.getter)&&void 0!==i?i:Wd,e.vf=null!==(r=null==n?void 0:n.setter)&&void 0!==r?r:Xd,e}return B(n,t),n.prototype.onActivate=function(n){var i,r=this;t.prototype.onActivate.call(this,n);var e=this.dialog,u=null!==(i=this.Ws)&&void 0!==i?i:null;this.vf(e,u),e.open(this).then((function(){var t=r.lf(e);t!==u&&(r.text=t,r.emit("change",t,u,r))}))},Object.defineProperty(n.prototype,"dialog",{get:function(){var t,n=this.Tc;if(null==n){var i=null===(t=this.kn)||void 0===t?void 0:t.dialog;n=i&&"open"in i?i:new Vd(i),this.Tc=n}return n},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"value",{get:function(){var t;return null!==(t=this.Ws)&&void 0!==t?t:null},set:function(t){this.text=t},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DButtonSelect"},n}(gs),Yd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.onActivate=function(n){var i,r,e=this;t.prototype.onActivate.call(this,n);var u=null!==(r=null===(i=this.Ws)||void 0===i?void 0:i.getTime())&&void 0!==r?r:Date.now(),s=this.dialog;s.current=new Date(u),s.new=new Date(u),s.open(this).then((function(){e.onValueChange(s.new,s.current)}))},n.prototype.onValueChange=function(t,n){this.text=new Date(t.getTime()),this.emit("change",t,n,this)},n.prototype.getDatetimeMask=function(){var t,n,i=this.jc;return null==i&&(i=$b.toMask(null===(n=null===(t=this.kn)||void 0===t?void 0:t.dialog)||void 0===n?void 0:n.picker),this.jc=i),i},Object.defineProperty(n.prototype,"dialog",{get:function(){var t,i=this.Tc;if(null==i){var r=null===(t=this.kn)||void 0===t?void 0:t.dialog;r?i=this.newDialog(r):(null==n.DIALOG&&(n.DIALOG=this.newDialog({mode:"MENU",sticky:!0})),i=n.DIALOG),this.Tc=i}return i},enumerable:!1,configurable:!0}),n.prototype.newDialog=function(t){return new vh(t)},Object.defineProperty(n.prototype,"value",{get:function(){var t;return null!==(t=this.Ws)&&void 0!==t?t:new Date},set:function(t){var n=this.Ws;void 0!==n&&n.getTime()===t.getTime()||(this.text=t)},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DButtonTime"},n}(gs),Jd=function(t){function n(n){var i=t.call(this,n)||this,r=i.state,e=Sb.getCommandController();return r.isDisabled=!e.isUndoable(),e.on("change",(function(){r.isDisabled=!e.isUndoable()})),i}return B(n,t),n.prototype.onActivate=function(n){t.prototype.onActivate.call(this,n),Sb.getCommandController().undo()},n}(gs),Zd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DCanvas"},n}(Qi),qd={TOP:0,BOTTOM:1,LEFT:2,RIGHT:3},Qd=function(){function t(t){this.bf=t,this.Qe=0}return Object.defineProperty(t.prototype,"shape",{get:function(){var t=this._r;return null==t&&(t=this.newShape(),this._r=t),t},enumerable:!1,configurable:!0}),t.prototype.newShape=function(){var t,n=this.bf,i=n.bar,r=new Kt;return r.points.position=this.newShapePosition(),r.points.style=null!==(t=i.style)&&void 0!==t?t:F.NONE,r.stroke.copy(i.stroke),r.text.copy(n.label),r},t.prototype.newShapePosition=function(){switch(this.bf.position){case qd.LEFT:case qd.RIGHT:return $.TOP;default:return $.LEFT}},t.prototype.bind=function(t,n){this.xc=t,this.Qe=n,this.shape.attach(t.container)},t.prototype.unbind=function(){var t=this._r;null!=t&&t.detach(),this.Qe=0,this.xc=void 0},t.prototype.update=function(){var t=this.xc,n=this.Qe,i=this._r;if(null!=i&&null!=t){var r=t.plotArea,e=r.width,u=r.height,s=this.bf.padding*n;i.disallowUploadedUpdate();var h=i.transform.position,o=i.size;switch(this.bf.position){case qd.TOP:h.set(.5*e,0-s),o.set(e,0);break;case qd.BOTTOM:h.set(.5*e,u+s),o.set(e,0);break;case qd.LEFT:h.set(0-s,.5*u),o.set(0,u);break;case qd.RIGHT:h.set(e+s,.5*u),o.set(0,u)}return i.allowUploadedUpdate(),!0}return!1},t.prototype.destroy=function(){var t=this._r;null!=t&&t.destroy(),this.Qe=0,this.xc=void 0},t}(),$d={INSIDE:0,OUTSIDE:1},tg=function(){function t(t,n){var i,r;this.df=null!==(i=null==n?void 0:n.coordinate)&&void 0!==i?i:0,this._=this.toPosition(t,n),this.gf=this.toTickContainer(t,n),this.Rh=this.toLabel(t,n),this.zn=null!==(r=null==n?void 0:n.padding)&&void 0!==r?r:t.getPadding(),this.mf=this.toBar(t,n)}return Object.defineProperty(t.prototype,"coordinateIndex",{get:function(){return this.df},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"padding",{get:function(){return this.zn},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"position",{get:function(){return this._},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bar",{get:function(){return this.mf},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tick",{get:function(){return this.gf},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"label",{get:function(){return this.Rh},enumerable:!1,configurable:!0}),t.prototype.toPosition=function(t,n){var i=null==n?void 0:n.position;return at(i)?qd[i]:null!=i?i:t.getPosition()},t.prototype.toBar=function(t,n){var i;return{style:null!==(i=null==n?void 0:n.style)&&void 0!==i?i:t.getStyle(),stroke:this.toBarStroke(t,null==n?void 0:n.stroke)}},t.prototype.toTickContainer=function(t,n){var i,r=null==n?void 0:n.tick;return{enable:null!==(i=null==r?void 0:r.enable)&&void 0!==i?i:t.getTickEnable(),major:this.toTickMajor(t,r),minor:this.toTickMinor(t,r)}},t.prototype.toTickMajor=function(t,n){var i,r,e,u,s,h,o,a,c=null==n?void 0:n.major,f=null!==(r=null!==(i=null==c?void 0:c.position)&&void 0!==i?i:null==n?void 0:n.position)&&void 0!==r?r:t.getMajorTickPosition(),l=null==n?void 0:n.style,v=Lv.from(null!==(u=null!==(e=null==c?void 0:c.style)&&void 0!==e?e:l)&&void 0!==u?u:t.getMajorTickStyle()),b=null==n?void 0:n.stroke,d=this.toTickMajorStroke(t,null==c?void 0:c.stroke,b),g=null!==(s=null==c?void 0:c.count)&&void 0!==s?s:t.getMajorTickCount();return{count:g,capacity:null!==(h=null==c?void 0:c.capacity)&&void 0!==h?h:t.getMajorTickCapacity(g),step:null!==(o=null==c?void 0:c.step)&&void 0!==o?o:t.getMajorTickStep(),size:null!==(a=null==c?void 0:c.size)&&void 0!==a?a:t.getMajorTickSize(),position:this.toTickPosition(f),style:v,stroke:d,text:this.toTickMajorText(t,null==c?void 0:c.text),formatter:this.toTickMajorFormatter(t,c),gridline:this.toTickMajorGridline(t,null==c?void 0:c.gridline,l,b)}},t.prototype.toTickMajorGridline=function(t,n,i,r){var e,u,s,h=Lv.from(null!==(u=null!==(e=null==n?void 0:n.style)&&void 0!==e?e:i)&&void 0!==u?u:t.getMajorTickGridlineStyle());return{enable:null!==(s=null==n?void 0:n.enable)&&void 0!==s?s:t.getMajorTickGridlineEnable(),style:h,stroke:this.toTickMajorGridlineStroke(t,null==n?void 0:n.stroke,r)}},t.prototype.toTickPosition=function(t){var n=this._;if(t===$d.OUTSIDE||"OUTSIDE"===t)switch(n){case qd.TOP:return $.BOTTOM;case qd.BOTTOM:return $.TOP;case qd.LEFT:return $.RIGHT;case qd.RIGHT:return $.LEFT;default:return $.TOP}else switch(n){case qd.TOP:return $.TOP;case qd.BOTTOM:return $.BOTTOM;case qd.LEFT:return $.LEFT;case qd.RIGHT:return $.RIGHT;default:return $.TOP}},t.prototype.toTickMinor=function(t,n){var i,r,e,u,s,h,o,a=null==n?void 0:n.minor,c=null!==(r=null!==(i=null==a?void 0:a.position)&&void 0!==i?i:null==n?void 0:n.position)&&void 0!==r?r:t.getMinorTickPosition(),f=Lv.from(null!==(u=null!==(e=null==a?void 0:a.style)&&void 0!==e?e:null==n?void 0:n.style)&&void 0!==u?u:t.getMinorTickStyle());return{count:null!==(s=null==a?void 0:a.count)&&void 0!==s?s:t.getMinorTickCount(),step:null!==(h=null==a?void 0:a.step)&&void 0!==h?h:t.getMinorTickStep(),size:null!==(o=null==a?void 0:a.size)&&void 0!==o?o:t.getMinorTickSize(),position:this.toTickPosition(c),style:f,stroke:this.toTickMinorStroke(t,null==a?void 0:a.stroke,null==n?void 0:n.stroke),text:this.toTickMinorText(t,null==a?void 0:a.text),formatter:this.toTickMinorFormatter(t,a)}},t.prototype.toBarStroke=function(t,n){return this.toStroke(n,void 0,t.getStrokeEnable(),t.getStrokeColor(),t.getStrokeAlpha(),t.getStrokeWidth(),t.getStrokeAlign(),t.getStrokeSide(),t.getStrokeStyle())},t.prototype.toTickMajorStroke=function(t,n,i){return this.toStroke(n,i,t.getMajorTickStrokeEnable(),t.getMajorTickStrokeColor(),t.getMajorTickStrokeAlpha(),t.getMajorTickStrokeWidth(),t.getMajorTickStrokeAlign(),t.getMajorTickStrokeSide(),t.getMajorTickStrokeStyle())},t.prototype.toTickMajorGridlineStroke=function(t,n,i){return this.toStroke(n,i,t.getMajorTickGridlineStrokeEnable(),t.getMajorTickGridlineStrokeColor(),t.getMajorTickGridlineStrokeAlpha(),t.getMajorTickGridlineStrokeWidth(),t.getMajorTickGridlineStrokeAlign(),t.getMajorTickGridlineStrokeSide(),t.getMajorTickGridlineStrokeStyle())},t.prototype.toTickMinorStroke=function(t,n,i){return this.toStroke(n,i,t.getMinorTickStrokeEnable(),t.getMinorTickStrokeColor(),t.getMinorTickStrokeAlpha(),t.getMinorTickStrokeWidth(),t.getMinorTickStrokeAlign(),t.getMinorTickStrokeSide(),t.getMinorTickStrokeStyle())},t.prototype.toStroke=function(t,n,i,r,e,u,s,h,o){var a,c,f,l,v,b,d,g,m,w,p,O,D,E,M,S,T,j,N,I,C,A,R,L,y,k,x,B;return t?n?{enable:null!==(c=null!==(a=t.enable)&&void 0!==a?a:n.enable)&&void 0!==c?c:i,color:null!==(l=null!==(f=t.color)&&void 0!==f?f:n.color)&&void 0!==l?l:r,alpha:null!==(b=null!==(v=t.alpha)&&void 0!==v?v:n.alpha)&&void 0!==b?b:e,width:null!==(g=null!==(d=t.width)&&void 0!==d?d:n.width)&&void 0!==g?g:u,align:null!==(w=null!==(m=t.align)&&void 0!==m?m:n.align)&&void 0!==w?w:s,side:null!==(O=null!==(p=t.side)&&void 0!==p?p:n.side)&&void 0!==O?O:h,style:null!==(E=null!==(D=t.style)&&void 0!==D?D:n.style)&&void 0!==E?E:o}:{enable:null!==(M=t.enable)&&void 0!==M?M:i,color:null!==(S=t.color)&&void 0!==S?S:r,alpha:null!==(T=t.alpha)&&void 0!==T?T:e,width:null!==(j=t.width)&&void 0!==j?j:u,align:null!==(N=t.align)&&void 0!==N?N:s,side:null!==(I=t.side)&&void 0!==I?I:h,style:null!==(C=t.style)&&void 0!==C?C:o}:n?{enable:null!==(A=n.enable)&&void 0!==A?A:i,color:null!==(R=n.color)&&void 0!==R?R:r,alpha:null!==(L=n.alpha)&&void 0!==L?L:e,width:null!==(y=n.width)&&void 0!==y?y:u,align:null!==(k=n.align)&&void 0!==k?k:s,side:null!==(x=n.side)&&void 0!==x?x:h,style:null!==(B=n.style)&&void 0!==B?B:o}:{enable:i,color:r,alpha:e,width:u,align:s,side:h,style:o}},t.prototype.toTickMajorFormatter=function(t,n){var i=null==n?void 0:n.text;if(i){var r=i.format;if(null===r)return;if(null!=r)return bi.create(r);var e=i.formatter;if(e)return{format:e}}var u=t.getMajorTickTextFormat();if(null!=u)return bi.create(u)},t.prototype.toTickMajorText=function(t,n){return{format:(n=n||{}).format,color:this.toTickMajorTextColor(t,n.color),alpha:n.alpha,family:n.family,size:n.size,weight:n.weight,align:this.toTickMajorTextAlign(t,n.align),offset:this.toTickMajorTextOffset(t,n.offset),style:n.style,outline:this.toTickMajorTextOutline(t,n.outline),spacing:this.toTickMajorTextSpacing(t,n.spacing),direction:this.toTickMajorTextDirection(t,n.direction),padding:this.toTickMajorTextPadding(t,n.padding),clipping:n.clipping}},t.prototype.toTickMajorTextOutline=function(t,n){if(n)return{enable:n.enable,color:n.color,alpha:n.alpha,width:n.width}},t.prototype.toTickMajorTextAlign=function(t,n){var i,r,e=this._;return{horizontal:null!==(i=null==n?void 0:n.horizontal)&&void 0!==i?i:t.getMajorTickTextAlignHorizontal(e),vertical:null!==(r=null==n?void 0:n.vertical)&&void 0!==r?r:t.getMajorTickTextAlignVertical(e)}},t.prototype.toTickMajorTextOffset=function(t,n){if(n)return{horizontal:n.horizontal,vertical:n.vertical}},t.prototype.toTickMajorTextSpacing=function(t,n){if(n)return{horizontal:n.horizontal,vertical:n.vertical}},t.prototype.toTickMajorTextPadding=function(t,n){var i,r;return{horizontal:null!==(i=null==n?void 0:n.horizontal)&&void 0!==i?i:t.getMajorTickTextPaddingHorizontal(),vertical:null!==(r=null==n?void 0:n.vertical)&&void 0!==r?r:t.getMajorTickTextPaddingVertical()}},t.prototype.toTickMajorTextDirection=function(t,n){return null!=n?n:t.getMajorTickTextDirection()},t.prototype.toTickMajorTextColor=function(t,n){return null!=n?n:t.getMajorTickTextColor()},t.prototype.toTickMinorFormatter=function(t,n){var i=null==n?void 0:n.text;if(i){var r=i.format;if(null===r)return;if(null!=r)return bi.create(r);var e=i.formatter;if(e)return{format:e}}var u=t.getMinorTickTextFormat();if(null!=u)return bi.create(u)},t.prototype.toTickMinorText=function(t,n){return{format:(n=n||{}).format,color:this.toTickMinorTextColor(t,n.color),alpha:n.alpha,family:n.family,size:n.size,weight:n.weight,align:this.toTickMinorTextAlign(t,n.align),offset:this.toTickMinorTextOffset(t,n.offset),style:n.style,outline:this.toTickMinorTextOutline(t,n.outline),spacing:this.toTickMinorTextSpacing(t,n.spacing),direction:this.toTickMinorTextDirection(t,n.direction),padding:this.toTickMinorTextPadding(t,n.padding),clipping:n.clipping}},t.prototype.toTickMinorTextOutline=function(t,n){if(n)return{enable:n.enable,color:n.color,alpha:n.alpha,width:n.width}},t.prototype.toTickMinorTextAlign=function(t,n){var i,r,e=this._;return{horizontal:null!==(i=null==n?void 0:n.horizontal)&&void 0!==i?i:t.getMinorTickTextAlignHorizontal(e),vertical:null!==(r=null==n?void 0:n.vertical)&&void 0!==r?r:t.getMinorTickTextAlignVertical(e)}},t.prototype.toTickMinorTextOffset=function(t,n){if(n)return{horizontal:n.horizontal,vertical:n.vertical}},t.prototype.toTickMinorTextSpacing=function(t,n){if(n)return{horizontal:n.horizontal,vertical:n.vertical}},t.prototype.toTickMinorTextPadding=function(t,n){var i,r;return{horizontal:null!==(i=null==n?void 0:n.horizontal)&&void 0!==i?i:t.getMinorTickTextPaddingHorizontal(),vertical:null!==(r=null==n?void 0:n.vertical)&&void 0!==r?r:t.getMinorTickTextPaddingVertical()}},t.prototype.toTickMinorTextDirection=function(t,n){return null!=n?n:t.getMinorTickTextDirection()},t.prototype.toTickMinorTextColor=function(t,n){return null!=n?n:t.getMinorTickTextColor()},t.prototype.toLabel=function(t,n){var i=null==n?void 0:n.label;if(i)return{value:i.value,color:this.toLabelColor(t,i.color),alpha:i.alpha,family:i.family,size:i.size,weight:i.weight,align:this.toLabelAlign(t,i.align),offset:this.toLabelOffset(t,i.offset),style:i.style,outline:this.toLabelOutline(t,i.outline),spacing:this.toLabelSpacing(t,i.spacing),direction:this.toLabelDirection(t,i.direction),padding:this.toLabelPadding(t,i.padding),clipping:i.clipping}},t.prototype.toLabelOutline=function(t,n){if(n)return{enable:n.enable,color:n.color,alpha:n.alpha,width:n.width}},t.prototype.toLabelAlign=function(t,n){var i,r,e=this._;return{horizontal:null!==(i=null==n?void 0:n.horizontal)&&void 0!==i?i:t.getLabelAlignHorizontal(e),vertical:null!==(r=null==n?void 0:n.vertical)&&void 0!==r?r:t.getLabelAlignVertical(e)}},t.prototype.toLabelOffset=function(t,n){if(n)return{horizontal:n.horizontal,vertical:n.vertical}},t.prototype.toLabelSpacing=function(t,n){if(n)return{horizontal:n.horizontal,vertical:n.vertical}},t.prototype.toLabelPadding=function(t,n){var i,r;return{horizontal:null!==(i=null==n?void 0:n.horizontal)&&void 0!==i?i:t.getLabelPaddingHorizontal(),vertical:null!==(r=null==n?void 0:n.vertical)&&void 0!==r?r:t.getLabelPaddingVertical()}},t.prototype.toLabelDirection=function(t,n){return null!=n?n:t.getLabelDirection()},t.prototype.toLabelColor=function(t,n){return null!=n?n:t.getLabelColor()},t}(),ng=function(){function t(t){this.bf=t,this.Qe=0}return Object.defineProperty(t.prototype,"shapes",{get:function(){var t=this.Lr;return null==t&&(t=this.newShapes(),this.Lr=t),t},enumerable:!1,configurable:!0}),t.prototype.newShapes=function(){var t,n=[],i=this.bf.tick,r=i.major,e=r.gridline;if(i.enable&&e.enable)for(var u=r.capacity,s=null!==(t=e.style)&&void 0!==t?t:F.NONE,h=this.newShapePosition(),o=0;o<u;++o){var a=new Kt;a.points.position=h,a.points.style=s,a.stroke.copy(e.stroke),n.push(a)}return n},t.prototype.newShapePosition=function(){switch(this.bf.position){case qd.LEFT:case qd.RIGHT:return $.LEFT;default:return $.TOP}},t.prototype.bind=function(t,n){this.xc=t,this.Qe=n;for(var i=this.shapes,r=t.container,e=0,u=i.length;e<u;++e)i[e].attach(r)},t.prototype.unbind=function(){var t=this.Lr;if(null!=t)for(var n=0,i=t.length;n<i;++n)t[n].detach();this.Qe=0,this.xc=void 0},t.prototype.destroy=function(){var t=this.Lr;if(null!=t)for(var n=0,i=t.length;n<i;++n)t[n].destroy();this.Qe=0,this.xc=void 0},t}(),ig=function(){function t(t){this.bf=t,this.Qe=0,this.wf=new ng(t)}return Object.defineProperty(t.prototype,"shapes",{get:function(){var t=this.Lr;return null==t&&(t=this.newShapes(),this.Lr=t),t},enumerable:!1,configurable:!0}),t.prototype.newShapes=function(){var t,n=[],i=this.bf.tick;if(i.enable)for(var r=i.major,e=r.capacity,u=r.size,s=r.position,h=null!==(t=r.style)&&void 0!==t?t:F.NONE,o=0;o<e;++o){var a=new Kt;a.points.position=s,a.points.size=u,a.points.style=h,a.stroke.copy(r.stroke),a.text.copy(r.text),a.size.set(0,0),n.push(a)}return n},Object.defineProperty(t.prototype,"gridline",{get:function(){return this.wf},enumerable:!1,configurable:!0}),t.prototype.bind=function(t,n){this.xc=t,this.Qe=n,this.wf.bind(t,n);for(var i=this.shapes,r=t.container,e=0,u=i.length;e<u;++e)i[e].attach(r)},t.prototype.unbind=function(){var t=this.Lr;if(null!=t)for(var n=0,i=t.length;n<i;++n)t[n].detach();this.wf.unbind(),this.Qe=0,this.xc=void 0},t.prototype.destroy=function(){var t=this.Lr;if(null!=t)for(var n=0,i=t.length;n<i;++n)t[n].destroy();this.wf.destroy(),this.Qe=0,this.xc=void 0},t}(),rg=function(){function t(t){this.bf=t,this.Qe=0}return Object.defineProperty(t.prototype,"shapes",{get:function(){var t=this.Lr;return null==t&&(t=this.newShapes(),this.Lr=t),t},enumerable:!1,configurable:!0}),t.prototype.newShapes=function(){var t,n=[],i=this.bf.tick;if(i.enable)for(var r=i.minor,e=r.count,u=r.size,s=r.position,h=null!==(t=r.style)&&void 0!==t?t:F.NONE,o=0,a=(i.major.capacity+1)*e;o<a;++o){var c=new Kt;c.points.position=s,c.points.size=u,c.points.style=h,c.stroke.copy(r.stroke),c.text.copy(r.text),c.size.set(0,0),n.push(c)}return n},t.prototype.bind=function(t,n){this.xc=t,this.Qe=n;for(var i=this.shapes,r=t.container,e=0,u=i.length;e<u;++e)i[e].attach(r)},t.prototype.unbind=function(){var t=this.Lr;if(null!=t)for(var n=0,i=t.length;n<i;++n)t[n].detach();this.Qe=0,this.xc=void 0},t.prototype.destroy=function(){var t=this.Lr;if(null!=t)for(var n=0,i=t.length;n<i;++n)t[n].destroy();this.Qe=0,this.xc=void 0},t}(),eg=function(){function t(t){this.bf=t,this.Qe=0,this.pf=this.newMajor(t),this.Of=this.newMinor(t),this.Df=[],this.Ef=[]}return Object.defineProperty(t.prototype,"major",{get:function(){return this.pf},enumerable:!1,configurable:!0}),t.prototype.newMajor=function(t){return new ig(t)},Object.defineProperty(t.prototype,"minor",{get:function(){return this.Of},enumerable:!1,configurable:!0}),t.prototype.newMinor=function(t){return new rg(t)},t.prototype.bind=function(t,n){this.xc=t,this.Qe=n,this.pf.bind(t,n),this.Of.bind(t,n)},t.prototype.unbind=function(){this.Of.unbind(),this.pf.unbind(),this.Qe=0,this.xc=void 0},t.prototype.update=function(){var t=this.xc,n=this.pf.shapes,i=this.Of.shapes;if(null!=t&&n&&i){var r=t.plotArea,e=r.getBoundsInContainer(),u=r.container.transform.localTransform,s=this.pf.gridline.shapes,h=this.bf,o=h.padding*this.Qe,a=void 0;switch(h.position){case qd.TOP:if(a=r.coordinate.x.get(h.coordinateIndex)){var c=a.unmap(a.transform.unmap(e.x)),f=a.unmap(a.transform.unmap(e.x+e.width)),l=r.height;return this.updateX(c,f,a,n,i,s,0-o,u,l)}break;case qd.BOTTOM:if(a=r.coordinate.x.get(h.coordinateIndex))return c=a.unmap(a.transform.unmap(e.x)),f=a.unmap(a.transform.unmap(e.x+e.width)),l=r.height,this.updateX(c,f,a,n,i,s,l+o,u,l);break;case qd.LEFT:if(a=r.coordinate.y.get(h.coordinateIndex)){c=a.unmap(a.transform.unmap(e.y)),f=a.unmap(a.transform.unmap(e.y+e.height));var v=r.width;return this.updateY(c,f,a,n,i,s,0-o,u,v)}break;case qd.RIGHT:if(a=r.coordinate.y.get(h.coordinateIndex))return c=a.unmap(a.transform.unmap(e.y)),f=a.unmap(a.transform.unmap(e.y+e.height)),v=r.width,this.updateY(c,f,a,n,i,s,v+o,u,v)}}return!1},t.prototype.updateX=function(t,n,i,r,e,u,s,h,o){var a=this.bf.tick,c=a.major,f=c.count,l=c.capacity,v=c.step,b=c.formatter,d=a.minor,g=d.count,m=(l+1)*g,w=d.step,p=d.formatter,O=this.Df,D=this.Ef;this.newTicks(i,t,n,f,l,v,g,m,w,O,D);for(var E=h.a,M=h.tx,S=0;S<l;++S){var T=r[S],j=3*S,N=O[j+0];if(isNaN(N))this.hideMajor(T),S<u.length&&this.hideMajorGridline(u[S]);else{var I=E*O[j+1]+M,C=O[j+2];this.showMajor(T,I,s,null==b?void 0:b.format(N,C)),S<u.length&&this.showMajorGridline(u[S],N,I,.5*o,0,o)}}for(S=0;S<m;++S){var A=e[S],R=3*S,L=D[R+0];if(isNaN(L))this.hideMinor(A);else{var y=E*D[R+1]+M,k=D[R+2];this.showMinor(A,y,s,null==p?void 0:p.format(L,k))}}return!0},t.prototype.updateY=function(t,n,i,r,e,u,s,h,o){var a=this.bf.tick,c=a.major,f=c.count,l=c.capacity,v=c.step,b=c.formatter,d=a.minor,g=d.count,m=(l+1)*g,w=d.step,p=d.formatter,O=this.Df,D=this.Ef;this.newTicks(i,t,n,f,l,v,g,m,w,O,D);for(var E=h.d,M=h.ty,S=0;S<l;++S){var T=r[S],j=3*S,N=O[j+0];if(isNaN(N))this.hideMajor(T),S<u.length&&this.hideMajorGridline(u[S]);else{var I=E*O[j+1]+M,C=O[j+2];this.showMajor(T,s,I,null==b?void 0:b.format(N,C)),S<u.length&&this.showMajorGridline(u[S],N,.5*o,I,o,0)}}for(S=0;S<m;++S){var A=e[S],R=3*S,L=D[R+0];if(isNaN(L))this.hideMinor(A);else{var y=E*D[R+1]+M,k=D[R+2];this.showMinor(A,s,y,null==p?void 0:p.format(L,k))}}return!0},t.prototype.showMajor=function(t,n,i,r){t.disallowUploadedUpdate(),t.visible=!0,t.transform.position.set(n,i),t.text.value=null!=r?r:"",t.allowUploadedUpdate()},t.prototype.showMajorGridline=function(t,n,i,r,e,u){t.disallowUploadedUpdate(),t.visible=!0,t.transform.position.set(i,r),t.size.set(e,u),t.allowUploadedUpdate()},t.prototype.hideMajor=function(t){t.visible=!1},t.prototype.hideMajorGridline=function(t){t.visible=!1},t.prototype.showMinor=function(t,n,i,r){t.disallowUploadedUpdate(),t.visible=!0,t.transform.position.set(n,i),t.text.value=null!=r?r:"",t.allowUploadedUpdate()},t.prototype.hideMinor=function(t){t.visible=!1},t.prototype.newTicks=function(t,n,i,r,e,u,s,h,o,a,c){t.ticks(n,i,r,e,u,s,h,o,a,c)},t.prototype.destroy=function(){this.pf.destroy(),this.Of.destroy(),this.Qe=0,this.xc=void 0},t}(),ug=function(){function t(t){var n=this.toTheme(t);this.$t=n;var i=new tg(n,t);this.bf=i,this.Qe=0,this.mf=this.newBar(i),this.gf=this.newTick(i)}return Object.defineProperty(t.prototype,"parser",{get:function(){return this.bf},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"position",{get:function(){return this.bf.position},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bar",{get:function(){return this.mf},enumerable:!1,configurable:!0}),t.prototype.newBar=function(t){return new Qd(t)},Object.defineProperty(t.prototype,"tick",{get:function(){return this.gf},enumerable:!1,configurable:!0}),t.prototype.newTick=function(t){return new eg(t)},t.prototype.bind=function(t,n){this.xc=t,this.Qe=n,this.mf.bind(t,n),this.gf.bind(t,n)},t.prototype.unbind=function(){this.gf.unbind(),this.mf.unbind(),this.Qe=0,this.xc=void 0},t.prototype.update=function(){var t=this.mf.update(),n=this.gf.update();if(t||n){var i=this.xc;i&&rt.update(i.plotArea)}},t.prototype.onRender=function(){this.mf.update(),this.gf.update()},t.prototype.destroy=function(){this.mf.destroy(),this.gf.destroy(),this.xc=void 0},t.prototype.toTheme=function(t){var n;return null!==(n=null==t?void 0:t.theme)&&void 0!==n?n:this.getThemeDefault()},t.prototype.getThemeDefault=function(){return K.getInstance().get(this.getType())},t.prototype.getType=function(){return"DChartAxisBase"},t}(),sg=function(){function t(t,n){this.Mf=t,this.xc=new Te,this.Rn=new Map;var i=n&&n.list;if(i)for(var r=0,e=i.length;r<e;++r)this.add(i[r])}return Object.defineProperty(t.prototype,"container",{get:function(){return this.xc},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"plotArea",{get:function(){return this.Mf},enumerable:!1,configurable:!0}),t.prototype.add=function(t){var n=this.Rn,i=n.get(t.position);null==i&&(i=[],n.set(t.position,i)),i.push(t),t.bind(this,i.length-1)},t.prototype.get=function(t,n){var i=this.Rn.get(Di(t,qd));return i&&0<=n&&n<i.length?i[n]:null},t.prototype.indexOf=function(t){var n=this.Rn.get(t.position);return n?n.indexOf(t):-1},t.prototype.clear=function(t){var n=this.Rn.get(Di(t,qd));if(n){for(var i=0,r=n.length;i<r;++i)n[i].destroy();n.length=0}return this},t.prototype.size=function(t){var n=this.Rn.get(Di(t,qd));return n?n.length:0},t.prototype.update=function(){this.Rn.forEach((function(t){for(var n=0,i=t.length;n<i;++n)t[n].update()}))},t.prototype.onRender=function(){this.Rn.forEach((function(t){for(var n=0,i=t.length;n<i;++n)t[n].onRender()}))},t.prototype.destroy=function(){this.Rn.forEach((function(t){for(var n=0,i=t.length;n<i;++n)t[n].destroy();t.length=0}))},t}(),hg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DChartAxisX"},n}(ug),og=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DChartAxisXDatetime"},n}(hg),ag=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DChartAxisY"},n}(ug),cg=[1095651,16667680,15778578,1858929],fg=[cg[0],Qt.brighten(cg[0],.4),cg[1],Qt.brighten(cg[1],.4),cg[2],Qt.brighten(cg[2],.4),cg[3],Qt.brighten(cg[3],.4)],lg=function(t){return fg[t%fg.length]},vg={X:0,Y:1},bg=function(){function t(t){this.$t=this.toTheme(t),this.R=0,this.Sf=null==t?void 0:t.translation,this.Tf=0,this.jf=null==t?void 0:t.scaling,this.Ln=1,this.Nf=0,this.If=1}return Object.defineProperty(t.prototype,"id",{get:function(){return this.R},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"translate",{get:function(){return this.Tf},set:function(t){this.set(t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"scale",{get:function(){return this.Ln},set:function(t){this.set(void 0,t)},enumerable:!1,configurable:!0}),t.prototype.bind=function(t,n){this.set(0,n===vg.X?1:-1)},t.prototype.unbind=function(){},t.prototype.set=function(t,n){var i=!1;null!=t&&!1!==this.Sf&&this.Tf!==t&&(i=!0,this.Tf=t),null!=n&&!1!==this.jf&&this.Ln!==n&&(i=!0,this.Ln=n),i&&(this.R+=1,this.If=this.$t.isZero(this.Ln)?0:1/this.Ln,this.Nf=-this.Tf*this.If)},t.prototype.blend=function(t,n){var i=1-t,r=n.newTranslate*t+n.oldTranslate*i,e=n.newScale*t+n.oldScale*i;this.set(r,e)},t.prototype.map=function(t){return this.Tf+this.Ln*t},t.prototype.mapAll=function(t,n,i,r,e){for(var u=this.Tf,s=this.Ln,h=n+e;h<i;h+=r)t[h]=u+s*t[h]},t.prototype.unmap=function(t){return this.Nf+this.If*t},t.prototype.unmapAll=function(t,n,i,r,e){for(var u=this.Nf,s=this.If,h=n+e;h<i;h+=r)t[h]=u+s*t[h]},t.prototype.toTheme=function(t){return t&&t.theme||this.getThemeDefault()},t.prototype.getThemeDefault=function(){return K.getInstance().get(this.getType())},t.prototype.getType=function(){return"DChartCoordinateTransform"},t}(),dg=function(){function t(){this.oldTranslate=0,this.oldScale=1,this.newTranslate=0,this.newScale=1}return t.prototype.set=function(t,n){null!=t&&(this.newTranslate=t),null!=n&&(this.newScale=n)},t}(),gg=function(){function t(t,n){this.from=t,this.to=n}return t.prototype.set=function(t,n){return null!=t&&(this.from=t),null!=n&&(this.to=n),this},t.prototype.add=function(t,n){return bh(t)||(this.from=bh(this.from)?t:Math.min(this.from,t)),bh(n)||(this.to=bh(this.to)?n:Math.max(this.to,n)),this},t.prototype.clear=function(){return this.from=NaN,this.to=NaN,this},t}(),mg=function(){function t(t){this.R=0,this.Yt=vg.X,this.$t=this.toTheme(t),this.I=this.newTransform(null==t?void 0:t.transform),this.gf=this.newTick(null==t?void 0:t.tick),this.bu=this.newRegion(),this.Cf=this.newMark(),this.It=null==t?void 0:t.from,this.Ct=null==t?void 0:t.to}return t.prototype.newTransform=function(t){return new bg(t)},t.prototype.newRegion=function(){return new gg(NaN,NaN)},t.prototype.newMark=function(){return new dg},Object.defineProperty(t.prototype,"from",{get:function(){return this.It},set:function(t){this.It=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"to",{get:function(){return this.Ct},set:function(t){this.Ct=t},enumerable:!1,configurable:!0}),t.prototype.bind=function(t,n){this.xc=t,this.Yt=n,this.I.bind(t,n)},t.prototype.unbind=function(){this.xc=void 0,this.I.unbind()},t.prototype.fit=function(t,n){this.doFit(t,n,this.I)},t.prototype.mark=function(t,n){var i=this.Cf,r=this.I;i.oldTranslate=r.translate,i.oldScale=r.scale,this.doFit(t,n,i)},t.prototype.blend=function(t){this.I.blend(t,this.Cf)},t.prototype.doFit=function(t,n,i){var r=this.xc;if(r){var e=r.container.plotArea,u=e.padding,s=this.bu;switch(this.Yt){case vg.X:this.Af(u.getLeft(),e.width-u.getRight(),this.toFitDomain(t,n,e,s),i);break;case vg.Y:this.Af(e.height-u.getBottom(),u.getTop(),this.toFitRange(t,n,e,s),i)}}},t.prototype.toFitDomain=function(t,n,i,r){return null==t&&(t=this.It),null==n&&(n=this.Ct),null!=t&&null!=n||i.series.getDomain(this,r),r.set(t,n),r},t.prototype.toFitRange=function(t,n,i,r){return null==t&&(t=this.It),null==n&&(n=this.Ct),null!=t&&null!=n||i.series.getRange(this,r),r.set(t,n),r},t.prototype.Af=function(t,n,i,r){var e=i.from,u=i.to;if(!bh(e)&&!bh(u)){var s,h=this.map(e),o=this.map(u)-h,a=t-h*(s=this.$t.isZero(o)?n<t?-1:1:(n-t)/o);r.set(a,s)}},Object.defineProperty(t.prototype,"id",{get:function(){return this.R},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"transform",{get:function(){return this.I},enumerable:!1,configurable:!0}),t.prototype.map=function(t){return t},t.prototype.mapAll=function(t,n,i,r,e){},t.prototype.unmap=function(t){return t},t.prototype.unmapAll=function(t,n,i,r,e){},t.prototype.ticks=function(t,n,i,r,e,u,s,h,o,a){this.gf.calculate(t,n,i,r,e,u,s,h,o,a,this)},t.prototype.toTheme=function(t){var n;return null!==(n=null==t?void 0:t.theme)&&void 0!==n?n:this.getThemeDefault()},t.prototype.getThemeDefault=function(){return K.getInstance().get(this.getType())},t.prototype.getType=function(){return"DChartCoordinate"},t}(),wg=function(){function t(t,n){this.xc=t,this.Yt=n,this.Rn=[]}return Object.defineProperty(t.prototype,"container",{get:function(){return this.xc},enumerable:!1,configurable:!0}),t.prototype.add=function(t,n){var i=this.Rn;return null==n?i.push(t):0<=n&&n<i.length?i.splice(n,0,t):i.push(t),t.bind(this,this.Yt),this},t.prototype.get=function(t){var n=this.Rn;return 0<=t&&t<n.length?n[t]:null},t.prototype.indexOf=function(t){return this.Rn.indexOf(t)},t.prototype.remove=function(t){var n=this.Rn;if(mn(t)){if(0<=(r=t)&&r<n.length){var i=n.splice(r,1)[0];return i.unbind(),i}}else{var r,e=t;if(0<=(r=n.indexOf(e)))return n.splice(r,1),e.unbind(),e}return null},t.prototype.clear=function(){for(var t=this.Rn,n=0,i=t.length;n<i;++n)t[n].unbind();return t.length=0,this},t.prototype.destroy=function(){return this.clear()},t.prototype.size=function(){return this.Rn.length},t.prototype.fit=function(t,n){for(var i=this.Rn,r=0,e=i.length;r<e;++r)i[r].fit(t,n);return this},t.prototype.mark=function(t,n){for(var i=this.Rn,r=0,e=i.length;r<e;++r)i[r].mark(t,n);return this},t.prototype.blend=function(t){for(var n=this.Rn,i=0,r=n.length;i<r;++i)n[i].blend(t);return this},t}(),pg=function(){function t(t,n){this.Mf=t;var i=new wg(this,vg.X);this._x=i;var r=new wg(this,vg.Y);if(this._y=r,n){var e=n.x;if(e)if(Rt(e))for(var u=0,s=e.length;u<s;++u)i.add(e[u]);else i.add(e);var h=n.y;if(h)if(Rt(h))for(u=0,s=h.length;u<s;++u)r.add(h[u]);else r.add(h)}}return Object.defineProperty(t.prototype,"x",{get:function(){return this._x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this._y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"plotArea",{get:function(){return this.Mf},enumerable:!1,configurable:!0}),t.prototype.fit=function(t,n,i,r){return this._x.fit(t,n),this._y.fit(i,r),this},t.prototype.mark=function(t,n,i,r){return this._x.mark(t,n),this._y.mark(i,r),this},t.prototype.blend=function(t){return this._x.blend(t),this._y.blend(t),this},t}(),Og=function(){function t(t){this.$t=this.toTheme(t)}return t.prototype.toMajorStep=function(t,n,i,r){return null==r?0<i?this.$t.toStep(t,n,i):-1:mn(r)?r:r(t,n,i)},t.prototype.toMinorStep=function(t,n,i){return null==i?0<=t?this.calcStepMinor(t,n):-1:mn(i)?i:i(t,n)},t.prototype.calcStepMinor=function(t,n){return t/(n+1)},t.prototype.calcTickMinorPositions=function(t,n,i,r,e,u,s){for(var h=0;h<n;h+=1){var o=i+(h+1)*t;r<=o&&o<=e&&(s[u++]=o)}},t.prototype.calculate=function(t,n,i,r,e,u,s,h,o,a,c){if(!(i<=0)){var f=c.transform,l=Math.min(t,n),v=Math.max(t,n),b=this.toMajorStep(l,v,i,e);if(b<=0){o[0]=l,o[1]=f.map(c.map(l)),o[2]=0;for(var d=1;d<r;++d)o[0+(A=3*d)]=NaN,o[A+1]=NaN,o[A+2]=NaN;for(d=0;d<s;++d)a[0+(R=3*d)]=NaN,a[R+1]=NaN,a[R+2]=NaN}else{var g=Math.floor(l/b)-1,m=Math.ceil(v/b)+1,w=f.map(c.map(l)),p=f.map(c.map(v)),O=Math.min(w,p)-.5,D=Math.max(w,p)+.5,E=this.toMinorStep(b,u,h),M=0,S=0;for(d=g;d<=m;++d){var T=d*b;if(M<r){var j=f.map(c.map(T));O<=j&&j<=D&&(o[0+(A=3*M)]=T,o[A+1]=j,o[A+2]=b,M+=1)}for(var N=0;N<u;N+=1)if(S<s){var I=T+(N+1)*E,C=f.map(c.map(I));O<=C&&C<=D&&(a[0+(R=3*S)]=I,a[R+1]=C,a[R+2]=E,S+=1)}}for(d=M;d<r;++d){var A;o[0+(A=3*d)]=NaN,o[A+1]=NaN,o[A+2]=NaN}for(d=S;d<s;++d){var R;a[0+(R=3*d)]=NaN,a[R+1]=NaN,a[R+2]=NaN}}}},t.prototype.toTheme=function(t){var n;return null!==(n=null==t?void 0:t.theme)&&void 0!==n?n:this.getThemeDefault()},t.prototype.getThemeDefault=function(){return K.getInstance().get(this.getType())},t.prototype.getType=function(){return"DChartCoordinateTick"},t}(),Dg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.newTick=function(t){return new Og(t)},n}(mg),Eg=function(){function t(t){this.$t=this.toTheme(t)}return t.prototype.toMajorStep=function(t,n,i,r){return null==r?0<i?this.$t.toStep(t,n,i):-1:mn(r)?r:r(t,n,i)},t.prototype.toMinorStep=function(t,n,i){return null==i?0<=t?this.calcStepMinor(t,n):-1:mn(i)?i:i(t,n)},t.prototype.calcStepMinor=function(t,n){return t/(n+1)},t.prototype.calcTickMinorPositions=function(t,n,i,r,e,u,s){for(var h=0;h<n;h+=1){var o=i+(h+1)*t;r<=o&&o<=e&&(s[u++]=o)}},t.prototype.calculate=function(t,n,i,r,e,u,s,h,o,a,c){if(!(i<=0)){var f=c.transform,l=c.map(t),v=c.map(n),b=Math.min(l,v),d=Math.max(l,v),g=this.toMajorStep(b,d,i,e);if(g<=0){var m=Math.min(t,n);o[0]=m,o[1]=f.map(c.map(m)),o[2]=0;for(var w=1;w<i;++w)o[0+(N=3*w)]=NaN,o[N+1]=NaN,o[N+2]=NaN;for(w=0;w<s;++w)a[0+(I=3*w)]=NaN,a[I+1]=NaN,a[I+2]=NaN}else{var p=Math.floor(b/g)-1,O=Math.ceil(d/g)+1,D=this.toMinorStep(g,u,h),E=0,M=0;for(w=p;w<=O;++w){var S=w*g;E<r&&b<=S&&S<=d&&(o[0+(N=3*E)]=c.unmap(S),o[N+1]=f.map(S),o[N+2]=c.unmap(S-1),E+=1);for(var T=0;T<u;T+=1)if(M<s){var j=S+(T+1)*D;b<=j&&j<=d&&(a[0+(I=3*M)]=c.unmap(j),a[I+1]=f.map(j),a[I+2]=c.unmap(j-1),M+=1)}}for(w=E;w<r;++w){var N;o[0+(N=3*w)]=NaN,o[N+1]=NaN,o[N+2]=NaN}for(w=M;w<s;++w){var I;a[0+(I=3*w)]=NaN,a[I+1]=NaN,a[I+2]=NaN}}}},t.prototype.toTheme=function(t){var n;return null!==(n=null==t?void 0:t.theme)&&void 0!==n?n:this.getThemeDefault()},t.prototype.getThemeDefault=function(){return K.getInstance().get(this.getType())},t.prototype.getType=function(){return"DChartCoordinateTick"},t}(),Mg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.newTick=function(t){return new Eg(t)},n.prototype.map=function(t){return Math.log(Math.max(0,t))/Math.LN10},n.prototype.mapAll=function(t,n,i,r,e){for(var u=1/Math.LN10,s=n+e;s<i;s+=r){var h=t[s];t[s]=Math.log(Math.max(0,h))*u}},n.prototype.unmap=function(t){return Math.pow(10,t)},n.prototype.unmapAll=function(t,n,i,r,e){for(var u=n+e;u<i;u+=r)t[u]=Math.pow(10,t[u])},n}(mg),Sg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DChartLegendItem"},n}(Qi),Tg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DChartLegend"},n}(Qi),jg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DChartOverview"},n}(Qi),Ng=function(n){function i(i){var r=n.call(this)||this,e=r.transform;return r._=new Ii(e.position,i),r.Ln=new Ii(e.scale,i),r._i=new t.Rectangle,r}return B(i,n),Object.defineProperty(i.prototype,"position",{get:function(){return this._},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"scale",{get:function(){return this.Ln},enumerable:!1,configurable:!0}),i.prototype.getBounds=function(t,i){return this._lastBoundsID=-1,n.prototype.getBounds.call(this,t,i)},i.prototype.calculateBounds=function(){var t=this._bounds,n=this.bu,i=this._i,r=this.transform.worldTransform,e=0,u=0,s=0,h=0,o=this.children;if(0<o.length)for(var a=!0,c=0,f=o.length;c<f;++c){var l=o[c];l.visible&&(l.getBoundsInternal(!1,i),a?(a=!1,e=i.x,s=i.y,u=i.x+i.width,h=i.y+i.height):(e=Math.min(e,i.x),s=Math.min(s,i.y),u=Math.max(u,i.x+i.width),h=Math.max(h,i.y+i.height)))}t.clear(),n.set(e,s),r.apply(n,n),t.addPoint(n),n.set(u,h),r.apply(n,n),t.addPoint(n)},i}(Te),Ig=function(){function t(){this.shape=null,this.x=0,this.y=0,this.p0x=0,this.p0y=0,this.p1x=0,this.p1y=0,this.index=0,this.t=0,this.distance=0}return t.prototype.copyFrom=function(t){return this.shape=t.shape,this.x=t.x,this.y=t.y,this.p0x=t.p0x,this.p0y=t.p0y,this.p1x=t.p1x,this.p1y=t.p1y,this.index=t.index,this.t=t.t,this.distance=t.distance,this},t}(),Cg=function(){function t(t,n,i){this.enable=t,this.color=n,this.alpha=i}return t.from=function(n,i,r){var e,u,s;return new t(null!==(e=null==r?void 0:r.enable)&&void 0!==e?e:n.enable(i),null!==(u=null==r?void 0:r.color)&&void 0!==u?u:n.color(i),null!==(s=null==r?void 0:r.alpha)&&void 0!==s?s:n.alpha(i))},t}(),Ag=function(){function t(){}return t.from=function(t,n){return Rt(t)?function(n){return t[n%t.length]}:ot(t)?t:null!=t?function(){return t}:Rt(n)?function(t){return n[t%n.length]}:ot(n)?n:function(){return n}},t}(),Rg=function(t){this.enable=Ag.from(null==t?void 0:t.enable,!0),this.color=Ag.from(null==t?void 0:t.color,lg),this.alpha=Ag.from(null==t?void 0:t.alpha,Y.FILL_ALPHA)},Lg=function(){function t(t,n){this.outer=t,this.inner=n}return t.from=function(n,i,r){var e,u;return new t(null!==(e=null==r?void 0:r.outer)&&void 0!==e?e:n.outer(i),null!==(u=null==r?void 0:r.inner)&&void 0!==u?u:n.inner(i))},t}(),yg=function(t){this.outer=Ag.from(null==t?void 0:t.outer,.2),this.inner=Ag.from(null==t?void 0:t.inner,.1)},kg=function(){function t(t,n){this.x=t,this.y=n}return t.from=function(n,i,r,e,u){var s,h;return new t(null!==(s=null==r?void 0:r.x)&&void 0!==s?s:null!=n.x?n.x(i):e,null!==(h=null==r?void 0:r.y)&&void 0!==h?h:null!=n.y?n.y(i):u)},t}(),xg=function(t){t&&(null!=t.x&&(this.x=Ag.from(t.x,0)),null!=t.y&&(this.y=Ag.from(t.y,0)))},Bg=function(){function t(t,n,i,r,e,u,s){this.enable=t,this.color=n,this.alpha=i,this.width=r,this.align=e,this.side=u,this.style=s}return t.from=function(n,i,r){var e,u,s,h,o,a,c;return new t(null!==(e=null==r?void 0:r.enable)&&void 0!==e?e:n.enable(i),null!==(u=null==r?void 0:r.color)&&void 0!==u?u:n.color(i),null!==(s=null==r?void 0:r.alpha)&&void 0!==s?s:n.alpha(i),null!==(h=null==r?void 0:r.width)&&void 0!==h?h:n.width(i),null!==(o=null==r?void 0:r.align)&&void 0!==o?o:n.align(i),null!==(a=null==r?void 0:r.side)&&void 0!==a?a:n.side(i),null!==(c=null==r?void 0:r.style)&&void 0!==c?c:n.style(i))},t}(),_g=function(t){this.enable=Ag.from(null==t?void 0:t.enable,!0),this.color=Ag.from(null==t?void 0:t.color,lg),this.alpha=Ag.from(null==t?void 0:t.alpha,Y.STROKE_ALPHA),this.width=Ag.from(null==t?void 0:t.width,Y.STROKE_WIDTH),this.align=Ag.from(null==t?void 0:t.width,Y.STROKE_ALIGN),this.side=Ag.from(null==t?void 0:t.side,Gt.ALL),this.style=Ag.from(null==t?void 0:t.style,s.NON_SCALING)},Pg=function(){function t(t,n){var i;this.Mf=t,this.Rf=new gg(NaN,NaN),this.Lf=new gg(NaN,NaN),this.Hc=null!==(i=null==n?void 0:n.selection)&&void 0!==i?i:null,this.C=new Rg(null==n?void 0:n.fill),this.mo=new _g(null==n?void 0:n.stroke),this.j=new xg(null==n?void 0:n.size),this.rn=new xg(null==n?void 0:n.offset),this.zn=new yg(null==n?void 0:n.padding),this.Rn=[];var r=n&&n.list;if(r){var e=r.length;if(0<e){for(var u=0;u<e;++u)this.add(r[u]);this.update()}}}return t.prototype.newFill=function(t,n){return Cg.from(this.C,t,n)},t.prototype.newStroke=function(t,n){return Bg.from(this.mo,t,n)},t.prototype.newSize=function(t,n,i,r){return kg.from(this.j,t,n,i,r)},t.prototype.newOffset=function(t,n,i,r){return kg.from(this.rn,t,n,i,r)},t.prototype.newPadding=function(t,n){return Lg.from(this.zn,t,n)},Object.defineProperty(t.prototype,"plotArea",{get:function(){return this.Mf},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selection",{get:function(){return this.Hc},enumerable:!1,configurable:!0}),t.prototype.update=function(){for(var t=this.Rn,n=0,i=t.length;n<i;++n)t[n].update();var r=this.Hc;r&&r.update()},t.prototype.add=function(t){var n=this.Rn;t.bind(this,n.length),n.push(t)},t.prototype.get=function(t){var n=this.Rn;return 0<=t&&t<n.length?n[t]:null},t.prototype.indexOf=function(t){return this.Rn.indexOf(t)},t.prototype.clear=function(){for(var t=this.Rn,n=0,i=t.length;n<i;++n)t[n].destroy();return t.length=0,this},t.prototype.size=function(){return this.Rn.length},t.prototype.destroy=function(){this.clear();var t=this.Hc;t&&t.unbind()},t.prototype.getDomain=function(t,n){n.clear();for(var i=this.Rn,r=0,e=i.length;r<e;++r){var u=i[r];if(u.coordinate.x===t){var s=u.domain;n.add(s.from,s.to)}}return n},t.prototype.getRange=function(t,n){n.clear();for(var i=this.Rn,r=0,e=i.length;r<e;++r){var u=i[r];if(u.coordinate.y===t){var s=u.range;n.add(s.from,s.to)}}return n},Object.defineProperty(t.prototype,"domain",{get:function(){var t=this.Rf;t.clear();for(var n=this.Rn,i=0,r=n.length;i<r;++i){var e=n[i].domain;t.add(e.from,e.to)}return t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"range",{get:function(){var t=this.Lf;t.clear();for(var n=this.Rn,i=0,r=n.length;i<r;++i){var e=n[i].range;t.add(e.from,e.to)}return t},enumerable:!1,configurable:!0}),t.prototype.hitTest=function(t,n){for(var i=this.Rn,r=i.length-1;0<=r;--r){var e=i[r];if(e.hitTest(t,n))return e}return null},t.prototype.calcHitPoint=function(n,i,r){var e=r,u=t.WORK_CALCHITPOINT,s=this.Rn,h=null;u.distance=1/0;for(var o=s.length-1;0<=o;--o){var a=s[o];if(a.calcHitPoint(n,i,e)&&e.distance<u.distance){h=a;var c=e;e=u,u=c}}return h&&u!==r&&r.copyFrom(u),h},t.WORK_CALCHITPOINT=new Ig,t}(),Ug=function(n){function i(t,i){var r=n.call(this,i)||this;return r.yf=t,r.kf=0,r.xf=1e3,r.Bf=null,r._f=function(){r.onBlend()},r}return B(i,n),i.prototype.init=function(i){var r,e=this;n.prototype.init.call(this,i);var u=new Ng((function(){e.Pf=!0,e.Uf=!0,rt.update(e)}));this.xc=u,this.Ff=new pg(this,null==i?void 0:i.coordinate);var s=new Pg(this,null==i?void 0:i.series);this.Gf=s;var h=new sg(this,null==i?void 0:i.axis);this.Hf=h,this.Pf=!0,this.Uf=!0,this.zf=new t.Rectangle,this.wc=new t.Point,this.addChild(u),this.addChild(h.container),this.rr=new fr(this,(function(){return u}),null==i?void 0:i.view);var o=s.selection;o&&o.bind(s),(null!==(r=null==i?void 0:i.mask)&&void 0!==r?r:this.theme.isOverflowMaskEnabled())&&(u.mask=this.getOverflowMask())},i.prototype.onResize=function(t,i,r,e){this.Pf=!0,this.Uf=!0,n.prototype.onResize.call(this,t,i,r,e)},i.prototype.getOverflowMask=function(){return null==this.er&&(this.er=new $i(this),this.reflowable.add(this.er),this.toDirty()),this.er},Object.defineProperty(i.prototype,"chart",{get:function(){return this.yf},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"coordinate",{get:function(){return this.Ff},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"series",{get:function(){return this.Gf},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"container",{get:function(){return this.xc},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"axis",{get:function(){return this.Hf},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"view",{get:function(){return this.rr},enumerable:!1,configurable:!0}),i.prototype.onWheel=function(t,i,r){var e=this.rr.onWheel(t,i,r),u=n.prototype.onWheel.call(this,t,i,r);return e||u},i.prototype.onDblClick=function(t,i){var r=this.rr.onDblClick(t,i),e=n.prototype.onDblClick.call(this,t,i);return r||e},i.prototype.onDown=function(t){this.rr.onDown(t),n.prototype.onDown.call(this,t)},i.prototype.render=function(t){if(this.Pf){this.Pf=!1,this.Hf.onRender();var i=this.Gf.selection;i&&i.onRender()}n.prototype.render.call(this,t)},i.prototype.destroy=function(){this.xc.destroy(),this.Gf.destroy(),this.Hf.destroy()},i.prototype.getType=function(){return"DChartPlotArea"},i.prototype.getBoundsInContainer=function(){var t=this.zf;if(this.Uf){this.Uf=!1;var n=this.container;n.updateTransform();var i=n.transform.localTransform,r=this.wc;r.set(0,0),i.applyInverse(r,r),t.x=r.x,t.y=r.y,r.set(this.width,this.height),i.applyInverse(r,r),t.width=r.x-t.x,t.height=r.y-t.y}return t},i.prototype.fit=function(t,n,i,r,e){var u=this.Ff,s=this.Hf,h=this.Gf;if(null!=t&&t<=0)u.fit(n,i,r,e),s.update(),h.update();else{this.xf=null!=t?t:200,this.kf=Date.now(),u.mark(n,i,r,e);var o=this.Bf;null!=o&&window.clearTimeout(o),this.Bf=window.setTimeout(this._f,0)}return this},i.prototype.onBlend=function(){var t=(Date.now()-this.kf)/this.xf;t<1?this.Bf=window.setTimeout(this._f,0):(this.Bf=null,t=1),this.Ff.blend(er.ELASTIC(t)),this.Hf.update(),this.Gf.update()},i}(Qi),Fg=function(){function t(t,n,i){this.It=t,this.Ct=n,this.Z=i}return Object.defineProperty(t.prototype,"from",{get:function(){return this.It},set:function(t){this.set(t,void 0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"to",{get:function(){return this.Ct},set:function(t){this.set(void 0,t)},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n){var i=!1;return null!=t&&this.It!==t&&(bh(this.It)&&bh(t)||(this.It=t,i=!0)),null!=n&&this.Ct!==n&&(bh(this.Ct)&&bh(n)||(this.Ct=n,i=!0)),i&&this.Z(),this},t.prototype.add=function(t,n){var i,r;return bh(t)||(i=bh(this.from)?t:Math.min(this.from,t)),bh(n)||(r=bh(this.to)?n:Math.max(this.to,n)),this.set(i,r)},t.prototype.clear=function(){return this.set(NaN,NaN)},t}(),Gg=function(){function t(t){var n,i,r,e=this.toTheme(t);this.$t=e;var u=(new ct).add(null!==(n=null==t?void 0:t.state)&&void 0!==n?n:ht.HOVERED);this.Mt=u,this.rs=null!==(i=null==t?void 0:t.enable)&&void 0!==i?i:e.isEnabled(u),this._r=null==t?void 0:t.shape,this.B=null!==(r=null==t?void 0:t.style)&&void 0!==r?r:this.setStyle}return t.prototype.bind=function(t){if(this.rs){var n=this._r||this.newShape(this.$t);this._r=n,n.attach(t.plotArea.axis.container),n.visible=!1}},t.prototype.unbind=function(){var t=this._r;t&&t.detach()},t.prototype.newShape=function(t){return t.newShape(this.Mt)},t.prototype.set=function(t,n,i){this.update(t,n);var r=this._r;r&&this.B(r,i)},t.prototype.setStyle=function(t,n){var i=n.shape;i&&(t.stroke.color=i.stroke.color)},t.prototype.unset=function(){var t=this._r;t&&(t.visible=!1)},t.prototype.toTheme=function(t){var n=null==t?void 0:t.theme;return at(n)?this.getTheme(n):null!=n?n:this.getTheme(this.getType())},t.prototype.getTheme=function(t){return K.getInstance().get(t)},t}(),Hg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.update=function(t,n){var i=this._r;if(i){var r=n.x,e=t.plotArea.height;return i.transform.position.set(r,.5*e),i.size.set(0,e),i.visible=this.isVisible(t,r),!0}return!1},n.prototype.isVisible=function(t,n){return 0<=n&&n<=t.plotArea.width},n.prototype.getType=function(){return"DChartSelectionGridlineX"},n}(Gg),zg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.update=function(t,n){var i=this._r;if(i){var r=n.y,e=t.plotArea.width;return i.transform.position.set(.5*e,r),i.size.set(e,0),i.visible=this.isVisible(t,r),!0}return!1},n.prototype.isVisible=function(t,n){return 0<=n&&n<=t.plotArea.height},n.prototype.getType=function(){return"DChartSelectionGridlineY"},n}(Gg),Vg=function(){function t(t){this._x=new Hg(null==t?void 0:t.x),this._y=new zg(null==t?void 0:t.y)}return Object.defineProperty(t.prototype,"x",{get:function(){return this._x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this._y},enumerable:!1,configurable:!0}),t.prototype.bind=function(t){this._x.bind(t),this._y.bind(t)},t.prototype.unbind=function(){this._x.unbind(),this._y.unbind()},t.prototype.set=function(t,n,i){this._x.set(t,n,i),this._y.set(t,n,i)},t.prototype.unset=function(){this._x.unset(),this._y.unset()},t.prototype.update=function(t,n){var i=this._x.update(t,n),r=this._y.update(t,n);return i||r},t}(),Wg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.update=function(t,n){var i=this._r;return!!i&&(i.transform.position.copyFrom(n),i.visible=this.isVisible(t,n),!0)},n.prototype.isVisible=function(t,n){var i=n.x,r=n.y,e=t.plotArea;return 0<=i&&i<=e.width&&0<=r&&r<=e.height},n.prototype.getType=function(){return"DChartSelectionMarker"},n}(Gg),Xg={PREVIOUS:0,NEXT:1,CLOSER:2,INTERSECTION:3},Kg=function(n){function i(i){var r,e,u,s=this;(s=n.call(this)||this).xc=null,s.Gf=null,s.rs=null===(r=i.enable)||void 0===r||r,s.wf=new Vg(i.gridline),s.A=new Wg(i.marker),s.Mt=null!==(e=i.state)&&void 0!==e?e:ht.HOVERED,s.Vf=null,s.Wf=null,s._=new t.Point,s.an=null!==(u=i.point)&&void 0!==u?u:Xg.CLOSER,s.bu=new t.Point;var h=i.on;if(h)for(var o in h){var a=h[o];a&&s.on(o,a)}return s}return B(i,n),i.prototype.bind=function(t){this.rs&&(this.xc=t,this.wf.bind(t),this.A.bind(t))},i.prototype.unbind=function(){this.A.unbind(),this.wf.unbind(),this.xc=null,this.Vf=null,this.Wf=null},Object.defineProperty(i.prototype,"series",{get:function(){return this.Gf},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"position",{get:function(){return this._},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"gridline",{get:function(){return this.wf},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"marker",{get:function(){return this.A},enumerable:!1,configurable:!0}),i.prototype.set=function(t,n){var i=this.xc,r=this.Vf=t.coordinate.x,e=this.Wf=t.coordinate.y;if(i&&r&&e){var u=i.plotArea.container.localTransform,s=this._,h=this.bu;if(n instanceof Ig){var o=n.x,a=n.y;switch(this.an){case Xg.PREVIOUS:o=n.p0x,a=n.p0y;break;case Xg.NEXT:o=n.p1x,a=n.p1y;break;case Xg.CLOSER:Math.abs(n.p0x-n.x)<Math.abs(n.p1x-n.x)?(o=n.p0x,a=n.p0y):(o=n.p1x,a=n.p1y)}h.set(o,a),u.apply(h,h),s.set(r.unmap(r.transform.unmap(o)),e.unmap(e.transform.unmap(a)))}else s.copyFrom(n.position),h.set(r.transform.map(r.map(s.x)),e.transform.map(e.map(s.y))),u.apply(h,h);this.wf.set(i,h,t),this.A.set(i,h,t),rt.update(i.plotArea)}var c=this.Gf;if(c!==t){var f=this.Mt;c&&c.state.remove(f),this.Gf=t,t.state.add(f)}this.emit("change",this)},i.prototype.setStyle=function(t,n){var i=n.shape;i&&(t.stroke.color=i.stroke.color)},i.prototype.unset=function(){var t=this.Gf;t&&(this.Gf=null,this.Vf=null,this.Wf=null,t.state.remove(this.Mt),this.wf.unset(),this.A.unset(),this.emit("change",this))},i.prototype.update=function(){var t=this.xc,n=this.Vf,i=this.Wf;if(t&&n&&i){var r=this._,e=this.bu;e.set(n.transform.map(n.map(r.x)),i.transform.map(i.map(r.y))),t.plotArea.container.localTransform.apply(e,e);var u=this.wf.update(t,e),s=this.A.update(t,e);return u||s}return!1},i}(t.utils.EventEmitter),Yg=function(t){function n(n){var i,r=this;(r=t.call(this)||this).xc=null;var e=Di(null!==(i=null==n?void 0:n.point)&&void 0!==i?i:Xg.CLOSER,Xg);r.Ba=r.newSelected(e,null==n?void 0:n.selected),r.Xf=r.newHovered(e,null==n?void 0:n.hovered);var u=null==n?void 0:n.on;if(null!=u)for(var s in u){var h=u[s];h&&r.on(s,h)}return r.Kf=function(t){r.onMove(t)},r.Yf=function(t){r.onClick(t)},r}return B(n,t),n.prototype.newSelected=function(t,n){return new Kg(this.toSubOptions(t,n,ht.ACTIVE))},n.prototype.newHovered=function(t,n){return new Kg(this.toSubOptions(t,n,ht.HOVERED))},n.prototype.toSubOptions=function(t,n,i){null==(n=n||{}).point&&(n.point=t),null==n.state&&(n.state=i);var r=n.gridline||{},e=r.x||{};null==e.state&&(e.state=i);var u=r.y||{};null==u.state&&(u.state=i);var s=n.marker||{};return null==s.state&&(s.state=i),n},n.prototype.onClick=function(t){var i=this.xc;if(i&&t.target===i.plotArea){var r=n.WORK_SELECT,e=t.data.global,u=i.calcHitPoint(e.x,e.y,r),s=this.Ba;u?s.set(u,r):s.unset()}},n.prototype.onMove=function(t){var i=this.xc;if(i){var r=this.Xf;if(t.target===i.plotArea){var e=n.WORK_SELECT,u=t.data.global,s=i.calcHitPoint(u.x,u.y,e);s?r.set(s,e):r.unset()}else r.unset()}},n.prototype.bind=function(t){this.xc=t,this.Ba.bind(t),this.Xf.bind(t);var n=t.plotArea;n.on(Ki.move,this.Kf),n.on(Ki.tap,this.Yf)},n.prototype.unbind=function(){var t=this.xc;this.xc=null,t&&t.plotArea.off(Ki.move,this.Kf),this.Ba.unbind(),this.Xf.unbind()},Object.defineProperty(n.prototype,"selected",{get:function(){return this.Ba},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"hovered",{get:function(){return this.Xf},enumerable:!1,configurable:!0}),n.prototype.update=function(){var t=this.Ba.update(),n=this.Xf.update();if(t||n){var i=this.xc;null!=i&&rt.update(i.plotArea)}},n.prototype.onRender=function(){this.Ba.update(),this.Xf.update()},n.WORK_SELECT=new Ig,n}(t.utils.EventEmitter),Jg=function(){function t(t,n){var i,r;this.p=t,this.Jf=null!==(i=null==n?void 0:n.x)&&void 0!==i?i:0,this.Zf=null!==(r=null==n?void 0:n.y)&&void 0!==r?r:0,this.qf=NaN,this.Qf=NaN,this.$f=NaN,this.tl=NaN}return Object.defineProperty(t.prototype,"x",{get:function(){var t=this.p.container;return t?t.plotArea.coordinate.x.get(this.Jf):null},set:function(t){var n=this.toIndexX(t);this.Jf!==n&&(this.Jf=n,this.qf=NaN,this.$f=NaN)},enumerable:!1,configurable:!0}),t.prototype.toIndexX=function(t){if(mn(t))return t;if(null!=t){var n=this.p.container;if(n)return n.plotArea.coordinate.x.indexOf(t)}return-1},Object.defineProperty(t.prototype,"y",{get:function(){var t=this.p.container;return t?t.plotArea.coordinate.y.get(this.Zf):null},set:function(t){var n=this.toIndexY(t);this.Zf!==n&&(this.Zf=n,this.Qf=NaN,this.tl=NaN)},enumerable:!1,configurable:!0}),t.prototype.toIndexY=function(t){if(mn(t))return t;if(null!=t){var n=this.p.container;if(n)return n.plotArea.coordinate.y.indexOf(t)}return-1},t.prototype.isDirty=function(t,n){var i=t.id,r=n.id,e=i!==this.qf,u=r!==this.Qf;return this.qf=i,this.Qf=r,e||u},t.prototype.isTransformDirty=function(t,n){var i=t.transform.id,r=n.transform.id,e=i!==this.$f,u=r!==this.tl;return this.$f=i,this.tl=r,e||u},t.prototype.reset=function(){this.qf=NaN,this.Qf=NaN},t.prototype.destroy=function(){this.reset()},t}(),Zg=function(t){function n(n){var i=t.call(this)||this;i.Ff=new Jg(i,null==n?void 0:n.coordinate),i.Qe=0,i.Rf=new gg(NaN,NaN),i.Lf=new gg(NaN,NaN),i.nl=NaN,i.il=!0,i.Mt=new ft((function(t,n){i.onStateChange(t,n)}));var r=null==n?void 0:n.on;if(null!=r)for(var e in r){var u=r[e];u&&i.on(e,u)}return i}return B(n,t),n.prototype.bind=function(t,n){this.xc=t,this.Ff.reset(),this.Qe=n;var i=t.plotArea.chart;return i&&(this.Mt.parent=i.state),this},n.prototype.unbind=function(){return this.xc=void 0,this},Object.defineProperty(n.prototype,"domain",{get:function(){return this.updateRegion(),this.Rf},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"range",{get:function(){return this.updateRegion(),this.Lf},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"container",{get:function(){return this.xc||null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"index",{get:function(){return this.Qe},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"coordinate",{get:function(){return this.Ff},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"state",{get:function(){return this.Mt},enumerable:!1,configurable:!0}),n.prototype.show=function(){return!0!==this.il&&(this.il=!0,this.onShow()),this},n.prototype.onShow=function(){var t=this.shape;null!=t&&(t.visible=!0)},n.prototype.isShown=function(){return this.il},n.prototype.hide=function(){return!1!==this.il&&(this.il=!1,this.onHide()),this},n.prototype.onHide=function(){var t=this.shape;null!=t&&(t.visible=!1)},n.prototype.isHidden=function(){return!this.il},n.prototype.destroy=function(){return this.xc=void 0,this.Ff.destroy(),this},n.prototype.hitTest=function(t,n){return!1},n.prototype.calcHitPoint=function(t,n,i){return!1},n.prototype.onStateChange=function(t,n){var i;this.toDirty();var r=null===(i=this.xc)||void 0===i?void 0:i.plotArea.chart;rt.update(r),this.emit("statechange",t,n,this)},n}(t.utils.EventEmitter),qg=function(n){function i(t){var i,r=this;return(r=n.call(this,t)||this).rl=null,r.kn=t,r.gt=null!==(i=null==t?void 0:t.points)&&void 0!==i?i:[],r.el=0,r.ul=NaN,r}return B(i,n),i.prototype.getSizeDefault=function(){return 10},i.prototype.getOffsetDefault=function(){return 0},i.prototype.bind=function(t,i){var r=this.rl;if(!r){(r=this.rl=this.newLineOfAny()).visible=this.il;var e=this.kn;this.initLine(r,e,t,i)}return r.attach(t.plotArea.container,i),this.ul=NaN,n.prototype.bind.call(this,t,i),this},i.prototype.initLine=function(t,n,i,r){var e=i.newFill(r,null==n?void 0:n.fill);this.C=e,t.fill.copy(e);var u=i.newStroke(r,null==n?void 0:n.stroke);this.mo=u,t.stroke.copy(u);var s=this.getSizeDefault(),h=i.newSize(r,null==n?void 0:n.size,s,s);this.j=h,t.points.size.set(h.x,h.y);var o=this.getOffsetDefault(),a=i.newOffset(r,n&&n.offset,o,o);this.rn=a,t.points.offset.set(a.x,a.y)},i.prototype.unbind=function(){var t=this.rl;return t&&t.detach(),n.prototype.unbind.call(this),this},Object.defineProperty(i.prototype,"shape",{get:function(){return this.rl},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"points",{get:function(){return this.gt},set:function(t){this.gt=t,this.el+=1},enumerable:!1,configurable:!0}),i.prototype.toDirty=function(){return this.el+=1,this},i.prototype.update=function(){var t=this.rl;if(t){var n=this.Ff,i=n.x,r=n.y;if(i&&r){var e=this.el,u=e!==this.ul,s=n.isDirty(i,r),h=n.isTransformDirty(i,r);(u||s||h)&&(this.ul=e,this.updateLine(t,i,r))}}return this},i.prototype.updateLine=function(t,n,r){for(var e=t.points.values,u=e.length,s=0,h=this.gt,o=NaN,a=NaN,c=NaN,f=NaN,l=0,v=h.length;l<v;l+=2){var b=h[l],d=h[l+1];null!=b&&null!=d&&(s<u?(e[s]=b,e[s+1]=d):e.push(b,d),s+=2,o!=o?(o=b,a=b,c=d,f=d):(o=Math.min(o,b),a=Math.max(a,b),c=Math.min(c,d),f=Math.max(f,d)))}e.length!==s&&(e.length=s),n.mapAll(e,0,s,2,0),r.mapAll(e,0,s,2,1),n.transform.mapAll(e,0,s,2,0),r.transform.mapAll(e,0,s,2,1),o!=o&&(o=0,a=0,c=0,f=0);var g=i.WORK_REGION||{xmin:0,xmax:0,ymin:0,ymax:0};i.WORK_REGION=g,this.adjustLineRegion(o,a,c,f,g),o=n.transform.map(n.map(g.xmin)),a=n.transform.map(n.map(g.xmax)),c=r.transform.map(r.map(g.ymin)),f=r.transform.map(r.map(g.ymax));var m=Math.abs(a-o),w=Math.abs(f-c),p=.5*(o+a),O=.5*(c+f);for(l=0,v=e.length;l<v;l+=2)e[l+0]-=p,e[l+1]-=O;t.disallowUploadedUpdate(),this.applyLine(t,n,r,m,w,p,O,e),t.allowUploadedUpdate(),rt.update(t)},i.prototype.adjustLineRegion=function(t,n,i,r,e){return e.xmin=t,e.xmax=n,e.ymin=i,e.ymax=r,e},i.prototype.applyLine=function(t,n,i,r,e,u,s,h){t.points.set(h),t.size.set(r,e),t.transform.position.set(u,s)},i.prototype.updateRegion=function(){var t=this.el;if(this.nl!==t){this.nl=t;var n=this.gt,i=this.Rf,r=this.Lf;i.clear(),r.clear(),this.calcRegion(n,i,r)}},i.prototype.calcRegion=function(t,n,i){for(var r=0,e=t.length;r<e;r+=2){var u=t[r];null!=u&&n.add(u,u);var s=t[r+1];null!=s&&i.add(s,s)}},i.prototype.destroy=function(){var t=this.rl;return t&&(this.rl=null,t.detach(),t.destroy()),this.gt.length=0,this.el=0,this.ul=NaN,n.prototype.destroy.call(this),this},i.prototype.hitTest=function(t,n){var r=this.rl;if(r){var e=i.WORK;return e.set(t,n),r.toLocal(e,void 0,e),null!=r.contains(e.x,e.y)}return!1},i.prototype.calcHitPoint=function(t,n,r){var e=this.rl;if(e){var u=i.WORK;return u.set(t,n),e.toLocal(u,void 0,u),r.shape=e,e.calcHitPoint(u.x,u.y,null,this.calcHitPointTestRange,this.calcHitPointHitTester,r)}return!1},i.prototype.calcHitPointTestRange=function(t,n,i,r,e,u,s,h,o){for(var a=$v(h,t+i+e,2,0),c=0,f=a-1,l=f<<1;0<=f;f-=1,l-=2)if(h[l]<=t-i){c=f;break}return o[0]=c,o[1]=c!==a?a:Math.min(h.length<<1,a+1),o},i.prototype.calcHitPointHitTester=function(t,n,i,r,e,u,s,h,o,a,c,f,l,v){var b=v.shape;if(b.containsPointAbs(t,n,i,r,e,u,s,h,o,a,c)){var d=b.transform,g=d.position,m=d.scale;v.x=v.p0x=v.p1x=g.x+m.x*s,v.y=v.p0y=v.p1y=g.y+m.y*h,v.t=l,v.index=f;var w=t-(s+e),p=n-(h+u);return v.distance=Math.sqrt(w*w+p*p),!0}return!1},i.WORK=new t.Point,i}(Zg),Qg=function(t){function n(n){var i=t.call(this,n)||this;return i.sl=-1,i.hl=-1,i.ol=-1,i.al=-1,i.cl=!1!==(n&&n.size&&n.size.auto),i}return B(n,t),n.prototype.bind=function(n,i){return this.sl=-1,this.hl=-1,this.ol=-1,this.al=-1,t.prototype.bind.call(this,n,i),this},n.prototype.initLine=function(n,i,r,e){t.prototype.initLine.call(this,n,i,r,e),this.zn=r.newPadding(e,i&&i.padding)},n.prototype.newLineOfAny=function(){return new bf},n.prototype.getSizeDefault=function(){return 1},n.prototype.adjustLineRegion=function(n,i,r,e,u){return t.prototype.adjustLineRegion.call(this,n,i,Math.min(0,r),Math.max(0,e),u)},n.prototype.updateBarCountAndIndex=function(){if(this.hl<0||this.sl<0){var t=0,i=0,r=this.xc;if(r)for(var e=0,u=r.size();e<u;++e){var s=r.get(e);s===this&&(t=i),s instanceof n&&(i+=1)}return i=Math.max(1,i),this.sl=i,this.hl=t,!0}return!1},n.prototype.applyLine=function(n,i,r,e,u,s,h,o){var a=n.points,c=a.offset,f=a.size,l=this.j,v=this.rn,b=this.zn;if(l&&v&&b){var d=i.id,g=i.transform.id;if(this.updateBarCountAndIndex()||this.ol!==d||this.al!==g){var m=this.sl,w=this.hl;this.ol=d,this.al=g;var p=i.transform.map(i.map(0)),O=i.transform.map(i.map(l.x)),D=Math.abs(p-O)*(1-b.outer);if(m<=1)c.x=v.x,f.x=D;else{var E=D*(1-b.inner),M=E/m,S=M*(w+.5)+w*((D-E)/(m-1));c.x=v.x+S-.5*D,f.x=M}}}var T=f.y;Rt(T)||(T=[]);var j=T.length,N=c.y;Rt(N)||(N=[]);for(var I=N.length,C=0,A=r.transform.map(r.map(0))-h,R=0,L=o.length;R<L;R+=2,C+=1){var y=o[R+1]-A,k=Math.abs(y);C<j?T[C]=k:T.push(k);var x=-.5*y;C<I?N[C]=x:N.push(x)}T.length!==C&&(T.length=C),N.length!==C&&(N.length=C),c.y=N,f.y=T,t.prototype.applyLine.call(this,n,i,r,e,u,s,h,o)},n.prototype.calcSizeX=function(t){var n=this.gt;if(2<n.length)for(var i=n.length,r=n[i-2],e=i-4;0<=e;e-=2){var u=n[e];if(null!=r&&null!=u)return Math.abs(r-u);r=u}return t},n.prototype.calcRegion=function(n,i,r){t.prototype.calcRegion.call(this,n,i,r);var e=this.j;if(e){var u=e.x;this.cl&&(u=this.calcSizeX(u),e.x=u);var s=.5*u;i.set(i.from-s,i.to+s)}r.add(0,0)},n}(qg),$g=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.newLineOfAny=function(){return new ef},n}(qg),tm=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.newLineOfAny=function(){return new af},n}(qg),nm=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.newLineOfAny=function(){return new bf},n}(qg),im=function(t){function n(n){var i=t.call(this,n)||this;return i.fl=0,i}return B(n,t),n.prototype.newLineOfAny=function(){return new Bf},n.prototype.applyLine=function(n,i,r,e,u,s,h,o){var a=this.j,c=this.rn;a&&c&&this.fl!==a.y&&(this.fl=a.y,n.points.offset.y=c.y-.2*a.y),t.prototype.applyLine.call(this,n,i,r,e,u,s,h,o)},n}(qg),rm=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.newLineOfAny=function(){return new Af},n}(im),em=function(n){function i(t){var i,r=this;return(r=n.call(this,t)||this).rl=null,r.kn=t,r.gt=null!==(i=null==t?void 0:t.points)&&void 0!==i?i:[],r.el=0,r.ul=NaN,r.ll=0,r.vl=0,r}return B(i,n),i.prototype.bind=function(t,i){var r,e=this.rl;if(!e){var u=t.newStroke(i,null===(r=this.kn)||void 0===r?void 0:r.stroke);this.mo=u,(e=new yc).stroke.copy(u),e.visible=this.il,this.rl=e}return e.attach(t.plotArea.container,i),this.ul=NaN,n.prototype.bind.call(this,t,i),this},i.prototype.unbind=function(){var t=this.rl;return t&&t.detach(),n.prototype.unbind.call(this),this},Object.defineProperty(i.prototype,"shape",{get:function(){return this.rl},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"points",{get:function(){return this.gt},set:function(t){this.gt=t,this.el+=1},enumerable:!1,configurable:!0}),i.prototype.toDirty=function(){return this.el+=1,this},i.prototype.update=function(){var t=this.rl;if(t){var n=this.Ff,i=n.x,r=n.y;if(i&&r){var e=this.el,u=e!==this.ul,s=n.isDirty(i,r),h=n.isTransformDirty(i,r);(u||s||h)&&(this.ul=e,this.updateLine(t,i,r,u||s))}}return this},i.prototype.updateLine=function(t,n,i,r){if(t.disallowUploadedUpdate(),r){for(var e=t.points.values,u=t.points.segments,s=e.length,h=u.length,o=0,a=0,c=this.gt,f=NaN,l=NaN,v=NaN,b=NaN,d=0,g=c.length;d<g;d+=2){var m=c[d],w=c[d+1];if(null!=m&&null!=w)o<s?(e[o]=m,e[o+1]=w):e.push(m,w),o+=2,f!=f?(f=m,l=m,v=w,b=w):(f=Math.min(f,m),l=Math.max(l,m),v=Math.min(v,w),b=Math.max(b,w));else{var p=(d>>1)-a;a<h?u[a]=p:u.push(p),a+=1}}e.length!==o&&(e.length=o),u.length!==a&&(u.length=a),n.mapAll(e,0,o,2,0),i.mapAll(e,0,o,2,1),f!=f&&(f=0,l=0,v=0,b=0),f=n.map(f),l=n.map(l),v=i.map(v),b=i.map(b);var O=Math.abs(l-f),D=Math.abs(b-v),E=.5*(f+l),M=.5*(v+b);for(d=0,g=e.length;d<g;d+=2)e[d+0]-=E,e[d+1]-=M;t.size.set(O,D),t.points.set(e,u),this.ll=E,this.vl=M}t.transform.position.set(n.transform.map(this.ll),i.transform.map(this.vl)),t.transform.scale.set(n.transform.scale,i.transform.scale),t.allowUploadedUpdate(),rt.update(t)},i.prototype.updateRegion=function(){var t=this.el;if(this.nl!==t){this.nl=t;var n=this.gt,i=this.Rf,r=this.Lf;if(i.clear(),r.clear(),null!=n)for(var e=0,u=n.length;e<u;e+=2){var s=n[e];null!=s&&i.add(s,s);var h=n[e+1];null!=h&&r.add(h,h)}}},i.prototype.destroy=function(){var t=this.rl;return t&&(this.rl=null,t.detach(),t.destroy()),this.gt.length=0,this.el=0,this.ul=NaN,n.prototype.destroy.call(this),this},i.prototype.hitTest=function(t,n){var r=this.rl;if(r){var e=i.WORK;return e.set(t,n),r.toLocal(e,void 0,e),null!=r.contains(e.x,e.y)}return!1},i.prototype.calcHitPoint=function(t,n,r){var e=this.rl;if(e){var u=i.WORK;return u.set(t,n),e.toLocal(u,void 0,u),r.shape=e,e.calcHitPoint(u.x,u.y,this.toThreshold,this.calcHitPointTestRange,this.calcHitPointHitTester,r)}return!1},i.prototype.toThreshold=function(t,n){return 1/0},i.prototype.calcHitPointTestRange=function(t,n,i,r,e){var u=$v(r,t,2,0);return e[0]=Math.max(0,u-1),e[1]=u,e},i.prototype.calcHitPointHitTester=function(t,n,i,r,e,u,s,h,o){if(i<=t&&t<e){var a=e-i;if(1e-4<Math.abs(a)){var c=(t-i)/a,f=t,l=r+c*(u-r),v=Math.abs(l-n);if(v<h){var b=o.shape.transform,d=b.position,g=d.x,m=d.y,w=b.scale,p=w.x,O=w.y;return o.x=g+p*f,o.y=m+O*l,o.p0x=g+p*i,o.p0y=m+O*r,o.p1x=g+p*e,o.p1y=m+O*u,o.t=c,o.index=s,o.distance=v,!0}}}return!1},i.WORK=new t.Point,i}(Zg),um=function(){function t(t,n,i,r){this.R=0,this.bl=NaN,this._a=t,this._b=n,this._x0=i,this._y0=r}return Object.defineProperty(t.prototype,"a",{get:function(){return this._a},set:function(t){this._a!==t&&(this.R+=1,this._a=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"b",{get:function(){return this._b},set:function(t){this._b!==t&&(this.R+=1,this._b=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"x0",{get:function(){return this._x0},set:function(t){this._x0!==t&&(this.R+=1,this._x0=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y0",{get:function(){return this._y0},set:function(t){this._y0!==t&&(this.R+=1,this._y0=t)},enumerable:!1,configurable:!0}),t.prototype.toDirty=function(){this.R+=1},t.prototype.isDirty=function(){return this.R!==this.bl},t.prototype.toClean=function(){this.bl=this.R},t.from=function(n){var i,r,e,u;return new t(null!==(i=null==n?void 0:n.a)&&void 0!==i?i:1,null!==(r=null==n?void 0:n.b)&&void 0!==r?r:1,null!==(e=null==n?void 0:n.x0)&&void 0!==e?e:0,null!==(u=null==n?void 0:n.y0)&&void 0!==u?u:0)},t}(),sm=function(n){function i(t){var i=n.call(this,t)||this;return i.rl=null,i.kn=t,i.dl=NaN,i.ml=NaN,i.wl=um.from(t),i}return B(i,n),i.prototype.bind=function(t,i){var r,e=this.rl;if(!e){var u=t.newStroke(i,null===(r=this.kn)||void 0===r?void 0:r.stroke);this.mo=u,(e=new yc).stroke.copy(u),e.visible=this.il,this.rl=e}return e.attach(t.plotArea.container,i),this.wl.toDirty(),this.dl=NaN,this.ml=NaN,n.prototype.bind.call(this,t,i),this},i.prototype.unbind=function(){var t=this.rl;return t&&t.detach(),n.prototype.unbind.call(this),this},Object.defineProperty(i.prototype,"shape",{get:function(){return this.rl},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"parameters",{get:function(){return this.wl},enumerable:!1,configurable:!0}),i.prototype.toDirty=function(){return this.wl.toDirty(),this},i.prototype.update=function(){var t=this.rl,n=this.xc;if(t&&n){var i=n.plotArea,r=this.Ff,e=r.x,u=r.y;if(e&&u){var s=i.width,h=i.height,o=this.wl,a=o.isDirty(),c=r.isDirty(e,u),f=r.isTransformDirty(e,u),l=s!==this.dl||h!==this.ml;(a||c||f||l)&&(o.toClean(),this.dl=s,this.ml=h,this.updateLine(t,e,u,s,h))}}return this},i.prototype.updateLine=function(t,n,i,r,e){var u=t.points.values,s=t.points.segments,h=this.wl,o=h.a,a=h.b,c=h.x0,f=h.y0,l=Math.abs(o),v=Math.abs(a),b=NaN,d=NaN,g=NaN,m=NaN,w=1e-5;if(v<=l){var p=n.unmap(n.transform.unmap(0)),O=n.unmap(n.transform.unmap(r));b=Math.min(p,O),g=Math.max(p,O);var D=i.unmap(i.transform.unmap(0)),E=i.unmap(i.transform.unmap(e));if(d=Math.min(D,E),m=Math.max(D,E),w<v){var M=(N=a/o)*(D-f)+c,S=N*(E-f)+c,T=Math.min(M,S),j=Math.max(M,S);d=(I=1/N)*((b=Math.max(b,T))-c)+a*f,m=I*((g=Math.min(g,j))-c)+a*f}else b=c,g=c}else if(D=i.unmap(i.transform.unmap(0)),E=i.unmap(i.transform.unmap(e)),d=Math.min(D,E),m=Math.max(D,E),p=n.unmap(n.transform.unmap(0)),O=n.unmap(n.transform.unmap(r)),b=Math.min(p,O),g=Math.max(p,O),w<l){var N,I,C=(N=o/a)*(p-c)+f,A=N*(O-c)+f,R=Math.min(C,A),L=Math.max(C,A);b=(I=1/N)*((d=Math.max(d,R))-f)+o*c,g=I*((m=Math.min(m,L))-f)+o*c}else d=f,m=f;b=n.transform.map(n.map(b)),d=i.transform.map(i.map(d));var y=.5*(b+(g=n.transform.map(n.map(g)))),k=.5*(d+(m=i.transform.map(i.map(m)))),x=Math.abs(g-b),B=Math.abs(m-d);b-=y,d-=k,g-=y,m-=k,4!==u.length?(u.length=0,u.push(b,d,g,m)):(u[0]=b,u[1]=d,u[2]=g,u[3]=m),0<s.length&&(s.length=0),t.disallowUploadedUpdate(),t.points.set(u,s),t.size.set(x,B),t.points.toFitted(),t.transform.position.set(y,k),t.allowUploadedUpdate(),rt.update(t)},i.prototype.updateRegion=function(){},i.prototype.destroy=function(){var t=this.rl;return t&&(this.rl=null,t.detach(),t.destroy()),n.prototype.destroy.call(this),this},i.prototype.hitTest=function(t,n){var r=this.rl;if(r){var e=i.WORK;return e.set(t,n),r.toLocal(e,void 0,e),null!=r.contains(e.x,e.y)}return!1},i.prototype.calcHitPoint=function(t,n,r){var e=this.rl;if(e){var u=i.WORK;return u.set(t,n),e.toLocal(u,void 0,u),r.shape=e,e.calcHitPoint(u.x,u.y,this.toThreshold,null,this.calcHitPointHitTester,r)}return!1},i.prototype.toThreshold=function(t,n){return 1/0},i.prototype.calcHitPointHitTester=function(t,n,i,r,e,u,s,h,o){if(i<=t&&t<e){var a=e-i;if(1e-4<Math.abs(a)){var c=(t-i)/a,f=t,l=r+c*(u-r),v=Math.abs(l-n);if(v<h){var b=o.shape.transform,d=b.position,g=d.x,m=d.y,w=b.scale,p=w.x,O=w.y;return o.x=o.p0x=o.p1x=g+p*f,o.y=o.p0y=o.p1y=m+O*l,o.t=c,o.index=s,o.distance=v,!0}}}return!1},i.WORK=new t.Point,i}(Zg),hm=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.init=function(n){var i;t.prototype.init.call(this,n);var r=this.plotArea;this.addChild(r),(null!==(i=null==n?void 0:n.mask)&&void 0!==i?i:this.theme.isOverflowMaskEnabled())&&(r.axis.container.mask=this.getOverflowMask())},n.prototype.getOverflowMask=function(){return null==this.er&&(this.er=new $i(this),this.reflowable.add(this.er),this.toDirty()),this.er},Object.defineProperty(n.prototype,"plotArea",{get:function(){var t=this.Mf;return null==t&&(t=this.newPlotArea(),this.Mf=t),t},enumerable:!1,configurable:!0}),n.prototype.newPlotArea=function(){var t;return new Ug(this,null===(t=this.kn)||void 0===t?void 0:t.plotArea)},n.prototype.getType=function(){return"DChart"},n.prototype.destroy=function(){var n;this._destroyed||(null===(n=this.Mf)||void 0===n||n.destroy(),t.prototype.destroy.call(this))},n}(Qi),om=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.isStorable=function(){return!1},n.prototype.isClear=function(){return!0},n}(Ob),am=function(t){function n(n){var i=t.call(this)||this;return i.Rr=n,i}return B(n,t),Object.defineProperty(n.prototype,"name",{get:function(){return this.Rr},enumerable:!1,configurable:!0}),n.prototype.isStorable=function(){return!1},n.prototype.execute=function(){return Sb.getDocumentController().saveAs(this.Rr),!0},n}(Ob),cm=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.isStorable=function(){return!1},n.prototype.execute=function(){return Sb.getDocumentController().save(),!0},n}(Ob),fm=function(t){function n(n,i){var r=t.call(this)||this;r.p=n;var e=null==i?void 0:i.on;if(e)for(var u in e){var s=e[u];s&&r.on(u,s)}return r}return B(n,t),n.prototype.createAsUrl=function(t){return null==t||mn(t)?this.create({size:t,extractor:function(t){return sb.base64({target:t})}}):this.create({size:t.size,cleanup:t.cleanup,extractor:function(t){return sb.base64({target:t})}})},n.prototype.createAsFile=function(t,n){at(t)?this.create({extractor:function(n){sb.file({target:n,filename:t})}}):null===t||mn(t)?this.create({size:t,extractor:function(t){sb.file({target:t,filename:n})}}):this.create({size:t.size,cleanup:t.cleanup,extractor:function(n){sb.file({target:n,filename:t.filename})}})},n.prototype.toScale=function(t,n){return null==t?1:t/rt.getResolution(n)/Math.max(n.width,n.height)},n.prototype.toCleanupSnap=function(t){if(null==t)return!0;var n=t.cleanup;return null==n||!0===n||!1!==n&&!1!==n.snap},n.prototype.toCleanupBackground=function(t){if(null==t)return!1;var n=t.cleanup;return null!=n&&!1!==n&&(!0===n||!0===n.background)},n.prototype.toCleanupReflow=function(t){if(null==t)return!0;var n=t.cleanup;return null==n||!0===n||!1!==n&&!1!==n.reflow},n.prototype.create=function(t){var n=this.p,i=n.canvas;if(i){var r=n.view,e=r.position,u=r.scale,s=e.x,h=e.y,o=u.x,a=u.y,c=this.toScale(t.size,i);r.transform(0,0,c,c,0);var f=void 0;if(this.toCleanupSnap(t)&&"snap"in i){var l=i.snap;null!=l&&((f=l.container).renderable?f.renderable=!1:f=void 0)}var v=void 0;if(this.toCleanupBackground(t)&&((v=i.snippet).renderable?v.renderable=!1:v=void 0),this.toCleanupReflow(t)){var b=rt.getLayer(i);b&&b.reflow()}this.emit("taking",i,this);var d=t.extractor(i);return this.emit("took",i,null,this),v&&(v.renderable=!0),null!=f&&(f.renderable=!0),r.transform(s,h,o,a,0),d}},n}(t.utils.EventEmitter),lm=function(t){function n(n){var i,r=this;return(r=t.call(this,n)||this).pl=null,r.Ol=null==n?void 0:n.tile,r.Dl=null==n?void 0:n.controller,r.El=null!==(i=null==n?void 0:n.ambient)&&void 0!==i?i:r.theme.isAmbient(),r.Ml=new fm(r,null==n?void 0:n.snapshot),r.Cr=r.toMode(n),r}return B(n,t),Object.defineProperty(n.prototype,"snapshot",{get:function(){return this.Ml},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"controller",{get:function(){return this.Dl||null},enumerable:!1,configurable:!0}),n.prototype.set=function(t){var n=this,i=this.pl;if(i!==t){if(i&&(this.pl=null,this.canvas&&(this.canvas=null),this.onUnset()),this.pl=t,t){var r=this.newCanvas(t),e=t.pieces,u=this.Cr,s=Ue.toPieceData(this.Dl,e,u).then((function(i){return n.newLayer(t,r,u,e,i)}));return this.onSet(t,r),this.canvas=r,s}return Promise.resolve(null)}return Promise.resolve(this.canvas)},n.prototype.onSet=function(t,n){},n.prototype.newLayer=function(t,n,i,r,e){var u=this,s=new dr(t,r,e,i,0),h=Ue.newLayer(t,n.layer,s).then((function(t){return u.initLayer(n,t)}));if(this.El){var o=this.toCanvasBaseBackgroundOptions(t,this.theme,!1);this.background.color=o.color,this.background.alpha=o.alpha}return h},n.prototype.initLayer=function(t,n,i){return t.layer.init(),t.initialize(n,i),rt.update(this),this.emit("ready",this),t},n.prototype.toCanvasBaseOptions=function(t){var n,i=this.theme,r=this.El;return{name:t.name,width:t.width,height:t.height,background:this.toCanvasBaseBackgroundOptions(t,i,r),border:r?{color:null}:void 0,outline:r?{color:null}:void 0,shadow:r?null:i.getCanvasShadow(),tile:{factory:this.Ol,mapping:null===(n=t.tile)||void 0===n?void 0:n.mapping},ambient:r}},n.prototype.toCanvasBaseBackgroundOptions=function(t,n,i){var r,e;if(i)return{color:null};var u=t.background;return{color:null!==(r=null==u?void 0:u.color)&&void 0!==r?r:n.getCanvasBackgroundColor(),alpha:null!==(e=null==u?void 0:u.alpha)&&void 0!==e?e:n.getCanvasBackgroundAlpha()}},n.prototype.onUnset=function(){},n.prototype.get=function(){return this.pl},Object.defineProperty(n.prototype,"layer",{get:function(){var t=this.canvas;return t?t.layer.active:null},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DDiagramBase"},n}(lr),vm=function(){function t(t,n){this.Jn=t,this.Ir=n}return t.prototype.getTheme=function(){return this.Jn.getTheme()},t.prototype.setTheme=function(t){this.Jn.setTheme(t)},t.prototype.getBaseColor=function(){return this.Ir},t.prototype.setBaseColor=function(t){this.Ir=t},t.prototype.getColor=function(t){var n=this.Jn,i=this.Ir,r=n.getColor(t);return null!=i?null!=r?Qt.blend(i,r,n.getAlpha(t)):i:r},Object.defineProperty(t.prototype,"color",{get:function(){return this.Jn.color},set:function(t){this.Jn.color=t},enumerable:!1,configurable:!0}),t.prototype.getAlpha=function(t){return null!=this.Ir?1:this.Jn.getAlpha(t)},Object.defineProperty(t.prototype,"alpha",{get:function(){return this.Jn.alpha},set:function(t){this.Jn.alpha=t},enumerable:!1,configurable:!0}),t}(),bm=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),Object.defineProperty(n.prototype,"lon",{get:function(){return this.x},set:function(t){this.x=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"lat",{get:function(){return this.y},set:function(t){this.y=t},enumerable:!1,configurable:!0}),n.prototype.toObject=function(){return{lon:this.x,lat:this.y}},n}(t.ObservablePoint),dm=function(){function t(t,n,i,r,e,u){if(this.Sl=t,!0===n||!1===n)this.O=n,this.It=new bm(t,null,i,r),this.Ct=new bm(t,null,e,u);else if(null!=n){this.O=n.enable;var s=n.from,h=n.to;this.It=new bm(t,null,s.lon,s.lat),this.Ct=new bm(t,null,h.lon,h.lat)}else this.O=!1,this.It=new bm(t,null,-180,85.05112877980659),this.Ct=new bm(t,null,180,-85.05112877980659)}return Object.defineProperty(t.prototype,"enable",{get:function(){return this.O},set:function(t){this.O!==t&&(this.O=t,this.Sl())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"from",{get:function(){return this.It},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"to",{get:function(){return this.Ct},enumerable:!1,configurable:!0}),t.prototype.serialize=function(){return{enable:this.O,from:this.It.toObject(),to:this.Ct.toObject()}},t}(),gm=function(){function t(t,n){var i=this;this.ir=t,this.Tl=null==n?void 0:n.factory,this.Gt=new dm((function(){i.onMappingChange()}),null==n?void 0:n.mapping)}return t.prototype.init=function(){this.onMappingChange()},t.prototype.onMappingChange=function(){var t=this.Tl;if(t){var n,i=this.Gt;i.enable?(n=this.jl)?n.mapping=i:this.jl=t(this.ir).fit():(n=this.jl)&&(this.jl=void 0,n.destroy())}},Object.defineProperty(t.prototype,"pyramid",{get:function(){return this.jl},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"factory",{get:function(){return this.Tl},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mapping",{get:function(){return this.Gt},enumerable:!1,configurable:!0}),t.prototype.serialize=function(){return{mapping:this.Gt.serialize()}},t.prototype.destroy=function(){var t=this.jl;null!=t&&(this.jl=void 0,t.destroy())},t}(),mm=function(t){function n(n,i){var r=t.call(this)||this;return r.dh=null,r.St=n,r.cn=i,r.interactive=!1,r.interactiveChildren=!1,r}return B(n,t),n.prototype.init=function(){if(null==this.dh){var t=this.children,n=t.length;0<n&&(this.dh=t[n-1])}},Object.defineProperty(n.prototype,"active",{get:function(){return this.dh},set:function(t){this.dh!==t&&(null==t||0<=this.children.indexOf(t))&&(this.dh=t,this.onLayerChange())},enumerable:!1,configurable:!0}),n.prototype.create=function(t,n){var i=new $e(t);return this.attach(i,n),i},n.prototype.attach=function(t,n){this.addChild(t),!0===n&&(this.dh=t),this.onLayerChange(),rt.update(this)},n.prototype.attachAt=function(t,n,i){this.addChildAt(t,n),!0===i&&(this.dh=t),this.onLayerChange(),rt.update(this)},n.prototype.detach=function(t,n){var i=this.children,r=i.indexOf(t);0<=r&&(this.dh=n,i.splice(r,1),t.parent=void 0,this.onLayerChange(),rt.update(this))},n.prototype.delete=function(t,n){var i=this.children,r=i.indexOf(t);return 0<=r&&(i.splice(r,1),t.parent=void 0,this.dh===t&&(!0===n?r<i.length?this.dh=i[r]:0<i.length?this.dh=i[r-1]:this.dh=null:this.dh=null),this.onLayerChange(),rt.update(this)),r},n.prototype.get=function(t){var n=this.children[t];return null!=n?n:null},n.prototype.clear=function(){var t=this.children;if(0<t.length){for(var n=t.length-1;0<=n;--n){var i=t[n];i.parent=null,i.destroy()}t.length=0,this.onLayerChange(),rt.update(this)}},n.prototype.destroy=function(){this._destroyed||(this.clear(),t.prototype.destroy.call(this))},n.prototype.size=function(){return this.children.length},n.prototype.onLayerChange=function(){this.emit("change",this)},n.prototype.serialize=function(t,n){for(var i=[],r=this.children,e=0,u=r.length;e<u;++e)r[e].addUuid(t);for(e=0,u=r.length;e<u;++e)r[e].updateUuid(t);for(e=0,u=r.length;e<u;++e)i.push(r[e].serialize(e,t,n));return i},n.prototype.deserialize=function(t,n){var i=t.length;if(0<i){for(var r=this.St,e=this.cn,u=0;u<i;++u)this.addChild($e.deserialize(t[u],n,r,e));this.onLayerChange(),rt.update(this)}},n}(t.Container),wm=function(t){function n(n){var i=t.call(this,n)||this,r=i.theme;i.isAmbient(r,n)||(i.Mn=new vm(i.Mn,i.toBackgroundBase(r,n)));var e=new mm(i.width,i.height);i.es=e,i.addChild(e);var u=new gm(i,null==n?void 0:n.tile);return i.Nl=u,u.init(),i}return B(n,t),n.prototype.isAmbient=function(t,n){var i;return null!==(i=null==n?void 0:n.ambient)&&void 0!==i?i:t.isAmbient()},n.prototype.toBackgroundBase=function(t,n){var i,r;return null!==(r=null===(i=null==n?void 0:n.background)||void 0===i?void 0:i.base)&&void 0!==r?r:t.getBackgroundBase()},Object.defineProperty(n.prototype,"tile",{get:function(){return this.Nl},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"layer",{get:function(){return this.es},enumerable:!1,configurable:!0}),n.prototype.initialize=function(t,n){},n.prototype.destroy=function(){this._destroyed||(this.onDestroy(),t.prototype.destroy.call(this))},n.prototype.onDestroy=function(){this.Nl.destroy(),this.es.destroy()},n.prototype.hitTest=function(t,n){for(var i=this.es.children,r=i.length-1;0<=r;--r){var e=i[r];if(e.visible){var u=e.hitTest(t,n);if(null!=u)return u}}return null},n.prototype.getType=function(){return"DDiagramCanvasBase"},n}(Zd),pm=function(){function t(t){this.ir=t}return t.prototype.each=function(t,n){for(var i=this.ir.layer.children,r=0,e=i.length;r<e&&!1!==this.Pc(i[r].children,t,n);++r);return this},t.prototype.Pc=function(t,n,i){for(var r=0,e=t.length;r<e;++r){var u=t[r];if(!1===n(u))return!1;if(i||mr.contains(u,wt.CHILDREN)){var s=u.children;if(0<s.length&&!1===this.Pc(s,n,i))return!1}}},t}(),Om=function(){function t(){}return Object.defineProperty(t.prototype,"private",{get:function(){var t=this.Ht;return null==t&&(t=this.newPrivate(),this.Ht=t),t},enumerable:!1,configurable:!0}),t.prototype.newPrivate=function(){return new Lt},Object.defineProperty(t.prototype,"protected",{get:function(){var t=this.Il;return null==t&&(t=this.newProtected(),this.Il=t),t},enumerable:!1,configurable:!0}),t.prototype.newProtected=function(){return new Lt},Object.defineProperty(t.prototype,"extended",{get:function(){var t=this.Cl;return null==t&&(t=this.newExtended(),this.Cl=t),t},enumerable:!1,configurable:!0}),t.prototype.newExtended=function(){return new Lt},Object.defineProperty(t.prototype,"ids",{get:function(){var t=this.Pt;if(null==t)return[];var n=[];return t.forEach((function(t,i){n.push(i)})),n},enumerable:!1,configurable:!0}),t.prototype.each=function(t){var n=this.Pt;if(null==n)return null;var i=null;return n.forEach((function(n,r){null==i&&!1===t(r)&&(i=r)})),i},t.prototype.add=function(t,n){var i,r=null!==(i=this.Pt)&&void 0!==i?i:this.Pt=new Map,e=r.get(t);null==e?r.set(t,[n]):e.push(n)},t.prototype.set=function(t,n,i,r,e,u){var s=this.Pt;if(null==s)return!1;var h=s.get(t);if(null==h)return!1;var o=h.length;if(o<=0)return!1;for(var a=0;a<o;++a){var c=h[a];c.range.set(e,u),void 0!==i&&(c.time=i),void 0!==r&&(c.state=r),void 0!==n&&(c.value=n)}return!0},t.prototype.get=function(t){var n=this.Pt;if(null==n)return null;var i=n.get(t);return null==i?null:i},t.prototype.clear=function(t){var n=this.Pt;if(null==n)return!1;var i=n.get(t);if(null==i)return!1;var r=i.length;if(r<=0)return!1;for(var e=0;e<r;++e)i[e].clear();return!0},t.prototype.toDirty=function(t){var n=this.Pt;if(null==n)return!1;var i=n.get(t);if(null==i)return!1;var r=i.length;if(r<=0)return!1;for(var e=0;e<r;++e)i[e].toDirty();return!0},t.prototype.setAll=function(t,n,i,r,e,u){var s=this.Pt;if(null==s)return!1;var h=s.get(t);if(null==h)return!1;var o=h.length;if(o<=0)return!1;for(var a=0;a<o;++a){var c=h[a];c.range.set(e,u),void 0!==i&&(c.times=i),void 0!==r&&(c.states=r),void 0!==n&&(c.values=n)}return!0},t.prototype.setValue=function(t,n){var i=this.Pt;if(null==i)return!1;var r=i.get(t);if(null==r)return!1;var e=r.length;if(e<=0)return!1;for(var u=0;u<e;++u)r[u].value=n;return!0},t.prototype.setValues=function(t,n){var i=this.Pt;if(null==i)return!1;var r=i.get(t);if(null==r)return!1;var e=r.length;if(e<=0)return!1;for(var u=0;u<e;++u)r[u].values=n;return!0},t.prototype.setTime=function(t,n){var i=this.Pt;if(null==i)return!1;var r=i.get(t);if(null==r)return!1;var e=r.length;if(e<=0)return!1;for(var u=0;u<e;++u)r[u].time=n;return!0},t.prototype.setTimes=function(t,n){var i=this.Pt;if(null==i)return!1;var r=i.get(t);if(null==r)return!1;var e=r.length;if(e<=0)return!1;for(var u=0;u<e;++u)r[u].times=n;return!0},t.prototype.setState=function(t,n){var i=this.Pt;if(null==i)return!1;var r=i.get(t);if(null==r)return!1;var e=r.length;if(e<=0)return!1;for(var u=0;u<e;++u)r[u].state=n;return!0},t.prototype.setStates=function(t,n){var i=this.Pt;if(null==i)return!1;var r=i.get(t);if(null==r)return!1;var e=r.length;if(e<=0)return!1;for(var u=0;u<e;++u)r[u].states=n;return!0},t.prototype.setRange=function(t,n,i){var r=this.Pt;if(null==r)return!1;var e=r.get(t);if(null==e)return!1;var u=e.length;if(u<=0)return!1;for(var s=0;s<u;++s){var h=e[s].range;void 0!==n&&(null!==n?(h.type|=Et.FROM,h.from=n):h.type&=~Et.FROM),void 0!==i&&(null!==i?(h.type|=Et.TO,h.to=i):h.type&=~Et.TO)}return!0},t}(),Dm=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n}(pm),Em=function(){function t(t,n,i){var r=this;this.p=t;var e=i.controller;this.Dl=e;var u=function(){r.onChange()};e.grid.on("change",u),e.target.on("change",u);var s=new Te;s.visible=!1,this.xc=s,t.addChildAt(s,t.children.length-1),this.Al=this.toGrid(n,i.grid),this.Jn=this.toTarget(n,i.target)}return t.prototype.toGrid=function(t,n){var i;return{major:this.toGridMajor(t,null==n?void 0:n.major),minor:this.toGridMinor(t,null==n?void 0:n.minor),size:null!==(i=null==n?void 0:n.size)&&void 0!==i?i:t.getSnapGridSize()}},t.prototype.toGridMajor=function(t,n){var i,r,e,u,s;return{interval:null!==(i=null==n?void 0:n.interval)&&void 0!==i?i:t.getSnapGridMajorInterval(),color:null!==(r=null==n?void 0:n.color)&&void 0!==r?r:t.getSnapGridMajorColor(),alpha:null!==(e=null==n?void 0:n.alpha)&&void 0!==e?e:t.getSnapGridMajorAlpha(),width:null!==(u=null==n?void 0:n.width)&&void 0!==u?u:t.getSnapGridMajorWidth(),style:null!==(s=null==n?void 0:n.style)&&void 0!==s?s:t.getSnapGridMajorStyle()}},t.prototype.toGridMinor=function(t,n){var i,r,e,u;return{color:null!==(i=null==n?void 0:n.color)&&void 0!==i?i:t.getSnapGridMinorColor(),alpha:null!==(r=null==n?void 0:n.alpha)&&void 0!==r?r:t.getSnapGridMinorAlpha(),width:null!==(e=null==n?void 0:n.width)&&void 0!==e?e:t.getSnapGridMinorWidth(),style:null!==(u=null==n?void 0:n.style)&&void 0!==u?u:t.getSnapGridMinorStyle()}},t.prototype.toTarget=function(t,n){var i,r,e,u;return{color:null!==(i=null==n?void 0:n.color)&&void 0!==i?i:t.getSnapTargetColor(),alpha:null!==(r=null==n?void 0:n.alpha)&&void 0!==r?r:t.getSnapTargetAlpha(),width:null!==(e=null==n?void 0:n.width)&&void 0!==e?e:t.getSnapTargetWidth(),style:null!==(u=null==n?void 0:n.style)&&void 0!==u?u:t.getSnapTargetStyle()}},t.prototype.onChange=function(){var t=this.p;t.toDirty(),rt.update(t)},Object.defineProperty(t.prototype,"container",{get:function(){return this.xc},enumerable:!1,configurable:!0}),t.prototype.serialize=function(){return this.Dl.serialize()},t.prototype.onReflow=function(){var t=this.p,n=this.xc,i=this.Dl,r=i.grid.visible,e=i.target.visible;if(r||e){var u=t.width,s=t.height,h=.5*u,o=.5*s,a=$.TOP,c=$.LEFT,f=n.children,l=0;if(r){for(var v=this.Al,b=v.major,d=v.minor,g=b.interval,m=v.size(i.grid.size,u,s),w=m,p=1;w<u;w+=m,p+=1,l+=1){var O=p%g==0?b:d;this.update(n,f,l,w,o,a,u,s,O)}for(var D=m,E=1;D<s;D+=m,E+=1,l+=1)O=E%g==0?b:d,this.update(n,f,l,h,D,c,u,s,O)}if(e)for(var M=i.target.values,S=this.Jn,T=0,j=M.length;T<j;T+=1,l+=1){var N=M[T],I=N.position;N.type===Bv.VERTICAL?this.update(n,f,l,I,o,a,u,s,S):this.update(n,f,l,h,I,c,u,s,S)}for(T=l,j=f.length;T<j;++T)f[T].visible=!1;n.visible=!0}else n.visible=!1},t.prototype.update=function(t,n,i,r,e,u,s,h,o){var a=null;i<n.length?((a=n[i]).disallowUploadedUpdate(),a.points.position=u,a.transform.position.set(r,e),a.stroke.set(!0,o.color,o.alpha,o.width,void 0,void 0,o.style),a.size.set(s,h),a.visible=!0,a.allowUploadedUpdate()):((a=new Kt).disallowUploadedUpdate(),a.points.position=u,a.transform.position.set(r,e),a.stroke.set(!0,o.color,o.alpha,o.width,void 0,void 0,o.style),a.size.set(s,h),a.visible=!0,a.allowUploadedUpdate(),a.attach(t))},t}(),Mm=function(t){function n(n){var i=t.call(this,n)||this;return i.Rl=i.toSnap(i.theme,n.snap),i}return B(n,t),n.prototype.toSnap=function(t,n){return n?new Em(this,t,n):null},Object.defineProperty(n.prototype,"snap",{get:function(){return this.Rl},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"shape",{get:function(){var t=this._r;return null==t&&(t=this.newShape(),this._r=t),t},enumerable:!1,configurable:!0}),n.prototype.newShape=function(){return new Dm(this)},n.prototype.serialize=function(t,n){var i,r=new yv,e=[],u=this.Mn,s=u.color,h=u.alpha;return{version:1,id:t,name:this.name,width:this.width,height:this.height,background:{color:mn(s)?s:16777215,alpha:mn(h)?h:0},tile:this.Nl.serialize(),resources:r.resources,data:r.data,pieces:r.pieces,layers:this.es.serialize(r,e),items:e,snap:null===(i=this.Rl)||void 0===i?void 0:i.serialize(),thumbnail:null==n?void 0:n.serialize()}},n.prototype.onReflow=function(){var n;t.prototype.onReflow.call(this),null===(n=this.Rl)||void 0===n||n.onReflow()},n.prototype.getType=function(){return"DDiagramCanvasEditor"},n}(wm),Sm=function(t){function n(n){var i=t.call(this,n)||this;return i.Pt=new Map,i}return B(n,t),n.prototype.add=function(t,n){var i=this.Pt,r=i.get(t);null==r?i.set(t,[n]):r.push(n)},n.prototype.get=function(t){var n=this.Pt.get(t);return n&&0<n.length?n[0]:null},n.prototype.getAll=function(t){return this.Pt.get(t)||[]},n}(pm),Tm=function(){function t(t,n){var i=this;this.p=t,this.L=[],this.ha=n,this.Ll=function(){i.onTime()}}return t.prototype.add=function(t){this.L.push(t)},t.prototype.start=function(){null==this.yl&&this.onTime()},t.prototype.getInterval=function(){var t=Date.now(),n=this.ha;return Math.max(0,n-t%n)},t.prototype.onTime=function(){var t=this.L;if(0<t.length){for(var n=Date.now()/this.ha,i=0,r=t.length;i<r;++i)t[i].value=n;rt.update(this.p)}this.yl=window.setTimeout(this.Ll,this.getInterval())},t.prototype.stop=function(){var t=this.yl;null!=t&&(clearTimeout(t),this.yl=void 0)},t}(),jm=function(){function t(t){this.p=t,this.Pt=new Map}return t.prototype.add=function(t){var n=this.Pt,i=this.toNormalized(t),r=n.get(i);if(null!=r)return r;var e=new Tm(this.p,i);return n.set(i,e),e},t.prototype.toNormalized=function(t){return mn(t)?Math.max(1,Math.round(t)):1e3},t.prototype.start=function(){this.Pt.forEach((function(t){t.start()}))},t.prototype.stop=function(){this.Pt.forEach((function(t){t.stop()}))},t}(),Nm="[]",Im=function(){return 0},Cm=function(){return[]},Am=function(){return""},Rm=function(){return{}},Lm=function(){return!1},ym=function(n){function i(t){var i=n.call(this,t)||this;return i.Pt=new Om,i._r=new Sm(i),i.kl=new jm(i),i.xl=[],i.Bl=new Set,i.aa=function(){rt.update(i)},i}return B(i,n),Object.defineProperty(i.prototype,"data",{get:function(){return this.Pt},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"shape",{get:function(){return this._r},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"ticker",{get:function(){return this.kl},enumerable:!1,configurable:!0}),i.prototype.initialize=function(t,n){var i=this,r=this.xl,e=this.Pt;this._l(t,null,null,n,new Map,new Map,new Map,this.kl,this._r,e,r);for(var u=this.es.children,s=u.length,h=0;h<s;++h)u[h].initialize(r);nn.isInitializing=!0;var o=Date.now();for(h=0;h<s;++h)u[h].update(o);nn.isInitializing=!1,e.extended.each((function(t){var n=Cv.getById(t);if(n){var r=n.start;r&&r(i)}})),this.kl.start()},i.prototype._l=function(t,n,i,r,e,u,s,h,o,a,c){for(var f=function(f,v){var b=t[f],d=b.id;0<d.length&&o.add(d,b),l.initData(b,n,i,r,e,u,h,a);var g=new(vo[b.type]||Ze)(b);b.runtime=g,l.initActions(b,g,s),g.initialize(b);var m=b.shortcut;null!=m&&Xi.on(b,m,(function(t){g.onClick(b,t)})),g.isActionable()&&c.push(b);var w=b.children;if(0<w.length){var p=n,O=i;b instanceof Nr&&(null==p&&(p=b),O=b),l._l(w,p,O,r,e,u,s,h,o,a,c)}},l=this,v=0,b=t.length;v<b;++v)f(v)},i.prototype.initData=function(t,n,i,r,e,u,s,h){for(var o=t.data,a=0,c=o.size();a<c;++a){var f=o.get(a);if(null!=f)switch(f.type){case Tt.BOOLEAN:case Tt.BOOLEAN_ARRAY:case Tt.NUMBER:case Tt.NUMBER_ARRAY:case Tt.STRING:case Tt.STRING_ARRAY:case Tt.OBJECT:case Tt.OBJECT_ARRAY:this.initDataValue(f,t,n,i,r,e,u,h);break;case Tt.TICKER:this.initDataTicker(f,u,s);break;default:this.initDataExtension(f,h)}}},i.prototype.initDataValue=function(t,n,i,r,e,u,s,h){if(t.scope===jt.PRIVATE)0<(o=t.id).length&&(r?r.data.private.add(o,t):h.private.add(o,t));else if(t.scope===jt.PROTECTED)0<(o=t.id).length&&h.protected.add(o,t);else{var o;e&&e(t,i||n),0<(o=t.id).length&&h.add(o,t)}var a=t.format,c=t.initial,f=u.get(t.type);null==f&&(f=new Map,u.set(t.type,f));var l=f.get(a);if(null!=l)t.formatter=l;else if(0<a.length){var v=this.calcFormatter(t,a,c);f.set(a,v),t.formatter=v}var b=s.get(t.type);null==b&&(b=new Map,s.set(t.type,b));var d=b.get(c);if(null!=d)t.value=d();else{var g=this.calcInitial(t,c);b.set(c,g),t.value=g()}},i.prototype.initDataTicker=function(t,n,i){var r=t.initial,e=n.get(t.type);null==e&&(e=new Map,n.set(t.type,e));var u=e.get(r);if(void 0!==u)t.value=0,i.add(u()).add(t);else{var s=this.calcInitial(t,r);e.set(r,s),t.value=0,i.add(s()).add(t)}},i.prototype.initDataExtension=function(t,n){var i=Cv.get(t.type);i&&(n.extended.add(i.id,t),t.value=i.initial)},i.prototype.initActions=function(t,n,i){var r=t.action.values,e=n.actions,u=Ov.get(t.type);if(null!=u)for(var s=0,h=u.length;s<h;++s){var o=u[s];e.push(o),n.reset|=o.reset}for(s=0,h=r.length;s<h;++s){var a=r[s],c=i.get(a);null==c?null!=(c=a.toRuntime())&&(i.set(a,c),e.push(c),n.reset|=c.reset):(e.push(c),n.reset|=c.reset)}},i.prototype.calcFormatter=function(t,n,i){var r=this.toInitial(t);try{return Function("value","try {"+"return (".concat(n,");")+"} catch( e1 ) {try {"+"return (".concat(0<i.length?i:r,");")+"} catch( e2 ) {"+"return ".concat(r,";")+"}}")}catch(n){return this.toInitializer(t)}},i.prototype.calcInitial=function(t,n){if(n.length<=0)return this.toInitializer(t);try{return Function("try {"+"return (".concat(n,");")+"} catch( e ) {"+"return ".concat(this.toInitial(t),";")+"}")}catch(n){return this.toInitializer(t)}},i.prototype.toInitial=function(t){switch(t.type){case Tt.BOOLEAN:return"false";case Tt.BOOLEAN_ARRAY:return Nm;case Tt.NUMBER:return"0";case Tt.NUMBER_ARRAY:return Nm;case Tt.STRING:return'""';case Tt.STRING_ARRAY:return Nm;case Tt.OBJECT:return"{}";case Tt.OBJECT_ARRAY:return Nm;case Tt.TICKER:default:return"0"}},i.prototype.toInitializer=function(t){switch(t.type){case Tt.BOOLEAN:return Lm;case Tt.BOOLEAN_ARRAY:return Cm;case Tt.NUMBER:return Im;case Tt.NUMBER_ARRAY:return Cm;case Tt.STRING:return Am;case Tt.STRING_ARRAY:return Cm;case Tt.OBJECT:return Rm;case Tt.OBJECT_ARRAY:return Cm;case Tt.TICKER:default:return Im}},i.prototype.onDestroy=function(){var t=this;this.Pt.extended.each((function(n){var i=Cv.getById(n);if(i){var r=i.stop;r&&r(t)}})),this.kl.stop(),n.prototype.onDestroy.call(this)},i.prototype.hitTestInteractives=function(t){for(var n=this.es.children,i=n.length-1;0<=i;--i){var r=n[i];if(r.visible){var e=r.hitTestInteractives(t);if(null!=e)return e}}return null},i.prototype.onShapeMove=function(t){var n=this.hitTestInteractives(t.data.global);this.cursor=this.Kn=this.toShapeCursor(n);var i=rt.getLayer(this);if(i){var r=this.toShapeTitle(n),e=i.view;e.title!==r&&(e.title=r)}var u=this.Pl;if(this.Pl=n,n===u){if(null!=n){var s=n.runtime;s&&s.onMove(n,t)}}else this.onShapeOut(t,u,n),this.onShapeOver(t,n);return null!=n},i.prototype.toShapeCursor=function(t){if(null!=t)for(var n=t;;){var i=n.cursor;if(null!=i&&0<i.length)return i;var r=n.parent;if(!(r instanceof Ot))break;n=r}return"auto"},i.prototype.toShapeTitle=function(t){if(null!=t)for(var n=t;;){var i=n.title;if(null!=i&&0<i.length)return i;var r=n.parent;if(!(r instanceof Ot))break;n=r}return""},i.prototype.onShapeOut=function(t,n,i){for(;null!=n&&n!==i&&n instanceof Ot;){var r=n.runtime;r&&r.onOut(n,t),n=n.parent}},i.prototype.onShapeOver=function(t,n,i){for(;null!=n&&n!==i&&n instanceof Ot;){var r=n.runtime;r&&r.onOver(n,t),n=n.parent}},i.prototype.onShapeDown=function(t){var n=this.hitTestInteractives(t.data.global);if(this.Ul=n,n){this.Bl.add(n);for(var i=n;;){var r=i.runtime;r&&r.onDown(i,t);var e=i.parent;if(!(e instanceof Ot))break;i=e}return!0}return!1},i.prototype.onShapeUp=function(t){var n=this.Bl,i=this.hitTestInteractives(t.data.global);if(i){n.delete(i);for(var r=i;;){var e=r.runtime;e&&e.onUp(r,t);var u=r.parent;if(!(u instanceof Ot))break;r=u}}return this.onShapeCancel(t),null!=i},i.prototype.onShapeCancel=function(t){var n=this.Bl;return 0<n.size&&(n.forEach((function(n){for(var i=n;;){var r=i.runtime;r&&r.onUpOutside(i,t);var e=i.parent;if(!(e instanceof Ot))break;i=e}})),n.clear(),!0)},i.prototype.onShapeClick=function(t){var n=this.hitTestInteractives(t.data.global);if(n&&this.Ul===n){for(var i=n;;){var r=i.runtime;r&&r.onClick(i,t);var e=i.parent;if(!(e instanceof Ot))break;i=e}return!0}return!1},i.prototype.onShapeDblClick=function(n,r){var e,u=null!==(e=i.WORK_DBLCLICK)&&void 0!==e?e:i.WORK_DBLCLICK=new t.Point;Ki.toGlobal(n,r,u);var s=this.hitTestInteractives(u);if(s){for(var h=s;;){var o=h.runtime;o&&o.onDblClick(h,n,r);var a=h.parent;if(!(a instanceof Ot))break;h=a}return!0}return!1},i.prototype.onShapeRightClick=function(t){var n=this.hitTestInteractives(t.data.global);if(n&&this.Ul===n){for(var i=n;;){var r=i.runtime;r&&r.onRightClick(i,t);var e=i.parent;if(!(e instanceof Ot))break;i=e}return!0}return!1},i.prototype.onShapeRightDown=function(t){var n=this.hitTestInteractives(t.data.global);if(this.Ul=n,n){this.Bl.add(n);for(var i=n;;){var r=i.runtime;r&&r.onRightDown(i,t);var e=i.parent;if(!(e instanceof Ot))break;i=e}return!0}return!1},i.prototype.onShapeRightUp=function(t){var n=this.Bl,i=this.hitTestInteractives(t.data.global);if(i){n.delete(i);for(var r=i;;){var e=r.runtime;e&&e.onRightUp(r,t);var u=r.parent;if(!(u instanceof Ot))break;r=u}}return this.onShapeRightCancel(t),null!=i},i.prototype.onShapeRightCancel=function(t){var n=this.Bl;return 0<n.size&&(n.forEach((function(n){for(var i=n;;){var r=i.runtime;r&&r.onRightUpOutside(i,t);var e=i.parent;if(!(e instanceof Ot))break;i=e}})),n.clear(),!0)},i.prototype.update=function(){var t=this.xl;if(0<t.length){for(var n=-1,i=Date.now(),r=0,e=t.length;r<e;++r){var u=t[r];u.update(i);var s=u.runtime;if(s){var h=s.effect;i<h&&(n=n<0?h:Math.min(n,h))}}0<=n&&window.setTimeout(this.aa,n-Date.now())}},i.prototype.onRender=function(t){var n=this.xl;if(0<n.length){for(var i=-1,r=Date.now(),e=0,u=n.length;e<u;++e){var s=n[e];s.onRender(r,t);var h=s.runtime;if(h){var o=h.effect;r<o&&(i=i<0?o:Math.min(i,o))}}0<=i&&window.setTimeout(this.aa,i-Date.now())}},i.prototype.getType=function(){return"DDiagramCanvas"},i}(wm),km=function(){function t(t){this.Fl=t}return Object.defineProperty(t.prototype,"ids",{get:function(){var t=this.Fl.canvas;return null!=t?t.data.private.ids:[]},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n,i,r,e,u){var s=this.Fl.canvas;return null!=s&&s.data.private.set(t,n,i,r,e,u)},t.prototype.toDirty=function(t){var n=this.Fl.canvas;return null!=n&&n.data.private.toDirty(t)},t.prototype.each=function(t){var n=this.Fl.canvas;return null!=n?n.data.private.each(t):null},t}(),xm=function(){function t(t){this.Fl=t}return Object.defineProperty(t.prototype,"ids",{get:function(){var t=this.Fl.canvas;return null!=t?t.data.protected.ids:[]},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n,i,r,e,u){var s=this.Fl.canvas;return null!=s&&s.data.protected.set(t,n,i,r,e,u)},t.prototype.toDirty=function(t){var n=this.Fl.canvas;return null!=n&&n.data.protected.toDirty(t)},t.prototype.each=function(t){var n=this.Fl.canvas;return null!=n?n.data.protected.each(t):null},t}(),Bm=function(){function t(t){this.Dl=t&&t.controller}return t.prototype.set=function(t,n){var i=this.Dl;return!!i&&(i.write(t,n),!0)},t}(),_m=function(){function t(t){this.Fl=t}return Object.defineProperty(t.prototype,"ids",{get:function(){var t=this.Fl.canvas;return null!=t?t.data.extended.ids:[]},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n,i,r,e,u){var s=this.Fl.canvas;return null!=s&&s.data.extended.set(t,n,i,r,e,u)},t.prototype.toDirty=function(t){var n=this.Fl.canvas;return null!=n&&n.data.extended.toDirty(t)},t.prototype.each=function(t){var n=this.Fl.canvas;return null!=n?n.data.extended.each(t):null},t}(),Pm=function(){function t(t,n){this.Fl=t,this.Gl=n&&n.mapper||null,this.Hl=new Bm(n&&n.remote),this.Ht=new km(t),this.Il=new xm(t),this.Cl=new _m(t)}return t.prototype.update=function(){},Object.defineProperty(t.prototype,"mapper",{get:function(){return this.Gl},set:function(t){this.Gl=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"remote",{get:function(){return this.Hl},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"private",{get:function(){return this.Ht},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"protected",{get:function(){return this.Il},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"extended",{get:function(){return this.Cl},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ids",{get:function(){var t=this.Fl.canvas;return t?t.data.ids:[]},enumerable:!1,configurable:!0}),t.prototype.each=function(t){var n=this.Fl.canvas;return null!=n?n.data.each(t):null},t.prototype.set=function(t,n,i,r,e,u){var s=this.Fl.canvas;return null!=s&&s.data.set(t,n,i,r,e,u)},t.prototype.get=function(t){var n=this.Fl.canvas;return null!=n?n.data.get(t):null},t.prototype.clear=function(t){var n=this.Fl.canvas;return null!=n&&n.data.clear(t)},t.prototype.toDirty=function(t){var n=this.Fl.canvas;return null!=n&&n.data.toDirty(t)},t.prototype.setAll=function(t,n,i,r,e,u){var s=this.Fl.canvas;return null!=s&&s.data.setAll(t,n,i,r,e,u)},t.prototype.setValue=function(t,n){var i=this.Fl.canvas;return null!=i&&i.data.setValue(t,n)},t.prototype.setValues=function(t,n){var i=this.Fl.canvas;return null!=i&&i.data.setValues(t,n)},t.prototype.setTime=function(t,n){var i=this.Fl.canvas;return null!=i&&i.data.setTime(t,n)},t.prototype.setTimes=function(t,n){var i=this.Fl.canvas;return null!=i&&i.data.setTimes(t,n)},t.prototype.setState=function(t,n){var i=this.Fl.canvas;return null!=i&&i.data.setState(t,n)},t.prototype.setStates=function(t,n){var i=this.Fl.canvas;return null!=i&&i.data.setStates(t,n)},t.prototype.setRange=function(t,n,i){var r=this.Fl.canvas;return null!=r&&r.data.setRange(t,n,i)},t}(),Um=function(){function t(t,n,i){this.Ml=t,this.rs=this.toIsEnabled(n,i),this.kn=this.toCreateAsUrlOptions(n,i)}return t.prototype.toIsEnabled=function(t,n){var i;return null!==(i=null==n?void 0:n.enable)&&void 0!==i?i:t.isThumbnailEnabled()},t.prototype.toSize=function(t,n){return void 0!==n?n:t.getThumbnailSize()},t.prototype.toCleanup=function(t,n){var i,r;return null==n||!0===n?{snap:!0,background:!0}:!1===n?{snap:!1,background:!1}:{snap:null===(i=n.snap)||void 0===i||i,background:null===(r=n.background)||void 0===r||r}},t.prototype.toCreateAsUrlOptions=function(t,n){return{size:this.toSize(t,null==n?void 0:n.size),cleanup:this.toCleanup(t,null==n?void 0:n.cleanup)}},Object.defineProperty(t.prototype,"enable",{get:function(){return this.rs},set:function(t){this.rs=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return this.kn.size},set:function(t){this.kn.size=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cleanup",{get:function(){return this.kn.cleanup},enumerable:!1,configurable:!0}),t.prototype.serialize=function(){if(this.rs)return this.Ml.createAsUrl(this.kn)},t}(),Fm=function(t){function n(n){var i=t.call(this,n)||this;i.Ut=!1,i.Ut=!1,Sb.getCommandController().on("dirty",(function(){!0!==i.Ut&&(i.Ut=!0,i.emit("change",i))}));var r=i.theme;return i.zl=new Gv(i,r,null==n?void 0:n.snapper),i.Vl=new Um(i.Ml,r,null==n?void 0:n.thumbnail),i}return B(n,t),Object.defineProperty(n.prototype,"thumbnail",{get:function(){return this.Vl},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"snapper",{get:function(){return this.zl},enumerable:!1,configurable:!0}),n.prototype.toMode=function(t){return(null==t?void 0:t.mapping)?gr.EDITOR_DATA_MAPPED:gr.EDITOR},n.prototype.newCanvas=function(t){return new Mm(this.toCanvasOptions(t))},n.prototype.toCanvasOptions=function(t){var n=this.toCanvasBaseOptions(t),i=this.zl,r=n.snap;return null==r?n.snap={controller:i}:null==r.controller&&(r.controller=i),n},n.prototype.serialize=function(){var t=this.canvas,n=this.pl;if(null!=t&&null!=n){this.emit("serializing",t,this);try{var i=t.serialize(n.id,this.Vl);return this.emit("serialized",t,null,this),i}catch(n){return this.emit("serialized",t,"exception",this),null}}return null},n.prototype.save=function(){var t=this,n=this.serialize();if(null!=n){var i=this.Dl;if(i){var r=Ue.toSimple(n);return this.emit("saving",r,this),i.save(r).then((function(i){t.Ut=!1,n.id=i,t.pl=n,t.emit("change",t),t.emit("saved",null,t)}),(function(n){t.emit("saved",n,t)}))}return this.emit("saved","no-controller",this),Promise.reject()}return this.emit("saved",null,this),Promise.resolve()},n.prototype.saveAs=function(t){var n=this,i=this.serialize();if(null!=i){var r=this.Dl;if(r){i.id=void 0,i.name=t;var e=Ue.toSimple(i);return this.emit("saving",e,this),r.save(e).then((function(r){n.Ut=!1,i.id=r,n.pl=i;var e=n.canvas;null!=e&&(e.name=t),n.emit("change",n),n.emit("saved",null,n)}),(function(t){n.emit("saved",t,n)}))}return this.emit("saved","no-controller",this),Promise.reject("no-controller")}return this.emit("saved",null,this),Promise.resolve()},n.prototype.delete=function(){var t=this,n=this.pl;if(n&&null!=n.id){var i=this.Dl;return i?(this.emit("deleting",this),i.delete(n.id).then((function(){var n=t.set(null);return t.emit("deleted",null,t),n}),(function(n){return t.emit("deleted",n,t),Promise.reject(n)}))):(this.emit("deleted","no-controller",this),Promise.reject("no-controller"))}return this.set(null),this.emit("deleted",null,this),Promise.resolve(null)},n.prototype.create=function(t,n,i){return this.set({version:1,id:void 0,name:t,width:n,height:i,resources:[],data:[],layers:[["Default layer"]],items:[],snap:void 0})},n.prototype.onSet=function(n,i){t.prototype.onSet.call(this,n,i);var r=n.snap,e=this.zl;null!=r?e.deserialize(r):e.reset(),this.El&&(e.target.visible=!1,e.grid.visible=!1),this.Ut=!1,this.emit("change",this)},n.prototype.onUnset=function(){t.prototype.onUnset.call(this),this.Ut=!1,this.emit("change",this)},n.prototype.open=function(t){var n=this,i=this.Dl;return i?(this.emit("opening",this),i.get(t).then((function(t){var i=n.set(Ue.toSerialized(t));return n.emit("opened",null,n),i}),(function(t){return n.emit("opened",t,n),Promise.reject(t)}))):(this.emit("opened","no-controller",this),Promise.reject("no-controller"))},n.prototype.close=function(){return this.set(null)},n.prototype.isChanged=function(){return this.Ut||this.isNew()},n.prototype.isNew=function(){var t=this.pl;return null!=t&&null==t.id},n.prototype.getName=function(){var t=this.pl;return null!=t?t.name:null},n.prototype.getType=function(){return"DDiagramEditor"},n}(lm),Gm=function(t){function n(n){var i=t.call(this)||this;return i.Fl=n,i.aa=function(){rt.update(n)},i}return B(n,t),n.prototype.update=function(){var t=this.Fl.canvas;t&&t.update()},n.prototype.onRender=function(t){var n=this.Fl.canvas;n&&n.onRender(t)},n.prototype.get=function(t){var n=this.Fl.canvas;return n?n.shape.get(t):null},n.prototype.getAll=function(t){var n=this.Fl.canvas;return n?n.shape.getAll(t):[]},n.prototype.each=function(t,n){void 0===n&&(n=!1);var i=this.Fl.canvas;if(null!=i){var r=i.layer.children;if(n){for(e=r.length-1;0<=e;--e)for(h=(s=r[e].children).length-1;0<=h;--h)if(!1===t(a=s[h]))return a}else for(var e=0,u=r.length;e<u;++e)for(var s,h=0,o=(s=r[e].children).length;h<o;++h){var a;if(!1===t(a=s[h]))return a}}return null},n}(t.utils.EventEmitter),Hm=function(t){function n(n){var i=t.call(this,n)||this;i.on(Ki.move,(function(t){i.onShapeMove(t)})),i.on(Ki.up,(function(t){i.onShapeUp(t)})),i.on(Ki.upoutside,(function(t){i.onShapeCancel(t)})),i.on(Ki.cancel,(function(t){i.onShapeCancel(t)})),i.on(Ki.tap,(function(t){i.onShapeClick(t)})),i.on(Ki.righttap,(function(t){i.onShapeRightClick(t)})),i.on(Ki.rightdown,(function(t){i.onShapeRightDown(t)})),i.on(Ki.rightup,(function(t){i.onShapeRightUp(t)})),i.on(Ki.rightupoutside,(function(t){i.onShapeRightCancel(t)}));var r=new Pm(i,n&&(n.data||n.tag));return i.data=r,i.tag=r,i.shape=new Gm(i),i}return B(n,t),n.prototype.initLayer=function(n,i,r){return t.prototype.initLayer.call(this,n,i,r||this.data.mapper)},n.prototype.toMode=function(t){return gr.VIEWER},n.prototype.newCanvas=function(t){return new ym(this.toCanvasOptions(t))},n.prototype.toCanvasOptions=function(t){return this.toCanvasBaseOptions(t)},n.prototype.onDown=function(n){var i=this.canvas;i?t.prototype.onDown.call(this,n,i.onShapeDown(n)):t.prototype.onDown.call(this,n)},n.prototype.onShapeMove=function(t){var n=this.canvas;if(n){var i=t.target;i!==this&&i!==n||n.onShapeMove(t)}},n.prototype.onShapeUp=function(t){var n=this.canvas;if(n){var i=t.target;i!==this&&i!==n||n.onShapeUp(t)}},n.prototype.onShapeCancel=function(t){var n=this.canvas;if(n){var i=t.target;i!==this&&i!==n||n.onShapeCancel(t)}},n.prototype.onShapeClick=function(t){var n=this.canvas;if(n){var i=t.target;i!==this&&i!==n||n.onShapeClick(t)}},n.prototype.onShapeRightClick=function(t){var n=this.canvas;if(n){var i=t.target;i!==this&&i!==n||n.onShapeRightClick(t)}},n.prototype.onShapeRightDown=function(t){var n=this.canvas;n&&n.onShapeRightDown(t)},n.prototype.onShapeRightUp=function(t){var n=this.canvas;if(n){var i=t.target;i!==this&&i!==n||n.onShapeRightUp(t)}},n.prototype.onShapeRightCancel=function(t){var n=this.canvas;if(n){var i=t.target;i!==this&&i!==n||n.onShapeRightCancel(t)}},n.prototype.onDblClick=function(n,i){var r=this.canvas;return r?t.prototype.onDblClick.call(this,n,i,r.onShapeDblClick(n,i)):t.prototype.onDblClick.call(this,n,i)},n.prototype.render=function(n){this.shape.onRender(n),t.prototype.render.call(this,n)},n.prototype.getType=function(){return"DDiagram"},n}(lm),zm=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DDialogConfirmMessage"},n}(gl),Vm=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.newContentChildren=function(n,i){var r=t.prototype.newContentChildren.call(this,n,i);return r.push(this.message),r},n.prototype.toMessage=function(t,n){var i=null==n?void 0:n.message;return null!=i?at(i)||ot(i)?this.newMessage(this.toMessageOptions(i)):i instanceof Qi?i:this.newMessage(this.toMessageOptionsMerged(i,t.getMessage())):this.newMessage(this.toMessageOptions(t.getMessage()))},n.prototype.toMessageOptionsMerged=function(t,n){var i=t.text;return null==i&&(i={},t.text=i),void 0===i.value&&(i.value=n),t},n.prototype.toMessageOptions=function(t){return{text:{value:t}}},n.prototype.newMessage=function(t){return new zm(t)},Object.defineProperty(n.prototype,"message",{get:function(){var t=this.Wl;return null==t&&(t=this.toMessage(this.theme,this.kn),this.Wl=t),t},enumerable:!1,configurable:!0}),n.prototype.getResolvedValue=function(){},n.prototype.getType=function(){return"DDialogConfirm"},n}(Ss),Wm=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DDialogConfirmDelete"},n}(Vm),Xm=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DDialogConfirmDiscard"},n}(Vm),Km=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DDialogMessage"},n}(Vm),Ym=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DDialogProcessingMessage"},n}(zm),Jm=function(t){function n(n){var i,r=this;(r=t.call(this,n)||this).Xl=!0,r.Zn=0;var e=null==n?void 0:n.delay;r.Kl=null!==(i=null==e?void 0:e.done)&&void 0!==i?i:r.theme.getDoneDelay();var u=null==e?void 0:e.close;return r.Yl=void 0!==u?u:r.theme.getCloseDelay(),r.Jl=r.message.text,r}return B(n,t),n.prototype.newMessage=function(t){return new Ym(t)},n.prototype.onOpen=function(){this.Xl=!1,this.Zn=Date.now();var n=this.yl;null!=n&&clearTimeout(n);var i=this.Zl;null!=i&&clearTimeout(i);var r=this.message;r.text=this.Jl,r.state.removeAll(ht.SUCCEEDED,ht.FAILED);var e=this.ah;null!=e&&e.hide(),t.prototype.onOpen.call(this)},n.prototype.onDone=function(t){var n=this;null!=t?this.Zl=window.setTimeout((function(){n.close()}),t):this.close()},n.prototype.onResolved=function(t){null!=t&&(this.message.text=t),this.message.state.set(ht.SUCCEEDED,ht.FAILED);var n=this.Yl;if(null!=n)this.onDone(n);else{var i=this.ah;null!=i?i.show():this.close()}},n.prototype.onRejected=function(t){null!=t&&(this.message.text=t),this.message.state.set(ht.FAILED,ht.SUCCEEDED);var n=this.ah;null!=n?n.show():this.onDone(this.Yl)},n.prototype.resolve=function(t){var n=this;if(!this.Xl){this.Xl=!0;var i=Date.now()-this.Zn,r=this.Kl-i;0<r?this.yl=window.setTimeout((function(){n.yl=void 0,n.onResolved(t)}),r):this.onResolved(t)}},n.prototype.reject=function(t){var n=this;if(!this.Xl){this.Xl=!0;var i=Date.now()-this.Zn,r=this.Kl-i;0<r?this.yl=window.setTimeout((function(){n.yl=void 0,n.onRejected(t)}),r):this.onRejected(t)}},n.prototype.onCloseOn=function(){this.Xl&&t.prototype.onCloseOn.call(this)},n.prototype.getType=function(){return"DDialogProcessing"},n}(Vm),Zm=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.onOpen=function(){var n=Sb.getDocumentController().getName();null!=n&&(this.input.value=n),t.prototype.onOpen.call(this)},n.prototype.onOk=function(n){t.prototype.onOk.call(this,n);var i=Sb.getCommandController();at(n)?i.push(new am(n)):n.then((function(t){i.push(new am(t))}))},n.prototype.getType=function(){return"DDialogSaveAs"},n}(Vs),qm=function(){function t(t){this.ql=t,this.Ql=[]}return t.prototype.indexOf=function(t){return this.Ql.indexOf(t)},t.prototype.close=function(t){for(var n=this.Ql,i=Math.max(0,t),r=n.length-1;i<=r;--r)n[r].close()},t.prototype.add=function(t){this.Ql.push(t)},t.prototype.trim=function(t){this.close(this.indexOf(t)+1)},t.prototype.remove=function(t){var n=this.indexOf(t);0<=n&&(this.close(n+1),this.Ql.splice(n,1))},t}(),Qm=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.init=function(n){var i,r,e,u=this;t.prototype.init.call(this,n),this.ss=function(){u.onPrerender()},this.Tt=Di(null!==(i=null==n?void 0:n.align)&&void 0!==i?i:ju.BOTTOM,ju),this.$l=null!==(r=null==n?void 0:n.fit)&&void 0!==r&&r,this.hs=null!==(e=null==n?void 0:n.sticky)&&void 0!==e&&e,this.tv=!1,this.ql=null,this.Wo=null,this.visible=!1,yu.apply(this,(function(){u.close()})),this.on("select",(function(){u.close()}));var s=null==n?void 0:n.items;s&&Ml.newItems(this,s,this.hs),this.cs=new ku(n)},n.prototype.findItem=function(t){for(var n=this.children,i=0,r=n.length;i<r;++i){var e=n[i];if(e instanceof wl&&e.value===t)return e}return null},n.prototype.getType=function(){return"DMenu"},n.prototype.getContext=function(){return this.Wo},n.prototype.getCloseable=function(){return this},n.prototype.open=function(n,i,r){if(this.isHidden()){var e=this.cs.pick(this);this.ql=n;for(var u=this.children,s=0,h=u.length;s<h;++s){var o=u[s];o instanceof Qi&&o.state.removeAll(ht.FOCUSED,ht.HOVERED)}var a=e.renderer,c=this.ss;if(this.hs?a.on("prerender",c):a.once("prerender",c),this.$l){var f=n.getBounds();null!=f&&(this.width=f.width)}this.tv=null!=r,r=r||new qm(n),null!=i&&r.trim(i),r.add(this),this.Wo=r,e.stage.addChild(this),this.fs=e.getFocusController().get(),this.focus(),t.prototype.show.call(this),this.emit("open",this)}return this},n.prototype.onPrerender=function(){var t=this.ql;if(t){var n=t.getBounds();if(n){this.$l&&(this.width=n.width);var i=this.cs.picked;if(i){var r=this.theme;Nu.attach(this,n,r.getOffsetX(),r.getOffsetY(),i.width,i.height,this.Tt)}}}},n.prototype.close=function(){if(this.isShown()){var n=this.Wo;n&&n.remove(this);var i=this.cs.picked;i&&i.renderer.off("prerender",this.ss),this.ql=null;var r=this.fs;if(null!=r)if(this.fs=null,i){var e=rt.getLayer(r);null!=e&&i!==e&&e.view.focus(),i.getFocusController().focus(r)}else this.blur(!0);else this.blur(!0);t.prototype.hide.call(this);var u=this.parent;u&&u.removeChild(this),this.emit("close",this)}return this},n.prototype.onKeyDown=function(n){return Xi.moveFocusVertically(n,this,this.cs),this.state.isActionable&&(Xi.isArrowLeftKey(n)||Xi.isCancelKey(n))&&this.close(),t.prototype.onKeyDown.call(this,n)},n.prototype.containsGlobalPoint=function(t){return!this.tv},n}(Fu);Ml.setMenuCreator((function(t){return new Qm(t)}));var $m=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.onMenuSelect=function(t,n,i){this.emit("select",t,n,this)},n.prototype.onMenuClose=function(t){if(t){var n=this.nv;n&&t.off("select",n);var i=this.iv;i&&t.off("close",i)}},n.prototype.toMenu=function(t,n){var i=null==n?void 0:n.menu;return i instanceof Qm?i:new Qm(this.toMenuOptions(t,i))},n.prototype.toMenuOptions=function(t,n){return n?(null==n.fit&&(n.fit=!0),n):{fit:!0}},Object.defineProperty(n.prototype,"menu",{get:function(){var t=this.Do;return null==t&&(t=this.toMenu(this.theme,this.kn),this.Do=t),t},set:function(t){var n=this.Do;n!=t&&(this.Do=t,this.onMenuReplaced(t,n))},enumerable:!1,configurable:!0}),n.prototype.onMenuReplaced=function(t,n){null!=n&&this.onMenuClose(n)},n.prototype.getType=function(){return"DDropdownBase"},n.prototype.onKeyDown=function(n){return Xi.isArrowDownKey(n)&&this.onKeyDownArrowDown(n),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyDownArrowDown=function(t){return!(!this.state.isActionable||!this.state.isFocused||(this.activate(t),0))},n.prototype.onActivate=function(n){t.prototype.onActivate.call(this,n),this.open()},n.prototype.open=function(){var t=this,n=this.menu;if(n.isHidden()){var i=this.nv;null==i&&(i=function(n,i,r){t.onMenuSelect(n,i,r)},this.nv=i);var r=this.iv;null==r&&(r=function(){t.onMenuClose(t.Do)}),n.on("select",i),n.on("close",r),n.open(this),this.emit("open",n,this)}},n.prototype.close=function(){this.menu.close()},n}(ds),tw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DDropdown"},n}($m),nw=function(t){function n(n){var i=t.call(this,n)||this;return i.on(Ki.down,(function(t){i.state.isActionable&&i.onSelect(t)})),i}return B(n,t),n.prototype.onSelect=function(t){this.emit("select",this)},n.prototype.onKeyDown=function(n){return Xi.isActivateKey(n)&&this.onKeyDownActivate(n),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyDownActivate=function(t){return!(!this.state.isActionable||!this.state.isFocused||(this.onSelect(t),0))},n.prototype.getType=function(){return"DExpandableHeader"},n}(gl),iw=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return B(i,n),i.prototype.init=function(t){var i=this;n.prototype.init.call(this,t);var r=this.theme,e=this.toHeader(r,t);this.hh=e,e.on("select",(function(){i.toggle()})),this.addChild(e);var u=this.toBody(r,t);this.pe=u,this.addChild(u),this.state.isActive?this.onActivated():this.onDeactivated()},i.prototype.toHeader=function(n,i){return i&&i.header?i.header instanceof t.DisplayObject?i.header:this.newHeader(n,i.header):this.newHeader(n)},i.prototype.newHeader=function(t,n){return new nw(n)},i.prototype.toBody=function(t,n){return n.body},i.prototype.open=function(){this.state.isActive=!0},i.prototype.close=function(){this.state.isActive=!1},i.prototype.toggle=function(){this.state.isActive=!this.state.isActive},i.prototype.onActivated=function(){var t=this.pe;t instanceof Qi?t.show():t.visible=!0},i.prototype.onDeactivated=function(){var t=this.pe;t instanceof Qi?t.hide():t.visible=!1},i.prototype.onStateChange=function(t,i){n.prototype.onStateChange.call(this,t,i),t.isActive?i.isActive||this.onActivated():i.isActive&&this.onDeactivated()},i.prototype.getType=function(){return"DExpandable"},i}(Fu),rw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.createInput=function(t){return new _s(t)},n}(Bb),ew=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.newUtil=function(){return new cb(this,this.newOperation(),this.theme,this.kn)},n.prototype.getType=function(){return"DInputTextArea"},n}(ks),uw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DListItemAmbient"},n}(ad),sw=function(){function t(t){void 0===t&&(t=256),this.rv=t}return t.prototype.getTileSize=function(){return this.rv},t.prototype.lonLatToMeters=function(n,i){var r=t.CIRCUMFERENCE_HALF;return i.x=n.x*r/180,i.y=Math.log(Math.tan((90+n.y)*Math.PI/360))*r/Math.PI,i},t.prototype.metersToLonLat=function(n,i){var r=t.CIRCUMFERENCE_HALF;return i.x=n.x/r*180,i.y=360*Math.atan(Math.exp(n.y*Math.PI/r))/Math.PI-90,i},t.prototype.pixelsToMeters=function(n,i,r,e){var u=this.toResolution(i,r),s=t.CIRCUMFERENCE_HALF;return e.x=n.x*u-s,e.y=s-n.y*u,e},t.prototype.metersToPixels=function(n,i,r,e){var u=this.toResolution(i,r),s=t.CIRCUMFERENCE_HALF;return e.x=(n.x+s)/u,e.y=(s-n.y)/u,e},t.prototype.pixelsToTile=function(t,n,i){return i.x=Math.ceil(t.x/n)-1,i.y=Math.ceil(t.y/n)-1,i},t.prototype.metersToTile=function(n,i,r){var e=t.CIRCUMFERENCE_HALF,u=1<<i;return r.x=Math.ceil(.5*(n.x/e+1)*u)-1,r.y=Math.ceil(.5*(1-n.y/e)*u)-1,r},t.prototype.lonLatToTile=function(t,n,i){return this.metersToTile(this.lonLatToMeters(t,i),n,i)},t.prototype.lonLatToPixels=function(t,n,i,r){return this.metersToPixels(this.lonLatToMeters(t,r),n,i,r)},t.prototype.pixelsToLonLat=function(t,n,i,r){return this.metersToLonLat(this.pixelsToMeters(t,n,i,r),r)},t.prototype.tileToPixels=function(t,n,i){return i.x=t.x*n,i.y=t.y*n,i},t.prototype.tileToMeters=function(n,i,r){var e=this.toResolutionMeter(i),u=t.CIRCUMFERENCE_HALF;return r.x=n.x*e+u,r.y=u-n.y*e,r},t.prototype.toResolutionMeter=function(n){return 2*t.CIRCUMFERENCE_HALF/(1<<n)},t.prototype.toResolution=function(n,i){return 2*t.CIRCUMFERENCE_HALF/(i<<n)},t.prototype.toTileCount=function(t){return 1<<t},t.prototype.toTileCode=function(t,n,i){return(n<<t)+i},t.CIRCUMFERENCE_HALF=6378137*Math.PI,t}(),hw=function(){function t(){}return Object.defineProperty(t,"DEFAULT",{get:function(){return null==this.Br&&(this.Br=new sw),this.Br},enumerable:!1,configurable:!0}),t}(),ow=function(){function n(n,i,r,e,u,s){this.tx=i,this.ty=r;var h=new t.Sprite(t.Texture.EMPTY);h.parent=n,h.position.set(e,u),h.scale.set(s,s),this.ev=h}return n.prototype.load=function(n,i){var r=t.Texture.from(n,{resolution:1});this.ev.texture=r,r.valid?i():r.on("update",i)},n.prototype.transform=function(t,n,i){var r=this.ev;r.position.set(t,n),r.scale.set(i,i)},Object.defineProperty(n.prototype,"loaded",{get:function(){return this.ev.texture.valid},enumerable:!1,configurable:!0}),n.prototype.render=function(t){var n=this.ev;n.updateTransform(),n.render(t)},n.prototype.destroy=function(){var n=this.ev,i=n.texture,r=i.baseTexture.resource,e=null;r instanceof t.resources.BaseImageResource&&r.source instanceof HTMLImageElement&&(e=r.source),i.destroy(!0),n.destroy(),e&&(e.src="")},n}(),aw=function(){function n(t,n,i,r,e,u){var s=this;this.p=t,this.Ze=n,this.uv=u,this.sv=!1,this.hv=!0,this.ov=function(){s.onLoaded()},this.av=i,this._lon0=NaN,this._lat0=NaN,this._lon1=NaN,this._lat1=NaN,this.cv=new Map,this.fv=function(t){s.renderTile(t)},this.lv=NaN,this.vv=NaN,this.bv=NaN,this.dv=NaN,this.gv=function(t,n,i){s.deleteTile(t,n,i)},this.mv=function(t){s.destroyTile(t)},this.wv=function(t){t.loaded||(s.pv=!1)},this.Ov=e.toTileCount(i),this.Dv=1/this.Ov,this.Ev=r.scale*this.Dv,this.rv=e.getTileSize()*r.scale,this.Gt=r,this.Ff=e,this.pv=!0}return n.prototype.newTile=function(t,n,i,r,e){return new ow(this.p,t,n,i,r,e)},n.prototype.renderTile=function(t){t.render(this.Je)},Object.defineProperty(n.prototype,"tz",{get:function(){return this.av},enumerable:!1,configurable:!0}),n.prototype.render=function(t){this.Je=t,this.cv.forEach(this.fv)},n.prototype.move=function(t,i,r,e){var u=this._lon0,s=this._lat0,h=this._lon1,o=this._lat1;if(u!==t||s!==i||h!==r||o!==e){this._lon0=t,this._lat0=i,this._lon1=r,this._lat1=e;var a=this.av,c=this.Ff,f=n.WORK;f.set(t,i),c.lonLatToTile(f,a,f);var l=f.x,v=f.y;f.set(r,e),c.lonLatToTile(f,a,f);var b=f.x,d=f.y,g=this.Ov,m=Math.max(0,l),w=Math.min(g-1,b),p=Math.max(0,v),O=Math.min(g-1,d),D=m-this.lv,E=w-this.vv,M=p-this.bv,S=O-this.dv,T=D!=D||D<0||1<D,j=E!=E||0<E||E<-1,N=M!=M||M<0||1<M,I=S!=S||0<S||S<-1;if(T||j||N||I){T?this.lv=m:m=this.lv,j?this.vv=w:w=this.vv,N?this.bv=p:p=this.bv,I?this.dv=O:O=this.dv,this.cv.forEach(this.gv);var C=m+w>>1,A=p+O>>1,R=Math.max(C-m,w-C),L=Math.max(A-p,O-A),y=Math.max(R,L);this.toOffset(f);var k=f.x,x=f.y;this.sv=!1,this.hv=!1,this.loadTile(a,C,A,k,x,f);for(var B=1;B<=y;++B){var _=C-B;m<=_&&this.loadTilesY(a,_,A,B,p,O,k,x,f);var P=C+B;P<=w&&this.loadTilesY(a,P,A,B,p,O,k,x,f);var U=A-B;p<=U&&this.loadTilesX(a,C,B-1,m,w,U,k,x,f);var F=A+B;F<=O&&this.loadTilesX(a,C,B-1,m,w,F,k,x,f)}this.hv=!0,this.sv&&this.onLoaded()}}},n.prototype.loadTilesX=function(t,n,i,r,e,u,s,h,o){this.loadTile(t,n,u,s,h,o);for(var a=1;a<=i;++a){var c=n-a;r<=c&&this.loadTile(t,c,u,s,h,o);var f=n+a;f<=e&&this.loadTile(t,f,u,s,h,o)}},n.prototype.loadTilesY=function(t,n,i,r,e,u,s,h,o){this.loadTile(t,n,i,s,h,o);for(var a=1;a<=r;++a){var c=i-a;e<=c&&this.loadTile(t,n,c,s,h,o);var f=i+a;f<=u&&this.loadTile(t,n,f,s,h,o)}},n.prototype.loadTile=function(t,n,i,r,e,u){var s=this.Ff.toTileCode(t,n,i),h=this.cv,o=h.get(s);null==o&&(this.toTilePosition(n,i,r,e,u),o=this.newTile(n,i,u.x,u.y,this.Ev),h.set(s,o),o.load(this.Ze(t,n,i),this.ov),this.pv=!1)},n.prototype.toTilePosition=function(t,n,i,r,e){var u=this.rv,s=this.Dv;return e.set(t,n),this.Ff.tileToPixels(e,u,e),e.set(e.x*s+i,e.y*s+r),e},n.prototype.toOffset=function(t){var n=this.p,i=this.Gt,r=this.rv;return t.set(-i.x*r+.5*n.width,-i.y*r+.5*n.height),t},n.prototype.deleteTile=function(t,n,i){var r=t.tx,e=t.ty;(r<this.lv||this.vv<r||e<this.bv||this.dv<e)&&(i.delete(n),t.destroy())},n.prototype.destroy=function(){var t=this.cv;t.forEach(this.mv),t.clear()},n.prototype.destroyTile=function(t){t.destroy()},n.prototype.updateLoadingState=function(){this.pv=!0,this.cv.forEach(this.wv)},n.prototype.onLoaded=function(){this.hv?this.uv():this.sv=!0},Object.defineProperty(n.prototype,"loaded",{get:function(){return this.pv||this.updateLoadingState(),this.pv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"mapping",{get:function(){return this.Gt},set:function(t){var i=this,r=this.Ff,e=t.scale*this.Dv,u=r.getTileSize()*t.scale;this.Ev=e,this.rv=u,this.Gt=t;var s=n.WORK;this.toOffset(s);var h=s.x,o=s.y;this.cv.forEach((function(t){i.toTilePosition(t.tx,t.ty,h,o,s),t.transform(s.x,s.y,e)}))},enumerable:!1,configurable:!0}),n.WORK=new t.Point,n}(),cw=function(n){function i(t){var i=n.call(this)||this,r=t.canvas;i.ir=r,i.Ze=t.builder;var e=t.mapping;i.Gt=e;var u=t.coordinate;i.Ff=u,i.Mv=i.toMapping(r,e,u),i._z=NaN,i.av=NaN,i.Sv=t.plane.min,i.Tv=t.plane.max,i.jv=[],i.ov=function(){i.onLoaded()},i.Nv=function(){i.Iv=void 0,i.fit()},i.Cv=t.plane.throttle;var s=function(){i.fitThrottled()};return i.Av=s,r.on("scale",s),r.on("move",s),r.snippet.add(i,!0),i}return B(i,n),Object.defineProperty(i.prototype,"coordinate",{get:function(){return this.Ff},enumerable:!1,configurable:!0}),i.prototype.fitThrottled=function(){null==this.Iv&&(this.Iv=window.setTimeout(this.Nv,this.Cv))},i.prototype.toMapping=function(t,n,r){var e=i.WORK_LONLAT,u=r.getTileSize();e.set(n.from.lon,n.from.lat),r.lonLatToPixels(e,0,u,e);var s=e.x,h=e.y;e.set(n.to.lon,n.to.lat),r.lonLatToPixels(e,0,u,e);var o=e.x,a=e.y,c=Math.abs(o-s),f=Math.abs(a-h),l=1e-7,v=1;return l<c?v=l<f?Math.max(t.width/c,t.height/f):t.width/c:l<f&&(v=t.height/f),{scale:v,x:.5*(o+s)/u,y:.5*(a+h)/u}},Object.defineProperty(i.prototype,"mapping",{get:function(){return this.Gt},set:function(t){var n=this.Mv,i=this.toMapping(this.ir,t,this.Ff),r=1e-7;if(r<Math.abs(n.scale-i.scale)||r<Math.abs(n.x-i.x)||r<Math.abs(n.y-i.y)){this.Mv=i;for(var e=this.jv,u=0,s=e.length;u<s;++u){var h=e[u];h&&(h.mapping=i)}rt.update(this.ir),this.Av()}},enumerable:!1,configurable:!0}),i.prototype.newPlane=function(t){return new aw(this.ir,this.Ze,t,this.Mv,this.Ff,this.ov)},i.prototype.render=function(t){for(var n=this.av,i=this.jv,r=0;r<n;++r)null!=(e=i[r])&&e.render(t);for(r=i.length-1;n<r;--r){var e;null!=(e=i[r])&&e.render(t)}var u=i[n];null!=u&&u.render(t)},i.prototype.toTileZ=function(t){return Math.min(this.Tv,Math.max(this.Sv,Math.floor(t)))},i.prototype.updateTransform=function(){},i.prototype.toZ=function(t){return Math.log(this.Mv.scale*t)/Math.log(2)},i.prototype.move=function(t,n,i,r,e){var u=this.jv,s=this.toZ(t);if(this._z!==s){this._z=s;var h=this.toTileZ(s);if(this.av!==h){this.av=h;var o=u[h];null==o&&(o=this.newPlane(h),u[h]=o)}}var a=u[this.av];return null!=a&&a.move(n,i,r,e),this},i.prototype.fit=function(){var t=this.ir;if(null!=t){var n=t.parent;if(null!=n){var r=t.scale,e=r.x,u=r.y,s=t.x,h=t.y,o=this.Ff,a=this.Mv,c=o.getTileSize()*a.scale,f=a.x*c-(s/e+.5*t.width),l=f+n.width/e,v=a.y*c-(h/u+.5*t.height),b=v+n.height/u,d=i.WORK_LONLAT;d.set(f,v),o.pixelsToLonLat(d,0,c,d);var g=d.x,m=d.y;d.set(l,b),o.pixelsToLonLat(d,0,c,d);var w=d.x,p=d.y;this.move(e,g,m,w,p)}}return this},i.prototype.destroyPlanesBefore=function(t,n){for(var i=0;i<t;++i){var r=n[i];r&&(r.destroy(),n[i]=void 0)}},i.prototype.destroyPlanesAfter=function(t,n){for(var i=t+1,r=n.length;i<r;++i){var e=n[i];e&&(e.destroy(),n[i]=void 0)}},i.prototype.cleanup=function(){var t=this.av,n=this.jv,i=n[t];if(i&&i.loaded)return this.destroyPlanesBefore(t,n),void this.destroyPlanesAfter(t,n);for(var r=t+1,e=n.length;r<e;++r)if((u=n[r])&&u.loaded)return this.destroyPlanesBefore(t,n),void this.destroyPlanesAfter(r,n);for(r=t-1;0<=r;--r){var u;if((u=n[r])&&u.loaded)return void this.destroyPlanesBefore(r,n)}},i.prototype.onLoaded=function(){this.cleanup(),rt.update(this.ir)},i.prototype.destroy=function(){for(var t=this.jv,n=0,i=t.length;n<i;++n){var r=t[n];r&&(r.destroy(),t[n]=void 0)}var e=this.ir,u=this.Av;return e.off("scale",u),e.off("move",u),e.snippet.remove(this,!0),this},i.WORK_LONLAT=new t.Point,i}(t.utils.EventEmitter),fw=function(t,n,i){return"https://j.tile.openstreetmap.jp/".concat(t,"/").concat(n,"/").concat(i,".png")},lw=function(){function t(){}return t.toPlaneOptions=function(t){var n,i,r,e=t.plane;return{min:null!==(n=null==e?void 0:e.min)&&void 0!==n?n:this.MIN,max:null!==(i=null==e?void 0:e.max)&&void 0!==i?i:this.MAX,throttle:null!==(r=null==e?void 0:e.throttle)&&void 0!==r?r:this.THROTTLE}},t.from=function(t){return new cw({canvas:t.canvas,builder:t.builder||fw,mapping:t.canvas.tile.mapping,coordinate:t.coordinate||hw.DEFAULT,plane:this.toPlaneOptions(t)})},t.MIN=0,t.MAX=18,t.THROTTLE=333,t}(),vw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.toMenu=function(t,n){var i=null==n?void 0:n.menu;return i instanceof Qm?i:new Qm(this.toMenuOptions(t,i))},n.prototype.newMenu=function(t,n){return new Qm(this.toMenuOptions(t,n))},n.prototype.toMenuOptions=function(t,n){return n?(null==n.fit&&(n.fit=!1),n):{fit:!1}},n.prototype.onActivate=function(n){t.prototype.onActivate.call(this,n),this.open()},n.prototype.open=function(){this.menu.open(this)},n.prototype.close=function(){this.menu.close()},Object.defineProperty(n.prototype,"menu",{get:function(){var t=this,n=this.Do;return null==n&&((n=this.toMenu(this.theme,this.kn)).on("select",(function(n,i,r){t.onMenuSelect(n,i,r)})),this.Do=n),n},enumerable:!1,configurable:!0}),n.prototype.onMenuSelect=function(t,n,i){this.emit("select",t,n,this);var r=this.parent;r&&r.emit("select",t,n,r)},n.prototype.onKeyDown=function(n){return Xi.isArrowDownKey(n)&&this.onKeyDownArrowDown(n),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyDownArrowDown=function(t){return!(!this.state.isActionable||!this.state.isFocused||(this.onActivate(t),0))},n.prototype.getType=function(){return"DMenuBarItem"},n}(gs),bw=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return B(i,n),i.prototype.init=function(t){n.prototype.init.call(this,t);var i=null==t?void 0:t.items;if(i)for(var r=0,e=i.length;r<e;++r){var u=this.toItem(i[r]);u&&this.addChild(u)}},i.prototype.toItem=function(n){return null==n?null:n instanceof t.DisplayObject?n:"space"in n?new _u(n):new vw(n)},i.prototype.onKeyDown=function(t){return Xi.moveFocusHorizontally(t,this),n.prototype.onKeyDown.call(this,t)},i.prototype.getType=function(){return"DMenuBar"},i}(ws),dw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.initReflowable=function(){},n.prototype.getType=function(){return"DMenuSidedContent"},n}(ws),gw={NONE:0,SINGLE:1,SINGLE_ONCE:2},mw=function(){return!0},ww=function(n){function i(t,i){var r,e,u,s=this;(s=n.call(this)||this).oh=t,s.Gc=null,s.vn=!0,s.Nt=Di(null!==(e=null!==(r=null==i?void 0:i.mode)&&void 0!==r?r:null==i?void 0:i.type)&&void 0!==e?e:gw.SINGLE_ONCE,gw),s.sf=null!==(u=null==i?void 0:i.filter)&&void 0!==u?u:s.getFilterDefault();var h=null==i?void 0:i.on;if(h)for(var o in h){var a=h[o];a&&s.on(o,a)}return s}return B(i,n),i.prototype.first=function(){return this.Gc},i.prototype.toDirty=function(){this.vn=!0},i.prototype.update=function(){this.vn&&(this.vn=!1,this.Gs(this.oh))},i.prototype.hasMenu=function(t){return t&&t.menu instanceof Qm},i.prototype.Gs=function(n){for(var i=n.children,r=0,e=i.length;r<e;++r){var u=i[r];u instanceof ml&&u.state.isActive&&this.Rv(u,!1),u instanceof t.Container&&this.Gs(u),this.hasMenu(u)&&this.Gs(u.menu)}},i.prototype.add=function(t){this.update(),this.Rv(t,!0)},i.prototype.set=function(t){this.update(),this.Rv(t,!0)},i.prototype.get=function(t){return this.update(),this.Gc},i.prototype.getIndex=function(t){return null},i.prototype.size=function(){return this.Gc?1:0},i.prototype.isEmpty=function(){return null==this.Gc},i.prototype.remove=function(t){this.update(),this.Gc===t&&this.Rv(null,!0)},i.prototype.clear=function(){this.update(),this.Rv(null,!0)},i.prototype.getFilterDefault=function(){return mw},i.prototype.Rv=function(t,n){var i=this.Gc,r=this.Nt;r!==gw.NONE&&this.sf(t)&&i!==t&&(this.setState(i,r,!1),this.Gc=t,this.setState(t,r,!0),n&&this.emit("change",this))},i.prototype.setState=function(t,n,i){t&&(n===gw.SINGLE?t.state.isActive=i:i?t.state.addAll(ht.ACTIVE,ht.READ_ONLY):t.state.removeAll(ht.ACTIVE,ht.READ_ONLY))},i}(t.utils.EventEmitter),pw=function(t){function n(n){var i,r=this;r=t.call(this,n)||this;var e=new qm(r);r.Wo=e,e.add(r);var u=null==n?void 0:n.items;if(null!=u){var s=null!==(i=null==n?void 0:n.sticky)&&void 0!==i&&i;r.newItems(u,s)}var h=null==n?void 0:n.selection;return r.Hc=h instanceof ww?h:r.newSelection(h),r}return B(n,t),n.prototype.newSelection=function(t){return new ww(this.content,t)},n.prototype.onHierarchyDirty=function(){var n=this.Hc;null!=n&&n.toDirty(),t.prototype.onHierarchyDirty.call(this)},n.prototype.newItems=function(t,n){sv.newItems(this.content,t,n)},n.prototype.newContent=function(t){return new dw(t)},Object.defineProperty(n.prototype,"selection",{get:function(){return this.Hc},enumerable:!1,configurable:!0}),n.prototype.getContext=function(){return this.Wo},n.prototype.getCloseable=function(){return this},n.prototype.open=function(){},n.prototype.close=function(){},n.prototype.onKeyDown=function(n){return Xi.moveFocusVertically(n,this),t.prototype.onKeyDown.call(this,n)},n.prototype.getType=function(){return"DMenuSided"},n}(yd),Ow=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DNoteError"},n}(Pd),Dw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DNoteNoItemsFound"},n}(Pd),Ew=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DNoteSearching"},n}(Pd),Mw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n}(Qi),Sw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DPaginationButtonLast"},n}(Os),Tw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DPaginationButtonNext"},n}(Os),jw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DPaginationButtonPage"},n}(Os),Nw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DPaginationButtonPrevious"},n}(Os),Iw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DPaginationButtonTop"},n}(Os),Cw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DPaginationDots"},n}(bs),Aw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DPaginationPage"},n}(bs),Rw=function(t){function n(n){var i,r,e,u,s=this;s=t.call(this,n)||this,null!=n?(s.j=null!==(r=null!==(i=n.size)&&void 0!==i?i:n.total)&&void 0!==r?r:10,s.Rt=null!==(u=null!==(e=n.value)&&void 0!==e?e:n.selected)&&void 0!==u?u:0):(s.j=10,s.Rt=0);var h=s.buttonTop,o=s.buttonPrevious;null!=h&&s.addChild(h),null!=o&&s.addChild(o),null==h&&null==o||s.addChild(s.newSpace());var a=s.buttonPages0,c=a.length;s.addChild(a[c-1]),s.addChild(s.dots0);for(var f=c-2;0<=f;--f)s.addChild(a[f]);s.addChild(s.page);for(var l=s.buttonPages1,v=l.length,b=(f=0,v-1);f<b;++f)s.addChild(l[f]);s.addChild(s.dots1),s.addChild(l[v-1]);var d=s.buttonNext,g=s.buttonLast;return null==d&&null==g||s.addChild(s.newSpace()),null!=d&&s.addChild(d),null!=g&&s.addChild(g),s.update(),s}return B(n,t),n.prototype.newSpace=function(){var t,n,i;return new _u({width:null!==(i=null===(n=null===(t=this.kn)||void 0===t?void 0:t.button)||void 0===n?void 0:n.space)&&void 0!==i?i:this.theme.getButtonSpace()})},Object.defineProperty(n.prototype,"value",{get:function(){return this.Rt},set:function(t){0<=t&&t<this.j&&this.Rt!==t&&(this.Rt=t,this.update())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"selected",{get:function(){return this.value},set:function(t){this.value=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"size",{get:function(){return this.j},set:function(t){0<=t&&this.j!==t&&(this.j=t,this.Rt=0===t?-1:Math.max(0,Math.min(this.j-1,this.Rt)),this.update())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"total",{get:function(){return this.size},set:function(t){this.size=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"dots0",{get:function(){var t=this._dots0;return null==t&&(t=this.newDots(),this._dots0=t),t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"dots1",{get:function(){var t=this._dots1;return null==t&&(t=this.newDots(),this._dots1=t),t},enumerable:!1,configurable:!0}),n.prototype.newDots=function(){return new Cw},Object.defineProperty(n.prototype,"buttonLast",{get:function(){var t=this.Lv;return void 0===t&&(t=this.newButtonLast(),this.Lv=t),t},enumerable:!1,configurable:!0}),n.prototype.newButtonLast=function(){var t,n,i=this,r=null===(n=null===(t=this.kn)||void 0===t?void 0:t.button)||void 0===n?void 0:n.last;if(null!==r&&!1!==r&&void 0!==r){var e=new Sw(!0!==r?r:void 0);return e.on("active",(function(){i.onButtonLastActive()})),e}return null},n.prototype.onButtonLastActive=function(){this.moveTo(this.j-1)},n.prototype.moveTo=function(t){if(0<=t&&t<this.j&&this.Rt!==t){var n=this.Rt;this.Rt=t,this.emit("change",t,n,this),this.update()}},Object.defineProperty(n.prototype,"buttonNext",{get:function(){var t=this.yv;return void 0===t&&(t=this.newButtonNext(),this.yv=t),t},enumerable:!1,configurable:!0}),n.prototype.newButtonNext=function(){var t,n,i=this,r=null===(n=null===(t=this.kn)||void 0===t?void 0:t.button)||void 0===n?void 0:n.next;if(null!==r&&!1!==r){var e=new Tw(!0!==r?r:void 0);return e.on("active",(function(){i.onButtonNextActive()})),e}return null},n.prototype.onButtonNextActive=function(){this.moveTo(this.Rt+1)},Object.defineProperty(n.prototype,"buttonPrevious",{get:function(){var t=this.kv;return void 0===t&&(t=this.newButtonPrevious(),this.kv=t),t},enumerable:!1,configurable:!0}),n.prototype.newButtonPrevious=function(){var t,n,i=this,r=null===(n=null===(t=this.kn)||void 0===t?void 0:t.button)||void 0===n?void 0:n.previous;if(null!==r&&!1!==r){var e=new Nw(!0!==r?r:void 0);return e.on("active",(function(){i.onButtonPreviousActive()})),e}return null},n.prototype.onButtonPreviousActive=function(){this.moveTo(this.Rt-1)},Object.defineProperty(n.prototype,"buttonTop",{get:function(){var t=this.xv;return void 0===t&&(t=this.newButtonTop(),this.xv=t),t},enumerable:!1,configurable:!0}),n.prototype.newButtonTop=function(){var t,n,i=this,r=null===(n=null===(t=this.kn)||void 0===t?void 0:t.button)||void 0===n?void 0:n.top;if(null!==r&&!1!==r&&void 0!==r){var e=new Iw(!0!==r?r:void 0);return e.on("active",(function(){i.onButtonTopActive()})),e}return null},n.prototype.onButtonTopActive=function(){this.moveTo(0)},n.prototype.newButtonPage=function(){var t,n,i=this,r=new jw(null===(n=null===(t=this.kn)||void 0===t?void 0:t.button)||void 0===n?void 0:n.page);return r.on("active",(function(){i.onButtonPageActive(r)})),r},Object.defineProperty(n.prototype,"buttonPages0",{get:function(){var t=this._buttonPages0;return null==t&&(t=this.newButtonPages0(),this._buttonPages0=t),t},enumerable:!1,configurable:!0}),n.prototype.newButtonPages0=function(){return[this.newButtonPage(),this.newButtonPage(),this.newButtonPage(),this.newButtonPage()]},Object.defineProperty(n.prototype,"buttonPages1",{get:function(){var t=this._buttonPages1;return null==t&&(t=this.newButtonPages1(),this._buttonPages1=t),t},enumerable:!1,configurable:!0}),n.prototype.newButtonPages1=function(){return[this.newButtonPage(),this.newButtonPage(),this.newButtonPage(),this.newButtonPage()]},Object.defineProperty(n.prototype,"page",{get:function(){var t=this.Bv;return null==t&&(t=this.newPage(),this.Bv=t),t},enumerable:!1,configurable:!0}),n.prototype.newPage=function(){var t;return new Aw(null===(t=this.kn)||void 0===t?void 0:t.page)},n.prototype.onButtonPageActive=function(t){var n=t.text;mn(n)&&(this.moveTo(n-1),t.state.isFocused&&(t.state.isHovered=!1,this.page.focus()))},n.prototype.update=function(){var t=this.j,n=this.Rt;if(t<=0){null!=(o=this.buttonTop)&&(o.state.isEnabled=!1),null!=(a=this.buttonPrevious)&&(a.state.isEnabled=!1),this.hideDots(this.dots0);for(var i=0,r=(l=this.buttonPages0).length;i<r;++i)this.hidePage(l[i]);for(this.hidePage(this.page),i=0,r=(v=this.buttonPages1).length;i<r;++i)this.hidePage(v[i]);this.hideDots(this.dots1),null!=(c=this.buttonNext)&&(c.state.isEnabled=!1),(f=this.buttonLast)&&(f.state.isEnabled=!1)}else{var e=n-2,u=n+2;if(e<0)u-=e,e=0;else if(t<=u){var s=u-t+1;u-=s,e-=s}var h=!1;0<e&&(h=!0,e=Math.min(e+1,n));var o,a,c,f,l,v,b=!1;for(u<t-1&&(b=!0,u=Math.max(u-1,n)),null!=(o=this.buttonTop)&&(o.state.isEnabled=0<n),null!=(a=this.buttonPrevious)&&(a.state.isEnabled=0<n),h?this.showDots(this.dots0,1,e-1):this.hideDots(this.dots0),i=0,r=(l=this.buttonPages0).length;i<r;++i){var d=n-i-1,g=l[i];e<=d&&d<=u&&0<=d?this.showPage(g,d):h&&i===r-1?this.showPage(g,0):this.hidePage(g)}for(this.showPage(this.page,n),i=0,r=(v=this.buttonPages1).length;i<r;++i)d=n+i+1,g=v[i],e<=d&&d<=u&&d<t?this.showPage(g,d):b&&i===r-1?this.showPage(g,t-1):this.hidePage(g);b?this.showDots(this.dots1,u+1,t-2):this.hideDots(this.dots1),null!=(c=this.buttonNext)&&(c.state.isEnabled=n<t-1),null!=(f=this.buttonLast)&&(f.state.isEnabled=n<t-1)}},n.prototype.showPage=function(t,n){t.text=n+1,t.show()},n.prototype.hidePage=function(t){t.hide()},n.prototype.showDots=function(t,n,i){t.show()},n.prototype.hideDots=function(t){t.hide()},n.prototype.getType=function(){return"DPagination"},n}(ws),Lw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n}(Qi),yw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n}(Qi),kw=function(t){function n(n){var i=t.call(this,n)||this;i.L=[];var r=null==n?void 0:n.values;return r&&(i.values=r),i}return B(n,t),n.prototype.onMenuSelect=function(n,i,r){if(t.prototype.onMenuSelect.call(this,n,i,r),i instanceof Ol){var e=this.L,u=[],s=[];i.state.isActive?this.updateMenuItems(r,e,n,void 0,u,s):this.updateMenuItems(r,e,void 0,n,u,s),this.L=u,this.text=s,this.onValueChange(u,e,s)}},n.prototype.onMenuReplaced=function(n,i){t.prototype.onMenuReplaced.call(this,n,i);var r=this.L,e=[],u=[];this.updateMenuItems(n,r,void 0,void 0,e,u),this.L=e,this.text=u},n.prototype.onValueChange=function(t,n,i){this.emit("change",t,n,i,this)},n.prototype.open=function(){this.updateMenuItems(this.menu,this.L),t.prototype.open.call(this)},Object.defineProperty(n.prototype,"values",{get:function(){return this.L},set:function(t){var n=this.L;if(!this.isSameValues(t,n)){var i=[],r=[];this.updateMenuItems(this.menu,t,void 0,void 0,i,r),this.L=i,this.text=r}},enumerable:!1,configurable:!0}),n.prototype.isSameValues=function(t,n){if(t.length===n.length)for(var i=0,r=t.length;i<r;++i)if(n.indexOf(t[i])<0)return!1;return!1},n.prototype.updateMenuItems=function(t,n,i,r,e,u){for(var s=t.children,h=0,o=s.length;h<o;++h){var a=s[h];if(a instanceof kl)this.updateMenuItems(a.menu,n,i,r,e,u);else if(a instanceof Ol){var c=a.value;void 0!==r&&r===c?a.state.isActive=!1:void 0!==i&&a.value===i||0<=n.indexOf(a.value)?(e&&e.push(a.value),u&&u.push(a),a.state.isActive=!0):a.state.isActive=!1}}},n.prototype.getType=function(){return"DSelectMultiple"},n}($m),xw=function(t){function n(n){var i=t.call(this,n)||this;i.Rt=null;var r=null==n?void 0:n.value;return null!=r&&(i.value=r),i}return B(n,t),n.prototype.onMenuSelect=function(n,i,r){t.prototype.onMenuSelect.call(this,n,i,r);var e=this.Rt;e!==n&&(this.Rt=n,this.text=i,this.onValueChange(n,e,i))},n.prototype.onMenuReplaced=function(n,i){t.prototype.onMenuReplaced.call(this,n,i);var r=this.Rt;if(null!=r){var e=this.findMenuItem(n,r);null!=e?(this.Rt=r,this.text=e):(this.Rt=null,this.text=null)}else this.Rt=null,this.text=null},n.prototype.onValueChange=function(t,n,i){this.emit("change",t,n,i,this)},n.prototype.findMenuItem=function(t,n){for(var i=t.children,r=0,e=i.length;r<e;++r){var u=i[r];if(u instanceof kl){var s=this.findMenuItem(u.menu,n);if(null!=s)return s}else if(u instanceof wl&&u.value===n)return u}return null},Object.defineProperty(n.prototype,"value",{get:function(){return this.Rt},set:function(t){if(this.Rt!==t){var n=this.findMenuItem(this.menu,t);null!=n?(this.Rt=t,this.text=n):(this.Rt=null,this.text=null)}},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DSelect"},n}($m),Bw=function(t){function n(n,i,r,e,u){var s=t.call(this,n,i,r,i,r)||this;return s._v=e,s.Pv=u,s.Da=.5*i,s.Ea=.5*r,s.interactive=!1,s.interactiveChildren=!1,n.on("update",(function(){s.onTextureUpdate()})),s}return B(n,t),n.prototype.onTextureUpdate=function(){this.emit("update",this)},n.prototype.onReflow=function(t,n,i){var r=this.Da,e=this.Ea;this.x=-r+this._v,this.y=-e+this.Pv,this.width=r+n+r,this.height=e+i+e},n.prototype.render=function(n){var i=this.parent;if(i){var r=i.alpha;this.alpha=r*r*r}t.prototype.render.call(this,n)},n}(t.NineSlicePlane),_w=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.init=function(n){var i;t.prototype.init.call(this,n),this.Rt=null!==(i=null==n?void 0:n.value)&&void 0!==i?i:0},Object.defineProperty(n.prototype,"value",{get:function(){return this.Rt},set:function(t){this.Rt=t},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DSliderLabel"},n}(vs),Pw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DSliderThumb"},n}(gs),Uw=function(t){function n(n){var i,r,e=this;return(e=t.call(this,n)||this).Rt=null!==(i=null==n?void 0:n.value)&&void 0!==i?i:0,e.Uv=e.toRounder(n),e.Fv=null!==(r=null==n?void 0:n.delta)&&void 0!==r?r:1,e}return B(n,t),n.prototype.toRounder=function(t){var n,i=null==t?void 0:t.rounder;if(i)return i;var r=null!==(n=null==t?void 0:t.precision)&&void 0!==n?n:this.theme.getPrecision(),e=Math.pow(10,r);return function(t){return Math.round(t*e)/e}},Object.defineProperty(n.prototype,"value",{get:function(){return this.Rt},set:function(t){this.Rt=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rounder",{get:function(){return this.Uv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"delta",{get:function(){return this.Fv},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DSliderValue"},n}(vs),Fw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.init=function(n){var i=this;t.prototype.init.call(this,n),this.Gv=0,this.Hv=this.newTrack(n),this.addChild(this.Hv),this.zv=this.newTrackSelected(n),this.zv.state.isActive=!0,this.addChild(this.zv),this.Qc=this.newThumb(n),this.addChild(this.Qc),this.$u=this.newLabelMin(n),this.addChild(this.$u),this.ts=this.newLabelMax(n),this.addChild(this.ts),this.Rt=this.newValue(n),this.addChild(this.Rt),this.Hv.on(Ki.down,(function(t){i.Rt.visible=i.state.inEnabled,i.onTrackDown(t.data.global)})),this.zv.on(Ki.down,(function(t){i.Rt.visible=i.state.inEnabled,i.onTrackSelectedDown(t.data.global)})),this.Vv=function(t){i.onTrackUpBound(t),i.Rt.visible=!1},this.Wv=function(t){i.onTrackSelectedUpBound(t),i.Rt.visible=!1},this.Qc.on(Ki.down,(function(t){i.Rt.visible=!0,i.onThumbDown(t)})),this.Xv=function(t){i.onThumbMove(t)},this.Kv=function(t){i.onThumbUp(t),i.Rt.visible=!1},this.onValuesChange()},n.prototype.newThumb=function(t){return new Pw(null==t?void 0:t.thumb)},n.prototype.newValue=function(t){return new Uw(this.toValueOptions(null==t?void 0:t.value))},n.prototype.toValueOptions=function(t){null==(t=t||{}).value&&(t.value=0);var n=t.text||{};return t.text=n,null==n.value&&(n.value=t.value),null==t.visible&&(t.visible=!1),t},n.prototype.newLabelMin=function(t){return new _w(this.toLabelMinOptions(null==t?void 0:t.min))},n.prototype.toLabelMinOptions=function(t){null==(t=t||{}).value&&(t.value=0);var n=t.text||{};return t.text=n,null==n.value&&(n.value="".concat(t.value)),t},n.prototype.newLabelMax=function(t){return new _w(this.toLabelMaxOptions(null==t?void 0:t.max))},n.prototype.toLabelMaxOptions=function(t){null==(t=t||{}).value&&(t.value=1);var n=t.text||{};return t.text=n,null==n.value&&(n.value="".concat(t.value)),t},n.prototype.getValueMargin=function(){return 14},n.prototype.onTrackDown=function(t){if(!this.state.inDisabled){var n=rt.getLayer(this);if(n){var i=n.renderer.plugins.interaction;this.Yv=i;var r=this.Vv;i.on(Ki.up,r),i.on(Ki.upoutside,r),i.on(Ki.cancel,r)}this.onPick(t)}},n.prototype.onTrackSelectedDown=function(t){if(!this.state.inDisabled){var n=rt.getLayer(this);if(n){var i=n.renderer.plugins.interaction;this.Yv=i;var r=this.Wv;i.on(Ki.up,r),i.on(Ki.upoutside,r),i.on(Ki.cancel,r)}this.onPick(t)}},n.prototype.onTrackUpBound=function(t){var n=this.Yv;if(n){this.Yv=void 0;var i=this.Vv;n.off(Ki.up,i),n.off(Ki.upoutside,i),n.off(Ki.cancel,i)}},n.prototype.onTrackSelectedUpBound=function(t){var n=this.Yv;if(n){this.Yv=void 0;var i=this.Wv;n.off(Ki.up,i),n.off(Ki.upoutside,i),n.off(Ki.cancel,i)}},n.prototype.onThumbMove=function(t){this.state.inDisabled||this.onPick(t.data.global)},n.prototype.onThumbDown=function(t){var n=rt.getLayer(this);if(n){var i=n.renderer.plugins.interaction;this.Yv=i;var r=this.Xv;i.on(Ki.move,r);var e=this.Kv;i.on(Ki.up,e),i.on(Ki.upoutside,e),i.on(Ki.cancel,e)}},n.prototype.onThumbUp=function(t){var n=this.Yv;if(n){this.Yv=void 0;var i=this.Xv;n.off(Ki.move,i);var r=this.Kv;n.off(Ki.up,r),n.off(Ki.upoutside,r),n.off(Ki.cancel,r)}},n.prototype.updateValue=function(){var t=this.$u.value,n=this.ts.value,i=this.Rt,r=i.rounder(t+this.Gv*(n-t)),e=i.value;r!==e&&(i.value=r,i.text=i.value,this.emit("change",r,e,this))},n.prototype.onResize=function(n,i,r,e){t.prototype.onResize.call(this,n,i,r,e),this.onValuesChange()},Object.defineProperty(n.prototype,"value",{get:function(){return this.Rt.value},set:function(t){t=Math.max(this.$u.value,Math.min(this.ts.value,t)),this.Rt.value!==t&&(this.Rt.value=t,this.onValuesChange())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"min",{get:function(){return this.$u.value},set:function(t){var n=this.$u;if(t=Math.min(this.ts.value,t),n.value!==t){var i=this.Rt;n.text=n.value=t,i.value=Math.max(t,i.value),this.onValuesChange()}},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"max",{get:function(){return this.ts.value},set:function(t){var n=this.ts;if(t=Math.max(this.$u.value,t),n.value!==t){var i=this.Rt;n.text=n.value=t,i.value=Math.min(t,i.value),this.onValuesChange()}},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DSlider"},n}(Qi),Gw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DSliderTrack"},n}(gs),Hw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DSliderTrackHorizontal"},n}(Gw),zw=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return B(i,n),i.prototype.newTrack=function(t){return new Hw(null==t?void 0:t.track)},i.prototype.newTrackSelected=function(t){return new Hw(null==t?void 0:t.track)},i.prototype.toValueOptions=function(t){var i=this;return null==(t=n.prototype.toValueOptions.call(this,t)).y&&(t.y=function(t,n){return.5*t-n-i.getValueMargin()}),t},i.prototype.toLabelMinOptions=function(t){return null==(t=n.prototype.toLabelMinOptions.call(this,t)).x&&(t.x=function(t,n){return.5*-n}),null==t.y&&(t.y=function(t,n){return-n}),t},i.prototype.toLabelMaxOptions=function(t){return null==(t=n.prototype.toLabelMaxOptions.call(this,t)).x&&(t.x=function(t,n){return t-.5*n}),null==t.y&&(t.y=function(t,n){return-n}),t},i.prototype.onPick=function(n){var i=new t.Point(0,0);this.toLocal(n,void 0,i);var r=Math.max(0,Math.min(this.Hv.width,i.x));this.Gv=r/this.Hv.width,this.moveThumbPosition(r)},i.prototype.onValuesChange=function(){var t=this.$u.value,n=this.ts.value,i=this.Rt.value;this.Gv=(i-t)/(n-t);var r=this.Gv*this.Hv.width;this.moveThumbPosition(r)},i.prototype.moveThumbPosition=function(t){var n=this.Qc;n.x=t-.5*n.width,this.zv.width=t;var i=this.Rt;i.x=t-.5*i.width,this.updateValue()},i.prototype.onKeyDown=function(t){return Xi.isArrowRightKey(t)?this.value+=this.Rt.delta:Xi.isArrowLeftKey(t)&&(this.value-=this.Rt.delta),n.prototype.onKeyDown.call(this,t)},i.prototype.getType=function(){return"DSliderHorizontal"},i}(Fw),Vw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DSliderTrackVertical"},n}(Gw),Ww=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return B(i,n),i.prototype.newTrack=function(t){return new Vw(null==t?void 0:t.track)},i.prototype.newTrackSelected=function(t){return new Vw(null==t?void 0:t.track)},i.prototype.toLabelMinOptions=function(t){null==(t=n.prototype.toLabelMinOptions.call(this,t)).x&&(t.x=function(t,n){return-n}),null==t.y&&(t.y=function(t,n){return t-.5*n});var i=t.text||{};t.text=i;var r=i.align||{};return i.align=r,null==r.horizontal&&(r.horizontal=Wu.RIGHT),t},i.prototype.toLabelMaxOptions=function(t){null==(t=n.prototype.toLabelMaxOptions.call(this,t)).x&&(t.x=function(t,n){return-n}),null==t.y&&(t.y=function(t,n){return.5*-n});var i=t.text||{};t.text=i;var r=i.align||{};return i.align=r,null==r.horizontal&&(r.horizontal=Wu.RIGHT),t},i.prototype.onPick=function(n){var i=new t.Point(0,0);this.toLocal(n,void 0,i);var r=this.height,e=Math.max(0,Math.min(r,i.y));this.Gv=(r-e)/r,this.moveThumbPosition(e)},i.prototype.onValuesChange=function(){var t=this.$u.value,n=this.ts.value,i=this.Rt.value;this.Gv=(i-t)/(n-t);var r=this.height*(1-this.Gv);this.moveThumbPosition(r)},i.prototype.moveThumbPosition=function(t){var n=this.Qc;n.y=t-.5*n.height;var i=this.zv;i.y=t,i.height=this.height-t;var r=this.Rt;r.y=t-r.height-this.getValueMargin(),this.updateValue()},i.prototype.onKeyDown=function(t){return Xi.isArrowUpKey(t)?this.value+=this.Rt.delta:Xi.isArrowDownKey(t)&&(this.value-=this.Rt.delta),n.prototype.onKeyDown.call(this,t)},i.prototype.getType=function(){return"DSliderVertical"},i}(Fw),Xw=function(){function t(){}return t.set=function(t,n,i,r,e){var u,s=this.toRenderable(n,i,r);t.renderable=s;var h=t.state;h.lock(),h.isDisabled=!s,!1!==e&&(h.isReadOnly=this.toReadOnly(n,i,r));var o=null===(u=r.state)||void 0===u?void 0:u.modifier;o&&o(n,i,t.state),h.unlock()},t.toReadOnly=function(t,n,i){var r=i.editing.enable;return!0!==r&&(!1===r||!r(t,n))},t.toRenderable=function(t,n,i){var r=i.renderable;return!0===r||!1!==r&&r(t,n)},t}(),Kw=function(t){function n(n,i,r,e){var u,s=this;return(s=t.call(this,e)||this).Jv=-1,s.Zv=n,s.qv=i,s.Z=r,s.Qv=null!==(u=null==e?void 0:e.sync)&&void 0!==u?u:s.theme.isSyncEnabled(),s}return B(n,t),n.prototype.onActivate=function(n){var i,r=this;t.prototype.onActivate.call(this,n);var e=this.qv.selecting,u=e.dialog;if(u){var s=null!==(i=this.Ws)&&void 0!==i?i:null;e.setter(u,s),u.open(this).then((function(){var t=e.getter(u);r.Qv?t!==s&&(r.text=t,r.onValueChange(t,s)):r.onValueChange(t,null)}))}},n.prototype.onValueChange=function(t,n){var i=this.$v;if(void 0!==i){var r=this.Jv,e=this.Zv;this.qv.setter(i,e,t),this.emit("change",t,n,this),this.Z(t,n,i,r,e,this)}},Object.defineProperty(n.prototype,"row",{get:function(){return this.$v},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.Jv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.Zv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.qv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"value",{get:function(){var t=this.Ws;return void 0!==t?t:null},set:function(t){this.text=t},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.$v=n,this.Jv=r,u?(this.Vs=t,this.Ws=t,this.onTextChange(),this.createOrUpdateText()):this.text=t,Xw.set(this,n,e,this.qv)},n.prototype.unset=function(){this.$v=void 0,this.Jv=-1},n.prototype.getType=function(){return"DTableBodyCellSelectDialog"},n}(gs),Yw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DTableBodyCellActionDialog"},n}(Kw),Jw=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.Jv=-1,u.Zv=n,u.qv=i,u.Z=r,u}return B(n,t),n.prototype.onMenuSelect=function(n,i,r){var e=this.$v;if(void 0!==e){var u=this.Jv,s=this.Zv;this.qv.setter(e,s,n),t.prototype.onMenuSelect.call(this,n,i,r),this.Z(n,null,e,u,s,this)}},n.prototype.onKeyDownArrowDown=function(t){return!1},Object.defineProperty(n.prototype,"row",{get:function(){return this.$v},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.Jv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.Zv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.qv},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.$v=n,this.Jv=r,this.text=t,Xw.set(this,n,e,this.qv)},n.prototype.unset=function(){this.$v=void 0,this.Jv=-1},n.prototype.getType=function(){return"DTableBodyCellActionMenu"},n}(tw),Zw=function(t){function n(n,i,r,e){var u,s=this;return(s=t.call(this,e)||this).Jv=-1,s.Zv=n,s.qv=i,s.Z=r,s.Qv=null!==(u=null==e?void 0:e.sync)&&void 0!==u?u:s.theme.isSyncEnabled(),s}return B(n,t),n.prototype.onActivate=function(n){var i=this;t.prototype.onActivate.call(this,n);var r=this.qv.selecting.promise;r&&r().then((function(t){var n;if(i.Qv){var r=null!==(n=i.Ws)&&void 0!==n?n:null;t!==r&&(i.text=t,i.onValueChange(t,r))}else i.onValueChange(t,null)}))},n.prototype.onValueChange=function(t,n){var i=this.$v;if(void 0!==i){var r=this.Jv,e=this.Zv;this.qv.setter(i,e,t),this.emit("change",t,n,this),this.Z(t,n,i,r,e,this)}},Object.defineProperty(n.prototype,"row",{get:function(){return this.$v},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.Jv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.Zv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.qv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"value",{get:function(){var t=this.Ws;return void 0!==t?t:null},set:function(t){this.text=t},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.$v=n,this.Jv=r,u?(this.Vs=t,this.Ws=t,this.onTextChange(),this.createOrUpdateText()):this.text=t,Xw.set(this,n,e,this.qv)},n.prototype.unset=function(){this.$v=void 0,this.Jv=-1},n.prototype.getType=function(){return"DTableBodyCellSelectPromise"},n}(gs),qw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DTableBodyCellActionPromise"},n}(Zw),Qw=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.Jv=-1,u.Zv=n,u.qv=i,u.Z=r,u}return B(n,t),Object.defineProperty(n.prototype,"row",{get:function(){return this.$v},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.Jv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.Zv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.qv},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.$v=n,this.Jv=r,this.text=t,Xw.set(this,n,e,this.qv)},n.prototype.unset=function(){this.$v=void 0,this.Jv=-1},n.prototype.getType=function(){return"DTableBodyCellText"},n}(bs),$w=function(t){function n(n,i,r,e){var u,s=this;return(s=t.call(this,n,i,r,e)||this).th=Di(null!==(u=null==e?void 0:e.when)&&void 0!==u?u:Hu.CLICKED,Hu),s.on(Ki.tap,(function(t){s.onClick(t)})),s}return B(n,t),n.prototype.onClick=function(t){this.th===Hu.CLICKED&&this.state.isActionable&&this.activate(t)},n.prototype.onDblClick=function(n,i){return this.th===Hu.DOUBLE_CLICKED&&this.state.isActionable&&this.activate(n),t.prototype.onDblClick.call(this,n,i)},n.prototype.activate=function(t){this.onActivate(t)},n.prototype.onActivate=function(t){this.emit("active",this);var n=this.$v;if(void 0!==n){var i=this.Jv,r=this.Zv;this.emit("change",null,null,this),this.Z(null,null,n,i,r,this)}},n.prototype.onActivateKeyDown=function(t){this.state.isActionable&&(this.state.isPressed=!0)},n.prototype.onActivateKeyUp=function(t){this.state.isActionable&&(this.state.isPressed&&this.onActivate(t),this.state.isPressed=!1)},n.prototype.onKeyDown=function(n){return Xi.isActivateKey(n)&&this.onActivateKeyDown(n),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyUp=function(n){return Xi.isActivateKey(n)&&this.onActivateKeyUp(n),t.prototype.onKeyUp.call(this,n)},n.prototype.getType=function(){return"DTableBodyCellButton"},n}(Qw),tp={INDEX:0,TEXT:1,INTEGER:2,REAL:3,CHECK:4,CHECK_SINGLE:5,COLOR:6,BUTTON:7,SELECT:8,DATE:9,DATETIME:10,TIME:11,ACTION:12,LINK:13,TREE:14},np=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.Jv=-1,u.Zv=n,u.qv=i,u.Z=r,u}return B(n,t),n.prototype.onActivate=function(n){t.prototype.onActivate.call(this,n),this.onValueChange(!0,!1)},n.prototype.onInactivate=function(n){t.prototype.onInactivate.call(this,n),this.onValueChange(!1,!0)},n.prototype.onValueChange=function(t,n){var i=this.$v;if(void 0!==i){var r=this.Jv,e=this.Zv,u=this.qv;u.setter(i,e,t),this.emit("change",t,n,this);var s=this.Z;s(t,n,i,r,e,this),t&&u.type===tp.CHECK_SINGLE&&this.onChangeSingle(r,e,u,s)}},n.prototype.onChangeSingle=function(t,n,i,r){var e=this,u=this.parent;if(u){var s=u.parent;if(s){var h=!1,o=i.getter,a=i.setter;s.data.each((function(i,u){return t===u||!o(i,n)||(a(i,n,!1),h=!0,r(!1,!0,i,u,n,e),!1)})),h&&s.update(!0)}}},Object.defineProperty(n.prototype,"row",{get:function(){return this.$v},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.Jv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.Zv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.qv},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.$v=n,this.Jv=r,this.state.isActive=!!t,Xw.set(this,n,e,this.qv)},n.prototype.unset=function(){this.$v=void 0,this.Jv=-1},n.prototype.getType=function(){return"DTableBodyCellCheck"},n}(Ab),ip=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.Jv=-1,u.Zv=n,u.qv=i,u.Z=r,u}return B(n,t),n.prototype.onValueChange=function(n,i){var r=this.$v;if(void 0!==r){var e=this.Jv,u=this.Zv;this.qv.setter(r,u,n),t.prototype.onValueChange.call(this,n,i),this.Z(n,i,r,e,u,this)}else t.prototype.onValueChange.call(this,n,i)},Object.defineProperty(n.prototype,"row",{get:function(){return this.$v},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.Jv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.Zv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.qv},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.$v=n,this.Jv=r;var s=this.value;if(mn(t))s.color=t,s.alpha=1;else if(at(t)){var h=Number(t);s.color=h==h?h:16777215,s.alpha=1}else if(null!=t){var o=t.color,a=t.alpha;s.color=mn(o)?o:16777215,s.alpha=mn(a)?a:1}else s.color=16777215,s.alpha=1;Xw.set(this,n,e,this.qv)},n.prototype.unset=function(){this.$v=void 0,this.Jv=-1},n.prototype.getType=function(){return"DTableBodyCellColor"},n}(Jb),rp=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.Jv=-1,u.Zv=n,u.qv=i,u.Z=r,u}return B(n,t),n.prototype.onValueChange=function(n,i){var r=this.$v;if(void 0!==r){var e=this.Jv,u=this.Zv;this.qv.setter(r,u,n),t.prototype.onValueChange.call(this,n,i),this.Z(n,i,r,e,u,this)}else t.prototype.onValueChange.call(this,n,i)},Object.defineProperty(n.prototype,"row",{get:function(){return this.$v},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.Jv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.Zv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.qv},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){if(this.$v=n,this.Jv=r,t instanceof Date)u?(this.Vs=t,this.Ws=t,this.onTextChange(),this.createOrUpdateText()):this.text=t;else if(mn(t)){var s=this.Ws;void 0===s?this.text=new Date(t):s.getTime()!==t&&(s.setTime(t),this.onTextChange(),this.createOrUpdateText())}Xw.set(this,n,e,this.qv)},n.prototype.unset=function(){this.$v=void 0,this.Jv=-1},n.prototype.getType=function(){return"DTableBodyCellDate"},n}(qb),ep=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.Jv=-1,u.Zv=n,u.qv=i,u.Z=r,u}return B(n,t),n.prototype.onValueChange=function(n,i){var r=this.$v;if(void 0!==r){var e=this.Jv,u=this.Zv;this.qv.setter(r,u,n),t.prototype.onValueChange.call(this,n,i),this.Z(n,i,r,e,u,this)}else t.prototype.onValueChange.call(this,n,i)},Object.defineProperty(n.prototype,"row",{get:function(){return this.$v},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.Jv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.Zv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.qv},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){if(this.$v=n,this.Jv=r,t instanceof Date)u?(this.Vs=t,this.Ws=t,this.onTextChange(),this.createOrUpdateText()):this.text=t;else if(mn(t)){var s=this.Ws;null==s?this.text=new Date(t):s.getTime()!==t&&(s.setTime(t),this.onTextChange(),this.createOrUpdateText())}Xw.set(this,n,e,this.qv)},n.prototype.unset=function(){this.$v=void 0,this.Jv=-1},n.prototype.getType=function(){return"DTableBodyCellDatetime"},n}(nd),up=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.Jv=-1,u.Zv=n,u.qv=i,u.Z=r,u}return B(n,t),Object.defineProperty(n.prototype,"row",{get:function(){return this.$v},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.Jv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.Zv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.qv},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.$v=n,this.Jv=r,this.text=r,Xw.set(this,n,e,this.qv)},n.prototype.unset=function(){this.$v=void 0,this.Jv=-1},n.prototype.getType=function(){return"DTableBodyCellIndex"},n}(bs),sp=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.Jv=-1,u.Zv=n,u.qv=i,u.Z=r,u}return B(n,t),n.prototype.onValueChange=function(n,i){var r=this.$v;if(void 0!==r){var e=this.Jv,u=this.Zv;this.qv.setter(r,u,n),t.prototype.onValueChange.call(this,n,i),this.Z(n,i,r,e,u,this)}},Object.defineProperty(n.prototype,"row",{get:function(){return this.$v},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.Jv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.Zv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.qv},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.$v=n,this.Jv=r,this.text=Number(t),Xw.set(this,n,e,this.qv)},n.prototype.unset=function(){this.$v=void 0,this.Jv=-1},n.prototype.getType=function(){return"DTableBodyCellInputInteger"},n}(_s),hp=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.Jv=-1,u.Zv=n,u.qv=i,u.Z=r,u}return B(n,t),n.prototype.onValueChange=function(n,i){var r=this.$v;if(void 0!==r){var e=this.Jv,u=this.Zv;this.qv.setter(r,u,n),t.prototype.onValueChange.call(this,n,i),this.Z(n,i,r,e,u,this)}},Object.defineProperty(n.prototype,"row",{get:function(){return this.$v},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.Jv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.Zv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.qv},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.$v=n,this.Jv=r,this.text=Number(t),Xw.set(this,n,e,this.qv)},n.prototype.unset=function(){this.$v=void 0,this.Jv=-1},n.prototype.getType=function(){return"DTableBodyCellInputReal"},n}(Fs),op=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.Jv=-1,u.Zv=n,u.qv=i,u.Z=r,u}return B(n,t),n.prototype.onValueChange=function(n,i){var r=this.$v;if(void 0!==r){var e=this.Jv,u=this.Zv;this.qv.setter(r,u,n),t.prototype.onValueChange.call(this,n,i),this.Z(n,i,r,e,u,this)}},Object.defineProperty(n.prototype,"row",{get:function(){return this.$v},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.Jv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.Zv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.qv},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.$v=n,this.Jv=r,this.text=String(t),Xw.set(this,n,e,this.qv)},n.prototype.unset=function(){this.$v=void 0,this.Jv=-1},n.prototype.getType=function(){return"DTableBodyCellInputText"},n}(zs),ap=function(t){function n(n){var i=t.call(this,n)||this;return i.zn=new Ib(i.zn),i}return B(n,t),Object.defineProperty(n.prototype,"padding",{get:function(){return this.zn},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DTableBodyCellInputTreeInput"},n}(zs),cp=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DTableBodyCellInputTreeMarker"},n}(ds),fp={START:"START",END:"END",FROZEN:"FROZEN",FROZEN_END:"FROZEN_END",SORTABLE:"SORTABLE",SORTED_ASCENDING:"SORTED_ASCENDING",SORTED_DESCENDING:"SORTED_DESCENDING",HAS_CHILDREN:"HAS_CHILDREN",OPENED:"OPENED",CHECKABLE:"CHECKABLE",SELECTABLE:"SELECTABLE"},lp=function(t){function n(n,i,r,e){var u=t.call(this,function(t){if(null!=t)return{weight:t.weight,width:t.width}}(e))||this;u.Jv=-1,u.Zv=n,u.qv=i,u.Z=r;var s=u.newInput(e);u.lh=s,u.addChild(s);var h=u.newMarker(e);return u.A=h,u.addChild(h),u}return B(n,t),n.prototype.newInput=function(t){return new ap(this.toInputOptions(t))},n.prototype.toInputOptions=function(t){var n=this;return{weight:1,text:null==t?void 0:t.text,editing:null==t?void 0:t.editing,when:null==t?void 0:t.when,cursor:null==t?void 0:t.cursor,on:{change:function(t,i){n.onInputChange(t,i)}}}},n.prototype.onInputChange=function(t,n){var i=this.$v;if(void 0!==i){var r=this.Jv,e=this.Zv;this.qv.setter(i,e,t),this.emit("change",t,n,this),this.Z(t,n,i,r,e,this)}},n.prototype.newMarker=function(t){var n=this;return new cp({visible:!1,on:{active:function(){n.onMarkerActive()}}})},n.prototype.onMarkerActive=function(){this.A.state.is(fp.HAS_CHILDREN)&&this.toggle()},Object.defineProperty(n.prototype,"row",{get:function(){return this.$v},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.Jv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.Zv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.qv},enumerable:!1,configurable:!0}),n.prototype.toggle=function(){var t=this.$v;if(void 0!==t){var n=this.parent;if(null!=n){var i=n.parent;if(null!=i){var r=i.data;r&&r.toggle&&(r.isExpanded(t)?r.collapse(t)&&(this.emit("collapse",this),r.emit("collapse",t,this)):r.expand(t)&&(this.emit("expand",this),r.emit("expand",t,this)))}}}},n.prototype.onRowSelect=function(t,n){return n.x<=this.position.x+this.lh.padding.getLeft()},n.prototype.set=function(t,n,i,r,e,u){this.$v=n,this.Jv=r;var s=this.lh;s.visible=!0,s.text=String(t);var h=this.A;if(mn(i)){var o=!!(1&i),a=!!(2&i),c=i>>2,f=h.state;f.lock(),f.set(fp.HAS_CHILDREN,a),f.set(ht.DISABLED,!a),f.set(fp.OPENED,o),f.unlock();var l=this.theme.getLevelPadding(c);h.width=l,a?h.show():h.hide(),s.padding.adjLeft(l)}else h.state.removeAll(fp.OPENED,fp.HAS_CHILDREN),h.hide(),s.padding.adjLeft(0);Xw.set(this.lh,n,e,this.qv)},n.prototype.unset=function(){this.$v=void 0,this.Jv=-1,this.lh.visible=!1,this.A.hide()},n.prototype.getType=function(){return"DTableBodyCellInputTree"},n}(Qi),vp=function(t,n){if(n)return{url:bp(t,n.url),target:n.target,checker:dp(t,n.checker),menu:n.menu}},bp=function(t,n){return at(n)||null==n?n:function(){var i=t.row;return void 0!==i?n(i,t.rowIndex,t.columnIndex,t):null}},dp=function(t,n){if(null!=n)return function(){var i=t.row;return void 0!==i&&n(i,t.rowIndex,t.columnIndex,t)}},gp=function(t){function n(n,i,r,e){var u;return t.call(this,n,i,r,Rl.toStateOptions(null===(u=null==e?void 0:e.link)||void 0===u?void 0:u.target,e))||this}return B(n,t),n.prototype.onClick=function(n){this.link.onClick(this,n)||t.prototype.onClick.call(this,n)},Object.defineProperty(n.prototype,"link",{get:function(){var t,n=this.So;return null==n&&(n=new Al(vp(this,null===(t=this.kn)||void 0===t?void 0:t.link)),this.So=n),n},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DTableBodyCellLink"},n.prototype.onActivate=function(n){t.prototype.onActivate.call(this,n),this.link.open(n)},n.prototype.open=function(t){this.link.open(t)},n}($w),mp=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.Jv=-1,u.Zv=n,u.qv=i,u.Z=r,u}return B(n,t),n.prototype.onValueChange=function(n,i,r){var e=this.$v;if(void 0!==e){var u=this.Jv,s=this.Zv;this.qv.setter(e,s,n),t.prototype.onValueChange.call(this,n,i,r),this.Z(n,i,e,u,s,this)}},n.prototype.onKeyDownArrowDown=function(t){return!1},Object.defineProperty(n.prototype,"row",{get:function(){return this.$v},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.Jv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.Zv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.qv},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.$v=n,this.Jv=r,this.value=t,Xw.set(this,n,e,this.qv)},n.prototype.unset=function(){this.$v=void 0,this.Jv=-1},n.prototype.getType=function(){return"DTableBodyCellSelectMenu"},n}(xw),wp=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.Jv=-1,u.Zv=n,u.qv=i,u.Z=r,u}return B(n,t),n.prototype.onValueChange=function(n,i,r){var e=this.$v;if(void 0!==e){var u=this.Jv,s=this.Zv;this.qv.setter(e,s,n),t.prototype.onValueChange.call(this,n,i,r),this.Z(n,i,e,u,s,this)}},n.prototype.onKeyDownArrowDown=function(t){return!1},Object.defineProperty(n.prototype,"row",{get:function(){return this.$v},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.Jv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.Zv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.qv},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.$v=n,this.Jv=r,this.values=t,Xw.set(this,n,e,this.qv)},n.prototype.unset=function(){this.$v=void 0,this.Jv=-1},n.prototype.getType=function(){return"DTableBodyCellSelectMultiple"},n}(kw),pp=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.Jv=-1,u.Zv=n,u.qv=i,u.Z=r,u}return B(n,t),n.prototype.onValueChange=function(n,i){var r=this.$v;if(void 0!==r){var e=this.Jv,u=this.Zv;this.qv.setter(r,u,n),t.prototype.onValueChange.call(this,n,i),this.Z(n,i,r,e,u,this)}else t.prototype.onValueChange.call(this,n,i)},Object.defineProperty(n.prototype,"row",{get:function(){return this.$v},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.Jv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.Zv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.qv},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){if(this.$v=n,this.Jv=r,t instanceof Date)u?(this.Vs=t,this.Ws=t,this.onTextChange(),this.createOrUpdateText()):this.text=t;else if(mn(t)){var s=this.Ws;null==s?this.text=new Date(t):s.getTime()!==t&&(s.setTime(t),this.onTextChange(),this.createOrUpdateText())}Xw.set(this,n,e,this.qv)},n.prototype.unset=function(){this.$v=void 0,this.Jv=-1},n.prototype.getType=function(){return"DTableBodyCellTime"},n}(Yd),Op=function(t){function n(n,i,r,e){var u,s=this;return(s=t.call(this,n,i,r,Rl.toStateOptions(null===(u=null==e?void 0:e.link)||void 0===u?void 0:u.target,e))||this).zn=new Ib(s.zn),s}return B(n,t),n.prototype.onClick=function(n){var i;!0!==(null===(i=this.link)||void 0===i?void 0:i.onClick(this,n))&&t.prototype.onClick.call(this,n)},Object.defineProperty(n.prototype,"link",{get:function(){var t=this.So;return void 0===t&&(t=this.newLink(),this.So=t),t},enumerable:!1,configurable:!0}),n.prototype.newLink=function(){var t,n=null===(t=this.kn)||void 0===t?void 0:t.link;return n?new Al(vp(this,n)):null},n.prototype.onActivate=function(n){var i;t.prototype.onActivate.call(this,n),this.state.is(fp.HAS_CHILDREN)?this.toggle():null===(i=this.link)||void 0===i||i.open(n)},n.prototype.toggle=function(){var t=this.$v;if(void 0!==t){var n=this.parent;if(null!=n){var i=n.parent;if(null!=i){var r=i.data;r&&r.toggle&&(r.isExpanded(t)?r.collapse(t)&&(this.emit("collapse",this),r.emit("collapse",t,this)):r.expand(t)&&(this.emit("expand",this),r.emit("expand",t,this)))}}}},n.prototype.onRowSelect=function(t,n){return n.x<=this.position.x+this.padding.getLeft()&&(this.toggle(),!0)},n.prototype.set=function(t,n,i,r,e,u){this.$v=n,this.Jv=r,this.text=t,Xw.set(this,n,e,this.qv,!1);var s=this.link,h=this.zn;if(mn(i)){var o=!!(1&i),a=!!(2&i),c=i>>2,f=this.state;f.lock(),f.set(fp.HAS_CHILDREN,a),f.set(fp.OPENED,o),f.unlock(),h.adjLeft(this.theme.getLevelPadding(c)),s&&(s.menu.enable=!a)}else this.state.removeAll(fp.OPENED,fp.HAS_CHILDREN),h.adjLeft(0),s&&(s.menu.enable=!1)},n.prototype.getType=function(){return"DTableBodyCellTree"},n}($w),Dp={NONE:0,SINGLE:1,MULTIPLE:2},Ep=function(t){function n(n){var i,r,e=this;return(e=t.call(this,n)||this).$n=!0,e.tb=null!==(i=n.frozen)&&void 0!==i?i:0,e.nb=null!==(r=n.columns)&&void 0!==r?r:[],e}return B(n,t),n.prototype.initCells=function(t,n,i){for(var r=this.toIndexEnd(n),e=n.length-1;0<=e;--e){var u=this.newCell(e,n[e],n,t),s=u.state;s.lock(!1),0===e&&s.add(fp.START),e===r&&s.add(fp.END),e<i&&s.add(fp.FROZEN),e===i-1&&s.add(fp.FROZEN_END),s.unlock(),this.addChild(u)}},n.prototype.toIndexEnd=function(t){for(var n=t.length,i=0;i<n;++i)if(void 0!==t[i].weight)return n-1;return n},n.prototype.onRefit=function(){t.prototype.onRefit.call(this),this.resetFrozenCellPosition()},n.prototype.updateFrozenCellPosition=function(t){for(var n=this.nb,i=this.children,r=i.length,e=this.tb,u=0;u<e;++u){var s=n[u];i[r-1-u].position.x=-t+s.offset}},n.prototype.resetFrozenCellPosition=function(){for(var t=this.nb,n=this.children,i=n.length,r=this.tb,e=this.getContentPositionX(),u=0;u<r;++u){var s=t[u],h=n[i-1-u];s.offset=h.position.x,h.position.x=-e+s.offset}},n.prototype.getClippingRect=function(n,i){t.prototype.getClippingRect.call(this,n,i);var r=this.tb;if(0<r){var e=n;if(e&&e.parent===this){var u=this.children,s=u.indexOf(e);if(0<=s&&r<=u.length-1-s){var h=u[s+1],o=h.position.x+h.width;i.x+=o,i.width-=o}}}},n.prototype.getType=function(){return"DTableRow"},n}(ws),Mp=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.Qe=-1,u.ib=function(t,i,r,e,s){u.emit("change",t,i,r,e,s,u),n(t,i,r,e,s,u)},u.rb=r,u.state.isAlternated=!i,u.initCells(e,u.nb,u.tb),u}return B(n,t),n.prototype.newCell=function(t,n,i,r){var e=this.ib,u=this.rb,s=u.get(t);if(null==s&&(s=this.toCellOptions(t,n,r),u.set(t,s)),!1!==n.editing.enable)return this.newCellEditable(t,n,e,s);var h=this.newCellUnediable(t,n,e,s);return n.type!==tp.TREE&&(h.state.isReadOnly=!0),h},n.prototype.newCellEditable=function(t,n,i,r){switch(n.type){case tp.INDEX:return new up(t,n,i,r);case tp.TEXT:return new op(t,n,i,r);case tp.TREE:return new lp(t,n,i,r);case tp.INTEGER:return new sp(t,n,i,r);case tp.REAL:return new hp(t,n,i,r);case tp.CHECK:case tp.CHECK_SINGLE:return new np(t,n,i,r);case tp.COLOR:return new ip(t,n,i,r);case tp.BUTTON:return new $w(t,n,i,r);case tp.LINK:return new gp(t,n,i,r);case tp.SELECT:return this.newCellSelect(t,n,i,r);case tp.ACTION:return this.newCellAction(t,n,i,r);case tp.DATE:return new rp(t,n,i,r);case tp.DATETIME:return new ep(t,n,i,r);case tp.TIME:return new pp(t,n,i,r);default:return new Qw(t,n,i,r)}},n.prototype.newCellUnediable=function(t,n,i,r){switch(n.type){case tp.INDEX:return new up(t,n,i,r);case tp.TEXT:return new Qw(t,n,i,r);case tp.TREE:return new Op(t,n,i,r);case tp.INTEGER:case tp.REAL:return new Qw(t,n,i,r);case tp.CHECK:case tp.CHECK_SINGLE:return new np(t,n,i,r);case tp.COLOR:return new ip(t,n,i,r);case tp.BUTTON:return new $w(t,n,i,r);case tp.LINK:return new gp(t,n,i,r);case tp.SELECT:return this.newCellSelect(t,n,i,r);case tp.ACTION:return this.newCellAction(t,n,i,r);case tp.DATE:return new rp(t,n,i,r);case tp.DATETIME:return new ep(t,n,i,r);case tp.TIME:return new pp(t,n,i,r);default:return new Qw(t,n,i,r)}},n.prototype.newCellSelect=function(t,n,i,r){var e=n.selecting;return null!=e.menu?new mp(t,n,i,r):null!=e.multiple?new wp(t,n,i,r):null!=e.dialog?new Kw(t,n,i,r):null!=e.promise?new Zw(t,n,i,r):new Qw(t,n,i,r)},n.prototype.newCellAction=function(t,n,i,r){var e=n.selecting;return null!=e.menu?new Jw(t,n,i,r):null!=e.dialog?new Yw(t,n,i,r):null!=e.promise?new qw(t,n,i,r):new Qw(t,n,i,r)},n.prototype.toCellOptions=function(t,n,i){var r,e,u,s,h,o,a,c,f,l,v,b,d,g,m=ib(n.body,i.cell);m.weight=n.weight,m.width=n.width,null!==(r=m.state)&&void 0!==r||(m.state=n.state.initial);var w=n.formatter;null!=w&&(null!==(u=(O=null!==(e=m.text)&&void 0!==e?e:m.text={}).formatter)&&void 0!==u||(O.formatter=w));var p=n.align;if(null!=p){var O,D=null!==(h=(O=null!==(s=m.text)&&void 0!==s?s:m.text={}).align)&&void 0!==h?h:O.align={};null!==(o=D.horizontal)&&void 0!==o||(D.horizontal=p)}var E=n.editing;if(!1!==E.enable){var M=null!==(a=(g=m).editing)&&void 0!==a?a:g.editing={};null!==(c=M.formatter)&&void 0!==c||(M.formatter=E.formatter),null!==(f=M.unformatter)&&void 0!==f||(M.unformatter=E.unformatter),null!==(l=M.validator)&&void 0!==l||(M.validator=E.validator)}var S=n.link;void 0!==S&&(m.link=S);var T=n.selecting,j=null!==(v=T.menu)&&void 0!==v?v:T.multiple;return void 0!==j&&(m.menu=j),(null!==(d=null===(b=null==i?void 0:i.selection)||void 0===b?void 0:b.type)&&void 0!==d?d:Dp.NONE)!==Dp.NONE&&(m.when="DOUBLE_CLICKED",m.cursor=function(t){if(t.in(fp.SELECTABLE))return"pointer"}),m},n.prototype.getType=function(){return"DTableBodyRow"},Object.defineProperty(n.prototype,"value",{get:function(){return this.Rt},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"index",{get:function(){return this.Qe},enumerable:!1,configurable:!0}),n.prototype.isCell=function(t){return null!=t&&"set"in t},n.prototype.set=function(t,n,i,r){if(r||this.Rt!==t||this.Qe!==i){this.Rt=t,this.Qe=i;for(var e=this.children,u=e.length,s=this.nb,h=s.length,o=0;o<u;++o){var a=e[o],c=h-1-o,f=s[c];this.isCell(a)&&a.set(f.getter(t,c),t,n,i,c,r)}this.onSet(t,i)}},n.prototype.onSet=function(t,n){this.emit("set",t,n,this)},n.prototype.unset=function(){if(void 0!==this.Rt){this.Rt=void 0,this.Qe=-1;for(var t=this.children,n=t.length,i=0;i<n;++i){var r=t[i];this.isCell(r)&&r.unset()}this.onUnset()}},n.prototype.onUnset=function(){this.emit("unset",this)},n.prototype.getContentPositionX=function(){var t=this.parent;if(t){var n=t.parent;if(n)return n.position.x}return 0},n}(Ep),Sp=function(t){function n(n){var i=t.call(this)||this;return i.R=0,i.bl=-1,i.eb=!1,i.ub=-1,i.p=n,i.sf=null,i.sb=null,i}return B(n,t),Object.defineProperty(n.prototype,"id",{get:function(){return this.R},enumerable:!1,configurable:!0}),n.prototype.apply=function(){this.eb=!0,this.R+=1,this.p.update()},n.prototype.unapply=function(){this.eb&&(this.eb=!1,this.R+=1,this.p.update())},n.prototype.isApplied=function(){return this.eb},n.prototype.newFiltered=function(){var t=this.sf;if(null!=t){var n,i=[],r=this.p,e=r.sorter,u=r.rows;if(ot(t))if(n=e.indices)for(var s=0,h=n.length;s<h;++s)t(u[o=n[s]],o)&&i.push(s);else for(s=0,h=u.length;s<h;++s)t(u[s],s)&&i.push(s);else if(n=e.indices)for(s=0,h=n.length;s<h;++s){var o=n[s];t.test(u[o],o)&&i.push(s)}else for(s=0,h=u.length;s<h;++s)t.test(u[s],s)&&i.push(s);return i}return null},n.prototype.get=function(){return this.sf},n.prototype.set=function(t){this.sf!==t&&(this.sf=t)},n.prototype.toDirty=function(){this.R+=1},n.prototype.update=function(){this.R===this.bl&&this.p.sorter.id===this.ub||(this.bl=this.R,this.ub=this.p.sorter.id,this.eb?(this.sb=this.newFiltered(),this.emit("change",this)):null!=this.sb&&(this.sb=null,this.emit("change",this)))},Object.defineProperty(n.prototype,"indices",{get:function(){return this.update(),this.sb},enumerable:!1,configurable:!0}),n.prototype.map=function(t){var n=t,i=this.indices;if(i){var r=i.indexOf(n);if(!(0<=r))return null;n=r}return n},n.prototype.unmap=function(t){var n=t,i=this.indices;return i&&(n=i[n]),n},n}(t.utils.EventEmitter),Tp=function(){function t(t){this.p=t}return t.prototype.map=function(t){var n=this.p,i=n.sorter.map(t);return null!=i?n.filter.map(i):null},t.prototype.unmap=function(t){var n=this.p;return n.sorter.unmap(n.filter.unmap(t))},t.prototype.size=function(){var t=this.p,n=t.filter.indices;return null!=n?n.length:t.size()},t.prototype.get=function(t){return this.p.get(this.unmap(t))},t.prototype.each=function(t,n,i){var r=this.p,e=r.rows,u=r.supplimentals,s=r.filter.indices,h=r.sorter.indices;if(n=null!=n?Math.max(0,n):0,s){var o=s.length;if(i=null!=i?Math.min(o,i):o,h)for(var a=n;a<i&&!1!==t(e[c=h[s[a]]],u?u[c]:null,a,c);++a);else for(a=n;a<i&&!1!==t(e[c=s[a]],u?u[c]:null,a,c);++a);}else if(o=e.length,i=null!=i?Math.min(o,i):o,h)for(a=n;a<i;++a){var c;if(!1===t(e[c=h[a]],u?u[c]:null,a,c))break}else for(a=n;a<i&&!1!==t(e[a],u?u[a]:null,a,a);++a);},t}(),jp=function(t,n){return t[0]-n[0]},Np=function(t){function n(n,i){var r,e=this;(e=t.call(this)||this).p=n,e.Nt=Di(null!==(r=null==i?void 0:i.type)&&void 0!==r?r:Dp.NONE,Dp),e.pn=new Set;var u=null==i?void 0:i.on;if(u)for(var s in u){var h=u[s];h&&e.on(s,h)}return e}return B(n,t),Object.defineProperty(n.prototype,"parent",{get:function(){return this.p},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"type",{get:function(){return this.Nt},enumerable:!1,configurable:!0}),n.prototype.onChange=function(){this.p.update(),this.emit("change",this)},n.prototype.toggle=function(t){var n=this.pn;n.has(t)?n.delete(t):n.add(t),this.onChange()},n.prototype.add=function(t){var n=this.pn,i=n.size;n.add(t),i!==n.size&&this.onChange()},Object.defineProperty(n.prototype,"first",{get:function(){var t=this.pn;if(0<t.size){var n=NaN;return t.forEach((function(t){n!=n&&(n=t)})),n}return null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"last",{get:function(){var t=this.pn;if(0<t.size){var n=0;return t.forEach((function(t){n=t})),n}return null},enumerable:!1,configurable:!0}),n.prototype.addTo=function(t){var n=this.last;null!=n&&this.addRange(n,!1,t,!0)},n.prototype.addRange=function(t,n,i,r){var e=this.pn,u=e.size;if(t<i)for(var s=i+(r?1:0),h=t+(n?0:1);h<s;++h)e.add(h);else for(s=t+(n?1:0),h=i+(r?0:1);h<s;++h)e.add(h);u!==e.size&&this.onChange()},n.prototype.addAll=function(t){for(var n=this.pn,i=n.size,r=0,e=t.length;r<e;++r)n.add(t[r]);i!==n.size&&this.onChange()},n.prototype.contains=function(t){return this.pn.has(t)},n.prototype.remove=function(t){this.pn.delete(t)&&this.onChange()},n.prototype.clear=function(){var t=this.pn;0<t.size&&(t.clear(),this.onChange())},n.prototype.clearAndAdd=function(t){var n=this.pn;n.has(t)&&1===n.size||(n.clear(),n.add(t),this.onChange())},n.prototype.clearAndAddAll=function(t){var n=this.pn;if(0<n.size||0<t.length){n.clear();for(var i=0,r=t.length;i<r;++i)n.add(t[i]);this.onChange()}},n.prototype.shift=function(t,n){var i=[],r=this.pn;if(r.forEach((function(n){t<=n&&i.push(n)})),0<i.length){for(var e=0,u=i.length;e<u;++e)r.delete(i[e]);for(e=0,u=i.length;e<u;++e)r.add(i[e]+n);this.onChange()}},n.prototype.size=function(){return this.pn.size},n.prototype.isEmpty=function(){return 0===this.pn.size},n.prototype.each=function(t){var n=!1;this.pn.forEach((function(i){n||!1===t(i)&&(n=!0)}))},Object.defineProperty(n.prototype,"indices",{get:function(){var t=[];return this.pn.forEach((function(n){t.push(n)})),t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rows",{get:function(){var t=[],n=this.p;return this.pn.forEach((function(i){t.push(n.get(i))})),t},enumerable:!1,configurable:!0}),n.prototype.toArray=function(){var t=[],n=this.p;return this.pn.forEach((function(i){t.push([i,n.get(i)])})),t},n.prototype.toSortedArray=function(){return this.toArray().sort(jp)},n.prototype.toObject=function(){var t={},n=this.p;return this.pn.forEach((function(i){t[i]=n.get(i)})),t},n.prototype.toMap=function(){var t=new Map,n=this.p;return this.pn.forEach((function(i){t.set(i,n.get(i))})),t},n}(t.utils.EventEmitter),Ip={ASCENDING:0,DESCENDING:1},Cp=function(t){function n(n){var i=t.call(this)||this;return i.R=0,i.bl=-1,i.eb=!1,i.p=n,i.hb=null,i.ob=null,i.kt=Ip.ASCENDING,i}return B(n,t),Object.defineProperty(n.prototype,"id",{get:function(){return this.R},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"order",{get:function(){return this.kt},set:function(t){this.kt=t},enumerable:!1,configurable:!0}),n.prototype.apply=function(){this.eb=!0,this.R+=1,this.p.update()},n.prototype.unapply=function(){this.eb&&(this.eb=!1,this.R+=1,this.p.update())},n.prototype.isApplied=function(){return this.eb},n.prototype.newSorted=function(){var t=this.hb;if(null!=t){for(var n=[],i=this.p.rows,r=0,e=i.length;r<e;++r)n.push(r);return n.sort(this.toComparator(i,t)),n}return null},n.prototype.toComparator=function(t,n){var i=this.kt;return ot(n)?i===Ip.ASCENDING?function(i,r){return n(t[i],t[r],i,r)}:function(i,r){return n(t[r],t[i],r,i)}:i===Ip.ASCENDING?function(i,r){return n.compare(t[i],t[r],i,r)}:function(i,r){return n.compare(t[r],t[i],r,i)}},n.prototype.get=function(){return this.hb},n.prototype.set=function(t){this.hb!==t&&(this.hb=t)},n.prototype.toDirty=function(){this.R+=1},n.prototype.update=function(){this.R!==this.bl&&(this.bl=this.R,this.eb?(this.ob=this.newSorted(),this.emit("change",this)):null!=this.ob&&(this.ob=null,this.emit("change",this)))},Object.defineProperty(n.prototype,"indices",{get:function(){return this.update(),this.ob},enumerable:!1,configurable:!0}),n.prototype.map=function(t){var n=t,i=this.indices;if(i){var r=i.indexOf(n);if(!(0<=r))return null;n=r}return n},n.prototype.unmap=function(t){var n=t,i=this.indices;return i&&(n=i[n]),n},n}(t.utils.EventEmitter),Ap=function(n){function i(t){var i=n.call(this)||this;if(i.p=null,i.ab=i.toRows(null==t?void 0:t.rows),i.zc=new Tp(i),i.Hc=i.toSelection(null==t?void 0:t.selection),i.sf=new Sp(i),i.cb=new Cp(i),t){var r=t.filter;r&&i.sf.set(r);var e=t.comparator;e&&i.cb.set(e);var u=t.on;if(u)for(var s in u){var h=u[s];h&&i.on(s,h)}}return i}return B(i,n),i.prototype.toSelection=function(n){return n instanceof t.utils.EventEmitter?n:ot(n)?n(this):this.newSelection(n)},i.prototype.newSelection=function(t){return new Np(this,t)},i.prototype.bind=function(t){this.p=t},i.prototype.toRows=function(t){var n=[];if(null!=t)for(var i=0,r=t.length;i<r;++i)n.push(t[i]);return n},Object.defineProperty(i.prototype,"rows",{get:function(){return this.ab},enumerable:!1,configurable:!0}),i.prototype.update=function(){var t=this.p;t&&t.update()},i.prototype.lock=function(){var t=this.p;t&&t.lock()},i.prototype.unlock=function(){var t=this.p;t&&(t.unlock(!1),t.update())},i.prototype.size=function(){return this.ab.length},i.prototype.clear=function(){var t=this.ab;0<t.length&&(t.length=0,this.lock(),this.Hc.clear(),this.cb.toDirty(),this.sf.toDirty(),this.unlock())},i.prototype.clearAndAdd=function(t){var n=this.ab;n.length=0,n.push(t),this.lock(),this.Hc.clear(),this.cb.toDirty(),this.sf.toDirty(),this.unlock()},i.prototype.clearAndAddAll=function(t){var n=this.ab;n.length=0;for(var i=0,r=t.length;i<r;++i)n.push(t[i]);this.lock(),this.Hc.clear(),this.cb.toDirty(),this.sf.toDirty(),this.unlock()},i.prototype.add=function(t,n){var i=this.ab,r=this.Hc,e=this.cb,u=this.sf;null==n?(i.push(t),this.lock(),e.toDirty(),u.toDirty(),this.unlock()):0<=n&&n<i.length&&(i.splice(n,0,t),this.lock(),r.shift(n,1),e.toDirty(),u.toDirty(),this.unlock())},i.prototype.addAll=function(t,n){var i=this.ab,r=i.length,e=this.Hc,u=this.cb,s=this.sf;if(null==n){for(var h=0,o=a=t.length;h<o;++h)i.push(t[h]);this.lock(),u.toDirty(),s.toDirty(),this.unlock()}else if(0<=n&&n<r){var a=t.length;for(h=0;h<a;++h)i.splice(n+h,0,t[h]);this.lock(),e.shift(n,a),u.toDirty(),s.toDirty(),this.unlock()}},i.prototype.get=function(t){var n=this.ab;return 0<=t&&t<n.length?n[t]:null},i.prototype.set=function(t,n){var i=this.ab;if(0<=t&&t<i.length){var r=i[t];return i[t]=n,this.lock(),this.cb.toDirty(),this.sf.toDirty(),this.unlock(),r}return null},i.prototype.remove=function(t){var n=this.ab;if(0<=t&&t<n.length){var i=n.splice(t,1)[0];return this.lock(),this.Hc.remove(t),this.cb.toDirty(),this.sf.toDirty(),this.unlock(),i}return null},i.prototype.each=function(t,n,i){var r=this.ab;n=null!=n?Math.max(0,n):0,i=null!=i?Math.min(r.length,i):r.length;for(var e=n;e<i&&!1!==t(r[e],e);++e);},Object.defineProperty(i.prototype,"selection",{get:function(){return this.Hc},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"filter",{get:function(){return this.sf},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"sorter",{get:function(){return this.cb},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"mapped",{get:function(){return this.zc},enumerable:!1,configurable:!0}),i}(t.utils.EventEmitter),Rp=function(n){function i(t){var i,r=this;(r=n.call(this,t)||this).transform.position.y=null!==(i=t.offset)&&void 0!==i?i:0;var e=r.toData(t.data);r.Pt=e,e.bind(r);var u=r.theme,s=function(t,n,i){var r=n.columns||[],e=n.row;return null!=e?(null==e.height&&(e.height=t.getRowHeight()),void 0===e.columns&&(e.columns=r),null==e.frozen&&(e.frozen=n.frozen),void 0===e.selection?e.selection={type:i}:void 0===e.selection.type&&(e.selection.type=i)):e={columns:r,height:t.getRowHeight(),frozen:n.frozen,selection:{type:i}},e}(u,t,e.selection.type);return r.fb=s,r.lb=null!=s.height?s.height:u.getRowHeight(),r.nb=s.columns||[],r.vb=0,r.bb=0,r.gb=0,r.mb=!1,r.wb=!1,r.pb=[],r.Ob=function(t,n,i,r,u){e.emit("change",t,n,i,r,u,e)},r.rb=new Map,r.Pt.emit("init",r.Pt),r}return B(i,n),i.prototype.toData=function(t){return this.isData(t)?t:new Ap(t)},i.prototype.isData=function(t){return null!=t&&"mapped"in t},i.prototype.onResize=function(t,i,r,e){n.prototype.onResize.call(this,t,i,r,e),this.update()},Object.defineProperty(i.prototype,"selection",{get:function(){return this.Pt.selection},enumerable:!1,configurable:!0}),i.prototype.lock=function(){this.gb+=1,1===this.gb&&(this.mb=!1,this.wb=!1)},i.prototype.unlock=function(t){this.gb-=1,0===this.gb&&(t&&this.mb&&this.update(this.wb),this.mb=!1,this.wb=!1)},i.prototype.update=function(t){if(0<this.gb)return this.mb=!0,void(t&&(this.wb=!0));var n=this.parent;if(null!=n){var i=n.parent;if(null!=i){var r=this.children,e=i.height,u=this.lb,s=this.Pt,h=s.mapped.size(),o=this.vb,a=this.bb,c=a-o,f=this.transform.position.y,l=f+h*u,v=Math.max(e,l),b=Math.max(e-v,n.position.y),d=-b/u,g=(e-(b+f))/u,m=Math.floor(d);m-=m%2==0?2:1;var w=Math.floor(g),p=(w+=(w-m)%2==1?3:2)-m;if(p<c&&c-2<=p&&(w=m+(p=c)),c<p){for(var O=c;O<p;++O){var D=o+O,E=this.newRow(D%2==0);this.addChild(E)}a=o+(c=p)}else if(p<c){for(O=c-1;p<=O;--O)this.removeChild(r[O]);a=o+(c=p)}this.vb=m,this.bb=w;var M=m-o,S=Math.abs(M),T=r.length;if(0<S&&S<T){var j=this.pb;if(0<M){for(O=0;O<S;++O)j.push(this.resetRow(r[O]));for(O=S;O<T;++O)r[O-S]=r[O];for(O=0;O<S;++O)r[T-S+O]=j[O]}else{for(O=0;O<S;++O)j.push(this.resetRow(r[T-S+O]));for(O=T-S-1;0<=O;--O)r[O+S]=r[O];for(O=0;O<S;++O)r[O]=j[O]}j.length=0}var N=s.selection,I=N.type!==Dp.NONE;for(s.mapped.each((function(n,i,e,s){var h=r[e-m];h.position.y=e*u;var o=h.state;o.lock(),o.set(fp.SELECTABLE,I),o.set(ht.ACTIVE,N.contains(s)),o.remove(ht.DISABLED),o.unlock(),h.set(n,i,s,t)}),m,m+T),O=0;m+O<0&&O<T;++O)(C=r[O]).position.y=(m+O)*u,(A=C.state).lock(),A.add(ht.DISABLED),A.removeAll(fp.SELECTABLE,ht.ACTIVE),A.unlock(),C.unset();for(O=T-1;h<=m+O&&0<=O;--O){var C,A;(C=r[O]).position.y=(m+O)*u,(A=C.state).lock(),A.add(ht.DISABLED),A.removeAll(fp.SELECTABLE,ht.ACTIVE),A.unlock(),C.unset()}this.lock(),n.position.y=b,n.height=v,this.height=l,this.unlock(!1),this.emit("update",d,g,this)}}},i.prototype.resetRow=function(t){t.blur(!0);for(var n=t.children,i=0,r=n.length;i<r;++i){var e=n[i];e instanceof Qi&&(e.state.isPressed=!1)}return t},i.prototype.newRow=function(t){return new Mp(this.Ob,t,this.rb,this.fb)},i.prototype.onParentMove=function(t,i,r,e){n.prototype.onParentMove.call(this,t,i,r,e),this.updateFrozenCellPosition(t)},i.prototype.updateFrozenCellPosition=function(t){var n=this.fb.frozen;if(null!=n&&0<n)for(var i=this.children,r=0,e=i.length;r<e;++r)i[r].updateFrozenCellPosition(t)},i.prototype.getClippingRect=function(t,i){n.prototype.getClippingRect.call(this,t,i);var r=this.parent;if(r){var e=-r.transform.position.y;i.y+=e,i.height-=e}},i.prototype.scrollTo=function(t){var n=this.parent;if(null==n)return!1;var i=n.parent;if(null==i)return!1;var r=-1;return mn(t)?0<=t&&t<this.data.mapped.size()&&(r=t):this.data.mapped.each((function(n,i,e){return n!==t||(r=e,!1)})),!(r<0||(n.position.y=Math.max(Math.min(0,i.height-n.height),-r*this.lb),rt.update(this),0))},i.prototype.toRowIndexMapped=function(t){return 0<=this.parent.position.y+t.y?Math.floor(t.y/this.lb):-1},i.prototype.toRow=function(t){var n=t-this.vb,i=this.children;return 0<=n&&n<i.length?i[n]:null},i.prototype.toCell=function(t,n){for(var i=t.children,r=i.length,e=this.nb.length,u=0,s=Math.min(r,e);u<s;++u){var h=i[r-u-1],o=n.x-h.position.x;if(0<=o&&o<=h.width)return h}return null},i.prototype.onRowClick=function(t){if(this.state.isActionable){var n=i.WORK_ON_CLICK;n.copyFrom(t.data.global),this.toLocal(n,void 0,n,!1);var r=this.toRowIndexMapped(n);if(0<=r&&r<this.Pt.mapped.size()){var e=this.toRow(r);if(e){var u=this.toCell(e,n);if(u&&u.onRowSelect&&u.onRowSelect(t,n))return}this.onRowSelect(t,r)}}},i.prototype.onRowSelect=function(t,n){var i=this.Pt,r=i.selection,e=r.type===Dp.SINGLE,u=!e,s=i.mapped.unmap(n),h=t.data.originalEvent,o=h.ctrlKey,a=h.shiftKey;if(e||r.isEmpty()||!u||!o&&!a)r.clearAndAdd(s);else if(o)r.toggle(s);else if(a){var c=r.last;if(null!=c){var f=i.sorter,l=i.filter,v=f.map(s),b=f.map(c);if(null!=v&&null!=b){var d=b+1,g=v+1;if(v<b&&(d=v,g=b),d<g){var m=[],w=l.indices,p=f.indices;if(w)if(p)for(var O=0,D=w.length;O<D;++O)d<=(E=w[O])&&E<g&&m.push(p[E]);else for(O=0,D=w.length;O<D;++O){var E;d<=(E=w[O])&&E<g&&m.push(E)}else if(p)for(O=d;O<g;++O)m.push(p[O]);else for(O=d;O<g;++O)m.push(O);r.addAll(m)}}}}},i.prototype.onDblClick=function(t,i){return n.prototype.onDblClick.call(this,t,i)},i.prototype.getType=function(){return"DTableBody"},Object.defineProperty(i.prototype,"data",{get:function(){return this.Pt},enumerable:!1,configurable:!0}),i.WORK_ON_CLICK=new t.Point,i}(Qi),Lp=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getType=function(){return"DTableCategoryCell"},n}(gl),yp=function(t){function n(n){var i,r=this;r=t.call(this,n)||this;var e=null!==(i=n.offset)&&void 0!==i?i:0;return r.rn=e,r.transform.position.y=e,r.initCells(n,r.nb,r.tb),r}return B(n,t),n.prototype.onParentMove=function(n,i,r,e){t.prototype.onParentMove.call(this,n,i,r,e),this.transform.position.y=-i+this.rn,this.updateFrozenCellPosition(n)},n.prototype.getContentPositionX=function(){var t=this.parent;return t?t.position.x:0},n.prototype.newCell=function(t,n,i,r){return new Lp(this.toCellOptions(t,n,r))},n.prototype.toCellOptions=function(t,n,i){var r=i.cell;if(r){r.weight=n.weight,r.width=n.width;var e=r.text||{};return r.text=e,e.value=e.value||n.label,r}return{weight:n.weight,width:n.width,text:{value:n.label}}},n.prototype.getType=function(){return"DTableCategory"},n}(Ep),kp=function(t){function n(n){var i=t.call(this)||this;return i.R=0,i.bl=-1,i.eb=!1,i.p=n,i.sf=null,i.sb=null,i}return B(n,t),Object.defineProperty(n.prototype,"id",{get:function(){return this.R},enumerable:!1,configurable:!0}),n.prototype.apply=function(){this.eb=!0,this.R+=1,this.p.update()},n.prototype.unapply=function(){this.eb&&(this.eb=!1,this.R+=1,this.p.update())},n.prototype.isApplied=function(){return this.eb},n.prototype.isFiltered=function(t,n,i){return ot(i)?i(t,n):i.test(t,n)},n.prototype.hasFiltered=function(t,n,i){for(var r=this.p.accessor.toChildren,e=0,u=n.length;e<u;++e){var s=n[e];if(this.isFiltered(s,-1,i))return!0;var h=r(s);if(null!=h&&0<h.length&&this.hasFiltered(t,h,i))return!0}return!1},n.prototype.addAllToFiltered=function(t,n,i,r){for(var e=this.p.accessor.toChildren,u=0,s=n.length;u<s;++u){var h=n[u];i.push(r[0]),r[0]+=1;var o=e(h);null!=o&&0<o.length&&t.isOpened(h)&&this.addAllToFiltered(t,o,i,r)}},n.prototype.newFilteredSub=function(t,n,i,r,e){for(var u=!1,s=this.p.accessor.toChildren,h=0,o=n.length;h<o;++h){var a=n[h],c=e[0];e[0]+=1;var f=this.isFiltered(a,c,i),l=s(a);if(null!=l&&0<l.length)if(t.isOpened(a))if(f)r.push(c),u=!0,this.addAllToFiltered(t,l,r,e);else{var v=r.length;this.newFilteredSub(t,l,i,r,e)&&(r.splice(v,0,c),u=!0)}else(f||this.hasFiltered(t,l,i))&&(r.push(c),u=!0);else f&&(r.push(c),u=!0)}return u},n.prototype.newFiltered=function(){var t=this.sf;if(null!=t){var n=[],i=this.p,r=i.nodes;return r&&this.newFilteredSub(i,r,t,n,[0]),n}return null},n.prototype.get=function(){return this.sf},n.prototype.set=function(t){this.sf!==t&&(this.sf=t)},n.prototype.toDirty=function(){this.R+=1},n.prototype.update=function(){this.R!==this.bl&&(this.bl=this.R,this.eb?(this.sb=this.newFiltered(),this.emit("change",this)):null!=this.sb&&(this.sb=null,this.emit("change",this)))},Object.defineProperty(n.prototype,"indices",{get:function(){return this.update(),this.sb},enumerable:!1,configurable:!0}),n.prototype.map=function(t){var n=t,i=this.indices;if(i){var r=i.indexOf(n);if(!(0<=r))return null;n=r}return n},n.prototype.unmap=function(t){var n=t,i=this.indices;return i&&(n=i[n]),n},n}(t.utils.EventEmitter),xp=function(t){return t.parent},Bp=function(t){return t.children},_p=function(t){var n,i;this.toParent=null!==(n=null==t?void 0:t.toParent)&&void 0!==n?n:xp,this.toChildren=null!==(i=null==t?void 0:t.toChildren)&&void 0!==i?i:Bp},Pp=function(t,n){return t[0]-n[0]},Up=function(t){function n(n,i){var r,e=this;(e=t.call(this)||this).p=n,e.Nt=Di(null!==(r=null==i?void 0:i.type)&&void 0!==r?r:Dp.NONE,Dp),e.ab=new Set;var u=null==i?void 0:i.on;if(u)for(var s in u){var h=u[s];h&&e.on(s,h)}return e}return B(n,t),Object.defineProperty(n.prototype,"parent",{get:function(){return this.p},enumerable:!1,configurable:!0}),n.prototype.onNodeChange=function(t){if(null!=t){var n=this.p.accessor.toChildren,i=this.ab,r=this.newRows(t,n,i,new Set);i.size!==r.size&&(this.ab=r,this.onChange())}else{var e=this.ab;0<e.size&&(e.clear(),this.onChange())}},n.prototype.newRows=function(t,n,i,r){for(var e=0,u=t.length;e<u;++e){var s=t[e];i.has(s)&&r.add(s);var h=n(s);null!=h&&this.newRows(h,n,i,r)}return r},Object.defineProperty(n.prototype,"indices",{get:function(){var t=this.ab,n=[];return this.p.each((function(i,r){t.has(i)&&n.push(r)})),n},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rows",{get:function(){var t=[];return this.ab.forEach((function(n){t.push(n)})),t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"type",{get:function(){return this.Nt},enumerable:!1,configurable:!0}),n.prototype.getFirst=function(){var t=this.ab;if(0<t.size){var n=null;return t.forEach((function(t){null==n&&(n=t)})),n}return null},n.prototype.getLast=function(){var t=this.ab;if(0<t.size){var n=null;return t.forEach((function(t){n=t})),n}return null},n.prototype.toIndex=function(t){var n=null;return this.p.each((function(i,r){return t!==i||(n=r,!1)})),n},Object.defineProperty(n.prototype,"first",{get:function(){var t=this.getFirst();return t?this.toIndex(t):null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"last",{get:function(){var t=this.getLast();return t?this.toIndex(t):null},enumerable:!1,configurable:!0}),n.prototype.onChange=function(){this.p.update(),this.emit("change",this)},n.prototype.toggle=function(t){var n=this.p.get(t);if(n){var i=this.ab;i.has(n)?i.delete(n):i.add(n),this.onChange()}},n.prototype.add=function(t){var n=this.p.get(t);if(n){var i=this.ab;i.has(n)||(i.add(n),this.onChange())}},n.prototype.addTo=function(t){var n=this.last;null!=n&&this.addRange(n,!1,t,!0)},n.prototype.addRange=function(t,n,i,r){var e=this.ab,u=e.size,s=this.p;t<i?s.each((function(t){e.add(t)}),t+(n?0:1),i+(r?1:0)):s.each((function(t){e.add(t)}),i+(r?0:1),t+(n?1:0)),u!==e.size&&this.onChange()},n.prototype.addAll=function(t){if(0<t.length){for(var n=this.ab,i=this.p,r=0,e=t.length;r<e;++r){var u=i.get(t[r]);u&&n.add(u)}this.onChange()}},n.prototype.contains=function(t){var n=this.p.get(t);return!!n&&this.ab.has(n)},n.prototype.remove=function(t){var n=this.p.get(t);if(n){var i=this.ab;i.has(n)&&(i.delete(n),this.onChange())}},n.prototype.clear=function(){var t=this.ab;0<t.size&&(t.clear(),this.onChange())},n.prototype.clearAndAdd=function(t){var n=this.p.get(t);if(n){var i=this.ab;i.has(n)?1<i.size&&(i.clear(),i.add(n),this.onChange()):(i.clear(),i.add(n),this.onChange())}},n.prototype.clearAndAddAll=function(t){var n=this.ab;if(0<n.size||0<t.length){n.clear();for(var i=this.p,r=0,e=t.length;r<e;++r){var u=i.get(t[r]);u&&n.add(u)}this.onChange()}},n.prototype.shift=function(t,n){},n.prototype.size=function(){return this.ab.size},n.prototype.isEmpty=function(){return this.ab.size<=0},n.prototype.each=function(t){var n=this.ab;this.p.each((function(i,r){return!n.has(i)||!1!==t(r)}))},n.prototype.toArray=function(){var t=this.ab,n=[];return this.p.each((function(i,r){t.has(i)&&n.push([r,i])})),n},n.prototype.toSortedArray=function(){return this.toArray().sort(Pp)},n.prototype.toObject=function(){var t=this.ab,n={};return this.p.each((function(i,r){t.has(i)&&(n[r]=i)})),n},n.prototype.toMap=function(){var t=this.ab,n=new Map;return this.p.each((function(i,r){t.has(i)&&n.set(r,i)})),n},n}(t.utils.EventEmitter),Fp=function(t){function n(){return t.call(this)||this}return B(n,t),Object.defineProperty(n.prototype,"id",{get:function(){return 0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"order",{get:function(){return Ip.ASCENDING},set:function(t){},enumerable:!1,configurable:!0}),n.prototype.apply=function(){},n.prototype.unapply=function(){},n.prototype.isApplied=function(){return!1},n.prototype.get=function(){return null},n.prototype.set=function(t){},n.prototype.toDirty=function(){},n.prototype.update=function(){},Object.defineProperty(n.prototype,"indices",{get:function(){return null},enumerable:!1,configurable:!0}),n.prototype.map=function(t){return t},n.prototype.unmap=function(t){return t},n}(t.utils.EventEmitter),Gp=function(n){function i(t){var i=n.call(this)||this;if(i.p=null,i.Uc=i.toAccessor(t),i.zc=new Tp(i),i.ab=[],i.Db=!1,i.Eb=[],i.Mb=new WeakMap,i.$n=!!(null==t?void 0:t.reverse),i.Hc=i.toSelection(null==t?void 0:t.selection),i.sf=new kp(i),i.cb=new Fp,t){var r=t.filter;r&&i.sf.set(r);var e=t.on;if(e)for(var u in e){var s=e[u];s&&i.on(u,s)}}return i.nodes=null==t?void 0:t.nodes,i}return B(i,n),i.prototype.toSelection=function(n){return n instanceof t.utils.EventEmitter?n:ot(n)?n(this):this.newSelection(n)},i.prototype.newSelection=function(t){return new Up(this,t)},i.prototype.toAccessor=function(t){return new _p(t)},i.prototype.bind=function(t){this.p=t},Object.defineProperty(i.prototype,"nodes",{get:function(){return this.Sb},set:function(t){this.Sb=t,this.Db=!0,this.Hc.onNodeChange(t),this.sf.toDirty(),this.update(!0)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"rows",{get:function(){return this.Db&&(this.Db=!1,this.updateRows(this.Sb)),this.ab},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"supplimentals",{get:function(){return this.Eb},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"accessor",{get:function(){return this.Uc},enumerable:!1,configurable:!0}),i.prototype.updateRows=function(t){var n=this.ab,i=this.Eb,r=this.Mb;if(null!=t){var e=this.newRows(t,0,0,n,i,r,this.$n,this.Uc.toChildren);e!==n.length&&(n.length=e,i.length=e)}else n.length=0,i.length=0},i.prototype.toSupplimental=function(t,n,i){return t<<2|(n?2:0)|(i?1:0)},i.prototype.newRows=function(t,n,i,r,e,u,s,h){for(var o=t.length,a=s?-1:1,c=s?o-1:0;0<=c&&c<o;c+=a){var f=t[c],l=h(f),v=u.has(f),b=this.toSupplimental(i,!!(l&&0<l.length),v);n<r.length?(r[n]=f,e[n]=b):(r.push(f),e.push(b)),n+=1,v&&l&&(n=this.newRows(l,n,i+1,r,e,u,s,h))}return n},i.prototype.update=function(t){var n=this.p;n&&n.update(t)},i.prototype.size=function(){return this.rows.length},i.prototype.get=function(t){var n=this.rows;return 0<=t&&t<n.length?n[t]:null},i.prototype.expand=function(t){var n=this.Mb;return!n.has(t)&&(n.set(t,1),this.Db=!0,this.sf.toDirty(),this.update(!0),!0)},i.prototype.collapse=function(t){var n=this.Mb;return!!n.has(t)&&(n.delete(t),this.Db=!0,this.sf.toDirty(),this.update(!0),!0)},i.prototype.isCollapsed=function(t){return!this.Mb.has(t)},i.prototype.isExpanded=function(t){return this.Mb.has(t)},i.prototype.toggle=function(t){return this.isExpanded(t)?this.collapse(t):this.expand(t)},i.prototype.open=function(t){return this.expand(t)},i.prototype.close=function(t){return this.collapse(t)},i.prototype.isOpened=function(t){return this.isExpanded(t)},i.prototype.each=function(t,n,i){var r=this.rows;n=null!=n?Math.max(0,n):0,i=null!=i?Math.min(r.length,i):r.length;for(var e=n;e<i&&!1!==t(r[e],e);++e);},Object.defineProperty(i.prototype,"selection",{get:function(){return this.Hc},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"filter",{get:function(){return this.sf},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"sorter",{get:function(){return this.cb},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"mapped",{get:function(){return this.zc},enumerable:!1,configurable:!0}),i}(t.utils.EventEmitter),Hp=function(){function t(t,n){var i,r,e;this.p=t,this.rs=null!==(i=null==n?void 0:n.enable)&&void 0!==i&&i,this.Tb=null===(r=null==n?void 0:n.filterable)||void 0===r||r,this.jb=null===(e=null==n?void 0:n.emittable)||void 0===e||e}return Object.defineProperty(t.prototype,"isEnabled",{get:function(){return this.rs},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isFilterable",{get:function(){return this.Tb},set:function(t){this.Tb=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isEmittable",{get:function(){return this.jb},set:function(t){this.jb=t},enumerable:!1,configurable:!0}),t.prototype.newIteratee=function(t,n){var i=this.p,r=i.column,e=i.columnIndex;if(null!=r&&null!=e){var u=r.getter,s=r.setter;if(this.jb){var h=t.data;return function(t,i){return u(t,e)!==n&&(s(t,e,n),h.emit("change",n,!n,t,i,e,h),!0)}}return function(t){return u(t,e)!==n&&(s(t,e,n),!0)}}return null},t.prototype.execute=function(t){var n,i=null===(n=this.p.header)||void 0===n?void 0:n.table;if(i){var r=this.newIteratee(i,t);if(r){var e=!1;this.Tb?i.data.mapped.each((function(t,n,i,u){r(t,u)&&(e=!0)})):i.data.each((function(t,n){r(t,n)&&(e=!0)})),e&&i.body.update(!0)}}},t}(),zp=t.interaction.InteractionEvent,Vp=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return B(i,n),i.prototype.init=function(t){null!=t?(this.hh=t.header,this.qv=t.column,this.Zv=t.columnIndex,this.Nb=new Hp(this,t.check)):this.Nb=new Hp(this),n.prototype.init.call(this,t),this.initOnClick(t)},Object.defineProperty(i.prototype,"column",{get:function(){return this.qv},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"columnIndex",{get:function(){return this.Zv},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"header",{get:function(){return this.hh},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"check",{get:function(){return this.Nb},enumerable:!1,configurable:!0}),i.prototype.initOnClick=function(t){var n=this,i=this.qv;if(i){var r=i.sorting.enable,e=this.Nb.isEnabled;if(e||r){this.on(Ki.tap,(function(t){n.onClick(t)}));var u=this.state;u.lock(),u.set(fp.SORTABLE,r),u.set(fp.CHECKABLE,e),u.unlock()}}},Object.defineProperty(i.prototype,"sorter",{get:function(){var t=this,n=this.cb;if(null==n){var i=this.hh;if(!i)return null;var r=i.table;if(!r)return null;n=r.data.sorter,this.cb=n,this.Ib=this.Ib||function(){t.onSorterChange()},n.on("change",this.Ib)}return n},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"comparator",{get:function(){var t=this.qv;return t&&t.sorting.comparator||null},enumerable:!1,configurable:!0}),i.prototype.onSorterChange=function(){var t=this.comparator;if(t){var n=this.cb;if(n){var i=fp.SORTED_ASCENDING,r=fp.SORTED_DESCENDING;n.isApplied()&&n.get()===t?n.order===Ip.ASCENDING?this.state.set(i,r):this.state.set(r,i):this.state.removeAll(i,r)}}},i.prototype.toClickPosition=function(n){var i=this.Cb||new t.Point;return this.Cb=i,n.data.getLocalPosition(this,i).x},i.prototype.isCheckClicked=function(t){if(t instanceof zp&&this.Nb.isEnabled){if(!this.isSortable)return!0;var n=this.Qs[1];if(n&&null!=n.image){var i=this.toClickPosition(t),r=n.bound,e=n.margin.horizontal;return r.left-e<=i&&i<=r.right+e}}return!1},i.prototype.onClick=function(t){this.state.isActionable&&this.activate(t)},i.prototype.activate=function(t){this.onActivate(t)},i.prototype.onActivate=function(t){this.isCheckClicked(t)?(this.onToggleStart(),this.onToggleEnd()):(this.doSort(t),this.emit("active",this))},i.prototype.doSort=function(t){if(this.isSortable){var n=this.comparator;if(n){var i=this.sorter;i&&(i.get()===n?i.order===Ip.ASCENDING?(i.order=Ip.DESCENDING,i.apply()):(i.set(null),i.apply()):(i.set(n),i.order=Ip.ASCENDING,i.apply()))}}},Object.defineProperty(i.prototype,"isSortable",{get:function(){var t=this.qv;return!!t&&t.sorting.enable},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"isToggle",{get:function(){return this.Nb.isEnabled},enumerable:!1,configurable:!0}),i.prototype.toggle=function(){this.state.isActionable&&this.isToggle&&(this.onToggleStart(),this.onToggleEnd())},i.prototype.onToggleStart=function(){this.state.isActive=!this.state.isActive},i.prototype.onToggleEnd=function(){this.state.isActive?(this.Nb.execute(!0),this.emit("active",this)):(this.Nb.execute(!1),this.emit("inactive",this))},i.prototype.onActivateKeyDown=function(t){this.state.isActionable&&(this.isToggle?this.onToggleStart():this.state.isPressed=!0)},i.prototype.onActivateKeyUp=function(t){this.state.isActionable&&(this.isToggle?this.onToggleEnd():(this.state.isPressed&&this.activate(t),this.state.isPressed=!1))},i.prototype.onKeyDown=function(t){return Xi.isActivateKey(t)&&this.onActivateKeyDown(t),n.prototype.onKeyDown.call(this,t)},i.prototype.onKeyUp=function(t){return Xi.isActivateKey(t)&&this.onActivateKeyUp(t),n.prototype.onKeyUp.call(this,t)},i.prototype.getType=function(){return"DTableHeaderCell"},i.prototype.destroy=function(){var t=this.cb,i=this.Ib;t&&i&&t.off("change",i),this.cb=void 0,this.Ib=void 0,n.prototype.destroy.call(this)},i}(gl),Wp=function(t){function n(n){var i,r,e=this;(e=t.call(this,n)||this).Ab=null!==(i=n.table)&&void 0!==i?i:null;var u=null!==(r=n.offset)&&void 0!==r?r:0;return e.rn=u,e.transform.position.y=u,e.initCells(n,e.nb,e.tb),e}return B(n,t),Object.defineProperty(n.prototype,"table",{get:function(){return this.Ab},enumerable:!1,configurable:!0}),n.prototype.onParentMove=function(n,i,r,e){t.prototype.onParentMove.call(this,n,i,r,e),this.transform.position.y=-i+this.rn,this.updateFrozenCellPosition(n)},n.prototype.getContentPositionX=function(){var t=this.parent;return t?t.position.x:0},n.prototype.newCell=function(t,n,i,r){return new Vp(this.toCellOptions(t,n,r))},n.prototype.toCellOptions=function(t,n,i){var r=n.header||i.cell;return null!=r?(void 0===r.weight&&(r.weight=n.weight),void 0===r.width&&(r.width=n.width),void 0===r.text?r.text={value:n.label}:void 0===r.text.value&&(r.text.value=n.label),void 0===r.header&&(r.header=this),void 0===r.column&&(r.column=n),void 0===r.columnIndex&&(r.columnIndex=t),r):{weight:n.weight,width:n.width,text:{value:n.label},header:this,column:n,columnIndex:t}},n.prototype.getType=function(){return"DTableHeader"},n}(Ep),Xp=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.getOffsetVerticalStart=function(t){return.5*t+this.p.body.position.y},n}(Ld),Kp=function(t,n){return t[n]},Yp=function(t,n,i){t[n]=i},Jp=function(){return""},Zp=function(){},qp=function(t){if(null!=t){var n=t.length;if(n<=1){var i=t[0];return function(t){return Object.prototype.hasOwnProperty.call(t,i)}}return function(i){for(var r=0;r<n;++r){var e=t[r];if(!(e in i))return!1;i=i[e]}return!0}}return function(t,n){return n<t.length}},Qp=function(t,n){return at(t)?qp(n):null!=t&&t},$p=function(t,n){var i,r=t.editing,e=t.editable;return r?{enable:Qp(null!==(i=r.enable)&&void 0!==i?i:e,n),formatter:r.formatter,unformatter:r.unformatter,validator:r.validator}:{enable:Qp(e,n)}},tO=function(t,n){return function(i,r){var e=t(i,n),u=t(r,n);return e<u?-1:u<e?1:0}},nO=function(t,n,i){var r=i.sorting,e=i.sortable;return r?r.enable||e?{enable:!0,comparator:r.comparator||tO(t,n)}:{enable:!1}:e?{enable:!0,comparator:tO(t,n)}:{enable:!1}},iO=function(t){return null==t?void 0:t instanceof Qm?t:new Qm(t)},rO=function(t){return null==t?void 0:"open"in t?t:new Vd(t)},eO=function(t){return t.value},uO=function(){},sO=function(t){return t?{getter:t.getter||eO,setter:t.setter||uO,menu:iO(t.menu),multiple:iO(t.multiple),dialog:rO(t.dialog),promise:t.promise}:{getter:eO,setter:uO}},hO=function(t){var n=t.state;return null!=n?at(n)||Rt(n)?{initial:n,modifier:void 0}:{initial:void 0,modifier:n}:{initial:void 0,modifier:void 0}},oO=function(t,n){var i=t.renderable;return at(i)?qp(n):null==i||i},aO=function(t,n){var i,r=n.weight,e=n.width;null!=r?null!=e&&(e=void 0):null==e&&(r=1);var u=Di(null!==(i=n.type)&&void 0!==i?i:tp.TEXT,tp),s=function(t,n){var i=t.align;if(null!=i)return at(i)?Wu[i]:i;switch(n){case tp.TEXT:return Wu.LEFT;case tp.REAL:case tp.INTEGER:return Wu.RIGHT;case tp.BUTTON:case tp.INDEX:case tp.SELECT:case tp.ACTION:case tp.LINK:case tp.CHECK:case tp.CHECK_SINGLE:case tp.COLOR:return Wu.CENTER;default:return Wu.LEFT}}(n,u),h=n.label||"",o=function(t){return null!=t.path?t.path.split("."):null}(n),a=function(t,n,i){var r=t.getter;if(r)return r;switch(n){case tp.ACTION:case tp.LINK:return Jp;default:return null==i?Kp:function(t,n){if(t.length<=1){var i=t[0];return void 0===n?function(t){return t[i]}:function(t){return Object.prototype.hasOwnProperty.call(t,i)?t[i]:n}}return void 0===n?function(n){for(var i=0,r=t.length-1;i<r;++i)n=n[t[i]];return n[t[t.length-1]]}:function(i){for(var r=0,e=t.length-1;r<e;++r)i=i[t[r]];var u=t[t.length-1];return Object.prototype.hasOwnProperty.call(i,u)?i[u]:n}}(i,t.default)}}(n,u,o);return{weight:r,width:e,type:u,label:h,getter:a,setter:function(t,n,i){var r=t.setter;if(r)return r;switch(n){case tp.BUTTON:case tp.ACTION:case tp.LINK:return Zp;default:return null==i?Yp:function(t){if(t.length<=1){var n=t[0];return function(t,i,r){t[n]=r}}return function(n,i,r){for(var e=0,u=t.length-1;e<u;++e)n=n[t[e]]||{};n[t[t.length-1]]=r}}(i)}}(n,u,o),formatter:n.formatter,renderable:oO(n,o),align:s,state:hO(n),editing:$p(n,o),sorting:nO(a,t,n),header:n.header,body:n.body,selecting:sO(n.selecting),category:n.category,frozen:n.frozen,offset:0,link:n.link}},cO=function(t){function n(n){var i=t.call(this,n)||this,r=i.content;r.setWidth(i.toContentWidth(n));var e=i.body;r.addChild(e),e.data.selection.type!==Dp.NONE&&i.on(Ki.tap,(function(t){e.onRowClick(t)}));var u=i.header;u&&r.addChild(u);for(var s=i.categories,h=s.length-1;0<=h;--h)r.addChild(s[h]);return e.update(),i}return B(n,t),Object.defineProperty(n.prototype,"columns",{get:function(){var t=this.nb;if(null==t){var n=this.kn;t=n?function(t){for(var n=[],i=0,r=t.length;i<r;++i)n.push(aO(i,t[i]));return n}(n.columns):[],this.nb=t}return t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"frozen",{get:function(){var t=this.tb;return null==t&&(t=function(t){for(var n=t.length-1;0<=n;--n)if(!0===t[n].frozen)return n+1;return 0}(this.columns),this.tb=t),t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"categories",{get:function(){var t=this.Rb;return null==t&&(t=this.newCategories(this.kn,this.columns,this.frozen),this.Rb=t),t},enumerable:!1,configurable:!0}),n.prototype.initContent=function(n){t.prototype.initContent.call(this,n),n.state.isFocusReverse=!0},n.prototype.onContentChange=function(){t.prototype.onContentChange.call(this),this.body.update()},n.prototype.onResize=function(n,i,r,e){var u=this.scrollbar;u.lock();var s=this.body;s.lock(),t.prototype.onResize.call(this,n,i,r,e),s.update(),s.unlock(!0),u.unlock(!0)},n.prototype.getCategoryCount=function(t){for(var n=0,i=0,r=t.length;i<r;++i){var e=t[i].category;if(null!=e){var u=at(e)?1:e.length;n=Math.max(n,u)}}return n},n.prototype.toCategoryLabel=function(t,n){if(n)if(at(n)){if(0===t)return n}else if(t<n.length)return n[t]},n.prototype.isSameCategory=function(t,n,i){if(null!=n){if(null!=i){if(at(n))return at(i)?0<t||n===i:0<t?i.length<=t:1===i.length&&n===i[0];if(at(i))return 0<t?n.length<=t:1===n.length&&n[0]===i;if(n.length<=t&&i.length<=t)return!0;if(i.length===n.length){for(var r=t,e=n.length;r<e;++r)if(n[r]!==i[r])return!1;return!0}return!1}return at(n)?0<t:n.length<=t}return null==i||(at(i)?0<t:i.length<=t)},n.prototype.toCategoryColumns=function(t,n,i){for(var r=[],e=null,u=null,s=0,h=n.length;s<h;++s){var o=n[s];s!==i&&u&&e&&this.isSameCategory(t,e.category,o.category)?null!=u.weight&&null!=o.weight?u.weight+=o.weight:null!=u.width&&null!=o.width?u.width+=o.width:(e=o,u={label:this.toCategoryLabel(t,o.category),weight:o.weight,width:o.width,offset:0},r.push(u)):(e=o,u={label:this.toCategoryLabel(t,o.category),weight:o.weight,width:o.width,offset:0},r.push(u))}return r},n.prototype.toCategoryOptions=function(t,n,i,r,e){return n?(void 0===n.columns&&(n.columns=this.toCategoryColumns(t,i,r)),null==n.frozen&&(n.frozen=r),null==n.offset&&(n.offset=e),n):{columns:this.toCategoryColumns(t,i,r),frozen:r,offset:e}},n.prototype.newCategories=function(t,n,i){for(var r=[],e=0,u=this.getCategoryCount(n)-1;0<=u;--u){var s=new yp(this.toCategoryOptions(u,null==t?void 0:t.category,n,i,e));r.push(s),e+=s.height}return r},n.prototype.onDblClick=function(n,i){var r=this.body.onDblClick(n,i);return t.prototype.onDblClick.call(this,n,i)||r},n.prototype.newScrollBar=function(t){var n=this;return new Xp(this,t,(function(t){n.onScrollBarUpdate(t)}))},n.prototype.toContentWidth=function(t){var n=0,i=null==t?void 0:t.columns;if(i)for(var r=0,e=i.length;r<e;++r){var u=i[r].width;null!=u&&(n+=u)}return 0<n?function(t){return Math.max(t,n)}:"100%"},n.prototype.getHeaderOffset=function(){var t=this.Lb;return null==t&&(t=this.newHeaderOffset(),this.Lb=t),t},n.prototype.newHeaderOffset=function(){for(var t=0,n=this.categories,i=0,r=n.length;i<r;++i)t+=n[i].height;return t},Object.defineProperty(n.prototype,"header",{get:function(){var t=this.hh;return void 0===t&&(t=this.newHeader(this.kn,this.columns,this.frozen,this.getHeaderOffset()),this.hh=t),t},enumerable:!1,configurable:!0}),n.prototype.hasHeader=function(t){if(t)for(var n=t.columns,i=0,r=n.length;i<r;++i)if(null!=n[i].label)return!0;return!1},n.prototype.newHeader=function(t,n,i,r){return this.hasHeader(t)?new Wp(this.toHeaderOptions(null==t?void 0:t.header,n,i,r)):null},n.prototype.toHeaderOptions=function(t,n,i,r){return t?(void 0===t.columns&&(t.columns=n),null==t.frozen&&(t.frozen=i),void 0===t.offset&&(t.offset=r),void 0===t.table&&(t.table=this),t):{columns:n,frozen:i,offset:r,table:this}},n.prototype.getBodyOffset=function(){var t=this.yb;return null==t&&(t=this.newBodyOffset(),this.yb=t),t},n.prototype.newBodyOffset=function(){var t,n;return this.getHeaderOffset()+(null!==(n=null===(t=this.header)||void 0===t?void 0:t.height)&&void 0!==n?n:0)},Object.defineProperty(n.prototype,"body",{get:function(){var t=this.pe;return null==t&&(t=this.newBody(this.kn,this.columns,this.frozen,this.getBodyOffset()),this.pe=t),t},enumerable:!1,configurable:!0}),n.prototype.newBody=function(t,n,i,r){return new Rp(this.toBodyOptions(null==t?void 0:t.body,n,i,r,null==t?void 0:t.data))},n.prototype.toBodyOptions=function(t,n,i,r,e){return null!=t?(void 0===t.columns&&(t.columns=n),null==t.frozen&&(t.frozen=i),void 0===t.offset&&(t.offset=r),void 0===t.data&&void 0!==e&&(Rt(e)?t.data={rows:e}:t.data=e),void 0===t.height&&void 0===t.weight&&(t.weight=1),t):Rt(e)?{columns:n,frozen:i,offset:r,data:{rows:e},weight:1}:{columns:n,frozen:i,offset:r,data:e,weight:1}},Object.defineProperty(n.prototype,"data",{get:function(){return this.body.data},enumerable:!1,configurable:!0}),n.prototype.getFocusedChildClippingRect=function(n,i,r,e,u,s,h,o){t.prototype.getFocusedChildClippingRect.call(this,n,i,r,e,u,s,h,o);var a=this.toCell(n);if(a){var c=i+this.toFrozenCellX(a)-o.x;if(0<c&&(o.x+=c,o.width-=c),a.parent.parent===this.body){var f=this.getBodyOffset();o.y+=f,o.height-=f}}return o},n.prototype.toFrozenCellX=function(t){var n=this.frozen;if(0<n){var i=t.parent.children,r=i.indexOf(t);if(0<=r){var e=i.length;if(n<=e-1-r){var u=i[e-n];return u.position.x+u.width}}}return 0},n.prototype.onKeyDown=function(n){Xi.moveFocusHorizontally(n,this);var i=Xi.isArrowUpKey(n),r=Xi.isArrowDownKey(n);return(i||r)&&this.onKeyDownArrowUpOrDown(n,r),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyDownArrowUpOrDown=function(t,n){var i=rt.getLayer(this);if(null==i)return!1;var r=i.getFocusController(),e=r.get();if(null==e)return!1;var u=this.toCell(e);if(null==u)return!1;var s=u.parent;if(null==s)return!1;var h=r.find(s,!1,!1,n,this);if(null==h)return!1;var o=this.toCell(h);if(null==o)return!1;var a=o.parent;if(null==a)return!1;var c=s.children.indexOf(u);if(c<0)return!1;var f=a.children[c];if(null==f||f===u||!("state"in f))return!1;var l=r.find(f,!0,!0,n,this);return null!=l&&(r.focus(l),!0)},n.prototype.toCell=function(t){for(var n=t;null!=n;){var i=n.parent;if(i instanceof Ep)return n instanceof Qi?n:null;n=i}return null},n.prototype.getType=function(){return"DTable"},n}(yd),fO=function(t){var n=t.text;if(at(n))return n;var i=t.label;if(at(i))return i;var r=t.name;return at(r)?r:void 0},lO=function(t){var n=t.title;if(at(n))return n},vO=function(t){return t.image},bO=function(t){return t.children},dO=function(t){return t.children=[]},gO=function(t){var n,i,r,e,u;this.toLabel=null!==(n=null==t?void 0:t.toLabel)&&void 0!==n?n:fO,this.toTitle=null!==(i=null==t?void 0:t.toTitle)&&void 0!==i?i:lO,this.toImage=null!==(r=null==t?void 0:t.toImage)&&void 0!==r?r:vO,this.toChildren=null!==(e=null==t?void 0:t.toChildren)&&void 0!==e?e:bO,this.newChildren=null!==(u=null==t?void 0:t.newChildren)&&void 0!==u?u:dO},mO={NONE:0,SINGLE:1,MULTIPLE:2},wO=function(){function t(t,n){this.p=t,this.Sb=[],this.kb=[],this.$n=n,this.vn=!1}return Object.defineProperty(t.prototype,"nodes",{get:function(){return this.update(),this.Sb},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"levels",{get:function(){return this.update(),this.kb},enumerable:!1,configurable:!0}),t.prototype.toDirty=function(){this.vn=!0},t.prototype.size=function(){return this.update(),this.Sb.length},t.prototype.each=function(t,n,i){this.update();for(var r=this.Sb,e=null!=n?Math.max(0,n):0,u=null!=i?Math.min(r.length,i):r.length,s=e;s<u&&!1!==t(r[s],s);++s);},t.prototype.update=function(){if(this.vn){this.vn=!1;var t=this.p,n=t.nodes,i=t.accessor.toChildren,r=this.Sb,e=this.kb,u=this.newNodes(t,n,0,0,r,e,this.$n,i);r.length!==u&&(r.length=u,e.length=u)}},t.prototype.newNodes=function(t,n,i,r,e,u,s,h){for(var o=n.length,a=s?-1:1,c=s?o-1:0;0<=c&&c<o;c+=a){var f=n[c];i<e.length?(e[i]=f,u[i]=r):(e.push(f),u.push(r)),i+=1;var l=h(f);l&&t.isExpanded(f)&&(i=this.newNodes(t,l,i,r+1,e,u,s,h))}return i},t}(),pO=function(t){function n(n,i){var r=t.call(this)||this;r.p=n,r.Sb=new Set;var e=null==i?void 0:i.on;if(e)for(var u in e){var s=e[u];s&&r.on(u,s)}return r}return B(n,t),Object.defineProperty(n.prototype,"type",{get:function(){return mO.MULTIPLE},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"first",{get:function(){var t=this.Sb;if(0<t.size){var n=null;return t.forEach((function(t){null==n&&(n=t)})),n}return null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"last",{get:function(){var t=this.Sb;if(0<t.size){var n=null;return t.forEach((function(t){n=t})),n}return null},enumerable:!1,configurable:!0}),n.prototype.get=function(t){var n=this.Sb;if(0<=t&&t<n.size){var i=0,r=null;return n.forEach((function(n){i===t&&(r=n),i+=1})),r}return null},n.prototype.add=function(t){var n=this.Sb;return!n.has(t)&&(n.add(t),this.onChange(),!0)},n.prototype.remove=function(t){var n=this.Sb;return!!n.has(t)&&(n.delete(t),this.onChange(),!0)},n.prototype.toggle=function(t){var n=this.Sb;return n.has(t)?n.delete(t):n.add(t),this.onChange(),!0},n.prototype.clear=function(){var t=this.Sb;return 0<t.size&&(t.clear(),this.onChange(),!0)},n.prototype.clearAndAdd=function(t){var n=this.Sb;return 1===n.size?!n.has(t)&&(n.clear(),n.add(t),this.onChange(),!0):(n.clear(),n.add(t),this.onChange(),!0)},n.prototype.clearAndAddAll=function(t){for(var n=!1,i=new Set,r=this.Sb,e=0,u=t.length;e<u;++e){var s=t[e];r.has(s)||(n=!0),i.add(s)}return n||r.forEach((function(t){i.has(t)||(n=!0)})),n&&(this.Sb=i,this.onChange()),n},n.prototype.contains=function(t){return this.Sb.has(t)},n.prototype.size=function(){return this.Sb.size},n.prototype.isEmpty=function(){return this.Sb.size<=0},n.prototype.each=function(t){var n=!1;this.Sb.forEach((function(i){n||!1===t(i)&&(n=!0)}))},n.prototype.toArray=function(){var t=[];return this.Sb.forEach((function(n){t.push(n)})),t},n.prototype.onChange=function(){this.p.update(),this.emit("change",this)},n.prototype.onNodeChange=function(t){var n=this.Sb;if(0<n.size){var i=this.newNodes(t,n,new Set);n.size!==i.size&&(this.Sb=i,this.onChange())}},n.prototype.newNodes=function(t,n,i){for(var r=this.p.accessor.toChildren,e=0,u=t.length;e<u;++e){var s=t[e];n.has(s)&&i.add(s);var h=r(s);h&&this.newNodes(h,n,i)}return i},n}(t.utils.EventEmitter),OO=function(t){function n(n,i){var r=t.call(this)||this;r.p=n,r.jn=null;var e=null==i?void 0:i.on;if(e)for(var u in e){var s=e[u];s&&r.on(u,s)}return r}return B(n,t),Object.defineProperty(n.prototype,"type",{get:function(){return mO.SINGLE},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"first",{get:function(){return this.jn},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"last",{get:function(){return this.jn},enumerable:!1,configurable:!0}),n.prototype.get=function(t){return 0===t?this.jn:null},n.prototype.add=function(t){return this.jn!==t&&(this.jn=t,this.onChange(),!0)},n.prototype.remove=function(t){return this.jn===t&&(this.jn=null,this.onChange(),!0)},n.prototype.toggle=function(t){return this.jn===t?this.jn=null:this.jn=t,this.onChange(),!0},n.prototype.clear=function(){return null!=this.jn&&(this.jn=null,this.onChange(),!0)},n.prototype.clearAndAdd=function(t){return this.jn!==t&&(this.jn=t,this.onChange(),!0)},n.prototype.clearAndAddAll=function(t){if(0<t.length){var n=t[t.length-1];return this.clearAndAdd(n)}return this.clear()},n.prototype.contains=function(t){return this.jn===t},n.prototype.size=function(){return null!=this.jn?1:0},n.prototype.isEmpty=function(){return null==this.jn},n.prototype.each=function(t){var n=this.jn;null!=n&&t(n)},n.prototype.toArray=function(){var t=this.jn;return null!=t?[t]:[]},n.prototype.onChange=function(){this.p.update(),this.emit("change",this)},n.prototype.onNodeChange=function(t){var n=this.jn;if(null!=n){var i=this.newNode(t,n);n!==i&&(this.jn=i,this.onChange())}},n.prototype.newNode=function(t,n){for(var i=this.p.accessor.toChildren,r=0,e=t.length;r<e;++r){var u=t[r];if(n===u)return u;var s=i(u);if(s){var h=this.newNode(s,n);if(null!=h)return h}}return null},n}(t.utils.EventEmitter),DO=function(t){function n(n,i){var r=t.call(this)||this;r.p=n;var e=null==i?void 0:i.on;if(e)for(var u in e){var s=e[u];s&&r.on(u,s)}return r}return B(n,t),Object.defineProperty(n.prototype,"type",{get:function(){return mO.NONE},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"first",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"last",{get:function(){return null},enumerable:!1,configurable:!0}),n.prototype.get=function(t){return null},n.prototype.add=function(t){return!1},n.prototype.remove=function(t){return!1},n.prototype.toggle=function(t){return!1},n.prototype.clear=function(){return!1},n.prototype.clearAndAdd=function(t){return!1},n.prototype.clearAndAddAll=function(t){return!1},n.prototype.contains=function(t){return!1},n.prototype.size=function(){return 0},n.prototype.isEmpty=function(){return!0},n.prototype.each=function(t){},n.prototype.toArray=function(){return[]},n.prototype.onNodeChange=function(t){},n}(t.utils.EventEmitter),EO=function(){function t(t,n){this.p=t,this.xb=new WeakMap,this.Hc=this.toSelection(n),this.Uc=new gO(n);var i=new wO(this,!!(null==n?void 0:n.reverse));this.zc=i;var r=null==n?void 0:n.nodes;null!=r?(this.Sb=r,i.toDirty()):this.Sb=[]}return t.prototype.toSelection=function(t){var n=null==t?void 0:t.selection;switch(null==n?void 0:n.type){case mO.NONE:case"NONE":return new DO(this,n);case mO.MULTIPLE:case"MULTIPLE":return new pO(this,n);default:return new OO(this,n)}},Object.defineProperty(t.prototype,"nodes",{get:function(){return this.Sb},set:function(t){this.Sb=t,this.update(!0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mapped",{get:function(){return this.zc},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"accessor",{get:function(){return this.Uc},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selection",{get:function(){return this.Hc},enumerable:!1,configurable:!0}),t.prototype.update=function(t){t&&(this.zc.toDirty(),this.Hc.onNodeChange(this.Sb)),this.p.update(t)},t.prototype.toggle=function(t){var n=this.xb;return n.has(t)?n.delete(t):n.set(t,1),this.zc.toDirty(),this.update(),!0},t.prototype.expand=function(t){var n=this.xb;return!n.has(t)&&(n.set(t,1),this.zc.toDirty(),this.update(),!0)},t.prototype.collapse=function(t){var n=this.xb;return!!n.has(t)&&(n.delete(t),this.zc.toDirty(),this.update(),!0)},t.prototype.expandAll=function(){var t=!1,n=this.xb;return this.each((function(i){n.has(i)||(n.set(i,1),t=!0)})),!!t&&(this.zc.toDirty(),this.update(),!0)},t.prototype.collapseAll=function(){var t=!1,n=this.xb;return this.each((function(i){n.has(i)&&(n.delete(i),t=!0)})),!!t&&(this.zc.toDirty(),this.update(),!0)},t.prototype.isCollapsed=function(t){return!this.isExpanded(t)},t.prototype.isExpanded=function(t){return this.xb.has(t)},t.prototype.clear=function(){var t=this.Sb;return 0<t.length&&(t.length=0,this.zc.toDirty(),this.Hc.clear(),this.update(),!0)},t.prototype.remove=function(t){var n=!1;return this.each((function(i,r,e){return i!==t||(e.splice(r,1),n=!0,!1)})),!!n&&(this.zc.toDirty(),this.Hc.remove(t),this.update(),!0)},t.prototype.add=function(t,n){var i=!1;if(n){var r=this.Uc,e=r.toChildren(n);if(e)e.push(t),i=!0;else{var u=r.newChildren(n);u&&(u.push(t),i=!0)}}else{var s=this.Sb;s?s.push(t):this.Sb=[t],i=!0}return i&&(this.zc.toDirty(),this.update()),!0},t.prototype.addBefore=function(t,n){var i=!1;return this.each((function(r,e,u){return r!==n||(u.splice(e,0,t),i=!0,!1)})),i&&(this.zc.toDirty(),this.update()),i},t.prototype.addAfter=function(t,n){var i=!1;return this.each((function(r,e,u){return r!==n||(u.splice(e+1,0,t),i=!0,!1)})),i&&(this.zc.toDirty(),this.update()),i},t.prototype.each=function(t){var n=this.Sb;n&&this.Pc(n,null,t)},t.prototype.Pc=function(t,n,i){for(var r=this.Uc.toChildren,e=0,u=t.length;e<u;++e){var s=t[e];if(!1===i(s,e,t,n))return;var h=r(s);h&&this.Pc(h,s,i)}},t}(),MO={HAS_CHILDREN:"HAS_CHILDREN",OPENED:"OPENED"},SO=function(t){function n(n,i){var r=t.call(this,i)||this;return r.zn=new Ib(r.zn),r.Pt=n,r}return B(n,t),Object.defineProperty(n.prototype,"node",{get:function(){return this.jn},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"value",{get:function(){return this.jn},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"index",{get:function(){return this.Qe},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"data",{get:function(){return this.Pt},enumerable:!1,configurable:!0}),n.prototype.toggle=function(){var t=this.jn;void 0!==t&&this.Pt.toggle(t)},n.prototype.set=function(t,n,i){var r,e=this.Pt,u=i||this.jn!==t;if(u){this.jn=t,this.Qe=n;var s=e.accessor;this.text=s.toLabel(t),this.title=null!==(r=s.toTitle(t))&&void 0!==r?r:"",this.image=s.toImage(t)}var h=e.mapped.levels[n];this.zn.adjLeft(this.theme.getLevelPadding(h));var o=e.accessor.toChildren(t),a=!!(o&&0<o.length),c=this.state;c.lock(),c.set(ht.ACTIVE,e.selection.contains(t)),c.remove(ht.DISABLED),c.set(MO.HAS_CHILDREN,a),c.set(MO.OPENED,e.isExpanded(t)),c.unlock(),u&&this.emit("set",t,n,this)},n.prototype.unset=function(){if(void 0!==this.jn){this.jn=void 0,this.Qe=void 0,this.text=void 0,this.title="",this.image=void 0;var t=this.state;t.lock(),t.add(ht.DISABLED),t.remove(ht.ACTIVE),t.unlock(),this.emit("unset",this)}},n.prototype.onSelect=function(t,n){var i=this.Pt,r=i.selection;if(r.type!==mO.MULTIPLE)r.clearAndAdd(n);else{var e=t&&"data"in t?t.data.originalEvent:t;if(null==e?void 0:e.ctrlKey)r.toggle(n);else if(null==e?void 0:e.shiftKey){var u=i.mapped,s=r.last;if(n===s)r.clearAndAdd(n);else{var h=!1,o=!1,a=[];u.each((function(t){if(h){if(o){if(a.unshift(t),t===n)return!1}else if(a.push(t),t===s)return!1}else t===n?(h=!0,o=!1,a.push(t)):t===s&&(h=!0,o=!0,a.push(t))})),r.clearAndAddAll(a)}}else r.clearAndAdd(n)}},n.prototype.onKeyDown=function(n){var i;return Xi.isActivateKey(n)&&this.onKeyDownActivate(n),Xi.isArrowRightKey(n)&&void 0!==(i=this.jn)&&this.state.is(MO.HAS_CHILDREN)&&this.Pt.expand(i),Xi.isArrowLeftKey(n)&&void 0!==(i=this.jn)&&this.state.is(MO.HAS_CHILDREN)&&this.Pt.collapse(i),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyDownActivate=function(t){if(this.state.isActionable&&this.state.isFocused){var n=this.jn;return void 0!==n&&this.onSelect(t,n),!0}return!1},n.prototype.getType=function(){return"DTreeItemText"},n}(bs),TO=function(t){function n(n,i){var r,e=this;return(e=t.call(this,n,i)||this).th=Di(null!==(r=null==i?void 0:i.when)&&void 0!==r?r:Hu.CLICKED,Hu),e.on(Ki.tap,(function(t){e.onClick(t)})),e}return B(n,t),n.prototype.onClick=function(t){this.th===Hu.CLICKED&&this.state.isActionable&&this.activate(t)},n.prototype.onDblClick=function(n,i){return this.th===Hu.DOUBLE_CLICKED&&this.activate(n),t.prototype.onDblClick.call(this,n,i)},n.prototype.activate=function(t){this.onActivate(t)},n.prototype.onActivate=function(t){this.emit("active",this)},n.prototype.onActivateKeyDown=function(t){this.state.isActionable&&(this.state.isPressed=!0)},n.prototype.onActivateKeyUp=function(t){this.state.isActionable&&(this.state.isPressed&&this.activate(t),this.state.isPressed=!1)},n.prototype.onKeyDown=function(n){return Xi.isActivateKey(n)&&this.onActivateKeyDown(n),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyUp=function(n){return Xi.isActivateKey(n)&&this.onActivateKeyUp(n),t.prototype.onKeyUp.call(this,n)},n.prototype.getType=function(){return"DTreeItemButton"},n}(SO),jO=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.onActivate=function(i){t.prototype.onActivate.call(this,i);var r=this.jn;void 0!==r&&(this.state.is(MO.HAS_CHILDREN)?i&&"data"in i&&(this.toLocal(i.data.global,void 0,n.WORK_CONTAINS_POINT).x<=this.padding.getLeft()?this.toggle():this.onSelect(i,r)):this.onSelect(i,r))},n.prototype.getType=function(){return"DTreeItemNonEditable"},n}(TO),NO=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return B(n,t),n.prototype.toMapped=function(t){return t.mapped},n.prototype.newItem=function(t){return new jO(t)},n}(fd),IO=function(t){function n(n){var i=t.call(this,n)||this;return i.update(),i}return B(n,t),n.prototype.onContentChange=function(){t.prototype.onContentChange.call(this),this.update()},n.prototype.onResize=function(n,i,r,e){var u=this.updater;u.lock(),t.prototype.onResize.call(this,n,i,r,e),u.update(),u.unlock(!0)},Object.defineProperty(n.prototype,"updater",{get:function(){var t=this.rf;return null==t&&(t=this.newUpdater(this.data,this.content,this.kn),this.rf=t),t},enumerable:!1,configurable:!0}),n.prototype.newUpdater=function(t,n,i){return new NO(t,n,n,null==i?void 0:i.updater)},Object.defineProperty(n.prototype,"data",{get:function(){var t=this.Pt;return null==t&&(t=this.toData(this.kn),this.Pt=t),t},enumerable:!1,configurable:!0}),n.prototype.toData=function(t){var n=t&&(t.data||t.nodes||t.value)||[];return Rt(n)?new EO(this,{nodes:n}):"add"in n?n:new EO(this,n)},n.prototype.update=function(t){this.updater.update(t)},n.prototype.lock=function(){this.updater.lock()},n.prototype.unlock=function(t){this.updater.unlock(t)},Object.defineProperty(n.prototype,"selection",{get:function(){return this.data.selection},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"value",{get:function(){return this.data.nodes},set:function(t){this.data.nodes=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"nodes",{get:function(){return this.data.nodes},set:function(t){this.data.nodes=t},enumerable:!1,configurable:!0}),n.prototype.toggle=function(t){return this.data.toggle(t)},n.prototype.expand=function(t){return this.data.expand(t)},n.prototype.collapse=function(t){return this.data.collapse(t)},n.prototype.expandAll=function(){return this.data.expandAll()},n.prototype.collapseAll=function(){return this.data.collapseAll()},n.prototype.isCollapsed=function(t){return this.data.isCollapsed(t)},n.prototype.isExpanded=function(t){return this.data.isExpanded(t)},n.prototype.clear=function(){return this.data.clear()},n.prototype.remove=function(t){return this.data.remove(t)},n.prototype.add=function(t,n){return this.data.add(t,n)},n.prototype.addBefore=function(t,n){return this.data.addBefore(t,n)},n.prototype.addAfter=function(t,n){return this.data.addAfter(t,n)},n.prototype.each=function(t){return this.data.each(t)},n.prototype.onKeyDown=function(n){return this.updater.moveFocus(n,this,!0,!1),t.prototype.onKeyDown.call(this,n)},n.prototype.getType=function(){return"DTree"},n}(yd),CO={__proto__:null,loadAll:pv,loadMenuItemAll:wv,loadMenuItemExpandable:$l,loadMenuItem:Hl,loadMenuSidedItemExpandable:mv,loadMenuSidedItem:hv,deserializeActionValue:eo,EShapeActionBases:tn,EShapeActionEnvironment:nn,EShapeActionExpressions:rn,EShapeActionOpenDialogExtensions:Dh,EShapeActionOpenExtensions:Sh,EShapeActionOpenOpeners:Fe,EShapeActionRuntimeBase:en,EShapeActionRuntimeBlinkBrighten:hn,EShapeActionRuntimeBlinkColorFill:on,EShapeActionRuntimeBlinkColorStroke:an,EShapeActionRuntimeBlinkDarken:cn,EShapeActionRuntimeBlinkOpacity:fn,EShapeActionRuntimeBlinkVisibility:ln,EShapeActionRuntimeBlink:sn,EShapeActionRuntimeChangeColorBrightness:In,EShapeActionRuntimeChangeColorCode:An,EShapeActionRuntimeChangeColor:Mn,EShapeActionRuntimeChangeCursor:Ln,EShapeActionRuntimeChangeTextNumber:di,EShapeActionRuntimeChangeTextText:gi,EShapeActionRuntimeConditional:un,EShapeActionRuntimeEmitEvent:He,EShapeActionRuntimeGestureLayer:Ae,EShapeActionRuntimeGestureShape:Le,EShapeActionRuntimeMiscEmitEvent:Ve,EShapeActionRuntimeMiscExecute:Du,EShapeActionRuntimeMiscHtmlElement:ru,EShapeActionRuntimeMiscInputInput:cu,EShapeActionRuntimeMiscInputInteger:lu,EShapeActionRuntimeMiscInputNumber:fu,EShapeActionRuntimeMiscInputReal:vu,EShapeActionRuntimeMiscInputText:du,EShapeActionRuntimeMiscInput:au,EShapeActionRuntimeMiscWriteBoth:mu,EShapeActionRuntimeMiscWriteLocal:wu,EShapeActionRuntimeMiscWriteRemote:pu,EShapeActionRuntimeMiscWrite:gu,EShapeActionRuntimeOpenDialogBoolean:Ls,EShapeActionRuntimeOpenDialogDate:wh,EShapeActionRuntimeOpenDialogDatetime:lh,EShapeActionRuntimeOpenDialogExtension:Eh,EShapeActionRuntimeOpenDialogInteger:Us,EShapeActionRuntimeOpenDialogReal:Hs,EShapeActionRuntimeOpenDialogText:Ws,EShapeActionRuntimeOpenDialogTime:dh,EShapeActionRuntimeOpenDialog:Rs,EShapeActionRuntimeOpen:Mu,EShapeActionRuntimeShowHideLayer:Ch,EShapeActionRuntimeShowHideShape:Rh,EShapeActionRuntimeShowHide:Nh,EShapeActionRuntimeTransformMoveAbsoluteX:kh,EShapeActionRuntimeTransformMoveAbsoluteY:xh,EShapeActionRuntimeTransformMoveForwardOrBackward:Bh,EShapeActionRuntimeTransformMoveLeftOrRight:_h,EShapeActionRuntimeTransformMoveRelativeX:Ph,EShapeActionRuntimeTransformMoveRelativeY:Uh,EShapeActionRuntimeTransformMove:yh,EShapeActionRuntimeTransformResizeHeightAbsolute:Xh,EShapeActionRuntimeTransformResizeHeightRelative:Kh,EShapeActionRuntimeTransformResizeSizeAbsolute:Yh,EShapeActionRuntimeTransformResizeSizeRelative:Jh,EShapeActionRuntimeTransformResizeWidthAbsolute:Zh,EShapeActionRuntimeTransformResizeWidthRelative:qh,EShapeActionRuntimeTransformResize:Wh,EShapeActionRuntimeTransformRotateAbsolute:to,EShapeActionRuntimeTransformRotateRelative:no,EShapeActionRuntimeTransformRotate:$h,EShapeActionRuntimes:Ov,EShapeActionValueBase:bn,EShapeActionValueBlinkType:vn,EShapeActionValueBlink:pn,EShapeActionValueChangeColorBrightness:Cn,EShapeActionValueChangeColorCode:Rn,EShapeActionValueChangeColorTarget:En,EShapeActionValueChangeColorTypeLegacy:Tn,EShapeActionValueChangeColorType:Sn,EShapeActionValueChangeColorTypes:jn,EShapeActionValueChangeColor:Nn,EShapeActionValueChangeCursor:yn,EShapeActionValueChangeTextType:mi,EShapeActionValueChangeText:wi,EShapeActionValueDeserializers:uo,EShapeActionValueEmitEvent:ze,EShapeActionValueGestureOperationType:Ie,EShapeActionValueGestureType:ye,EShapeActionValueGesture:xe,EShapeActionValueMiscEmitEvent:Dv,EShapeActionValueMiscExecute:Eu,EShapeActionValueMiscHtmlElement:Ev,EShapeActionValueMiscInput:Mv,EShapeActionValueMiscType:ke,EShapeActionValueMiscWrite:Sv,EShapeActionValueMisc:Ou,EShapeActionValueOnInputAction:hu,EShapeActionValueOnInputActions:ou,EShapeActionValueOpenDialogExtension:Mh,EShapeActionValueOpenDialogType:ph,EShapeActionValueOpenDialog:Oh,EShapeActionValueOpenExtension:Th,EShapeActionValueOpenType:Su,EShapeActionValueOpen:Tu,EShapeActionValueOpetyped:Fh,EShapeActionValueShowHideLayer:Ah,EShapeActionValueShowHideShape:Lh,EShapeActionValueShowHideType:jh,EShapeActionValueShowHide:Ih,EShapeActionValueSubtyped:dn,EShapeActionValueTransformMoveType:Gh,EShapeActionValueTransformMove:zh,EShapeActionValueTransformResizeType:Vh,EShapeActionValueTransformResize:Qh,EShapeActionValueTransformRotateType:io,EShapeActionValueTransformRotate:ro,EShapeActionValueTransformType:Hh,EShapeActionValueType:gn,EShapeActionValues:wn,EShapeAction:et,EShapeActions:Ge,loadShapeAll:dl,loadShapeBar:lo,loadShapeButton:ko,loadShapeCircle:Xo,loadShapeClipperEx:function(){tu=!0},isShapeClipperExLoaded:nu,loadShapeConnectorElbow:Ka,loadShapeConnectorLine:Ya,loadShapeEmbedded:nc,loadShapeGroupShadowed:fc,loadShapeGroup:hc,loadShapeImage:gc,loadShapeLabel:Lc,loadShapeLineOfCircles:sf,loadShapeLineOfRectangleRoundeds:ff,loadShapeLineOfRectangles:gf,loadShapeLineOfTriangleRoundeds:Lf,loadShapeLineOfTriangles:Pf,loadShapeLine:xc,loadShapeNull:Hf,loadShapeRectangleRounded:Kf,loadShapeRectangle:Vf,loadShapeSemicircle:sl,loadShapeTriangleRounded:bl,loadShapeTriangle:cl,BAR_VERTEX_COUNT:4,BAR_INDEX_COUNT:2,buildBarClipping:c,buildBarIndex:f,buildBarVertexStepAndColorFill:l,buildBarUv:v,CIRCLE_VERTEX_COUNT:9,CIRCLE_INDEX_COUNT:8,CIRCLE_WORLD_SIZE:xo,buildCircleClipping:_o,buildCircleIndex:Po,buildCircleVertex:Uo,buildCircleStep:Fo,buildCircleUv:Go,buildColor:G,IMAGE_SDF_VERTEX_COUNT:9,IMAGE_SDF_INDEX_COUNT:8,IMAGE_SDF_WORLD_SIZE:mc,buildImageSdfClipping:pc,buildImageSdfIndex:Oc,buildImageSdfStep:Dc,buildImageSdfVertex:Ec,buildImageSdfUv:Mc,toLineOfAnyPointCount:Fc,buildLineOfAnyColor:Gc,toPointsCount:Yo,toLinePointCount:Jo,toLineVertexCount:Zo,toLineIndexCount:qo,buildLineClipping:Qo,buildLineIndex:$o,buildLineUv:ta,buildLineVertexStepAndColorFill:na,buildNullClipping:Bc,buildNullIndex:function(t,n,i,r){for(var e=3*i,u=3*(i+r);e<u;e+=3)t[e+0]=n,t[e+1]=n,t[e+2]=n},buildNullVertex:_c,buildNullStep:Pc,buildNullUv:Uc,RECTANGLE_ROUNDED_VERTEX_COUNT:bo,RECTANGLE_ROUNDED_INDEX_COUNT:24,RECTANGLE_ROUNDED_WORLD_SIZE:go,buildRectangleRoundedIndex:wo,buildRectangleRoundedVertex:po,buildRectangleRoundedClipping:Oo,buildRectangleRoundedStep:Do,buildRectangleRoundedUv:Eo,RECTANGLE_VERTEX_COUNT:Ma,RECTANGLE_INDEX_COUNT:Sa,RECTANGLE_WORLD_SIZE:Ta,buildRectangleClipping:Na,buildRectangleIndex:Ia,buildRectangleVertex:Ca,buildRectangleStep:Aa,buildRectangleUv:La,SEMICIRCLE_VERTEX_COUNT:6,SEMICIRCLE_INDEX_COUNT:4,SEMICIRCLE_WORLD_SIZE:Yf,buildSemicircleClipping:Zf,buildSemicircleIndex:qf,buildSemicircleVertex:Qf,buildSemicircleStep:$f,buildSemicircleUv:tl,TEXT_VERTEX_COUNT:4,TEXT_INDEX_COUNT:2,TEXT_FMIN:D,toTextBufferCount:M,buildTextClipping:S,buildTextIndex:T,buildTextStep:j,buildTextVertex:I,TRIANGLE_ROUNDED_VERTEX_COUNT:mf,TRIANGLE_ROUNDED_INDEX_COUNT:15,TRIANGLE_ROUNDED_WORLD_SIZE:wf,buildTriangleRoundedIndex:Of,buildTriangleRoundedVertex:Df,buildTriangleRoundedClipping:Ef,buildTriangleRoundedStep:Mf,buildTriangleRoundedUv:Sf,TRIANGLE_VERTEX_COUNT:7,TRIANGLE_INDEX_COUNT:3,TRIANGLE_WORLD_SIZE:oa,buildTriangleClipping:ca,buildTriangleIndex:fa,buildTriangleVertex:la,buildTriangleStep:va,buildTriangleUv:ba,BuilderBar:Yt,BuilderBase:H,BuilderCircle:Ho,BuilderImageSdf:Sc,BuilderLabel:Ic,BuilderLineOfAny:Hc,BuilderLineOfCircles:tf,BuilderLineOfRectangleRoundeds:hf,BuilderLineOfRectangles:lf,BuilderLineOfTriangleRoundeds:Tf,BuilderLineOfTriangles:yf,BuilderLine:ha,BuilderMarkerCircleHead:Oa,BuilderMarkerCircleTail:Da,BuilderMarkerCircle:pa,BuilderMarkerRectangleHead:xa,BuilderMarkerRectangleTail:ka,BuilderMarkerRectangle:ya,BuilderMarkerTriangleHead:ma,BuilderMarkerTriangleTail:wa,BuilderMarkerTriangle:ga,BuilderNull:Ea,BuilderRectanglePivoted:Ja,BuilderRectangleRounded:Mo,BuilderRectangle:lc,BuilderSemicircle:nl,BuilderText:Jt,BuilderTriangleRounded:fl,BuilderTriangle:hl,toTransformLocalId:z,toTexture:V,toTextureTransformId:W,toTextureUvs:X,copyClipping:zc,copyIndex:Vc,copyStep:Wc,copyUvs:Xc,copyVertex:Kc,createBarUploaded:Zt,createButtonUploaded:To,createCircleUploaded:zo,createRectanglePivotedUploaded:Za,createGroupUploaded:qa,createImageSdfUploaded:Tc,createImageSdf:Tv,createImage:function(t){return ao(t).then((function(t){return new bc(t)}))},createLabelUploaded:Cc,createLineOfAnyUploaded:nf,createLineOfCirclesUploaded:rf,createLineOfRectangleRoundedsUploaded:of,createLineOfRectanglesUploaded:vf,createLineOfTriangleRoundedsUploaded:jf,createLineOfTrianglesUploaded:kf,createLineUploaded:Fa,createLine:function(t,n,i,r){for(var e=Zr(t,[0,0,0,0]),u=.5*(e[2]+e[0]),s=.5*(e[3]+e[1]),h=e[2]-e[0],o=e[3]-e[1],a=[],c=0,f=t.length;c<f;c+=2)a.push(t[c]-u,t[c+1]-s);var l=new yc;return l.stroke.set(!0,void 0,void 0,i),l.transform.position.set(u,s),l.size.set(h,o),l.points.set(a,n,r),l},createNullUploaded:Uf,createRectangleRoundedUploaded:So,createRectangleUploaded:vc,createSemicircleUploaded:il,createTriangleRoundedUploaded:ll,createTriangleUploaded:ol,deserializeAll:Ar,deserializeBar:fo,deserializeBase:co,deserializeButton:Ao,deserializeCircle:Wo,deserializeConnectorElbow:za,deserializeConnectorLine:Wa,onDeserializedConnectorLine:Xa,deserializeEmbedded:tc,deserializeEmbeddedLayer:_e,deserializeGradient:ho,deserializeGroupShadowed:cc,deserializeGroup:sc,deserializeImageSdf:Nc,deserializeImage:dc,deserializeLabel:Rc,deserializeLineOfCircles:uf,deserializeLineOfRectangleRoundeds:cf,deserializeLineOfRectangles:df,deserializeLineOfTriangleRoundeds:Rf,deserializeLineOfTriangles:_f,deserializeLine:kc,deserializeNull:Gf,deserializeRectanglePivoted:Wf,deserializeRectangleRounded:Xf,deserializeRectangle:zf,deserializeSemicircle:ul,deserializeTriangleRounded:vl,deserializeTriangle:al,deserialize:Cr,EShapeBarPoints:tt,EShapeBarPosition:$,EShapeBar:Kt,EShapeBaseHitTestData:dt,EShapeBase:Ot,EShapeButtonRuntimeActionToggle:Lo,EShapeButtonRuntimeAction:Ro,EShapeButtonRuntime:yo,EShapeButton:Co,EShapeCircle:Vo,EShapeConnectorElbowPointsFiller:Ga,EShapeConnectorElbow:Ha,EShapeConnectorLine:re,EShapeEmbeddedDatum:Lr,EShapeEmbeddedLayerContainer:Pe,EShapeEmbeddedLayer:je,EShapeEmbedded:Nr,EShapeEmbeddeds:jv,EShapeFillImpl:Z,EShapeGroupFillEditor:ic,EShapeGroupFillViewer:Sr,EShapeGroupPoints:rc,EShapeGroupShadowed:ac,EShapeGroupSizeEditor:Er,EShapeGroupSizeLayout:Dr,EShapeGroupSizeShadowed:oc,EShapeGroupSizeViewer:Mr,EShapeGroupStrokeEditor:ec,EShapeGroupStrokeViewer:Tr,EShapeGroupViewer:jr,EShapeGroup:uc,EShapeImageSdf:jc,EShapeImage:bc,EShapeLabel:Ac,EShapeLineBaseHitPart:nt,EShapeLineBase:Xt,EShapeLineOfAnyPointsFillImpl:Zc,EShapeLineOfAnyPointsImpl:$c,EShapeLineOfAnyPointsPointImpl:qc,EShapeLineOfAnyPointsStrokeImpl:Qc,EShapeLineOfCircles:ef,EShapeLineOfRectangleRoundeds:af,EShapeLineOfRectangles:bf,EShapeLineOfTriangleRoundeds:Af,EShapeLineOfTriangles:Bf,EShapeLinePoints:ne,EShapeLine:yc,EShapeNull:Ff,EShapePrimitive:Ut,EShapeRectanglePivoted:Qe,EShapeRectangleRounded:Io,EShapeRectangle:qe,EShapeSemicircle:el,EShapeStrokeImpl:Dt,EShapeTextAlignImpl:xt,EShapeTextImpl:Pt,EShapeTextOffsetImpl:Bt,EShapeTextOutlineImpl:_t,EShapeTriangleRounded:Cf,EShapeTriangle:xf,hitTestBBox:gt,hitTestCircle:Ft,hitTestSemicircle:rl,hitTestRectangleRounded:No,hitTestRectangle:Ht,hitTestTriangleRounded:If,hitTestTriangleFilled:zt,hitTestTriangle:Vt,isStatic:Yc,toComputed:Jc,toDash:h,toGradientImageUrl:function(t){for(var n=t.direction,i=t.points,r="",e=0,u=i.length;e<u;++e){var s=i[e],h=Qt.toCode(s.color),o=s.alpha,a=100*s.position;r+='<stop offset="'.concat(a,'%" stop-color="#').concat(h,'" stop-opacity="').concat(o,'" />')}var c=n*Math.PI/180,f=.5*Math.cos(c),l=-.5*Math.sin(c);return Nv('<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><defs>'+'<linearGradient id="o2glkm3aeu2oio" x1="'.concat(.5-f,'" x2="').concat(.5+f,'" y1="').concat(.5-l,'" y2="').concat(.5+l,'">')+r+'</linearGradient></defs><rect x="0" y="0" width="32" height="32" stroke="none" fill="url(#o2glkm3aeu2oio)" /></svg>')},toGradientSerialized:mt,toImageElement:ao,toLength:O,toResized:function(t,n,i,r,e){t.disallowUploadedUpdate();var u=t.transform.position;if(r){var s=Math.abs(i.x-n.x),h=Math.abs(i.y-n.y);if(e){var o=(f=Math.max(s,h))+f;t.size.set(pr(o),pr(o)),u.set(Iv(n.x),Iv(n.y))}else t.size.set(pr(s+s),pr(h+h)),u.set(Iv(n.x),Iv(n.y))}else if(e){s=i.x-n.x,h=i.y-n.y,o=Math.max(Math.abs(s),Math.abs(h));var a=n.x+(s<0?-o:+o),c=n.y+(h<0?-o:+o),f=.5*o,l=Math.min(n.x,a)+f,v=Math.min(n.y,c)+f;t.size.set(pr(o),pr(o)),u.set(Iv(l),Iv(v))}else{var b=Math.min(n.x,i.x),d=Math.min(n.y,i.y),g=Math.max(n.x,i.x)-b,m=Math.max(n.y,i.y)-d,w=.5*g,p=.5*m;t.size.set(pr(g),pr(m)),u.set(Iv(b+w),Iv(d+p))}t.allowUploadedUpdate()},toScaleInvariant:o,toSizeNormalized:pr,toSizeRounded:Iv,toThresholdDefault:Wt,EShapeAcceptorImpl:yr,EShapeAcceptorType:kr,EShapeAcceptors:xr,EShapeBufferUnitBuilder:pe,EShapeBufferUnit:we,EShapeBuffer:Oe,EShapeCapabilities:mr,EShapeCapability:wt,EShapeConnectorBodies:Va,EShapeConnectorBodyImpl:ie,EShapeConnectorContainerImpl:ut,EShapeConnectorEdgeAcceptorImpl:Br,EShapeConnectorEdgeContainerImpl:Pr,EShapeConnectorEdgeImpl:_r,EShapeConnectors:ee,EShapeContainer:Te,EShapeCopyPart:st,EShapeCorner:it,EShapeDataImpl:kt,EShapeDataMapperImpl:br,EShapeDataMappingImpl:At,EShapeDataScopedImpl:Lt,EShapeDataSystemImpl:yt,EShapeDataValueExtensions:Cv,EShapeDataValueImpl:Ct,EShapeDataValueOrder:St,EShapeDataValueRangeImpl:Mt,EShapeDataValueRangeType:Et,EShapeDataValueScope:jt,EShapeDataValueState:Nt,EShapeDataValueType:Tt,EShapeDefaults:Y,EShapeDeleter:Rv,EShapeDeserializers:n,EShapeOnDeserializeds:i,EShapeEditor:wr,EShapeLayerState:Be,toPointsBoundary:Zr,eShapePointsFormatterCurve:Jr,EShapePointsMarkerBase:qr,EShapePointsMarkerContainerImplNoop:Q,EShapePointsMarkerContainerImpl:te,EShapePointsMarkerHead:Qr,EShapePointsMarkerNoop:q,EShapePointsMarkerTail:$r,EShapePointsMarkerType:J,EShapePointsStyle:F,EShapePointsStyles:Lv,EShapeRendererIteratorDatum:Ee,EShapeRendererIterator:Me,EShapeRenderer:Se,EShapeResourceManagerDeserializationMode:gr,EShapeResourceManagerDeserialization:dr,EShapeResourceManagerSerialization:yv,EShapeRuntimeImpl:Ze,EShapeRuntimeReset:$t,EShapeRuntimes:vo,EShapeSearch:Av,EShapeStateSetImplObservable:vt,EShapeState:lt,EShapeStrokeSide:Gt,EShapeStrokeStyle:s,EShapeTextAlignHorizontal:m,EShapeTextAlignVertical:w,EShapeTextDirection:p,EShapeTextWeight:d,EShapeTextStyle:g,EShapeTransformImpl:bt,EShapeTransforms:Or,EShapeType:r,EShapeUploadedImpl:u,EShapeUploadeds:e,EShapeUuidMappingImpl:Ir,ESnapperGrid:kv,ESnapperResultScale:function(){this.distance=NaN,this.scale=new t.Point},ESnapperResult:xv,ESnapperTargetValueType:Bv,ESnapperTargetValue:_v,ESnapperTarget:Pv,ESnapperModifierAnchor:Fv,ESnapper:Gv,DThemes:K,FormatNodeA:kn,FormatNodea:xn,FormatNodeD:Bn,FormatNoded:_n,FormatNodee:Un,FormatNodef:Fn,FormatNodefsi:Gn,FormatNodeg:Hn,FormatNodeH:zn,FormatNodeh:Vn,FormatNodeM:Wn,FormatNodem:Xn,FormatNodemi:Kn,FormatNodeP:Yn,FormatNodep:Jn,FormatNodePadding:Zn,FormatNodeParenthesis:qn,FormatNodePlus:Qn,FormatNodePrecision:Pn,FormatNoderd:oi,FormatNodeRP:$n,FormatNoderp:ti,FormatNodesdt:ni,FormatNodeSpace:ii,FormatNodessi:ri,FormatNodeString:ei,FormatNodeY:ui,FormatNodey:si,FormatNodez:hi,FormatNodes:ai,DynamicAtlasItemEmpty:se,DynamicAtlasItemFontAtlas:ae,DynamicAtlasItemImage:me,DynamicAtlasItemText:Hv,DynamicAtlasItemWhite:he,DynamicAtlasItem:ue,DynamicAtlas:oe,DynamicFontAtlasCharacterOrigin:fe,DynamicFontAtlasCharacterType:ve,DynamicFontAtlasCharacter:le,DynamicFontAtlasFont:Vv,DynamicFontAtlas:Wv,DynamicFontAtlases:Zv,DynamicSDFFontAtlas:de,DynamicSDFFontAtlases:ge,DynamicSDFFontGenerator:be,isArray:Rt,isFunction:ot,isNaN:bh,isNumber:mn,isObject:qv,isString:at,Lazy:Qv,NumberFormatterImpl:vi,NumberFormatters:bi,toCeilingIndex:$v,toCloned:tb,toEnum:Di,toIndexOf:Ur,toLabel:nb,toMerged:ib,toPadded:qt,toString:function(t){return null!=t?String(t):""},toSvgTexture:function(n,i){return t.Texture.from(Nv(n),{resolution:i})},toSvgUrl:Nv,UtilAlpha:On,UtilSvgAtlasBuilder:rb,UtilAttachAlign:ju,UtilAttach:Nu,UtilCharacterIterator:b,UtilClickOutside:yu,UtilClipboard:Il,UtilGestureData:rr,UtilGestureEasingHistory:sr,UtilGestureEasing:hr,UtilGestureMode:ir,UtilGestureModifier:tr,UtilGestureModifiers:nr,UtilGesture:or,UtilExtract:sb,UtilExtractor:eb,UtilFileDownloader:ub,UtilFileAs:hb,UtilFileOpener:ob,UtilFont:zv,UtilHsv:ab,UtilHtmlElementClipperExImpl:Xe,UtilHtmlElementClipperExRectsImpl:Ke,UtilHtmlElementWhen:Ye,UtilHtmlElement:Je,UtilInputInput:uu,UtilInputNumber:su,UtilInputTextArea:cb,UtilInputText:bu,UtilInput:eu,UtilKeyboardEvent:Xi,UtilName:fb,UtilOverlay:ku,UtilPointerEvent:Ki,UtilRgb:Qt,UtilRgba:lb,UtilStateBlinker:vb,UtilTransition:bb,UtilWheelEvent:db,DAlignHorizontal:Wu,DAlignVertical:Xu,DAlignWith:Ku,DAnimationBase:ur,DAnimationEmpty:gb,DAnimationFadeIn:mb,DAnimationTimings:er,DApplicationLayerOptions:pb,DApplicationLayer:Tb,DApplicationPadding:wb,DApplication:Nb,DApplications:rt,DBaseAutoSet:Ji,DBaseAuto:Yi,DBaseBackgroundMeshGeometry:Ai,DBaseBackgroundMesh:Ri,DBaseBackgroundSnippet:Li,DBaseBackground:pi,DBaseBorderMeshGeometry:yi,DBaseBorderMesh:ki,DBaseBorderSnippet:xi,DBaseBorder:Ei,DBaseCorner:Si,DBaseInteractive:Ti,DBaseMeshGeometry:Ci,DBaseOutlineSnippet:Bi,DBaseOutline:ji,DBaseOverflowMaskSimple:es,DBaseOverflowMask:$i,DBasePaddingAdjustable:Ib,DBasePadding:Ni,DBasePoint:Ii,DBaseReflowableContainer:qi,DBaseReflowableImpl:_i,DBaseSnippetContainer:Zi,DBaseStateSetImplObservable:ft,DBaseStateSetImpl:ct,DBaseState:ht,DBase:Qi,DBoard:Cb,DBorderMask:Oi,DButtonAmbient:Os,DButtonBaseWhen:Hu,DButtonBase:ds,DButtonCheckRight:Rb,DButtonCheck:Ab,DButtonColorGradient:Kb,DButtonColor:Jb,DButtonDanger:Zb,DButtonDate:qb,DButtonDatetime:nd,DButtonFileAs:hb,DButtonFile:id,DButtonGroup:js,DButtonLink:rd,DButtonPrimary:ms,DButtonRadioRight:ud,DButtonRadio:ed,DButtonRedo:sd,DButtonSecondary:hd,DButtonSelect:Kd,DButtonTime:Yd,DButtonUndo:Jd,DButton:gs,DCanvasContainer:lr,DCanvas:Zd,DChartAxisBaseBar:Qd,DChartAxisBaseOptionParser:tg,DChartAxisBaseTickContainer:eg,DChartAxisBaseTickMajorGridline:ng,DChartAxisBaseTickMajor:ig,DChartAxisBaseTickMinor:rg,DChartAxisBase:ug,DChartAxisContainerImpl:sg,DChartAxisPosition:qd,DChartAxisTickPosition:$d,DChartAxisXDatetime:og,DChartAxisX:hg,DChartAxisY:ag,DChartColorSet1:function(t){return cg[t%cg.length]},DChartColorSet2:lg,DChartCoordinateBase:mg,DChartCoordinateContainerImpl:pg,DChartCoordinateContainerSubImpl:wg,DChartCoordinateDirection:vg,DChartCoordinateLinearTick:Og,DChartCoordinateLinear:Dg,DChartCoordinateLogTick:Eg,DChartCoordinateLog:Mg,DChartCoordinateTransformImpl:bg,DChartCoordinateTransformMarkImpl:dg,DChartLegendItem:Sg,DChartLegend:Tg,DChartOverview:jg,DChartPlotAreaContainer:Ng,DChartPlotAreaImpl:Ug,DChartRegionImplObservable:Fg,DChartRegionImpl:gg,DChartSelectionGridlineContainerImpl:Vg,DChartSelectionGridlineX:Hg,DChartSelectionGridlineY:zg,DChartSelectionMarker:Wg,DChartSelectionShapeBase:Gg,DChartSelectionSimple:Yg,DChartSelectionSubImpl:Kg,DChartSelectionPoint:Xg,DChartSeriesBar:Qg,DChartSeriesBaseCoordinateContainer:Jg,DChartSeriesBase:Zg,DChartSeriesContainerImpl:Pg,DChartSeriesFillComputedImpl:Cg,DChartSeriesFillImpl:Rg,DChartSeriesLineOfAny:qg,DChartSeriesLineOfCircles:$g,DChartSeriesLineOfRectangleRoundeds:tm,DChartSeriesLineOfRectangles:nm,DChartSeriesLineOfTriangleRoundeds:rm,DChartSeriesLineOfTriangles:im,DChartSeriesLine:em,DChartSeriesExpressionParametersImpl:um,DChartSeriesLinear:sm,DChartSeriesPaddingComputedImpl:Lg,DChartSeriesPaddingImpl:yg,DChartSeriesPointComputedImpl:kg,DChartSeriesPointImpl:xg,DChartSeriesScalars:Ag,DChartSeriesStrokeComputedImpl:Bg,DChartSeriesStrokeImpl:_g,DChartSeriesHitResult:Ig,DChart:hm,DColorGradientObservable:kb,DColorGradientPointObservable:Lb,DCommandBase:Ob,DCommandClear:Db,DCommandCreate:om,DCommandSaveAs:am,DCommandSave:cm,DContent:Md,DControllerCommandImpl:Eb,DControllerFocusImpl:jb,DControllerKeyboard:Mb,DControllers:Sb,DCornerMask:Mi,DDiagramBaseControllerOpenType:vr,DDiagramBase:lm,DDiagramCanvasBase:wm,DDiagramCanvasBaseShapeImpl:pm,DDiagramCanvasDataImpl:Om,DDiagramCanvasEditorBackground:vm,DDiagramCanvasEditorShapeImpl:Dm,DDiagramCanvasEditorSnap:Em,DDiagramCanvasEditor:Mm,DDiagramCanvasTileMappingImpl:dm,DDiagramCanvasTileMappingPointImpl:bm,DDiagramCanvasShapeImpl:Sm,DDiagramCanvasTickerImpl:jm,DDiagramCanvasTile:gm,DDiagramCanvas:ym,DDiagramDataImpl:Pm,DDiagramDataPrivateImpl:km,DDiagramDataRemoteImpl:Bm,DDiagramEditorThumbnail:Um,DDiagramEditor:Fm,DDiagramLayerContainer:mm,DDiagramLayer:$e,DDiagramLayers:Ne,DDiagramSerializedVersion:1,DDiagramShape:Gm,DDiagramSnapshot:fm,DDiagramTicker:Tm,DDiagram:Hm,DDiagrams:Ue,DDialogAlign:ju,DDialogCloseOn:Iu,DDialogColorGradient:Xb,DDialogColor:Yb,DDialogConfirmDelete:Wm,DDialogConfirmDiscard:Xm,DDialogConfirmMessage:zm,DDialogConfirm:Vm,DDialogDate:mh,DDialogDatetime:fh,DDialogFittedContent:Xs,DDialogFitted:Ks,DDialogGestureImpl:Au,DDialogGestureMode:Cu,DDialogInputBoolean:As,DDialogInputInteger:Ps,DDialogInputReal:Gs,DDialogInputText:Vs,DDialogInput:Ts,DDialogLayeredContent:Gu,DDialogLayeredFooter:ps,DDialogLayeredHeaderButtonClose:Ds,DDialogLayeredHeaderSeparator:Es,DDialogLayeredHeader:Ms,DDialogLayered:Ss,DDialogMessage:Km,DDialogMode:Ru,DDialogProcessingMessage:Ym,DDialogProcessing:Jm,DDialogSaveAs:Zm,DDialogSelectListItemUpdater:vd,DDialogSelectListItem:cd,DDialogSelectList:xd,DDialogSelectSearhDismissableImpl:zd,DDialogSelectSearhImpl:Bd,DDialogSelect:Vd,DDialogState:Lu,DDialogTime:vh,DDialog:xu,DDropdownBase:$m,DDropdown:tw,DDynamicTextGeometry:cs,DDynamicTextMeasureResultCharacter:us,DDynamicTextMeasureResult:ss,DDynamicTextMeasure:as,DDynamicTextStyleWordWrap:hs,DDynamicTextStyle:fs,DDynamicText:ls,DExpandableHeader:nw,DExpandable:iw,DHtmlElementState:We,DHtmlElement:ys,DImageBaseThemeWrapperSecondary:zu,DImageBaseThemeWrapperTertiary:Vu,DImageBase:bs,DImagePieceLayouterPartBottom:Zu,DImagePieceLayouterPartCenter:qu,DImagePieceLayouterPartContainer:is,DImagePieceLayouterPartLeft:Qu,DImagePieceLayouterPartMiddle:$u,DImagePieceLayouterPartRight:ts,DImagePieceLayouterPartTop:ns,DImagePieceLayouterPart:Ju,DImagePieceLayouter:rs,DImagePiece:Yu,DImage:gl,DInputAndLabel:Bb,DInputBooleanButtonOff:Ns,DInputBooleanButtonOn:Is,DInputBoolean:Cs,DInputInput:xs,DInputIntegerAndLabel:rw,DInputInteger:_s,DInputLabel:xb,DInputNumber:Bs,DInputRealAndLabel:_b,DInputReal:Fs,DInputSearch:_d,DInputTextAndLabel:Pb,DInputTextArea:ew,DInputText:zs,DInput:ks,DItemUpdater:fd,DLayoutClearType:Pi,DLayoutDirection:Bu,DLayoutHorizontal:ws,DLayoutSpace:_u,DLayoutVertical:Fu,DLayout:Uu,DLinkMenuItemId:El,DLinkMenu:Sl,DLinkTarget:Tl,DLink:Al,DLinks:Rl,DListDataImpl:Ed,DListDataMappedImpl:bd,DListDataSelectionMultiple:dd,DListDataSelectionNone:gd,DListDataSelectionSingle:md,DListDataSelectionType:od,DListItemAccessorImpl:Dd,DListItemAmbient:uw,DListItemUpdater:ld,DListItem:ad,DList:kd,DMapCoordinateEPSG3857:sw,DMapCoordinates:hw,DMapTilePlane:aw,DMapTilePyramidImpl:cw,DMapTileUrlBuilderKokudo:function(t,n,i){return 5<=t?"https://cyberjapandata.gsi.go.jp/xyz/pale/".concat(t,"/").concat(n,"/").concat(i,".png"):2<=t?"https://cyberjapandata.gsi.go.jp/xyz/std/".concat(t,"/").concat(n,"/").concat(i,".png"):"https://cyberjapandata.gsi.go.jp/xyz/earthhillshade/".concat(t,"/").concat(n,"/").concat(i,".png")},DMapTileUrlBuilderOsm:function(t,n,i){return"https://".concat("abc"[(n+i)%3],".tile.openstreetmap.org/").concat(t,"/").concat(n,"/").concat(i,".png")},DMapTileUrlBuilderOsmfj:fw,DMapTilePyramids:lw,DMapTile:ow,DMenuAlign:ju,DMenuBarItem:vw,DMenuBar:bw,DMenuContext:qm,DMenuItemBase:ml,DMenuItemCheckIsCompatible:Dl,DMenuItemCheck:Ol,DMenuItemExpandableBody:zl,DMenuItemExpandableHeader:Vl,DMenuItemExpandableIsCompatible:Kl,DMenuItemExpandableItemCheck:Yl,DMenuItemExpandableItemLink:Jl,DMenuItemExpandableItemMenu:lv,DMenuItemExpandableItemSeparator:Zl,DMenuItemExpandableItemSpace:ql,DMenuItemExpandableItemText:Ql,DMenuItemExpandable:Xl,DMenuItemExpandables:Wl,DMenuItemLinkIsCompatible:yl,DMenuItemLink:Ll,DMenuItemMenuIsCompatible:xl,DMenuItemMenuToSubMenuOptions:Bl,DMenuItemMenu:kl,DMenuItemSeparatorReflowable:_l,DMenuItemSeparatorIsCompatible:Pl,DMenuItemSeparator:Ul,DMenuItemSpaceIsCompatible:Gl,DMenuItemSpace:Fl,DMenuItemText:pl,DMenuItem:wl,DMenuSidedContent:dw,DMenuSidedItemCheck:tv,DMenuSidedItemExpandableItemCheck:cv,DMenuSidedItemExpandableItemLink:fv,DMenuSidedItemExpandableItemMenu:vv,DMenuSidedItemExpandableItemSeparator:bv,DMenuSidedItemExpandableItemSpace:dv,DMenuSidedItemExpandableItemText:gv,DMenuSidedItemExpandable:av,DMenuSidedItemExpandables:ov,DMenuSidedItemLink:nv,DMenuSidedItemMenu:iv,DMenuSidedItemSeparator:rv,DMenuSidedItemSpace:ev,DMenuSidedItemText:uv,DMenuSidedSelectionType:gw,DMenuSidedSelection:ww,DMenuSided:pw,DMenuSideds:sv,DMenu:Qm,DMenus:Ml,DNoteError:Ow,DNoteNoItemsFound:Dw,DNoteSearching:Ew,DNoteSmallError:Fd,DNoteSmallNoItemsFound:Gd,DNoteSmallSearching:Hd,DNoteSmall:Ud,DNote:Pd,DNotification:Mw,DPaginationButtonLast:Sw,DPaginationButtonNext:Tw,DPaginationButtonPage:jw,DPaginationButtonPrevious:Nw,DPaginationButtonTop:Iw,DPaginationDots:Cw,DPaginationPage:Aw,DPagination:Rw,DPaneScrollBar:Ld,DPane:yd,DPickerColorAndAlpha:Ub,DPickerColorGradientRecent:zb,DPickerColorGradientView:Vb,DPickerColorGradient:Wb,DPickerColorRecent:Fb,DPickerColor:Gb,DPickerDate:gh,DPickerDates:Qb,DPickerDatetimeButtonBack:Ys,DPickerDatetimeButtonDate:Js,DPickerDatetimeButtonNext:Zs,DPickerDatetimeLabelDate:$s,DPickerDatetimeLabel:Qs,DPickerDatetimeMask:nh,DPickerDatetimeMasks:ih,DPickerDatetimeRange:Lw,DPickerDatetimeSpace:th,DPickerDatetime:ch,DPickerDatetimes:td,DPickerTimeBoundHours:eh,DPickerTimeBoundMinutes:uh,DPickerTimeBoundSeconds:sh,DPickerTimeBound:rh,DPickerTimeBounds:hh,DPickerTimeRange:yw,DPickerTime:ah,DPickerTimes:$b,DScalarExpressionNodeType:Ui,DScalarExpression:Fi,DScalarFunctions:Wi,DScrollBarHorizontal:Id,DScrollBarThumbHorizontal:Nd,DScrollBarThumbReflowableHorizontal:jd,DScrollBarThumbReflowableVertical:Cd,DScrollBarThumbVertical:Ad,DScrollBarThumb:Td,DScrollBarVertical:Rd,DScrollBar:Sd,DSelectMultiple:kw,DSelect:xw,DShadowImpl:Bw,DSliderHorizontal:zw,DSliderLabel:_w,DSliderThumb:Pw,DSliderTrackHorizontal:Hw,DSliderTrackVertical:Vw,DSliderTrack:Gw,DSliderValue:Uw,DSliderVertical:Ww,DSlider:Fw,DTableBodyCellActionDialog:Yw,DTableBodyCellActionMenu:Jw,DTableBodyCellActionPromise:qw,DTableBodyCellButton:$w,DTableBodyCellCheck:np,DTableBodyCellColor:ip,DTableBodyCellDate:rp,DTableBodyCellDatetime:ep,DTableBodyCellIndex:up,DTableBodyCellInputInteger:sp,DTableBodyCellInputReal:hp,DTableBodyCellInputText:op,DTableBodyCellInputTreeInput:ap,DTableBodyCellInputTreeMarker:cp,DTableBodyCellInputTree:lp,toLinkOptions:vp,toUrl:bp,toChecker:dp,DTableBodyCellLink:gp,DTableBodyCellSelectDialog:Kw,DTableBodyCellSelectMenu:mp,DTableBodyCellSelectMultiple:wp,DTableBodyCellSelectPromise:Zw,DTableBodyCellText:Qw,DTableBodyCellTime:pp,DTableBodyCellTree:Op,DTableBodyCells:Xw,DTableBodyRow:Mp,DTableBody:Rp,DTableCategoryCell:Lp,DTableCategory:yp,DTableColumnType:tp,DTableDataListFilter:Sp,DTableDataListMapped:Tp,DTableDataListSelection:Np,DTableDataListSorter:Cp,DTableDataList:Ap,DTableDataSelectionType:Dp,DTableDataOrder:Ip,DTableDataTreeFilter:kp,DTableDataTreeItemAccessor:_p,DTableDataTreeSelectionImpl:Up,DTableDataTreeSorter:Fp,DTableDataTree:Gp,DTableHeaderCellCheck:Hp,DTableHeaderCell:Vp,DTableHeader:Wp,DTableRow:Ep,DTableScrollBar:Xp,DTableState:fp,DTable:cO,DTextBase:vs,DText:qs,DTreeDataImpl:EO,DTreeDataMappedImpl:wO,DTreeDataSelectionMultiple:pO,DTreeDataSelectionNone:DO,DTreeDataSelectionSingle:OO,DTreeDataSelectionType:mO,DTreeItemButton:TO,DTreeItemNonEditable:jO,DTreeItemState:MO,DTreeItemText:SO,DTreeItemUpdater:NO,DTreeNodeAccessorImpl:gO,DTree:IO,DViewGestureImpl:ar,DViewImpl:fr,DViewTransformImpl:cr};pv();var AO=window;AO.wcardinal=AO.wcardinal||{},AO.wcardinal.ui=CO}(PIXI);
10
10
  //# sourceMappingURL=wcardinal-ui.min.js.map