{'id': 183207, 'code': 'Y2gQopBX
var PMA=function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="dist/",n(n.s=260)}([function(t,e,n){"use strict";n.r(e),n.d(e,"boundingExtent",(function(){return a})),n.d(e,"buffer",(function(){return s})),n.d(e,"clone",(function(){return l})),n.d(e,"closestSquaredDistanceXY",(function(){return u})),n.d(e,"containsCoordinate",(function(){return c})),n.d(e,"containsExtent",(function(){return h})),n.d(e,"containsXY",(function(){return p})),n.d(e,"coordinateRelationship",(function(){return d})),n.d(e,"createEmpty",(function(){return f})),n.d(e,"createOrUpdate",(function(){return g})),n.d(e,"createOrUpdateEmpty",(function(){return y})),n.d(e,"createOrUpdateFromCoordinate",(function(){return m})),n.d(e,"createOrUpdateFromCoordinates",(function(){return v})),n.d(e,"createOrUpdateFromFlatCoordinates",(function(){return _})),n.d(e,"createOrUpdateFromRings",(function(){return b})),n.d(e,"equals",(function(){return w})),n.d(e,"approximatelyEquals",(function(){return x})),n.d(e,"extend",(function(){return E})),n.d(e,"extendCoordinate",(function(){return S})),n.d(e,"extendCoordinates",(function(){return O})),n.d(e,"extendFlatCoordinates",(function(){return C})),n.d(e,"extendRings",(function(){return T})),n.d(e,"extendXY",(function(){return I})),n.d(e,"forEachCorner",(function(){return L})),n.d(e,"getArea",(function(){return P})),n.d(e,"getBottomLeft",(function(){return R})),n.d(e,"getBottomRight",(function(){return M})),n.d(e,"getCenter",(function(){return N})),n.d(e,"getCorner",(function(){return j})),n.d(e,"getEnlargedArea",(function(){return A})),n.d(e,"getForViewAndSize",(function(){return k})),n.d(e,"getHeight",(function(){return F})),n.d(e,"getIntersectionArea",(function(){return D})),n.d(e,"getIntersection",(function(){return G})),n.d(e,"getMargin",(function(){return z})),n.d(e,"getSize",(function(){return U})),n.d(e,"getTopLeft",(function(){return B})),n.d(e,"getTopRight",(function(){return V})),n.d(e,"getWidth",(function(){return q})),n.d(e,"intersects",(function(){return Y})),n.d(e,"isEmpty",(function(){return X})),n.d(e,"returnOrUpdate",(function(){return W})),n.d(e,"scaleFromCenter",(function(){return H})),n.d(e,"intersectsSegment",(function(){return K})),n.d(e,"applyTransform",(function(){return Z})),n.d(e,"wrapX",(function(){return $}));var r=n(143),i=n(72),o=n(13);function a(t){for(var e=f(),n=0,r=t.length;n<r;++n)S(e,t[n]);return e}function s(t,e,n){return n?(n[0]=t[0]-e,n[1]=t[1]-e,n[2]=t[2]+e,n[3]=t[3]+e,n):[t[0]-e,t[1]-e,t[2]+e,t[3]+e]}function l(t,e){return e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t.slice()}function u(t,e,n){var r,i;return(r=e<t[0]?t[0]-e:t[2]<e?e-t[2]:0)*r+(i=n<t[1]?t[1]-n:t[3]<n?n-t[3]:0)*i}function c(t,e){return p(t,e[0],e[1])}function h(t,e){return t[0]<=e[0]&&e[2]<=t[2]&&t[1]<=e[1]&&e[3]<=t[3]}function p(t,e,n){return t[0]<=e&&e<=t[2]&&t[1]<=n&&n<=t[3]}function d(t,e){var n=t[0],r=t[1],o=t[2],a=t[3],s=e[0],l=e[1],u=i.a.UNKNOWN;return s<n?u|=i.a.LEFT:s>o&&(u|=i.a.RIGHT),l<r?u|=i.a.BELOW:l>a&&(u|=i.a.ABOVE),u===i.a.UNKNOWN&&(u=i.a.INTERSECTING),u}function f(){return[1/0,1/0,-1/0,-1/0]}function g(t,e,n,r,i){return i?(i[0]=t,i[1]=e,i[2]=n,i[3]=r,i):[t,e,n,r]}function y(t){return g(1/0,1/0,-1/0,-1/0,t)}function m(t,e){var n=t[0],r=t[1];return g(n,r,n,r,e)}function v(t,e){return O(y(e),t)}function _(t,e,n,r,i){return C(y(i),t,e,n,r)}function b(t,e){return T(y(e),t)}function w(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function x(t,e,n){return Math.abs(t[0]-e[0])<n&&Math.abs(t[2]-e[2])<n&&Math.abs(t[1]-e[1])<n&&Math.abs(t[3]-e[3])<n}function E(t,e){return e[0]<t[0]&&(t[0]=e[0]),e[2]>t[2]&&(t[2]=e[2]),e[1]<t[1]&&(t[1]=e[1]),e[3]>t[3]&&(t[3]=e[3]),t}function S(t,e){e[0]<t[0]&&(t[0]=e[0]),e[0]>t[2]&&(t[2]=e[0]),e[1]<t[1]&&(t[1]=e[1]),e[1]>t[3]&&(t[3]=e[1])}function O(t,e){for(var n=0,r=e.length;n<r;++n)S(t,e[n]);return t}function C(t,e,n,r,i){for(;n<r;n+=i)I(t,e[n],e[n+1]);return t}function T(t,e){for(var n=0,r=e.length;n<r;++n)O(t,e[n]);return t}function I(t,e,n){t[0]=Math.min(t[0],e),t[1]=Math.min(t[1],n),t[2]=Math.max(t[2],e),t[3]=Math.max(t[3],n)}function L(t,e){var n;return(n=e(R(t)))||(n=e(M(t)))||(n=e(V(t)))?n:(n=e(B(t)))||!1}function P(t){var e=0;return X(t)||(e=q(t)*F(t)),e}function R(t){return[t[0],t[1]]}function M(t){return[t[2],t[1]]}function N(t){return[(t[0]+t[2])/2,(t[1]+t[3])/2]}function j(t,e){var n;return e===r.a.BOTTOM_LEFT?n=R(t):e===r.a.BOTTOM_RIGHT?n=M(t):e===r.a.TOP_LEFT?n=B(t):e===r.a.TOP_RIGHT?n=V(t):Object(o.a)(!1,13),n}function A(t,e){var n=Math.min(t[0],e[0]),r=Math.min(t[1],e[1]);return(Math.max(t[2],e[2])-n)*(Math.max(t[3],e[3])-r)}function k(t,e,n,r,i){var o=e*r[0]/2,a=e*r[1]/2,s=Math.cos(n),l=Math.sin(n),u=o*s,c=o*l,h=a*s,p=a*l,d=t[0],f=t[1],y=d-u+p,m=d-u-p,v=d+u-p,_=d+u+p,b=f-c-h,w=f-c+h,x=f+c+h,E=f+c-h;return g(Math.min(y,m,v,_),Math.min(b,w,x,E),Math.max(y,m,v,_),Math.max(b,w,x,E),i)}function F(t){return t[3]-t[1]}function D(t,e){return P(G(t,e))}function G(t,e,n){var r=n||[1/0,1/0,-1/0,-1/0];return Y(t,e)?(t[0]>e[0]?r[0]=t[0]:r[0]=e[0],t[1]>e[1]?r[1]=t[1]:r[1]=e[1],t[2]<e[2]?r[2]=t[2]:r[2]=e[2],t[3]<e[3]?r[3]=t[3]:r[3]=e[3]):y(r),r}function z(t){return q(t)+F(t)}function U(t){return[t[2]-t[0],t[3]-t[1]]}function B(t){return[t[0],t[3]]}function V(t){return[t[2],t[3]]}function q(t){return t[2]-t[0]}function Y(t,e){return t[0]<=e[2]&&t[2]>=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}function X(t){return t[2]<t[0]||t[3]<t[1]}function W(t,e){return e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t}function H(t,e){var n=(t[2]-t[0])/2*(e-1),r=(t[3]-t[1])/2*(e-1);t[0]-=n,t[2]+=n,t[1]-=r,t[3]+=r}function K(t,e,n){var r=!1,o=d(t,e),a=d(t,n);if(o===i.a.INTERSECTING||a===i.a.INTERSECTING)r=!0;else{var s=t[0],l=t[1],u=t[2],c=t[3],h=e[0],p=e[1],f=n[0],g=n[1],y=(g-p)/(f-h),m=void 0,v=void 0;a&i.a.ABOVE&&!(o&i.a.ABOVE)&&(r=(m=f-(g-c)/y)>=s&&m<=u),r||!(a&i.a.RIGHT)||o&i.a.RIGHT||(r=(v=g-(f-u)*y)>=l&&v<=c),r||!(a&i.a.BELOW)||o&i.a.BELOW||(r=(m=f-(g-l)/y)>=s&&m<=u),r||!(a&i.a.LEFT)||o&i.a.LEFT||(r=(v=g-(f-s)*y)>=l&&v<=c)}return r}function Z(t,e,n,r){var i=[];if(r>1)for(var o=t[2]-t[0],a=t[3]-t[1],s=0;s<r;++s)i.push(t[0]+o*s/r,t[1],t[2],t[1]+a*s/r,t[2]-o*s/r,t[3],t[0],t[3]-a*s/r);else i=[t[0],t[1],t[2],t[1],t[2],t[3],t[0],t[3]];e(i,i,2);for(var l=[],u=[],c=(s=0,i.length);s<c;s+=2)l.push(i[s]),u.push(i[s+1]);return function(t,e,n){return g(Math.min.apply(null,t),Math.min.apply(null,e),Math.max.apply(null,t),Math.max.apply(null,e),n)}(l,u,n)}function $(t,e){var n=e.getExtent(),r=N(t);if(e.canWrapX()&&(r[0]<n[0]||r[0]>=n[2])){var i=q(n),o=Math.floor((r[0]-n[0])/i)*i;t[0]-=o,t[2]-=o}return t}},function(t,e,n){"use strict";e.a={POINT:"Point",LINE_STRING:"LineString",LINEAR_RING:"LinearRing",POLYGON:"Polygon",MULTI_POINT:"MultiPoint",MULTI_LINE_STRING:"MultiLineString",MULTI_POLYGON:"MultiPolygon",GEOMETRY_COLLECTION:"GeometryCollection",CIRCLE:"Circle"}},function(t,e,n){"use strict";n.r(e),n.d(e,"METERS_PER_UNIT",(function(){return o.a})),n.d(e,"Projection",(function(){return i.a})),n.d(e,"cloneTransform",(function(){return T})),n.d(e,"identityTransform",(function(){return I})),n.d(e,"addProjection",(function(){return L})),n.d(e,"addProjections",(function(){return P})),n.d(e,"get",(function(){return R})),n.d(e,"getPointResolution",(function(){return M})),n.d(e,"addEquivalentProjections",(function(){return N})),n.d(e,"addEquivalentTransforms",(function(){return j})),n.d(e,"clearAllProjections",(function(){return A})),n.d(e,"createProjection",(function(){return k})),n.d(e,"createTransformFromCoordinateTransform",(function(){return F})),n.d(e,"addCoordinateTransforms",(function(){return D})),n.d(e,"fromLonLat",(function(){return G})),n.d(e,"toLonLat",(function(){return z})),n.d(e,"equivalent",(function(){return U})),n.d(e,"getTransformFromProjections",(function(){return B})),n.d(e,"getTransform",(function(){return V})),n.d(e,"transform",(function(){return q})),n.d(e,"transformExtent",(function(){return Y})),n.d(e,"transformWithProjections",(function(){return X})),n.d(e,"setUserProjection",(function(){return H})),n.d(e,"clearUserProjection",(function(){return K})),n.d(e,"getUserProjection",(function(){return Z})),n.d(e,"useGeographic",(function(){return $})),n.d(e,"toUserCoordinate",(function(){return J})),n.d(e,"fromUserCoordinate",(function(){return Q})),n.d(e,"toUserExtent",(function(){return tt})),n.d(e,"fromUserExtent",(function(){return et})),n.d(e,"createSafeCoordinateTransform",(function(){return nt})),n.d(e,"addCommon",(function(){return rt}));var r,i=n(125),o=n(52),a=n(8),s=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),l=6378137*Math.PI,u=[-l,-l,l,l],c=[-180,-85,180,85],h=6378137*Math.log(Math.tan(Math.PI/2)),p=function(t){function e(e){return t.call(this,{code:e,units:o.b.METERS,extent:u,global:!0,worldExtent:c,getPointResolution:function(t,e){return t/Object(a.b)(e[1]/6378137)}})||this}return s(e,t),e}(i.a),d=[new p("EPSG:3857"),new p("EPSG:102100"),new p("EPSG:102113"),new p("EPSG:900913"),new p("http://www.opengis.net/gml/srs/epsg.xml#3857")];function f(t,e,n){var r=t.length,i=n>1?n:2,o=e;void 0===o&&(o=i>2?t.slice():new Array(r));for(var a=0;a<r;a+=i){o[a]=l*t[a]/180;var s=6378137*Math.log(Math.tan(Math.PI*(+t[a+1]+90)/360));s>h?s=h:s<-h&&(s=-h),o[a+1]=s}return o}function g(t,e,n){var r=t.length,i=n>1?n:2,o=e;void 0===o&&(o=i>2?t.slice():new Array(r));for(var a=0;a<r;a+=i)o[a]=180*t[a]/l,o[a+1]=360*Math.atan(Math.exp(t[a+1]/6378137))/Math.PI-90;return o}var y=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),m=[-180,-90,180,90],v=6378137*Math.PI/180,_=function(t){function e(e,n){return t.call(this,{code:e,units:o.b.DEGREES,extent:m,axisOrientation:n,global:!0,metersPerUnit:v,worldExtent:m})||this}return y(e,t),e}(i.a),b=[new _("CRS:84"),new _("EPSG:4326","neu"),new _("urn:ogc:def:crs:OGC:1.3:CRS84"),new _("urn:ogc:def:crs:OGC:2:84"),new _("http://www.opengis.net/gml/srs/epsg.xml#4326","neu")],w={};n(6);var x={};function E(t,e,n){var r=t.getCode(),i=e.getCode();r in x||(x[r]={}),x[r][i]=n}var S=n(0),O=n(175),C=n(21);function T(t,e,n){var r;if(void 0!==e){for(var i=0,o=t.length;i<o;++i)e[i]=t[i];r=e}else r=t.slice();return r}function I(t,e,n){if(void 0!==e&&t!==e){for(var r=0,i=t.length;r<i;++r)e[r]=t[r];t=e}return t}function L(t){!function(t,e){w[t]=e}(t.getCode(),t),E(t,t,T)}function P(t){t.forEach(L)}function R(t){return"string"==typeof t?w[e=t]||w[e.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,"EPSG:$3")]||null:t||null;var e}function M(t,e,n,r){var i,a=(t=R(t)).getPointResolutionFunc();if(a){if(i=a(e,n),r&&r!==t.getUnits())(l=t.getMetersPerUnit())&&(i=i*l/o.a[r])}else{var s=t.getUnits();if(s==o.b.DEGREES&&!r||r==o.b.DEGREES)i=e;else{var l,u=B(t,R("EPSG:4326"));if(u===I&&s!==o.b.DEGREES)i=e*t.getMetersPerUnit();else{var c=[n[0]-e/2,n[1],n[0]+e/2,n[1],n[0],n[1]-e/2,n[0],n[1]+e/2];c=u(c,c,2),i=(Object(O.a)(c.slice(0,2),c.slice(2,4))+Object(O.a)(c.slice(4,6),c.slice(6,8)))/2}void 0!==(l=r?o.a[r]:t.getMetersPerUnit())&&(i/=l)}}return i}function N(t){P(t),t.forEach((function(e){t.forEach((function(t){e!==t&&E(e,t,T)}))}))}function j(t,e,n,r){t.forEach((function(t){e.forEach((function(e){E(t,e,n),E(e,t,r)}))}))}function A(){w={},x={}}function k(t,e){return t?"string"==typeof t?R(t):t:R(e)}function F(t){return function(e,n,r){for(var i=e.length,o=void 0!==r?r:2,a=void 0!==n?n:new Array(i),s=0;s<i;s+=o){var l=t([e[s],e[s+1]]);a[s]=l[0],a[s+1]=l[1];for(var u=o-1;u>=2;--u)a[s+u]=e[s+u]}return a}}function D(t,e,n,r){var i=R(t),o=R(e);E(i,o,F(n)),E(o,i,F(r))}function G(t,e){return q(t,"EPSG:4326",void 0!==e?e:"EPSG:3857")}function z(t,e){var n=q(t,void 0!==e?e:"EPSG:3857","EPSG:4326"),r=n[0];return(r<-180||r>180)&&(n[0]=Object(a.e)(r+180,360)-180),n}function U(t,e){if(t===e)return!0;var n=t.getUnits()===e.getUnits();return(t.getCode()===e.getCode()||B(t,e)===T)&&n}function B(t,e){var n=function(t,e){var n;return t in x&&e in x[t]&&(n=x[t][e]),n}(t.getCode(),e.getCode());return n||(n=I),n}function V(t,e){return B(R(t),R(e))}function q(t,e,n){return V(e,n)(t,void 0,t.length)}function Y(t,e,n,r){var i=V(e,n);return Object(S.applyTransform)(t,i,void 0,r)}function X(t,e,n){return B(e,n)(t)}var W=null;function H(t){W=R(t)}function K(){W=null}function Z(){return W}function $(){H("EPSG:4326")}function J(t,e){return W?q(t,e,W):t}function Q(t,e){return W?q(t,W,e):t}function tt(t,e){return W?Y(t,e,W):t}function et(t,e){return W?Y(t,W,e):t}function nt(t,e,n){return function(r){var i,o,s=r[0],l=r[1];if(t.canWrapX()){var u=t.getExtent(),c=Object(S.getWidth)(u);(o=Object(C.g)(r,t,c))&&(s-=o*c),s=Object(a.a)(s,u[0],u[2]),l=Object(a.a)(l,u[1],u[3]),i=n([s,l])}else i=n(r);return o&&e.canWrapX()&&(i[0]+=o*Object(S.getWidth)(e.getExtent())),i}}function rt(){N(d),N(b),j(b,d,f,g)}rt()},function(t,e,n){"use strict";n.d(e,"c",(function(){return h})),n.d(e,"a",(function(){return p})),n.d(e,"e",(function(){return d})),n.d(e,"d",(function(){return f})),n.d(e,"b",(function(){return g})),n.d(e,"f",(function(){return y})),n.d(e,"o",(function(){return v})),n.d(e,"n",(function(){return _})),n.d(e,"i",(function(){return b})),n.d(e,"g",(function(){return w})),n.d(e,"h",(function(){return x})),n.d(e,"m",(function(){return E})),n.d(e,"l",(function(){return S})),n.d(e,"k",(function(){return O})),n.d(e,"j",(function(){return C}));var r=n(133),i=n.n(r),o=n(87),a=n.n(o),s=n(11),l=n(150);function u(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function c(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?u(Object(n),!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var h={DirectorySelected:"directorySelected",SlideSelected:"slideSelected",ServerSelected:"serverSelected",ServerExpanded:"serverExpanded",DirectoryExpanded:"directoryExpanded",MultiSelectionChanged:"multiSelectionChanged",SlideDeSelected:"slideDeSelected",TreeNodeDoubleClicked:"treeNodeDoubleClicked",SlideInfoError:"SlideInfoError",BeforeSlideLoad:"BeforeSlideLoad",SlideLoaded:"SlideLoaded",AnnotationAdded:"annotationAdded",AnnotationDrawing:"annotationDrawing",AnnotationDeleted:"annotationDeleted",AnnotationModified:"annotationModified",AnnotationsSaved:"annotationsSaved",AnnotationsSelectionChanged:"annotationsSelectionChanged",AnnotationEditingStarted:"annotationEditingStarted",AnnotationEditingEnded:"annotationEditingEnded",FormSaved:"formSaved",FormEditClick:"formEditClick",SyncChanged:"syncChanged",SearchStarted:"searchStarted",SearchFinished:"searchFinished",SearchFailed:"searchFailed",ValueExpanded:"valueExpanded",Dropped:"dropped",SessionIdLoginFailed:"sessionIdLoginFailed",BeforeDrop:"beforeDrop"},p={Authenticate:"Authenticate",GetFiles:"GetFiles",GetDirectories:"GetDirectories",GetImageInfo:"GetImageInfo",GetImagesInfo:"GetImagesInfo",DeAuthenticate:"DeAuthenticate",GetForms:"GetForms",GetFormDefinitions:"GetFormDefinitions",GetFormSubmissions:"GetFormSubmissions",GetForm:"GetForm",SaveFormDefinition:"SaveFormDefinition",DeleteFormDefinition:"DeleteFormDefinition",SaveFormData:"SaveFormData",GetFormData:"GetFormData",GetAnnotations:"GetAnnotations",AddAnnotation:"AddAnnotation",UpdateAnnotation:"UpdateAnnotation",DeleteAnnotation:"DeleteAnnotation",GetVersionInfo:"GetVersionInfo",QueryFilename:"Filename",SaveAnnotations:"SaveAnnotations",DistinctValues:"DistinctValues",Metadata:"Metadata",GetEvents:"GetEvents",RunScripts:"Run"},d={Normal:0,OneLevel:1,Recursive:2},f={All:"all",Thumbnail:"thumbnail",Barcode:"barcode"},g="application/x-pma-node",y={_list:{},set:function(t,e){this._list[t]=e},get:function(){return this._list},clear:function(){this._list={}}};function m(t){for(var e=/^\/+|\/+$/g,n=/^\/+/g,r=0,i=t.length;r<i;r++)t[r]=r===i-1?t[r].replace(n,""):t[r].replace(e,"");return t.join("/")}var v=function(t){if(null==t||""===t)return null;var e=JSON.parse(t);return e.hasOwnProperty("d")?e.d:e},_=function(t){try{var e=t.getData(PMA.UI.Components.DragDropMimeType);return JSON.parse(e)}catch(t){}try{var n=t.getData("text");return JSON.parse(n)}catch(t){}return null},b=function(t){if(t&&"object"===a()(t)){var e="",n=0;for(var r in t)t.hasOwnProperty(r)&&(n>0&&(e+="&"),e+=encodeURIComponent(r)+"="+encodeURIComponent(t[r]),n++);return e}return t},w=function(t,e,n,r,i,o){e=e.toUpperCase();var a=null;(a=n&&n.toLowerCase&&"application/json"===n.toLowerCase()?JSON.stringify(r):b(r))&&"GET"==e&&(t=t+"?"+a,a=null);var s=new XMLHttpRequest;s.open(e,t,!0),"POST"!=e||n?n&&s.setRequestHeader("Content-Type",n):s.setRequestHeader("Content-type","application/x-www-form-urlencoded"),s.onreadystatechange=function(){4===s.readyState&&(200===s.status?"function"==typeof i&&i(s):"function"==typeof o&&o(s))},a?s.send(a):s.send()},x=function(t){var e="GET";t.httpMethod&&(e=t.httpMethod),t.apiPath||(t.apiPath="api");var n=!0===t.webapi?"/":"/json/";w(m([t.serverUrl,t.apiPath+n,t.method]),e,t.contentType,t.data,t.success,t.failure)},E=function(t,e,n,r,i,o){if("string"!=typeof r)throw"Caller parameter not supplied";function a(t){if("function"==typeof o)if(t.responseText&&0!==t.responseText.length&&""!==t.responseType)try{var e=v(t.responseText);o(e)}catch(t){o({Message:s.a.translate("Authentication failed")})}else o({Message:s.a.translate("Authentication failed")})}var u;(u={serverUrl:t,method:p.GetVersionInfo},new Promise((function(t,e){var n=c(c({},u),{},{success:t,failure:e});x(n)}))).then((function(o){var s=Object(l.b)(JSON.parse(o.responseText));x({serverUrl:t,method:p.Authenticate,httpMethod:s?"POST":"GET",contentType:s?"application/json":null,data:{username:e,password:n,caller:r},success:function(e){var n=v(e.responseText);n&&!0===n.Success?(y.set(t,n),"function"==typeof i&&i(n.SessionId)):a(e)},failure:a})}),a)},S=function(t,e,n,r,i,o){return m([t,"thumbnail"])+"?sessionID="+encodeURIComponent(e)+"&pathOrUid="+encodeURIComponent(n)+"&orientation="+(r||0)+"&w="+(i||0)+"&h="+(o||0)},O=function(t,e,n,r,i,o,a){a||(a="jpg"),i=i||150,o=o||150;var s="0";r.channels&&(s=r.channels.join(","));var l=r.timeframe?r.timeframe:0,u=r.layer?r.layer:0,c=Math.max(i/r.width,o/r.height);(r.width*c<1||r.height<1)&&(c=1/Math.max(r.width,r.height));var h=r.rotation?r.rotation:0;return m([t,"region"])+"?sessionID="+encodeURIComponent(e)+"&pathOrUid="+encodeURIComponent(n)+"&format="+encodeURIComponent(a)+"&timeframe="+l+"&layer="+u+"&channels="+s+"&x="+Math.floor(r.x)+"&y="+Math.floor(r.y)+"&width="+Math.floor(r.width)+"&height="+Math.floor(r.height)+"&scale="+c+"&rotation="+h+"&flipHorizontal="+r.flipHorizontally+"&flipVertical="+r.flipVertically},C=function(t,e,n,r){return m([t,"barcode"])+"?sessionID="+encodeURIComponent(e)+"&pathOrUid="+encodeURIComponent(n)+"&rotation="+(r||0)}},function(t,e,n){"use strict";function r(){return function(){throw new Error("Unimplemented abstract method.")}()}n.d(e,"b",(function(){return r})),n.d(e,"c",(function(){return o})),n.d(e,"a",(function(){return a}));var i=0;function o(t){return t.ol_uid||(t.ol_uid=String(++i))}var a="6.6.1"},function(t,e,n){"use strict";n.d(e,"i",(function(){return r})),n.d(e,"c",(function(){return i})),n.d(e,"a",(function(){return o})),n.d(e,"f",(function(){return a})),n.d(e,"b",(function(){return s})),n.d(e,"d",(function(){return l})),n.d(e,"e",(function(){return u})),n.d(e,"g",(function(){return c})),n.d(e,"h",(function(){return h}));var r={Default:"default",Classic:"classic",Modern:"modern"},i={N:"n",S:"s",E:"e",W:"w",NE:"ne",NW:"nw",SE:"se",SW:"sw"},o={Rectangle:"Rectangle",Arrow:"Arrow",Line:"Line",Icon:"Icon",Point:"Point",MultiPoint:"MultiPoint",Freehand:"Freehand",ClosedFreehand:"ClosedFreehand",CompoundFreehand:"CompoundFreehand",Ellipse:"Ellipse",Circle:"Circle",Polygon:"Polygon",LineString:"LineString"},a={Transform:"Transform",Modify:"Modify",Wand:"Wand",Brush:"Brush",Eraser:"Eraser"},s={Pristine:1,Added:2,Modified:3,Deleted:4},l={ZoomSlider:"zoomslider",ScaleLine:"scaleline",Overview:"overview",Barcode:"barcode",Magnifier:"magnifier",ColorAdjustments:"coloradjustments",LayerSwitch:"layerswitch",DimensionSelector:"dimensionselector",Filename:"filename",Snapshot:"shapshot",Rotation:"rotation",Attribution:"attribution",Fullscreen:"fullscreen"},u="rgba(255, 255, 255, 0.2)",c={DimensionsChanged:"change:dimension",ViewChanged:"viewchanged",TilesError:"tileserror",SlideLoadError:"SlideLoadError",FilenameClick:"click:filename",AnnotationLayerChanged:"layer:change"},h={Min:"min","1X":"1","2X":"2","5X":"5","10X":"10","20X":"20","40X":"40","1:1":"1:1",Max:"max"}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r})),n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"d",(function(){return a}));var r="function"==typeof Object.assign?Object.assign:function(t,e){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var n=Object(t),r=1,i=arguments.length;r<i;++r){var o=arguments[r];if(null!=o)for(var a in o)o.hasOwnProperty(a)&&(n[a]=o[a])}return n};function i(t){for(var e in t)delete t[e]}var o="function"==typeof Object.values?Object.values:function(t){var e=[];for(var n in t)e.push(t[n]);return e};function a(t){var e;for(e in t)return!1;return!e}},function(t,e,n){"use strict";function r(t,e,n){for(var r,o,a=n||i,s=0,l=t.length,u=!1;s<l;)(o=+a(t[r=s+(l-s>>1)],e))<0?s=r+1:(l=r,u=!o);return u?s:~s}function i(t,e){return t>e?1:t<e?-1:0}function o(t,e){return t.indexOf(e)>=0}function a(t,e,n){var r=t.length;if(t[0]<=e)return 0;if(e<=t[r-1])return r-1;var i=void 0;if(n>0){for(i=1;i<r;++i)if(t[i]<e)return i-1}else if(n<0){for(i=1;i<r;++i)if(t[i]<=e)return i}else for(i=1;i<r;++i){if(t[i]==e)return i;if(t[i]<e)return"function"==typeof n?n(e,t[i-1],t[i])>0?i-1:i:t[i-1]-e<e-t[i]?i-1:i}return r-1}function s(t,e,n){for(;e<n;){var r=t[e];t[e]=t[n],t[n]=r,++e,--n}}function l(t,e){for(var n=Array.isArray(e)?e:[e],r=n.length,i=0;i<r;i++)t[t.length]=n[i]}function u(t,e){for(var n,r=t.length>>>0,i=0;i<r;i++)if(e(n=t[i],i,t))return n;return null}function c(t,e){var n=t.length;if(n!==e.length)return!1;for(var r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}function h(t,e){var n;return!t.every((function(r,i){return n=i,!e(r,i,t)}))?n:-1}function p(t,e,n){var r=e||i;return t.every((function(e,i){if(0===i)return!0;var o=r(t[i-1],e);return!(o>0||n&&0===o)}))}n.d(e,"a",(function(){return r})),n.d(e,"i",(function(){return i})),n.d(e,"f",(function(){return o})),n.d(e,"h",(function(){return a})),n.d(e,"j",(function(){return s})),n.d(e,"c",(function(){return l})),n.d(e,"d",(function(){return u})),n.d(e,"b",(function(){return c})),n.d(e,"e",(function(){return h})),n.d(e,"g",(function(){return p}))},function(t,e,n){"use strict";function r(t,e,n){return Math.min(Math.max(t,e),n)}n.d(e,"a",(function(){return r})),n.d(e,"b",(function(){return i})),n.d(e,"d",(function(){return o})),n.d(e,"h",(function(){return a})),n.d(e,"g",(function(){return s})),n.d(e,"f",(function(){return l})),n.d(e,"i",(function(){return u})),n.d(e,"j",(function(){return c})),n.d(e,"e",(function(){return h})),n.d(e,"c",(function(){return p}));var i="cosh"in Math?Math.cosh:function(t){var e=Math.exp(t);return(e+1/e)/2},o="log2"in Math?Math.log2:function(t){return Math.log(t)*Math.LOG2E};function a(t,e,n,r,i,o){var a=i-n,l=o-r;if(0!==a||0!==l){var u=((t-n)*a+(e-r)*l)/(a*a+l*l);u>1?(n=i,r=o):u>0&&(n+=a*u,r+=l*u)}return s(t,e,n,r)}function s(t,e,n,r){var i=n-t,o=r-e;return i*i+o*o}function l(t){for(var e=t.length,n=0;n<e;n++){for(var r=n,i=Math.abs(t[n][n]),o=n+1;o<e;o++){var a=Math.abs(t[o][n]);a>i&&(i=a,r=o)}if(0===i)return null;var s=t[r];t[r]=t[n],t[n]=s;for(var l=n+1;l<e;l++)for(var u=-t[l][n]/t[n][n],c=n;c<e+1;c++)n==c?t[l][c]=0:t[l][c]+=u*t[n][c]}for(var h=new Array(e),p=e-1;p>=0;p--){h[p]=t[p][e]/t[p][p];for(var d=p-1;d>=0;d--)t[d][e]-=t[d][p]*h[p]}return h}function u(t){return 180*t/Math.PI}function c(t){return t*Math.PI/180}function h(t,e){var n=t%e;return n*e<0?n+e:n}function p(t,e,n){return t+n*(e-t)}},function(t,e,n){"use strict";e.a={CHANGE:"change",ERROR:"error",BLUR:"blur",CLEAR:"clear",CONTEXTMENU:"contextmenu",CLICK:"click",DBLCLICK:"dblclick",DRAGENTER:"dragenter",DRAGOVER:"dragover",DROP:"drop",FOCUS:"focus",KEYDOWN:"keydown",KEYPRESS:"keypress",LOAD:"load",RESIZE:"resize",TOUCHMOVE:"touchmove",WHEEL:"wheel"}},function(t,e,n){"use strict";n.r(e),n.d(e,"listen",(function(){return i})),n.d(e,"listenOnce",(function(){return o})),n.d(e,"unlistenByKey",(function(){return a}));var r=n(6);function i(t,e,n,r,i){if(r&&r!==t&&(n=n.bind(r)),i){var o=n;n=function(){t.removeEventListener(e,n),o.apply(this,arguments)}}var a={target:t,type:e,listener:n};return t.addEventListener(e,n),a}function o(t,e,n,r){return i(t,e,n,r,!0)}function a(t){t&&t.target&&(t.target.removeEventListener(t.type,t.listener),Object(r.b)(t))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r=n(87),i=n.n(r),o="",a={},s={Labels:a,setCulture:function(t){o=t},interpolate:function(t,e){return t.replace(/{([^{}]*)}/g,(function(t,n){var r=e[n];return"string"==typeof r||"number"==typeof r?r:t}))},translate:function(t,e){return""!==o&&a[o].hasOwnProperty(t)&&(t=a[o][t]),"object"===i()(e)?this.interpolate(t,e):t}}},function(t,e){t.exports=jQuery},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(190);function i(t,e){if(!t)throw new r.a(e)}},function(t,e,n){"use strict";n.d(e,"c",(function(){return s})),n.d(e,"g",(function(){return l})),n.d(e,"f",(function(){return u})),n.d(e,"j",(function(){return h})),n.d(e,"a",(function(){return p})),n.d(e,"h",(function(){return d})),n.d(e,"i",(function(){return f})),n.d(e,"e",(function(){return g})),n.d(e,"l",(function(){return y})),n.d(e,"b",(function(){return m})),n.d(e,"d",(function(){return v})),n.d(e,"k",(function(){return _}));var r,i=n(57),o=n(13),a=new Array(6);function s(){return[1,0,0,1,0,0]}function l(t){return c(t,1,0,0,1,0,0)}function u(t,e){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],l=e[0],u=e[1],c=e[2],h=e[3],p=e[4],d=e[5];return t[0]=n*l+i*u,t[1]=r*l+o*u,t[2]=n*c+i*h,t[3]=r*c+o*h,t[4]=n*p+i*d+a,t[5]=r*p+o*d+s,t}function c(t,e,n,r,i,o,a){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=a,t}function h(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function p(t,e){var n=e[0],r=e[1];return e[0]=t[0]*n+t[2]*r+t[4],e[1]=t[1]*n+t[3]*r+t[5],e}function d(t,e){var n=Math.cos(e),r=Math.sin(e);return u(t,c(a,n,r,-r,n,0,0))}function f(t,e,n){return u(t,c(a,e,0,0,n,0,0))}function g(t,e,n){return c(t,e,0,0,n,0,0)}function y(t,e,n){return u(t,c(a,1,0,0,1,e,n))}function m(t,e,n,r,i,o,a,s){var l=Math.sin(o),u=Math.cos(o);return t[0]=r*u,t[1]=i*l,t[2]=-r*l,t[3]=i*u,t[4]=a*r*u-s*r*l+e,t[5]=a*i*l+s*i*u+n,t}function v(t,e){var n,r=(n=e)[0]*n[3]-n[1]*n[2];Object(o.a)(0!==r,32);var i=e[0],a=e[1],s=e[2],l=e[3],u=e[4],c=e[5];return t[0]=l/r,t[1]=-a/r,t[2]=-s/r,t[3]=i/r,t[4]=(s*c-l*u)/r,t[5]=-(i*c-a*u)/r,t}function _(t){var e="matrix("+t.join(", ")+")";if(i.g)return e;var n=r||(r=document.createElement("div"));return n.style.transform=e,n.style.transform}},function(t,e,n){"use strict";e.a={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4}},function(t,e,n){"use strict";e.a={XY:"XY",XYZ:"XYZ",XYM:"XYM",XYZM:"XYZM"}},function(t,e,n){"use strict";n.d(e,"c",(function(){return u})),n.d(e,"b",(function(){return c})),n.d(e,"d",(function(){return h})),n.d(e,"e",(function(){return p})),n.d(e,"f",(function(){return d})),n.d(e,"g",(function(){return f})),n.d(e,"i",(function(){return g})),n.d(e,"k",(function(){return y})),n.d(e,"l",(function(){return m})),n.d(e,"m",(function(){return v})),n.d(e,"j",(function(){return _})),n.d(e,"h",(function(){return b})),n.d(e,"a",(function(){return w})),n.d(e,"o",(function(){return x})),n.d(e,"s",(function(){return T})),n.d(e,"q",(function(){return I})),n.d(e,"p",(function(){return R})),n.d(e,"r",(function(){return M})),n.d(e,"n",(function(){return N}));var r=n(54),i=n(98),o=n(57),a=n(6),s=n(25),l=n(36),u="10px sans-serif",c="#000",h="round",p=[],d=0,f="round",g=10,y="#000",m="center",v="middle",_=[0,0,0,0],b=1,w=new r.a,x=new i.a;x.setSize=function(){console.warn("labelCache is deprecated.")};var E,S,O=null,C={},T=function(){var t,e,n=["monospace","serif"],r=n.length,i="wmytzilWMYTZIL@#/&?$%10";function o(t,o,a){for(var s=!0,l=0;l<r;++l){var u=n[l];if(e=P(t+" "+o+" 32px "+u,i),a!=u){var c=P(t+" "+o+" 32px "+a+","+u,i);s=s&&c!=e}}return!!s}function s(){for(var e=!0,n=w.getKeys(),r=0,i=n.length;r<i;++r){var s=n[r];w.get(s)<100&&(o.apply(this,s.split("\n"))?(Object(a.b)(C),O=null,E=void 0,w.set(s,100)):(w.set(s,w.get(s)+1,!0),e=!1))}e&&(clearInterval(t),t=void 0)}return function(e){var n=Object(l.g)(e);if(n)for(var r=n.families,i=0,a=r.length;i<a;++i){var u=r[i],c=n.style+"\n"+n.weight+"\n"+u;void 0===w.get(c)&&(w.set(c,100,!0),o(n.style,n.weight,u)||(w.set(c,0,!0),void 0===t&&(t=setInterval(s,32))))}}}(),I=function(t){var e=C[t];if(null==e){if(o.g){var n=Object(l.g)(t),r=L(t,"Žg");e=(isNaN(Number(n.lineHeight))?1.2:Number(n.lineHeight))*(r.actualBoundingBoxAscent+r.actualBoundingBoxDescent)}else S||((S=document.createElement("div")).innerHTML="M",S.style.minHeight="0",S.style.maxHeight="none",S.style.height="auto",S.style.padding="0",S.style.border="none",S.style.position="absolute",S.style.display="block",S.style.left="-99999px"),S.style.font=t,document.body.appendChild(S),e=S.offsetHeight,document.body.removeChild(S);C[t]=e}return e};function L(t,e){return O||(O=Object(s.a)(1,1)),t!=E&&(O.font=t,E=O.font),O.measureText(e)}function P(t,e){return L(t,e).width}function R(t,e,n){if(e in n)return n[e];var r=P(t,e);return n[e]=r,r}function M(t,e,n){for(var r=e.length,i=0,o=0;o<r;++o){var a=P(t,e[o]);i=Math.max(i,a),n.push(a)}return i}function N(t,e,n,r,i,o,a,s,l,u,c){t.save(),1!==n&&(t.globalAlpha*=n),e&&t.setTransform.apply(t,e),r.contextInstructions?(t.translate(l,u),t.scale(c[0],c[1]),function(t,e){for(var n=t.contextInstructions,r=0,i=n.length;r<i;r+=2)Array.isArray(n[r+1])?e[n[r]].apply(e,n[r+1]):e[n[r]]=n[r+1]}(r,t)):c[0]<0||c[1]<0?(t.translate(l,u),t.scale(c[0],c[1]),t.drawImage(r,i,o,a,s,0,0,a,s)):t.drawImage(r,i,o,a,s,l,u,a*c[0],s*c[1]),t.restore()}},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r=n(131),i=n(86),o=n(2),a={layer:n(217),source:n(218),tilegrid:n(55),proj:o,control:i,style:r,interaction:n(132),events:n(10),format:n(187),extent:n(0),geom:n(144)}},function(t,e,n){"use strict";n.d(e,"d",(function(){return i})),n.d(e,"e",(function(){return o})),n.d(e,"a",(function(){return a})),n.d(e,"b",(function(){return s}));var r={BEGIN_GEOMETRY:0,BEGIN_PATH:1,CIRCLE:2,CLOSE_PATH:3,CUSTOM:4,DRAW_CHARS:5,DRAW_IMAGE:6,END_GEOMETRY:7,FILL:8,MOVE_TO_LINE_TO:9,SET_FILL_STYLE:10,SET_STROKE_STYLE:11,STROKE:12},i=[r.FILL],o=[r.STROKE],a=[r.BEGIN_PATH],s=[r.CLOSE_PATH];e.c=r},function(t,e,n){"use strict";n.d(e,"a",(function(){return s})),n.d(e,"b",(function(){return l})),n.d(e,"c",(function(){return u})),n.d(e,"f",(function(){return c})),n.d(e,"d",(function(){return h})),n.d(e,"e",(function(){return p})),n.d(e,"g",(function(){return d})),n.d(e,"i",(function(){return f})),n.d(e,"k",(function(){return g})),n.d(e,"n",(function(){return y})),n.d(e,"j",(function(){return m})),n.d(e,"m",(function(){return v})),n.d(e,"o",(function(){return _})),n.d(e,"h",(function(){return b})),n.d(e,"l",(function(){return w}));var r=n(29),i=n(30),o=n(57),a=n(13);function s(t){var e=arguments;return function(t){for(var n=!0,r=0,i=e.length;r<i&&(n=n&&e[r](t));++r);return n}}var l=function(t){var e=t.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey},u=function(t){var e=t.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},c=function(t){return!t.map.getTargetElement().hasAttribute("tabindex")||function(t){return t.target.getTargetElement().contains(document.activeElement)}(t)},h=i.b,p=function(t){return t.type==r.a.CLICK},d=function(t){var e=t.originalEvent;return 0==e.button&&!(o.f&&o.d&&e.ctrlKey)},f=i.a,g=function(t){return"pointermove"==t.type},y=function(t){return t.type==r.a.SINGLECLICK},m=function(t){var e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey},v=function(t){var e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},_=function(t){var e=t.originalEvent.target.tagName;return"INPUT"!==e&&"SELECT"!==e&&"TEXTAREA"!==e},b=function(t){var e=t.originalEvent;return Object(a.a)(void 0!==e,56),"mouse"==e.pointerType},w=function(t){var e=t.originalEvent;return Object(a.a)(void 0!==e,56),e.isPrimary&&0===e.button}},function(t,e,n){"use strict";n.d(e,"a",(function(){return a})),n.d(e,"b",(function(){return s})),n.d(e,"c",(function(){return l})),n.d(e,"d",(function(){return u})),n.d(e,"f",(function(){return c})),n.d(e,"h",(function(){return h})),n.d(e,"i",(function(){return p})),n.d(e,"j",(function(){return d})),n.d(e,"e",(function(){return f})),n.d(e,"k",(function(){return g})),n.d(e,"l",(function(){return y})),n.d(e,"g",(function(){return m}));var r=n(0),i=n(8),o=n(96);function a(t,e){return t[0]+=+e[0],t[1]+=+e[1],t}function s(t,e){var n=e.getRadius(),r=e.getCenter(),i=r[0],o=r[1],a=t[0]-i,s=t[1]-o;0===a&&0===s&&(a=1);var l=Math.sqrt(a*a+s*s);return[i+n*a/l,o+n*s/l]}function l(t,e){var n,r,i=t[0],o=t[1],a=e[0],s=e[1],l=a[0],u=a[1],c=s[0],h=s[1],p=c-l,d=h-u,f=0===p&&0===d?0:(p*(i-l)+d*(o-u))/(p*p+d*d||0);return f<=0?(n=l,r=u):f>=1?(n=c,r=h):(n=l+f*p,r=u+f*d),[n,r]}function u(t,e,n){var r=Object(i.e)(e+180,360)-180,a=Math.abs(3600*r),s=n||0,l=Math.pow(10,s),u=Math.floor(a/3600),c=Math.floor((a-3600*u)/60),h=a-3600*u-60*c;return(h=Math.ceil(h*l)/l)>=60&&(h=0,c+=1),c>=60&&(c=0,u+=1),u+"° "+Object(o.b)(c,2)+"′ "+Object(o.b)(h,2,s)+"″"+(0==r?"":" "+t.charAt(r<0?1:0))}function c(t,e){for(var n=!0,r=t.length-1;r>=0;--r)if(t[r]!=e[r]){n=!1;break}return n}function h(t,e){var n=Math.cos(e),r=Math.sin(e),i=t[0]*n-t[1]*r,o=t[1]*n+t[0]*r;return t[0]=i,t[1]=o,t}function p(t,e){return t[0]*=e,t[1]*=e,t}function d(t,e){var n=t[0]-e[0],r=t[1]-e[1];return n*n+r*r}function f(t,e){return Math.sqrt(d(t,e))}function g(t,e){return d(t,l(t,e))}function y(t,e){if(e.canWrapX()){var n=Object(r.getWidth)(e.getExtent()),i=m(t,e,n);i&&(t[0]-=i*n)}return t}function m(t,e,n){var i=e.getExtent(),o=0;if(e.canWrapX()&&(t[0]<i[0]||t[0]>i[2])){var a=n||Object(r.getWidth)(i);o=Math.floor((t[0]-i[0])/a)}return o}},function(t,e,n){"use strict";n.d(e,"c",(function(){return E})),n.d(e,"b",(function(){return S})),n.d(e,"d",(function(){return O}));var r,i=n(16),o=n(1),a=n(114),s=n(31),l=n(62),u=n(89),c=n(0),h=n(77),p=n(7),d=n(139),f=n(75),g=n(127),y=n(105),m=n(155),v=n(104),_=n(8),b=n(100),w=(n(175),r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),x=function(t){function e(e,n,r){var i=t.call(this)||this;return i.ends_=[],i.flatInteriorPointRevision_=-1,i.flatInteriorPoint_=null,i.maxDelta_=-1,i.maxDeltaRevision_=-1,i.orientedRevision_=-1,i.orientedFlatCoordinates_=null,void 0!==n&&r?(i.setFlatCoordinates(n,e),i.ends_=r):i.setCoordinates(e,n),i}return w(e,t),e.prototype.appendLinearRing=function(t){this.flatCoordinates?Object(p.c)(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()},e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,n,r){return r<Object(c.closestSquaredDistanceXY)(this.getExtent(),t,e)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Object(u.a)(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Object(u.b)(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,t,e,n,r))},e.prototype.containsXY=function(t,e){return Object(v.c)(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,e)},e.prototype.getArea=function(){return Object(m.b)(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)},e.prototype.getCoordinates=function(t){var e;return void 0!==t?(e=this.getOrientedFlatCoordinates().slice(),Object(y.d)(e,0,this.ends_,this.stride,t)):e=this.flatCoordinates,Object(f.b)(e,0,this.ends_,this.stride)},e.prototype.getEnds=function(){return this.ends_},e.prototype.getFlatInteriorPoint=function(){if(this.flatInteriorPointRevision_!=this.getRevision()){var t=Object(c.getCenter)(this.getExtent());this.flatInteriorPoint_=Object(d.a)(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_},e.prototype.getInteriorPoint=function(){return new s.a(this.getFlatInteriorPoint(),i.a.XYM)},e.prototype.getLinearRingCount=function(){return this.ends_.length},e.prototype.getLinearRing=function(t){return t<0||this.ends_.length<=t?null:new a.a(this.flatCoordinates.slice(0===t?0:this.ends_[t-1],this.ends_[t]),this.layout)},e.prototype.getLinearRings=function(){for(var t=this.layout,e=this.flatCoordinates,n=this.ends_,r=[],i=0,o=0,s=n.length;o<s;++o){var l=n[o],u=new a.a(e.slice(i,l),t);r.push(u),i=l}return r},e.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;Object(y.b)(t,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=Object(y.d)(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},e.prototype.getSimplifiedGeometryInternal=function(t){var n=[],r=[];return n.length=Object(b.c)(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(t),n,0,r),new e(n,i.a.XY,r)},e.prototype.getType=function(){return o.a.POLYGON},e.prototype.intersectsExtent=function(t){return Object(g.c)(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);var n=Object(h.c)(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===n.length?0:n[n.length-1],this.changed()},e}(l.a);function E(t){var e=t[0],n=t[1],r=t[2],o=t[3],a=[e,n,e,o,r,o,r,n,e,n];return new x(a,i.a.XY,[a.length])}function S(t,e,n){for(var r=e||32,i=t.getStride(),o=t.getLayout(),a=t.getCenter(),s=i*(r+1),l=new Array(s),u=0;u<s;u+=i){l[u]=0,l[u+1]=0;for(var c=2;c<i;c++)l[u+c]=a[c]}var h=[l.length],p=new x(l,o,h);return O(p,a,t.getRadius(),n),p}function O(t,e,n,r){for(var i=t.getFlatCoordinates(),o=t.getStride(),a=i.length/o-1,s=r||0,l=0;l<=a;++l){var u=l*o,c=s+2*Object(_.e)(l,a)*Math.PI/a;i[u]=e[0]+n*Math.cos(c),i[u+1]=e[1]+n*Math.sin(c)}t.changed()}e.a=x},function(t,e,n){"use strict";e.a={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4}},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"b",(function(){return a})),n.d(e,"g",(function(){return s})),n.d(e,"e",(function(){return l})),n.d(e,"d",(function(){return u})),n.d(e,"f",(function(){return c}));var r=n(57);function i(t,e,n,i){var o=n&&n.length?n.shift():r.g?new OffscreenCanvas(t||300,e||300):document.createElement("canvas");return t&&(o.width=t),e&&(o.height=e),o.getContext("2d",i)}function o(t){var e=t.offsetWidth,n=getComputedStyle(t);return e+=parseInt(n.marginLeft,10)+parseInt(n.marginRight,10)}function a(t){var e=t.offsetHeight,n=getComputedStyle(t);return e+=parseInt(n.marginTop,10)+parseInt(n.marginBottom,10)}function s(t,e){var n=e.parentNode;n&&n.replaceChild(t,e)}function l(t){return t&&t.parentNode?t.parentNode.removeChild(t):null}function u(t){for(;t.lastChild;)t.removeChild(t.lastChild)}function c(t,e){for(var n=t.childNodes,r=0;;++r){var i=n[r],o=e[r];if(!i&&!o)break;i!==o&&(i?o?t.insertBefore(o,i):(t.removeChild(i),--r):t.appendChild(o))}}},function(t,e,n){"use strict";var r,i=n(54),o=n(9),a=n(13),s=n(10),l=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),u=function(t){function e(e){var n=t.call(this)||this;if(n.on,n.once,n.un,n.id_=void 0,n.geometryName_="geometry",n.style_=null,n.styleFunction_=void 0,n.geometryChangeKey_=null,n.addChangeListener(n.geometryName_,n.handleGeometryChanged_),e)if("function"==typeof e.getSimplifiedGeometry){var r=e;n.setGeometry(r)}else{var i=e;n.setProperties(i)}return n}return l(e,t),e.prototype.clone=function(){var t=new e(this.hasProperties()?this.getProperties():null);t.setGeometryName(this.getGeometryName());var n=this.getGeometry();n&&t.setGeometry(n.clone());var r=this.getStyle();return r&&t.setStyle(r),t},e.prototype.getGeometry=function(){return this.get(this.geometryName_)},e.prototype.getId=function(){return this.id_},e.prototype.getGeometryName=function(){return this.geometryName_},e.prototype.getStyle=function(){return this.style_},e.prototype.getStyleFunction=function(){return this.styleFunction_},e.prototype.handleGeometryChange_=function(){this.changed()},e.prototype.handleGeometryChanged_=function(){this.geometryChangeKey_&&(Object(s.unlistenByKey)(this.geometryChangeKey_),this.geometryChangeKey_=null);var t=this.getGeometry();t&&(this.geometryChangeKey_=Object(s.listen)(t,o.a.CHANGE,this.handleGeometryChange_,this)),this.changed()},e.prototype.setGeometry=function(t){this.set(this.geometryName_,t)},e.prototype.setStyle=function(t){this.style_=t,this.styleFunction_=t?function(t){if("function"==typeof t)return t;var e;Array.isArray(t)?e=t:(Object(a.a)("function"==typeof t.getZIndex,41),e=[t]);return function(){return e}}(t):void 0,this.changed()},e.prototype.setId=function(t){this.id_=t,this.changed()},e.prototype.setGeometryName=function(t){this.removeChangeListener(this.geometryName_,this.handleGeometryChanged_),this.geometryName_=t,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),this.handleGeometryChanged_()},e}(i.a);e.a=u},function(t,e){function n(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}t.exports=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t}},function(t,e){function n(e){return t.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},n(e)}t.exports=n},function(t,e,n){"use strict";var r=n(9);e.a={SINGLECLICK:"singleclick",CLICK:r.a.CLICK,DBLCLICK:r.a.DBLCLICK,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"}},function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"a",(function(){return o})),n.d(e,"c",(function(){return a})),n.d(e,"d",(function(){return s}));var r=n(7);function i(){return!0}function o(){return!1}function a(){}function s(t){var e,n,i,o=!1;return function(){var a=Array.prototype.slice.call(arguments);return o&&this===i&&Object(r.b)(a,n)||(o=!0,i=this,n=a,e=t.apply(this,arguments)),e}}},function(t,e,n){"use strict";var r,i=n(1),o=n(62),a=n(0),s=n(77),l=n(8),u=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),c=function(t){function e(e,n){var r=t.call(this)||this;return r.setCoordinates(e,n),r}return u(e,t),e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,n,r){var i=this.flatCoordinates,o=Object(l.g)(t,e,i[0],i[1]);if(o<r){for(var a=this.stride,s=0;s<a;++s)n[s]=i[s];return n.length=a,o}return r},e.prototype.getCoordinates=function(){return this.flatCoordinates?this.flatCoordinates.slice():[]},e.prototype.computeExtent=function(t){return Object(a.createOrUpdateFromCoordinate)(this.flatCoordinates,t)},e.prototype.getType=function(){return i.a.POINT},e.prototype.intersectsExtent=function(t){return Object(a.containsXY)(t,this.flatCoordinates[0],this.flatCoordinates[1])},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,0),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Object(s.a)(this.flatCoordinates,0,t,this.stride),this.changed()},e}(o.a);e.a=c},function(t,e){t.exports=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}},function(t,e,n){"use strict";n.d(e,"c",(function(){return l})),n.d(e,"b",(function(){return u}));var r=n(52),i=n(4),o=n(6),a=n(2),s=function(){function t(){this.dataProjection=void 0,this.defaultFeatureProjection=void 0}return t.prototype.getReadOptions=function(t,e){var n;if(e){var i=e.dataProjection?Object(a.get)(e.dataProjection):this.readProjection(t);e.extent&&i&&i.getUnits()===r.b.TILE_PIXELS&&(i=Object(a.get)(i)).setWorldExtent(e.extent),n={dataProjection:i,featureProjection:e.featureProjection}}return this.adaptOptions(n)},t.prototype.adaptOptions=function(t){return Object(o.a)({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection},t)},t.prototype.getType=function(){return Object(i.b)()},t.prototype.readFeature=function(t,e){return Object(i.b)()},t.prototype.readFeatures=function(t,e){return Object(i.b)()},t.prototype.readGeometry=function(t,e){return Object(i.b)()},t.prototype.readProjection=function(t){return Object(i.b)()},t.prototype.writeFeature=function(t,e){return Object(i.b)()},t.prototype.writeFeatures=function(t,e){return Object(i.b)()},t.prototype.writeGeometry=function(t,e){return Object(i.b)()},t}();function l(t,e,n){var r,i=n?Object(a.get)(n.featureProjection):null,o=n?Object(a.get)(n.dataProjection):null;if(r=i&&o&&!Object(a.equivalent)(i,o)?(e?t.clone():t).transform(e?i:o,e?o:i):t,e&&n&&void 0!==n.decimals){var s=Math.pow(10,n.decimals);r===t&&(r=t.clone()),r.applyTransform((function(t){for(var e=0,n=t.length;e<n;++e)t[e]=Math.round(t[e]*s)/s;return t}))}return r}function u(t,e){var n=e?Object(a.get)(e.featureProjection):null,r=e?Object(a.get)(e.dataProjection):null;return n&&r&&!Object(a.equivalent)(n,r)?Object(a.transformExtent)(t,r,n):t}e.a=s},function(t,e,n){"use strict";e.a={CIRCLE:"Circle",DEFAULT:"Default",IMAGE:"Image",LINE_STRING:"LineString",POLYGON:"Polygon",TEXT:"Text"}},function(t,e,n){"use strict";function r(t,e,n){return void 0===n&&(n=[0,0]),n[0]=t[0]+2*e,n[1]=t[1]+2*e,n}function i(t){return t[0]>0&&t[1]>0}function o(t,e,n){return void 0===n&&(n=[0,0]),n[0]=t[0]*e+.5|0,n[1]=t[1]*e+.5|0,n}function a(t,e){return Array.isArray(t)?t:(void 0===e?e=[t,t]:(e[0]=t,e[1]=t),e)}n.d(e,"a",(function(){return r})),n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"d",(function(){return a}))},function(t,e,n){"use strict";n.d(e,"c",(function(){return r})),n.d(e,"d",(function(){return i})),n.d(e,"e",(function(){return o})),n.d(e,"f",(function(){return a})),n.d(e,"b",(function(){return s})),n.d(e,"a",(function(){return l})),n.d(e,"g",(function(){return h}));var r="ol-hidden",i="ol-selectable",o="ol-unselectable",a="ol-unsupported",s="ol-control",l="ol-collapsed",u=new RegExp(["^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00 ))?)","(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?","(?:small|large)|medium|smaller|larger|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))","(?:\\s*\\/\\s*(normal|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])?))","?\\s*([-,\\\"\\'\\sa-z]+?)\\s*$"].join(""),"i"),c=["style","variant","weight","size","lineHeight","family"],h=function(t){var e=t.match(u);if(!e)return null;for(var n={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"},r=0,i=c.length;r<i;++r){var o=e[r+1];void 0!==o&&(n[c[r]]=o)}return n.families=n.family.split(/,\s?/),n}},function(t,e,n){"use strict";var r,i=n(190),o=n(54),a=n(49),s=n(40),l=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),u="length",c=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.element=n,i.index=r,i}return l(e,t),e}(s.a),h=function(t){function e(e,n){var r=t.call(this)||this;r.on,r.once,r.un;var i=n||{};if(r.unique_=!!i.unique,r.array_=e||[],r.unique_)for(var o=0,a=r.array_.length;o<a;++o)r.assertUnique_(r.array_[o],o);return r.updateLength_(),r}return l(e,t),e.prototype.clear=function(){for(;this.getLength()>0;)this.pop()},e.prototype.extend=function(t){for(var e=0,n=t.length;e<n;++e)this.push(t[e]);return this},e.prototype.forEach=function(t){for(var e=this.array_,n=0,r=e.length;n<r;++n)t(e[n],n,e)},e.prototype.getArray=function(){return this.array_},e.prototype.item=function(t){return this.array_[t]},e.prototype.getLength=function(){return this.get(u)},e.prototype.insertAt=function(t,e){this.unique_&&this.assertUnique_(e),this.array_.splice(t,0,e),this.updateLength_(),this.dispatchEvent(new c(a.a.ADD,e,t))},e.prototype.pop=function(){return this.removeAt(this.getLength()-1)},e.prototype.push=function(t){this.unique_&&this.assertUnique_(t);var e=this.getLength();return this.insertAt(e,t),this.getLength()},e.prototype.remove=function(t){for(var e=this.array_,n=0,r=e.length;n<r;++n)if(e[n]===t)return this.removeAt(n)},e.prototype.removeAt=function(t){var e=this.array_[t];return this.array_.splice(t,1),this.updateLength_(),this.dispatchEvent(new c(a.a.REMOVE,e,t)),e},e.prototype.setAt=function(t,e){var n=this.getLength();if(t<n){this.unique_&&this.assertUnique_(e,t);var r=this.array_[t];this.array_[t]=e,this.dispatchEvent(new c(a.a.REMOVE,r,t)),this.dispatchEvent(new c(a.a.ADD,e,t))}else{for(var i=n;i<t;++i)this.insertAt(i,void 0);this.insertAt(t,e)}},e.prototype.updateLength_=function(){this.set(u,this.array_.length)},e.prototype.assertUnique_=function(t,e){for(var n=0,r=this.array_.length;n<r;++n)if(this.array_[n]===t&&n!==e)throw new i.a(58)},e}(o.a);e.a=h},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var r,i=n(70),o=n(29),a=n(6),s=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),l=function(t){function e(e){var n=this,r=e||{};return n=t.call(this,r)||this,r.handleDownEvent&&(n.handleDownEvent=r.handleDownEvent),r.handleDragEvent&&(n.handleDragEvent=r.handleDragEvent),r.handleMoveEvent&&(n.handleMoveEvent=r.handleMoveEvent),r.handleUpEvent&&(n.handleUpEvent=r.handleUpEvent),r.stopDown&&(n.stopDown=r.stopDown),n.handlingDownUpSequence=!1,n.trackedPointers_={},n.targetPointers=[],n}return s(e,t),e.prototype.getPointerCount=function(){return this.targetPointers.length},e.prototype.handleDownEvent=function(t){return!1},e.prototype.handleDragEvent=function(t){},e.prototype.handleEvent=function(t){if(!t.originalEvent)return!0;var e=!1;if(this.updateTrackedPointers_(t),this.handlingDownUpSequence){if(t.type==o.a.POINTERDRAG)this.handleDragEvent(t),t.originalEvent.preventDefault();else if(t.type==o.a.POINTERUP){var n=this.handleUpEvent(t);this.handlingDownUpSequence=n&&this.targetPointers.length>0}}else if(t.type==o.a.POINTERDOWN){var r=this.handleDownEvent(t);this.handlingDownUpSequence=r,e=this.stopDown(r)}else t.type==o.a.POINTERMOVE&&this.handleMoveEvent(t);return!e},e.prototype.handleMoveEvent=function(t){},e.prototype.handleUpEvent=function(t){return!1},e.prototype.stopDown=function(t){return t},e.prototype.updateTrackedPointers_=function(t){if(function(t){var e=t.type;return e===o.a.POINTERDOWN||e===o.a.POINTERDRAG||e===o.a.POINTERUP}(t)){var e=t.originalEvent,n=e.pointerId.toString();t.type==o.a.POINTERUP?delete this.trackedPointers_[n]:(t.type==o.a.POINTERDOWN||n in this.trackedPointers_)&&(this.trackedPointers_[n]=e),this.targetPointers=Object(a.c)(this.trackedPointers_)}},e}(i.a);function u(t){for(var e=t.length,n=0,r=0,i=0;i<e;i++)n+=t[i].clientX,r+=t[i].clientY;return[n/e,r/e]}e.b=l},function(t,e,n){"use strict";e.a={UNDEFINED:"undefined",LOADING:"loading",READY:"ready",ERROR:"error"}},function(t,e,n){"use strict";n.d(e,"b",(function(){return i}));var r=function(){function t(t){this.propagationStopped,this.defaultPrevented,this.type=t,this.target=null}return t.prototype.preventDefault=function(){this.defaultPrevented=!0},t.prototype.stopPropagation=function(){this.propagationStopped=!0},t}();function i(t){t.stopPropagation()}e.a=r},function(t,e,n){"use strict";n.d(e,"d",(function(){return u})),n.d(e,"a",(function(){return h})),n.d(e,"b",(function(){return p}));var r=n(134),i=n(59),o=n(1),a=n(61),s=n(13),l=function(){function t(t){var e=t||{};this.geometry_=null,this.geometryFunction_=d,void 0!==e.geometry&&this.setGeometry(e.geometry),this.fill_=void 0!==e.fill?e.fill:null,this.image_=void 0!==e.image?e.image:null,this.renderer_=void 0!==e.renderer?e.renderer:null,this.stroke_=void 0!==e.stroke?e.stroke:null,this.text_=void 0!==e.text?e.text:null,this.zIndex_=e.zIndex}return t.prototype.clone=function(){var e=this.getGeometry();return e&&"object"==typeof e&&(e=e.clone()),new t({geometry:e,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,renderer:this.getRenderer(),stroke:this.getStroke()?this.getStroke().clone():void 0,text:this.getText()?this.getText().clone():void 0,zIndex:this.getZIndex()})},t.prototype.getRenderer=function(){return this.renderer_},t.prototype.setRenderer=function(t){this.renderer_=t},t.prototype.getGeometry=function(){return this.geometry_},t.prototype.getGeometryFunction=function(){return this.geometryFunction_},t.prototype.getFill=function(){return this.fill_},t.prototype.setFill=function(t){this.fill_=t},t.prototype.getImage=function(){return this.image_},t.prototype.setImage=function(t){this.image_=t},t.prototype.getStroke=function(){return this.stroke_},t.prototype.setStroke=function(t){this.stroke_=t},t.prototype.getText=function(){return this.text_},t.prototype.setText=function(t){this.text_=t},t.prototype.getZIndex=function(){return this.zIndex_},t.prototype.setGeometry=function(t){"function"==typeof t?this.geometryFunction_=t:"string"==typeof t?this.geometryFunction_=function(e){return e.get(t)}:t?void 0!==t&&(this.geometryFunction_=function(){return t}):this.geometryFunction_=d,this.geometry_=t},t.prototype.setZIndex=function(t){this.zIndex_=t},t}();function u(t){var e;if("function"==typeof t)e=t;else{var n;if(Array.isArray(t))n=t;else Object(s.a)("function"==typeof t.getZIndex,41),n=[t];e=function(){return n}}return e}var c=null;function h(t,e){if(!c){var n=new i.a({color:"rgba(255,255,255,0.4)"}),o=new a.a({color:"#3399CC",width:1.25});c=[new l({image:new r.a({fill:n,stroke:o,radius:5}),fill:n,stroke:o})]}return c}function p(){var t={},e=[255,255,255,1],n=[0,153,255,1];return t[o.a.POLYGON]=[new l({fill:new i.a({color:[255,255,255,.5]})})],t[o.a.MULTI_POLYGON]=t[o.a.POLYGON],t[o.a.LINE_STRING]=[new l({stroke:new a.a({color:e,width:5})}),new l({stroke:new a.a({color:n,width:3})})],t[o.a.MULTI_LINE_STRING]=t[o.a.LINE_STRING],t[o.a.CIRCLE]=t[o.a.POLYGON].concat(t[o.a.LINE_STRING]),t[o.a.POINT]=[new l({image:new r.a({radius:6,fill:new i.a({color:n}),stroke:new a.a({color:e,width:1.5})}),zIndex:1/0})],t[o.a.MULTI_POINT]=t[o.a.POINT],t[o.a.GEOMETRY_COLLECTION]=t[o.a.POLYGON].concat(t[o.a.LINE_STRING],t[o.a.POINT]),t}function d(t){return t.getGeometry()}e.c=l},function(t,e,n){"use strict";n.d(e,"o",(function(){return R})),n.d(e,"a",(function(){return M})),n.d(e,"q",(function(){return k})),n.d(e,"p",(function(){return B})),n.d(e,"b",(function(){return q})),n.d(e,"n",(function(){return W})),n.d(e,"f",(function(){return K})),n.d(e,"d",(function(){return Z})),n.d(e,"e",(function(){return J})),n.d(e,"u",(function(){return et})),n.d(e,"r",(function(){return nt})),n.d(e,"k",(function(){return it})),n.d(e,"v",(function(){return at})),n.d(e,"c",(function(){return st})),n.d(e,"i",(function(){return lt})),n.d(e,"j",(function(){return ut})),n.d(e,"g",(function(){return ct})),n.d(e,"h",(function(){return ht})),n.d(e,"s",(function(){return dt})),n.d(e,"l",(function(){return ft})),n.d(e,"t",(function(){return yt})),n.d(e,"m",(function(){return mt}));var r=n(133),i=n.n(r),o=n(87),a=n.n(o),s=n(44),l=n(5),u=n(18),c=n(41),h=n(204),p=n(20),d=n(123),f=n(163),g=n(11),y=n(205),m=n(171),v=n(160),_=n(206),b=n(207),w=n(208),x=n(209),E=n(180),S=n(210),O=n(211),C=n(212),T=n(172),I=n(150);function L(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}var P={};function R(){this.imageInfo?(this.serviceUrl=this.imageInfo.BaseUrl+"api/json/",this.imagesUrl=this.imageInfo.BaseUrl,this.sessionID?V.call(this):B.call(this,V)):U.call(this,0)}function M(t,e,n){t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent&&t.attachEvent("on"+e,n)}function N(t,e){return-1!==(" "+t.className+" ").indexOf(" "+e+" ")}function j(t,e){t&&(N(t,e)||(t.className+=" "+e))}function A(t,e){t&&N(t,e)&&(t.className=t.className.replace(new RegExp(e,"g"),""))}function k(t){if(null==t||""===t)return null;var e=JSON.parse(t);return e.hasOwnProperty("d")?e.d:e}function F(t,e){if(!0===this.options.flip.horizontally||!0===this.options.flip.vertically||0!==this.imageAdjustments.brightness||1!==this.imageAdjustments.contrast||1!==this.imageAdjustments.gamma||null!==this.imageAdjustments.rgb&&(1!=this.imageAdjustments.rgb[0]||1!=this.imageAdjustments.rgb[1]||1!=this.imageAdjustments.rgb[2])||this.imageAdjustments.tileTransformers&&0!==this.imageAdjustments.tileTransformers.length){var n=new Image;n.crossOrigin="";var r=this;n.onload=function(){var e=document.createElement("canvas");e.width=n.width,e.height=n.height;var i=e.getContext("2d"),o=r.options.flip.horizontally?n.width:0,a=r.options.flip.vertically?n.height:0,s=r.options.flip.horizontally?-1:1,l=r.options.flip.vertically?-1:1;if(i.translate(o,a),i.scale(s,l),i.drawImage(n,0,0),0!==r.imageAdjustments.brightness||1!==r.imageAdjustments.contrast||1!==r.imageAdjustments.gamma||null!==r.imageAdjustments.rgb&&(1!=r.imageAdjustments.rgb[0]||1!=r.imageAdjustments.rgb[1]||1!=r.imageAdjustments.rgb[2])||r.imageAdjustments.tileTransformers&&r.imageAdjustments.tileTransformers.length>0){var u=i.getImageData(0,0,e.width,e.height);if(r.imageAdjustments.tileTransformers)for(var c=0;c<r.imageAdjustments.tileTransformers.length;c++)r.imageAdjustments.tileTransformers[c](u);var h=r.imageAdjustments.brightness,p=r.imageAdjustments.contrast;!function(t,e,n,r){var i=[];(!r||r<0)&&(r=0);for(var o=0;o<256;o++){var a=n*(o-128)+128+e;1!=r&&(a=255*Math.pow(a/255,1/r)),a[o]<0&&(a[o]=0),a[o]>255&&(a[o]=255),i.push(a)}for(o=0;o<t.length;o+=4)t[o]=i[t[o]],t[o+1]=i[t[o+1]],t[o+2]=i[t[o+2]]}(u.data,h,p,r.imageAdjustments.gamma),null===r.imageAdjustments.rgb||1==r.imageAdjustments.rgb[0]&&1==r.imageAdjustments.rgb[1]&&1==r.imageAdjustments.rgb[2]||function(t,e,n,r){for(var i=0;i<t.length;i+=4)t[i]=Math.max(0,Math.min(255,t[i]*e)),t[i+1]=Math.max(0,Math.min(255,t[i+1]*n)),t[i+2]=Math.max(0,Math.min(255,t[i+2]*r))}(u.data,r.imageAdjustments.rgb[0],r.imageAdjustments.rgb[1],r.imageAdjustments.rgb[2]),i.putImageData(u,0,0)}t.getImage().src=e.toDataURL("image/jpeg")},n.src=e}else t.getImage().src=e}function D(t,e,n){this.imageInfo.MaxZoomLevel;var r=Math.pow(2,t[0]),i=t[1];!0===this.options.flip.horizontally&&(i=r-t[1]-1);var o=t[2];return!0===this.options.flip.vertically&&(o=r-t[2]-1),this.imagesUrl+"tile?sessionID="+encodeURIComponent(this.sessionID)+"&channels="+this.channelsString+"&channelClipping="+this.channelClippingString+"&gamma="+this.channelGammaString+"&timeframe="+this.selectedTimeFrame+"&layer="+this.selectedLayer+"&pathOrUid="+encodeURIComponent(this.image)+"&x="+i+"&y="+o+"&z="+t[0]}function G(t,e,n,r){this.imageInfo.MaxZoomLevel;var i=Math.pow(2,e[0]),o=e[1];!0===this.options.flip.horizontally&&(o=i-e[1]-1);var a=e[2];return!0===this.options.flip.vertically&&(a=i-e[2]-1),this.imagesUrl+"annotatedTile?sessionID="+encodeURIComponent(this.sessionID)+"&pathOrUid="+encodeURIComponent(this.image)+"&type="+encodeURIComponent(t)+"&x="+o+"&y="+a+"&z="+e[0]}function z(t,e){if(!0===this.options.flip.horizontally||!0===this.options.flip.vertically){var n=new Image;n.crossOrigin="";var r=this;n.onload=function(){var e=document.createElement("canvas");e.width=n.width,e.height=n.height;var i=e.getContext("2d"),o=r.options.flip.horizontally?n.width:0,a=r.options.flip.vertically?n.height:0,s=r.options.flip.horizontally?-1:1,l=r.options.flip.vertically?-1:1;i.translate(o,a),i.scale(s,l),i.drawImage(n,0,0),t.getImage().src=e.toDataURL("image/png")},n.src=e}else t.getImage().src=e}function U(t){var e=this;s.a.call(this,this.serverUrls[t]+"api/json/GetVersionInfo","GET",null,(function(n){if(200==n.status){var r=this.serverUrls[t];"/"!=r[r.length-1]&&(r+="/");var i=JSON.parse(n.responseText);this.serviceUrl=r+"api/json/",this.imagesUrl=r,this.sessionID?V.call(this):B.call(this,V,i)}else{if(!(t<this.serverUrls.length-1))throw"function"==typeof e.failCallback&&e.failCallback(),"No accessible server URL found.";U.call(this,t+1)}}))}function B(t,e){var n=this;n.userInfo=null;var r=Object(I.b)(e);s.a.call(this,this.serviceUrl+"Authenticate",r?"POST":"GET",{username:this.username,password:this.password,caller:this.options.caller},(function(e){if(200!=e.status)throw"function"==typeof n.failCallback&&n.failCallback(),console.log(e),"Login failed with status "+e.status+" "+e.statusText;var r=k(e.responseText);if(!r||!0!==r.Success)throw"function"==typeof n.failCallback&&n.failCallback(),"Login failed. "+r.Reason;n.sessionID=r.SessionId,n.userInfo=r,t&&t.call(n)}),{contentType:"application/json",dataEncodeCallback:r?JSON.stringify:null})}function V(){if(this.imageInfo)Q.call(this);else{var t=this;s.a.call(this,this.serviceUrl+"GetImageInfo","GET",{sessionID:this.sessionID,pathOrUid:this.image},(function(e){if(200==e.status){var n=k(e.responseText);n?(t.imageInfo=n,Q.call(t)):("function"==typeof t.failCallback&&t.failCallback(),t.fireEvent(l.g.SlideLoadError,t),console.error("Server found but could not get image info"))}else{"function"==typeof t.failCallback&&t.failCallback();var r=0,i=g.a.translate("Unknown Error");try{if(e.responseText&&0!==e.responseText.length){var o=k(e.responseText);o&&o.hasOwnProperty("Code")&&(r=o.Code,i=g.a.translate(o.Message))}}catch(t){}this.element&&(this.element.innerHTML="Cannot load slide. "+i),t.Error={Code:r,Message:i},t.fireEvent(l.g.SlideLoadError,t),console.error("Server responded with status "+e.status+" and code "+r),console.log(e)}}))}}function q(t,e,n){for(var r=0;r<t.length;r+=n){var i=t[r],o=t[r+1];!0!==this.flip.vertically&&(o=this.extent[3]-o),!0===this.flip.horizontally&&(i=this.extent[2]-i),e[r]=i,e[r+1]=o}}function Y(t,e){var n=this;"object"===a()(this.options.annotations)&&"loadAnnotationsByFingerprint"in this.options.annotations&&this.options.annotations.loadAnnotationsByFingerprint?W.call(this,(function(r){X.call(n,t,e,r,n.options.annotations.filter)})):X.call(this,t,e,null,this.options.annotations.filter)}function X(t,e,n,r){var o=this;s.a.call(this,this.serviceUrl+"GetAnnotations","GET",function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?L(Object(n),!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):L(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({sessionID:this.sessionID,pathOrUid:this.image,currentUserOnly:!1,refresh:Math.random()},n?{fingerprint:n}:{}),(function(n){if(200==n.status){var i=k(n.responseText);if(i){var a=i;if("function"==typeof r){a=[];i.forEach((function(t){r(t)&&a.push(t)}))}var s=o.initializeFeatures(a,e);t.addFeatures(s)}}"function"==typeof o.readyCallback&&o.readyCallback()}))}function W(t){s.a.call(this,this.serviceUrl+"GetFingerprint","GET",{sessionID:this.sessionID,pathOrUid:this.image},(function(e){if(200==e.status){var n=k(e.responseText);t(n||null)}else t(null)}))}function H(){var t,e,n;null!==this.arrowPanInteraction&&this.map.removeInteraction(this.arrowPanInteraction),this.arrowPanInteraction=new u.a.interaction.KeyboardPan({pixelDelta:(t=this.options.keyboardPanFactor,e=this.element.offsetWidth,n=t*e,(isNaN(n)||n<0||!isFinite(n))&&(n=50),n),duration:0}),this.map.addInteraction(this.arrowPanInteraction)}function K(){var t=this.imageInfo.MaxZoomLevel,e=0,n=0,r=Math.pow(2,t)*this.imageInfo.TileSize;!0===this.options.flip.horizontally&&(e=r-this.imageInfo.Width),!0!==this.options.flip.vertically&&(n=r-this.imageInfo.Height);var i=1;return this.imageInfo.MicrometresPerPixelX&&this.imageInfo.MicrometresPerPixelX>0&&(i=this.imageInfo.MicrometresPerPixelX),new u.a.proj.Projection({code:"pixel",units:"pixels",extent:[e,n,e+this.imageInfo.Width,n+this.imageInfo.Height],metersPerUnit:1e-6*i,getPointResolution:function(t,e){return t}})}function Z(t,e,n,r){var i=Math.pow(2,this.imageInfo.MaxZoomLevel),o=parseInt(this.options.digitalZoomLevels);(isNaN(o)||o<=0)&&(o=0),this.options.digitalZoomLevels=o;for(var a=this.imageInfo.MaxZoomLevel,s=this.imageInfo.Width,c=this.imageInfo.Height;a>0&&(s>this.element.offsetWidth||c>this.element.offsetHeight);)s/=2,c/=2,a--;var h=[];if(this.imageInfo.MicrometresPerPixelX){var p=i,f=1/Math.pow(2,o),g=this.imageInfo.MicrometresPerPixelX;for(h=[1,2,5,10,20,40,80,160].map((function(t){return{objective:t,resolution:10/g/t}}));h[0].resolution<p;)h=[{objective:0,resolution:2*h[0].resolution}].concat(h);h[h.length-1]>f&&h.push({objective:"MAX",resolution:f})}var y=new d.a({projection:t,center:e||u.a.extent.getCenter(t.getExtent()),showFullExtent:!0,maxResolution:i,minResolution:1/Math.pow(2,o),zoom:n||a,rotation:r||0,resolutions:0==h.length?void 0:h.map((function(t){return t.resolution})),constrainResolution:!1,zoomFactor:2}),m=this;function v(){m.fireEvent(l.g.ViewChanged,m)}return y.on("change:center",v.bind(this)),y.on("change:resolution",v.bind(this)),y.on("change:rotation",v.bind(this)),y}function $(t,e){return new C.a({target:t,collapsed:e})}function J(){var t=Math.pow(2,this.imageInfo.MaxZoomLevel);return this.element.querySelector(".ol-overview")&&this.element.querySelector(".ol-overview").remove(),new v.a({maxResolution:t,tipLabel:g.a.translate("Overview"),collapsed:this.options.overview&&!0===this.options.overview.collapsed,tracking:this.options.overview&&!0===this.options.overview.tracking,stateManager:P})}function Q(){this.imageInfo.TimeFrames&&this.imageInfo.TimeFrames.TimeFrame&&(this.imageInfo.TimeFrames=[this.imageInfo.TimeFrames.TimeFrame]),this.imageInfo.TimeFrames&&0!==this.imageInfo.TimeFrames.length||(this.imageInfo.TimeFrames=[],this.imageInfo.TimeFrames.push({Layers:[{LayerID:0,Channels:[{ChannelID:0,Color:"ffffffff",Name:"Default"}]}],TimeID:0}));for(var t=0;t<this.imageInfo.TimeFrames.length;t++){var e=this.imageInfo.TimeFrames[t];e.Layers.ImageLayer&&(e.Layers=[e.Layers.ImageLayer]);for(var n=0;n<this.imageInfo.TimeFrames[t].Layers.length;n++){var r=this.imageInfo.TimeFrames[t].Layers[n];r.Channels.Channel&&(r.Channels=[r.Channels.Channel])}}for(this.selectedTimeFrame=this.options.fov&&this.options.fov.timeframe?this.options.fov.timeframe:0,this.selectedLayer=this.options.fov&&this.options.fov.layer?this.options.fov.layer:0,t=0;t<this.imageInfo.TimeFrames[0].Layers[0].Channels.length;t++){var i=this.imageInfo.TimeFrames[0].Layers[0].Channels[t];this.options.fov&&this.options.fov.channels?i.Active=this.options.fov.channels.includes(t):i.hasOwnProperty("Active")||(i.Active=!0),i.DefaultGamma?i.Gamma=i.DefaultGamma:i.Gamma=1}for(var o in this.channelsString=this.getActiveChannels().join(","),this.channelGammaString=this.getChannelGammaString(),j(this.element,"pma-ui-viewport-container"),this.element.tabIndex<0&&(this.element.tabIndex=0),l.i)l.i.hasOwnProperty(o)&&A(this.element,l.i[o]);j(this.element,this.options.theme),this.element.innerHTML="",this.imageInfo.BackgroundColor||(this.imageInfo.BackgroundColor="ffffff"),this.imageInfo.TimeFrames[0].Layers[0].Channels.length<2&&this.imageInfo.TimeFrames.length<2&&this.imageInfo.TimeFrames[0].Layers.length<2&&(this.options.dimensions=!1),this.element.style.backgroundColor="#"+this.imageInfo.BackgroundColor,this.imageInfo.NumberOfZoomLevels&&(this.imageInfo.MaxZoomLevel=this.imageInfo.NumberOfZoomLevels);var a=this.imageInfo.MaxZoomLevel;(!this.imageInfo.MicrometresPerPixelX||this.imageInfo.MicrometresPerPixelX<=0)&&(this.options.scaleLine=!1);var s=K.call(this),d=Math.pow(2,a),m=new u.a.layer.Tile({source:new u.a.source.XYZ({tileUrlFunction:D.bind(this),tileLoadFunction:F.bind(this),projection:s,wrapX:!1,attributions:"",crossOrigin:"PMA.UI",cacheSize:100,tileGrid:u.a.tilegrid.createXYZ({tileSize:[this.imageInfo.TileSize,this.imageInfo.TileSize],extent:[0,0,d*this.imageInfo.TileSize,d*this.imageInfo.TileSize],maxZoom:a})}),preload:2,className:"ol-layer main-layer",extent:[0,0,d*this.imageInfo.TileSize,d*this.imageInfo.TileSize]});this.mainLayer=m,this.loading=0,this.loaded=0,this.progressEl=null;var v=this;this.options.loadingBar&&(this.loading=0,this.loaded=0,this.progressEl=document.createElement("div"),this.progressEl.className="ol-progress",this.imageInfo.TimeFrames[0].Layers[0].Channels.length>1&&(this.progressEl.className="ol-progress dark"),this.element.appendChild(this.progressEl),m.getSource().on("tileloadstart",(function(t){0===v.loading&&(v.progressEl.style.visibility="visible"),++v.loading,at.call(v)})),m.getSource().on("tileloadend",(function(){setTimeout((function(){++v.loaded,at.call(v)}),100)})),m.getSource().on("tileloaderror",(function(){setTimeout((function(){++v.loaded,at.call(v)}),100)}))),m.getSource().on("tileloaderror",(function(t){v.fireEvent(l.g.TilesError,v)}));var _=new u.a.interaction.DragZoom({condition:p.m,duration:0}),b=new u.a.interaction.DragRotate({condition:p.b}),w=[new u.a.control.Zoom({zoomInTipLabel:g.a.translate("Zoom in"),zoomOutTipLabel:g.a.translate("Zoom out")}),new y.a({tipLabel:g.a.translate("Previous view"),dragZoom:_})];w.push(new u.a.control.FullScreen({tipLabel:g.a.translate("Toggle fullscreen"),source:this.options.fullScreenElement,label:"↕",labelActive:"↕"}));var x=[m];if(this.options.annotationsLayers&&this.imageInfo.AnnotationsLayers&&this.imageInfo.AnnotationsLayers.length>0){for(var E=[],S=0;S<this.imageInfo.AnnotationsLayers.length;S++){var O=this.imageInfo.AnnotationsLayers[S],C=new u.a.layer.Tile({displayInLayerSwitcher:!0,visible:!0===this.options.annotationsLayers.loadLayers,title:O,source:new u.a.source.XYZ({tileUrlFunction:G.bind(this,O),tileLoadFunction:z.bind(this),projection:s,wrapX:!1,attributions:"",crossOrigin:"PMA.UI"}),extent:[0,0,d*this.imageInfo.TileSize,d*this.imageInfo.TileSize],className:"ol-layer annotations-layer"});C.getSource().tileGrid=u.a.tilegrid.createXYZ({tileSize:[this.imageInfo.TileSize,this.imageInfo.TileSize],extent:[0,0,d*this.imageInfo.TileSize,d*this.imageInfo.TileSize],maxZoom:a}),E.push(C)}if(E.length>0){var I=new u.a.layer.Group({title:g.a.translate("Annotation layers"),layers:E});x.push(I)}}if(this.options.annotations){var L=new u.a.source.Vector({projection:s});this.annotationsLayer=new u.a.layer.Vector({source:L,updateWhileAnimating:!0,updateWhileInteracting:!0,className:"ol-layer annotations-layer"}),Y.call(this,L,s),x.push(this.annotationsLayer),this.showAnnotations(!1!==this.options.annotations.visible)}var P=new u.a.source.Vector({projection:s});this.measureLayer=new u.a.layer.Vector({source:P,updateWhileAnimating:!0,updateWhileInteracting:!0,style:new c.c({fill:new u.a.style.Fill({color:"rgba(255, 255, 255, 0.2)"}),stroke:new u.a.style.Stroke({color:"#ffcc33",width:2}),image:new u.a.style.Circle({radius:7,fill:new u.a.style.Fill({color:"rgba(255, 255, 255, 0.2)"}),stroke:new u.a.style.Stroke({color:"#ff0000",width:2})}),text:new u.a.style.Text({font:"12px Calibri,sans-serif",fill:new u.a.style.Fill({color:"#000"}),stroke:new u.a.style.Stroke({color:"#fff",width:2})})})}),this.gridLayer=new u.a.layer.Vector({updateWhileAnimating:!0,updateWhileInteracting:!0,source:new u.a.source.Vector({projection:s}),style:new u.a.style.Style({fill:new u.a.style.Fill({color:"rgba(255, 255, 255, 0.2)"}),stroke:new u.a.style.Stroke({color:"#bbcc33",width:1})})}),this.measureTooltips=[],x.push(this.measureLayer),x.push(this.gridLayer),this.options.keyboardPanFactor||(this.options.keyboardPanFactor=.5);var R=new u.a.interaction.DragPan({kinetic:new h.a(-.005,.05,100),onFocusOnly:!1});if(this.mouseWheelInteraction=new T.b({duration:0,maxDelta:1,deltaPerZoom:100,timeout:0,onFocusOnly:!1,condition:p.d,constrainResolution:!1}),this.map=new f.a({interactions:[R,b,_,this.mouseWheelInteraction,new u.a.interaction.PinchZoom({constrainResolution:!1}),new u.a.interaction.PinchRotate,new u.a.interaction.DoubleClickZoom,new u.a.interaction.KeyboardZoom],loadTilesWhileAnimating:!0===this.options.highQuality,loadTilesWhileInteracting:!0===this.options.highQuality,layers:x,target:this.element,controls:w,view:Z.call(this,s)}),dt.call(this,this.element.querySelector(".ol-full-screen"),this.options.fullscreenControl),H.call(this),this.options.customButtons&&pt.call(this,this.options.customButtons),this.options.position&&this.setPosition(this.options.position),this.options.fov&&this.options.fov.extent&&this.fitToExtent(this.options.fov.extent,1==this.options.fov.constrainResolution),this.options.fov&&this.options.fov.rotation&&this.setPosition({rotation:this.options.fov.rotation}),vt.call(this),this.options.digitalZoomLevels>1){var M=this.options.digitalZoomLevels+a,N=100-Math.round(100*this.options.digitalZoomLevels/M);if(N>0&&N<=100){var k=this.element.querySelector(".ol-zoomslider");if(k){var U,B=window.getComputedStyle(k,null),V=document.createElement("div");V.className="pma-ui-viewport-container "+this.options.theme;var q=document.createElement("div");q.className=this.options.theme+" ol-zoomslider digital-zoom-levels",V.appendChild(q),k.appendChild(V),U=window.getComputedStyle(q,null).getPropertyValue("background-color"),k.removeChild(V),k.style.background="linear-gradient(to top, "+B.getPropertyValue("background-color")+" "+N+"%, "+U+" "+N+"%, "+U+" 100%)"}}}this.options.grid&&this.showGrid(this.options.grid.size),this.map&&(this.map.on("change:size",tt.bind(this)),et.call(this)),isNaN(this.imageInfo.DefaultGamma)||this.setGamma(this.imageInfo.DefaultGamma),this.options.annotations||"function"!=typeof this.readyCallback||this.readyCallback()}function tt(){et.call(this),H.call(this)}function et(){var t=this.map.getSize();if(this.element.className=this.element.className.replace(/ xlg\b| lg\b| md\b| sm\b| xs\b/g,""),t[0]>1200?(this.element.className+=" xlg",A(this.element.querySelector(".ol-scale-line"),"collapsed"),A(this.element.querySelector(".ol-filename"),"ol-collapsed")):t[0]>992?(this.element.className+=" lg",A(this.element.querySelector(".ol-scale-line"),"collapsed"),A(this.element.querySelector(".ol-filename"),"ol-collapsed")):t[0]>768?(this.element.className+=" md",A(this.element.querySelector(".ol-scale-line"),"collapsed"),A(this.element.querySelector(".ol-filename"),"ol-collapsed")):t[0]>576?this.element.className+=" sm":this.element.className+=" xs",this.element.className=this.element.className.replace(/ xlgh| lgh| mdh| smh| xsh/g,""),t[1]>1200?this.element.className+=" xlgh":t[1]>992?this.element.className+=" lgh":t[1]>768?this.element.className+=" mdh":t[1]>576?this.element.className+=" smh":this.element.className+=" xsh",this.overviewControl)if(t[0]<300||t[1]<300);else{var e=1/14;t[0]<500?e=1/6:t[0]<750?e=1/7:t[0]<1e3?e=1/8:t[0]<1250?e=1/9:t[0]<1500?e=.1:t[0]<1750?e=1/11:t[0]<2e3?e=1/12:t[0]<3e3&&(e=1/13),this.overviewControl.changeOverviewSizePx(Math.sqrt(t[0]*t[0])*e)}}function nt(){var t=this.element.querySelector(".ol-zoomslider");if(t){var e=t.querySelector(".objectives-scale");e&&t.removeChild(e);var n=window.getComputedStyle(t,null);if(0!==this.imageInfo.MicrometresPerPixelX){parseFloat(n.getPropertyValue("padding-top")),parseFloat(n.getPropertyValue("margin-top")),parseFloat(n.getPropertyValue("border-top-width")),parseFloat(n.getPropertyValue("padding-bottom")),parseFloat(n.getPropertyValue("margin-bottom")),parseFloat(n.getPropertyValue("border-bottom-width"));var r=this.element.querySelector(".ol-zoomslider-thumb"),i=window.getComputedStyle(r,null),o=r.offsetHeight+parseFloat(i.getPropertyValue("padding-top"))+parseFloat(i.getPropertyValue("margin-top"))+parseFloat(i.getPropertyValue("border-top-width"))+parseFloat(i.getPropertyValue("padding-bottom"))+parseFloat(i.getPropertyValue("margin-bottom"))+parseFloat(i.getPropertyValue("border-bottom-width")),a=t.offsetHeight-o;a+=o-r.offsetHeight;for(var s=10/this.imageInfo.MicrometresPerPixelX,l=this.options.digitalZoomLevels+this.imageInfo.MaxZoomLevel,u=a/l,c=[],h=0;h<=l;h++){var p=s/Math.pow(2,l-h-this.options.digitalZoomLevels);!1!==(p=rt(p))&&c.push({name:p+"X",height:u*h})}if(c.length>0){var d=document.createElement("div");d.className="objectives-scale",t.appendChild(d);for(var f="",g=0;g<c.length;g++)f+='<div style="bottom: '+c[g].height+'px"><div>'+c[g].name+"</div></div>";d.innerHTML=f,d.style.height=a+"px",d.style.top=o/2+"px"}}}}function rt(t){if(t>1){(t|=0)>10&&(t=10*Math.round(t/10)|0);for(var e=[1,2,5,10,20,40,80,160],n=0;n<e.length;n++)if(e[n]===t)return e[n]}return!1}function it(t){var e=[1,2,5,10,20,40,80,160];return e[e.map((function(e){return Math.abs(1-e/t)})).reduce((function(t,e,n,r){return e<r[t]?n:t}),0)]}function ot(t){var e=10/this.imageInfo.MicrometresPerPixelX/this.map.getView().getResolution();e>1?(e|=0,t.innerHTML=e+"X",t.style.display="block"):t.style.display="none"}function at(){var t=this.loaded/this.loading*100;t>100&&(t=100);var e=t.toFixed(1)+"%";if(this.progressEl.style.width=e,this.loading<=this.loaded){this.loading=0,this.loaded=0;var n=this;setTimeout((function(){n.loading===n.loaded&&(n.progressEl.style.visibility="hidden",n.progressEl.style.width=0)}),500)}}function st(){null!=this.colorAdjustmentsControl&&this.colorAdjustmentsControl.update(this.imageAdjustments.brightness,this.imageAdjustments.contrast,this.imageAdjustments.gamma),this.mainLayer.getSource().refresh()}function lt(t,e,n,r,i){var o=t;if(0!=e.MicrometresPerPixelX){i||(i="24px serif"),r||(r="TopLeft");for(var a=n/e.MicrometresPerPixelX,s=0,l=1,u=0,c=o.canvas.width,h=o.canvas.height;u<80;){var p=s/l;0==p?s=1:1==p?s=2:2==p?s=5:(s=1,l*=10),u=(s*=l)*a}var d="";s%1e3==0?(d=" mm",s/=1e3):d=" μm";var f=r.toLowerCase().startsWith("bottom")?h-25-20:20,g=r.toLowerCase().endsWith("right")?c-160-20:20;o.fillStyle="white",o.fillRect(g-4,f-4,u+8,33),o.beginPath(),o.moveTo(g,f),o.lineTo(g,f+25),o.lineTo(g+u,f+25),o.lineTo(g+u,f),o.stroke(),o.font=i,o.fillStyle="red";var y=g+u/2-o.measureText("".concat(s," ").concat(d)).width/2;y=y<g?g:y,o.textBaseline="top",o.fillText("".concat(s," ").concat(d),y,f)}}function ut(t,e){if(e&&t){t.font="32px serif",t.fillStyle="black",t.strokeStyle="white",t.lineWidth=4;var n=t.measureText(e),r=t.canvas.width/2-n.width/2;t.textBaseline="top",t.strokeText(e,r,20),t.fillText(e,r,20)}}function ct(t,e,n){return new Promise((function(r,i){var o=e&&e.imageInfo;if(e&&t&&o)if(o.AssociatedImageTypes.indexOf("Barcode")<0)r();else{var a=new Image;a.crossOrigin="anonymous",a.onload=function(){var e=.12*t.canvas.width,n=e*(a.height/a.width),i=t.canvas.width-e-20;t.lineWidth=2,t.drawImage(a,i,20,e,n),t.strokeStyle="black",t.strokeRect(i,20,e+2,n+2),t.strokeStyle="white",t.strokeRect(i+2,22,e-2,n-2),r()},a.onerror=i,a.src=function(t,e){return t.getActiveServerUrl()+"barcode?sessionID="+encodeURIComponent(t.getSessionID())+"&pathOrUid="+encodeURIComponent(t.imageInfo.Filename)+(e?"&rotation="+e:"")}(e,n)}else r()}))}function ht(t,e){return new Promise((function(n,r){var i=.2*t.canvas.width/e.imageInfo.Width,o=e.imagesUrl+"region?pathOrUid="+encodeURIComponent(e.image)+"&format=jpg&timeframe="+e.selectedTimeFrame+"&layer="+e.selectedLayer+"&channels="+e.channelsString+"&channelClipping="+e.channelClippingString+"&sessionID="+encodeURIComponent(e.sessionID)+"&drawScaleBar=false&x=0&y=0&width="+e.imageInfo.Width+"&height="+e.imageInfo.Height+"&scale="+i,a=new Image;a.crossOrigin="anonymous",a.onload=function(){var e=.2*t.canvas.width,r=e*(a.height/a.width),i=t.canvas.width-e-20,o=t.canvas.height-r-20;t.drawImage(a,i,o,e,r),t.lineWidth=2,t.strokeStyle="black",t.strokeRect(i,o,e+2,r+2),t.strokeStyle="white",t.strokeRect(i+2,o+2,e-2,r-2),n()},a.onerror=r,a.src=o}))}function pt(t){if(null!=t&&t.length>0&&this.element){var e=l.c.S,n={};n[e]=[];for(var r=0;r<t.length;r++)if(t[r].location){var i=t[r].location;(n[i]=n[i]||[]).push(t[r])}else n[e].push(t[r]);for(var o in n)if(n.hasOwnProperty(o)){var a=document.createElement("div");for(a.className="ol-unselectable ol-control ol-pma-custom-btn ol-custom-control "+o.toString(),r=0;r<n[o].length;r++){var s=n[o][r],u=document.createElement("button");u.title=s.title?s.title:"",u.innerHTML=s.content?s.content:"",u.className=s.class?s.class:"","function"==typeof s.callback&&u.addEventListener("click",s.callback.bind(this)),a.appendChild(u)}this.element.querySelector(".ol-overlaycontainer-stopevent").appendChild(a)}}}function dt(t,e){if(t)if(!1===e)j(t,"ol-hidden");else{if(N(t,"ol-dimension-selector")&&this.imageInfo.TimeFrames[0].Layers[0].Channels.length<2&&this.imageInfo.TimeFrames.length<2&&this.imageInfo.TimeFrames[0].Layers.length<2)return;A(t,"ol-hidden")}}function ft(t){return!!t&&!N(t,"ol-hidden")}function gt(t){var e=this.element.querySelector(".ol-scale-line");e&&(dt.call(this,e,t.visible),!0===t.collapsed?(j(e,"collapsed"),P.scaleLine.collapsed=!0):(A(e,"collapsed"),P.scaleLine.collapsed=!1))}function yt(t){for(var e=0;e<t.length;e++){var n=t[e];n.control==l.d.ZoomSlider?dt.call(this,this.element.querySelector(".ol-zoomslider"),n.visible):n.control==l.d.ScaleLine?gt.call(this,n):n.control==l.d.Overview?(dt.call(this,this.element.querySelector(".ol-overview"),n.visible),this.overviewControl.setCollapsed(n.collapsed)):n.control==l.d.Barcode?(dt.call(this,this.element.querySelector(".ol-associated-image"),n.visible),this.barcodeControl&&this.barcodeControl.setCollapsed(n.collapsed)):n.control==l.d.Magnifier?this.magnifierControl&&this.magnifierControl.setCollapsed(n.visible):n.control==l.d.ColorAdjustments?dt.call(this,this.element.querySelector(".ol-brightness-contrast"),n.visible):n.control==l.d.LayerSwitch?(dt.call(this,this.element.querySelector(".ol-layerswitch"),n.visible),this.layerSwitcher&&this.layerSwitcher.setCollapsed(n.collapsed)):n.control==l.d.DimensionSelector?(dt.call(this,this.element.querySelector(".ol-dimension-selector"),n.visible),this.dimensionsControl&&this.dimensionsControl.setCollapsed(n.collapsed)):n.control==l.d.Filename?(dt.call(this,this.element.querySelector(".ol-filename"),n.visible),this.filenameControl&&this.filenameControl.setCollapsed(n.collapsed)):n.control==l.d.Snapshot?dt.call(this,this.element.querySelector(".ol-snapshot"),n.visible):n.control==l.d.RotationControl?(dt.call(this,this.element.querySelector(".ol-rotation"),n.visible),this.rotationControl&&this.rotationControl.setCollapsed(n.collapsed)):n.control==l.d.Attribution?dt.call(this,this.element.querySelector(".ol-attr"),n.visible):n.control==l.d.Fullscreen&&dt.call(this,this.element.querySelector(".ol-full-screen"),n.visible)}}function mt(){var t=this.element.querySelector(".ol-scale-line");return[{control:l.d.ZoomSlider,visible:ft.call(this,this.element.querySelector(".ol-zoomslider"))},{control:l.d.ScaleLine,visible:this.scaleLineControl&&ft.call(this,this.element.querySelector(".ol-scale-line")),collapsed:!!t&&N(t,"collapsed")},{control:l.d.Overview,visible:ft.call(this,this.element.querySelector(".ol-overview")),collapsed:this.overviewControl&&this.overviewControl.getCollapsed()},{control:l.d.Barcode,visible:ft.call(this,this.element.querySelector(".ol-associated-image")),collapsed:this.barcodeControl&&this.barcodeControl.getCollapsed(),rotation:this.barcodeControl?this.barcodeControl.rotation:0},{control:l.d.Magnifier,visible:this.magnifierControl&&this.magnifierControl.getCollapsed()},{control:l.d.ColorAdjustments,visible:ft.call(this,this.element.querySelector(".ol-brightness-contrast"))},{control:l.d.LayerSwitch,visible:this.layerSwitcher&&ft.call(this,this.element.querySelector(".ol-layerswitch")),collapsed:!!this.layerSwitcher&&this.layerSwitcher.getCollapsed()},{control:l.d.DimensionSelector,visible:this.dimensionsControl&&ft.call(this,this.element.querySelector(".ol-dimension-selector")),collapsed:!!this.dimensionsControl&&this.dimensionsControl.getCollapsed()},{control:l.d.Filename,visible:this.filenameControl&&ft.call(this,this.element.querySelector(".ol-filename")),collapsed:!!this.filenameControl&&this.filenameControl.getCollapsed(),filename:null},{control:l.d.Snapshot,visible:this.snapShotControl&&ft.call(this,this.element.querySelector(".ol-snapshot"))},{control:l.d.RotationControl,visible:this.rotationControl&&ft.call(this,this.element.querySelector(".ol-rotation"))},{control:l.d.Attribution,visible:this.attributionControl&&ft.call(this,this.element.querySelector(".ol-attr")),options:null}]}function vt(){this.zoomSliderControl=new u.a.control.ZoomSlider,this.map.addControl(this.zoomSliderControl),!1===this.options.zoomSlider&&dt.call(this,this.element.querySelector(".ol-zoomslider"),!1);for(var t=this.imageInfo.MetaData,e=0;e<t.length;e++)if("compression"===t[e].Name){"Jpeg2000YCbCr"!==t[e].Value&&"Jpeg2000RGB"!==t[e].Value&&"Jpeg2000"!==t[e].Value&&-1===t[e].Value.indexOf("JPEG 2000")&&"JP2"!==t[e].Value||!0;break}if(!1?(this.attributionControl=new E.a({className:"ol-attr-kakadu",html:'<a href="http://kakadusoftware.com/" target="_blank"> </a>'}),this.map.addControl(this.attributionControl)):this.options.attributions&&(this.attributionControl=new E.a(this.options.attributions),this.map.addControl(this.attributionControl)),this.colorAdjustmentsControl=new O.a({layer:this.mainLayer,viewer:this}),this.map.addControl(this.colorAdjustmentsControl),dt.call(this,this.element.querySelector(".ol-brightness-contrast"),this.options.colorAdjustments),this.options.annotationsLayers&&this.imageInfo.AnnotationsLayers&&this.imageInfo.AnnotationsLayers.length>0&&(this.layerSwitcher=new S.a({pmaViewport:this,tipLabel:g.a.translate("Layers"),collapsed:!(!this.options.annotationsLayers||!this.options.annotationsLayers.collapsed),stateManager:P}),this.map.addControl(this.layerSwitcher)),this.overviewControl=J.call(this),this.map.addControl(this.overviewControl),dt.call(this,this.element.querySelector(".ol-overview"),this.options.overview),this.imageInfo.AssociatedImageTypes)for(var n=0;n<this.imageInfo.AssociatedImageTypes.length;n++)if("barcode"==this.imageInfo.AssociatedImageTypes[n].toLowerCase()){var r=0,i=!1;this.options.barcode&&(this.options.barcode.rotation&&(r=this.options.barcode.rotation),this.options.barcode.collapsed&&(i=this.options.barcode.collapsed)),this.barcodeControl=new _.a({pmaViewport:this,rotation:r,collapsed:i,imageType:"barcode",tipLabel:g.a.translate("Barcode"),stateManager:P}),this.map.addControl(this.barcodeControl),dt.call(this,this.element.querySelector(".ol-associated-image"),this.options.barcode);break}this.dimensionsControl=new x.a({pmaViewport:this,tipLabel:g.a.translate("Channels"),collapsed:this.options.dimensions&&this.options.dimensions.collapsed,stateManager:P}),this.map.addControl(this.dimensionsControl),this.dimensionsControl.renderSliders(),dt.call(this,this.element.querySelector(".ol-dimension-selector"),this.options.dimensions);var o=this,a={onClick:function(){o.fireEvent(l.g.FilenameClick,o)},stateManager:P};"string"==typeof this.options.filename?a.filename=o.options.filename:"function"==typeof this.options.filename?a.filename=o.options.filename.call(o,{serverUrl:o.getActiveServerUrl(),path:o.imageInfo.Filename}):a.filename=o.imageInfo.Filename,this.filenameControl=new w.a(a),this.map.addControl(this.filenameControl),dt.call(this,this.element.querySelector(".ol-filename"),this.options.filename),P.scaleLine||(P.scaleLine={}),this.scaleLineControl=new u.a.control.ScaleLine,this.map.addControl(this.scaleLineControl);var s,c=this.element.querySelector(".ol-scale-line");if(c){0==this.options.scaleLine&>.call(this,{visible:!1,collapsed:P.scaleLine.collapsed}),!0===P.scaleLine.collapsed&&j(c,"collapsed");var h=document.createElement("div");h.className="scanResolution",ot.call(this,h),c.appendChild(h);var p=this;this.map.getView().on("change:resolution",(function(){ot.call(p,h)})),M(c,"click",(function(){N(c,"collapsed")?(A(c,"collapsed"),P.scaleLine.collapsed=!1):(j(c,"collapsed"),P.scaleLine.collapsed=!0)}))}this.snapShotControl=new b.a({pmaViewport:this,tipLabel:g.a.translate("Snapshot")}),this.map.addControl(this.snapShotControl),dt.call(this,this.element.querySelector(".ol-snapshot"),1==this.options.snapshot);try{s=!0===this.options.rotationControl.collapsed}catch(t){s=!1}this.rotationControl=new m.a({pmaViewport:this,resetTipLabel:g.a.translate("Reset rotation"),flipHorizontallyTipLabel:g.a.translate("Flip horizontally"),flipVerticallyTipLabel:g.a.translate("Flip vertically"),collapsed:s}),this.map.addControl(this.rotationControl),dt.call(this,this.element.querySelector(".ol-rotation"),!(!1===this.options.rotationControl)),this.magnifierControl=$.call(this,null,!this.options.magnifier||this.options.magnifier&&!0===this.options.magnifier.collapsed),this.map.addControl(this.magnifierControl),nt.call(this)}},function(t,e,n){"use strict";var r,i=n(16),o=n(1),a=n(62),s=n(89),l=n(0),u=n(77),c=n(100),h=n(7),p=n(193),d=n(75),f=n(124),g=n(127),y=n(194),m=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),v=function(t){function e(e,n){var r=t.call(this)||this;return r.flatMidpoint_=null,r.flatMidpointRevision_=-1,r.maxDelta_=-1,r.maxDeltaRevision_=-1,void 0===n||Array.isArray(e[0])?r.setCoordinates(e,n):r.setFlatCoordinates(n,e),r}return m(e,t),e.prototype.appendCoordinate=function(t){this.flatCoordinates?Object(h.c)(this.flatCoordinates,t):this.flatCoordinates=t.slice(),this.changed()},e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,n,r){return r<Object(l.closestSquaredDistanceXY)(this.getExtent(),t,e)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Object(s.e)(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Object(s.d)(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,t,e,n,r))},e.prototype.forEachSegment=function(t){return Object(p.a)(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},e.prototype.getCoordinateAtM=function(t,e){if(this.layout!=i.a.XYM&&this.layout!=i.a.XYZM)return null;var n=void 0!==e&&e;return Object(f.b)(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,n)},e.prototype.getCoordinates=function(){return Object(d.a)(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getCoordinateAt=function(t,e){return Object(f.a)(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,this.stride)},e.prototype.getLength=function(){return Object(y.a)(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getFlatMidpoint=function(){return this.flatMidpointRevision_!=this.getRevision()&&(this.flatMidpoint_=this.getCoordinateAt(.5,this.flatMidpoint_),this.flatMidpointRevision_=this.getRevision()),this.flatMidpoint_},e.prototype.getSimplifiedGeometryInternal=function(t){var n=[];return n.length=Object(c.a)(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,n,0),new e(n,i.a.XY)},e.prototype.getType=function(){return o.a.LINE_STRING},e.prototype.intersectsExtent=function(t){return Object(g.a)(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Object(u.b)(this.flatCoordinates,0,t,this.stride),this.changed()},e}(a.a);e.a=v},function(t,e,n){"use strict";n.d(e,"b",(function(){return o})),n.d(e,"c",(function(){return l})),n.d(e,"a",(function(){return s}));var r=n(11),i=!1,o=function(t){var e=!0;void 0===window.HTMLElement&&(e=!1),document.all&&!document.querySelector&&(e=!1);var n=document.createElement("canvas");if(n.getContext&&n.getContext("2d")||(e=!1),window.XMLHttpRequest)try{var o=new XMLHttpRequest;"https:"!=window.location.protocol?o.open("GET","http://fake.pathomation.com/",!0):o.open("GET","https://fake.pathomation.com/",!0)}catch(t){e=!1}else e=!1;if(!e){var a=null;if(t)if(void 0!==t.innerHTML)a=t;else if("string"==typeof t){var s=t;s=s.replace("#",""),a=document.getElementById(s)}null!==a?a.innerHTML=r.a.translate("Browser not supported."):i||(i=!0,"string"==typeof PMA.UI.IncompatibilityRedirect?document.location=PMA.UI.IncompatibilityRedirect:alert(r.a.translate("Browser not supported.")))}return e},a=function(t){if(t){var e="",n=0;for(var r in t)t.hasOwnProperty(r)&&(n>0&&(e+="&"),e+=encodeURIComponent(r)+"="+encodeURIComponent(t[r]),n++);return e}return null},s=function(t,e,n,r,i){var o=this;e=e.toUpperCase(),i||(i={}),i.dataEncodeCallback||(i.dataEncodeCallback=a);var s=i.dataEncodeCallback(n);s&&"GET"==e&&(t=t+"?"+s,s=null);var l=new XMLHttpRequest;l.open(e,t,!0),i.contentType?l.setRequestHeader("Content-type",i.contentType):"POST"==e&&l.setRequestHeader("Content-type","application/x-www-form-urlencoded"),l.onreadystatechange=function(){4==l.readyState&&"function"==typeof r&&r.call(o,l)},s?l.send(s):l.send()},l=function(){var t=function(){return(65536*(1+Math.random())|0).toString(16).substring(1)};return t()+t()+"-"+t()+"-"+t()+"-"+t()+"-"+t()+t()+t()}},function(t,e,n){"use strict";e.a={ANIMATING:0,INTERACTING:1}},function(t,e,n){"use strict";n.d(e,"b",(function(){return u}));var r,i=n(98),o=n(9),a=n(10),s=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),l=function(t){function e(){var e=t.call(this)||this;return e.on=e.onInternal,e.once=e.onceInternal,e.un=e.unInternal,e.revision_=0,e}return s(e,t),e.prototype.changed=function(){++this.revision_,this.dispatchEvent(o.a.CHANGE)},e.prototype.getRevision=function(){return this.revision_},e.prototype.onInternal=function(t,e){if(Array.isArray(t)){for(var n=t.length,r=new Array(n),i=0;i<n;++i)r[i]=Object(a.listen)(this,t[i],e);return r}return Object(a.listen)(this,t,e)},e.prototype.onceInternal=function(t,e){var n;if(Array.isArray(t)){var r=t.length;n=new Array(r);for(var i=0;i<r;++i)n[i]=Object(a.listenOnce)(this,t[i],e)}else n=Object(a.listenOnce)(this,t,e);return e.ol_key=n,n},e.prototype.unInternal=function(t,e){var n=e.ol_key;if(n)u(n);else if(Array.isArray(t))for(var r=0,i=t.length;r<i;++r)this.removeEventListener(t[r],e);else this.removeEventListener(t,e)},e}(i.a);function u(t){if(Array.isArray(t))for(var e=0,n=t.length;e<n;++e)Object(a.unlistenByKey)(t[e]);else Object(a.unlistenByKey)(t)}l.prototype.on,l.prototype.once,l.prototype.un,e.a=l},function(t,e,n){"use strict";var r,i=n(54),o=n(117),a=n(30),s=n(10),l=n(25),u=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),c=function(t){function e(e){var n=t.call(this)||this,r=e.element;return!r||e.target||r.style.pointerEvents||(r.style.pointerEvents="auto"),n.element=r||null,n.target_=null,n.map_=null,n.listenerKeys=[],e.render&&(n.render=e.render),e.target&&n.setTarget(e.target),n}return u(e,t),e.prototype.disposeInternal=function(){Object(l.e)(this.element),t.prototype.disposeInternal.call(this)},e.prototype.getMap=function(){return this.map_},e.prototype.setMap=function(t){this.map_&&Object(l.e)(this.element);for(var e=0,n=this.listenerKeys.length;e<n;++e)Object(s.unlistenByKey)(this.listenerKeys[e]);(this.listenerKeys.length=0,this.map_=t,this.map_)&&((this.target_?this.target_:t.getOverlayContainerStopEvent()).appendChild(this.element),this.render!==a.c&&this.listenerKeys.push(Object(s.listen)(t,o.a.POSTRENDER,this.render,this)),t.render())},e.prototype.render=function(t){},e.prototype.setTarget=function(t){this.target_="string"==typeof t?document.getElementById(t):t},e}(i.a);e.a=c},function(t,e,n){"use strict";function r(t,e,n,r){return void 0!==r?(r[0]=t,r[1]=e,r[2]=n,r):[t,e,n]}function i(t,e,n){return t+"/"+e+"/"+n}function o(t){return i(t[0],t[1],t[2])}function a(t){var e=t.substring(t.lastIndexOf("/")+1,t.length).split(",").map(Number);return i(e[0],e[1],e[2])}function s(t){return t.split("/").map(Number)}function l(t){return(t[1]<<t[0])+t[2]}function u(t,e){var n=t[0],r=t[1],i=t[2];if(e.getMinZoom()>n||n>e.getMaxZoom())return!1;var o=e.getFullTileRange(n);return!o||o.containsXY(r,i)}n.d(e,"a",(function(){return r})),n.d(e,"e",(function(){return i})),n.d(e,"d",(function(){return o})),n.d(e,"c",(function(){return a})),n.d(e,"b",(function(){return s})),n.d(e,"f",(function(){return l})),n.d(e,"g",(function(){return u}))},function(t,e,n){"use strict";e.a={ADD:"add",REMOVE:"remove"}},function(t,e,n){"use strict";e.a={OPACITY:"opacity",VISIBLE:"visible",EXTENT:"extent",Z_INDEX:"zIndex",MAX_RESOLUTION:"maxResolution",MIN_RESOLUTION:"minResolution",MAX_ZOOM:"maxZoom",MIN_ZOOM:"minZoom",SOURCE:"source"}},function(t,e,n){var r=n(252);t.exports=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&r(t,e)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r={DEGREES:"degrees",FEET:"ft",METERS:"m",PIXELS:"pixels",TILE_PIXELS:"tile-pixels",USFEET:"us-ft"},i={};i[r.DEGREES]=2*Math.PI*6370997/360,i[r.FEET]=.3048,i[r.METERS]=1,i[r.USFEET]=1200/3937,e.b=r},function(t,e,n){var r=n(87),i=n(32);t.exports=function(t,e){return!e||"object"!==r(e)&&"function"!=typeof e?i(t):e}},function(t,e,n){"use strict";var r,i=n(40),o=n(91),a=n(46),s=n(6),l=n(4),u=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),c=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.key=n,i.oldValue=r,i}return u(e,t),e}(i.a),h=function(t){function e(e){var n=t.call(this)||this;return n.on,n.once,n.un,Object(l.c)(n),n.values_=null,void 0!==e&&n.setProperties(e),n}return u(e,t),e.prototype.get=function(t){var e;return this.values_&&this.values_.hasOwnProperty(t)&&(e=this.values_[t]),e},e.prototype.getKeys=function(){return this.values_&&Object.keys(this.values_)||[]},e.prototype.getProperties=function(){return this.values_&&Object(s.a)({},this.values_)||{}},e.prototype.hasProperties=function(){return!!this.values_},e.prototype.notify=function(t,e){var n;n="change:"+t,this.dispatchEvent(new c(n,t,e)),n=o.a.PROPERTYCHANGE,this.dispatchEvent(new c(n,t,e))},e.prototype.addChangeListener=function(t,e){this.addEventListener("change:"+t,e)},e.prototype.removeChangeListener=function(t,e){this.removeEventListener("change:"+t,e)},e.prototype.set=function(t,e,n){var r=this.values_||(this.values_={});if(n)r[t]=e;else{var i=r[t];r[t]=e,i!==e&&this.notify(t,i)}},e.prototype.setProperties=function(t,e){for(var n in t)this.set(n,t[n],e)},e.prototype.applyProperties=function(t){t.values_&&Object(s.a)(this.values_||(this.values_={}),t.values_)},e.prototype.unset=function(t,e){if(this.values_&&t in this.values_){var n=this.values_[t];delete this.values_[t],Object(s.d)(this.values_)&&(this.values_=null),e||this.notify(t,n)}},e}(a.a);e.a=h},function(t,e,n){"use strict";n.r(e),n.d(e,"getForProjection",(function(){return c})),n.d(e,"wrapX",(function(){return h})),n.d(e,"createForExtent",(function(){return p})),n.d(e,"createXYZ",(function(){return d})),n.d(e,"createForProjection",(function(){return g})),n.d(e,"extentFromProjection",(function(){return y}));var r=n(143),i=n(102),o=n(52),a=n(103),s=n(2),l=n(0),u=n(35);function c(t){var e=t.getDefaultTileGrid();return e||(e=g(t),t.setDefaultTileGrid(e)),e}function h(t,e,n){var r=e[0],i=t.getTileCoordCenter(e),o=y(n);if(Object(l.containsCoordinate)(o,i))return e;var a=Object(l.getWidth)(o),s=Math.ceil((o[0]-i[0])/a);return i[0]+=a*s,t.getTileCoordForCoordAndZ(i,r)}function p(t,e,n,o){var a=void 0!==o?o:r.a.TOP_LEFT,s=f(t,e,n);return new i.a({extent:t,origin:Object(l.getCorner)(t,a),resolutions:s,tileSize:n})}function d(t){var e=t||{},n=e.extent||Object(s.get)("EPSG:3857").getExtent(),r={extent:n,minZoom:e.minZoom,tileSize:e.tileSize,resolutions:f(n,e.maxZoom,e.tileSize,e.maxResolution)};return new i.a(r)}function f(t,e,n,r){for(var i=void 0!==e?e:a.a,o=Object(l.getHeight)(t),s=Object(l.getWidth)(t),c=Object(u.d)(void 0!==n?n:a.b),h=r>0?r:Math.max(s/c[0],o/c[1]),p=i+1,d=new Array(p),f=0;f<p;++f)d[f]=h/Math.pow(2,f);return d}function g(t,e,n,r){return p(y(t),e,n,r)}function y(t){var e=(t=Object(s.get)(t)).getExtent();if(!e){var n=180*s.METERS_PER_UNIT[o.b.DEGREES]/t.getMetersPerUnit();e=Object(l.createOrUpdate)(-n,-n,n,n)}return e}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return o})),n.d(e,"c",(function(){return a})),n.d(e,"d",(function(){return s}));var r=n(60);function i(t){if(!t)throw new Error("obj is required");var e=o(t);if(e.length>1&&Object(r.b)(e[0])&&Object(r.b)(e[1]))return e;throw new Error("Coordinate is not a valid Point")}function o(t){if(!t)throw new Error("obj is required");var e;if(t.length?e=t:t.coordinates?e=t.coordinates:t.geometry&&t.geometry.coordinates&&(e=t.geometry.coordinates),e)return function t(e){if(e.length>1&&Object(r.b)(e[0])&&Object(r.b)(e[1]))return!0;if(Array.isArray(e[0])&&e[0].length)return t(e[0]);throw new Error("coordinates must only contain numbers")}(e),e;throw new Error("No valid coordinates")}function a(t){if(!t)throw new Error("geojson is required");if(void 0!==t.geometry)return t.geometry;if(t.coordinates||t.geometries)return t;throw new Error("geojson must be a valid Feature or Geometry Object")}function s(t,e){if(!t)throw new Error((e||"geojson")+" is required");if(t.geometry&&t.geometry.type)return t.geometry.type;if(t.type)return t.type;throw new Error((e||"geojson")+" is invalid")}},function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"f",(function(){return o})),n.d(e,"d",(function(){return a})),n.d(e,"a",(function(){return s})),n.d(e,"g",(function(){return l})),n.d(e,"c",(function(){return u})),n.d(e,"e",(function(){return c}));var r="undefined"!=typeof navigator&&void 0!==navigator.userAgent?navigator.userAgent.toLowerCase():"",i=-1!==r.indexOf("firefox"),o=(-1!==r.indexOf("safari")&&r.indexOf("chrom"),-1!==r.indexOf("webkit")&&-1==r.indexOf("edge")),a=-1!==r.indexOf("macintosh"),s="undefined"!=typeof devicePixelRatio?devicePixelRatio:1,l="undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas&&self instanceof WorkerGlobalScope,u="undefined"!=typeof Image&&Image.prototype.decode,c=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("_",null,e),window.removeEventListener("_",null,e)}catch(t){}return t}()},function(t,e,n){"use strict";var r,i=n(16),o=n(1),a=n(43),s=n(62),l=n(89),u=n(0),c=n(77),h=n(100),p=n(7),d=n(75),f=n(124),g=n(127),y=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),m=function(t){function e(e,n,r){var i=t.call(this)||this;if(i.ends_=[],i.maxDelta_=-1,i.maxDeltaRevision_=-1,Array.isArray(e[0]))i.setCoordinates(e,n);else if(void 0!==n&&r)i.setFlatCoordinates(n,e),i.ends_=r;else{for(var o=i.getLayout(),a=e,s=[],l=[],u=0,c=a.length;u<c;++u){var h=a[u];0===u&&(o=h.getLayout()),Object(p.c)(s,h.getFlatCoordinates()),l.push(s.length)}i.setFlatCoordinates(o,s),i.ends_=l}return i}return y(e,t),e.prototype.appendLineString=function(t){this.flatCoordinates?Object(p.c)(this.flatCoordinates,t.getFlatCoordinates().slice()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()},e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,n,r){return r<Object(u.closestSquaredDistanceXY)(this.getExtent(),t,e)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Object(l.a)(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Object(l.b)(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!1,t,e,n,r))},e.prototype.getCoordinateAtM=function(t,e,n){if(this.layout!=i.a.XYM&&this.layout!=i.a.XYZM||0===this.flatCoordinates.length)return null;var r=void 0!==e&&e,o=void 0!==n&&n;return Object(f.c)(this.flatCoordinates,0,this.ends_,this.stride,t,r,o)},e.prototype.getCoordinates=function(){return Object(d.b)(this.flatCoordinates,0,this.ends_,this.stride)},e.prototype.getEnds=function(){return this.ends_},e.prototype.getLineString=function(t){return t<0||this.ends_.length<=t?null:new a.a(this.flatCoordinates.slice(0===t?0:this.ends_[t-1],this.ends_[t]),this.layout)},e.prototype.getLineStrings=function(){for(var t=this.flatCoordinates,e=this.ends_,n=this.layout,r=[],i=0,o=0,s=e.length;o<s;++o){var l=e[o],u=new a.a(t.slice(i,l),n);r.push(u),i=l}return r},e.prototype.getFlatMidpoints=function(){for(var t=[],e=this.flatCoordinates,n=0,r=this.ends_,i=this.stride,o=0,a=r.length;o<a;++o){var s=r[o],l=Object(f.a)(e,n,s,i,.5);Object(p.c)(t,l),n=s}return t},e.prototype.getSimplifiedGeometryInternal=function(t){var n=[],r=[];return n.length=Object(h.b)(this.flatCoordinates,0,this.ends_,this.stride,t,n,0,r),new e(n,i.a.XY,r)},e.prototype.getType=function(){return o.a.MULTI_LINE_STRING},e.prototype.intersectsExtent=function(t){return Object(g.b)(this.flatCoordinates,0,this.ends_,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);var n=Object(c.c)(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===n.length?0:n[n.length-1],this.changed()},e}(s.a);e.a=m},function(t,e,n){"use strict";var r=function(){function t(t){var e=t||{};this.color_=void 0!==e.color?e.color:null}return t.prototype.clone=function(){var e=this.getColor();return new t({color:Array.isArray(e)?e.slice():e||void 0})},t.prototype.getColor=function(){return this.color_},t.prototype.setColor=function(t){this.color_=t},t}();e.a=r},function(t,e,n){"use strict";n.d(e,"a",(function(){return r})),n.d(e,"d",(function(){return i})),n.d(e,"b",(function(){return o})),n.d(e,"c",(function(){return a}));function r(t,e,n){if(!a(n=n||{}))throw new Error("options is invalid");var r=n.bbox,i=n.id;if(void 0===t)throw new Error("geometry is required");if(e&&e.constructor!==Object)throw new Error("properties must be an Object");r&&s(r),i&&l(i);var o={type:"Feature"};return i&&(o.id=i),r&&(o.bbox=r),o.properties=e||{},o.geometry=t,o}function i(t,e,n){if(!t)throw new Error("coordinates is required");if(t.length<2)throw new Error("coordinates must be an array of two or more positions");if(!o(t[0][1])||!o(t[0][1]))throw new Error("coordinates must contain numbers");return r({type:"LineString",coordinates:t},e,n)}function o(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}function a(t){return!!t&&t.constructor===Object}function s(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(4!==t.length&&6!==t.length)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach((function(t){if(!o(t))throw new Error("bbox must only contain numbers")}))}function l(t){if(!t)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof t))throw new Error("id must be a number or a string")}},function(t,e,n){"use strict";var r=function(){function t(t){var e=t||{};this.color_=void 0!==e.color?e.color:null,this.lineCap_=e.lineCap,this.lineDash_=void 0!==e.lineDash?e.lineDash:null,this.lineDashOffset_=e.lineDashOffset,this.lineJoin_=e.lineJoin,this.miterLimit_=e.miterLimit,this.width_=e.width}return t.prototype.clone=function(){var e=this.getColor();return new t({color:Array.isArray(e)?e.slice():e||void 0,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():void 0,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),width:this.getWidth()})},t.prototype.getColor=function(){return this.color_},t.prototype.getLineCap=function(){return this.lineCap_},t.prototype.getLineDash=function(){return this.lineDash_},t.prototype.getLineDashOffset=function(){return this.lineDashOffset_},t.prototype.getLineJoin=function(){return this.lineJoin_},t.prototype.getMiterLimit=function(){return this.miterLimit_},t.prototype.getWidth=function(){return this.width_},t.prototype.setColor=function(t){this.color_=t},t.prototype.setLineCap=function(t){this.lineCap_=t},t.prototype.setLineDash=function(t){this.lineDash_=t},t.prototype.setLineDashOffset=function(t){this.lineDashOffset_=t},t.prototype.setLineJoin=function(t){this.lineJoin_=t},t.prototype.setMiterLimit=function(t){this.miterLimit_=t},t.prototype.setWidth=function(t){this.width_=t},t}();e.a=r},function(t,e,n){"use strict";n.d(e,"b",(function(){return h})),n.d(e,"c",(function(){return p}));var r,i=n(146),o=n(16),a=n(4),s=n(0),l=n(63),u=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),c=function(t){function e(){var e=t.call(this)||this;return e.layout=o.a.XY,e.stride=2,e.flatCoordinates=null,e}return u(e,t),e.prototype.computeExtent=function(t){return Object(s.createOrUpdateFromFlatCoordinates)(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},e.prototype.getCoordinates=function(){return Object(a.b)()},e.prototype.getFirstCoordinate=function(){return this.flatCoordinates.slice(0,this.stride)},e.prototype.getFlatCoordinates=function(){return this.flatCoordinates},e.prototype.getLastCoordinate=function(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)},e.prototype.getLayout=function(){return this.layout},e.prototype.getSimplifiedGeometry=function(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||0!==this.simplifiedGeometryMaxMinSquaredTolerance&&t<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;var e=this.getSimplifiedGeometryInternal(t);return e.getFlatCoordinates().length<this.flatCoordinates.length?e:(this.simplifiedGeometryMaxMinSquaredTolerance=t,this)},e.prototype.getSimplifiedGeometryInternal=function(t){return this},e.prototype.getStride=function(){return this.stride},e.prototype.setFlatCoordinates=function(t,e){this.stride=h(t),this.layout=t,this.flatCoordinates=e},e.prototype.setCoordinates=function(t,e){Object(a.b)()},e.prototype.setLayout=function(t,e,n){var r;if(t)r=h(t);else{for(var i=0;i<n;++i){if(0===e.length)return this.layout=o.a.XY,void(this.stride=2);e=e[0]}t=function(t){var e;2==t?e=o.a.XY:3==t?e=o.a.XYZ:4==t&&(e=o.a.XYZM);return e}(r=e.length)}this.layout=t,this.stride=r},e.prototype.applyTransform=function(t){this.flatCoordinates&&(t(this.flatCoordinates,this.flatCoordinates,this.stride),this.changed())},e.prototype.rotate=function(t,e){var n=this.getFlatCoordinates();if(n){var r=this.getStride();Object(l.a)(n,0,n.length,r,t,e,n),this.changed()}},e.prototype.scale=function(t,e,n){var r=e;void 0===r&&(r=t);var i=n;i||(i=Object(s.getCenter)(this.getExtent()));var o=this.getFlatCoordinates();if(o){var a=this.getStride();Object(l.b)(o,0,o.length,a,t,r,i,o),this.changed()}},e.prototype.translate=function(t,e){var n=this.getFlatCoordinates();if(n){var r=this.getStride();Object(l.d)(n,0,n.length,r,t,e,n),this.changed()}},e}(i.a);function h(t){var e;return t==o.a.XY?e=2:t==o.a.XYZ||t==o.a.XYM?e=3:t==o.a.XYZM&&(e=4),e}function p(t,e,n){var r=t.getFlatCoordinates();if(r){var i=t.getStride();return Object(l.c)(r,0,r.length,i,e,n)}return null}e.a=c},function(t,e,n){"use strict";function r(t,e,n,r,i,o){for(var a=o||[],s=0,l=e;l<n;l+=r){var u=t[l],c=t[l+1];a[s++]=i[0]*u+i[2]*c+i[4],a[s++]=i[1]*u+i[3]*c+i[5]}return o&&a.length!=s&&(a.length=s),a}function i(t,e,n,r,i,o,a){for(var s=a||[],l=Math.cos(i),u=Math.sin(i),c=o[0],h=o[1],p=0,d=e;d<n;d+=r){var f=t[d]-c,g=t[d+1]-h;s[p++]=c+f*l-g*u,s[p++]=h+f*u+g*l;for(var y=d+2;y<d+r;++y)s[p++]=t[y]}return a&&s.length!=p&&(s.length=p),s}function o(t,e,n,r,i,o,a,s){for(var l=s||[],u=a[0],c=a[1],h=0,p=e;p<n;p+=r){var d=t[p]-u,f=t[p+1]-c;l[h++]=u+i*d,l[h++]=c+o*f;for(var g=p+2;g<p+r;++g)l[h++]=t[g]}return s&&l.length!=h&&(l.length=h),l}function a(t,e,n,r,i,o,a){for(var s=a||[],l=0,u=e;u<n;u+=r){s[l++]=t[u]+i,s[l++]=t[u+1]+o;for(var c=u+2;c<u+r;++c)s[l++]=t[c]}return a&&s.length!=l&&(s.length=l),s}n.d(e,"c",(function(){return r})),n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return o})),n.d(e,"d",(function(){return a}))},function(t,e,n){"use strict";e.a={ADDFEATURE:"addfeature",CHANGEFEATURE:"changefeature",CLEAR:"clear",REMOVEFEATURE:"removefeature",FEATURESLOADSTART:"featuresloadstart",FEATURESLOADEND:"featuresloadend",FEATURESLOADERROR:"featuresloaderror"}},function(t,e,n){"use strict";var r,i=n(128),o=n(195),a=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=function(t){function e(e){return t.call(this,e)||this}return a(e,t),e.prototype.createRenderer=function(){return new o.a(this)},e}(i.a);e.a=s},function(t,e,n){"use strict";var r=n(37),i=n(49),o=n(40),a=n(9),s=n(91),l=n(138),u=n(108),c=n(39),h=n(64),p=n(30);function d(t,e){return[[-1/0,-1/0,1/0,1/0]]}var f,g=n(13),y=n(0),m=n(7),v=n(4),_=n(6),b=n(10),w=n(176),x=(f=function(t,e){return(f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}f(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),E=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.feature=n,i.features=r,i}return x(e,t),e}(o.a),S=function(t){function e(e){var n=this,i=e||{};(n=t.call(this,{attributions:i.attributions,projection:void 0,state:c.a.READY,wrapX:void 0===i.wrapX||i.wrapX})||this).on,n.once,n.un,n.loader_=p.c,n.format_=i.format,n.overlaps_=void 0===i.overlaps||i.overlaps,n.url_=i.url,void 0!==i.loader?n.loader_=i.loader:void 0!==n.url_&&(Object(g.a)(n.format_,7),n.loader_=Object(w.b)(n.url_,n.format_)),n.strategy_=void 0!==i.strategy?i.strategy:d;var o,a,s=void 0===i.useSpatialIndex||i.useSpatialIndex;return n.featuresRtree_=s?new l.a:null,n.loadedExtentsRtree_=new l.a,n.loadingExtentsCount_=0,n.nullGeometryFeatures_={},n.idIndex_={},n.uidIndex_={},n.featureChangeKeys_={},n.featuresCollection_=null,Array.isArray(i.features)?a=i.features:i.features&&(a=(o=i.features).getArray()),s||void 0!==o||(o=new r.a(a)),void 0!==a&&n.addFeaturesInternal(a),void 0!==o&&n.bindFeaturesCollection_(o),n}return x(e,t),e.prototype.addFeature=function(t){this.addFeatureInternal(t),this.changed()},e.prototype.addFeatureInternal=function(t){var e=Object(v.c)(t);if(this.addToIndex_(e,t)){this.setupChangeEvents_(e,t);var n=t.getGeometry();if(n){var r=n.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(r,t)}else this.nullGeometryFeatures_[e]=t;this.dispatchEvent(new E(h.a.ADDFEATURE,t))}else this.featuresCollection_&&this.featuresCollection_.remove(t)},e.prototype.setupChangeEvents_=function(t,e){this.featureChangeKeys_[t]=[Object(b.listen)(e,a.a.CHANGE,this.handleFeatureChange_,this),Object(b.listen)(e,s.a.PROPERTYCHANGE,this.handleFeatureChange_,this)]},e.prototype.addToIndex_=function(t,e){var n=!0,r=e.getId();return void 0!==r&&(r.toString()in this.idIndex_?n=!1:this.idIndex_[r.toString()]=e),n&&(Object(g.a)(!(t in this.uidIndex_),30),this.uidIndex_[t]=e),n},e.prototype.addFeatures=function(t){this.addFeaturesInternal(t),this.changed()},e.prototype.addFeaturesInternal=function(t){for(var e=[],n=[],r=[],i=0,o=t.length;i<o;i++){var a=t[i],s=Object(v.c)(a);this.addToIndex_(s,a)&&n.push(a)}i=0;for(var l=n.length;i<l;i++){a=n[i],s=Object(v.c)(a);this.setupChangeEvents_(s,a);var u=a.getGeometry();if(u){var c=u.getExtent();e.push(c),r.push(a)}else this.nullGeometryFeatures_[s]=a}this.featuresRtree_&&this.featuresRtree_.load(e,r);i=0;for(var p=n.length;i<p;i++)this.dispatchEvent(new E(h.a.ADDFEATURE,n[i]))},e.prototype.bindFeaturesCollection_=function(t){var e=!1;this.addEventListener(h.a.ADDFEATURE,(function(n){e||(e=!0,t.push(n.feature),e=!1)})),this.addEventListener(h.a.REMOVEFEATURE,(function(n){e||(e=!0,t.remove(n.feature),e=!1)})),t.addEventListener(i.a.ADD,function(t){e||(e=!0,this.addFeature(t.element),e=!1)}.bind(this)),t.addEventListener(i.a.REMOVE,function(t){e||(e=!0,this.removeFeature(t.element),e=!1)}.bind(this)),this.featuresCollection_=t},e.prototype.clear=function(t){if(t){for(var e in this.featureChangeKeys_){this.featureChangeKeys_[e].forEach(b.unlistenByKey)}this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.uidIndex_={})}else if(this.featuresRtree_)for(var n in this.featuresRtree_.forEach(this.removeFeatureInternal.bind(this)),this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[n]);this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.nullGeometryFeatures_={};var r=new E(h.a.CLEAR);this.dispatchEvent(r),this.changed()},e.prototype.forEachFeature=function(t){if(this.featuresRtree_)return this.featuresRtree_.forEach(t);this.featuresCollection_&&this.featuresCollection_.forEach(t)},e.prototype.forEachFeatureAtCoordinateDirect=function(t,e){var n=[t[0],t[1],t[0],t[1]];return this.forEachFeatureInExtent(n,(function(n){return n.getGeometry().intersectsCoordinate(t)?e(n):void 0}))},e.prototype.forEachFeatureInExtent=function(t,e){if(this.featuresRtree_)return this.featuresRtree_.forEachInExtent(t,e);this.featuresCollection_&&this.featuresCollection_.forEach(e)},e.prototype.forEachFeatureIntersectingExtent=function(t,e){return this.forEachFeatureInExtent(t,(function(n){if(n.getGeometry().intersectsExtent(t)){var r=e(n);if(r)return r}}))},e.prototype.getFeaturesCollection=function(){return this.featuresCollection_},e.prototype.getFeatures=function(){var t;return this.featuresCollection_?t=this.featuresCollection_.getArray().slice(0):this.featuresRtree_&&(t=this.featuresRtree_.getAll(),Object(_.d)(this.nullGeometryFeatures_)||Object(m.c)(t,Object(_.c)(this.nullGeometryFeatures_))),t},e.prototype.getFeaturesAtCoordinate=function(t){var e=[];return this.forEachFeatureAtCoordinateDirect(t,(function(t){e.push(t)})),e},e.prototype.getFeaturesInExtent=function(t){return this.featuresRtree_?this.featuresRtree_.getInExtent(t):this.featuresCollection_?this.featuresCollection_.getArray().slice(0):[]},e.prototype.getClosestFeatureToCoordinate=function(t,e){var n=t[0],r=t[1],i=null,o=[NaN,NaN],a=1/0,s=[-1/0,-1/0,1/0,1/0],l=e||p.b;return this.featuresRtree_.forEachInExtent(s,(function(t){if(l(t)){var e=t.getGeometry(),u=a;if((a=e.closestPointXY(n,r,o,a))<u){i=t;var c=Math.sqrt(a);s[0]=n-c,s[1]=r-c,s[2]=n+c,s[3]=r+c}}})),i},e.prototype.getExtent=function(t){return this.featuresRtree_.getExtent(t)},e.prototype.getFeatureById=function(t){var e=this.idIndex_[t.toString()];return void 0!==e?e:null},e.prototype.getFeatureByUid=function(t){var e=this.uidIndex_[t];return void 0!==e?e:null},e.prototype.getFormat=function(){return this.format_},e.prototype.getOverlaps=function(){return this.overlaps_},e.prototype.getUrl=function(){return this.url_},e.prototype.handleFeatureChange_=function(t){var e=t.target,n=Object(v.c)(e),r=e.getGeometry();if(r){var i=r.getExtent();n in this.nullGeometryFeatures_?(delete this.nullGeometryFeatures_[n],this.featuresRtree_&&this.featuresRtree_.insert(i,e)):this.featuresRtree_&&this.featuresRtree_.update(i,e)}else n in this.nullGeometryFeatures_||(this.featuresRtree_&&this.featuresRtree_.remove(e),this.nullGeometryFeatures_[n]=e);var o=e.getId();if(void 0!==o){var a=o.toString();this.idIndex_[a]!==e&&(this.removeFromIdIndex_(e),this.idIndex_[a]=e)}else this.removeFromIdIndex_(e),this.uidIndex_[n]=e;this.changed(),this.dispatchEvent(new E(h.a.CHANGEFEATURE,e))},e.prototype.hasFeature=function(t){var e=t.getId();return void 0!==e?e in this.idIndex_:Object(v.c)(t)in this.uidIndex_},e.prototype.isEmpty=function(){return this.featuresRtree_.isEmpty()&&Object(_.d)(this.nullGeometryFeatures_)},e.prototype.loadFeatures=function(t,e,n){for(var r=this.loadedExtentsRtree_,i=this.strategy_(t,e),o=function(t,o){var s=i[t];r.forEachInExtent(s,(function(t){return Object(y.containsExtent)(t.extent,s)}))||(++a.loadingExtentsCount_,a.dispatchEvent(new E(h.a.FEATURESLOADSTART)),a.loader_.call(a,s,e,n,function(t){--this.loadingExtentsCount_,this.dispatchEvent(new E(h.a.FEATURESLOADEND,void 0,t))}.bind(a),function(){--this.loadingExtentsCount_,this.dispatchEvent(new E(h.a.FEATURESLOADERROR))}.bind(a)),r.insert(s,{extent:s.slice()}))},a=this,s=0,l=i.length;s<l;++s)o(s);this.loading=this.loader_!==p.c&&this.loadingExtentsCount_>0},e.prototype.refresh=function(){this.clear(!0),this.loadedExtentsRtree_.clear(),t.prototype.refresh.call(this)},e.prototype.removeLoadedExtent=function(t){var e,n=this.loadedExtentsRtree_;n.forEachInExtent(t,(function(n){if(Object(y.equals)(n.extent,t))return e=n,!0})),e&&n.remove(e)},e.prototype.removeFeature=function(t){var e=Object(v.c)(t);e in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[e]:this.featuresRtree_&&this.featuresRtree_.remove(t),this.removeFeatureInternal(t),this.changed()},e.prototype.removeFeatureInternal=function(t){var e=Object(v.c)(t);this.featureChangeKeys_[e].forEach(b.unlistenByKey),delete this.featureChangeKeys_[e];var n=t.getId();void 0!==n&&delete this.idIndex_[n.toString()],delete this.uidIndex_[e],this.dispatchEvent(new E(h.a.REMOVEFEATURE,t))},e.prototype.removeFromIdIndex_=function(t){var e=!1;for(var n in this.idIndex_)if(this.idIndex_[n]===t){delete this.idIndex_[n],e=!0;break}return e},e.prototype.setLoader=function(t){this.loader_=t},e.prototype.setUrl=function(t){Object(g.a)(this.format_,7),this.url_=t,this.setLoader(Object(w.b)(t,this.format_))},e}(u.a);e.a=S},function(t,e,n){"use strict";e.a={BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",TOP_LEFT:"top-left",TOP_RIGHT:"top-right"}},function(t,e,n){"use strict";var r,i=n(16),o=n(1),a=n(69),s=n(22),l=n(62),u=n(89),c=n(0),h=n(77),p=n(7),d=n(139),f=n(75),g=n(127),y=n(105),m=n(155),v=n(200),_=n(104),b=n(100),w=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),x=function(t){function e(e,n,r){var i=t.call(this)||this;if(i.endss_=[],i.flatInteriorPointsRevision_=-1,i.flatInteriorPoints_=null,i.maxDelta_=-1,i.maxDeltaRevision_=-1,i.orientedRevision_=-1,i.orientedFlatCoordinates_=null,!r&&!Array.isArray(e[0])){for(var o=i.getLayout(),a=e,s=[],l=[],u=0,c=a.length;u<c;++u){var h=a[u];0===u&&(o=h.getLayout());for(var d=s.length,f=h.getEnds(),g=0,y=f.length;g<y;++g)f[g]+=d;Object(p.c)(s,h.getFlatCoordinates()),l.push(f)}n=o,e=s,r=l}return void 0!==n&&r?(i.setFlatCoordinates(n,e),i.endss_=r):i.setCoordinates(e,n),i}return w(e,t),e.prototype.appendPolygon=function(t){var e;if(this.flatCoordinates){var n=this.flatCoordinates.length;Object(p.c)(this.flatCoordinates,t.getFlatCoordinates());for(var r=0,i=(e=t.getEnds().slice()).length;r<i;++r)e[r]+=n}else this.flatCoordinates=t.getFlatCoordinates().slice(),e=t.getEnds().slice(),this.endss_.push();this.endss_.push(e),this.changed()},e.prototype.clone=function(){for(var t=this.endss_.length,n=new Array(t),r=0;r<t;++r)n[r]=this.endss_[r].slice();var i=new e(this.flatCoordinates.slice(),this.layout,n);return i.applyProperties(this),i},e.prototype.closestPointXY=function(t,e,n,r){return r<Object(c.closestSquaredDistanceXY)(this.getExtent(),t,e)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Object(u.f)(this.flatCoordinates,0,this.endss_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Object(u.c)(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,this.maxDelta_,!0,t,e,n,r))},e.prototype.containsXY=function(t,e){return Object(_.d)(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t,e)},e.prototype.getArea=function(){return Object(m.c)(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride)},e.prototype.getCoordinates=function(t){var e;return void 0!==t?(e=this.getOrientedFlatCoordinates().slice(),Object(y.e)(e,0,this.endss_,this.stride,t)):e=this.flatCoordinates,Object(f.c)(e,0,this.endss_,this.stride)},e.prototype.getEndss=function(){return this.endss_},e.prototype.getFlatInteriorPoints=function(){if(this.flatInteriorPointsRevision_!=this.getRevision()){var t=Object(v.a)(this.flatCoordinates,0,this.endss_,this.stride);this.flatInteriorPoints_=Object(d.b)(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t),this.flatInteriorPointsRevision_=this.getRevision()}return this.flatInteriorPoints_},e.prototype.getInteriorPoints=function(){return new a.a(this.getFlatInteriorPoints().slice(),i.a.XYM)},e.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;Object(y.c)(t,0,this.endss_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=Object(y.e)(this.orientedFlatCoordinates_,0,this.endss_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},e.prototype.getSimplifiedGeometryInternal=function(t){var n=[],r=[];return n.length=Object(b.d)(this.flatCoordinates,0,this.endss_,this.stride,Math.sqrt(t),n,0,r),new e(n,i.a.XY,r)},e.prototype.getPolygon=function(t){if(t<0||this.endss_.length<=t)return null;var e;if(0===t)e=0;else{var n=this.endss_[t-1];e=n[n.length-1]}var r=this.endss_[t].slice(),i=r[r.length-1];if(0!==e)for(var o=0,a=r.length;o<a;++o)r[o]-=e;return new s.a(this.flatCoordinates.slice(e,i),this.layout,r)},e.prototype.getPolygons=function(){for(var t=this.layout,e=this.flatCoordinates,n=this.endss_,r=[],i=0,o=0,a=n.length;o<a;++o){var l=n[o].slice(),u=l[l.length-1];if(0!==i)for(var c=0,h=l.length;c<h;++c)l[c]-=i;var p=new s.a(e.slice(i,u),t,l);r.push(p),i=u}return r},e.prototype.getType=function(){return o.a.MULTI_POLYGON},e.prototype.intersectsExtent=function(t){return Object(g.d)(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,3),this.flatCoordinates||(this.flatCoordinates=[]);var n=Object(h.d)(this.flatCoordinates,0,t,this.stride,this.endss_);if(0===n.length)this.flatCoordinates.length=0;else{var r=n[n.length-1];this.flatCoordinates.length=0===r.length?0:r[r.length-1]}this.changed()},e}(l.a);e.a=x},function(t,e,n){"use strict";var r,i=n(1),o=n(31),a=n(62),s=n(0),l=n(77),u=n(7),c=n(75),h=n(8),p=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),d=function(t){function e(e,n){var r=t.call(this)||this;return n&&!Array.isArray(e[0])?r.setFlatCoordinates(n,e):r.setCoordinates(e,n),r}return p(e,t),e.prototype.appendPoint=function(t){this.flatCoordinates?Object(u.c)(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.changed()},e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,n,r){if(r<Object(s.closestSquaredDistanceXY)(this.getExtent(),t,e))return r;for(var i=this.flatCoordinates,o=this.stride,a=0,l=i.length;a<l;a+=o){var u=Object(h.g)(t,e,i[a],i[a+1]);if(u<r){r=u;for(var c=0;c<o;++c)n[c]=i[a+c];n.length=o}}return r},e.prototype.getCoordinates=function(){return Object(c.a)(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getPoint=function(t){var e=this.flatCoordinates?this.flatCoordinates.length/this.stride:0;return t<0||e<=t?null:new o.a(this.flatCoordinates.slice(t*this.stride,(t+1)*this.stride),this.layout)},e.prototype.getPoints=function(){for(var t=this.flatCoordinates,e=this.layout,n=this.stride,r=[],i=0,a=t.length;i<a;i+=n){var s=new o.a(t.slice(i,i+n),e);r.push(s)}return r},e.prototype.getType=function(){return i.a.MULTI_POINT},e.prototype.intersectsExtent=function(t){for(var e=this.flatCoordinates,n=this.stride,r=0,i=e.length;r<i;r+=n){var o=e[r],a=e[r+1];if(Object(s.containsXY)(t,o,a))return!0}return!1},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Object(l.b)(this.flatCoordinates,0,t,this.stride),this.changed()},e}(a.a);e.a=d},function(t,e,n){"use strict";n.d(e,"b",(function(){return u})),n.d(e,"c",(function(){return c}));var r,i=n(54),o=n(141),a=n(74),s=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),l=function(t){function e(e){var n=t.call(this)||this;return n.on,n.once,n.un,e&&e.handleEvent&&(n.handleEvent=e.handleEvent),n.map_=null,n.setActive(!0),n}return s(e,t),e.prototype.getActive=function(){return this.get(o.a.ACTIVE)},e.prototype.getMap=function(){return this.map_},e.prototype.handleEvent=function(t){return!0},e.prototype.setActive=function(t){this.set(o.a.ACTIVE,t)},e.prototype.setMap=function(t){this.map_=t},e}(i.a);function u(t,e,n){var r=t.getCenterInternal();if(r){var i=[r[0]+e[0],r[1]+e[1]];t.animateInternal({duration:void 0!==n?n:250,easing:a.d,center:t.getConstrainedCenter(i)})}}function c(t,e,n,r){var i=t.getZoom();if(void 0!==i){var o=t.getConstrainedZoom(i+e),s=t.getResolutionForZoom(o);t.getAnimating()&&t.cancelAnimations(),t.animate({resolution:s,anchor:n,duration:void 0!==r?r:250,easing:a.b})}}e.a=l},function(t,e,n){"use strict";e.a={FRACTION:"fraction",PIXELS:"pixels"}},function(t,e,n){"use strict";e.a={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16}},function(t,e,n){"use strict";e.a={LAYERGROUP:"layergroup",SIZE:"size",TARGET:"target",VIEW:"view"}},function(t,e,n){"use strict";function r(t){return Math.pow(t,3)}function i(t){return 1-r(1-t)}function o(t){return 3*t*t-2*t*t*t}function a(t){return t}n.d(e,"a",(function(){return r})),n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"d",(function(){return a}))},function(t,e,n){"use strict";function r(t,e,n,r,i){for(var o=void 0!==i?i:[],a=0,s=e;s<n;s+=r)o[a++]=t.slice(s,s+r);return o.length=a,o}function i(t,e,n,i,o){for(var a=void 0!==o?o:[],s=0,l=0,u=n.length;l<u;++l){var c=n[l];a[s++]=r(t,e,c,i,a[s]),e=c}return a.length=s,a}function o(t,e,n,r,o){for(var a=void 0!==o?o:[],s=0,l=0,u=n.length;l<u;++l){var c=n[l];a[s++]=i(t,e,c,r,a[s]),e=c[c.length-1]}return a.length=s,a}n.d(e,"a",(function(){return r})),n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return o}))},function(t,e,n){"use strict";var r,i=n(9),o=n(202),a=n(78),s=n(113),l=n(15),u=n(203),c=n(116),h=n(8),p=n(0),d=n(10),f=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),g=function(t){function e(e,n,r,i,o,s,d,f,g,y,m,v){var _=t.call(this,o,l.a.IDLE)||this;_.renderEdges_=void 0!==m&&m,_.contextOptions_=v,_.pixelRatio_=d,_.gutter_=f,_.canvas_=null,_.sourceTileGrid_=n,_.targetTileGrid_=i,_.wrappedTileCoord_=s||o,_.sourceTiles_=[],_.sourcesListenerKeys_=null,_.sourceZ_=0;var b=i.getTileCoordExtent(_.wrappedTileCoord_),w=_.targetTileGrid_.getExtent(),x=_.sourceTileGrid_.getExtent(),E=w?Object(p.getIntersection)(b,w):b;if(0===Object(p.getArea)(E))return _.state=l.a.EMPTY,_;var S=e.getExtent();S&&(x=x?Object(p.getIntersection)(x,S):S);var O=i.getResolution(_.wrappedTileCoord_[0]),C=Object(c.a)(e,r,E,O);if(!isFinite(C)||C<=0)return _.state=l.a.EMPTY,_;var T=void 0!==y?y:a.b;if(_.triangulation_=new u.a(e,r,E,x,C*T,O),0===_.triangulation_.getTriangles().length)return _.state=l.a.EMPTY,_;_.sourceZ_=n.getZForResolution(C);var I=_.triangulation_.calculateSourceExtent();if(x&&(e.canWrapX()?(I[1]=Object(h.a)(I[1],x[1],x[3]),I[3]=Object(h.a)(I[3],x[1],x[3])):I=Object(p.getIntersection)(I,x)),Object(p.getArea)(I)){for(var L=n.getTileRangeForExtentAndZ(I,_.sourceZ_),P=L.minX;P<=L.maxX;P++)for(var R=L.minY;R<=L.maxY;R++){var M=g(_.sourceZ_,P,R,d);M&&_.sourceTiles_.push(M)}0===_.sourceTiles_.length&&(_.state=l.a.EMPTY)}else _.state=l.a.EMPTY;return _}return f(e,t),e.prototype.getImage=function(){return this.canvas_},e.prototype.reproject_=function(){var t=[];if(this.sourceTiles_.forEach(function(e,n,r){e&&e.getState()==l.a.LOADED&&t.push({extent:this.sourceTileGrid_.getTileCoordExtent(e.tileCoord),image:e.getImage()})}.bind(this)),this.sourceTiles_.length=0,0===t.length)this.state=l.a.ERROR;else{var e=this.wrappedTileCoord_[0],n=this.targetTileGrid_.getTileSize(e),r="number"==typeof n?n:n[0],i="number"==typeof n?n:n[1],o=this.targetTileGrid_.getResolution(e),a=this.sourceTileGrid_.getResolution(this.sourceZ_),s=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=Object(c.c)(r,i,this.pixelRatio_,a,this.sourceTileGrid_.getExtent(),o,s,this.triangulation_,t,this.gutter_,this.renderEdges_,this.contextOptions_),this.state=l.a.LOADED}this.changed()},e.prototype.load=function(){if(this.state==l.a.IDLE){this.state=l.a.LOADING,this.changed();var t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(function(e,n,r){var o=e.getState();if(o==l.a.IDLE||o==l.a.LOADING){t++;var a=Object(d.listen)(e,i.a.CHANGE,(function(n){var r=e.getState();r!=l.a.LOADED&&r!=l.a.ERROR&&r!=l.a.EMPTY||(Object(d.unlistenByKey)(a),0===--t&&(this.unlistenSources_(),this.reproject_()))}),this);this.sourcesListenerKeys_.push(a)}}.bind(this)),0===t?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach((function(t,e,n){t.getState()==l.a.IDLE&&t.load()}))}},e.prototype.unlistenSources_=function(){this.sourcesListenerKeys_.forEach(d.unlistenByKey),this.sourcesListenerKeys_=null},e}(s.a),y=n(161),m=n(149),v=n(84),_=n(2),b=n(48),w=n(55),x=n(4),E=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),S=function(t){function e(e){var n=t.call(this,{attributions:e.attributions,cacheSize:e.cacheSize,opaque:e.opaque,projection:e.projection,state:e.state,tileGrid:e.tileGrid,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:O,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX,transition:e.transition,key:e.key,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection})||this;return n.crossOrigin=void 0!==e.crossOrigin?e.crossOrigin:null,n.tileClass=void 0!==e.tileClass?e.tileClass:o.a,n.tileCacheForProjection={},n.tileGridForProjection={},n.reprojectionErrorThreshold_=e.reprojectionErrorThreshold,n.contextOptions_=!1===e.imageSmoothing?v.b:void 0,n.renderReprojectionEdges_=!1,n}return E(e,t),e.prototype.canExpireCache=function(){if(!a.a)return t.prototype.canExpireCache.call(this);if(this.tileCache.canExpireCache())return!0;for(var e in this.tileCacheForProjection)if(this.tileCacheForProjection[e].canExpireCache())return!0;return!1},e.prototype.expireCache=function(e,n){if(a.a){var r=this.getTileCacheForProjection(e);for(var i in this.tileCache.expireCache(this.tileCache==r?n:{}),this.tileCacheForProjection){var o=this.tileCacheForProjection[i];o.expireCache(o==r?n:{})}}else t.prototype.expireCache.call(this,e,n)},e.prototype.getContextOptions=function(){return this.contextOptions_},e.prototype.getGutterForProjection=function(t){return a.a&&this.getProjection()&&t&&!Object(_.equivalent)(this.getProjection(),t)?0:this.getGutter()},e.prototype.getGutter=function(){return 0},e.prototype.getKey=function(){return t.prototype.getKey.call(this)+(this.contextOptions_?"\n"+JSON.stringify(this.contextOptions_):"")},e.prototype.getOpaque=function(e){return!(a.a&&this.getProjection()&&e&&!Object(_.equivalent)(this.getProjection(),e))&&t.prototype.getOpaque.call(this,e)},e.prototype.getTileGridForProjection=function(e){if(!a.a)return t.prototype.getTileGridForProjection.call(this,e);var n=this.getProjection();if(!this.tileGrid||n&&!Object(_.equivalent)(n,e)){var r=Object(x.c)(e);return r in this.tileGridForProjection||(this.tileGridForProjection[r]=Object(w.getForProjection)(e)),this.tileGridForProjection[r]}return this.tileGrid},e.prototype.getTileCacheForProjection=function(e){if(!a.a)return t.prototype.getTileCacheForProjection.call(this,e);var n=this.getProjection();if(!n||Object(_.equivalent)(n,e))return this.tileCache;var r=Object(x.c)(e);return r in this.tileCacheForProjection||(this.tileCacheForProjection[r]=new y.a(this.tileCache.highWaterMark)),this.tileCacheForProjection[r]},e.prototype.createTile_=function(t,e,n,r,o,a){var s=[t,e,n],u=this.getTileCoordForTileUrlFunction(s,o),c=u?this.tileUrlFunction(u,r,o):void 0,h=new this.tileClass(s,void 0!==c?l.a.IDLE:l.a.EMPTY,void 0!==c?c:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return h.key=a,h.addEventListener(i.a.CHANGE,this.handleTileChange.bind(this)),h},e.prototype.getTile=function(t,e,n,r,i){var o=this.getProjection();if(a.a&&o&&i&&!Object(_.equivalent)(o,i)){var s=this.getTileCacheForProjection(i),l=[t,e,n],u=void 0,c=Object(b.d)(l);s.containsKey(c)&&(u=s.get(c));var h=this.getKey();if(u&&u.key==h)return u;var p=this.getTileGridForProjection(o),d=this.getTileGridForProjection(i),f=this.getTileCoordForTileUrlFunction(l,i),y=new g(o,p,i,d,l,f,this.getTilePixelRatio(r),this.getGutter(),function(t,e,n,r){return this.getTileInternal(t,e,n,r,o)}.bind(this),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.contextOptions_);return y.key=h,u?(y.interimTile=u,y.refreshInterimChain(),s.replace(c,y)):s.set(c,y),y}return this.getTileInternal(t,e,n,r,o||i)},e.prototype.getTileInternal=function(t,e,n,r,i){var o=null,a=Object(b.e)(t,e,n),s=this.getKey();if(this.tileCache.containsKey(a)){if((o=this.tileCache.get(a)).key!=s){var u=o;o=this.createTile_(t,e,n,r,i,s),u.getState()==l.a.IDLE?o.interimTile=u.interimTile:o.interimTile=u,o.refreshInterimChain(),this.tileCache.replace(a,o)}}else o=this.createTile_(t,e,n,r,i,s),this.tileCache.set(a,o);return o},e.prototype.setRenderReprojectionEdges=function(t){if(a.a&&this.renderReprojectionEdges_!=t){for(var e in this.renderReprojectionEdges_=t,this.tileCacheForProjection)this.tileCacheForProjection[e].clear();this.changed()}},e.prototype.setTileGridForProjection=function(t,e){if(a.a){var n=Object(_.get)(t);if(n){var r=Object(x.c)(n);r in this.tileGridForProjection||(this.tileGridForProjection[r]=e)}}},e}(m.a);function O(t,e){t.getImage().src=e}e.a=S},function(t,e,n){"use strict";function r(t,e,n,r){for(var i=0,o=n.length;i<o;++i)t[e++]=n[i];return e}function i(t,e,n,r){for(var i=0,o=n.length;i<o;++i)for(var a=n[i],s=0;s<r;++s)t[e++]=a[s];return e}function o(t,e,n,r,o){for(var a=o||[],s=0,l=0,u=n.length;l<u;++l){var c=i(t,e,n[l],r);a[s++]=c,e=c}return a.length=s,a}function a(t,e,n,r,i){for(var a=i||[],s=0,l=0,u=n.length;l<u;++l){var c=o(t,e,n[l],r,a[s]);a[s++]=c,e=c[c.length-1]}return a.length=s,a}n.d(e,"a",(function(){return r})),n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"d",(function(){return a}))},function(t,e,n){"use strict";n.d(e,"b",(function(){return r})),n.d(e,"a",(function(){return i}));var r=.5,i=!0},function(t,e,n){"use strict";n.d(e,"b",(function(){return f}));var r,i=n(197),o=n(9),a=n(50),s=n(82),l=n(39),u=n(13),c=n(6),h=n(10),p=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),d=function(t){function e(e){var n=this,r=Object(c.a)({},e);delete r.source,(n=t.call(this,r)||this).on,n.once,n.un,n.mapPrecomposeKey_=null,n.mapRenderKey_=null,n.sourceChangeKey_=null,n.renderer_=null,e.render&&(n.render=e.render),e.map&&n.setMap(e.map),n.addChangeListener(a.a.SOURCE,n.handleSourcePropertyChange_);var i=e.source?e.source:null;return n.setSource(i),n}return p(e,t),e.prototype.getLayersArray=function(t){var e=t||[];return e.push(this),e},e.prototype.getLayerStatesArray=function(t){var e=t||[];return e.push(this.getLayerState()),e},e.prototype.getSource=function(){return this.get(a.a.SOURCE)||null},e.prototype.getSourceState=function(){var t=this.getSource();return t?t.getState():l.a.UNDEFINED},e.prototype.handleSourceChange_=function(){this.changed()},e.prototype.handleSourcePropertyChange_=function(){this.sourceChangeKey_&&(Object(h.unlistenByKey)(this.sourceChangeKey_),this.sourceChangeKey_=null);var t=this.getSource();t&&(this.sourceChangeKey_=Object(h.listen)(t,o.a.CHANGE,this.handleSourceChange_,this)),this.changed()},e.prototype.getFeatures=function(t){return this.renderer_?this.renderer_.getFeatures(t):new Promise((function(t){return t([])}))},e.prototype.render=function(t,e){var n=this.getRenderer();if(n.prepareFrame(t))return n.renderFrame(t,e)},e.prototype.setMap=function(t){this.mapPrecomposeKey_&&(Object(h.unlistenByKey)(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&(Object(h.unlistenByKey)(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=Object(h.listen)(t,s.a.PRECOMPOSE,(function(t){var e=t.frameState.layerStatesArray,n=this.getLayerState(!1);Object(u.a)(!e.some((function(t){return t.layer===n.layer})),67),e.push(n)}),this),this.mapRenderKey_=Object(h.listen)(this,o.a.CHANGE,t.render,t),this.changed())},e.prototype.setSource=function(t){this.set(a.a.SOURCE,t)},e.prototype.getRenderer=function(){return this.renderer_||(this.renderer_=this.createRenderer()),this.renderer_},e.prototype.hasRenderer=function(){return!!this.renderer_},e.prototype.createRenderer=function(){return null},e.prototype.disposeInternal=function(){this.setSource(null),t.prototype.disposeInternal.call(this)},e}(i.a);function f(t,e){if(!t.visible)return!1;var n=e.resolution;if(n<t.minResolution||n>=t.maxResolution)return!1;var r=e.zoom;return r>t.minZoom&&r<=t.maxZoom}e.a=d},function(t,e,n){"use strict";e.a={ARRAY_BUFFER:"arraybuffer",JSON:"json",TEXT:"text",XML:"xml"}},function(t,e,n){"use strict";n.d(e,"a",(function(){return s})),n.d(e,"b",(function(){return l})),n.d(e,"d",(function(){return u})),n.d(e,"c",(function(){return c}));var r=n(13),i=n(8),o=n(48);function a(t,e){var n=/\{z\}/g,i=/\{x\}/g,o=/\{y\}/g,a=/\{-y\}/g;return function(s,l,u){return s?t.replace(n,s[0].toString()).replace(i,s[1].toString()).replace(o,s[2].toString()).replace(a,(function(){var t=s[0],n=e.getFullTileRange(t);return Object(r.a)(n,55),(n.getHeight()-s[2]-1).toString()})):void 0}}function s(t,e){for(var n=t.length,r=new Array(n),i=0;i<n;++i)r[i]=a(t[i],e);return l(r)}function l(t){return 1===t.length?t[0]:function(e,n,r){if(e){var a=Object(o.f)(e),s=Object(i.e)(a,t.length);return t[s](e,n,r)}}}function u(t,e,n){}function c(t){var e=[],n=/\{([a-z])-([a-z])\}/.exec(t);if(n){var r=n[1].charCodeAt(0),i=n[2].charCodeAt(0),o=void 0;for(o=r;o<=i;++o)e.push(t.replace(n[0],String.fromCharCode(o)));return e}if(n=/\{(\d+)-(\d+)\}/.exec(t)){for(var a=parseInt(n[2],10),s=parseInt(n[1],10);s<=a;s++)e.push(t.replace(n[0],s.toString()));return e}return e.push(t),e}},function(t,e,n){"use strict";e.a={PRERENDER:"prerender",POSTRENDER:"postrender",PRECOMPOSE:"precompose",POSTCOMPOSE:"postcompose",RENDERCOMPLETE:"rendercomplete"}},function(t,e,n){var r=n(232);function i(e,n,o){return"undefined"!=typeof Reflect&&Reflect.get?t.exports=i=Reflect.get:t.exports=i=function(t,e,n){var i=r(t,e);if(i){var o=Object.getOwnPropertyDescriptor(i,e);return o.get?o.get.call(n):o.value}},i(e,n,o||e)}t.exports=i},function(t,e,n){"use strict";n.d(e,"a",(function(){return r})),n.d(e,"b",(function(){return i}));var r="1.3.0",i={imageSmoothingEnabled:!1,msImageSmoothingEnabled:!1}},function(t,e,n){"use strict";e.a={BOTTOM_LEFT:"bottom-left",BOTTOM_CENTER:"bottom-center",BOTTOM_RIGHT:"bottom-right",CENTER_LEFT:"center-left",CENTER_CENTER:"center-center",CENTER_RIGHT:"center-right",TOP_LEFT:"top-left",TOP_CENTER:"top-center",TOP_RIGHT:"top-right"}},function(t,e,n){"use strict";n.r(e),n.d(e,"Attribution",(function(){return h})),n.d(e,"Control",(function(){return i.a})),n.d(e,"FullScreen",(function(){return C})),n.d(e,"MousePosition",(function(){return P})),n.d(e,"OverviewMap",(function(){return q})),n.d(e,"Rotate",(function(){return g})),n.d(e,"ScaleLine",(function(){return tt})),n.d(e,"Zoom",(function(){return m})),n.d(e,"ZoomSlider",(function(){return at})),n.d(e,"ZoomToExtent",(function(){return lt})),n.d(e,"defaults",(function(){return ut}));var r,i=n(47),o=n(9),a=n(36),s=n(7),l=n(79),u=n(25),c=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),h=function(t){function e(e){var n=this,r=e||{};(n=t.call(this,{element:document.createElement("div"),render:r.render,target:r.target})||this).ulElement_=document.createElement("ul"),n.collapsed_=void 0===r.collapsed||r.collapsed,n.userCollapsed_=n.collapsed_,n.overrideCollapsible_=void 0!==r.collapsible,n.collapsible_=void 0===r.collapsible||r.collapsible,n.collapsible_||(n.collapsed_=!1);var i=void 0!==r.className?r.className:"ol-attribution",s=void 0!==r.tipLabel?r.tipLabel:"Attributions",l=void 0!==r.expandClassName?r.expandClassName:i+"-expand",u=void 0!==r.collapseLabel?r.collapseLabel:"»",c=void 0!==r.collapseClassName?r.collapseClassName:i+"-collpase";"string"==typeof u?(n.collapseLabel_=document.createElement("span"),n.collapseLabel_.textContent=u,n.collapseLabel_.className=c):n.collapseLabel_=u;var h=void 0!==r.label?r.label:"i";"string"==typeof h?(n.label_=document.createElement("span"),n.label_.textContent=h,n.label_.className=l):n.label_=h;var p=n.collapsible_&&!n.collapsed_?n.collapseLabel_:n.label_;n.toggleButton_=document.createElement("button"),n.toggleButton_.setAttribute("type","button"),n.toggleButton_.setAttribute("aria-expanded",String(!n.collapsed_)),n.toggleButton_.title=s,n.toggleButton_.appendChild(p),n.toggleButton_.addEventListener(o.a.CLICK,n.handleClick_.bind(n),!1);var d=i+" "+a.e+" "+a.b+(n.collapsed_&&n.collapsible_?" "+a.a:"")+(n.collapsible_?"":" ol-uncollapsible"),f=n.element;return f.className=d,f.appendChild(n.toggleButton_),f.appendChild(n.ulElement_),n.renderedAttributions_=[],n.renderedVisible_=!0,n}return c(e,t),e.prototype.collectSourceAttributions_=function(t){for(var e={},n=[],r=!0,i=t.layerStatesArray,o=0,a=i.length;o<a;++o){var s=i[o];if(Object(l.b)(s,t.viewState)){var u=s.layer.getSource();if(u){var c=u.getAttributions();if(c){var h=c(t);if(h)if(r=r&&!1!==u.getAttributionsCollapsible(),Array.isArray(h))for(var p=0,d=h.length;p<d;++p)h[p]in e||(n.push(h[p]),e[h[p]]=!0);else h in e||(n.push(h),e[h]=!0)}}}}return this.overrideCollapsible_||this.setCollapsible(r),n},e.prototype.updateElement_=function(t){if(t){var e=this.collectSourceAttributions_(t),n=e.length>0;if(this.renderedVisible_!=n&&(this.element.style.display=n?"":"none",this.renderedVisible_=n),!Object(s.b)(e,this.renderedAttributions_)){Object(u.d)(this.ulElement_);for(var r=0,i=e.length;r<i;++r){var o=document.createElement("li");o.innerHTML=e[r],this.ulElement_.appendChild(o)}this.renderedAttributions_=e}}else this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1)},e.prototype.handleClick_=function(t){t.preventDefault(),this.handleToggle_(),this.userCollapsed_=this.collapsed_},e.prototype.handleToggle_=function(){this.element.classList.toggle(a.a),this.collapsed_?Object(u.g)(this.collapseLabel_,this.label_):Object(u.g)(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_,this.toggleButton_.setAttribute("aria-expanded",String(!this.collapsed_))},e.prototype.getCollapsible=function(){return this.collapsible_},e.prototype.setCollapsible=function(t){this.collapsible_!==t&&(this.collapsible_=t,this.element.classList.toggle("ol-uncollapsible"),this.userCollapsed_&&this.handleToggle_())},e.prototype.setCollapsed=function(t){this.userCollapsed_=t,this.collapsible_&&this.collapsed_!==t&&this.handleToggle_()},e.prototype.getCollapsed=function(){return this.collapsed_},e.prototype.render=function(t){this.updateElement_(t.frameState)},e}(i.a),p=n(37),d=n(74),f=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),g=function(t){function e(e){var n=this,r=e||{};n=t.call(this,{element:document.createElement("div"),render:r.render,target:r.target})||this;var i=void 0!==r.className?r.className:"ol-rotate",s=void 0!==r.label?r.label:"⇧",l=void 0!==r.compassClassName?r.compassClassName:"ol-compass";n.label_=null,"string"==typeof s?(n.label_=document.createElement("span"),n.label_.className=l,n.label_.textContent=s):(n.label_=s,n.label_.classList.add(l));var u=r.tipLabel?r.tipLabel:"Reset rotation",c=document.createElement("button");c.className=i+"-reset",c.setAttribute("type","button"),c.title=u,c.appendChild(n.label_),c.addEventListener(o.a.CLICK,n.handleClick_.bind(n),!1);var h=i+" "+a.e+" "+a.b,p=n.element;return p.className=h,p.appendChild(c),n.callResetNorth_=r.resetNorth?r.resetNorth:void 0,n.duration_=void 0!==r.duration?r.duration:250,n.autoHide_=void 0===r.autoHide||r.autoHide,n.rotation_=void 0,n.autoHide_&&n.element.classList.add(a.c),n}return f(e,t),e.prototype.handleClick_=function(t){t.preventDefault(),void 0!==this.callResetNorth_?this.callResetNorth_():this.resetNorth_()},e.prototype.resetNorth_=function(){var t=this.getMap().getView();if(t){var e=t.getRotation();void 0!==e&&(this.duration_>0&&e%(2*Math.PI)!=0?t.animate({rotation:0,duration:this.duration_,easing:d.b}):t.setRotation(0))}},e.prototype.render=function(t){var e=t.frameState;if(e){var n=e.viewState.rotation;if(n!=this.rotation_){var r="rotate("+n+"rad)";if(this.autoHide_){var i=this.element.classList.contains(a.c);i||0!==n?i&&0!==n&&this.element.classList.remove(a.c):this.element.classList.add(a.c)}this.label_.style.transform=r}this.rotation_=n}},e}(i.a),y=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),m=function(t){function e(e){var n=this,r=e||{};n=t.call(this,{element:document.createElement("div"),target:r.target})||this;var i=void 0!==r.className?r.className:"ol-zoom",s=void 0!==r.delta?r.delta:1,l=void 0!==r.zoomInClassName?r.zoomInClassName:i+"-in",u=void 0!==r.zoomOutClassName?r.zoomOutClassName:i+"-out",c=void 0!==r.zoomInLabel?r.zoomInLabel:"+",h=void 0!==r.zoomOutLabel?r.zoomOutLabel:"−",p=void 0!==r.zoomInTipLabel?r.zoomInTipLabel:"Zoom in",d=void 0!==r.zoomOutTipLabel?r.zoomOutTipLabel:"Zoom out",f=document.createElement("button");f.className=l,f.setAttribute("type","button"),f.title=p,f.appendChild("string"==typeof c?document.createTextNode(c):c),f.addEventListener(o.a.CLICK,n.handleClick_.bind(n,s),!1);var g=document.createElement("button");g.className=u,g.setAttribute("type","button"),g.title=d,g.appendChild("string"==typeof h?document.createTextNode(h):h),g.addEventListener(o.a.CLICK,n.handleClick_.bind(n,-s),!1);var y=i+" "+a.e+" "+a.b,m=n.element;return m.className=y,m.appendChild(f),m.appendChild(g),n.duration_=void 0!==r.duration?r.duration:250,n}return y(e,t),e.prototype.handleClick_=function(t,e){e.preventDefault(),this.zoomByDelta_(t)},e.prototype.zoomByDelta_=function(t){var e=this.getMap().getView();if(e){var n=e.getZoom();if(void 0!==n){var r=e.getConstrainedZoom(n+t);this.duration_>0?(e.getAnimating()&&e.cancelAnimations(),e.animate({zoom:r,duration:this.duration_,easing:d.b})):e.setZoom(r)}}},e}(i.a),v=n(10),_=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),b=["fullscreenchange","webkitfullscreenchange","MSFullscreenChange"],w="enterfullscreen",x="leavefullscreen";function E(){var t=document.body;return!!(t.webkitRequestFullscreen||t.msRequestFullscreen&&document.msFullscreenEnabled||t.requestFullscreen&&document.fullscreenEnabled)}function S(){return!!(document.webkitIsFullScreen||document.msFullscreenElement||document.fullscreenElement)}function O(t){t.requestFullscreen?t.requestFullscreen():t.msRequestFullscreen?t.msRequestFullscreen():t.webkitRequestFullscreen&&t.webkitRequestFullscreen()}var C=function(t){function e(e){var n=this,r=e||{};(n=t.call(this,{element:document.createElement("div"),target:r.target})||this).on,n.once,n.un,n.cssClassName_=void 0!==r.className?r.className:"ol-full-screen",n.activeClassName_=void 0!==r.activeClassName?r.activeClassName.split(" "):[n.cssClassName_+"-true"],n.inactiveClassName_=void 0!==r.inactiveClassName?r.inactiveClassName.split(" "):[n.cssClassName_+"-false"];var i=void 0!==r.label?r.label:"⤢";n.labelNode_="string"==typeof i?document.createTextNode(i):i;var s=void 0!==r.labelActive?r.labelActive:"×";n.labelActiveNode_="string"==typeof s?document.createTextNode(s):s,n.button_=document.createElement("button");var l=r.tipLabel?r.tipLabel:"Toggle full-screen";n.setClassName_(n.button_,S()),n.button_.setAttribute("type","button"),n.button_.title=l,n.button_.appendChild(n.labelNode_),n.button_.addEventListener(o.a.CLICK,n.handleClick_.bind(n),!1);var u=n.cssClassName_+" "+a.e+" "+a.b+" "+(E()?"":a.f),c=n.element;return c.className=u,c.appendChild(n.button_),n.keys_=void 0!==r.keys&&r.keys,n.source_=r.source,n}return _(e,t),e.prototype.handleClick_=function(t){t.preventDefault(),this.handleFullScreen_()},e.prototype.handleFullScreen_=function(){if(E()){var t=this.getMap();if(t)if(S())document.exitFullscreen?document.exitFullscreen():document.msExitFullscreen?document.msExitFullscreen():document.webkitExitFullscreen&&document.webkitExitFullscreen();else{var e=void 0;e=this.source_?"string"==typeof this.source_?document.getElementById(this.source_):this.source_:t.getTargetElement(),this.keys_?function(t){t.webkitRequestFullscreen?t.webkitRequestFullscreen():O(t)}(e):O(e)}}},e.prototype.handleFullScreenChange_=function(){var t=this.getMap();S()?(this.setClassName_(this.button_,!0),Object(u.g)(this.labelActiveNode_,this.labelNode_),this.dispatchEvent(w)):(this.setClassName_(this.button_,!1),Object(u.g)(this.labelNode_,this.labelActiveNode_),this.dispatchEvent(x)),t&&t.updateSize()},e.prototype.setClassName_=function(t,e){var n,r,i,o=this.activeClassName_,a=this.inactiveClassName_,s=e?o:a;(n=t.classList).remove.apply(n,o),(r=t.classList).remove.apply(r,a),(i=t.classList).add.apply(i,s)},e.prototype.setMap=function(e){if(t.prototype.setMap.call(this,e),e)for(var n=0,r=b.length;n<r;++n)this.listenerKeys.push(Object(v.listen)(document,b[n],this.handleFullScreenChange_,this))},e}(i.a),T=n(93),I=n(2),L=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),P=function(t){function e(e){var n=this,r=e||{},i=document.createElement("div");i.className=void 0!==r.className?r.className:"ol-mouse-position",(n=t.call(this,{element:i,render:r.render,target:r.target})||this).on,n.once,n.un,n.addChangeListener("projection",n.handleProjectionChanged_),r.coordinateFormat&&n.setCoordinateFormat(r.coordinateFormat),r.projection&&n.setProjection(r.projection);var o=!0,a=" ";return"undefinedHTML"in r?(void 0!==r.undefinedHTML&&(a=r.undefinedHTML),o=!!a):"placeholder"in r&&(!1===r.placeholder?o=!1:a=String(r.placeholder)),n.placeholder_=a,n.renderOnMouseOut_=o,n.renderedHTML_=i.innerHTML,n.mapProjection_=null,n.transform_=null,n}return L(e,t),e.prototype.handleProjectionChanged_=function(){this.transform_=null},e.prototype.getCoordinateFormat=function(){return this.get("coordinateFormat")},e.prototype.getProjection=function(){return this.get("projection")},e.prototype.handleMouseMove=function(t){var e=this.getMap();this.updateHTML_(e.getEventPixel(t))},e.prototype.handleMouseOut=function(t){this.updateHTML_(null)},e.prototype.setMap=function(e){if(t.prototype.setMap.call(this,e),e){var n=e.getViewport();this.listenerKeys.push(Object(v.listen)(n,T.a.POINTERMOVE,this.handleMouseMove,this)),this.renderOnMouseOut_&&this.listenerKeys.push(Object(v.listen)(n,T.a.POINTEROUT,this.handleMouseOut,this)),this.updateHTML_(null)}},e.prototype.setCoordinateFormat=function(t){this.set("coordinateFormat",t)},e.prototype.setProjection=function(t){this.set("projection",Object(I.get)(t))},e.prototype.updateHTML_=function(t){var e=this.placeholder_;if(t&&this.mapProjection_){if(!this.transform_){var n=this.getProjection();this.transform_=n?Object(I.getTransformFromProjections)(this.mapProjection_,n):I.identityTransform}var r=this.getMap().getCoordinateFromPixelInternal(t);if(r){var i=Object(I.getUserProjection)();i&&(this.transform_=Object(I.getTransformFromProjections)(this.mapProjection_,i)),this.transform_(r,r);var o=this.getCoordinateFormat();e=o?o(r):r.toString()}}this.renderedHTML_&&e===this.renderedHTML_||(this.element.innerHTML=e,this.renderedHTML_=e)},e.prototype.render=function(t){var e=t.frameState;e?this.mapProjection_!=e.viewState.projection&&(this.mapProjection_=e.viewState.projection,this.transform_=null):this.mapProjection_=null},e}(i.a),R=n(215),M=n(117),N=n(73),j=n(91),A=n(135),k=n(85),F=n(214),D=n(123),G=n(95),z=n(0),U=n(22),B=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),V=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return B(e,t),e.prototype.createRenderer=function(){return new R.a(this)},e}(F.a),q=function(t){function e(e){var n=this,r=e||{};(n=t.call(this,{element:document.createElement("div"),render:r.render,target:r.target})||this).boundHandleRotationChanged_=n.handleRotationChanged_.bind(n),n.collapsed_=void 0===r.collapsed||r.collapsed,n.collapsible_=void 0===r.collapsible||r.collapsible,n.collapsible_||(n.collapsed_=!1),n.rotateWithView_=void 0!==r.rotateWithView&&r.rotateWithView,n.viewExtent_=void 0;var i=void 0!==r.className?r.className:"ol-overviewmap",s=void 0!==r.tipLabel?r.tipLabel:"Overview map",l=void 0!==r.collapseLabel?r.collapseLabel:"«";"string"==typeof l?(n.collapseLabel_=document.createElement("span"),n.collapseLabel_.textContent=l):n.collapseLabel_=l;var u=void 0!==r.label?r.label:"»";"string"==typeof u?(n.label_=document.createElement("span"),n.label_.textContent=u):n.label_=u;var c=n.collapsible_&&!n.collapsed_?n.collapseLabel_:n.label_,h=document.createElement("button");h.setAttribute("type","button"),h.title=s,h.appendChild(c),h.addEventListener(o.a.CLICK,n.handleClick_.bind(n),!1),n.ovmapDiv_=document.createElement("div"),n.ovmapDiv_.className="ol-overviewmap-map",n.view_=r.view,n.ovmap_=new V({view:r.view});var p=n.ovmap_;r.layers&&r.layers.forEach((function(t){p.addLayer(t)}));var d=document.createElement("div");d.className="ol-overviewmap-box",d.style.boxSizing="border-box",n.boxOverlay_=new A.a({position:[0,0],positioning:k.a.CENTER_CENTER,element:d}),n.ovmap_.addOverlay(n.boxOverlay_);var f=i+" "+a.e+" "+a.b+(n.collapsed_&&n.collapsible_?" "+a.a:"")+(n.collapsible_?"":" ol-uncollapsible"),g=n.element;g.className=f,g.appendChild(n.ovmapDiv_),g.appendChild(h);var y=n,m=n.boxOverlay_,v=n.boxOverlay_.getElement(),_=function(t){var e,n={clientX:(e=t).clientX,clientY:e.clientY},r=p.getEventCoordinateInternal(n);m.setPosition(r)},b=function(t){var e=p.getEventCoordinateInternal(t);y.getMap().getView().setCenterInternal(e),window.removeEventListener("mousemove",_),window.removeEventListener("mouseup",b)};return v.addEventListener("mousedown",(function(){window.addEventListener("mousemove",_),window.addEventListener("mouseup",b)})),n}return B(e,t),e.prototype.setMap=function(e){var n=this.getMap();if(e!==n){if(n){var r=n.getView();r&&this.unbindView_(r),this.ovmap_.setTarget(null)}if(t.prototype.setMap.call(this,e),e){this.ovmap_.setTarget(this.ovmapDiv_),this.listenerKeys.push(Object(v.listen)(e,j.a.PROPERTYCHANGE,this.handleMapPropertyChange_,this));var i=e.getView();i&&(this.bindView_(i),i.isDef()&&(this.ovmap_.updateSize(),this.resetExtent_())),this.ovmap_.isRendered()||this.updateBoxAfterOvmapIsRendered_()}}},e.prototype.handleMapPropertyChange_=function(t){if(t.key===N.a.VIEW){var e=t.oldValue;e&&this.unbindView_(e);var n=this.getMap().getView();this.bindView_(n)}else this.ovmap_.isRendered()||t.key!==N.a.TARGET&&t.key!==N.a.SIZE||this.ovmap_.updateSize()},e.prototype.bindView_=function(t){if(!this.view_){var e=new D.a({projection:t.getProjection()});this.ovmap_.setView(e)}t.addChangeListener(G.a.ROTATION,this.boundHandleRotationChanged_),this.handleRotationChanged_()},e.prototype.unbindView_=function(t){t.removeChangeListener(G.a.ROTATION,this.boundHandleRotationChanged_)},e.prototype.handleRotationChanged_=function(){this.rotateWithView_&&this.ovmap_.getView().setRotation(this.getMap().getView().getRotation())},e.prototype.validateExtent_=function(){var t=this.getMap(),e=this.ovmap_;if(t.isRendered()&&e.isRendered()){var n=t.getSize(),r=t.getView().calculateExtentInternal(n);if(!this.viewExtent_||!Object(z.equals)(r,this.viewExtent_)){this.viewExtent_=r;var i=e.getSize(),o=e.getView().calculateExtentInternal(i),a=e.getPixelFromCoordinateInternal(Object(z.getTopLeft)(r)),s=e.getPixelFromCoordinateInternal(Object(z.getBottomRight)(r)),l=Math.abs(a[0]-s[0]),u=Math.abs(a[1]-s[1]),c=i[0],h=i[1];l<.1*c||u<.1*h||l>.75*c||u>.75*h?this.resetExtent_():Object(z.containsExtent)(o,r)||this.recenter_()}}},e.prototype.resetExtent_=function(){var t=this.getMap(),e=this.ovmap_,n=t.getSize(),r=t.getView().calculateExtentInternal(n),i=e.getView(),o=Math.log(7.5)/Math.LN2,a=1/(.1*Math.pow(2,o/2));Object(z.scaleFromCenter)(r,a),i.fitInternal(Object(U.c)(r))},e.prototype.recenter_=function(){var t=this.getMap(),e=this.ovmap_,n=t.getView();e.getView().setCenterInternal(n.getCenterInternal())},e.prototype.updateBox_=function(){var t=this.getMap(),e=this.ovmap_;if(t.isRendered()&&e.isRendered()){var n=t.getSize(),r=t.getView(),i=e.getView(),o=this.rotateWithView_?0:-r.getRotation(),a=this.boxOverlay_,s=this.boxOverlay_.getElement(),l=r.getCenterInternal(),u=r.getResolution(),c=i.getResolution(),h=n[0]*u/c,p=n[1]*u/c;if(a.setPosition(l),s){s.style.width=h+"px",s.style.height=p+"px";var d="rotate("+o+"rad)";s.style.transform=d}}},e.prototype.updateBoxAfterOvmapIsRendered_=function(){this.ovmapPostrenderKey_||(this.ovmapPostrenderKey_=Object(v.listenOnce)(this.ovmap_,M.a.POSTRENDER,(function(t){delete this.ovmapPostrenderKey_,this.updateBox_()}),this))},e.prototype.handleClick_=function(t){t.preventDefault(),this.handleToggle_()},e.prototype.handleToggle_=function(){this.element.classList.toggle(a.a),this.collapsed_?Object(u.g)(this.collapseLabel_,this.label_):Object(u.g)(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_;var t=this.ovmap_;if(!this.collapsed_){if(t.isRendered())return this.viewExtent_=void 0,void t.render();t.updateSize(),this.resetExtent_(),this.updateBoxAfterOvmapIsRendered_()}},e.prototype.getCollapsible=function(){return this.collapsible_},e.prototype.setCollapsible=function(t){this.collapsible_!==t&&(this.collapsible_=t,this.element.classList.toggle("ol-uncollapsible"),!t&&this.collapsed_&&this.handleToggle_())},e.prototype.setCollapsed=function(t){this.collapsible_&&this.collapsed_!==t&&this.handleToggle_()},e.prototype.getCollapsed=function(){return this.collapsed_},e.prototype.getRotateWithView=function(){return this.rotateWithView_},e.prototype.setRotateWithView=function(t){this.rotateWithView_!==t&&(this.rotateWithView_=t,0!==this.getMap().getView().getRotation()&&(this.rotateWithView_?this.handleRotationChanged_():this.ovmap_.getView().setRotation(0),this.viewExtent_=void 0,this.validateExtent_(),this.updateBox_()))},e.prototype.getOverviewMap=function(){return this.ovmap_},e.prototype.render=function(t){this.validateExtent_(),this.updateBox_()},e}(i.a),Y=n(52),X=n(13),W=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),H="degrees",K="imperial",Z="nautical",$="metric",J="us",Q=[1,2,5],tt=function(t){function e(e){var n=this,r=e||{},i=void 0!==r.className?r.className:r.bar?"ol-scale-bar":"ol-scale-line";return(n=t.call(this,{element:document.createElement("div"),render:r.render,target:r.target})||this).on,n.once,n.un,n.innerElement_=document.createElement("div"),n.innerElement_.className=i+"-inner",n.element.className=i+" "+a.e,n.element.appendChild(n.innerElement_),n.viewState_=null,n.minWidth_=void 0!==r.minWidth?r.minWidth:64,n.renderedVisible_=!1,n.renderedWidth_=void 0,n.renderedHTML_="",n.addChangeListener("units",n.handleUnitsChanged_),n.setUnits(r.units||$),n.scaleBar_=r.bar||!1,n.scaleBarSteps_=r.steps||4,n.scaleBarText_=r.text||!1,n.dpi_=r.dpi||void 0,n}return W(e,t),e.prototype.getUnits=function(){return this.get("units")},e.prototype.handleUnitsChanged_=function(){this.updateElement_()},e.prototype.setUnits=function(t){this.set("units",t)},e.prototype.setDpi=function(t){this.dpi_=t},e.prototype.updateElement_=function(){var t=this.viewState_;if(t){var e=t.center,n=t.projection,r=this.getUnits(),i=r==H?Y.b.DEGREES:Y.b.METERS,o=Object(I.getPointResolution)(n,t.resolution,e,i),a=this.minWidth_*(this.dpi_||25.4/.28)/(25.4/.28),s=a*o,l="";if(r==H){var u=I.METERS_PER_UNIT[Y.b.DEGREES];(s*=u)<u/60?(l="″",o*=3600):s<u?(l="′",o*=60):l="°"}else r==K?s<.9144?(l="in",o/=.0254):s<1609.344?(l="ft",o/=.3048):(l="mi",o/=1609.344):r==Z?(o/=1852,l="nm"):r==$?s<.001?(l="μm",o*=1e6):s<1?(l="mm",o*=1e3):s<1e3?l="m":(l="km",o/=1e3):r==J?s<.9144?(l="in",o*=39.37):s<1609.344?(l="ft",o/=.30480061):(l="mi",o/=1609.3472):Object(X.a)(!1,33);for(var c,h,p,d,f=3*Math.floor(Math.log(a*o)/Math.log(10));;){p=Math.floor(f/3);var g=Math.pow(10,p);if(c=Q[(f%3+3)%3]*g,h=Math.round(c/o),isNaN(h))return this.element.style.display="none",void(this.renderedVisible_=!1);if(h>=a)break;++f}d=this.scaleBar_?this.createScaleBar(h,c,l):c.toFixed(p<0?-p:0)+" "+l,this.renderedHTML_!=d&&(this.innerElement_.innerHTML=d,this.renderedHTML_=d),this.renderedWidth_!=h&&(this.innerElement_.style.width=h+"px",this.renderedWidth_=h),this.renderedVisible_||(this.element.style.display="",this.renderedVisible_=!0)}else this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1)},e.prototype.createScaleBar=function(t,e,n){for(var r="1 : "+Math.round(this.getScaleForResolution()).toLocaleString(),i=[],o=t/this.scaleBarSteps_,a="#ffffff",s=0;s<this.scaleBarSteps_;s++)0===s&&i.push(this.createMarker("absolute",s)),i.push('<div><div class="ol-scale-singlebar" style="width: '+o+"px;background-color: "+a+';"></div>'+this.createMarker("relative",s)+(s%2==0||2===this.scaleBarSteps_?this.createStepText(s,t,!1,e,n):"")+"</div>"),s===this.scaleBarSteps_-1&&i.push(this.createStepText(s+1,t,!0,e,n)),a="#ffffff"===a?"#000000":"#ffffff";return'<div style="display: flex;">'+(this.scaleBarText_?'<div class="ol-scale-text" style="width: '+t+'px;">'+r+"</div>":"")+i.join("")+"</div>"},e.prototype.createMarker=function(t,e){return'<div class="ol-scale-step-marker" style="position: '+t+";top: "+("absolute"===t?3:-10)+'px;"></div>'},e.prototype.createStepText=function(t,e,n,r,i){var o=(0===t?0:Math.round(r/this.scaleBarSteps_*t*100)/100)+(0===t?"":" "+i);return'<div class="ol-scale-step-text" style="margin-left: '+(0===t?-3:e/this.scaleBarSteps_*-1)+"px;text-align: "+(0===t?"left":"center")+"; min-width: "+(0===t?0:e/this.scaleBarSteps_*2)+"px;left: "+(n?e+"px":"unset")+';">'+o+"</div>"},e.prototype.getScaleForResolution=function(){var t=Object(I.getPointResolution)(this.viewState_.projection,this.viewState_.resolution,this.viewState_.center),e=this.dpi_||25.4/.28,n=this.viewState_.projection.getMetersPerUnit();return parseFloat(t.toString())*n*(1e3/25.4)*e},e.prototype.render=function(t){var e=t.frameState;this.viewState_=e?e.viewState:null,this.updateElement_()},e}(i.a),et=n(8),nt=n(40),rt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),it=0,ot=1,at=function(t){function e(e){var n=this,r=e||{};(n=t.call(this,{element:document.createElement("div"),render:r.render})||this).dragListenerKeys_=[],n.currentResolution_=void 0,n.direction_=it,n.dragging_,n.heightLimit_=0,n.widthLimit_=0,n.startX_,n.startY_,n.thumbSize_=null,n.sliderInitialized_=!1,n.duration_=void 0!==r.duration?r.duration:200;var i=void 0!==r.className?r.className:"ol-zoomslider",s=document.createElement("button");s.setAttribute("type","button"),s.className=i+"-thumb "+a.e;var l=n.element;return l.className=i+" "+a.e+" "+a.b,l.appendChild(s),l.addEventListener(T.a.POINTERDOWN,n.handleDraggerStart_.bind(n),!1),l.addEventListener(T.a.POINTERMOVE,n.handleDraggerDrag_.bind(n),!1),l.addEventListener(T.a.POINTERUP,n.handleDraggerEnd_.bind(n),!1),l.addEventListener(o.a.CLICK,n.handleContainerClick_.bind(n),!1),s.addEventListener(o.a.CLICK,nt.b,!1),n}return rt(e,t),e.prototype.setMap=function(e){t.prototype.setMap.call(this,e),e&&e.render()},e.prototype.initSlider_=function(){var t=this.element,e=t.offsetWidth,n=t.offsetHeight;if(0===e&&0===n)return this.sliderInitialized_=!1;var r=getComputedStyle(t);e-=parseFloat(r.paddingRight)+parseFloat(r.paddingLeft),n-=parseFloat(r.paddingTop)+parseFloat(r.paddingBottom);var i=t.firstElementChild,o=getComputedStyle(i),a=i.offsetWidth+parseFloat(o.marginRight)+parseFloat(o.marginLeft),s=i.offsetHeight+parseFloat(o.marginTop)+parseFloat(o.marginBottom);return this.thumbSize_=[a,s],e>n?(this.direction_=ot,this.widthLimit_=e-a):(this.direction_=it,this.heightLimit_=n-s),this.sliderInitialized_=!0},e.prototype.handleContainerClick_=function(t){var e=this.getMap().getView(),n=this.getRelativePosition_(t.offsetX-this.thumbSize_[0]/2,t.offsetY-this.thumbSize_[1]/2),r=this.getResolutionForPosition_(n),i=e.getConstrainedZoom(e.getZoomForResolution(r));e.animateInternal({zoom:i,duration:this.duration_,easing:d.b})},e.prototype.handleDraggerStart_=function(t){if(!this.dragging_&&t.target===this.element.firstElementChild){var e=this.element.firstElementChild;if(this.getMap().getView().beginInteraction(),this.startX_=t.clientX-parseFloat(e.style.left),this.startY_=t.clientY-parseFloat(e.style.top),this.dragging_=!0,0===this.dragListenerKeys_.length){var n=this.handleDraggerDrag_,r=this.handleDraggerEnd_,i=this.getMap().getOwnerDocument();this.dragListenerKeys_.push(Object(v.listen)(i,T.a.POINTERMOVE,n,this),Object(v.listen)(i,T.a.POINTERUP,r,this))}}},e.prototype.handleDraggerDrag_=function(t){if(this.dragging_){var e=t.clientX-this.startX_,n=t.clientY-this.startY_,r=this.getRelativePosition_(e,n);this.currentResolution_=this.getResolutionForPosition_(r),this.getMap().getView().setResolution(this.currentResolution_)}},e.prototype.handleDraggerEnd_=function(t){this.dragging_&&(this.getMap().getView().endInteraction(),this.dragging_=!1,this.startX_=void 0,this.startY_=void 0,this.dragListenerKeys_.forEach(v.unlistenByKey),this.dragListenerKeys_.length=0)},e.prototype.setThumbPosition_=function(t){var e=this.getPositionForResolution_(t),n=this.element.firstElementChild;this.direction_==ot?n.style.left=this.widthLimit_*e+"px":n.style.top=this.heightLimit_*e+"px"},e.prototype.getRelativePosition_=function(t,e){var n;return n=this.direction_===ot?t/this.widthLimit_:e/this.heightLimit_,Object(et.a)(n,0,1)},e.prototype.getResolutionForPosition_=function(t){return this.getMap().getView().getResolutionForValueFunction()(1-t)},e.prototype.getPositionForResolution_=function(t){var e=this.getMap().getView().getValueForResolutionFunction();return Object(et.a)(1-e(t),0,1)},e.prototype.render=function(t){if(t.frameState&&(this.sliderInitialized_||this.initSlider_())){var e=t.frameState.viewState.resolution;this.currentResolution_=e,this.setThumbPosition_(e)}},e}(i.a),st=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),lt=function(t){function e(e){var n=this,r=e||{};(n=t.call(this,{element:document.createElement("div"),target:r.target})||this).extent=r.extent?r.extent:null;var i=void 0!==r.className?r.className:"ol-zoom-extent",s=void 0!==r.label?r.label:"E",l=void 0!==r.tipLabel?r.tipLabel:"Fit to extent",u=document.createElement("button");u.setAttribute("type","button"),u.title=l,u.appendChild("string"==typeof s?document.createTextNode(s):s),u.addEventListener(o.a.CLICK,n.handleClick_.bind(n),!1);var c=i+" "+a.e+" "+a.b,h=n.element;return h.className=c,h.appendChild(u),n}return st(e,t),e.prototype.handleClick_=function(t){t.preventDefault(),this.handleZoomToExtent()},e.prototype.handleZoomToExtent=function(){var t=this.getMap().getView(),e=this.extent?this.extent:t.getProjection().getExtent();t.fitInternal(Object(U.c)(e))},e}(i.a);function ut(t){var e=t||{},n=new p.a;return(void 0===e.zoom||e.zoom)&&n.push(new m(e.zoomOptions)),(void 0===e.rotate||e.rotate)&&n.push(new g(e.rotateOptions)),(void 0===e.attribution||e.attribution)&&n.push(new h(e.attributionOptions)),n}},function(t,e){function n(e){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?t.exports=n=function(t){return typeof t}:t.exports=n=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(e)}t.exports=n},function(t,e,n){"use strict";n.d(e,"b",(function(){return s})),n.d(e,"a",(function(){return p})),n.d(e,"d",(function(){return f})),n.d(e,"c",(function(){return g}));var r=n(13),i=n(8),o=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,a=/^([a-z]*)$|^hsla?\(.*\)$/i;function s(t){return"string"==typeof t?t:f(t)}function l(t){var e=document.createElement("div");if(e.style.color=t,""!==e.style.color){document.body.appendChild(e);var n=getComputedStyle(e).color;return document.body.removeChild(e),n}return""}var u,c,h=(u={},c=0,function(t){var e;if(u.hasOwnProperty(t))e=u[t];else{if(c>=1024){var n=0;for(var i in u)0==(3&n++)&&(delete u[i],--c)}e=function(t){var e,n,i,s,u;if(a.exec(t)&&(t=l(t)),o.exec(t)){var c=t.length-1,h=void 0;h=c<=4?1:2;var p=4===c||8===c;e=parseInt(t.substr(1+0*h,h),16),n=parseInt(t.substr(1+1*h,h),16),i=parseInt(t.substr(1+2*h,h),16),s=p?parseInt(t.substr(1+3*h,h),16):255,1==h&&(e=(e<<4)+e,n=(n<<4)+n,i=(i<<4)+i,p&&(s=(s<<4)+s)),u=[e,n,i,s/255]}else 0==t.indexOf("rgba(")?d(u=t.slice(5,-1).split(",").map(Number)):0==t.indexOf("rgb(")?((u=t.slice(4,-1).split(",").map(Number)).push(1),d(u)):Object(r.a)(!1,14);return u}(t),u[t]=e,++c}return e});function p(t){return Array.isArray(t)?t:h(t)}function d(t){return t[0]=Object(i.a)(t[0]+.5|0,0,255),t[1]=Object(i.a)(t[1]+.5|0,0,255),t[2]=Object(i.a)(t[2]+.5|0,0,255),t[3]=Object(i.a)(t[3],0,1),t}function f(t){var e=t[0];e!=(0|e)&&(e=e+.5|0);var n=t[1];n!=(0|n)&&(n=n+.5|0);var r=t[2];return r!=(0|r)&&(r=r+.5|0),"rgba("+e+","+n+","+r+","+(void 0===t[3]?1:t[3])+")"}function g(t){return a.test(t)&&(t=l(t)),o.test(t)||0===t.indexOf("rgba(")||0===t.indexOf("rgb(")}},function(t,e,n){"use strict";n.d(e,"e",(function(){return o})),n.d(e,"a",(function(){return a})),n.d(e,"f",(function(){return s})),n.d(e,"d",(function(){return l})),n.d(e,"b",(function(){return u})),n.d(e,"c",(function(){return c}));var r=n(8);function i(t,e,n,i,o,a,s){var l,u=t[e],c=t[e+1],h=t[n]-u,p=t[n+1]-c;if(0===h&&0===p)l=e;else{var d=((o-u)*h+(a-c)*p)/(h*h+p*p);if(d>1)l=n;else{if(d>0){for(var f=0;f<i;++f)s[f]=Object(r.c)(t[e+f],t[n+f],d);return void(s.length=i)}l=e}}for(f=0;f<i;++f)s[f]=t[l+f];s.length=i}function o(t,e,n,i,o){var a=t[e],s=t[e+1];for(e+=i;e<n;e+=i){var l=t[e],u=t[e+1],c=Object(r.g)(a,s,l,u);c>o&&(o=c),a=l,s=u}return o}function a(t,e,n,r,i){for(var a=0,s=n.length;a<s;++a){var l=n[a];i=o(t,e,l,r,i),e=l}return i}function s(t,e,n,r,i){for(var o=0,s=n.length;o<s;++o){var l=n[o];i=a(t,e,l,r,i),e=l[l.length-1]}return i}function l(t,e,n,o,a,s,l,u,c,h,p){if(e==n)return h;var d,f;if(0===a){if((f=Object(r.g)(l,u,t[e],t[e+1]))<h){for(d=0;d<o;++d)c[d]=t[e+d];return c.length=o,f}return h}for(var g=p||[NaN,NaN],y=e+o;y<n;)if(i(t,y-o,y,o,l,u,g),(f=Object(r.g)(l,u,g[0],g[1]))<h){for(h=f,d=0;d<o;++d)c[d]=g[d];c.length=o,y+=o}else y+=o*Math.max((Math.sqrt(f)-Math.sqrt(h))/a|0,1);if(s&&(i(t,n-o,e,o,l,u,g),(f=Object(r.g)(l,u,g[0],g[1]))<h)){for(h=f,d=0;d<o;++d)c[d]=g[d];c.length=o}return h}function u(t,e,n,r,i,o,a,s,u,c,h){for(var p=h||[NaN,NaN],d=0,f=n.length;d<f;++d){var g=n[d];c=l(t,e,g,r,i,o,a,s,u,c,p),e=g}return c}function c(t,e,n,r,i,o,a,s,l,c,h){for(var p=h||[NaN,NaN],d=0,f=n.length;d<f;++d){var g=n[d];c=u(t,e,g,r,i,o,a,s,l,c,p),e=g[g.length-1]}return c}},function(t,e,n){"use strict";var r,i=n(9),o=n(146),a=n(1),s=n(0),l=n(10),u=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),c=function(t){function e(e){var n=t.call(this)||this;return n.geometries_=e||null,n.changeEventsKeys_=[],n.listenGeometriesChange_(),n}return u(e,t),e.prototype.unlistenGeometriesChange_=function(){this.changeEventsKeys_.forEach(l.unlistenByKey),this.changeEventsKeys_.length=0},e.prototype.listenGeometriesChange_=function(){if(this.geometries_)for(var t=0,e=this.geometries_.length;t<e;++t)this.changeEventsKeys_.push(Object(l.listen)(this.geometries_[t],i.a.CHANGE,this.changed,this))},e.prototype.clone=function(){var t=new e(null);return t.setGeometries(this.geometries_),t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,n,r){if(r<Object(s.closestSquaredDistanceXY)(this.getExtent(),t,e))return r;for(var i=this.geometries_,o=0,a=i.length;o<a;++o)r=i[o].closestPointXY(t,e,n,r);return r},e.prototype.containsXY=function(t,e){for(var n=this.geometries_,r=0,i=n.length;r<i;++r)if(n[r].containsXY(t,e))return!0;return!1},e.prototype.computeExtent=function(t){Object(s.createOrUpdateEmpty)(t);for(var e=this.geometries_,n=0,r=e.length;n<r;++n)Object(s.extend)(t,e[n].getExtent());return t},e.prototype.getGeometries=function(){return h(this.geometries_)},e.prototype.getGeometriesArray=function(){return this.geometries_},e.prototype.getGeometriesArrayRecursive=function(){for(var t=[],e=this.geometries_,n=0,r=e.length;n<r;++n)e[n].getType()===this.getType()?t=t.concat(e[n].getGeometriesArrayRecursive()):t.push(e[n]);return t},e.prototype.getSimplifiedGeometry=function(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||0!==this.simplifiedGeometryMaxMinSquaredTolerance&&t<this.simplifiedGeometryMaxMinSquaredTolerance)return this;for(var n=[],r=this.geometries_,i=!1,o=0,a=r.length;o<a;++o){var s=r[o],l=s.getSimplifiedGeometry(t);n.push(l),l!==s&&(i=!0)}if(i){var u=new e(null);return u.setGeometriesArray(n),u}return this.simplifiedGeometryMaxMinSquaredTolerance=t,this},e.prototype.getType=function(){return a.a.GEOMETRY_COLLECTION},e.prototype.intersectsExtent=function(t){for(var e=this.geometries_,n=0,r=e.length;n<r;++n)if(e[n].intersectsExtent(t))return!0;return!1},e.prototype.isEmpty=function(){return 0===this.geometries_.length},e.prototype.rotate=function(t,e){for(var n=this.geometries_,r=0,i=n.length;r<i;++r)n[r].rotate(t,e);this.changed()},e.prototype.scale=function(t,e,n){var r=n;r||(r=Object(s.getCenter)(this.getExtent()));for(var i=this.geometries_,o=0,a=i.length;o<a;++o)i[o].scale(t,e,r);this.changed()},e.prototype.setGeometries=function(t){this.setGeometriesArray(h(t))},e.prototype.setGeometriesArray=function(t){this.unlistenGeometriesChange_(),this.geometries_=t,this.listenGeometriesChange_(),this.changed()},e.prototype.applyTransform=function(t){for(var e=this.geometries_,n=0,r=e.length;n<r;++n)e[n].applyTransform(t);this.changed()},e.prototype.translate=function(t,e){for(var n=this.geometries_,r=0,i=n.length;r<i;++r)n[r].translate(t,e);this.changed()},e.prototype.disposeInternal=function(){this.unlistenGeometriesChange_(),t.prototype.disposeInternal.call(this)},e}(o.a);function h(t){for(var e=[],n=0,r=t.length;n<r;++n)e.push(t[n].clone());return e}e.a=c},function(t,e,n){"use strict";e.a={PROPERTYCHANGE:"propertychange"}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(88);function i(t){return Array.isArray(t)?Object(r.d)(t):t}},function(t,e,n){"use strict";e.a={POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"}},function(t,e,n){"use strict";n.d(e,"a",(function(){return h})),n.d(e,"b",(function(){return p})),n.d(e,"c",(function(){return d}));var r=n(177),i=n(1),o=n(71),a=n(122),s=n(8),l=n(25),u=n(0),c=n(7),h=.5;function p(t,e,n,s,p,d,f){var g=t[0]*h,y=t[1]*h,m=Object(l.a)(g,y);m.imageSmoothingEnabled=!1;for(var v=m.canvas,_=new r.a(m,h,p,null,f),b=n.length,w=Math.floor(16777215/b),x={},E=1;E<=b;++E){var S=n[E-1],O=S.getStyleFunction()||s;if(s){var C=O(S,d);if(C){Array.isArray(C)||(C=[C]);for(var T="#"+("000000"+(E*w).toString(16)).slice(-6),I=0,L=C.length;I<L;++I){var P=C[I],R=P.getGeometryFunction()(S);if(R&&Object(u.intersects)(p,R.getExtent())){var M=P.clone(),N=M.getFill();N&&N.setColor(T);var j=M.getStroke();j&&(j.setColor(T),j.setLineDash(null)),M.setText(void 0);var A=P.getImage();if(A&&0!==A.getOpacity()){var k=A.getImageSize();if(!k)continue;var F=Object(l.a)(k[0],k[1],void 0,{alpha:!1}),D=F.canvas;F.fillStyle=T,F.fillRect(0,0,D.width,D.height),M.setImage(new a.a({img:D,imgSize:k,anchor:A.getAnchor(),anchorXUnits:o.a.PIXELS,anchorYUnits:o.a.PIXELS,offset:A.getOrigin(),opacity:1,size:A.getSize(),scale:A.getScale(),rotation:A.getRotation(),rotateWithView:A.getRotateWithView()}))}var G=M.getZIndex()||0;(B=x[G])||(B={},x[G]=B,B[i.a.POLYGON]=[],B[i.a.CIRCLE]=[],B[i.a.LINE_STRING]=[],B[i.a.POINT]=[]),B[R.getType().replace("Multi","")].push(R,M)}}}}}for(var z=Object.keys(x).map(Number).sort(c.i),U=(E=0,z.length);E<U;++E){var B=x[z[E]];for(var V in B){var q=B[V];for(I=0,L=q.length;I<L;I+=2){_.setStyle(q[I+1]);for(var Y=0,X=e.length;Y<X;++Y)_.setTransform(e[Y]),_.drawGeometry(q[I])}}}return m.getImageData(0,0,v.width,v.height)}function d(t,e,n){var r=[];if(n){var i=Math.floor(Math.round(t[0])*h),o=Math.floor(Math.round(t[1])*h),a=4*(Object(s.a)(i,0,n.width-1)+Object(s.a)(o,0,n.height-1)*n.width),l=n.data[a],u=n.data[a+1],c=n.data[a+2]+256*(u+256*l),p=Math.floor(16777215/e.length);c&&c%p==0&&r.push(e[c/p-1])}return r}},function(t,e,n){"use strict";e.a={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"}},function(t,e,n){"use strict";function r(t,e,n){var r=void 0!==n?t.toFixed(n):""+t,i=r.indexOf(".");return(i=-1===i?r.length:i)>e?r:new Array(1+e-i).join("0")+r}function i(t,e){for(var n=(""+t).split("."),r=(""+e).split("."),i=0;i<Math.max(n.length,r.length);i++){var o=parseInt(n[i]||"0",10),a=parseInt(r[i]||"0",10);if(o>a)return 1;if(a>o)return-1}return 0}n.d(e,"b",(function(){return r})),n.d(e,"a",(function(){return i}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return l})),n.d(e,"b",(function(){return u})),n.d(e,"c",(function(){return c})),n.d(e,"d",(function(){return h}));var r=n(34),i=n(1),o=n(23),a=n(4),s={Point:function(t,e,n,i,a){var s,l=n.getImage(),u=n.getText();a&&(t=a,s=l&&u&&u.getText()?{}:void 0);if(l){if(l.getImageState()!=o.a.LOADED)return;var c=t.getBuilder(n.getZIndex(),r.a.IMAGE);c.setImageStyle(l,s),c.drawPoint(e,i)}if(u&&u.getText()){var h=t.getBuilder(n.getZIndex(),r.a.TEXT);h.setTextStyle(u,s),h.drawText(e,i)}},LineString:function(t,e,n,i,o){var a=n.getStroke();if(a){var s=t.getBuilder(n.getZIndex(),r.a.LINE_STRING);s.setFillStrokeStyle(null,a),s.drawLineString(e,i)}var l=n.getText();if(l&&l.getText()){var u=(o||t).getBuilder(n.getZIndex(),r.a.TEXT);u.setTextStyle(l),u.drawText(e,i)}},Polygon:function(t,e,n,i,o){var a=n.getFill(),s=n.getStroke();if(a||s){var l=t.getBuilder(n.getZIndex(),r.a.POLYGON);l.setFillStrokeStyle(a,s),l.drawPolygon(e,i)}var u=n.getText();if(u&&u.getText()){var c=(o||t).getBuilder(n.getZIndex(),r.a.TEXT);c.setTextStyle(u),c.drawText(e,i)}},MultiPoint:function(t,e,n,i,a){var s,l=n.getImage(),u=n.getText();a&&(t=a,s=l&&u&&u.getText()?{}:void 0);if(l){if(l.getImageState()!=o.a.LOADED)return;var c=t.getBuilder(n.getZIndex(),r.a.IMAGE);c.setImageStyle(l,s),c.drawMultiPoint(e,i)}if(u&&u.getText()){var h=(a||t).getBuilder(n.getZIndex(),r.a.TEXT);h.setTextStyle(u,s),h.drawText(e,i)}},MultiLineString:function(t,e,n,i,o){var a=n.getStroke();if(a){var s=t.getBuilder(n.getZIndex(),r.a.LINE_STRING);s.setFillStrokeStyle(null,a),s.drawMultiLineString(e,i)}var l=n.getText();if(l&&l.getText()){var u=(o||t).getBuilder(n.getZIndex(),r.a.TEXT);u.setTextStyle(l),u.drawText(e,i)}},MultiPolygon:function(t,e,n,i,o){var a=n.getFill(),s=n.getStroke();if(s||a){var l=t.getBuilder(n.getZIndex(),r.a.POLYGON);l.setFillStrokeStyle(a,s),l.drawMultiPolygon(e,i)}var u=n.getText();if(u&&u.getText()){var c=(o||t).getBuilder(n.getZIndex(),r.a.TEXT);c.setTextStyle(u),c.drawText(e,i)}},GeometryCollection:function(t,e,n,r,i){var o,a,l=e.getGeometriesArray();for(o=0,a=l.length;o<a;++o){(0,s[l[o].getType()])(t,l[o],n,r,i)}},Circle:function(t,e,n,i,o){var a=n.getFill(),s=n.getStroke();if(a||s){var l=t.getBuilder(n.getZIndex(),r.a.CIRCLE);l.setFillStrokeStyle(a,s),l.drawCircle(e,i)}var u=n.getText();if(u&&u.getText()){var c=(o||t).getBuilder(n.getZIndex(),r.a.TEXT);c.setTextStyle(u),c.drawText(e,i)}}};function l(t,e){return parseInt(Object(a.c)(t),10)-parseInt(Object(a.c)(e),10)}function u(t,e){var n=c(t,e);return n*n}function c(t,e){return.5*t/e}function h(t,e,n,a,l,u,c){var h=!1,p=n.getImage();if(p){var d=p.getImageState();d==o.a.LOADED||d==o.a.ERROR?p.unlistenImageChange(l):(d==o.a.IDLE&&p.load(),d=p.getImageState(),p.listenImageChange(l),h=!0)}return function(t,e,n,o,a,l){var u=n.getGeometryFunction()(e);if(!u)return;var c=u.simplifyTransformed(o,a);if(n.getRenderer())!function t(e,n,o,a){if(n.getType()==i.a.GEOMETRY_COLLECTION){for(var s=n.getGeometries(),l=0,u=s.length;l<u;++l)t(e,s[l],o,a);return}e.getBuilder(o.getZIndex(),r.a.DEFAULT).drawCustom(n,a,o.getRenderer())}(t,c,n,e);else{(0,s[c.getType()])(t,c,n,e,l)}}(t,e,n,a,u,c),h}},function(t,e,n){"use strict";var r,i=n(111),o=n(40),a=n(30),s=n(6),l=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),u=function(t){function e(e){var n=t.call(this)||this;return n.eventTarget_=e,n.pendingRemovals_=null,n.dispatching_=null,n.listeners_=null,n}return l(e,t),e.prototype.addEventListener=function(t,e){if(t&&e){var n=this.listeners_||(this.listeners_={}),r=n[t]||(n[t]=[]);-1===r.indexOf(e)&&r.push(e)}},e.prototype.dispatchEvent=function(t){var e="string"==typeof t?new o.a(t):t,n=e.type;e.target||(e.target=this.eventTarget_||this);var r,i=this.listeners_&&this.listeners_[n];if(i){var s=this.dispatching_||(this.dispatching_={}),l=this.pendingRemovals_||(this.pendingRemovals_={});n in s||(s[n]=0,l[n]=0),++s[n];for(var u=0,c=i.length;u<c;++u)if(!1===(r="handleEvent"in i[u]?i[u].handleEvent(e):i[u].call(this,e))||e.propagationStopped){r=!1;break}if(--s[n],0===s[n]){var h=l[n];for(delete l[n];h--;)this.removeEventListener(n,a.c);delete s[n]}return r}},e.prototype.disposeInternal=function(){this.listeners_&&Object(s.b)(this.listeners_)},e.prototype.getListeners=function(t){return this.listeners_&&this.listeners_[t]||void 0},e.prototype.hasListener=function(t){return!!this.listeners_&&(t?t in this.listeners_:Object.keys(this.listeners_).length>0)},e.prototype.removeEventListener=function(t,e){var n=this.listeners_&&this.listeners_[t];if(n){var r=n.indexOf(e);-1!==r&&(this.pendingRemovals_&&t in this.pendingRemovals_?(n[r]=a.c,++this.pendingRemovals_[t]):(n.splice(r,1),0===n.length&&delete this.listeners_[t]))}},e}(i.a);e.a=u},function(t,e,n){"use strict";var r=n(59),i=n(191),o=n(35),a=function(){function t(t){var e=t||{};this.font_=e.font,this.rotation_=e.rotation,this.rotateWithView_=e.rotateWithView,this.scale_=e.scale,this.scaleArray_=Object(o.d)(void 0!==e.scale?e.scale:1),this.text_=e.text,this.textAlign_=e.textAlign,this.textBaseline_=e.textBaseline,this.fill_=void 0!==e.fill?e.fill:new r.a({color:"#333"}),this.maxAngle_=void 0!==e.maxAngle?e.maxAngle:Math.PI/4,this.placement_=void 0!==e.placement?e.placement:i.a.POINT,this.overflow_=!!e.overflow,this.stroke_=void 0!==e.stroke?e.stroke:null,this.offsetX_=void 0!==e.offsetX?e.offsetX:0,this.offsetY_=void 0!==e.offsetY?e.offsetY:0,this.backgroundFill_=e.backgroundFill?e.backgroundFill:null,this.backgroundStroke_=e.backgroundStroke?e.backgroundStroke:null,this.padding_=void 0===e.padding?null:e.padding}return t.prototype.clone=function(){var e=this.getScale();return new t({font:this.getFont(),placement:this.getPlacement(),maxAngle:this.getMaxAngle(),overflow:this.getOverflow(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(e)?e.slice():e,text:this.getText(),textAlign:this.getTextAlign(),textBaseline:this.getTextBaseline(),fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,offsetX:this.getOffsetX(),offsetY:this.getOffsetY(),backgroundFill:this.getBackgroundFill()?this.getBackgroundFill().clone():void 0,backgroundStroke:this.getBackgroundStroke()?this.getBackgroundStroke().clone():void 0,padding:this.getPadding()})},t.prototype.getOverflow=function(){return this.overflow_},t.prototype.getFont=function(){return this.font_},t.prototype.getMaxAngle=function(){return this.maxAngle_},t.prototype.getPlacement=function(){return this.placement_},t.prototype.getOffsetX=function(){return this.offsetX_},t.prototype.getOffsetY=function(){return this.offsetY_},t.prototype.getFill=function(){return this.fill_},t.prototype.getRotateWithView=function(){return this.rotateWithView_},t.prototype.getRotation=function(){return this.rotation_},t.prototype.getScale=function(){return this.scale_},t.prototype.getScaleArray=function(){return this.scaleArray_},t.prototype.getStroke=function(){return this.stroke_},t.prototype.getText=function(){return this.text_},t.prototype.getTextAlign=function(){return this.textAlign_},t.prototype.getTextBaseline=function(){return this.textBaseline_},t.prototype.getBackgroundFill=function(){return this.backgroundFill_},t.prototype.getBackgroundStroke=function(){return this.backgroundStroke_},t.prototype.getPadding=function(){return this.padding_},t.prototype.setOverflow=function(t){this.overflow_=t},t.prototype.setFont=function(t){this.font_=t},t.prototype.setMaxAngle=function(t){this.maxAngle_=t},t.prototype.setOffsetX=function(t){this.offsetX_=t},t.prototype.setOffsetY=function(t){this.offsetY_=t},t.prototype.setPlacement=function(t){this.placement_=t},t.prototype.setRotateWithView=function(t){this.rotateWithView_=t},t.prototype.setFill=function(t){this.fill_=t},t.prototype.setRotation=function(t){this.rotation_=t},t.prototype.setScale=function(t){this.scale_=t,this.scaleArray_=Object(o.d)(void 0!==t?t:1)},t.prototype.setStroke=function(t){this.stroke_=t},t.prototype.setText=function(t){this.text_=t},t.prototype.setTextAlign=function(t){this.textAlign_=t},t.prototype.setTextBaseline=function(t){this.textBaseline_=t},t.prototype.setBackgroundFill=function(t){this.backgroundFill_=t},t.prototype.setBackgroundStroke=function(t){this.backgroundStroke_=t},t.prototype.setPadding=function(t){this.padding_=t},t}();e.a=a},function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return o})),n.d(e,"e",(function(){return a})),n.d(e,"c",(function(){return l})),n.d(e,"d",(function(){return u}));var r=n(8);function i(t,e,n,i,o,a,s){var l=(n-e)/i;if(l<3){for(;e<n;e+=i)a[s++]=t[e],a[s++]=t[e+1];return s}var u=new Array(l);u[0]=1,u[l-1]=1;for(var c=[e,n-i],h=0;c.length>0;){for(var p=c.pop(),d=c.pop(),f=0,g=t[d],y=t[d+1],m=t[p],v=t[p+1],_=d+i;_<p;_+=i){var b=t[_],w=t[_+1],x=Object(r.h)(b,w,g,y,m,v);x>f&&(h=_,f=x)}f>o&&(u[(h-e)/i]=1,d+i<h&&c.push(d,h),h+i<p&&c.push(h,p))}for(_=0;_<l;++_)u[_]&&(a[s++]=t[e+_*i],a[s++]=t[e+_*i+1]);return s}function o(t,e,n,r,o,a,s,l){for(var u=0,c=n.length;u<c;++u){var h=n[u];s=i(t,e,h,r,o,a,s),l.push(s),e=h}return s}function a(t,e){return e*Math.round(t/e)}function s(t,e,n,r,i,o,s){if(e==n)return s;var l,u,c=a(t[e],i),h=a(t[e+1],i);e+=r,o[s++]=c,o[s++]=h;do{if(l=a(t[e],i),u=a(t[e+1],i),(e+=r)==n)return o[s++]=l,o[s++]=u,s}while(l==c&&u==h);for(;e<n;){var p=a(t[e],i),d=a(t[e+1],i);if(e+=r,p!=l||d!=u){var f=l-c,g=u-h,y=p-c,m=d-h;f*m==g*y&&(f<0&&y<f||f==y||f>0&&y>f)&&(g<0&&m<g||g==m||g>0&&m>g)?(l=p,u=d):(o[s++]=l,o[s++]=u,c=l,h=u,l=p,u=d)}}return o[s++]=l,o[s++]=u,s}function l(t,e,n,r,i,o,a,l){for(var u=0,c=n.length;u<c;++u){var h=n[u];a=s(t,e,h,r,i,o,a),l.push(a),e=h}return a}function u(t,e,n,r,i,o,a,s){for(var u=0,c=n.length;u<c;++u){var h=n[u],p=[];a=l(t,e,h,r,i,o,a,p),s.push(p),e=h[h.length-1]}return a}},function(t,e,n){"use strict";n.d(e,"b",(function(){return p}));var r,i=n(9),o=n(152),a=n(23),s=n(57),l=n(0),u=n(10),c=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),h=function(t){function e(e,n,r,i,o,s){var l=t.call(this,e,n,r,a.a.IDLE)||this;return l.src_=i,l.image_=new Image,null!==o&&(l.image_.crossOrigin=o),l.unlisten_=null,l.state=a.a.IDLE,l.imageLoadFunction_=s,l}return c(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.handleImageError_=function(){this.state=a.a.ERROR,this.unlistenImage_(),this.changed()},e.prototype.handleImageLoad_=function(){void 0===this.resolution&&(this.resolution=Object(l.getHeight)(this.extent)/this.image_.height),this.state=a.a.LOADED,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state!=a.a.IDLE&&this.state!=a.a.ERROR||(this.state=a.a.LOADING,this.changed(),this.imageLoadFunction_(this,this.src_),this.unlisten_=p(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.setImage=function(t){this.image_=t,this.resolution=Object(l.getHeight)(this.extent)/this.image_.height},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(o.a);function p(t,e,n){var r=t;if(r.src&&s.c){var o=r.decode(),a=!0;return o.then((function(){a&&e()})).catch((function(t){a&&("EncodingError"===t.name&&"Invalid image type."===t.message?e():n())})),function(){a=!1}}var l=[Object(u.listenOnce)(r,i.a.LOAD,e),Object(u.listenOnce)(r,i.a.ERROR,n)];return function(){l.forEach(u.unlistenByKey)}}e.a=h},function(t,e,n){"use strict";var r=n(119),i=n(103),o=n(13),a=n(8),s=n(0),l=n(48),u=n(7),c=n(35),h=[0,0,0],p=function(){function t(t){var e;if(this.minZoom=void 0!==t.minZoom?t.minZoom:0,this.resolutions_=t.resolutions,Object(o.a)(Object(u.g)(this.resolutions_,(function(t,e){return e-t}),!0),17),!t.origins)for(var n=0,a=this.resolutions_.length-1;n<a;++n)if(e){if(this.resolutions_[n]/this.resolutions_[n+1]!==e){e=void 0;break}}else e=this.resolutions_[n]/this.resolutions_[n+1];this.zoomFactor_=e,this.maxZoom=this.resolutions_.length-1,this.origin_=void 0!==t.origin?t.origin:null,this.origins_=null,void 0!==t.origins&&(this.origins_=t.origins,Object(o.a)(this.origins_.length==this.resolutions_.length,20));var l=t.extent;void 0===l||this.origin_||this.origins_||(this.origin_=Object(s.getTopLeft)(l)),Object(o.a)(!this.origin_&&this.origins_||this.origin_&&!this.origins_,18),this.tileSizes_=null,void 0!==t.tileSizes&&(this.tileSizes_=t.tileSizes,Object(o.a)(this.tileSizes_.length==this.resolutions_.length,19)),this.tileSize_=void 0!==t.tileSize?t.tileSize:this.tileSizes_?null:i.b,Object(o.a)(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,22),this.extent_=void 0!==l?l:null,this.fullTileRanges_=null,this.tmpSize_=[0,0],this.tmpExtent_=[0,0,0,0],void 0!==t.sizes?this.fullTileRanges_=t.sizes.map((function(t,e){var n=new r.b(Math.min(0,t[0]),Math.max(t[0]-1,-1),Math.min(0,t[1]),Math.max(t[1]-1,-1));if(l){var i=this.getTileRangeForExtentAndZ(l,e);n.minX=Math.max(i.minX,n.minX),n.maxX=Math.min(i.maxX,n.maxX),n.minY=Math.max(i.minY,n.minY),n.maxY=Math.min(i.maxY,n.maxY)}return n}),this):l&&this.calculateTileRanges_(l)}return t.prototype.forEachTileCoord=function(t,e,n){for(var r=this.getTileRangeForExtentAndZ(t,e),i=r.minX,o=r.maxX;i<=o;++i)for(var a=r.minY,s=r.maxY;a<=s;++a)n([e,i,a])},t.prototype.forEachTileCoordParentTileRange=function(t,e,n,i){var o,a,s,l=null,u=t[0]-1;for(2===this.zoomFactor_?(a=t[1],s=t[2]):l=this.getTileCoordExtent(t,i);u>=this.minZoom;){if(2===this.zoomFactor_?(a=Math.floor(a/2),s=Math.floor(s/2),o=Object(r.a)(a,a,s,s,n)):o=this.getTileRangeForExtentAndZ(l,u,n),e(u,o))return!0;--u}return!1},t.prototype.getExtent=function(){return this.extent_},t.prototype.getMaxZoom=function(){return this.maxZoom},t.prototype.getMinZoom=function(){return this.minZoom},t.prototype.getOrigin=function(t){return this.origin_?this.origin_:this.origins_[t]},t.prototype.getResolution=function(t){return this.resolutions_[t]},t.prototype.getResolutions=function(){return this.resolutions_},t.prototype.getTileCoordChildTileRange=function(t,e,n){if(t[0]<this.maxZoom){if(2===this.zoomFactor_){var i=2*t[1],o=2*t[2];return Object(r.a)(i,i+1,o,o+1,e)}var a=this.getTileCoordExtent(t,n||this.tmpExtent_);return this.getTileRangeForExtentAndZ(a,t[0]+1,e)}return null},t.prototype.getTileRangeForTileCoordAndZ=function(t,e,n){if(e>this.maxZoom||e<this.minZoom)return null;var i=t[0],o=t[1],a=t[2];if(e===i)return Object(r.a)(o,a,o,a,n);if(this.zoomFactor_){var s=Math.pow(this.zoomFactor_,e-i),l=Math.floor(o*s),u=Math.floor(a*s);if(e<i)return Object(r.a)(l,l,u,u,n);var c=Math.floor(s*(o+1))-1,h=Math.floor(s*(a+1))-1;return Object(r.a)(l,c,u,h,n)}var p=this.getTileCoordExtent(t,this.tmpExtent_);return this.getTileRangeForExtentAndZ(p,e,n)},t.prototype.getTileRangeExtent=function(t,e,n){var r=this.getOrigin(t),i=this.getResolution(t),o=Object(c.d)(this.getTileSize(t),this.tmpSize_),a=r[0]+e.minX*o[0]*i,l=r[0]+(e.maxX+1)*o[0]*i,u=r[1]+e.minY*o[1]*i,h=r[1]+(e.maxY+1)*o[1]*i;return Object(s.createOrUpdate)(a,u,l,h,n)},t.prototype.getTileRangeForExtentAndZ=function(t,e,n){var i=h;this.getTileCoordForXYAndZ_(t[0],t[3],e,!1,i);var o=i[1],a=i[2];return this.getTileCoordForXYAndZ_(t[2],t[1],e,!0,i),Object(r.a)(o,i[1],a,i[2],n)},t.prototype.getTileCoordCenter=function(t){var e=this.getOrigin(t[0]),n=this.getResolution(t[0]),r=Object(c.d)(this.getTileSize(t[0]),this.tmpSize_);return[e[0]+(t[1]+.5)*r[0]*n,e[1]-(t[2]+.5)*r[1]*n]},t.prototype.getTileCoordExtent=function(t,e){var n=this.getOrigin(t[0]),r=this.getResolution(t[0]),i=Object(c.d)(this.getTileSize(t[0]),this.tmpSize_),o=n[0]+t[1]*i[0]*r,a=n[1]-(t[2]+1)*i[1]*r,l=o+i[0]*r,u=a+i[1]*r;return Object(s.createOrUpdate)(o,a,l,u,e)},t.prototype.getTileCoordForCoordAndResolution=function(t,e,n){return this.getTileCoordForXYAndResolution_(t[0],t[1],e,!1,n)},t.prototype.getTileCoordForXYAndResolution_=function(t,e,n,r,i){var o=this.getZForResolution(n),a=n/this.getResolution(o),s=this.getOrigin(o),u=Object(c.d)(this.getTileSize(o),this.tmpSize_),h=r?.5:0,p=r?.5:0,d=Math.floor((t-s[0])/n+h),f=Math.floor((s[1]-e)/n+p),g=a*d/u[0],y=a*f/u[1];return r?(g=Math.ceil(g)-1,y=Math.ceil(y)-1):(g=Math.floor(g),y=Math.floor(y)),Object(l.a)(o,g,y,i)},t.prototype.getTileCoordForXYAndZ_=function(t,e,n,r,i){var o=this.getOrigin(n),a=this.getResolution(n),s=Object(c.d)(this.getTileSize(n),this.tmpSize_),u=r?.5:0,h=r?.5:0,p=Math.floor((t-o[0])/a+u),d=Math.floor((o[1]-e)/a+h),f=p/s[0],g=d/s[1];return r?(f=Math.ceil(f)-1,g=Math.ceil(g)-1):(f=Math.floor(f),g=Math.floor(g)),Object(l.a)(n,f,g,i)},t.prototype.getTileCoordForCoordAndZ=function(t,e,n){return this.getTileCoordForXYAndZ_(t[0],t[1],e,!1,n)},t.prototype.getTileCoordResolution=function(t){return this.resolutions_[t[0]]},t.prototype.getTileSize=function(t){return this.tileSize_?this.tileSize_:this.tileSizes_[t]},t.prototype.getFullTileRange=function(t){return this.fullTileRanges_?this.fullTileRanges_[t]:this.extent_?this.getTileRangeForExtentAndZ(this.extent_,t):null},t.prototype.getZForResolution=function(t,e){var n=Object(u.h)(this.resolutions_,t,e||0);return Object(a.a)(n,this.minZoom,this.maxZoom)},t.prototype.calculateTileRanges_=function(t){for(var e=this.resolutions_.length,n=new Array(e),r=this.minZoom;r<e;++r)n[r]=this.getTileRangeForExtentAndZ(t,r);this.fullTileRanges_=n},t}();e.a=p},function(t,e,n){"use strict";n.d(e,"a",(function(){return r})),n.d(e,"b",(function(){return i}));var r=42,i=256},function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return o})),n.d(e,"c",(function(){return a})),n.d(e,"d",(function(){return s}));var r=n(0);function i(t,e,n,i,a){return!Object(r.forEachCorner)(a,(function(r){return!o(t,e,n,i,r[0],r[1])}))}function o(t,e,n,r,i,o){for(var a=0,s=t[n-r],l=t[n-r+1];e<n;e+=r){var u=t[e],c=t[e+1];l<=o?c>o&&(u-s)*(o-l)-(i-s)*(c-l)>0&&a++:c<=o&&(u-s)*(o-l)-(i-s)*(c-l)<0&&a--,s=u,l=c}return 0!==a}function a(t,e,n,r,i,a){if(0===n.length)return!1;if(!o(t,e,n[0],r,i,a))return!1;for(var s=1,l=n.length;s<l;++s)if(o(t,n[s-1],n[s],r,i,a))return!1;return!0}function s(t,e,n,r,i,o){if(0===n.length)return!1;for(var s=0,l=n.length;s<l;++s){var u=n[s];if(a(t,e,u,r,i,o))return!0;e=u[u.length-1]}return!1}},function(t,e,n){"use strict";function r(t,e,n,r){for(;e<n-r;){for(var i=0;i<r;++i){var o=t[e+i];t[e+i]=t[n-r+i],t[n-r+i]=o}e+=r,n-=r}}function i(t,e,n,r){for(var i=0,o=t[n-r],a=t[n-r+1];e<n;e+=r){var s=t[e],l=t[e+1];i+=(s-o)*(l+a),o=s,a=l}return 0===i?void 0:i>0}function o(t,e,n,r,o){for(var a=void 0!==o&&o,s=0,l=n.length;s<l;++s){var u=n[s],c=i(t,e,u,r);if(0===s){if(a&&c||!a&&!c)return!1}else if(a&&!c||!a&&c)return!1;e=u}return!0}function a(t,e,n,r,i){for(var a=0,s=n.length;a<s;++a){var l=n[a];if(!o(t,e,l,r,i))return!1;l.length&&(e=l[l.length-1])}return!0}function s(t,e,n,o,a){for(var s=void 0!==a&&a,l=0,u=n.length;l<u;++l){var c=n[l],h=i(t,e,c,o);(0===l?s&&h||!s&&!h:s&&!h||!s&&h)&&r(t,e,c,o),e=c}return e}function l(t,e,n,r,i){for(var o=0,a=n.length;o<a;++o)e=s(t,e,n[o],r,i);return e}n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return o})),n.d(e,"c",(function(){return a})),n.d(e,"d",(function(){return s})),n.d(e,"e",(function(){return l}))},function(t,e,n){"use strict";var r,i=n(164),o=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),a=function(t){function e(e,n,r,i,o){var a=t.call(this,e,n,o)||this;return a.originalEvent=r,a.pixel_=null,a.coordinate_=null,a.dragging=void 0!==i&&i,a}return o(e,t),Object.defineProperty(e.prototype,"pixel",{get:function(){return this.pixel_||(this.pixel_=this.map.getEventPixel(this.originalEvent)),this.pixel_},set:function(t){this.pixel_=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"coordinate",{get:function(){return this.coordinate_||(this.coordinate_=this.map.getCoordinateFromPixel(this.pixel)),this.coordinate_},set:function(t){this.coordinate_=t},enumerable:!1,configurable:!0}),e.prototype.preventDefault=function(){t.prototype.preventDefault.call(this),"preventDefault"in this.originalEvent&&this.originalEvent.preventDefault()},e.prototype.stopPropagation=function(){t.prototype.stopPropagation.call(this),"stopPropagation"in this.originalEvent&&this.originalEvent.stopPropagation()},e}(i.a);e.a=a},function(t,e,n){!function(t){"use strict";function e(){}function n(t){this.message=t||""}function r(t){this.message=t||""}function i(t){this.message=t||""}function o(){}function a(t){return null===t?jt:t.color}function s(t){return null===t?null:t.parent}function l(t,e){null!==t&&(t.color=e)}function u(t){return null===t?null:t.left}function c(t){return null===t?null:t.right}function h(){this.root_=null,this.size_=0}function p(){}function d(){this.array_=[],arguments[0]instanceof bt&&this.addAll(arguments[0])}function f(){}function g(t){this.message=t||""}function y(){this.array_=[]}"fill"in Array.prototype||Object.defineProperty(Array.prototype,"fill",{configurable:!0,value:function(t){if(null==this)throw new TypeError(this+" is not an object");var e=Object(this),n=Math.max(Math.min(e.length,9007199254740991),0)||0,r=1 in arguments&&parseInt(Number(arguments[1]),10)||0;r=r<0?Math.max(n+r,0):Math.min(r,n);var i=2 in arguments&&void 0!==arguments[2]?parseInt(Number(arguments[2]),10)||0:n;for(i=i<0?Math.max(n+arguments[2],0):Math.min(i,n);r<i;)e[r]=t,++r;return e},writable:!0}),Number.isFinite=Number.isFinite||function(t){return"number"==typeof t&&isFinite(t)},Number.isInteger=Number.isInteger||function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t},Number.parseFloat=Number.parseFloat||parseFloat,Number.isNaN=Number.isNaN||function(t){return t!=t},Math.trunc=Math.trunc||function(t){return t<0?Math.ceil(t):Math.floor(t)};var m=function(){};m.prototype.interfaces_=function(){return[]},m.prototype.getClass=function(){return m},m.prototype.equalsWithTolerance=function(t,e,n){return Math.abs(t-e)<=n};var v=function(t){function e(e){t.call(this,e),this.name="IllegalArgumentException",this.message=e,this.stack=(new t).stack}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Error),_=function(){},b={MAX_VALUE:{configurable:!0}};_.isNaN=function(t){return Number.isNaN(t)},_.doubleToLongBits=function(t){return t},_.longBitsToDouble=function(t){return t},_.isInfinite=function(t){return!Number.isFinite(t)},b.MAX_VALUE.get=function(){return Number.MAX_VALUE},Object.defineProperties(_,b);var w=function(){},x=function(){},E=function(){},S=function t(){if(this.x=null,this.y=null,this.z=null,0===arguments.length)this.x=0,this.y=0,this.z=t.NULL_ORDINATE;else if(1===arguments.length){var e=arguments[0];this.x=e.x,this.y=e.y,this.z=e.z}else 2===arguments.length?(this.x=arguments[0],this.y=arguments[1],this.z=t.NULL_ORDINATE):3===arguments.length&&(this.x=arguments[0],this.y=arguments[1],this.z=arguments[2])},O={DimensionalComparator:{configurable:!0},serialVersionUID:{configurable:!0},NULL_ORDINATE:{configurable:!0},X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0}};S.prototype.setOrdinate=function(t,e){switch(t){case S.X:this.x=e;break;case S.Y:this.y=e;break;case S.Z:this.z=e;break;default:throw new v("Invalid ordinate index: "+t)}},S.prototype.equals2D=function(){if(1===arguments.length){var t=arguments[0];return this.x===t.x&&this.y===t.y}if(2===arguments.length){var e=arguments[0],n=arguments[1];return!!m.equalsWithTolerance(this.x,e.x,n)&&!!m.equalsWithTolerance(this.y,e.y,n)}},S.prototype.getOrdinate=function(t){switch(t){case S.X:return this.x;case S.Y:return this.y;case S.Z:return this.z}throw new v("Invalid ordinate index: "+t)},S.prototype.equals3D=function(t){return this.x===t.x&&this.y===t.y&&(this.z===t.z||_.isNaN(this.z))&&_.isNaN(t.z)},S.prototype.equals=function(t){return t instanceof S&&this.equals2D(t)},S.prototype.equalInZ=function(t,e){return m.equalsWithTolerance(this.z,t.z,e)},S.prototype.compareTo=function(t){var e=t;return this.x<e.x?-1:this.x>e.x?1:this.y<e.y?-1:this.y>e.y?1:0},S.prototype.clone=function(){},S.prototype.copy=function(){return new S(this)},S.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},S.prototype.distance3D=function(t){var e=this.x-t.x,n=this.y-t.y,r=this.z-t.z;return Math.sqrt(e*e+n*n+r*r)},S.prototype.distance=function(t){var e=this.x-t.x,n=this.y-t.y;return Math.sqrt(e*e+n*n)},S.prototype.hashCode=function(){var t=17;return 37*(t=37*t+S.hashCode(this.x))+S.hashCode(this.y)},S.prototype.setCoordinate=function(t){this.x=t.x,this.y=t.y,this.z=t.z},S.prototype.interfaces_=function(){return[w,x,e]},S.prototype.getClass=function(){return S},S.hashCode=function(){if(1===arguments.length){var t=arguments[0],e=_.doubleToLongBits(t);return Math.trunc((e^e)>>>32)}},O.DimensionalComparator.get=function(){return C},O.serialVersionUID.get=function(){return 0x5cbf2c235c7e5800},O.NULL_ORDINATE.get=function(){return _.NaN},O.X.get=function(){return 0},O.Y.get=function(){return 1},O.Z.get=function(){return 2},Object.defineProperties(S,O);var C=function(t){if(this._dimensionsToTest=2,0===arguments.length);else if(1===arguments.length){var e=arguments[0];if(2!==e&&3!==e)throw new v("only 2 or 3 dimensions may be specified");this._dimensionsToTest=e}};C.prototype.compare=function(t,e){var n=t,r=e,i=C.compare(n.x,r.x);if(0!==i)return i;var o=C.compare(n.y,r.y);return 0!==o?o:this._dimensionsToTest<=2?0:C.compare(n.z,r.z)},C.prototype.interfaces_=function(){return[E]},C.prototype.getClass=function(){return C},C.compare=function(t,e){return t<e?-1:t>e?1:_.isNaN(t)?_.isNaN(e)?0:-1:_.isNaN(e)?1:0};var T=function(){};T.prototype.create=function(){},T.prototype.interfaces_=function(){return[]},T.prototype.getClass=function(){return T};var I=function(){},L={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};I.prototype.interfaces_=function(){return[]},I.prototype.getClass=function(){return I},I.toLocationSymbol=function(t){switch(t){case I.EXTERIOR:return"e";case I.BOUNDARY:return"b";case I.INTERIOR:return"i";case I.NONE:return"-"}throw new v("Unknown location value: "+t)},L.INTERIOR.get=function(){return 0},L.BOUNDARY.get=function(){return 1},L.EXTERIOR.get=function(){return 2},L.NONE.get=function(){return-1},Object.defineProperties(I,L);var P=function(t,e){return t.interfaces_&&t.interfaces_().indexOf(e)>-1},R=function(){},M={LOG_10:{configurable:!0}};R.prototype.interfaces_=function(){return[]},R.prototype.getClass=function(){return R},R.log10=function(t){var e=Math.log(t);return _.isInfinite(e)||_.isNaN(e)?e:e/R.LOG_10},R.min=function(t,e,n,r){var i=t;return e<i&&(i=e),n<i&&(i=n),r<i&&(i=r),i},R.clamp=function(){if("number"==typeof arguments[2]&&"number"==typeof arguments[0]&&"number"==typeof arguments[1]){var t=arguments[0],e=arguments[1],n=arguments[2];return t<e?e:t>n?n:t}if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var r=arguments[0],i=arguments[1],o=arguments[2];return r<i?i:r>o?o:r}},R.wrap=function(t,e){return t<0?e- -t%e:t%e},R.max=function(){if(3===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2],r=t;return e>r&&(r=e),n>r&&(r=n),r}if(4===arguments.length){var i=arguments[0],o=arguments[1],a=arguments[2],s=arguments[3],l=i;return o>l&&(l=o),a>l&&(l=a),s>l&&(l=s),l}},R.average=function(t,e){return(t+e)/2},M.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(R,M);var N=function(t){this.str=t};N.prototype.append=function(t){this.str+=t},N.prototype.setCharAt=function(t,e){this.str=this.str.substr(0,t)+e+this.str.substr(t+1)},N.prototype.toString=function(t){return this.str};var j=function(t){this.value=t};j.prototype.intValue=function(){return this.value},j.prototype.compareTo=function(t){return this.value<t?-1:this.value>t?1:0},j.isNaN=function(t){return Number.isNaN(t)};var A=function(){};A.isWhitespace=function(t){return t<=32&&t>=0||127===t},A.toUpperCase=function(t){return t.toUpperCase()};var k=function t(){if(this._hi=0,this._lo=0,0===arguments.length)this.init(0);else if(1===arguments.length){if("number"==typeof arguments[0]){var e=arguments[0];this.init(e)}else if(arguments[0]instanceof t){var n=arguments[0];this.init(n)}else if("string"==typeof arguments[0]){var r=arguments[0];t.call(this,t.parse(r))}}else if(2===arguments.length){var i=arguments[0],o=arguments[1];this.init(i,o)}},F={PI:{configurable:!0},TWO_PI:{configurable:!0},PI_2:{configurable:!0},E:{configurable:!0},NaN:{configurable:!0},EPS:{configurable:!0},SPLIT:{configurable:!0},MAX_PRINT_DIGITS:{configurable:!0},TEN:{configurable:!0},ONE:{configurable:!0},SCI_NOT_EXPONENT_CHAR:{configurable:!0},SCI_NOT_ZERO:{configurable:!0}};k.prototype.le=function(t){return(this._hi<t._hi||this._hi===t._hi)&&this._lo<=t._lo},k.prototype.extractSignificantDigits=function(t,e){var n=this.abs(),r=k.magnitude(n._hi),i=k.TEN.pow(r);(n=n.divide(i)).gt(k.TEN)?(n=n.divide(k.TEN),r+=1):n.lt(k.ONE)&&(n=n.multiply(k.TEN),r-=1);for(var o=r+1,a=new N,s=k.MAX_PRINT_DIGITS-1,l=0;l<=s;l++){t&&l===o&&a.append(".");var u=Math.trunc(n._hi);if(u<0)break;var c=!1,h=0;u>9?(c=!0,h="9"):h="0"+u,a.append(h),n=n.subtract(k.valueOf(u)).multiply(k.TEN),c&&n.selfAdd(k.TEN);var p=!0,d=k.magnitude(n._hi);if(d<0&&Math.abs(d)>=s-l&&(p=!1),!p)break}return e[0]=r,a.toString()},k.prototype.sqr=function(){return this.multiply(this)},k.prototype.doubleValue=function(){return this._hi+this._lo},k.prototype.subtract=function(){if(arguments[0]instanceof k){var t=arguments[0];return this.add(t.negate())}if("number"==typeof arguments[0]){var e=arguments[0];return this.add(-e)}},k.prototype.equals=function(){if(1===arguments.length){var t=arguments[0];return this._hi===t._hi&&this._lo===t._lo}},k.prototype.isZero=function(){return 0===this._hi&&0===this._lo},k.prototype.selfSubtract=function(){if(arguments[0]instanceof k){var t=arguments[0];return this.isNaN()?this:this.selfAdd(-t._hi,-t._lo)}if("number"==typeof arguments[0]){var e=arguments[0];return this.isNaN()?this:this.selfAdd(-e,0)}},k.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},k.prototype.min=function(t){return this.le(t)?this:t},k.prototype.selfDivide=function(){if(1===arguments.length){if(arguments[0]instanceof k){var t=arguments[0];return this.selfDivide(t._hi,t._lo)}if("number"==typeof arguments[0]){var e=arguments[0];return this.selfDivide(e,0)}}else if(2===arguments.length){var n=arguments[0],r=arguments[1],i=null,o=null,a=null,s=null,l=null,u=null,c=null,h=null;return l=this._hi/n,h=(i=(u=k.SPLIT*l)-(i=u-l))*(a=(h=k.SPLIT*n)-(a=h-n))-(c=l*n)+i*(s=n-a)+(o=l-i)*a+o*s,h=l+(u=(this._hi-c-h+this._lo-l*r)/n),this._hi=h,this._lo=l-h+u,this}},k.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"},k.prototype.divide=function(){if(arguments[0]instanceof k){var t=arguments[0],e=null,n=null,r=null,i=null,o=null,a=null,s=null,l=null;return n=(o=this._hi/t._hi)-(e=(a=k.SPLIT*o)-(e=a-o)),l=e*(r=(l=k.SPLIT*t._hi)-(r=l-t._hi))-(s=o*t._hi)+e*(i=t._hi-r)+n*r+n*i,a=(this._hi-s-l+this._lo-o*t._lo)/t._hi,new k(l=o+a,o-l+a)}if("number"==typeof arguments[0]){var u=arguments[0];return _.isNaN(u)?k.createNaN():k.copy(this).selfDivide(u,0)}},k.prototype.ge=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>=t._lo},k.prototype.pow=function(t){if(0===t)return k.valueOf(1);var e=new k(this),n=k.valueOf(1),r=Math.abs(t);if(r>1)for(;r>0;)r%2==1&&n.selfMultiply(e),(r/=2)>0&&(e=e.sqr());else n=e;return t<0?n.reciprocal():n},k.prototype.ceil=function(){if(this.isNaN())return k.NaN;var t=Math.ceil(this._hi),e=0;return t===this._hi&&(e=Math.ceil(this._lo)),new k(t,e)},k.prototype.compareTo=function(t){var e=t;return this._hi<e._hi?-1:this._hi>e._hi?1:this._lo<e._lo?-1:this._lo>e._lo?1:0},k.prototype.rint=function(){return this.isNaN()?this:this.add(.5).floor()},k.prototype.setValue=function(){if(arguments[0]instanceof k){var t=arguments[0];return this.init(t),this}if("number"==typeof arguments[0]){var e=arguments[0];return this.init(e),this}},k.prototype.max=function(t){return this.ge(t)?this:t},k.prototype.sqrt=function(){if(this.isZero())return k.valueOf(0);if(this.isNegative())return k.NaN;var t=1/Math.sqrt(this._hi),e=this._hi*t,n=k.valueOf(e),r=this.subtract(n.sqr())._hi*(.5*t);return n.add(r)},k.prototype.selfAdd=function(){if(1===arguments.length){if(arguments[0]instanceof k){var t=arguments[0];return this.selfAdd(t._hi,t._lo)}if("number"==typeof arguments[0]){var e=arguments[0],n=null,r=null,i=null,o=null,a=null,s=null;return o=(i=this._hi+e)-(a=i-this._hi),r=(s=(o=e-a+(this._hi-o))+this._lo)+(i-(n=i+s)),this._hi=n+r,this._lo=r+(n-this._hi),this}}else if(2===arguments.length){var l=arguments[0],u=arguments[1],c=null,h=null,p=null,d=null,f=null,g=null,y=null;d=this._hi+l,h=this._lo+u,f=d-(g=d-this._hi),p=h-(y=h-this._lo);var m=(c=d+(g=(f=l-g+(this._hi-f))+h))+(g=(p=u-y+(this._lo-p))+(g+(d-c))),v=g+(c-m);return this._hi=m,this._lo=v,this}},k.prototype.selfMultiply=function(){if(1===arguments.length){if(arguments[0]instanceof k){var t=arguments[0];return this.selfMultiply(t._hi,t._lo)}if("number"==typeof arguments[0]){var e=arguments[0];return this.selfMultiply(e,0)}}else if(2===arguments.length){var n=arguments[0],r=arguments[1],i=null,o=null,a=null,s=null,l=null,u=null;i=(l=k.SPLIT*this._hi)-this._hi,u=k.SPLIT*n,i=l-i,o=this._hi-i,a=u-n;var c=(l=this._hi*n)+(u=i*(a=u-a)-l+i*(s=n-a)+o*a+o*s+(this._hi*r+this._lo*n)),h=u+(i=l-c);return this._hi=c,this._lo=h,this}},k.prototype.selfSqr=function(){return this.selfMultiply(this)},k.prototype.floor=function(){if(this.isNaN())return k.NaN;var t=Math.floor(this._hi),e=0;return t===this._hi&&(e=Math.floor(this._lo)),new k(t,e)},k.prototype.negate=function(){return this.isNaN()?this:new k(-this._hi,-this._lo)},k.prototype.clone=function(){},k.prototype.multiply=function(){if(arguments[0]instanceof k){var t=arguments[0];return t.isNaN()?k.createNaN():k.copy(this).selfMultiply(t)}if("number"==typeof arguments[0]){var e=arguments[0];return _.isNaN(e)?k.createNaN():k.copy(this).selfMultiply(e,0)}},k.prototype.isNaN=function(){return _.isNaN(this._hi)},k.prototype.intValue=function(){return Math.trunc(this._hi)},k.prototype.toString=function(){var t=k.magnitude(this._hi);return t>=-3&&t<=20?this.toStandardNotation():this.toSciNotation()},k.prototype.toStandardNotation=function(){var t=this.getSpecialNumberString();if(null!==t)return t;var e=new Array(1).fill(null),n=this.extractSignificantDigits(!0,e),r=e[0]+1,i=n;if("."===n.charAt(0))i="0"+n;else if(r<0)i="0."+k.stringOfChar("0",-r)+n;else if(-1===n.indexOf(".")){var o=r-n.length;i=n+k.stringOfChar("0",o)+".0"}return this.isNegative()?"-"+i:i},k.prototype.reciprocal=function(){var t,e,n,r,i=null,o=null,a=null,s=null;t=(n=1/this._hi)-(i=(a=k.SPLIT*n)-(i=a-n)),o=(s=k.SPLIT*this._hi)-this._hi;var l=n+(a=(1-(r=n*this._hi)-(s=i*(o=s-o)-r+i*(e=this._hi-o)+t*o+t*e)-n*this._lo)/this._hi);return new k(l,n-l+a)},k.prototype.toSciNotation=function(){if(this.isZero())return k.SCI_NOT_ZERO;var t=this.getSpecialNumberString();if(null!==t)return t;var e=new Array(1).fill(null),n=this.extractSignificantDigits(!1,e),r=k.SCI_NOT_EXPONENT_CHAR+e[0];if("0"===n.charAt(0))throw new Error("Found leading zero: "+n);var i="";n.length>1&&(i=n.substring(1));var o=n.charAt(0)+"."+i;return this.isNegative()?"-"+o+r:o+r},k.prototype.abs=function(){return this.isNaN()?k.NaN:this.isNegative()?this.negate():new k(this)},k.prototype.isPositive=function(){return(this._hi>0||0===this._hi)&&this._lo>0},k.prototype.lt=function(t){return(this._hi<t._hi||this._hi===t._hi)&&this._lo<t._lo},k.prototype.add=function(){if(arguments[0]instanceof k){var t=arguments[0];return k.copy(this).selfAdd(t)}if("number"==typeof arguments[0]){var e=arguments[0];return k.copy(this).selfAdd(e)}},k.prototype.init=function(){if(1===arguments.length){if("number"==typeof arguments[0]){var t=arguments[0];this._hi=t,this._lo=0}else if(arguments[0]instanceof k){var e=arguments[0];this._hi=e._hi,this._lo=e._lo}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this._hi=n,this._lo=r}},k.prototype.gt=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>t._lo},k.prototype.isNegative=function(){return(this._hi<0||0===this._hi)&&this._lo<0},k.prototype.trunc=function(){return this.isNaN()?k.NaN:this.isPositive()?this.floor():this.ceil()},k.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0},k.prototype.interfaces_=function(){return[e,w,x]},k.prototype.getClass=function(){return k},k.sqr=function(t){return k.valueOf(t).selfMultiply(t)},k.valueOf=function(){if("string"==typeof arguments[0]){var t=arguments[0];return k.parse(t)}if("number"==typeof arguments[0]){var e=arguments[0];return new k(e)}},k.sqrt=function(t){return k.valueOf(t).sqrt()},k.parse=function(t){for(var e=0,n=t.length;A.isWhitespace(t.charAt(e));)e++;var r=!1;if(e<n){var i=t.charAt(e);"-"!==i&&"+"!==i||(e++,"-"===i&&(r=!0))}for(var o=new k,a=0,s=0,l=0;!(e>=n);){var u=t.charAt(e);if(e++,A.isDigit(u)){var c=u-"0";o.selfMultiply(k.TEN),o.selfAdd(c),a++}else{if("."!==u){if("e"===u||"E"===u){var h=t.substring(e);try{l=j.parseInt(h)}catch(e){throw e instanceof Error?new Error("Invalid exponent "+h+" in string "+t):e}break}throw new Error("Unexpected character '"+u+"' at position "+e+" in string "+t)}s=a}}var p=o,d=a-s-l;if(0===d)p=o;else if(d>0){var f=k.TEN.pow(d);p=o.divide(f)}else if(d<0){var g=k.TEN.pow(-d);p=o.multiply(g)}return r?p.negate():p},k.createNaN=function(){return new k(_.NaN,_.NaN)},k.copy=function(t){return new k(t)},k.magnitude=function(t){var e=Math.abs(t),n=Math.log(e)/Math.log(10),r=Math.trunc(Math.floor(n));return 10*Math.pow(10,r)<=e&&(r+=1),r},k.stringOfChar=function(t,e){for(var n=new N,r=0;r<e;r++)n.append(t);return n.toString()},F.PI.get=function(){return new k(3.141592653589793,12246467991473532e-32)},F.TWO_PI.get=function(){return new k(6.283185307179586,24492935982947064e-32)},F.PI_2.get=function(){return new k(1.5707963267948966,6123233995736766e-32)},F.E.get=function(){return new k(2.718281828459045,14456468917292502e-32)},F.NaN.get=function(){return new k(_.NaN,_.NaN)},F.EPS.get=function(){return 123259516440783e-46},F.SPLIT.get=function(){return 134217729},F.MAX_PRINT_DIGITS.get=function(){return 32},F.TEN.get=function(){return k.valueOf(10)},F.ONE.get=function(){return k.valueOf(1)},F.SCI_NOT_EXPONENT_CHAR.get=function(){return"E"},F.SCI_NOT_ZERO.get=function(){return"0.0E0"},Object.defineProperties(k,F);var D=function(){},G={DP_SAFE_EPSILON:{configurable:!0}};D.prototype.interfaces_=function(){return[]},D.prototype.getClass=function(){return D},D.orientationIndex=function(t,e,n){var r=D.orientationIndexFilter(t,e,n);if(r<=1)return r;var i=k.valueOf(e.x).selfAdd(-t.x),o=k.valueOf(e.y).selfAdd(-t.y),a=k.valueOf(n.x).selfAdd(-e.x),s=k.valueOf(n.y).selfAdd(-e.y);return i.selfMultiply(s).selfSubtract(o.selfMultiply(a)).signum()},D.signOfDet2x2=function(t,e,n,r){return t.multiply(r).selfSubtract(e.multiply(n)).signum()},D.intersection=function(t,e,n,r){var i=k.valueOf(r.y).selfSubtract(n.y).selfMultiply(k.valueOf(e.x).selfSubtract(t.x)),o=k.valueOf(r.x).selfSubtract(n.x).selfMultiply(k.valueOf(e.y).selfSubtract(t.y)),a=i.subtract(o),s=k.valueOf(r.x).selfSubtract(n.x).selfMultiply(k.valueOf(t.y).selfSubtract(n.y)),l=k.valueOf(r.y).selfSubtract(n.y).selfMultiply(k.valueOf(t.x).selfSubtract(n.x)),u=s.subtract(l).selfDivide(a).doubleValue(),c=k.valueOf(t.x).selfAdd(k.valueOf(e.x).selfSubtract(t.x).selfMultiply(u)).doubleValue(),h=k.valueOf(e.x).selfSubtract(t.x).selfMultiply(k.valueOf(t.y).selfSubtract(n.y)),p=k.valueOf(e.y).selfSubtract(t.y).selfMultiply(k.valueOf(t.x).selfSubtract(n.x)),d=h.subtract(p).selfDivide(a).doubleValue(),f=k.valueOf(n.y).selfAdd(k.valueOf(r.y).selfSubtract(n.y).selfMultiply(d)).doubleValue();return new S(c,f)},D.orientationIndexFilter=function(t,e,n){var r=null,i=(t.x-n.x)*(e.y-n.y),o=(t.y-n.y)*(e.x-n.x),a=i-o;if(i>0){if(o<=0)return D.signum(a);r=i+o}else{if(!(i<0))return D.signum(a);if(o>=0)return D.signum(a);r=-i-o}var s=D.DP_SAFE_EPSILON*r;return a>=s||-a>=s?D.signum(a):2},D.signum=function(t){return t>0?1:t<0?-1:0},G.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(D,G);var z=function(){},U={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};U.X.get=function(){return 0},U.Y.get=function(){return 1},U.Z.get=function(){return 2},U.M.get=function(){return 3},z.prototype.setOrdinate=function(t,e,n){},z.prototype.size=function(){},z.prototype.getOrdinate=function(t,e){},z.prototype.getCoordinate=function(){},z.prototype.getCoordinateCopy=function(t){},z.prototype.getDimension=function(){},z.prototype.getX=function(t){},z.prototype.clone=function(){},z.prototype.expandEnvelope=function(t){},z.prototype.copy=function(){},z.prototype.getY=function(t){},z.prototype.toCoordinateArray=function(){},z.prototype.interfaces_=function(){return[x]},z.prototype.getClass=function(){return z},Object.defineProperties(z,U);var B=function(){},V=function(t){function e(){t.call(this,"Projective point not representable on the Cartesian plane.")}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(B),q=function(){};q.arraycopy=function(t,e,n,r,i){for(var o=0,a=e;a<e+i;a++)n[r+o]=t[a],o++},q.getProperty=function(t){return{"line.separator":"\n"}[t]};var Y=function t(){if(this.x=null,this.y=null,this.w=null,0===arguments.length)this.x=0,this.y=0,this.w=1;else if(1===arguments.length){var e=arguments[0];this.x=e.x,this.y=e.y,this.w=1}else if(2===arguments.length){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var n=arguments[0],r=arguments[1];this.x=n,this.y=r,this.w=1}else if(arguments[0]instanceof t&&arguments[1]instanceof t){var i=arguments[0],o=arguments[1];this.x=i.y*o.w-o.y*i.w,this.y=o.x*i.w-i.x*o.w,this.w=i.x*o.y-o.x*i.y}else if(arguments[0]instanceof S&&arguments[1]instanceof S){var a=arguments[0],s=arguments[1];this.x=a.y-s.y,this.y=s.x-a.x,this.w=a.x*s.y-s.x*a.y}}else if(3===arguments.length){var l=arguments[0],u=arguments[1],c=arguments[2];this.x=l,this.y=u,this.w=c}else if(4===arguments.length){var h=arguments[0],p=arguments[1],d=arguments[2],f=arguments[3],g=h.y-p.y,y=p.x-h.x,m=h.x*p.y-p.x*h.y,v=d.y-f.y,_=f.x-d.x,b=d.x*f.y-f.x*d.y;this.x=y*b-_*m,this.y=v*m-g*b,this.w=g*_-v*y}};Y.prototype.getY=function(){var t=this.y/this.w;if(_.isNaN(t)||_.isInfinite(t))throw new V;return t},Y.prototype.getX=function(){var t=this.x/this.w;if(_.isNaN(t)||_.isInfinite(t))throw new V;return t},Y.prototype.getCoordinate=function(){var t=new S;return t.x=this.getX(),t.y=this.getY(),t},Y.prototype.interfaces_=function(){return[]},Y.prototype.getClass=function(){return Y},Y.intersection=function(t,e,n,r){var i=t.y-e.y,o=e.x-t.x,a=t.x*e.y-e.x*t.y,s=n.y-r.y,l=r.x-n.x,u=n.x*r.y-r.x*n.y,c=i*l-s*o,h=(o*u-l*a)/c,p=(s*a-i*u)/c;if(_.isNaN(h)||_.isInfinite(h)||_.isNaN(p)||_.isInfinite(p))throw new V;return new S(h,p)};var X=function t(){if(this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,0===arguments.length)this.init();else if(1===arguments.length){if(arguments[0]instanceof S){var e=arguments[0];this.init(e.x,e.x,e.y,e.y)}else if(arguments[0]instanceof t){var n=arguments[0];this.init(n)}}else if(2===arguments.length){var r=arguments[0],i=arguments[1];this.init(r.x,i.x,r.y,i.y)}else if(4===arguments.length){var o=arguments[0],a=arguments[1],s=arguments[2],l=arguments[3];this.init(o,a,s,l)}},W={serialVersionUID:{configurable:!0}};X.prototype.getArea=function(){return this.getWidth()*this.getHeight()},X.prototype.equals=function(t){if(!(t instanceof X))return!1;var e=t;return this.isNull()?e.isNull():this._maxx===e.getMaxX()&&this._maxy===e.getMaxY()&&this._minx===e.getMinX()&&this._miny===e.getMinY()},X.prototype.intersection=function(t){if(this.isNull()||t.isNull()||!this.intersects(t))return new X;var e=this._minx>t._minx?this._minx:t._minx,n=this._miny>t._miny?this._miny:t._miny,r=this._maxx<t._maxx?this._maxx:t._maxx,i=this._maxy<t._maxy?this._maxy:t._maxy;return new X(e,r,n,i)},X.prototype.isNull=function(){return this._maxx<this._minx},X.prototype.getMaxX=function(){return this._maxx},X.prototype.covers=function(){if(1===arguments.length){if(arguments[0]instanceof S){var t=arguments[0];return this.covers(t.x,t.y)}if(arguments[0]instanceof X){var e=arguments[0];return!this.isNull()&&!e.isNull()&&e.getMinX()>=this._minx&&e.getMaxX()<=this._maxx&&e.getMinY()>=this._miny&&e.getMaxY()<=this._maxy}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];return!this.isNull()&&n>=this._minx&&n<=this._maxx&&r>=this._miny&&r<=this._maxy}},X.prototype.intersects=function(){if(1===arguments.length){if(arguments[0]instanceof X){var t=arguments[0];return!this.isNull()&&!t.isNull()&&!(t._minx>this._maxx||t._maxx<this._minx||t._miny>this._maxy||t._maxy<this._miny)}if(arguments[0]instanceof S){var e=arguments[0];return this.intersects(e.x,e.y)}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];return!this.isNull()&&!(n>this._maxx||n<this._minx||r>this._maxy||r<this._miny)}},X.prototype.getMinY=function(){return this._miny},X.prototype.getMinX=function(){return this._minx},X.prototype.expandToInclude=function(){if(1===arguments.length){if(arguments[0]instanceof S){var t=arguments[0];this.expandToInclude(t.x,t.y)}else if(arguments[0]instanceof X){var e=arguments[0];if(e.isNull())return null;this.isNull()?(this._minx=e.getMinX(),this._maxx=e.getMaxX(),this._miny=e.getMinY(),this._maxy=e.getMaxY()):(e._minx<this._minx&&(this._minx=e._minx),e._maxx>this._maxx&&(this._maxx=e._maxx),e._miny<this._miny&&(this._miny=e._miny),e._maxy>this._maxy&&(this._maxy=e._maxy))}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this.isNull()?(this._minx=n,this._maxx=n,this._miny=r,this._maxy=r):(n<this._minx&&(this._minx=n),n>this._maxx&&(this._maxx=n),r<this._miny&&(this._miny=r),r>this._maxy&&(this._maxy=r))}},X.prototype.minExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t<e?t:e},X.prototype.getWidth=function(){return this.isNull()?0:this._maxx-this._minx},X.prototype.compareTo=function(t){var e=t;return this.isNull()?e.isNull()?0:-1:e.isNull()?1:this._minx<e._minx?-1:this._minx>e._minx?1:this._miny<e._miny?-1:this._miny>e._miny?1:this._maxx<e._maxx?-1:this._maxx>e._maxx?1:this._maxy<e._maxy?-1:this._maxy>e._maxy?1:0},X.prototype.translate=function(t,e){if(this.isNull())return null;this.init(this.getMinX()+t,this.getMaxX()+t,this.getMinY()+e,this.getMaxY()+e)},X.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"},X.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1},X.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny},X.prototype.maxExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t>e?t:e},X.prototype.expandBy=function(){if(1===arguments.length){var t=arguments[0];this.expandBy(t,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(this.isNull())return null;this._minx-=e,this._maxx+=e,this._miny-=n,this._maxy+=n,(this._minx>this._maxx||this._miny>this._maxy)&&this.setToNull()}},X.prototype.contains=function(){if(1===arguments.length){if(arguments[0]instanceof X){var t=arguments[0];return this.covers(t)}if(arguments[0]instanceof S){var e=arguments[0];return this.covers(e)}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];return this.covers(n,r)}},X.prototype.centre=function(){return this.isNull()?null:new S((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},X.prototype.init=function(){if(0===arguments.length)this.setToNull();else if(1===arguments.length){if(arguments[0]instanceof S){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof X){var e=arguments[0];this._minx=e._minx,this._maxx=e._maxx,this._miny=e._miny,this._maxy=e._maxy}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this.init(n.x,r.x,n.y,r.y)}else if(4===arguments.length){var i=arguments[0],o=arguments[1],a=arguments[2],s=arguments[3];i<o?(this._minx=i,this._maxx=o):(this._minx=o,this._maxx=i),a<s?(this._miny=a,this._maxy=s):(this._miny=s,this._maxy=a)}},X.prototype.getMaxY=function(){return this._maxy},X.prototype.distance=function(t){if(this.intersects(t))return 0;var e=0;this._maxx<t._minx?e=t._minx-this._maxx:this._minx>t._maxx&&(e=this._minx-t._maxx);var n=0;return this._maxy<t._miny?n=t._miny-this._maxy:this._miny>t._maxy&&(n=this._miny-t._maxy),0===e?n:0===n?e:Math.sqrt(e*e+n*n)},X.prototype.hashCode=function(){var t=17;return 37*(t=37*(t=37*(t=37*t+S.hashCode(this._minx))+S.hashCode(this._maxx))+S.hashCode(this._miny))+S.hashCode(this._maxy)},X.prototype.interfaces_=function(){return[w,e]},X.prototype.getClass=function(){return X},X.intersects=function(){if(3===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2];return n.x>=(t.x<e.x?t.x:e.x)&&n.x<=(t.x>e.x?t.x:e.x)&&n.y>=(t.y<e.y?t.y:e.y)&&n.y<=(t.y>e.y?t.y:e.y)}if(4===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2],a=arguments[3],s=Math.min(o.x,a.x),l=Math.max(o.x,a.x),u=Math.min(r.x,i.x),c=Math.max(r.x,i.x);return!(u>l||c<s||(s=Math.min(o.y,a.y),l=Math.max(o.y,a.y),u=Math.min(r.y,i.y),c=Math.max(r.y,i.y),u>l||c<s))}},W.serialVersionUID.get=function(){return 0x51845cd552189800},Object.defineProperties(X,W);var H={typeStr:/^\s*(\w+)\s*\(\s*(.*)\s*\)\s*$/,emptyTypeStr:/^\s*(\w+)\s*EMPTY\s*$/,spaces:/\s+/,parenComma:/\)\s*,\s*\(/,doubleParenComma:/\)\s*\)\s*,\s*\(\s*\(/,trimParens:/^\s*\(?(.*?)\)?\s*$/},K=function(t){this.geometryFactory=t||new me};K.prototype.read=function(t){var e,n,r;t=t.replace(/[\n\r]/g," ");var i=H.typeStr.exec(t);if(-1!==t.search("EMPTY")&&((i=H.emptyTypeStr.exec(t))[2]=void 0),i&&(n=i[1].toLowerCase(),r=i[2],$[n]&&(e=$[n].apply(this,[r]))),void 0===e)throw new Error("Could not parse WKT "+t);return e},K.prototype.write=function(t){return this.extractGeometry(t)},K.prototype.extractGeometry=function(t){var e=t.getGeometryType().toLowerCase();if(!Z[e])return null;var n=e.toUpperCase();return t.isEmpty()?n+" EMPTY":n+"("+Z[e].apply(this,[t])+")"};var Z={coordinate:function(t){return t.x+" "+t.y},point:function(t){return Z.coordinate.call(this,t._coordinates._coordinates[0])},multipoint:function(t){for(var e=[],n=0,r=t._geometries.length;n<r;++n)e.push("("+Z.point.apply(this,[t._geometries[n]])+")");return e.join(",")},linestring:function(t){for(var e=[],n=0,r=t._points._coordinates.length;n<r;++n)e.push(Z.coordinate.apply(this,[t._points._coordinates[n]]));return e.join(",")},linearring:function(t){for(var e=[],n=0,r=t._points._coordinates.length;n<r;++n)e.push(Z.coordinate.apply(this,[t._points._coordinates[n]]));return e.join(",")},multilinestring:function(t){for(var e=[],n=0,r=t._geometries.length;n<r;++n)e.push("("+Z.linestring.apply(this,[t._geometries[n]])+")");return e.join(",")},polygon:function(t){var e=[];e.push("("+Z.linestring.apply(this,[t._shell])+")");for(var n=0,r=t._holes.length;n<r;++n)e.push("("+Z.linestring.apply(this,[t._holes[n]])+")");return e.join(",")},multipolygon:function(t){for(var e=[],n=0,r=t._geometries.length;n<r;++n)e.push("("+Z.polygon.apply(this,[t._geometries[n]])+")");return e.join(",")},geometrycollection:function(t){for(var e=[],n=0,r=t._geometries.length;n<r;++n)e.push(this.extractGeometry(t._geometries[n]));return e.join(",")}},$={point:function(t){if(void 0===t)return this.geometryFactory.createPoint();var e=t.trim().split(H.spaces);return this.geometryFactory.createPoint(new S(Number.parseFloat(e[0]),Number.parseFloat(e[1])))},multipoint:function(t){if(void 0===t)return this.geometryFactory.createMultiPoint();for(var e,n=t.trim().split(","),r=[],i=0,o=n.length;i<o;++i)e=n[i].replace(H.trimParens,"$1"),r.push($.point.apply(this,[e]));return this.geometryFactory.createMultiPoint(r)},linestring:function(t){if(void 0===t)return this.geometryFactory.createLineString();for(var e,n=t.trim().split(","),r=[],i=0,o=n.length;i<o;++i)e=n[i].trim().split(H.spaces),r.push(new S(Number.parseFloat(e[0]),Number.parseFloat(e[1])));return this.geometryFactory.createLineString(r)},linearring:function(t){if(void 0===t)return this.geometryFactory.createLinearRing();for(var e,n=t.trim().split(","),r=[],i=0,o=n.length;i<o;++i)e=n[i].trim().split(H.spaces),r.push(new S(Number.parseFloat(e[0]),Number.parseFloat(e[1])));return this.geometryFactory.createLinearRing(r)},multilinestring:function(t){if(void 0===t)return this.geometryFactory.createMultiLineString();for(var e,n=t.trim().split(H.parenComma),r=[],i=0,o=n.length;i<o;++i)e=n[i].replace(H.trimParens,"$1"),r.push($.linestring.apply(this,[e]));return this.geometryFactory.createMultiLineString(r)},polygon:function(t){if(void 0===t)return this.geometryFactory.createPolygon();for(var e,n,r,i,o=t.trim().split(H.parenComma),a=[],s=0,l=o.length;s<l;++s)e=o[s].replace(H.trimParens,"$1"),n=$.linestring.apply(this,[e]),r=this.geometryFactory.createLinearRing(n._points),0===s?i=r:a.push(r);return this.geometryFactory.createPolygon(i,a)},multipolygon:function(t){if(void 0===t)return this.geometryFactory.createMultiPolygon();for(var e,n=t.trim().split(H.doubleParenComma),r=[],i=0,o=n.length;i<o;++i)e=n[i].replace(H.trimParens,"$1"),r.push($.polygon.apply(this,[e]));return this.geometryFactory.createMultiPolygon(r)},geometrycollection:function(t){if(void 0===t)return this.geometryFactory.createGeometryCollection();for(var e=(t=t.replace(/,\s*([A-Za-z])/g,"|$1")).trim().split("|"),n=[],r=0,i=e.length;r<i;++r)n.push(this.read(e[r]));return this.geometryFactory.createGeometryCollection(n)}},J=function(t){this.parser=new K(t)};J.prototype.write=function(t){return this.parser.write(t)},J.toLineString=function(t,e){if(2!==arguments.length)throw new Error("Not implemented");return"LINESTRING ( "+t.x+" "+t.y+", "+e.x+" "+e.y+" )"};var Q=function(t){function e(e){t.call(this,e),this.name="RuntimeException",this.message=e,this.stack=(new t).stack}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Error),tt=function(t){function e(){if(t.call(this),0===arguments.length)t.call(this);else if(1===arguments.length){var e=arguments[0];t.call(this,e)}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Q),et=function(){};et.prototype.interfaces_=function(){return[]},et.prototype.getClass=function(){return et},et.shouldNeverReachHere=function(){if(0===arguments.length)et.shouldNeverReachHere(null);else if(1===arguments.length){var t=arguments[0];throw new tt("Should never reach here"+(null!==t?": "+t:""))}},et.isTrue=function(){var t;if(1===arguments.length)et.isTrue(arguments[0],null);else if(2===arguments.length&&(t=arguments[1],!arguments[0]))throw null===t?new tt:new tt(t)},et.equals=function(){var t,e,n;if(2===arguments.length)et.equals(t=arguments[0],e=arguments[1],null);else if(3===arguments.length&&(t=arguments[0],n=arguments[2],!(e=arguments[1]).equals(t)))throw new tt("Expected "+t+" but encountered "+e+(null!==n?": "+n:""))};var nt=function(){this._result=null,this._inputLines=Array(2).fill().map((function(){return Array(2)})),this._intPt=new Array(2).fill(null),this._intLineIndex=null,this._isProper=null,this._pa=null,this._pb=null,this._precisionModel=null,this._intPt[0]=new S,this._intPt[1]=new S,this._pa=this._intPt[0],this._pb=this._intPt[1],this._result=0},rt={DONT_INTERSECT:{configurable:!0},DO_INTERSECT:{configurable:!0},COLLINEAR:{configurable:!0},NO_INTERSECTION:{configurable:!0},POINT_INTERSECTION:{configurable:!0},COLLINEAR_INTERSECTION:{configurable:!0}};nt.prototype.getIndexAlongSegment=function(t,e){return this.computeIntLineIndex(),this._intLineIndex[t][e]},nt.prototype.getTopologySummary=function(){var t=new N;return this.isEndPoint()&&t.append(" endpoint"),this._isProper&&t.append(" proper"),this.isCollinear()&&t.append(" collinear"),t.toString()},nt.prototype.computeIntersection=function(t,e,n,r){this._inputLines[0][0]=t,this._inputLines[0][1]=e,this._inputLines[1][0]=n,this._inputLines[1][1]=r,this._result=this.computeIntersect(t,e,n,r)},nt.prototype.getIntersectionNum=function(){return this._result},nt.prototype.computeIntLineIndex=function(){if(0===arguments.length)null===this._intLineIndex&&(this._intLineIndex=Array(2).fill().map((function(){return Array(2)})),this.computeIntLineIndex(0),this.computeIntLineIndex(1));else if(1===arguments.length){var t=arguments[0];this.getEdgeDistance(t,0)>this.getEdgeDistance(t,1)?(this._intLineIndex[t][0]=0,this._intLineIndex[t][1]=1):(this._intLineIndex[t][0]=1,this._intLineIndex[t][1]=0)}},nt.prototype.isProper=function(){return this.hasIntersection()&&this._isProper},nt.prototype.setPrecisionModel=function(t){this._precisionModel=t},nt.prototype.isInteriorIntersection=function(){if(0===arguments.length)return!!this.isInteriorIntersection(0)||!!this.isInteriorIntersection(1);if(1===arguments.length){for(var t=arguments[0],e=0;e<this._result;e++)if(!this._intPt[e].equals2D(this._inputLines[t][0])&&!this._intPt[e].equals2D(this._inputLines[t][1]))return!0;return!1}},nt.prototype.getIntersection=function(t){return this._intPt[t]},nt.prototype.isEndPoint=function(){return this.hasIntersection()&&!this._isProper},nt.prototype.hasIntersection=function(){return this._result!==nt.NO_INTERSECTION},nt.prototype.getEdgeDistance=function(t,e){return nt.computeEdgeDistance(this._intPt[e],this._inputLines[t][0],this._inputLines[t][1])},nt.prototype.isCollinear=function(){return this._result===nt.COLLINEAR_INTERSECTION},nt.prototype.toString=function(){return J.toLineString(this._inputLines[0][0],this._inputLines[0][1])+" - "+J.toLineString(this._inputLines[1][0],this._inputLines[1][1])+this.getTopologySummary()},nt.prototype.getEndpoint=function(t,e){return this._inputLines[t][e]},nt.prototype.isIntersection=function(t){for(var e=0;e<this._result;e++)if(this._intPt[e].equals2D(t))return!0;return!1},nt.prototype.getIntersectionAlongSegment=function(t,e){return this.computeIntLineIndex(),this._intPt[this._intLineIndex[t][e]]},nt.prototype.interfaces_=function(){return[]},nt.prototype.getClass=function(){return nt},nt.computeEdgeDistance=function(t,e,n){var r=Math.abs(n.x-e.x),i=Math.abs(n.y-e.y),o=-1;if(t.equals(e))o=0;else if(t.equals(n))o=r>i?r:i;else{var a=Math.abs(t.x-e.x),s=Math.abs(t.y-e.y);0!==(o=r>i?a:s)||t.equals(e)||(o=Math.max(a,s))}return et.isTrue(!(0===o&&!t.equals(e)),"Bad distance calculation"),o},nt.nonRobustComputeEdgeDistance=function(t,e,n){var r=t.x-e.x,i=t.y-e.y,o=Math.sqrt(r*r+i*i);return et.isTrue(!(0===o&&!t.equals(e)),"Invalid distance calculation"),o},rt.DONT_INTERSECT.get=function(){return 0},rt.DO_INTERSECT.get=function(){return 1},rt.COLLINEAR.get=function(){return 2},rt.NO_INTERSECTION.get=function(){return 0},rt.POINT_INTERSECTION.get=function(){return 1},rt.COLLINEAR_INTERSECTION.get=function(){return 2},Object.defineProperties(nt,rt);var it=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isInSegmentEnvelopes=function(t){var e=new X(this._inputLines[0][0],this._inputLines[0][1]),n=new X(this._inputLines[1][0],this._inputLines[1][1]);return e.contains(t)&&n.contains(t)},e.prototype.computeIntersection=function(){if(3!==arguments.length)return t.prototype.computeIntersection.apply(this,arguments);var e=arguments[0],n=arguments[1],r=arguments[2];if(this._isProper=!1,X.intersects(n,r,e)&&0===st.orientationIndex(n,r,e)&&0===st.orientationIndex(r,n,e))return this._isProper=!0,(e.equals(n)||e.equals(r))&&(this._isProper=!1),this._result=t.POINT_INTERSECTION,null;this._result=t.NO_INTERSECTION},e.prototype.normalizeToMinimum=function(t,e,n,r,i){i.x=this.smallestInAbsValue(t.x,e.x,n.x,r.x),i.y=this.smallestInAbsValue(t.y,e.y,n.y,r.y),t.x-=i.x,t.y-=i.y,e.x-=i.x,e.y-=i.y,n.x-=i.x,n.y-=i.y,r.x-=i.x,r.y-=i.y},e.prototype.safeHCoordinateIntersection=function(t,n,r,i){var o=null;try{o=Y.intersection(t,n,r,i)}catch(a){if(!(a instanceof V))throw a;o=e.nearestEndpoint(t,n,r,i)}return o},e.prototype.intersection=function(t,n,r,i){var o=this.intersectionWithNormalization(t,n,r,i);return this.isInSegmentEnvelopes(o)||(o=new S(e.nearestEndpoint(t,n,r,i))),null!==this._precisionModel&&this._precisionModel.makePrecise(o),o},e.prototype.smallestInAbsValue=function(t,e,n,r){var i=t,o=Math.abs(i);return Math.abs(e)<o&&(i=e,o=Math.abs(e)),Math.abs(n)<o&&(i=n,o=Math.abs(n)),Math.abs(r)<o&&(i=r),i},e.prototype.checkDD=function(t,e,n,r,i){var o=D.intersection(t,e,n,r),a=this.isInSegmentEnvelopes(o);q.out.println("DD in env = "+a+" --------------------- "+o),i.distance(o)>1e-4&&q.out.println("Distance = "+i.distance(o))},e.prototype.intersectionWithNormalization=function(t,e,n,r){var i=new S(t),o=new S(e),a=new S(n),s=new S(r),l=new S;this.normalizeToEnvCentre(i,o,a,s,l);var u=this.safeHCoordinateIntersection(i,o,a,s);return u.x+=l.x,u.y+=l.y,u},e.prototype.computeCollinearIntersection=function(e,n,r,i){var o=X.intersects(e,n,r),a=X.intersects(e,n,i),s=X.intersects(r,i,e),l=X.intersects(r,i,n);return o&&a?(this._intPt[0]=r,this._intPt[1]=i,t.COLLINEAR_INTERSECTION):s&&l?(this._intPt[0]=e,this._intPt[1]=n,t.COLLINEAR_INTERSECTION):o&&s?(this._intPt[0]=r,this._intPt[1]=e,!r.equals(e)||a||l?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):o&&l?(this._intPt[0]=r,this._intPt[1]=n,!r.equals(n)||a||s?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):a&&s?(this._intPt[0]=i,this._intPt[1]=e,!i.equals(e)||o||l?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):a&&l?(this._intPt[0]=i,this._intPt[1]=n,!i.equals(n)||o||s?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):t.NO_INTERSECTION},e.prototype.normalizeToEnvCentre=function(t,e,n,r,i){var o=t.x<e.x?t.x:e.x,a=t.y<e.y?t.y:e.y,s=t.x>e.x?t.x:e.x,l=t.y>e.y?t.y:e.y,u=n.x<r.x?n.x:r.x,c=n.y<r.y?n.y:r.y,h=n.x>r.x?n.x:r.x,p=n.y>r.y?n.y:r.y,d=((o>u?o:u)+(s<h?s:h))/2,f=((a>c?a:c)+(l<p?l:p))/2;i.x=d,i.y=f,t.x-=i.x,t.y-=i.y,e.x-=i.x,e.y-=i.y,n.x-=i.x,n.y-=i.y,r.x-=i.x,r.y-=i.y},e.prototype.computeIntersect=function(e,n,r,i){if(this._isProper=!1,!X.intersects(e,n,r,i))return t.NO_INTERSECTION;var o=st.orientationIndex(e,n,r),a=st.orientationIndex(e,n,i);if(o>0&&a>0||o<0&&a<0)return t.NO_INTERSECTION;var s=st.orientationIndex(r,i,e),l=st.orientationIndex(r,i,n);return s>0&&l>0||s<0&&l<0?t.NO_INTERSECTION:0===o&&0===a&&0===s&&0===l?this.computeCollinearIntersection(e,n,r,i):(0===o||0===a||0===s||0===l?(this._isProper=!1,e.equals2D(r)||e.equals2D(i)?this._intPt[0]=e:n.equals2D(r)||n.equals2D(i)?this._intPt[0]=n:0===o?this._intPt[0]=new S(r):0===a?this._intPt[0]=new S(i):0===s?this._intPt[0]=new S(e):0===l&&(this._intPt[0]=new S(n))):(this._isProper=!0,this._intPt[0]=this.intersection(e,n,r,i)),t.POINT_INTERSECTION)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.nearestEndpoint=function(t,e,n,r){var i=t,o=st.distancePointLine(t,n,r),a=st.distancePointLine(e,n,r);return a<o&&(o=a,i=e),(a=st.distancePointLine(n,t,e))<o&&(o=a,i=n),(a=st.distancePointLine(r,t,e))<o&&(o=a,i=r),i},e}(nt),ot=function(){};ot.prototype.interfaces_=function(){return[]},ot.prototype.getClass=function(){return ot},ot.orientationIndex=function(t,e,n){var r=e.x-t.x,i=e.y-t.y,o=n.x-e.x,a=n.y-e.y;return ot.signOfDet2x2(r,i,o,a)},ot.signOfDet2x2=function(t,e,n,r){var i=null,o=null,a=null;if(i=1,0===t||0===r)return 0===e||0===n?0:e>0?n>0?-i:i:n>0?i:-i;if(0===e||0===n)return r>0?t>0?i:-i:t>0?-i:i;if(e>0?r>0?e<=r||(i=-i,o=t,t=n,n=o,o=e,e=r,r=o):e<=-r?(i=-i,n=-n,r=-r):(o=t,t=-n,n=o,o=e,e=-r,r=o):r>0?-e<=r?(i=-i,t=-t,e=-e):(o=-t,t=n,n=o,o=-e,e=r,r=o):e>=r?(t=-t,e=-e,n=-n,r=-r):(i=-i,o=-t,t=-n,n=o,o=-e,e=-r,r=o),t>0){if(!(n>0))return i;if(!(t<=n))return i}else{if(n>0)return-i;if(!(t>=n))return-i;i=-i,t=-t,n=-n}for(;;){if((r-=(a=Math.floor(n/t))*e)<0)return-i;if(r>e)return i;if(t>(n-=a*t)+n){if(e<r+r)return i}else{if(e>r+r)return-i;n=t-n,r=e-r,i=-i}if(0===r)return 0===n?0:-i;if(0===n)return i;if((e-=(a=Math.floor(t/n))*r)<0)return i;if(e>r)return-i;if(n>(t-=a*n)+t){if(r<e+e)return-i}else{if(r>e+e)return i;t=n-t,e=r-e,i=-i}if(0===e)return 0===t?0:i;if(0===t)return-i}};var at=function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var t=arguments[0];this._p=t};at.prototype.countSegment=function(t,e){if(t.x<this._p.x&&e.x<this._p.x)return null;if(this._p.x===e.x&&this._p.y===e.y)return this._isPointOnSegment=!0,null;if(t.y===this._p.y&&e.y===this._p.y){var n=t.x,r=e.x;return n>r&&(n=e.x,r=t.x),this._p.x>=n&&this._p.x<=r&&(this._isPointOnSegment=!0),null}if(t.y>this._p.y&&e.y<=this._p.y||e.y>this._p.y&&t.y<=this._p.y){var i=t.x-this._p.x,o=t.y-this._p.y,a=e.x-this._p.x,s=e.y-this._p.y,l=ot.signOfDet2x2(i,o,a,s);if(0===l)return this._isPointOnSegment=!0,null;s<o&&(l=-l),l>0&&this._crossingCount++}},at.prototype.isPointInPolygon=function(){return this.getLocation()!==I.EXTERIOR},at.prototype.getLocation=function(){return this._isPointOnSegment?I.BOUNDARY:this._crossingCount%2==1?I.INTERIOR:I.EXTERIOR},at.prototype.isOnSegment=function(){return this._isPointOnSegment},at.prototype.interfaces_=function(){return[]},at.prototype.getClass=function(){return at},at.locatePointInRing=function(){if(arguments[0]instanceof S&&P(arguments[1],z)){for(var t=arguments[0],e=arguments[1],n=new at(t),r=new S,i=new S,o=1;o<e.size();o++)if(e.getCoordinate(o,r),e.getCoordinate(o-1,i),n.countSegment(r,i),n.isOnSegment())return n.getLocation();return n.getLocation()}if(arguments[0]instanceof S&&arguments[1]instanceof Array){for(var a=arguments[0],s=arguments[1],l=new at(a),u=1;u<s.length;u++){var c=s[u],h=s[u-1];if(l.countSegment(c,h),l.isOnSegment())return l.getLocation()}return l.getLocation()}};var st=function(){},lt={CLOCKWISE:{configurable:!0},RIGHT:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},LEFT:{configurable:!0},COLLINEAR:{configurable:!0},STRAIGHT:{configurable:!0}};st.prototype.interfaces_=function(){return[]},st.prototype.getClass=function(){return st},st.orientationIndex=function(t,e,n){return D.orientationIndex(t,e,n)},st.signedArea=function(){if(arguments[0]instanceof Array){var t=arguments[0];if(t.length<3)return 0;for(var e=0,n=t[0].x,r=1;r<t.length-1;r++){var i=t[r].x-n,o=t[r+1].y;e+=i*(t[r-1].y-o)}return e/2}if(P(arguments[0],z)){var a=arguments[0],s=a.size();if(s<3)return 0;var l=new S,u=new S,c=new S;a.getCoordinate(0,u),a.getCoordinate(1,c);var h=u.x;c.x-=h;for(var p=0,d=1;d<s-1;d++)l.y=u.y,u.x=c.x,u.y=c.y,a.getCoordinate(d+1,c),c.x-=h,p+=u.x*(l.y-c.y);return p/2}},st.distanceLineLine=function(t,e,n,r){if(t.equals(e))return st.distancePointLine(t,n,r);if(n.equals(r))return st.distancePointLine(r,t,e);var i=!1;if(X.intersects(t,e,n,r)){var o=(e.x-t.x)*(r.y-n.y)-(e.y-t.y)*(r.x-n.x);if(0===o)i=!0;else{var a=(t.y-n.y)*(r.x-n.x)-(t.x-n.x)*(r.y-n.y),s=((t.y-n.y)*(e.x-t.x)-(t.x-n.x)*(e.y-t.y))/o,l=a/o;(l<0||l>1||s<0||s>1)&&(i=!0)}}else i=!0;return i?R.min(st.distancePointLine(t,n,r),st.distancePointLine(e,n,r),st.distancePointLine(n,t,e),st.distancePointLine(r,t,e)):0},st.isPointInRing=function(t,e){return st.locatePointInRing(t,e)!==I.EXTERIOR},st.computeLength=function(t){var e=t.size();if(e<=1)return 0;var n=0,r=new S;t.getCoordinate(0,r);for(var i=r.x,o=r.y,a=1;a<e;a++){t.getCoordinate(a,r);var s=r.x,l=r.y,u=s-i,c=l-o;n+=Math.sqrt(u*u+c*c),i=s,o=l}return n},st.isCCW=function(t){var e=t.length-1;if(e<3)throw new v("Ring has fewer than 4 points, so orientation cannot be determined");for(var n=t[0],r=0,i=1;i<=e;i++){var o=t[i];o.y>n.y&&(n=o,r=i)}var a=r;do{(a-=1)<0&&(a=e)}while(t[a].equals2D(n)&&a!==r);var s=r;do{s=(s+1)%e}while(t[s].equals2D(n)&&s!==r);var l=t[a],u=t[s];if(l.equals2D(n)||u.equals2D(n)||l.equals2D(u))return!1;var c=st.computeOrientation(l,n,u);return 0===c?l.x>u.x:c>0},st.locatePointInRing=function(t,e){return at.locatePointInRing(t,e)},st.distancePointLinePerpendicular=function(t,e,n){var r=(n.x-e.x)*(n.x-e.x)+(n.y-e.y)*(n.y-e.y),i=((e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y))/r;return Math.abs(i)*Math.sqrt(r)},st.computeOrientation=function(t,e,n){return st.orientationIndex(t,e,n)},st.distancePointLine=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];if(0===e.length)throw new v("Line array must contain at least one vertex");for(var n=t.distance(e[0]),r=0;r<e.length-1;r++){var i=st.distancePointLine(t,e[r],e[r+1]);i<n&&(n=i)}return n}if(3===arguments.length){var o=arguments[0],a=arguments[1],s=arguments[2];if(a.x===s.x&&a.y===s.y)return o.distance(a);var l=(s.x-a.x)*(s.x-a.x)+(s.y-a.y)*(s.y-a.y),u=((o.x-a.x)*(s.x-a.x)+(o.y-a.y)*(s.y-a.y))/l;if(u<=0)return o.distance(a);if(u>=1)return o.distance(s);var c=((a.y-o.y)*(s.x-a.x)-(a.x-o.x)*(s.y-a.y))/l;return Math.abs(c)*Math.sqrt(l)}},st.isOnLine=function(t,e){for(var n=new it,r=1;r<e.length;r++){var i=e[r-1],o=e[r];if(n.computeIntersection(t,i,o),n.hasIntersection())return!0}return!1},lt.CLOCKWISE.get=function(){return-1},lt.RIGHT.get=function(){return st.CLOCKWISE},lt.COUNTERCLOCKWISE.get=function(){return 1},lt.LEFT.get=function(){return st.COUNTERCLOCKWISE},lt.COLLINEAR.get=function(){return 0},lt.STRAIGHT.get=function(){return st.COLLINEAR},Object.defineProperties(st,lt);var ut=function(){};ut.prototype.filter=function(t){},ut.prototype.interfaces_=function(){return[]},ut.prototype.getClass=function(){return ut};var ct=function(){var t=arguments[0];this._envelope=null,this._factory=null,this._SRID=null,this._userData=null,this._factory=t,this._SRID=t.getSRID()},ht={serialVersionUID:{configurable:!0},SORTINDEX_POINT:{configurable:!0},SORTINDEX_MULTIPOINT:{configurable:!0},SORTINDEX_LINESTRING:{configurable:!0},SORTINDEX_LINEARRING:{configurable:!0},SORTINDEX_MULTILINESTRING:{configurable:!0},SORTINDEX_POLYGON:{configurable:!0},SORTINDEX_MULTIPOLYGON:{configurable:!0},SORTINDEX_GEOMETRYCOLLECTION:{configurable:!0},geometryChangedFilter:{configurable:!0}};ct.prototype.isGeometryCollection=function(){return this.getSortIndex()===ct.SORTINDEX_GEOMETRYCOLLECTION},ct.prototype.getFactory=function(){return this._factory},ct.prototype.getGeometryN=function(t){return this},ct.prototype.getArea=function(){return 0},ct.prototype.isRectangle=function(){return!1},ct.prototype.equals=function(){if(arguments[0]instanceof ct){var t=arguments[0];return null!==t&&this.equalsTopo(t)}if(arguments[0]instanceof Object){var e=arguments[0];if(!(e instanceof ct))return!1;var n=e;return this.equalsExact(n)}},ct.prototype.equalsExact=function(t){return this===t||this.equalsExact(t,0)},ct.prototype.geometryChanged=function(){this.apply(ct.geometryChangedFilter)},ct.prototype.geometryChangedAction=function(){this._envelope=null},ct.prototype.equalsNorm=function(t){return null!==t&&this.norm().equalsExact(t.norm())},ct.prototype.getLength=function(){return 0},ct.prototype.getNumGeometries=function(){return 1},ct.prototype.compareTo=function(){if(1===arguments.length){var t=arguments[0],e=t;return this.getSortIndex()!==e.getSortIndex()?this.getSortIndex()-e.getSortIndex():this.isEmpty()&&e.isEmpty()?0:this.isEmpty()?-1:e.isEmpty()?1:this.compareToSameClass(t)}if(2===arguments.length){var n=arguments[0],r=arguments[1];return this.getSortIndex()!==n.getSortIndex()?this.getSortIndex()-n.getSortIndex():this.isEmpty()&&n.isEmpty()?0:this.isEmpty()?-1:n.isEmpty()?1:this.compareToSameClass(n,r)}},ct.prototype.getUserData=function(){return this._userData},ct.prototype.getSRID=function(){return this._SRID},ct.prototype.getEnvelope=function(){return this.getFactory().toGeometry(this.getEnvelopeInternal())},ct.prototype.checkNotGeometryCollection=function(t){if(t.getSortIndex()===ct.SORTINDEX_GEOMETRYCOLLECTION)throw new v("This method does not support GeometryCollection arguments")},ct.prototype.equal=function(t,e,n){return 0===n?t.equals(e):t.distance(e)<=n},ct.prototype.norm=function(){var t=this.copy();return t.normalize(),t},ct.prototype.getPrecisionModel=function(){return this._factory.getPrecisionModel()},ct.prototype.getEnvelopeInternal=function(){return null===this._envelope&&(this._envelope=this.computeEnvelopeInternal()),new X(this._envelope)},ct.prototype.setSRID=function(t){this._SRID=t},ct.prototype.setUserData=function(t){this._userData=t},ct.prototype.compare=function(t,e){for(var n=t.iterator(),r=e.iterator();n.hasNext()&&r.hasNext();){var i=n.next(),o=r.next(),a=i.compareTo(o);if(0!==a)return a}return n.hasNext()?1:r.hasNext()?-1:0},ct.prototype.hashCode=function(){return this.getEnvelopeInternal().hashCode()},ct.prototype.isGeometryCollectionOrDerived=function(){return this.getSortIndex()===ct.SORTINDEX_GEOMETRYCOLLECTION||this.getSortIndex()===ct.SORTINDEX_MULTIPOINT||this.getSortIndex()===ct.SORTINDEX_MULTILINESTRING||this.getSortIndex()===ct.SORTINDEX_MULTIPOLYGON},ct.prototype.interfaces_=function(){return[x,w,e]},ct.prototype.getClass=function(){return ct},ct.hasNonEmptyElements=function(t){for(var e=0;e<t.length;e++)if(!t[e].isEmpty())return!0;return!1},ct.hasNullElements=function(t){for(var e=0;e<t.length;e++)if(null===t[e])return!0;return!1},ht.serialVersionUID.get=function(){return 0x799ea46522854c00},ht.SORTINDEX_POINT.get=function(){return 0},ht.SORTINDEX_MULTIPOINT.get=function(){return 1},ht.SORTINDEX_LINESTRING.get=function(){return 2},ht.SORTINDEX_LINEARRING.get=function(){return 3},ht.SORTINDEX_MULTILINESTRING.get=function(){return 4},ht.SORTINDEX_POLYGON.get=function(){return 5},ht.SORTINDEX_MULTIPOLYGON.get=function(){return 6},ht.SORTINDEX_GEOMETRYCOLLECTION.get=function(){return 7},ht.geometryChangedFilter.get=function(){return pt},Object.defineProperties(ct,ht);var pt=function(){};pt.interfaces_=function(){return[ut]},pt.filter=function(t){t.geometryChangedAction()};var dt=function(){};dt.prototype.filter=function(t){},dt.prototype.interfaces_=function(){return[]},dt.prototype.getClass=function(){return dt};var ft=function(){},gt={Mod2BoundaryNodeRule:{configurable:!0},EndPointBoundaryNodeRule:{configurable:!0},MultiValentEndPointBoundaryNodeRule:{configurable:!0},MonoValentEndPointBoundaryNodeRule:{configurable:!0},MOD2_BOUNDARY_RULE:{configurable:!0},ENDPOINT_BOUNDARY_RULE:{configurable:!0},MULTIVALENT_ENDPOINT_BOUNDARY_RULE:{configurable:!0},MONOVALENT_ENDPOINT_BOUNDARY_RULE:{configurable:!0},OGC_SFS_BOUNDARY_RULE:{configurable:!0}};ft.prototype.isInBoundary=function(t){},ft.prototype.interfaces_=function(){return[]},ft.prototype.getClass=function(){return ft},gt.Mod2BoundaryNodeRule.get=function(){return yt},gt.EndPointBoundaryNodeRule.get=function(){return mt},gt.MultiValentEndPointBoundaryNodeRule.get=function(){return vt},gt.MonoValentEndPointBoundaryNodeRule.get=function(){return _t},gt.MOD2_BOUNDARY_RULE.get=function(){return new yt},gt.ENDPOINT_BOUNDARY_RULE.get=function(){return new mt},gt.MULTIVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new vt},gt.MONOVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new _t},gt.OGC_SFS_BOUNDARY_RULE.get=function(){return ft.MOD2_BOUNDARY_RULE},Object.defineProperties(ft,gt);var yt=function(){};yt.prototype.isInBoundary=function(t){return t%2==1},yt.prototype.interfaces_=function(){return[ft]},yt.prototype.getClass=function(){return yt};var mt=function(){};mt.prototype.isInBoundary=function(t){return t>0},mt.prototype.interfaces_=function(){return[ft]},mt.prototype.getClass=function(){return mt};var vt=function(){};vt.prototype.isInBoundary=function(t){return t>1},vt.prototype.interfaces_=function(){return[ft]},vt.prototype.getClass=function(){return vt};var _t=function(){};_t.prototype.isInBoundary=function(t){return 1===t},_t.prototype.interfaces_=function(){return[ft]},_t.prototype.getClass=function(){return _t};var bt=function(){};bt.prototype.add=function(){},bt.prototype.addAll=function(){},bt.prototype.isEmpty=function(){},bt.prototype.iterator=function(){},bt.prototype.size=function(){},bt.prototype.toArray=function(){},bt.prototype.remove=function(){},(n.prototype=new Error).name="IndexOutOfBoundsException";var wt=function(){};wt.prototype.hasNext=function(){},wt.prototype.next=function(){},wt.prototype.remove=function(){};var xt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(){},e.prototype.set=function(){},e.prototype.isEmpty=function(){},e}(bt);(r.prototype=new Error).name="NoSuchElementException";var Et=function(t){function e(){t.call(this),this.array_=[],arguments[0]instanceof bt&&this.addAll(arguments[0])}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.ensureCapacity=function(){},e.prototype.interfaces_=function(){return[t,bt]},e.prototype.add=function(t){return 1===arguments.length?this.array_.push(t):this.array_.splice(arguments[0],arguments[1]),!0},e.prototype.clear=function(){this.array_=[]},e.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next());return!0},e.prototype.set=function(t,e){var n=this.array_[t];return this.array_[t]=e,n},e.prototype.iterator=function(){return new St(this)},e.prototype.get=function(t){if(t<0||t>=this.size())throw new n;return this.array_[t]},e.prototype.isEmpty=function(){return 0===this.array_.length},e.prototype.size=function(){return this.array_.length},e.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e<n;e++)t.push(this.array_[e]);return t},e.prototype.remove=function(t){for(var e=!1,n=0,r=this.array_.length;n<r;n++)if(this.array_[n]===t){this.array_.splice(n,1),e=!0;break}return e},e}(xt),St=function(t){function e(e){t.call(this),this.arrayList_=e,this.position_=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.next=function(){if(this.position_===this.arrayList_.size())throw new r;return this.arrayList_.get(this.position_++)},e.prototype.hasNext=function(){return this.position_<this.arrayList_.size()},e.prototype.set=function(t){return this.arrayList_.set(this.position_-1,t)},e.prototype.remove=function(){this.arrayList_.remove(this.arrayList_.get(this.position_))},e}(wt),Ot=function(t){function e(){if(t.call(this),0===arguments.length);else if(1===arguments.length){var e=arguments[0];this.ensureCapacity(e.length),this.add(e,!0)}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this.ensureCapacity(n.length),this.add(n,r)}}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={coordArrayType:{configurable:!0}};return n.coordArrayType.get=function(){return new Array(0).fill(null)},e.prototype.getCoordinate=function(t){return this.get(t)},e.prototype.addAll=function(){if(2===arguments.length){for(var e=arguments[0],n=arguments[1],r=!1,i=e.iterator();i.hasNext();)this.add(i.next(),n),r=!0;return r}return t.prototype.addAll.apply(this,arguments)},e.prototype.clone=function(){for(var e=t.prototype.clone.call(this),n=0;n<this.size();n++)e.add(n,this.get(n).copy());return e},e.prototype.toCoordinateArray=function(){return this.toArray(e.coordArrayType)},e.prototype.add=function(){if(1===arguments.length){var e=arguments[0];t.prototype.add.call(this,e)}else if(2===arguments.length){if(arguments[0]instanceof Array&&"boolean"==typeof arguments[1]){var n=arguments[0],r=arguments[1];return this.add(n,r,!0),!0}if(arguments[0]instanceof S&&"boolean"==typeof arguments[1]){var i=arguments[0];if(!arguments[1]&&this.size()>=1&&this.get(this.size()-1).equals2D(i))return null;t.prototype.add.call(this,i)}else if(arguments[0]instanceof Object&&"boolean"==typeof arguments[1]){var o=arguments[0],a=arguments[1];return this.add(o,a),!0}}else if(3===arguments.length){if("boolean"==typeof arguments[2]&&arguments[0]instanceof Array&&"boolean"==typeof arguments[1]){var s=arguments[0],l=arguments[1];if(arguments[2])for(var u=0;u<s.length;u++)this.add(s[u],l);else for(var c=s.length-1;c>=0;c--)this.add(s[c],l);return!0}if("boolean"==typeof arguments[2]&&Number.isInteger(arguments[0])&&arguments[1]instanceof S){var h=arguments[0],p=arguments[1];if(!arguments[2]){var d=this.size();if(d>0){if(h>0&&this.get(h-1).equals2D(p))return null;if(h<d&&this.get(h).equals2D(p))return null}}t.prototype.add.call(this,h,p)}}else if(4===arguments.length){var f=arguments[0],g=arguments[1],y=arguments[2],m=arguments[3],v=1;y>m&&(v=-1);for(var _=y;_!==m;_+=v)this.add(f[_],g);return!0}},e.prototype.closeRing=function(){this.size()>0&&this.add(new S(this.get(0)),!1)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},Object.defineProperties(e,n),e}(Et),Ct=function(){},Tt={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};Tt.ForwardComparator.get=function(){return It},Tt.BidirectionalComparator.get=function(){return Lt},Tt.coordArrayType.get=function(){return new Array(0).fill(null)},Ct.prototype.interfaces_=function(){return[]},Ct.prototype.getClass=function(){return Ct},Ct.isRing=function(t){return!(t.length<4||!t[0].equals2D(t[t.length-1]))},Ct.ptNotInList=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(Ct.indexOf(r,e)<0)return r}return null},Ct.scroll=function(t,e){var n=Ct.indexOf(e,t);if(n<0)return null;var r=new Array(t.length).fill(null);q.arraycopy(t,n,r,0,t.length-n),q.arraycopy(t,0,r,t.length-n,n),q.arraycopy(r,0,t,0,t.length)},Ct.equals=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];if(t===e)return!0;if(null===t||null===e)return!1;if(t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(!t[n].equals(e[n]))return!1;return!0}if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2];if(r===i)return!0;if(null===r||null===i)return!1;if(r.length!==i.length)return!1;for(var a=0;a<r.length;a++)if(0!==o.compare(r[a],i[a]))return!1;return!0}},Ct.intersection=function(t,e){for(var n=new Ot,r=0;r<t.length;r++)e.intersects(t[r])&&n.add(t[r],!0);return n.toCoordinateArray()},Ct.hasRepeatedPoints=function(t){for(var e=1;e<t.length;e++)if(t[e-1].equals(t[e]))return!0;return!1},Ct.removeRepeatedPoints=function(t){return Ct.hasRepeatedPoints(t)?new Ot(t,!1).toCoordinateArray():t},Ct.reverse=function(t){for(var e=t.length-1,n=Math.trunc(e/2),r=0;r<=n;r++){var i=t[r];t[r]=t[e-r],t[e-r]=i}},Ct.removeNull=function(t){for(var e=0,n=0;n<t.length;n++)null!==t[n]&&e++;var r=new Array(e).fill(null);if(0===e)return r;for(var i=0,o=0;o<t.length;o++)null!==t[o]&&(r[i++]=t[o]);return r},Ct.copyDeep=function(){if(1===arguments.length){for(var t=arguments[0],e=new Array(t.length).fill(null),n=0;n<t.length;n++)e[n]=new S(t[n]);return e}if(5===arguments.length)for(var r=arguments[0],i=arguments[1],o=arguments[2],a=arguments[3],s=arguments[4],l=0;l<s;l++)o[a+l]=new S(r[i+l])},Ct.isEqualReversed=function(t,e){for(var n=0;n<t.length;n++){var r=t[n],i=e[t.length-n-1];if(0!==r.compareTo(i))return!1}return!0},Ct.envelope=function(t){for(var e=new X,n=0;n<t.length;n++)e.expandToInclude(t[n]);return e},Ct.toCoordinateArray=function(t){return t.toArray(Ct.coordArrayType)},Ct.atLeastNCoordinatesOrNothing=function(t,e){return e.length>=t?e:[]},Ct.indexOf=function(t,e){for(var n=0;n<e.length;n++)if(t.equals(e[n]))return n;return-1},Ct.increasingDirection=function(t){for(var e=0;e<Math.trunc(t.length/2);e++){var n=t.length-1-e,r=t[e].compareTo(t[n]);if(0!==r)return r}return 1},Ct.compare=function(t,e){for(var n=0;n<t.length&&n<e.length;){var r=t[n].compareTo(e[n]);if(0!==r)return r;n++}return n<e.length?-1:n<t.length?1:0},Ct.minCoordinate=function(t){for(var e=null,n=0;n<t.length;n++)(null===e||e.compareTo(t[n])>0)&&(e=t[n]);return e},Ct.extract=function(t,e,n){e=R.clamp(e,0,t.length);var r=(n=R.clamp(n,-1,t.length))-e+1;n<0&&(r=0),e>=t.length&&(r=0),n<e&&(r=0);var i=new Array(r).fill(null);if(0===r)return i;for(var o=0,a=e;a<=n;a++)i[o++]=t[a];return i},Object.defineProperties(Ct,Tt);var It=function(){};It.prototype.compare=function(t,e){return Ct.compare(t,e)},It.prototype.interfaces_=function(){return[E]},It.prototype.getClass=function(){return It};var Lt=function(){};Lt.prototype.compare=function(t,e){var n=t,r=e;if(n.length<r.length)return-1;if(n.length>r.length)return 1;if(0===n.length)return 0;var i=Ct.compare(n,r);return Ct.isEqualReversed(n,r)?0:i},Lt.prototype.OLDcompare=function(t,e){var n=t,r=e;if(n.length<r.length)return-1;if(n.length>r.length)return 1;if(0===n.length)return 0;for(var i=Ct.increasingDirection(n),o=Ct.increasingDirection(r),a=i>0?0:n.length-1,s=o>0?0:n.length-1,l=0;l<n.length;l++){var u=n[a].compareTo(r[s]);if(0!==u)return u;a+=i,s+=o}return 0},Lt.prototype.interfaces_=function(){return[E]},Lt.prototype.getClass=function(){return Lt};var Pt=function(){};Pt.prototype.get=function(){},Pt.prototype.put=function(){},Pt.prototype.size=function(){},Pt.prototype.values=function(){},Pt.prototype.entrySet=function(){};var Rt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Pt);(i.prototype=new Error).name="OperationNotSupported",(o.prototype=new bt).contains=function(){};var Mt=function(t){function e(){t.call(this),this.array_=[],arguments[0]instanceof bt&&this.addAll(arguments[0])}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.contains=function(t){for(var e=0,n=this.array_.length;e<n;e++)if(this.array_[e]===t)return!0;return!1},e.prototype.add=function(t){return!this.contains(t)&&(this.array_.push(t),!0)},e.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next());return!0},e.prototype.remove=function(t){throw new Error},e.prototype.size=function(){return this.array_.length},e.prototype.isEmpty=function(){return 0===this.array_.length},e.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e<n;e++)t.push(this.array_[e]);return t},e.prototype.iterator=function(){return new Nt(this)},e}(o),Nt=function(t){function e(e){t.call(this),this.hashSet_=e,this.position_=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.next=function(){if(this.position_===this.hashSet_.size())throw new r;return this.hashSet_.array_[this.position_++]},e.prototype.hasNext=function(){return this.position_<this.hashSet_.size()},e.prototype.remove=function(){throw new i},e}(wt),jt=0;(h.prototype=new Rt).get=function(t){for(var e=this.root_;null!==e;){var n=t.compareTo(e.key);if(n<0)e=e.left;else{if(!(n>0))return e.value;e=e.right}}return null},h.prototype.put=function(t,e){if(null===this.root_)return this.root_={key:t,value:e,left:null,right:null,parent:null,color:jt,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var n,r,i=this.root_;do{if(n=i,(r=t.compareTo(i.key))<0)i=i.left;else{if(!(r>0)){var o=i.value;return i.value=e,o}i=i.right}}while(null!==i);var a={key:t,left:null,right:null,value:e,parent:n,color:jt,getValue:function(){return this.value},getKey:function(){return this.key}};return r<0?n.left=a:n.right=a,this.fixAfterInsertion(a),this.size_++,null},h.prototype.fixAfterInsertion=function(t){for(t.color=1;null!=t&&t!==this.root_&&1===t.parent.color;)if(s(t)===u(s(s(t)))){var e=c(s(s(t)));1===a(e)?(l(s(t),jt),l(e,jt),l(s(s(t)),1),t=s(s(t))):(t===c(s(t))&&(t=s(t),this.rotateLeft(t)),l(s(t),jt),l(s(s(t)),1),this.rotateRight(s(s(t))))}else{var n=u(s(s(t)));1===a(n)?(l(s(t),jt),l(n,jt),l(s(s(t)),1),t=s(s(t))):(t===u(s(t))&&(t=s(t),this.rotateRight(t)),l(s(t),jt),l(s(s(t)),1),this.rotateLeft(s(s(t))))}this.root_.color=jt},h.prototype.values=function(){var t=new Et,e=this.getFirstEntry();if(null!==e)for(t.add(e.value);null!==(e=h.successor(e));)t.add(e.value);return t},h.prototype.entrySet=function(){var t=new Mt,e=this.getFirstEntry();if(null!==e)for(t.add(e);null!==(e=h.successor(e));)t.add(e);return t},h.prototype.rotateLeft=function(t){if(null!=t){var e=t.right;t.right=e.left,null!=e.left&&(e.left.parent=t),e.parent=t.parent,null===t.parent?this.root_=e:t.parent.left===t?t.parent.left=e:t.parent.right=e,e.left=t,t.parent=e}},h.prototype.rotateRight=function(t){if(null!=t){var e=t.left;t.left=e.right,null!=e.right&&(e.right.parent=t),e.parent=t.parent,null===t.parent?this.root_=e:t.parent.right===t?t.parent.right=e:t.parent.left=e,e.right=t,t.parent=e}},h.prototype.getFirstEntry=function(){var t=this.root_;if(null!=t)for(;null!=t.left;)t=t.left;return t},h.successor=function(t){if(null===t)return null;if(null!==t.right){for(var e=t.right;null!==e.left;)e=e.left;return e}for(var n=t.parent,r=t;null!==n&&r===n.right;)r=n,n=n.parent;return n},h.prototype.size=function(){return this.size_};var At=function(){};At.prototype.interfaces_=function(){return[]},At.prototype.getClass=function(){return At},p.prototype=new o,(d.prototype=new p).contains=function(t){for(var e=0,n=this.array_.length;e<n;e++)if(0===this.array_[e].compareTo(t))return!0;return!1},d.prototype.add=function(t){if(this.contains(t))return!1;for(var e=0,n=this.array_.length;e<n;e++)if(1===this.array_[e].compareTo(t))return this.array_.splice(e,0,t),!0;return this.array_.push(t),!0},d.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next());return!0},d.prototype.remove=function(t){throw new i},d.prototype.size=function(){return this.array_.length},d.prototype.isEmpty=function(){return 0===this.array_.length},d.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e<n;e++)t.push(this.array_[e]);return t},d.prototype.iterator=function(){return new kt(this)};var kt=function(t){this.treeSet_=t,this.position_=0};kt.prototype.next=function(){if(this.position_===this.treeSet_.size())throw new r;return this.treeSet_.array_[this.position_++]},kt.prototype.hasNext=function(){return this.position_<this.treeSet_.size()},kt.prototype.remove=function(){throw new i};var Ft=function(){};Ft.sort=function(){var t,e,n,r,i=arguments[0];if(1===arguments.length)r=function(t,e){return t.compareTo(e)},i.sort(r);else if(2===arguments.length)n=arguments[1],r=function(t,e){return n.compare(t,e)},i.sort(r);else if(3===arguments.length){(e=i.slice(arguments[1],arguments[2])).sort();var o=i.slice(0,arguments[1]).concat(e,i.slice(arguments[2],i.length));for(i.splice(0,i.length),t=0;t<o.length;t++)i.push(o[t])}else if(4===arguments.length)for(e=i.slice(arguments[1],arguments[2]),n=arguments[3],r=function(t,e){return n.compare(t,e)},e.sort(r),o=i.slice(0,arguments[1]).concat(e,i.slice(arguments[2],i.length)),i.splice(0,i.length),t=0;t<o.length;t++)i.push(o[t])},Ft.asList=function(t){for(var e=new Et,n=0,r=t.length;n<r;n++)e.add(t[n]);return e};var Dt=function(){},Gt={P:{configurable:!0},L:{configurable:!0},A:{configurable:!0},FALSE:{configurable:!0},TRUE:{configurable:!0},DONTCARE:{configurable:!0},SYM_FALSE:{configurable:!0},SYM_TRUE:{configurable:!0},SYM_DONTCARE:{configurable:!0},SYM_P:{configurable:!0},SYM_L:{configurable:!0},SYM_A:{configurable:!0}};Gt.P.get=function(){return 0},Gt.L.get=function(){return 1},Gt.A.get=function(){return 2},Gt.FALSE.get=function(){return-1},Gt.TRUE.get=function(){return-2},Gt.DONTCARE.get=function(){return-3},Gt.SYM_FALSE.get=function(){return"F"},Gt.SYM_TRUE.get=function(){return"T"},Gt.SYM_DONTCARE.get=function(){return"*"},Gt.SYM_P.get=function(){return"0"},Gt.SYM_L.get=function(){return"1"},Gt.SYM_A.get=function(){return"2"},Dt.prototype.interfaces_=function(){return[]},Dt.prototype.getClass=function(){return Dt},Dt.toDimensionSymbol=function(t){switch(t){case Dt.FALSE:return Dt.SYM_FALSE;case Dt.TRUE:return Dt.SYM_TRUE;case Dt.DONTCARE:return Dt.SYM_DONTCARE;case Dt.P:return Dt.SYM_P;case Dt.L:return Dt.SYM_L;case Dt.A:return Dt.SYM_A}throw new v("Unknown dimension value: "+t)},Dt.toDimensionValue=function(t){switch(A.toUpperCase(t)){case Dt.SYM_FALSE:return Dt.FALSE;case Dt.SYM_TRUE:return Dt.TRUE;case Dt.SYM_DONTCARE:return Dt.DONTCARE;case Dt.SYM_P:return Dt.P;case Dt.SYM_L:return Dt.L;case Dt.SYM_A:return Dt.A}throw new v("Unknown dimension symbol: "+t)},Object.defineProperties(Dt,Gt);var zt=function(){};zt.prototype.filter=function(t){},zt.prototype.interfaces_=function(){return[]},zt.prototype.getClass=function(){return zt};var Ut=function(){};Ut.prototype.filter=function(t,e){},Ut.prototype.isDone=function(){},Ut.prototype.isGeometryChanged=function(){},Ut.prototype.interfaces_=function(){return[]},Ut.prototype.getClass=function(){return Ut};var Bt=function(t){function e(e,n){if(t.call(this,n),this._geometries=e||[],t.hasNullElements(this._geometries))throw new v("geometries must not contain null elements")}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){for(var t=new X,e=0;e<this._geometries.length;e++)t.expandToInclude(this._geometries[e].getEnvelopeInternal());return t},e.prototype.getGeometryN=function(t){return this._geometries[t]},e.prototype.getSortIndex=function(){return t.SORTINDEX_GEOMETRYCOLLECTION},e.prototype.getCoordinates=function(){for(var t=new Array(this.getNumPoints()).fill(null),e=-1,n=0;n<this._geometries.length;n++)for(var r=this._geometries[n].getCoordinates(),i=0;i<r.length;i++)t[++e]=r[i];return t},e.prototype.getArea=function(){for(var t=0,e=0;e<this._geometries.length;e++)t+=this._geometries[e].getArea();return t},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];if(!this.isEquivalentClass(e))return!1;var r=e;if(this._geometries.length!==r._geometries.length)return!1;for(var i=0;i<this._geometries.length;i++)if(!this._geometries[i].equalsExact(r._geometries[i],n))return!1;return!0}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){for(var t=0;t<this._geometries.length;t++)this._geometries[t].normalize();Ft.sort(this._geometries)},e.prototype.getCoordinate=function(){return this.isEmpty()?null:this._geometries[0].getCoordinate()},e.prototype.getBoundaryDimension=function(){for(var t=Dt.FALSE,e=0;e<this._geometries.length;e++)t=Math.max(t,this._geometries[e].getBoundaryDimension());return t},e.prototype.getDimension=function(){for(var t=Dt.FALSE,e=0;e<this._geometries.length;e++)t=Math.max(t,this._geometries[e].getDimension());return t},e.prototype.getLength=function(){for(var t=0,e=0;e<this._geometries.length;e++)t+=this._geometries[e].getLength();return t},e.prototype.getNumPoints=function(){for(var t=0,e=0;e<this._geometries.length;e++)t+=this._geometries[e].getNumPoints();return t},e.prototype.getNumGeometries=function(){return this._geometries.length},e.prototype.reverse=function(){for(var t=this._geometries.length,e=new Array(t).fill(null),n=0;n<this._geometries.length;n++)e[n]=this._geometries[n].reverse();return this.getFactory().createGeometryCollection(e)},e.prototype.compareToSameClass=function(){if(1===arguments.length){var t=arguments[0],e=new d(Ft.asList(this._geometries)),n=new d(Ft.asList(t._geometries));return this.compare(e,n)}if(2===arguments.length){for(var r=arguments[0],i=arguments[1],o=r,a=this.getNumGeometries(),s=o.getNumGeometries(),l=0;l<a&&l<s;){var u=this.getGeometryN(l),c=o.getGeometryN(l),h=u.compareToSameClass(c,i);if(0!==h)return h;l++}return l<a?1:l<s?-1:0}},e.prototype.apply=function(){if(P(arguments[0],dt))for(var t=arguments[0],e=0;e<this._geometries.length;e++)this._geometries[e].apply(t);else if(P(arguments[0],Ut)){var n=arguments[0];if(0===this._geometries.length)return null;for(var r=0;r<this._geometries.length&&(this._geometries[r].apply(n),!n.isDone());r++);n.isGeometryChanged()&&this.geometryChanged()}else if(P(arguments[0],zt)){var i=arguments[0];i.filter(this);for(var o=0;o<this._geometries.length;o++)this._geometries[o].apply(i)}else if(P(arguments[0],ut)){var a=arguments[0];a.filter(this);for(var s=0;s<this._geometries.length;s++)this._geometries[s].apply(a)}},e.prototype.getBoundary=function(){return this.checkNotGeometryCollection(this),et.shouldNeverReachHere(),null},e.prototype.clone=function(){var e=t.prototype.clone.call(this);e._geometries=new Array(this._geometries.length).fill(null);for(var n=0;n<this._geometries.length;n++)e._geometries[n]=this._geometries[n].clone();return e},e.prototype.getGeometryType=function(){return"GeometryCollection"},e.prototype.copy=function(){for(var t=new Array(this._geometries.length).fill(null),n=0;n<t.length;n++)t[n]=this._geometries[n].copy();return new e(t,this._factory)},e.prototype.isEmpty=function(){for(var t=0;t<this._geometries.length;t++)if(!this._geometries[t].isEmpty())return!1;return!0},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return-0x4f07bcb1f857d800},Object.defineProperties(e,n),e}(ct),Vt=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return ct.SORTINDEX_MULTILINESTRING},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];return!!this.isEquivalentClass(e)&&t.prototype.equalsExact.call(this,e,n)}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.getBoundaryDimension=function(){return this.isClosed()?Dt.FALSE:0},e.prototype.isClosed=function(){if(this.isEmpty())return!1;for(var t=0;t<this._geometries.length;t++)if(!this._geometries[t].isClosed())return!1;return!0},e.prototype.getDimension=function(){return 1},e.prototype.reverse=function(){for(var t=this._geometries.length,e=new Array(t).fill(null),n=0;n<this._geometries.length;n++)e[t-1-n]=this._geometries[n].reverse();return this.getFactory().createMultiLineString(e)},e.prototype.getBoundary=function(){return new qt(this).getBoundary()},e.prototype.getGeometryType=function(){return"MultiLineString"},e.prototype.copy=function(){for(var t=new Array(this._geometries.length).fill(null),n=0;n<t.length;n++)t[n]=this._geometries[n].copy();return new e(t,this._factory)},e.prototype.interfaces_=function(){return[At]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return 0x7155d2ab4afa8000},Object.defineProperties(e,n),e}(Bt),qt=function(){if(this._geom=null,this._geomFact=null,this._bnRule=null,this._endpointMap=null,1===arguments.length){var t=arguments[0],e=ft.MOD2_BOUNDARY_RULE;this._geom=t,this._geomFact=t.getFactory(),this._bnRule=e}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this._geom=n,this._geomFact=n.getFactory(),this._bnRule=r}};qt.prototype.boundaryMultiLineString=function(t){if(this._geom.isEmpty())return this.getEmptyMultiPoint();var e=this.computeBoundaryCoordinates(t);return 1===e.length?this._geomFact.createPoint(e[0]):this._geomFact.createMultiPointFromCoords(e)},qt.prototype.getBoundary=function(){return this._geom instanceof Kt?this.boundaryLineString(this._geom):this._geom instanceof Vt?this.boundaryMultiLineString(this._geom):this._geom.getBoundary()},qt.prototype.boundaryLineString=function(t){return this._geom.isEmpty()?this.getEmptyMultiPoint():t.isClosed()?this._bnRule.isInBoundary(2)?t.getStartPoint():this._geomFact.createMultiPoint():this._geomFact.createMultiPoint([t.getStartPoint(),t.getEndPoint()])},qt.prototype.getEmptyMultiPoint=function(){return this._geomFact.createMultiPoint()},qt.prototype.computeBoundaryCoordinates=function(t){var e=new Et;this._endpointMap=new h;for(var n=0;n<t.getNumGeometries();n++){var r=t.getGeometryN(n);0!==r.getNumPoints()&&(this.addEndpoint(r.getCoordinateN(0)),this.addEndpoint(r.getCoordinateN(r.getNumPoints()-1)))}for(var i=this._endpointMap.entrySet().iterator();i.hasNext();){var o=i.next(),a=o.getValue().count;this._bnRule.isInBoundary(a)&&e.add(o.getKey())}return Ct.toCoordinateArray(e)},qt.prototype.addEndpoint=function(t){var e=this._endpointMap.get(t);null===e&&(e=new Yt,this._endpointMap.put(t,e)),e.count++},qt.prototype.interfaces_=function(){return[]},qt.prototype.getClass=function(){return qt},qt.getBoundary=function(){if(1===arguments.length){var t=arguments[0];return new qt(t).getBoundary()}if(2===arguments.length){var e=arguments[0],n=arguments[1];return new qt(e,n).getBoundary()}};var Yt=function(){this.count=null};Yt.prototype.interfaces_=function(){return[]},Yt.prototype.getClass=function(){return Yt};var Xt=function(){},Wt={NEWLINE:{configurable:!0},SIMPLE_ORDINATE_FORMAT:{configurable:!0}};Xt.prototype.interfaces_=function(){return[]},Xt.prototype.getClass=function(){return Xt},Xt.chars=function(t,e){for(var n=new Array(e).fill(null),r=0;r<e;r++)n[r]=t;return String(n)},Xt.getStackTrace=function(){if(1===arguments.length){var t=arguments[0],e=new function(){},n=new function(){}(e);return t.printStackTrace(n),e.toString()}if(2===arguments.length){for(var r=arguments[0],i=arguments[1],o="",a=new function(){}(new function(){}(Xt.getStackTrace(r))),s=0;s<i;s++)try{o+=a.readLine()+Xt.NEWLINE}catch(t){if(!(t instanceof f))throw t;et.shouldNeverReachHere()}return o}},Xt.split=function(t,e){for(var n=e.length,r=new Et,i=""+t,o=i.indexOf(e);o>=0;){var a=i.substring(0,o);r.add(a),o=(i=i.substring(o+n)).indexOf(e)}i.length>0&&r.add(i);for(var s=new Array(r.size()).fill(null),l=0;l<s.length;l++)s[l]=r.get(l);return s},Xt.toString=function(){if(1===arguments.length){var t=arguments[0];return Xt.SIMPLE_ORDINATE_FORMAT.format(t)}},Xt.spaces=function(t){return Xt.chars(" ",t)},Wt.NEWLINE.get=function(){return q.getProperty("line.separator")},Wt.SIMPLE_ORDINATE_FORMAT.get=function(){return new function(){}("0.#")},Object.defineProperties(Xt,Wt);var Ht=function(){};Ht.prototype.interfaces_=function(){return[]},Ht.prototype.getClass=function(){return Ht},Ht.copyCoord=function(t,e,n,r){for(var i=Math.min(t.getDimension(),n.getDimension()),o=0;o<i;o++)n.setOrdinate(r,o,t.getOrdinate(e,o))},Ht.isRing=function(t){var e=t.size();return 0===e||!(e<=3)&&t.getOrdinate(0,z.X)===t.getOrdinate(e-1,z.X)&&t.getOrdinate(0,z.Y)===t.getOrdinate(e-1,z.Y)},Ht.isEqual=function(t,e){var n=t.size();if(n!==e.size())return!1;for(var r=Math.min(t.getDimension(),e.getDimension()),i=0;i<n;i++)for(var o=0;o<r;o++){var a=t.getOrdinate(i,o),s=e.getOrdinate(i,o);if(!(t.getOrdinate(i,o)===e.getOrdinate(i,o)||_.isNaN(a)&&_.isNaN(s)))return!1}return!0},Ht.extend=function(t,e,n){var r=t.create(n,e.getDimension()),i=e.size();if(Ht.copy(e,0,r,0,i),i>0)for(var o=i;o<n;o++)Ht.copy(e,i-1,r,o,1);return r},Ht.reverse=function(t){for(var e=t.size()-1,n=Math.trunc(e/2),r=0;r<=n;r++)Ht.swap(t,r,e-r)},Ht.swap=function(t,e,n){if(e===n)return null;for(var r=0;r<t.getDimension();r++){var i=t.getOrdinate(e,r);t.setOrdinate(e,r,t.getOrdinate(n,r)),t.setOrdinate(n,r,i)}},Ht.copy=function(t,e,n,r,i){for(var o=0;o<i;o++)Ht.copyCoord(t,e+o,n,r+o)},Ht.toString=function(){if(1===arguments.length){var t=arguments[0],e=t.size();if(0===e)return"()";var n=t.getDimension(),r=new N;r.append("(");for(var i=0;i<e;i++){i>0&&r.append(" ");for(var o=0;o<n;o++)o>0&&r.append(","),r.append(Xt.toString(t.getOrdinate(i,o)))}return r.append(")"),r.toString()}},Ht.ensureValidRing=function(t,e){var n=e.size();return 0===n?e:n<=3?Ht.createClosedRing(t,e,4):e.getOrdinate(0,z.X)===e.getOrdinate(n-1,z.X)&&e.getOrdinate(0,z.Y)===e.getOrdinate(n-1,z.Y)?e:Ht.createClosedRing(t,e,n+1)},Ht.createClosedRing=function(t,e,n){var r=t.create(n,e.getDimension()),i=e.size();Ht.copy(e,0,r,0,i);for(var o=i;o<n;o++)Ht.copy(e,0,r,o,1);return r};var Kt=function(t){function e(e,n){t.call(this,n),this._points=null,this.init(e)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){return this.isEmpty()?new X:this._points.expandEnvelope(new X)},e.prototype.isRing=function(){return this.isClosed()&&this.isSimple()},e.prototype.getSortIndex=function(){return t.SORTINDEX_LINESTRING},e.prototype.getCoordinates=function(){return this._points.toCoordinateArray()},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];if(!this.isEquivalentClass(e))return!1;var r=e;if(this._points.size()!==r._points.size())return!1;for(var i=0;i<this._points.size();i++)if(!this.equal(this._points.getCoordinate(i),r._points.getCoordinate(i),n))return!1;return!0}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){for(var t=0;t<Math.trunc(this._points.size()/2);t++){var e=this._points.size()-1-t;if(!this._points.getCoordinate(t).equals(this._points.getCoordinate(e)))return this._points.getCoordinate(t).compareTo(this._points.getCoordinate(e))>0&&Ht.reverse(this._points),null}},e.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},e.prototype.getBoundaryDimension=function(){return this.isClosed()?Dt.FALSE:0},e.prototype.isClosed=function(){return!this.isEmpty()&&this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))},e.prototype.getEndPoint=function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)},e.prototype.getDimension=function(){return 1},e.prototype.getLength=function(){return st.computeLength(this._points)},e.prototype.getNumPoints=function(){return this._points.size()},e.prototype.reverse=function(){var t=this._points.copy();return Ht.reverse(t),this.getFactory().createLineString(t)},e.prototype.compareToSameClass=function(){if(1===arguments.length){for(var t=arguments[0],e=0,n=0;e<this._points.size()&&n<t._points.size();){var r=this._points.getCoordinate(e).compareTo(t._points.getCoordinate(n));if(0!==r)return r;e++,n++}return e<this._points.size()?1:n<t._points.size()?-1:0}if(2===arguments.length){var i=arguments[0];return arguments[1].compare(this._points,i._points)}},e.prototype.apply=function(){if(P(arguments[0],dt))for(var t=arguments[0],e=0;e<this._points.size();e++)t.filter(this._points.getCoordinate(e));else if(P(arguments[0],Ut)){var n=arguments[0];if(0===this._points.size())return null;for(var r=0;r<this._points.size()&&(n.filter(this._points,r),!n.isDone());r++);n.isGeometryChanged()&&this.geometryChanged()}else(P(arguments[0],zt)||P(arguments[0],ut))&&arguments[0].filter(this)},e.prototype.getBoundary=function(){return new qt(this).getBoundary()},e.prototype.isEquivalentClass=function(t){return t instanceof e},e.prototype.clone=function(){var e=t.prototype.clone.call(this);return e._points=this._points.clone(),e},e.prototype.getCoordinateN=function(t){return this._points.getCoordinate(t)},e.prototype.getGeometryType=function(){return"LineString"},e.prototype.copy=function(){return new e(this._points.copy(),this._factory)},e.prototype.getCoordinateSequence=function(){return this._points},e.prototype.isEmpty=function(){return 0===this._points.size()},e.prototype.init=function(t){if(null===t&&(t=this.getFactory().getCoordinateSequenceFactory().create([])),1===t.size())throw new v("Invalid number of points in LineString (found "+t.size()+" - must be 0 or >= 2)");this._points=t},e.prototype.isCoordinate=function(t){for(var e=0;e<this._points.size();e++)if(this._points.getCoordinate(e).equals(t))return!0;return!1},e.prototype.getStartPoint=function(){return this.isEmpty()?null:this.getPointN(0)},e.prototype.getPointN=function(t){return this.getFactory().createPoint(this._points.getCoordinate(t))},e.prototype.interfaces_=function(){return[At]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return 0x2b2b51ba435c8e00},Object.defineProperties(e,n),e}(ct),Zt=function(){};Zt.prototype.interfaces_=function(){return[]},Zt.prototype.getClass=function(){return Zt};var $t=function(t){function e(e,n){t.call(this,n),this._coordinates=e||null,this.init(this._coordinates)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){if(this.isEmpty())return new X;var t=new X;return t.expandToInclude(this._coordinates.getX(0),this._coordinates.getY(0)),t},e.prototype.getSortIndex=function(){return t.SORTINDEX_POINT},e.prototype.getCoordinates=function(){return this.isEmpty()?[]:[this.getCoordinate()]},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];return!!this.isEquivalentClass(e)&&(!(!this.isEmpty()||!e.isEmpty())||this.isEmpty()===e.isEmpty()&&this.equal(e.getCoordinate(),this.getCoordinate(),n))}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){},e.prototype.getCoordinate=function(){return 0!==this._coordinates.size()?this._coordinates.getCoordinate(0):null},e.prototype.getBoundaryDimension=function(){return Dt.FALSE},e.prototype.getDimension=function(){return 0},e.prototype.getNumPoints=function(){return this.isEmpty()?0:1},e.prototype.reverse=function(){return this.copy()},e.prototype.getX=function(){if(null===this.getCoordinate())throw new Error("getX called on empty Point");return this.getCoordinate().x},e.prototype.compareToSameClass=function(){if(1===arguments.length){var t=arguments[0];return this.getCoordinate().compareTo(t.getCoordinate())}if(2===arguments.length){var e=arguments[0];return arguments[1].compare(this._coordinates,e._coordinates)}},e.prototype.apply=function(){if(P(arguments[0],dt)){var t=arguments[0];if(this.isEmpty())return null;t.filter(this.getCoordinate())}else if(P(arguments[0],Ut)){var e=arguments[0];if(this.isEmpty())return null;e.filter(this._coordinates,0),e.isGeometryChanged()&&this.geometryChanged()}else(P(arguments[0],zt)||P(arguments[0],ut))&&arguments[0].filter(this)},e.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},e.prototype.clone=function(){var e=t.prototype.clone.call(this);return e._coordinates=this._coordinates.clone(),e},e.prototype.getGeometryType=function(){return"Point"},e.prototype.copy=function(){return new e(this._coordinates.copy(),this._factory)},e.prototype.getCoordinateSequence=function(){return this._coordinates},e.prototype.getY=function(){if(null===this.getCoordinate())throw new Error("getY called on empty Point");return this.getCoordinate().y},e.prototype.isEmpty=function(){return 0===this._coordinates.size()},e.prototype.init=function(t){null===t&&(t=this.getFactory().getCoordinateSequenceFactory().create([])),et.isTrue(t.size()<=1),this._coordinates=t},e.prototype.isSimple=function(){return!0},e.prototype.interfaces_=function(){return[Zt]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return 0x44077bad161cbc00},Object.defineProperties(e,n),e}(ct),Jt=function(){};Jt.prototype.interfaces_=function(){return[]},Jt.prototype.getClass=function(){return Jt};var Qt=function(t){function e(e,n,r){if(t.call(this,r),this._shell=null,this._holes=null,null===e&&(e=this.getFactory().createLinearRing()),null===n&&(n=[]),t.hasNullElements(n))throw new v("holes must not contain null elements");if(e.isEmpty()&&t.hasNonEmptyElements(n))throw new v("shell is empty but holes are not");this._shell=e,this._holes=n}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){return this._shell.getEnvelopeInternal()},e.prototype.getSortIndex=function(){return t.SORTINDEX_POLYGON},e.prototype.getCoordinates=function(){if(this.isEmpty())return[];for(var t=new Array(this.getNumPoints()).fill(null),e=-1,n=this._shell.getCoordinates(),r=0;r<n.length;r++)t[++e]=n[r];for(var i=0;i<this._holes.length;i++)for(var o=this._holes[i].getCoordinates(),a=0;a<o.length;a++)t[++e]=o[a];return t},e.prototype.getArea=function(){var t=0;t+=Math.abs(st.signedArea(this._shell.getCoordinateSequence()));for(var e=0;e<this._holes.length;e++)t-=Math.abs(st.signedArea(this._holes[e].getCoordinateSequence()));return t},e.prototype.isRectangle=function(){if(0!==this.getNumInteriorRing())return!1;if(null===this._shell)return!1;if(5!==this._shell.getNumPoints())return!1;for(var t=this._shell.getCoordinateSequence(),e=this.getEnvelopeInternal(),n=0;n<5;n++){var r=t.getX(n);if(r!==e.getMinX()&&r!==e.getMaxX())return!1;var i=t.getY(n);if(i!==e.getMinY()&&i!==e.getMaxY())return!1}for(var o=t.getX(0),a=t.getY(0),s=1;s<=4;s++){var l=t.getX(s),u=t.getY(s);if(l!==o==(u!==a))return!1;o=l,a=u}return!0},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];if(!this.isEquivalentClass(e))return!1;var r=e,i=this._shell,o=r._shell;if(!i.equalsExact(o,n))return!1;if(this._holes.length!==r._holes.length)return!1;for(var a=0;a<this._holes.length;a++)if(!this._holes[a].equalsExact(r._holes[a],n))return!1;return!0}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){if(0===arguments.length){this.normalize(this._shell,!0);for(var t=0;t<this._holes.length;t++)this.normalize(this._holes[t],!1);Ft.sort(this._holes)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(e.isEmpty())return null;var r=new Array(e.getCoordinates().length-1).fill(null);q.arraycopy(e.getCoordinates(),0,r,0,r.length);var i=Ct.minCoordinate(e.getCoordinates());Ct.scroll(r,i),q.arraycopy(r,0,e.getCoordinates(),0,r.length),e.getCoordinates()[r.length]=r[0],st.isCCW(e.getCoordinates())===n&&Ct.reverse(e.getCoordinates())}},e.prototype.getCoordinate=function(){return this._shell.getCoordinate()},e.prototype.getNumInteriorRing=function(){return this._holes.length},e.prototype.getBoundaryDimension=function(){return 1},e.prototype.getDimension=function(){return 2},e.prototype.getLength=function(){var t=0;t+=this._shell.getLength();for(var e=0;e<this._holes.length;e++)t+=this._holes[e].getLength();return t},e.prototype.getNumPoints=function(){for(var t=this._shell.getNumPoints(),e=0;e<this._holes.length;e++)t+=this._holes[e].getNumPoints();return t},e.prototype.reverse=function(){var t=this.copy();t._shell=this._shell.copy().reverse(),t._holes=new Array(this._holes.length).fill(null);for(var e=0;e<this._holes.length;e++)t._holes[e]=this._holes[e].copy().reverse();return t},e.prototype.convexHull=function(){return this.getExteriorRing().convexHull()},e.prototype.compareToSameClass=function(){if(1===arguments.length){var t=arguments[0],e=this._shell,n=t._shell;return e.compareToSameClass(n)}if(2===arguments.length){var r=arguments[0],i=arguments[1],o=r,a=this._shell,s=o._shell,l=a.compareToSameClass(s,i);if(0!==l)return l;for(var u=this.getNumInteriorRing(),c=o.getNumInteriorRing(),h=0;h<u&&h<c;){var p=this.getInteriorRingN(h),d=o.getInteriorRingN(h),f=p.compareToSameClass(d,i);if(0!==f)return f;h++}return h<u?1:h<c?-1:0}},e.prototype.apply=function(t){if(P(t,dt)){this._shell.apply(t);for(var e=0;e<this._holes.length;e++)this._holes[e].apply(t)}else if(P(t,Ut)){if(this._shell.apply(t),!t.isDone())for(var n=0;n<this._holes.length&&(this._holes[n].apply(t),!t.isDone());n++);t.isGeometryChanged()&&this.geometryChanged()}else if(P(t,zt))t.filter(this);else if(P(t,ut)){t.filter(this),this._shell.apply(t);for(var r=0;r<this._holes.length;r++)this._holes[r].apply(t)}},e.prototype.getBoundary=function(){if(this.isEmpty())return this.getFactory().createMultiLineString();var t=new Array(this._holes.length+1).fill(null);t[0]=this._shell;for(var e=0;e<this._holes.length;e++)t[e+1]=this._holes[e];return t.length<=1?this.getFactory().createLinearRing(t[0].getCoordinateSequence()):this.getFactory().createMultiLineString(t)},e.prototype.clone=function(){var e=t.prototype.clone.call(this);e._shell=this._shell.clone(),e._holes=new Array(this._holes.length).fill(null);for(var n=0;n<this._holes.length;n++)e._holes[n]=this._holes[n].clone();return e},e.prototype.getGeometryType=function(){return"Polygon"},e.prototype.copy=function(){for(var t=this._shell.copy(),n=new Array(this._holes.length).fill(null),r=0;r<n.length;r++)n[r]=this._holes[r].copy();return new e(t,n,this._factory)},e.prototype.getExteriorRing=function(){return this._shell},e.prototype.isEmpty=function(){return this._shell.isEmpty()},e.prototype.getInteriorRingN=function(t){return this._holes[t]},e.prototype.interfaces_=function(){return[Jt]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return-0x307ffefd8dc97200},Object.defineProperties(e,n),e}(ct),te=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return ct.SORTINDEX_MULTIPOINT},e.prototype.isValid=function(){return!0},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];return!!this.isEquivalentClass(e)&&t.prototype.equalsExact.call(this,e,n)}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.getCoordinate=function(){if(1===arguments.length){var e=arguments[0];return this._geometries[e].getCoordinate()}return t.prototype.getCoordinate.apply(this,arguments)},e.prototype.getBoundaryDimension=function(){return Dt.FALSE},e.prototype.getDimension=function(){return 0},e.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},e.prototype.getGeometryType=function(){return"MultiPoint"},e.prototype.copy=function(){for(var t=new Array(this._geometries.length).fill(null),n=0;n<t.length;n++)t[n]=this._geometries[n].copy();return new e(t,this._factory)},e.prototype.interfaces_=function(){return[Zt]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return-0x6fb1ed4162e0fc00},Object.defineProperties(e,n),e}(Bt),ee=function(t){function e(e,n){e instanceof S&&n instanceof me&&(e=n.getCoordinateSequenceFactory().create(e)),t.call(this,e,n),this.validateConstruction()}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={MINIMUM_VALID_SIZE:{configurable:!0},serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return ct.SORTINDEX_LINEARRING},e.prototype.getBoundaryDimension=function(){return Dt.FALSE},e.prototype.isClosed=function(){return!!this.isEmpty()||t.prototype.isClosed.call(this)},e.prototype.reverse=function(){var t=this._points.copy();return Ht.reverse(t),this.getFactory().createLinearRing(t)},e.prototype.validateConstruction=function(){if(!this.isEmpty()&&!t.prototype.isClosed.call(this))throw new v("Points of LinearRing do not form a closed linestring");if(this.getCoordinateSequence().size()>=1&&this.getCoordinateSequence().size()<e.MINIMUM_VALID_SIZE)throw new v("Invalid number of points in LinearRing (found "+this.getCoordinateSequence().size()+" - must be 0 or >= 4)")},e.prototype.getGeometryType=function(){return"LinearRing"},e.prototype.copy=function(){return new e(this._points.copy(),this._factory)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},n.MINIMUM_VALID_SIZE.get=function(){return 4},n.serialVersionUID.get=function(){return-0x3b229e262367a600},Object.defineProperties(e,n),e}(Kt),ne=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return ct.SORTINDEX_MULTIPOLYGON},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];return!!this.isEquivalentClass(e)&&t.prototype.equalsExact.call(this,e,n)}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.getBoundaryDimension=function(){return 1},e.prototype.getDimension=function(){return 2},e.prototype.reverse=function(){for(var t=this._geometries.length,e=new Array(t).fill(null),n=0;n<this._geometries.length;n++)e[n]=this._geometries[n].reverse();return this.getFactory().createMultiPolygon(e)},e.prototype.getBoundary=function(){if(this.isEmpty())return this.getFactory().createMultiLineString();for(var t=new Et,e=0;e<this._geometries.length;e++)for(var n=this._geometries[e].getBoundary(),r=0;r<n.getNumGeometries();r++)t.add(n.getGeometryN(r));var i=new Array(t.size()).fill(null);return this.getFactory().createMultiLineString(t.toArray(i))},e.prototype.getGeometryType=function(){return"MultiPolygon"},e.prototype.copy=function(){for(var t=new Array(this._geometries.length).fill(null),n=0;n<t.length;n++)t[n]=this._geometries[n].copy();return new e(t,this._factory)},e.prototype.interfaces_=function(){return[Jt]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return-0x7a5aa1369171980},Object.defineProperties(e,n),e}(Bt),re=function(t){this._factory=t||null,this._isUserDataCopied=!1},ie={NoOpGeometryOperation:{configurable:!0},CoordinateOperation:{configurable:!0},CoordinateSequenceOperation:{configurable:!0}};re.prototype.setCopyUserData=function(t){this._isUserDataCopied=t},re.prototype.edit=function(t,e){if(null===t)return null;var n=this.editInternal(t,e);return this._isUserDataCopied&&n.setUserData(t.getUserData()),n},re.prototype.editInternal=function(t,e){return null===this._factory&&(this._factory=t.getFactory()),t instanceof Bt?this.editGeometryCollection(t,e):t instanceof Qt?this.editPolygon(t,e):t instanceof $t||t instanceof Kt?e.edit(t,this._factory):(et.shouldNeverReachHere("Unsupported Geometry class: "+t.getClass().getName()),null)},re.prototype.editGeometryCollection=function(t,e){for(var n=e.edit(t,this._factory),r=new Et,i=0;i<n.getNumGeometries();i++){var o=this.edit(n.getGeometryN(i),e);null===o||o.isEmpty()||r.add(o)}return n.getClass()===te?this._factory.createMultiPoint(r.toArray([])):n.getClass()===Vt?this._factory.createMultiLineString(r.toArray([])):n.getClass()===ne?this._factory.createMultiPolygon(r.toArray([])):this._factory.createGeometryCollection(r.toArray([]))},re.prototype.editPolygon=function(t,e){var n=e.edit(t,this._factory);if(null===n&&(n=this._factory.createPolygon(null)),n.isEmpty())return n;var r=this.edit(n.getExteriorRing(),e);if(null===r||r.isEmpty())return this._factory.createPolygon();for(var i=new Et,o=0;o<n.getNumInteriorRing();o++){var a=this.edit(n.getInteriorRingN(o),e);null===a||a.isEmpty()||i.add(a)}return this._factory.createPolygon(r,i.toArray([]))},re.prototype.interfaces_=function(){return[]},re.prototype.getClass=function(){return re},re.GeometryEditorOperation=function(){},ie.NoOpGeometryOperation.get=function(){return oe},ie.CoordinateOperation.get=function(){return ae},ie.CoordinateSequenceOperation.get=function(){return se},Object.defineProperties(re,ie);var oe=function(){};oe.prototype.edit=function(t,e){return t},oe.prototype.interfaces_=function(){return[re.GeometryEditorOperation]},oe.prototype.getClass=function(){return oe};var ae=function(){};ae.prototype.edit=function(t,e){var n=this.editCoordinates(t.getCoordinates(),t);return null===n?t:t instanceof ee?e.createLinearRing(n):t instanceof Kt?e.createLineString(n):t instanceof $t?n.length>0?e.createPoint(n[0]):e.createPoint():t},ae.prototype.interfaces_=function(){return[re.GeometryEditorOperation]},ae.prototype.getClass=function(){return ae};var se=function(){};se.prototype.edit=function(t,e){return t instanceof ee?e.createLinearRing(this.edit(t.getCoordinateSequence(),t)):t instanceof Kt?e.createLineString(this.edit(t.getCoordinateSequence(),t)):t instanceof $t?e.createPoint(this.edit(t.getCoordinateSequence(),t)):t},se.prototype.interfaces_=function(){return[re.GeometryEditorOperation]},se.prototype.getClass=function(){return se};var le=function(){if(this._dimension=3,this._coordinates=null,1===arguments.length){if(arguments[0]instanceof Array)this._coordinates=arguments[0],this._dimension=3;else if(Number.isInteger(arguments[0])){var t=arguments[0];this._coordinates=new Array(t).fill(null);for(var e=0;e<t;e++)this._coordinates[e]=new S}else if(P(arguments[0],z)){var n=arguments[0];if(null===n)return this._coordinates=new Array(0).fill(null),null;this._dimension=n.getDimension(),this._coordinates=new Array(n.size()).fill(null);for(var r=0;r<this._coordinates.length;r++)this._coordinates[r]=n.getCoordinateCopy(r)}}else if(2===arguments.length)if(arguments[0]instanceof Array&&Number.isInteger(arguments[1])){var i=arguments[0],o=arguments[1];this._coordinates=i,this._dimension=o,null===i&&(this._coordinates=new Array(0).fill(null))}else if(Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var a=arguments[0],s=arguments[1];this._coordinates=new Array(a).fill(null),this._dimension=s;for(var l=0;l<a;l++)this._coordinates[l]=new S}},ue={serialVersionUID:{configurable:!0}};le.prototype.setOrdinate=function(t,e,n){switch(e){case z.X:this._coordinates[t].x=n;break;case z.Y:this._coordinates[t].y=n;break;case z.Z:this._coordinates[t].z=n;break;default:throw new v("invalid ordinateIndex")}},le.prototype.size=function(){return this._coordinates.length},le.prototype.getOrdinate=function(t,e){switch(e){case z.X:return this._coordinates[t].x;case z.Y:return this._coordinates[t].y;case z.Z:return this._coordinates[t].z}return _.NaN},le.prototype.getCoordinate=function(){if(1===arguments.length){var t=arguments[0];return this._coordinates[t]}if(2===arguments.length){var e=arguments[0],n=arguments[1];n.x=this._coordinates[e].x,n.y=this._coordinates[e].y,n.z=this._coordinates[e].z}},le.prototype.getCoordinateCopy=function(t){return new S(this._coordinates[t])},le.prototype.getDimension=function(){return this._dimension},le.prototype.getX=function(t){return this._coordinates[t].x},le.prototype.clone=function(){for(var t=new Array(this.size()).fill(null),e=0;e<this._coordinates.length;e++)t[e]=this._coordinates[e].clone();return new le(t,this._dimension)},le.prototype.expandEnvelope=function(t){for(var e=0;e<this._coordinates.length;e++)t.expandToInclude(this._coordinates[e]);return t},le.prototype.copy=function(){for(var t=new Array(this.size()).fill(null),e=0;e<this._coordinates.length;e++)t[e]=this._coordinates[e].copy();return new le(t,this._dimension)},le.prototype.toString=function(){if(this._coordinates.length>0){var t=new N(17*this._coordinates.length);t.append("("),t.append(this._coordinates[0]);for(var e=1;e<this._coordinates.length;e++)t.append(", "),t.append(this._coordinates[e]);return t.append(")"),t.toString()}return"()"},le.prototype.getY=function(t){return this._coordinates[t].y},le.prototype.toCoordinateArray=function(){return this._coordinates},le.prototype.interfaces_=function(){return[z,e]},le.prototype.getClass=function(){return le},ue.serialVersionUID.get=function(){return-0xcb44a778db18e00},Object.defineProperties(le,ue);var ce=function(){},he={serialVersionUID:{configurable:!0},instanceObject:{configurable:!0}};ce.prototype.readResolve=function(){return ce.instance()},ce.prototype.create=function(){if(1===arguments.length){if(arguments[0]instanceof Array){var t=arguments[0];return new le(t)}if(P(arguments[0],z)){var e=arguments[0];return new le(e)}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];return r>3&&(r=3),r<2?new le(n):new le(n,r)}},ce.prototype.interfaces_=function(){return[T,e]},ce.prototype.getClass=function(){return ce},ce.instance=function(){return ce.instanceObject},he.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00},he.instanceObject.get=function(){return new ce},Object.defineProperties(ce,he);var pe=function(t){function e(){t.call(this),this.map_=new Map}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return this.map_.get(t)||null},e.prototype.put=function(t,e){return this.map_.set(t,e),e},e.prototype.values=function(){for(var t=new Et,e=this.map_.values(),n=e.next();!n.done;)t.add(n.value),n=e.next();return t},e.prototype.entrySet=function(){var t=new Mt;return this.map_.entries().forEach((function(e){return t.add(e)})),t},e.prototype.size=function(){return this.map_.size()},e}(Pt),de=function t(){if(this._modelType=null,this._scale=null,0===arguments.length)this._modelType=t.FLOATING;else if(1===arguments.length)if(arguments[0]instanceof ge){var e=arguments[0];this._modelType=e,e===t.FIXED&&this.setScale(1)}else if("number"==typeof arguments[0]){var n=arguments[0];this._modelType=t.FIXED,this.setScale(n)}else if(arguments[0]instanceof t){var r=arguments[0];this._modelType=r._modelType,this._scale=r._scale}},fe={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}};de.prototype.equals=function(t){if(!(t instanceof de))return!1;var e=t;return this._modelType===e._modelType&&this._scale===e._scale},de.prototype.compareTo=function(t){var e=t,n=this.getMaximumSignificantDigits(),r=e.getMaximumSignificantDigits();return new j(n).compareTo(new j(r))},de.prototype.getScale=function(){return this._scale},de.prototype.isFloating=function(){return this._modelType===de.FLOATING||this._modelType===de.FLOATING_SINGLE},de.prototype.getType=function(){return this._modelType},de.prototype.toString=function(){var t="UNKNOWN";return this._modelType===de.FLOATING?t="Floating":this._modelType===de.FLOATING_SINGLE?t="Floating-Single":this._modelType===de.FIXED&&(t="Fixed (Scale="+this.getScale()+")"),t},de.prototype.makePrecise=function(){if("number"==typeof arguments[0]){var t=arguments[0];return _.isNaN(t)||this._modelType===de.FLOATING_SINGLE?t:this._modelType===de.FIXED?Math.round(t*this._scale)/this._scale:t}if(arguments[0]instanceof S){var e=arguments[0];if(this._modelType===de.FLOATING)return null;e.x=this.makePrecise(e.x),e.y=this.makePrecise(e.y)}},de.prototype.getMaximumSignificantDigits=function(){var t=16;return this._modelType===de.FLOATING?t=16:this._modelType===de.FLOATING_SINGLE?t=6:this._modelType===de.FIXED&&(t=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),t},de.prototype.setScale=function(t){this._scale=Math.abs(t)},de.prototype.interfaces_=function(){return[e,w]},de.prototype.getClass=function(){return de},de.mostPrecise=function(t,e){return t.compareTo(e)>=0?t:e},fe.serialVersionUID.get=function(){return 0x6bee6404e9a25c00},fe.maximumPreciseValue.get=function(){return 9007199254740992},Object.defineProperties(de,fe);var ge=function t(e){this._name=e||null,t.nameToTypeMap.put(e,this)},ye={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}};ge.prototype.readResolve=function(){return ge.nameToTypeMap.get(this._name)},ge.prototype.toString=function(){return this._name},ge.prototype.interfaces_=function(){return[e]},ge.prototype.getClass=function(){return ge},ye.serialVersionUID.get=function(){return-552860263173159e4},ye.nameToTypeMap.get=function(){return new pe},Object.defineProperties(ge,ye),de.Type=ge,de.FIXED=new ge("FIXED"),de.FLOATING=new ge("FLOATING"),de.FLOATING_SINGLE=new ge("FLOATING SINGLE");var me=function t(){this._precisionModel=new de,this._SRID=0,this._coordinateSequenceFactory=t.getDefaultCoordinateSequenceFactory(),0===arguments.length||(1===arguments.length?P(arguments[0],T)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof de&&(this._precisionModel=arguments[0]):2===arguments.length?(this._precisionModel=arguments[0],this._SRID=arguments[1]):3===arguments.length&&(this._precisionModel=arguments[0],this._SRID=arguments[1],this._coordinateSequenceFactory=arguments[2]))},ve={serialVersionUID:{configurable:!0}};me.prototype.toGeometry=function(t){return t.isNull()?this.createPoint(null):t.getMinX()===t.getMaxX()&&t.getMinY()===t.getMaxY()?this.createPoint(new S(t.getMinX(),t.getMinY())):t.getMinX()===t.getMaxX()||t.getMinY()===t.getMaxY()?this.createLineString([new S(t.getMinX(),t.getMinY()),new S(t.getMaxX(),t.getMaxY())]):this.createPolygon(this.createLinearRing([new S(t.getMinX(),t.getMinY()),new S(t.getMinX(),t.getMaxY()),new S(t.getMaxX(),t.getMaxY()),new S(t.getMaxX(),t.getMinY()),new S(t.getMinX(),t.getMinY())]),null)},me.prototype.createLineString=function(t){return t?t instanceof Array?new Kt(this.getCoordinateSequenceFactory().create(t),this):P(t,z)?new Kt(t,this):void 0:new Kt(this.getCoordinateSequenceFactory().create([]),this)},me.prototype.createMultiLineString=function(){if(0===arguments.length)return new Vt(null,this);if(1===arguments.length){var t=arguments[0];return new Vt(t,this)}},me.prototype.buildGeometry=function(t){for(var e=null,n=!1,r=!1,i=t.iterator();i.hasNext();){var o=i.next(),a=o.getClass();null===e&&(e=a),a!==e&&(n=!0),o.isGeometryCollectionOrDerived()&&(r=!0)}if(null===e)return this.createGeometryCollection();if(n||r)return this.createGeometryCollection(me.toGeometryArray(t));var s=t.iterator().next();if(t.size()>1){if(s instanceof Qt)return this.createMultiPolygon(me.toPolygonArray(t));if(s instanceof Kt)return this.createMultiLineString(me.toLineStringArray(t));if(s instanceof $t)return this.createMultiPoint(me.toPointArray(t));et.shouldNeverReachHere("Unhandled class: "+s.getClass().getName())}return s},me.prototype.createMultiPointFromCoords=function(t){return this.createMultiPoint(null!==t?this.getCoordinateSequenceFactory().create(t):null)},me.prototype.createPoint=function(){if(0===arguments.length)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof S){var t=arguments[0];return this.createPoint(null!==t?this.getCoordinateSequenceFactory().create([t]):null)}if(P(arguments[0],z)){var e=arguments[0];return new $t(e,this)}}},me.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory},me.prototype.createPolygon=function(){if(0===arguments.length)return new Qt(null,null,this);if(1===arguments.length){if(P(arguments[0],z)){var t=arguments[0];return this.createPolygon(this.createLinearRing(t))}if(arguments[0]instanceof Array){var e=arguments[0];return this.createPolygon(this.createLinearRing(e))}if(arguments[0]instanceof ee){var n=arguments[0];return this.createPolygon(n,null)}}else if(2===arguments.length){var r=arguments[0],i=arguments[1];return new Qt(r,i,this)}},me.prototype.getSRID=function(){return this._SRID},me.prototype.createGeometryCollection=function(){if(0===arguments.length)return new Bt(null,this);if(1===arguments.length){var t=arguments[0];return new Bt(t,this)}},me.prototype.createGeometry=function(t){return new re(this).edit(t,{edit:function(){if(2===arguments.length){var t=arguments[0];return this._coordinateSequenceFactory.create(t)}}})},me.prototype.getPrecisionModel=function(){return this._precisionModel},me.prototype.createLinearRing=function(){if(0===arguments.length)return this.createLinearRing(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof Array){var t=arguments[0];return this.createLinearRing(null!==t?this.getCoordinateSequenceFactory().create(t):null)}if(P(arguments[0],z)){var e=arguments[0];return new ee(e,this)}}},me.prototype.createMultiPolygon=function(){if(0===arguments.length)return new ne(null,this);if(1===arguments.length){var t=arguments[0];return new ne(t,this)}},me.prototype.createMultiPoint=function(){if(0===arguments.length)return new te(null,this);if(1===arguments.length){if(arguments[0]instanceof Array){var t=arguments[0];return new te(t,this)}if(arguments[0]instanceof Array){var e=arguments[0];return this.createMultiPoint(null!==e?this.getCoordinateSequenceFactory().create(e):null)}if(P(arguments[0],z)){var n=arguments[0];if(null===n)return this.createMultiPoint(new Array(0).fill(null));for(var r=new Array(n.size()).fill(null),i=0;i<n.size();i++){var o=this.getCoordinateSequenceFactory().create(1,n.getDimension());Ht.copy(n,i,o,0,1),r[i]=this.createPoint(o)}return this.createMultiPoint(r)}}},me.prototype.interfaces_=function(){return[e]},me.prototype.getClass=function(){return me},me.toMultiPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},me.toGeometryArray=function(t){if(null===t)return null;var e=new Array(t.size()).fill(null);return t.toArray(e)},me.getDefaultCoordinateSequenceFactory=function(){return ce.instance()},me.toMultiLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},me.toLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},me.toMultiPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},me.toLinearRingArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},me.toPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},me.toPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},me.createPointFromInternalCoord=function(t,e){return e.getPrecisionModel().makePrecise(t),e.getFactory().createPoint(t)},ve.serialVersionUID.get=function(){return-0x5ea75f2051eeb400},Object.defineProperties(me,ve);var _e=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],be=function(t){this.geometryFactory=t||new me};be.prototype.read=function(t){var e,n=(e="string"==typeof t?JSON.parse(t):t).type;if(!we[n])throw new Error("Unknown GeoJSON type: "+e.type);return-1!==_e.indexOf(n)?we[n].apply(this,[e.coordinates]):"GeometryCollection"===n?we[n].apply(this,[e.geometries]):we[n].apply(this,[e])},be.prototype.write=function(t){var e=t.getGeometryType();if(!xe[e])throw new Error("Geometry is not supported");return xe[e].apply(this,[t])};var we={Feature:function(t){var e={};for(var n in t)e[n]=t[n];if(t.geometry){var r=t.geometry.type;if(!we[r])throw new Error("Unknown GeoJSON type: "+t.type);e.geometry=this.read(t.geometry)}return t.bbox&&(e.bbox=we.bbox.apply(this,[t.bbox])),e},FeatureCollection:function(t){var e={};if(t.features){e.features=[];for(var n=0;n<t.features.length;++n)e.features.push(this.read(t.features[n]))}return t.bbox&&(e.bbox=this.parse.bbox.apply(this,[t.bbox])),e},coordinates:function(t){for(var e=[],n=0;n<t.length;++n){var r=t[n];e.push(new S(r[0],r[1]))}return e},bbox:function(t){return this.geometryFactory.createLinearRing([new S(t[0],t[1]),new S(t[2],t[1]),new S(t[2],t[3]),new S(t[0],t[3]),new S(t[0],t[1])])},Point:function(t){var e=new S(t[0],t[1]);return this.geometryFactory.createPoint(e)},MultiPoint:function(t){for(var e=[],n=0;n<t.length;++n)e.push(we.Point.apply(this,[t[n]]));return this.geometryFactory.createMultiPoint(e)},LineString:function(t){var e=we.coordinates.apply(this,[t]);return this.geometryFactory.createLineString(e)},MultiLineString:function(t){for(var e=[],n=0;n<t.length;++n)e.push(we.LineString.apply(this,[t[n]]));return this.geometryFactory.createMultiLineString(e)},Polygon:function(t){for(var e=we.coordinates.apply(this,[t[0]]),n=this.geometryFactory.createLinearRing(e),r=[],i=1;i<t.length;++i){var o=t[i],a=we.coordinates.apply(this,[o]),s=this.geometryFactory.createLinearRing(a);r.push(s)}return this.geometryFactory.createPolygon(n,r)},MultiPolygon:function(t){for(var e=[],n=0;n<t.length;++n){var r=t[n];e.push(we.Polygon.apply(this,[r]))}return this.geometryFactory.createMultiPolygon(e)},GeometryCollection:function(t){for(var e=[],n=0;n<t.length;++n){var r=t[n];e.push(this.read(r))}return this.geometryFactory.createGeometryCollection(e)}},xe={coordinate:function(t){return[t.x,t.y]},Point:function(t){return{type:"Point",coordinates:xe.coordinate.apply(this,[t.getCoordinate()])}},MultiPoint:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var r=t._geometries[n],i=xe.Point.apply(this,[r]);e.push(i.coordinates)}return{type:"MultiPoint",coordinates:e}},LineString:function(t){for(var e=[],n=t.getCoordinates(),r=0;r<n.length;++r){var i=n[r];e.push(xe.coordinate.apply(this,[i]))}return{type:"LineString",coordinates:e}},MultiLineString:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var r=t._geometries[n],i=xe.LineString.apply(this,[r]);e.push(i.coordinates)}return{type:"MultiLineString",coordinates:e}},Polygon:function(t){var e=[],n=xe.LineString.apply(this,[t._shell]);e.push(n.coordinates);for(var r=0;r<t._holes.length;++r){var i=t._holes[r],o=xe.LineString.apply(this,[i]);e.push(o.coordinates)}return{type:"Polygon",coordinates:e}},MultiPolygon:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var r=t._geometries[n],i=xe.Polygon.apply(this,[r]);e.push(i.coordinates)}return{type:"MultiPolygon",coordinates:e}},GeometryCollection:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var r=t._geometries[n],i=r.getGeometryType();e.push(xe[i].apply(this,[r]))}return{type:"GeometryCollection",geometries:e}}},Ee=function(t){this.geometryFactory=t||new me,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new be(this.geometryFactory)};Ee.prototype.read=function(t){var e=this.parser.read(t);return this.precisionModel.getType()===de.FIXED&&this.reducePrecision(e),e},Ee.prototype.reducePrecision=function(t){var e,n;if(t.coordinate)this.precisionModel.makePrecise(t.coordinate);else if(t.points)for(e=0,n=t.points.length;e<n;e++)this.precisionModel.makePrecise(t.points[e]);else if(t.geometries)for(e=0,n=t.geometries.length;e<n;e++)this.reducePrecision(t.geometries[e])};var Se=function(){this.parser=new be(this.geometryFactory)};Se.prototype.write=function(t){return this.parser.write(t)};var Oe=function(){},Ce={ON:{configurable:!0},LEFT:{configurable:!0},RIGHT:{configurable:!0}};Oe.prototype.interfaces_=function(){return[]},Oe.prototype.getClass=function(){return Oe},Oe.opposite=function(t){return t===Oe.LEFT?Oe.RIGHT:t===Oe.RIGHT?Oe.LEFT:t},Ce.ON.get=function(){return 0},Ce.LEFT.get=function(){return 1},Ce.RIGHT.get=function(){return 2},Object.defineProperties(Oe,Ce),(g.prototype=new Error).name="EmptyStackException",(y.prototype=new xt).add=function(t){return this.array_.push(t),!0},y.prototype.get=function(t){if(t<0||t>=this.size())throw new Error;return this.array_[t]},y.prototype.push=function(t){return this.array_.push(t),t},y.prototype.pop=function(t){if(0===this.array_.length)throw new g;return this.array_.pop()},y.prototype.peek=function(){if(0===this.array_.length)throw new g;return this.array_[this.array_.length-1]},y.prototype.empty=function(){return 0===this.array_.length},y.prototype.isEmpty=function(){return this.empty()},y.prototype.search=function(t){return this.array_.indexOf(t)},y.prototype.size=function(){return this.array_.length},y.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e<n;e++)t.push(this.array_[e]);return t};var Te=function(){this._minIndex=-1,this._minCoord=null,this._minDe=null,this._orientedDe=null};Te.prototype.getCoordinate=function(){return this._minCoord},Te.prototype.getRightmostSide=function(t,e){var n=this.getRightmostSideOfSegment(t,e);return n<0&&(n=this.getRightmostSideOfSegment(t,e-1)),n<0&&(this._minCoord=null,this.checkForRightmostCoordinate(t)),n},Te.prototype.findRightmostEdgeAtVertex=function(){var t=this._minDe.getEdge().getCoordinates();et.isTrue(this._minIndex>0&&this._minIndex<t.length,"rightmost point expected to be interior vertex of edge");var e=t[this._minIndex-1],n=t[this._minIndex+1],r=st.computeOrientation(this._minCoord,n,e),i=!1;(e.y<this._minCoord.y&&n.y<this._minCoord.y&&r===st.COUNTERCLOCKWISE||e.y>this._minCoord.y&&n.y>this._minCoord.y&&r===st.CLOCKWISE)&&(i=!0),i&&(this._minIndex=this._minIndex-1)},Te.prototype.getRightmostSideOfSegment=function(t,e){var n=t.getEdge().getCoordinates();if(e<0||e+1>=n.length)return-1;if(n[e].y===n[e+1].y)return-1;var r=Oe.LEFT;return n[e].y<n[e+1].y&&(r=Oe.RIGHT),r},Te.prototype.getEdge=function(){return this._orientedDe},Te.prototype.checkForRightmostCoordinate=function(t){for(var e=t.getEdge().getCoordinates(),n=0;n<e.length-1;n++)(null===this._minCoord||e[n].x>this._minCoord.x)&&(this._minDe=t,this._minIndex=n,this._minCoord=e[n])},Te.prototype.findRightmostEdgeAtNode=function(){var t=this._minDe.getNode().getEdges();this._minDe=t.getRightmostEdge(),this._minDe.isForward()||(this._minDe=this._minDe.getSym(),this._minIndex=this._minDe.getEdge().getCoordinates().length-1)},Te.prototype.findEdge=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();n.isForward()&&this.checkForRightmostCoordinate(n)}et.isTrue(0!==this._minIndex||this._minCoord.equals(this._minDe.getCoordinate()),"inconsistency in rightmost processing"),0===this._minIndex?this.findRightmostEdgeAtNode():this.findRightmostEdgeAtVertex(),this._orientedDe=this._minDe,this.getRightmostSide(this._minDe,this._minIndex)===Oe.LEFT&&(this._orientedDe=this._minDe.getSym())},Te.prototype.interfaces_=function(){return[]},Te.prototype.getClass=function(){return Te};var Ie=function(t){function e(n,r){t.call(this,e.msgWithCoord(n,r)),this.pt=r?new S(r):null,this.name="TopologyException"}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getCoordinate=function(){return this.pt},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.msgWithCoord=function(t,e){return e?t:t+" [ "+e+" ]"},e}(Q),Le=function(){this.array_=[]};Le.prototype.addLast=function(t){this.array_.push(t)},Le.prototype.removeFirst=function(){return this.array_.shift()},Le.prototype.isEmpty=function(){return 0===this.array_.length};var Pe=function(){this._finder=null,this._dirEdgeList=new Et,this._nodes=new Et,this._rightMostCoord=null,this._env=null,this._finder=new Te};Pe.prototype.clearVisitedEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();)t.next().setVisited(!1)},Pe.prototype.getRightmostCoordinate=function(){return this._rightMostCoord},Pe.prototype.computeNodeDepth=function(t){for(var e=null,n=t.getEdges().iterator();n.hasNext();){var r=n.next();if(r.isVisited()||r.getSym().isVisited()){e=r;break}}if(null===e)throw new Ie("unable to find edge to compute depths at "+t.getCoordinate());t.getEdges().computeDepths(e);for(var i=t.getEdges().iterator();i.hasNext();){var o=i.next();o.setVisited(!0),this.copySymDepths(o)}},Pe.prototype.computeDepth=function(t){this.clearVisitedEdges();var e=this._finder.getEdge();e.setEdgeDepths(Oe.RIGHT,t),this.copySymDepths(e),this.computeDepths(e)},Pe.prototype.create=function(t){this.addReachable(t),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()},Pe.prototype.findResultEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();e.getDepth(Oe.RIGHT)>=1&&e.getDepth(Oe.LEFT)<=0&&!e.isInteriorAreaEdge()&&e.setInResult(!0)}},Pe.prototype.computeDepths=function(t){var e=new Mt,n=new Le,r=t.getNode();for(n.addLast(r),e.add(r),t.setVisited(!0);!n.isEmpty();){var i=n.removeFirst();e.add(i),this.computeNodeDepth(i);for(var o=i.getEdges().iterator();o.hasNext();){var a=o.next().getSym();if(!a.isVisited()){var s=a.getNode();e.contains(s)||(n.addLast(s),e.add(s))}}}},Pe.prototype.compareTo=function(t){var e=t;return this._rightMostCoord.x<e._rightMostCoord.x?-1:this._rightMostCoord.x>e._rightMostCoord.x?1:0},Pe.prototype.getEnvelope=function(){if(null===this._env){for(var t=new X,e=this._dirEdgeList.iterator();e.hasNext();)for(var n=e.next().getEdge().getCoordinates(),r=0;r<n.length-1;r++)t.expandToInclude(n[r]);this._env=t}return this._env},Pe.prototype.addReachable=function(t){var e=new y;for(e.add(t);!e.empty();){var n=e.pop();this.add(n,e)}},Pe.prototype.copySymDepths=function(t){var e=t.getSym();e.setDepth(Oe.LEFT,t.getDepth(Oe.RIGHT)),e.setDepth(Oe.RIGHT,t.getDepth(Oe.LEFT))},Pe.prototype.add=function(t,e){t.setVisited(!0),this._nodes.add(t);for(var n=t.getEdges().iterator();n.hasNext();){var r=n.next();this._dirEdgeList.add(r);var i=r.getSym().getNode();i.isVisited()||e.push(i)}},Pe.prototype.getNodes=function(){return this._nodes},Pe.prototype.getDirectedEdges=function(){return this._dirEdgeList},Pe.prototype.interfaces_=function(){return[w]},Pe.prototype.getClass=function(){return Pe};var Re=function t(){if(this.location=null,1===arguments.length){if(arguments[0]instanceof Array){var e=arguments[0];this.init(e.length)}else if(Number.isInteger(arguments[0])){var n=arguments[0];this.init(1),this.location[Oe.ON]=n}else if(arguments[0]instanceof t){var r=arguments[0];if(this.init(r.location.length),null!==r)for(var i=0;i<this.location.length;i++)this.location[i]=r.location[i]}}else if(3===arguments.length){var o=arguments[0],a=arguments[1],s=arguments[2];this.init(3),this.location[Oe.ON]=o,this.location[Oe.LEFT]=a,this.location[Oe.RIGHT]=s}};Re.prototype.setAllLocations=function(t){for(var e=0;e<this.location.length;e++)this.location[e]=t},Re.prototype.isNull=function(){for(var t=0;t<this.location.length;t++)if(this.location[t]!==I.NONE)return!1;return!0},Re.prototype.setAllLocationsIfNull=function(t){for(var e=0;e<this.location.length;e++)this.location[e]===I.NONE&&(this.location[e]=t)},Re.prototype.isLine=function(){return 1===this.location.length},Re.prototype.merge=function(t){if(t.location.length>this.location.length){var e=new Array(3).fill(null);e[Oe.ON]=this.location[Oe.ON],e[Oe.LEFT]=I.NONE,e[Oe.RIGHT]=I.NONE,this.location=e}for(var n=0;n<this.location.length;n++)this.location[n]===I.NONE&&n<t.location.length&&(this.location[n]=t.location[n])},Re.prototype.getLocations=function(){return this.location},Re.prototype.flip=function(){if(this.location.length<=1)return null;var t=this.location[Oe.LEFT];this.location[Oe.LEFT]=this.location[Oe.RIGHT],this.location[Oe.RIGHT]=t},Re.prototype.toString=function(){var t=new N;return this.location.length>1&&t.append(I.toLocationSymbol(this.location[Oe.LEFT])),t.append(I.toLocationSymbol(this.location[Oe.ON])),this.location.length>1&&t.append(I.toLocationSymbol(this.location[Oe.RIGHT])),t.toString()},Re.prototype.setLocations=function(t,e,n){this.location[Oe.ON]=t,this.location[Oe.LEFT]=e,this.location[Oe.RIGHT]=n},Re.prototype.get=function(t){return t<this.location.length?this.location[t]:I.NONE},Re.prototype.isArea=function(){return this.location.length>1},Re.prototype.isAnyNull=function(){for(var t=0;t<this.location.length;t++)if(this.location[t]===I.NONE)return!0;return!1},Re.prototype.setLocation=function(){if(1===arguments.length){var t=arguments[0];this.setLocation(Oe.ON,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.location[e]=n}},Re.prototype.init=function(t){this.location=new Array(t).fill(null),this.setAllLocations(I.NONE)},Re.prototype.isEqualOnSide=function(t,e){return this.location[e]===t.location[e]},Re.prototype.allPositionsEqual=function(t){for(var e=0;e<this.location.length;e++)if(this.location[e]!==t)return!1;return!0},Re.prototype.interfaces_=function(){return[]},Re.prototype.getClass=function(){return Re};var Me=function t(){if(this.elt=new Array(2).fill(null),1===arguments.length){if(Number.isInteger(arguments[0])){var e=arguments[0];this.elt[0]=new Re(e),this.elt[1]=new Re(e)}else if(arguments[0]instanceof t){var n=arguments[0];this.elt[0]=new Re(n.elt[0]),this.elt[1]=new Re(n.elt[1])}}else if(2===arguments.length){var r=arguments[0],i=arguments[1];this.elt[0]=new Re(I.NONE),this.elt[1]=new Re(I.NONE),this.elt[r].setLocation(i)}else if(3===arguments.length){var o=arguments[0],a=arguments[1],s=arguments[2];this.elt[0]=new Re(o,a,s),this.elt[1]=new Re(o,a,s)}else if(4===arguments.length){var l=arguments[0],u=arguments[1],c=arguments[2],h=arguments[3];this.elt[0]=new Re(I.NONE,I.NONE,I.NONE),this.elt[1]=new Re(I.NONE,I.NONE,I.NONE),this.elt[l].setLocations(u,c,h)}};Me.prototype.getGeometryCount=function(){var t=0;return this.elt[0].isNull()||t++,this.elt[1].isNull()||t++,t},Me.prototype.setAllLocations=function(t,e){this.elt[t].setAllLocations(e)},Me.prototype.isNull=function(t){return this.elt[t].isNull()},Me.prototype.setAllLocationsIfNull=function(){if(1===arguments.length){var t=arguments[0];this.setAllLocationsIfNull(0,t),this.setAllLocationsIfNull(1,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.elt[e].setAllLocationsIfNull(n)}},Me.prototype.isLine=function(t){return this.elt[t].isLine()},Me.prototype.merge=function(t){for(var e=0;e<2;e++)null===this.elt[e]&&null!==t.elt[e]?this.elt[e]=new Re(t.elt[e]):this.elt[e].merge(t.elt[e])},Me.prototype.flip=function(){this.elt[0].flip(),this.elt[1].flip()},Me.prototype.getLocation=function(){if(1===arguments.length){var t=arguments[0];return this.elt[t].get(Oe.ON)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return this.elt[e].get(n)}},Me.prototype.toString=function(){var t=new N;return null!==this.elt[0]&&(t.append("A:"),t.append(this.elt[0].toString())),null!==this.elt[1]&&(t.append(" B:"),t.append(this.elt[1].toString())),t.toString()},Me.prototype.isArea=function(){if(0===arguments.length)return this.elt[0].isArea()||this.elt[1].isArea();if(1===arguments.length){var t=arguments[0];return this.elt[t].isArea()}},Me.prototype.isAnyNull=function(t){return this.elt[t].isAnyNull()},Me.prototype.setLocation=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];this.elt[t].setLocation(Oe.ON,e)}else if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];this.elt[n].setLocation(r,i)}},Me.prototype.isEqualOnSide=function(t,e){return this.elt[0].isEqualOnSide(t.elt[0],e)&&this.elt[1].isEqualOnSide(t.elt[1],e)},Me.prototype.allPositionsEqual=function(t,e){return this.elt[t].allPositionsEqual(e)},Me.prototype.toLine=function(t){this.elt[t].isArea()&&(this.elt[t]=new Re(this.elt[t].location[0]))},Me.prototype.interfaces_=function(){return[]},Me.prototype.getClass=function(){return Me},Me.toLineLabel=function(t){for(var e=new Me(I.NONE),n=0;n<2;n++)e.setLocation(n,t.getLocation(n));return e};var Ne=function(){this._startDe=null,this._maxNodeDegree=-1,this._edges=new Et,this._pts=new Et,this._label=new Me(I.NONE),this._ring=null,this._isHole=null,this._shell=null,this._holes=new Et,this._geometryFactory=null;var t=arguments[0],e=arguments[1];this._geometryFactory=e,this.computePoints(t),this.computeRing()};Ne.prototype.computeRing=function(){if(null!==this._ring)return null;for(var t=new Array(this._pts.size()).fill(null),e=0;e<this._pts.size();e++)t[e]=this._pts.get(e);this._ring=this._geometryFactory.createLinearRing(t),this._isHole=st.isCCW(this._ring.getCoordinates())},Ne.prototype.isIsolated=function(){return 1===this._label.getGeometryCount()},Ne.prototype.computePoints=function(t){this._startDe=t;var e=t,n=!0;do{if(null===e)throw new Ie("Found null DirectedEdge");if(e.getEdgeRing()===this)throw new Ie("Directed Edge visited twice during ring-building at "+e.getCoordinate());this._edges.add(e);var r=e.getLabel();et.isTrue(r.isArea()),this.mergeLabel(r),this.addPoints(e.getEdge(),e.isForward(),n),n=!1,this.setEdgeRing(e,this),e=this.getNext(e)}while(e!==this._startDe)},Ne.prototype.getLinearRing=function(){return this._ring},Ne.prototype.getCoordinate=function(t){return this._pts.get(t)},Ne.prototype.computeMaxNodeDegree=function(){this._maxNodeDegree=0;var t=this._startDe;do{var e=t.getNode().getEdges().getOutgoingDegree(this);e>this._maxNodeDegree&&(this._maxNodeDegree=e),t=this.getNext(t)}while(t!==this._startDe);this._maxNodeDegree*=2},Ne.prototype.addPoints=function(t,e,n){var r=t.getCoordinates();if(e){var i=1;n&&(i=0);for(var o=i;o<r.length;o++)this._pts.add(r[o])}else{var a=r.length-2;n&&(a=r.length-1);for(var s=a;s>=0;s--)this._pts.add(r[s])}},Ne.prototype.isHole=function(){return this._isHole},Ne.prototype.setInResult=function(){var t=this._startDe;do{t.getEdge().setInResult(!0),t=t.getNext()}while(t!==this._startDe)},Ne.prototype.containsPoint=function(t){var e=this.getLinearRing();if(!e.getEnvelopeInternal().contains(t))return!1;if(!st.isPointInRing(t,e.getCoordinates()))return!1;for(var n=this._holes.iterator();n.hasNext();)if(n.next().containsPoint(t))return!1;return!0},Ne.prototype.addHole=function(t){this._holes.add(t)},Ne.prototype.isShell=function(){return null===this._shell},Ne.prototype.getLabel=function(){return this._label},Ne.prototype.getEdges=function(){return this._edges},Ne.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree},Ne.prototype.getShell=function(){return this._shell},Ne.prototype.mergeLabel=function(){if(1===arguments.length){var t=arguments[0];this.mergeLabel(t,0),this.mergeLabel(t,1)}else if(2===arguments.length){var e=arguments[0],n=arguments[1],r=e.getLocation(n,Oe.RIGHT);if(r===I.NONE)return null;if(this._label.getLocation(n)===I.NONE)return this._label.setLocation(n,r),null}},Ne.prototype.setShell=function(t){this._shell=t,null!==t&&t.addHole(this)},Ne.prototype.toPolygon=function(t){for(var e=new Array(this._holes.size()).fill(null),n=0;n<this._holes.size();n++)e[n]=this._holes.get(n).getLinearRing();return t.createPolygon(this.getLinearRing(),e)},Ne.prototype.interfaces_=function(){return[]},Ne.prototype.getClass=function(){return Ne};var je=function(t){function e(){var e=arguments[0],n=arguments[1];t.call(this,e,n)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setEdgeRing=function(t,e){t.setMinEdgeRing(e)},e.prototype.getNext=function(t){return t.getNextMin()},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Ne),Ae=function(t){function e(){var e=arguments[0],n=arguments[1];t.call(this,e,n)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.buildMinimalRings=function(){var t=new Et,e=this._startDe;do{if(null===e.getMinEdgeRing()){var n=new je(e,this._geometryFactory);t.add(n)}e=e.getNext()}while(e!==this._startDe);return t},e.prototype.setEdgeRing=function(t,e){t.setEdgeRing(e)},e.prototype.linkDirectedEdgesForMinimalEdgeRings=function(){var t=this._startDe;do{t.getNode().getEdges().linkMinimalDirectedEdges(this),t=t.getNext()}while(t!==this._startDe)},e.prototype.getNext=function(t){return t.getNext()},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Ne),ke=function(){if(this._label=null,this._isInResult=!1,this._isCovered=!1,this._isCoveredSet=!1,this._isVisited=!1,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this._label=t}};ke.prototype.setVisited=function(t){this._isVisited=t},ke.prototype.setInResult=function(t){this._isInResult=t},ke.prototype.isCovered=function(){return this._isCovered},ke.prototype.isCoveredSet=function(){return this._isCoveredSet},ke.prototype.setLabel=function(t){this._label=t},ke.prototype.getLabel=function(){return this._label},ke.prototype.setCovered=function(t){this._isCovered=t,this._isCoveredSet=!0},ke.prototype.updateIM=function(t){et.isTrue(this._label.getGeometryCount()>=2,"found partial label"),this.computeIM(t)},ke.prototype.isInResult=function(){return this._isInResult},ke.prototype.isVisited=function(){return this._isVisited},ke.prototype.interfaces_=function(){return[]},ke.prototype.getClass=function(){return ke};var Fe=function(t){function e(){t.call(this),this._coord=null,this._edges=null;var e=arguments[0],n=arguments[1];this._coord=e,this._edges=n,this._label=new Me(0,I.NONE)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isIncidentEdgeInResult=function(){for(var t=this.getEdges().getEdges().iterator();t.hasNext();)if(t.next().getEdge().isInResult())return!0;return!1},e.prototype.isIsolated=function(){return 1===this._label.getGeometryCount()},e.prototype.getCoordinate=function(){return this._coord},e.prototype.print=function(t){t.println("node "+this._coord+" lbl: "+this._label)},e.prototype.computeIM=function(t){},e.prototype.computeMergedLocation=function(t,e){var n=I.NONE;if(n=this._label.getLocation(e),!t.isNull(e)){var r=t.getLocation(e);n!==I.BOUNDARY&&(n=r)}return n},e.prototype.setLabel=function(){if(2!==arguments.length)return t.prototype.setLabel.apply(this,arguments);var e=arguments[0],n=arguments[1];null===this._label?this._label=new Me(e,n):this._label.setLocation(e,n)},e.prototype.getEdges=function(){return this._edges},e.prototype.mergeLabel=function(){if(arguments[0]instanceof e){var t=arguments[0];this.mergeLabel(t._label)}else if(arguments[0]instanceof Me)for(var n=arguments[0],r=0;r<2;r++){var i=this.computeMergedLocation(n,r);this._label.getLocation(r)===I.NONE&&this._label.setLocation(r,i)}},e.prototype.add=function(t){this._edges.insert(t),t.setNode(this)},e.prototype.setLabelBoundary=function(t){if(null===this._label)return null;var e=I.NONE;null!==this._label&&(e=this._label.getLocation(t));var n=null;switch(e){case I.BOUNDARY:n=I.INTERIOR;break;case I.INTERIOR:default:n=I.BOUNDARY}this._label.setLocation(t,n)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(ke),De=function(){this.nodeMap=new h,this.nodeFact=null;var t=arguments[0];this.nodeFact=t};De.prototype.find=function(t){return this.nodeMap.get(t)},De.prototype.addNode=function(){if(arguments[0]instanceof S){var t=arguments[0],e=this.nodeMap.get(t);return null===e&&(e=this.nodeFact.createNode(t),this.nodeMap.put(t,e)),e}if(arguments[0]instanceof Fe){var n=arguments[0],r=this.nodeMap.get(n.getCoordinate());return null===r?(this.nodeMap.put(n.getCoordinate(),n),n):(r.mergeLabel(n),r)}},De.prototype.print=function(t){for(var e=this.iterator();e.hasNext();)e.next().print(t)},De.prototype.iterator=function(){return this.nodeMap.values().iterator()},De.prototype.values=function(){return this.nodeMap.values()},De.prototype.getBoundaryNodes=function(t){for(var e=new Et,n=this.iterator();n.hasNext();){var r=n.next();r.getLabel().getLocation(t)===I.BOUNDARY&&e.add(r)}return e},De.prototype.add=function(t){var e=t.getCoordinate();this.addNode(e).add(t)},De.prototype.interfaces_=function(){return[]},De.prototype.getClass=function(){return De};var Ge=function(){},ze={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}};Ge.prototype.interfaces_=function(){return[]},Ge.prototype.getClass=function(){return Ge},Ge.isNorthern=function(t){return t===Ge.NE||t===Ge.NW},Ge.isOpposite=function(t,e){return t!==e&&2==(t-e+4)%4},Ge.commonHalfPlane=function(t,e){if(t===e)return t;if(2==(t-e+4)%4)return-1;var n=t<e?t:e;return 0===n&&3===(t>e?t:e)?3:n},Ge.isInHalfPlane=function(t,e){return e===Ge.SE?t===Ge.SE||t===Ge.SW:t===e||t===e+1},Ge.quadrant=function(){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var t=arguments[0],e=arguments[1];if(0===t&&0===e)throw new v("Cannot compute the quadrant for point ( "+t+", "+e+" )");return t>=0?e>=0?Ge.NE:Ge.SE:e>=0?Ge.NW:Ge.SW}if(arguments[0]instanceof S&&arguments[1]instanceof S){var n=arguments[0],r=arguments[1];if(r.x===n.x&&r.y===n.y)throw new v("Cannot compute the quadrant for two identical points "+n);return r.x>=n.x?r.y>=n.y?Ge.NE:Ge.SE:r.y>=n.y?Ge.NW:Ge.SW}},ze.NE.get=function(){return 0},ze.NW.get=function(){return 1},ze.SW.get=function(){return 2},ze.SE.get=function(){return 3},Object.defineProperties(Ge,ze);var Ue=function(){if(this._edge=null,this._label=null,this._node=null,this._p0=null,this._p1=null,this._dx=null,this._dy=null,this._quadrant=null,1===arguments.length){var t=arguments[0];this._edge=t}else if(3===arguments.length){var e=arguments[0],n=arguments[1],r=arguments[2];this._edge=e,this.init(n,r),this._label=null}else if(4===arguments.length){var i=arguments[0],o=arguments[1],a=arguments[2],s=arguments[3];this._edge=i,this.init(o,a),this._label=s}};Ue.prototype.compareDirection=function(t){return this._dx===t._dx&&this._dy===t._dy?0:this._quadrant>t._quadrant?1:this._quadrant<t._quadrant?-1:st.computeOrientation(t._p0,t._p1,this._p1)},Ue.prototype.getDy=function(){return this._dy},Ue.prototype.getCoordinate=function(){return this._p0},Ue.prototype.setNode=function(t){this._node=t},Ue.prototype.print=function(t){var e=Math.atan2(this._dy,this._dx),n=this.getClass().getName(),r=n.lastIndexOf("."),i=n.substring(r+1);t.print(" "+i+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+e+" "+this._label)},Ue.prototype.compareTo=function(t){var e=t;return this.compareDirection(e)},Ue.prototype.getDirectedCoordinate=function(){return this._p1},Ue.prototype.getDx=function(){return this._dx},Ue.prototype.getLabel=function(){return this._label},Ue.prototype.getEdge=function(){return this._edge},Ue.prototype.getQuadrant=function(){return this._quadrant},Ue.prototype.getNode=function(){return this._node},Ue.prototype.toString=function(){var t=Math.atan2(this._dy,this._dx),e=this.getClass().getName(),n=e.lastIndexOf(".");return" "+e.substring(n+1)+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+t+" "+this._label},Ue.prototype.computeLabel=function(t){},Ue.prototype.init=function(t,e){this._p0=t,this._p1=e,this._dx=e.x-t.x,this._dy=e.y-t.y,this._quadrant=Ge.quadrant(this._dx,this._dy),et.isTrue(!(0===this._dx&&0===this._dy),"EdgeEnd with identical endpoints found")},Ue.prototype.interfaces_=function(){return[w]},Ue.prototype.getClass=function(){return Ue};var Be=function(t){function e(){var e=arguments[0],n=arguments[1];if(t.call(this,e),this._isForward=null,this._isInResult=!1,this._isVisited=!1,this._sym=null,this._next=null,this._nextMin=null,this._edgeRing=null,this._minEdgeRing=null,this._depth=[0,-999,-999],this._isForward=n,n)this.init(e.getCoordinate(0),e.getCoordinate(1));else{var r=e.getNumPoints()-1;this.init(e.getCoordinate(r),e.getCoordinate(r-1))}this.computeDirectedLabel()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getNextMin=function(){return this._nextMin},e.prototype.getDepth=function(t){return this._depth[t]},e.prototype.setVisited=function(t){this._isVisited=t},e.prototype.computeDirectedLabel=function(){this._label=new Me(this._edge.getLabel()),this._isForward||this._label.flip()},e.prototype.getNext=function(){return this._next},e.prototype.setDepth=function(t,e){if(-999!==this._depth[t]&&this._depth[t]!==e)throw new Ie("assigned depths do not match",this.getCoordinate());this._depth[t]=e},e.prototype.isInteriorAreaEdge=function(){for(var t=!0,e=0;e<2;e++)this._label.isArea(e)&&this._label.getLocation(e,Oe.LEFT)===I.INTERIOR&&this._label.getLocation(e,Oe.RIGHT)===I.INTERIOR||(t=!1);return t},e.prototype.setNextMin=function(t){this._nextMin=t},e.prototype.print=function(e){t.prototype.print.call(this,e),e.print(" "+this._depth[Oe.LEFT]+"/"+this._depth[Oe.RIGHT]),e.print(" ("+this.getDepthDelta()+")"),this._isInResult&&e.print(" inResult")},e.prototype.setMinEdgeRing=function(t){this._minEdgeRing=t},e.prototype.isLineEdge=function(){var t=this._label.isLine(0)||this._label.isLine(1),e=!this._label.isArea(0)||this._label.allPositionsEqual(0,I.EXTERIOR),n=!this._label.isArea(1)||this._label.allPositionsEqual(1,I.EXTERIOR);return t&&e&&n},e.prototype.setEdgeRing=function(t){this._edgeRing=t},e.prototype.getMinEdgeRing=function(){return this._minEdgeRing},e.prototype.getDepthDelta=function(){var t=this._edge.getDepthDelta();return this._isForward||(t=-t),t},e.prototype.setInResult=function(t){this._isInResult=t},e.prototype.getSym=function(){return this._sym},e.prototype.isForward=function(){return this._isForward},e.prototype.getEdge=function(){return this._edge},e.prototype.printEdge=function(t){this.print(t),t.print(" "),this._isForward?this._edge.print(t):this._edge.printReverse(t)},e.prototype.setSym=function(t){this._sym=t},e.prototype.setVisitedEdge=function(t){this.setVisited(t),this._sym.setVisited(t)},e.prototype.setEdgeDepths=function(t,e){var n=this.getEdge().getDepthDelta();this._isForward||(n=-n);var r=1;t===Oe.LEFT&&(r=-1);var i=Oe.opposite(t),o=e+n*r;this.setDepth(t,e),this.setDepth(i,o)},e.prototype.getEdgeRing=function(){return this._edgeRing},e.prototype.isInResult=function(){return this._isInResult},e.prototype.setNext=function(t){this._next=t},e.prototype.isVisited=function(){return this._isVisited},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.depthFactor=function(t,e){return t===I.EXTERIOR&&e===I.INTERIOR?1:t===I.INTERIOR&&e===I.EXTERIOR?-1:0},e}(Ue),Ve=function(){};Ve.prototype.createNode=function(t){return new Fe(t,null)},Ve.prototype.interfaces_=function(){return[]},Ve.prototype.getClass=function(){return Ve};var qe=function(){if(this._edges=new Et,this._nodes=null,this._edgeEndList=new Et,0===arguments.length)this._nodes=new De(new Ve);else if(1===arguments.length){var t=arguments[0];this._nodes=new De(t)}};qe.prototype.printEdges=function(t){t.println("Edges:");for(var e=0;e<this._edges.size();e++){t.println("edge "+e+":");var n=this._edges.get(e);n.print(t),n.eiList.print(t)}},qe.prototype.find=function(t){return this._nodes.find(t)},qe.prototype.addNode=function(){if(arguments[0]instanceof Fe){var t=arguments[0];return this._nodes.addNode(t)}if(arguments[0]instanceof S){var e=arguments[0];return this._nodes.addNode(e)}},qe.prototype.getNodeIterator=function(){return this._nodes.iterator()},qe.prototype.linkResultDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();)t.next().getEdges().linkResultDirectedEdges()},qe.prototype.debugPrintln=function(t){q.out.println(t)},qe.prototype.isBoundaryNode=function(t,e){var n=this._nodes.find(e);if(null===n)return!1;var r=n.getLabel();return null!==r&&r.getLocation(t)===I.BOUNDARY},qe.prototype.linkAllDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();)t.next().getEdges().linkAllDirectedEdges()},qe.prototype.matchInSameDirection=function(t,e,n,r){return!!t.equals(n)&&st.computeOrientation(t,e,r)===st.COLLINEAR&&Ge.quadrant(t,e)===Ge.quadrant(n,r)},qe.prototype.getEdgeEnds=function(){return this._edgeEndList},qe.prototype.debugPrint=function(t){q.out.print(t)},qe.prototype.getEdgeIterator=function(){return this._edges.iterator()},qe.prototype.findEdgeInSameDirection=function(t,e){for(var n=0;n<this._edges.size();n++){var r=this._edges.get(n),i=r.getCoordinates();if(this.matchInSameDirection(t,e,i[0],i[1]))return r;if(this.matchInSameDirection(t,e,i[i.length-1],i[i.length-2]))return r}return null},qe.prototype.insertEdge=function(t){this._edges.add(t)},qe.prototype.findEdgeEnd=function(t){for(var e=this.getEdgeEnds().iterator();e.hasNext();){var n=e.next();if(n.getEdge()===t)return n}return null},qe.prototype.addEdges=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();this._edges.add(n);var r=new Be(n,!0),i=new Be(n,!1);r.setSym(i),i.setSym(r),this.add(r),this.add(i)}},qe.prototype.add=function(t){this._nodes.add(t),this._edgeEndList.add(t)},qe.prototype.getNodes=function(){return this._nodes.values()},qe.prototype.findEdge=function(t,e){for(var n=0;n<this._edges.size();n++){var r=this._edges.get(n),i=r.getCoordinates();if(t.equals(i[0])&&e.equals(i[1]))return r}return null},qe.prototype.interfaces_=function(){return[]},qe.prototype.getClass=function(){return qe},qe.linkResultDirectedEdges=function(t){for(var e=t.iterator();e.hasNext();)e.next().getEdges().linkResultDirectedEdges()};var Ye=function(){this._geometryFactory=null,this._shellList=new Et;var t=arguments[0];this._geometryFactory=t};Ye.prototype.sortShellsAndHoles=function(t,e,n){for(var r=t.iterator();r.hasNext();){var i=r.next();i.isHole()?n.add(i):e.add(i)}},Ye.prototype.computePolygons=function(t){for(var e=new Et,n=t.iterator();n.hasNext();){var r=n.next().toPolygon(this._geometryFactory);e.add(r)}return e},Ye.prototype.placeFreeHoles=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next();if(null===r.getShell()){var i=this.findEdgeRingContaining(r,t);if(null===i)throw new Ie("unable to assign hole to a shell",r.getCoordinate(0));r.setShell(i)}}},Ye.prototype.buildMinimalEdgeRings=function(t,e,n){for(var r=new Et,i=t.iterator();i.hasNext();){var o=i.next();if(o.getMaxNodeDegree()>2){o.linkDirectedEdgesForMinimalEdgeRings();var a=o.buildMinimalRings(),s=this.findShell(a);null!==s?(this.placePolygonHoles(s,a),e.add(s)):n.addAll(a)}else r.add(o)}return r},Ye.prototype.containsPoint=function(t){for(var e=this._shellList.iterator();e.hasNext();)if(e.next().containsPoint(t))return!0;return!1},Ye.prototype.buildMaximalEdgeRings=function(t){for(var e=new Et,n=t.iterator();n.hasNext();){var r=n.next();if(r.isInResult()&&r.getLabel().isArea()&&null===r.getEdgeRing()){var i=new Ae(r,this._geometryFactory);e.add(i),i.setInResult()}}return e},Ye.prototype.placePolygonHoles=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next();r.isHole()&&r.setShell(t)}},Ye.prototype.getPolygons=function(){return this.computePolygons(this._shellList)},Ye.prototype.findEdgeRingContaining=function(t,e){for(var n=t.getLinearRing(),r=n.getEnvelopeInternal(),i=n.getCoordinateN(0),o=null,a=null,s=e.iterator();s.hasNext();){var l=s.next(),u=l.getLinearRing(),c=u.getEnvelopeInternal();null!==o&&(a=o.getLinearRing().getEnvelopeInternal());var h=!1;c.contains(r)&&st.isPointInRing(i,u.getCoordinates())&&(h=!0),h&&(null===o||a.contains(c))&&(o=l)}return o},Ye.prototype.findShell=function(t){for(var e=0,n=null,r=t.iterator();r.hasNext();){var i=r.next();i.isHole()||(n=i,e++)}return et.isTrue(e<=1,"found two shells in MinimalEdgeRing list"),n},Ye.prototype.add=function(){if(1===arguments.length){var t=arguments[0];this.add(t.getEdgeEnds(),t.getNodes())}else if(2===arguments.length){var e=arguments[0],n=arguments[1];qe.linkResultDirectedEdges(n);var r=this.buildMaximalEdgeRings(e),i=new Et,o=this.buildMinimalEdgeRings(r,this._shellList,i);this.sortShellsAndHoles(o,this._shellList,i),this.placeFreeHoles(this._shellList,i)}},Ye.prototype.interfaces_=function(){return[]},Ye.prototype.getClass=function(){return Ye};var Xe=function(){};Xe.prototype.getBounds=function(){},Xe.prototype.interfaces_=function(){return[]},Xe.prototype.getClass=function(){return Xe};var We=function(){this._bounds=null,this._item=null;var t=arguments[0],e=arguments[1];this._bounds=t,this._item=e};We.prototype.getItem=function(){return this._item},We.prototype.getBounds=function(){return this._bounds},We.prototype.interfaces_=function(){return[Xe,e]},We.prototype.getClass=function(){return We};var He=function(){this._size=null,this._items=null,this._size=0,this._items=new Et,this._items.add(null)};He.prototype.poll=function(){if(this.isEmpty())return null;var t=this._items.get(1);return this._items.set(1,this._items.get(this._size)),this._size-=1,this.reorder(1),t},He.prototype.size=function(){return this._size},He.prototype.reorder=function(t){for(var e=null,n=this._items.get(t);2*t<=this._size&&((e=2*t)!==this._size&&this._items.get(e+1).compareTo(this._items.get(e))<0&&e++,this._items.get(e).compareTo(n)<0);t=e)this._items.set(t,this._items.get(e));this._items.set(t,n)},He.prototype.clear=function(){this._size=0,this._items.clear()},He.prototype.isEmpty=function(){return 0===this._size},He.prototype.add=function(t){this._items.add(null),this._size+=1;var e=this._size;for(this._items.set(0,t);t.compareTo(this._items.get(Math.trunc(e/2)))<0;e/=2)this._items.set(e,this._items.get(Math.trunc(e/2)));this._items.set(e,t)},He.prototype.interfaces_=function(){return[]},He.prototype.getClass=function(){return He};var Ke=function(){};Ke.prototype.visitItem=function(t){},Ke.prototype.interfaces_=function(){return[]},Ke.prototype.getClass=function(){return Ke};var Ze=function(){};Ze.prototype.insert=function(t,e){},Ze.prototype.remove=function(t,e){},Ze.prototype.query=function(){},Ze.prototype.interfaces_=function(){return[]},Ze.prototype.getClass=function(){return Ze};var $e=function(){if(this._childBoundables=new Et,this._bounds=null,this._level=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this._level=t}},Je={serialVersionUID:{configurable:!0}};$e.prototype.getLevel=function(){return this._level},$e.prototype.size=function(){return this._childBoundables.size()},$e.prototype.getChildBoundables=function(){return this._childBoundables},$e.prototype.addChildBoundable=function(t){et.isTrue(null===this._bounds),this._childBoundables.add(t)},$e.prototype.isEmpty=function(){return this._childBoundables.isEmpty()},$e.prototype.getBounds=function(){return null===this._bounds&&(this._bounds=this.computeBounds()),this._bounds},$e.prototype.interfaces_=function(){return[Xe,e]},$e.prototype.getClass=function(){return $e},Je.serialVersionUID.get=function(){return 0x5a1e55ec41369800},Object.defineProperties($e,Je);var Qe=function(){};Qe.reverseOrder=function(){return{compare:function(t,e){return e.compareTo(t)}}},Qe.min=function(t){return Qe.sort(t),t.get(0)},Qe.sort=function(t,e){var n=t.toArray();e?Ft.sort(n,e):Ft.sort(n);for(var r=t.iterator(),i=0,o=n.length;i<o;i++)r.next(),r.set(n[i])},Qe.singletonList=function(t){var e=new Et;return e.add(t),e};var tn=function(){this._boundable1=null,this._boundable2=null,this._distance=null,this._itemDistance=null;var t=arguments[0],e=arguments[1],n=arguments[2];this._boundable1=t,this._boundable2=e,this._itemDistance=n,this._distance=this.distance()};tn.prototype.expandToQueue=function(t,e){var n=tn.isComposite(this._boundable1),r=tn.isComposite(this._boundable2);if(n&&r)return tn.area(this._boundable1)>tn.area(this._boundable2)?(this.expand(this._boundable1,this._boundable2,t,e),null):(this.expand(this._boundable2,this._boundable1,t,e),null);if(n)return this.expand(this._boundable1,this._boundable2,t,e),null;if(r)return this.expand(this._boundable2,this._boundable1,t,e),null;throw new v("neither boundable is composite")},tn.prototype.isLeaves=function(){return!(tn.isComposite(this._boundable1)||tn.isComposite(this._boundable2))},tn.prototype.compareTo=function(t){var e=t;return this._distance<e._distance?-1:this._distance>e._distance?1:0},tn.prototype.expand=function(t,e,n,r){for(var i=t.getChildBoundables().iterator();i.hasNext();){var o=i.next(),a=new tn(o,e,this._itemDistance);a.getDistance()<r&&n.add(a)}},tn.prototype.getBoundable=function(t){return 0===t?this._boundable1:this._boundable2},tn.prototype.getDistance=function(){return this._distance},tn.prototype.distance=function(){return this.isLeaves()?this._itemDistance.distance(this._boundable1,this._boundable2):this._boundable1.getBounds().distance(this._boundable2.getBounds())},tn.prototype.interfaces_=function(){return[w]},tn.prototype.getClass=function(){return tn},tn.area=function(t){return t.getBounds().getArea()},tn.isComposite=function(t){return t instanceof $e};var en=function t(){if(this._root=null,this._built=!1,this._itemBoundables=new Et,this._nodeCapacity=null,0===arguments.length){var e=t.DEFAULT_NODE_CAPACITY;this._nodeCapacity=e}else if(1===arguments.length){var n=arguments[0];et.isTrue(n>1,"Node capacity must be greater than 1"),this._nodeCapacity=n}},nn={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};en.prototype.getNodeCapacity=function(){return this._nodeCapacity},en.prototype.lastNode=function(t){return t.get(t.size()-1)},en.prototype.size=function(){if(0===arguments.length)return this.isEmpty()?0:(this.build(),this.size(this._root));if(1===arguments.length){for(var t=0,e=arguments[0].getChildBoundables().iterator();e.hasNext();){var n=e.next();n instanceof $e?t+=this.size(n):n instanceof We&&(t+=1)}return t}},en.prototype.removeItem=function(t,e){for(var n=null,r=t.getChildBoundables().iterator();r.hasNext();){var i=r.next();i instanceof We&&i.getItem()===e&&(n=i)}return null!==n&&(t.getChildBoundables().remove(n),!0)},en.prototype.itemsTree=function(){if(0===arguments.length){this.build();var t=this.itemsTree(this._root);return null===t?new Et:t}if(1===arguments.length){for(var e=arguments[0],n=new Et,r=e.getChildBoundables().iterator();r.hasNext();){var i=r.next();if(i instanceof $e){var o=this.itemsTree(i);null!==o&&n.add(o)}else i instanceof We?n.add(i.getItem()):et.shouldNeverReachHere()}return n.size()<=0?null:n}},en.prototype.insert=function(t,e){et.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new We(t,e))},en.prototype.boundablesAtLevel=function(){if(1===arguments.length){var t=arguments[0],e=new Et;return this.boundablesAtLevel(t,this._root,e),e}if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];if(et.isTrue(n>-2),r.getLevel()===n)return i.add(r),null;for(var o=r.getChildBoundables().iterator();o.hasNext();){var a=o.next();a instanceof $e?this.boundablesAtLevel(n,a,i):(et.isTrue(a instanceof We),-1===n&&i.add(a))}return null}},en.prototype.query=function(){if(1===arguments.length){var t=arguments[0];this.build();var e=new Et;return this.isEmpty()||this.getIntersectsOp().intersects(this._root.getBounds(),t)&&this.query(t,this._root,e),e}if(2===arguments.length){var n=arguments[0],r=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),n)&&this.query(n,this._root,r)}else if(3===arguments.length)if(P(arguments[2],Ke)&&arguments[0]instanceof Object&&arguments[1]instanceof $e)for(var i=arguments[0],o=arguments[1],a=arguments[2],s=o.getChildBoundables(),l=0;l<s.size();l++){var u=s.get(l);this.getIntersectsOp().intersects(u.getBounds(),i)&&(u instanceof $e?this.query(i,u,a):u instanceof We?a.visitItem(u.getItem()):et.shouldNeverReachHere())}else if(P(arguments[2],xt)&&arguments[0]instanceof Object&&arguments[1]instanceof $e)for(var c=arguments[0],h=arguments[1],p=arguments[2],d=h.getChildBoundables(),f=0;f<d.size();f++){var g=d.get(f);this.getIntersectsOp().intersects(g.getBounds(),c)&&(g instanceof $e?this.query(c,g,p):g instanceof We?p.add(g.getItem()):et.shouldNeverReachHere())}},en.prototype.build=function(){if(this._built)return null;this._root=this._itemBoundables.isEmpty()?this.createNode(0):this.createHigherLevels(this._itemBoundables,-1),this._itemBoundables=null,this._built=!0},en.prototype.getRoot=function(){return this.build(),this._root},en.prototype.remove=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return this.build(),!!this.getIntersectsOp().intersects(this._root.getBounds(),t)&&this.remove(t,this._root,e)}if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2],o=this.removeItem(r,i);if(o)return!0;for(var a=null,s=r.getChildBoundables().iterator();s.hasNext();){var l=s.next();if(this.getIntersectsOp().intersects(l.getBounds(),n)&&l instanceof $e&&(o=this.remove(n,l,i))){a=l;break}}return null!==a&&a.getChildBoundables().isEmpty()&&r.getChildBoundables().remove(a),o}},en.prototype.createHigherLevels=function(t,e){et.isTrue(!t.isEmpty());var n=this.createParentBoundables(t,e+1);return 1===n.size()?n.get(0):this.createHigherLevels(n,e+1)},en.prototype.depth=function(){if(0===arguments.length)return this.isEmpty()?0:(this.build(),this.depth(this._root));if(1===arguments.length){for(var t=0,e=arguments[0].getChildBoundables().iterator();e.hasNext();){var n=e.next();if(n instanceof $e){var r=this.depth(n);r>t&&(t=r)}}return t+1}},en.prototype.createParentBoundables=function(t,e){et.isTrue(!t.isEmpty());var n=new Et;n.add(this.createNode(e));var r=new Et(t);Qe.sort(r,this.getComparator());for(var i=r.iterator();i.hasNext();){var o=i.next();this.lastNode(n).getChildBoundables().size()===this.getNodeCapacity()&&n.add(this.createNode(e)),this.lastNode(n).addChildBoundable(o)}return n},en.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()},en.prototype.interfaces_=function(){return[e]},en.prototype.getClass=function(){return en},en.compareDoubles=function(t,e){return t>e?1:t<e?-1:0},nn.IntersectsOp.get=function(){return rn},nn.serialVersionUID.get=function(){return-0x35ef64c82d4c5400},nn.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(en,nn);var rn=function(){},on=function(){};on.prototype.distance=function(t,e){},on.prototype.interfaces_=function(){return[]},on.prototype.getClass=function(){return on};var an=function(t){function n(e){e=e||n.DEFAULT_NODE_CAPACITY,t.call(this,e)}t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n;var r={STRtreeNode:{configurable:!0},serialVersionUID:{configurable:!0},xComparator:{configurable:!0},yComparator:{configurable:!0},intersectsOp:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};return n.prototype.createParentBoundablesFromVerticalSlices=function(t,e){et.isTrue(t.length>0);for(var n=new Et,r=0;r<t.length;r++)n.addAll(this.createParentBoundablesFromVerticalSlice(t[r],e));return n},n.prototype.createNode=function(t){return new sn(t)},n.prototype.size=function(){return 0===arguments.length?t.prototype.size.call(this):t.prototype.size.apply(this,arguments)},n.prototype.insert=function(){if(2!==arguments.length)return t.prototype.insert.apply(this,arguments);var e=arguments[0],n=arguments[1];if(e.isNull())return null;t.prototype.insert.call(this,e,n)},n.prototype.getIntersectsOp=function(){return n.intersectsOp},n.prototype.verticalSlices=function(t,e){for(var n=Math.trunc(Math.ceil(t.size()/e)),r=new Array(e).fill(null),i=t.iterator(),o=0;o<e;o++){r[o]=new Et;for(var a=0;i.hasNext()&&a<n;){var s=i.next();r[o].add(s),a++}}return r},n.prototype.query=function(){if(1===arguments.length){var e=arguments[0];return t.prototype.query.call(this,e)}if(2===arguments.length){var n=arguments[0],r=arguments[1];t.prototype.query.call(this,n,r)}else if(3===arguments.length)if(P(arguments[2],Ke)&&arguments[0]instanceof Object&&arguments[1]instanceof $e){var i=arguments[0],o=arguments[1],a=arguments[2];t.prototype.query.call(this,i,o,a)}else if(P(arguments[2],xt)&&arguments[0]instanceof Object&&arguments[1]instanceof $e){var s=arguments[0],l=arguments[1],u=arguments[2];t.prototype.query.call(this,s,l,u)}},n.prototype.getComparator=function(){return n.yComparator},n.prototype.createParentBoundablesFromVerticalSlice=function(e,n){return t.prototype.createParentBoundables.call(this,e,n)},n.prototype.remove=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];return t.prototype.remove.call(this,e,n)}return t.prototype.remove.apply(this,arguments)},n.prototype.depth=function(){return 0===arguments.length?t.prototype.depth.call(this):t.prototype.depth.apply(this,arguments)},n.prototype.createParentBoundables=function(t,e){et.isTrue(!t.isEmpty());var r=Math.trunc(Math.ceil(t.size()/this.getNodeCapacity())),i=new Et(t);Qe.sort(i,n.xComparator);var o=this.verticalSlices(i,Math.trunc(Math.ceil(Math.sqrt(r))));return this.createParentBoundablesFromVerticalSlices(o,e)},n.prototype.nearestNeighbour=function(){if(1===arguments.length){if(P(arguments[0],on)){var t=arguments[0],e=new tn(this.getRoot(),this.getRoot(),t);return this.nearestNeighbour(e)}if(arguments[0]instanceof tn){var r=arguments[0];return this.nearestNeighbour(r,_.POSITIVE_INFINITY)}}else if(2===arguments.length){if(arguments[0]instanceof n&&P(arguments[1],on)){var i=arguments[0],o=arguments[1],a=new tn(this.getRoot(),i.getRoot(),o);return this.nearestNeighbour(a)}if(arguments[0]instanceof tn&&"number"==typeof arguments[1]){var s=arguments[0],l=arguments[1],u=null,c=new He;for(c.add(s);!c.isEmpty()&&l>0;){var h=c.poll(),p=h.getDistance();if(p>=l)break;h.isLeaves()?(l=p,u=h):h.expandToQueue(c,l)}return[u.getBoundable(0).getItem(),u.getBoundable(1).getItem()]}}else if(3===arguments.length){var d=arguments[0],f=arguments[1],g=arguments[2],y=new We(d,f),m=new tn(this.getRoot(),y,g);return this.nearestNeighbour(m)[0]}},n.prototype.interfaces_=function(){return[Ze,e]},n.prototype.getClass=function(){return n},n.centreX=function(t){return n.avg(t.getMinX(),t.getMaxX())},n.avg=function(t,e){return(t+e)/2},n.centreY=function(t){return n.avg(t.getMinY(),t.getMaxY())},r.STRtreeNode.get=function(){return sn},r.serialVersionUID.get=function(){return 0x39920f7d5f261e0},r.xComparator.get=function(){return{interfaces_:function(){return[E]},compare:function(e,r){return t.compareDoubles(n.centreX(e.getBounds()),n.centreX(r.getBounds()))}}},r.yComparator.get=function(){return{interfaces_:function(){return[E]},compare:function(e,r){return t.compareDoubles(n.centreY(e.getBounds()),n.centreY(r.getBounds()))}}},r.intersectsOp.get=function(){return{interfaces_:function(){return[t.IntersectsOp]},intersects:function(t,e){return t.intersects(e)}}},r.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(n,r),n}(en),sn=function(t){function e(){var e=arguments[0];t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.computeBounds=function(){for(var t=null,e=this.getChildBoundables().iterator();e.hasNext();){var n=e.next();null===t?t=new X(n.getBounds()):t.expandToInclude(n.getBounds())}return t},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}($e),ln=function(){};ln.prototype.interfaces_=function(){return[]},ln.prototype.getClass=function(){return ln},ln.relativeSign=function(t,e){return t<e?-1:t>e?1:0},ln.compare=function(t,e,n){if(e.equals2D(n))return 0;var r=ln.relativeSign(e.x,n.x),i=ln.relativeSign(e.y,n.y);switch(t){case 0:return ln.compareValue(r,i);case 1:return ln.compareValue(i,r);case 2:return ln.compareValue(i,-r);case 3:return ln.compareValue(-r,i);case 4:return ln.compareValue(-r,-i);case 5:return ln.compareValue(-i,-r);case 6:return ln.compareValue(-i,r);case 7:return ln.compareValue(r,-i)}return et.shouldNeverReachHere("invalid octant value"),0},ln.compareValue=function(t,e){return t<0?-1:t>0?1:e<0?-1:e>0?1:0};var un=function(){this._segString=null,this.coord=null,this.segmentIndex=null,this._segmentOctant=null,this._isInterior=null;var t=arguments[0],e=arguments[1],n=arguments[2],r=arguments[3];this._segString=t,this.coord=new S(e),this.segmentIndex=n,this._segmentOctant=r,this._isInterior=!e.equals2D(t.getCoordinate(n))};un.prototype.getCoordinate=function(){return this.coord},un.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex)},un.prototype.compareTo=function(t){var e=t;return this.segmentIndex<e.segmentIndex?-1:this.segmentIndex>e.segmentIndex?1:this.coord.equals2D(e.coord)?0:ln.compare(this._segmentOctant,this.coord,e.coord)},un.prototype.isEndPoint=function(t){return 0===this.segmentIndex&&!this._isInterior||this.segmentIndex===t},un.prototype.isInterior=function(){return this._isInterior},un.prototype.interfaces_=function(){return[w]},un.prototype.getClass=function(){return un};var cn=function(){this._nodeMap=new h,this._edge=null;var t=arguments[0];this._edge=t};cn.prototype.getSplitCoordinates=function(){var t=new Ot;this.addEndpoints();for(var e=this.iterator(),n=e.next();e.hasNext();){var r=e.next();this.addEdgeCoordinates(n,r,t),n=r}return t.toCoordinateArray()},cn.prototype.addCollapsedNodes=function(){var t=new Et;this.findCollapsesFromInsertedNodes(t),this.findCollapsesFromExistingVertices(t);for(var e=t.iterator();e.hasNext();){var n=e.next().intValue();this.add(this._edge.getCoordinate(n),n)}},cn.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();)e.next().print(t)},cn.prototype.findCollapsesFromExistingVertices=function(t){for(var e=0;e<this._edge.size()-2;e++){var n=this._edge.getCoordinate(e),r=this._edge.getCoordinate(e+2);n.equals2D(r)&&t.add(new j(e+1))}},cn.prototype.addEdgeCoordinates=function(t,e,n){var r=this._edge.getCoordinate(e.segmentIndex),i=e.isInterior()||!e.coord.equals2D(r);n.add(new S(t.coord),!1);for(var o=t.segmentIndex+1;o<=e.segmentIndex;o++)n.add(this._edge.getCoordinate(o));i&&n.add(new S(e.coord))},cn.prototype.iterator=function(){return this._nodeMap.values().iterator()},cn.prototype.addSplitEdges=function(t){this.addEndpoints(),this.addCollapsedNodes();for(var e=this.iterator(),n=e.next();e.hasNext();){var r=e.next(),i=this.createSplitEdge(n,r);t.add(i),n=r}},cn.prototype.findCollapseIndex=function(t,e,n){if(!t.coord.equals2D(e.coord))return!1;var r=e.segmentIndex-t.segmentIndex;return e.isInterior()||r--,1===r&&(n[0]=t.segmentIndex+1,!0)},cn.prototype.findCollapsesFromInsertedNodes=function(t){for(var e=new Array(1).fill(null),n=this.iterator(),r=n.next();n.hasNext();){var i=n.next();this.findCollapseIndex(r,i,e)&&t.add(new j(e[0])),r=i}},cn.prototype.getEdge=function(){return this._edge},cn.prototype.addEndpoints=function(){var t=this._edge.size()-1;this.add(this._edge.getCoordinate(0),0),this.add(this._edge.getCoordinate(t),t)},cn.prototype.createSplitEdge=function(t,e){var n=e.segmentIndex-t.segmentIndex+2,r=this._edge.getCoordinate(e.segmentIndex),i=e.isInterior()||!e.coord.equals2D(r);i||n--;var o=new Array(n).fill(null),a=0;o[a++]=new S(t.coord);for(var s=t.segmentIndex+1;s<=e.segmentIndex;s++)o[a++]=this._edge.getCoordinate(s);return i&&(o[a]=new S(e.coord)),new fn(o,this._edge.getData())},cn.prototype.add=function(t,e){var n=new un(this._edge,t,e,this._edge.getSegmentOctant(e)),r=this._nodeMap.get(n);return null!==r?(et.isTrue(r.coord.equals2D(t),"Found equal nodes with different coordinates"),r):(this._nodeMap.put(n,n),n)},cn.prototype.checkSplitEdgesCorrectness=function(t){var e=this._edge.getCoordinates(),n=t.get(0).getCoordinate(0);if(!n.equals2D(e[0]))throw new Q("bad split edge start point at "+n);var r=t.get(t.size()-1).getCoordinates(),i=r[r.length-1];if(!i.equals2D(e[e.length-1]))throw new Q("bad split edge end point at "+i)},cn.prototype.interfaces_=function(){return[]},cn.prototype.getClass=function(){return cn};var hn=function(){};hn.prototype.interfaces_=function(){return[]},hn.prototype.getClass=function(){return hn},hn.octant=function(){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var t=arguments[0],e=arguments[1];if(0===t&&0===e)throw new v("Cannot compute the octant for point ( "+t+", "+e+" )");var n=Math.abs(t),r=Math.abs(e);return t>=0?e>=0?n>=r?0:1:n>=r?7:6:e>=0?n>=r?3:2:n>=r?4:5}if(arguments[0]instanceof S&&arguments[1]instanceof S){var i=arguments[0],o=arguments[1],a=o.x-i.x,s=o.y-i.y;if(0===a&&0===s)throw new v("Cannot compute the octant for two identical points "+i);return hn.octant(a,s)}};var pn=function(){};pn.prototype.getCoordinates=function(){},pn.prototype.size=function(){},pn.prototype.getCoordinate=function(t){},pn.prototype.isClosed=function(){},pn.prototype.setData=function(t){},pn.prototype.getData=function(){},pn.prototype.interfaces_=function(){return[]},pn.prototype.getClass=function(){return pn};var dn=function(){};dn.prototype.addIntersection=function(t,e){},dn.prototype.interfaces_=function(){return[pn]},dn.prototype.getClass=function(){return dn};var fn=function(){this._nodeList=new cn(this),this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};fn.prototype.getCoordinates=function(){return this._pts},fn.prototype.size=function(){return this._pts.length},fn.prototype.getCoordinate=function(t){return this._pts[t]},fn.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},fn.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(t),this.getCoordinate(t+1))},fn.prototype.setData=function(t){this._data=t},fn.prototype.safeOctant=function(t,e){return t.equals2D(e)?0:hn.octant(t,e)},fn.prototype.getData=function(){return this._data},fn.prototype.addIntersection=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];this.addIntersectionNode(t,e)}else if(4===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[3],o=new S(n.getIntersection(i));this.addIntersection(o,r)}},fn.prototype.toString=function(){return J.toLineString(new le(this._pts))},fn.prototype.getNodeList=function(){return this._nodeList},fn.prototype.addIntersectionNode=function(t,e){var n=e,r=n+1;if(r<this._pts.length){var i=this._pts[r];t.equals2D(i)&&(n=r)}return this._nodeList.add(t,n)},fn.prototype.addIntersections=function(t,e,n){for(var r=0;r<t.getIntersectionNum();r++)this.addIntersection(t,e,n,r)},fn.prototype.interfaces_=function(){return[dn]},fn.prototype.getClass=function(){return fn},fn.getNodedSubstrings=function(){if(1===arguments.length){var t=arguments[0],e=new Et;return fn.getNodedSubstrings(t,e),e}if(2===arguments.length)for(var n=arguments[0],r=arguments[1],i=n.iterator();i.hasNext();)i.next().getNodeList().addSplitEdges(r)};var gn=function(){if(this.p0=null,this.p1=null,0===arguments.length)this.p0=new S,this.p1=new S;else if(1===arguments.length){var t=arguments[0];this.p0=new S(t.p0),this.p1=new S(t.p1)}else if(2===arguments.length)this.p0=arguments[0],this.p1=arguments[1];else if(4===arguments.length){var e=arguments[0],n=arguments[1],r=arguments[2],i=arguments[3];this.p0=new S(e,n),this.p1=new S(r,i)}},yn={serialVersionUID:{configurable:!0}};gn.prototype.minX=function(){return Math.min(this.p0.x,this.p1.x)},gn.prototype.orientationIndex=function(){if(arguments[0]instanceof gn){var t=arguments[0],e=st.orientationIndex(this.p0,this.p1,t.p0),n=st.orientationIndex(this.p0,this.p1,t.p1);return e>=0&&n>=0||e<=0&&n<=0?Math.max(e,n):0}if(arguments[0]instanceof S){var r=arguments[0];return st.orientationIndex(this.p0,this.p1,r)}},gn.prototype.toGeometry=function(t){return t.createLineString([this.p0,this.p1])},gn.prototype.isVertical=function(){return this.p0.x===this.p1.x},gn.prototype.equals=function(t){if(!(t instanceof gn))return!1;var e=t;return this.p0.equals(e.p0)&&this.p1.equals(e.p1)},gn.prototype.intersection=function(t){var e=new it;return e.computeIntersection(this.p0,this.p1,t.p0,t.p1),e.hasIntersection()?e.getIntersection(0):null},gn.prototype.project=function(){if(arguments[0]instanceof S){var t=arguments[0];if(t.equals(this.p0)||t.equals(this.p1))return new S(t);var e=this.projectionFactor(t),n=new S;return n.x=this.p0.x+e*(this.p1.x-this.p0.x),n.y=this.p0.y+e*(this.p1.y-this.p0.y),n}if(arguments[0]instanceof gn){var r=arguments[0],i=this.projectionFactor(r.p0),o=this.projectionFactor(r.p1);if(i>=1&&o>=1)return null;if(i<=0&&o<=0)return null;var a=this.project(r.p0);i<0&&(a=this.p0),i>1&&(a=this.p1);var s=this.project(r.p1);return o<0&&(s=this.p0),o>1&&(s=this.p1),new gn(a,s)}},gn.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()},gn.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)},gn.prototype.getCoordinate=function(t){return 0===t?this.p0:this.p1},gn.prototype.distancePerpendicular=function(t){return st.distancePointLinePerpendicular(t,this.p0,this.p1)},gn.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)},gn.prototype.midPoint=function(){return gn.midPoint(this.p0,this.p1)},gn.prototype.projectionFactor=function(t){if(t.equals(this.p0))return 0;if(t.equals(this.p1))return 1;var e=this.p1.x-this.p0.x,n=this.p1.y-this.p0.y,r=e*e+n*n;return r<=0?_.NaN:((t.x-this.p0.x)*e+(t.y-this.p0.y)*n)/r},gn.prototype.closestPoints=function(t){var e=this.intersection(t);if(null!==e)return[e,e];var n=new Array(2).fill(null),r=_.MAX_VALUE,i=null,o=this.closestPoint(t.p0);r=o.distance(t.p0),n[0]=o,n[1]=t.p0;var a=this.closestPoint(t.p1);(i=a.distance(t.p1))<r&&(r=i,n[0]=a,n[1]=t.p1);var s=t.closestPoint(this.p0);(i=s.distance(this.p0))<r&&(r=i,n[0]=this.p0,n[1]=s);var l=t.closestPoint(this.p1);return(i=l.distance(this.p1))<r&&(r=i,n[0]=this.p1,n[1]=l),n},gn.prototype.closestPoint=function(t){var e=this.projectionFactor(t);return e>0&&e<1?this.project(t):this.p0.distance(t)<this.p1.distance(t)?this.p0:this.p1},gn.prototype.maxX=function(){return Math.max(this.p0.x,this.p1.x)},gn.prototype.getLength=function(){return this.p0.distance(this.p1)},gn.prototype.compareTo=function(t){var e=t,n=this.p0.compareTo(e.p0);return 0!==n?n:this.p1.compareTo(e.p1)},gn.prototype.reverse=function(){var t=this.p0;this.p0=this.p1,this.p1=t},gn.prototype.equalsTopo=function(t){return this.p0.equals(t.p0)&&(this.p1.equals(t.p1)||this.p0.equals(t.p1))&&this.p1.equals(t.p0)},gn.prototype.lineIntersection=function(t){try{return Y.intersection(this.p0,this.p1,t.p0,t.p1)}catch(t){if(!(t instanceof V))throw t}return null},gn.prototype.maxY=function(){return Math.max(this.p0.y,this.p1.y)},gn.prototype.pointAlongOffset=function(t,e){var n=this.p0.x+t*(this.p1.x-this.p0.x),r=this.p0.y+t*(this.p1.y-this.p0.y),i=this.p1.x-this.p0.x,o=this.p1.y-this.p0.y,a=Math.sqrt(i*i+o*o),s=0,l=0;if(0!==e){if(a<=0)throw new Error("Cannot compute offset from zero-length line segment");s=e*i/a,l=e*o/a}return new S(n-l,r+s)},gn.prototype.setCoordinates=function(){if(1===arguments.length){var t=arguments[0];this.setCoordinates(t.p0,t.p1)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.p0.x=e.x,this.p0.y=e.y,this.p1.x=n.x,this.p1.y=n.y}},gn.prototype.segmentFraction=function(t){var e=this.projectionFactor(t);return e<0?e=0:(e>1||_.isNaN(e))&&(e=1),e},gn.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"},gn.prototype.isHorizontal=function(){return this.p0.y===this.p1.y},gn.prototype.distance=function(){if(arguments[0]instanceof gn){var t=arguments[0];return st.distanceLineLine(this.p0,this.p1,t.p0,t.p1)}if(arguments[0]instanceof S){var e=arguments[0];return st.distancePointLine(e,this.p0,this.p1)}},gn.prototype.pointAlong=function(t){var e=new S;return e.x=this.p0.x+t*(this.p1.x-this.p0.x),e.y=this.p0.y+t*(this.p1.y-this.p0.y),e},gn.prototype.hashCode=function(){var t=_.doubleToLongBits(this.p0.x);t^=31*_.doubleToLongBits(this.p0.y);var e=Math.trunc(t)^Math.trunc(t>>32),n=_.doubleToLongBits(this.p1.x);return n^=31*_.doubleToLongBits(this.p1.y),e^Math.trunc(n)^Math.trunc(n>>32)},gn.prototype.interfaces_=function(){return[w,e]},gn.prototype.getClass=function(){return gn},gn.midPoint=function(t,e){return new S((t.x+e.x)/2,(t.y+e.y)/2)},yn.serialVersionUID.get=function(){return 0x2d2172135f411c00},Object.defineProperties(gn,yn);var mn=function(){this.tempEnv1=new X,this.tempEnv2=new X,this._overlapSeg1=new gn,this._overlapSeg2=new gn};mn.prototype.overlap=function(){if(2===arguments.length);else if(4===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2],r=arguments[3];t.getLineSegment(e,this._overlapSeg1),n.getLineSegment(r,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}},mn.prototype.interfaces_=function(){return[]},mn.prototype.getClass=function(){return mn};var vn=function(){this._pts=null,this._start=null,this._end=null,this._env=null,this._context=null,this._id=null;var t=arguments[0],e=arguments[1],n=arguments[2],r=arguments[3];this._pts=t,this._start=e,this._end=n,this._context=r};vn.prototype.getLineSegment=function(t,e){e.p0=this._pts[t],e.p1=this._pts[t+1]},vn.prototype.computeSelect=function(t,e,n,r){var i=this._pts[e],o=this._pts[n];if(r.tempEnv1.init(i,o),n-e==1)return r.select(this,e),null;if(!t.intersects(r.tempEnv1))return null;var a=Math.trunc((e+n)/2);e<a&&this.computeSelect(t,e,a,r),a<n&&this.computeSelect(t,a,n,r)},vn.prototype.getCoordinates=function(){for(var t=new Array(this._end-this._start+1).fill(null),e=0,n=this._start;n<=this._end;n++)t[e++]=this._pts[n];return t},vn.prototype.computeOverlaps=function(t,e){this.computeOverlapsInternal(this._start,this._end,t,t._start,t._end,e)},vn.prototype.setId=function(t){this._id=t},vn.prototype.select=function(t,e){this.computeSelect(t,this._start,this._end,e)},vn.prototype.getEnvelope=function(){if(null===this._env){var t=this._pts[this._start],e=this._pts[this._end];this._env=new X(t,e)}return this._env},vn.prototype.getEndIndex=function(){return this._end},vn.prototype.getStartIndex=function(){return this._start},vn.prototype.getContext=function(){return this._context},vn.prototype.getId=function(){return this._id},vn.prototype.computeOverlapsInternal=function(t,e,n,r,i,o){var a=this._pts[t],s=this._pts[e],l=n._pts[r],u=n._pts[i];if(e-t==1&&i-r==1)return o.overlap(this,t,n,r),null;if(o.tempEnv1.init(a,s),o.tempEnv2.init(l,u),!o.tempEnv1.intersects(o.tempEnv2))return null;var c=Math.trunc((t+e)/2),h=Math.trunc((r+i)/2);t<c&&(r<h&&this.computeOverlapsInternal(t,c,n,r,h,o),h<i&&this.computeOverlapsInternal(t,c,n,h,i,o)),c<e&&(r<h&&this.computeOverlapsInternal(c,e,n,r,h,o),h<i&&this.computeOverlapsInternal(c,e,n,h,i,o))},vn.prototype.interfaces_=function(){return[]},vn.prototype.getClass=function(){return vn};var _n=function(){};_n.prototype.interfaces_=function(){return[]},_n.prototype.getClass=function(){return _n},_n.getChainStartIndices=function(t){var e=0,n=new Et;n.add(new j(e));do{var r=_n.findChainEnd(t,e);n.add(new j(r)),e=r}while(e<t.length-1);return _n.toIntArray(n)},_n.findChainEnd=function(t,e){for(var n=e;n<t.length-1&&t[n].equals2D(t[n+1]);)n++;if(n>=t.length-1)return t.length-1;for(var r=Ge.quadrant(t[n],t[n+1]),i=e+1;i<t.length&&(t[i-1].equals2D(t[i])||Ge.quadrant(t[i-1],t[i])===r);)i++;return i-1},_n.getChains=function(){if(1===arguments.length){var t=arguments[0];return _n.getChains(t,null)}if(2===arguments.length){for(var e=arguments[0],n=arguments[1],r=new Et,i=_n.getChainStartIndices(e),o=0;o<i.length-1;o++){var a=new vn(e,i[o],i[o+1],n);r.add(a)}return r}},_n.toIntArray=function(t){for(var e=new Array(t.size()).fill(null),n=0;n<e.length;n++)e[n]=t.get(n).intValue();return e};var bn=function(){};bn.prototype.computeNodes=function(t){},bn.prototype.getNodedSubstrings=function(){},bn.prototype.interfaces_=function(){return[]},bn.prototype.getClass=function(){return bn};var wn=function(){if(this._segInt=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this.setSegmentIntersector(t)}};wn.prototype.setSegmentIntersector=function(t){this._segInt=t},wn.prototype.interfaces_=function(){return[bn]},wn.prototype.getClass=function(){return wn};var xn=function(t){function e(e){e?t.call(this,e):t.call(this),this._monoChains=new Et,this._index=new an,this._idCounter=0,this._nodedSegStrings=null,this._nOverlaps=0}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={SegmentOverlapAction:{configurable:!0}};return e.prototype.getMonotoneChains=function(){return this._monoChains},e.prototype.getNodedSubstrings=function(){return fn.getNodedSubstrings(this._nodedSegStrings)},e.prototype.getIndex=function(){return this._index},e.prototype.add=function(t){for(var e=_n.getChains(t.getCoordinates(),t).iterator();e.hasNext();){var n=e.next();n.setId(this._idCounter++),this._index.insert(n.getEnvelope(),n),this._monoChains.add(n)}},e.prototype.computeNodes=function(t){this._nodedSegStrings=t;for(var e=t.iterator();e.hasNext();)this.add(e.next());this.intersectChains()},e.prototype.intersectChains=function(){for(var t=new En(this._segInt),e=this._monoChains.iterator();e.hasNext();)for(var n=e.next(),r=this._index.query(n.getEnvelope()).iterator();r.hasNext();){var i=r.next();if(i.getId()>n.getId()&&(n.computeOverlaps(i,t),this._nOverlaps++),this._segInt.isDone())return null}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},n.SegmentOverlapAction.get=function(){return En},Object.defineProperties(e,n),e}(wn),En=function(t){function e(){t.call(this),this._si=null;var e=arguments[0];this._si=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.overlap=function(){if(4!==arguments.length)return t.prototype.overlap.apply(this,arguments);var e=arguments[0],n=arguments[1],r=arguments[2],i=arguments[3],o=e.getContext(),a=r.getContext();this._si.processIntersections(o,n,a,i)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(mn),Sn=function t(){if(this._quadrantSegments=t.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=t.CAP_ROUND,this._joinStyle=t.JOIN_ROUND,this._mitreLimit=t.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=t.DEFAULT_SIMPLIFY_FACTOR,0===arguments.length);else if(1===arguments.length){var e=arguments[0];this.setQuadrantSegments(e)}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this.setQuadrantSegments(n),this.setEndCapStyle(r)}else if(4===arguments.length){var i=arguments[0],o=arguments[1],a=arguments[2],s=arguments[3];this.setQuadrantSegments(i),this.setEndCapStyle(o),this.setJoinStyle(a),this.setMitreLimit(s)}},On={CAP_ROUND:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},JOIN_ROUND:{configurable:!0},JOIN_MITRE:{configurable:!0},JOIN_BEVEL:{configurable:!0},DEFAULT_QUADRANT_SEGMENTS:{configurable:!0},DEFAULT_MITRE_LIMIT:{configurable:!0},DEFAULT_SIMPLIFY_FACTOR:{configurable:!0}};Sn.prototype.getEndCapStyle=function(){return this._endCapStyle},Sn.prototype.isSingleSided=function(){return this._isSingleSided},Sn.prototype.setQuadrantSegments=function(t){this._quadrantSegments=t,0===this._quadrantSegments&&(this._joinStyle=Sn.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=Sn.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),t<=0&&(this._quadrantSegments=1),this._joinStyle!==Sn.JOIN_ROUND&&(this._quadrantSegments=Sn.DEFAULT_QUADRANT_SEGMENTS)},Sn.prototype.getJoinStyle=function(){return this._joinStyle},Sn.prototype.setJoinStyle=function(t){this._joinStyle=t},Sn.prototype.setSimplifyFactor=function(t){this._simplifyFactor=t<0?0:t},Sn.prototype.getSimplifyFactor=function(){return this._simplifyFactor},Sn.prototype.getQuadrantSegments=function(){return this._quadrantSegments},Sn.prototype.setEndCapStyle=function(t){this._endCapStyle=t},Sn.prototype.getMitreLimit=function(){return this._mitreLimit},Sn.prototype.setMitreLimit=function(t){this._mitreLimit=t},Sn.prototype.setSingleSided=function(t){this._isSingleSided=t},Sn.prototype.interfaces_=function(){return[]},Sn.prototype.getClass=function(){return Sn},Sn.bufferDistanceError=function(t){var e=Math.PI/2/t;return 1-Math.cos(e/2)},On.CAP_ROUND.get=function(){return 1},On.CAP_FLAT.get=function(){return 2},On.CAP_SQUARE.get=function(){return 3},On.JOIN_ROUND.get=function(){return 1},On.JOIN_MITRE.get=function(){return 2},On.JOIN_BEVEL.get=function(){return 3},On.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8},On.DEFAULT_MITRE_LIMIT.get=function(){return 5},On.DEFAULT_SIMPLIFY_FACTOR.get=function(){return.01},Object.defineProperties(Sn,On);var Cn=function(t){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=st.COUNTERCLOCKWISE,this._inputLine=t||null},Tn={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};Cn.prototype.isDeletable=function(t,e,n,r){var i=this._inputLine[t],o=this._inputLine[e],a=this._inputLine[n];return!!this.isConcave(i,o,a)&&!!this.isShallow(i,o,a,r)&&this.isShallowSampled(i,o,t,n,r)},Cn.prototype.deleteShallowConcavities=function(){for(var t=1,e=this.findNextNonDeletedIndex(t),n=this.findNextNonDeletedIndex(e),r=!1;n<this._inputLine.length;){var i=!1;this.isDeletable(t,e,n,this._distanceTol)&&(this._isDeleted[e]=Cn.DELETE,i=!0,r=!0),t=i?n:e,e=this.findNextNonDeletedIndex(t),n=this.findNextNonDeletedIndex(e)}return r},Cn.prototype.isShallowConcavity=function(t,e,n,r){return st.computeOrientation(t,e,n)===this._angleOrientation&&st.distancePointLine(e,t,n)<r},Cn.prototype.isShallowSampled=function(t,e,n,r,i){var o=Math.trunc((r-n)/Cn.NUM_PTS_TO_CHECK);o<=0&&(o=1);for(var a=n;a<r;a+=o)if(!this.isShallow(t,e,this._inputLine[a],i))return!1;return!0},Cn.prototype.isConcave=function(t,e,n){return st.computeOrientation(t,e,n)===this._angleOrientation},Cn.prototype.simplify=function(t){this._distanceTol=Math.abs(t),t<0&&(this._angleOrientation=st.CLOCKWISE),this._isDeleted=new Array(this._inputLine.length).fill(null);var e=!1;do{e=this.deleteShallowConcavities()}while(e);return this.collapseLine()},Cn.prototype.findNextNonDeletedIndex=function(t){for(var e=t+1;e<this._inputLine.length&&this._isDeleted[e]===Cn.DELETE;)e++;return e},Cn.prototype.isShallow=function(t,e,n,r){return st.distancePointLine(e,t,n)<r},Cn.prototype.collapseLine=function(){for(var t=new Ot,e=0;e<this._inputLine.length;e++)this._isDeleted[e]!==Cn.DELETE&&t.add(this._inputLine[e]);return t.toCoordinateArray()},Cn.prototype.interfaces_=function(){return[]},Cn.prototype.getClass=function(){return Cn},Cn.simplify=function(t,e){return new Cn(t).simplify(e)},Tn.INIT.get=function(){return 0},Tn.DELETE.get=function(){return 1},Tn.KEEP.get=function(){return 1},Tn.NUM_PTS_TO_CHECK.get=function(){return 10},Object.defineProperties(Cn,Tn);var In=function(){this._ptList=null,this._precisionModel=null,this._minimimVertexDistance=0,this._ptList=new Et},Ln={COORDINATE_ARRAY_TYPE:{configurable:!0}};In.prototype.getCoordinates=function(){return this._ptList.toArray(In.COORDINATE_ARRAY_TYPE)},In.prototype.setPrecisionModel=function(t){this._precisionModel=t},In.prototype.addPt=function(t){var e=new S(t);if(this._precisionModel.makePrecise(e),this.isRedundant(e))return null;this._ptList.add(e)},In.prototype.revere=function(){},In.prototype.addPts=function(t,e){if(e)for(var n=0;n<t.length;n++)this.addPt(t[n]);else for(var r=t.length-1;r>=0;r--)this.addPt(t[r])},In.prototype.isRedundant=function(t){if(this._ptList.size()<1)return!1;var e=this._ptList.get(this._ptList.size()-1);return t.distance(e)<this._minimimVertexDistance},In.prototype.toString=function(){return(new me).createLineString(this.getCoordinates()).toString()},In.prototype.closeRing=function(){if(this._ptList.size()<1)return null;var t=new S(this._ptList.get(0)),e=this._ptList.get(this._ptList.size()-1);if(t.equals(e))return null;this._ptList.add(t)},In.prototype.setMinimumVertexDistance=function(t){this._minimimVertexDistance=t},In.prototype.interfaces_=function(){return[]},In.prototype.getClass=function(){return In},Ln.COORDINATE_ARRAY_TYPE.get=function(){return new Array(0).fill(null)},Object.defineProperties(In,Ln);var Pn=function(){},Rn={PI_TIMES_2:{configurable:!0},PI_OVER_2:{configurable:!0},PI_OVER_4:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},CLOCKWISE:{configurable:!0},NONE:{configurable:!0}};Pn.prototype.interfaces_=function(){return[]},Pn.prototype.getClass=function(){return Pn},Pn.toDegrees=function(t){return 180*t/Math.PI},Pn.normalize=function(t){for(;t>Math.PI;)t-=Pn.PI_TIMES_2;for(;t<=-Math.PI;)t+=Pn.PI_TIMES_2;return t},Pn.angle=function(){if(1===arguments.length){var t=arguments[0];return Math.atan2(t.y,t.x)}if(2===arguments.length){var e=arguments[0],n=arguments[1],r=n.x-e.x,i=n.y-e.y;return Math.atan2(i,r)}},Pn.isAcute=function(t,e,n){var r=t.x-e.x,i=t.y-e.y;return r*(n.x-e.x)+i*(n.y-e.y)>0},Pn.isObtuse=function(t,e,n){var r=t.x-e.x,i=t.y-e.y;return r*(n.x-e.x)+i*(n.y-e.y)<0},Pn.interiorAngle=function(t,e,n){var r=Pn.angle(e,t),i=Pn.angle(e,n);return Math.abs(i-r)},Pn.normalizePositive=function(t){if(t<0){for(;t<0;)t+=Pn.PI_TIMES_2;t>=Pn.PI_TIMES_2&&(t=0)}else{for(;t>=Pn.PI_TIMES_2;)t-=Pn.PI_TIMES_2;t<0&&(t=0)}return t},Pn.angleBetween=function(t,e,n){var r=Pn.angle(e,t),i=Pn.angle(e,n);return Pn.diff(r,i)},Pn.diff=function(t,e){var n=null;return(n=t<e?e-t:t-e)>Math.PI&&(n=2*Math.PI-n),n},Pn.toRadians=function(t){return t*Math.PI/180},Pn.getTurn=function(t,e){var n=Math.sin(e-t);return n>0?Pn.COUNTERCLOCKWISE:n<0?Pn.CLOCKWISE:Pn.NONE},Pn.angleBetweenOriented=function(t,e,n){var r=Pn.angle(e,t),i=Pn.angle(e,n)-r;return i<=-Math.PI?i+Pn.PI_TIMES_2:i>Math.PI?i-Pn.PI_TIMES_2:i},Rn.PI_TIMES_2.get=function(){return 2*Math.PI},Rn.PI_OVER_2.get=function(){return Math.PI/2},Rn.PI_OVER_4.get=function(){return Math.PI/4},Rn.COUNTERCLOCKWISE.get=function(){return st.COUNTERCLOCKWISE},Rn.CLOCKWISE.get=function(){return st.CLOCKWISE},Rn.NONE.get=function(){return st.COLLINEAR},Object.defineProperties(Pn,Rn);var Mn=function t(){this._maxCurveSegmentError=0,this._filletAngleQuantum=null,this._closingSegLengthFactor=1,this._segList=null,this._distance=0,this._precisionModel=null,this._bufParams=null,this._li=null,this._s0=null,this._s1=null,this._s2=null,this._seg0=new gn,this._seg1=new gn,this._offset0=new gn,this._offset1=new gn,this._side=0,this._hasNarrowConcaveAngle=!1;var e=arguments[0],n=arguments[1],r=arguments[2];this._precisionModel=e,this._bufParams=n,this._li=new it,this._filletAngleQuantum=Math.PI/2/n.getQuadrantSegments(),n.getQuadrantSegments()>=8&&n.getJoinStyle()===Sn.JOIN_ROUND&&(this._closingSegLengthFactor=t.MAX_CLOSING_SEG_LEN_FACTOR),this.init(r)},Nn={OFFSET_SEGMENT_SEPARATION_FACTOR:{configurable:!0},INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},CURVE_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},MAX_CLOSING_SEG_LEN_FACTOR:{configurable:!0}};Mn.prototype.addNextSegment=function(t,e){if(this._s0=this._s1,this._s1=this._s2,this._s2=t,this._seg0.setCoordinates(this._s0,this._s1),this.computeOffsetSegment(this._seg0,this._side,this._distance,this._offset0),this._seg1.setCoordinates(this._s1,this._s2),this.computeOffsetSegment(this._seg1,this._side,this._distance,this._offset1),this._s1.equals(this._s2))return null;var n=st.computeOrientation(this._s0,this._s1,this._s2),r=n===st.CLOCKWISE&&this._side===Oe.LEFT||n===st.COUNTERCLOCKWISE&&this._side===Oe.RIGHT;0===n?this.addCollinear(e):r?this.addOutsideTurn(n,e):this.addInsideTurn(n,e)},Mn.prototype.addLineEndCap=function(t,e){var n=new gn(t,e),r=new gn;this.computeOffsetSegment(n,Oe.LEFT,this._distance,r);var i=new gn;this.computeOffsetSegment(n,Oe.RIGHT,this._distance,i);var o=e.x-t.x,a=e.y-t.y,s=Math.atan2(a,o);switch(this._bufParams.getEndCapStyle()){case Sn.CAP_ROUND:this._segList.addPt(r.p1),this.addFilletArc(e,s+Math.PI/2,s-Math.PI/2,st.CLOCKWISE,this._distance),this._segList.addPt(i.p1);break;case Sn.CAP_FLAT:this._segList.addPt(r.p1),this._segList.addPt(i.p1);break;case Sn.CAP_SQUARE:var l=new S;l.x=Math.abs(this._distance)*Math.cos(s),l.y=Math.abs(this._distance)*Math.sin(s);var u=new S(r.p1.x+l.x,r.p1.y+l.y),c=new S(i.p1.x+l.x,i.p1.y+l.y);this._segList.addPt(u),this._segList.addPt(c)}},Mn.prototype.getCoordinates=function(){return this._segList.getCoordinates()},Mn.prototype.addMitreJoin=function(t,e,n,r){var i=!0,o=null;try{o=Y.intersection(e.p0,e.p1,n.p0,n.p1),(r<=0?1:o.distance(t)/Math.abs(r))>this._bufParams.getMitreLimit()&&(i=!1)}catch(t){if(!(t instanceof V))throw t;o=new S(0,0),i=!1}i?this._segList.addPt(o):this.addLimitedMitreJoin(e,n,r,this._bufParams.getMitreLimit())},Mn.prototype.addFilletCorner=function(t,e,n,r,i){var o=e.x-t.x,a=e.y-t.y,s=Math.atan2(a,o),l=n.x-t.x,u=n.y-t.y,c=Math.atan2(u,l);r===st.CLOCKWISE?s<=c&&(s+=2*Math.PI):s>=c&&(s-=2*Math.PI),this._segList.addPt(e),this.addFilletArc(t,s,c,r,i),this._segList.addPt(n)},Mn.prototype.addOutsideTurn=function(t,e){if(this._offset0.p1.distance(this._offset1.p0)<this._distance*Mn.OFFSET_SEGMENT_SEPARATION_FACTOR)return this._segList.addPt(this._offset0.p1),null;this._bufParams.getJoinStyle()===Sn.JOIN_MITRE?this.addMitreJoin(this._s1,this._offset0,this._offset1,this._distance):this._bufParams.getJoinStyle()===Sn.JOIN_BEVEL?this.addBevelJoin(this._offset0,this._offset1):(e&&this._segList.addPt(this._offset0.p1),this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,t,this._distance),this._segList.addPt(this._offset1.p0))},Mn.prototype.createSquare=function(t){this._segList.addPt(new S(t.x+this._distance,t.y+this._distance)),this._segList.addPt(new S(t.x+this._distance,t.y-this._distance)),this._segList.addPt(new S(t.x-this._distance,t.y-this._distance)),this._segList.addPt(new S(t.x-this._distance,t.y+this._distance)),this._segList.closeRing()},Mn.prototype.addSegments=function(t,e){this._segList.addPts(t,e)},Mn.prototype.addFirstSegment=function(){this._segList.addPt(this._offset1.p0)},Mn.prototype.addLastSegment=function(){this._segList.addPt(this._offset1.p1)},Mn.prototype.initSideSegments=function(t,e,n){this._s1=t,this._s2=e,this._side=n,this._seg1.setCoordinates(t,e),this.computeOffsetSegment(this._seg1,n,this._distance,this._offset1)},Mn.prototype.addLimitedMitreJoin=function(t,e,n,r){var i=this._seg0.p1,o=Pn.angle(i,this._seg0.p0),a=Pn.angleBetweenOriented(this._seg0.p0,i,this._seg1.p1)/2,s=Pn.normalize(o+a),l=Pn.normalize(s+Math.PI),u=r*n,c=n-u*Math.abs(Math.sin(a)),h=i.x+u*Math.cos(l),p=i.y+u*Math.sin(l),d=new S(h,p),f=new gn(i,d),g=f.pointAlongOffset(1,c),y=f.pointAlongOffset(1,-c);this._side===Oe.LEFT?(this._segList.addPt(g),this._segList.addPt(y)):(this._segList.addPt(y),this._segList.addPt(g))},Mn.prototype.computeOffsetSegment=function(t,e,n,r){var i=e===Oe.LEFT?1:-1,o=t.p1.x-t.p0.x,a=t.p1.y-t.p0.y,s=Math.sqrt(o*o+a*a),l=i*n*o/s,u=i*n*a/s;r.p0.x=t.p0.x-u,r.p0.y=t.p0.y+l,r.p1.x=t.p1.x-u,r.p1.y=t.p1.y+l},Mn.prototype.addFilletArc=function(t,e,n,r,i){var o=r===st.CLOCKWISE?-1:1,a=Math.abs(e-n),s=Math.trunc(a/this._filletAngleQuantum+.5);if(s<1)return null;for(var l=a/s,u=0,c=new S;u<a;){var h=e+o*u;c.x=t.x+i*Math.cos(h),c.y=t.y+i*Math.sin(h),this._segList.addPt(c),u+=l}},Mn.prototype.addInsideTurn=function(t,e){if(this._li.computeIntersection(this._offset0.p0,this._offset0.p1,this._offset1.p0,this._offset1.p1),this._li.hasIntersection())this._segList.addPt(this._li.getIntersection(0));else if(this._hasNarrowConcaveAngle=!0,this._offset0.p1.distance(this._offset1.p0)<this._distance*Mn.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR)this._segList.addPt(this._offset0.p1);else{if(this._segList.addPt(this._offset0.p1),this._closingSegLengthFactor>0){var n=new S((this._closingSegLengthFactor*this._offset0.p1.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset0.p1.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(n);var r=new S((this._closingSegLengthFactor*this._offset1.p0.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset1.p0.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(r)}else this._segList.addPt(this._s1);this._segList.addPt(this._offset1.p0)}},Mn.prototype.createCircle=function(t){var e=new S(t.x+this._distance,t.y);this._segList.addPt(e),this.addFilletArc(t,0,2*Math.PI,-1,this._distance),this._segList.closeRing()},Mn.prototype.addBevelJoin=function(t,e){this._segList.addPt(t.p1),this._segList.addPt(e.p0)},Mn.prototype.init=function(t){this._distance=t,this._maxCurveSegmentError=t*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new In,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(t*Mn.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},Mn.prototype.addCollinear=function(t){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2),this._li.getIntersectionNum()>=2&&(this._bufParams.getJoinStyle()===Sn.JOIN_BEVEL||this._bufParams.getJoinStyle()===Sn.JOIN_MITRE?(t&&this._segList.addPt(this._offset0.p1),this._segList.addPt(this._offset1.p0)):this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,st.CLOCKWISE,this._distance))},Mn.prototype.closeRing=function(){this._segList.closeRing()},Mn.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle},Mn.prototype.interfaces_=function(){return[]},Mn.prototype.getClass=function(){return Mn},Nn.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return.001},Nn.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return.001},Nn.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6},Nn.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80},Object.defineProperties(Mn,Nn);var jn=function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var t=arguments[0],e=arguments[1];this._precisionModel=t,this._bufParams=e};jn.prototype.getOffsetCurve=function(t,e){if(this._distance=e,0===e)return null;var n=e<0,r=Math.abs(e),i=this.getSegGen(r);t.length<=1?this.computePointCurve(t[0],i):this.computeOffsetCurve(t,n,i);var o=i.getCoordinates();return n&&Ct.reverse(o),o},jn.prototype.computeSingleSidedBufferCurve=function(t,e,n){var r=this.simplifyTolerance(this._distance);if(e){n.addSegments(t,!0);var i=Cn.simplify(t,-r),o=i.length-1;n.initSideSegments(i[o],i[o-1],Oe.LEFT),n.addFirstSegment();for(var a=o-2;a>=0;a--)n.addNextSegment(i[a],!0)}else{n.addSegments(t,!1);var s=Cn.simplify(t,r),l=s.length-1;n.initSideSegments(s[0],s[1],Oe.LEFT),n.addFirstSegment();for(var u=2;u<=l;u++)n.addNextSegment(s[u],!0)}n.addLastSegment(),n.closeRing()},jn.prototype.computeRingBufferCurve=function(t,e,n){var r=this.simplifyTolerance(this._distance);e===Oe.RIGHT&&(r=-r);var i=Cn.simplify(t,r),o=i.length-1;n.initSideSegments(i[o-1],i[0],e);for(var a=1;a<=o;a++){var s=1!==a;n.addNextSegment(i[a],s)}n.closeRing()},jn.prototype.computeLineBufferCurve=function(t,e){var n=this.simplifyTolerance(this._distance),r=Cn.simplify(t,n),i=r.length-1;e.initSideSegments(r[0],r[1],Oe.LEFT);for(var o=2;o<=i;o++)e.addNextSegment(r[o],!0);e.addLastSegment(),e.addLineEndCap(r[i-1],r[i]);var a=Cn.simplify(t,-n),s=a.length-1;e.initSideSegments(a[s],a[s-1],Oe.LEFT);for(var l=s-2;l>=0;l--)e.addNextSegment(a[l],!0);e.addLastSegment(),e.addLineEndCap(a[1],a[0]),e.closeRing()},jn.prototype.computePointCurve=function(t,e){switch(this._bufParams.getEndCapStyle()){case Sn.CAP_ROUND:e.createCircle(t);break;case Sn.CAP_SQUARE:e.createSquare(t)}},jn.prototype.getLineCurve=function(t,e){if(this._distance=e,e<0&&!this._bufParams.isSingleSided())return null;if(0===e)return null;var n=Math.abs(e),r=this.getSegGen(n);if(t.length<=1)this.computePointCurve(t[0],r);else if(this._bufParams.isSingleSided()){var i=e<0;this.computeSingleSidedBufferCurve(t,i,r)}else this.computeLineBufferCurve(t,r);return r.getCoordinates()},jn.prototype.getBufferParameters=function(){return this._bufParams},jn.prototype.simplifyTolerance=function(t){return t*this._bufParams.getSimplifyFactor()},jn.prototype.getRingCurve=function(t,e,n){if(this._distance=n,t.length<=2)return this.getLineCurve(t,n);if(0===n)return jn.copyCoordinates(t);var r=this.getSegGen(n);return this.computeRingBufferCurve(t,e,r),r.getCoordinates()},jn.prototype.computeOffsetCurve=function(t,e,n){var r=this.simplifyTolerance(this._distance);if(e){var i=Cn.simplify(t,-r),o=i.length-1;n.initSideSegments(i[o],i[o-1],Oe.LEFT),n.addFirstSegment();for(var a=o-2;a>=0;a--)n.addNextSegment(i[a],!0)}else{var s=Cn.simplify(t,r),l=s.length-1;n.initSideSegments(s[0],s[1],Oe.LEFT),n.addFirstSegment();for(var u=2;u<=l;u++)n.addNextSegment(s[u],!0)}n.addLastSegment()},jn.prototype.getSegGen=function(t){return new Mn(this._precisionModel,this._bufParams,t)},jn.prototype.interfaces_=function(){return[]},jn.prototype.getClass=function(){return jn},jn.copyCoordinates=function(t){for(var e=new Array(t.length).fill(null),n=0;n<e.length;n++)e[n]=new S(t[n]);return e};var An=function(){this._subgraphs=null,this._seg=new gn,this._cga=new st;var t=arguments[0];this._subgraphs=t},kn={DepthSegment:{configurable:!0}};An.prototype.findStabbedSegments=function(){if(1===arguments.length){for(var t=arguments[0],e=new Et,n=this._subgraphs.iterator();n.hasNext();){var r=n.next(),i=r.getEnvelope();t.y<i.getMinY()||t.y>i.getMaxY()||this.findStabbedSegments(t,r.getDirectedEdges(),e)}return e}if(3===arguments.length)if(P(arguments[2],xt)&&arguments[0]instanceof S&&arguments[1]instanceof Be){for(var o=arguments[0],a=arguments[1],s=arguments[2],l=a.getEdge().getCoordinates(),u=0;u<l.length-1;u++)if(this._seg.p0=l[u],this._seg.p1=l[u+1],this._seg.p0.y>this._seg.p1.y&&this._seg.reverse(),!(Math.max(this._seg.p0.x,this._seg.p1.x)<o.x||this._seg.isHorizontal()||o.y<this._seg.p0.y||o.y>this._seg.p1.y||st.computeOrientation(this._seg.p0,this._seg.p1,o)===st.RIGHT)){var c=a.getDepth(Oe.LEFT);this._seg.p0.equals(l[u])||(c=a.getDepth(Oe.RIGHT));var h=new Fn(this._seg,c);s.add(h)}}else if(P(arguments[2],xt)&&arguments[0]instanceof S&&P(arguments[1],xt))for(var p=arguments[0],d=arguments[1],f=arguments[2],g=d.iterator();g.hasNext();){var y=g.next();y.isForward()&&this.findStabbedSegments(p,y,f)}},An.prototype.getDepth=function(t){var e=this.findStabbedSegments(t);return 0===e.size()?0:Qe.min(e)._leftDepth},An.prototype.interfaces_=function(){return[]},An.prototype.getClass=function(){return An},kn.DepthSegment.get=function(){return Fn},Object.defineProperties(An,kn);var Fn=function(){this._upwardSeg=null,this._leftDepth=null;var t=arguments[0],e=arguments[1];this._upwardSeg=new gn(t),this._leftDepth=e};Fn.prototype.compareTo=function(t){var e=t;if(this._upwardSeg.minX()>=e._upwardSeg.maxX())return 1;if(this._upwardSeg.maxX()<=e._upwardSeg.minX())return-1;var n=this._upwardSeg.orientationIndex(e._upwardSeg);return 0!==n||0!=(n=-1*e._upwardSeg.orientationIndex(this._upwardSeg))?n:this._upwardSeg.compareTo(e._upwardSeg)},Fn.prototype.compareX=function(t,e){var n=t.p0.compareTo(e.p0);return 0!==n?n:t.p1.compareTo(e.p1)},Fn.prototype.toString=function(){return this._upwardSeg.toString()},Fn.prototype.interfaces_=function(){return[w]},Fn.prototype.getClass=function(){return Fn};var Dn=function(t,e,n){this.p0=t||null,this.p1=e||null,this.p2=n||null};Dn.prototype.area=function(){return Dn.area(this.p0,this.p1,this.p2)},Dn.prototype.signedArea=function(){return Dn.signedArea(this.p0,this.p1,this.p2)},Dn.prototype.interpolateZ=function(t){if(null===t)throw new v("Supplied point is null.");return Dn.interpolateZ(t,this.p0,this.p1,this.p2)},Dn.prototype.longestSideLength=function(){return Dn.longestSideLength(this.p0,this.p1,this.p2)},Dn.prototype.isAcute=function(){return Dn.isAcute(this.p0,this.p1,this.p2)},Dn.prototype.circumcentre=function(){return Dn.circumcentre(this.p0,this.p1,this.p2)},Dn.prototype.area3D=function(){return Dn.area3D(this.p0,this.p1,this.p2)},Dn.prototype.centroid=function(){return Dn.centroid(this.p0,this.p1,this.p2)},Dn.prototype.inCentre=function(){return Dn.inCentre(this.p0,this.p1,this.p2)},Dn.prototype.interfaces_=function(){return[]},Dn.prototype.getClass=function(){return Dn},Dn.area=function(t,e,n){return Math.abs(((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2)},Dn.signedArea=function(t,e,n){return((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2},Dn.det=function(t,e,n,r){return t*r-e*n},Dn.interpolateZ=function(t,e,n,r){var i=e.x,o=e.y,a=n.x-i,s=r.x-i,l=n.y-o,u=r.y-o,c=a*u-s*l,h=t.x-i,p=t.y-o,d=(u*h-s*p)/c,f=(-l*h+a*p)/c;return e.z+d*(n.z-e.z)+f*(r.z-e.z)},Dn.longestSideLength=function(t,e,n){var r=t.distance(e),i=e.distance(n),o=n.distance(t),a=r;return i>a&&(a=i),o>a&&(a=o),a},Dn.isAcute=function(t,e,n){return!!Pn.isAcute(t,e,n)&&!!Pn.isAcute(e,n,t)&&!!Pn.isAcute(n,t,e)},Dn.circumcentre=function(t,e,n){var r=n.x,i=n.y,o=t.x-r,a=t.y-i,s=e.x-r,l=e.y-i,u=2*Dn.det(o,a,s,l),c=Dn.det(a,o*o+a*a,l,s*s+l*l),h=Dn.det(o,o*o+a*a,s,s*s+l*l);return new S(r-c/u,i+h/u)},Dn.perpendicularBisector=function(t,e){var n=e.x-t.x,r=e.y-t.y,i=new Y(t.x+n/2,t.y+r/2,1),o=new Y(t.x-r+n/2,t.y+n+r/2,1);return new Y(i,o)},Dn.angleBisector=function(t,e,n){var r=e.distance(t),i=r/(r+e.distance(n)),o=n.x-t.x,a=n.y-t.y;return new S(t.x+i*o,t.y+i*a)},Dn.area3D=function(t,e,n){var r=e.x-t.x,i=e.y-t.y,o=e.z-t.z,a=n.x-t.x,s=n.y-t.y,l=n.z-t.z,u=i*l-o*s,c=o*a-r*l,h=r*s-i*a,p=u*u+c*c+h*h;return Math.sqrt(p)/2},Dn.centroid=function(t,e,n){var r=(t.x+e.x+n.x)/3,i=(t.y+e.y+n.y)/3;return new S(r,i)},Dn.inCentre=function(t,e,n){var r=e.distance(n),i=t.distance(n),o=t.distance(e),a=r+i+o,s=(r*t.x+i*e.x+o*n.x)/a,l=(r*t.y+i*e.y+o*n.y)/a;return new S(s,l)};var Gn=function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new Et;var t=arguments[0],e=arguments[1],n=arguments[2];this._inputGeom=t,this._distance=e,this._curveBuilder=n};Gn.prototype.addPoint=function(t){if(this._distance<=0)return null;var e=t.getCoordinates(),n=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(n,I.EXTERIOR,I.INTERIOR)},Gn.prototype.addPolygon=function(t){var e=this._distance,n=Oe.LEFT;this._distance<0&&(e=-this._distance,n=Oe.RIGHT);var r=t.getExteriorRing(),i=Ct.removeRepeatedPoints(r.getCoordinates());if(this._distance<0&&this.isErodedCompletely(r,this._distance))return null;if(this._distance<=0&&i.length<3)return null;this.addPolygonRing(i,e,n,I.EXTERIOR,I.INTERIOR);for(var o=0;o<t.getNumInteriorRing();o++){var a=t.getInteriorRingN(o),s=Ct.removeRepeatedPoints(a.getCoordinates());this._distance>0&&this.isErodedCompletely(a,-this._distance)||this.addPolygonRing(s,e,Oe.opposite(n),I.INTERIOR,I.EXTERIOR)}},Gn.prototype.isTriangleErodedCompletely=function(t,e){var n=new Dn(t[0],t[1],t[2]),r=n.inCentre();return st.distancePointLine(r,n.p0,n.p1)<Math.abs(e)},Gn.prototype.addLineString=function(t){if(this._distance<=0&&!this._curveBuilder.getBufferParameters().isSingleSided())return null;var e=Ct.removeRepeatedPoints(t.getCoordinates()),n=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(n,I.EXTERIOR,I.INTERIOR)},Gn.prototype.addCurve=function(t,e,n){if(null===t||t.length<2)return null;var r=new fn(t,new Me(0,I.BOUNDARY,e,n));this._curveList.add(r)},Gn.prototype.getCurves=function(){return this.add(this._inputGeom),this._curveList},Gn.prototype.addPolygonRing=function(t,e,n,r,i){if(0===e&&t.length<ee.MINIMUM_VALID_SIZE)return null;var o=r,a=i;t.length>=ee.MINIMUM_VALID_SIZE&&st.isCCW(t)&&(o=i,a=r,n=Oe.opposite(n));var s=this._curveBuilder.getRingCurve(t,n,e);this.addCurve(s,o,a)},Gn.prototype.add=function(t){if(t.isEmpty())return null;t instanceof Qt?this.addPolygon(t):t instanceof Kt?this.addLineString(t):t instanceof $t?this.addPoint(t):(t instanceof te||t instanceof Vt||t instanceof ne||t instanceof Bt)&&this.addCollection(t)},Gn.prototype.isErodedCompletely=function(t,e){var n=t.getCoordinates();if(n.length<4)return e<0;if(4===n.length)return this.isTriangleErodedCompletely(n,e);var r=t.getEnvelopeInternal(),i=Math.min(r.getHeight(),r.getWidth());return e<0&&2*Math.abs(e)>i},Gn.prototype.addCollection=function(t){for(var e=0;e<t.getNumGeometries();e++){var n=t.getGeometryN(e);this.add(n)}},Gn.prototype.interfaces_=function(){return[]},Gn.prototype.getClass=function(){return Gn};var zn=function(){};zn.prototype.locate=function(t){},zn.prototype.interfaces_=function(){return[]},zn.prototype.getClass=function(){return zn};var Un=function(){this._parent=null,this._atStart=null,this._max=null,this._index=null,this._subcollectionIterator=null;var t=arguments[0];this._parent=t,this._atStart=!0,this._index=0,this._max=t.getNumGeometries()};Un.prototype.next=function(){if(this._atStart)return this._atStart=!1,Un.isAtomic(this._parent)&&this._index++,this._parent;if(null!==this._subcollectionIterator){if(this._subcollectionIterator.hasNext())return this._subcollectionIterator.next();this._subcollectionIterator=null}if(this._index>=this._max)throw new r;var t=this._parent.getGeometryN(this._index++);return t instanceof Bt?(this._subcollectionIterator=new Un(t),this._subcollectionIterator.next()):t},Un.prototype.remove=function(){throw new Error(this.getClass().getName())},Un.prototype.hasNext=function(){if(this._atStart)return!0;if(null!==this._subcollectionIterator){if(this._subcollectionIterator.hasNext())return!0;this._subcollectionIterator=null}return!(this._index>=this._max)},Un.prototype.interfaces_=function(){return[wt]},Un.prototype.getClass=function(){return Un},Un.isAtomic=function(t){return!(t instanceof Bt)};var Bn=function(){this._geom=null;var t=arguments[0];this._geom=t};Bn.prototype.locate=function(t){return Bn.locate(t,this._geom)},Bn.prototype.interfaces_=function(){return[zn]},Bn.prototype.getClass=function(){return Bn},Bn.isPointInRing=function(t,e){return!!e.getEnvelopeInternal().intersects(t)&&st.isPointInRing(t,e.getCoordinates())},Bn.containsPointInPolygon=function(t,e){if(e.isEmpty())return!1;var n=e.getExteriorRing();if(!Bn.isPointInRing(t,n))return!1;for(var r=0;r<e.getNumInteriorRing();r++){var i=e.getInteriorRingN(r);if(Bn.isPointInRing(t,i))return!1}return!0},Bn.containsPoint=function(t,e){if(e instanceof Qt)return Bn.containsPointInPolygon(t,e);if(e instanceof Bt)for(var n=new Un(e);n.hasNext();){var r=n.next();if(r!==e&&Bn.containsPoint(t,r))return!0}return!1},Bn.locate=function(t,e){return e.isEmpty()?I.EXTERIOR:Bn.containsPoint(t,e)?I.INTERIOR:I.EXTERIOR};var Vn=function(){this._edgeMap=new h,this._edgeList=null,this._ptInAreaLocation=[I.NONE,I.NONE]};Vn.prototype.getNextCW=function(t){this.getEdges();var e=this._edgeList.indexOf(t),n=e-1;return 0===e&&(n=this._edgeList.size()-1),this._edgeList.get(n)},Vn.prototype.propagateSideLabels=function(t){for(var e=I.NONE,n=this.iterator();n.hasNext();){var r=n.next().getLabel();r.isArea(t)&&r.getLocation(t,Oe.LEFT)!==I.NONE&&(e=r.getLocation(t,Oe.LEFT))}if(e===I.NONE)return null;for(var i=e,o=this.iterator();o.hasNext();){var a=o.next(),s=a.getLabel();if(s.getLocation(t,Oe.ON)===I.NONE&&s.setLocation(t,Oe.ON,i),s.isArea(t)){var l=s.getLocation(t,Oe.LEFT),u=s.getLocation(t,Oe.RIGHT);if(u!==I.NONE){if(u!==i)throw new Ie("side location conflict",a.getCoordinate());l===I.NONE&&et.shouldNeverReachHere("found single null side (at "+a.getCoordinate()+")"),i=l}else et.isTrue(s.getLocation(t,Oe.LEFT)===I.NONE,"found single null side"),s.setLocation(t,Oe.RIGHT,i),s.setLocation(t,Oe.LEFT,i)}}},Vn.prototype.getCoordinate=function(){var t=this.iterator();return t.hasNext()?t.next().getCoordinate():null},Vn.prototype.print=function(t){q.out.println("EdgeEndStar: "+this.getCoordinate());for(var e=this.iterator();e.hasNext();)e.next().print(t)},Vn.prototype.isAreaLabelsConsistent=function(t){return this.computeEdgeEndLabels(t.getBoundaryNodeRule()),this.checkAreaLabelsConsistent(0)},Vn.prototype.checkAreaLabelsConsistent=function(t){var e=this.getEdges();if(e.size()<=0)return!0;var n=e.size()-1,r=e.get(n).getLabel().getLocation(t,Oe.LEFT);et.isTrue(r!==I.NONE,"Found unlabelled area edge");for(var i=r,o=this.iterator();o.hasNext();){var a=o.next().getLabel();et.isTrue(a.isArea(t),"Found non-area edge");var s=a.getLocation(t,Oe.LEFT),l=a.getLocation(t,Oe.RIGHT);if(s===l)return!1;if(l!==i)return!1;i=s}return!0},Vn.prototype.findIndex=function(t){this.iterator();for(var e=0;e<this._edgeList.size();e++)if(this._edgeList.get(e)===t)return e;return-1},Vn.prototype.iterator=function(){return this.getEdges().iterator()},Vn.prototype.getEdges=function(){return null===this._edgeList&&(this._edgeList=new Et(this._edgeMap.values())),this._edgeList},Vn.prototype.getLocation=function(t,e,n){return this._ptInAreaLocation[t]===I.NONE&&(this._ptInAreaLocation[t]=Bn.locate(e,n[t].getGeometry())),this._ptInAreaLocation[t]},Vn.prototype.toString=function(){var t=new N;t.append("EdgeEndStar: "+this.getCoordinate()),t.append("\n");for(var e=this.iterator();e.hasNext();){var n=e.next();t.append(n),t.append("\n")}return t.toString()},Vn.prototype.computeEdgeEndLabels=function(t){for(var e=this.iterator();e.hasNext();)e.next().computeLabel(t)},Vn.prototype.computeLabelling=function(t){this.computeEdgeEndLabels(t[0].getBoundaryNodeRule()),this.propagateSideLabels(0),this.propagateSideLabels(1);for(var e=[!1,!1],n=this.iterator();n.hasNext();)for(var r=n.next().getLabel(),i=0;i<2;i++)r.isLine(i)&&r.getLocation(i)===I.BOUNDARY&&(e[i]=!0);for(var o=this.iterator();o.hasNext();)for(var a=o.next(),s=a.getLabel(),l=0;l<2;l++)if(s.isAnyNull(l)){var u=I.NONE;if(e[l])u=I.EXTERIOR;else{var c=a.getCoordinate();u=this.getLocation(l,c,t)}s.setAllLocationsIfNull(l,u)}},Vn.prototype.getDegree=function(){return this._edgeMap.size()},Vn.prototype.insertEdgeEnd=function(t,e){this._edgeMap.put(t,e),this._edgeList=null},Vn.prototype.interfaces_=function(){return[]},Vn.prototype.getClass=function(){return Vn};var qn=function(t){function e(){t.call(this),this._resultAreaEdgeList=null,this._label=null,this._SCANNING_FOR_INCOMING=1,this._LINKING_TO_OUTGOING=2}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.linkResultDirectedEdges=function(){this.getResultAreaEdges();for(var t=null,e=null,n=this._SCANNING_FOR_INCOMING,r=0;r<this._resultAreaEdgeList.size();r++){var i=this._resultAreaEdgeList.get(r),o=i.getSym();if(i.getLabel().isArea())switch(null===t&&i.isInResult()&&(t=i),n){case this._SCANNING_FOR_INCOMING:if(!o.isInResult())continue;e=o,n=this._LINKING_TO_OUTGOING;break;case this._LINKING_TO_OUTGOING:if(!i.isInResult())continue;e.setNext(i),n=this._SCANNING_FOR_INCOMING}}if(n===this._LINKING_TO_OUTGOING){if(null===t)throw new Ie("no outgoing dirEdge found",this.getCoordinate());et.isTrue(t.isInResult(),"unable to link last incoming dirEdge"),e.setNext(t)}},e.prototype.insert=function(t){var e=t;this.insertEdgeEnd(e,e)},e.prototype.getRightmostEdge=function(){var t=this.getEdges(),e=t.size();if(e<1)return null;var n=t.get(0);if(1===e)return n;var r=t.get(e-1),i=n.getQuadrant(),o=r.getQuadrant();return Ge.isNorthern(i)&&Ge.isNorthern(o)?n:Ge.isNorthern(i)||Ge.isNorthern(o)?0!==n.getDy()?n:0!==r.getDy()?r:(et.shouldNeverReachHere("found two horizontal edges incident on node"),null):r},e.prototype.print=function(t){q.out.println("DirectedEdgeStar: "+this.getCoordinate());for(var e=this.iterator();e.hasNext();){var n=e.next();t.print("out "),n.print(t),t.println(),t.print("in "),n.getSym().print(t),t.println()}},e.prototype.getResultAreaEdges=function(){if(null!==this._resultAreaEdgeList)return this._resultAreaEdgeList;this._resultAreaEdgeList=new Et;for(var t=this.iterator();t.hasNext();){var e=t.next();(e.isInResult()||e.getSym().isInResult())&&this._resultAreaEdgeList.add(e)}return this._resultAreaEdgeList},e.prototype.updateLabelling=function(t){for(var e=this.iterator();e.hasNext();){var n=e.next().getLabel();n.setAllLocationsIfNull(0,t.getLocation(0)),n.setAllLocationsIfNull(1,t.getLocation(1))}},e.prototype.linkAllDirectedEdges=function(){this.getEdges();for(var t=null,e=null,n=this._edgeList.size()-1;n>=0;n--){var r=this._edgeList.get(n),i=r.getSym();null===e&&(e=i),null!==t&&i.setNext(t),t=r}e.setNext(t)},e.prototype.computeDepths=function(){if(1===arguments.length){var t=arguments[0],e=this.findIndex(t),n=t.getDepth(Oe.LEFT),r=t.getDepth(Oe.RIGHT),i=this.computeDepths(e+1,this._edgeList.size(),n);if(this.computeDepths(0,e,i)!==r)throw new Ie("depth mismatch at "+t.getCoordinate())}else if(3===arguments.length){for(var o=arguments[0],a=arguments[1],s=arguments[2],l=o;l<a;l++){var u=this._edgeList.get(l);u.setEdgeDepths(Oe.RIGHT,s),s=u.getDepth(Oe.LEFT)}return s}},e.prototype.mergeSymLabels=function(){for(var t=this.iterator();t.hasNext();){var e=t.next();e.getLabel().merge(e.getSym().getLabel())}},e.prototype.linkMinimalDirectedEdges=function(t){for(var e=null,n=null,r=this._SCANNING_FOR_INCOMING,i=this._resultAreaEdgeList.size()-1;i>=0;i--){var o=this._resultAreaEdgeList.get(i),a=o.getSym();switch(null===e&&o.getEdgeRing()===t&&(e=o),r){case this._SCANNING_FOR_INCOMING:if(a.getEdgeRing()!==t)continue;n=a,r=this._LINKING_TO_OUTGOING;break;case this._LINKING_TO_OUTGOING:if(o.getEdgeRing()!==t)continue;n.setNextMin(o),r=this._SCANNING_FOR_INCOMING}}r===this._LINKING_TO_OUTGOING&&(et.isTrue(null!==e,"found null for first outgoing dirEdge"),et.isTrue(e.getEdgeRing()===t,"unable to link last incoming dirEdge"),n.setNextMin(e))},e.prototype.getOutgoingDegree=function(){if(0===arguments.length){for(var t=0,e=this.iterator();e.hasNext();)e.next().isInResult()&&t++;return t}if(1===arguments.length){for(var n=arguments[0],r=0,i=this.iterator();i.hasNext();)i.next().getEdgeRing()===n&&r++;return r}},e.prototype.getLabel=function(){return this._label},e.prototype.findCoveredLineEdges=function(){for(var t=I.NONE,e=this.iterator();e.hasNext();){var n=e.next(),r=n.getSym();if(!n.isLineEdge()){if(n.isInResult()){t=I.INTERIOR;break}if(r.isInResult()){t=I.EXTERIOR;break}}}if(t===I.NONE)return null;for(var i=t,o=this.iterator();o.hasNext();){var a=o.next(),s=a.getSym();a.isLineEdge()?a.getEdge().setCovered(i===I.INTERIOR):(a.isInResult()&&(i=I.EXTERIOR),s.isInResult()&&(i=I.INTERIOR))}},e.prototype.computeLabelling=function(e){t.prototype.computeLabelling.call(this,e),this._label=new Me(I.NONE);for(var n=this.iterator();n.hasNext();)for(var r=n.next().getEdge().getLabel(),i=0;i<2;i++){var o=r.getLocation(i);o!==I.INTERIOR&&o!==I.BOUNDARY||this._label.setLocation(i,I.INTERIOR)}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Vn),Yn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createNode=function(t){return new Fe(t,new qn)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Ve),Xn=function t(){this._pts=null,this._orientation=null;var e=arguments[0];this._pts=e,this._orientation=t.orientation(e)};Xn.prototype.compareTo=function(t){var e=t;return Xn.compareOriented(this._pts,this._orientation,e._pts,e._orientation)},Xn.prototype.interfaces_=function(){return[w]},Xn.prototype.getClass=function(){return Xn},Xn.orientation=function(t){return 1===Ct.increasingDirection(t)},Xn.compareOriented=function(t,e,n,r){for(var i=e?1:-1,o=r?1:-1,a=e?t.length:-1,s=r?n.length:-1,l=e?0:t.length-1,u=r?0:n.length-1;;){var c=t[l].compareTo(n[u]);if(0!==c)return c;var h=(l+=i)===a,p=(u+=o)===s;if(h&&!p)return-1;if(!h&&p)return 1;if(h&&p)return 0}};var Wn=function(){this._edges=new Et,this._ocaMap=new h};Wn.prototype.print=function(t){t.print("MULTILINESTRING ( ");for(var e=0;e<this._edges.size();e++){var n=this._edges.get(e);e>0&&t.print(","),t.print("(");for(var r=n.getCoordinates(),i=0;i<r.length;i++)i>0&&t.print(","),t.print(r[i].x+" "+r[i].y);t.println(")")}t.print(") ")},Wn.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next())},Wn.prototype.findEdgeIndex=function(t){for(var e=0;e<this._edges.size();e++)if(this._edges.get(e).equals(t))return e;return-1},Wn.prototype.iterator=function(){return this._edges.iterator()},Wn.prototype.getEdges=function(){return this._edges},Wn.prototype.get=function(t){return this._edges.get(t)},Wn.prototype.findEqualEdge=function(t){var e=new Xn(t.getCoordinates());return this._ocaMap.get(e)},Wn.prototype.add=function(t){this._edges.add(t);var e=new Xn(t.getCoordinates());this._ocaMap.put(e,t)},Wn.prototype.interfaces_=function(){return[]},Wn.prototype.getClass=function(){return Wn};var Hn=function(){};Hn.prototype.processIntersections=function(t,e,n,r){},Hn.prototype.isDone=function(){},Hn.prototype.interfaces_=function(){return[]},Hn.prototype.getClass=function(){return Hn};var Kn=function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._hasInterior=!1,this._properIntersectionPoint=null,this._li=null,this._isSelfIntersection=null,this.numIntersections=0,this.numInteriorIntersections=0,this.numProperIntersections=0,this.numTests=0;var t=arguments[0];this._li=t};Kn.prototype.isTrivialIntersection=function(t,e,n,r){if(t===n&&1===this._li.getIntersectionNum()){if(Kn.isAdjacentSegments(e,r))return!0;if(t.isClosed()){var i=t.size()-1;if(0===e&&r===i||0===r&&e===i)return!0}}return!1},Kn.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},Kn.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},Kn.prototype.getLineIntersector=function(){return this._li},Kn.prototype.hasProperIntersection=function(){return this._hasProper},Kn.prototype.processIntersections=function(t,e,n,r){if(t===n&&e===r)return null;this.numTests++;var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],a=n.getCoordinates()[r],s=n.getCoordinates()[r+1];this._li.computeIntersection(i,o,a,s),this._li.hasIntersection()&&(this.numIntersections++,this._li.isInteriorIntersection()&&(this.numInteriorIntersections++,this._hasInterior=!0),this.isTrivialIntersection(t,e,n,r)||(this._hasIntersection=!0,t.addIntersections(this._li,e,0),n.addIntersections(this._li,r,1),this._li.isProper()&&(this.numProperIntersections++,this._hasProper=!0,this._hasProperInterior=!0)))},Kn.prototype.hasIntersection=function(){return this._hasIntersection},Kn.prototype.isDone=function(){return!1},Kn.prototype.hasInteriorIntersection=function(){return this._hasInterior},Kn.prototype.interfaces_=function(){return[Hn]},Kn.prototype.getClass=function(){return Kn},Kn.isAdjacentSegments=function(t,e){return 1===Math.abs(t-e)};var Zn=function(){this.coord=null,this.segmentIndex=null,this.dist=null;var t=arguments[0],e=arguments[1],n=arguments[2];this.coord=new S(t),this.segmentIndex=e,this.dist=n};Zn.prototype.getSegmentIndex=function(){return this.segmentIndex},Zn.prototype.getCoordinate=function(){return this.coord},Zn.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex),t.println(" dist = "+this.dist)},Zn.prototype.compareTo=function(t){var e=t;return this.compare(e.segmentIndex,e.dist)},Zn.prototype.isEndPoint=function(t){return 0===this.segmentIndex&&0===this.dist||this.segmentIndex===t},Zn.prototype.toString=function(){return this.coord+" seg # = "+this.segmentIndex+" dist = "+this.dist},Zn.prototype.getDistance=function(){return this.dist},Zn.prototype.compare=function(t,e){return this.segmentIndex<t?-1:this.segmentIndex>t?1:this.dist<e?-1:this.dist>e?1:0},Zn.prototype.interfaces_=function(){return[w]},Zn.prototype.getClass=function(){return Zn};var $n=function(){this._nodeMap=new h,this.edge=null;var t=arguments[0];this.edge=t};$n.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();)e.next().print(t)},$n.prototype.iterator=function(){return this._nodeMap.values().iterator()},$n.prototype.addSplitEdges=function(t){this.addEndpoints();for(var e=this.iterator(),n=e.next();e.hasNext();){var r=e.next(),i=this.createSplitEdge(n,r);t.add(i),n=r}},$n.prototype.addEndpoints=function(){var t=this.edge.pts.length-1;this.add(this.edge.pts[0],0,0),this.add(this.edge.pts[t],t,0)},$n.prototype.createSplitEdge=function(t,e){var n=e.segmentIndex-t.segmentIndex+2,r=this.edge.pts[e.segmentIndex],i=e.dist>0||!e.coord.equals2D(r);i||n--;var o=new Array(n).fill(null),a=0;o[a++]=new S(t.coord);for(var s=t.segmentIndex+1;s<=e.segmentIndex;s++)o[a++]=this.edge.pts[s];return i&&(o[a]=e.coord),new nr(o,new Me(this.edge._label))},$n.prototype.add=function(t,e,n){var r=new Zn(t,e,n),i=this._nodeMap.get(r);return null!==i?i:(this._nodeMap.put(r,r),r)},$n.prototype.isIntersection=function(t){for(var e=this.iterator();e.hasNext();)if(e.next().coord.equals(t))return!0;return!1},$n.prototype.interfaces_=function(){return[]},$n.prototype.getClass=function(){return $n};var Jn=function(){};Jn.prototype.getChainStartIndices=function(t){var e=0,n=new Et;n.add(new j(e));do{var r=this.findChainEnd(t,e);n.add(new j(r)),e=r}while(e<t.length-1);return Jn.toIntArray(n)},Jn.prototype.findChainEnd=function(t,e){for(var n=Ge.quadrant(t[e],t[e+1]),r=e+1;r<t.length&&Ge.quadrant(t[r-1],t[r])===n;)r++;return r-1},Jn.prototype.interfaces_=function(){return[]},Jn.prototype.getClass=function(){return Jn},Jn.toIntArray=function(t){for(var e=new Array(t.size()).fill(null),n=0;n<e.length;n++)e[n]=t.get(n).intValue();return e};var Qn=function(){this.e=null,this.pts=null,this.startIndex=null,this.env1=new X,this.env2=new X;var t=arguments[0];this.e=t,this.pts=t.getCoordinates();var e=new Jn;this.startIndex=e.getChainStartIndices(this.pts)};Qn.prototype.getCoordinates=function(){return this.pts},Qn.prototype.getMaxX=function(t){var e=this.pts[this.startIndex[t]].x,n=this.pts[this.startIndex[t+1]].x;return e>n?e:n},Qn.prototype.getMinX=function(t){var e=this.pts[this.startIndex[t]].x,n=this.pts[this.startIndex[t+1]].x;return e<n?e:n},Qn.prototype.computeIntersectsForChain=function(){if(4===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2],r=arguments[3];this.computeIntersectsForChain(this.startIndex[t],this.startIndex[t+1],e,e.startIndex[n],e.startIndex[n+1],r)}else if(6===arguments.length){var i=arguments[0],o=arguments[1],a=arguments[2],s=arguments[3],l=arguments[4],u=arguments[5],c=this.pts[i],h=this.pts[o],p=a.pts[s],d=a.pts[l];if(o-i==1&&l-s==1)return u.addIntersections(this.e,i,a.e,s),null;if(this.env1.init(c,h),this.env2.init(p,d),!this.env1.intersects(this.env2))return null;var f=Math.trunc((i+o)/2),g=Math.trunc((s+l)/2);i<f&&(s<g&&this.computeIntersectsForChain(i,f,a,s,g,u),g<l&&this.computeIntersectsForChain(i,f,a,g,l,u)),f<o&&(s<g&&this.computeIntersectsForChain(f,o,a,s,g,u),g<l&&this.computeIntersectsForChain(f,o,a,g,l,u))}},Qn.prototype.getStartIndexes=function(){return this.startIndex},Qn.prototype.computeIntersects=function(t,e){for(var n=0;n<this.startIndex.length-1;n++)for(var r=0;r<t.startIndex.length-1;r++)this.computeIntersectsForChain(n,t,r,e)},Qn.prototype.interfaces_=function(){return[]},Qn.prototype.getClass=function(){return Qn};var tr=function t(){this._depth=Array(2).fill().map((function(){return Array(3)}));for(var e=0;e<2;e++)for(var n=0;n<3;n++)this._depth[e][n]=t.NULL_VALUE},er={NULL_VALUE:{configurable:!0}};tr.prototype.getDepth=function(t,e){return this._depth[t][e]},tr.prototype.setDepth=function(t,e,n){this._depth[t][e]=n},tr.prototype.isNull=function(){if(0===arguments.length){for(var t=0;t<2;t++)for(var e=0;e<3;e++)if(this._depth[t][e]!==tr.NULL_VALUE)return!1;return!0}if(1===arguments.length){var n=arguments[0];return this._depth[n][1]===tr.NULL_VALUE}if(2===arguments.length){var r=arguments[0],i=arguments[1];return this._depth[r][i]===tr.NULL_VALUE}},tr.prototype.normalize=function(){for(var t=0;t<2;t++)if(!this.isNull(t)){var e=this._depth[t][1];this._depth[t][2]<e&&(e=this._depth[t][2]),e<0&&(e=0);for(var n=1;n<3;n++){var r=0;this._depth[t][n]>e&&(r=1),this._depth[t][n]=r}}},tr.prototype.getDelta=function(t){return this._depth[t][Oe.RIGHT]-this._depth[t][Oe.LEFT]},tr.prototype.getLocation=function(t,e){return this._depth[t][e]<=0?I.EXTERIOR:I.INTERIOR},tr.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]},tr.prototype.add=function(){if(1===arguments.length)for(var t=arguments[0],e=0;e<2;e++)for(var n=1;n<3;n++){var r=t.getLocation(e,n);r!==I.EXTERIOR&&r!==I.INTERIOR||(this.isNull(e,n)?this._depth[e][n]=tr.depthAtLocation(r):this._depth[e][n]+=tr.depthAtLocation(r))}else if(3===arguments.length){var i=arguments[0],o=arguments[1];arguments[2]===I.INTERIOR&&this._depth[i][o]++}},tr.prototype.interfaces_=function(){return[]},tr.prototype.getClass=function(){return tr},tr.depthAtLocation=function(t){return t===I.EXTERIOR?0:t===I.INTERIOR?1:tr.NULL_VALUE},er.NULL_VALUE.get=function(){return-1},Object.defineProperties(tr,er);var nr=function(t){function e(){if(t.call(this),this.pts=null,this._env=null,this.eiList=new $n(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new tr,this._depthDelta=0,1===arguments.length){var n=arguments[0];e.call(this,n,null)}else if(2===arguments.length){var r=arguments[0],i=arguments[1];this.pts=r,this._label=i}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDepth=function(){return this._depth},e.prototype.getCollapsedEdge=function(){var t=new Array(2).fill(null);return t[0]=this.pts[0],t[1]=this.pts[1],new e(t,Me.toLineLabel(this._label))},e.prototype.isIsolated=function(){return this._isIsolated},e.prototype.getCoordinates=function(){return this.pts},e.prototype.setIsolated=function(t){this._isIsolated=t},e.prototype.setName=function(t){this._name=t},e.prototype.equals=function(t){if(!(t instanceof e))return!1;var n=t;if(this.pts.length!==n.pts.length)return!1;for(var r=!0,i=!0,o=this.pts.length,a=0;a<this.pts.length;a++)if(this.pts[a].equals2D(n.pts[a])||(r=!1),this.pts[a].equals2D(n.pts[--o])||(i=!1),!r&&!i)return!1;return!0},e.prototype.getCoordinate=function(){if(0===arguments.length)return this.pts.length>0?this.pts[0]:null;if(1===arguments.length){var t=arguments[0];return this.pts[t]}},e.prototype.print=function(t){t.print("edge "+this._name+": "),t.print("LINESTRING (");for(var e=0;e<this.pts.length;e++)e>0&&t.print(","),t.print(this.pts[e].x+" "+this.pts[e].y);t.print(") "+this._label+" "+this._depthDelta)},e.prototype.computeIM=function(t){e.updateIM(this._label,t)},e.prototype.isCollapsed=function(){return!!this._label.isArea()&&3===this.pts.length&&!!this.pts[0].equals(this.pts[2])},e.prototype.isClosed=function(){return this.pts[0].equals(this.pts[this.pts.length-1])},e.prototype.getMaximumSegmentIndex=function(){return this.pts.length-1},e.prototype.getDepthDelta=function(){return this._depthDelta},e.prototype.getNumPoints=function(){return this.pts.length},e.prototype.printReverse=function(t){t.print("edge "+this._name+": ");for(var e=this.pts.length-1;e>=0;e--)t.print(this.pts[e]+" ");t.println("")},e.prototype.getMonotoneChainEdge=function(){return null===this._mce&&(this._mce=new Qn(this)),this._mce},e.prototype.getEnvelope=function(){if(null===this._env){this._env=new X;for(var t=0;t<this.pts.length;t++)this._env.expandToInclude(this.pts[t])}return this._env},e.prototype.addIntersection=function(t,e,n,r){var i=new S(t.getIntersection(r)),o=e,a=t.getEdgeDistance(n,r),s=o+1;if(s<this.pts.length){var l=this.pts[s];i.equals2D(l)&&(o=s,a=0)}this.eiList.add(i,o,a)},e.prototype.toString=function(){var t=new N;t.append("edge "+this._name+": "),t.append("LINESTRING (");for(var e=0;e<this.pts.length;e++)e>0&&t.append(","),t.append(this.pts[e].x+" "+this.pts[e].y);return t.append(") "+this._label+" "+this._depthDelta),t.toString()},e.prototype.isPointwiseEqual=function(t){if(this.pts.length!==t.pts.length)return!1;for(var e=0;e<this.pts.length;e++)if(!this.pts[e].equals2D(t.pts[e]))return!1;return!0},e.prototype.setDepthDelta=function(t){this._depthDelta=t},e.prototype.getEdgeIntersectionList=function(){return this.eiList},e.prototype.addIntersections=function(t,e,n){for(var r=0;r<t.getIntersectionNum();r++)this.addIntersection(t,e,n,r)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.updateIM=function(){if(2!==arguments.length)return t.prototype.updateIM.apply(this,arguments);var e=arguments[0],n=arguments[1];n.setAtLeastIfValid(e.getLocation(0,Oe.ON),e.getLocation(1,Oe.ON),1),e.isArea()&&(n.setAtLeastIfValid(e.getLocation(0,Oe.LEFT),e.getLocation(1,Oe.LEFT),2),n.setAtLeastIfValid(e.getLocation(0,Oe.RIGHT),e.getLocation(1,Oe.RIGHT),2))},e}(ke),rr=function(t){this._workingPrecisionModel=null,this._workingNoder=null,this._geomFact=null,this._graph=null,this._edgeList=new Wn,this._bufParams=t||null};rr.prototype.setWorkingPrecisionModel=function(t){this._workingPrecisionModel=t},rr.prototype.insertUniqueEdge=function(t){var e=this._edgeList.findEqualEdge(t);if(null!==e){var n=e.getLabel(),r=t.getLabel();e.isPointwiseEqual(t)||(r=new Me(t.getLabel())).flip(),n.merge(r);var i=rr.depthDelta(r),o=e.getDepthDelta()+i;e.setDepthDelta(o)}else this._edgeList.add(t),t.setDepthDelta(rr.depthDelta(t.getLabel()))},rr.prototype.buildSubgraphs=function(t,e){for(var n=new Et,r=t.iterator();r.hasNext();){var i=r.next(),o=i.getRightmostCoordinate(),a=new An(n).getDepth(o);i.computeDepth(a),i.findResultEdges(),n.add(i),e.add(i.getDirectedEdges(),i.getNodes())}},rr.prototype.createSubgraphs=function(t){for(var e=new Et,n=t.getNodes().iterator();n.hasNext();){var r=n.next();if(!r.isVisited()){var i=new Pe;i.create(r),e.add(i)}}return Qe.sort(e,Qe.reverseOrder()),e},rr.prototype.createEmptyResultGeometry=function(){return this._geomFact.createPolygon()},rr.prototype.getNoder=function(t){if(null!==this._workingNoder)return this._workingNoder;var e=new xn,n=new it;return n.setPrecisionModel(t),e.setSegmentIntersector(new Kn(n)),e},rr.prototype.buffer=function(t,e){var n=this._workingPrecisionModel;null===n&&(n=t.getPrecisionModel()),this._geomFact=t.getFactory();var r=new jn(n,this._bufParams),i=new Gn(t,e,r).getCurves();if(i.size()<=0)return this.createEmptyResultGeometry();this.computeNodedEdges(i,n),this._graph=new qe(new Yn),this._graph.addEdges(this._edgeList.getEdges());var o=this.createSubgraphs(this._graph),a=new Ye(this._geomFact);this.buildSubgraphs(o,a);var s=a.getPolygons();return s.size()<=0?this.createEmptyResultGeometry():this._geomFact.buildGeometry(s)},rr.prototype.computeNodedEdges=function(t,e){var n=this.getNoder(e);n.computeNodes(t);for(var r=n.getNodedSubstrings().iterator();r.hasNext();){var i=r.next(),o=i.getCoordinates();if(2!==o.length||!o[0].equals2D(o[1])){var a=i.getData(),s=new nr(i.getCoordinates(),new Me(a));this.insertUniqueEdge(s)}}},rr.prototype.setNoder=function(t){this._workingNoder=t},rr.prototype.interfaces_=function(){return[]},rr.prototype.getClass=function(){return rr},rr.depthDelta=function(t){var e=t.getLocation(0,Oe.LEFT),n=t.getLocation(0,Oe.RIGHT);return e===I.INTERIOR&&n===I.EXTERIOR?1:e===I.EXTERIOR&&n===I.INTERIOR?-1:0},rr.convertSegStrings=function(t){for(var e=new me,n=new Et;t.hasNext();){var r=t.next(),i=e.createLineString(r.getCoordinates());n.add(i)}return e.buildGeometry(n)};var ir=function(){if(this._noder=null,this._scaleFactor=null,this._offsetX=null,this._offsetY=null,this._isScaled=!1,2===arguments.length){var t=arguments[0],e=arguments[1];this._noder=t,this._scaleFactor=e,this._offsetX=0,this._offsetY=0,this._isScaled=!this.isIntegerPrecision()}else if(4===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2],o=arguments[3];this._noder=n,this._scaleFactor=r,this._offsetX=i,this._offsetY=o,this._isScaled=!this.isIntegerPrecision()}};ir.prototype.rescale=function(){if(P(arguments[0],bt))for(var t=arguments[0].iterator();t.hasNext();){var e=t.next();this.rescale(e.getCoordinates())}else if(arguments[0]instanceof Array){for(var n=arguments[0],r=0;r<n.length;r++)n[r].x=n[r].x/this._scaleFactor+this._offsetX,n[r].y=n[r].y/this._scaleFactor+this._offsetY;2===n.length&&n[0].equals2D(n[1])&&q.out.println(n)}},ir.prototype.scale=function(){if(P(arguments[0],bt)){for(var t=arguments[0],e=new Et,n=t.iterator();n.hasNext();){var r=n.next();e.add(new fn(this.scale(r.getCoordinates()),r.getData()))}return e}if(arguments[0]instanceof Array){for(var i=arguments[0],o=new Array(i.length).fill(null),a=0;a<i.length;a++)o[a]=new S(Math.round((i[a].x-this._offsetX)*this._scaleFactor),Math.round((i[a].y-this._offsetY)*this._scaleFactor),i[a].z);return Ct.removeRepeatedPoints(o)}},ir.prototype.isIntegerPrecision=function(){return 1===this._scaleFactor},ir.prototype.getNodedSubstrings=function(){var t=this._noder.getNodedSubstrings();return this._isScaled&&this.rescale(t),t},ir.prototype.computeNodes=function(t){var e=t;this._isScaled&&(e=this.scale(t)),this._noder.computeNodes(e)},ir.prototype.interfaces_=function(){return[bn]},ir.prototype.getClass=function(){return ir};var or=function(){this._li=new it,this._segStrings=null;var t=arguments[0];this._segStrings=t},ar={fact:{configurable:!0}};or.prototype.checkEndPtVertexIntersections=function(){if(0===arguments.length)for(var t=this._segStrings.iterator();t.hasNext();){var e=t.next().getCoordinates();this.checkEndPtVertexIntersections(e[0],this._segStrings),this.checkEndPtVertexIntersections(e[e.length-1],this._segStrings)}else if(2===arguments.length)for(var n=arguments[0],r=arguments[1].iterator();r.hasNext();)for(var i=r.next().getCoordinates(),o=1;o<i.length-1;o++)if(i[o].equals(n))throw new Q("found endpt/interior pt intersection at index "+o+" :pt "+n)},or.prototype.checkInteriorIntersections=function(){if(0===arguments.length)for(var t=this._segStrings.iterator();t.hasNext();)for(var e=t.next(),n=this._segStrings.iterator();n.hasNext();){var r=n.next();this.checkInteriorIntersections(e,r)}else if(2===arguments.length)for(var i=arguments[0],o=arguments[1],a=i.getCoordinates(),s=o.getCoordinates(),l=0;l<a.length-1;l++)for(var u=0;u<s.length-1;u++)this.checkInteriorIntersections(i,l,o,u);else if(4===arguments.length){var c=arguments[0],h=arguments[1],p=arguments[2],d=arguments[3];if(c===p&&h===d)return null;var f=c.getCoordinates()[h],g=c.getCoordinates()[h+1],y=p.getCoordinates()[d],m=p.getCoordinates()[d+1];if(this._li.computeIntersection(f,g,y,m),this._li.hasIntersection()&&(this._li.isProper()||this.hasInteriorIntersection(this._li,f,g)||this.hasInteriorIntersection(this._li,y,m)))throw new Q("found non-noded intersection at "+f+"-"+g+" and "+y+"-"+m)}},or.prototype.checkValid=function(){this.checkEndPtVertexIntersections(),this.checkInteriorIntersections(),this.checkCollapses()},or.prototype.checkCollapses=function(){if(0===arguments.length)for(var t=this._segStrings.iterator();t.hasNext();){var e=t.next();this.checkCollapses(e)}else if(1===arguments.length)for(var n=arguments[0].getCoordinates(),r=0;r<n.length-2;r++)this.checkCollapse(n[r],n[r+1],n[r+2])},or.prototype.hasInteriorIntersection=function(t,e,n){for(var r=0;r<t.getIntersectionNum();r++){var i=t.getIntersection(r);if(!i.equals(e)&&!i.equals(n))return!0}return!1},or.prototype.checkCollapse=function(t,e,n){if(t.equals(n))throw new Q("found non-noded collapse at "+or.fact.createLineString([t,e,n]))},or.prototype.interfaces_=function(){return[]},or.prototype.getClass=function(){return or},ar.fact.get=function(){return new me},Object.defineProperties(or,ar);var sr=function(){this._li=null,this._pt=null,this._originalPt=null,this._ptScaled=null,this._p0Scaled=null,this._p1Scaled=null,this._scaleFactor=null,this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,this._corner=new Array(4).fill(null),this._safeEnv=null;var t=arguments[0],e=arguments[1],n=arguments[2];if(this._originalPt=t,this._pt=t,this._scaleFactor=e,this._li=n,e<=0)throw new v("Scale factor must be non-zero");1!==e&&(this._pt=new S(this.scale(t.x),this.scale(t.y)),this._p0Scaled=new S,this._p1Scaled=new S),this.initCorners(this._pt)},lr={SAFE_ENV_EXPANSION_FACTOR:{configurable:!0}};sr.prototype.intersectsScaled=function(t,e){var n=Math.min(t.x,e.x),r=Math.max(t.x,e.x),i=Math.min(t.y,e.y),o=Math.max(t.y,e.y),a=this._maxx<n||this._minx>r||this._maxy<i||this._miny>o;if(a)return!1;var s=this.intersectsToleranceSquare(t,e);return et.isTrue(!(a&&s),"Found bad envelope test"),s},sr.prototype.initCorners=function(t){this._minx=t.x-.5,this._maxx=t.x+.5,this._miny=t.y-.5,this._maxy=t.y+.5,this._corner[0]=new S(this._maxx,this._maxy),this._corner[1]=new S(this._minx,this._maxy),this._corner[2]=new S(this._minx,this._miny),this._corner[3]=new S(this._maxx,this._miny)},sr.prototype.intersects=function(t,e){return 1===this._scaleFactor?this.intersectsScaled(t,e):(this.copyScaled(t,this._p0Scaled),this.copyScaled(e,this._p1Scaled),this.intersectsScaled(this._p0Scaled,this._p1Scaled))},sr.prototype.scale=function(t){return Math.round(t*this._scaleFactor)},sr.prototype.getCoordinate=function(){return this._originalPt},sr.prototype.copyScaled=function(t,e){e.x=this.scale(t.x),e.y=this.scale(t.y)},sr.prototype.getSafeEnvelope=function(){if(null===this._safeEnv){var t=sr.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new X(this._originalPt.x-t,this._originalPt.x+t,this._originalPt.y-t,this._originalPt.y+t)}return this._safeEnv},sr.prototype.intersectsPixelClosure=function(t,e){return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!(this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),this._li.hasIntersection()))))},sr.prototype.intersectsToleranceSquare=function(t,e){var n=!1,r=!1;return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!(this._li.isProper()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),this._li.isProper()||(this._li.hasIntersection()&&(n=!0),this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),this._li.isProper()||(this._li.hasIntersection()&&(r=!0),this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),this._li.isProper()||n&&r||t.equals(this._pt)||e.equals(this._pt)))))},sr.prototype.addSnappedNode=function(t,e){var n=t.getCoordinate(e),r=t.getCoordinate(e+1);return!!this.intersects(n,r)&&(t.addIntersection(this.getCoordinate(),e),!0)},sr.prototype.interfaces_=function(){return[]},sr.prototype.getClass=function(){return sr},lr.SAFE_ENV_EXPANSION_FACTOR.get=function(){return.75},Object.defineProperties(sr,lr);var ur=function(){this.tempEnv1=new X,this.selectedSegment=new gn};ur.prototype.select=function(){if(1===arguments.length);else if(2===arguments.length){var t=arguments[0],e=arguments[1];t.getLineSegment(e,this.selectedSegment),this.select(this.selectedSegment)}},ur.prototype.interfaces_=function(){return[]},ur.prototype.getClass=function(){return ur};var cr=function(){this._index=null;var t=arguments[0];this._index=t},hr={HotPixelSnapAction:{configurable:!0}};cr.prototype.snap=function(){if(1===arguments.length){var t=arguments[0];return this.snap(t,null,-1)}if(3===arguments.length){var e=arguments[0],n=arguments[1],r=arguments[2],i=e.getSafeEnvelope(),o=new pr(e,n,r);return this._index.query(i,{interfaces_:function(){return[Ke]},visitItem:function(t){t.select(i,o)}}),o.isNodeAdded()}},cr.prototype.interfaces_=function(){return[]},cr.prototype.getClass=function(){return cr},hr.HotPixelSnapAction.get=function(){return pr},Object.defineProperties(cr,hr);var pr=function(t){function e(){t.call(this),this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;var e=arguments[0],n=arguments[1],r=arguments[2];this._hotPixel=e,this._parentEdge=n,this._hotPixelVertexIndex=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isNodeAdded=function(){return this._isNodeAdded},e.prototype.select=function(){if(2!==arguments.length)return t.prototype.select.apply(this,arguments);var e=arguments[0],n=arguments[1],r=e.getContext();if(null!==this._parentEdge&&r===this._parentEdge&&n===this._hotPixelVertexIndex)return null;this._isNodeAdded=this._hotPixel.addSnappedNode(r,n)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(ur),dr=function(){this._li=null,this._interiorIntersections=null;var t=arguments[0];this._li=t,this._interiorIntersections=new Et};dr.prototype.processIntersections=function(t,e,n,r){if(t===n&&e===r)return null;var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],a=n.getCoordinates()[r],s=n.getCoordinates()[r+1];if(this._li.computeIntersection(i,o,a,s),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var l=0;l<this._li.getIntersectionNum();l++)this._interiorIntersections.add(this._li.getIntersection(l));t.addIntersections(this._li,e,0),n.addIntersections(this._li,r,1)}},dr.prototype.isDone=function(){return!1},dr.prototype.getInteriorIntersections=function(){return this._interiorIntersections},dr.prototype.interfaces_=function(){return[Hn]},dr.prototype.getClass=function(){return dr};var fr=function(){this._pm=null,this._li=null,this._scaleFactor=null,this._noder=null,this._pointSnapper=null,this._nodedSegStrings=null;var t=arguments[0];this._pm=t,this._li=new it,this._li.setPrecisionModel(t),this._scaleFactor=t.getScale()};fr.prototype.checkCorrectness=function(t){var e=fn.getNodedSubstrings(t),n=new or(e);try{n.checkValid()}catch(t){if(!(t instanceof B))throw t;t.printStackTrace()}},fr.prototype.getNodedSubstrings=function(){return fn.getNodedSubstrings(this._nodedSegStrings)},fr.prototype.snapRound=function(t,e){var n=this.findInteriorIntersections(t,e);this.computeIntersectionSnaps(n),this.computeVertexSnaps(t)},fr.prototype.findInteriorIntersections=function(t,e){var n=new dr(e);return this._noder.setSegmentIntersector(n),this._noder.computeNodes(t),n.getInteriorIntersections()},fr.prototype.computeVertexSnaps=function(){if(P(arguments[0],bt))for(var t=arguments[0].iterator();t.hasNext();){var e=t.next();this.computeVertexSnaps(e)}else if(arguments[0]instanceof fn)for(var n=arguments[0],r=n.getCoordinates(),i=0;i<r.length;i++){var o=new sr(r[i],this._scaleFactor,this._li);this._pointSnapper.snap(o,n,i)&&n.addIntersection(r[i],i)}},fr.prototype.computeNodes=function(t){this._nodedSegStrings=t,this._noder=new xn,this._pointSnapper=new cr(this._noder.getIndex()),this.snapRound(t,this._li)},fr.prototype.computeIntersectionSnaps=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next(),r=new sr(n,this._scaleFactor,this._li);this._pointSnapper.snap(r)}},fr.prototype.interfaces_=function(){return[bn]},fr.prototype.getClass=function(){return fr};var gr=function(){if(this._argGeom=null,this._distance=null,this._bufParams=new Sn,this._resultGeometry=null,this._saveException=null,1===arguments.length){var t=arguments[0];this._argGeom=t}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this._argGeom=e,this._bufParams=n}},yr={CAP_ROUND:{configurable:!0},CAP_BUTT:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},MAX_PRECISION_DIGITS:{configurable:!0}};gr.prototype.bufferFixedPrecision=function(t){var e=new ir(new fr(new de(1)),t.getScale()),n=new rr(this._bufParams);n.setWorkingPrecisionModel(t),n.setNoder(e),this._resultGeometry=n.buffer(this._argGeom,this._distance)},gr.prototype.bufferReducedPrecision=function(){var t=this;if(0===arguments.length){for(var e=gr.MAX_PRECISION_DIGITS;e>=0;e--){try{t.bufferReducedPrecision(e)}catch(e){if(!(e instanceof Ie))throw e;t._saveException=e}if(null!==t._resultGeometry)return null}throw this._saveException}if(1===arguments.length){var n=arguments[0],r=gr.precisionScaleFactor(this._argGeom,this._distance,n),i=new de(r);this.bufferFixedPrecision(i)}},gr.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),null!==this._resultGeometry)return null;var t=this._argGeom.getFactory().getPrecisionModel();t.getType()===de.FIXED?this.bufferFixedPrecision(t):this.bufferReducedPrecision()},gr.prototype.setQuadrantSegments=function(t){this._bufParams.setQuadrantSegments(t)},gr.prototype.bufferOriginalPrecision=function(){try{var t=new rr(this._bufParams);this._resultGeometry=t.buffer(this._argGeom,this._distance)}catch(t){if(!(t instanceof Q))throw t;this._saveException=t}},gr.prototype.getResultGeometry=function(t){return this._distance=t,this.computeGeometry(),this._resultGeometry},gr.prototype.setEndCapStyle=function(t){this._bufParams.setEndCapStyle(t)},gr.prototype.interfaces_=function(){return[]},gr.prototype.getClass=function(){return gr},gr.bufferOp=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return new gr(t).getResultGeometry(e)}if(3===arguments.length){if(Number.isInteger(arguments[2])&&arguments[0]instanceof ct&&"number"==typeof arguments[1]){var n=arguments[0],r=arguments[1],i=arguments[2],o=new gr(n);return o.setQuadrantSegments(i),o.getResultGeometry(r)}if(arguments[2]instanceof Sn&&arguments[0]instanceof ct&&"number"==typeof arguments[1]){var a=arguments[0],s=arguments[1],l=arguments[2];return new gr(a,l).getResultGeometry(s)}}else if(4===arguments.length){var u=arguments[0],c=arguments[1],h=arguments[2],p=arguments[3],d=new gr(u);return d.setQuadrantSegments(h),d.setEndCapStyle(p),d.getResultGeometry(c)}},gr.precisionScaleFactor=function(t,e,n){var r=t.getEnvelopeInternal(),i=R.max(Math.abs(r.getMaxX()),Math.abs(r.getMaxY()),Math.abs(r.getMinX()),Math.abs(r.getMinY()))+2*(e>0?e:0),o=n-Math.trunc(Math.log(i)/Math.log(10)+1);return Math.pow(10,o)},yr.CAP_ROUND.get=function(){return Sn.CAP_ROUND},yr.CAP_BUTT.get=function(){return Sn.CAP_FLAT},yr.CAP_FLAT.get=function(){return Sn.CAP_FLAT},yr.CAP_SQUARE.get=function(){return Sn.CAP_SQUARE},yr.MAX_PRECISION_DIGITS.get=function(){return 12},Object.defineProperties(gr,yr);var mr=function(){this._pt=[new S,new S],this._distance=_.NaN,this._isNull=!0};mr.prototype.getCoordinates=function(){return this._pt},mr.prototype.getCoordinate=function(t){return this._pt[t]},mr.prototype.setMinimum=function(){if(1===arguments.length){var t=arguments[0];this.setMinimum(t._pt[0],t._pt[1])}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var r=e.distance(n);r<this._distance&&this.initialize(e,n,r)}},mr.prototype.initialize=function(){if(0===arguments.length)this._isNull=!0;else if(2===arguments.length){var t=arguments[0],e=arguments[1];this._pt[0].setCoordinate(t),this._pt[1].setCoordinate(e),this._distance=t.distance(e),this._isNull=!1}else if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];this._pt[0].setCoordinate(n),this._pt[1].setCoordinate(r),this._distance=i,this._isNull=!1}},mr.prototype.getDistance=function(){return this._distance},mr.prototype.setMaximum=function(){if(1===arguments.length){var t=arguments[0];this.setMaximum(t._pt[0],t._pt[1])}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var r=e.distance(n);r>this._distance&&this.initialize(e,n,r)}},mr.prototype.interfaces_=function(){return[]},mr.prototype.getClass=function(){return mr};var vr=function(){};vr.prototype.interfaces_=function(){return[]},vr.prototype.getClass=function(){return vr},vr.computeDistance=function(){if(arguments[2]instanceof mr&&arguments[0]instanceof Kt&&arguments[1]instanceof S)for(var t=arguments[0],e=arguments[1],n=arguments[2],r=t.getCoordinates(),i=new gn,o=0;o<r.length-1;o++){i.setCoordinates(r[o],r[o+1]);var a=i.closestPoint(e);n.setMinimum(a,e)}else if(arguments[2]instanceof mr&&arguments[0]instanceof Qt&&arguments[1]instanceof S){var s=arguments[0],l=arguments[1],u=arguments[2];vr.computeDistance(s.getExteriorRing(),l,u);for(var c=0;c<s.getNumInteriorRing();c++)vr.computeDistance(s.getInteriorRingN(c),l,u)}else if(arguments[2]instanceof mr&&arguments[0]instanceof ct&&arguments[1]instanceof S){var h=arguments[0],p=arguments[1],d=arguments[2];if(h instanceof Kt)vr.computeDistance(h,p,d);else if(h instanceof Qt)vr.computeDistance(h,p,d);else if(h instanceof Bt)for(var f=h,g=0;g<f.getNumGeometries();g++){var y=f.getGeometryN(g);vr.computeDistance(y,p,d)}else d.setMinimum(h.getCoordinate(),p)}else if(arguments[2]instanceof mr&&arguments[0]instanceof gn&&arguments[1]instanceof S){var m=arguments[0],v=arguments[1],_=arguments[2],b=m.closestPoint(v);_.setMinimum(b,v)}};var _r=function(t){this._maxPtDist=new mr,this._inputGeom=t||null},br={MaxPointDistanceFilter:{configurable:!0},MaxMidpointDistanceFilter:{configurable:!0}};_r.prototype.computeMaxMidpointDistance=function(t){var e=new xr(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},_r.prototype.computeMaxVertexDistance=function(t){var e=new wr(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},_r.prototype.findDistance=function(t){return this.computeMaxVertexDistance(t),this.computeMaxMidpointDistance(t),this._maxPtDist.getDistance()},_r.prototype.getDistancePoints=function(){return this._maxPtDist},_r.prototype.interfaces_=function(){return[]},_r.prototype.getClass=function(){return _r},br.MaxPointDistanceFilter.get=function(){return wr},br.MaxMidpointDistanceFilter.get=function(){return xr},Object.defineProperties(_r,br);var wr=function(t){this._maxPtDist=new mr,this._minPtDist=new mr,this._geom=t||null};wr.prototype.filter=function(t){this._minPtDist.initialize(),vr.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},wr.prototype.getMaxPointDistance=function(){return this._maxPtDist},wr.prototype.interfaces_=function(){return[dt]},wr.prototype.getClass=function(){return wr};var xr=function(t){this._maxPtDist=new mr,this._minPtDist=new mr,this._geom=t||null};xr.prototype.filter=function(t,e){if(0===e)return null;var n=t.getCoordinate(e-1),r=t.getCoordinate(e),i=new S((n.x+r.x)/2,(n.y+r.y)/2);this._minPtDist.initialize(),vr.computeDistance(this._geom,i,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},xr.prototype.isDone=function(){return!1},xr.prototype.isGeometryChanged=function(){return!1},xr.prototype.getMaxPointDistance=function(){return this._maxPtDist},xr.prototype.interfaces_=function(){return[Ut]},xr.prototype.getClass=function(){return xr};var Er=function(t){this._comps=t||null};Er.prototype.filter=function(t){t instanceof Qt&&this._comps.add(t)},Er.prototype.interfaces_=function(){return[zt]},Er.prototype.getClass=function(){return Er},Er.getPolygons=function(){if(1===arguments.length){var t=arguments[0];return Er.getPolygons(t,new Et)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e instanceof Qt?n.add(e):e instanceof Bt&&e.apply(new Er(n)),n}};var Sr=function(){if(this._lines=null,this._isForcedToLineString=!1,1===arguments.length){var t=arguments[0];this._lines=t}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this._lines=e,this._isForcedToLineString=n}};Sr.prototype.filter=function(t){if(this._isForcedToLineString&&t instanceof ee){var e=t.getFactory().createLineString(t.getCoordinateSequence());return this._lines.add(e),null}t instanceof Kt&&this._lines.add(t)},Sr.prototype.setForceToLineString=function(t){this._isForcedToLineString=t},Sr.prototype.interfaces_=function(){return[ut]},Sr.prototype.getClass=function(){return Sr},Sr.getGeometry=function(){if(1===arguments.length){var t=arguments[0];return t.getFactory().buildGeometry(Sr.getLines(t))}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e.getFactory().buildGeometry(Sr.getLines(e,n))}},Sr.getLines=function(){if(1===arguments.length){var t=arguments[0];return Sr.getLines(t,!1)}if(2===arguments.length){if(P(arguments[0],bt)&&P(arguments[1],bt)){for(var e=arguments[0],n=arguments[1],r=e.iterator();r.hasNext();){var i=r.next();Sr.getLines(i,n)}return n}if(arguments[0]instanceof ct&&"boolean"==typeof arguments[1]){var o=arguments[0],a=arguments[1],s=new Et;return o.apply(new Sr(s,a)),s}if(arguments[0]instanceof ct&&P(arguments[1],bt)){var l=arguments[0],u=arguments[1];return l instanceof Kt?u.add(l):l.apply(new Sr(u)),u}}else if(3===arguments.length){if("boolean"==typeof arguments[2]&&P(arguments[0],bt)&&P(arguments[1],bt)){for(var c=arguments[0],h=arguments[1],p=arguments[2],d=c.iterator();d.hasNext();){var f=d.next();Sr.getLines(f,h,p)}return h}if("boolean"==typeof arguments[2]&&arguments[0]instanceof ct&&P(arguments[1],bt)){var g=arguments[0],y=arguments[1],m=arguments[2];return g.apply(new Sr(y,m)),y}}};var Or=function(){if(this._boundaryRule=ft.OGC_SFS_BOUNDARY_RULE,this._isIn=null,this._numBoundaries=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];if(null===t)throw new v("Rule must be non-null");this._boundaryRule=t}};Or.prototype.locateInternal=function(){if(arguments[0]instanceof S&&arguments[1]instanceof Qt){var t=arguments[0],e=arguments[1];if(e.isEmpty())return I.EXTERIOR;var n=e.getExteriorRing(),r=this.locateInPolygonRing(t,n);if(r===I.EXTERIOR)return I.EXTERIOR;if(r===I.BOUNDARY)return I.BOUNDARY;for(var i=0;i<e.getNumInteriorRing();i++){var o=e.getInteriorRingN(i),a=this.locateInPolygonRing(t,o);if(a===I.INTERIOR)return I.EXTERIOR;if(a===I.BOUNDARY)return I.BOUNDARY}return I.INTERIOR}if(arguments[0]instanceof S&&arguments[1]instanceof Kt){var s=arguments[0],l=arguments[1];if(!l.getEnvelopeInternal().intersects(s))return I.EXTERIOR;var u=l.getCoordinates();return l.isClosed()||!s.equals(u[0])&&!s.equals(u[u.length-1])?st.isOnLine(s,u)?I.INTERIOR:I.EXTERIOR:I.BOUNDARY}if(arguments[0]instanceof S&&arguments[1]instanceof $t){var c=arguments[0];return arguments[1].getCoordinate().equals2D(c)?I.INTERIOR:I.EXTERIOR}},Or.prototype.locateInPolygonRing=function(t,e){return e.getEnvelopeInternal().intersects(t)?st.locatePointInRing(t,e.getCoordinates()):I.EXTERIOR},Or.prototype.intersects=function(t,e){return this.locate(t,e)!==I.EXTERIOR},Or.prototype.updateLocationInfo=function(t){t===I.INTERIOR&&(this._isIn=!0),t===I.BOUNDARY&&this._numBoundaries++},Or.prototype.computeLocation=function(t,e){if(e instanceof $t&&this.updateLocationInfo(this.locateInternal(t,e)),e instanceof Kt)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof Qt)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof Vt)for(var n=e,r=0;r<n.getNumGeometries();r++){var i=n.getGeometryN(r);this.updateLocationInfo(this.locateInternal(t,i))}else if(e instanceof ne)for(var o=e,a=0;a<o.getNumGeometries();a++){var s=o.getGeometryN(a);this.updateLocationInfo(this.locateInternal(t,s))}else if(e instanceof Bt)for(var l=new Un(e);l.hasNext();){var u=l.next();u!==e&&this.computeLocation(t,u)}},Or.prototype.locate=function(t,e){return e.isEmpty()?I.EXTERIOR:e instanceof Kt||e instanceof Qt?this.locateInternal(t,e):(this._isIn=!1,this._numBoundaries=0,this.computeLocation(t,e),this._boundaryRule.isInBoundary(this._numBoundaries)?I.BOUNDARY:this._numBoundaries>0||this._isIn?I.INTERIOR:I.EXTERIOR)},Or.prototype.interfaces_=function(){return[]},Or.prototype.getClass=function(){return Or};var Cr=function t(){if(this._component=null,this._segIndex=null,this._pt=null,2===arguments.length){var e=arguments[0],n=arguments[1];t.call(this,e,t.INSIDE_AREA,n)}else if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2];this._component=r,this._segIndex=i,this._pt=o}},Tr={INSIDE_AREA:{configurable:!0}};Cr.prototype.isInsideArea=function(){return this._segIndex===Cr.INSIDE_AREA},Cr.prototype.getCoordinate=function(){return this._pt},Cr.prototype.getGeometryComponent=function(){return this._component},Cr.prototype.getSegmentIndex=function(){return this._segIndex},Cr.prototype.interfaces_=function(){return[]},Cr.prototype.getClass=function(){return Cr},Tr.INSIDE_AREA.get=function(){return-1},Object.defineProperties(Cr,Tr);var Ir=function(t){this._pts=t||null};Ir.prototype.filter=function(t){t instanceof $t&&this._pts.add(t)},Ir.prototype.interfaces_=function(){return[zt]},Ir.prototype.getClass=function(){return Ir},Ir.getPoints=function(){if(1===arguments.length){var t=arguments[0];return t instanceof $t?Qe.singletonList(t):Ir.getPoints(t,new Et)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e instanceof $t?n.add(e):e instanceof Bt&&e.apply(new Ir(n)),n}};var Lr=function(){this._locations=null;var t=arguments[0];this._locations=t};Lr.prototype.filter=function(t){(t instanceof $t||t instanceof Kt||t instanceof Qt)&&this._locations.add(new Cr(t,0,t.getCoordinate()))},Lr.prototype.interfaces_=function(){return[zt]},Lr.prototype.getClass=function(){return Lr},Lr.getLocations=function(t){var e=new Et;return t.apply(new Lr(e)),e};var Pr=function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new Or,this._minDistanceLocation=null,this._minDistance=_.MAX_VALUE,2===arguments.length){var t=arguments[0],e=arguments[1];this._geom=[t,e],this._terminateDistance=0}else if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];this._geom=new Array(2).fill(null),this._geom[0]=n,this._geom[1]=r,this._terminateDistance=i}};Pr.prototype.computeContainmentDistance=function(){if(0===arguments.length){var t=new Array(2).fill(null);if(this.computeContainmentDistance(0,t),this._minDistance<=this._terminateDistance)return null;this.computeContainmentDistance(1,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1],r=1-e,i=Er.getPolygons(this._geom[e]);if(i.size()>0){var o=Lr.getLocations(this._geom[r]);if(this.computeContainmentDistance(o,i,n),this._minDistance<=this._terminateDistance)return this._minDistanceLocation[r]=n[0],this._minDistanceLocation[e]=n[1],null}}else if(3===arguments.length)if(arguments[2]instanceof Array&&P(arguments[0],xt)&&P(arguments[1],xt)){for(var a=arguments[0],s=arguments[1],l=arguments[2],u=0;u<a.size();u++)for(var c=a.get(u),h=0;h<s.size();h++)if(this.computeContainmentDistance(c,s.get(h),l),this._minDistance<=this._terminateDistance)return null}else if(arguments[2]instanceof Array&&arguments[0]instanceof Cr&&arguments[1]instanceof Qt){var p=arguments[0],d=arguments[1],f=arguments[2],g=p.getCoordinate();if(I.EXTERIOR!==this._ptLocator.locate(g,d))return this._minDistance=0,f[0]=p,f[1]=new Cr(d,g),null}},Pr.prototype.computeMinDistanceLinesPoints=function(t,e,n){for(var r=0;r<t.size();r++)for(var i=t.get(r),o=0;o<e.size();o++){var a=e.get(o);if(this.computeMinDistance(i,a,n),this._minDistance<=this._terminateDistance)return null}},Pr.prototype.computeFacetDistance=function(){var t=new Array(2).fill(null),e=Sr.getLines(this._geom[0]),n=Sr.getLines(this._geom[1]),r=Ir.getPoints(this._geom[0]),i=Ir.getPoints(this._geom[1]);return this.computeMinDistanceLines(e,n,t),this.updateMinDistance(t,!1),this._minDistance<=this._terminateDistance?null:(t[0]=null,t[1]=null,this.computeMinDistanceLinesPoints(e,i,t),this.updateMinDistance(t,!1),this._minDistance<=this._terminateDistance?null:(t[0]=null,t[1]=null,this.computeMinDistanceLinesPoints(n,r,t),this.updateMinDistance(t,!0),this._minDistance<=this._terminateDistance?null:(t[0]=null,t[1]=null,this.computeMinDistancePoints(r,i,t),void this.updateMinDistance(t,!1))))},Pr.prototype.nearestLocations=function(){return this.computeMinDistance(),this._minDistanceLocation},Pr.prototype.updateMinDistance=function(t,e){if(null===t[0])return null;e?(this._minDistanceLocation[0]=t[1],this._minDistanceLocation[1]=t[0]):(this._minDistanceLocation[0]=t[0],this._minDistanceLocation[1]=t[1])},Pr.prototype.nearestPoints=function(){return this.computeMinDistance(),[this._minDistanceLocation[0].getCoordinate(),this._minDistanceLocation[1].getCoordinate()]},Pr.prototype.computeMinDistance=function(){if(0===arguments.length){if(null!==this._minDistanceLocation)return null;if(this._minDistanceLocation=new Array(2).fill(null),this.computeContainmentDistance(),this._minDistance<=this._terminateDistance)return null;this.computeFacetDistance()}else if(3===arguments.length)if(arguments[2]instanceof Array&&arguments[0]instanceof Kt&&arguments[1]instanceof $t){var t=arguments[0],e=arguments[1],n=arguments[2];if(t.getEnvelopeInternal().distance(e.getEnvelopeInternal())>this._minDistance)return null;for(var r=t.getCoordinates(),i=e.getCoordinate(),o=0;o<r.length-1;o++){var a=st.distancePointLine(i,r[o],r[o+1]);if(a<this._minDistance){this._minDistance=a;var s=new gn(r[o],r[o+1]).closestPoint(i);n[0]=new Cr(t,o,s),n[1]=new Cr(e,0,i)}if(this._minDistance<=this._terminateDistance)return null}}else if(arguments[2]instanceof Array&&arguments[0]instanceof Kt&&arguments[1]instanceof Kt){var l=arguments[0],u=arguments[1],c=arguments[2];if(l.getEnvelopeInternal().distance(u.getEnvelopeInternal())>this._minDistance)return null;for(var h=l.getCoordinates(),p=u.getCoordinates(),d=0;d<h.length-1;d++)for(var f=0;f<p.length-1;f++){var g=st.distanceLineLine(h[d],h[d+1],p[f],p[f+1]);if(g<this._minDistance){this._minDistance=g;var y=new gn(h[d],h[d+1]),m=new gn(p[f],p[f+1]),v=y.closestPoints(m);c[0]=new Cr(l,d,v[0]),c[1]=new Cr(u,f,v[1])}if(this._minDistance<=this._terminateDistance)return null}}},Pr.prototype.computeMinDistancePoints=function(t,e,n){for(var r=0;r<t.size();r++)for(var i=t.get(r),o=0;o<e.size();o++){var a=e.get(o),s=i.getCoordinate().distance(a.getCoordinate());if(s<this._minDistance&&(this._minDistance=s,n[0]=new Cr(i,0,i.getCoordinate()),n[1]=new Cr(a,0,a.getCoordinate())),this._minDistance<=this._terminateDistance)return null}},Pr.prototype.distance=function(){if(null===this._geom[0]||null===this._geom[1])throw new v("null geometries are not supported");return this._geom[0].isEmpty()||this._geom[1].isEmpty()?0:(this.computeMinDistance(),this._minDistance)},Pr.prototype.computeMinDistanceLines=function(t,e,n){for(var r=0;r<t.size();r++)for(var i=t.get(r),o=0;o<e.size();o++){var a=e.get(o);if(this.computeMinDistance(i,a,n),this._minDistance<=this._terminateDistance)return null}},Pr.prototype.interfaces_=function(){return[]},Pr.prototype.getClass=function(){return Pr},Pr.distance=function(t,e){return new Pr(t,e).distance()},Pr.isWithinDistance=function(t,e,n){return new Pr(t,e,n).distance()<=n},Pr.nearestPoints=function(t,e){return new Pr(t,e).nearestPoints()};var Rr=function(){this._pt=[new S,new S],this._distance=_.NaN,this._isNull=!0};Rr.prototype.getCoordinates=function(){return this._pt},Rr.prototype.getCoordinate=function(t){return this._pt[t]},Rr.prototype.setMinimum=function(){if(1===arguments.length){var t=arguments[0];this.setMinimum(t._pt[0],t._pt[1])}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var r=e.distance(n);r<this._distance&&this.initialize(e,n,r)}},Rr.prototype.initialize=function(){if(0===arguments.length)this._isNull=!0;else if(2===arguments.length){var t=arguments[0],e=arguments[1];this._pt[0].setCoordinate(t),this._pt[1].setCoordinate(e),this._distance=t.distance(e),this._isNull=!1}else if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];this._pt[0].setCoordinate(n),this._pt[1].setCoordinate(r),this._distance=i,this._isNull=!1}},Rr.prototype.toString=function(){return J.toLineString(this._pt[0],this._pt[1])},Rr.prototype.getDistance=function(){return this._distance},Rr.prototype.setMaximum=function(){if(1===arguments.length){var t=arguments[0];this.setMaximum(t._pt[0],t._pt[1])}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var r=e.distance(n);r>this._distance&&this.initialize(e,n,r)}},Rr.prototype.interfaces_=function(){return[]},Rr.prototype.getClass=function(){return Rr};var Mr=function(){};Mr.prototype.interfaces_=function(){return[]},Mr.prototype.getClass=function(){return Mr},Mr.computeDistance=function(){if(arguments[2]instanceof Rr&&arguments[0]instanceof Kt&&arguments[1]instanceof S)for(var t=arguments[0],e=arguments[1],n=arguments[2],r=new gn,i=t.getCoordinates(),o=0;o<i.length-1;o++){r.setCoordinates(i[o],i[o+1]);var a=r.closestPoint(e);n.setMinimum(a,e)}else if(arguments[2]instanceof Rr&&arguments[0]instanceof Qt&&arguments[1]instanceof S){var s=arguments[0],l=arguments[1],u=arguments[2];Mr.computeDistance(s.getExteriorRing(),l,u);for(var c=0;c<s.getNumInteriorRing();c++)Mr.computeDistance(s.getInteriorRingN(c),l,u)}else if(arguments[2]instanceof Rr&&arguments[0]instanceof ct&&arguments[1]instanceof S){var h=arguments[0],p=arguments[1],d=arguments[2];if(h instanceof Kt)Mr.computeDistance(h,p,d);else if(h instanceof Qt)Mr.computeDistance(h,p,d);else if(h instanceof Bt)for(var f=h,g=0;g<f.getNumGeometries();g++){var y=f.getGeometryN(g);Mr.computeDistance(y,p,d)}else d.setMinimum(h.getCoordinate(),p)}else if(arguments[2]instanceof Rr&&arguments[0]instanceof gn&&arguments[1]instanceof S){var m=arguments[0],v=arguments[1],_=arguments[2],b=m.closestPoint(v);_.setMinimum(b,v)}};var Nr=function(){this._g0=null,this._g1=null,this._ptDist=new Rr,this._densifyFrac=0;var t=arguments[0],e=arguments[1];this._g0=t,this._g1=e},jr={MaxPointDistanceFilter:{configurable:!0},MaxDensifiedByFractionDistanceFilter:{configurable:!0}};Nr.prototype.getCoordinates=function(){return this._ptDist.getCoordinates()},Nr.prototype.setDensifyFraction=function(t){if(t>1||t<=0)throw new v("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=t},Nr.prototype.compute=function(t,e){this.computeOrientedDistance(t,e,this._ptDist),this.computeOrientedDistance(e,t,this._ptDist)},Nr.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()},Nr.prototype.computeOrientedDistance=function(t,e,n){var r=new Ar(e);if(t.apply(r),n.setMaximum(r.getMaxPointDistance()),this._densifyFrac>0){var i=new kr(e,this._densifyFrac);t.apply(i),n.setMaximum(i.getMaxPointDistance())}},Nr.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()},Nr.prototype.interfaces_=function(){return[]},Nr.prototype.getClass=function(){return Nr},Nr.distance=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return new Nr(t,e).distance()}if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2],o=new Nr(n,r);return o.setDensifyFraction(i),o.distance()}},jr.MaxPointDistanceFilter.get=function(){return Ar},jr.MaxDensifiedByFractionDistanceFilter.get=function(){return kr},Object.defineProperties(Nr,jr);var Ar=function(){this._maxPtDist=new Rr,this._minPtDist=new Rr,this._euclideanDist=new Mr,this._geom=null;var t=arguments[0];this._geom=t};Ar.prototype.filter=function(t){this._minPtDist.initialize(),Mr.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},Ar.prototype.getMaxPointDistance=function(){return this._maxPtDist},Ar.prototype.interfaces_=function(){return[dt]},Ar.prototype.getClass=function(){return Ar};var kr=function(){this._maxPtDist=new Rr,this._minPtDist=new Rr,this._geom=null,this._numSubSegs=0;var t=arguments[0],e=arguments[1];this._geom=t,this._numSubSegs=Math.trunc(Math.round(1/e))};kr.prototype.filter=function(t,e){if(0===e)return null;for(var n=t.getCoordinate(e-1),r=t.getCoordinate(e),i=(r.x-n.x)/this._numSubSegs,o=(r.y-n.y)/this._numSubSegs,a=0;a<this._numSubSegs;a++){var s=n.x+a*i,l=n.y+a*o,u=new S(s,l);this._minPtDist.initialize(),Mr.computeDistance(this._geom,u,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)}},kr.prototype.isDone=function(){return!1},kr.prototype.isGeometryChanged=function(){return!1},kr.prototype.getMaxPointDistance=function(){return this._maxPtDist},kr.prototype.interfaces_=function(){return[Ut]},kr.prototype.getClass=function(){return kr};var Fr=function(t,e,n){this._minValidDistance=null,this._maxValidDistance=null,this._minDistanceFound=null,this._maxDistanceFound=null,this._isValid=!0,this._errMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=t||null,this._bufDistance=e||null,this._result=n||null},Dr={VERBOSE:{configurable:!0},MAX_DISTANCE_DIFF_FRAC:{configurable:!0}};Fr.prototype.checkMaximumDistance=function(t,e,n){var r=new Nr(e,t);if(r.setDensifyFraction(.25),this._maxDistanceFound=r.orientedDistance(),this._maxDistanceFound>n){this._isValid=!1;var i=r.getCoordinates();this._errorLocation=i[1],this._errorIndicator=t.getFactory().createLineString(i),this._errMsg="Distance between buffer curve and input is too large ("+this._maxDistanceFound+" at "+J.toLineString(i[0],i[1])+")"}},Fr.prototype.isValid=function(){var t=Math.abs(this._bufDistance),e=Fr.MAX_DISTANCE_DIFF_FRAC*t;return this._minValidDistance=t-e,this._maxValidDistance=t+e,!(!this._input.isEmpty()&&!this._result.isEmpty())||(this._bufDistance>0?this.checkPositiveValid():this.checkNegativeValid(),Fr.VERBOSE&&q.out.println("Min Dist= "+this._minDistanceFound+" err= "+(1-this._minDistanceFound/this._bufDistance)+" Max Dist= "+this._maxDistanceFound+" err= "+(this._maxDistanceFound/this._bufDistance-1)),this._isValid)},Fr.prototype.checkNegativeValid=function(){if(!(this._input instanceof Qt||this._input instanceof ne||this._input instanceof Bt))return null;var t=this.getPolygonLines(this._input);if(this.checkMinimumDistance(t,this._result,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(t,this._result,this._maxValidDistance)},Fr.prototype.getErrorIndicator=function(){return this._errorIndicator},Fr.prototype.checkMinimumDistance=function(t,e,n){var r=new Pr(t,e,n);if(this._minDistanceFound=r.distance(),this._minDistanceFound<n){this._isValid=!1;var i=r.nearestPoints();this._errorLocation=r.nearestPoints()[1],this._errorIndicator=t.getFactory().createLineString(i),this._errMsg="Distance between buffer curve and input is too small ("+this._minDistanceFound+" at "+J.toLineString(i[0],i[1])+" )"}},Fr.prototype.checkPositiveValid=function(){var t=this._result.getBoundary();if(this.checkMinimumDistance(this._input,t,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(this._input,t,this._maxValidDistance)},Fr.prototype.getErrorLocation=function(){return this._errorLocation},Fr.prototype.getPolygonLines=function(t){for(var e=new Et,n=new Sr(e),r=Er.getPolygons(t).iterator();r.hasNext();)r.next().apply(n);return t.getFactory().buildGeometry(e)},Fr.prototype.getErrorMessage=function(){return this._errMsg},Fr.prototype.interfaces_=function(){return[]},Fr.prototype.getClass=function(){return Fr},Dr.VERBOSE.get=function(){return!1},Dr.MAX_DISTANCE_DIFF_FRAC.get=function(){return.012},Object.defineProperties(Fr,Dr);var Gr=function(t,e,n){this._isValid=!0,this._errorMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=t||null,this._distance=e||null,this._result=n||null},zr={VERBOSE:{configurable:!0},MAX_ENV_DIFF_FRAC:{configurable:!0}};Gr.prototype.isValid=function(){return this.checkPolygonal(),this._isValid?(this.checkExpectedEmpty(),this._isValid?(this.checkEnvelope(),this._isValid?(this.checkArea(),this._isValid?(this.checkDistance(),this._isValid):this._isValid):this._isValid):this._isValid):this._isValid},Gr.prototype.checkEnvelope=function(){if(this._distance<0)return null;var t=this._distance*Gr.MAX_ENV_DIFF_FRAC;0===t&&(t=.001);var e=new X(this._input.getEnvelopeInternal());e.expandBy(this._distance);var n=new X(this._result.getEnvelopeInternal());n.expandBy(t),n.contains(e)||(this._isValid=!1,this._errorMsg="Buffer envelope is incorrect",this._errorIndicator=this._input.getFactory().toGeometry(n)),this.report("Envelope")},Gr.prototype.checkDistance=function(){var t=new Fr(this._input,this._distance,this._result);t.isValid()||(this._isValid=!1,this._errorMsg=t.getErrorMessage(),this._errorLocation=t.getErrorLocation(),this._errorIndicator=t.getErrorIndicator()),this.report("Distance")},Gr.prototype.checkArea=function(){var t=this._input.getArea(),e=this._result.getArea();this._distance>0&&t>e&&(this._isValid=!1,this._errorMsg="Area of positive buffer is smaller than input",this._errorIndicator=this._result),this._distance<0&&t<e&&(this._isValid=!1,this._errorMsg="Area of negative buffer is larger than input",this._errorIndicator=this._result),this.report("Area")},Gr.prototype.checkPolygonal=function(){this._result instanceof Qt||this._result instanceof ne||(this._isValid=!1),this._errorMsg="Result is not polygonal",this._errorIndicator=this._result,this.report("Polygonal")},Gr.prototype.getErrorIndicator=function(){return this._errorIndicator},Gr.prototype.getErrorLocation=function(){return this._errorLocation},Gr.prototype.checkExpectedEmpty=function(){return this._input.getDimension()>=2||this._distance>0?null:(this._result.isEmpty()||(this._isValid=!1,this._errorMsg="Result is non-empty",this._errorIndicator=this._result),void this.report("ExpectedEmpty"))},Gr.prototype.report=function(t){if(!Gr.VERBOSE)return null;q.out.println("Check "+t+": "+(this._isValid?"passed":"FAILED"))},Gr.prototype.getErrorMessage=function(){return this._errorMsg},Gr.prototype.interfaces_=function(){return[]},Gr.prototype.getClass=function(){return Gr},Gr.isValidMsg=function(t,e,n){var r=new Gr(t,e,n);return r.isValid()?null:r.getErrorMessage()},Gr.isValid=function(t,e,n){return!!new Gr(t,e,n).isValid()},zr.VERBOSE.get=function(){return!1},zr.MAX_ENV_DIFF_FRAC.get=function(){return.012},Object.defineProperties(Gr,zr);var Ur=function(){this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};Ur.prototype.getCoordinates=function(){return this._pts},Ur.prototype.size=function(){return this._pts.length},Ur.prototype.getCoordinate=function(t){return this._pts[t]},Ur.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},Ur.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:hn.octant(this.getCoordinate(t),this.getCoordinate(t+1))},Ur.prototype.setData=function(t){this._data=t},Ur.prototype.getData=function(){return this._data},Ur.prototype.toString=function(){return J.toLineString(new le(this._pts))},Ur.prototype.interfaces_=function(){return[pn]},Ur.prototype.getClass=function(){return Ur};var Br=function(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new Et,this._intersectionCount=0,this._keepIntersections=!0;var t=arguments[0];this._li=t,this._interiorIntersection=null};Br.prototype.getInteriorIntersection=function(){return this._interiorIntersection},Br.prototype.setCheckEndSegmentsOnly=function(t){this._isCheckEndSegmentsOnly=t},Br.prototype.getIntersectionSegments=function(){return this._intSegments},Br.prototype.count=function(){return this._intersectionCount},Br.prototype.getIntersections=function(){return this._intersections},Br.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},Br.prototype.setKeepIntersections=function(t){this._keepIntersections=t},Br.prototype.processIntersections=function(t,e,n,r){if(!this._findAllIntersections&&this.hasIntersection())return null;if(t===n&&e===r)return null;if(this._isCheckEndSegmentsOnly&&!this.isEndSegment(t,e)&&!this.isEndSegment(n,r))return null;var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],a=n.getCoordinates()[r],s=n.getCoordinates()[r+1];this._li.computeIntersection(i,o,a,s),this._li.hasIntersection()&&this._li.isInteriorIntersection()&&(this._intSegments=new Array(4).fill(null),this._intSegments[0]=i,this._intSegments[1]=o,this._intSegments[2]=a,this._intSegments[3]=s,this._interiorIntersection=this._li.getIntersection(0),this._keepIntersections&&this._intersections.add(this._interiorIntersection),this._intersectionCount++)},Br.prototype.isEndSegment=function(t,e){return 0===e||e>=t.size()-2},Br.prototype.hasIntersection=function(){return null!==this._interiorIntersection},Br.prototype.isDone=function(){return!this._findAllIntersections&&null!==this._interiorIntersection},Br.prototype.interfaces_=function(){return[Hn]},Br.prototype.getClass=function(){return Br},Br.createAllIntersectionsFinder=function(t){var e=new Br(t);return e.setFindAllIntersections(!0),e},Br.createAnyIntersectionFinder=function(t){return new Br(t)},Br.createIntersectionCounter=function(t){var e=new Br(t);return e.setFindAllIntersections(!0),e.setKeepIntersections(!1),e};var Vr=function(){this._li=new it,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var t=arguments[0];this._segStrings=t};Vr.prototype.execute=function(){if(null!==this._segInt)return null;this.checkInteriorIntersections()},Vr.prototype.getIntersections=function(){return this._segInt.getIntersections()},Vr.prototype.isValid=function(){return this.execute(),this._isValid},Vr.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},Vr.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new Br(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var t=new xn;if(t.setSegmentIntersector(this._segInt),t.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null},Vr.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new Ie(this.getErrorMessage(),this._segInt.getInteriorIntersection())},Vr.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections found";var t=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+J.toLineString(t[0],t[1])+" and "+J.toLineString(t[2],t[3])},Vr.prototype.interfaces_=function(){return[]},Vr.prototype.getClass=function(){return Vr},Vr.computeIntersections=function(t){var e=new Vr(t);return e.setFindAllIntersections(!0),e.isValid(),e.getIntersections()};var qr=function t(){this._nv=null;var e=arguments[0];this._nv=new Vr(t.toSegmentStrings(e))};qr.prototype.checkValid=function(){this._nv.checkValid()},qr.prototype.interfaces_=function(){return[]},qr.prototype.getClass=function(){return qr},qr.toSegmentStrings=function(t){for(var e=new Et,n=t.iterator();n.hasNext();){var r=n.next();e.add(new Ur(r.getCoordinates(),r))}return e},qr.checkValid=function(t){new qr(t).checkValid()};var Yr=function(t){this._mapOp=t};Yr.prototype.map=function(t){for(var e=new Et,n=0;n<t.getNumGeometries();n++){var r=this._mapOp.map(t.getGeometryN(n));r.isEmpty()||e.add(r)}return t.getFactory().createGeometryCollection(me.toGeometryArray(e))},Yr.prototype.interfaces_=function(){return[]},Yr.prototype.getClass=function(){return Yr},Yr.map=function(t,e){return new Yr(e).map(t)};var Xr=function(){this._op=null,this._geometryFactory=null,this._ptLocator=null,this._lineEdgesList=new Et,this._resultLineList=new Et;var t=arguments[0],e=arguments[1],n=arguments[2];this._op=t,this._geometryFactory=e,this._ptLocator=n};Xr.prototype.collectLines=function(t){for(var e=this._op.getGraph().getEdgeEnds().iterator();e.hasNext();){var n=e.next();this.collectLineEdge(n,t,this._lineEdgesList),this.collectBoundaryTouchEdge(n,t,this._lineEdgesList)}},Xr.prototype.labelIsolatedLine=function(t,e){var n=this._ptLocator.locate(t.getCoordinate(),this._op.getArgGeometry(e));t.getLabel().setLocation(e,n)},Xr.prototype.build=function(t){return this.findCoveredLineEdges(),this.collectLines(t),this.buildLines(t),this._resultLineList},Xr.prototype.collectLineEdge=function(t,e,n){var r=t.getLabel(),i=t.getEdge();t.isLineEdge()&&(t.isVisited()||!Ci.isResultOfOp(r,e)||i.isCovered()||(n.add(i),t.setVisitedEdge(!0)))},Xr.prototype.findCoveredLineEdges=function(){for(var t=this._op.getGraph().getNodes().iterator();t.hasNext();)t.next().getEdges().findCoveredLineEdges();for(var e=this._op.getGraph().getEdgeEnds().iterator();e.hasNext();){var n=e.next(),r=n.getEdge();if(n.isLineEdge()&&!r.isCoveredSet()){var i=this._op.isCoveredByA(n.getCoordinate());r.setCovered(i)}}},Xr.prototype.labelIsolatedLines=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next(),r=n.getLabel();n.isIsolated()&&(r.isNull(0)?this.labelIsolatedLine(n,0):this.labelIsolatedLine(n,1))}},Xr.prototype.buildLines=function(t){for(var e=this._lineEdgesList.iterator();e.hasNext();){var n=e.next(),r=this._geometryFactory.createLineString(n.getCoordinates());this._resultLineList.add(r),n.setInResult(!0)}},Xr.prototype.collectBoundaryTouchEdge=function(t,e,n){var r=t.getLabel();return t.isLineEdge()||t.isVisited()||t.isInteriorAreaEdge()||t.getEdge().isInResult()?null:(et.isTrue(!(t.isInResult()||t.getSym().isInResult())||!t.getEdge().isInResult()),void(Ci.isResultOfOp(r,e)&&e===Ci.INTERSECTION&&(n.add(t.getEdge()),t.setVisitedEdge(!0))))},Xr.prototype.interfaces_=function(){return[]},Xr.prototype.getClass=function(){return Xr};var Wr=function(){this._op=null,this._geometryFactory=null,this._resultPointList=new Et;var t=arguments[0],e=arguments[1];this._op=t,this._geometryFactory=e};Wr.prototype.filterCoveredNodeToPoint=function(t){var e=t.getCoordinate();if(!this._op.isCoveredByLA(e)){var n=this._geometryFactory.createPoint(e);this._resultPointList.add(n)}},Wr.prototype.extractNonCoveredResultNodes=function(t){for(var e=this._op.getGraph().getNodes().iterator();e.hasNext();){var n=e.next();if(!(n.isInResult()||n.isIncidentEdgeInResult()||0!==n.getEdges().getDegree()&&t!==Ci.INTERSECTION)){var r=n.getLabel();Ci.isResultOfOp(r,t)&&this.filterCoveredNodeToPoint(n)}}},Wr.prototype.build=function(t){return this.extractNonCoveredResultNodes(t),this._resultPointList},Wr.prototype.interfaces_=function(){return[]},Wr.prototype.getClass=function(){return Wr};var Hr=function(){this._inputGeom=null,this._factory=null,this._pruneEmptyGeometry=!0,this._preserveGeometryCollectionType=!0,this._preserveCollections=!1,this._preserveType=!1};Hr.prototype.transformPoint=function(t,e){return this._factory.createPoint(this.transformCoordinates(t.getCoordinateSequence(),t))},Hr.prototype.transformPolygon=function(t,e){var n=!0,r=this.transformLinearRing(t.getExteriorRing(),t);null!==r&&r instanceof ee&&!r.isEmpty()||(n=!1);for(var i=new Et,o=0;o<t.getNumInteriorRing();o++){var a=this.transformLinearRing(t.getInteriorRingN(o),t);null===a||a.isEmpty()||(a instanceof ee||(n=!1),i.add(a))}if(n)return this._factory.createPolygon(r,i.toArray([]));var s=new Et;return null!==r&&s.add(r),s.addAll(i),this._factory.buildGeometry(s)},Hr.prototype.createCoordinateSequence=function(t){return this._factory.getCoordinateSequenceFactory().create(t)},Hr.prototype.getInputGeometry=function(){return this._inputGeom},Hr.prototype.transformMultiLineString=function(t,e){for(var n=new Et,r=0;r<t.getNumGeometries();r++){var i=this.transformLineString(t.getGeometryN(r),t);null!==i&&(i.isEmpty()||n.add(i))}return this._factory.buildGeometry(n)},Hr.prototype.transformCoordinates=function(t,e){return this.copy(t)},Hr.prototype.transformLineString=function(t,e){return this._factory.createLineString(this.transformCoordinates(t.getCoordinateSequence(),t))},Hr.prototype.transformMultiPoint=function(t,e){for(var n=new Et,r=0;r<t.getNumGeometries();r++){var i=this.transformPoint(t.getGeometryN(r),t);null!==i&&(i.isEmpty()||n.add(i))}return this._factory.buildGeometry(n)},Hr.prototype.transformMultiPolygon=function(t,e){for(var n=new Et,r=0;r<t.getNumGeometries();r++){var i=this.transformPolygon(t.getGeometryN(r),t);null!==i&&(i.isEmpty()||n.add(i))}return this._factory.buildGeometry(n)},Hr.prototype.copy=function(t){return t.copy()},Hr.prototype.transformGeometryCollection=function(t,e){for(var n=new Et,r=0;r<t.getNumGeometries();r++){var i=this.transform(t.getGeometryN(r));null!==i&&(this._pruneEmptyGeometry&&i.isEmpty()||n.add(i))}return this._preserveGeometryCollectionType?this._factory.createGeometryCollection(me.toGeometryArray(n)):this._factory.buildGeometry(n)},Hr.prototype.transform=function(t){if(this._inputGeom=t,this._factory=t.getFactory(),t instanceof $t)return this.transformPoint(t,null);if(t instanceof te)return this.transformMultiPoint(t,null);if(t instanceof ee)return this.transformLinearRing(t,null);if(t instanceof Kt)return this.transformLineString(t,null);if(t instanceof Vt)return this.transformMultiLineString(t,null);if(t instanceof Qt)return this.transformPolygon(t,null);if(t instanceof ne)return this.transformMultiPolygon(t,null);if(t instanceof Bt)return this.transformGeometryCollection(t,null);throw new v("Unknown Geometry subtype: "+t.getClass().getName())},Hr.prototype.transformLinearRing=function(t,e){var n=this.transformCoordinates(t.getCoordinateSequence(),t);if(null===n)return this._factory.createLinearRing(null);var r=n.size();return r>0&&r<4&&!this._preserveType?this._factory.createLineString(n):this._factory.createLinearRing(n)},Hr.prototype.interfaces_=function(){return[]},Hr.prototype.getClass=function(){return Hr};var Kr=function t(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new gn,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof Kt&&"number"==typeof arguments[1]){var e=arguments[0],n=arguments[1];t.call(this,e.getCoordinates(),n)}else if(arguments[0]instanceof Array&&"number"==typeof arguments[1]){var r=arguments[0],i=arguments[1];this._srcPts=r,this._isClosed=t.isClosed(r),this._snapTolerance=i}};Kr.prototype.snapVertices=function(t,e){for(var n=this._isClosed?t.size()-1:t.size(),r=0;r<n;r++){var i=t.get(r),o=this.findSnapForVertex(i,e);null!==o&&(t.set(r,new S(o)),0===r&&this._isClosed&&t.set(t.size()-1,new S(o)))}},Kr.prototype.findSnapForVertex=function(t,e){for(var n=0;n<e.length;n++){if(t.equals2D(e[n]))return null;if(t.distance(e[n])<this._snapTolerance)return e[n]}return null},Kr.prototype.snapTo=function(t){var e=new Ot(this._srcPts);return this.snapVertices(e,t),this.snapSegments(e,t),e.toCoordinateArray()},Kr.prototype.snapSegments=function(t,e){if(0===e.length)return null;var n=e.length;e[0].equals2D(e[e.length-1])&&(n=e.length-1);for(var r=0;r<n;r++){var i=e[r],o=this.findSegmentIndexToSnap(i,t);o>=0&&t.add(o+1,new S(i),!1)}},Kr.prototype.findSegmentIndexToSnap=function(t,e){for(var n=_.MAX_VALUE,r=-1,i=0;i<e.size()-1;i++){if(this._seg.p0=e.get(i),this._seg.p1=e.get(i+1),this._seg.p0.equals2D(t)||this._seg.p1.equals2D(t)){if(this._allowSnappingToSourceVertices)continue;return-1}var o=this._seg.distance(t);o<this._snapTolerance&&o<n&&(n=o,r=i)}return r},Kr.prototype.setAllowSnappingToSourceVertices=function(t){this._allowSnappingToSourceVertices=t},Kr.prototype.interfaces_=function(){return[]},Kr.prototype.getClass=function(){return Kr},Kr.isClosed=function(t){return!(t.length<=1)&&t[0].equals2D(t[t.length-1])};var Zr=function(t){this._srcGeom=t||null},$r={SNAP_PRECISION_FACTOR:{configurable:!0}};Zr.prototype.snapTo=function(t,e){var n=this.extractTargetCoordinates(t);return new Jr(e,n).transform(this._srcGeom)},Zr.prototype.snapToSelf=function(t,e){var n=this.extractTargetCoordinates(this._srcGeom),r=new Jr(t,n,!0).transform(this._srcGeom),i=r;return e&&P(i,Jt)&&(i=r.buffer(0)),i},Zr.prototype.computeSnapTolerance=function(t){return this.computeMinimumSegmentLength(t)/10},Zr.prototype.extractTargetCoordinates=function(t){for(var e=new d,n=t.getCoordinates(),r=0;r<n.length;r++)e.add(n[r]);return e.toArray(new Array(0).fill(null))},Zr.prototype.computeMinimumSegmentLength=function(t){for(var e=_.MAX_VALUE,n=0;n<t.length-1;n++){var r=t[n].distance(t[n+1]);r<e&&(e=r)}return e},Zr.prototype.interfaces_=function(){return[]},Zr.prototype.getClass=function(){return Zr},Zr.snap=function(t,e,n){var r=new Array(2).fill(null),i=new Zr(t);r[0]=i.snapTo(e,n);var o=new Zr(e);return r[1]=o.snapTo(r[0],n),r},Zr.computeOverlaySnapTolerance=function(){if(1===arguments.length){var t=arguments[0],e=Zr.computeSizeBasedSnapTolerance(t),n=t.getPrecisionModel();if(n.getType()===de.FIXED){var r=1/n.getScale()*2/1.415;r>e&&(e=r)}return e}if(2===arguments.length){var i=arguments[0],o=arguments[1];return Math.min(Zr.computeOverlaySnapTolerance(i),Zr.computeOverlaySnapTolerance(o))}},Zr.computeSizeBasedSnapTolerance=function(t){var e=t.getEnvelopeInternal();return Math.min(e.getHeight(),e.getWidth())*Zr.SNAP_PRECISION_FACTOR},Zr.snapToSelf=function(t,e,n){return new Zr(t).snapToSelf(e,n)},$r.SNAP_PRECISION_FACTOR.get=function(){return 1e-9},Object.defineProperties(Zr,$r);var Jr=function(t){function e(e,n,r){t.call(this),this._snapTolerance=e||null,this._snapPts=n||null,this._isSelfSnap=void 0!==r&&r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.snapLine=function(t,e){var n=new Kr(t,this._snapTolerance);return n.setAllowSnappingToSourceVertices(this._isSelfSnap),n.snapTo(e)},e.prototype.transformCoordinates=function(t,e){var n=t.toCoordinateArray(),r=this.snapLine(n,this._snapPts);return this._factory.getCoordinateSequenceFactory().create(r)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Hr),Qr=function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null};Qr.prototype.getCommon=function(){return _.longBitsToDouble(this._commonBits)},Qr.prototype.add=function(t){var e=_.doubleToLongBits(t);return this._isFirst?(this._commonBits=e,this._commonSignExp=Qr.signExpBits(this._commonBits),this._isFirst=!1,null):Qr.signExpBits(e)!==this._commonSignExp?(this._commonBits=0,null):(this._commonMantissaBitsCount=Qr.numCommonMostSigMantissaBits(this._commonBits,e),void(this._commonBits=Qr.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))))},Qr.prototype.toString=function(){if(1===arguments.length){var t=arguments[0],e=_.longBitsToDouble(t),n="0000000000000000000000000000000000000000000000000000000000000000"+_.toBinaryString(t),r=n.substring(n.length-64);return r.substring(0,1)+" "+r.substring(1,12)+"(exp) "+r.substring(12)+" [ "+e+" ]"}},Qr.prototype.interfaces_=function(){return[]},Qr.prototype.getClass=function(){return Qr},Qr.getBit=function(t,e){return 0!=(t&1<<e)?1:0},Qr.signExpBits=function(t){return t>>52},Qr.zeroLowerBits=function(t,e){return t&~((1<<e)-1)},Qr.numCommonMostSigMantissaBits=function(t,e){for(var n=0,r=52;r>=0;r--){if(Qr.getBit(t,r)!==Qr.getBit(e,r))return n;n++}return 52};var ti=function(){this._commonCoord=null,this._ccFilter=new ni},ei={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}};ti.prototype.addCommonBits=function(t){var e=new ri(this._commonCoord);t.apply(e),t.geometryChanged()},ti.prototype.removeCommonBits=function(t){if(0===this._commonCoord.x&&0===this._commonCoord.y)return t;var e=new S(this._commonCoord);e.x=-e.x,e.y=-e.y;var n=new ri(e);return t.apply(n),t.geometryChanged(),t},ti.prototype.getCommonCoordinate=function(){return this._commonCoord},ti.prototype.add=function(t){t.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()},ti.prototype.interfaces_=function(){return[]},ti.prototype.getClass=function(){return ti},ei.CommonCoordinateFilter.get=function(){return ni},ei.Translater.get=function(){return ri},Object.defineProperties(ti,ei);var ni=function(){this._commonBitsX=new Qr,this._commonBitsY=new Qr};ni.prototype.filter=function(t){this._commonBitsX.add(t.x),this._commonBitsY.add(t.y)},ni.prototype.getCommonCoordinate=function(){return new S(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())},ni.prototype.interfaces_=function(){return[dt]},ni.prototype.getClass=function(){return ni};var ri=function(){this.trans=null;var t=arguments[0];this.trans=t};ri.prototype.filter=function(t,e){var n=t.getOrdinate(e,0)+this.trans.x,r=t.getOrdinate(e,1)+this.trans.y;t.setOrdinate(e,0,n),t.setOrdinate(e,1,r)},ri.prototype.isDone=function(){return!1},ri.prototype.isGeometryChanged=function(){return!0},ri.prototype.interfaces_=function(){return[Ut]},ri.prototype.getClass=function(){return ri};var ii=function(t,e){this._geom=new Array(2).fill(null),this._snapTolerance=null,this._cbr=null,this._geom[0]=t,this._geom[1]=e,this.computeSnapTolerance()};ii.prototype.selfSnap=function(t){return new Zr(t).snapTo(t,this._snapTolerance)},ii.prototype.removeCommonBits=function(t){this._cbr=new ti,this._cbr.add(t[0]),this._cbr.add(t[1]);var e=new Array(2).fill(null);return e[0]=this._cbr.removeCommonBits(t[0].copy()),e[1]=this._cbr.removeCommonBits(t[1].copy()),e},ii.prototype.prepareResult=function(t){return this._cbr.addCommonBits(t),t},ii.prototype.getResultGeometry=function(t){var e=this.snap(this._geom),n=Ci.overlayOp(e[0],e[1],t);return this.prepareResult(n)},ii.prototype.checkValid=function(t){t.isValid()||q.out.println("Snapped geometry is invalid")},ii.prototype.computeSnapTolerance=function(){this._snapTolerance=Zr.computeOverlaySnapTolerance(this._geom[0],this._geom[1])},ii.prototype.snap=function(t){var e=this.removeCommonBits(t);return Zr.snap(e[0],e[1],this._snapTolerance)},ii.prototype.interfaces_=function(){return[]},ii.prototype.getClass=function(){return ii},ii.overlayOp=function(t,e,n){return new ii(t,e).getResultGeometry(n)},ii.union=function(t,e){return ii.overlayOp(t,e,Ci.UNION)},ii.intersection=function(t,e){return ii.overlayOp(t,e,Ci.INTERSECTION)},ii.symDifference=function(t,e){return ii.overlayOp(t,e,Ci.SYMDIFFERENCE)},ii.difference=function(t,e){return ii.overlayOp(t,e,Ci.DIFFERENCE)};var oi=function(t,e){this._geom=new Array(2).fill(null),this._geom[0]=t,this._geom[1]=e};oi.prototype.getResultGeometry=function(t){var e=null,n=!1,r=null;try{e=Ci.overlayOp(this._geom[0],this._geom[1],t),n=!0}catch(t){if(!(t instanceof Q))throw t;r=t}if(!n)try{e=ii.overlayOp(this._geom[0],this._geom[1],t)}catch(t){throw t instanceof Q?r:t}return e},oi.prototype.interfaces_=function(){return[]},oi.prototype.getClass=function(){return oi},oi.overlayOp=function(t,e,n){return new oi(t,e).getResultGeometry(n)},oi.union=function(t,e){return oi.overlayOp(t,e,Ci.UNION)},oi.intersection=function(t,e){return oi.overlayOp(t,e,Ci.INTERSECTION)},oi.symDifference=function(t,e){return oi.overlayOp(t,e,Ci.SYMDIFFERENCE)},oi.difference=function(t,e){return oi.overlayOp(t,e,Ci.DIFFERENCE)};var ai=function(){this.mce=null,this.chainIndex=null;var t=arguments[0],e=arguments[1];this.mce=t,this.chainIndex=e};ai.prototype.computeIntersections=function(t,e){this.mce.computeIntersectsForChain(this.chainIndex,t.mce,t.chainIndex,e)},ai.prototype.interfaces_=function(){return[]},ai.prototype.getClass=function(){return ai};var si=function t(){if(this._label=null,this._xValue=null,this._eventType=null,this._insertEvent=null,this._deleteEventIndex=null,this._obj=null,2===arguments.length){var e=arguments[0],n=arguments[1];this._eventType=t.DELETE,this._xValue=e,this._insertEvent=n}else if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2];this._eventType=t.INSERT,this._label=r,this._xValue=i,this._obj=o}},li={INSERT:{configurable:!0},DELETE:{configurable:!0}};si.prototype.isDelete=function(){return this._eventType===si.DELETE},si.prototype.setDeleteEventIndex=function(t){this._deleteEventIndex=t},si.prototype.getObject=function(){return this._obj},si.prototype.compareTo=function(t){var e=t;return this._xValue<e._xValue?-1:this._xValue>e._xValue?1:this._eventType<e._eventType?-1:this._eventType>e._eventType?1:0},si.prototype.getInsertEvent=function(){return this._insertEvent},si.prototype.isInsert=function(){return this._eventType===si.INSERT},si.prototype.isSameLabel=function(t){return null!==this._label&&this._label===t._label},si.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex},si.prototype.interfaces_=function(){return[w]},si.prototype.getClass=function(){return si},li.INSERT.get=function(){return 1},li.DELETE.get=function(){return 2},Object.defineProperties(si,li);var ui=function(){};ui.prototype.interfaces_=function(){return[]},ui.prototype.getClass=function(){return ui};var ci=function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._properIntersectionPoint=null,this._li=null,this._includeProper=null,this._recordIsolated=null,this._isSelfIntersection=null,this._numIntersections=0,this.numTests=0,this._bdyNodes=null,this._isDone=!1,this._isDoneWhenProperInt=!1;var t=arguments[0],e=arguments[1],n=arguments[2];this._li=t,this._includeProper=e,this._recordIsolated=n};ci.prototype.isTrivialIntersection=function(t,e,n,r){if(t===n&&1===this._li.getIntersectionNum()){if(ci.isAdjacentSegments(e,r))return!0;if(t.isClosed()){var i=t.getNumPoints()-1;if(0===e&&r===i||0===r&&e===i)return!0}}return!1},ci.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},ci.prototype.setIsDoneIfProperInt=function(t){this._isDoneWhenProperInt=t},ci.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},ci.prototype.isBoundaryPointInternal=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next().getCoordinate();if(t.isIntersection(r))return!0}return!1},ci.prototype.hasProperIntersection=function(){return this._hasProper},ci.prototype.hasIntersection=function(){return this._hasIntersection},ci.prototype.isDone=function(){return this._isDone},ci.prototype.isBoundaryPoint=function(t,e){return!(null===e||!this.isBoundaryPointInternal(t,e[0])&&!this.isBoundaryPointInternal(t,e[1]))},ci.prototype.setBoundaryNodes=function(t,e){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=t,this._bdyNodes[1]=e},ci.prototype.addIntersections=function(t,e,n,r){if(t===n&&e===r)return null;this.numTests++;var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],a=n.getCoordinates()[r],s=n.getCoordinates()[r+1];this._li.computeIntersection(i,o,a,s),this._li.hasIntersection()&&(this._recordIsolated&&(t.setIsolated(!1),n.setIsolated(!1)),this._numIntersections++,this.isTrivialIntersection(t,e,n,r)||(this._hasIntersection=!0,!this._includeProper&&this._li.isProper()||(t.addIntersections(this._li,e,0),n.addIntersections(this._li,r,1)),this._li.isProper()&&(this._properIntersectionPoint=this._li.getIntersection(0).copy(),this._hasProper=!0,this._isDoneWhenProperInt&&(this._isDone=!0),this.isBoundaryPoint(this._li,this._bdyNodes)||(this._hasProperInterior=!0))))},ci.prototype.interfaces_=function(){return[]},ci.prototype.getClass=function(){return ci},ci.isAdjacentSegments=function(t,e){return 1===Math.abs(t-e)};var hi=function(t){function e(){t.call(this),this.events=new Et,this.nOverlaps=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.prepareEvents=function(){Qe.sort(this.events);for(var t=0;t<this.events.size();t++){var e=this.events.get(t);e.isDelete()&&e.getInsertEvent().setDeleteEventIndex(t)}},e.prototype.computeIntersections=function(){if(1===arguments.length){var t=arguments[0];this.nOverlaps=0,this.prepareEvents();for(var e=0;e<this.events.size();e++){var n=this.events.get(e);if(n.isInsert()&&this.processOverlaps(e,n.getDeleteEventIndex(),n,t),t.isDone())break}}else if(3===arguments.length)if(arguments[2]instanceof ci&&P(arguments[0],xt)&&P(arguments[1],xt)){var r=arguments[0],i=arguments[1],o=arguments[2];this.addEdges(r,r),this.addEdges(i,i),this.computeIntersections(o)}else if("boolean"==typeof arguments[2]&&P(arguments[0],xt)&&arguments[1]instanceof ci){var a=arguments[0],s=arguments[1];arguments[2]?this.addEdges(a,null):this.addEdges(a),this.computeIntersections(s)}},e.prototype.addEdge=function(t,e){for(var n=t.getMonotoneChainEdge(),r=n.getStartIndexes(),i=0;i<r.length-1;i++){var o=new ai(n,i),a=new si(e,n.getMinX(i),o);this.events.add(a),this.events.add(new si(n.getMaxX(i),a))}},e.prototype.processOverlaps=function(t,e,n,r){for(var i=n.getObject(),o=t;o<e;o++){var a=this.events.get(o);if(a.isInsert()){var s=a.getObject();n.isSameLabel(a)||(i.computeIntersections(s,r),this.nOverlaps++)}}},e.prototype.addEdges=function(){if(1===arguments.length)for(var t=arguments[0].iterator();t.hasNext();){var e=t.next();this.addEdge(e,e)}else if(2===arguments.length)for(var n=arguments[0],r=arguments[1],i=n.iterator();i.hasNext();){var o=i.next();this.addEdge(o,r)}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(ui),pi=function(){this._min=_.POSITIVE_INFINITY,this._max=_.NEGATIVE_INFINITY},di={NodeComparator:{configurable:!0}};pi.prototype.getMin=function(){return this._min},pi.prototype.intersects=function(t,e){return!(this._min>e||this._max<t)},pi.prototype.getMax=function(){return this._max},pi.prototype.toString=function(){return J.toLineString(new S(this._min,0),new S(this._max,0))},pi.prototype.interfaces_=function(){return[]},pi.prototype.getClass=function(){return pi},di.NodeComparator.get=function(){return fi},Object.defineProperties(pi,di);var fi=function(){};fi.prototype.compare=function(t,e){var n=t,r=e,i=(n._min+n._max)/2,o=(r._min+r._max)/2;return i<o?-1:i>o?1:0},fi.prototype.interfaces_=function(){return[E]},fi.prototype.getClass=function(){return fi};var gi=function(t){function e(){t.call(this),this._item=null;var e=arguments[0],n=arguments[1],r=arguments[2];this._min=e,this._max=n,this._item=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.query=function(t,e,n){if(!this.intersects(t,e))return null;n.visitItem(this._item)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(pi),yi=function(t){function e(){t.call(this),this._node1=null,this._node2=null;var e=arguments[0],n=arguments[1];this._node1=e,this._node2=n,this.buildExtent(this._node1,this._node2)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.buildExtent=function(t,e){this._min=Math.min(t._min,e._min),this._max=Math.max(t._max,e._max)},e.prototype.query=function(t,e,n){if(!this.intersects(t,e))return null;null!==this._node1&&this._node1.query(t,e,n),null!==this._node2&&this._node2.query(t,e,n)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(pi),mi=function(){this._leaves=new Et,this._root=null,this._level=0};mi.prototype.buildTree=function(){Qe.sort(this._leaves,new pi.NodeComparator);for(var t=this._leaves,e=null,n=new Et;;){if(this.buildLevel(t,n),1===n.size())return n.get(0);e=t,t=n,n=e}},mi.prototype.insert=function(t,e,n){if(null!==this._root)throw new Error("Index cannot be added to once it has been queried");this._leaves.add(new gi(t,e,n))},mi.prototype.query=function(t,e,n){this.init(),this._root.query(t,e,n)},mi.prototype.buildRoot=function(){if(null!==this._root)return null;this._root=this.buildTree()},mi.prototype.printNode=function(t){q.out.println(J.toLineString(new S(t._min,this._level),new S(t._max,this._level)))},mi.prototype.init=function(){if(null!==this._root)return null;this.buildRoot()},mi.prototype.buildLevel=function(t,e){this._level++,e.clear();for(var n=0;n<t.size();n+=2){var r=t.get(n);if(null===(n+1<t.size()?t.get(n):null))e.add(r);else{var i=new yi(t.get(n),t.get(n+1));e.add(i)}}},mi.prototype.interfaces_=function(){return[]},mi.prototype.getClass=function(){return mi};var vi=function(){this._items=new Et};vi.prototype.visitItem=function(t){this._items.add(t)},vi.prototype.getItems=function(){return this._items},vi.prototype.interfaces_=function(){return[Ke]},vi.prototype.getClass=function(){return vi};var _i=function(){this._index=null;var t=arguments[0];if(!P(t,Jt))throw new v("Argument must be Polygonal");this._index=new xi(t)},bi={SegmentVisitor:{configurable:!0},IntervalIndexedGeometry:{configurable:!0}};_i.prototype.locate=function(t){var e=new at(t),n=new wi(e);return this._index.query(t.y,t.y,n),e.getLocation()},_i.prototype.interfaces_=function(){return[zn]},_i.prototype.getClass=function(){return _i},bi.SegmentVisitor.get=function(){return wi},bi.IntervalIndexedGeometry.get=function(){return xi},Object.defineProperties(_i,bi);var wi=function(){this._counter=null;var t=arguments[0];this._counter=t};wi.prototype.visitItem=function(t){var e=t;this._counter.countSegment(e.getCoordinate(0),e.getCoordinate(1))},wi.prototype.interfaces_=function(){return[Ke]},wi.prototype.getClass=function(){return wi};var xi=function(){this._index=new mi;var t=arguments[0];this.init(t)};xi.prototype.init=function(t){for(var e=Sr.getLines(t).iterator();e.hasNext();){var n=e.next().getCoordinates();this.addLine(n)}},xi.prototype.addLine=function(t){for(var e=1;e<t.length;e++){var n=new gn(t[e-1],t[e]),r=Math.min(n.p0.y,n.p1.y),i=Math.max(n.p0.y,n.p1.y);this._index.insert(r,i,n)}},xi.prototype.query=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=new vi;return this._index.query(t,e,n),n.getItems()}if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2];this._index.query(r,i,o)}},xi.prototype.interfaces_=function(){return[]},xi.prototype.getClass=function(){return xi};var Ei=function(t){function e(){if(t.call(this),this._parentGeom=null,this._lineEdgeMap=new pe,this._boundaryNodeRule=null,this._useBoundaryDeterminationRule=!0,this._argIndex=null,this._boundaryNodes=null,this._hasTooFewPoints=!1,this._invalidPoint=null,this._areaPtLocator=null,this._ptLocator=new Or,2===arguments.length){var e=arguments[0],n=arguments[1],r=ft.OGC_SFS_BOUNDARY_RULE;this._argIndex=e,this._parentGeom=n,this._boundaryNodeRule=r,null!==n&&this.add(n)}else if(3===arguments.length){var i=arguments[0],o=arguments[1],a=arguments[2];this._argIndex=i,this._parentGeom=o,this._boundaryNodeRule=a,null!==o&&this.add(o)}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.insertBoundaryPoint=function(t,n){var r=this._nodes.addNode(n).getLabel(),i=1;r.getLocation(t,Oe.ON)===I.BOUNDARY&&i++;var o=e.determineBoundary(this._boundaryNodeRule,i);r.setLocation(t,o)},e.prototype.computeSelfNodes=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return this.computeSelfNodes(t,e,!1)}if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2],o=new ci(n,!0,!1);o.setIsDoneIfProperInt(i);var a=this.createEdgeSetIntersector(),s=this._parentGeom instanceof ee||this._parentGeom instanceof Qt||this._parentGeom instanceof ne,l=r||!s;return a.computeIntersections(this._edges,o,l),this.addSelfIntersectionNodes(this._argIndex),o}},e.prototype.computeSplitEdges=function(t){for(var e=this._edges.iterator();e.hasNext();)e.next().eiList.addSplitEdges(t)},e.prototype.computeEdgeIntersections=function(t,e,n){var r=new ci(e,n,!0);return r.setBoundaryNodes(this.getBoundaryNodes(),t.getBoundaryNodes()),this.createEdgeSetIntersector().computeIntersections(this._edges,t._edges,r),r},e.prototype.getGeometry=function(){return this._parentGeom},e.prototype.getBoundaryNodeRule=function(){return this._boundaryNodeRule},e.prototype.hasTooFewPoints=function(){return this._hasTooFewPoints},e.prototype.addPoint=function(){if(arguments[0]instanceof $t){var t=arguments[0].getCoordinate();this.insertPoint(this._argIndex,t,I.INTERIOR)}else if(arguments[0]instanceof S){var e=arguments[0];this.insertPoint(this._argIndex,e,I.INTERIOR)}},e.prototype.addPolygon=function(t){this.addPolygonRing(t.getExteriorRing(),I.EXTERIOR,I.INTERIOR);for(var e=0;e<t.getNumInteriorRing();e++){var n=t.getInteriorRingN(e);this.addPolygonRing(n,I.INTERIOR,I.EXTERIOR)}},e.prototype.addEdge=function(t){this.insertEdge(t);var e=t.getCoordinates();this.insertPoint(this._argIndex,e[0],I.BOUNDARY),this.insertPoint(this._argIndex,e[e.length-1],I.BOUNDARY)},e.prototype.addLineString=function(t){var e=Ct.removeRepeatedPoints(t.getCoordinates());if(e.length<2)return this._hasTooFewPoints=!0,this._invalidPoint=e[0],null;var n=new nr(e,new Me(this._argIndex,I.INTERIOR));this._lineEdgeMap.put(t,n),this.insertEdge(n),et.isTrue(e.length>=2,"found LineString with single point"),this.insertBoundaryPoint(this._argIndex,e[0]),this.insertBoundaryPoint(this._argIndex,e[e.length-1])},e.prototype.getInvalidPoint=function(){return this._invalidPoint},e.prototype.getBoundaryPoints=function(){for(var t=this.getBoundaryNodes(),e=new Array(t.size()).fill(null),n=0,r=t.iterator();r.hasNext();){var i=r.next();e[n++]=i.getCoordinate().copy()}return e},e.prototype.getBoundaryNodes=function(){return null===this._boundaryNodes&&(this._boundaryNodes=this._nodes.getBoundaryNodes(this._argIndex)),this._boundaryNodes},e.prototype.addSelfIntersectionNode=function(t,e,n){if(this.isBoundaryNode(t,e))return null;n===I.BOUNDARY&&this._useBoundaryDeterminationRule?this.insertBoundaryPoint(t,e):this.insertPoint(t,e,n)},e.prototype.addPolygonRing=function(t,e,n){if(t.isEmpty())return null;var r=Ct.removeRepeatedPoints(t.getCoordinates());if(r.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=r[0],null;var i=e,o=n;st.isCCW(r)&&(i=n,o=e);var a=new nr(r,new Me(this._argIndex,I.BOUNDARY,i,o));this._lineEdgeMap.put(t,a),this.insertEdge(a),this.insertPoint(this._argIndex,r[0],I.BOUNDARY)},e.prototype.insertPoint=function(t,e,n){var r=this._nodes.addNode(e),i=r.getLabel();null===i?r._label=new Me(t,n):i.setLocation(t,n)},e.prototype.createEdgeSetIntersector=function(){return new hi},e.prototype.addSelfIntersectionNodes=function(t){for(var e=this._edges.iterator();e.hasNext();)for(var n=e.next(),r=n.getLabel().getLocation(t),i=n.eiList.iterator();i.hasNext();){var o=i.next();this.addSelfIntersectionNode(t,o.coord,r)}},e.prototype.add=function(){if(1!==arguments.length)return t.prototype.add.apply(this,arguments);var e=arguments[0];if(e.isEmpty())return null;if(e instanceof ne&&(this._useBoundaryDeterminationRule=!1),e instanceof Qt)this.addPolygon(e);else if(e instanceof Kt)this.addLineString(e);else if(e instanceof $t)this.addPoint(e);else if(e instanceof te)this.addCollection(e);else if(e instanceof Vt)this.addCollection(e);else if(e instanceof ne)this.addCollection(e);else{if(!(e instanceof Bt))throw new Error(e.getClass().getName());this.addCollection(e)}},e.prototype.addCollection=function(t){for(var e=0;e<t.getNumGeometries();e++){var n=t.getGeometryN(e);this.add(n)}},e.prototype.locate=function(t){return P(this._parentGeom,Jt)&&this._parentGeom.getNumGeometries()>50?(null===this._areaPtLocator&&(this._areaPtLocator=new _i(this._parentGeom)),this._areaPtLocator.locate(t)):this._ptLocator.locate(t,this._parentGeom)},e.prototype.findEdge=function(){if(1===arguments.length){var e=arguments[0];return this._lineEdgeMap.get(e)}return t.prototype.findEdge.apply(this,arguments)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.determineBoundary=function(t,e){return t.isInBoundary(e)?I.BOUNDARY:I.INTERIOR},e}(qe),Si=function(){if(this._li=new it,this._resultPrecisionModel=null,this._arg=null,1===arguments.length){var t=arguments[0];this.setComputationPrecision(t.getPrecisionModel()),this._arg=new Array(1).fill(null),this._arg[0]=new Ei(0,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1],r=ft.OGC_SFS_BOUNDARY_RULE;e.getPrecisionModel().compareTo(n.getPrecisionModel())>=0?this.setComputationPrecision(e.getPrecisionModel()):this.setComputationPrecision(n.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new Ei(0,e,r),this._arg[1]=new Ei(1,n,r)}else if(3===arguments.length){var i=arguments[0],o=arguments[1],a=arguments[2];i.getPrecisionModel().compareTo(o.getPrecisionModel())>=0?this.setComputationPrecision(i.getPrecisionModel()):this.setComputationPrecision(o.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new Ei(0,i,a),this._arg[1]=new Ei(1,o,a)}};Si.prototype.getArgGeometry=function(t){return this._arg[t].getGeometry()},Si.prototype.setComputationPrecision=function(t){this._resultPrecisionModel=t,this._li.setPrecisionModel(this._resultPrecisionModel)},Si.prototype.interfaces_=function(){return[]},Si.prototype.getClass=function(){return Si};var Oi=function(){};Oi.prototype.interfaces_=function(){return[]},Oi.prototype.getClass=function(){return Oi},Oi.map=function(){if(arguments[0]instanceof ct&&P(arguments[1],Oi.MapOp)){for(var t=arguments[0],e=arguments[1],n=new Et,r=0;r<t.getNumGeometries();r++){var i=e.map(t.getGeometryN(r));null!==i&&n.add(i)}return t.getFactory().buildGeometry(n)}if(P(arguments[0],bt)&&P(arguments[1],Oi.MapOp)){for(var o=arguments[0],a=arguments[1],s=new Et,l=o.iterator();l.hasNext();){var u=l.next(),c=a.map(u);null!==c&&s.add(c)}return s}},Oi.MapOp=function(){};var Ci=function(t){function e(){var e=arguments[0],n=arguments[1];t.call(this,e,n),this._ptLocator=new Or,this._geomFact=null,this._resultGeom=null,this._graph=null,this._edgeList=new Wn,this._resultPolyList=new Et,this._resultLineList=new Et,this._resultPointList=new Et,this._graph=new qe(new Yn),this._geomFact=e.getFactory()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.insertUniqueEdge=function(t){var e=this._edgeList.findEqualEdge(t);if(null!==e){var n=e.getLabel(),r=t.getLabel();e.isPointwiseEqual(t)||(r=new Me(t.getLabel())).flip();var i=e.getDepth();i.isNull()&&i.add(n),i.add(r),n.merge(r)}else this._edgeList.add(t)},e.prototype.getGraph=function(){return this._graph},e.prototype.cancelDuplicateResultEdges=function(){for(var t=this._graph.getEdgeEnds().iterator();t.hasNext();){var e=t.next(),n=e.getSym();e.isInResult()&&n.isInResult()&&(e.setInResult(!1),n.setInResult(!1))}},e.prototype.isCoveredByLA=function(t){return!!this.isCovered(t,this._resultLineList)||!!this.isCovered(t,this._resultPolyList)},e.prototype.computeGeometry=function(t,n,r,i){var o=new Et;return o.addAll(t),o.addAll(n),o.addAll(r),o.isEmpty()?e.createEmptyResult(i,this._arg[0].getGeometry(),this._arg[1].getGeometry(),this._geomFact):this._geomFact.buildGeometry(o)},e.prototype.mergeSymLabels=function(){for(var t=this._graph.getNodes().iterator();t.hasNext();)t.next().getEdges().mergeSymLabels()},e.prototype.isCovered=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next();if(this._ptLocator.locate(t,r)!==I.EXTERIOR)return!0}return!1},e.prototype.replaceCollapsedEdges=function(){for(var t=new Et,e=this._edgeList.iterator();e.hasNext();){var n=e.next();n.isCollapsed()&&(e.remove(),t.add(n.getCollapsedEdge()))}this._edgeList.addAll(t)},e.prototype.updateNodeLabelling=function(){for(var t=this._graph.getNodes().iterator();t.hasNext();){var e=t.next(),n=e.getEdges().getLabel();e.getLabel().merge(n)}},e.prototype.getResultGeometry=function(t){return this.computeOverlay(t),this._resultGeom},e.prototype.insertUniqueEdges=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();this.insertUniqueEdge(n)}},e.prototype.computeOverlay=function(t){this.copyPoints(0),this.copyPoints(1),this._arg[0].computeSelfNodes(this._li,!1),this._arg[1].computeSelfNodes(this._li,!1),this._arg[0].computeEdgeIntersections(this._arg[1],this._li,!0);var e=new Et;this._arg[0].computeSplitEdges(e),this._arg[1].computeSplitEdges(e),this.insertUniqueEdges(e),this.computeLabelsFromDepths(),this.replaceCollapsedEdges(),qr.checkValid(this._edgeList.getEdges()),this._graph.addEdges(this._edgeList.getEdges()),this.computeLabelling(),this.labelIncompleteNodes(),this.findResultAreaEdges(t),this.cancelDuplicateResultEdges();var n=new Ye(this._geomFact);n.add(this._graph),this._resultPolyList=n.getPolygons();var r=new Xr(this,this._geomFact,this._ptLocator);this._resultLineList=r.build(t);var i=new Wr(this,this._geomFact,this._ptLocator);this._resultPointList=i.build(t),this._resultGeom=this.computeGeometry(this._resultPointList,this._resultLineList,this._resultPolyList,t)},e.prototype.labelIncompleteNode=function(t,e){var n=this._ptLocator.locate(t.getCoordinate(),this._arg[e].getGeometry());t.getLabel().setLocation(e,n)},e.prototype.copyPoints=function(t){for(var e=this._arg[t].getNodeIterator();e.hasNext();){var n=e.next();this._graph.addNode(n.getCoordinate()).setLabel(t,n.getLabel().getLocation(t))}},e.prototype.findResultAreaEdges=function(t){for(var n=this._graph.getEdgeEnds().iterator();n.hasNext();){var r=n.next(),i=r.getLabel();i.isArea()&&!r.isInteriorAreaEdge()&&e.isResultOfOp(i.getLocation(0,Oe.RIGHT),i.getLocation(1,Oe.RIGHT),t)&&r.setInResult(!0)}},e.prototype.computeLabelsFromDepths=function(){for(var t=this._edgeList.iterator();t.hasNext();){var e=t.next(),n=e.getLabel(),r=e.getDepth();if(!r.isNull()){r.normalize();for(var i=0;i<2;i++)n.isNull(i)||!n.isArea()||r.isNull(i)||(0===r.getDelta(i)?n.toLine(i):(et.isTrue(!r.isNull(i,Oe.LEFT),"depth of LEFT side has not been initialized"),n.setLocation(i,Oe.LEFT,r.getLocation(i,Oe.LEFT)),et.isTrue(!r.isNull(i,Oe.RIGHT),"depth of RIGHT side has not been initialized"),n.setLocation(i,Oe.RIGHT,r.getLocation(i,Oe.RIGHT))))}}},e.prototype.computeLabelling=function(){for(var t=this._graph.getNodes().iterator();t.hasNext();)t.next().getEdges().computeLabelling(this._arg);this.mergeSymLabels(),this.updateNodeLabelling()},e.prototype.labelIncompleteNodes=function(){for(var t=this._graph.getNodes().iterator();t.hasNext();){var e=t.next(),n=e.getLabel();e.isIsolated()&&(n.isNull(0)?this.labelIncompleteNode(e,0):this.labelIncompleteNode(e,1)),e.getEdges().updateLabelling(n)}},e.prototype.isCoveredByA=function(t){return!!this.isCovered(t,this._resultPolyList)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Si);Ci.overlayOp=function(t,e,n){return new Ci(t,e).getResultGeometry(n)},Ci.intersection=function(t,e){if(t.isEmpty()||e.isEmpty())return Ci.createEmptyResult(Ci.INTERSECTION,t,e,t.getFactory());if(t.isGeometryCollection()){var n=e;return Yr.map(t,{interfaces_:function(){return[Oi.MapOp]},map:function(t){return t.intersection(n)}})}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),oi.overlayOp(t,e,Ci.INTERSECTION)},Ci.symDifference=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return Ci.createEmptyResult(Ci.SYMDIFFERENCE,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),oi.overlayOp(t,e,Ci.SYMDIFFERENCE)},Ci.resultDimension=function(t,e,n){var r=e.getDimension(),i=n.getDimension(),o=-1;switch(t){case Ci.INTERSECTION:o=Math.min(r,i);break;case Ci.UNION:o=Math.max(r,i);break;case Ci.DIFFERENCE:o=r;break;case Ci.SYMDIFFERENCE:o=Math.max(r,i)}return o},Ci.createEmptyResult=function(t,e,n,r){var i=null;switch(Ci.resultDimension(t,e,n)){case-1:i=r.createGeometryCollection(new Array(0).fill(null));break;case 0:i=r.createPoint();break;case 1:i=r.createLineString();break;case 2:i=r.createPolygon()}return i},Ci.difference=function(t,e){return t.isEmpty()?Ci.createEmptyResult(Ci.DIFFERENCE,t,e,t.getFactory()):e.isEmpty()?t.copy():(t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),oi.overlayOp(t,e,Ci.DIFFERENCE))},Ci.isResultOfOp=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=t.getLocation(0),r=t.getLocation(1);return Ci.isResultOfOp(n,r,e)}if(3===arguments.length){var i=arguments[0],o=arguments[1],a=arguments[2];switch(i===I.BOUNDARY&&(i=I.INTERIOR),o===I.BOUNDARY&&(o=I.INTERIOR),a){case Ci.INTERSECTION:return i===I.INTERIOR&&o===I.INTERIOR;case Ci.UNION:return i===I.INTERIOR||o===I.INTERIOR;case Ci.DIFFERENCE:return i===I.INTERIOR&&o!==I.INTERIOR;case Ci.SYMDIFFERENCE:return i===I.INTERIOR&&o!==I.INTERIOR||i!==I.INTERIOR&&o===I.INTERIOR}return!1}},Ci.INTERSECTION=1,Ci.UNION=2,Ci.DIFFERENCE=3,Ci.SYMDIFFERENCE=4;var Ti=function(){this._g=null,this._boundaryDistanceTolerance=null,this._linework=null,this._ptLocator=new Or,this._seg=new gn;var t=arguments[0],e=arguments[1];this._g=t,this._boundaryDistanceTolerance=e,this._linework=this.extractLinework(t)};Ti.prototype.isWithinToleranceOfBoundary=function(t){for(var e=0;e<this._linework.getNumGeometries();e++)for(var n=this._linework.getGeometryN(e).getCoordinateSequence(),r=0;r<n.size()-1;r++)if(n.getCoordinate(r,this._seg.p0),n.getCoordinate(r+1,this._seg.p1),this._seg.distance(t)<=this._boundaryDistanceTolerance)return!0;return!1},Ti.prototype.getLocation=function(t){return this.isWithinToleranceOfBoundary(t)?I.BOUNDARY:this._ptLocator.locate(t,this._g)},Ti.prototype.extractLinework=function(t){var e=new Ii;t.apply(e);var n=e.getLinework(),r=me.toLineStringArray(n);return t.getFactory().createMultiLineString(r)},Ti.prototype.interfaces_=function(){return[]},Ti.prototype.getClass=function(){return Ti};var Ii=function(){this._linework=null,this._linework=new Et};Ii.prototype.getLinework=function(){return this._linework},Ii.prototype.filter=function(t){if(t instanceof Qt){var e=t;this._linework.add(e.getExteriorRing());for(var n=0;n<e.getNumInteriorRing();n++)this._linework.add(e.getInteriorRingN(n))}},Ii.prototype.interfaces_=function(){return[zt]},Ii.prototype.getClass=function(){return Ii};var Li=function(){this._g=null,this._doLeft=!0,this._doRight=!0;var t=arguments[0];this._g=t};Li.prototype.extractPoints=function(t,e,n){for(var r=t.getCoordinates(),i=0;i<r.length-1;i++)this.computeOffsetPoints(r[i],r[i+1],e,n)},Li.prototype.setSidesToGenerate=function(t,e){this._doLeft=t,this._doRight=e},Li.prototype.getPoints=function(t){for(var e=new Et,n=Sr.getLines(this._g).iterator();n.hasNext();){var r=n.next();this.extractPoints(r,t,e)}return e},Li.prototype.computeOffsetPoints=function(t,e,n,r){var i=e.x-t.x,o=e.y-t.y,a=Math.sqrt(i*i+o*o),s=n*i/a,l=n*o/a,u=(e.x+t.x)/2,c=(e.y+t.y)/2;if(this._doLeft){var h=new S(u-l,c+s);r.add(h)}if(this._doRight){var p=new S(u+l,c-s);r.add(p)}},Li.prototype.interfaces_=function(){return[]},Li.prototype.getClass=function(){return Li};var Pi=function t(){this._geom=null,this._locFinder=null,this._location=new Array(3).fill(null),this._invalidLocation=null,this._boundaryDistanceTolerance=t.TOLERANCE,this._testCoords=new Et;var e=arguments[0],n=arguments[1],r=arguments[2];this._boundaryDistanceTolerance=t.computeBoundaryDistanceTolerance(e,n),this._geom=[e,n,r],this._locFinder=[new Ti(this._geom[0],this._boundaryDistanceTolerance),new Ti(this._geom[1],this._boundaryDistanceTolerance),new Ti(this._geom[2],this._boundaryDistanceTolerance)]},Ri={TOLERANCE:{configurable:!0}};Pi.prototype.reportResult=function(t,e,n){q.out.println("Overlay result invalid - A:"+I.toLocationSymbol(e[0])+" B:"+I.toLocationSymbol(e[1])+" expected:"+(n?"i":"e")+" actual:"+I.toLocationSymbol(e[2]))},Pi.prototype.isValid=function(t){return this.addTestPts(this._geom[0]),this.addTestPts(this._geom[1]),this.checkValid(t)},Pi.prototype.checkValid=function(){if(1===arguments.length){for(var t=arguments[0],e=0;e<this._testCoords.size();e++){var n=this._testCoords.get(e);if(!this.checkValid(t,n))return this._invalidLocation=n,!1}return!0}if(2===arguments.length){var r=arguments[0],i=arguments[1];return this._location[0]=this._locFinder[0].getLocation(i),this._location[1]=this._locFinder[1].getLocation(i),this._location[2]=this._locFinder[2].getLocation(i),!!Pi.hasLocation(this._location,I.BOUNDARY)||this.isValidResult(r,this._location)}},Pi.prototype.addTestPts=function(t){var e=new Li(t);this._testCoords.addAll(e.getPoints(5*this._boundaryDistanceTolerance))},Pi.prototype.isValidResult=function(t,e){var n=Ci.isResultOfOp(e[0],e[1],t),r=!(n^e[2]===I.INTERIOR);return r||this.reportResult(t,e,n),r},Pi.prototype.getInvalidLocation=function(){return this._invalidLocation},Pi.prototype.interfaces_=function(){return[]},Pi.prototype.getClass=function(){return Pi},Pi.hasLocation=function(t,e){for(var n=0;n<3;n++)if(t[n]===e)return!0;return!1},Pi.computeBoundaryDistanceTolerance=function(t,e){return Math.min(Zr.computeSizeBasedSnapTolerance(t),Zr.computeSizeBasedSnapTolerance(e))},Pi.isValid=function(t,e,n,r){return new Pi(t,e,r).isValid(n)},Ri.TOLERANCE.get=function(){return 1e-6},Object.defineProperties(Pi,Ri);var Mi=function t(e){this._geomFactory=null,this._skipEmpty=!1,this._inputGeoms=null,this._geomFactory=t.extractFactory(e),this._inputGeoms=e};Mi.prototype.extractElements=function(t,e){if(null===t)return null;for(var n=0;n<t.getNumGeometries();n++){var r=t.getGeometryN(n);this._skipEmpty&&r.isEmpty()||e.add(r)}},Mi.prototype.combine=function(){for(var t=new Et,e=this._inputGeoms.iterator();e.hasNext();){var n=e.next();this.extractElements(n,t)}return 0===t.size()?null!==this._geomFactory?this._geomFactory.createGeometryCollection(null):null:this._geomFactory.buildGeometry(t)},Mi.prototype.interfaces_=function(){return[]},Mi.prototype.getClass=function(){return Mi},Mi.combine=function(){if(1===arguments.length){var t=arguments[0];return new Mi(t).combine()}if(2===arguments.length){var e=arguments[0],n=arguments[1];return new Mi(Mi.createList(e,n)).combine()}if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2];return new Mi(Mi.createList(r,i,o)).combine()}},Mi.extractFactory=function(t){return t.isEmpty()?null:t.iterator().next().getFactory()},Mi.createList=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=new Et;return n.add(t),n.add(e),n}if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2],a=new Et;return a.add(r),a.add(i),a.add(o),a}};var Ni=function(){this._inputPolys=null,this._geomFactory=null;var t=arguments[0];this._inputPolys=t,null===this._inputPolys&&(this._inputPolys=new Et)},ji={STRTREE_NODE_CAPACITY:{configurable:!0}};Ni.prototype.reduceToGeometries=function(t){for(var e=new Et,n=t.iterator();n.hasNext();){var r=n.next(),i=null;P(r,xt)?i=this.unionTree(r):r instanceof ct&&(i=r),e.add(i)}return e},Ni.prototype.extractByEnvelope=function(t,e,n){for(var r=new Et,i=0;i<e.getNumGeometries();i++){var o=e.getGeometryN(i);o.getEnvelopeInternal().intersects(t)?r.add(o):n.add(o)}return this._geomFactory.buildGeometry(r)},Ni.prototype.unionOptimized=function(t,e){var n=t.getEnvelopeInternal(),r=e.getEnvelopeInternal();if(!n.intersects(r))return Mi.combine(t,e);if(t.getNumGeometries()<=1&&e.getNumGeometries()<=1)return this.unionActual(t,e);var i=n.intersection(r);return this.unionUsingEnvelopeIntersection(t,e,i)},Ni.prototype.union=function(){if(null===this._inputPolys)throw new Error("union() method cannot be called twice");if(this._inputPolys.isEmpty())return null;this._geomFactory=this._inputPolys.iterator().next().getFactory();for(var t=new an(Ni.STRTREE_NODE_CAPACITY),e=this._inputPolys.iterator();e.hasNext();){var n=e.next();t.insert(n.getEnvelopeInternal(),n)}this._inputPolys=null;var r=t.itemsTree();return this.unionTree(r)},Ni.prototype.binaryUnion=function(){if(1===arguments.length){var t=arguments[0];return this.binaryUnion(t,0,t.size())}if(3===arguments.length){var e=arguments[0],n=arguments[1],r=arguments[2];if(r-n<=1){var i=Ni.getGeometry(e,n);return this.unionSafe(i,null)}if(r-n==2)return this.unionSafe(Ni.getGeometry(e,n),Ni.getGeometry(e,n+1));var o=Math.trunc((r+n)/2),a=this.binaryUnion(e,n,o),s=this.binaryUnion(e,o,r);return this.unionSafe(a,s)}},Ni.prototype.repeatedUnion=function(t){for(var e=null,n=t.iterator();n.hasNext();){var r=n.next();e=null===e?r.copy():e.union(r)}return e},Ni.prototype.unionSafe=function(t,e){return null===t&&null===e?null:null===t?e.copy():null===e?t.copy():this.unionOptimized(t,e)},Ni.prototype.unionActual=function(t,e){return Ni.restrictToPolygons(t.union(e))},Ni.prototype.unionTree=function(t){var e=this.reduceToGeometries(t);return this.binaryUnion(e)},Ni.prototype.unionUsingEnvelopeIntersection=function(t,e,n){var r=new Et,i=this.extractByEnvelope(n,t,r),o=this.extractByEnvelope(n,e,r),a=this.unionActual(i,o);return r.add(a),Mi.combine(r)},Ni.prototype.bufferUnion=function(){if(1===arguments.length){var t=arguments[0];return t.get(0).getFactory().buildGeometry(t).buffer(0)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e.getFactory().createGeometryCollection([e,n]).buffer(0)}},Ni.prototype.interfaces_=function(){return[]},Ni.prototype.getClass=function(){return Ni},Ni.restrictToPolygons=function(t){if(P(t,Jt))return t;var e=Er.getPolygons(t);return 1===e.size()?e.get(0):t.getFactory().createMultiPolygon(me.toPolygonArray(e))},Ni.getGeometry=function(t,e){return e>=t.size()?null:t.get(e)},Ni.union=function(t){return new Ni(t).union()},ji.STRTREE_NODE_CAPACITY.get=function(){return 4},Object.defineProperties(Ni,ji);var Ai=function(){};Ai.prototype.interfaces_=function(){return[]},Ai.prototype.getClass=function(){return Ai},Ai.union=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return Ci.createEmptyResult(Ci.UNION,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),oi.overlayOp(t,e,Ci.UNION)},t.GeoJSONReader=Ee,t.GeoJSONWriter=Se,t.OverlayOp=Ci,t.UnionOp=Ai,t.BufferOp=gr,Object.defineProperty(t,"__esModule",{value:!0})}(e)},function(t,e,n){"use strict";var r,i=n(54),o=n(39),a=n(4),s=n(2),l=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),u=function(t){function e(e){var n=t.call(this)||this;return n.projection=Object(s.get)(e.projection),n.attributions_=c(e.attributions),n.attributionsCollapsible_=void 0===e.attributionsCollapsible||e.attributionsCollapsible,n.loading=!1,n.state_=void 0!==e.state?e.state:o.a.READY,n.wrapX_=void 0!==e.wrapX&&e.wrapX,n}return l(e,t),e.prototype.getAttributions=function(){return this.attributions_},e.prototype.getAttributionsCollapsible=function(){return this.attributionsCollapsible_},e.prototype.getProjection=function(){return this.projection},e.prototype.getResolutions=function(){return Object(a.b)()},e.prototype.getState=function(){return this.state_},e.prototype.getWrapX=function(){return this.wrapX_},e.prototype.getContextOptions=function(){},e.prototype.refresh=function(){this.changed()},e.prototype.setAttributions=function(t){this.attributions_=c(t),this.changed()},e.prototype.setState=function(t){this.state_=t,this.changed()},e}(i.a);function c(t){return t?Array.isArray(t)?function(e){return t}:"function"==typeof t?t:function(e){return[t]}:null}e.a=u},function(t,e,n){"use strict";(function(t,r){n.d(e,"a",(function(){return J})),n.d(e,"b",(function(){return wn})),n.d(e,"c",(function(){return Qn})),n.d(e,"d",(function(){return pn})),n.d(e,"e",(function(){return tr})),n.d(e,"f",(function(){return i}));var i={$version:8,$root:{version:{required:!0,type:"enum",values:[8],doc:"Style specification version number. Must be 8.",example:8},name:{type:"string",doc:"A human-readable name for the style.",example:"Bright"},metadata:{type:"*",doc:"Arbitrary properties useful to track with the stylesheet, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'mapbox:'."},center:{type:"array",value:"number",doc:"Default map center in longitude and latitude. The style center will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",example:[-73.9749,40.7736]},zoom:{type:"number",doc:"Default zoom level. The style zoom will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",example:12.5},bearing:{type:"number",default:0,period:360,units:"degrees",doc:'Default bearing, in degrees. The bearing is the compass direction that is "up"; for example, a bearing of 90° orients the map so that east is up. This value will be used only if the map has not been positioned by other means (e.g. map options or user interaction).',example:29},pitch:{type:"number",default:0,units:"degrees",doc:"Default pitch, in degrees. Zero is perpendicular to the surface, for a look straight down at the map, while a greater value like 60 looks ahead towards the horizon. The style pitch will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",example:50},light:{type:"light",doc:"The global light source.",example:{anchor:"viewport",color:"white",intensity:.4}},terrain:{type:"terrain",doc:"A global modifier that elevates layers and markers based on a DEM data source."},fog:{type:"fog",doc:"A global effect that fades layers and markers based on their distance to the camera. The fog can be used to approximate the effect of atmosphere on distant objects and enhance the depth perception of the map when used with terrain or 3D features."},sources:{required:!0,type:"sources",doc:"Data source specifications.",example:{"mapbox-streets":{type:"vector",url:"mapbox://mapbox.mapbox-streets-v6"}}},sprite:{type:"string",doc:"A base URL for retrieving the sprite image and metadata. The extensions `.png`, `.json` and scale factor `@2x.png` will be automatically appended. This property is required if any layer uses the `background-pattern`, `fill-pattern`, `line-pattern`, `fill-extrusion-pattern`, or `icon-image` properties. The URL must be absolute, containing the [scheme, authority and path components](https://en.wikipedia.org/wiki/URL#Syntax).",example:"mapbox://sprites/mapbox/bright-v8"},glyphs:{type:"string",doc:"A URL template for loading signed-distance-field glyph sets in PBF format. The URL must include `{fontstack}` and `{range}` tokens. This property is required if any layer uses the `text-field` layout property. The URL must be absolute, containing the [scheme, authority and path components](https://en.wikipedia.org/wiki/URL#Syntax).",example:"mapbox://fonts/mapbox/{fontstack}/{range}.pbf"},transition:{type:"transition",doc:"A global transition definition to use as a default across properties, to be used for timing transitions between one value and the next when no property-specific transition is set. Collision-based symbol fading is controlled independently of the style's `transition` property.",example:{duration:300,delay:0}},layers:{required:!0,type:"array",value:"layer",doc:"Layers will be drawn in the order of this array.",example:[{id:"water",source:"mapbox-streets","source-layer":"water",type:"fill",paint:{"fill-color":"#00ffff"}}]}},sources:{"*":{type:"source",doc:"Specification of a data source. For vector and raster sources, either TileJSON or a URL to a TileJSON must be provided. For image and video sources, a URL must be provided. For GeoJSON sources, a URL or inline GeoJSON must be provided."}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{doc:"A vector tile source."}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://<Tileset ID>`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},scheme:{type:"enum",values:{xyz:{doc:"Slippy map tilenames scheme."},tms:{doc:"OSGeo spec scheme."}},default:"xyz",doc:"Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},promoteId:{type:"promoteId",doc:"A property to use as a feature id (for feature state). Either a property name, or an object of the form `{<sourceLayer>: <propertyName>}`. If specified as a string for a vector tile source, the same property is used across all its source layers."},volatile:{type:"boolean",default:!1,doc:"A setting to determine whether a source's tiles are cached locally.","sdk-support":{"basic functionality":{android:"9.3.0",ios:"5.10.0"}}},"*":{type:"*",doc:"Other keys to configure the data source."}},source_raster:{type:{required:!0,type:"enum",values:{raster:{doc:"A raster tile source."}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://<Tileset ID>`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},tileSize:{type:"number",default:512,units:"pixels",doc:"The minimum visual size to display tiles for this layer. Only configurable for raster layers."},scheme:{type:"enum",values:{xyz:{doc:"Slippy map tilenames scheme."},tms:{doc:"OSGeo spec scheme."}},default:"xyz",doc:"Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},volatile:{type:"boolean",default:!1,doc:"A setting to determine whether a source's tiles are cached locally.","sdk-support":{"basic functionality":{android:"9.3.0",ios:"5.10.0"}}},"*":{type:"*",doc:"Other keys to configure the data source."}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{doc:"A RGB-encoded raster DEM source"}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://<Tileset ID>`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},tileSize:{type:"number",default:512,units:"pixels",doc:"The minimum visual size to display tiles for this layer. Only configurable for raster layers."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},encoding:{type:"enum",values:{terrarium:{doc:"Terrarium format PNG tiles. See https://aws.amazon.com/es/public-datasets/terrain/ for more info."},mapbox:{doc:"Mapbox Terrain RGB tiles. See https://www.mapbox.com/help/access-elevation-data/#mapbox-terrain-rgb for more info."}},default:"mapbox",doc:"The encoding used by this source. Mapbox Terrain RGB is used by default"},volatile:{type:"boolean",default:!1,doc:"A setting to determine whether a source's tiles are cached locally.","sdk-support":{"basic functionality":{android:"9.3.0",ios:"5.10.0"}}},"*":{type:"*",doc:"Other keys to configure the data source."}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{doc:"A GeoJSON data source."}},doc:"The data type of the GeoJSON source."},data:{type:"*",doc:"A URL to a GeoJSON file, or inline GeoJSON."},maxzoom:{type:"number",default:18,doc:"Maximum zoom level at which to create vector tiles (higher means greater detail at high zoom levels)."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},buffer:{type:"number",default:128,maximum:512,minimum:0,doc:"Size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance."},filter:{type:"*",doc:"An expression for filtering features prior to processing them for rendering."},tolerance:{type:"number",default:.375,doc:"Douglas-Peucker simplification tolerance (higher means simpler geometries and faster performance)."},cluster:{type:"boolean",default:!1,doc:"If the data is a collection of point features, setting this to true clusters the points by radius into groups. Cluster groups become new `Point` features in the source with additional properties:\n * `cluster` Is `true` if the point is a cluster \n * `cluster_id` A unqiue id for the cluster to be used in conjunction with the [cluster inspection methods](https://www.mapbox.com/mapbox-gl-js/api/#geojsonsource#getclusterexpansionzoom)\n * `point_count` Number of original points grouped into this cluster\n * `point_count_abbreviated` An abbreviated point count"},clusterRadius:{type:"number",default:50,minimum:0,doc:"Radius of each cluster if clustering is enabled. A value of 512 indicates a radius equal to the width of a tile."},clusterMaxZoom:{type:"number",doc:"Max zoom on which to cluster points if clustering is enabled. Defaults to one zoom less than maxzoom (so that last zoom features are not clustered). Clusters are re-evaluated at integer zoom levels so setting clusterMaxZoom to 14 means the clusters will be displayed until z15."},clusterMinPoints:{type:"number",doc:"Minimum number of points necessary to form a cluster if clustering is enabled. Defaults to `2`."},clusterProperties:{type:"*",doc:'An object defining custom properties on the generated clusters if clustering is enabled, aggregating values from clustered points. Has the form `{"property_name": [operator, map_expression]}`. `operator` is any expression function that accepts at least 2 operands (e.g. `"+"` or `"max"`) — it accumulates the property value from clusters/points the cluster contains; `map_expression` produces the value of a single point.\n\nExample: `{"sum": ["+", ["get", "scalerank"]]}`.\n\nFor more advanced use cases, in place of `operator`, you can use a custom reduce expression that references a special `["accumulated"]` value, e.g.:\n`{"sum": [["+", ["accumulated"], ["get", "sum"]], ["get", "scalerank"]]}`'},lineMetrics:{type:"boolean",default:!1,doc:"Whether to calculate line distance metrics. This is required for line layers that specify `line-gradient` values."},generateId:{type:"boolean",default:!1,doc:"Whether to generate ids for the geojson features. When enabled, the `feature.id` property will be auto assigned based on its index in the `features` array, over-writing any previous values."},promoteId:{type:"promoteId",doc:"A property to use as a feature id (for feature state). Either a property name, or an object of the form `{<sourceLayer>: <propertyName>}`."}},source_video:{type:{required:!0,type:"enum",values:{video:{doc:"A video data source."}},doc:"The data type of the video source."},urls:{required:!0,type:"array",value:"string",doc:"URLs to video content in order of preferred format."},coordinates:{required:!0,doc:"Corners of video specified in longitude, latitude pairs.",type:"array",length:4,value:{type:"array",length:2,value:"number",doc:"A single longitude, latitude pair."}}},source_image:{type:{required:!0,type:"enum",values:{image:{doc:"An image data source."}},doc:"The data type of the image source."},url:{required:!0,type:"string",doc:"URL that points to an image."},coordinates:{required:!0,doc:"Corners of image specified in longitude, latitude pairs.",type:"array",length:4,value:{type:"array",length:2,value:"number",doc:"A single longitude, latitude pair."}}},layer:{id:{type:"string",doc:"Unique layer name.",required:!0},type:{type:"enum",values:{fill:{doc:"A filled polygon with an optional stroked border.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},line:{doc:"A stroked line.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},symbol:{doc:"An icon or a text label.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},circle:{doc:"A filled circle.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},heatmap:{doc:"A heatmap.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"fill-extrusion":{doc:"An extruded (3D) polygon.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},raster:{doc:"Raster map textures such as satellite imagery.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},hillshade:{doc:"Client-side hillshading visualization based on DEM data. Currently, the implementation only supports Mapbox Terrain RGB and Mapzen Terrarium tiles.","sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},background:{doc:"The background color or pattern of the map.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},sky:{doc:"A spherical dome around the map that is always rendered behind all other layers.","sdk-support":{"basic functionality":{js:"2.0.0"}}}},doc:"Rendering type of this layer.",required:!0},metadata:{type:"*",doc:"Arbitrary properties useful to track with the layer, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'mapbox:'."},source:{type:"string",doc:"Name of a source description to be used for this layer. Required for all layer types except `background`."},"source-layer":{type:"string",doc:"Layer to use from a vector tile source. Required for vector tile sources; prohibited for all other source types, including GeoJSON sources."},minzoom:{type:"number",minimum:0,maximum:24,doc:"The minimum zoom level for the layer. At zoom levels less than the minzoom, the layer will be hidden."},maxzoom:{type:"number",minimum:0,maximum:24,doc:"The maximum zoom level for the layer. At zoom levels equal to or greater than the maxzoom, the layer will be hidden."},filter:{type:"filter",doc:"A expression specifying conditions on source features. Only features that match the filter are displayed. Zoom expressions in filters are only evaluated at integer zoom levels. The `feature-state` expression is not supported in filter expressions."},layout:{type:"layout",doc:"Layout properties for the layer."},paint:{type:"paint",doc:"Default paint properties for this layer."}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background","layout_sky"],layout_background:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_sky:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"2.0.0"}},"property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"},"data-driven styling":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{js:"1.2.0",android:"9.2.0",ios:"5.9.0",macos:"0.16.0"},"data-driven styling":{js:"1.2.0",android:"9.2.0",ios:"5.9.0",macos:"0.16.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},"property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},"property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{doc:"A cap with a squared-off end which is drawn to the exact endpoint of the line."},round:{doc:"A cap with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's width and centered on the endpoint of the line."},square:{doc:"A cap with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line's width."}},default:"butt",doc:"The display of line endings.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"2.3.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-join":{type:"enum",values:{bevel:{doc:"A join with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line's width."},round:{doc:"A join with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's width and centered on the endpoint of the line."},miter:{doc:"A join with a sharp, angled corner which is drawn with the outer sides beyond the endpoint of the path until they meet."}},default:"miter",doc:"The display of lines when joining.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,doc:"Used to automatically convert miter joins to bevel joins for sharp angles.",requires:[{"line-join":"miter"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,doc:"Used to automatically convert round joins to miter joins for shallow angles.",requires:[{"line-join":"round"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"},"data-driven styling":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{doc:"The label is placed at the point where the geometry is located."},line:{doc:"The label is placed along the line of the geometry. Can only be used on `LineString` and `Polygon` geometries."},"line-center":{doc:"The label is placed at the center of the line of the geometry. Can only be used on `LineString` and `Polygon` geometries. Note that a single feature in a vector tile may contain multiple line geometries."}},default:"point",doc:"Label placement relative to its geometry.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"`line-center` value":{js:"0.47.0",android:"6.4.0",ios:"4.3.0",macos:"0.10.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",doc:"Distance between two symbol anchors.",requires:[{"symbol-placement":"line"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,doc:"If true, the symbols will not cross tile edges to avoid mutual collisions. Recommended in layers that don't have enough padding in the vector tile to prevent collisions, or if it is a point symbol layer placed after a line symbol layer. When using a client that supports global collision detection, like Mapbox GL JS version 0.42.0 or greater, enabling this property is not needed to prevent clipped labels at tile boundaries.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with lower sort keys are drawn and placed first. When `icon-allow-overlap` or `text-allow-overlap` is `false`, features with a lower sort key will have priority during placement. When `icon-allow-overlap` or `text-allow-overlap` is set to `true`, features with a higher sort key will overlap over features with a lower sort key.","sdk-support":{"basic functionality":{js:"0.53.0",android:"7.4.0",ios:"4.11.0",macos:"0.14.0"},"data-driven styling":{js:"0.53.0",android:"7.4.0",ios:"4.11.0",macos:"0.14.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{doc:"Sorts symbols by `symbol-sort-key` if set. Otherwise, sorts symbols by their y-position relative to the viewport if `icon-allow-overlap` or `text-allow-overlap` is set to `true` or `icon-ignore-placement` or `text-ignore-placement` is `false`."},"viewport-y":{doc:"Sorts symbols by their y-position relative to the viewport if `icon-allow-overlap` or `text-allow-overlap` is set to `true` or `icon-ignore-placement` or `text-ignore-placement` is `false`."},source:{doc:"Sorts symbols by `symbol-sort-key` if set. Otherwise, no sorting is applied; symbols are rendered in the same order as the source data."}},default:"auto",doc:"Determines whether overlapping symbols in the same layer are rendered in the order that they appear in the data source or by their y-position relative to the viewport. To control the order and prioritization of symbols otherwise, use `symbol-sort-key`.","sdk-support":{"basic functionality":{js:"0.49.0",android:"6.6.0",ios:"4.5.0",macos:"0.12.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,doc:"If true, the icon will be visible even if it collides with other previously drawn symbols.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,doc:"If true, other symbols can be visible even if they collide with the icon.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,doc:"If true, text will display without their corresponding icons when the icon collides with other symbols and the text does not.",requires:["icon-image","text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{doc:"When `symbol-placement` is set to `point`, aligns icons east-west. When `symbol-placement` is set to `line` or `line-center`, aligns icon x-axes with the line."},viewport:{doc:"Produces icons whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`."},auto:{doc:"When `symbol-placement` is set to `point`, this is equivalent to `viewport`. When `symbol-placement` is set to `line` or `line-center`, this is equivalent to `map`."}},default:"auto",doc:"In combination with `symbol-placement`, determines the rotation behavior of icons.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",doc:"Scales the original size of the icon by the provided factor. The new pixel size of the image will be the original pixel size multiplied by `icon-size`. 1 is the original size; 3 triples the size of the image.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{doc:"The icon is displayed at its intrinsic aspect ratio."},width:{doc:"The icon is scaled in the x-dimension to fit the width of the text."},height:{doc:"The icon is scaled in the y-dimension to fit the height of the text."},both:{doc:"The icon is scaled in both x- and y-dimensions."}},default:"none",doc:"Scales the icon to fit around the associated text.",requires:["icon-image","text-field"],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"},"stretchable icons":{js:"1.6.0",android:"9.2.0",ios:"5.8.0",macos:"0.15.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",doc:"Size of the additional area added to dimensions determined by `icon-text-fit`, in clockwise order: top, right, bottom, left.",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",doc:"Name of image in sprite to use for drawing an image background.",tokens:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",doc:"Rotates the icon clockwise.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.21.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",doc:"Size of the additional area around the icon bounding box used for detecting symbol collisions.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,doc:"If true, the icon may be flipped to prevent it from being rendered upside-down.",requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],doc:"Offset distance of icon from its anchor. Positive values indicate right and down, while negative values indicate left and up. Each component is multiplied by the value of `icon-size` to obtain the final offset in pixels. When combined with `icon-rotate` the offset will be as if the rotated direction was up.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{doc:"The center of the icon is placed closest to the anchor."},left:{doc:"The left side of the icon is placed closest to the anchor."},right:{doc:"The right side of the icon is placed closest to the anchor."},top:{doc:"The top of the icon is placed closest to the anchor."},bottom:{doc:"The bottom of the icon is placed closest to the anchor."},"top-left":{doc:"The top left corner of the icon is placed closest to the anchor."},"top-right":{doc:"The top right corner of the icon is placed closest to the anchor."},"bottom-left":{doc:"The bottom left corner of the icon is placed closest to the anchor."},"bottom-right":{doc:"The bottom right corner of the icon is placed closest to the anchor."}},default:"center",doc:"Part of the icon placed closest to the anchor.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{doc:"The icon is aligned to the plane of the map."},viewport:{doc:"The icon is aligned to the plane of the viewport."},auto:{doc:"Automatically matches the value of `icon-rotation-alignment`."}},default:"auto",doc:"Orientation of icon when map is pitched.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{doc:"The text is aligned to the plane of the map."},viewport:{doc:"The text is aligned to the plane of the viewport."},auto:{doc:"Automatically matches the value of `text-rotation-alignment`."}},default:"auto",doc:"Orientation of text when map is pitched.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{doc:"When `symbol-placement` is set to `point`, aligns text east-west. When `symbol-placement` is set to `line` or `line-center`, aligns text x-axes with the line."},viewport:{doc:"Produces glyphs whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`."},auto:{doc:"When `symbol-placement` is set to `point`, this is equivalent to `viewport`. When `symbol-placement` is set to `line` or `line-center`, this is equivalent to `map`."}},default:"auto",doc:"In combination with `symbol-placement`, determines the rotation behavior of the individual glyphs forming the text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,doc:"Value to use for a text label. If a plain `string` is provided, it will be treated as a `formatted` with default/inherited formatting options.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],doc:"Font stack to use for displaying text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",doc:"Font size.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",doc:"The maximum line width for text wrapping.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",doc:"Text leading value for multi-line text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"2.3.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-letter-spacing":{type:"number",default:0,units:"ems",doc:"Text tracking amount.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{doc:"The text is aligned towards the anchor position."},left:{doc:"The text is aligned to the left."},center:{doc:"The text is centered."},right:{doc:"The text is aligned to the right."}},default:"center",doc:"Text justification options.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"},auto:{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,doc:"Radial offset of text, in the direction of the symbol's anchor. Useful in combination with `text-variable-anchor`, which defaults to using the two-dimensional `text-offset` if present.","sdk-support":{"basic functionality":{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"},"data-driven styling":{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"}},requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{doc:"The center of the text is placed closest to the anchor."},left:{doc:"The left side of the text is placed closest to the anchor."},right:{doc:"The right side of the text is placed closest to the anchor."},top:{doc:"The top of the text is placed closest to the anchor."},bottom:{doc:"The bottom of the text is placed closest to the anchor."},"top-left":{doc:"The top left corner of the text is placed closest to the anchor."},"top-right":{doc:"The top right corner of the text is placed closest to the anchor."},"bottom-left":{doc:"The bottom left corner of the text is placed closest to the anchor."},"bottom-right":{doc:"The bottom right corner of the text is placed closest to the anchor."}},requires:["text-field",{"symbol-placement":["point"]}],doc:"To increase the chance of placing high-priority labels on the map, you can provide an array of `text-anchor` locations: the renderer will attempt to place the label at each location, in order, before moving onto the next label. Use `text-justify: auto` to choose justification based on anchor position. To apply an offset, use the `text-radial-offset` or the two-dimensional `text-offset`.","sdk-support":{"basic functionality":{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{doc:"The center of the text is placed closest to the anchor."},left:{doc:"The left side of the text is placed closest to the anchor."},right:{doc:"The right side of the text is placed closest to the anchor."},top:{doc:"The top of the text is placed closest to the anchor."},bottom:{doc:"The bottom of the text is placed closest to the anchor."},"top-left":{doc:"The top left corner of the text is placed closest to the anchor."},"top-right":{doc:"The top right corner of the text is placed closest to the anchor."},"bottom-left":{doc:"The bottom left corner of the text is placed closest to the anchor."},"bottom-right":{doc:"The bottom right corner of the text is placed closest to the anchor."}},default:"center",doc:"Part of the text placed closest to the anchor.",requires:["text-field",{"!":"text-variable-anchor"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",doc:"Maximum angle change between adjacent characters.",requires:["text-field",{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{doc:"If a text's language supports horizontal writing mode, symbols with point placement would be laid out horizontally."},vertical:{doc:"If a text's language supports vertical writing mode, symbols with point placement would be laid out vertically."}},doc:"The property allows control over a symbol's orientation. Note that the property values act as a hint, so that a symbol whose language doesn’t support the provided orientation will be laid out in its natural orientation. Example: English point symbol will be rendered horizontally even if array value contains single 'vertical' enum value. The order of elements in an array define priority order for the placement of an orientation variant.",requires:["text-field",{"symbol-placement":["point"]}],"sdk-support":{"basic functionality":{js:"1.3.0",android:"8.3.0",ios:"5.3.0",macos:"0.15.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",doc:"Rotates the text clockwise.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",doc:"Size of the additional area around the text bounding box used for detecting symbol collisions.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,doc:"If true, the text may be flipped vertically to prevent it from being rendered upside-down.",requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{doc:"The text is not altered."},uppercase:{doc:"Forces all letters to be displayed in uppercase."},lowercase:{doc:"Forces all letters to be displayed in lowercase."}},default:"none",doc:"Specifies how to capitalize text, similar to the CSS `text-transform` property.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",doc:"Offset distance of text from its anchor. Positive values indicate right and down, while negative values indicate left and up. If used with text-variable-anchor, input values will be taken as absolute values. Offsets along the x- and y-axis will be applied automatically based on the anchor position.",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,doc:"If true, the text will be visible even if it collides with other previously drawn symbols.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,doc:"If true, other symbols can be visible even if they collide with the text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,doc:"If true, icons will display without their corresponding text when the text collides with other symbols and the icon does not.",requires:["text-field","icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},"property-type":"constant"}},filter:{type:"array",value:"*",doc:"A filter selects specific features from a layer."},filter_operator:{type:"enum",values:{"==":{doc:'`["==", key, value]` equality: `feature[key] = value`'},"!=":{doc:'`["!=", key, value]` inequality: `feature[key] ≠ value`'},">":{doc:'`[">", key, value]` greater than: `feature[key] > value`'},">=":{doc:'`[">=", key, value]` greater than or equal: `feature[key] ≥ value`'},"<":{doc:'`["<", key, value]` less than: `feature[key] < value`'},"<=":{doc:'`["<=", key, value]` less than or equal: `feature[key] ≤ value`'},in:{doc:'`["in", key, v0, ..., vn]` set inclusion: `feature[key] ∈ {v0, ..., vn}`'},"!in":{doc:'`["!in", key, v0, ..., vn]` set exclusion: `feature[key] ∉ {v0, ..., vn}`'},all:{doc:'`["all", f0, ..., fn]` logical `AND`: `f0 ∧ ... ∧ fn`'},any:{doc:'`["any", f0, ..., fn]` logical `OR`: `f0 ∨ ... ∨ fn`'},none:{doc:'`["none", f0, ..., fn]` logical `NOR`: `¬f0 ∧ ... ∧ ¬fn`'},has:{doc:'`["has", key]` `feature[key]` exists'},"!has":{doc:'`["!has", key]` `feature[key]` does not exist'},within:{doc:'`["within", object]` feature geometry is within object geometry'}},doc:"The filter operator."},geometry_type:{type:"enum",values:{Point:{doc:"Filter to point geometries."},LineString:{doc:"Filter to line geometries."},Polygon:{doc:"Filter to polygon geometries."}},doc:"The geometry type for the filter to select."},function:{expression:{type:"expression",doc:"An expression."},stops:{type:"array",doc:"An array of stops.",value:"function_stop"},base:{type:"number",default:1,minimum:0,doc:"The exponential base of the interpolation curve. It controls the rate at which the result increases. Higher values make the result increase more towards the high end of the range. With `1` the stops are interpolated linearly."},property:{type:"string",doc:"The name of a feature property to use as the function input.",default:"$zoom"},type:{type:"enum",values:{identity:{doc:"Return the input value as the output value."},exponential:{doc:"Generate an output by interpolating between stops just less than and just greater than the function input."},interval:{doc:"Return the output value of the stop just less than the function input."},categorical:{doc:"Return the output value of the stop equal to the function input."}},doc:"The interpolation strategy to use in function evaluation.",default:"exponential"},colorSpace:{type:"enum",values:{rgb:{doc:"Use the RGB color space to interpolate color values"},lab:{doc:"Use the LAB color space to interpolate color values."},hcl:{doc:"Use the HCL color space to interpolate color values, interpolating the Hue, Chroma, and Luminance channels individually."}},doc:"The color space in which colors interpolated. Interpolating colors in perceptual color spaces like LAB and HCL tend to produce color ramps that look more consistent and produce colors that can be differentiated more easily than those interpolated in RGB space.",default:"rgb"},default:{type:"*",required:!1,doc:"A value to serve as a fallback function result when a value isn't otherwise available. It is used in the following circumstances:\n* In categorical functions, when the feature value does not match any of the stop domain values.\n* In property and zoom-and-property functions, when a feature does not contain a value for the specified property.\n* In identity functions, when the feature value is not valid for the style property (for example, if the function is being used for a `circle-color` property but the feature property value is not a string or not a valid color).\n* In interval or exponential property and zoom-and-property functions, when the feature value is not numeric.\nIf no default is provided, the style property's default is used in these circumstances."}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2,doc:"Zoom level and value pair."},expression:{type:"array",value:"*",minimum:1,doc:"An expression defines a function that can be used for data-driven style properties or feature filters."},expression_name:{doc:"",type:"enum",values:{let:{doc:'Binds expressions to named variables, which can then be referenced in the result expression using ["var", "variable_name"].',group:"Variable binding","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},var:{doc:'References variable bound using "let".',group:"Variable binding","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},literal:{doc:"Provides a literal array or object value.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},array:{doc:"Asserts that the input is an array (optionally with a specific item type and length). If, when the input expression is evaluated, it is not of the asserted type, then this assertion will cause the whole expression to be aborted.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},at:{doc:"Retrieves an item from an array.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},in:{doc:"Determines whether an item exists in an array or a substring exists in a string.",group:"Lookup","sdk-support":{"basic functionality":{js:"1.6.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"}}},"index-of":{doc:"Returns the first position at which an item can be found in an array or a substring can be found in a string, or `-1` if the input cannot be found. Accepts an optional index from where to begin the search.",group:"Lookup","sdk-support":{"basic functionality":{js:"1.10.0"}}},slice:{doc:"Returns an item from an array or a substring from a string from a specified start index, or between a start index and an end index if set. The return value is inclusive of the start index but not of the end index.",group:"Lookup","sdk-support":{"basic functionality":{js:"1.10.0"}}},case:{doc:"Selects the first output whose corresponding test condition evaluates to true, or the fallback value otherwise.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},match:{doc:'Selects the output for which the label value matches the input value, or the fallback value if no match is found. The input can be any expression (for example, `["get", "building_type"]`). Each label must be unique, and must be either:\n - a single literal value; or\n - an array of literal values, the values of which must be all strings or all numbers (for example `[100, 101]` or `["c", "b"]`).\n\nThe input matches if any of the values in the array matches using strict equality, similar to the `"in"` operator.\nIf the input type does not match the type of the labels, the result will be the fallback value.',group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},coalesce:{doc:"Evaluates each expression in turn until the first non-null value is obtained, and returns that value.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},step:{doc:'Produces discrete, stepped results by evaluating a piecewise-constant function defined by pairs of input and output values ("stops"). The `input` may be any numeric expression (e.g., `["get", "population"]`). Stop inputs must be numeric literals in strictly ascending order. Returns the output value of the stop just less than the input, or the first output if the input is less than the first stop.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.42.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},interpolate:{doc:'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). The `input` may be any numeric expression (e.g., `["get", "population"]`). Stop inputs must be numeric literals in strictly ascending order. The output type must be `number`, `array<number>`, or `color`.\n\nInterpolation types:\n- `["linear"]`: Interpolates linearly between the pair of stops just less than and just greater than the input.\n- `["exponential", base]`: Interpolates exponentially between the stops just less than and just greater than the input. `base` controls the rate at which the output increases: higher values make the output increase more towards the high end of the range. With values close to 1 the output increases linearly.\n- `["cubic-bezier", x1, y1, x2, y2]`: Interpolates using the cubic bezier curve defined by the given control points.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.42.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"interpolate-hcl":{doc:'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). Works like `interpolate`, but the output type must be `color`, and the interpolation is performed in the Hue-Chroma-Luminance color space.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.49.0"}}},"interpolate-lab":{doc:'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). Works like `interpolate`, but the output type must be `color`, and the interpolation is performed in the CIELAB color space.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.49.0"}}},ln2:{doc:"Returns mathematical constant ln(2).",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},pi:{doc:"Returns the mathematical constant pi.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},e:{doc:"Returns the mathematical constant e.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},typeof:{doc:"Returns a string describing the type of the given value.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},string:{doc:"Asserts that the input value is a string. If multiple values are provided, each one is evaluated in order until a string is obtained. If none of the inputs are strings, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},number:{doc:"Asserts that the input value is a number. If multiple values are provided, each one is evaluated in order until a number is obtained. If none of the inputs are numbers, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},boolean:{doc:"Asserts that the input value is a boolean. If multiple values are provided, each one is evaluated in order until a boolean is obtained. If none of the inputs are booleans, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},object:{doc:"Asserts that the input value is an object. If multiple values are provided, each one is evaluated in order until an object is obtained. If none of the inputs are objects, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},collator:{doc:"Returns a `collator` for use in locale-dependent comparison operations. The `case-sensitive` and `diacritic-sensitive` options default to `false`. The `locale` argument specifies the IETF language tag of the locale to use. If none is provided, the default locale is used. If the requested locale is not available, the `collator` will use a system-defined fallback locale. Use `resolved-locale` to test the results of locale fallback behavior.",group:"Types","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},format:{doc:'Returns a `formatted` string for displaying mixed-format text in the `text-field` property. The input may contain a string literal or expression, including an [`\'image\'`](#types-image) expression. Strings may be followed by a style override object that supports the following properties:\n- `"text-font"`: Overrides the font stack specified by the root layout property.\n- `"text-color"`: Overrides the color specified by the root paint property.\n- `"font-scale"`: Applies a scaling factor on `text-size` as specified by the root layout property.',group:"Types","sdk-support":{"basic functionality":{js:"0.48.0",android:"6.7.0",ios:"4.6.0",macos:"0.12.0"},"text-font":{js:"0.48.0",android:"6.7.0",ios:"4.6.0",macos:"0.12.0"},"font-scale":{js:"0.48.0",android:"6.7.0",ios:"4.6.0",macos:"0.12.0"},"text-color":{js:"1.3.0",android:"7.3.0",ios:"4.10.0",macos:"0.14.0"},image:{js:"1.6.0",android:"8.6.0",ios:"5.7.0",macos:"0.15.0"}}},image:{doc:"Returns an `image` type for use in `icon-image`, `*-pattern` entries and as a section in the `format` expression. If set, the `image` argument will check that the requested image exists in the style and will return either the resolved image name or `null`, depending on whether or not the image is currently in the style. This validation process is synchronous and requires the image to have been added to the style before requesting it in the `image` argument.",group:"Types","sdk-support":{"basic functionality":{js:"1.4.0",android:"8.6.0",ios:"5.7.0",macos:"0.15.0"}}},"number-format":{doc:"Converts the input number into a string representation using the providing formatting rules. If set, the `locale` argument specifies the locale to use, as a BCP 47 language tag. If set, the `currency` argument specifies an ISO 4217 code to use for currency-style formatting. If set, the `min-fraction-digits` and `max-fraction-digits` arguments specify the minimum and maximum number of fractional digits to include.",group:"Types","sdk-support":{"basic functionality":{js:"0.54.0"}}},"to-string":{doc:'Converts the input value to a string. If the input is `null`, the result is `""`. If the input is a boolean, the result is `"true"` or `"false"`. If the input is a number, it is converted to a string as specified by the ["NumberToString" algorithm](https://tc39.github.io/ecma262/#sec-tostring-applied-to-the-number-type) of the ECMAScript Language Specification. If the input is a color, it is converted to a string of the form `"rgba(r,g,b,a)"`, where `r`, `g`, and `b` are numerals ranging from 0 to 255, and `a` ranges from 0 to 1. Otherwise, the input is converted to a string in the format specified by the [`JSON.stringify`](https://tc39.github.io/ecma262/#sec-json.stringify) function of the ECMAScript Language Specification.',group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-number":{doc:'Converts the input value to a number, if possible. If the input is `null` or `false`, the result is 0. If the input is `true`, the result is 1. If the input is a string, it is converted to a number as specified by the ["ToNumber Applied to the String Type" algorithm](https://tc39.github.io/ecma262/#sec-tonumber-applied-to-the-string-type) of the ECMAScript Language Specification. If multiple values are provided, each one is evaluated in order until the first successful conversion is obtained. If none of the inputs can be converted, the expression is an error.',group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-boolean":{doc:"Converts the input value to a boolean. The result is `false` when then input is an empty string, 0, `false`, `null`, or `NaN`; otherwise it is `true`.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-rgba":{doc:"Returns a four-element array containing the input color's red, green, blue, and alpha components, in that order.",group:"Color","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-color":{doc:"Converts the input value to a color. If multiple values are provided, each one is evaluated in order until the first successful conversion is obtained. If none of the inputs can be converted, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},rgb:{doc:"Creates a color value from red, green, and blue components, which must range between 0 and 255, and an alpha component of 1. If any component is out of range, the expression is an error.",group:"Color","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},rgba:{doc:"Creates a color value from red, green, blue components, which must range between 0 and 255, and an alpha component which must range between 0 and 1. If any component is out of range, the expression is an error.",group:"Color","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},get:{doc:"Retrieves a property value from the current feature's properties, or from another object if a second argument is provided. Returns null if the requested property is missing.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},has:{doc:"Tests for the presence of an property value in the current feature's properties, or from another object if a second argument is provided.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},length:{doc:"Gets the length of an array or string.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},properties:{doc:'Gets the feature properties object. Note that in some cases, it may be more efficient to use ["get", "property_name"] directly.',group:"Feature data","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"feature-state":{doc:"Retrieves a property value from the current feature's state. Returns null if the requested property is not present on the feature's state. A feature's state is not part of the GeoJSON or vector tile data, and must be set programmatically on each feature. Features are identified by their `id` attribute, which must be an integer or a string that can be cast to an integer. Note that [\"feature-state\"] can only be used with paint properties that support data-driven styling.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.46.0"}}},"geometry-type":{doc:"Gets the feature's geometry type: `Point`, `MultiPoint`, `LineString`, `MultiLineString`, `Polygon`, `MultiPolygon`.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},id:{doc:"Gets the feature's id, if it has one.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},zoom:{doc:'Gets the current zoom level. Note that in style layout and paint properties, ["zoom"] may only appear as the input to a top-level "step" or "interpolate" expression.',group:"Zoom","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"heatmap-density":{doc:"Gets the kernel density estimation of a pixel in a heatmap layer, which is a relative measure of how many data points are crowded around a particular pixel. Can only be used in the `heatmap-color` property.",group:"Heatmap","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"line-progress":{doc:"Gets the progress along a gradient line. Can only be used in the `line-gradient` property.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.6.0",macos:"0.12.0"}}},"sky-radial-progress":{doc:"Gets the distance of a point on the sky from the sun position. Returns 0 at sun position and 1 when the distance reaches `sky-gradient-radius`. Can only be used in the `sky-gradient` property.",group:"sky","sdk-support":{"basic functionality":{js:"2.0.0"}}},accumulated:{doc:"Gets the value of a cluster property accumulated so far. Can only be used in the `clusterProperties` option of a clustered GeoJSON source.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.53.0"}}},"+":{doc:"Returns the sum of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"*":{doc:"Returns the product of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"-":{doc:"For two inputs, returns the result of subtracting the second input from the first. For a single input, returns the result of subtracting it from 0.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"/":{doc:"Returns the result of floating point division of the first input by the second.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"%":{doc:"Returns the remainder after integer division of the first input by the second.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"^":{doc:"Returns the result of raising the first input to the power specified by the second.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},sqrt:{doc:"Returns the square root of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.42.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},log10:{doc:"Returns the base-ten logarithm of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},ln:{doc:"Returns the natural logarithm of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},log2:{doc:"Returns the base-two logarithm of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},sin:{doc:"Returns the sine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},cos:{doc:"Returns the cosine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},tan:{doc:"Returns the tangent of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},asin:{doc:"Returns the arcsine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},acos:{doc:"Returns the arccosine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},atan:{doc:"Returns the arctangent of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},min:{doc:"Returns the minimum value of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},max:{doc:"Returns the maximum value of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},round:{doc:'Rounds the input to the nearest integer. Halfway values are rounded away from zero. For example, `["round", -1.5]` evaluates to -2.',group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},abs:{doc:"Returns the absolute value of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},ceil:{doc:"Returns the smallest integer that is greater than or equal to the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},floor:{doc:"Returns the largest integer that is less than or equal to the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},distance:{doc:"Returns the shortest distance in meters between the evaluated feature and the input geometry. The input value can be a valid GeoJSON of type `Point`, `MultiPoint`, `LineString`, `MultiLineString`, `Polygon`, `MultiPolygon`, `Feature`, or `FeatureCollection`. Distance values returned may vary in precision due to loss in precision from encoding geometries, particularly below zoom level 13.",group:"Math","sdk-support":{"basic functionality":{android:"9.2.0",ios:"5.9.0",macos:"0.16.0"}}},"==":{doc:"Returns `true` if the input values are equal, `false` otherwise. The comparison is strictly typed: values of different runtime types are always considered unequal. Cases where the types are known to be different at parse time are considered invalid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},"!=":{doc:"Returns `true` if the input values are not equal, `false` otherwise. The comparison is strictly typed: values of different runtime types are always considered unequal. Cases where the types are known to be different at parse time are considered invalid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},">":{doc:"Returns `true` if the first input is strictly greater than the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},"<":{doc:"Returns `true` if the first input is strictly less than the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},">=":{doc:"Returns `true` if the first input is greater than or equal to the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},"<=":{doc:"Returns `true` if the first input is less than or equal to the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},all:{doc:"Returns `true` if all the inputs are `true`, `false` otherwise. The inputs are evaluated in order, and evaluation is short-circuiting: once an input expression evaluates to `false`, the result is `false` and no further input expressions are evaluated.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},any:{doc:"Returns `true` if any of the inputs are `true`, `false` otherwise. The inputs are evaluated in order, and evaluation is short-circuiting: once an input expression evaluates to `true`, the result is `true` and no further input expressions are evaluated.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"!":{doc:"Logical negation. Returns `true` if the input is `false`, and `false` if the input is `true`.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},within:{doc:"Returns `true` if the evaluated feature is fully contained inside a boundary of the input geometry, `false` otherwise. The input value can be a valid GeoJSON of type `Polygon`, `MultiPolygon`, `Feature`, or `FeatureCollection`. Supported features for evaluation:\n- `Point`: Returns `false` if a point is on the boundary or falls outside the boundary.\n- `LineString`: Returns `false` if any part of a line falls outside the boundary, the line intersects the boundary, or a line's endpoint is on the boundary.",group:"Decision","sdk-support":{"basic functionality":{js:"1.9.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"}}},"is-supported-script":{doc:"Returns `true` if the input string is expected to render legibly. Returns `false` if the input string contains sections that cannot be rendered without potential loss of meaning (e.g. Indic scripts that require complex text shaping, or right-to-left scripts if the the `mapbox-gl-rtl-text` plugin is not in use in Mapbox GL JS).",group:"String","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.6.0"}}},upcase:{doc:"Returns the input string converted to uppercase. Follows the Unicode Default Case Conversion algorithm and the locale-insensitive case mappings in the Unicode Character Database.",group:"String","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},downcase:{doc:"Returns the input string converted to lowercase. Follows the Unicode Default Case Conversion algorithm and the locale-insensitive case mappings in the Unicode Character Database.",group:"String","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},concat:{doc:"Returns a `string` consisting of the concatenation of the inputs. Each input is converted to a string as if by `to-string`.",group:"String","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"resolved-locale":{doc:"Returns the IETF language tag of the locale being used by the provided `collator`. This can be used to determine the default system locale, or to determine if a requested locale was successfully loaded.",group:"String","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}}}},fog:{range:{type:"array",default:[.5,10],minimum:-20,maximum:20,length:2,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},doc:"The start and end distance range in which fog fades from fully transparent to fully opaque. The distance to the point at the center of the map is defined as zero, so that negative range values are closer to the camera, and positive values are farther away.",example:[.5,10],"sdk-support":{"basic functionality":{js:"2.3.0"}}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"The color of the fog. Using opacity is recommended only for smoothly transitioning fog on/off as anything less than 100% opacity results in more tiles loaded and drawn.","sdk-support":{"basic functionality":{js:"2.3.0"}}},"horizon-blend":{type:"number","property-type":"data-constant",default:.1,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Horizon blend applies a smooth fade from the color of the fog to the color of the sky. A value of zero leaves a sharp transition from fog to sky. Increasing the value blends the color of fog into increasingly high angles of the sky.","sdk-support":{"basic functionality":{js:"2.3.0"}}}},light:{anchor:{type:"enum",default:"viewport",values:{map:{doc:"The position of the light source is aligned to the rotation of the map."},viewport:{doc:"The position of the light source is aligned to the rotation of the viewport."}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]},doc:"Whether extruded geometries are lit relative to the map or viewport.",example:"map","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},doc:"Position of the light source relative to lit (extruded) geometries, in [r radial coordinate, a azimuthal angle, p polar angle] where r indicates the distance from the center of the base of an object to its light, a indicates the position of the light relative to 0° (0° when `light.anchor` is set to `viewport` corresponds to the top of the viewport, or 0° when `light.anchor` is set to `map` corresponds to due north, and degrees proceed clockwise), and p indicates the height of the light (from 0°, directly above, to 180°, directly below).",example:[1.5,90,80],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Color tint for lighting extruded geometries.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Intensity of lighting (on a scale from 0 to 1). Higher numbers will present as more extreme contrast.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}}},terrain:{source:{type:"string",doc:"Name of a source of `raster_dem` type to be used for terrain elevation.",required:!0,"sdk-support":{"basic functionality":{js:"2.0.0"}}},exaggeration:{type:"number","property-type":"data-constant",default:1,minimum:0,maximum:1e3,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Exaggerates the elevation of the terrain by multiplying the data from the DEM with this value.","sdk-support":{"basic functionality":{js:"2.0.0"}}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background","paint_sky"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,doc:"Whether or not the fill should be antialiased.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity of the entire fill layer. In contrast to the `fill-color`, this value will also affect the 1px stroke around the fill, if the stroke is used.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.21.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",doc:"The color of the filled part of this layer. This color can be specified as `rgba` with an alpha component and the color's opacity will not affect the opacity of the 1px stroke, if it is used.",transition:!0,requires:[{"!":"fill-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.19.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",doc:"The outline color of the fill. Matches the value of `fill-color` if unspecified.",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.19.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{doc:"The fill is translated relative to the map."},viewport:{doc:"The fill is translated relative to the viewport."}},doc:"Controls the frame of reference for `fill-translate`.",default:"map",requires:["fill-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,doc:"Name of image in sprite to use for drawing image fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",macos:"0.11.0",ios:"4.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity of the entire fill extrusion layer. This is rendered on a per-layer, not per-feature, basis, and data-driven styling is not available.",transition:!0,"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",doc:"The base color of the extruded fill. The extrusion's surfaces will be shaded differently based on this color in combination with the root `light` settings. If this color is specified as `rgba` with an alpha component, the alpha component will be ignored; use `fill-extrusion-opacity` to set layer opacity.",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up (on the flat plane), respectively.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{doc:"The fill extrusion is translated relative to the map."},viewport:{doc:"The fill extrusion is translated relative to the viewport."}},doc:"Controls the frame of reference for `fill-extrusion-translate`.",default:"map",requires:["fill-extrusion-translate"],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,doc:"Name of image in sprite to use for drawing images on extruded fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",macos:"0.11.0",ios:"4.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",doc:"The height with which to extrude this layer.",transition:!0,"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",doc:"The height with which to extrude the base of this layer. Must be less than or equal to `fill-extrusion-height`.",transition:!0,requires:["fill-extrusion-height"],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,doc:"Whether to apply a vertical gradient to the sides of a fill-extrusion layer. If true, sides will be shaded slightly darker farther down.",transition:!1,"sdk-support":{"basic functionality":{js:"0.50.0",ios:"4.7.0",macos:"0.13.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",doc:"The opacity at which the line will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",doc:"The color with which the line will be drawn.",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.23.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{doc:"The line is translated relative to the map."},viewport:{doc:"The line is translated relative to the viewport."}},doc:"Controls the frame of reference for `line-translate`.",default:"map",requires:["line-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",doc:"Stroke thickness.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,doc:"Draws a line casing outside of a line's actual path. Value indicates the width of the inner gap.",transition:!0,units:"pixels","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,doc:"The line's offset. For linear features, a positive value offsets the line to the right, relative to the direction of the line, and a negative value to the left. For polygon features, a positive value results in an inset, and a negative value results in an outset.",transition:!0,units:"pixels","sdk-support":{"basic functionality":{js:"0.12.1",android:"3.0.0",ios:"3.1.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"Blur applied to the line, in pixels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",doc:"Specifies the lengths of the alternating dashes and gaps that form the dash pattern. The lengths are later scaled by the line width. To convert a dash length to pixels, multiply the length by the current line width. Note that GeoJSON sources with `lineMetrics: true` specified won't render dashed lines to the expected scale. Also note that zoom-dependent expressions will be evaluated only at integer zoom levels.",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"2.3.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-pattern":{type:"resolvedImage",transition:!0,doc:"Name of image in sprite to use for drawing image lines. For seamless patterns, image width must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",macos:"0.11.0",ios:"4.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",doc:'Defines a gradient with which to color a line feature. Can only be used with GeoJSON sources that specify `"lineMetrics": true`.',transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],"sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.4.0",macos:"0.11.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",doc:"Circle radius.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.18.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",doc:"The fill color of the circle.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.18.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,doc:"Amount to blur the circle. 1 blurs the circle such that only the centerpoint is full opacity.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.20.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",doc:"The opacity at which the circle will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.20.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{doc:"The circle is translated relative to the map."},viewport:{doc:"The circle is translated relative to the viewport."}},doc:"Controls the frame of reference for `circle-translate`.",default:"map",requires:["circle-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{doc:"Circles are scaled according to their apparent distance to the camera."},viewport:{doc:"Circles are not scaled."}},default:"map",doc:"Controls the scaling behavior of the circle when the map is pitched.","sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{doc:"The circle is aligned to the plane of the map."},viewport:{doc:"The circle is aligned to the plane of the viewport."}},default:"viewport",doc:"Orientation of circle when map is pitched.","sdk-support":{"basic functionality":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"The width of the circle's stroke. Strokes are placed outside of the `circle-radius`.","sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",doc:"The stroke color of the circle.",transition:!0,"sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",doc:"The opacity of the circle's stroke.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",doc:"Radius of influence of one heatmap point in pixels. Increasing the value makes the heatmap smoother, but less detailed.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,doc:"A measure of how much an individual point contributes to the heatmap. A value of 10 would be equivalent to having 10 points of weight 1 in the same spot. Especially useful when combined with clustering.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,doc:"Similar to `heatmap-weight` but controls the intensity of the heatmap globally. Primarily used for adjusting the heatmap based on zoom level.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],doc:'Defines the color of each pixel based on its density value in a heatmap. Should be an expression that uses `["heatmap-density"]` as input.',transition:!1,"sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",doc:"The global opacity at which the heatmap layer will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{doc:"The opacity at which the icon will be drawn.",type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,doc:"The color of the icon. This can only be used with sdf icons.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,doc:"The color of the icon's halo. Icon halos can only be used with SDF icons.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"Distance of halo to the icon outline.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"Fade out the halo towards the outside.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"Distance that the icon's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{doc:"Icons are translated relative to the map."},viewport:{doc:"Icons are translated relative to the viewport."}},doc:"Controls the frame of reference for `icon-translate`.",default:"map",requires:["icon-image","icon-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",doc:"The opacity at which the text will be drawn.",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",doc:"The color with which the text will be drawn.",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,doc:"The color of the text's halo, which helps it stand out from backgrounds.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"Distance of halo to the font outline. Max text halo width is 1/4 of the font-size.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"The halo's fadeout distance towards the outside.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"Distance that the text's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{doc:"The text is translated relative to the map."},viewport:{doc:"The text is translated relative to the viewport."}},doc:"Controls the frame of reference for `text-translate`.",default:"map",requires:["text-field","text-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",doc:"The opacity at which the image will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",doc:"Rotates hues around the color wheel.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",doc:"Increase or reduce the brightness of the image. The value is the minimum brightness.",default:0,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",doc:"Increase or reduce the brightness of the image. The value is the maximum brightness.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",doc:"Increase or reduce the saturation of the image.",default:0,minimum:-1,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",doc:"Increase or reduce the contrast of the image.",default:0,minimum:-1,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",doc:"The resampling/interpolation method to use for overscaling, also known as texture magnification filter",values:{linear:{doc:"(Bi)linear filtering interpolates pixel values using the weighted average of the four closest original source pixels creating a smooth but blurry look when overscaled"},nearest:{doc:"Nearest neighbor filtering interpolates pixel values using the nearest original source pixel creating a sharp but pixelated look when overscaled"}},default:"linear","sdk-support":{"basic functionality":{js:"0.47.0",android:"6.3.0",ios:"4.2.0",macos:"0.9.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",doc:"Fade duration when a new tile is added.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,doc:"The direction of the light source used to generate the hillshading with 0 as the top of the viewport if `hillshade-illumination-anchor` is set to `viewport` and due north if `hillshade-illumination-anchor` is set to `map`.",transition:!1,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{doc:"The hillshade illumination is relative to the north direction."},viewport:{doc:"The hillshade illumination is relative to the top of the viewport."}},default:"viewport",doc:"Direction of light source when map is rotated.","sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",doc:"Intensity of the hillshade",default:.5,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",doc:"The shading color of areas that face away from the light source.",transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",doc:"The shading color of areas that faces towards the light source.",transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",doc:"The shading color used to accentuate rugged terrain like sharp cliffs and gorges.",transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",doc:"The color with which the background will be drawn.",transition:!0,requires:[{"!":"background-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,doc:"Name of image in sprite to use for drawing an image background. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity at which the background will be drawn.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_sky:{"sky-type":{type:"enum",values:{gradient:{doc:"Renders the sky with a gradient that can be configured with `sky-gradient-radius` and `sky-gradient`."},atmosphere:{doc:"Renders the sky with a simulated atmospheric scattering algorithm, the sun direction can be attached to the light position or explicitly set through `sky-atmosphere-sun`."}},default:"atmosphere",doc:"The type of the sky","sdk-support":{"basic functionality":{js:"2.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun":{type:"array",value:"number",length:2,units:"degrees",minimum:[0,0],maximum:[360,180],transition:!1,doc:"Position of the sun center [a azimuthal angle, p polar angle]. The azimuthal angle indicates the position of the sun relative to 0° north, where degrees proceed clockwise. The polar angle indicates the height of the sun, where 0° is directly above, at zenith, and 90° at the horizon. When this property is ommitted, the sun center is directly inherited from the light position.","sdk-support":{"basic functionality":{js:"2.0.0"}},requires:[{"sky-type":"atmosphere"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun-intensity":{type:"number",requires:[{"sky-type":"atmosphere"}],default:10,minimum:0,maximum:100,transition:!1,doc:"Intensity of the sun as a light source in the atmosphere (on a scale from 0 to a 100). Setting higher values will brighten up the sky.","sdk-support":{"basic functionality":{js:"2.0.0"}},"property-type":"data-constant"},"sky-gradient-center":{type:"array",requires:[{"sky-type":"gradient"}],value:"number",default:[0,0],length:2,units:"degrees",minimum:[0,0],maximum:[360,180],transition:!1,doc:"Position of the gradient center [a azimuthal angle, p polar angle]. The azimuthal angle indicates the position of the gradient center relative to 0° north, where degrees proceed clockwise. The polar angle indicates the height of the gradient center, where 0° is directly above, at zenith, and 90° at the horizon.","sdk-support":{"basic functionality":{js:"2.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-gradient-radius":{type:"number",requires:[{"sky-type":"gradient"}],default:90,minimum:0,maximum:180,transition:!1,doc:"The angular distance (measured in degrees) from `sky-gradient-center` up to which the gradient extends. A value of 180 causes the gradient to wrap around to the opposite direction from `sky-gradient-center`.","sdk-support":{"basic functionality":{js:"2.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-gradient":{type:"color",default:["interpolate",["linear"],["sky-radial-progress"],.8,"#87ceeb",1,"white"],doc:"Defines a radial color gradient with which to color the sky. The color values can be interpolated with an expression using `sky-radial-progress`. The range [0, 1] for the interpolant covers a radial distance (in degrees) of [0, `sky-gradient-radius`] centered at the position specified by `sky-gradient-center`.",transition:!1,requires:[{"sky-type":"gradient"}],"sdk-support":{"basic functionality":{js:"2.0.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["sky-radial-progress"]},"property-type":"color-ramp"},"sky-atmosphere-halo-color":{type:"color",default:"white",doc:"A color applied to the atmosphere sun halo. The alpha channel describes how strongly the sun halo is represented in an atmosphere sky layer.",transition:!1,requires:[{"sky-type":"atmosphere"}],"sdk-support":{"basic functionality":{js:"2.0.0"}},"property-type":"data-constant"},"sky-atmosphere-color":{type:"color",default:"white",doc:"A color used to tweak the main atmospheric scattering coefficients. Using white applies the default coefficients giving the natural blue color to the atmosphere. This color affects how heavily the corresponding wavelength is represented during scattering. The alpha channel describes the density of the atmosphere, with 1 maximum density and 0 no density.",transition:!1,requires:[{"sky-type":"atmosphere"}],"sdk-support":{"basic functionality":{js:"2.0.0"}},"property-type":"data-constant"},"sky-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity of the entire sky layer.",transition:!0,"sdk-support":{"basic functionality":{js:"2.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds",doc:"Time allotted for transitions to complete."},delay:{type:"number",default:0,minimum:0,units:"milliseconds",doc:"Length of time before a transition begins."}},"property-type":{"data-driven":{type:"property-type",doc:"Property is interpolable and can be represented using a property expression."},"cross-faded":{type:"property-type",doc:"Property is non-interpolable; rather, its values will be cross-faded to smoothly transition between integer zooms."},"cross-faded-data-driven":{type:"property-type",doc:"Property is non-interpolable; rather, its values will be cross-faded to smoothly transition between integer zooms. It can be represented using a property expression."},"color-ramp":{type:"property-type",doc:"Property should be specified using a color ramp from which the output color can be sampled based on a property calculation."},"data-constant":{type:"property-type",doc:"Property is interpolable but cannot be represented using a property expression."},constant:{type:"property-type",doc:"Property is constant across all zoom levels and property values."}},promoteId:{"*":{type:"string",doc:"A name of a feature property to use as ID for feature state."}}};var o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==t?t:"undefined"!=typeof self?self:{};function a(t){var e={exports:{}};return t(e,e.exports),e.exports}function s(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets option of @rollup/plugin-commonjs appropriately for this require call to behave properly.')}
/*! https://mths.be/punycode v1.3.2 by @mathias */var l=a((function(t,e){!function(n){var r=e&&!e.nodeType&&e,i=t&&!t.nodeType&&t,a="object"==typeof o&&o;a.global!==a&&a.window!==a&&a.self!==a||(n=a);var s,l,u=2147483647,c=/^xn--/,h=/[^\x20-\x7E]/,p=/[\x2E\u3002\uFF0E\uFF61]/g,d={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},f=Math.floor,g=String.fromCharCode;function y(t){throw RangeError(d[t])}function m(t,e){for(var n=t.length,r=[];n--;)r[n]=e(t[n]);return r}function v(t,e){var n=t.split("@"),r="";return n.length>1&&(r=n[0]+"@",t=n[1]),r+m((t=t.replace(p,".")).split("."),e).join(".")}function _(t){for(var e,n,r=[],i=0,o=t.length;i<o;)(e=t.charCodeAt(i++))>=55296&&e<=56319&&i<o?56320==(64512&(n=t.charCodeAt(i++)))?r.push(((1023&e)<<10)+(1023&n)+65536):(r.push(e),i--):r.push(e);return r}function b(t){return m(t,(function(t){var e="";return t>65535&&(e+=g((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=g(t)})).join("")}function w(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function x(t,e,n){var r=0;for(t=n?f(t/700):t>>1,t+=f(t/e);t>455;r+=36)t=f(t/35);return f(r+36*t/(t+38))}function E(t){var e,n,r,i,o,a,s,l,c,h,p,d=[],g=t.length,m=0,v=128,_=72;for((n=t.lastIndexOf("-"))<0&&(n=0),r=0;r<n;++r)t.charCodeAt(r)>=128&&y("not-basic"),d.push(t.charCodeAt(r));for(i=n>0?n+1:0;i<g;){for(o=m,a=1,s=36;i>=g&&y("invalid-input"),((l=(p=t.charCodeAt(i++))-48<10?p-22:p-65<26?p-65:p-97<26?p-97:36)>=36||l>f((u-m)/a))&&y("overflow"),m+=l*a,!(l<(c=s<=_?1:s>=_+26?26:s-_));s+=36)a>f(u/(h=36-c))&&y("overflow"),a*=h;_=x(m-o,e=d.length+1,0==o),f(m/e)>u-v&&y("overflow"),v+=f(m/e),m%=e,d.splice(m++,0,v)}return b(d)}function S(t){var e,n,r,i,o,a,s,l,c,h,p,d,m,v,b,E=[];for(d=(t=_(t)).length,e=128,n=0,o=72,a=0;a<d;++a)(p=t[a])<128&&E.push(g(p));for(r=i=E.length,i&&E.push("-");r<d;){for(s=u,a=0;a<d;++a)(p=t[a])>=e&&p<s&&(s=p);for(s-e>f((u-n)/(m=r+1))&&y("overflow"),n+=(s-e)*m,e=s,a=0;a<d;++a)if((p=t[a])<e&&++n>u&&y("overflow"),p==e){for(l=n,c=36;!(l<(h=c<=o?1:c>=o+26?26:c-o));c+=36)b=l-h,v=36-h,E.push(g(w(h+b%v,0))),l=f(b/v);E.push(g(w(l,0))),o=x(n,m,r==i),n=0,++r}++n,++e}return E.join("")}if(s={version:"1.3.2",ucs2:{decode:_,encode:b},decode:E,encode:S,toASCII:function(t){return v(t,(function(t){return h.test(t)?"xn--"+S(t):t}))},toUnicode:function(t){return v(t,(function(t){return c.test(t)?E(t.slice(4).toLowerCase()):t}))}},r&&i)if(t.exports==r)i.exports=s;else for(l in s)s.hasOwnProperty(l)&&(r[l]=s[l]);else n.punycode=s}(o)})),u=function(t){return"string"==typeof t},c=function(t){return"object"==typeof t&&null!==t},h=function(t){return null===t},p=function(t){return null==t};function d(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var f=function(t,e,n,r){e=e||"&",n=n||"=";var i={};if("string"!=typeof t||0===t.length)return i;var o=/\+/g;t=t.split(e);var a=1e3;r&&"number"==typeof r.maxKeys&&(a=r.maxKeys);var s=t.length;a>0&&s>a&&(s=a);for(var l=0;l<s;++l){var u,c,h,p,f=t[l].replace(o,"%20"),g=f.indexOf(n);g>=0?(u=f.substr(0,g),c=f.substr(g+1)):(u=f,c=""),h=decodeURIComponent(u),p=decodeURIComponent(c),d(i,h)?Array.isArray(i[h])?i[h].push(p):i[h]=[i[h],p]:i[h]=p}return i},g=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}},y=function(t,e,n,r){return e=e||"&",n=n||"=",null===t&&(t=void 0),"object"==typeof t?Object.keys(t).map((function(r){var i=encodeURIComponent(g(r))+n;return Array.isArray(t[r])?t[r].map((function(t){return i+encodeURIComponent(g(t))})).join(e):i+encodeURIComponent(g(t[r]))})).join(e):r?encodeURIComponent(g(r))+n+encodeURIComponent(g(t)):""},m=a((function(t,e){e.decode=e.parse=f,e.encode=e.stringify=y}));function v(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var _=/^([a-z0-9.+-]+:)/i,b=/:[0-9]*$/,w=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,x=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),E=["'"].concat(x),S=["%","/","?",";","#"].concat(E),O=["/","?","#"],C=/^[+a-z0-9A-Z_-]{0,63}$/,T=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,I={javascript:!0,"javascript:":!0},L={javascript:!0,"javascript:":!0},P={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function R(t,e,n){if(t&&c(t)&&t instanceof v)return t;var r=new v;return r.parse(t,e,n),r}v.prototype.parse=function(t,e,n){if(!u(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var r=t.indexOf("?"),i=-1!==r&&r<t.indexOf("#")?"?":"#",o=t.split(i);o[0]=o[0].replace(/\\/g,"/");var a=t=o.join(i);if(a=a.trim(),!n&&1===t.split("#").length){var s=w.exec(a);if(s)return this.path=a,this.href=a,this.pathname=s[1],s[2]?(this.search=s[2],this.query=e?m.parse(this.search.substr(1)):this.search.substr(1)):e&&(this.search="",this.query={}),this}var c=_.exec(a);if(c){var h=(c=c[0]).toLowerCase();this.protocol=h,a=a.substr(c.length)}if(n||c||a.match(/^\/\/[^@\/]+@[^@\/]+/)){var p="//"===a.substr(0,2);!p||c&&L[c]||(a=a.substr(2),this.slashes=!0)}if(!L[c]&&(p||c&&!P[c])){for(var d,f,g=-1,y=0;y<O.length;y++){-1!==(v=a.indexOf(O[y]))&&(-1===g||v<g)&&(g=v)}-1!==(f=-1===g?a.lastIndexOf("@"):a.lastIndexOf("@",g))&&(d=a.slice(0,f),a=a.slice(f+1),this.auth=decodeURIComponent(d)),g=-1;for(y=0;y<S.length;y++){var v;-1!==(v=a.indexOf(S[y]))&&(-1===g||v<g)&&(g=v)}-1===g&&(g=a.length),this.host=a.slice(0,g),a=a.slice(g),this.parseHost(),this.hostname=this.hostname||"";var b="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!b)for(var x=this.hostname.split(/\./),R=(y=0,x.length);y<R;y++){var M=x[y];if(M&&!M.match(C)){for(var N="",j=0,A=M.length;j<A;j++)M.charCodeAt(j)>127?N+="x":N+=M[j];if(!N.match(C)){var k=x.slice(0,y),F=x.slice(y+1),D=M.match(T);D&&(k.push(D[1]),F.unshift(D[2])),F.length&&(a="/"+F.join(".")+a),this.hostname=k.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),b||(this.hostname=l.toASCII(this.hostname));var G=this.port?":"+this.port:"",z=this.hostname||"";this.host=z+G,this.href+=this.host,b&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==a[0]&&(a="/"+a))}if(!I[h])for(y=0,R=E.length;y<R;y++){var U=E[y];if(-1!==a.indexOf(U)){var B=encodeURIComponent(U);B===U&&(B=escape(U)),a=a.split(U).join(B)}}var V=a.indexOf("#");-1!==V&&(this.hash=a.substr(V),a=a.slice(0,V));var q=a.indexOf("?");if(-1!==q?(this.search=a.substr(q),this.query=a.substr(q+1),e&&(this.query=m.parse(this.query)),a=a.slice(0,q)):e&&(this.search="",this.query={}),a&&(this.pathname=a),P[h]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){G=this.pathname||"";var Y=this.search||"";this.path=G+Y}return this.href=this.format(),this},v.prototype.format=function(){var t=this.auth||"";t&&(t=(t=encodeURIComponent(t)).replace(/%3A/i,":"),t+="@");var e=this.protocol||"",n=this.pathname||"",r=this.hash||"",i=!1,o="";this.host?i=t+this.host:this.hostname&&(i=t+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(i+=":"+this.port)),this.query&&c(this.query)&&Object.keys(this.query).length&&(o=m.stringify(this.query));var a=this.search||o&&"?"+o||"";return e&&":"!==e.substr(-1)&&(e+=":"),this.slashes||(!e||P[e])&&!1!==i?(i="//"+(i||""),n&&"/"!==n.charAt(0)&&(n="/"+n)):i||(i=""),r&&"#"!==r.charAt(0)&&(r="#"+r),a&&"?"!==a.charAt(0)&&(a="?"+a),e+i+(n=n.replace(/[?#]/g,(function(t){return encodeURIComponent(t)})))+(a=a.replace("#","%23"))+r},v.prototype.resolve=function(t){return this.resolveObject(R(t,!1,!0)).format()},v.prototype.resolveObject=function(t){if(u(t)){var e=new v;e.parse(t,!1,!0),t=e}for(var n=new v,r=Object.keys(this),i=0;i<r.length;i++){var o=r[i];n[o]=this[o]}if(n.hash=t.hash,""===t.href)return n.href=n.format(),n;if(t.slashes&&!t.protocol){for(var a=Object.keys(t),s=0;s<a.length;s++){var l=a[s];"protocol"!==l&&(n[l]=t[l])}return P[n.protocol]&&n.hostname&&!n.pathname&&(n.path=n.pathname="/"),n.href=n.format(),n}if(t.protocol&&t.protocol!==n.protocol){if(!P[t.protocol]){for(var c=Object.keys(t),d=0;d<c.length;d++){var f=c[d];n[f]=t[f]}return n.href=n.format(),n}if(n.protocol=t.protocol,t.host||L[t.protocol])n.pathname=t.pathname;else{for(var g=(t.pathname||"").split("/");g.length&&!(t.host=g.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),""!==g[0]&&g.unshift(""),g.length<2&&g.unshift(""),n.pathname=g.join("/")}if(n.search=t.search,n.query=t.query,n.host=t.host||"",n.auth=t.auth,n.hostname=t.hostname||t.host,n.port=t.port,n.pathname||n.search){var y=n.pathname||"",m=n.search||"";n.path=y+m}return n.slashes=n.slashes||t.slashes,n.href=n.format(),n}var _=n.pathname&&"/"===n.pathname.charAt(0),b=t.host||t.pathname&&"/"===t.pathname.charAt(0),w=b||_||n.host&&t.pathname,x=w,E=n.pathname&&n.pathname.split("/")||[],S=(g=t.pathname&&t.pathname.split("/")||[],n.protocol&&!P[n.protocol]);if(S&&(n.hostname="",n.port=null,n.host&&(""===E[0]?E[0]=n.host:E.unshift(n.host)),n.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(""===g[0]?g[0]=t.host:g.unshift(t.host)),t.host=null),w=w&&(""===g[0]||""===E[0])),b)n.host=t.host||""===t.host?t.host:n.host,n.hostname=t.hostname||""===t.hostname?t.hostname:n.hostname,n.search=t.search,n.query=t.query,E=g;else if(g.length)E||(E=[]),E.pop(),E=E.concat(g),n.search=t.search,n.query=t.query;else if(!p(t.search)){if(S)n.hostname=n.host=E.shift(),(R=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=R.shift(),n.host=n.hostname=R.shift());return n.search=t.search,n.query=t.query,h(n.pathname)&&h(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n}if(!E.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var O=E.slice(-1)[0],C=(n.host||t.host||E.length>1)&&("."===O||".."===O)||""===O,T=0,I=E.length;I>=0;I--)"."===(O=E[I])?E.splice(I,1):".."===O?(E.splice(I,1),T++):T&&(E.splice(I,1),T--);if(!w&&!x)for(;T--;T)E.unshift("..");!w||""===E[0]||E[0]&&"/"===E[0].charAt(0)||E.unshift(""),C&&"/"!==E.join("/").substr(-1)&&E.push("");var R,M=""===E[0]||E[0]&&"/"===E[0].charAt(0);S&&(n.hostname=n.host=M?"":E.length?E.shift():"",(R=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=R.shift(),n.host=n.hostname=R.shift()));return(w=w||n.host&&E.length)&&!M&&E.unshift(""),E.length?n.pathname=E.join("/"):(n.pathname=null,n.path=null),h(n.pathname)&&h(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=t.auth||n.auth,n.slashes=n.slashes||t.slashes,n.href=n.format(),n},v.prototype.parseHost=function(){var t=this.host,e=b.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};function M(t,...e){for(const n of e)for(const e in n)t[e]=n[e];return t}class N extends Error{constructor(t,e){super(e),this.message=e,this.key=t}}class j{constructor(t,e=[]){this.parent=t,this.bindings={};for(const[t,n]of e)this.bindings[t]=n}concat(t){return new j(this,t)}get(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw new Error(t+" not found in scope.")}has(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)}}const A={kind:"null"},k={kind:"number"},F={kind:"string"},D={kind:"boolean"},G={kind:"color"},z={kind:"object"},U={kind:"value"},B={kind:"collator"},V={kind:"formatted"},q={kind:"resolvedImage"};function Y(t,e){return{kind:"array",itemType:t,N:e}}function X(t){if("array"===t.kind){const e=X(t.itemType);return"number"==typeof t.N?`array<${e}, ${t.N}>`:"value"===t.itemType.kind?"array":`array<${e}>`}return t.kind}const W=[A,k,F,D,G,V,z,Y(U),q];function H(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!H(t.itemType,e.itemType))&&("number"!=typeof t.N||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if("value"===t.kind)for(const t of W)if(!H(t,e))return null}return`Expected ${X(t)} but found ${X(e)} instead.`}function K(t,e){return e.some(e=>e.kind===t.kind)}function Z(t,e){return e.some(e=>"null"===e?null===t:"array"===e?Array.isArray(t):"object"===e?t&&!Array.isArray(t)&&"object"==typeof t:e===typeof t)}var $=a((function(t,e){var n={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function r(t){return(t=Math.round(t))<0?0:t>255?255:t}function i(t){return t<0?0:t>1?1:t}function o(t){return"%"===t[t.length-1]?r(parseFloat(t)/100*255):r(parseInt(t))}function a(t){return"%"===t[t.length-1]?i(parseFloat(t)/100):i(parseFloat(t))}function s(t,e,n){return n<0?n+=1:n>1&&(n-=1),6*n<1?t+(e-t)*n*6:2*n<1?e:3*n<2?t+(e-t)*(2/3-n)*6:t}try{e.parseCSSColor=function(t){var e,i=t.replace(/ /g,"").toLowerCase();if(i in n)return n[i].slice();if("#"===i[0])return 4===i.length?(e=parseInt(i.substr(1),16))>=0&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:7===i.length&&(e=parseInt(i.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var l=i.indexOf("("),u=i.indexOf(")");if(-1!==l&&u+1===i.length){var c=i.substr(0,l),h=i.substr(l+1,u-(l+1)).split(","),p=1;switch(c){case"rgba":if(4!==h.length)return null;p=a(h.pop());case"rgb":return 3!==h.length?null:[o(h[0]),o(h[1]),o(h[2]),p];case"hsla":if(4!==h.length)return null;p=a(h.pop());case"hsl":if(3!==h.length)return null;var d=(parseFloat(h[0])%360+360)%360/360,f=a(h[1]),g=a(h[2]),y=g<=.5?g*(f+1):g+f-g*f,m=2*g-y;return[r(255*s(m,y,d+1/3)),r(255*s(m,y,d)),r(255*s(m,y,d-1/3)),p];default:return null}}return null}}catch(t){}}));class J{constructor(t,e,n,r=1){this.r=t,this.g=e,this.b=n,this.a=r}static parse(t){if(!t)return;if(t instanceof J)return t;if("string"!=typeof t)return;const e=$.parseCSSColor(t);return e?new J(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3]):void 0}toString(){const[t,e,n,r]=this.toArray();return`rgba(${Math.round(t)},${Math.round(e)},${Math.round(n)},${r})`}toArray(){const{r:t,g:e,b:n,a:r}=this;return 0===r?[0,0,0,0]:[255*t/r,255*e/r,255*n/r,r]}}J.black=new J(0,0,0,1),J.white=new J(1,1,1,1),J.transparent=new J(0,0,0,0),J.red=new J(1,0,0,1),J.blue=new J(0,0,1,1);class Q{constructor(t,e,n){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=n,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(t,e){return this.collator.compare(t,e)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class tt{constructor(t,e,n,r,i){this.text=t,this.image=e,this.scale=n,this.fontStack=r,this.textColor=i}}class et{constructor(t){this.sections=t}static fromString(t){return new et([new tt(t,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some(t=>0!==t.text.length||t.image&&0!==t.image.name.length)}static factory(t){return t instanceof et?t:et.fromString(t)}toString(){return 0===this.sections.length?"":this.sections.map(t=>t.text).join("")}serialize(){const t=["format"];for(const e of this.sections){if(e.image){t.push(["image",e.image.name]);continue}t.push(e.text);const n={};e.fontStack&&(n["text-font"]=["literal",e.fontStack.split(",")]),e.scale&&(n["font-scale"]=e.scale),e.textColor&&(n["text-color"]=["rgba"].concat(e.textColor.toArray())),t.push(n)}return t}}class nt{constructor(t){this.name=t.name,this.available=t.available}toString(){return this.name}static fromString(t){return t?new nt({name:t,available:!1}):null}serialize(){return["image",this.name]}}function rt(t,e,n,r){if(!("number"==typeof t&&t>=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof n&&n>=0&&n<=255)){return`Invalid rgba value [${("number"==typeof r?[t,e,n,r]:[t,e,n]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}return void 0===r||"number"==typeof r&&r>=0&&r<=1?null:`Invalid rgba value [${[t,e,n,r].join(", ")}]: 'a' must be between 0 and 1.`}function it(t){if(null===t)return!0;if("string"==typeof t)return!0;if("boolean"==typeof t)return!0;if("number"==typeof t)return!0;if(t instanceof J)return!0;if(t instanceof Q)return!0;if(t instanceof et)return!0;if(t instanceof nt)return!0;if(Array.isArray(t)){for(const e of t)if(!it(e))return!1;return!0}if("object"==typeof t){for(const e in t)if(!it(t[e]))return!1;return!0}return!1}function ot(t){if(null===t)return A;if("string"==typeof t)return F;if("boolean"==typeof t)return D;if("number"==typeof t)return k;if(t instanceof J)return G;if(t instanceof Q)return B;if(t instanceof et)return V;if(t instanceof nt)return q;if(Array.isArray(t)){const e=t.length;let n;for(const e of t){const t=ot(e);if(n){if(n===t)continue;n=U;break}n=t}return Y(n||U,e)}return z}function at(t){const e=typeof t;return null===t?"":"string"===e||"number"===e||"boolean"===e?String(t):t instanceof J||t instanceof et||t instanceof nt?t.toString():JSON.stringify(t)}class st{constructor(t,e){this.type=t,this.value=e}static parse(t,e){if(2!==t.length)return e.error(`'literal' expression requires exactly one argument, but found ${t.length-1} instead.`);if(!it(t[1]))return e.error("invalid value");const n=t[1];let r=ot(n);const i=e.expectedType;return"array"!==r.kind||0!==r.N||!i||"array"!==i.kind||"number"==typeof i.N&&0!==i.N||(r=i),new st(r,n)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}serialize(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof J?["rgba"].concat(this.value.toArray()):this.value instanceof et?this.value.serialize():this.value}}class lt{constructor(t){this.name="ExpressionEvaluationError",this.message=t}toJSON(){return this.message}}const ut={string:F,number:k,boolean:D,object:z};class ct{constructor(t,e){this.type=t,this.args=e}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");let n,r=1;const i=t[0];if("array"===i){let i,o;if(t.length>2){const n=t[1];if("string"!=typeof n||!(n in ut)||"object"===n)return e.error('The item type argument of "array" must be one of string, number, boolean',1);i=ut[n],r++}else i=U;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return e.error('The length argument to "array" must be a positive integer literal',2);o=t[2],r++}n=Y(i,o)}else n=ut[i];const o=[];for(;r<t.length;r++){const n=e.parse(t[r],r,U);if(!n)return null;o.push(n)}return new ct(n,o)}evaluate(t){for(let e=0;e<this.args.length;e++){const n=this.args[e].evaluate(t);if(!H(this.type,ot(n)))return n;if(e===this.args.length-1)throw new lt(`Expected value to be of type ${X(this.type)}, but found ${X(ot(n))} instead.`)}return null}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}serialize(){const t=this.type,e=[t.kind];if("array"===t.kind){const n=t.itemType;if("string"===n.kind||"number"===n.kind||"boolean"===n.kind){e.push(n.kind);const r=t.N;("number"==typeof r||this.args.length>1)&&e.push(r)}}return e.concat(this.args.map(t=>t.serialize()))}}class ht{constructor(t){this.type=V,this.sections=t}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");const n=t[1];if(!Array.isArray(n)&&"object"==typeof n)return e.error("First argument must be an image or text section.");const r=[];let i=!1;for(let n=1;n<=t.length-1;++n){const o=t[n];if(i&&"object"==typeof o&&!Array.isArray(o)){i=!1;let t=null;if(o["font-scale"]&&(t=e.parse(o["font-scale"],1,k),!t))return null;let n=null;if(o["text-font"]&&(n=e.parse(o["text-font"],1,Y(F)),!n))return null;let a=null;if(o["text-color"]&&(a=e.parse(o["text-color"],1,G),!a))return null;const s=r[r.length-1];s.scale=t,s.font=n,s.textColor=a}else{const o=e.parse(t[n],1,U);if(!o)return null;const a=o.type.kind;if("string"!==a&&"value"!==a&&"null"!==a&&"resolvedImage"!==a)return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");i=!0,r.push({content:o,scale:null,font:null,textColor:null})}}return new ht(r)}evaluate(t){return new et(this.sections.map(e=>{const n=e.content.evaluate(t);return ot(n)===q?new tt("",n,null,null,null):new tt(at(n),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)}))}eachChild(t){for(const e of this.sections)t(e.content),e.scale&&t(e.scale),e.font&&t(e.font),e.textColor&&t(e.textColor)}outputDefined(){return!1}serialize(){const t=["format"];for(const e of this.sections){t.push(e.content.serialize());const n={};e.scale&&(n["font-scale"]=e.scale.serialize()),e.font&&(n["text-font"]=e.font.serialize()),e.textColor&&(n["text-color"]=e.textColor.serialize()),t.push(n)}return t}}class pt{constructor(t){this.type=q,this.input=t}static parse(t,e){if(2!==t.length)return e.error("Expected two arguments.");const n=e.parse(t[1],1,F);return n?new pt(n):e.error("No image name provided.")}evaluate(t){const e=this.input.evaluate(t),n=nt.fromString(e);return n&&t.availableImages&&(n.available=t.availableImages.indexOf(e)>-1),n}eachChild(t){t(this.input)}outputDefined(){return!1}serialize(){return["image",this.input.serialize()]}}const dt={"to-boolean":D,"to-color":G,"to-number":k,"to-string":F};class ft{constructor(t,e){this.type=t,this.args=e}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");const n=t[0];if(("to-boolean"===n||"to-string"===n)&&2!==t.length)return e.error("Expected one argument.");const r=dt[n],i=[];for(let n=1;n<t.length;n++){const r=e.parse(t[n],n,U);if(!r)return null;i.push(r)}return new ft(r,i)}evaluate(t){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(t));if("color"===this.type.kind){let e,n;for(const r of this.args){if(e=r.evaluate(t),n=null,e instanceof J)return e;if("string"==typeof e){const n=t.parseColor(e);if(n)return n}else if(Array.isArray(e)&&(n=e.length<3||e.length>4?`Invalid rbga value ${JSON.stringify(e)}: expected an array containing either three or four numeric values.`:rt(e[0],e[1],e[2],e[3]),!n))return new J(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new lt(n||`Could not parse color from value '${"string"==typeof e?e:String(JSON.stringify(e))}'`)}if("number"===this.type.kind){let e=null;for(const n of this.args){if(e=n.evaluate(t),null===e)return 0;const r=Number(e);if(!isNaN(r))return r}throw new lt(`Could not convert ${JSON.stringify(e)} to number.`)}return"formatted"===this.type.kind?et.fromString(at(this.args[0].evaluate(t))):"resolvedImage"===this.type.kind?nt.fromString(at(this.args[0].evaluate(t))):at(this.args[0].evaluate(t))}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}serialize(){if("formatted"===this.type.kind)return new ht([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new pt(this.args[0]).serialize();const t=["to-"+this.type.kind];return this.eachChild(e=>{t.push(e.serialize())}),t}}const gt=["Unknown","Point","LineString","Polygon"];class yt{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?"number"==typeof this.feature.type?gt[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(t){let e=this._parseColorCache[t];return e||(e=this._parseColorCache[t]=J.parse(t)),e}}class mt{constructor(t,e,n,r){this.name=t,this.type=e,this._evaluate=n,this.args=r}evaluate(t){return this._evaluate(t,this.args)}eachChild(t){this.args.forEach(t)}outputDefined(){return!1}serialize(){return[this.name].concat(this.args.map(t=>t.serialize()))}static parse(t,e){const n=t[0],r=mt.definitions[n];if(!r)return e.error(`Unknown expression "${n}". If you wanted a literal array, use ["literal", [...]].`,0);const i=Array.isArray(r)?r[0]:r.type,o=Array.isArray(r)?[[r[1],r[2]]]:r.overloads,a=o.filter(([e])=>!Array.isArray(e)||e.length===t.length-1);let s=null;for(const[r,o]of a){s=new zt(e.registry,e.path,null,e.scope);const a=[];let l=!1;for(let e=1;e<t.length;e++){const n=t[e],i=Array.isArray(r)?r[e-1]:r.type,o=s.parse(n,1+a.length,i);if(!o){l=!0;break}a.push(o)}if(!l)if(Array.isArray(r)&&r.length!==a.length)s.error(`Expected ${r.length} arguments, but found ${a.length} instead.`);else{for(let t=0;t<a.length;t++){const e=Array.isArray(r)?r[t]:r.type,n=a[t];s.concat(t+1).checkSubtype(e,n.type)}if(0===s.errors.length)return new mt(n,i,o,a)}}if(1===a.length)e.errors.push(...s.errors);else{const n=(a.length?a:o).map(([t])=>{return e=t,Array.isArray(e)?`(${e.map(X).join(", ")})`:`(${X(e.type)}...)`;var e}).join(" | "),r=[];for(let n=1;n<t.length;n++){const i=e.parse(t[n],1+r.length);if(!i)return null;r.push(X(i.type))}e.error(`Expected arguments of type ${n}, but found (${r.join(", ")}) instead.`)}return null}static register(t,e){mt.definitions=e;for(const n in e)t[n]=mt}}class vt{constructor(t,e,n){this.type=B,this.locale=n,this.caseSensitive=t,this.diacriticSensitive=e}static parse(t,e){if(2!==t.length)return e.error("Expected one argument.");const n=t[1];if("object"!=typeof n||Array.isArray(n))return e.error("Collator options argument must be an object.");const r=e.parse(void 0!==n["case-sensitive"]&&n["case-sensitive"],1,D);if(!r)return null;const i=e.parse(void 0!==n["diacritic-sensitive"]&&n["diacritic-sensitive"],1,D);if(!i)return null;let o=null;return n.locale&&(o=e.parse(n.locale,1,F),!o)?null:new vt(r,i,o)}evaluate(t){return new Q(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)}eachChild(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)}outputDefined(){return!1}serialize(){const t={};return t["case-sensitive"]=this.caseSensitive.serialize(),t["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(t.locale=this.locale.serialize()),["collator",t]}}function _t(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[2]=Math.max(t[2],e[0]),t[3]=Math.max(t[3],e[1])}function bt(t,e){return!(t[0]<=e[0])&&(!(t[2]>=e[2])&&(!(t[1]<=e[1])&&!(t[3]>=e[3])))}function wt(t,e){const n=(180+t[0])/360;const r=(i=t[1],(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+i*Math.PI/360)))/360);var i;const o=Math.pow(2,e.z);return[Math.round(n*o*8192),Math.round(r*o*8192)]}function xt(t,e,n){const r=t[0]-e[0],i=t[1]-e[1],o=t[0]-n[0],a=t[1]-n[1];return r*a-o*i==0&&r*o<=0&&i*a<=0}function Et(t,e){let n=!1;for(let a=0,s=e.length;a<s;a++){const s=e[a];for(let e=0,a=s.length;e<a-1;e++){if(xt(t,s[e],s[e+1]))return!1;r=t,i=s[e],o=s[e+1],i[1]>r[1]!=o[1]>r[1]&&r[0]<(o[0]-i[0])*(r[1]-i[1])/(o[1]-i[1])+i[0]&&(n=!n)}}var r,i,o;return n}function St(t,e){for(let n=0;n<e.length;n++)if(Et(t,e[n]))return!0;return!1}function Ot(t,e,n,r){const i=t[0]-n[0],o=t[1]-n[1],a=e[0]-n[0],s=e[1]-n[1],l=r[0]-n[0],u=r[1]-n[1],c=i*u-l*o,h=a*u-l*s;return c>0&&h<0||c<0&&h>0}function Ct(t,e,n,r){const i=[e[0]-t[0],e[1]-t[1]],o=[r[0]-n[0],r[1]-n[1]];return 0!=(a=o)[0]*(s=i)[1]-a[1]*s[0]&&!(!Ot(t,e,n,r)||!Ot(n,r,t,e));var a,s}function Tt(t,e,n){for(const r of n)for(let n=0;n<r.length-1;++n)if(Ct(t,e,r[n],r[n+1]))return!0;return!1}function It(t,e){for(let n=0;n<t.length;++n)if(!Et(t[n],e))return!1;for(let n=0;n<t.length-1;++n)if(Tt(t[n],t[n+1],e))return!1;return!0}function Lt(t,e){for(let n=0;n<e.length;n++)if(It(t,e[n]))return!0;return!1}function Pt(t,e,n){const r=[];for(let i=0;i<t.length;i++){const o=[];for(let r=0;r<t[i].length;r++){const a=wt(t[i][r],n);_t(e,a),o.push(a)}r.push(o)}return r}function Rt(t,e,n){const r=[];for(let i=0;i<t.length;i++){const o=Pt(t[i],e,n);r.push(o)}return r}function Mt(t,e,n,r){if(t[0]<n[0]||t[0]>n[2]){const e=.5*r;let i=t[0]-n[0]>e?-r:n[0]-t[0]>e?r:0;0===i&&(i=t[0]-n[2]>e?-r:n[2]-t[0]>e?r:0),t[0]+=i}_t(e,t)}function Nt(t,e,n,r){const i=8192*Math.pow(2,r.z),o=[8192*r.x,8192*r.y],a=[];for(const r of t)for(const t of r){const r=[t.x+o[0],t.y+o[1]];Mt(r,e,n,i),a.push(r)}return a}function jt(t,e,n,r){const i=8192*Math.pow(2,r.z),o=[8192*r.x,8192*r.y],a=[];for(const n of t){const t=[];for(const r of n){const n=[r.x+o[0],r.y+o[1]];_t(e,n),t.push(n)}a.push(t)}if(e[2]-e[0]<=i/2){(s=e)[0]=s[1]=1/0,s[2]=s[3]=-1/0;for(const t of a)for(const r of t)Mt(r,e,n,i)}var s;return a}class At{constructor(t,e){this.type=D,this.geojson=t,this.geometries=e}static parse(t,e){if(2!==t.length)return e.error(`'within' expression requires exactly one argument, but found ${t.length-1} instead.`);if(it(t[1])){const e=t[1];if("FeatureCollection"===e.type)for(let t=0;t<e.features.length;++t){const n=e.features[t].geometry.type;if("Polygon"===n||"MultiPolygon"===n)return new At(e,e.features[t].geometry)}else if("Feature"===e.type){const t=e.geometry.type;if("Polygon"===t||"MultiPolygon"===t)return new At(e,e.geometry)}else if("Polygon"===e.type||"MultiPolygon"===e.type)return new At(e,e)}return e.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(t){if(null!=t.geometry()&&null!=t.canonicalID()){if("Point"===t.geometryType())return function(t,e){const n=[1/0,1/0,-1/0,-1/0],r=[1/0,1/0,-1/0,-1/0],i=t.canonicalID();if("Polygon"===e.type){const o=Pt(e.coordinates,r,i),a=Nt(t.geometry(),n,r,i);if(!bt(n,r))return!1;for(const t of a)if(!Et(t,o))return!1}if("MultiPolygon"===e.type){const o=Rt(e.coordinates,r,i),a=Nt(t.geometry(),n,r,i);if(!bt(n,r))return!1;for(const t of a)if(!St(t,o))return!1}return!0}(t,this.geometries);if("LineString"===t.geometryType())return function(t,e){const n=[1/0,1/0,-1/0,-1/0],r=[1/0,1/0,-1/0,-1/0],i=t.canonicalID();if("Polygon"===e.type){const o=Pt(e.coordinates,r,i),a=jt(t.geometry(),n,r,i);if(!bt(n,r))return!1;for(const t of a)if(!It(t,o))return!1}if("MultiPolygon"===e.type){const o=Rt(e.coordinates,r,i),a=jt(t.geometry(),n,r,i);if(!bt(n,r))return!1;for(const t of a)if(!Lt(t,o))return!1}return!0}(t,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}serialize(){return["within",this.geojson]}}function kt(t){if(t instanceof mt){if("get"===t.name&&1===t.args.length)return!1;if("feature-state"===t.name)return!1;if("has"===t.name&&1===t.args.length)return!1;if("properties"===t.name||"geometry-type"===t.name||"id"===t.name)return!1;if(/^filter-/.test(t.name))return!1}if(t instanceof At)return!1;let e=!0;return t.eachChild(t=>{e&&!kt(t)&&(e=!1)}),e}function Ft(t){if(t instanceof mt&&"feature-state"===t.name)return!1;let e=!0;return t.eachChild(t=>{e&&!Ft(t)&&(e=!1)}),e}function Dt(t,e){if(t instanceof mt&&e.indexOf(t.name)>=0)return!1;let n=!0;return t.eachChild(t=>{n&&!Dt(t,e)&&(n=!1)}),n}class Gt{constructor(t,e){this.type=e.type,this.name=t,this.boundExpression=e}static parse(t,e){if(2!==t.length||"string"!=typeof t[1])return e.error("'var' expression requires exactly one string literal argument.");const n=t[1];return e.scope.has(n)?new Gt(n,e.scope.get(n)):e.error(`Unknown variable "${n}". Make sure "${n}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(t){return this.boundExpression.evaluate(t)}eachChild(){}outputDefined(){return!1}serialize(){return["var",this.name]}}class zt{constructor(t,e=[],n,r=new j,i=[]){this.registry=t,this.path=e,this.key=e.map(t=>`[${t}]`).join(""),this.scope=r,this.errors=i,this.expectedType=n}parse(t,e,n,r,i={}){return e?this.concat(e,n,r)._parse(t,i):this._parse(t,i)}_parse(t,e){function n(t,e,n){return"assert"===n?new ct(e,[t]):"coerce"===n?new ft(e,[t]):t}if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const r=t[0];if("string"!=typeof r)return this.error(`Expression name must be a string, but found ${typeof r} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const i=this.registry[r];if(i){let r=i.parse(t,this);if(!r)return null;if(this.expectedType){const t=this.expectedType,i=r.type;if("string"!==t.kind&&"number"!==t.kind&&"boolean"!==t.kind&&"object"!==t.kind&&"array"!==t.kind||"value"!==i.kind)if("color"!==t.kind&&"formatted"!==t.kind&&"resolvedImage"!==t.kind||"value"!==i.kind&&"string"!==i.kind){if(this.checkSubtype(t,i))return null}else r=n(r,t,e.typeAnnotation||"coerce");else r=n(r,t,e.typeAnnotation||"assert")}if(!(r instanceof st)&&"resolvedImage"!==r.type.kind&&function t(e){if(e instanceof Gt)return t(e.boundExpression);if(e instanceof mt&&"error"===e.name)return!1;if(e instanceof vt)return!1;if(e instanceof At)return!1;const n=e instanceof ft||e instanceof ct;let r=!0;if(e.eachChild(e=>{r=n?r&&t(e):r&&e instanceof st}),!r)return!1;return kt(e)&&Dt(e,["zoom","heatmap-density","line-progress","sky-radial-progress","accumulated","is-supported-script"])}(r)){const t=new yt;try{r=new st(r.type,r.evaluate(t))}catch(t){return this.error(t.message),null}}return r}return this.error(`Unknown expression "${r}". If you wanted a literal array, use ["literal", [...]].`,0)}return void 0===t?this.error("'undefined' value invalid. Use null instead."):"object"==typeof t?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error(`Expected an array, but found ${typeof t} instead.`)}concat(t,e,n){const r="number"==typeof t?this.path.concat(t):this.path,i=n?this.scope.concat(n):this.scope;return new zt(this.registry,r,e||null,i,this.errors)}error(t,...e){const n=`${this.key}${e.map(t=>`[${t}]`).join("")}`;this.errors.push(new N(n,t))}checkSubtype(t,e){const n=H(t,e);return n&&this.error(n),n}}function Ut(t,e){const n=t.length-1;let r,i,o=0,a=n,s=0;for(;o<=a;)if(s=Math.floor((o+a)/2),r=t[s],i=t[s+1],r<=e){if(s===n||e<i)return s;o=s+1}else{if(!(r>e))throw new lt("Input is not a number.");a=s-1}return 0}class Bt{constructor(t,e,n){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(const[t,e]of n)this.labels.push(t),this.outputs.push(e)}static parse(t,e){if(t.length-1<4)return e.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");const n=e.parse(t[1],1,k);if(!n)return null;const r=[];let i=null;e.expectedType&&"value"!==e.expectedType.kind&&(i=e.expectedType);for(let n=1;n<t.length;n+=2){const o=1===n?-1/0:t[n],a=t[n+1],s=n,l=n+1;if("number"!=typeof o)return e.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',s);if(r.length&&r[r.length-1][0]>=o)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',s);const u=e.parse(a,l,i);if(!u)return null;i=i||u.type,r.push([o,u])}return new Bt(i,n,r)}evaluate(t){const e=this.labels,n=this.outputs;if(1===e.length)return n[0].evaluate(t);const r=this.input.evaluate(t);if(r<=e[0])return n[0].evaluate(t);const i=e.length;if(r>=e[i-1])return n[i-1].evaluate(t);return n[Ut(e,r)].evaluate(t)}eachChild(t){t(this.input);for(const e of this.outputs)t(e)}outputDefined(){return this.outputs.every(t=>t.outputDefined())}serialize(){const t=["step",this.input.serialize()];for(let e=0;e<this.labels.length;e++)e>0&&t.push(this.labels[e]),t.push(this.outputs[e].serialize());return t}}var Vt=qt;function qt(t,e,n,r){this.cx=3*t,this.bx=3*(n-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(r-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=r,this.p2x=n,this.p2y=r}function Yt(t,e,n){return t*(1-n)+e*n}qt.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},qt.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},qt.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},qt.prototype.solveCurveX=function(t,e){var n,r,i,o,a;for(void 0===e&&(e=1e-6),i=t,a=0;a<8;a++){if(o=this.sampleCurveX(i)-t,Math.abs(o)<e)return i;var s=this.sampleCurveDerivativeX(i);if(Math.abs(s)<1e-6)break;i-=o/s}if((i=t)<(n=0))return n;if(i>(r=1))return r;for(;n<r;){if(o=this.sampleCurveX(i),Math.abs(o-t)<e)return i;t>o?n=i:r=i,i=.5*(r-n)+n}return i},qt.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var Xt=Object.freeze({__proto__:null,number:Yt,color:function(t,e,n){return new J(Yt(t.r,e.r,n),Yt(t.g,e.g,n),Yt(t.b,e.b,n),Yt(t.a,e.a,n))},array:function(t,e,n){return t.map((t,r)=>Yt(t,e[r],n))}});const Wt=6/29,Ht=3*Wt*Wt,Kt=Math.PI/180,Zt=180/Math.PI;function $t(t){return t>.008856451679035631?Math.pow(t,1/3):t/Ht+4/29}function Jt(t){return t>Wt?t*t*t:Ht*(t-4/29)}function Qt(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function te(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function ee(t){const e=te(t.r),n=te(t.g),r=te(t.b),i=$t((.4124564*e+.3575761*n+.1804375*r)/.95047),o=$t((.2126729*e+.7151522*n+.072175*r)/1);return{l:116*o-16,a:500*(i-o),b:200*(o-$t((.0193339*e+.119192*n+.9503041*r)/1.08883)),alpha:t.a}}function ne(t){let e=(t.l+16)/116,n=isNaN(t.a)?e:e+t.a/500,r=isNaN(t.b)?e:e-t.b/200;return e=1*Jt(e),n=.95047*Jt(n),r=1.08883*Jt(r),new J(Qt(3.2404542*n-1.5371385*e-.4985314*r),Qt(-.969266*n+1.8760108*e+.041556*r),Qt(.0556434*n-.2040259*e+1.0572252*r),t.alpha)}function re(t,e,n){const r=e-t;return t+n*(r>180||r<-180?r-360*Math.round(r/360):r)}const ie={forward:ee,reverse:ne,interpolate:function(t,e,n){return{l:Yt(t.l,e.l,n),a:Yt(t.a,e.a,n),b:Yt(t.b,e.b,n),alpha:Yt(t.alpha,e.alpha,n)}}},oe={forward:function(t){const{l:e,a:n,b:r}=ee(t),i=Math.atan2(r,n)*Zt;return{h:i<0?i+360:i,c:Math.sqrt(n*n+r*r),l:e,alpha:t.a}},reverse:function(t){const e=t.h*Kt,n=t.c;return ne({l:t.l,a:Math.cos(e)*n,b:Math.sin(e)*n,alpha:t.alpha})},interpolate:function(t,e,n){return{h:re(t.h,e.h,n),c:Yt(t.c,e.c,n),l:Yt(t.l,e.l,n),alpha:Yt(t.alpha,e.alpha,n)}}};var ae=Object.freeze({__proto__:null,lab:ie,hcl:oe});class se{constructor(t,e,n,r,i){this.type=t,this.operator=e,this.interpolation=n,this.input=r,this.labels=[],this.outputs=[];for(const[t,e]of i)this.labels.push(t),this.outputs.push(e)}static interpolationFactor(t,e,n,r){let i=0;if("exponential"===t.name)i=le(e,t.base,n,r);else if("linear"===t.name)i=le(e,1,n,r);else if("cubic-bezier"===t.name){const o=t.controlPoints;i=new Vt(o[0],o[1],o[2],o[3]).solve(le(e,1,n,r))}return i}static parse(t,e){let[n,r,i,...o]=t;if(!Array.isArray(r)||0===r.length)return e.error("Expected an interpolation type expression.",1);if("linear"===r[0])r={name:"linear"};else if("exponential"===r[0]){const t=r[1];if("number"!=typeof t)return e.error("Exponential interpolation requires a numeric base.",1,1);r={name:"exponential",base:t}}else{if("cubic-bezier"!==r[0])return e.error("Unknown interpolation type "+String(r[0]),1,0);{const t=r.slice(1);if(4!==t.length||t.some(t=>"number"!=typeof t||t<0||t>1))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);r={name:"cubic-bezier",controlPoints:t}}}if(t.length-1<4)return e.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(i=e.parse(i,2,k),!i)return null;const a=[];let s=null;"interpolate-hcl"===n||"interpolate-lab"===n?s=G:e.expectedType&&"value"!==e.expectedType.kind&&(s=e.expectedType);for(let t=0;t<o.length;t+=2){const n=o[t],r=o[t+1],i=t+3,l=t+4;if("number"!=typeof n)return e.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',i);if(a.length&&a[a.length-1][0]>=n)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',i);const u=e.parse(r,l,s);if(!u)return null;s=s||u.type,a.push([n,u])}return"number"===s.kind||"color"===s.kind||"array"===s.kind&&"number"===s.itemType.kind&&"number"==typeof s.N?new se(s,n,r,i,a):e.error(`Type ${X(s)} is not interpolatable.`)}evaluate(t){const e=this.labels,n=this.outputs;if(1===e.length)return n[0].evaluate(t);const r=this.input.evaluate(t);if(r<=e[0])return n[0].evaluate(t);const i=e.length;if(r>=e[i-1])return n[i-1].evaluate(t);const o=Ut(e,r),a=e[o],s=e[o+1],l=se.interpolationFactor(this.interpolation,r,a,s),u=n[o].evaluate(t),c=n[o+1].evaluate(t);return"interpolate"===this.operator?Xt[this.type.kind.toLowerCase()](u,c,l):"interpolate-hcl"===this.operator?oe.reverse(oe.interpolate(oe.forward(u),oe.forward(c),l)):ie.reverse(ie.interpolate(ie.forward(u),ie.forward(c),l))}eachChild(t){t(this.input);for(const e of this.outputs)t(e)}outputDefined(){return this.outputs.every(t=>t.outputDefined())}serialize(){let t;t="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);const e=[this.operator,t,this.input.serialize()];for(let t=0;t<this.labels.length;t++)e.push(this.labels[t],this.outputs[t].serialize());return e}}function le(t,e,n,r){const i=r-n,o=t-n;return 0===i?0:1===e?o/i:(Math.pow(e,o)-1)/(Math.pow(e,i)-1)}class ue{constructor(t,e){this.type=t,this.args=e}static parse(t,e){if(t.length<2)return e.error("Expectected at least one argument.");let n=null;const r=e.expectedType;r&&"value"!==r.kind&&(n=r);const i=[];for(const r of t.slice(1)){const t=e.parse(r,1+i.length,n,void 0,{typeAnnotation:"omit"});if(!t)return null;n=n||t.type,i.push(t)}const o=r&&i.some(t=>H(r,t.type));return new ue(o?U:n,i)}evaluate(t){let e,n=null,r=0;for(const i of this.args)if(r++,n=i.evaluate(t),n&&n instanceof nt&&!n.available&&(e||(e=n.name),n=null,r===this.args.length&&(n=e)),null!==n)break;return n}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}serialize(){const t=["coalesce"];return this.eachChild(e=>{t.push(e.serialize())}),t}}class ce{constructor(t,e){this.type=e.type,this.bindings=[].concat(t),this.result=e}evaluate(t){return this.result.evaluate(t)}eachChild(t){for(const e of this.bindings)t(e[1]);t(this.result)}static parse(t,e){if(t.length<4)return e.error(`Expected at least 3 arguments, but found ${t.length-1} instead.`);const n=[];for(let r=1;r<t.length-1;r+=2){const i=t[r];if("string"!=typeof i)return e.error(`Expected string, but found ${typeof i} instead.`,r);if(/[^a-zA-Z0-9_]/.test(i))return e.error("Variable names must contain only alphanumeric characters or '_'.",r);const o=e.parse(t[r+1],r+1);if(!o)return null;n.push([i,o])}const r=e.parse(t[t.length-1],t.length-1,e.expectedType,n);return r?new ce(n,r):null}outputDefined(){return this.result.outputDefined()}serialize(){const t=["let"];for(const[e,n]of this.bindings)t.push(e,n.serialize());return t.push(this.result.serialize()),t}}class he{constructor(t,e,n){this.type=t,this.index=e,this.input=n}static parse(t,e){if(3!==t.length)return e.error(`Expected 2 arguments, but found ${t.length-1} instead.`);const n=e.parse(t[1],1,k),r=e.parse(t[2],2,Y(e.expectedType||U));if(!n||!r)return null;const i=r.type;return new he(i.itemType,n,r)}evaluate(t){const e=this.index.evaluate(t),n=this.input.evaluate(t);if(e<0)throw new lt(`Array index out of bounds: ${e} < 0.`);if(e>=n.length)throw new lt(`Array index out of bounds: ${e} > ${n.length-1}.`);if(e!==Math.floor(e))throw new lt(`Array index must be an integer, but found ${e} instead.`);return n[e]}eachChild(t){t(this.index),t(this.input)}outputDefined(){return!1}serialize(){return["at",this.index.serialize(),this.input.serialize()]}}class pe{constructor(t,e){this.type=D,this.needle=t,this.haystack=e}static parse(t,e){if(3!==t.length)return e.error(`Expected 2 arguments, but found ${t.length-1} instead.`);const n=e.parse(t[1],1,U),r=e.parse(t[2],2,U);return n&&r?K(n.type,[D,F,k,A,U])?new pe(n,r):e.error(`Expected first argument to be of type boolean, string, number or null, but found ${X(n.type)} instead`):null}evaluate(t){const e=this.needle.evaluate(t),n=this.haystack.evaluate(t);if(!n)return!1;if(!Z(e,["boolean","string","number","null"]))throw new lt(`Expected first argument to be of type boolean, string, number or null, but found ${X(ot(e))} instead.`);if(!Z(n,["string","array"]))throw new lt(`Expected second argument to be of type array or string, but found ${X(ot(n))} instead.`);return n.indexOf(e)>=0}eachChild(t){t(this.needle),t(this.haystack)}outputDefined(){return!0}serialize(){return["in",this.needle.serialize(),this.haystack.serialize()]}}class de{constructor(t,e,n){this.type=k,this.needle=t,this.haystack=e,this.fromIndex=n}static parse(t,e){if(t.length<=2||t.length>=5)return e.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const n=e.parse(t[1],1,U),r=e.parse(t[2],2,U);if(!n||!r)return null;if(!K(n.type,[D,F,k,A,U]))return e.error(`Expected first argument to be of type boolean, string, number or null, but found ${X(n.type)} instead`);if(4===t.length){const i=e.parse(t[3],3,k);return i?new de(n,r,i):null}return new de(n,r)}evaluate(t){const e=this.needle.evaluate(t),n=this.haystack.evaluate(t);if(!Z(e,["boolean","string","number","null"]))throw new lt(`Expected first argument to be of type boolean, string, number or null, but found ${X(ot(e))} instead.`);if(!Z(n,["string","array"]))throw new lt(`Expected second argument to be of type array or string, but found ${X(ot(n))} instead.`);if(this.fromIndex){const r=this.fromIndex.evaluate(t);return n.indexOf(e,r)}return n.indexOf(e)}eachChild(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)}outputDefined(){return!1}serialize(){if(null!=this.fromIndex&&void 0!==this.fromIndex){const t=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),t]}return["index-of",this.needle.serialize(),this.haystack.serialize()]}}class fe{constructor(t,e,n,r,i,o){this.inputType=t,this.type=e,this.input=n,this.cases=r,this.outputs=i,this.otherwise=o}static parse(t,e){if(t.length<5)return e.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if(t.length%2!=1)return e.error("Expected an even number of arguments.");let n,r;e.expectedType&&"value"!==e.expectedType.kind&&(r=e.expectedType);const i={},o=[];for(let a=2;a<t.length-1;a+=2){let s=t[a];const l=t[a+1];Array.isArray(s)||(s=[s]);const u=e.concat(a);if(0===s.length)return u.error("Expected at least one branch label.");for(const t of s){if("number"!=typeof t&&"string"!=typeof t)return u.error("Branch labels must be numbers or strings.");if("number"==typeof t&&Math.abs(t)>Number.MAX_SAFE_INTEGER)return u.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof t&&Math.floor(t)!==t)return u.error("Numeric branch labels must be integer values.");if(n){if(u.checkSubtype(n,ot(t)))return null}else n=ot(t);if(void 0!==i[String(t)])return u.error("Branch labels must be unique.");i[String(t)]=o.length}const c=e.parse(l,a,r);if(!c)return null;r=r||c.type,o.push(c)}const a=e.parse(t[1],1,U);if(!a)return null;const s=e.parse(t[t.length-1],t.length-1,r);return s?"value"!==a.type.kind&&e.concat(1).checkSubtype(n,a.type)?null:new fe(n,r,a,i,o,s):null}evaluate(t){const e=this.input.evaluate(t);return(ot(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)}eachChild(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)}outputDefined(){return this.outputs.every(t=>t.outputDefined())&&this.otherwise.outputDefined()}serialize(){const t=["match",this.input.serialize()],e=Object.keys(this.cases).sort(),n=[],r={};for(const t of e){const e=r[this.cases[t]];void 0===e?(r[this.cases[t]]=n.length,n.push([this.cases[t],[t]])):n[e][1].push(t)}const i=t=>"number"===this.inputType.kind?Number(t):t;for(const[e,r]of n)1===r.length?t.push(i(r[0])):t.push(r.map(i)),t.push(this.outputs[e].serialize());return t.push(this.otherwise.serialize()),t}}class ge{constructor(t,e,n){this.type=t,this.branches=e,this.otherwise=n}static parse(t,e){if(t.length<4)return e.error(`Expected at least 3 arguments, but found only ${t.length-1}.`);if(t.length%2!=0)return e.error("Expected an odd number of arguments.");let n;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);const r=[];for(let i=1;i<t.length-1;i+=2){const o=e.parse(t[i],i,D);if(!o)return null;const a=e.parse(t[i+1],i+1,n);if(!a)return null;r.push([o,a]),n=n||a.type}const i=e.parse(t[t.length-1],t.length-1,n);return i?new ge(n,r,i):null}evaluate(t){for(const[e,n]of this.branches)if(e.evaluate(t))return n.evaluate(t);return this.otherwise.evaluate(t)}eachChild(t){for(const[e,n]of this.branches)t(e),t(n);t(this.otherwise)}outputDefined(){return this.branches.every(([t,e])=>e.outputDefined())&&this.otherwise.outputDefined()}serialize(){const t=["case"];return this.eachChild(e=>{t.push(e.serialize())}),t}}class ye{constructor(t,e,n,r){this.type=t,this.input=e,this.beginIndex=n,this.endIndex=r}static parse(t,e){if(t.length<=2||t.length>=5)return e.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const n=e.parse(t[1],1,U),r=e.parse(t[2],2,k);if(!n||!r)return null;if(!K(n.type,[Y(U),F,U]))return e.error(`Expected first argument to be of type array or string, but found ${X(n.type)} instead`);if(4===t.length){const i=e.parse(t[3],3,k);return i?new ye(n.type,n,r,i):null}return new ye(n.type,n,r)}evaluate(t){const e=this.input.evaluate(t),n=this.beginIndex.evaluate(t);if(!Z(e,["string","array"]))throw new lt(`Expected first argument to be of type array or string, but found ${X(ot(e))} instead.`);if(this.endIndex){const r=this.endIndex.evaluate(t);return e.slice(n,r)}return e.slice(n)}eachChild(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)}outputDefined(){return!1}serialize(){if(null!=this.endIndex&&void 0!==this.endIndex){const t=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),t]}return["slice",this.input.serialize(),this.beginIndex.serialize()]}}function me(t,e){return"=="===t||"!="===t?"boolean"===e.kind||"string"===e.kind||"number"===e.kind||"null"===e.kind||"value"===e.kind:"string"===e.kind||"number"===e.kind||"value"===e.kind}function ve(t,e,n,r){return 0===r.compare(e,n)}function _e(t,e,n){const r="=="!==t&&"!="!==t;return class i{constructor(t,e,n){this.type=D,this.lhs=t,this.rhs=e,this.collator=n,this.hasUntypedArgument="value"===t.type.kind||"value"===e.type.kind}static parse(t,e){if(3!==t.length&&4!==t.length)return e.error("Expected two or three arguments.");const n=t[0];let o=e.parse(t[1],1,U);if(!o)return null;if(!me(n,o.type))return e.concat(1).error(`"${n}" comparisons are not supported for type '${X(o.type)}'.`);let a=e.parse(t[2],2,U);if(!a)return null;if(!me(n,a.type))return e.concat(2).error(`"${n}" comparisons are not supported for type '${X(a.type)}'.`);if(o.type.kind!==a.type.kind&&"value"!==o.type.kind&&"value"!==a.type.kind)return e.error(`Cannot compare types '${X(o.type)}' and '${X(a.type)}'.`);r&&("value"===o.type.kind&&"value"!==a.type.kind?o=new ct(a.type,[o]):"value"!==o.type.kind&&"value"===a.type.kind&&(a=new ct(o.type,[a])));let s=null;if(4===t.length){if("string"!==o.type.kind&&"string"!==a.type.kind&&"value"!==o.type.kind&&"value"!==a.type.kind)return e.error("Cannot use collator to compare non-string types.");if(s=e.parse(t[3],3,B),!s)return null}return new i(o,a,s)}evaluate(i){const o=this.lhs.evaluate(i),a=this.rhs.evaluate(i);if(r&&this.hasUntypedArgument){const e=ot(o),n=ot(a);if(e.kind!==n.kind||"string"!==e.kind&&"number"!==e.kind)throw new lt(`Expected arguments for "${t}" to be (string, string) or (number, number), but found (${e.kind}, ${n.kind}) instead.`)}if(this.collator&&!r&&this.hasUntypedArgument){const t=ot(o),n=ot(a);if("string"!==t.kind||"string"!==n.kind)return e(i,o,a)}return this.collator?n(i,o,a,this.collator.evaluate(i)):e(i,o,a)}eachChild(t){t(this.lhs),t(this.rhs),this.collator&&t(this.collator)}outputDefined(){return!0}serialize(){const e=[t];return this.eachChild(t=>{e.push(t.serialize())}),e}}}const be=_e("==",(function(t,e,n){return e===n}),ve),we=_e("!=",(function(t,e,n){return e!==n}),(function(t,e,n,r){return!ve(0,e,n,r)})),xe=_e("<",(function(t,e,n){return e<n}),(function(t,e,n,r){return r.compare(e,n)<0})),Ee=_e(">",(function(t,e,n){return e>n}),(function(t,e,n,r){return r.compare(e,n)>0})),Se=_e("<=",(function(t,e,n){return e<=n}),(function(t,e,n,r){return r.compare(e,n)<=0})),Oe=_e(">=",(function(t,e,n){return e>=n}),(function(t,e,n,r){return r.compare(e,n)>=0}));class Ce{constructor(t,e,n,r,i){this.type=F,this.number=t,this.locale=e,this.currency=n,this.minFractionDigits=r,this.maxFractionDigits=i}static parse(t,e){if(3!==t.length)return e.error("Expected two arguments.");const n=e.parse(t[1],1,k);if(!n)return null;const r=t[2];if("object"!=typeof r||Array.isArray(r))return e.error("NumberFormat options argument must be an object.");let i=null;if(r.locale&&(i=e.parse(r.locale,1,F),!i))return null;let o=null;if(r.currency&&(o=e.parse(r.currency,1,F),!o))return null;let a=null;if(r["min-fraction-digits"]&&(a=e.parse(r["min-fraction-digits"],1,k),!a))return null;let s=null;return r["max-fraction-digits"]&&(s=e.parse(r["max-fraction-digits"],1,k),!s)?null:new Ce(n,i,o,a,s)}evaluate(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))}eachChild(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)}outputDefined(){return!1}serialize(){const t={};return this.locale&&(t.locale=this.locale.serialize()),this.currency&&(t.currency=this.currency.serialize()),this.minFractionDigits&&(t["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(t["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),t]}}class Te{constructor(t){this.type=k,this.input=t}static parse(t,e){if(2!==t.length)return e.error(`Expected 1 argument, but found ${t.length-1} instead.`);const n=e.parse(t[1],1);return n?"array"!==n.type.kind&&"string"!==n.type.kind&&"value"!==n.type.kind?e.error(`Expected argument of type string or array, but found ${X(n.type)} instead.`):new Te(n):null}evaluate(t){const e=this.input.evaluate(t);if("string"==typeof e)return e.length;if(Array.isArray(e))return e.length;throw new lt(`Expected value to be of type string or array, but found ${X(ot(e))} instead.`)}eachChild(t){t(this.input)}outputDefined(){return!1}serialize(){const t=["length"];return this.eachChild(e=>{t.push(e.serialize())}),t}}const Ie={"==":be,"!=":we,">":Ee,"<":xe,">=":Oe,"<=":Se,array:ct,at:he,boolean:ct,case:ge,coalesce:ue,collator:vt,format:ht,image:pt,in:pe,"index-of":de,interpolate:se,"interpolate-hcl":se,"interpolate-lab":se,length:Te,let:ce,literal:st,match:fe,number:ct,"number-format":Ce,object:ct,slice:ye,step:Bt,string:ct,"to-boolean":ft,"to-color":ft,"to-number":ft,"to-string":ft,var:Gt,within:At};function Le(t,[e,n,r,i]){e=e.evaluate(t),n=n.evaluate(t),r=r.evaluate(t);const o=i?i.evaluate(t):1,a=rt(e,n,r,o);if(a)throw new lt(a);return new J(e/255*o,n/255*o,r/255*o,o)}function Pe(t,e){return t in e}function Re(t,e){const n=e[t];return void 0===n?null:n}function Me(t){return{type:t}}function Ne(t){return{result:"success",value:t}}function je(t){return{result:"error",value:t}}function Ae(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function ke(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function Fe(t){return!!t.expression&&t.expression.interpolated}function De(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function Ge(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function ze(t){return t}function Ue(t,e){const n="color"===e.type,r=t.stops&&"object"==typeof t.stops[0][0],i=r||void 0!==t.property,o=r||!i,a=t.type||(Fe(e)?"exponential":"interval");if(n&&((t=M({},t)).stops&&(t.stops=t.stops.map(t=>[t[0],J.parse(t[1])])),t.default?t.default=J.parse(t.default):t.default=J.parse(e.default)),t.colorSpace&&"rgb"!==t.colorSpace&&!ae[t.colorSpace])throw new Error("Unknown color space: "+t.colorSpace);let s,l,u;if("exponential"===a)s=Ye;else if("interval"===a)s=qe;else if("categorical"===a){s=Ve,l=Object.create(null);for(const e of t.stops)l[e[0]]=e[1];u=typeof t.stops[0][0]}else{if("identity"!==a)throw new Error(`Unknown function type "${a}"`);s=Xe}if(r){const n={},r=[];for(let e=0;e<t.stops.length;e++){const i=t.stops[e],o=i[0].zoom;void 0===n[o]&&(n[o]={zoom:o,type:t.type,property:t.property,default:t.default,stops:[]},r.push(o)),n[o].stops.push([i[0].value,i[1]])}const i=[];for(const t of r)i.push([n[t].zoom,Ue(n[t],e)]);const o={name:"linear"};return{kind:"composite",interpolationType:o,interpolationFactor:se.interpolationFactor.bind(void 0,o),zoomStops:i.map(t=>t[0]),evaluate:({zoom:n},r)=>Ye({stops:i,base:t.base},e,n).evaluate(n,r)}}if(o){const n="exponential"===a?{name:"exponential",base:void 0!==t.base?t.base:1}:null;return{kind:"camera",interpolationType:n,interpolationFactor:se.interpolationFactor.bind(void 0,n),zoomStops:t.stops.map(t=>t[0]),evaluate:({zoom:n})=>s(t,e,n,l,u)}}return{kind:"source",evaluate(n,r){const i=r&&r.properties?r.properties[t.property]:void 0;return void 0===i?Be(t.default,e.default):s(t,e,i,l,u)}}}function Be(t,e,n){return void 0!==t?t:void 0!==e?e:void 0!==n?n:void 0}function Ve(t,e,n,r,i){return Be(typeof n===i?r[n]:void 0,t.default,e.default)}function qe(t,e,n){if("number"!==De(n))return Be(t.default,e.default);const r=t.stops.length;if(1===r)return t.stops[0][1];if(n<=t.stops[0][0])return t.stops[0][1];if(n>=t.stops[r-1][0])return t.stops[r-1][1];const i=Ut(t.stops.map(t=>t[0]),n);return t.stops[i][1]}function Ye(t,e,n){const r=void 0!==t.base?t.base:1;if("number"!==De(n))return Be(t.default,e.default);const i=t.stops.length;if(1===i)return t.stops[0][1];if(n<=t.stops[0][0])return t.stops[0][1];if(n>=t.stops[i-1][0])return t.stops[i-1][1];const o=Ut(t.stops.map(t=>t[0]),n),a=function(t,e,n,r){const i=r-n,o=t-n;return 0===i?0:1===e?o/i:(Math.pow(e,o)-1)/(Math.pow(e,i)-1)}(n,r,t.stops[o][0],t.stops[o+1][0]),s=t.stops[o][1],l=t.stops[o+1][1];let u=Xt[e.type]||ze;if(t.colorSpace&&"rgb"!==t.colorSpace){const e=ae[t.colorSpace];u=(t,n)=>e.reverse(e.interpolate(e.forward(t),e.forward(n),a))}return"function"==typeof s.evaluate?{evaluate(...t){const e=s.evaluate.apply(void 0,t),n=l.evaluate.apply(void 0,t);if(void 0!==e&&void 0!==n)return u(e,n,a)}}:u(s,l,a)}function Xe(t,e,n){return"color"===e.type?n=J.parse(n):"formatted"===e.type?n=et.fromString(n.toString()):"resolvedImage"===e.type?n=nt.fromString(n.toString()):De(n)===e.type||"enum"===e.type&&e.values[n]||(n=void 0),Be(n,t.default,e.default)}mt.register(Ie,{error:[{kind:"error"},[F],(t,[e])=>{throw new lt(e.evaluate(t))}],typeof:[F,[U],(t,[e])=>X(ot(e.evaluate(t)))],"to-rgba":[Y(k,4),[G],(t,[e])=>e.evaluate(t).toArray()],rgb:[G,[k,k,k],Le],rgba:[G,[k,k,k,k],Le],has:{type:D,overloads:[[[F],(t,[e])=>Pe(e.evaluate(t),t.properties())],[[F,z],(t,[e,n])=>Pe(e.evaluate(t),n.evaluate(t))]]},get:{type:U,overloads:[[[F],(t,[e])=>Re(e.evaluate(t),t.properties())],[[F,z],(t,[e,n])=>Re(e.evaluate(t),n.evaluate(t))]]},"feature-state":[U,[F],(t,[e])=>Re(e.evaluate(t),t.featureState||{})],properties:[z,[],t=>t.properties()],"geometry-type":[F,[],t=>t.geometryType()],id:[U,[],t=>t.id()],zoom:[k,[],t=>t.globals.zoom],"heatmap-density":[k,[],t=>t.globals.heatmapDensity||0],"line-progress":[k,[],t=>t.globals.lineProgress||0],"sky-radial-progress":[k,[],t=>t.globals.skyRadialProgress||0],accumulated:[U,[],t=>void 0===t.globals.accumulated?null:t.globals.accumulated],"+":[k,Me(k),(t,e)=>{let n=0;for(const r of e)n+=r.evaluate(t);return n}],"*":[k,Me(k),(t,e)=>{let n=1;for(const r of e)n*=r.evaluate(t);return n}],"-":{type:k,overloads:[[[k,k],(t,[e,n])=>e.evaluate(t)-n.evaluate(t)],[[k],(t,[e])=>-e.evaluate(t)]]},"/":[k,[k,k],(t,[e,n])=>e.evaluate(t)/n.evaluate(t)],"%":[k,[k,k],(t,[e,n])=>e.evaluate(t)%n.evaluate(t)],ln2:[k,[],()=>Math.LN2],pi:[k,[],()=>Math.PI],e:[k,[],()=>Math.E],"^":[k,[k,k],(t,[e,n])=>Math.pow(e.evaluate(t),n.evaluate(t))],sqrt:[k,[k],(t,[e])=>Math.sqrt(e.evaluate(t))],log10:[k,[k],(t,[e])=>Math.log(e.evaluate(t))/Math.LN10],ln:[k,[k],(t,[e])=>Math.log(e.evaluate(t))],log2:[k,[k],(t,[e])=>Math.log(e.evaluate(t))/Math.LN2],sin:[k,[k],(t,[e])=>Math.sin(e.evaluate(t))],cos:[k,[k],(t,[e])=>Math.cos(e.evaluate(t))],tan:[k,[k],(t,[e])=>Math.tan(e.evaluate(t))],asin:[k,[k],(t,[e])=>Math.asin(e.evaluate(t))],acos:[k,[k],(t,[e])=>Math.acos(e.evaluate(t))],atan:[k,[k],(t,[e])=>Math.atan(e.evaluate(t))],min:[k,Me(k),(t,e)=>Math.min(...e.map(e=>e.evaluate(t)))],max:[k,Me(k),(t,e)=>Math.max(...e.map(e=>e.evaluate(t)))],abs:[k,[k],(t,[e])=>Math.abs(e.evaluate(t))],round:[k,[k],(t,[e])=>{const n=e.evaluate(t);return n<0?-Math.round(-n):Math.round(n)}],floor:[k,[k],(t,[e])=>Math.floor(e.evaluate(t))],ceil:[k,[k],(t,[e])=>Math.ceil(e.evaluate(t))],"filter-==":[D,[F,U],(t,[e,n])=>t.properties()[e.value]===n.value],"filter-id-==":[D,[U],(t,[e])=>t.id()===e.value],"filter-type-==":[D,[F],(t,[e])=>t.geometryType()===e.value],"filter-<":[D,[F,U],(t,[e,n])=>{const r=t.properties()[e.value],i=n.value;return typeof r==typeof i&&r<i}],"filter-id-<":[D,[U],(t,[e])=>{const n=t.id(),r=e.value;return typeof n==typeof r&&n<r}],"filter->":[D,[F,U],(t,[e,n])=>{const r=t.properties()[e.value],i=n.value;return typeof r==typeof i&&r>i}],"filter-id->":[D,[U],(t,[e])=>{const n=t.id(),r=e.value;return typeof n==typeof r&&n>r}],"filter-<=":[D,[F,U],(t,[e,n])=>{const r=t.properties()[e.value],i=n.value;return typeof r==typeof i&&r<=i}],"filter-id-<=":[D,[U],(t,[e])=>{const n=t.id(),r=e.value;return typeof n==typeof r&&n<=r}],"filter->=":[D,[F,U],(t,[e,n])=>{const r=t.properties()[e.value],i=n.value;return typeof r==typeof i&&r>=i}],"filter-id->=":[D,[U],(t,[e])=>{const n=t.id(),r=e.value;return typeof n==typeof r&&n>=r}],"filter-has":[D,[U],(t,[e])=>e.value in t.properties()],"filter-has-id":[D,[],t=>null!==t.id()&&void 0!==t.id()],"filter-type-in":[D,[Y(F)],(t,[e])=>e.value.indexOf(t.geometryType())>=0],"filter-id-in":[D,[Y(U)],(t,[e])=>e.value.indexOf(t.id())>=0],"filter-in-small":[D,[F,Y(U)],(t,[e,n])=>n.value.indexOf(t.properties()[e.value])>=0],"filter-in-large":[D,[F,Y(U)],(t,[e,n])=>function(t,e,n,r){for(;n<=r;){const i=n+r>>1;if(e[i]===t)return!0;e[i]>t?r=i-1:n=i+1}return!1}(t.properties()[e.value],n.value,0,n.value.length-1)],all:{type:D,overloads:[[[D,D],(t,[e,n])=>e.evaluate(t)&&n.evaluate(t)],[Me(D),(t,e)=>{for(const n of e)if(!n.evaluate(t))return!1;return!0}]]},any:{type:D,overloads:[[[D,D],(t,[e,n])=>e.evaluate(t)||n.evaluate(t)],[Me(D),(t,e)=>{for(const n of e)if(n.evaluate(t))return!0;return!1}]]},"!":[D,[D],(t,[e])=>!e.evaluate(t)],"is-supported-script":[D,[F],(t,[e])=>{const n=t.globals&&t.globals.isSupportedScript;return!n||n(e.evaluate(t))}],upcase:[F,[F],(t,[e])=>e.evaluate(t).toUpperCase()],downcase:[F,[F],(t,[e])=>e.evaluate(t).toLowerCase()],concat:[F,Me(U),(t,e)=>e.map(e=>at(e.evaluate(t))).join("")],"resolved-locale":[F,[B],(t,[e])=>e.evaluate(t).resolvedLocale()]});class We{constructor(t,e){var n;this.expression=t,this._warningHistory={},this._evaluator=new yt,this._defaultValue=e?"color"===(n=e).type&&Ge(n.default)?new J(0,0,0,0):"color"===n.type?J.parse(n.default)||null:void 0===n.default?null:n.default:null,this._enumValues=e&&"enum"===e.type?e.values:null}evaluateWithoutErrorHandling(t,e,n,r,i,o){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=n,this._evaluator.canonical=r,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=o,this.expression.evaluate(this._evaluator)}evaluate(t,e,n,r,i,o){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=n||null,this._evaluator.canonical=r,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=o||null;try{const t=this.expression.evaluate(this._evaluator);if(null==t||"number"==typeof t&&t!=t)return this._defaultValue;if(this._enumValues&&!(t in this._enumValues))throw new lt(`Expected value to be one of ${Object.keys(this._enumValues).map(t=>JSON.stringify(t)).join(", ")}, but found ${JSON.stringify(t)} instead.`);return t}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}}}function He(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&t[0]in Ie}function Ke(t,e){const n=new zt(Ie,[],e?function(t){const e={color:G,string:F,number:k,enum:F,boolean:D,formatted:V,resolvedImage:q};if("array"===t.type)return Y(e[t.value]||U,t.length);return e[t.type]}(e):void 0),r=n.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return r?Ne(new We(r,e)):je(n.errors)}class Ze{constructor(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!Ft(e.expression)}evaluateWithoutErrorHandling(t,e,n,r,i,o){return this._styleExpression.evaluateWithoutErrorHandling(t,e,n,r,i,o)}evaluate(t,e,n,r,i,o){return this._styleExpression.evaluate(t,e,n,r,i,o)}}class $e{constructor(t,e,n,r){this.kind=t,this.zoomStops=n,this._styleExpression=e,this.isStateDependent="camera"!==t&&!Ft(e.expression),this.interpolationType=r}evaluateWithoutErrorHandling(t,e,n,r,i,o){return this._styleExpression.evaluateWithoutErrorHandling(t,e,n,r,i,o)}evaluate(t,e,n,r,i,o){return this._styleExpression.evaluate(t,e,n,r,i,o)}interpolationFactor(t,e,n){return this.interpolationType?se.interpolationFactor(this.interpolationType,t,e,n):0}}function Je(t,e){if("error"===(t=Ke(t,e)).result)return t;const n=t.value.expression,r=kt(n);if(!r&&!Ae(e))return je([new N("","data expressions not supported")]);const i=Dt(n,["zoom"]);if(!i&&!ke(e))return je([new N("","zoom expressions not supported")]);const o=function t(e){let n=null;if(e instanceof ce)n=t(e.result);else if(e instanceof ue){for(const r of e.args)if(n=t(r),n)break}else(e instanceof Bt||e instanceof se)&&e.input instanceof mt&&"zoom"===e.input.name&&(n=e);if(n instanceof N)return n;return e.eachChild(e=>{const r=t(e);r instanceof N?n=r:!n&&r?n=new N("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):n&&r&&n!==r&&(n=new N("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),n}(n);if(!o&&!i)return je([new N("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(o instanceof N)return je([o]);if(o instanceof se&&!Fe(e))return je([new N("",'"interpolate" expressions cannot be used with this property')]);if(!o)return Ne(new Ze(r?"constant":"source",t.value));const a=o instanceof se?o.interpolation:void 0;return Ne(new $e(r?"camera":"composite",t.value,o.labels,a))}class Qe{constructor(t,e){this._parameters=t,this._specification=e,M(this,Ue(this._parameters,this._specification))}static deserialize(t){return new Qe(t._parameters,t._specification)}static serialize(t){return{_parameters:t._parameters,_specification:t._specification}}}function tn(t){return"object"==typeof t?["literal",t]:t}function en(t,e){let n=t.stops;if(!n)return function(t,e){const n=["get",t.property];if(void 0===t.default)return"string"===e.type?["string",n]:n;if("enum"===e.type)return["match",n,Object.keys(e.values),n,t.default];{const r=["color"===e.type?"to-color":e.type,n,tn(t.default)];return"array"===e.type&&r.splice(1,0,e.value,e.length||null),r}}(t,e);const r=n&&"object"==typeof n[0][0],i=r||void 0!==t.property,o=r||!i;return n=n.map(t=>!i&&e.tokens&&"string"==typeof t[1]?[t[0],un(t[1])]:[t[0],tn(t[1])]),r?function(t,e,n){const r={},i={},o=[];for(let e=0;e<n.length;e++){const a=n[e],s=a[0].zoom;void 0===r[s]&&(r[s]={zoom:s,type:t.type,property:t.property,default:t.default},i[s]=[],o.push(s)),i[s].push([a[0].value,a[1]])}if("exponential"===ln({},e)){const n=[nn(t),["linear"],["zoom"]];for(const t of o){const o=on(r[t],e,i[t]);sn(n,t,o,!1)}return n}{const t=["step",["zoom"]];for(const n of o){const o=on(r[n],e,i[n]);sn(t,n,o,!0)}return an(t),t}}(t,e,n):o?function(t,e,n,r=["zoom"]){const i=ln(t,e);let o,a=!1;if("interval"===i)o=["step",r],a=!0;else{if("exponential"!==i)throw new Error(`Unknown zoom function type "${i}"`);{const e=void 0!==t.base?t.base:1;o=[nn(t),1===e?["linear"]:["exponential",e],r]}}for(const t of n)sn(o,t[0],t[1],a);return an(o),o}(t,e,n):on(t,e,n)}function nn(t){switch(t.colorSpace){case"hcl":return"interpolate-hcl";case"lab":return"interpolate-lab";default:return"interpolate"}}function rn(t,e){const n=tn((r=t.default,i=e.default,void 0!==r?r:void 0!==i?i:void 0));var r,i;return void 0===n&&"resolvedImage"===e.type?"":n}function on(t,e,n){const r=ln(t,e),i=["get",t.property];if("categorical"===r&&"boolean"==typeof n[0][0]){const r=["case"];for(const t of n)r.push(["==",i,t[0]],t[1]);return r.push(rn(t,e)),r}if("categorical"===r){const r=["match",i];for(const t of n)sn(r,t[0],t[1],!1);return r.push(rn(t,e)),r}if("interval"===r){const e=["step",["number",i]];for(const t of n)sn(e,t[0],t[1],!0);return an(e),void 0===t.default?e:["case",["==",["typeof",i],"number"],e,tn(t.default)]}if("exponential"===r){const e=void 0!==t.base?t.base:1,r=[nn(t),1===e?["linear"]:["exponential",e],["number",i]];for(const t of n)sn(r,t[0],t[1],!1);return void 0===t.default?r:["case",["==",["typeof",i],"number"],r,tn(t.default)]}throw new Error("Unknown property function type "+r)}function an(t){"step"===t[0]&&3===t.length&&(t.push(0),t.push(t[3]))}function sn(t,e,n,r){t.length>3&&e===t[t.length-2]||(r&&2===t.length||t.push(e),t.push(n))}function ln(t,e){return t.type?t.type:e.expression.interpolated?"exponential":"interval"}function un(t){const e=["concat"],n=/{([^{}]+)}/g;let r=0;for(let i=n.exec(t);null!==i;i=n.exec(t)){const o=t.slice(r,n.lastIndex-i[0].length);r=n.lastIndex,o.length>0&&e.push(o),e.push(["get",i[1]])}if(1===e.length)return t;if(r<t.length)e.push(t.slice(r));else if(2===e.length)return["to-string",e[1]];return e}function cn(t){if(!0===t||!1===t)return!0;if(!Array.isArray(t)||0===t.length)return!1;switch(t[0]){case"has":return t.length>=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":return t.length>=3&&("string"!=typeof t[1]||Array.isArray(t[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(const e of t.slice(1))if(!cn(e)&&"boolean"!=typeof e)return!1;return!0;default:return!0}}const hn={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function pn(t){if(null==t)return{filter:()=>!0,needGeometry:!1};cn(t)||(t=fn(t));const e=Ke(t,hn);if("error"===e.result)throw new Error(e.value.map(t=>`${t.key}: ${t.message}`).join(", "));return{filter:(t,n,r)=>e.value.evaluate(t,n,{},r),needGeometry:function t(e){if(!Array.isArray(e))return!1;if("within"===e[0])return!0;for(let n=1;n<e.length;n++)if(t(e[n]))return!0;return!1}(t)}}function dn(t,e){return t<e?-1:t>e?1:0}function fn(t){if(!t)return!0;const e=t[0];if(t.length<=1)return"any"!==e;var n;return"=="===e?gn(t[1],t[2],"=="):"!="===e?vn(gn(t[1],t[2],"==")):"<"===e||">"===e||"<="===e||">="===e?gn(t[1],t[2],e):"any"===e?(n=t.slice(1),["any"].concat(n.map(fn))):"all"===e?["all"].concat(t.slice(1).map(fn)):"none"===e?["all"].concat(t.slice(1).map(fn).map(vn)):"in"===e?yn(t[1],t.slice(2)):"!in"===e?vn(yn(t[1],t.slice(2))):"has"===e?mn(t[1]):"!has"===e?vn(mn(t[1])):"within"!==e||t}function gn(t,e,n){switch(t){case"$type":return["filter-type-"+n,e];case"$id":return["filter-id-"+n,e];default:return["filter-"+n,t,e]}}function yn(t,e){if(0===e.length)return!1;switch(t){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some(t=>typeof t!=typeof e[0])?["filter-in-large",t,["literal",e.sort(dn)]]:["filter-in-small",t,["literal",e]]}}function mn(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function vn(t){return["!",t]}var _n=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function bn(t,e){const n={};for(const e in t)"ref"!==e&&(n[e]=t[e]);return _n.forEach(t=>{t in e&&(n[t]=e[t])}),n}function wn(t){t=t.slice();const e=Object.create(null);for(let n=0;n<t.length;n++)e[t[n].id]=t[n];for(let n=0;n<t.length;n++)"ref"in t[n]&&(t[n]=bn(t[n],e[t[n].ref]));return t}class xn{constructor(t,e,n,r){this.message=(t?t+": ":"")+n,r&&(this.identifier=r),null!=e&&e.__line__&&(this.line=e.__line__)}}class En{constructor(t){this.error=t,this.message=t.message;const e=t.message.match(/line (\d+)/);this.line=e?parseInt(e[1],10):0}}function Sn(t){const e=t.key,n=t.value;return n?[new xn(e,n,"constants have been deprecated as of v8")]:[]}function On(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}function Cn(t){if(Array.isArray(t))return t.map(Cn);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){const e={};for(const n in t)e[n]=Cn(t[n]);return e}return On(t)}function Tn(t){const e=t.key,n=t.value,r=t.valueSpec||{},i=t.objectElementValidators||{},o=t.style,a=t.styleSpec;let s=[];const l=De(n);if("object"!==l)return[new xn(e,n,`object expected, ${l} found`)];for(const t in n){const l=t.split(".")[0],u=r[l]||r["*"];let c;if(i[l])c=i[l];else if(r[l])c=Yn;else if(i["*"])c=i["*"];else{if(!r["*"]){s.push(new xn(e,n[t],`unknown property "${t}"`));continue}c=Yn}s=s.concat(c({key:(e?e+".":e)+t,value:n[t],valueSpec:u,style:o,styleSpec:a,object:n,objectKey:t},n))}for(const t in r)i[t]||r[t].required&&void 0===r[t].default&&void 0===n[t]&&s.push(new xn(e,n,`missing required property "${t}"`));return s}function In(t){const e=t.value,n=t.valueSpec,r=t.style,i=t.styleSpec,o=t.key,a=t.arrayElementValidator||Yn;if("array"!==De(e))return[new xn(o,e,`array expected, ${De(e)} found`)];if(n.length&&e.length!==n.length)return[new xn(o,e,`array length ${n.length} expected, length ${e.length} found`)];if(n["min-length"]&&e.length<n["min-length"])return[new xn(o,e,`array length at least ${n["min-length"]} expected, length ${e.length} found`)];let s={type:n.value,values:n.values,minimum:n.minimum,maximum:n.maximum};i.$version<7&&(s.function=n.function),"object"===De(n.value)&&(s=n.value);let l=[];for(let t=0;t<e.length;t++)l=l.concat(a({array:e,arrayIndex:t,value:e[t],valueSpec:s,style:r,styleSpec:i,key:`${o}[${t}]`}));return l}function Ln(t){const e=t.key,n=t.value,r=t.valueSpec;let i=De(n);if("number"===i&&n!=n&&(i="NaN"),"number"!==i)return[new xn(e,n,`number expected, ${i} found`)];if("minimum"in r){let i=r.minimum;if("array"===De(r.minimum)){const e=t.arrayIndex;i=r.minimum[e]}if(n<i)return[new xn(e,n,`${n} is less than the minimum value ${i}`)]}if("maximum"in r){let i=r.maximum;if("array"===De(r.maximum)){const e=t.arrayIndex;i=r.maximum[e]}if(n>i)return[new xn(e,n,`${n} is greater than the maximum value ${i}`)]}return[]}function Pn(t){const e=t.valueSpec,n=On(t.value.type);let r,i,o,a={};const s="categorical"!==n&&void 0===t.value.property,l=!s,u="array"===De(t.value.stops)&&"array"===De(t.value.stops[0])&&"object"===De(t.value.stops[0][0]),c=Tn({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(t){if("identity"===n)return[new xn(t.key,t.value,'identity function may not have a "stops" property')];let e=[];const r=t.value;e=e.concat(In({key:t.key,value:r,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:h})),"array"===De(r)&&0===r.length&&e.push(new xn(t.key,r,"array must have at least one stop"));return e},default:function(t){return Yn({key:t.key,value:t.value,valueSpec:e,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===n&&s&&c.push(new xn(t.key,t.value,'missing required property "property"')),"identity"===n||t.value.stops||c.push(new xn(t.key,t.value,'missing required property "stops"')),"exponential"===n&&t.valueSpec.expression&&!Fe(t.valueSpec)&&c.push(new xn(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(l&&!Ae(t.valueSpec)?c.push(new xn(t.key,t.value,"property functions not supported")):s&&!ke(t.valueSpec)&&c.push(new xn(t.key,t.value,"zoom functions not supported"))),"categorical"!==n&&!u||void 0!==t.value.property||c.push(new xn(t.key,t.value,'"property" property is required')),c;function h(t){let n=[];const r=t.value,s=t.key;if("array"!==De(r))return[new xn(s,r,`array expected, ${De(r)} found`)];if(2!==r.length)return[new xn(s,r,`array length 2 expected, length ${r.length} found`)];if(u){if("object"!==De(r[0]))return[new xn(s,r,`object expected, ${De(r[0])} found`)];if(void 0===r[0].zoom)return[new xn(s,r,"object stop key must have zoom")];if(void 0===r[0].value)return[new xn(s,r,"object stop key must have value")];if(o&&o>On(r[0].zoom))return[new xn(s,r[0].zoom,"stop zoom values must appear in ascending order")];On(r[0].zoom)!==o&&(o=On(r[0].zoom),i=void 0,a={}),n=n.concat(Tn({key:s+"[0]",value:r[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:Ln,value:p}}))}else n=n.concat(p({key:s+"[0]",value:r[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec},r));return He(Cn(r[1]))?n.concat([new xn(s+"[1]",r[1],"expressions are not allowed in function stops.")]):n.concat(Yn({key:s+"[1]",value:r[1],valueSpec:e,style:t.style,styleSpec:t.styleSpec}))}function p(t,o){const s=De(t.value),l=On(t.value),u=null!==t.value?t.value:o;if(r){if(s!==r)return[new xn(t.key,u,`${s} stop domain type must match previous stop domain type ${r}`)]}else r=s;if("number"!==s&&"string"!==s&&"boolean"!==s)return[new xn(t.key,u,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==n){let r=`number expected, ${s} found`;return Ae(e)&&void 0===n&&(r+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new xn(t.key,u,r)]}return"categorical"!==n||"number"!==s||isFinite(l)&&Math.floor(l)===l?"categorical"!==n&&"number"===s&&void 0!==i&&l<i?[new xn(t.key,u,"stop domain values must appear in ascending order")]:(i=l,"categorical"===n&&l in a?[new xn(t.key,u,"stop domain values must be unique")]:(a[l]=!0,[])):[new xn(t.key,u,"integer expected, found "+l)]}}function Rn(t){const e=("property"===t.expressionContext?Je:Ke)(Cn(t.value),t.valueSpec);if("error"===e.result)return e.value.map(e=>new xn(`${t.key}${e.key}`,t.value,e.message));const n=e.value.expression||e.value._styleExpression.expression;if("property"===t.expressionContext&&"text-font"===t.propertyKey&&!n.outputDefined())return[new xn(t.key,t.value,`Invalid data expression for "${t.propertyKey}". Output values must be contained as literals within the expression.`)];if("property"===t.expressionContext&&"layout"===t.propertyType&&!Ft(n))return[new xn(t.key,t.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===t.expressionContext&&!Ft(n))return[new xn(t.key,t.value,'"feature-state" data expressions are not supported with filters.')];if(t.expressionContext&&0===t.expressionContext.indexOf("cluster")){if(!Dt(n,["zoom","feature-state"]))return[new xn(t.key,t.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===t.expressionContext&&!kt(n))return[new xn(t.key,t.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Mn(t){const e=t.key,n=t.value,r=t.valueSpec,i=[];return Array.isArray(r.values)?-1===r.values.indexOf(On(n))&&i.push(new xn(e,n,`expected one of [${r.values.join(", ")}], ${JSON.stringify(n)} found`)):-1===Object.keys(r.values).indexOf(On(n))&&i.push(new xn(e,n,`expected one of [${Object.keys(r.values).join(", ")}], ${JSON.stringify(n)} found`)),i}function Nn(t){return cn(Cn(t.value))?Rn(M({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function t(e){const n=e.value,r=e.key;if("array"!==De(n))return[new xn(r,n,`array expected, ${De(n)} found`)];const i=e.styleSpec;let o,a=[];if(n.length<1)return[new xn(r,n,"filter array must have at least 1 element")];switch(a=a.concat(Mn({key:r+"[0]",value:n[0],valueSpec:i.filter_operator,style:e.style,styleSpec:e.styleSpec})),On(n[0])){case"<":case"<=":case">":case">=":n.length>=2&&"$type"===On(n[1])&&a.push(new xn(r,n,`"$type" cannot be use with operator "${n[0]}"`));case"==":case"!=":3!==n.length&&a.push(new xn(r,n,`filter array for operator "${n[0]}" must have 3 elements`));case"in":case"!in":n.length>=2&&(o=De(n[1]),"string"!==o&&a.push(new xn(r+"[1]",n[1],`string expected, ${o} found`)));for(let t=2;t<n.length;t++)o=De(n[t]),"$type"===On(n[1])?a=a.concat(Mn({key:`${r}[${t}]`,value:n[t],valueSpec:i.geometry_type,style:e.style,styleSpec:e.styleSpec})):"string"!==o&&"number"!==o&&"boolean"!==o&&a.push(new xn(`${r}[${t}]`,n[t],`string, number, or boolean expected, ${o} found`));break;case"any":case"all":case"none":for(let i=1;i<n.length;i++)a=a.concat(t({key:`${r}[${i}]`,value:n[i],style:e.style,styleSpec:e.styleSpec}));break;case"has":case"!has":o=De(n[1]),2!==n.length?a.push(new xn(r,n,`filter array for "${n[0]}" operator must have 2 elements`)):"string"!==o&&a.push(new xn(r+"[1]",n[1],`string expected, ${o} found`));break;case"within":o=De(n[1]),2!==n.length?a.push(new xn(r,n,`filter array for "${n[0]}" operator must have 2 elements`)):"object"!==o&&a.push(new xn(r+"[1]",n[1],`object expected, ${o} found`))}return a}(t)}function jn(t,e){const n=t.key,r=t.style,i=t.styleSpec,o=t.value,a=t.objectKey,s=i[`${e}_${t.layerType}`];if(!s)return[];const l=a.match(/^(.*)-transition$/);if("paint"===e&&l&&s[l[1]]&&s[l[1]].transition)return Yn({key:n,value:o,valueSpec:i.transition,style:r,styleSpec:i});const u=t.valueSpec||s[a];if(!u)return[new xn(n,o,`unknown property "${a}"`)];let c;if("string"===De(o)&&Ae(u)&&!u.tokens&&(c=/^{([^}]+)}$/.exec(o)))return[new xn(n,o,`"${a}" does not support interpolation syntax\nUse an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(c[1])} }\`.`)];const h=[];return"symbol"===t.layerType&&("text-field"===a&&r&&!r.glyphs&&h.push(new xn(n,o,'use of "text-field" requires a style "glyphs" property')),"text-font"===a&&Ge(Cn(o))&&"identity"===On(o.type)&&h.push(new xn(n,o,'"text-font" does not support identity functions'))),h.concat(Yn({key:t.key,value:o,valueSpec:u,style:r,styleSpec:i,expressionContext:"property",propertyType:e,propertyKey:a}))}function An(t){return jn(t,"paint")}function kn(t){return jn(t,"layout")}function Fn(t){let e=[];const n=t.value,r=t.key,i=t.style,o=t.styleSpec;n.type||n.ref||e.push(new xn(r,n,'either "type" or "ref" is required'));let a=On(n.type);const s=On(n.ref);if(n.id){const o=On(n.id);for(let a=0;a<t.arrayIndex;a++){const t=i.layers[a];On(t.id)===o&&e.push(new xn(r,n.id,`duplicate layer id "${n.id}", previously used at line ${t.id.__line__}`))}}if("ref"in n){let t;["type","source","source-layer","filter","layout"].forEach(t=>{t in n&&e.push(new xn(r,n[t],`"${t}" is prohibited for ref layers`))}),i.layers.forEach(e=>{On(e.id)===s&&(t=e)}),t?t.ref?e.push(new xn(r,n.ref,"ref cannot reference another ref layer")):a=On(t.type):e.push(new xn(r,n.ref,`ref layer "${s}" not found`))}else if("background"!==a&&"sky"!==a)if(n.source){const t=i.sources&&i.sources[n.source],o=t&&On(t.type);t?"vector"===o&&"raster"===a?e.push(new xn(r,n.source,`layer "${n.id}" requires a raster source`)):"raster"===o&&"raster"!==a?e.push(new xn(r,n.source,`layer "${n.id}" requires a vector source`)):"vector"!==o||n["source-layer"]?"raster-dem"===o&&"hillshade"!==a?e.push(new xn(r,n.source,"raster-dem source can only be used with layer type 'hillshade'.")):"line"!==a||!n.paint||!n.paint["line-gradient"]||"geojson"===o&&t.lineMetrics||e.push(new xn(r,n,`layer "${n.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):e.push(new xn(r,n,`layer "${n.id}" must specify a "source-layer"`)):e.push(new xn(r,n.source,`source "${n.source}" not found`))}else e.push(new xn(r,n,'missing required property "source"'));return e=e.concat(Tn({key:r,value:n,valueSpec:o.layer,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":()=>[],type:()=>Yn({key:r+".type",value:n.type,valueSpec:o.layer.type,style:t.style,styleSpec:t.styleSpec,object:n,objectKey:"type"}),filter:Nn,layout:t=>Tn({layer:n,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":t=>kn(M({layerType:a},t))}}),paint:t=>Tn({layer:n,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":t=>An(M({layerType:a},t))}})}})),e}function Dn(t){const e=t.value,n=t.key,r=De(e);return"string"!==r?[new xn(n,e,`string expected, ${r} found`)]:[]}const Gn={promoteId:function({key:t,value:e}){if("string"===De(e))return Dn({key:t,value:e});{const n=[];for(const r in e)n.push(...Dn({key:`${t}.${r}`,value:e[r]}));return n}}};function zn(t){const e=t.value,n=t.key,r=t.styleSpec,i=t.style;if(!e.type)return[new xn(n,e,'"type" is required')];const o=On(e.type);let a;switch(o){case"vector":case"raster":case"raster-dem":return a=Tn({key:n,value:e,valueSpec:r["source_"+o.replace("-","_")],style:t.style,styleSpec:r,objectElementValidators:Gn}),a;case"geojson":if(a=Tn({key:n,value:e,valueSpec:r.source_geojson,style:i,styleSpec:r,objectElementValidators:Gn}),e.cluster)for(const t in e.clusterProperties){const[r,i]=e.clusterProperties[t],o="string"==typeof r?[r,["accumulated"],["get",t]]:r;a.push(...Rn({key:`${n}.${t}.map`,value:i,expressionContext:"cluster-map"})),a.push(...Rn({key:`${n}.${t}.reduce`,value:o,expressionContext:"cluster-reduce"}))}return a;case"video":return Tn({key:n,value:e,valueSpec:r.source_video,style:i,styleSpec:r});case"image":return Tn({key:n,value:e,valueSpec:r.source_image,style:i,styleSpec:r});case"canvas":return[new xn(n,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Mn({key:n+".type",value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:i,styleSpec:r})}}function Un(t){const e=t.value,n=t.styleSpec,r=n.light,i=t.style;let o=[];const a=De(e);if(void 0===e)return o;if("object"!==a)return o=o.concat([new xn("light",e,`object expected, ${a} found`)]),o;for(const t in e){const a=t.match(/^(.*)-transition$/);o=a&&r[a[1]]&&r[a[1]].transition?o.concat(Yn({key:t,value:e[t],valueSpec:n.transition,style:i,styleSpec:n})):r[t]?o.concat(Yn({key:t,value:e[t],valueSpec:r[t],style:i,styleSpec:n})):o.concat([new xn(t,e[t],`unknown property "${t}"`)])}return o}function Bn(t){const e=t.value,n=t.key,r=t.style,i=t.styleSpec,o=i.terrain;let a=[];const s=De(e);if(void 0===e)return a;if("object"!==s)return a=a.concat([new xn("terrain",e,`object expected, ${s} found`)]),a;for(const t in e){const n=t.match(/^(.*)-transition$/);a=n&&o[n[1]]&&o[n[1]].transition?a.concat(Yn({key:t,value:e[t],valueSpec:i.transition,style:r,styleSpec:i})):o[t]?a.concat(Yn({key:t,value:e[t],valueSpec:o[t],style:r,styleSpec:i})):a.concat([new xn(t,e[t],`unknown property "${t}"`)])}if(e.source){const t=r.sources&&r.sources[e.source],i=t&&On(t.type);t?"raster-dem"!==i&&a.push(new xn(n,e.source,`terrain cannot be used with a source of type ${i}, it only be used with a "raster-dem" source type`)):a.push(new xn(n,e.source,`source "${e.source}" not found`))}else a.push(new xn(n,e,'terrain is missing required property "source"'));return a}function Vn(t){const e=t.value,n=t.style,r=t.styleSpec,i=r.fog;let o=[];const a=De(e);if(void 0===e)return o;if("object"!==a)return o=o.concat([new xn("fog",e,`object expected, ${a} found`)]),o;for(const t in e){const a=t.match(/^(.*)-transition$/);o=a&&i[a[1]]&&i[a[1]].transition?o.concat(Yn({key:t,value:e[t],valueSpec:r.transition,style:n,styleSpec:r})):i[t]?o.concat(Yn({key:t,value:e[t],valueSpec:i[t],style:n,styleSpec:r})):o.concat([new xn(t,e[t],`unknown property "${t}"`)])}return o}const qn={"*":()=>[],array:In,boolean:function(t){const e=t.value,n=t.key,r=De(e);return"boolean"!==r?[new xn(n,e,`boolean expected, ${r} found`)]:[]},number:Ln,color:function(t){const e=t.key,n=t.value,r=De(n);return"string"!==r?[new xn(e,n,`color expected, ${r} found`)]:null===$.parseCSSColor(n)?[new xn(e,n,`color expected, "${n}" found`)]:[]},constants:Sn,enum:Mn,filter:Nn,function:Pn,layer:Fn,object:Tn,source:zn,light:Un,terrain:Bn,fog:Vn,string:Dn,formatted:function(t){return 0===Dn(t).length?[]:Rn(t)},resolvedImage:function(t){return 0===Dn(t).length?[]:Rn(t)}};function Yn(t){const e=t.value,n=t.valueSpec,r=t.styleSpec;if(n.expression&&Ge(On(e)))return Pn(t);if(n.expression&&He(Cn(e)))return Rn(t);if(n.type&&qn[n.type])return qn[n.type](t);return Tn(M({},t,{valueSpec:n.type?r[n.type]:n}))}function Xn(t){const e=t.value,n=t.key,r=Dn(t);return r.length||(-1===e.indexOf("{fontstack}")&&r.push(new xn(n,e,'"glyphs" url must include a "{fontstack}" token')),-1===e.indexOf("{range}")&&r.push(new xn(n,e,'"glyphs" url must include a "{range}" token'))),r}function Wn(t,e=i){let n=[];return n=n.concat(Yn({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,objectElementValidators:{glyphs:Xn,"*":()=>[]}})),t.constants&&(n=n.concat(Sn({key:"constants",value:t.constants,style:t,styleSpec:e}))),Hn(n)}function Hn(t){return[].concat(t).sort((t,e)=>t.line-e.line)}function Kn(t){return function(...e){return Hn(t.apply(this,e))}}Wn.source=Kn(zn),Wn.light=Kn(Un),Wn.terrain=Kn(Bn),Wn.fog=Kn(Vn),Wn.layer=Kn(Fn),Wn.filter=Kn(Nn),Wn.paintProperty=Kn(An),Wn.layoutProperty=Kn(kn);var Zn=a((function(t,e){var n=function(){var t=function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n},e=[1,12],n=[1,13],r=[1,9],i=[1,10],o=[1,11],a=[1,14],s=[1,15],l=[14,18,22,24],u=[18,22],c=[22,24],h={trace:function(){},yy:{},symbols_:{error:2,JSONString:3,STRING:4,JSONNumber:5,NUMBER:6,JSONNullLiteral:7,NULL:8,JSONBooleanLiteral:9,TRUE:10,FALSE:11,JSONText:12,JSONValue:13,EOF:14,JSONObject:15,JSONArray:16,"{":17,"}":18,JSONMemberList:19,JSONMember:20,":":21,",":22,"[":23,"]":24,JSONElementList:25,$accept:0,$end:1},terminals_:{2:"error",4:"STRING",6:"NUMBER",8:"NULL",10:"TRUE",11:"FALSE",14:"EOF",17:"{",18:"}",21:":",22:",",23:"[",24:"]"},productions_:[0,[3,1],[5,1],[7,1],[9,1],[9,1],[12,2],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[15,2],[15,3],[20,3],[19,1],[19,3],[16,2],[16,3],[25,1],[25,3]],performAction:function(t,e,n,r,i,o,a){var s=o.length-1;switch(i){case 1:this.$=new String(t.replace(/\\(\\|")/g,"$1").replace(/\\n/g,"\n").replace(/\\r/g,"\r").replace(/\\t/g,"\t").replace(/\\v/g,"\v").replace(/\\f/g,"\f").replace(/\\b/g,"\b")),this.$.__line__=this._$.first_line;break;case 2:this.$=new Number(t),this.$.__line__=this._$.first_line;break;case 3:this.$=null;break;case 4:this.$=new Boolean(!0),this.$.__line__=this._$.first_line;break;case 5:this.$=new Boolean(!1),this.$.__line__=this._$.first_line;break;case 6:return this.$=o[s-1];case 13:this.$={},Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 14:case 19:this.$=o[s-1],Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 15:this.$=[o[s-2],o[s]];break;case 16:this.$={},this.$[o[s][0]]=o[s][1];break;case 17:this.$=o[s-2],o[s-2][o[s][0]]=o[s][1];break;case 18:this.$=[],Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 20:this.$=[o[s]];break;case 21:this.$=o[s-2],o[s-2].push(o[s])}},table:[{3:5,4:e,5:6,6:n,7:3,8:r,9:4,10:i,11:o,12:1,13:2,15:7,16:8,17:a,23:s},{1:[3]},{14:[1,16]},t(l,[2,7]),t(l,[2,8]),t(l,[2,9]),t(l,[2,10]),t(l,[2,11]),t(l,[2,12]),t(l,[2,3]),t(l,[2,4]),t(l,[2,5]),t([14,18,21,22,24],[2,1]),t(l,[2,2]),{3:20,4:e,18:[1,17],19:18,20:19},{3:5,4:e,5:6,6:n,7:3,8:r,9:4,10:i,11:o,13:23,15:7,16:8,17:a,23:s,24:[1,21],25:22},{1:[2,6]},t(l,[2,13]),{18:[1,24],22:[1,25]},t(u,[2,16]),{21:[1,26]},t(l,[2,18]),{22:[1,28],24:[1,27]},t(c,[2,20]),t(l,[2,14]),{3:20,4:e,20:29},{3:5,4:e,5:6,6:n,7:3,8:r,9:4,10:i,11:o,13:30,15:7,16:8,17:a,23:s},t(l,[2,19]),{3:5,4:e,5:6,6:n,7:3,8:r,9:4,10:i,11:o,13:31,15:7,16:8,17:a,23:s},t(u,[2,17]),t(u,[2,15]),t(c,[2,21])],defaultActions:{16:[2,6]},parseError:function(t,e){if(!e.recoverable)throw new Error(t);this.trace(t)},parse:function(t){var e=this,n=[0],r=[null],i=[],o=this.table,a="",s=0,l=0,u=2,c=1,h=i.slice.call(arguments,1),p=Object.create(this.lexer),d={yy:{}};for(var f in this.yy)Object.prototype.hasOwnProperty.call(this.yy,f)&&(d.yy[f]=this.yy[f]);p.setInput(t,d.yy),d.yy.lexer=p,d.yy.parser=this,void 0===p.yylloc&&(p.yylloc={});var g=p.yylloc;i.push(g);var y=p.options&&p.options.ranges;function m(){var t;return"number"!=typeof(t=p.lex()||c)&&(t=e.symbols_[t]||t),t}"function"==typeof d.yy.parseError?this.parseError=d.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var v,_,b,w,x,E,S,O,C={};;){if(_=n[n.length-1],this.defaultActions[_]?b=this.defaultActions[_]:(null==v&&(v=m()),b=o[_]&&o[_][v]),void 0===b||!b.length||!b[0]){var T="";for(x in O=[],o[_])this.terminals_[x]&&x>u&&O.push("'"+this.terminals_[x]+"'");T=p.showPosition?"Parse error on line "+(s+1)+":\n"+p.showPosition()+"\nExpecting "+O.join(", ")+", got '"+(this.terminals_[v]||v)+"'":"Parse error on line "+(s+1)+": Unexpected "+(v==c?"end of input":"'"+(this.terminals_[v]||v)+"'"),this.parseError(T,{text:p.match,token:this.terminals_[v]||v,line:p.yylineno,loc:g,expected:O})}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+_+", token: "+v);switch(b[0]){case 1:n.push(v),r.push(p.yytext),i.push(p.yylloc),n.push(b[1]),v=null,l=p.yyleng,a=p.yytext,s=p.yylineno,g=p.yylloc;break;case 2:if(E=this.productions_[b[1]][1],C.$=r[r.length-E],C._$={first_line:i[i.length-(E||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(E||1)].first_column,last_column:i[i.length-1].last_column},y&&(C._$.range=[i[i.length-(E||1)].range[0],i[i.length-1].range[1]]),void 0!==(w=this.performAction.apply(C,[a,l,s,d.yy,b[1],r,i].concat(h))))return w;E&&(n=n.slice(0,-1*E*2),r=r.slice(0,-1*E),i=i.slice(0,-1*E)),n.push(this.productions_[b[1]][0]),r.push(C.$),i.push(C._$),S=o[n[n.length-2]][n[n.length-1]],n.push(S);break;case 3:return!0}}return!0}},p={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),(r=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var o in i)this[o]=i[o];return!1}return!1},next:function(){if(this.done)return this.EOF;var t,e,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),o=0;o<i.length;o++)if((n=this._input.match(this.rules[i[o]]))&&(!e||n[0].length>e[0].length)){if(e=n,r=o,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,i[o])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(t,e,n,r){switch(n){case 0:break;case 1:return 6;case 2:return e.yytext=e.yytext.substr(1,e.yyleng-2),4;case 3:return 17;case 4:return 18;case 5:return 23;case 6:return 24;case 7:return 22;case 8:return 21;case 9:return 10;case 10:return 11;case 11:return 8;case 12:return 14;case 13:return"INVALID"}},rules:[/^(?:\s+)/,/^(?:(-?([0-9]|[1-9][0-9]+))(\.[0-9]+)?([eE][-+]?[0-9]+)?\b)/,/^(?:"(?:\\[\\"bfnrt/]|\\u[a-fA-F0-9]{4}|[^\\\0-\x09\x0a-\x1f"])*")/,/^(?:\{)/,/^(?:\})/,/^(?:\[)/,/^(?:\])/,/^(?:,)/,/^(?::)/,/^(?:true\b)/,/^(?:false\b)/,/^(?:null\b)/,/^(?:$)/,/^(?:.)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13],inclusive:!0}}};function d(){this.yy={}}return h.lexer=p,d.prototype=h,h.Parser=d,new d}();void 0!==s&&(e.parser=n,e.Parser=n.Parser,e.parse=function(){return n.parse.apply(n,arguments)})}));function $n(t){if(t instanceof String||"string"==typeof t||t instanceof r)try{return Zn.parse(t.toString())}catch(t){throw new En(t)}return t}function Jn(t,e=i){let n=t;try{n=$n(n)}catch(t){return[t]}return Wn(n,e)}new Set(["vector","raster","raster-dem"]);const Qn={StyleExpression:We,isExpression:He,isExpressionFilter:cn,createExpression:Ke,createPropertyExpression:Je,normalizePropertyExpression:function(t,e){if(Ge(t))return new Qe(t,e);if(He(t)){const n=Je(t,e);if("error"===n.result)throw new Error(n.value.map(t=>`${t.key}: ${t.message}`).join(", "));return n.value}{let n=t;return"string"==typeof t&&"color"===e.type&&(n=J.parse(t)),{kind:"constant",evaluate:()=>n}}},ZoomConstantExpression:Ze,ZoomDependentExpression:$e,StylePropertyFunction:Qe},tr={convertFunction:en,createFunction:Ue,isFunction:Ge};Jn.parsed=Jn,Jn.latest=Jn}).call(this,n(216),n(249).Buffer)},function(t,e,n){"use strict";var r,i=n(79),o=n(120),a=n(6),s=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),l=function(t){function e(e){var n=this,r=e||{},i=Object(a.a)({},r);return delete i.preload,delete i.useInterimTilesOnError,(n=t.call(this,i)||this).on,n.once,n.un,n.setPreload(void 0!==r.preload?r.preload:0),n.setUseInterimTilesOnError(void 0===r.useInterimTilesOnError||r.useInterimTilesOnError),n}return s(e,t),e.prototype.getPreload=function(){return this.get(o.a.PRELOAD)},e.prototype.setPreload=function(t){this.set(o.a.PRELOAD,t)},e.prototype.getUseInterimTilesOnError=function(){return this.get(o.a.USE_INTERIM_TILES_ON_ERROR)},e.prototype.setUseInterimTilesOnError=function(t){this.set(o.a.USE_INTERIM_TILES_ON_ERROR,t)},e}(i.a),u=n(201),c=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),h=function(t){function e(e){return t.call(this,e)||this}return c(e,t),e.prototype.createRenderer=function(){return new u.a(this)},e}(l);e.a=h},function(t,e,n){"use strict";var r=function(){function t(){this.disposed=!1}return t.prototype.dispose=function(){this.disposed||(this.disposed=!0,this.disposeInternal())},t.prototype.disposeInternal=function(){},t}();e.a=r},function(t,e,n){"use strict";var r,i=n(19),o=n(1),a=n(72),s=n(192),l=n(92),u=n(0),c=n(17),h=n(7),p=n(75),d=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),f=function(t){function e(e,n,r,i){var o=t.call(this)||this;return o.tolerance=e,o.maxExtent=n,o.pixelRatio=i,o.maxLineWidth=0,o.resolution=r,o.beginGeometryInstruction1_=null,o.beginGeometryInstruction2_=null,o.bufferedMaxExtent_=null,o.instructions=[],o.coordinates=[],o.tmpCoordinate_=[],o.hitDetectionInstructions=[],o.state={},o}return d(e,t),e.prototype.applyPixelRatio=function(t){var e=this.pixelRatio;return 1==e?t:t.map((function(t){return t*e}))},e.prototype.appendFlatPointCoordinates=function(t,e){for(var n=this.getBufferedMaxExtent(),r=this.tmpCoordinate_,i=this.coordinates,o=i.length,a=0,s=t.length;a<s;a+=e)r[0]=t[a],r[1]=t[a+1],Object(u.containsCoordinate)(n,r)&&(i[o++]=r[0],i[o++]=r[1]);return o},e.prototype.appendFlatLineCoordinates=function(t,e,n,r,i,o){var s=this.coordinates,l=s.length,c=this.getBufferedMaxExtent();o&&(e+=r);var h,p,d,f=t[e],g=t[e+1],y=this.tmpCoordinate_,m=!0;for(h=e+r;h<n;h+=r)y[0]=t[h],y[1]=t[h+1],(d=Object(u.coordinateRelationship)(c,y))!==p?(m&&(s[l++]=f,s[l++]=g,m=!1),s[l++]=y[0],s[l++]=y[1]):d===a.a.INTERSECTING?(s[l++]=y[0],s[l++]=y[1],m=!1):m=!0,f=y[0],g=y[1],p=d;return(i&&m||h===e+r)&&(s[l++]=f,s[l++]=g),l},e.prototype.drawCustomCoordinates_=function(t,e,n,r,i){for(var o=0,a=n.length;o<a;++o){var s=n[o],l=this.appendFlatLineCoordinates(t,e,s,r,!1,!1);i.push(l),e=s}return e},e.prototype.drawCustom=function(t,e,n){this.beginGeometry(t,e);var r,a,s,l,u,c=t.getType(),h=t.getStride(),d=this.coordinates.length;if(c==o.a.MULTI_POLYGON){r=t.getOrientedFlatCoordinates(),l=[];var f=t.getEndss();u=0;for(var g=0,y=f.length;g<y;++g){var m=[];u=this.drawCustomCoordinates_(r,u,f[g],h,m),l.push(m)}this.instructions.push([i.c.CUSTOM,d,l,t,n,p.c])}else c==o.a.POLYGON||c==o.a.MULTI_LINE_STRING?(s=[],r=c==o.a.POLYGON?t.getOrientedFlatCoordinates():t.getFlatCoordinates(),u=this.drawCustomCoordinates_(r,0,t.getEnds(),h,s),this.instructions.push([i.c.CUSTOM,d,s,t,n,p.b])):c==o.a.LINE_STRING||c==o.a.CIRCLE?(r=t.getFlatCoordinates(),a=this.appendFlatLineCoordinates(r,0,r.length,h,!1,!1),this.instructions.push([i.c.CUSTOM,d,a,t,n,p.a])):c==o.a.MULTI_POINT?(r=t.getFlatCoordinates(),(a=this.appendFlatPointCoordinates(r,h))>d&&this.instructions.push([i.c.CUSTOM,d,a,t,n,p.a])):c==o.a.POINT&&(r=t.getFlatCoordinates(),this.coordinates.push(r[0],r[1]),a=this.coordinates.length,this.instructions.push([i.c.CUSTOM,d,a,t,n]));this.endGeometry(e)},e.prototype.beginGeometry=function(t,e){this.beginGeometryInstruction1_=[i.c.BEGIN_GEOMETRY,e,0,t],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[i.c.BEGIN_GEOMETRY,e,0,t],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)},e.prototype.finish=function(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}},e.prototype.reverseHitDetectionInstructions=function(){var t,e=this.hitDetectionInstructions;e.reverse();var n,r,o=e.length,a=-1;for(t=0;t<o;++t)(r=(n=e[t])[0])==i.c.END_GEOMETRY?a=t:r==i.c.BEGIN_GEOMETRY&&(n[2]=t,Object(h.j)(this.hitDetectionInstructions,a,t),a=-1)},e.prototype.setFillStrokeStyle=function(t,e){var n=this.state;if(t){var r=t.getColor();n.fillStyle=Object(l.a)(r||c.b)}else n.fillStyle=void 0;if(e){var i=e.getColor();n.strokeStyle=Object(l.a)(i||c.k);var o=e.getLineCap();n.lineCap=void 0!==o?o:c.d;var a=e.getLineDash();n.lineDash=a?a.slice():c.e;var s=e.getLineDashOffset();n.lineDashOffset=s||c.f;var u=e.getLineJoin();n.lineJoin=void 0!==u?u:c.g;var h=e.getWidth();n.lineWidth=void 0!==h?h:c.h;var p=e.getMiterLimit();n.miterLimit=void 0!==p?p:c.i,n.lineWidth>this.maxLineWidth&&(this.maxLineWidth=n.lineWidth,this.bufferedMaxExtent_=null)}else n.strokeStyle=void 0,n.lineCap=void 0,n.lineDash=null,n.lineDashOffset=void 0,n.lineJoin=void 0,n.lineWidth=void 0,n.miterLimit=void 0},e.prototype.createFill=function(t){var e=t.fillStyle,n=[i.c.SET_FILL_STYLE,e];return"string"!=typeof e&&n.push(!0),n},e.prototype.applyStroke=function(t){this.instructions.push(this.createStroke(t))},e.prototype.createStroke=function(t){return[i.c.SET_STROKE_STYLE,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio]},e.prototype.updateFillStyle=function(t,e){var n=t.fillStyle;"string"==typeof n&&t.currentFillStyle==n||(void 0!==n&&this.instructions.push(e.call(this,t)),t.currentFillStyle=n)},e.prototype.updateStrokeStyle=function(t,e){var n=t.strokeStyle,r=t.lineCap,i=t.lineDash,o=t.lineDashOffset,a=t.lineJoin,s=t.lineWidth,l=t.miterLimit;(t.currentStrokeStyle!=n||t.currentLineCap!=r||i!=t.currentLineDash&&!Object(h.b)(t.currentLineDash,i)||t.currentLineDashOffset!=o||t.currentLineJoin!=a||t.currentLineWidth!=s||t.currentMiterLimit!=l)&&(void 0!==n&&e.call(this,t),t.currentStrokeStyle=n,t.currentLineCap=r,t.currentLineDash=i,t.currentLineDashOffset=o,t.currentLineJoin=a,t.currentLineWidth=s,t.currentMiterLimit=l)},e.prototype.endGeometry=function(t){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;var e=[i.c.END_GEOMETRY,t];this.instructions.push(e),this.hitDetectionInstructions.push(e)},e.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=Object(u.clone)(this.maxExtent),this.maxLineWidth>0)){var t=this.resolution*(this.maxLineWidth+1)/2;Object(u.buffer)(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_},e}(s.a);e.a=f},function(t,e,n){"use strict";var r,i=n(98),o=n(9),a=n(15),s=n(4),l=n(74),u=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),c=function(t){function e(e,n,r){var i=t.call(this)||this,o=r||{};return i.tileCoord=e,i.state=n,i.interimTile=null,i.key="",i.transition_=void 0===o.transition?250:o.transition,i.transitionStarts_={},i}return u(e,t),e.prototype.changed=function(){this.dispatchEvent(o.a.CHANGE)},e.prototype.release=function(){},e.prototype.getKey=function(){return this.key+"/"+this.tileCoord},e.prototype.getInterimTile=function(){if(!this.interimTile)return this;var t=this.interimTile;do{if(t.getState()==a.a.LOADED)return this.transition_=0,t;t=t.interimTile}while(t);return this},e.prototype.refreshInterimChain=function(){if(this.interimTile){var t=this.interimTile,e=this;do{if(t.getState()==a.a.LOADED){t.interimTile=null;break}t.getState()==a.a.LOADING?e=t:t.getState()==a.a.IDLE?e.interimTile=t.interimTile:e=t,t=e.interimTile}while(t)}},e.prototype.getTileCoord=function(){return this.tileCoord},e.prototype.getState=function(){return this.state},e.prototype.setState=function(t){if(this.state!==a.a.ERROR&&this.state>t)throw new Error("Tile load sequence violation");this.state=t,this.changed()},e.prototype.load=function(){Object(s.b)()},e.prototype.getAlpha=function(t,e){if(!this.transition_)return 1;var n=this.transitionStarts_[t];if(n){if(-1===n)return 1}else n=e,this.transitionStarts_[t]=n;var r=e-n+1e3/60;return r>=this.transition_?1:Object(l.a)(r/this.transition_)},e.prototype.inTransition=function(t){return!!this.transition_&&-1!==this.transitionStarts_[t]},e.prototype.endTransition=function(t){this.transition_&&(this.transitionStarts_[t]=-1)},e}(i.a);e.a=c},function(t,e,n){"use strict";var r,i=n(16),o=n(1),a=n(62),s=n(89),l=n(0),u=n(77),c=n(100),h=n(75),p=n(155),d=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),f=function(t){function e(e,n){var r=t.call(this)||this;return r.maxDelta_=-1,r.maxDeltaRevision_=-1,void 0===n||Array.isArray(e[0])?r.setCoordinates(e,n):r.setFlatCoordinates(n,e),r}return d(e,t),e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),this.layout)},e.prototype.closestPointXY=function(t,e,n,r){return r<Object(l.closestSquaredDistanceXY)(this.getExtent(),t,e)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Object(s.e)(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Object(s.d)(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,t,e,n,r))},e.prototype.getArea=function(){return Object(p.a)(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getCoordinates=function(){return Object(h.a)(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getSimplifiedGeometryInternal=function(t){var n=[];return n.length=Object(c.a)(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,n,0),new e(n,i.a.XY)},e.prototype.getType=function(){return o.a.LINEAR_RING},e.prototype.intersectsExtent=function(t){return!1},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Object(u.b)(this.flatCoordinates,0,t,this.stride),this.changed()},e}(a.a);e.a=f},function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"d",(function(){return a})),n.d(e,"b",(function(){return s}));var r=n(60);function i(t,e,n){if(null!==t)for(var r,o,a,s,l,u,c,h,p=0,d=0,f=t.type,g="FeatureCollection"===f,y="Feature"===f,m=g?t.features.length:1,v=0;v<m;v++){l=(h=!!(c=g?t.features[v].geometry:y?t.geometry:t)&&"GeometryCollection"===c.type)?c.geometries.length:1;for(var _=0;_<l;_++){var b=0,w=0;if(null!==(s=h?c.geometries[_]:c)){u=s.coordinates;var x=s.type;switch(p=!n||"Polygon"!==x&&"MultiPolygon"!==x?0:1,x){case null:break;case"Point":e(u,d,v,b,w),d++,b++;break;case"LineString":case"MultiPoint":for(r=0;r<u.length;r++)e(u[r],d,v,b,w),d++,"MultiPoint"===x&&b++;"LineString"===x&&b++;break;case"Polygon":case"MultiLineString":for(r=0;r<u.length;r++){for(o=0;o<u[r].length-p;o++)e(u[r][o],d,v,b,w),d++;"MultiLineString"===x&&b++,"Polygon"===x&&w++}"Polygon"===x&&b++;break;case"MultiPolygon":for(r=0;r<u.length;r++){for("MultiPolygon"===x&&(w=0),o=0;o<u[r].length;o++){for(a=0;a<u[r][o].length-p;a++)e(u[r][o][a],d,v,b,w),d++;w++}b++}break;case"GeometryCollection":for(r=0;r<s.geometries.length;r++)i(s.geometries[r],e,n);break;default:throw new Error("Unknown Geometry Type")}}}}}function o(t,e){var n,r,i,o,a,s,l,u,c,h,p=0,d="FeatureCollection"===t.type,f="Feature"===t.type,g=d?t.features.length:1;for(n=0;n<g;n++){for(s=d?t.features[n].geometry:f?t.geometry:t,u=d?t.features[n].properties:f?t.properties:{},c=d?t.features[n].bbox:f?t.bbox:void 0,h=d?t.features[n].id:f?t.id:void 0,a=(l=!!s&&"GeometryCollection"===s.type)?s.geometries.length:1,i=0;i<a;i++)if(null!==(o=l?s.geometries[i]:s))switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":e(o,p,u,c,h);break;case"GeometryCollection":for(r=0;r<o.geometries.length;r++)e(o.geometries[r],p,u,c,h);break;default:throw new Error("Unknown Geometry Type")}else e(null,p,u,c,h);p++}}function a(t,e,n){var r=n;return o(t,(function(t,i,o,a,s){r=0===i&&void 0===n?t:e(r,t,i,o,a,s)})),r}function s(t,e){o(t,(function(t,n,i,o,a){var s,l=null===t?null:t.type;switch(l){case null:case"Point":case"LineString":case"Polygon":return void e(Object(r.a)(t,i,{bbox:o,id:a}),n,0)}switch(l){case"MultiPoint":s="Point";break;case"MultiLineString":s="LineString";break;case"MultiPolygon":s="Polygon"}t.coordinates.forEach((function(t,o){var a={type:s,coordinates:t};e(Object(r.a)(a,i),n,o)}))}))}},function(t,e,n){"use strict";n.d(e,"b",(function(){return p})),n.d(e,"a",(function(){return d})),n.d(e,"c",(function(){return f}));var r,i=n(84),o=n(6),a=n(0),s=n(25),l=n(2),u=n(8);function c(t,e,n,r,i){t.beginPath(),t.moveTo(0,0),t.lineTo(e,n),t.lineTo(r,i),t.closePath(),t.save(),t.clip(),t.fillRect(0,0,Math.max(e,r)+1,Math.max(n,i)),t.restore()}function h(t,e){return Math.abs(t[4*e]-210)>2||Math.abs(t[4*e+3]-191.25)>2}function p(t,e,n,r){var i=Object(l.transform)(n,e,t),o=Object(l.getPointResolution)(e,r,n),s=e.getMetersPerUnit();void 0!==s&&(o*=s);var u=t.getMetersPerUnit();void 0!==u&&(o/=u);var c=t.getExtent();if(!c||Object(a.containsCoordinate)(c,i)){var h=Object(l.getPointResolution)(t,o,i)/o;isFinite(h)&&h>0&&(o/=h)}return o}function d(t,e,n,r){var i=Object(a.getCenter)(n),o=p(t,e,i,r);return(!isFinite(o)||o<=0)&&Object(a.forEachCorner)(n,(function(n){return o=p(t,e,n,r),isFinite(o)&&o>0})),o}function f(t,e,n,l,p,d,f,g,y,m,v,_){var b=Object(s.a)(Math.round(n*t),Math.round(n*e));if(Object(o.a)(b,_),0===y.length)return b.canvas;function w(t){return Math.round(t*n)/n}b.scale(n,n),b.globalCompositeOperation="lighter";var x=Object(a.createEmpty)();y.forEach((function(t,e,n){Object(a.extend)(x,t.extent)}));var E=Object(a.getWidth)(x),S=Object(a.getHeight)(x),O=Object(s.a)(Math.round(n*E/l),Math.round(n*S/l));Object(o.a)(O,_);var C=n/l;y.forEach((function(t,e,n){var r=t.extent[0]-x[0],i=-(t.extent[3]-x[3]),o=Object(a.getWidth)(t.extent),s=Object(a.getHeight)(t.extent);t.image.width>0&&t.image.height>0&&O.drawImage(t.image,m,m,t.image.width-2*m,t.image.height-2*m,r*C,i*C,o*C,s*C)}));var T=Object(a.getTopLeft)(f);return g.getTriangles().forEach((function(t,e,o){var a=t.source,s=t.target,p=a[0][0],f=a[0][1],g=a[1][0],y=a[1][1],m=a[2][0],v=a[2][1],E=w((s[0][0]-T[0])/d),S=w(-(s[0][1]-T[1])/d),C=w((s[1][0]-T[0])/d),I=w(-(s[1][1]-T[1])/d),L=w((s[2][0]-T[0])/d),P=w(-(s[2][1]-T[1])/d),R=p,M=f;p=0,f=0;var N=[[g-=R,y-=M,0,0,C-E],[m-=R,v-=M,0,0,L-E],[0,0,g,y,I-S],[0,0,m,v,P-S]],j=Object(u.f)(N);if(j){if(b.save(),b.beginPath(),function(){if(void 0===r){var t=document.createElement("canvas").getContext("2d");t.globalCompositeOperation="lighter",t.fillStyle="rgba(210, 0, 0, 0.75)",c(t,4,5,4,0),c(t,4,5,0,5);var e=t.getImageData(0,0,3,3).data;r=h(e,0)||h(e,4)||h(e,8)}return r}()||_===i.b){b.moveTo(C,I);for(var A=E-C,k=S-I,F=0;F<4;F++)b.lineTo(C+w((F+1)*A/4),I+w(F*k/3)),3!=F&&b.lineTo(C+w((F+1)*A/4),I+w((F+1)*k/3));b.lineTo(L,P)}else b.moveTo(C,I),b.lineTo(E,S),b.lineTo(L,P);b.clip(),b.transform(j[0],j[2],j[1],j[3],E,S),b.translate(x[0]-R,x[3]-M),b.scale(l/n,-l/n),b.drawImage(O.canvas,0,0),b.restore()}})),v&&(b.save(),b.globalCompositeOperation="source-over",b.strokeStyle="black",b.lineWidth=1,g.getTriangles().forEach((function(t,e,n){var r=t.target,i=(r[0][0]-T[0])/d,o=-(r[0][1]-T[1])/d,a=(r[1][0]-T[0])/d,s=-(r[1][1]-T[1])/d,l=(r[2][0]-T[0])/d,u=-(r[2][1]-T[1])/d;b.beginPath(),b.moveTo(a,s),b.lineTo(i,o),b.lineTo(l,u),b.closePath(),b.stroke()})),b.restore()),b.canvas}},function(t,e,n){"use strict";e.a={POSTRENDER:"postrender",MOVESTART:"movestart",MOVEEND:"moveend"}},function(t,e,n){"use strict";n.d(e,"c",(function(){return i})),n.d(e,"d",(function(){return o})),n.d(e,"a",(function(){return a})),n.d(e,"b",(function(){return s}));var r=n(8);function i(t){return void 0!==t?0:void 0}function o(t){return void 0!==t?t:void 0}function a(t){var e=2*Math.PI/t;return function(t,n){return n?t:void 0!==t?t=Math.floor(t/e+.5)*e:void 0}}function s(t){var e=t||Object(r.j)(5);return function(t,n){return n?t:void 0!==t?Math.abs(t)<=e?0:t:void 0}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=function(){function t(t,e,n,r){this.minX=t,this.maxX=e,this.minY=n,this.maxY=r}return t.prototype.contains=function(t){return this.containsXY(t[1],t[2])},t.prototype.containsTileRange=function(t){return this.minX<=t.minX&&t.maxX<=this.maxX&&this.minY<=t.minY&&t.maxY<=this.maxY},t.prototype.containsXY=function(t,e){return this.minX<=t&&t<=this.maxX&&this.minY<=e&&e<=this.maxY},t.prototype.equals=function(t){return this.minX==t.minX&&this.minY==t.minY&&this.maxX==t.maxX&&this.maxY==t.maxY},t.prototype.extend=function(t){t.minX<this.minX&&(this.minX=t.minX),t.maxX>this.maxX&&(this.maxX=t.maxX),t.minY<this.minY&&(this.minY=t.minY),t.maxY>this.maxY&&(this.maxY=t.maxY)},t.prototype.getHeight=function(){return this.maxY-this.minY+1},t.prototype.getSize=function(){return[this.getWidth(),this.getHeight()]},t.prototype.getWidth=function(){return this.maxX-this.minX+1},t.prototype.intersects=function(t){return this.minX<=t.maxX&&this.maxX>=t.minX&&this.minY<=t.maxY&&this.maxY>=t.minY},t}();function i(t,e,n,i,o){return void 0!==o?(o.minX=t,o.maxX=e,o.minY=n,o.maxY=i,o):new r(t,e,n,i)}e.b=r},function(t,e,n){"use strict";e.a={PRELOAD:"preload",USE_INTERIM_TILES_ON_ERROR:"useInterimTilesOnError"}},function(t,e,n){"use strict";n.d(e,"a",(function(){return y}));var r,i=n(40),o=n(108),a=n(161),s=n(15),l=n(4),u=n(13),c=n(2),h=n(48),p=n(55),d=n(35),f=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),g=function(t){function e(e){var n=t.call(this,{attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,projection:e.projection,state:e.state,wrapX:e.wrapX})||this;n.on,n.once,n.un,n.opaque_=void 0!==e.opaque&&e.opaque,n.tilePixelRatio_=void 0!==e.tilePixelRatio?e.tilePixelRatio:1,n.tileGrid=void 0!==e.tileGrid?e.tileGrid:null;var r=e.tileGrid;return r&&Object(d.d)(r.getTileSize(r.getMinZoom()),[256,256]),n.tileCache=new a.a(e.cacheSize||0),n.tmpSize=[0,0],n.key_=e.key||"",n.tileOptions={transition:e.transition},n.zDirection=e.zDirection?e.zDirection:0,n}return f(e,t),e.prototype.canExpireCache=function(){return this.tileCache.canExpireCache()},e.prototype.expireCache=function(t,e){var n=this.getTileCacheForProjection(t);n&&n.expireCache(e)},e.prototype.forEachLoadedTile=function(t,e,n,r){var i=this.getTileCacheForProjection(t);if(!i)return!1;for(var o,a,l,u=!0,c=n.minX;c<=n.maxX;++c)for(var p=n.minY;p<=n.maxY;++p)a=Object(h.e)(e,c,p),l=!1,i.containsKey(a)&&(l=(o=i.get(a)).getState()===s.a.LOADED)&&(l=!1!==r(o)),l||(u=!1);return u},e.prototype.getGutterForProjection=function(t){return 0},e.prototype.getKey=function(){return this.key_},e.prototype.setKey=function(t){this.key_!==t&&(this.key_=t,this.changed())},e.prototype.getOpaque=function(t){return this.opaque_},e.prototype.getResolutions=function(){return this.tileGrid.getResolutions()},e.prototype.getTile=function(t,e,n,r,i){return Object(l.b)()},e.prototype.getTileGrid=function(){return this.tileGrid},e.prototype.getTileGridForProjection=function(t){return this.tileGrid?this.tileGrid:Object(p.getForProjection)(t)},e.prototype.getTileCacheForProjection=function(t){return Object(u.a)(Object(c.equivalent)(this.getProjection(),t),68),this.tileCache},e.prototype.getTilePixelRatio=function(t){return this.tilePixelRatio_},e.prototype.getTilePixelSize=function(t,e,n){var r=this.getTileGridForProjection(n),i=this.getTilePixelRatio(e),o=Object(d.d)(r.getTileSize(t),this.tmpSize);return 1==i?o:Object(d.c)(o,i,this.tmpSize)},e.prototype.getTileCoordForTileUrlFunction=function(t,e){var n=void 0!==e?e:this.getProjection(),r=this.getTileGridForProjection(n);return this.getWrapX()&&n.isGlobal()&&(t=Object(p.wrapX)(r,t,n)),Object(h.g)(t,r)?t:null},e.prototype.clear=function(){this.tileCache.clear()},e.prototype.refresh=function(){this.clear(),t.prototype.refresh.call(this)},e.prototype.updateCacheSize=function(t,e){var n=this.getTileCacheForProjection(e);t>n.highWaterMark&&(n.highWaterMark=t)},e.prototype.useTile=function(t,e,n,r){},e}(o.a),y=function(t){function e(e,n){var r=t.call(this,e)||this;return r.tile=n,r}return f(e,t),e}(i.a);e.b=g},function(t,e,n){"use strict";var r,i=n(9),o=n(71),a=n(67),s=n(23),l=n(145),u=n(88),c=n(13),h=n(183),p=n(4),d=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),f=function(t){function e(e){var n=this,r=e||{},i=void 0!==r.opacity?r.opacity:1,l=void 0!==r.rotation?r.rotation:0,d=void 0!==r.scale?r.scale:1,f=void 0!==r.rotateWithView&&r.rotateWithView;(n=t.call(this,{opacity:i,rotation:l,scale:d,displacement:void 0!==r.displacement?r.displacement:[0,0],rotateWithView:f})||this).anchor_=void 0!==r.anchor?r.anchor:[.5,.5],n.normalizedAnchor_=null,n.anchorOrigin_=void 0!==r.anchorOrigin?r.anchorOrigin:a.a.TOP_LEFT,n.anchorXUnits_=void 0!==r.anchorXUnits?r.anchorXUnits:o.a.FRACTION,n.anchorYUnits_=void 0!==r.anchorYUnits?r.anchorYUnits:o.a.FRACTION,n.crossOrigin_=void 0!==r.crossOrigin?r.crossOrigin:null;var g=void 0!==r.img?r.img:null,y=void 0!==r.imgSize?r.imgSize:null,m=r.src;Object(c.a)(!(void 0!==m&&g),4),Object(c.a)(!g||g&&y,5),void 0!==m&&0!==m.length||!g||(m=g.src||Object(p.c)(g)),Object(c.a)(void 0!==m&&m.length>0,6);var v=void 0!==r.src?s.a.IDLE:s.a.LOADED;return n.color_=void 0!==r.color?Object(u.a)(r.color):null,n.iconImage_=Object(h.b)(g,m,y,n.crossOrigin_,v,n.color_),n.offset_=void 0!==r.offset?r.offset:[0,0],n.offsetOrigin_=void 0!==r.offsetOrigin?r.offsetOrigin:a.a.TOP_LEFT,n.origin_=null,n.size_=void 0!==r.size?r.size:null,n}return d(e,t),e.prototype.clone=function(){var t=this.getScale();return new e({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,crossOrigin:this.crossOrigin_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,src:this.getSrc(),offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,size:null!==this.size_?this.size_.slice():void 0,opacity:this.getOpacity(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView()})},e.prototype.getAnchor=function(){if(this.normalizedAnchor_)return this.normalizedAnchor_;var t=this.anchor_,e=this.getSize();if(this.anchorXUnits_==o.a.FRACTION||this.anchorYUnits_==o.a.FRACTION){if(!e)return null;t=this.anchor_.slice(),this.anchorXUnits_==o.a.FRACTION&&(t[0]*=e[0]),this.anchorYUnits_==o.a.FRACTION&&(t[1]*=e[1])}if(this.anchorOrigin_!=a.a.TOP_LEFT){if(!e)return null;t===this.anchor_&&(t=this.anchor_.slice()),this.anchorOrigin_!=a.a.TOP_RIGHT&&this.anchorOrigin_!=a.a.BOTTOM_RIGHT||(t[0]=-t[0]+e[0]),this.anchorOrigin_!=a.a.BOTTOM_LEFT&&this.anchorOrigin_!=a.a.BOTTOM_RIGHT||(t[1]=-t[1]+e[1])}var n=this.getDisplacement();return t[0]-=n[0],t[1]+=n[1],this.normalizedAnchor_=t,this.normalizedAnchor_},e.prototype.setAnchor=function(t){this.anchor_=t,this.normalizedAnchor_=null},e.prototype.getColor=function(){return this.color_},e.prototype.getImage=function(t){return this.iconImage_.getImage(t)},e.prototype.getPixelRatio=function(t){return this.iconImage_.getPixelRatio(t)},e.prototype.getImageSize=function(){return this.iconImage_.getSize()},e.prototype.getImageState=function(){return this.iconImage_.getImageState()},e.prototype.getHitDetectionImage=function(){return this.iconImage_.getHitDetectionImage()},e.prototype.getOrigin=function(){if(this.origin_)return this.origin_;var t=this.offset_;if(this.offsetOrigin_!=a.a.TOP_LEFT){var e=this.getSize(),n=this.iconImage_.getSize();if(!e||!n)return null;t=t.slice(),this.offsetOrigin_!=a.a.TOP_RIGHT&&this.offsetOrigin_!=a.a.BOTTOM_RIGHT||(t[0]=n[0]-e[0]-t[0]),this.offsetOrigin_!=a.a.BOTTOM_LEFT&&this.offsetOrigin_!=a.a.BOTTOM_RIGHT||(t[1]=n[1]-e[1]-t[1])}return this.origin_=t,this.origin_},e.prototype.getSrc=function(){return this.iconImage_.getSrc()},e.prototype.getSize=function(){return this.size_?this.size_:this.iconImage_.getSize()},e.prototype.listenImageChange=function(t){this.iconImage_.addEventListener(i.a.CHANGE,t)},e.prototype.load=function(){this.iconImage_.load()},e.prototype.unlistenImageChange=function(t){this.iconImage_.removeEventListener(i.a.CHANGE,t)},e}(l.a);e.a=f},function(t,e,n){"use strict";var r=n(54),i=n(1),o=n(52),a=n(45),s=n(95),l=n(103),u=n(2),c=n(30),h=n(21),p=n(13),d=n(6),f=n(8);function g(t,e,n){return function(r,i,o,a,s){if(r){var l=e?0:o[0]*i,u=e?0:o[1]*i,c=s?s[0]:0,h=s?s[1]:0,p=t[0]+l/2+c,d=t[2]-l/2+c,g=t[1]+u/2+h,y=t[3]-u/2+h;p>d&&(d=p=(d+p)/2),g>y&&(y=g=(y+g)/2);var m=Object(f.a)(r[0],p,d),v=Object(f.a)(r[1],g,y),_=30*i;return a&&n&&(m+=-_*Math.log(1+Math.max(0,p-r[0])/_)+_*Math.log(1+Math.max(0,r[0]-d)/_),v+=-_*Math.log(1+Math.max(0,g-r[1])/_)+_*Math.log(1+Math.max(0,r[1]-y)/_)),[m,v]}}}function y(t){return t}var m=n(0),v=n(7);function _(t,e,n,r){var i=Object(m.getWidth)(e)/n[0],o=Object(m.getHeight)(e)/n[1];return r?Math.min(t,Math.max(i,o)):Math.min(t,Math.min(i,o))}function b(t,e,n){var r=Math.min(t,e);return r*=Math.log(1+50*Math.max(0,t/e-1))/50+1,n&&(r=Math.max(r,n),r/=Math.log(1+50*Math.max(0,n/t-1))/50+1),Object(f.a)(r,n/2,2*e)}function w(t,e,n,r,i){return function(o,a,s,l){if(void 0!==o){var u=r?_(t,r,s,i):t;return(void 0===n||n)&&l?b(o,u,e):Object(f.a)(o,e,u)}}}var x,E=n(118),S=n(74),O=n(22),C=(x=function(t,e){return(x=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}x(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),T=function(t){function e(e){var n=t.call(this)||this;n.on,n.once,n.un;var r=Object(d.a)({},e);return n.hints_=[0,0],n.animations_=[],n.updateAnimationKey_,n.projection_=Object(u.createProjection)(r.projection,"EPSG:3857"),n.viewportSize_=[100,100],n.targetCenter_=null,n.targetResolution_,n.targetRotation_,n.cancelAnchor_=void 0,r.center&&(r.center=Object(u.fromUserCoordinate)(r.center,n.projection_)),r.extent&&(r.extent=Object(u.fromUserExtent)(r.extent,n.projection_)),n.applyOptions_(r),n}return C(e,t),e.prototype.applyOptions_=function(t){var e=function(t){var e,n,r,i=void 0!==t.minZoom?t.minZoom:0,a=void 0!==t.maxZoom?t.maxZoom:28,s=void 0!==t.zoomFactor?t.zoomFactor:2,c=void 0!==t.multiWorld&&t.multiWorld,h=void 0===t.smoothResolutionConstraint||t.smoothResolutionConstraint,p=void 0!==t.showFullExtent&&t.showFullExtent,d=Object(u.createProjection)(t.projection,"EPSG:3857"),g=d.getExtent(),y=t.constrainOnlyCenter,x=t.extent;c||x||!d.isGlobal()||(y=!1,x=g);if(void 0!==t.resolutions){var E=t.resolutions;n=E[i],r=void 0!==E[a]?E[a]:E[E.length-1],e=t.constrainResolution?function(t,e,n,r){return function(i,o,a,s){if(void 0!==i){var l=t[0],u=t[t.length-1],c=n?_(l,n,a,r):l;if(s)return void 0===e||e?b(i,c,u):Object(f.a)(i,u,c);var h=Math.min(c,i),p=Math.floor(Object(v.h)(t,h,o));return t[p]>c&&p<t.length-1?t[p+1]:t[p]}}}(E,h,!y&&x,p):w(n,r,h,!y&&x,p)}else{var S=(g?Math.max(Object(m.getWidth)(g),Object(m.getHeight)(g)):360*u.METERS_PER_UNIT[o.b.DEGREES]/d.getMetersPerUnit())/l.b/Math.pow(2,0),O=S/Math.pow(2,28);void 0!==(n=t.maxResolution)?i=0:n=S/Math.pow(s,i),void 0===(r=t.minResolution)&&(r=void 0!==t.maxZoom?void 0!==t.maxResolution?n/Math.pow(s,a):S/Math.pow(s,a):O),a=i+Math.floor(Math.log(n/r)/Math.log(s)),r=n/Math.pow(s,a-i),e=t.constrainResolution?function(t,e,n,r,i,o){return function(a,s,l,u){if(void 0!==a){var c=i?_(e,i,l,o):e,h=void 0!==n?n:0;if(u)return void 0===r||r?b(a,c,h):Object(f.a)(a,h,c);var p=Math.ceil(Math.log(e/c)/Math.log(t)-1e-9),d=-s*(.5-1e-9)+.5,g=Math.min(c,a),y=Math.floor(Math.log(e/g)/Math.log(t)+d),m=Math.max(p,y),v=e/Math.pow(t,m);return Object(f.a)(v,h,c)}}}(s,n,r,h,!y&&x,p):w(n,r,h,!y&&x,p)}return{constraint:e,maxResolution:n,minResolution:r,minZoom:i,zoomFactor:s}}(t);this.maxResolution_=e.maxResolution,this.minResolution_=e.minResolution,this.zoomFactor_=e.zoomFactor,this.resolutions_=t.resolutions,this.padding_=t.padding,this.minZoom_=e.minZoom;var n=function(t){if(void 0!==t.extent){var e=void 0===t.smoothExtentConstraint||t.smoothExtentConstraint;return g(t.extent,t.constrainOnlyCenter,e)}var n=Object(u.createProjection)(t.projection,"EPSG:3857");if(!0!==t.multiWorld&&n.isGlobal()){var r=n.getExtent().slice();return r[0]=-1/0,r[2]=1/0,g(r,!1,!1)}return y}(t),r=e.constraint,i=function(t){if(void 0===t.enableRotation||t.enableRotation){var e=t.constrainRotation;return void 0===e||!0===e?Object(E.b)():!1===e?E.d:"number"==typeof e?Object(E.a)(e):E.d}return E.c}(t);this.constraints_={center:n,resolution:r,rotation:i},this.setRotation(void 0!==t.rotation?t.rotation:0),this.setCenterInternal(void 0!==t.center?t.center:null),void 0!==t.resolution?this.setResolution(t.resolution):void 0!==t.zoom&&this.setZoom(t.zoom),this.setProperties({}),this.options_=t},Object.defineProperty(e.prototype,"padding",{get:function(){return this.padding_},set:function(t){var e=this.padding_;this.padding_=t;var n=this.getCenter();if(n){var r=t||[0,0,0,0];e=e||[0,0,0,0];var i=this.getResolution(),o=i/2*(r[3]-e[3]+e[1]-r[1]),a=i/2*(r[0]-e[0]+e[2]-r[2]);this.setCenterInternal([n[0]+o,n[1]-a])}},enumerable:!1,configurable:!0}),e.prototype.getUpdatedOptions_=function(t){var e=Object(d.a)({},this.options_);return void 0!==e.resolution?e.resolution=this.getResolution():e.zoom=this.getZoom(),e.center=this.getCenterInternal(),e.rotation=this.getRotation(),Object(d.a)({},e,t)},e.prototype.animate=function(t){this.isDef()&&!this.getAnimating()&&this.resolveConstraints(0);for(var e=new Array(arguments.length),n=0;n<e.length;++n){var r=arguments[n];r.center&&((r=Object(d.a)({},r)).center=Object(u.fromUserCoordinate)(r.center,this.getProjection())),r.anchor&&((r=Object(d.a)({},r)).anchor=Object(u.fromUserCoordinate)(r.anchor,this.getProjection())),e[n]=r}this.animateInternal.apply(this,e)},e.prototype.animateInternal=function(t){var e,n=arguments.length;if(n>1&&"function"==typeof arguments[n-1]&&(e=arguments[n-1],--n),!this.isDef()){var r=arguments[n-1];return r.center&&this.setCenterInternal(r.center),void 0!==r.zoom&&this.setZoom(r.zoom),void 0!==r.rotation&&this.setRotation(r.rotation),void(e&&I(e,!0))}for(var i=Date.now(),o=this.targetCenter_.slice(),s=this.targetResolution_,l=this.targetRotation_,u=[],c=0;c<n;++c){var h=arguments[c],p={start:i,complete:!1,anchor:h.anchor,duration:void 0!==h.duration?h.duration:1e3,easing:h.easing||S.c,callback:e};if(h.center&&(p.sourceCenter=o,p.targetCenter=h.center.slice(),o=p.targetCenter),void 0!==h.zoom?(p.sourceResolution=s,p.targetResolution=this.getResolutionForZoom(h.zoom),s=p.targetResolution):h.resolution&&(p.sourceResolution=s,p.targetResolution=h.resolution,s=p.targetResolution),void 0!==h.rotation){p.sourceRotation=l;var d=Object(f.e)(h.rotation-l+Math.PI,2*Math.PI)-Math.PI;p.targetRotation=l+d,l=p.targetRotation}L(p)?p.complete=!0:i+=p.duration,u.push(p)}this.animations_.push(u),this.setHint(a.a.ANIMATING,1),this.updateAnimations_()},e.prototype.getAnimating=function(){return this.hints_[a.a.ANIMATING]>0},e.prototype.getInteracting=function(){return this.hints_[a.a.INTERACTING]>0},e.prototype.cancelAnimations=function(){var t;this.setHint(a.a.ANIMATING,-this.hints_[a.a.ANIMATING]);for(var e=0,n=this.animations_.length;e<n;++e){var r=this.animations_[e];if(r[0].callback&&I(r[0].callback,!1),!t)for(var i=0,o=r.length;i<o;++i){var s=r[i];if(!s.complete){t=s.anchor;break}}}this.animations_.length=0,this.cancelAnchor_=t},e.prototype.updateAnimations_=function(){if(void 0!==this.updateAnimationKey_&&(cancelAnimationFrame(this.updateAnimationKey_),this.updateAnimationKey_=void 0),this.getAnimating()){for(var t=Date.now(),e=!1,n=this.animations_.length-1;n>=0;--n){for(var r=this.animations_[n],i=!0,o=0,s=r.length;o<s;++o){var l=r[o];if(!l.complete){var u=t-l.start,c=l.duration>0?u/l.duration:1;c>=1?(l.complete=!0,c=1):i=!1;var h=l.easing(c);if(l.sourceCenter){var p=l.sourceCenter[0],d=l.sourceCenter[1],g=p+h*(l.targetCenter[0]-p),y=d+h*(l.targetCenter[1]-d);this.targetCenter_=[g,y]}if(l.sourceResolution&&l.targetResolution){var m=1===h?l.targetResolution:l.sourceResolution+h*(l.targetResolution-l.sourceResolution);if(l.anchor){var v=this.getViewportSize_(this.getRotation()),_=this.constraints_.resolution(m,0,v,!0);this.targetCenter_=this.calculateCenterZoom(_,l.anchor)}this.targetResolution_=m,this.applyTargetState_(!0)}if(void 0!==l.sourceRotation&&void 0!==l.targetRotation){var b=1===h?Object(f.e)(l.targetRotation+Math.PI,2*Math.PI)-Math.PI:l.sourceRotation+h*(l.targetRotation-l.sourceRotation);if(l.anchor){var w=this.constraints_.rotation(b,!0);this.targetCenter_=this.calculateCenterRotate(w,l.anchor)}this.targetRotation_=b}if(this.applyTargetState_(!0),e=!0,!l.complete)break}}if(i){this.animations_[n]=null,this.setHint(a.a.ANIMATING,-1);var x=r[0].callback;x&&I(x,!0)}}this.animations_=this.animations_.filter(Boolean),e&&void 0===this.updateAnimationKey_&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}},e.prototype.calculateCenterRotate=function(t,e){var n,r=this.getCenterInternal();return void 0!==r&&(n=[r[0]-e[0],r[1]-e[1]],Object(h.h)(n,t-this.getRotation()),Object(h.a)(n,e)),n},e.prototype.calculateCenterZoom=function(t,e){var n,r=this.getCenterInternal(),i=this.getResolution();void 0!==r&&void 0!==i&&(n=[e[0]-t*(e[0]-r[0])/i,e[1]-t*(e[1]-r[1])/i]);return n},e.prototype.getViewportSize_=function(t){var e=this.viewportSize_;if(t){var n=e[0],r=e[1];return[Math.abs(n*Math.cos(t))+Math.abs(r*Math.sin(t)),Math.abs(n*Math.sin(t))+Math.abs(r*Math.cos(t))]}return e},e.prototype.setViewportSize=function(t){this.viewportSize_=Array.isArray(t)?t.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)},e.prototype.getCenter=function(){var t=this.getCenterInternal();return t?Object(u.toUserCoordinate)(t,this.getProjection()):t},e.prototype.getCenterInternal=function(){return this.get(s.a.CENTER)},e.prototype.getConstraints=function(){return this.constraints_},e.prototype.getConstrainResolution=function(){return this.options_.constrainResolution},e.prototype.getHints=function(t){return void 0!==t?(t[0]=this.hints_[0],t[1]=this.hints_[1],t):this.hints_.slice()},e.prototype.calculateExtent=function(t){var e=this.calculateExtentInternal(t);return Object(u.toUserExtent)(e,this.getProjection())},e.prototype.calculateExtentInternal=function(t){var e=t||this.getViewportSizeMinusPadding_(),n=this.getCenterInternal();Object(p.a)(n,1);var r=this.getResolution();Object(p.a)(void 0!==r,2);var i=this.getRotation();return Object(p.a)(void 0!==i,3),Object(m.getForViewAndSize)(n,r,i,e)},e.prototype.getMaxResolution=function(){return this.maxResolution_},e.prototype.getMinResolution=function(){return this.minResolution_},e.prototype.getMaxZoom=function(){return this.getZoomForResolution(this.minResolution_)},e.prototype.setMaxZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({maxZoom:t}))},e.prototype.getMinZoom=function(){return this.getZoomForResolution(this.maxResolution_)},e.prototype.setMinZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({minZoom:t}))},e.prototype.setConstrainResolution=function(t){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:t}))},e.prototype.getProjection=function(){return this.projection_},e.prototype.getResolution=function(){return this.get(s.a.RESOLUTION)},e.prototype.getResolutions=function(){return this.resolutions_},e.prototype.getResolutionForExtent=function(t,e){return this.getResolutionForExtentInternal(Object(u.fromUserExtent)(t,this.getProjection()),e)},e.prototype.getResolutionForExtentInternal=function(t,e){var n=e||this.getViewportSizeMinusPadding_(),r=Object(m.getWidth)(t)/n[0],i=Object(m.getHeight)(t)/n[1];return Math.max(r,i)},e.prototype.getResolutionForValueFunction=function(t){var e=t||2,n=this.getConstrainedResolution(this.maxResolution_),r=this.minResolution_,i=Math.log(n/r)/Math.log(e);return function(t){return n/Math.pow(e,t*i)}},e.prototype.getRotation=function(){return this.get(s.a.ROTATION)},e.prototype.getValueForResolutionFunction=function(t){var e=Math.log(t||2),n=this.getConstrainedResolution(this.maxResolution_),r=this.minResolution_,i=Math.log(n/r)/e;return function(t){return Math.log(n/t)/e/i}},e.prototype.getViewportSizeMinusPadding_=function(t){var e=this.getViewportSize_(t),n=this.padding_;return n&&(e=[e[0]-n[1]-n[3],e[1]-n[0]-n[2]]),e},e.prototype.getState=function(){var t=this.getProjection(),e=this.getResolution(),n=this.getRotation(),r=this.getCenterInternal(),i=this.padding_;if(i){var o=this.getViewportSizeMinusPadding_();r=P(r,this.getViewportSize_(),[o[0]/2+i[3],o[1]/2+i[0]],e,n)}return{center:r.slice(0),projection:void 0!==t?t:null,resolution:e,rotation:n,zoom:this.getZoom()}},e.prototype.getZoom=function(){var t,e=this.getResolution();return void 0!==e&&(t=this.getZoomForResolution(e)),t},e.prototype.getZoomForResolution=function(t){var e,n,r=this.minZoom_||0;if(this.resolutions_){var i=Object(v.h)(this.resolutions_,t,1);r=i,e=this.resolutions_[i],n=i==this.resolutions_.length-1?2:e/this.resolutions_[i+1]}else e=this.maxResolution_,n=this.zoomFactor_;return r+Math.log(e/t)/Math.log(n)},e.prototype.getResolutionForZoom=function(t){if(this.resolutions_){if(this.resolutions_.length<=1)return 0;var e=Object(f.a)(Math.floor(t),0,this.resolutions_.length-2),n=this.resolutions_[e]/this.resolutions_[e+1];return this.resolutions_[e]/Math.pow(n,Object(f.a)(t-e,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,t-this.minZoom_)},e.prototype.fit=function(t,e){var n;if(Object(p.a)(Array.isArray(t)||"function"==typeof t.getSimplifiedGeometry,24),Array.isArray(t)){Object(p.a)(!Object(m.isEmpty)(t),25);var r=Object(u.fromUserExtent)(t,this.getProjection());n=Object(O.c)(r)}else if(t.getType()===i.a.CIRCLE){r=Object(u.fromUserExtent)(t.getExtent(),this.getProjection());(n=Object(O.c)(r)).rotate(this.getRotation(),Object(m.getCenter)(r))}else{var o=Object(u.getUserProjection)();n=o?t.clone().transform(o,this.getProjection()):t}this.fitInternal(n,e)},e.prototype.rotatedExtentForGeometry=function(t){for(var e=this.getRotation(),n=Math.cos(e),r=Math.sin(-e),i=t.getFlatCoordinates(),o=t.getStride(),a=1/0,s=1/0,l=-1/0,u=-1/0,c=0,h=i.length;c<h;c+=o){var p=i[c]*n-i[c+1]*r,d=i[c]*r+i[c+1]*n;a=Math.min(a,p),s=Math.min(s,d),l=Math.max(l,p),u=Math.max(u,d)}return[a,s,l,u]},e.prototype.fitInternal=function(t,e){var n=e||{},r=n.size;r||(r=this.getViewportSizeMinusPadding_());var i,o=void 0!==n.padding?n.padding:[0,0,0,0],a=void 0!==n.nearest&&n.nearest;i=void 0!==n.minResolution?n.minResolution:void 0!==n.maxZoom?this.getResolutionForZoom(n.maxZoom):0;var s=this.rotatedExtentForGeometry(t),l=this.getResolutionForExtentInternal(s,[r[0]-o[1]-o[3],r[1]-o[0]-o[2]]);l=isNaN(l)?i:Math.max(l,i),l=this.getConstrainedResolution(l,a?0:1);var u=this.getRotation(),h=Math.sin(u),p=Math.cos(u),d=Object(m.getCenter)(s);d[0]+=(o[1]-o[3])/2*l,d[1]+=(o[0]-o[2])/2*l;var f=d[0]*p-d[1]*h,g=d[1]*p+d[0]*h,y=this.getConstrainedCenter([f,g],l),v=n.callback?n.callback:c.c;void 0!==n.duration?this.animateInternal({resolution:l,center:y,duration:n.duration,easing:n.easing},v):(this.targetResolution_=l,this.targetCenter_=y,this.applyTargetState_(!1,!0),I(v,!0))},e.prototype.centerOn=function(t,e,n){this.centerOnInternal(Object(u.fromUserCoordinate)(t,this.getProjection()),e,n)},e.prototype.centerOnInternal=function(t,e,n){this.setCenterInternal(P(t,e,n,this.getResolution(),this.getRotation()))},e.prototype.calculateCenterShift=function(t,e,n,r){var i,o=this.padding_;if(o&&t){var a=this.getViewportSizeMinusPadding_(-n),s=P(t,r,[a[0]/2+o[3],a[1]/2+o[0]],e,n);i=[t[0]-s[0],t[1]-s[1]]}return i},e.prototype.isDef=function(){return!!this.getCenterInternal()&&void 0!==this.getResolution()},e.prototype.adjustCenter=function(t){var e=Object(u.toUserCoordinate)(this.targetCenter_,this.getProjection());this.setCenter([e[0]+t[0],e[1]+t[1]])},e.prototype.adjustCenterInternal=function(t){var e=this.targetCenter_;this.setCenterInternal([e[0]+t[0],e[1]+t[1]])},e.prototype.adjustResolution=function(t,e){var n=e&&Object(u.fromUserCoordinate)(e,this.getProjection());this.adjustResolutionInternal(t,n)},e.prototype.adjustResolutionInternal=function(t,e){var n=this.getAnimating()||this.getInteracting(),r=this.getViewportSize_(this.getRotation()),i=this.constraints_.resolution(this.targetResolution_*t,0,r,n);e&&(this.targetCenter_=this.calculateCenterZoom(i,e)),this.targetResolution_*=t,this.applyTargetState_()},e.prototype.adjustZoom=function(t,e){this.adjustResolution(Math.pow(this.zoomFactor_,-t),e)},e.prototype.adjustRotation=function(t,e){e&&(e=Object(u.fromUserCoordinate)(e,this.getProjection())),this.adjustRotationInternal(t,e)},e.prototype.adjustRotationInternal=function(t,e){var n=this.getAnimating()||this.getInteracting(),r=this.constraints_.rotation(this.targetRotation_+t,n);e&&(this.targetCenter_=this.calculateCenterRotate(r,e)),this.targetRotation_+=t,this.applyTargetState_()},e.prototype.setCenter=function(t){this.setCenterInternal(Object(u.fromUserCoordinate)(t,this.getProjection()))},e.prototype.setCenterInternal=function(t){this.targetCenter_=t,this.applyTargetState_()},e.prototype.setHint=function(t,e){return this.hints_[t]+=e,this.changed(),this.hints_[t]},e.prototype.setResolution=function(t){this.targetResolution_=t,this.applyTargetState_()},e.prototype.setRotation=function(t){this.targetRotation_=t,this.applyTargetState_()},e.prototype.setZoom=function(t){this.setResolution(this.getResolutionForZoom(t))},e.prototype.applyTargetState_=function(t,e){var n=this.getAnimating()||this.getInteracting()||e,r=this.constraints_.rotation(this.targetRotation_,n),i=this.getViewportSize_(r),o=this.constraints_.resolution(this.targetResolution_,0,i,n),a=this.constraints_.center(this.targetCenter_,o,i,n,this.calculateCenterShift(this.targetCenter_,o,r,i));this.get(s.a.ROTATION)!==r&&this.set(s.a.ROTATION,r),this.get(s.a.RESOLUTION)!==o&&this.set(s.a.RESOLUTION,o),this.get(s.a.CENTER)&&Object(h.f)(this.get(s.a.CENTER),a)||this.set(s.a.CENTER,a),this.getAnimating()&&!t&&this.cancelAnimations(),this.cancelAnchor_=void 0},e.prototype.resolveConstraints=function(t,e,n){var r=void 0!==t?t:200,i=e||0,o=this.constraints_.rotation(this.targetRotation_),a=this.getViewportSize_(o),s=this.constraints_.resolution(this.targetResolution_,i,a),l=this.constraints_.center(this.targetCenter_,s,a,!1,this.calculateCenterShift(this.targetCenter_,s,o,a));if(0===r&&!this.cancelAnchor_)return this.targetResolution_=s,this.targetRotation_=o,this.targetCenter_=l,void this.applyTargetState_();var u=n||(0===r?this.cancelAnchor_:void 0);this.cancelAnchor_=void 0,this.getResolution()===s&&this.getRotation()===o&&this.getCenterInternal()&&Object(h.f)(this.getCenterInternal(),l)||(this.getAnimating()&&this.cancelAnimations(),this.animateInternal({rotation:o,center:l,resolution:s,duration:r,easing:S.b,anchor:u}))},e.prototype.beginInteraction=function(){this.resolveConstraints(0),this.setHint(a.a.INTERACTING,1)},e.prototype.endInteraction=function(t,e,n){var r=n&&Object(u.fromUserCoordinate)(n,this.getProjection());this.endInteractionInternal(t,e,r)},e.prototype.endInteractionInternal=function(t,e,n){this.setHint(a.a.INTERACTING,-1),this.resolveConstraints(t,e,n)},e.prototype.getConstrainedCenter=function(t,e){var n=this.getViewportSize_(this.getRotation());return this.constraints_.center(t,e||this.getResolution(),n)},e.prototype.getConstrainedZoom=function(t,e){var n=this.getResolutionForZoom(t);return this.getZoomForResolution(this.getConstrainedResolution(n,e))},e.prototype.getConstrainedResolution=function(t,e){var n=e||0,r=this.getViewportSize_(this.getRotation());return this.constraints_.resolution(t,n,r)},e}(r.a);function I(t,e){setTimeout((function(){t(e)}),0)}function L(t){return!(t.sourceCenter&&t.targetCenter&&!Object(h.f)(t.sourceCenter,t.targetCenter))&&(t.sourceResolution===t.targetResolution&&t.sourceRotation===t.targetRotation)}function P(t,e,n,r,i){var o=Math.cos(-i),a=Math.sin(-i),s=t[0]*o-t[1]*a,l=t[1]*o+t[0]*a;return[(s+=(e[0]/2-n[0])*r)*o-(l+=(n[1]-e[1]/2)*r)*(a=-a),l*o+s*a]}e.a=T},function(t,e,n){"use strict";n.d(e,"a",(function(){return o})),n.d(e,"b",(function(){return a})),n.d(e,"c",(function(){return s}));var r=n(7),i=n(8);function o(t,e,n,o,a,s,l){var u,c,h=(n-e)/o;if(1===h)u=e;else if(2===h)u=e,c=a;else if(0!==h){for(var p=t[e],d=t[e+1],f=0,g=[0],y=e+o;y<n;y+=o){var m=t[y],v=t[y+1];f+=Math.sqrt((m-p)*(m-p)+(v-d)*(v-d)),g.push(f),p=m,d=v}var _=a*f,b=Object(r.a)(g,_);b<0?(c=(_-g[-b-2])/(g[-b-1]-g[-b-2]),u=e+(-b-2)*o):u=e+b*o}var w=l>1?l:2,x=s||new Array(w);for(y=0;y<w;++y)x[y]=void 0===u?NaN:void 0===c?t[u+y]:Object(i.c)(t[u+y],t[u+o+y],c);return x}function a(t,e,n,r,o,a){if(n==e)return null;var s;if(o<t[e+r-1])return a?((s=t.slice(e,e+r))[r-1]=o,s):null;if(t[n-1]<o)return a?((s=t.slice(n-r,n))[r-1]=o,s):null;if(o==t[e+r-1])return t.slice(e,e+r);for(var l=e/r,u=n/r;l<u;){var c=l+u>>1;o<t[(c+1)*r-1]?u=c:l=c+1}var h=t[l*r-1];if(o==h)return t.slice((l-1)*r,(l-1)*r+r);var p=(o-h)/(t[(l+1)*r-1]-h);s=[];for(var d=0;d<r-1;++d)s.push(Object(i.c)(t[(l-1)*r+d],t[l*r+d],p));return s.push(o),s}function s(t,e,n,r,i,o,s){if(s)return a(t,e,n[n.length-1],r,i,o);var l;if(i<t[r-1])return o?((l=t.slice(0,r))[r-1]=i,l):null;if(t[t.length-1]<i)return o?((l=t.slice(t.length-r))[r-1]=i,l):null;for(var u=0,c=n.length;u<c;++u){var h=n[u];if(e!=h){if(i<t[e+r-1])return null;if(i<=t[h-1])return a(t,e,h,r,i,!1);e=h}}return null}},function(t,e,n){"use strict";var r=n(52),i=function(){function t(t){this.code_=t.code,this.units_=t.units,this.extent_=void 0!==t.extent?t.extent:null,this.worldExtent_=void 0!==t.worldExtent?t.worldExtent:null,this.axisOrientation_=void 0!==t.axisOrientation?t.axisOrientation:"enu",this.global_=void 0!==t.global&&t.global,this.canWrapX_=!(!this.global_||!this.extent_),this.getPointResolutionFunc_=t.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=t.metersPerUnit}return t.prototype.canWrapX=function(){return this.canWrapX_},t.prototype.getCode=function(){return this.code_},t.prototype.getExtent=function(){return this.extent_},t.prototype.getUnits=function(){return this.units_},t.prototype.getMetersPerUnit=function(){return this.metersPerUnit_||r.a[this.units_]},t.prototype.getWorldExtent=function(){return this.worldExtent_},t.prototype.getAxisOrientation=function(){return this.axisOrientation_},t.prototype.isGlobal=function(){return this.global_},t.prototype.setGlobal=function(t){this.global_=t,this.canWrapX_=!(!t||!this.extent_)},t.prototype.getDefaultTileGrid=function(){return this.defaultTileGrid_},t.prototype.setDefaultTileGrid=function(t){this.defaultTileGrid_=t},t.prototype.setExtent=function(t){this.extent_=t,this.canWrapX_=!(!this.global_||!t)},t.prototype.setWorldExtent=function(t){this.worldExtent_=t},t.prototype.setGetPointResolution=function(t){this.getPointResolutionFunc_=t},t.prototype.getPointResolutionFunc=function(){return this.getPointResolutionFunc_},t}();e.a=i},function(t,e,n){"use strict";var r,i=n(23),o=n(145),a=n(88),s=n(92),l=n(25),u=n(17),c=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),h=function(t){function e(e){var n=this,r=void 0!==e.rotateWithView&&e.rotateWithView;return(n=t.call(this,{opacity:1,rotateWithView:r,rotation:void 0!==e.rotation?e.rotation:0,scale:void 0!==e.scale?e.scale:1,displacement:void 0!==e.displacement?e.displacement:[0,0]})||this).canvas_=void 0,n.hitDetectionCanvas_=null,n.fill_=void 0!==e.fill?e.fill:null,n.origin_=[0,0],n.points_=e.points,n.radius_=void 0!==e.radius?e.radius:e.radius1,n.radius2_=e.radius2,n.angle_=void 0!==e.angle?e.angle:0,n.stroke_=void 0!==e.stroke?e.stroke:null,n.anchor_=null,n.size_=null,n.renderOptions_=null,n.render(),n}return c(e,t),e.prototype.clone=function(){var t=this.getScale(),n=new e({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,displacement:this.getDisplacement().slice()});return n.setOpacity(this.getOpacity()),n},e.prototype.getAnchor=function(){return this.anchor_},e.prototype.getAngle=function(){return this.angle_},e.prototype.getFill=function(){return this.fill_},e.prototype.getHitDetectionImage=function(){return this.hitDetectionCanvas_||this.createHitDetectionCanvas_(this.renderOptions_),this.hitDetectionCanvas_},e.prototype.getImage=function(t){var e=this.canvas_[t];if(!e){var n=this.renderOptions_,r=Object(l.a)(n.size*t,n.size*t);this.draw_(n,r,t),e=r.canvas,this.canvas_[t]=e}return e},e.prototype.getPixelRatio=function(t){return t},e.prototype.getImageSize=function(){return this.size_},e.prototype.getImageState=function(){return i.a.LOADED},e.prototype.getOrigin=function(){return this.origin_},e.prototype.getPoints=function(){return this.points_},e.prototype.getRadius=function(){return this.radius_},e.prototype.getRadius2=function(){return this.radius2_},e.prototype.getSize=function(){return this.size_},e.prototype.getStroke=function(){return this.stroke_},e.prototype.listenImageChange=function(t){},e.prototype.load=function(){},e.prototype.unlistenImageChange=function(t){},e.prototype.calculateLineJoinSize_=function(t,e,n){if(0===e||this.points_===1/0||"bevel"!==t&&"miter"!==t)return e;var r=this.radius_,i=void 0===this.radius2_?r:this.radius2_;if(r<i){var o=r;r=i,i=o}var a=void 0===this.radius2_?this.points_:2*this.points_,s=2*Math.PI/a,l=i*Math.sin(s),u=r-Math.sqrt(i*i-l*l),c=Math.sqrt(l*l+u*u),h=c/l;if("miter"===t&&h<=n)return h*e;var p=e/2/h,d=e/2*(u/c),f=Math.sqrt((r+p)*(r+p)+d*d)-r;if(void 0===this.radius2_||"bevel"===t)return 2*f;var g=r*Math.sin(s),y=i-Math.sqrt(r*r-g*g),m=Math.sqrt(g*g+y*y)/g;if(m<=n){var v=m*e/2-i-r;return 2*Math.max(f,v)}return 2*f},e.prototype.createRenderOptions=function(){var t,e=u.g,n=0,r=null,i=0,o=0;this.stroke_&&(null===(t=this.stroke_.getColor())&&(t=u.k),t=Object(s.a)(t),void 0===(o=this.stroke_.getWidth())&&(o=u.h),r=this.stroke_.getLineDash(),i=this.stroke_.getLineDashOffset(),void 0===(e=this.stroke_.getLineJoin())&&(e=u.g),void 0===(n=this.stroke_.getMiterLimit())&&(n=u.i));var a=this.calculateLineJoinSize_(e,o,n),l=Math.max(this.radius_,this.radius2_||0);return{strokeStyle:t,strokeWidth:o,size:Math.ceil(2*l+a),lineDash:r,lineDashOffset:i,lineJoin:e,miterLimit:n}},e.prototype.render=function(){this.renderOptions_=this.createRenderOptions();var t=this.renderOptions_.size,e=this.getDisplacement();this.canvas_={},this.anchor_=[t/2-e[0],t/2+e[1]],this.size_=[t,t]},e.prototype.draw_=function(t,e,n){if(e.scale(n,n),e.translate(t.size/2,t.size/2),this.createPath_(e),this.fill_){var r=this.fill_.getColor();null===r&&(r=u.b),e.fillStyle=Object(s.a)(r),e.fill()}this.stroke_&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.strokeWidth,e.setLineDash&&t.lineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineJoin=t.lineJoin,e.miterLimit=t.miterLimit,e.stroke())},e.prototype.createHitDetectionCanvas_=function(t){if(this.fill_){var e=this.fill_.getColor(),n=0;if("string"==typeof e&&(e=Object(a.a)(e)),null===e?n=1:Array.isArray(e)&&(n=4===e.length?e[3]:1),0===n){var r=Object(l.a)(t.size,t.size);this.hitDetectionCanvas_=r.canvas,this.drawHitDetectionCanvas_(t,r)}}this.hitDetectionCanvas_||(this.hitDetectionCanvas_=this.getImage(1))},e.prototype.createPath_=function(t){var e=this.points_,n=this.radius_;if(e===1/0)t.arc(0,0,n,0,2*Math.PI);else{var r=void 0===this.radius2_?n:this.radius2_;void 0!==this.radius2_&&(e*=2);for(var i=this.angle_-Math.PI/2,o=2*Math.PI/e,a=0;a<e;a++){var s=i+a*o,l=a%2==0?n:r;t.lineTo(l*Math.cos(s),l*Math.sin(s))}t.closePath()}},e.prototype.drawHitDetectionCanvas_=function(t,e){e.translate(t.size/2,t.size/2),this.createPath_(e),e.fillStyle=u.b,e.fill(),this.stroke_&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.strokeWidth,t.lineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineJoin=t.lineJoin,e.miterLimit=t.miterLimit,e.stroke())},e}(o.a);e.a=h},function(t,e,n){"use strict";n.d(e,"a",(function(){return a})),n.d(e,"b",(function(){return s})),n.d(e,"c",(function(){return l})),n.d(e,"d",(function(){return u}));var r=n(0),i=n(193),o=n(104);function a(t,e,n,o,a){var s=Object(r.extendFlatCoordinates)(Object(r.createEmpty)(),t,e,n,o);return!!Object(r.intersects)(a,s)&&(!!Object(r.containsExtent)(a,s)||(s[0]>=a[0]&&s[2]<=a[2]||(s[1]>=a[1]&&s[3]<=a[3]||Object(i.a)(t,e,n,o,(function(t,e){return Object(r.intersectsSegment)(a,t,e)})))))}function s(t,e,n,r,i){for(var o=0,s=n.length;o<s;++o){if(a(t,e,n[o],r,i))return!0;e=n[o]}return!1}function l(t,e,n,r,i){if(!function(t,e,n,r,i){return!!a(t,e,n,r,i)||(!!Object(o.b)(t,e,n,r,i[0],i[1])||(!!Object(o.b)(t,e,n,r,i[0],i[3])||(!!Object(o.b)(t,e,n,r,i[2],i[1])||!!Object(o.b)(t,e,n,r,i[2],i[3]))))}(t,e,n[0],r,i))return!1;if(1===n.length)return!0;for(var s=1,l=n.length;s<l;++s)if(Object(o.a)(t,n[s-1],n[s],r,i)&&!a(t,n[s-1],n[s],r,i))return!1;return!0}function u(t,e,n,r,i){for(var o=0,a=n.length;o<a;++o){var s=n[o];if(l(t,e,s,r,i))return!0;e=s[s.length-1]}return!1}},function(t,e,n){"use strict";var r,i=n(79),o=n(151),a=n.n(o),s=n(6),l=n(41),u=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),c="renderOrder",h=function(t){function e(e){var n=this,r=e||{},i=Object(s.a)({},r);return delete i.style,delete i.renderBuffer,delete i.updateWhileAnimating,delete i.updateWhileInteracting,(n=t.call(this,i)||this).declutter_=void 0!==r.declutter&&r.declutter,n.renderBuffer_=void 0!==r.renderBuffer?r.renderBuffer:100,n.style_=null,n.styleFunction_=void 0,n.setStyle(r.style),n.updateWhileAnimating_=void 0!==r.updateWhileAnimating&&r.updateWhileAnimating,n.updateWhileInteracting_=void 0!==r.updateWhileInteracting&&r.updateWhileInteracting,n}return u(e,t),e.prototype.getDeclutter=function(){return this.declutter_},e.prototype.getFeatures=function(e){return t.prototype.getFeatures.call(this,e)},e.prototype.getRenderBuffer=function(){return this.renderBuffer_},e.prototype.getRenderOrder=function(){return this.get(c)},e.prototype.getStyle=function(){return this.style_},e.prototype.getStyleFunction=function(){return this.styleFunction_},e.prototype.getUpdateWhileAnimating=function(){return this.updateWhileAnimating_},e.prototype.getUpdateWhileInteracting=function(){return this.updateWhileInteracting_},e.prototype.renderDeclutter=function(t){t.declutterTree||(t.declutterTree=new a.a(9)),this.getRenderer().renderDeclutter(t)},e.prototype.setRenderOrder=function(t){this.set(c,t)},e.prototype.setStyle=function(t){this.style_=void 0!==t?t:l.a,this.styleFunction_=null===t?void 0:Object(l.d)(this.style_),this.changed()},e}(i.a);e.a=h},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r=n(13),i=n(7),o=function(t,e){for(var n=0,r=e.length,i=t.length;n<r;n++,i++)t[i]=e[n];return t},a={VERSION1:"version1",VERSION2:"version2",VERSION3:"version3"},s={};s[a.VERSION1]={level0:{supports:[],formats:[],qualities:["native"]},level1:{supports:["regionByPx","sizeByW","sizeByH","sizeByPct"],formats:["jpg"],qualities:["native"]},level2:{supports:["regionByPx","regionByPct","sizeByW","sizeByH","sizeByPct","sizeByConfinedWh","sizeByWh"],formats:["jpg","png"],qualities:["native","color","grey","bitonal"]}},s[a.VERSION2]={level0:{supports:[],formats:["jpg"],qualities:["default"]},level1:{supports:["regionByPx","sizeByW","sizeByH","sizeByPct"],formats:["jpg"],qualities:["default"]},level2:{supports:["regionByPx","regionByPct","sizeByW","sizeByH","sizeByPct","sizeByConfinedWh","sizeByDistortedWh","sizeByWh"],formats:["jpg","png"],qualities:["default","bitonal"]}},s[a.VERSION3]={level0:{supports:[],formats:["jpg"],qualities:["default"]},level1:{supports:["regionByPx","regionSquare","sizeByW","sizeByH","sizeByWh"],formats:["jpg"],qualities:["default"]},level2:{supports:["regionByPx","regionSquare","regionByPct","sizeByW","sizeByH","sizeByPct","sizeByConfinedWh","sizeByWh"],formats:["jpg","png"],qualities:["default"]}},s.none={none:{supports:[],formats:[],qualities:[]}};var l=/^https?:\/\/library\.stanford\.edu\/iiif\/image-api\/(?:1\.1\/)?compliance\.html#level[0-2]$/,u=/^https?:\/\/iiif\.io\/api\/image\/2\/level[0-2](?:\.json)?$/,c=/(^https?:\/\/iiif\.io\/api\/image\/3\/level[0-2](?:\.json)?$)|(^level[0-2]$)/;var h={};h[a.VERSION1]=function(t){var e=t.getComplianceLevelSupportedFeatures();return void 0===e&&(e=s[a.VERSION1].level0),{url:void 0===t.imageInfo["@id"]?void 0:t.imageInfo["@id"].replace(/\/?(?:info\.json)?$/g,""),supports:e.supports,formats:o(o([],e.formats),[void 0===t.imageInfo.formats?[]:t.imageInfo.formats]),qualities:o(o([],e.qualities),[void 0===t.imageInfo.qualities?[]:t.imageInfo.qualities]),resolutions:t.imageInfo.scale_factors,tileSize:void 0!==t.imageInfo.tile_width?void 0!==t.imageInfo.tile_height?[t.imageInfo.tile_width,t.imageInfo.tile_height]:[t.imageInfo.tile_width,t.imageInfo.tile_width]:null!=t.imageInfo.tile_height?[t.imageInfo.tile_height,t.imageInfo.tile_height]:void 0}},h[a.VERSION2]=function(t){var e=t.getComplianceLevelSupportedFeatures(),n=Array.isArray(t.imageInfo.profile)&&t.imageInfo.profile.length>1,r=n&&t.imageInfo.profile[1].supports?t.imageInfo.profile[1].supports:[],i=n&&t.imageInfo.profile[1].formats?t.imageInfo.profile[1].formats:[],a=n&&t.imageInfo.profile[1].qualities?t.imageInfo.profile[1].qualities:[];return{url:t.imageInfo["@id"].replace(/\/?(?:info\.json)?$/g,""),sizes:void 0===t.imageInfo.sizes?void 0:t.imageInfo.sizes.map((function(t){return[t.width,t.height]})),tileSize:void 0===t.imageInfo.tiles?void 0:[t.imageInfo.tiles.map((function(t){return t.width}))[0],t.imageInfo.tiles.map((function(t){return void 0===t.height?t.width:t.height}))[0]],resolutions:void 0===t.imageInfo.tiles?void 0:t.imageInfo.tiles.map((function(t){return t.scaleFactors}))[0],supports:o(o([],e.supports),r),formats:o(o([],e.formats),i),qualities:o(o([],e.qualities),a)}},h[a.VERSION3]=function(t){var e=t.getComplianceLevelSupportedFeatures(),n=void 0===t.imageInfo.extraFormats?e.formats:o(o([],e.formats),t.imageInfo.extraFormats),r=void 0!==t.imageInfo.preferredFormats&&Array.isArray(t.imageInfo.preferredFormats)&&t.imageInfo.preferredFormats.length>0?t.imageInfo.preferredFormats.filter((function(t){return Object(i.f)(["jpg","png","gif"],t)})).reduce((function(t,e){return void 0===t&&Object(i.f)(n,e)?e:t}),void 0):void 0;return{url:t.imageInfo.id,sizes:void 0===t.imageInfo.sizes?void 0:t.imageInfo.sizes.map((function(t){return[t.width,t.height]})),tileSize:void 0===t.imageInfo.tiles?void 0:[t.imageInfo.tiles.map((function(t){return t.width}))[0],t.imageInfo.tiles.map((function(t){return t.height}))[0]],resolutions:void 0===t.imageInfo.tiles?void 0:t.imageInfo.tiles.map((function(t){return t.scaleFactors}))[0],supports:void 0===t.imageInfo.extraFeatures?e.supports:o(o([],e.supports),t.imageInfo.extraFeatures),formats:n,qualities:void 0===t.imageInfo.extraQualities?e.qualities:o(o([],e.qualities),t.imageInfo.extraQualities),preferredFormat:r}};var p=function(){function t(t){this.setImageInfo(t)}return t.prototype.setImageInfo=function(t){this.imageInfo="string"==typeof t?JSON.parse(t):t},t.prototype.getImageApiVersion=function(){if(void 0!==this.imageInfo){var t=this.imageInfo["@context"]||"ol-no-context";"string"==typeof t&&(t=[t]);for(var e=0;e<t.length;e++)switch(t[e]){case"http://library.stanford.edu/iiif/image-api/1.1/context.json":case"http://iiif.io/api/image/1/context.json":return a.VERSION1;case"http://iiif.io/api/image/2/context.json":return a.VERSION2;case"http://iiif.io/api/image/3/context.json":return a.VERSION3;case"ol-no-context":if(this.getComplianceLevelEntryFromProfile(a.VERSION1)&&this.imageInfo.identifier)return a.VERSION1}Object(r.a)(!1,61)}},t.prototype.getComplianceLevelEntryFromProfile=function(t){if(void 0!==this.imageInfo&&void 0!==this.imageInfo.profile)switch(void 0===t&&(t=this.getImageApiVersion()),t){case a.VERSION1:if(l.test(this.imageInfo.profile))return this.imageInfo.profile;break;case a.VERSION3:if(c.test(this.imageInfo.profile))return this.imageInfo.profile;break;case a.VERSION2:if("string"==typeof this.imageInfo.profile&&u.test(this.imageInfo.profile))return this.imageInfo.profile;if(Array.isArray(this.imageInfo.profile)&&this.imageInfo.profile.length>0&&"string"==typeof this.imageInfo.profile[0]&&u.test(this.imageInfo.profile[0]))return this.imageInfo.profile[0]}},t.prototype.getComplianceLevelFromProfile=function(t){var e=this.getComplianceLevelEntryFromProfile(t);if(void 0!==e){var n=e.match(/level[0-2](?:\.json)?$/g);return Array.isArray(n)?n[0].replace(".json",""):void 0}},t.prototype.getComplianceLevelSupportedFeatures=function(){if(void 0!==this.imageInfo){var t=this.getImageApiVersion(),e=this.getComplianceLevelFromProfile(t);return void 0===e?s.none.none:s[t][e]}},t.prototype.getTileSourceOptions=function(t){var e=t||{},n=this.getImageApiVersion();if(void 0!==n){var r=void 0===n?void 0:h[n](this);if(void 0!==r)return{url:r.url,version:n,size:[this.imageInfo.width,this.imageInfo.height],sizes:r.sizes,format:void 0!==e.format&&Object(i.f)(r.formats,e.format)?e.format:void 0!==r.preferredFormat?r.preferredFormat:"jpg",supports:r.supports,quality:e.quality&&Object(i.f)(r.qualities,e.quality)?e.quality:Object(i.f)(r.qualities,"native")?"native":"default",resolutions:Array.isArray(r.resolutions)?r.resolutions.sort((function(t,e){return e-t})):void 0,tileSize:r.tileSize}}},t}();e.b=p},function(t,e){var n;
/*
Magic wand tool (fuzzy selection) by color
@package magic-wand-tool
@author Ryasnoy Paul <ryasnoypaul@gmail.com>
@version 1.1.4
@license MIT
@copyright (c) 2014-2019, Ryasnoy Paul <ryasnoypaul@gmail.com>
*/
MagicWand=((n={}).floodFill=function(t,e,n,r,i,o){return o?function(t,e,n,r,i){var o,a,s,l,u,c,h,p,d,f,g=t.data,y=t.width,m=t.height,v=t.bytes,_=-1,b=y+1,w=-1,x=m+1,E=n*y+e,S=new Uint8Array(y*m),O=new Uint8Array(i||y*m);if(1===O[E])return null;var C=[g[E*=v],g[E+1],g[E+2],g[E+3]],T=[{y:n,left:e-1,right:e+1,dir:1}];do{for(l=T.shift(),f=!1,a=l.left+1;a<l.right;a++)if(h=l.y*y,E=(h+a)*v,1!==O[h+a]&&(f=!0,S[h+a]=1,O[h+a]=1,!((o=g[E]-C[0])>r||o<-r||(o=g[E+1]-C[1])>r||o<-r||(o=g[E+2]-C[2])>r||o<-r))){for(c=a-1;c>-1&&(E=(p=h+c)*v,1!==O[p])&&(S[p]=1,O[p]=1,c--,!((o=g[E]-C[0])>r||o<-r))&&!((o=g[E+1]-C[1])>r||o<-r)&&!((o=g[E+2]-C[2])>r||o<-r););for(u=a+1;u<y&&(E=(d=h+u)*v,1!==O[d])&&(S[d]=1,O[d]=1,u++,!((o=g[E]-C[0])>r||o<-r))&&!((o=g[E+1]-C[1])>r||o<-r)&&!((o=g[E+2]-C[2])>r||o<-r););c<b&&(b=c+1),u>_&&(_=u-1),(s=l.y-l.dir)>=0&&s<m&&(c<l.left&&T.push({y:s,left:c,right:l.left,dir:-l.dir}),l.right<u&&T.push({y:s,left:l.right,right:u,dir:-l.dir})),(s=l.y+l.dir)>=0&&s<m&&c<u&&T.push({y:s,left:c,right:u,dir:l.dir})}f&&(l.y<x&&(x=l.y),l.y>w&&(w=l.y))}while(T.length>0);return{data:S,width:t.width,height:t.height,bounds:{minX:b,minY:x,maxX:_,maxY:w}}}(t,e,n,r,i):function(t,e,n,r,i){var o,a,s,l,u,c,h,p,d,f,g=t.data,y=t.width,m=t.height,v=t.bytes,_=-1,b=y+1,w=-1,x=m+1,E=n*y+e,S=new Uint8Array(y*m),O=new Uint8Array(i||y*m);if(1===O[E])return null;var C=[g[E*=v],g[E+1],g[E+2],g[E+3]],T=[{y:n,left:e-1,right:e+1,dir:1}];do{for(l=T.shift(),f=!1,a=l.left+1;a<l.right;a++)if(h=l.y*y,E=(h+a)*v,1!==O[h+a]&&!((o=g[E]-C[0])>r||o<-r||(o=g[E+1]-C[1])>r||o<-r||(o=g[E+2]-C[2])>r||o<-r)){for(f=!0,S[h+a]=1,O[h+a]=1,c=a-1;c>-1&&(E=(p=h+c)*v,1!==O[p])&&!((o=g[E]-C[0])>r||o<-r)&&!((o=g[E+1]-C[1])>r||o<-r)&&!((o=g[E+2]-C[2])>r||o<-r);)S[p]=1,O[p]=1,c--;for(u=a+1;u<y&&(E=(d=h+u)*v,1!==O[d])&&!((o=g[E]-C[0])>r||o<-r)&&!((o=g[E+1]-C[1])>r||o<-r)&&!((o=g[E+2]-C[2])>r||o<-r);)S[d]=1,O[d]=1,u++;c<b&&(b=c+1),u>_&&(_=u-1),(s=l.y-l.dir)>=0&&s<m&&(c<l.left&&T.push({y:s,left:c,right:l.left,dir:-l.dir}),l.right<u&&T.push({y:s,left:l.right,right:u,dir:-l.dir})),(s=l.y+l.dir)>=0&&s<m&&c<u&&T.push({y:s,left:c,right:u,dir:l.dir})}f&&(l.y<x&&(x=l.y),l.y>w&&(w=l.y))}while(T.length>0);return{data:S,width:t.width,height:t.height,bounds:{minX:b,minY:x,maxX:_,maxY:w}}}(t,e,n,r,i)},n.gaussBlur=function(t,e){var n,r,i,o,a,s,l,u=2*e+1,c=e*e,h=new Float32Array(u),p=0,d=t.width,f=t.height,g=t.data,y=t.bounds.minX,m=t.bounds.maxX,v=t.bounds.minY,_=t.bounds.maxY;for(n=0;n<e;n++){var b=(e-n)*(e-n),w=Math.exp(-b/(2*c))/(2*Math.PI*c);h[e+n]=h[e-n]=w,p+=2*w}for(n=0;n<u;n++)h[n]/=p;var x=new Uint8Array(d*f),E=e+d,S=e+f;for(a=v;a<_+1;a++)for(o=y;o<m+1;o++){for(s=0,l=E-o<u?E-o:u,i=(r=a*d+o)-e,n=e-o>0?e-o:0;n<l;n++)s+=g[i+n]*h[n];for(l=S-a<u?S-a:u,i=r-e*d,n=e-a>0?e-a:0;n<l;n++)s+=g[i+n*d]*h[n];x[r]=s>.5?1:0}return{data:x,width:d,height:f,bounds:{minX:y,minY:v,maxX:m,maxY:_}}},n.gaussBlurOnlyBorder=function(t,e,n){var r,i,o,a,s,l,u,c,h,p,d=function(t,e,n){var r,i,o,a,s,l,u,c=t.width,h=t.height,p=t.data,d=new Uint8Array(p),f=t.bounds.minX,g=t.bounds.maxX,y=t.bounds.minY,m=t.bounds.maxY,v=c*h,_=new Uint8Array(v),b=[],w=Math.max(f,1),x=Math.min(g,c-2),E=Math.max(y,1),S=Math.min(m,h-2);if(n&&n.length>0)for(s=0;s<v;s++)1===n[s]&&(d[s]=1);for(a=E;a<S+1;a++)for(r=w;r<x+1;r++)0!==p[s=a*c+r]&&(l=s+c,u=s-c,0!==d[s+1]&&0!==d[s-1]&&0!==d[l]&&0!==d[l+1]&&0!==d[l-1]&&0!==d[u]&&0!==d[u+1]&&0!==d[u-1]||b.push(s));if(0==f)for(a=y;a<m+1;a++)1===p[a*c]&&b.push(a*c);if(g==c-1)for(a=y;a<m+1;a++)1===p[a*c+g]&&b.push(a*c+g);if(0==y)for(r=f;r<g+1;r++)1===p[r]&&b.push(r);if(m==h-1)for(r=f;r<g+1;r++)1===p[m*c+r]&&b.push(m*c+r);var O,C=[],T=e+c,I=e+h,L=2*e+1;for(v=b.length,o=0;o<v;o++){for(_[s=b[o]]=1,C.push(s),a=(s-(r=s%c))/c,O=T-r<L?T-r:L,l=s-e,i=e-r>0?e-r:0;i<O;i++)0===_[u=l+i]&&(_[u]=1,C.push(u));for(O=I-a<L?I-a:L,l=s-e*c,i=e-a>0?e-a:0;i<O;i++)0===_[u=l+i*c]&&(_[u]=1,C.push(u))}return C}(t,e,n),f=2*e+1,g=2*e*e,y=new Float32Array(f),m=0,v=t.width,_=t.height,b=t.data,w=t.bounds.minX,x=t.bounds.maxX,E=t.bounds.minY,S=t.bounds.maxY,O=d.length;for(o=0;o<e;o++)i=(e-o)*(e-o),r=Math.exp(-i/g)/Math.PI,y[e+o]=y[e-o]=r,m+=2*r;for(o=0;o<f;o++)y[o]/=m;var C=new Uint8Array(b),T=e+v,I=e+_;for(o=0;o<O;o++){for(h=0,c=((s=d[o])-(u=s%v))/v,p=T-u<f?T-u:f,l=s-e,a=e-u>0?e-u:0;a<p;a++)h+=b[l+a]*y[a];if(h>.5)C[s]=1,u<w&&(w=u),u>x&&(x=u),c<E&&(E=c),c>S&&(S=c);else{for(p=I-c<f?I-c:f,l=s-e*v,a=e-c>0?e-c:0;a<p;a++)h+=b[l+a*v]*y[a];h>.5?(C[s]=1,u<w&&(w=u),u>x&&(x=u),c<E&&(E=c),c>S&&(S=c)):C[s]=0}}return{data:C,width:v,height:_,bounds:{minX:w,minY:E,maxX:x,maxY:S}}},n.createBorderMask=function(t){var e,n,r,i,o,a=t.width,s=t.height,l=t.data,u=t.bounds.minX,c=t.bounds.maxX,h=t.bounds.minY,p=t.bounds.maxY,d=c-u+1,f=p-h+1,g=new Uint8Array(d*f),y=Math.max(u,1),m=Math.min(c,a-2),v=Math.max(h,1),_=Math.min(p,s-2);for(n=v;n<_+1;n++)for(e=y;e<m+1;e++)0!==l[r=n*a+e]&&(i=r+a,o=r-a,0!==l[r+1]&&0!==l[r-1]&&0!==l[i]&&0!==l[i+1]&&0!==l[i-1]&&0!==l[o]&&0!==l[o+1]&&0!==l[o-1]||(g[(n-h)*d+(e-u)]=1));if(0==u)for(n=h;n<p+1;n++)1===l[n*a]&&(g[(n-h)*d]=1);if(c==a-1)for(n=h;n<p+1;n++)1===l[n*a+c]&&(g[(n-h)*d+(c-u)]=1);if(0==h)for(e=u;e<c+1;e++)1===l[e]&&(g[e-u]=1);if(p==s-1)for(e=u;e<c+1;e++)1===l[p*a+e]&&(g[(p-h)*d+(e-u)]=1);return{data:g,width:d,height:f,offset:{x:u,y:h}}},n.getBorderIndices=function(t){var e,n,r,i,o,a=t.width,s=t.height,l=t.data,u=[],c=a-1,h=s-1;for(n=1;n<h;n++)for(e=1;e<c;e++)0!==l[r=n*a+e]&&(i=r+a,o=r-a,0!==l[r+1]&&0!==l[r-1]&&0!==l[i]&&0!==l[i+1]&&0!==l[i-1]&&0!==l[o]&&0!==l[o+1]&&0!==l[o-1]||u.push(r));for(n=0;n<s;n++)1===l[n*a]&&u.push(n*a);for(e=0;e<a;e++)1===l[e]&&u.push(e);for(r=a-1,n=0;n<s;n++)1===l[n*a+r]&&u.push(n*a+r);for(r=(s-1)*a,e=0;e<a;e++)1===l[r+e]&&u.push(r+e);return u},n.traceContours=function(t){var e,n,r,i,o,a,s,l,u,c,h,p,d,f,g,y=function(t){var e,n,r=t.width,i=t.data,o=t.bounds.minX,a=t.bounds.maxX,s=t.bounds.minY,l=t.bounds.maxY,u=a-o+3,c=l-s+3,h=new Uint8Array(u*c);for(n=s;n<l+1;n++)for(e=o;e<a+1;e++)1===i[n*r+e]&&(h[(n-s+1)*u+(e-o+1)]=1);return{data:h,width:u,height:c,offset:{x:o-1,y:s-1}}}(t),m=[],v=0,_=y.width,b=2*_,w=y.height,x=y.data,E=y.offset.x,S=y.offset.y,O=new Uint8Array(x),C=[[1,0],[1,1],[0,1],[-1,1],[-1,0],[-1,-1],[0,-1],[1,-1]];for(i=1;i<w-1;i++)for(r=1;r<_-1;r++)if(1===x[o=i*_+r])for(e=-_;e<b;e+=b)if(0===x[o+e]&&0===O[o+e]){for(v++,s=[],u=(l=e===_)?2:6,p=d=c={x:r,y:i},h=null;;){for(O[p.y*_+p.x]=v,n=0;n<8;n++){if(g=C[u=(u+1)%8],1===x[a=(f={x:p.x+g[0],y:p.y+g[1]}).y*_+f.x]){O[a]=v;break}O[a]=-1,f=null}if(null===f)break;if(p=f,h){if(d.x===c.x&&d.y===c.y&&p.x===h.x&&p.y===h.y)break}else h=f;s.push({x:d.x+E,y:d.y+S}),d=p,u=(u+4)%8}null!=f&&(s.push({x:c.x+E,y:c.y+S}),m.push({inner:l,label:v,points:s}))}return m},n.simplifyContours=function(t,e,n){var r,i,o,a,s,l,u,c,h,p,d,f,g,y,m,v,_,b,w,x,E,S=t.length,O=[];for(i=0;i<S;i++)if(s=(a=t[i]).points,(l=a.points.length)<n){for(u=[],o=0;o<l;o++)u.push({x:s[o].x,y:s[o].y});O.push({inner:a.inner,label:a.label,points:u,initialCount:l})}else{c=[0,l-1],h=[{first:0,last:l-1}];do{if(!((p=h.shift()).last<=p.first+1)){for(d=-1,f=p.first,r=p.first+1;r<p.last;r++)w=s[r],x=s[p.first],E=s[p.last],_=w.x-x.x,b=w.y-x.y,y=Math.sqrt(_*_+b*b),_=w.x-E.x,b=w.y-E.y,m=Math.sqrt(_*_+b*b),_=x.x-E.x,b=x.y-E.y,v=Math.sqrt(_*_+b*b),(g=y>=Math.sqrt(m*m+v*v)?m:m>=Math.sqrt(y*y+v*v)?y:Math.abs((b*w.x-_*w.y+x.x*E.y-E.x*x.y)/v))>d&&(f=r,d=g);d>e&&(c.push(f),h.push({first:p.first,last:f}),h.push({first:f,last:p.last}))}}while(h.length>0);for(u=[],l=c.length,c.sort((function(t,e){return t-e})),o=0;o<l;o++)u.push({x:s[c[o]].x,y:s[c[o]].y});O.push({inner:a.inner,label:a.label,points:u,initialCount:a.points.length})}return O},n),t.exports=MagicWand},function(t,e,n){"use strict";n.r(e);var r=n(134);n.d(e,"Circle",(function(){return r.a}));var i=n(59);n.d(e,"Fill",(function(){return i.a}));var o=n(122);n.d(e,"Icon",(function(){return o.a}));var a=n(183);n.d(e,"IconImage",(function(){return a.a}));var s=n(145);n.d(e,"Image",(function(){return s.a}));var l=n(126);n.d(e,"RegularShape",(function(){return l.a}));var u=n(61);n.d(e,"Stroke",(function(){return u.a}));var c=n(41);n.d(e,"Style",(function(){return c.c}));var h=n(99);n.d(e,"Text",(function(){return h.a}))},function(t,e,n){"use strict";n.r(e),n.d(e,"DoubleClickZoom",(function(){return l})),n.d(e,"DragAndDrop",(function(){return Q})),n.d(e,"DragBox",(function(){return T})),n.d(e,"DragPan",(function(){return u.a})),n.d(e,"DragRotate",(function(){return g})),n.d(e,"DragRotateAndZoom",(function(){return et})),n.d(e,"DragZoom",(function(){return P})),n.d(e,"Draw",(function(){return nt.a})),n.d(e,"Extent",(function(){return yt})),n.d(e,"Interaction",(function(){return o.a})),n.d(e,"KeyboardPan",(function(){return D})),n.d(e,"KeyboardZoom",(function(){return z})),n.d(e,"Modify",(function(){return mt.a})),n.d(e,"MouseWheelZoom",(function(){return B.a})),n.d(e,"PinchRotate",(function(){return q})),n.d(e,"PinchZoom",(function(){return X})),n.d(e,"Pointer",(function(){return c.b})),n.d(e,"Select",(function(){return vt.a})),n.d(e,"Snap",(function(){return _t.a})),n.d(e,"Translate",(function(){return bt.a})),n.d(e,"defaults",(function(){return wt}));var r,i=n(37),o=n(70),a=n(29),s=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),l=function(t){function e(e){var n=t.call(this)||this,r=e||{};return n.delta_=r.delta?r.delta:1,n.duration_=void 0!==r.duration?r.duration:250,n}return s(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==a.a.DBLCLICK){var n=t.originalEvent,r=t.map,i=t.coordinate,s=n.shiftKey?-this.delta_:this.delta_,l=r.getView();Object(o.c)(l,s,i,this.duration_),n.preventDefault(),e=!0}return!e},e}(o.a),u=n(185),c=n(38),h=n(30),p=n(20),d=n(118),f=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),g=function(t){function e(e){var n=this,r=e||{};return(n=t.call(this,{stopDown:h.a})||this).condition_=r.condition?r.condition:p.c,n.lastAngle_=void 0,n.duration_=void 0!==r.duration?r.duration:250,n}return f(e,t),e.prototype.handleDragEvent=function(t){if(Object(p.h)(t)){var e=t.map,n=e.getView();if(n.getConstraints().rotation!==d.c){var r=e.getSize(),i=t.pixel,o=Math.atan2(r[1]/2-i[1],i[0]-r[0]/2);if(void 0!==this.lastAngle_){var a=o-this.lastAngle_;n.adjustRotationInternal(-a)}this.lastAngle_=o}}},e.prototype.handleUpEvent=function(t){return!Object(p.h)(t)||(t.map.getView().endInteraction(this.duration_),!1)},e.prototype.handleDownEvent=function(t){return!!Object(p.h)(t)&&(!(!Object(p.g)(t)||!this.condition_(t))&&(t.map.getView().beginInteraction(),this.lastAngle_=void 0,!0))},e}(c.b),y=n(40),m=n(111),v=n(22),_=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),b=function(t){function e(e){var n=t.call(this)||this;return n.geometry_=null,n.element_=document.createElement("div"),n.element_.style.position="absolute",n.element_.style.pointerEvents="auto",n.element_.className="ol-box "+e,n.map_=null,n.startPixel_=null,n.endPixel_=null,n}return _(e,t),e.prototype.disposeInternal=function(){this.setMap(null)},e.prototype.render_=function(){var t=this.startPixel_,e=this.endPixel_,n=this.element_.style;n.left=Math.min(t[0],e[0])+"px",n.top=Math.min(t[1],e[1])+"px",n.width=Math.abs(e[0]-t[0])+"px",n.height=Math.abs(e[1]-t[1])+"px"},e.prototype.setMap=function(t){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);var e=this.element_.style;e.left="inherit",e.top="inherit",e.width="inherit",e.height="inherit"}this.map_=t,this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)},e.prototype.setPixels=function(t,e){this.startPixel_=t,this.endPixel_=e,this.createOrUpdateGeometry(),this.render_()},e.prototype.createOrUpdateGeometry=function(){var t=this.startPixel_,e=this.endPixel_,n=[t,[t[0],e[1]],e,[e[0],t[1]]].map(this.map_.getCoordinateFromPixelInternal,this.map_);n[4]=n[0].slice(),this.geometry_?this.geometry_.setCoordinates([n]):this.geometry_=new v.a([n])},e.prototype.getGeometry=function(){return this.geometry_},e}(m.a),w=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),x="boxstart",E="boxdrag",S="boxend",O="boxcancel",C=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.coordinate=n,i.mapBrowserEvent=r,i}return w(e,t),e}(y.a),T=function(t){function e(e){var n=t.call(this)||this;n.on,n.once,n.un;var r=e||{};return n.box_=new b(r.className||"ol-dragbox"),n.minArea_=void 0!==r.minArea?r.minArea:64,r.onBoxEnd&&(n.onBoxEnd=r.onBoxEnd),n.startPixel_=null,n.condition_=r.condition?r.condition:p.g,n.boxEndCondition_=r.boxEndCondition?r.boxEndCondition:n.defaultBoxEndCondition,n}return w(e,t),e.prototype.defaultBoxEndCondition=function(t,e,n){var r=n[0]-e[0],i=n[1]-e[1];return r*r+i*i>=this.minArea_},e.prototype.getGeometry=function(){return this.box_.getGeometry()},e.prototype.handleDragEvent=function(t){this.box_.setPixels(this.startPixel_,t.pixel),this.dispatchEvent(new C(E,t.coordinate,t))},e.prototype.handleUpEvent=function(t){this.box_.setMap(null);var e=this.boxEndCondition_(t,this.startPixel_,t.pixel);return e&&this.onBoxEnd(t),this.dispatchEvent(new C(e?S:O,t.coordinate,t)),!1},e.prototype.handleDownEvent=function(t){return!!this.condition_(t)&&(this.startPixel_=t.pixel,this.box_.setMap(t.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new C(x,t.coordinate,t)),!0)},e.prototype.onBoxEnd=function(t){},e}(c.b),I=n(74),L=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),P=function(t){function e(e){var n=this,r=e||{},i=r.condition?r.condition:p.m;return(n=t.call(this,{condition:i,className:r.className||"ol-dragzoom",minArea:r.minArea})||this).duration_=void 0!==r.duration?r.duration:200,n.out_=void 0!==r.out&&r.out,n}return L(e,t),e.prototype.onBoxEnd=function(t){var e=this.getMap().getView(),n=this.getGeometry();if(this.out_){var r=e.rotatedExtentForGeometry(n),i=e.getResolutionForExtentInternal(r),o=e.getResolution()/i;(n=n.clone()).scale(o*o)}e.fitInternal(n,{duration:this.duration_,easing:I.b})},e}(T),R=n(9),M=37,N=38,j=39,A=40,k=n(21),F=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),D=function(t){function e(e){var n=t.call(this)||this,r=e||{};return n.defaultCondition_=function(t){return Object(p.j)(t)&&Object(p.o)(t)},n.condition_=void 0!==r.condition?r.condition:n.defaultCondition_,n.duration_=void 0!==r.duration?r.duration:100,n.pixelDelta_=void 0!==r.pixelDelta?r.pixelDelta:128,n}return F(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==R.a.KEYDOWN){var n=t.originalEvent,r=n.keyCode;if(this.condition_(t)&&(r==A||r==M||r==j||r==N)){var i=t.map.getView(),a=i.getResolution()*this.pixelDelta_,s=0,l=0;r==A?l=-a:r==M?s=-a:r==j?s=a:l=a;var u=[s,l];Object(k.h)(u,i.getRotation()),Object(o.b)(i,u,this.duration_),n.preventDefault(),e=!0}}return!e},e}(o.a),G=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),z=function(t){function e(e){var n=t.call(this)||this,r=e||{};return n.condition_=r.condition?r.condition:p.o,n.delta_=r.delta?r.delta:1,n.duration_=void 0!==r.duration?r.duration:100,n}return G(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==R.a.KEYDOWN||t.type==R.a.KEYPRESS){var n=t.originalEvent,r=n.charCode;if(this.condition_(t)&&(r=="+".charCodeAt(0)||r=="-".charCodeAt(0))){var i=t.map,a=r=="+".charCodeAt(0)?this.delta_:-this.delta_,s=i.getView();Object(o.c)(s,a,void 0,this.duration_),n.preventDefault(),e=!0}}return!e},e}(o.a),U=n(204),B=n(170),V=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),q=function(t){function e(e){var n=this,r=e||{},i=r;return i.stopDown||(i.stopDown=h.a),(n=t.call(this,i)||this).anchor_=null,n.lastAngle_=void 0,n.rotating_=!1,n.rotationDelta_=0,n.threshold_=void 0!==r.threshold?r.threshold:.3,n.duration_=void 0!==r.duration?r.duration:250,n}return V(e,t),e.prototype.handleDragEvent=function(t){var e=0,n=this.targetPointers[0],r=this.targetPointers[1],i=Math.atan2(r.clientY-n.clientY,r.clientX-n.clientX);if(void 0!==this.lastAngle_){var o=i-this.lastAngle_;this.rotationDelta_+=o,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),e=o}this.lastAngle_=i;var a=t.map,s=a.getView();if(s.getConstraints().rotation!==d.c){var l=a.getViewport().getBoundingClientRect(),u=Object(c.a)(this.targetPointers);u[0]-=l.left,u[1]-=l.top,this.anchor_=a.getCoordinateFromPixelInternal(u),this.rotating_&&(a.render(),s.adjustRotationInternal(e,this.anchor_))}},e.prototype.handleUpEvent=function(t){return!(this.targetPointers.length<2)||(t.map.getView().endInteraction(this.duration_),!1)},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var e=t.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1},e}(c.b),Y=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),X=function(t){function e(e){var n=this,r=e||{},i=r;return i.stopDown||(i.stopDown=h.a),(n=t.call(this,i)||this).anchor_=null,n.duration_=void 0!==r.duration?r.duration:400,n.lastDistance_=void 0,n.lastScaleDelta_=1,n}return Y(e,t),e.prototype.handleDragEvent=function(t){var e=1,n=this.targetPointers[0],r=this.targetPointers[1],i=n.clientX-r.clientX,o=n.clientY-r.clientY,a=Math.sqrt(i*i+o*o);void 0!==this.lastDistance_&&(e=this.lastDistance_/a),this.lastDistance_=a;var s=t.map,l=s.getView();1!=e&&(this.lastScaleDelta_=e);var u=s.getViewport().getBoundingClientRect(),h=Object(c.a)(this.targetPointers);h[0]-=u.left,h[1]-=u.top,this.anchor_=s.getCoordinateFromPixelInternal(h),s.render(),l.adjustResolutionInternal(e,this.anchor_)},e.prototype.handleUpEvent=function(t){if(this.targetPointers.length<2){var e=t.map.getView(),n=this.lastScaleDelta_>1?1:-1;return e.endInteraction(this.duration_,n),!1}return!0},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var e=t.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1},e}(c.b),W=n(80),H=n(2),K=n(10),Z=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),$="addfeatures",J=function(t){function e(e,n,r,i){var o=t.call(this,e)||this;return o.features=r,o.file=n,o.projection=i,o}return Z(e,t),e}(y.a),Q=function(t){function e(e){var n=this,r=e||{};(n=t.call(this,{handleEvent:h.b})||this).on,n.once,n.un,n.readAsBuffer_=!1,n.formats_=[];for(var i=r.formatConstructors?r.formatConstructors:[],o=0,a=i.length;o<a;++o){var s=i[o];"function"==typeof s&&(s=new s),n.formats_.push(s),n.readAsBuffer_=n.readAsBuffer_||s.getType()===W.a.ARRAY_BUFFER}return n.projection_=r.projection?Object(H.get)(r.projection):null,n.dropListenKeys_=null,n.source_=r.source||null,n.target=r.target?r.target:null,n}return Z(e,t),e.prototype.handleResult_=function(t,e){var n,r=e.target.result,i=this.getMap(),o=this.projection_;o||(o=i.getView().getProjection());for(var a=this.formats_,s=0,l=a.length;s<l;++s){var u=a[s],c=r;this.readAsBuffer_&&u.getType()!==W.a.ARRAY_BUFFER&&(void 0===n&&(n=(new TextDecoder).decode(r)),c=n);var h=this.tryReadFeatures_(u,c,{featureProjection:o});if(h&&h.length>0){this.source_&&(this.source_.clear(),this.source_.addFeatures(h)),this.dispatchEvent(new J($,t,h,o));break}}},e.prototype.registerListeners_=function(){var t=this.getMap();if(t){var e=this.target?this.target:t.getViewport();this.dropListenKeys_=[Object(K.listen)(e,R.a.DROP,this.handleDrop,this),Object(K.listen)(e,R.a.DRAGENTER,this.handleStop,this),Object(K.listen)(e,R.a.DRAGOVER,this.handleStop,this),Object(K.listen)(e,R.a.DROP,this.handleStop,this)]}},e.prototype.setActive=function(e){!this.getActive()&&e&&this.registerListeners_(),this.getActive()&&!e&&this.unregisterListeners_(),t.prototype.setActive.call(this,e)},e.prototype.setMap=function(e){this.unregisterListeners_(),t.prototype.setMap.call(this,e),this.getActive()&&this.registerListeners_()},e.prototype.tryReadFeatures_=function(t,e,n){try{return t.readFeatures(e,n)}catch(t){return null}},e.prototype.unregisterListeners_=function(){this.dropListenKeys_&&(this.dropListenKeys_.forEach(K.unlistenByKey),this.dropListenKeys_=null)},e.prototype.handleDrop=function(t){for(var e=t.dataTransfer.files,n=0,r=e.length;n<r;++n){var i=e.item(n),o=new FileReader;o.addEventListener(R.a.LOAD,this.handleResult_.bind(this,i)),this.readAsBuffer_?o.readAsArrayBuffer(i):o.readAsText(i)}},e.prototype.handleStop=function(t){t.stopPropagation(),t.preventDefault(),t.dataTransfer.dropEffect="copy"},e}(o.a),tt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),et=function(t){function e(e){var n=this,r=e||{};return(n=t.call(this,r)||this).condition_=r.condition?r.condition:p.m,n.lastAngle_=void 0,n.lastMagnitude_=void 0,n.lastScaleDelta_=0,n.duration_=void 0!==r.duration?r.duration:400,n}return tt(e,t),e.prototype.handleDragEvent=function(t){if(Object(p.h)(t)){var e=t.map,n=e.getSize(),r=t.pixel,i=r[0]-n[0]/2,o=n[1]/2-r[1],a=Math.atan2(o,i),s=Math.sqrt(i*i+o*o),l=e.getView();if(void 0!==this.lastAngle_){var u=this.lastAngle_-a;l.adjustRotationInternal(u)}this.lastAngle_=a,void 0!==this.lastMagnitude_&&l.adjustResolutionInternal(this.lastMagnitude_/s),void 0!==this.lastMagnitude_&&(this.lastScaleDelta_=this.lastMagnitude_/s),this.lastMagnitude_=s}},e.prototype.handleUpEvent=function(t){if(!Object(p.h)(t))return!0;var e=t.map.getView(),n=this.lastScaleDelta_>1?1:-1;return e.endInteraction(this.duration_,n),this.lastScaleDelta_=0,!1},e.prototype.handleDownEvent=function(t){return!!Object(p.h)(t)&&(!!this.condition_(t)&&(t.map.getView().beginInteraction(),this.lastAngle_=void 0,this.lastMagnitude_=void 0,!0))},e}(c.b),nt=n(227),rt=n(26),it=n(1),ot=n(31),at=n(65),st=n(66),lt=n(0),ut=n(41),ct=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ht="extentchanged",pt=function(t){function e(e){var n=t.call(this,ht)||this;return n.extent=e,n}return ct(e,t),e}(y.a);function dt(){var t=Object(ut.b)();return function(e,n){return t[it.a.POINT]}}function ft(t){return function(e){return Object(lt.boundingExtent)([t,e])}}function gt(t,e){return t[0]==e[0]?function(n){return Object(lt.boundingExtent)([t,[n[0],e[1]]])}:t[1]==e[1]?function(n){return Object(lt.boundingExtent)([t,[e[0],n[1]]])}:null}var yt=function(t){function e(e){var n,r=this,i=e||{};return(r=t.call(this,i)||this).on,r.once,r.un,r.condition_=i.condition?i.condition:p.d,r.extent_=null,r.pointerHandler_=null,r.pixelTolerance_=void 0!==i.pixelTolerance?i.pixelTolerance:10,r.snappedToVertex_=!1,r.extentFeature_=null,r.vertexFeature_=null,e||(e={}),r.extentOverlay_=new at.a({source:new st.a({useSpatialIndex:!1,wrapX:!!e.wrapX}),style:e.boxStyle?e.boxStyle:(n=Object(ut.b)(),function(t,e){return n[it.a.POLYGON]}),updateWhileAnimating:!0,updateWhileInteracting:!0}),r.vertexOverlay_=new at.a({source:new st.a({useSpatialIndex:!1,wrapX:!!e.wrapX}),style:e.pointerStyle?e.pointerStyle:dt(),updateWhileAnimating:!0,updateWhileInteracting:!0}),e.extent&&r.setExtent(e.extent),r}return ct(e,t),e.prototype.snapToVertex_=function(t,e){var n=e.getCoordinateFromPixelInternal(t),r=this.getExtentInternal();if(r){var i=function(t){return[[[t[0],t[1]],[t[0],t[3]]],[[t[0],t[3]],[t[2],t[3]]],[[t[2],t[3]],[t[2],t[1]]],[[t[2],t[1]],[t[0],t[1]]]]}(r);i.sort((function(t,e){return Object(k.k)(n,t)-Object(k.k)(n,e)}));var o=i[0],a=Object(k.c)(n,o),s=e.getPixelFromCoordinateInternal(a);if(Object(k.e)(t,s)<=this.pixelTolerance_){var l=e.getPixelFromCoordinateInternal(o[0]),u=e.getPixelFromCoordinateInternal(o[1]),c=Object(k.j)(s,l),h=Object(k.j)(s,u),p=Math.sqrt(Math.min(c,h));return this.snappedToVertex_=p<=this.pixelTolerance_,this.snappedToVertex_&&(a=c>h?o[1]:o[0]),a}}return null},e.prototype.handlePointerMove_=function(t){var e=t.pixel,n=t.map,r=this.snapToVertex_(e,n);r||(r=n.getCoordinateFromPixelInternal(e)),this.createOrUpdatePointerFeature_(r)},e.prototype.createOrUpdateExtentFeature_=function(t){var e=this.extentFeature_;return e?t?e.setGeometry(Object(v.c)(t)):e.setGeometry(void 0):(e=t?new rt.a(Object(v.c)(t)):new rt.a({}),this.extentFeature_=e,this.extentOverlay_.getSource().addFeature(e)),e},e.prototype.createOrUpdatePointerFeature_=function(t){var e=this.vertexFeature_;e?e.getGeometry().setCoordinates(t):(e=new rt.a(new ot.a(t)),this.vertexFeature_=e,this.vertexOverlay_.getSource().addFeature(e));return e},e.prototype.handleEvent=function(e){return!e.originalEvent||!this.condition_(e)||(e.type!=a.a.POINTERMOVE||this.handlingDownUpSequence||this.handlePointerMove_(e),t.prototype.handleEvent.call(this,e),!1)},e.prototype.handleDownEvent=function(t){var e=t.pixel,n=t.map,r=this.getExtentInternal(),i=this.snapToVertex_(e,n),o=function(t){var e=null,n=null;return t[0]==r[0]?e=r[2]:t[0]==r[2]&&(e=r[0]),t[1]==r[1]?n=r[3]:t[1]==r[3]&&(n=r[1]),null!==e&&null!==n?[e,n]:null};if(i&&r){var a=i[0]==r[0]||i[0]==r[2]?i[0]:null,s=i[1]==r[1]||i[1]==r[3]?i[1]:null;null!==a&&null!==s?this.pointerHandler_=ft(o(i)):null!==a?this.pointerHandler_=gt(o([a,r[1]]),o([a,r[3]])):null!==s&&(this.pointerHandler_=gt(o([r[0],s]),o([r[2],s])))}else i=n.getCoordinateFromPixelInternal(e),this.setExtent([i[0],i[1],i[0],i[1]]),this.pointerHandler_=ft(i);return!0},e.prototype.handleDragEvent=function(t){if(this.pointerHandler_){var e=t.coordinate;this.setExtent(this.pointerHandler_(e)),this.createOrUpdatePointerFeature_(e)}},e.prototype.handleUpEvent=function(t){this.pointerHandler_=null;var e=this.getExtentInternal();return e&&0!==Object(lt.getArea)(e)||this.setExtent(null),!1},e.prototype.setMap=function(e){this.extentOverlay_.setMap(e),this.vertexOverlay_.setMap(e),t.prototype.setMap.call(this,e)},e.prototype.getExtent=function(){return Object(H.toUserExtent)(this.getExtentInternal(),this.getMap().getView().getProjection())},e.prototype.getExtentInternal=function(){return this.extent_},e.prototype.setExtent=function(t){this.extent_=t||null,this.createOrUpdateExtentFeature_(t),this.dispatchEvent(new pt(this.extent_))},e}(c.b),mt=n(228),vt=n(229),_t=n(230),bt=n(186);function wt(t){var e=t||{},n=new i.a,r=new U.a(-.005,.05,100);return(void 0===e.altShiftDragRotate||e.altShiftDragRotate)&&n.push(new g),(void 0===e.doubleClickZoom||e.doubleClickZoom)&&n.push(new l({delta:e.zoomDelta,duration:e.zoomDuration})),(void 0===e.dragPan||e.dragPan)&&n.push(new u.a({onFocusOnly:e.onFocusOnly,kinetic:r})),(void 0===e.pinchRotate||e.pinchRotate)&&n.push(new q),(void 0===e.pinchZoom||e.pinchZoom)&&n.push(new X({duration:e.zoomDuration})),(void 0===e.keyboard||e.keyboard)&&(n.push(new D),n.push(new z({delta:e.zoomDelta,duration:e.zoomDuration}))),(void 0===e.mouseWheelZoom||e.mouseWheelZoom)&&n.push(new B.a({onFocusOnly:e.onFocusOnly,duration:e.zoomDuration})),(void 0===e.shiftDragZoom||e.shiftDragZoom)&&n.push(new P({duration:e.zoomDuration})),n}},function(t,e){t.exports=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}},function(t,e,n){"use strict";var r,i=n(126),o=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),a=function(t){function e(e){var n=e||{};return t.call(this,{points:1/0,fill:n.fill,radius:n.radius,stroke:n.stroke,scale:void 0!==n.scale?n.scale:1,rotation:void 0!==n.rotation?n.rotation:0,rotateWithView:void 0!==n.rotateWithView&&n.rotateWithView,displacement:void 0!==n.displacement?n.displacement:[0,0]})||this}return o(e,t),e.prototype.clone=function(){var t=this.getScale(),n=new e({fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,radius:this.getRadius(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice()});return n.setOpacity(this.getOpacity()),n},e.prototype.setRadius=function(t){this.radius_=t,this.render()},e}(i.a);e.a=a},function(t,e,n){"use strict";var r,i=n(54),o=n(117),a=n(85),s=n(36),l=n(0),u=n(10),c=n(25),h=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),p="element",d="map",f="offset",g="position",y="positioning",m=function(t){function e(e){var n=t.call(this)||this;n.on,n.once,n.un,n.options=e,n.id=e.id,n.insertFirst=void 0===e.insertFirst||e.insertFirst,n.stopEvent=void 0===e.stopEvent||e.stopEvent,n.element=document.createElement("div"),n.element.className=void 0!==e.className?e.className:"ol-overlay-container "+s.d,n.element.style.position="absolute",n.element.style.pointerEvents="auto";var r=e.autoPan;return r&&"object"!=typeof r&&(r={animation:e.autoPanAnimation,margin:e.autoPanMargin}),n.autoPan=r||!1,n.rendered={transform_:"",visible:!0},n.mapPostrenderListenerKey=null,n.addChangeListener(p,n.handleElementChanged),n.addChangeListener(d,n.handleMapChanged),n.addChangeListener(f,n.handleOffsetChanged),n.addChangeListener(g,n.handlePositionChanged),n.addChangeListener(y,n.handlePositioningChanged),void 0!==e.element&&n.setElement(e.element),n.setOffset(void 0!==e.offset?e.offset:[0,0]),n.setPositioning(void 0!==e.positioning?e.positioning:a.a.TOP_LEFT),void 0!==e.position&&n.setPosition(e.position),n}return h(e,t),e.prototype.getElement=function(){return this.get(p)},e.prototype.getId=function(){return this.id},e.prototype.getMap=function(){return this.get(d)},e.prototype.getOffset=function(){return this.get(f)},e.prototype.getPosition=function(){return this.get(g)},e.prototype.getPositioning=function(){return this.get(y)},e.prototype.handleElementChanged=function(){Object(c.d)(this.element);var t=this.getElement();t&&this.element.appendChild(t)},e.prototype.handleMapChanged=function(){this.mapPostrenderListenerKey&&(Object(c.e)(this.element),Object(u.unlistenByKey)(this.mapPostrenderListenerKey),this.mapPostrenderListenerKey=null);var t=this.getMap();if(t){this.mapPostrenderListenerKey=Object(u.listen)(t,o.a.POSTRENDER,this.render,this),this.updatePixelPosition();var e=this.stopEvent?t.getOverlayContainerStopEvent():t.getOverlayContainer();this.insertFirst?e.insertBefore(this.element,e.childNodes[0]||null):e.appendChild(this.element),this.performAutoPan()}},e.prototype.render=function(){this.updatePixelPosition()},e.prototype.handleOffsetChanged=function(){this.updatePixelPosition()},e.prototype.handlePositionChanged=function(){this.updatePixelPosition(),this.performAutoPan()},e.prototype.handlePositioningChanged=function(){this.updatePixelPosition()},e.prototype.setElement=function(t){this.set(p,t)},e.prototype.setMap=function(t){this.set(d,t)},e.prototype.setOffset=function(t){this.set(f,t)},e.prototype.setPosition=function(t){this.set(g,t)},e.prototype.performAutoPan=function(){this.autoPan&&this.panIntoView(this.autoPan)},e.prototype.panIntoView=function(t){var e=this.getMap();if(e&&e.getTargetElement()&&this.get(g)){var n=this.getRect(e.getTargetElement(),e.getSize()),r=this.getElement(),i=this.getRect(r,[Object(c.c)(r),Object(c.b)(r)]),o=t||{},a=void 0===o.margin?20:o.margin;if(!Object(l.containsExtent)(n,i)){var s=i[0]-n[0],u=n[2]-i[2],h=i[1]-n[1],p=n[3]-i[3],d=[0,0];if(s<0?d[0]=s-a:u<0&&(d[0]=Math.abs(u)+a),h<0?d[1]=h-a:p<0&&(d[1]=Math.abs(p)+a),0!==d[0]||0!==d[1]){var f=e.getView().getCenterInternal(),y=e.getPixelFromCoordinateInternal(f);if(!y)return;var m=[y[0]+d[0],y[1]+d[1]],v=o.animation||{};e.getView().animateInternal({center:e.getCoordinateFromPixelInternal(m),duration:v.duration,easing:v.easing})}}}},e.prototype.getRect=function(t,e){var n=t.getBoundingClientRect(),r=n.left+window.pageXOffset,i=n.top+window.pageYOffset;return[r,i,r+e[0],i+e[1]]},e.prototype.setPositioning=function(t){this.set(y,t)},e.prototype.setVisible=function(t){this.rendered.visible!==t&&(this.element.style.display=t?"":"none",this.rendered.visible=t)},e.prototype.updatePixelPosition=function(){var t=this.getMap(),e=this.getPosition();if(t&&t.isRendered()&&e){var n=t.getPixelFromCoordinate(e),r=t.getSize();this.updateRenderedPosition(n,r)}else this.setVisible(!1)},e.prototype.updateRenderedPosition=function(t,e){var n=this.element.style,r=this.getOffset(),i=this.getPositioning();this.setVisible(!0);var o=Math.round(t[0]+r[0])+"px",s=Math.round(t[1]+r[1])+"px",l="0%",u="0%";i==a.a.BOTTOM_RIGHT||i==a.a.CENTER_RIGHT||i==a.a.TOP_RIGHT?l="-100%":i!=a.a.BOTTOM_CENTER&&i!=a.a.CENTER_CENTER&&i!=a.a.TOP_CENTER||(l="-50%"),i==a.a.BOTTOM_LEFT||i==a.a.BOTTOM_CENTER||i==a.a.BOTTOM_RIGHT?u="-100%":i!=a.a.CENTER_LEFT&&i!=a.a.CENTER_CENTER&&i!=a.a.CENTER_RIGHT||(u="-50%");var c="translate("+l+", "+u+") translate("+o+", "+s+")";this.rendered.transform_!=c&&(this.rendered.transform_=c,n.transform=c,n.msTransform=c)},e.prototype.getOptions=function(){return this.options},e}(i.a);e.a=m},function(t,e,n){"use strict";n.d(e,"a",(function(){return q}));var r=n(133),i=n.n(r),o=n(189),a=n.n(o),s=n(237),l=n.n(s),u=n(24),c=n.n(u),h=n(27),p=n.n(h),d=n(223),f=n.n(d),g=n(44),y=n(5),m=n(42),v=n(18),_=n(135),b=n(20),w=n(46);function x(){var t=document.createElement("div");t.className="pma-ui-viewport-tooltip pma-ui-viewport-tooltip-measure";var e=new _.a({element:t,offset:[0,-15],positioning:"bottom-center",stopEvent:!1,insertFirst:!1});this.map.addOverlay(e),e.element=t,t.parentElement.style.display="block";var n=this;return Object(m.a)(t,"click",(function(){n.map.removeOverlay(e),n.measureLayer.getSource().removeFeature(e.sketch),t.parentNode&&t.parentNode.removeChild(t),t=null})),e}function E(t){if(!this.measureDraw){t="area"===t?"Polygon":"LineString",this.measureDraw=new v.a.interaction.Draw({source:this.measureLayer.getSource(),type:t,geometryFunction:null,style:new v.a.style.Style({fill:new v.a.style.Fill({color:"rgba(255, 255, 255, 0.2)"}),stroke:new v.a.style.Stroke({color:"rgba(0, 0, 0, 0.5)",lineDash:[10,10],width:2}),image:new v.a.style.Circle({radius:5,stroke:new v.a.style.Stroke({color:"rgba(0, 0, 0, 0.7)"}),fill:new v.a.style.Fill({color:"rgba(255, 255, 255, 0.2)"})})}),condition:b.j,freehandCondition:b.i}),this.map.addInteraction(this.measureDraw);var e,n,r=this,i=x.call(this);this.measureTooltips.push(i),this.measureDraw.on("drawstart",(function(t){n=t.feature,i.sketch=n;var o=t.coordinate;e=n.getGeometry().on("change",(function(t){var e,n=t.target;n instanceof v.a.geom.Polygon?(e=C.call(r,n),o=n.getInteriorPoint().getCoordinates()):n instanceof v.a.geom.LineString&&(e=O.call(r,n),o=n.getLastCoordinate()),i.element.innerHTML=e,i.setPosition(o)}))}),this),this.measureDraw.on("drawend",(function(){i.element.className="pma-ui-viewport-tooltip pma-ui-viewport-tooltip-static",i.setOffset([0,-7]),i.sketch=n,n=null,Object(w.b)(e),setTimeout((function(){S.call(r)}),100)}),this)}}function S(t){if(this.measureDraw&&(this.map.removeInteraction(this.measureDraw),this.measureDraw=null),1==t)for(;this.measureTooltips.length>0;){var e=this.measureTooltips.pop();this.map.removeOverlay(e),this.measureLayer.getSource().removeFeature(e.sketch),e.element.parentNode&&e.element.parentNode.removeChild(e.element)}}function O(t){if(0===this.imageInfo.MicrometresPerPixelX)return t.getLength()+" px";var e=t.getLength()*this.imageInfo.MicrometresPerPixelX;return e>=1e3?Math.round(10*e/1e3)/10+" mm":Math.round(10*e)/10+" μm"}function C(t){if(0===this.imageInfo.MicrometresPerPixelX)return t.getArea()+" px<sup>2</sup>";var e=t.getArea()*this.imageInfo.MicrometresPerPixelX*this.imageInfo.MicrometresPerPixelX;return e>1e4?Math.round(10*e/1e6)/10+" mm<sup>2</sup>":Math.round(10*e)/10+" μm<sup>2</sup>"}var T,I=n(160),L=n(242),P=n(22),R=n(99),M=n(59),N=n(61);n(171),n(172);function j(t){var e=-1;T||(T=function(){for(var t=new Int32Array(256),e=0;e<256;e++){for(var n=e,r=0;r<8;r++)n=1&n?3988292384^n>>>1:n>>>1;t[e]=n}return t}());for(var n=0;n<t.length;n++)e=T[255&(e^t[n])]^e>>>8;return-1^e}var A="image/png",k="image/jpeg",F="p".charCodeAt(0),D="H".charCodeAt(0),G="Y".charCodeAt(0),z="s".charCodeAt(0);function U(t,e){var n=t.slice(0,33);return new Promise((function(r,i){var o=new FileReader;o.onload=function(){var n=new Uint8Array(o.result),i=t.slice(33),a=B(n,e,t.type);r(new Blob([a,i],{type:t.type}))},o.readAsArrayBuffer(n)}))}function B(t,e,n,r){if(n===k)return t[13]=1,t[14]=e>>8,t[15]=255&e,t[16]=e>>8,t[17]=255&e,t;if(n===A){var i=new Uint8Array(13);e*=39.3701,i[0]=F,i[1]=D,i[2]=G,i[3]=z,i[4]=e>>>24,i[5]=e>>>16,i[6]=e>>>8,i[7]=255&e,i[8]=i[4],i[9]=i[5],i[10]=i[6],i[11]=i[7],i[12]=1;var o=j(i),a=new Uint8Array(4);if(a[0]=o>>>24,a[1]=o>>>16,a[2]=o>>>8,a[3]=255&o,r){var s=function(t){for(var e=t.length-1;e>=4;e--)if(9===t[e-4]&&t[e-3]===F&&t[e-2]===D&&t[e-1]===G&&t[e]===z)return e-3}(t);return t.set(i,s),t.set(a,s+13),t}var l=new Uint8Array(4);l[0]=0,l[1]=0,l[2]=0,l[3]=9;var u=new Uint8Array(54);return u.set(t,0),u.set(l,33),u.set(i,37),u.set(a,50),u}}function V(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}var q=function(){function t(e,n,r){if(c()(this,t),this.options=e,this.options.hasOwnProperty("magnifier")||(this.options.magnifier=!1),this.options.hasOwnProperty("colorAdjustments")||(this.options.colorAdjustments=!1),this.options.hasOwnProperty("annotations")||(this.options.annotations=!1),this.options.hasOwnProperty("fullscreenControl")||(this.options.fullscreenControl=!0),this.readyCallback=n,this.failCallback=r,this.options.flip||(this.options.flip={horizontally:!1,vertically:!1}),Object(g.b)(e.element)){if("string"!=typeof e.caller)throw"function"==typeof this.failCallback&&this.failCallback(),"Caller parameter not supplied";if("string"!=typeof e.theme&&(e.theme="default"),!e.element)throw"function"==typeof this.failCallback&&this.failCallback(),"No element provided";if(e.element instanceof HTMLElement)this.element=e.element;else if("string"==typeof e.element){var i=document.querySelector(e.element);if(!i)throw"Invalid selector for element";this.element=i}if(this.userInfo=null,this.imageInfo=e.imageInfo,e.image)this.image=e.image;else{if(!this.imageInfo)throw"function"==typeof this.failCallback&&this.failCallback(),"No image path or UID provided";this.image=this.imageInfo.Filename}if(e.sessionID)this.sessionID=e.sessionID;else{if(!e.username&&!e.password)throw"function"==typeof this.failCallback&&this.failCallback(),"SessionID or Username not provided. Cannot login.";if(this.username=e.username,this.password=e.password,!e.username||!e.password)throw"function"==typeof this.failCallback&&this.failCallback(),"Username and/or password not povided"}if(e.serverUrls&&e.serverUrls instanceof Array&&e.serverUrls.length>0)this.serverUrls=e.serverUrls;else if(!this.imageInfo)throw"function"==typeof this.failCallback&&this.failCallback(),"Server URLs not provided or is not an array and no image info was given.";this.overviewControl=null,this.dimensionsControl=null,this.barcodeControl=null,this.colorAdjustmentsControl=null,this.rotationControl=null,this.layerSwitcher=null,this.mouseWheelInteraction=null,this.measureDraw=null,this.zoomSliderControl=null,this.scaleLineControl=null,this.magnifierControl=null,this.filenameControl=null,this.snapShotControl=null,this.attributionControl=null,this.serviceUrl=null,this.imagesUrl=null,this.channelsString=null,this.channelClippingString=null,this.channelGammaString=null,this.imageAdjustments={brightness:0,contrast:1,gamma:1,rgb:[1,1,1],tileTransformers:[]},void 0===this.options.loadingBar&&(this.options.loadingBar=!0),void 0===this.options.annotationsLayers&&(this.options.annotationsLayers=!0),this.listeners={},this.listeners[y.g.DimensionsChanged]=[],this.listeners[y.g.ViewChanged]=[],this.listeners[y.g.TilesError]=[],this.listeners[y.g.SlideLoadError]=[],this.listeners[y.g.FilenameClick]=[],this.listeners[y.g.AnnotationLayerChanged]=[],this.map=null,m.o.call(this)}}return p()(t,[{key:"calculateArea",value:function(t){if(0===this.imageInfo.MicrometresPerPixelX)return 0;var e=null;if(t instanceof v.a.geom.Polygon)e=t.getCoordinates()[0];else{if(t instanceof v.a.geom.LineString)return 0;if(!(t instanceof v.a.geom.Circle)){if(t instanceof v.a.geom.GeometryCollection){for(var n=t.getGeometries(),r=0,i=0;i<n.length;i++)r+=this.calculateArea.call(this,n[i]);return r}return 0}e=Object(P.b)(t).getCoordinates()[0]}for(var o=[],a=0;a<e.length;a++)o.push([e[a][0]*this.imageInfo.MicrometresPerPixelX,e[a][1]*this.imageInfo.MicrometresPerPixelY]);var s=new v.a.geom.Polygon([o]),l=s.getArea();return s=null,l}},{key:"calculateLength",value:function(t){if(0===this.imageInfo.MicrometresPerPixelX)return 0;var e=null;if(t instanceof v.a.geom.Polygon)e=t.getCoordinates()[0];else if(t instanceof v.a.geom.LineString)e=t.getCoordinates();else{if(!(t instanceof v.a.geom.Circle)){if(t instanceof v.a.geom.GeometryCollection){for(var n=t.getGeometries(),r=0,i=0;i<n.length;i++)r+=this.calculateLength.call(this,n[i]);return r}return 0}e=Object(P.b)(t).getCoordinates()[0]}for(var o=[],a=0;a<e.length;a++)o.push([e[a][0]*this.imageInfo.MicrometresPerPixelX,e[a][1]*this.imageInfo.MicrometresPerPixelY]);var s=new v.a.geom.LineString(o),l=s.getLength();return s=null,l}},{key:"formatLength",value:function(t){return 0===this.imageInfo.MicrometresPerPixelX?0:!(this.options.annotations&&!0===this.options.annotations.alwaysDisplayInMicrons)&&t>=1e3?Math.round(10*t/1e3)/10+" mm":Math.round(10*t)/10+" μm"}},{key:"formatArea",value:function(t){if(0===this.imageInfo.MicrometresPerPixelX)return 0;var e=String.fromCharCode("2".charCodeAt(0)+128);return!(this.options.annotations&&!0===this.options.annotations.alwaysDisplayInMicrons)&&t>=1e5?Math.round(10*t/1e6)/10+" mm"+e:Math.round(10*t)/10+" μm"+e}},{key:"getAnnotationTextStyle",value:function(t,e){var n=this.getAnnotationFormattedLabel(t);return new R.a({text:n,textAlign:"center",textBaseline:"bottom",placement:"point",overflow:!0,font:"normal 16px Tahoma",fill:new M.a({color:"#000000"}),stroke:new N.a({color:"#ffffff",width:2})})}},{key:"getAnnotationFormattedLabel",value:function(t){var e="";if(this.options.annotations&&t&&t.metaData&&(!1!==this.options.annotations.labels&&t.metaData.Notes&&(e=t.metaData.Notes),!1!==this.options.annotations.showMeasurements)){var n=t.getGeometry().getType();t.metaData.hasOwnProperty("Dimensions")&&!isNaN(t.metaData.Dimensions)?(t.metaData.Dimensions>0&&(e+="\n"+t.metaData.FormattedLength),t.metaData.Dimensions>1&&(e+="\n"+t.metaData.FormattedArea)):-1!==n.indexOf("LineString")?e+="\n"+t.metaData.FormattedLength:-1===n.indexOf("Polygon")&&-1===n.indexOf("Circle")||(e+="\n"+t.metaData.FormattedLength+"\n"+t.metaData.FormattedArea)}return e}},{key:"getAnnotationStyle",value:function(t,e){return t.getText().setText(this.getAnnotationFormattedLabel(e)),t}},{key:"showAnnotation",value:function(t,e){if(null!==t&&!isNaN(t)){this.hiddenAnnotations||(this.hiddenAnnotations=[]);var n=null;if(e){for(var r=0;r<this.hiddenAnnotations.length;r++)if(this.hiddenAnnotations[r].getId()==t)return n=this.hiddenAnnotations.splice(r,1),void this.annotationsLayer.getSource().addFeatures(n)}else(n=this.annotationsLayer.getSource().getFeatureById(t))&&(this.annotationsLayer.getSource().removeFeature(n),this.hiddenAnnotations.push(n))}}},{key:"showAnnotationsByFingerprint",value:function(t){var e=this;t&&(this.forceLoadedAnnotationsByFingerprint||this.options.annotations.loadAnnotationsByFingerprint||(m.n.call(this,(function(t){e.reloadAnnotations(null,t)})),this.forceLoadedAnnotationsByFingerprint=!0)),this.hiddenAnnotationsByFingerprint||(this.hiddenAnnotationsByFingerprint=[]);var n=null,r=this.annotationsLayer.getSource().getFeatures();if(t)for(var i=this.hiddenAnnotationsByFingerprint.length;i>0;i--)n=this.hiddenAnnotationsByFingerprint.pop(),this.annotationsLayer.getSource().addFeature(n);else for(var o=0;o<r.length;o++)(n=r[o]).metaData.Image!==this.imageInfo.Filename&&(this.annotationsLayer.getSource().removeFeature(n),this.hiddenAnnotationsByFingerprint.push(n))}},{key:"showAnnotations",value:function(t){this.annotationsLayer&&this.annotationsLayer.setVisible(t)}},{key:"getAnnotationLabelsVisible",value:function(){return!!this.annotationsLayer&&!0===this.options.annotations.labels}},{key:"showAnnotationsLabels",value:function(t,e){if(this.annotationsLayer){var n=this;if(void 0!==e){if(this.options.annotations.labels===t&&this.options.annotations.showMeasurements===e)return;this.options.annotations.showMeasurements=e}else e=this.options.annotations.showMeasurements;this.options.annotations.labels=t,this.annotationsLayer.getSource().forEachFeature((function(r,i){var o=r.getStyle(),a=null;if(o instanceof Array){for(var s=0;s<o.length;s++)if(o[s].getText()){a=o[s];break}}else a=o;if(a)try{t||e?a.getText().setText(n.getAnnotationFormattedLabel(r)):a.getText().setText("")}catch(t){return}}),this),this.annotationsLayer.changed()}}},{key:"getAnnotations",value:function(){return this.annotationsLayer?this.hiddenAnnotations&&this.hiddenAnnotations.length>0?this.annotationsLayer.getSource().getFeatures().concat(this.hiddenAnnotations):this.annotationsLayer.getSource().getFeatures():null}},{key:"getActiveChannels",value:function(){for(var t=[],e=0;e<this.imageInfo.TimeFrames[0].Layers[0].Channels.length;e++)this.imageInfo.TimeFrames[0].Layers[0].Channels[e].Active&&t.push(e);return t}},{key:"setActiveChannels",value:function(t){for(var e=0;e<this.imageInfo.TimeFrames[0].Layers[0].Channels.length;e++)this.imageInfo.TimeFrames[0].Layers[0].Channels[e].Active=!1;for(e=0;e<t.length;e++)this.imageInfo.TimeFrames[0].Layers[0].Channels[t[e]].Active=!0;this.channelsString=this.getActiveChannels().join(","),this.channelClippingString=this.getChannelClippingString(),this.channelGammaString=this.getChannelGammaString(),this.redraw(),this.fireEvent(y.g.DimensionsChanged,this)}},{key:"setChannelRenderingOptions",value:function(t){this.imageInfo.TimeFrames[0].Layers[0].Channels[t.index].Clipping=t.clipping,this.imageInfo.TimeFrames[0].Layers[0].Channels[t.index].Gamma=t.gamma,this.channelClippingString=this.getChannelClippingString(),this.channelGammaString=this.getChannelGammaString(),this.redraw(),this.fireEvent(y.g.DimensionsChanged,this)}},{key:"getChannelClippingString",value:function(){var t=this.imageInfo.TimeFrames[0].Layers[0].Channels;this.channelClippingString="";for(var e=0;e<t.length;e++)t[e].Active&&(this.channelClippingString.length>0&&(this.channelClippingString+=","),t[e].Clipping?this.channelClippingString+=t[e].Clipping[0]+","+t[e].Clipping[1]:this.channelClippingString+="0,100");return this.channelClippingString}},{key:"getChannelGammaString",value:function(){var t=this.imageInfo.TimeFrames[0].Layers[0].Channels;this.channelGammaString="";for(var e=0;e<t.length;e++)t[e].Active&&(this.channelGammaString.length>0&&(this.channelGammaString+=","),t[e].Gamma?this.channelGammaString+=t[e].Gamma:this.channelGammaString+="1.0");return this.channelGammaString}},{key:"getActiveTimeFrame",value:function(){return this.selectedTimeFrame}},{key:"setActiveTimeFrame",value:function(t){(t=parseInt(t))>=0&&t<this.imageInfo.TimeFrames.length&&(this.selectedTimeFrame=t,this.redraw(),this.fireEvent(y.g.DimensionsChanged,this))}},{key:"getActiveLayer",value:function(){return this.selectedLayer}},{key:"setActiveLayer",value:function(t){(t=parseInt(t))>=0&&t<this.imageInfo.TimeFrames[this.selectedTimeFrame].Layers.length&&(this.selectedLayer=t,this.redraw(),this.fireEvent(y.g.DimensionsChanged,this))}},{key:"setFlip",value:function(t,e){var n=1==t,r=1==e,i=this.options.flip.horizontally!==n,o=this.options.flip.vertically!==r;if(i||o){var a,s=this.map.getView().getProjection().getExtent(),l=this.getPosition(),u=this.map.getView(),c=u.getProjection().getExtent(),h={extent:c,flip:this.options.flip},p=this.getAnnotations();if(p)for(a=0;a<p.length;a++)p[a].getGeometry().applyTransform(m.b.bind(h));this.options.flip.horizontally=n,this.options.flip.vertically=r;var d=m.f.call(this);if(this.map.setView(m.d.call(this,d,null,null,-u.getRotation())),h={extent:c=this.map.getView().getProjection().getExtent(),flip:this.options.flip},p)for(a=0;a<p.length;a++)p[a].getGeometry().applyTransform(m.b.bind(h));var f=this.getPosition();if(f.zoom=l.zoom,f.center[0]=i?c[0]+(s[2]-l.center[0]):c[0]+(l.center[0]-s[0]),f.center[1]=o?c[1]+(s[3]-l.center[1]):c[1]+(l.center[1]-s[1]),this.setPosition(f,null),this.redraw(),this.overviewControl){this.overviewControl.setMap(null);var g=m.l.call(this,this.element.querySelector(".ol-overview")),v=this.overviewControl&&this.overviewControl.getCollapsed();this.map.removeControl(this.overviewControl),this.overviewControl=m.e.call(this),this.map.addControl(this.overviewControl),g||m.s.call(this,this.element.querySelector(".ol-overview"),!1),this.overviewControl.setCollapsed(v),m.u.call(this)}this.fireEvent(y.g.ViewChanged,this)}}},{key:"getFlip",value:function(){return{horizontally:this.options.flip.horizontally,vertically:this.options.flip.vertically}}},{key:"redraw",value:function(){for(var t,e=this.map.getLayers().getArray(),n=0;n<e.length;n++)if(e[n].getSource){if(e[n]===this.mainLayer){var r=this.imageInfo.MaxZoomLevel,i=Math.pow(2,r);if((t=new v.a.layer.Tile({source:new v.a.source.XYZ({tileUrlFunction:this.mainLayer.getSource().getTileUrlFunction(),tileLoadFunction:this.mainLayer.getSource().getTileLoadFunction(),projection:this.mainLayer.getSource().getProjection(),wrapX:!1,attributions:"",crossOrigin:"PMA.UI",tileGrid:v.a.tilegrid.createXYZ({tileSize:[this.imageInfo.TileSize,this.imageInfo.TileSize],extent:[0,0,i*this.imageInfo.TileSize,i*this.imageInfo.TileSize],maxZoom:r})}),className:"ol-layer main-layer",extent:[0,0,i*this.imageInfo.TileSize,i*this.imageInfo.TileSize]})).set("active",!0,!0),this.mainLayer.set("active",!1,!0),this.options.loadingBar){Object(w.b)(this.listeners.tileloadstart),Object(w.b)(this.listeners.tileloadend),Object(w.b)(this.listeners.tileloaderror),this.listeners.tileloadstart=[],this.listeners.tileloadend=[],this.listeners.tileloaderror=[],this.loading=0,this.loaded=0,m.v.call(this);var o=this;this.listeners.tileloadstart.push(t.getSource().on("tileloadstart",(function(){0===o.loading&&(o.progressEl.style.visibility="visible"),++o.loading,m.v.call(o)}))),this.listeners.tileloadend.push(t.getSource().on("tileloadend",(function(){setTimeout((function(){++o.loaded,m.v.call(o)}),100)}))),this.listeners.tileloaderror.push(t.getSource().on("tileloaderror",(function(){setTimeout((function(){++o.loaded,m.v.call(o)}),100)})))}setTimeout((function(t,e,n){n.setMap(null),t.removeLayer(e),n.setMap(t)}),1e4,this.map,this.mainLayer,this.overviewControl)}}else if(e[n].getLayers)for(var a=e[n].getLayers().getArray(),s=0;s<a.length;s++)a[s].getSource().refresh(),a[s].setZIndex(999);t&&(this.mainLayer=t,this.map.addLayer(this.mainLayer),this.mainLayer.setZIndex(900),this.annotationsLayer&&this.annotationsLayer.setZIndex(1e3))}},{key:"zoomToObjective",value:function(t){if(this.imageInfo&&0!==this.imageInfo.MicrometresPerPixelX){var e;if("1:1"===t)e=1;else{if(t=parseFloat(t),isNaN(t)||0===t)return;e=10/this.imageInfo.MicrometresPerPixelX/t}this.map.getView().setResolution(e)}}},{key:"getPosition",value:function(){if(!this.map)return null;var t=this.map.getView();return t?{center:t.getCenter(),zoom:t.getZoom(),resolution:t.getResolution(),rotation:t.getRotation()}:null}},{key:"setPosition",value:function(t,e){this.map&&this.map.getView().animate(Object.assign(t,{duration:0}))}},{key:"fitToExtent",value:function(t,e){this.map&&this.map.getView().fit(t,{size:this.map.getSize(),constrainResolution:e||!1})}},{key:"getCurrentExtent",value:function(t){if(this.map){var e=this.map.getView(),n=e.calculateExtent(this.map.getSize());return t?this.rotateExtent(n,-e.getRotation()):n}}},{key:"setSessionID",value:function(t){this.sessionID=t,this.redraw()}},{key:"getSessionID",value:function(){return this.sessionID}},{key:"login",value:function(t,e){t&&(this.username=t),e&&(this.password=e),m.p.call(this,this.redraw)}},{key:"getViewportCoordinates",value:function(){var t=this.map.getSize(),e=[this.map.getCoordinateFromPixel([0,0]),this.map.getCoordinateFromPixel([t[0],0]),this.map.getCoordinateFromPixel([t[0],t[1]]),this.map.getCoordinateFromPixel([0,t[1]])],n=this.getFlip(),r=this.imageInfo.MaxZoomLevel,i=0,o=0,a=Math.pow(2,r)*this.imageInfo.TileSize;!0===n.horizontally&&(i=a-this.imageInfo.Width),!0!==n.vertically&&(o=a-this.imageInfo.Height);for(var s=0;s<4;s++)e[s][0]-=i,e[s][1]-=o,!0===n.horizontally&&(e[s][0]=this.imageInfo.Width-e[s][0]),!0!==n.vertically&&(e[s][1]=this.imageInfo.Height-e[s][1]);return e}},{key:"getSnapshotParameters",value:function(){var t=this.getViewportCoordinates(),e=this.map.getSize(),n=1/this.map.getView().getResolution(),r=this.getFlip(),i=180*-this.map.getView().getRotation()/Math.PI%360;return r.horizontally^r.vertically&&(i*=-1),{x:Math.round(t[0][0]),y:Math.round(t[0][1]),width:Math.round(e[0]/n),height:Math.round(e[1]/n),rotation:i,channels:this.getActiveChannels(),layer:this.selectedLayer,timeframe:this.selectedTimeFrame,flipHorizontally:r.horizontally,flipVertically:r.vertically}}},{key:"getSnapshotUrl",value:function(t,e,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"snapshot";n||(n="jpg"),null===o&&(o="snapshot"),r=!!r;var a=this.getViewportCoordinates(),s=this.map.getSize(),l=this.getFlip(),u=1/this.map.getView().getResolution();if(e)if(e==y.h.Min)u=1/Math.pow(2,this.imageInfo.MaxZoomLevel);else if(e==y.h.Max)u=this.options.digitalZoomLevels>0?2:1;else if(e==y.h["1:1"])u=1;else{var c=parseInt(e);if(c>=1){var h=-Math.log2(10)+Math.log2(c*this.imageInfo.MicrometresPerPixelX)+this.imageInfo.MaxZoomLevel;u=1/Math.pow(2,this.imageInfo.MaxZoomLevel-h)}}var p=180*-this.map.getView().getRotation()/Math.PI%360;l.horizontally^l.vertically&&(p*=-1);var d=Math.round(a[0][0]),f=Math.round(a[0][1]),g=Math.round(s[0]*this.map.getView().getResolution()),m=Math.round(s[1]*this.map.getView().getResolution()),v=this.imagesUrl+"region?pathOrUid="+encodeURIComponent(this.image)+"&format="+encodeURIComponent(n)+"&timeframe="+this.selectedTimeFrame+"&layer="+this.selectedLayer+"&channels="+this.channelsString+"&channelClipping="+this.channelClippingString+"&gamma="+this.channelGammaString+"&sessionID="+encodeURIComponent(this.sessionID)+"&drawScaleBar="+r+"&x="+d+"&y="+f+"&width="+g+"&height="+m+"&scale="+u+"&rotation="+p+"&dpi="+i+"&filename="+o+"&flipHorizontal="+l.horizontally+"&flipVertical="+l.vertically+(this.imageAdjustments.gamma&&1!=this.imageAdjustments.gamma?"&postGamma="+this.imageAdjustments.gamma.toFixed(2):"")+(this.imageAdjustments.brightness&&0!=this.imageAdjustments.brightness?"&brightness="+this.imageAdjustments.brightness:"")+(this.imageAdjustments.contrast&&1!=this.imageAdjustments.contrast?"&contrast="+this.imageAdjustments.contrast.toFixed(2):"");return t&&(v+="&downloadInsteadOfDisplay=true"),{url:v,width:Math.round(g*u),height:Math.round(m*u),scale:u}}},{key:"drawViewport",value:function(){var t=[],e=this.map.getSize();t.push(this.map.getCoordinateFromPixel([0,0])),t.push(this.map.getCoordinateFromPixel([0,e[1]])),t.push(this.map.getCoordinateFromPixel([e[0],e[1]])),t.push(this.map.getCoordinateFromPixel([e[0],0]));var n=new v.a.geom.Polygon([t]),r=new v.a.Feature(n),i=this.measureLayer.getSource();i.clear(),i.addFeature(r)}},{key:"getSnapshot",value:function(t,e){t||(t="png");var n=this;return new Promise((function(r,i){n.map.once("rendercomplete",(function(o){try{var s=document.createElement("canvas"),u=o.target.getSize();s.width=u[0],s.height=u[1];var c=s.getContext("2d"),h=1/n.map.getView().getResolution();(function(){var t=l()(f.a.mark((function t(){var r,i,o,s,l,u,p,d,g,y;return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=Array.from(n.map.getTargetElement().querySelectorAll(".ol-layer.main-layer canvas")),i=r[r.length-1],o=Array.from(n.map.getTargetElement().querySelectorAll(".ol-layer.annotations-layer canvas")),o=[i].concat(a()(o)),s=o[0],0!==o.length){t.next=7;break}return t.abrupt("return");case 7:if(!(s.width>0)){t.next=25;break}for(l=s.parentNode.style.opacity,c.globalAlpha=""===l?1:Number(l),u="#000000",n.imageInfo&&n.imageInfo.BackgroundColor&&(u="#"+n.imageInfo.BackgroundColor),c.fillStyle=u,c.fillRect(0,0,c.canvas.width,c.canvas.height),p=0;p<o.length;p++)o[p].width>0&&(d=o[p].style.transform,g=d.match(/^matrix\(([^\(]*)\)$/)[1].split(",").map(Number),CanvasRenderingContext2D.prototype.setTransform.apply(c,g),c.drawImage(o[p],0,0),c.resetTransform());if(e&&!1===e.scalebar||Object(m.i)(c,n.imageInfo,h,e?e.scalebarLocation:null,e?e.scalebarFont:null),e&&e.title&&Object(m.j)(c,e.title),!e||!e.barcode){t.next=22;break}return y=0,n.barcodeControl&&n.barcodeControl.rotation&&(y=n.barcodeControl.rotation),t.next=22,Object(m.g)(c,n,y);case 22:if(!e||!e.overview){t.next=25;break}return t.next=25,Object(m.h)(c,n);case 25:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}})()().then((function(){var n="snapshot";if(e&&e.filename&&(n=e.filename),navigator.msSaveBlob){var i=s.msToBlob();if("jpg"==t&&console.warn("Cannot save jpg snapshot on internet explorer/edge. The resulting snapshot is in png format"),"blob"==t)return void r(i);var o=function(t){if(e&&"open-tab"===e.action){var r=new FileReader;return r.onload=function(t){var e=window.open(t.target.result,"_blank");e&&e.focus()},void r.readAsDataURL(t)}navigator.msSaveBlob(t,n+".png")};if(e&&e.dpi)return void U(i,e.dpi).then((function(t){o(t),r(t)}));o(i),r(i)}else s.toBlob((function(i){if("blob"!=t){var o=function(r){if(e&&"open-tab"===e.action){var i=new FileReader;return i.onload=function(t){var e=window.open(t.target.result,"_blank");e&&e.focus()},void i.readAsDataURL(r)}Object(L.saveAs)(r,n+"."+("jpg"==t?"jpg":"png"))};e&&e.dpi?U(i,e.dpi).then((function(t){o(t),r(t)})):(o(i),r(i))}else r(i)}),"jpg"==t?"image/jpeg":"image/png")}))}catch(t){i(Error("Error creating snapshot"))}})),n.map.renderSync()}))}},{key:"listen",value:function(t,e){this.listeners.hasOwnProperty(t)||console.error(t+" is not a valid event"),this.listeners[t].push(e)}},{key:"unlisten",value:function(t,e){this.listeners.hasOwnProperty(t)||console.error(t+" is not a valid event");var n=this.listeners[t].indexOf(e);return n>=0&&n<this.listeners[t].length&&(this.listeners[t].splice(n,1),!0)}},{key:"fireEvent",value:function(t,e){if(this.listeners.hasOwnProperty(t))for(var n=0,r=this.listeners[t].length;n<r;n++)this.listeners[t][n].call(this,e);else console.error(t+" does not exist")}},{key:"focusToAnnotation",value:function(t){var e=this.annotationsLayer.getSource().getFeatureById(t);if(e){var n={duration:500,center:this.map.getView().getCenter()},r=this.map.getSize(),i=e.getGeometry().getExtent();if(Math.abs((i[2]-i[0])*(i[3]-i[1]))<1e-4){var o=this.map.getView().getProjection().getExtent();i[0]-=o[2]/32,i[1]-=o[3]/32,i[2]+=o[2]/32,i[3]+=o[3]/32}this.map.getView().animate(n),this.map.getView().fit(i,r)}}},{key:"setBrightness",value:function(t){this.imageAdjustments.brightness=t,m.c.call(this)}},{key:"setContrast",value:function(t){this.imageAdjustments.contrast=t,m.c.call(this)}},{key:"setBrightnessContrastGamma",value:function(t,e,n){this.imageAdjustments.brightness=t,this.imageAdjustments.contrast=e,this.imageAdjustments.gamma=n,m.c.call(this)}},{key:"setGamma",value:function(t){this.imageAdjustments.gamma=t,m.c.call(this)}},{key:"setColorBalance",value:function(t,e,n){this.imageAdjustments.rgb=[t,e,n],m.c.call(this)}},{key:"getColorBalance",value:function(){return this.imageAdjustments.rgb}},{key:"addTileTransformer",value:function(t){this.imageAdjustments.tileTransformers=this.imageAdjustments.tileTransformers||[],this.imageAdjustments.tileTransformers.push(t)}},{key:"setTileTransformers",value:function(t){this.imageAdjustments.tileTransformers=t}},{key:"getBrightness",value:function(){return this.imageAdjustments.brightness}},{key:"getGamma",value:function(){return this.imageAdjustments.gamma}},{key:"getContrast",value:function(){return this.imageAdjustments.contrast}},{key:"getTileTransformers",value:function(){return(this.imageAdjustments.tileTransformers||[]).slice()}},{key:"getActiveServerUrl",value:function(){return this.imagesUrl}},{key:"updateSize",value:function(){if(this.map){this.map.updateSize();for(var t=this.map.getControls(),e=0;e<t.getLength();e++){var n=t.item(e);n instanceof I.a&&n.overviewMap&&n.overviewMap.updateSize()}m.r.call(this),m.u.call(this)}}},{key:"initializeFeatures",value:function(t,e){for(var n=new v.a.format.WKT,r={extent:e.getExtent(),flip:this.getFlip()},i=[],o=0;o<t.length;o++){var a=t[o],s=n.readFeature(a.Geometry);null===a.AnnotationID||void 0===a.AnnotationID?s.setId(1e4*Math.random()|0):s.setId(a.AnnotationID);var l=s.getGeometry();l.applyTransform(m.b.bind(r));var u=isNaN(a.Dimensions)?2:a.Dimensions,c=this.calculateArea(l),h=this.formatArea(c),p=this.calculateLength(l),d=this.formatLength(p),f=null;if(a.AuditLastModifiedOn){var g=/\/Date\(((\d*)([\+\-]?\d*))\)\//.exec(a.AuditLastModifiedOn);g&&g.length>2&&(f=new Date(parseInt(g[2])))}var _=null;if(a.AuditCreatedOn){var b=/\/Date\(((\d*)([\+\-]?\d*))\)\//.exec(a.AuditCreatedOn);b&&b.length>2&&(_=new Date(parseInt(b[2])))}else _=new Date;var w=a.FillColor?a.FillColor:y.e,x=a.Color?a.Color:"#3399CC",E=null;s.name=a.Notes,s.metaData={AnnotationID:a.AnnotationID,Classification:a.Classification,Color:x,CreatedOn:_,CreatedBy:a.AuditCreatedBy,Image:a.Image,LayerID:a.LayerID,Notes:a.Notes,UpdateInfo:a.UpdateInfo,UpdatedOn:f,UpdatedBy:a.AuditLastModifiedBy,Geometry:a.Geometry,Area:u>1?c:0,FormattedArea:u>1?h:"",Length:u>0?p:0,FormattedLength:u>0?d:"",FillColor:w,Dimensions:u,State:y.b.Pristine,LineThickness:a.LineThickness?a.LineThickness:2},"MultiPoint"===l.getType()&&(s.metaData.PointCount=l.getCoordinates().length);var S=new v.a.style.Fill({color:w}),O=new v.a.style.Stroke({color:x,width:s.metaData.LineThickness?s.metaData.LineThickness:2});if(a.Color&&-1!==a.Color.indexOf("#"))x="#"+a.Color.split("#")[1],E=new v.a.style.Circle({fill:S,stroke:O,radius:5});else-1!==a.Geometry.indexOf("POINT")&&(E=new v.a.style.Icon({anchor:[.5,.5],anchorXUnits:"fraction",anchorYUnits:"fraction",opacity:1,src:this.options.annotations.imageBaseUrl+a.Color,scale:isNaN(this.options.annotations.imageScale)?1:this.options.annotations.imageScale}));var C=new v.a.style.Style({image:E,fill:S,stroke:O,text:this.getAnnotationTextStyle(s,x)});s.setStyle(this.getAnnotationStyle(C,s)),s.originalStyle=C,i.push(s)}return i}},{key:"getAnnotationsLayersNames",value:function(){return this.imageInfo&&this.imageInfo.AnnotationsLayers?this.imageInfo.AnnotationsLayers:[]}},{key:"setControlsConfiguration",value:function(t){Array.isArray(t)||(t=[t]),m.t.call(this,t)}},{key:"getControlsConfiguration",value:function(){return m.m.call(this)}},{key:"hideGrid",value:function(){this.gridLayer&&this.gridLayer.getSource().clear()}},{key:"showGrid",value:function(t){if(!t||t.length<2||t[0]<=0||t[1]<=0)throw"Invalid size specified";this.options.grid={size:t},this.gridLayer.getSource().clear();var e=t[0]/this.imageInfo.MicrometresPerPixelX,n=t[1]/this.imageInfo.MicrometresPerPixelY,r=this.map.getView().getProjection().getExtent(),i=Math.min(r[0],r[2]),o=Math.max(r[0],r[2]),a=Math.min(r[1],r[3]),s=Math.max(r[1],r[3]),l=Math.ceil((o-i)/e),u=Math.ceil((s-a)/n);o=i+l*e,a=s-u*n;for(var c=0;c<=l;c++)this.gridLayer.getSource().addFeature(new v.a.Feature({geometry:new v.a.geom.LineString([[i+c*e,a],[i+c*e,s]])}));for(var h=0;h<=u;h++)this.gridLayer.getSource().addFeature(new v.a.Feature({geometry:new v.a.geom.LineString([[i,s-h*n],[o,s-h*n]])}))}},{key:"reloadAnnotations",value:function(t,e){if(!(this.annotationsLayer&&this.mainLayer&&this.sessionID&&this.image))return console.error("Reload annotations: No image loaded in viewer"),void("function"==typeof t&&t.call(this));var n=this.annotationsLayer.getSource();n.clear(),this.hiddenAnnotations&&(this.hiddenAnnotations=[]),this.hiddenAnnotationsByFingerprint&&(this.hiddenAnnotationsByFingerprint=[]);var r=this.mainLayer.getSource().getProjection(),o=this;g.a.call(this,this.serviceUrl+"GetAnnotations","GET",function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?V(Object(n),!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):V(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({sessionID:this.sessionID,pathOrUid:this.image,currentUserOnly:!1,refresh:Math.random()},e?{fingerprint:e}:{}),(function(e){if(200==e.status){var i=Object(m.q)(e.responseText);if(i){var a=i,s=o.initializeFeatures(a,r);n.addFeatures(s)}}"function"==typeof t&&t.call(this)}))}},{key:"rotateExtent",value:function(t,e){var n=v.a.geom.Polygon.fromExtent(t),r=v.a.extent.getCenter(t);return n.rotate(e,r),n.getExtent()}},{key:"getCurrentObjective",value:function(){if(!this.imageInfo||0==this.imageInfo.MicrometresPerPixelX)return"";if(!this.map)return console.warn("PMA.UI.Viewport map is not initialized"),"";var t=10/this.imageInfo.MicrometresPerPixelX/this.map.getView().getResolution();return t>1?(t|=0)+"X":void 0}},{key:"getMaxObjective",value:function(){var t=10/this.imageInfo.MicrometresPerPixelX;if(t>1)return t|=0,Object(m.k)(t)+"X"}},{key:"getAnnotationLayersVisibility",value:function(){return this.layerSwitcher?this.layerSwitcher.getLayersVisibility():[]}},{key:"setAnnotationLayersVisibility",value:function(t){this.layerSwitcher&&this.layerSwitcher.setLayersVisibility(t)}},{key:"getMouseWheelZoomMode",value:function(){return this.mouseWheelInteraction?this.mouseWheelInteraction.mode:MouseWheelMode.Normal}},{key:"setMouseWheelZoomMode",value:function(t){this.mouseWheelInteraction&&this.mouseWheelInteraction.setMode(t)}},{key:"startMeasuring",value:function(t){E.call(this,t)}},{key:"stopMeasuring",value:function(){S.call(this,!0)}}]),t}()},function(t,e,n){"use strict";var r,i=n(9),o=n(113),a=n(15),s=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),l=function(t){function e(e,n,r,i,o,a){var s=t.call(this,e,n,a)||this;return s.extent=null,s.format_=i,s.features_=null,s.loader_,s.projection=null,s.resolution,s.tileLoadFunction_=o,s.url_=r,s.key=r,s}return s(e,t),e.prototype.getFormat=function(){return this.format_},e.prototype.getFeatures=function(){return this.features_},e.prototype.load=function(){this.state==a.a.IDLE&&(this.setState(a.a.LOADING),this.tileLoadFunction_(this,this.url_),this.loader_&&this.loader_(this.extent,this.resolution,this.projection))},e.prototype.onLoad=function(t,e){this.setFeatures(t)},e.prototype.onError=function(){this.setState(a.a.ERROR)},e.prototype.setFeatures=function(t){this.features_=t,this.setState(a.a.LOADED)},e.prototype.setLoader=function(t){this.loader_=t},e}(o.a),u=n(161),c=n(149),h=n(25),p=n(4),d=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),f=[],g=function(t){function e(e,n,r,i){var o=t.call(this,e,n,{transition:0})||this;return o.context_={},o.executorGroups={},o.declutterExecutorGroups={},o.loadingSourceTiles=0,o.hitDetectionImageData={},o.replayState_={},o.sourceTiles=[],o.errorTileKeys={},o.wantedResolution,o.getSourceTiles=i.bind(void 0,o),o.wrappedTileCoord=r,o}return d(e,t),e.prototype.getContext=function(t){var e=Object(p.c)(t);return e in this.context_||(this.context_[e]=Object(h.a)(1,1,f)),this.context_[e]},e.prototype.hasContext=function(t){return Object(p.c)(t)in this.context_},e.prototype.getImage=function(t){return this.hasContext(t)?this.getContext(t).canvas:null},e.prototype.getReplayState=function(t){var e=Object(p.c)(t);return e in this.replayState_||(this.replayState_[e]={dirty:!1,renderedRenderOrder:null,renderedResolution:NaN,renderedRevision:-1,renderedTileResolution:NaN,renderedTileRevision:-1,renderedTileZ:-1}),this.replayState_[e]},e.prototype.load=function(){this.getSourceTiles()},e.prototype.release=function(){for(var e in this.context_)f.push(this.context_[e].canvas),delete this.context_[e];t.prototype.release.call(this)},e}(o.a),y=n(0),m=n(55),v=n(48),_=n(6),b=n(176),w=n(35),x=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),E=function(t){function e(e){var n=this,r=e.projection||"EPSG:3857",i=e.extent||Object(m.extentFromProjection)(r),o=e.tileGrid||Object(m.createXYZ)({extent:i,maxResolution:e.maxResolution,maxZoom:void 0!==e.maxZoom?e.maxZoom:22,minZoom:e.minZoom,tileSize:e.tileSize||512});return(n=t.call(this,{attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,cacheSize:e.cacheSize,opaque:!1,projection:r,state:e.state,tileGrid:o,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:S,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:void 0===e.wrapX||e.wrapX,transition:e.transition,zDirection:void 0===e.zDirection?1:e.zDirection})||this).format_=e.format?e.format:null,n.sourceTileCache=new u.a(n.tileCache.highWaterMark),n.overlaps_=null==e.overlaps||e.overlaps,n.tileClass=e.tileClass?e.tileClass:l,n.tileGrids_={},n}return x(e,t),e.prototype.getFeaturesInExtent=function(t){var e=[],n=this.tileCache;if(0===n.getCount())return e;var r=Object(v.b)(n.peekFirstKey())[0],i=this.tileGrid;return n.forEach((function(n){if(n.tileCoord[0]===r&&n.getState()===a.a.LOADED)for(var o=n.getSourceTiles(),s=0,l=o.length;s<l;++s){var u=o[s],c=u.tileCoord;if(Object(y.intersects)(t,i.getTileCoordExtent(c))){var h=u.getFeatures();if(h)for(var p=0,d=h.length;p<d;++p){var f=h[p],g=f.getGeometry();Object(y.intersects)(t,g.getExtent())&&e.push(f)}}}})),e},e.prototype.getOverlaps=function(){return this.overlaps_},e.prototype.clear=function(){this.tileCache.clear(),this.sourceTileCache.clear()},e.prototype.expireCache=function(e,n){var r=this.getTileCacheForProjection(e),i=Object.keys(n).reduce((function(t,e){var n=Object(v.c)(e);if(r.containsKey(n))for(var i=r.get(n).sourceTiles,o=0,a=i.length;o<a;++o)t[i[o].getKey()]=!0;return t}),{});t.prototype.expireCache.call(this,e,n),this.sourceTileCache.expireCache(i)},e.prototype.getSourceTiles=function(t,e,n){var r=this;if(n.getState()===a.a.IDLE){n.setState(a.a.LOADING);var o=n.wrappedTileCoord,s=this.getTileGridForProjection(e),l=s.getTileCoordExtent(o),u=o[0],c=s.getResolution(u);Object(y.buffer)(l,-c,l);var h=this.tileGrid,p=h.getExtent();p&&Object(y.getIntersection)(l,p,l);var d=h.getZForResolution(c,1);h.forEachTileCoord(l,d,(function(o){var s=r.tileUrlFunction(o,t,e),l=r.sourceTileCache.containsKey(s)?r.sourceTileCache.get(s):new r.tileClass(o,s?a.a.IDLE:a.a.EMPTY,s,r.format_,r.tileLoadFunction);n.sourceTiles.push(l);var u=l.getState();if(u<a.a.LOADED){var c=function(t){r.handleTileChange(t);var e=l.getState();if(e===a.a.LOADED||e===a.a.ERROR){var o=l.getKey();o in n.errorTileKeys?l.getState()===a.a.LOADED&&delete n.errorTileKeys[o]:n.loadingSourceTiles--,e===a.a.ERROR?n.errorTileKeys[o]=!0:l.removeEventListener(i.a.CHANGE,c),0===n.loadingSourceTiles&&n.setState(Object(_.d)(n.errorTileKeys)?a.a.LOADED:a.a.ERROR)}};l.addEventListener(i.a.CHANGE,c),n.loadingSourceTiles++}u===a.a.IDLE&&(l.extent=h.getTileCoordExtent(o),l.projection=e,l.resolution=h.getResolution(o[0]),r.sourceTileCache.set(s,l),l.load())})),n.loadingSourceTiles||n.setState(n.sourceTiles.some((function(t){return t.getState()===a.a.ERROR}))?a.a.ERROR:a.a.LOADED)}return n.sourceTiles},e.prototype.getTile=function(t,e,n,r,i){var o,s=Object(v.e)(t,e,n),l=this.getKey();if(this.tileCache.containsKey(s)&&(o=this.tileCache.get(s)).key===l)return o;var u=[t,e,n],c=this.getTileCoordForTileUrlFunction(u,i),h=this.getTileGrid().getExtent(),p=this.getTileGridForProjection(i);if(c&&h){var d=p.getTileCoordExtent(c);Object(y.buffer)(d,-p.getResolution(t),d),Object(y.intersects)(h,d)||(c=null)}var f=!0;if(null!==c){var m=this.tileGrid,_=p.getResolution(t),b=m.getZForResolution(_,1),w=p.getTileCoordExtent(c);Object(y.buffer)(w,-_,w),m.forEachTileCoord(w,b,function(t){f=f&&!this.tileUrlFunction(t,r,i)}.bind(this))}var x=new g(u,f?a.a.EMPTY:a.a.IDLE,c,this.getSourceTiles.bind(this,r,i));return x.key=l,o?(x.interimTile=o,x.refreshInterimChain(),this.tileCache.replace(s,x)):this.tileCache.set(s,x),x},e.prototype.getTileGridForProjection=function(t){var e=t.getCode(),n=this.tileGrids_[e];if(!n){var r=this.tileGrid;n=Object(m.createForProjection)(t,void 0,r?r.getTileSize(r.getMinZoom()):void 0),this.tileGrids_[e]=n}return n},e.prototype.getTilePixelRatio=function(t){return t},e.prototype.getTilePixelSize=function(t,e,n){var r=this.getTileGridForProjection(n),i=Object(w.d)(r.getTileSize(t),this.tmpSize);return[Math.round(i[0]*e),Math.round(i[1]*e)]},e.prototype.updateCacheSize=function(e,n){t.prototype.updateCacheSize.call(this,2*e,n),this.sourceTileCache.highWaterMark=this.getTileCacheForProjection(n).highWaterMark},e}(c.a);e.a=E;function S(t,e){t.setLoader((function(n,r,i){Object(b.a)(e,t.getFormat(),n,r,i,t.onLoad.bind(t),t.onError.bind(t))}))}},function(t,e,n){"use strict";var r=n(151),i=n.n(r),o=n(0),a=n(4),s=n(6),l=function(){function t(t){this.rbush_=new i.a(t),this.items_={}}return t.prototype.insert=function(t,e){var n={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:e};this.rbush_.insert(n),this.items_[Object(a.c)(e)]=n},t.prototype.load=function(t,e){for(var n=new Array(e.length),r=0,i=e.length;r<i;r++){var o=t[r],s=e[r],l={minX:o[0],minY:o[1],maxX:o[2],maxY:o[3],value:s};n[r]=l,this.items_[Object(a.c)(s)]=l}this.rbush_.load(n)},t.prototype.remove=function(t){var e=Object(a.c)(t),n=this.items_[e];return delete this.items_[e],null!==this.rbush_.remove(n)},t.prototype.update=function(t,e){var n=this.items_[Object(a.c)(e)],r=[n.minX,n.minY,n.maxX,n.maxY];Object(o.equals)(r,t)||(this.remove(e),this.insert(t,e))},t.prototype.getAll=function(){return this.rbush_.all().map((function(t){return t.value}))},t.prototype.getInExtent=function(t){var e={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]};return this.rbush_.search(e).map((function(t){return t.value}))},t.prototype.forEach=function(t){return this.forEach_(this.getAll(),t)},t.prototype.forEachInExtent=function(t,e){return this.forEach_(this.getInExtent(t),e)},t.prototype.forEach_=function(t,e){for(var n,r=0,i=t.length;r<i;r++)if(n=e(t[r]))return n;return n},t.prototype.isEmpty=function(){return Object(s.d)(this.items_)},t.prototype.clear=function(){this.rbush_.clear(),this.items_={}},t.prototype.getExtent=function(t){var e=this.rbush_.toJSON();return Object(o.createOrUpdate)(e.minX,e.minY,e.maxX,e.maxY,t)},t.prototype.concat=function(t){for(var e in this.rbush_.load(t.rbush_.all()),t.items_)this.items_[e]=t.items_[e]},t}();e.a=l},function(t,e,n){"use strict";n.d(e,"a",(function(){return o})),n.d(e,"b",(function(){return a}));var r=n(104),i=n(7);function o(t,e,n,o,a,s,l){for(var u,c,h,p,d,f,g,y=a[s+1],m=[],v=0,_=n.length;v<_;++v){var b=n[v];for(p=t[b-o],f=t[b-o+1],u=e;u<b;u+=o)d=t[u],g=t[u+1],(y<=f&&g<=y||f<=y&&y<=g)&&(h=(y-f)/(g-f)*(d-p)+p,m.push(h)),p=d,f=g}var w=NaN,x=-1/0;for(m.sort(i.i),p=m[0],u=1,c=m.length;u<c;++u){d=m[u];var E=Math.abs(d-p);E>x&&(h=(p+d)/2,Object(r.c)(t,e,n,o,h,y)&&(w=h,x=E)),p=d}return isNaN(w)&&(w=a[s]),l?(l.push(w,y,x),l):[w,y,x]}function a(t,e,n,r,i){for(var a=[],s=0,l=n.length;s<l;++s){var u=n[s];a=o(t,e,u,r,i,2*s,a),e=u[u.length-1]}return a}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(4);function i(t,e,n,i){var o=document.createElement("script"),a="olc_"+Object(r.c)(e);function s(){delete window[a],o.parentNode.removeChild(o)}o.async=!0,o.src=t+(-1==t.indexOf("?")?"?":"&")+(i||"callback")+"="+a;var l=setTimeout((function(){s(),n&&n()}),1e4);window[a]=function(t){clearTimeout(l),s(),e(t)},document.getElementsByTagName("head")[0].appendChild(o)}},function(t,e,n){"use strict";e.a={ACTIVE:"active"}},function(t,e,n){"use strict";var r=n(107),i=n(115);function o(t){var e=0;if(t&&t.length>0){e+=Math.abs(a(t[0]));for(var n=1;n<t.length;n++)e-=Math.abs(a(t[n]))}return e}function a(t){var e,n,r,i,o,a,l=0,u=t.length;if(u>2){for(a=0;a<u;a++)a===u-2?(r=u-2,i=u-1,o=0):a===u-1?(r=u-1,i=0,o=1):(r=a,i=a+1,o=a+2),e=t[r],n=t[i],l+=(s(t[o][0])-s(e[0]))*Math.sin(s(n[1]));l=6378137*l*6378137/2}return l}function s(t){return t*Math.PI/180}var l=function(t){return Object(i.d)(t,(function(t,e){return t+function t(e){var n,r=0;switch(e.type){case"Polygon":return o(e.coordinates);case"MultiPolygon":for(n=0;n<e.coordinates.length;n++)r+=o(e.coordinates[n]);return r;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0;case"GeometryCollection":for(n=0;n<e.geometries.length;n++)r+=t(e.geometries[n]);return r}}(e)}),0)},u=n(60),c=n(56);function h(t){switch(t.type){case"Polygon":return l(t)>1?t:null;case"MultiPolygon":var e=[];if(Object(i.b)(t,(function(t){l(t)>1&&e.push(t.geometry.coordinates)})),e.length)return{type:"MultiPolygon",coordinates:e}}}e.a=function(t,e){var n=Object(c.c)(t),i=Object(c.c)(e),o=t.properties||{};if(n=h(n),i=h(i),!n)return null;if(!i)return Object(u.a)(n,o);var a=new r.GeoJSONReader,s=a.read(n),l=a.read(i),p=r.OverlayOp.difference(s,l);if(p.isEmpty())return null;var d=(new r.GeoJSONWriter).write(p);return Object(u.a)(d,o)}},function(t,e,n){"use strict";e.a={BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",TOP_LEFT:"top-left",TOP_RIGHT:"top-right"}},function(t,e,n){"use strict";n.r(e);var r=n(169);n.d(e,"Circle",(function(){return r.a}));var i=n(146);n.d(e,"Geometry",(function(){return i.a}));var o=n(90);n.d(e,"GeometryCollection",(function(){return o.a}));var a=n(114);n.d(e,"LinearRing",(function(){return a.a}));var s=n(43);n.d(e,"LineString",(function(){return s.a}));var l=n(58);n.d(e,"MultiLineString",(function(){return l.a}));var u=n(69);n.d(e,"MultiPoint",(function(){return u.a}));var c=n(68);n.d(e,"MultiPolygon",(function(){return c.a}));var h=n(31);n.d(e,"Point",(function(){return h.a}));var p=n(22);n.d(e,"Polygon",(function(){return p.a}));var d=n(62);n.d(e,"SimpleGeometry",(function(){return d.a}))},function(t,e,n){"use strict";var r=n(4),i=n(35),o=function(){function t(t){this.opacity_=t.opacity,this.rotateWithView_=t.rotateWithView,this.rotation_=t.rotation,this.scale_=t.scale,this.scaleArray_=Object(i.d)(t.scale),this.displacement_=t.displacement}return t.prototype.clone=function(){var e=this.getScale();return new t({opacity:this.getOpacity(),scale:Array.isArray(e)?e.slice():e,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice()})},t.prototype.getOpacity=function(){return this.opacity_},t.prototype.getRotateWithView=function(){return this.rotateWithView_},t.prototype.getRotation=function(){return this.rotation_},t.prototype.getScale=function(){return this.scale_},t.prototype.getScaleArray=function(){return this.scaleArray_},t.prototype.getDisplacement=function(){return this.displacement_},t.prototype.getAnchor=function(){return Object(r.b)()},t.prototype.getImage=function(t){return Object(r.b)()},t.prototype.getHitDetectionImage=function(){return Object(r.b)()},t.prototype.getPixelRatio=function(t){return 1},t.prototype.getImageState=function(){return Object(r.b)()},t.prototype.getImageSize=function(){return Object(r.b)()},t.prototype.getOrigin=function(){return Object(r.b)()},t.prototype.getSize=function(){return Object(r.b)()},t.prototype.setOpacity=function(t){this.opacity_=t},t.prototype.setRotateWithView=function(t){this.rotateWithView_=t},t.prototype.setRotation=function(t){this.rotation_=t},t.prototype.setScale=function(t){this.scale_=t,this.scaleArray_=Object(i.d)(t)},t.prototype.listenImageChange=function(t){Object(r.b)()},t.prototype.load=function(){Object(r.b)()},t.prototype.unlistenImageChange=function(t){Object(r.b)()},t}();e.a=o},function(t,e,n){"use strict";var r,i=n(54),o=n(52),a=n(4),s=n(14),l=n(0),u=n(2),c=n(30),h=n(63),p=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),d=Object(s.c)(),f=function(t){function e(){var e=t.call(this)||this;return e.extent_=Object(l.createEmpty)(),e.extentRevision_=-1,e.simplifiedGeometryMaxMinSquaredTolerance=0,e.simplifiedGeometryRevision=0,e.simplifyTransformedInternal=Object(c.d)((function(t,e,n){if(!n)return this.getSimplifiedGeometry(e);var r=this.clone();return r.applyTransform(n),r.getSimplifiedGeometry(e)})),e}return p(e,t),e.prototype.simplifyTransformed=function(t,e){return this.simplifyTransformedInternal(this.getRevision(),t,e)},e.prototype.clone=function(){return Object(a.b)()},e.prototype.closestPointXY=function(t,e,n,r){return Object(a.b)()},e.prototype.containsXY=function(t,e){var n=this.getClosestPoint([t,e]);return n[0]===t&&n[1]===e},e.prototype.getClosestPoint=function(t,e){var n=e||[NaN,NaN];return this.closestPointXY(t[0],t[1],n,1/0),n},e.prototype.intersectsCoordinate=function(t){return this.containsXY(t[0],t[1])},e.prototype.computeExtent=function(t){return Object(a.b)()},e.prototype.getExtent=function(t){if(this.extentRevision_!=this.getRevision()){var e=this.computeExtent(this.extent_);(isNaN(e[0])||isNaN(e[1]))&&Object(l.createOrUpdateEmpty)(e),this.extentRevision_=this.getRevision()}return Object(l.returnOrUpdate)(this.extent_,t)},e.prototype.rotate=function(t,e){Object(a.b)()},e.prototype.scale=function(t,e,n){Object(a.b)()},e.prototype.simplify=function(t){return this.getSimplifiedGeometry(t*t)},e.prototype.getSimplifiedGeometry=function(t){return Object(a.b)()},e.prototype.getType=function(){return Object(a.b)()},e.prototype.applyTransform=function(t){Object(a.b)()},e.prototype.intersectsExtent=function(t){return Object(a.b)()},e.prototype.translate=function(t,e){Object(a.b)()},e.prototype.transform=function(t,e){var n=Object(u.get)(t),r=n.getUnits()==o.b.TILE_PIXELS?function(t,r,i){var o=n.getExtent(),a=n.getWorldExtent(),c=Object(l.getHeight)(a)/Object(l.getHeight)(o);return Object(s.b)(d,a[0],a[3],c,-c,0,0,0),Object(h.c)(t,0,t.length,i,d,r),Object(u.getTransform)(n,e)(t,r,i)}:Object(u.getTransform)(n,e);return this.applyTransform(r),this},e}(i.a);e.a=f},function(t,e,n){"use strict";var r,i=n(33),o=n(80),a=n(16),s=n(1),l=n(43),u=n(58),c=n(69),h=n(68),p=n(239),d=n.n(p),f=n(31),g=n(22),y=n(125),m=n(178),v=n(52),_=n(13),b=n(2),w=n(105),x=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),E=function(t){function e(e){var n=t.call(this)||this,r=e||{};return n.dataProjection=new y.a({code:"",units:v.b.TILE_PIXELS}),n.featureClass_=r.featureClass?r.featureClass:m.a,n.geometryName_=r.geometryName,n.layerName_=r.layerName?r.layerName:"layer",n.layers_=r.layers?r.layers:null,n.idProperty_=r.idProperty,n}return x(e,t),e.prototype.readRawGeometry_=function(t,e,n,r){t.pos=e.geometry;for(var i=t.readVarint()+t.pos,o=1,a=0,s=0,l=0,u=0,c=0;t.pos<i;){if(!a){var h=t.readVarint();o=7&h,a=h>>3}a--,1===o||2===o?(s+=t.readSVarint(),l+=t.readSVarint(),1===o&&u>c&&(r.push(u),c=u),n.push(s,l),u+=2):7===o?u>c&&(n.push(n[c],n[c+1]),u+=2):Object(_.a)(!1,59)}u>c&&(r.push(u),c=u)},e.prototype.createFeature_=function(t,e,n){var r,o=e.type;if(0===o)return null;var p,d=e.properties;this.idProperty_?(p=d[this.idProperty_],delete d[this.idProperty_]):p=e.id,d[this.layerName_]=e.layer.name;var y=[],v=[];this.readRawGeometry_(t,e,y,v);var _=function(t,e){var n;1===t?n=1===e?s.a.POINT:s.a.MULTI_POINT:2===t?n=1===e?s.a.LINE_STRING:s.a.MULTI_LINE_STRING:3===t&&(n=s.a.POLYGON);return n}(o,v.length);if(this.featureClass_===m.a)(r=new this.featureClass_(_,y,v,d,p)).transform(n.dataProjection);else{var b=void 0;if(_==s.a.POLYGON){for(var x=[],E=0,S=0,O=0,C=v.length;O<C;++O){var T=v[O];if(Object(w.a)(y,E,T,2)){if(0===x.length)continue;x[x.length-1].push(v[S])}else x.push(v.slice(S,O+1));S=O+1,E=T}b=x.length>1?new h.a(y,a.a.XY,x):new g.a(y,a.a.XY,v)}else b=_===s.a.POINT?new f.a(y,a.a.XY):_===s.a.LINE_STRING?new l.a(y,a.a.XY):_===s.a.POLYGON?new g.a(y,a.a.XY,v):_===s.a.MULTI_POINT?new c.a(y,a.a.XY):_===s.a.MULTI_LINE_STRING?new u.a(y,a.a.XY,v):null;r=new(0,this.featureClass_),this.geometryName_&&r.setGeometryName(this.geometryName_);var I=Object(i.c)(b,!1,n);r.setGeometry(I),r.setId(p),r.setProperties(d,!0)}return r},e.prototype.getType=function(){return o.a.ARRAY_BUFFER},e.prototype.readFeatures=function(t,e){var n=this.layers_,r=this.adaptOptions(e),i=Object(b.get)(r.dataProjection);i.setWorldExtent(r.extent),r.dataProjection=i;var o=new d.a(t),a=o.readFields(S,{}),s=[];for(var l in a)if(!n||-1!=n.indexOf(l)){var u=a[l],c=u?[0,0,u.extent,u.extent]:null;i.setExtent(c);for(var h=0,p=u.length;h<p;++h){var f=T(o,u,h);s.push(this.createFeature_(o,f,r))}}return s},e.prototype.readProjection=function(t){return this.dataProjection},e.prototype.setLayers=function(t){this.layers_=t},e}(i.a);function S(t,e,n){if(3===t){var r={keys:[],values:[],features:[]},i=n.readVarint()+n.pos;n.readFields(O,r,i),r.length=r.features.length,r.length&&(e[r.name]=r)}}function O(t,e,n){if(15===t)e.version=n.readVarint();else if(1===t)e.name=n.readString();else if(5===t)e.extent=n.readVarint();else if(2===t)e.features.push(n.pos);else if(3===t)e.keys.push(n.readString());else if(4===t){for(var r=null,i=n.readVarint()+n.pos;n.pos<i;)r=1===(t=n.readVarint()>>3)?n.readString():2===t?n.readFloat():3===t?n.readDouble():4===t?n.readVarint64():5===t?n.readVarint():6===t?n.readSVarint():7===t?n.readBoolean():null;e.values.push(r)}}function C(t,e,n){if(1==t)e.id=n.readVarint();else if(2==t)for(var r=n.readVarint()+n.pos;n.pos<r;){var i=e.layer.keys[n.readVarint()],o=e.layer.values[n.readVarint()];e.properties[i]=o}else 3==t?e.type=n.readVarint():4==t&&(e.geometry=n.pos)}function T(t,e,n){t.pos=e.features[n];var r=t.readVarint()+t.pos,i={layer:e,type:0,properties:{}};return t.readFields(C,i,r),i}e.a=E},function(t,e,n){"use strict";var r,i=n(26),o=n(90),a=n(1),s=n(156),l=n(43),u=n(58),c=n(69),h=n(68),p=n(31),d=n(22),f=n(13),g=n(6),y=n(2),m=n(33),v=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),_=function(t){function e(e){var n=this,r=e||{};return(n=t.call(this)||this).dataProjection=Object(y.get)(r.dataProjection?r.dataProjection:"EPSG:4326"),r.featureProjection&&(n.defaultFeatureProjection=Object(y.get)(r.featureProjection)),n.geometryName_=r.geometryName,n.extractGeometryName_=r.extractGeometryName,n}return v(e,t),e.prototype.readFeatureFromObject=function(t,e){var n=null,r=b((n="Feature"===t.type?t:{type:"Feature",geometry:t,properties:null}).geometry,e),o=new i.a;return this.geometryName_?o.setGeometryName(this.geometryName_):this.extractGeometryName_&&"geometry_name"in n!==void 0&&o.setGeometryName(n.geometry_name),o.setGeometry(r),"id"in n&&o.setId(n.id),n.properties&&o.setProperties(n.properties,!0),o},e.prototype.readFeaturesFromObject=function(t,e){var n=null;if("FeatureCollection"===t.type){n=[];for(var r=t.features,i=0,o=r.length;i<o;++i)n.push(this.readFeatureFromObject(r[i],e))}else n=[this.readFeatureFromObject(t,e)];return n},e.prototype.readGeometryFromObject=function(t,e){return b(t,e)},e.prototype.readProjectionFromObject=function(t){var e,n=t.crs;return n?"name"==n.type?e=Object(y.get)(n.properties.name):"EPSG"===n.type?e=Object(y.get)("EPSG:"+n.properties.code):Object(f.a)(!1,36):e=this.dataProjection,e},e.prototype.writeFeatureObject=function(t,e){e=this.adaptOptions(e);var n={type:"Feature",geometry:null,properties:null},r=t.getId();if(void 0!==r&&(n.id=r),!t.hasProperties())return n;var i=t.getProperties(),o=t.getGeometry();return o&&(n.geometry=w(o,e),delete i[t.getGeometryName()]),Object(g.d)(i)||(n.properties=i),n},e.prototype.writeFeaturesObject=function(t,e){e=this.adaptOptions(e);for(var n=[],r=0,i=t.length;r<i;++r)n.push(this.writeFeatureObject(t[r],e));return{type:"FeatureCollection",features:n}},e.prototype.writeGeometryObject=function(t,e){return w(t,this.adaptOptions(e))},e}(s.a);function b(t,e){if(!t)return null;var n;switch(t.type){case a.a.POINT:n=function(t){return new p.a(t.coordinates)}(t);break;case a.a.LINE_STRING:n=function(t){return new l.a(t.coordinates)}(t);break;case a.a.POLYGON:n=function(t){return new d.a(t.coordinates)}(t);break;case a.a.MULTI_POINT:n=function(t){return new c.a(t.coordinates)}(t);break;case a.a.MULTI_LINE_STRING:n=function(t){return new u.a(t.coordinates)}(t);break;case a.a.MULTI_POLYGON:n=function(t){return new h.a(t.coordinates)}(t);break;case a.a.GEOMETRY_COLLECTION:n=function(t,e){var n=t.geometries.map((function(t){return b(t,e)}));return new o.a(n)}(t);break;default:throw new Error("Unsupported GeoJSON type: "+t.type)}return Object(m.c)(n,!1,e)}function w(t,e){var n,r=(t=Object(m.c)(t,!0,e)).getType();switch(r){case a.a.POINT:n=function(t,e){return{type:"Point",coordinates:t.getCoordinates()}}(t);break;case a.a.LINE_STRING:n=function(t,e){return{type:"LineString",coordinates:t.getCoordinates()}}(t);break;case a.a.POLYGON:n=function(t,e){var n;e&&(n=e.rightHanded);return{type:"Polygon",coordinates:t.getCoordinates(n)}}(t,e);break;case a.a.MULTI_POINT:n=function(t,e){return{type:"MultiPoint",coordinates:t.getCoordinates()}}(t);break;case a.a.MULTI_LINE_STRING:n=function(t,e){return{type:"MultiLineString",coordinates:t.getCoordinates()}}(t);break;case a.a.MULTI_POLYGON:n=function(t,e){var n;e&&(n=e.rightHanded);return{type:"MultiPolygon",coordinates:t.getCoordinates(n)}}(t,e);break;case a.a.GEOMETRY_COLLECTION:n=function(t,e){return{type:"GeometryCollection",geometries:t.getGeometriesArray().map((function(t){var n=Object(g.a)({},e);return delete n.featureProjection,w(t,n)}))}}(t,e);break;case a.a.CIRCLE:n={type:"GeometryCollection",geometries:[]};break;default:throw new Error("Unsupported geometry type: "+r)}return n}e.a=_},function(t,e,n){"use strict";var r,i="tileloadstart",o="tileloadend",a="tileloaderror",s=n(121),l=n(15),u=n(81),c=n(48),h=n(4),p=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),d=function(t){function e(n){var r=t.call(this,{attributions:n.attributions,cacheSize:n.cacheSize,opaque:n.opaque,projection:n.projection,state:n.state,tileGrid:n.tileGrid,tilePixelRatio:n.tilePixelRatio,wrapX:n.wrapX,transition:n.transition,key:n.key,attributionsCollapsible:n.attributionsCollapsible,zDirection:n.zDirection})||this;return r.generateTileUrlFunction_=r.tileUrlFunction===e.prototype.tileUrlFunction,r.tileLoadFunction=n.tileLoadFunction,n.tileUrlFunction&&(r.tileUrlFunction=n.tileUrlFunction),r.urls=null,n.urls?r.setUrls(n.urls):n.url&&r.setUrl(n.url),r.tileLoadingKeys_={},r}return p(e,t),e.prototype.getTileLoadFunction=function(){return this.tileLoadFunction},e.prototype.getTileUrlFunction=function(){return Object.getPrototypeOf(this).tileUrlFunction===this.tileUrlFunction?this.tileUrlFunction.bind(this):this.tileUrlFunction},e.prototype.getUrls=function(){return this.urls},e.prototype.handleTileChange=function(t){var e,n=t.target,r=Object(h.c)(n),u=n.getState();u==l.a.LOADING?(this.tileLoadingKeys_[r]=!0,e=i):r in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[r],e=u==l.a.ERROR?a:u==l.a.LOADED?o:void 0),null!=e&&this.dispatchEvent(new s.a(e,n))},e.prototype.setTileLoadFunction=function(t){this.tileCache.clear(),this.tileLoadFunction=t,this.changed()},e.prototype.setTileUrlFunction=function(t,e){this.tileUrlFunction=t,this.tileCache.pruneExceptNewestZ(),void 0!==e?this.setKey(e):this.changed()},e.prototype.setUrl=function(t){var e=Object(u.c)(t);this.urls=e,this.setUrls(e)},e.prototype.setUrls=function(t){this.urls=t;var e=t.join("\n");this.generateTileUrlFunction_?this.setTileUrlFunction(Object(u.a)(t,this.tileGrid),e):this.setKey(e)},e.prototype.tileUrlFunction=function(t,e,n){},e.prototype.useTile=function(t,e,n){var r=Object(c.e)(t,e,n);this.tileCache.containsKey(r)&&this.tileCache.get(r)},e}(s.b);e.a=d},function(t,e,n){"use strict";n.d(e,"a",(function(){return o})),n.d(e,"b",(function(){return a}));var r=n(236),i=r.version,o=function(){return i},a=function(t){var e=!1;if(t&&null!=t&&""!==t){var n=t.split(".").map((function(t){return parseInt(t)}));4===n.length&&(n[0]>2||2===n[0]&&n[3]>=1836)&&(e=!0)}return e}},function(t,e,n){t.exports=function(){"use strict";function t(t,r,i,o,a){!function t(n,r,i,o,a){for(;o>i;){if(o-i>600){var s=o-i+1,l=r-i+1,u=Math.log(s),c=.5*Math.exp(2*u/3),h=.5*Math.sqrt(u*c*(s-c)/s)*(l-s/2<0?-1:1);t(n,r,Math.max(i,Math.floor(r-l*c/s+h)),Math.min(o,Math.floor(r+(s-l)*c/s+h)),a)}var p=n[r],d=i,f=o;for(e(n,i,r),a(n[o],p)>0&&e(n,i,o);d<f;){for(e(n,d,f),d++,f--;a(n[d],p)<0;)d++;for(;a(n[f],p)>0;)f--}0===a(n[i],p)?e(n,i,f):e(n,++f,o),f<=r&&(i=f+1),r<=f&&(o=f-1)}}(t,r,i||0,o||t.length-1,a||n)}function e(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function n(t,e){return t<e?-1:t>e?1:0}var r=function(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function i(t,e,n){if(!n)return e.indexOf(t);for(var r=0;r<e.length;r++)if(n(t,e[r]))return r;return-1}function o(t,e){a(t,0,t.children.length,e,t)}function a(t,e,n,r,i){i||(i=f(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var o=e;o<n;o++){var a=t.children[o];s(i,t.leaf?r(a):a)}return i}function s(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function l(t,e){return t.minX-e.minX}function u(t,e){return t.minY-e.minY}function c(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function h(t){return t.maxX-t.minX+(t.maxY-t.minY)}function p(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function d(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function f(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function g(e,n,r,i,o){for(var a=[n,r];a.length;)if(!((r=a.pop())-(n=a.pop())<=i)){var s=n+Math.ceil((r-n)/i/2)*i;t(e,s,n,r,o),a.push(n,s,s,r)}}return r.prototype.all=function(){return this._all(this.data,[])},r.prototype.search=function(t){var e=this.data,n=[];if(!d(t,e))return n;for(var r=this.toBBox,i=[];e;){for(var o=0;o<e.children.length;o++){var a=e.children[o],s=e.leaf?r(a):a;d(t,s)&&(e.leaf?n.push(a):p(t,s)?this._all(a,n):i.push(a))}e=i.pop()}return n},r.prototype.collides=function(t){var e=this.data;if(!d(t,e))return!1;for(var n=[];e;){for(var r=0;r<e.children.length;r++){var i=e.children[r],o=e.leaf?this.toBBox(i):i;if(d(t,o)){if(e.leaf||p(t,o))return!0;n.push(i)}}e=n.pop()}return!1},r.prototype.load=function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var e=0;e<t.length;e++)this.insert(t[e]);return this}var n=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(this.data.height<n.height){var r=this.data;this.data=n,n=r}this._insert(n,this.data.height-n.height-1,!0)}else this.data=n;return this},r.prototype.insert=function(t){return t&&this._insert(t,this.data.height-1),this},r.prototype.clear=function(){return this.data=f([]),this},r.prototype.remove=function(t,e){if(!t)return this;for(var n,r,o,a=this.data,s=this.toBBox(t),l=[],u=[];a||l.length;){if(a||(a=l.pop(),r=l[l.length-1],n=u.pop(),o=!0),a.leaf){var c=i(t,a.children,e);if(-1!==c)return a.children.splice(c,1),l.push(a),this._condense(l),this}o||a.leaf||!p(a,s)?r?(n++,a=r.children[n],o=!1):a=null:(l.push(a),u.push(n),n=0,r=a,a=a.children[0])}return this},r.prototype.toBBox=function(t){return t},r.prototype.compareMinX=function(t,e){return t.minX-e.minX},r.prototype.compareMinY=function(t,e){return t.minY-e.minY},r.prototype.toJSON=function(){return this.data},r.prototype.fromJSON=function(t){return this.data=t,this},r.prototype._all=function(t,e){for(var n=[];t;)t.leaf?e.push.apply(e,t.children):n.push.apply(n,t.children),t=n.pop();return e},r.prototype._build=function(t,e,n,r){var i,a=n-e+1,s=this._maxEntries;if(a<=s)return o(i=f(t.slice(e,n+1)),this.toBBox),i;r||(r=Math.ceil(Math.log(a)/Math.log(s)),s=Math.ceil(a/Math.pow(s,r-1))),(i=f([])).leaf=!1,i.height=r;var l=Math.ceil(a/s),u=l*Math.ceil(Math.sqrt(s));g(t,e,n,u,this.compareMinX);for(var c=e;c<=n;c+=u){var h=Math.min(c+u-1,n);g(t,c,h,l,this.compareMinY);for(var p=c;p<=h;p+=l){var d=Math.min(p+l-1,h);i.children.push(this._build(t,p,d,r-1))}}return o(i,this.toBBox),i},r.prototype._chooseSubtree=function(t,e,n,r){for(;r.push(e),!e.leaf&&r.length-1!==n;){for(var i=1/0,o=1/0,a=void 0,s=0;s<e.children.length;s++){var l=e.children[s],u=c(l),h=(p=t,d=l,(Math.max(d.maxX,p.maxX)-Math.min(d.minX,p.minX))*(Math.max(d.maxY,p.maxY)-Math.min(d.minY,p.minY))-u);h<o?(o=h,i=u<i?u:i,a=l):h===o&&u<i&&(i=u,a=l)}e=a||e.children[0]}var p,d;return e},r.prototype._insert=function(t,e,n){var r=n?t:this.toBBox(t),i=[],o=this._chooseSubtree(r,this.data,e,i);for(o.children.push(t),s(o,r);e>=0&&i[e].children.length>this._maxEntries;)this._split(i,e),e--;this._adjustParentBBoxes(r,i,e)},r.prototype._split=function(t,e){var n=t[e],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);var a=this._chooseSplitIndex(n,i,r),s=f(n.children.splice(a,n.children.length-a));s.height=n.height,s.leaf=n.leaf,o(n,this.toBBox),o(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(n,s)},r.prototype._splitRoot=function(t,e){this.data=f([t,e]),this.data.height=t.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},r.prototype._chooseSplitIndex=function(t,e,n){for(var r,i,o,s,l,u,h,p=1/0,d=1/0,f=e;f<=n-e;f++){var g=a(t,0,f,this.toBBox),y=a(t,f,n,this.toBBox),m=(i=g,o=y,s=Math.max(i.minX,o.minX),l=Math.max(i.minY,o.minY),u=Math.min(i.maxX,o.maxX),h=Math.min(i.maxY,o.maxY),Math.max(0,u-s)*Math.max(0,h-l)),v=c(g)+c(y);m<p?(p=m,r=f,d=v<d?v:d):m===p&&v<d&&(d=v,r=f)}return r||n-e},r.prototype._chooseSplitAxis=function(t,e,n){var r=t.leaf?this.compareMinX:l,i=t.leaf?this.compareMinY:u;this._allDistMargin(t,e,n,r)<this._allDistMargin(t,e,n,i)&&t.children.sort(r)},r.prototype._allDistMargin=function(t,e,n,r){t.children.sort(r);for(var i=this.toBBox,o=a(t,0,e,i),l=a(t,n-e,n,i),u=h(o)+h(l),c=e;c<n-e;c++){var p=t.children[c];s(o,t.leaf?i(p):p),u+=h(o)}for(var d=n-e-1;d>=e;d--){var f=t.children[d];s(l,t.leaf?i(f):f),u+=h(l)}return u},r.prototype._adjustParentBBoxes=function(t,e,n){for(var r=n;r>=0;r--)s(e[r],t)},r.prototype._condense=function(t){for(var e=t.length-1,n=void 0;e>=0;e--)0===t[e].children.length?e>0?(n=t[e-1].children).splice(n.indexOf(t[e]),1):this.clear():o(t[e],this.toBBox)},r}()},function(t,e,n){"use strict";var r,i=n(98),o=n(9),a=n(4),s=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),l=function(t){function e(e,n,r,i){var o=t.call(this)||this;return o.extent=e,o.pixelRatio_=r,o.resolution=n,o.state=i,o}return s(e,t),e.prototype.changed=function(){this.dispatchEvent(o.a.CHANGE)},e.prototype.getExtent=function(){return this.extent},e.prototype.getImage=function(){return Object(a.b)()},e.prototype.getPixelRatio=function(){return this.pixelRatio_},e.prototype.getResolution=function(){return this.resolution},e.prototype.getState=function(){return this.state},e.prototype.load=function(){Object(a.b)()},e}(i.a);e.a=l},function(t,e,n){"use strict";var r,i=n(196),o=n(154),a=n(82),s=n(14),l=n(0),u=n(25),c=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),h=function(t){function e(e){var n=t.call(this,e)||this;return n.container=null,n.renderedResolution,n.tempTransform=Object(s.c)(),n.pixelTransform=Object(s.c)(),n.inversePixelTransform=Object(s.c)(),n.context=null,n.containerReused=!1,n}return c(e,t),e.prototype.useContainer=function(t,e,n){var r,i,o=this.getLayer().getClassName();t&&""===t.style.opacity&&t.className===o&&((s=t.firstElementChild)instanceof HTMLCanvasElement&&(i=s.getContext("2d")));if(!i||0!==i.canvas.width&&i.canvas.style.transform!==e?this.containerReused&&(this.container=null,this.context=null,this.containerReused=!1):(this.container=t,this.context=i,this.containerReused=!0),!this.container){(r=document.createElement("div")).className=o;var a=r.style;a.position="absolute",a.width="100%",a.height="100%";var s=(i=Object(u.a)()).canvas;r.appendChild(s),(a=s.style).position="absolute",a.left="0",a.transformOrigin="top left",this.container=r,this.context=i}},e.prototype.clipUnrotated=function(t,e,n){var r=Object(l.getTopLeft)(n),i=Object(l.getTopRight)(n),o=Object(l.getBottomRight)(n),a=Object(l.getBottomLeft)(n);Object(s.a)(e.coordinateToPixelTransform,r),Object(s.a)(e.coordinateToPixelTransform,i),Object(s.a)(e.coordinateToPixelTransform,o),Object(s.a)(e.coordinateToPixelTransform,a);var u=this.inversePixelTransform;Object(s.a)(u,r),Object(s.a)(u,i),Object(s.a)(u,o),Object(s.a)(u,a),t.save(),t.beginPath(),t.moveTo(Math.round(r[0]),Math.round(r[1])),t.lineTo(Math.round(i[0]),Math.round(i[1])),t.lineTo(Math.round(o[0]),Math.round(o[1])),t.lineTo(Math.round(a[0]),Math.round(a[1])),t.clip()},e.prototype.dispatchRenderEvent_=function(t,e,n){var r=this.getLayer();if(r.hasListener(t)){var i=new o.a(t,this.inversePixelTransform,n,e);r.dispatchEvent(i)}},e.prototype.preRender=function(t,e){this.dispatchRenderEvent_(a.a.PRERENDER,t,e)},e.prototype.postRender=function(t,e){this.dispatchRenderEvent_(a.a.POSTRENDER,t,e)},e.prototype.getRenderTransform=function(t,e,n,r,i,o,a){var l=i/2,u=o/2,c=r/e,h=-c,p=-t[0]+a,d=-t[1];return Object(s.b)(this.tempTransform,l,u,c,h,-n,p,d)},e.prototype.getDataAtPixel=function(t,e,n){var r,i=Object(s.a)(this.inversePixelTransform,t.slice()),o=this.context,a=this.getLayer().getExtent();if(a){var u=Object(s.a)(e.pixelToCoordinateTransform,t.slice());if(!Object(l.containsCoordinate)(a,u))return null}try{var c=Math.round(i[0]),h=Math.round(i[1]),p=document.createElement("canvas"),d=p.getContext("2d");p.width=1,p.height=1,d.clearRect(0,0,1,1),d.drawImage(o.canvas,c,h,1,1,0,0,1,1),r=d.getImageData(0,0,1,1).data}catch(t){return"SecurityError"===t.name?new Uint8Array:r}return 0===r[3]?null:r},e}(i.a);e.a=h},function(t,e,n){"use strict";var r,i=n(40),o=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),a=function(t){function e(e,n,r,i){var o=t.call(this,e)||this;return o.inversePixelTransform=n,o.frameState=r,o.context=i,o}return o(e,t),e}(i.a);e.a=a},function(t,e,n){"use strict";function r(t,e,n,r){for(var i=0,o=t[n-r],a=t[n-r+1];e<n;e+=r){var s=t[e],l=t[e+1];i+=a*s-o*l,o=s,a=l}return i/2}function i(t,e,n,i){for(var o=0,a=0,s=n.length;a<s;++a){var l=n[a];o+=r(t,e,l,i),e=l}return o}function o(t,e,n,r){for(var o=0,a=0,s=n.length;a<s;++a){var l=n[a];o+=i(t,e,l,r),e=l[l.length-1]}return o}n.d(e,"a",(function(){return r})),n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return o}))},function(t,e,n){"use strict";var r,i=n(33),o=n(80),a=n(4),s=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),l=function(t){function e(){return t.call(this)||this}return s(e,t),e.prototype.getType=function(){return o.a.JSON},e.prototype.readFeature=function(t,e){return this.readFeatureFromObject(u(t),this.getReadOptions(t,e))},e.prototype.readFeatures=function(t,e){return this.readFeaturesFromObject(u(t),this.getReadOptions(t,e))},e.prototype.readFeatureFromObject=function(t,e){return Object(a.b)()},e.prototype.readFeaturesFromObject=function(t,e){return Object(a.b)()},e.prototype.readGeometry=function(t,e){return this.readGeometryFromObject(u(t),this.getReadOptions(t,e))},e.prototype.readGeometryFromObject=function(t,e){return Object(a.b)()},e.prototype.readProjection=function(t){return this.readProjectionFromObject(u(t))},e.prototype.readProjectionFromObject=function(t){return Object(a.b)()},e.prototype.writeFeature=function(t,e){return JSON.stringify(this.writeFeatureObject(t,e))},e.prototype.writeFeatureObject=function(t,e){return Object(a.b)()},e.prototype.writeFeatures=function(t,e){return JSON.stringify(this.writeFeaturesObject(t,e))},e.prototype.writeFeaturesObject=function(t,e){return Object(a.b)()},e.prototype.writeGeometry=function(t,e){return JSON.stringify(this.writeGeometryObject(t,e))},e.prototype.writeGeometryObject=function(t,e){return Object(a.b)()},e}(i.a);function u(t){if("string"==typeof t){var e=JSON.parse(t);return e||null}return null!==t?t:null}e.a=l},function(t,e,n){"use strict";var r,i=n(152),o=n(23),a=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=function(t){function e(e,n,r,i,a){var s=this,l=void 0!==a?o.a.IDLE:o.a.LOADED;return(s=t.call(this,e,n,r,l)||this).loader_=void 0!==a?a:null,s.canvas_=i,s.error_=null,s}return a(e,t),e.prototype.getError=function(){return this.error_},e.prototype.handleLoad_=function(t){t?(this.error_=t,this.state=o.a.ERROR):this.state=o.a.LOADED,this.changed()},e.prototype.load=function(){this.state==o.a.IDLE&&(this.state=o.a.LOADING,this.changed(),this.loader_(this.handleLoad_.bind(this)))},e.prototype.getImage=function(){return this.canvas_},e}(i.a);e.a=s},function(t,e,n){"use strict";var r,i=n(33),o=n(80),a=n(4),s=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),l=function(t){function e(){return t.call(this)||this}return s(e,t),e.prototype.getType=function(){return o.a.TEXT},e.prototype.readFeature=function(t,e){return this.readFeatureFromText(u(t),this.adaptOptions(e))},e.prototype.readFeatureFromText=function(t,e){return Object(a.b)()},e.prototype.readFeatures=function(t,e){return this.readFeaturesFromText(u(t),this.adaptOptions(e))},e.prototype.readFeaturesFromText=function(t,e){return Object(a.b)()},e.prototype.readGeometry=function(t,e){return this.readGeometryFromText(u(t),this.adaptOptions(e))},e.prototype.readGeometryFromText=function(t,e){return Object(a.b)()},e.prototype.readProjection=function(t){return this.readProjectionFromText(u(t))},e.prototype.readProjectionFromText=function(t){return this.dataProjection},e.prototype.writeFeature=function(t,e){return this.writeFeatureText(t,this.adaptOptions(e))},e.prototype.writeFeatureText=function(t,e){return Object(a.b)()},e.prototype.writeFeatures=function(t,e){return this.writeFeaturesText(t,this.adaptOptions(e))},e.prototype.writeFeaturesText=function(t,e){return Object(a.b)()},e.prototype.writeGeometry=function(t,e){return this.writeGeometryText(t,this.adaptOptions(e))},e.prototype.writeGeometryText=function(t,e){return Object(a.b)()},e}(i.a);function u(t){return"string"==typeof t?t:""}e.a=l},function(t,e,n){"use strict";var r=n(107);e.a=function(){for(var t=new r.GeoJSONReader,e=t.read(JSON.stringify(arguments[0].geometry)),n=1;n<arguments.length;n++)e=r.UnionOp.union(e,t.read(JSON.stringify(arguments[n].geometry)));var i=new r.GeoJSONWriter;return{type:"Feature",geometry:e=i.write(e),properties:arguments[0].properties}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return Z}));var r=n(24),i=n.n(r),o=n(27),a=n.n(o),s=n(32),l=n.n(s),u=n(83),c=n.n(u),h=n(51),p=n.n(h),d=n(53),f=n.n(d),g=n(240),y=n.n(g),m=n(28),v=n.n(m),_=n(47),b=n(123),w=n(163),x=n(0),E=n(65),S=n(110),O=n(66),C=n(26),T=n(37),I=n(22),L=n(41),P=n(61),R=n(59),M=n(148),N=n(159),j=n(142),A=n(179);function k(t){var e={type:"Feature"};return Object.keys(t).forEach((function(n){switch(n){case"type":case"properties":case"geometry":return;default:e[n]=t[n]}})),e.properties=function t(e){var n={};return e?(Object.keys(e).forEach((function(r){var i=e[r];"object"==typeof i?null===i?n[r]=null:i.length?n[r]=i.map((function(t){return t})):n[r]=t(i):n[r]=i})),n):n}(t.properties),e.geometry=F(t.geometry),e}function F(t){var e={type:t.type};return t.bbox&&(e.bbox=t.bbox),"GeometryCollection"===t.type?(e.geometries=t.geometries.map((function(t){return F(t)})),e):(e.coordinates=function t(e){if("object"!=typeof e[0])return e.slice();return e.map((function(e){return t(e)}))}(t.coordinates),e)}var D=function(t){if(!t)throw new Error("geojson is required");switch(t.type){case"Feature":return k(t);case"FeatureCollection":return function(t){var e={type:"FeatureCollection"};return Object.keys(t).forEach((function(n){switch(n){case"type":case"features":return;default:e[n]=t[n]}})),e.features=t.features.map((function(t){return k(t)})),e}(t);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return F(t);default:throw new Error("unknown GeoJSON type")}},G=n(115),z=n(60);function U(t,e,n){var r=e.x,i=e.y,o=n.x-r,a=n.y-i;if(0!==o||0!==a){var s=((t.x-r)*o+(t.y-i)*a)/(o*o+a*a);s>1?(r=n.x,i=n.y):s>0&&(r+=o*s,i+=a*s)}return(o=t.x-r)*o+(a=t.y-i)*a}function B(t,e){var n=t.length-1,r=[t[0]];return function t(e,n,r,i,o){for(var a,s=i,l=n+1;l<r;l++){var u=U(e[l],e[n],e[r]);u>s&&(a=l,s=u)}s>i&&(a-n>1&&t(e,n,a,i,o),o.push(e[a]),r-a>1&&t(e,a,r,i,o))}(t,0,n,e,r),r.push(t[n]),r}function V(t,e,n){if(t.length<=2)return t;var r=void 0!==e?e*e:1;return t=B(t=n?t:function(t,e){for(var n,r,i,o,a,s=t[0],l=[s],u=1,c=t.length;u<c;u++)n=t[u],i=s,o=void 0,a=void 0,o=(r=n).x-i.x,a=r.y-i.y,o*o+a*a>e&&(l.push(n),s=n);return s!==n&&l.push(n),l}(t,r),r)}function q(t,e,n){return V(t.map((function(t){return{x:t[0],y:t[1],z:t[2]}})),e,n).map((function(t){return t.z?[t.x,t.y,t.z]:[t.x,t.y]}))}function Y(t,e,n){return t.map((function(t){var r=t.map((function(t){return{x:t[0],y:t[1]}}));if(r.length<4)throw new Error("invalid polygon");for(var i=V(r,e,n).map((function(t){return[t.x,t.y]}));!X(i);)i=V(r,e-=.01*e,n).map((function(t){return[t.x,t.y]}));return i[i.length-1][0]===i[0][0]&&i[i.length-1][1]===i[0][1]||i.push(i[0]),i}))}function X(t){return!(t.length<3)&&!(3===t.length&&t[2][0]===t[0][0]&&t[2][1]===t[0][1])}var W=function(t,e){if(e=e||{},!Object(z.c)(e))throw new Error("options is invalid");var n=void 0!==e.tolerance?e.tolerance:1,r=e.highQuality||!1,i=e.mutate||!1;if(!t)throw new Error("geojson is required");if(n&&n<0)throw new Error("invalid tolerance");return!0!==i&&(t=D(t)),Object(G.c)(t,(function(t){!function(t,e,n){var r=t.type;if("Point"===r||"MultiPoint"===r)return t;Object(A.a)(t,!0);var i=t.coordinates;switch(r){case"LineString":t.coordinates=q(i,e,n);break;case"MultiLineString":t.coordinates=i.map((function(t){return q(t,e,n)}));break;case"Polygon":t.coordinates=Y(i,e,n);break;case"MultiPolygon":t.coordinates=i.map((function(t){return Y(t,e,n)}))}}(t,n,r)})),t},H=n(46);function K(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=v()(t);if(e){var i=v()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return f()(this,n)}}var Z=function(t){p()(n,t);var e=K(n);function n(t){var r,o;i()(this,n);var a=t||{},s=document.createElement("div");o=e.call(this,{element:s,target:a.target}),y()((r=l()(o),v()(n.prototype)),"render",o.updateBox.bind(l()(o)),r,!0),o.trackingFlag=!0===a.tracking,o.stateManager=a.stateManager?a.stateManager:null,o.stateManager?(o.stateManager.overview||(o.stateManager.overview={},o.stateManager.overview.collapsed=!!a.collapsed&&a.collapsed),o.collapsed_=!0===o.stateManager.overview.collapsed):o.collapsed_=!!a.collapsed&&a.collapsed,o.collapsible_=!a.collapsible||a.collapsible,o.collapsible_||(o.collapsed_=!1);var u=a.className?a.className:"ol-overview",c=a.tipLabel?a.tipLabel:"Overview map",h=a.collapseLabel?a.collapseLabel:"»";o.collapseLabel_=document.createElement("span"),o.collapseLabel_.innerHTML=h;var p=a.label?a.label:"«";o.label_=document.createElement("span"),o.label_.innerHTML=p;var d=o.collapsible_&&!o.collapsed_?o.collapseLabel_:o.label_,f=document.createElement("button");f.type="button",f.title=c,f.appendChild(d),"ontouchstart"in document.documentElement?f.addEventListener("touchstart",o.buttonClk.bind(l()(o)),!1):f.addEventListener("click",o.buttonClk.bind(l()(o)),!1),o.ovmapDiv=document.createElement("div"),o.ovmapDiv.className="ol-overview-map";var g=u+" ol-unselectable ol-control"+(o.collapsed_&&o.collapsible_?" ol-collapsed":"")+(o.collapsible_?"":" ol-uncollapsible");s.className=g,s.appendChild(o.ovmapDiv),s.appendChild(f);var m=document.createElement("button");m.type="button",m.title="Enlarge",m.className="size",m.innerHTML="+","ontouchstart"in document.documentElement?m.addEventListener("touchstart",o.enlargeButtonClick.bind(l()(o)),!1):m.addEventListener("click",o.enlargeButtonClick.bind(l()(o)),!1),s.appendChild(m);var _=document.createElement("button");_.type="button",_.title="Shrink",_.className="size",_.innerHTML="-","ontouchstart"in document.documentElement?_.addEventListener("touchstart",o.shrinkButtonClick.bind(l()(o)),!1):_.addEventListener("click",o.shrinkButtonClick.bind(l()(o)),!1),s.appendChild(_);var b=document.createElement("button");return b.type="button",b.title="Enable tracking",b.className="size",b.innerHTML="⌕","ontouchstart"in document.documentElement?b.addEventListener("touchstart",o.trackingButtonClick.bind(l()(o)),!1):b.addEventListener("click",o.trackingButtonClick.bind(l()(o)),!1),s.appendChild(b),o.trackingButton=b,o.featureSelect=null,o.eventKeys=[],o}return a()(n,[{key:"getBoxSize",value:function(){if(this.masterMap){var t=x.getBottomLeft(this.masterMap.getView().getProjection().getExtent()),e=x.getTopRight(this.masterMap.getView().getProjection().getExtent());return[Math.abs((t[0]-e[0])/this.masterMap.getView().getMaxResolution()),Math.abs((e[1]-t[1])/this.masterMap.getView().getMaxResolution())]}return[0,0]}},{key:"createOverviewView",value:function(){var t=this.masterMap.getView().getProjection(),e=t.getExtent();return new b.a({projection:t,center:x.getCenter(e),showFullExtent:!0,maxResolution:1250,minResolution:1})}},{key:"setMap",value:function(t){if(t){var e=this.getMap();if(t!==e){e&&this.overviewMap.setTarget(null),c()(v()(n.prototype),"setMap",this).call(this,t),this.masterMap=t;var r=this.getBoxSize(),i=1,o=t.getSize();(r[0]>o[0]/5||r[1]>o[1]/5)&&(i=2),r[0]/=i,r[1]/=i;var a=this.createOverviewView(),s=new E.a({source:new O.a({features:[new C.a({geometry:Object(I.c)(t.getView().calculateExtent(t.getSize()))})]}),style:new L.c({stroke:new P.a({width:2,color:"rgba(0, 60, 136, 1.0)"}),fill:new R.a({color:"rgba(0, 0, 0, 0.0)"})})}),l=new C.a({geometry:Object(I.c)(t.getView().calculateExtent(t.getSize()))});l.setStyle(new L.c({fill:new R.a({color:"rgba(0, 0, 0, 0.4)"})}));var u=new E.a({source:new O.a({features:[l]}),visible:!1}),h=t.getLayers().item(0),p=t.getLayers().getArray().filter((function(t){return!0===t.get("active")}));p.length>0&&(h=p[0]);var d=[new S.a({source:h.getSource()})];d.push(u),d.push(s),this.currentOverlayFeature=l;this.viewboxFeatures=[null,null,null,null];var f=Math.round(Math.sqrt(r[0]*r[0]+r[1]*r[1]));this.ovmapDiv.style.width=f+"px",this.ovmapDiv.style.height=f+"px",this.overviewMap=new w.a({controls:new T.a,interactions:new T.a,target:this.ovmapDiv,view:a,layers:d});var g=new M.a;this.format=g;this.simplifyOptions={tolerance:.01,highQuality:!1};var y={featureProjection:this.overviewMap.getView().getProjection()};this.formatOptions=y;var m=g.writeFeatureObject(this.currentOverlayFeature,y);this.currentOverlayFeatureJson=m;var _=[];_.push(new L.c({stroke:new P.a({width:1,color:"rgba(255, 0, 0, 1.0)"}),fill:new R.a({color:"rgba(0, 0, 0, 0.3)"})})),_.push(new L.c({stroke:new P.a({width:1,color:"rgba(0, 255, 255, 1.0)"}),fill:new R.a({color:"rgba(0, 0, 0, 0.2)"})})),_.push(new L.c({stroke:new P.a({width:1,color:"rgba(255, 215, 0, 1.0)"}),fill:new R.a({color:"rgba(0, 0, 0, 0.1)"})})),_.push(new L.c({stroke:new P.a({width:1,color:"rgba(0, 255, 0, 1.0)"}),fill:new R.a({color:"rgba(0, 0, 0, 0.0)"})})),this.featureStyle=_,this.vectorLayer=s,this.fogLayer=u;this.polling=0;this.pollingRate=10;var b=t.getView().getZoom();this.lastZoomValue=b;var N=this,j=this.overviewMap.on("singleclick",(function(e){e.preventDefault(),t.getView().setCenter(e.coordinate)}),this);this.eventKeys.push(j),j=this.overviewMap.on("pointermove",(function(e){e.preventDefault();var n=!1;e.dragging?(N.featureSelect||(N.featureSelect=N.overviewMap.forEachFeatureAtPixel(e.pixel,(function(t,e){return n=!0,t}))),N.featureSelect&&t.getView().setCenter(e.coordinate)):N.featureSelect&&(N.featureSelect=null),n||(n=N.overviewMap.forEachFeatureAtPixel(e.pixel,(function(t,e){return!0})));var r=e.map.getTargetElement();r.style.cursor=n?"move":""}),this),this.eventKeys.push(j),j=t.getView().on("change:center",this.updateBox.bind(this),this),this.eventKeys.push(j),j=t.getView().on("change:resolution",this.updateBox.bind(this),this),this.eventKeys.push(j),j=t.getView().on("change:rotation",this.updateBox.bind(this),this),this.eventKeys.push(j),this.overviewMap.updateSize();var A=t.getView().getProjection().getExtent();this.overviewMap.getView().fit(A,this.overviewMap.getSize()),this.overviewMap.getView().setCenter(x.getCenter(A)),this.updateBox(),this.setTrackingEnabled(this.trackingFlag),this.masterView=this.masterMap.getView()}}else Object(H.b)(this.eventKeys)}},{key:"updateBox",value:function(){if(this.masterMap&&this.masterMap.isRendered()&&this.overviewMap.isRendered()){var t=this.masterMap.getView(),e=this.overviewMap.getView(),n=t.getRotation();e.setRotation(n);var r=this.masterMap.getSize(),i=t.getResolution(),o=r[0]*i*.5,a=r[1]*i*.5,s=t.getCenter(),l=s[0]-o,u=s[0]+o,c=[l,s[1]-a,u,s[1]+a],h=t.getProjection().getExtent(),p=x.getBottomLeft(h),d=x.getTopRight(h),f=x.getCenter(h),g=Math.abs(p[0]-d[0]),y=Math.abs(d[1]-p[1]),m=.5*Math.sqrt(g*g+y*y),v=[f[0]-m,f[1]-m,f[0]+m,f[1]+m],_=x.getIntersection(c,v),b=new I.a([[[_[0],_[1]],[_[2],_[1]],[_[2],_[3]],[_[0],_[3]],[_[0],_[1]]]]);if(b.rotate(n,b.getInteriorPoint().getFirstCoordinate()),this.vectorLayer.getSource().getFeatures()[0].setGeometry(b),this.trackingFlag){var w;switch(!0){case Math.floor(t.getZoom())<3:return;case Math.floor(t.getZoom())<4:w=1;break;case Math.floor(t.getZoom())<6:w=2;break;case Math.floor(t.getZoom())<7:w=3;break;default:w=4}var E=new C.a({geometry:b}),S=this.format.writeFeatureObject(E,this.formatOptions);if(0!==this.polling&&this.polling<this.pollingRate&&this.lastZoomValue===t.getZoom())return void this.polling++;this.polling=1,this.lastZoomValue=t.getZoom();for(var O=0;O<w;O++)if(null!==this.viewboxFeatures[O]){var T=this.viewboxFeatures[O],P=Object(N.a)(T,S);this.viewboxFeatures[O]=P}else this.viewboxFeatures[O]=S;for(var M,A=Array.from(this.viewboxFeatures),k=0;k<A.length-1;k++)if(null!==A[k+1]&&null!==A[k]){var F=A[k+1],D=W(F,this.simplifyOptions),G=A[k],z=W(G,this.simplifyOptions),U=Object(j.a)(z,D);A[k]=U}var B=this.viewboxFeatures[0],V=W(B,this.simplifyOptions);M=Object(j.a)(this.currentOverlayFeatureJson,V);var q=this.format.readFeature(M,this.formatOptions);q.setStyle(new L.c({fill:new R.a({color:"rgba(0, 0, 0, 0.4)"})}));var Y=Array.from(this.fogLayer.getSource().getFeatures());this.fogLayer.getSource().clear(),this.fogLayer.getSource().addFeature(q);for(var X=0;X<A.length;X++){var H=A[X];if(null!==H){var K=this.format.readFeature(H,this.formatOptions);K.setStyle(this.featureStyle[X]),this.fogLayer.getSource().addFeature(K)}else Y[X+1]&&this.fogLayer.getSource().addFeature(Y[X+1])}}}}},{key:"buttonClk",value:function(t){t&&(t.preventDefault(),t.stopPropagation()),(" "+this.element.className+" ").indexOf(" ol-collapsed ")>-1?this.element.className=this.element.className.replace(/ol-collapsed/g,""):this.element.className+=" ol-collapsed",this.collapsed_?this.label_.parentNode.replaceChild(this.collapseLabel_,this.label_):this.collapseLabel_.parentNode.replaceChild(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_,this.stateManager&&(this.stateManager.overview.collapsed=this.collapsed_),this.overviewMap.updateSize()}},{key:"changeOverviewSize",value:function(t){var e=[this.ovmapDiv.clientWidth,this.ovmapDiv.clientHeight];e[0]/=t,e[1]/=t;var n=Math.round(Math.sqrt(e[0]*e[0]+e[1]*e[1]));n<60||n>600||(this.ovmapDiv.style.width=e[0]+"px",this.ovmapDiv.style.height=e[1]+"px",this.overviewMap.updateSize(),this.overviewMap.getView().fit(this.overviewMap.getView().getProjection().getExtent(),this.overviewMap.getSize()))}},{key:"changeOverviewSizePx",value:function(t){if(!(t<60||t>600)){var e=this.getBoxSize();Math.round(Math.sqrt(e[0]*e[0]+e[1]*e[1]));this.ovmapDiv.style.width=t+"px",this.ovmapDiv.style.height=t+"px",this.overviewMap&&(this.overviewMap.updateSize(),this.overviewMap.getView().fit(this.masterMap.getView().getProjection().getExtent()))}}},{key:"enlargeButtonClick",value:function(t){t&&(t.preventDefault(),t.stopPropagation()),this.changeOverviewSize(.75)}},{key:"shrinkButtonClick",value:function(t){t&&(t.preventDefault(),t.stopPropagation()),this.changeOverviewSize(1.25)}},{key:"trackingButtonClick",value:function(t){t&&(t.preventDefault(),t.stopPropagation()),this.setTrackingEnabled(!this.trackingFlag)}},{key:"setTrackingEnabled",value:function(t){this.trackingFlag=t,this.trackingFlag?(this.trackingButton.classList.add("selected"),this.polling=0,this.fogLayer.setVisible(!0),this.updateBox()):(this.trackingButton.classList.remove("selected"),this.fogLayer.setVisible(!1)),this.trackingButton.blur(),this.trackingButton.hideFocus=!0,this.trackingButton.style.outline="none"}},{key:"getTrackingEnabled",value:function(){return this.trackingFlag}},{key:"getCollapsed",value:function(){return(" "+this.element.className+" ").indexOf(" ol-collapsed ")>-1}},{key:"setCollapsed",value:function(t){this.getCollapsed()!=t&&this.buttonClk()}}]),n}(_.a)},function(t,e,n){"use strict";var r,i=n(13),o=function(){function t(t){this.highWaterMark=void 0!==t?t:2048,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}return t.prototype.canExpireCache=function(){return this.highWaterMark>0&&this.getCount()>this.highWaterMark},t.prototype.clear=function(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null},t.prototype.containsKey=function(t){return this.entries_.hasOwnProperty(t)},t.prototype.forEach=function(t){for(var e=this.oldest_;e;)t(e.value_,e.key_,this),e=e.newer},t.prototype.get=function(t,e){var n=this.entries_[t];return Object(i.a)(void 0!==n,15),n===this.newest_||(n===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(n.newer.older=n.older,n.older.newer=n.newer),n.newer=null,n.older=this.newest_,this.newest_.newer=n,this.newest_=n),n.value_},t.prototype.remove=function(t){var e=this.entries_[t];return Object(i.a)(void 0!==e,15),e===this.newest_?(this.newest_=e.older,this.newest_&&(this.newest_.newer=null)):e===this.oldest_?(this.oldest_=e.newer,this.oldest_&&(this.oldest_.older=null)):(e.newer.older=e.older,e.older.newer=e.newer),delete this.entries_[t],--this.count_,e.value_},t.prototype.getCount=function(){return this.count_},t.prototype.getKeys=function(){var t,e=new Array(this.count_),n=0;for(t=this.newest_;t;t=t.older)e[n++]=t.key_;return e},t.prototype.getValues=function(){var t,e=new Array(this.count_),n=0;for(t=this.newest_;t;t=t.older)e[n++]=t.value_;return e},t.prototype.peekLast=function(){return this.oldest_.value_},t.prototype.peekLastKey=function(){return this.oldest_.key_},t.prototype.peekFirstKey=function(){return this.newest_.key_},t.prototype.pop=function(){var t=this.oldest_;return delete this.entries_[t.key_],t.newer&&(t.newer.older=null),this.oldest_=t.newer,this.oldest_||(this.newest_=null),--this.count_,t.value_},t.prototype.replace=function(t,e){this.get(t),this.entries_[t].value_=e},t.prototype.set=function(t,e){Object(i.a)(!(t in this.entries_),16);var n={key_:t,newer:null,older:this.newest_,value_:e};this.newest_?this.newest_.newer=n:this.oldest_=n,this.newest_=n,this.entries_[t]=n,++this.count_},t.prototype.setSize=function(t){this.highWaterMark=t},t}(),a=n(48),s=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return s(e,t),e.prototype.expireCache=function(t){for(;this.canExpireCache();){if(this.peekLast().getKey()in t)break;this.pop().release()}},e.prototype.pruneExceptNewestZ=function(){if(0!==this.getCount()){var t=this.peekFirstKey(),e=Object(a.b)(t)[0];this.forEach(function(t){t.tileCoord[0]!==e&&(this.remove(Object(a.d)(t.tileCoord)),t.release())}.bind(this))}},e}(o);e.a=l},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r=n(88),i=function(){function t(){this.cache_={},this.cacheSize_=0,this.maxCacheSize_=32}return t.prototype.clear=function(){this.cache_={},this.cacheSize_=0},t.prototype.canExpireCache=function(){return this.cacheSize_>this.maxCacheSize_},t.prototype.expire=function(){if(this.canExpireCache()){var t=0;for(var e in this.cache_){var n=this.cache_[e];0!=(3&t++)||n.hasListener()||(delete this.cache_[e],--this.cacheSize_)}}},t.prototype.get=function(t,e,n){var r=o(t,e,n);return r in this.cache_?this.cache_[r]:null},t.prototype.set=function(t,e,n,r){var i=o(t,e,n);this.cache_[i]=r,++this.cacheSize_},t.prototype.setSize=function(t){this.maxCacheSize_=t,this.expire()},t}();function o(t,e,n){return e+":"+t+":"+(n?Object(r.b)(n):"null")}var a=new i},function(t,e,n){"use strict";var r,i=n(215),o=n(214),a=n(6),s=n(86),l=n(132),u=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),c=function(t){function e(e){return(e=Object(a.a)({},e)).controls||(e.controls=Object(s.defaults)()),e.interactions||(e.interactions=Object(l.defaults)({onFocusOnly:!0})),t.call(this,e)||this}return u(e,t),e.prototype.createRenderer=function(){return new i.a(this)},e}(o.a);e.a=c},function(t,e,n){"use strict";var r,i=n(40),o=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),a=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.map=n,i.frameState=void 0!==r?r:null,i}return o(e,t),e}(i.a);e.a=a},function(t,e,n){"use strict";var r,i=n(112),o=n(19),a=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=function(t){function e(e,n,r,i){var o=t.call(this,e,n,r,i)||this;return o.hitDetectionImage_=null,o.image_=null,o.imagePixelRatio_=void 0,o.anchorX_=void 0,o.anchorY_=void 0,o.height_=void 0,o.opacity_=void 0,o.originX_=void 0,o.originY_=void 0,o.rotateWithView_=void 0,o.rotation_=void 0,o.scale_=void 0,o.width_=void 0,o.declutterImageWithText_=void 0,o}return a(e,t),e.prototype.drawPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var n=t.getFlatCoordinates(),r=t.getStride(),i=this.coordinates.length,a=this.appendFlatPointCoordinates(n,r);this.instructions.push([o.c.DRAW_IMAGE,i,a,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterImageWithText_]),this.hitDetectionInstructions.push([o.c.DRAW_IMAGE,i,a,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterImageWithText_]),this.endGeometry(e)}},e.prototype.drawMultiPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var n=t.getFlatCoordinates(),r=t.getStride(),i=this.coordinates.length,a=this.appendFlatPointCoordinates(n,r);this.instructions.push([o.c.DRAW_IMAGE,i,a,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterImageWithText_]),this.hitDetectionInstructions.push([o.c.DRAW_IMAGE,i,a,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterImageWithText_]),this.endGeometry(e)}},e.prototype.finish=function(){return this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.height_=void 0,this.scale_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.width_=void 0,t.prototype.finish.call(this)},e.prototype.setImageStyle=function(t,e){var n=t.getAnchor(),r=t.getSize(),i=t.getHitDetectionImage(),o=t.getImage(this.pixelRatio),a=t.getOrigin();this.imagePixelRatio_=t.getPixelRatio(this.pixelRatio),this.anchorX_=n[0],this.anchorY_=n[1],this.hitDetectionImage_=i,this.image_=o,this.height_=r[1],this.opacity_=t.getOpacity(),this.originX_=a[0],this.originY_=a[1],this.rotateWithView_=t.getRotateWithView(),this.rotation_=t.getRotation(),this.scale_=t.getScaleArray(),this.width_=r[0],this.declutterImageWithText_=e},e}(i.a),l=n(17),u=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),c=function(t){function e(e,n,r,i){return t.call(this,e,n,r,i)||this}return u(e,t),e.prototype.drawFlatCoordinates_=function(t,e,n,r){var i=this.coordinates.length,a=this.appendFlatLineCoordinates(t,e,n,r,!1,!1),s=[o.c.MOVE_TO_LINE_TO,i,a];return this.instructions.push(s),this.hitDetectionInstructions.push(s),n},e.prototype.drawLineString=function(t,e){var n=this.state,r=n.strokeStyle,i=n.lineWidth;if(void 0!==r&&void 0!==i){this.updateStrokeStyle(n,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([o.c.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,l.e,l.f],o.a);var a=t.getFlatCoordinates(),s=t.getStride();this.drawFlatCoordinates_(a,0,a.length,s),this.hitDetectionInstructions.push(o.e),this.endGeometry(e)}},e.prototype.drawMultiLineString=function(t,e){var n=this.state,r=n.strokeStyle,i=n.lineWidth;if(void 0!==r&&void 0!==i){this.updateStrokeStyle(n,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([o.c.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,n.lineDash,n.lineDashOffset],o.a);for(var a=t.getEnds(),s=t.getFlatCoordinates(),l=t.getStride(),u=0,c=0,h=a.length;c<h;++c)u=this.drawFlatCoordinates_(s,u,a[c],l);this.hitDetectionInstructions.push(o.e),this.endGeometry(e)}},e.prototype.finish=function(){var e=this.state;return null!=e.lastStroke&&e.lastStroke!=this.coordinates.length&&this.instructions.push(o.e),this.reverseHitDetectionInstructions(),this.state=null,t.prototype.finish.call(this)},e.prototype.applyStroke=function(e){null!=e.lastStroke&&e.lastStroke!=this.coordinates.length&&(this.instructions.push(o.e),e.lastStroke=this.coordinates.length),e.lastStroke=0,t.prototype.applyStroke.call(this,e),this.instructions.push(o.a)},e}(i.a),h=n(100),p=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),d=function(t){function e(e,n,r,i){return t.call(this,e,n,r,i)||this}return p(e,t),e.prototype.drawFlatCoordinatess_=function(t,e,n,r){var i=this.state,a=void 0!==i.fillStyle,s=void 0!==i.strokeStyle,l=n.length;this.instructions.push(o.a),this.hitDetectionInstructions.push(o.a);for(var u=0;u<l;++u){var c=n[u],h=this.coordinates.length,p=this.appendFlatLineCoordinates(t,e,c,r,!0,!s),d=[o.c.MOVE_TO_LINE_TO,h,p];this.instructions.push(d),this.hitDetectionInstructions.push(d),s&&(this.instructions.push(o.b),this.hitDetectionInstructions.push(o.b)),e=c}return a&&(this.instructions.push(o.d),this.hitDetectionInstructions.push(o.d)),s&&(this.instructions.push(o.e),this.hitDetectionInstructions.push(o.e)),e},e.prototype.drawCircle=function(t,e){var n=this.state,r=n.fillStyle,i=n.strokeStyle;if(void 0!==r||void 0!==i){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==n.fillStyle&&this.hitDetectionInstructions.push([o.c.SET_FILL_STYLE,l.b]),void 0!==n.strokeStyle&&this.hitDetectionInstructions.push([o.c.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,n.lineDash,n.lineDashOffset]);var a=t.getFlatCoordinates(),s=t.getStride(),u=this.coordinates.length;this.appendFlatLineCoordinates(a,0,a.length,s,!1,!1);var c=[o.c.CIRCLE,u];this.instructions.push(o.a,c),this.hitDetectionInstructions.push(o.a,c),void 0!==n.fillStyle&&(this.instructions.push(o.d),this.hitDetectionInstructions.push(o.d)),void 0!==n.strokeStyle&&(this.instructions.push(o.e),this.hitDetectionInstructions.push(o.e)),this.endGeometry(e)}},e.prototype.drawPolygon=function(t,e){var n=this.state,r=n.fillStyle,i=n.strokeStyle;if(void 0!==r||void 0!==i){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==n.fillStyle&&this.hitDetectionInstructions.push([o.c.SET_FILL_STYLE,l.b]),void 0!==n.strokeStyle&&this.hitDetectionInstructions.push([o.c.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,n.lineDash,n.lineDashOffset]);var a=t.getEnds(),s=t.getOrientedFlatCoordinates(),u=t.getStride();this.drawFlatCoordinatess_(s,0,a,u),this.endGeometry(e)}},e.prototype.drawMultiPolygon=function(t,e){var n=this.state,r=n.fillStyle,i=n.strokeStyle;if(void 0!==r||void 0!==i){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==n.fillStyle&&this.hitDetectionInstructions.push([o.c.SET_FILL_STYLE,l.b]),void 0!==n.strokeStyle&&this.hitDetectionInstructions.push([o.c.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,n.lineDash,n.lineDashOffset]);for(var a=t.getEndss(),s=t.getOrientedFlatCoordinates(),u=t.getStride(),c=0,h=0,p=a.length;h<p;++h)c=this.drawFlatCoordinatess_(s,c,a[h],u);this.endGeometry(e)}},e.prototype.finish=function(){this.reverseHitDetectionInstructions(),this.state=null;var e=this.tolerance;if(0!==e)for(var n=this.coordinates,r=0,i=n.length;r<i;++r)n[r]=Object(h.e)(n[r],e);return t.prototype.finish.call(this)},e.prototype.setFillStrokeStyles_=function(){var t=this.state;void 0!==t.fillStyle&&this.updateFillStyle(t,this.createFill),void 0!==t.strokeStyle&&this.updateStrokeStyle(t,this.applyStroke)},e}(i.a),f=n(167),g={Circle:d,Default:i.a,Image:s,LineString:c,Polygon:d,Text:f.b},y=function(){function t(t,e,n,r){this.tolerance_=t,this.maxExtent_=e,this.pixelRatio_=r,this.resolution_=n,this.buildersByZIndex_={}}return t.prototype.finish=function(){var t={};for(var e in this.buildersByZIndex_){t[e]=t[e]||{};var n=this.buildersByZIndex_[e];for(var r in n){var i=n[r].finish();t[e][r]=i}}return t},t.prototype.getBuilder=function(t,e){var n=void 0!==t?t.toString():"0",r=this.buildersByZIndex_[n];void 0===r&&(r={},this.buildersByZIndex_[n]=r);var i=r[e];void 0===i&&(i=new(0,g[e])(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),r[e]=i);return i},t}();e.a=y},function(t,e,n){"use strict";var r=n(34),i=n(19),o=n(167),a=n(57),s=n(14),l=n(0),u=n(17),c=n(8),h=n(63);function p(t,e,n,r,i,o,a,s,l,u,p,d){var f=t[e],g=t[e+1],y=0,m=0,v=0,_=0;function b(){y=f,m=g,f=t[e+=r],g=t[e+1],_+=v,v=Math.sqrt((f-y)*(f-y)+(g-m)*(g-m))}do{b()}while(e<n-r&&_+v<o);for(var w=(o-_)/v,x=Object(c.c)(y,f,w),E=Object(c.c)(m,g,w),S=e-r,O=_,C=o+s*l(u,i,p);e<n-r&&_+v<C;)b();w=(C-_)/v;var T,I=Object(c.c)(y,f,w),L=Object(c.c)(m,g,w);if(d){var P=[x,E,I,L];Object(h.a)(P,0,4,2,d,P,P),T=P[0]>P[2]}else T=x>I;var R,M=Math.PI,N=[],j=S+r===e;if(v=0,_=O,f=t[e=S],g=t[e+1],j){b();var A=Math.atan2(g-m,f-y);T&&(A+=A>0?-M:M);var k=(I+x)/2,F=(L+E)/2;return N[0]=[k,F,(C-o)/2,A,i],N}for(var D=0,G=i.length;D<G;){b();var z=Math.atan2(g-m,f-y);if(T&&(z+=z>0?-M:M),void 0!==R){var U=z-R;if(U+=U>M?-2*M:U<-M?2*M:0,Math.abs(U)>a)return null}R=z;for(var B=D,V=0;D<G;++D){var q=s*l(u,i[T?G-D-1:D],p);if(e+r<n&&_+v<o+V+q/2)break;V+=q}if(D!==B){var Y=T?i.substring(G-B,G-D):i.substring(B,D);w=(o+V/2-_)/v;k=Object(c.c)(y,f,w),F=Object(c.c)(m,g,w);N.push([k,F,V/2,z,Y]),o+=V}}return N}var d=n(7),f=n(194),g=Object(l.createEmpty)(),y=[],m=[],v=[],_=[];function b(t){return t[3].declutterBox}var w=new RegExp("["+String.fromCharCode(1425)+"-"+String.fromCharCode(2303)+String.fromCharCode(64285)+"-"+String.fromCharCode(65023)+String.fromCharCode(65136)+"-"+String.fromCharCode(65276)+String.fromCharCode(67584)+"-"+String.fromCharCode(69631)+String.fromCharCode(124928)+"-"+String.fromCharCode(126975)+"]");function x(t,e){return"start"!==e&&"end"!==e||w.test(t)||(e="start"===e?"left":"right"),o.a[e]}var E=function(){function t(t,e,n,r){this.overlaps=n,this.pixelRatio=e,this.resolution=t,this.alignFill_,this.instructions=r.instructions,this.coordinates=r.coordinates,this.coordinateCache_={},this.renderedTransform_=Object(s.c)(),this.hitDetectionInstructions=r.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=r.fillStates||{},this.strokeStates=r.strokeStates||{},this.textStates=r.textStates||{},this.widths_={},this.labels_={}}return t.prototype.createLabel=function(t,e,n,r){var i=t+e+n+r;if(this.labels_[i])return this.labels_[i];var o=r?this.strokeStates[r]:null,s=n?this.fillStates[n]:null,l=this.textStates[e],c=this.pixelRatio,h=[l.scale[0]*c,l.scale[1]*c],p=x(t,l.textAlign||u.l),d=r&&o.lineWidth?o.lineWidth:0,f=t.split("\n"),g=f.length,y=[],m=Object(u.r)(l.font,f,y),v=Object(u.q)(l.font),_=m+d,b=[],w=(_+2)*h[0],E=(v*g+d)*h[1],S={width:w<0?Math.floor(w):Math.ceil(w),height:E<0?Math.floor(E):Math.ceil(E),contextInstructions:b};(1==h[0]&&1==h[1]||b.push("scale",h),b.push("font",l.font),r)&&(b.push("strokeStyle",o.strokeStyle),b.push("lineWidth",d),b.push("lineCap",o.lineCap),b.push("lineJoin",o.lineJoin),b.push("miterLimit",o.miterLimit),(a.g?OffscreenCanvasRenderingContext2D:CanvasRenderingContext2D).prototype.setLineDash&&(b.push("setLineDash",[o.lineDash]),b.push("lineDashOffset",o.lineDashOffset)));n&&b.push("fillStyle",s.fillStyle),b.push("textBaseline","middle"),b.push("textAlign","center");var O,C=.5-p,T=p*_+C*d;if(r)for(O=0;O<g;++O)b.push("strokeText",[f[O],T+C*y[O],.5*(d+v)+O*v]);if(n)for(O=0;O<g;++O)b.push("fillText",[f[O],T+C*y[O],.5*(d+v)+O*v]);return this.labels_[i]=S,S},t.prototype.replayTextBackground_=function(t,e,n,r,i,o,a){t.beginPath(),t.moveTo.apply(t,e),t.lineTo.apply(t,n),t.lineTo.apply(t,r),t.lineTo.apply(t,i),t.lineTo.apply(t,e),o&&(this.alignFill_=o[2],this.fill_(t)),a&&(this.setStrokeStyle_(t,a),t.stroke())},t.prototype.calculateImageOrLabelDimensions_=function(t,e,n,r,i,o,a,u,c,h,p,d,f,b,w,x){var E,S=n-(a*=d[0]),O=r-(u*=d[1]),C=i+c>t?t-c:i,T=o+h>e?e-h:o,I=b[3]+C*d[0]+b[1],L=b[0]+T*d[1]+b[2],P=S-b[3],R=O-b[0];return(w||0!==p)&&(y[0]=P,_[0]=P,y[1]=R,m[1]=R,m[0]=P+I,v[0]=m[0],v[1]=R+L,_[1]=v[1]),0!==p?(E=Object(s.b)(Object(s.c)(),n,r,1,1,p,-n,-r),Object(s.a)(E,y),Object(s.a)(E,m),Object(s.a)(E,v),Object(s.a)(E,_),Object(l.createOrUpdate)(Math.min(y[0],m[0],v[0],_[0]),Math.min(y[1],m[1],v[1],_[1]),Math.max(y[0],m[0],v[0],_[0]),Math.max(y[1],m[1],v[1],_[1]),g)):Object(l.createOrUpdate)(Math.min(P,P+I),Math.min(R,R+L),Math.max(P,P+I),Math.max(R,R+L),g),f&&(S=Math.round(S),O=Math.round(O)),{drawImageX:S,drawImageY:O,drawImageW:C,drawImageH:T,originX:c,originY:h,declutterBox:{minX:g[0],minY:g[1],maxX:g[2],maxY:g[3],value:x},canvasTransform:E,scale:d}},t.prototype.replayImageOrLabel_=function(t,e,n,r,i,o,a){var s=!(!o&&!a),l=r.declutterBox,c=t.canvas,h=a?a[2]*r.scale[0]/2:0;return l.minX-h<=c.width/e&&l.maxX+h>=0&&l.minY-h<=c.height/e&&l.maxY+h>=0&&(s&&this.replayTextBackground_(t,y,m,v,_,o,a),Object(u.n)(t,r.canvasTransform,i,n,r.originX,r.originY,r.drawImageW,r.drawImageH,r.drawImageX,r.drawImageY,r.scale)),!0},t.prototype.fill_=function(t){if(this.alignFill_){var e=Object(s.a)(this.renderedTransform_,[0,0]),n=512*this.pixelRatio;t.save(),t.translate(e[0]%n,e[1]%n),t.rotate(this.viewRotation_)}t.fill(),this.alignFill_&&t.restore()},t.prototype.setStrokeStyle_=function(t,e){t.strokeStyle=e[1],t.lineWidth=e[2],t.lineCap=e[3],t.lineJoin=e[4],t.miterLimit=e[5],t.setLineDash&&(t.lineDashOffset=e[7],t.setLineDash(e[6]))},t.prototype.drawLabelWithPointPlacement_=function(t,e,n,r){var i=this.textStates[e],a=this.createLabel(t,e,r,n),s=this.strokeStates[n],l=this.pixelRatio,c=x(t,i.textAlign||u.l),h=o.a[i.textBaseline||u.m],p=s&&s.lineWidth?s.lineWidth:0;return{label:a,anchorX:c*(a.width/l-2*i.scale[0])+2*(.5-c)*p,anchorY:h*a.height/l+2*(.5-h)*p}},t.prototype.execute_=function(t,e,n,r,a,c,g,y){var m;this.pixelCoordinates_&&Object(d.b)(n,this.renderedTransform_)?m=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),m=Object(h.c)(this.coordinates,0,this.coordinates.length,2,n,this.pixelCoordinates_),Object(s.j)(this.renderedTransform_,n));for(var v,_,w,x,E,S,O,C,T,I,L,P,R,M,N,j,A=0,k=r.length,F=0,D=0,G=0,z=null,U=null,B=this.coordinateCache_,V=this.viewRotation_,q=Math.round(1e12*Math.atan2(-n[1],n[0]))/1e12,Y={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:V},X=this.instructions!=r||this.overlaps?0:200;A<k;){var W=r[A];switch(W[0]){case i.c.BEGIN_GEOMETRY:R=W[1],j=W[3],R.getGeometry()?void 0===g||Object(l.intersects)(g,j.getExtent())?++A:A=W[2]+1:A=W[2];break;case i.c.BEGIN_PATH:D>X&&(this.fill_(t),D=0),G>X&&(t.stroke(),G=0),D||G||(t.beginPath(),x=NaN,E=NaN),++A;break;case i.c.CIRCLE:var H=m[F=W[1]],K=m[F+1],Z=m[F+2]-H,$=m[F+3]-K,J=Math.sqrt(Z*Z+$*$);t.moveTo(H+J,K),t.arc(H,K,J,0,2*Math.PI,!0),++A;break;case i.c.CLOSE_PATH:t.closePath(),++A;break;case i.c.CUSTOM:F=W[1],v=W[2];var Q=W[3],tt=W[4],et=6==W.length?W[5]:void 0;Y.geometry=Q,Y.feature=R,A in B||(B[A]=[]);var nt=B[A];et?et(m,F,v,2,nt):(nt[0]=m[F],nt[1]=m[F+1],nt.length=2),tt(nt,Y),++A;break;case i.c.DRAW_IMAGE:F=W[1],v=W[2],C=W[3],_=W[4],w=W[5];var rt=W[6],it=W[7],ot=W[8],at=W[9],st=W[10],lt=W[11],ut=W[12],ct=W[13],ht=W[14];if(!C&&W.length>=19){T=W[18],I=W[19],L=W[20],P=W[21];var pt=this.drawLabelWithPointPlacement_(T,I,L,P);C=pt.label,W[3]=C;var dt=W[22];_=(pt.anchorX-dt)*this.pixelRatio,W[4]=_;var ft=W[23];w=(pt.anchorY-ft)*this.pixelRatio,W[5]=w,rt=C.height,W[6]=rt,ct=C.width,W[13]=ct}var gt=void 0;W.length>24&&(gt=W[24]);var yt=void 0,mt=void 0,vt=void 0;W.length>16?(yt=W[15],mt=W[16],vt=W[17]):(yt=u.j,mt=!1,vt=!1),st&&q?lt+=V:st||q||(lt-=V);for(var _t=0;F<v;F+=2)if(!(gt&>[_t++]<ct/this.pixelRatio)){var bt=[t,e,C,Wt=this.calculateImageOrLabelDimensions_(C.width,C.height,m[F],m[F+1],ct,rt,_,w,ot,at,lt,ut,a,yt,mt||vt,R),it,mt?z:null,vt?U:null],wt=void 0,xt=void 0;if(y&&ht){var Et=v-F;if(!ht[Et]){ht[Et]=bt;continue}if(wt=ht[Et],delete ht[Et],xt=b(wt),y.collides(xt))continue}y&&y.collides(Wt.declutterBox)||(wt&&(y&&y.insert(xt),this.replayImageOrLabel_.apply(this,wt)),y&&y.insert(Wt.declutterBox),this.replayImageOrLabel_.apply(this,bt))}++A;break;case i.c.DRAW_CHARS:var St=W[1],Ot=W[2],Ct=W[3],Tt=W[4];P=W[5];var It=W[6],Lt=W[7],Pt=W[8];L=W[9];var Rt=W[10];T=W[11],I=W[12];var Mt=[W[13],W[13]],Nt=this.textStates[I],jt=Nt.font,At=[Nt.scale[0]*Lt,Nt.scale[1]*Lt],kt=void 0;jt in this.widths_?kt=this.widths_[jt]:(kt={},this.widths_[jt]=kt);var Ft=Object(f.a)(m,St,Ot,2),Dt=Math.abs(At[0])*Object(u.p)(jt,T,kt);if(Tt||Dt<=Ft){var Gt=this.textStates[I].textAlign,zt=p(m,St,Ot,2,T,(Ft-Dt)*o.a[Gt],It,Math.abs(At[0]),u.p,jt,kt,q?0:this.viewRotation_);t:if(zt){var Ut=[],Bt=void 0,Vt=void 0,qt=void 0,Yt=void 0,Xt=void 0;if(L)for(Bt=0,Vt=zt.length;Bt<Vt;++Bt){qt=(Xt=zt[Bt])[4],Yt=this.createLabel(qt,I,"",L),_=Xt[2]+(At[0]<0?-Rt:Rt),w=Ct*Yt.height+2*(.5-Ct)*Rt*At[1]/At[0]-Pt;var Wt=this.calculateImageOrLabelDimensions_(Yt.width,Yt.height,Xt[0],Xt[1],Yt.width,Yt.height,_,w,0,0,Xt[3],Mt,!1,u.j,!1,R);if(y&&y.collides(Wt.declutterBox))break t;Ut.push([t,e,Yt,Wt,1,null,null])}if(P)for(Bt=0,Vt=zt.length;Bt<Vt;++Bt){qt=(Xt=zt[Bt])[4],Yt=this.createLabel(qt,I,P,""),_=Xt[2],w=Ct*Yt.height-Pt;Wt=this.calculateImageOrLabelDimensions_(Yt.width,Yt.height,Xt[0],Xt[1],Yt.width,Yt.height,_,w,0,0,Xt[3],Mt,!1,u.j,!1,R);if(y&&y.collides(Wt.declutterBox))break t;Ut.push([t,e,Yt,Wt,1,null,null])}y&&y.load(Ut.map(b));for(var Ht=0,Kt=Ut.length;Ht<Kt;++Ht)this.replayImageOrLabel_.apply(this,Ut[Ht])}}++A;break;case i.c.END_GEOMETRY:if(void 0!==c){var Zt=c(R=W[1],j);if(Zt)return Zt}++A;break;case i.c.FILL:X?D++:this.fill_(t),++A;break;case i.c.MOVE_TO_LINE_TO:for(F=W[1],v=W[2],M=m[F],O=(N=m[F+1])+.5|0,(S=M+.5|0)===x&&O===E||(t.moveTo(M,N),x=S,E=O),F+=2;F<v;F+=2)S=(M=m[F])+.5|0,O=(N=m[F+1])+.5|0,F!=v-2&&S===x&&O===E||(t.lineTo(M,N),x=S,E=O);++A;break;case i.c.SET_FILL_STYLE:z=W,this.alignFill_=W[2],D&&(this.fill_(t),D=0,G&&(t.stroke(),G=0)),t.fillStyle=W[1],++A;break;case i.c.SET_STROKE_STYLE:U=W,G&&(t.stroke(),G=0),this.setStrokeStyle_(t,W),++A;break;case i.c.STROKE:X?G++:t.stroke(),++A;break;default:++A}}D&&this.fill_(t),G&&t.stroke()},t.prototype.execute=function(t,e,n,r,i,o){this.viewRotation_=r,this.execute_(t,e,n,this.instructions,i,void 0,void 0,o)},t.prototype.executeHitDetection=function(t,e,n,r,i){return this.viewRotation_=n,this.execute_(t,1,e,this.hitDetectionInstructions,!0,r,i)},t}(),S=n(25),O=n(6),C=[r.a.POLYGON,r.a.CIRCLE,r.a.LINE_STRING,r.a.IMAGE,r.a.TEXT,r.a.DEFAULT],T=function(){function t(t,e,n,r,i,o){this.maxExtent_=t,this.overlaps_=r,this.pixelRatio_=n,this.resolution_=e,this.renderBuffer_=o,this.executorsByZIndex_={},this.hitDetectionContext_=null,this.hitDetectionTransform_=Object(s.c)(),this.createExecutors_(i)}return t.prototype.clip=function(t,e){var n=this.getClipCoords(e);t.beginPath(),t.moveTo(n[0],n[1]),t.lineTo(n[2],n[3]),t.lineTo(n[4],n[5]),t.lineTo(n[6],n[7]),t.clip()},t.prototype.createExecutors_=function(t){for(var e in t){var n=this.executorsByZIndex_[e];void 0===n&&(n={},this.executorsByZIndex_[e]=n);var r=t[e];for(var i in r){var o=r[i];n[i]=new E(this.resolution_,this.pixelRatio_,this.overlaps_,o)}}},t.prototype.hasExecutors=function(t){for(var e in this.executorsByZIndex_)for(var n=this.executorsByZIndex_[e],r=0,i=t.length;r<i;++r)if(t[r]in n)return!0;return!1},t.prototype.forEachFeatureAtCoordinate=function(t,e,n,i,o,a){var u=2*(i=Math.round(i))+1,c=Object(s.b)(this.hitDetectionTransform_,i+.5,i+.5,1/e,-1/e,-n,-t[0],-t[1]),h=!this.hitDetectionContext_;h&&(this.hitDetectionContext_=Object(S.a)(u,u));var p,f=this.hitDetectionContext_;f.canvas.width!==u||f.canvas.height!==u?(f.canvas.width=u,f.canvas.height=u):h||f.clearRect(0,0,u,u),void 0!==this.renderBuffer_&&(p=Object(l.createEmpty)(),Object(l.extendCoordinate)(p,t),Object(l.buffer)(p,e*(this.renderBuffer_+i),p));var g,y=function(t){if(void 0!==I[t])return I[t];for(var e=2*t+1,n=t*t,r=new Array(n+1),i=0;i<=t;++i)for(var o=0;o<=t;++o){var a=i*i+o*o;if(a>n)break;var s=r[a];s||(s=[],r[a]=s),s.push(4*((t+i)*e+(t+o))+3),i>0&&s.push(4*((t-i)*e+(t+o))+3),o>0&&(s.push(4*((t+i)*e+(t-o))+3),i>0&&s.push(4*((t-i)*e+(t-o))+3))}for(var l=[],u=(i=0,r.length);i<u;++i)r[i]&&l.push.apply(l,r[i]);return I[t]=l,l}(i);function m(t,e){for(var n=f.getImageData(0,0,u,u).data,s=0,l=y.length;s<l;s++)if(n[y[s]]>0){if(!a||g!==r.a.IMAGE&&g!==r.a.TEXT||-1!==a.indexOf(t)){var c=(y[s]-3)/4,h=i-c%u,p=i-(c/u|0),d=o(t,e,h*h+p*p);if(d)return d}f.clearRect(0,0,u,u);break}}var v,_,b,w,x,E=Object.keys(this.executorsByZIndex_).map(Number);for(E.sort(d.i),v=E.length-1;v>=0;--v){var O=E[v].toString();for(b=this.executorsByZIndex_[O],_=C.length-1;_>=0;--_)if(void 0!==(w=b[g=C[_]])&&(x=w.executeHitDetection(f,c,n,m,p)))return x}},t.prototype.getClipCoords=function(t){var e=this.maxExtent_;if(!e)return null;var n=e[0],r=e[1],i=e[2],o=e[3],a=[n,r,n,o,i,o,i,r];return Object(h.c)(a,0,8,2,t,a),a},t.prototype.isEmpty=function(){return Object(O.d)(this.executorsByZIndex_)},t.prototype.execute=function(t,e,n,r,i,o,a){var s=Object.keys(this.executorsByZIndex_).map(Number);s.sort(d.i),this.maxExtent_&&(t.save(),this.clip(t,n));var l,u,c,h,p,f,g=o||C;for(a&&s.reverse(),l=0,u=s.length;l<u;++l){var y=s[l].toString();for(p=this.executorsByZIndex_[y],c=0,h=g.length;c<h;++c){void 0!==(f=p[g[c]])&&f.execute(t,e,n,r,i,a)}}this.maxExtent_&&t.restore()},t}(),I={};e.a=T},function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var r=n(112),i=n(19),o=n(1),a=n(191),s=n(92),l=n(17),u=n(4),c=n(0);function h(t,e,n,r,i){var o,a,s,l,u,c,h,p,d,f=n,g=n,y=0,m=0,v=n;for(o=n;o<r;o+=i){var _=e[o],b=e[o+1];void 0!==l&&(p=_-l,d=b-u,s=Math.sqrt(p*p+d*d),void 0!==c&&(m+=a,Math.acos((c*p+h*d)/(a*s))>t&&(m>y&&(y=m,f=v,g=o),m=0,v=o-i)),a=s,c=p,h=d),l=_,u=b}return(m+=s)>y?[v,o]:[f,g]}var p,d=(p=function(t,e){return(p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}p(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),f={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},g=function(t){function e(e,n,r,i){var o=t.call(this,e,n,r,i)||this;return o.labels_=null,o.text_="",o.textOffsetX_=0,o.textOffsetY_=0,o.textRotateWithView_=void 0,o.textRotation_=0,o.textFillState_=null,o.fillStates={},o.textStrokeState_=null,o.strokeStates={},o.textState_={},o.textStates={},o.textKey_="",o.fillKey_="",o.strokeKey_="",o.declutterImageWithText_=void 0,o}return d(e,t),e.prototype.finish=function(){var e=t.prototype.finish.call(this);return e.textStates=this.textStates,e.fillStates=this.fillStates,e.strokeStates=this.strokeStates,e},e.prototype.drawText=function(t,e){var n=this.textFillState_,r=this.textStrokeState_,s=this.textState_;if(""!==this.text_&&s&&(n||r)){var u=this.coordinates,p=u.length,d=t.getType(),f=null,g=t.getStride();if(s.placement!==a.a.LINE||d!=o.a.LINE_STRING&&d!=o.a.MULTI_LINE_STRING&&d!=o.a.POLYGON&&d!=o.a.MULTI_POLYGON){var y=s.overflow?null:[];switch(d){case o.a.POINT:case o.a.MULTI_POINT:f=t.getFlatCoordinates();break;case o.a.LINE_STRING:f=t.getFlatMidpoint();break;case o.a.CIRCLE:f=t.getCenter();break;case o.a.MULTI_LINE_STRING:f=t.getFlatMidpoints(),g=2;break;case o.a.POLYGON:f=t.getFlatInteriorPoint(),s.overflow||y.push(f[2]/this.resolution),g=3;break;case o.a.MULTI_POLYGON:var m=t.getFlatInteriorPoints();f=[];for(I=0,L=m.length;I<L;I+=3)s.overflow||y.push(m[I+2]/this.resolution),f.push(m[I],m[I+1]);if(0===f.length)return;g=2}if((k=this.appendFlatPointCoordinates(f,g))===p)return;if(y&&(k-p)/2!=f.length/g){var v=p/2;y=y.filter((function(t,e){var n=u[2*(v+e)]===f[e*g]&&u[2*(v+e)+1]===f[e*g+1];return n||--v,n}))}this.saveTextStates_(),(s.backgroundFill||s.backgroundStroke)&&(this.setFillStrokeStyle(s.backgroundFill,s.backgroundStroke),s.backgroundFill&&(this.updateFillStyle(this.state,this.createFill),this.hitDetectionInstructions.push(this.createFill(this.state))),s.backgroundStroke&&(this.updateStrokeStyle(this.state,this.applyStroke),this.hitDetectionInstructions.push(this.createStroke(this.state)))),this.beginGeometry(t,e);var _=s.padding;if(_!=l.j&&(s.scale[0]<0||s.scale[1]<0)){var b=s.padding[0],w=s.padding[1],x=s.padding[2],E=s.padding[3];s.scale[0]<0&&(w=-w,E=-E),s.scale[1]<0&&(b=-b,x=-x),_=[b,w,x,E]}var S=this.pixelRatio;this.instructions.push([i.c.DRAW_IMAGE,p,k,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,this.declutterImageWithText_,_==l.j?l.j:_.map((function(t){return t*S})),!!s.backgroundFill,!!s.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,y]);var O=1/S;this.hitDetectionInstructions.push([i.c.DRAW_IMAGE,p,k,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[O,O],NaN,this.declutterImageWithText_,_,!!s.backgroundFill,!!s.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,y]),this.endGeometry(e)}else{if(!Object(c.intersects)(this.getBufferedMaxExtent(),t.getExtent()))return;var C=void 0;if(f=t.getFlatCoordinates(),d==o.a.LINE_STRING)C=[f.length];else if(d==o.a.MULTI_LINE_STRING)C=t.getEnds();else if(d==o.a.POLYGON)C=t.getEnds().slice(0,1);else if(d==o.a.MULTI_POLYGON){var T=t.getEndss();C=[];for(var I=0,L=T.length;I<L;++I)C.push(T[I][0])}this.beginGeometry(t,e);for(var P=s.textAlign,R=0,M=void 0,N=0,j=C.length;N<j;++N){if(null==P){var A=h(s.maxAngle,f,R,C[N],g);R=A[0],M=A[1]}else M=C[N];for(var I=R;I<M;I+=g)u.push(f[I],f[I+1]);var k=u.length;R=C[N],this.drawChars_(p,k),p=k}this.endGeometry(e)}}},e.prototype.saveTextStates_=function(){var t=this.textStrokeState_,e=this.textState_,n=this.textFillState_,r=this.strokeKey_;t&&(r in this.strokeStates||(this.strokeStates[r]={strokeStyle:t.strokeStyle,lineCap:t.lineCap,lineDashOffset:t.lineDashOffset,lineWidth:t.lineWidth,lineJoin:t.lineJoin,miterLimit:t.miterLimit,lineDash:t.lineDash}));var i=this.textKey_;i in this.textStates||(this.textStates[i]={font:e.font,textAlign:e.textAlign||l.l,textBaseline:e.textBaseline||l.m,scale:e.scale});var o=this.fillKey_;n&&(o in this.fillStates||(this.fillStates[o]={fillStyle:n.fillStyle}))},e.prototype.drawChars_=function(t,e){var n=this.textStrokeState_,r=this.textState_,o=this.strokeKey_,a=this.textKey_,s=this.fillKey_;this.saveTextStates_();var l=this.pixelRatio,u=f[r.textBaseline],c=this.textOffsetY_*l,h=this.text_,p=n?n.lineWidth*Math.abs(r.scale[0])/2:0;this.instructions.push([i.c.DRAW_CHARS,t,e,u,r.overflow,s,r.maxAngle,l,c,o,p*l,h,a,1]),this.hitDetectionInstructions.push([i.c.DRAW_CHARS,t,e,u,r.overflow,s,r.maxAngle,1,c,o,p,h,a,1/l])},e.prototype.setTextStyle=function(t,e){var n,r,i;if(t){var o=t.getFill();o?((r=this.textFillState_)||(r={},this.textFillState_=r),r.fillStyle=Object(s.a)(o.getColor()||l.b)):(r=null,this.textFillState_=r);var a=t.getStroke();if(a){(i=this.textStrokeState_)||(i={},this.textStrokeState_=i);var c=a.getLineDash(),h=a.getLineDashOffset(),p=a.getWidth(),d=a.getMiterLimit();i.lineCap=a.getLineCap()||l.d,i.lineDash=c?c.slice():l.e,i.lineDashOffset=void 0===h?l.f:h,i.lineJoin=a.getLineJoin()||l.g,i.lineWidth=void 0===p?l.h:p,i.miterLimit=void 0===d?l.i:d,i.strokeStyle=Object(s.a)(a.getColor()||l.k)}else i=null,this.textStrokeState_=i;n=this.textState_;var f=t.getFont()||l.c;Object(l.s)(f);var g=t.getScaleArray();n.overflow=t.getOverflow(),n.font=f,n.maxAngle=t.getMaxAngle(),n.placement=t.getPlacement(),n.textAlign=t.getTextAlign(),n.textBaseline=t.getTextBaseline()||l.m,n.backgroundFill=t.getBackgroundFill(),n.backgroundStroke=t.getBackgroundStroke(),n.padding=t.getPadding()||l.j,n.scale=void 0===g?[1,1]:g;var y=t.getOffsetX(),m=t.getOffsetY(),v=t.getRotateWithView(),_=t.getRotation();this.text_=t.getText()||"",this.textOffsetX_=void 0===y?0:y,this.textOffsetY_=void 0===m?0:m,this.textRotateWithView_=void 0!==v&&v,this.textRotation_=void 0===_?0:_,this.strokeKey_=i?("string"==typeof i.strokeStyle?i.strokeStyle:Object(u.c)(i.strokeStyle))+i.lineCap+i.lineDashOffset+"|"+i.lineWidth+i.lineJoin+i.miterLimit+"["+i.lineDash.join()+"]":"",this.textKey_=n.font+n.scale+(n.textAlign||"?")+(n.textBaseline||"?"),this.fillKey_=r?"string"==typeof r.fillStyle?r.fillStyle:"|"+Object(u.c)(r.fillStyle):""}else this.text_="";this.declutterImageWithText_=e},e}(r.a);e.b=g},function(t,e,n){"use strict";var r,i=n(39),o=n(76),a=n(0),s=n(13),l=n(81),u=n(55),c=n(2),h=n(140),p=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),d=function(t){function e(e){var n=t.call(this,{attributions:e.attributions,cacheSize:e.cacheSize,crossOrigin:e.crossOrigin,imageSmoothing:e.imageSmoothing,projection:Object(c.get)("EPSG:3857"),reprojectionErrorThreshold:e.reprojectionErrorThreshold,state:i.a.LOADING,tileLoadFunction:e.tileLoadFunction,wrapX:void 0===e.wrapX||e.wrapX,transition:e.transition,zDirection:e.zDirection})||this;if(n.tileJSON_=null,n.tileSize_=e.tileSize,e.url)if(e.jsonp)Object(h.a)(e.url,n.handleTileJSONResponse.bind(n),n.handleTileJSONError.bind(n));else{var r=new XMLHttpRequest;r.addEventListener("load",n.onXHRLoad_.bind(n)),r.addEventListener("error",n.onXHRError_.bind(n)),r.open("GET",e.url),r.send()}else e.tileJSON?n.handleTileJSONResponse(e.tileJSON):Object(s.a)(!1,51);return n}return p(e,t),e.prototype.onXHRLoad_=function(t){var e=t.target;if(!e.status||e.status>=200&&e.status<300){var n=void 0;try{n=JSON.parse(e.responseText)}catch(t){return void this.handleTileJSONError()}this.handleTileJSONResponse(n)}else this.handleTileJSONError()},e.prototype.onXHRError_=function(t){this.handleTileJSONError()},e.prototype.getTileJSON=function(){return this.tileJSON_},e.prototype.handleTileJSONResponse=function(t){var e,n=Object(c.get)("EPSG:4326"),r=this.getProjection();if(void 0!==t.bounds){var o=Object(c.getTransformFromProjections)(n,r);e=Object(a.applyTransform)(t.bounds,o)}var s=Object(u.extentFromProjection)(r),h=t.minzoom||0,p=t.maxzoom||22,d=Object(u.createXYZ)({extent:s,maxZoom:p,minZoom:h,tileSize:this.tileSize_});if(this.tileGrid=d,this.tileUrlFunction=Object(l.a)(t.tiles,d),void 0!==t.attribution&&!this.getAttributions()){var f=void 0!==e?e:s;this.setAttributions((function(e){return Object(a.intersects)(f,e.extent)?[t.attribution]:null}))}this.tileJSON_=t,this.setState(i.a.READY)},e.prototype.handleTileJSONError=function(){this.setState(i.a.ERROR)},e}(o.a);e.a=d},function(t,e,n){"use strict";var r,i=n(1),o=n(62),a=n(0),s=n(77),l=n(63),u=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),c=function(t){function e(e,n,r){var i=t.call(this)||this;if(void 0!==r&&void 0===n)i.setFlatCoordinates(r,e);else{var o=n||0;i.setCenterAndRadius(e,o,r)}return i}return u(e,t),e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),void 0,this.layout);return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,n,r){var i=this.flatCoordinates,o=t-i[0],a=e-i[1],s=o*o+a*a;if(s<r){if(0===s)for(var l=0;l<this.stride;++l)n[l]=i[l];else{var u=this.getRadius()/Math.sqrt(s);n[0]=i[0]+u*o,n[1]=i[1]+u*a;for(l=2;l<this.stride;++l)n[l]=i[l]}return n.length=this.stride,s}return r},e.prototype.containsXY=function(t,e){var n=this.flatCoordinates,r=t-n[0],i=e-n[1];return r*r+i*i<=this.getRadiusSquared_()},e.prototype.getCenter=function(){return this.flatCoordinates.slice(0,this.stride)},e.prototype.computeExtent=function(t){var e=this.flatCoordinates,n=e[this.stride]-e[0];return Object(a.createOrUpdate)(e[0]-n,e[1]-n,e[0]+n,e[1]+n,t)},e.prototype.getRadius=function(){return Math.sqrt(this.getRadiusSquared_())},e.prototype.getRadiusSquared_=function(){var t=this.flatCoordinates[this.stride]-this.flatCoordinates[0],e=this.flatCoordinates[this.stride+1]-this.flatCoordinates[1];return t*t+e*e},e.prototype.getType=function(){return i.a.CIRCLE},e.prototype.intersectsExtent=function(t){var e=this.getExtent();if(Object(a.intersects)(t,e)){var n=this.getCenter();return t[0]<=n[0]&&t[2]>=n[0]||(t[1]<=n[1]&&t[3]>=n[1]||Object(a.forEachCorner)(t,this.intersectsCoordinate.bind(this)))}return!1},e.prototype.setCenter=function(t){var e=this.stride,n=this.flatCoordinates[e]-this.flatCoordinates[0],r=t.slice();r[e]=r[0]+n;for(var i=1;i<e;++i)r[e+i]=t[i];this.setFlatCoordinates(this.layout,r),this.changed()},e.prototype.setCenterAndRadius=function(t,e,n){this.setLayout(n,t,0),this.flatCoordinates||(this.flatCoordinates=[]);var r=this.flatCoordinates,i=Object(s.a)(r,0,t,this.stride);r[i++]=r[0]+e;for(var o=1,a=this.stride;o<a;++o)r[i++]=r[o];r.length=i,this.changed()},e.prototype.getCoordinates=function(){return null},e.prototype.setCoordinates=function(t,e){},e.prototype.setRadius=function(t){this.flatCoordinates[this.stride]=this.flatCoordinates[0]+t,this.changed()},e.prototype.rotate=function(t,e){var n=this.getCenter(),r=this.getStride();this.setCenter(Object(l.a)(n,0,n.length,r,t,e,n)),this.changed()},e.prototype.translate=function(t,e){var n=this.getCenter(),r=this.getStride();this.setCenter(Object(l.d)(n,0,n.length,r,t,e,n)),this.changed()},e}(o.a);c.prototype.transform,e.a=c},function(t,e,n){"use strict";var r,i=n(9),o=n(70),a=n(57),s=n(20),l=n(8),u=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),c="trackpad",h="wheel",p=function(t){function e(e){var n=this,r=e||{};(n=t.call(this,r)||this).totalDelta_=0,n.lastDelta_=0,n.maxDelta_=void 0!==r.maxDelta?r.maxDelta:1,n.duration_=void 0!==r.duration?r.duration:250,n.timeout_=void 0!==r.timeout?r.timeout:80,n.useAnchor_=void 0===r.useAnchor||r.useAnchor,n.constrainResolution_=void 0!==r.constrainResolution&&r.constrainResolution;var i=r.condition?r.condition:s.d;return n.condition_=r.onFocusOnly?Object(s.a)(s.f,i):i,n.lastAnchor_=null,n.startTime_=void 0,n.timeoutId_,n.mode_=void 0,n.trackpadEventGap_=400,n.trackpadTimeoutId_,n.deltaPerZoom_=300,n}return u(e,t),e.prototype.endInteraction_=function(){this.trackpadTimeoutId_=void 0,this.getMap().getView().endInteraction(void 0,this.lastDelta_?this.lastDelta_>0?1:-1:0,this.lastAnchor_)},e.prototype.handleEvent=function(t){if(!this.condition_(t))return!0;if(t.type!==i.a.WHEEL)return!0;var e,n=t.map,r=t.originalEvent;if(r.preventDefault(),this.useAnchor_&&(this.lastAnchor_=t.coordinate),t.type==i.a.WHEEL&&(e=r.deltaY,a.b&&r.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(e/=a.a),r.deltaMode===WheelEvent.DOM_DELTA_LINE&&(e*=40)),0===e)return!1;this.lastDelta_=e;var o=Date.now();void 0===this.startTime_&&(this.startTime_=o),(!this.mode_||o-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(e)<4?c:h);var s=n.getView();if(this.mode_===c&&!s.getConstrainResolution()&&!this.constrainResolution_)return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(s.getAnimating()&&s.cancelAnimations(),s.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),s.adjustZoom(-e/this.deltaPerZoom_,this.lastAnchor_),this.startTime_=o,!1;this.totalDelta_+=e;var l=Math.max(this.timeout_-(o-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,n),l),!1},e.prototype.handleWheelZoom_=function(t){var e=t.getView();e.getAnimating()&&e.cancelAnimations();var n=-Object(l.a)(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(e.getConstrainResolution()||this.constrainResolution_)&&(n=n?n>0?1:-1:0),Object(o.c)(e,n,this.lastAnchor_,this.duration_),this.mode_=void 0,this.totalDelta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0},e.prototype.setMouseAnchor=function(t){this.useAnchor_=t,t||(this.lastAnchor_=null)},e}(o.a);e.a=p},function(t,e,n){"use strict";n.d(e,"a",(function(){return _}));var r=n(24),i=n.n(r),o=n(27),a=n.n(o),s=n(32),l=n.n(s),u=n(83),c=n.n(u),h=n(51),p=n.n(h),d=n(53),f=n.n(d),g=n(28),y=n.n(g),m=n(47);n(136);function v(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=y()(t);if(e){var i=y()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return f()(this,n)}}var _=function(t){p()(n,t);var e=v(n);function n(t){var r;i()(this,n);var o,a,s,u=t||{};u.collapsed=!0===u.collapsed,s=document.createElement("span"),u.collapsed?s.innerHTML="»":s.innerHTML="«";var c=document.createElement("button");c.type="button",c.title="Compass",c.appendChild(s);var h=document.createElement("div");h.className="ol-rotation ol-control ol-unselectable";var p=document.createElement("span");p.innerHTML="°",p.className="ol-degree";var d=document.createElement("input");d.id="rotationText",d.type="text",d.value=0,d.maxLength=5,d.size=1;var f=document.createElement("input");f.id="rotation",f.type="range",f.min=-180,f.max=180,f.value=0,f.step=1,o=u.resetTipLabel?u.resetTipLabel:"Reset rotation",a='<i class="fa fa-repeat" aria-hidden="true"></i>',(s=document.createElement("span")).innerHTML=a;var g=document.createElement("button");g.type="button",g.title=o,g.appendChild(s),o=u.flipHorizontallyTipLabel?u.flipHorizontallyTipLabel:"Flip horizontally",a='<i class="fa fa-code" aria-hidden="true"></i>',(s=document.createElement("span")).innerHTML=a;var y=document.createElement("button");y.type="button",y.title=o,y.appendChild(s),o=u.flipVerticallyTipLabel?u.flipVerticallyTipLabel:"Flip vertically",a='<i class="fa fa-code fa-rotate-90" aria-hidden="true"></i>',(s=document.createElement("span")).innerHTML=a;var m=document.createElement("button");m.type="button",m.title=o,m.appendChild(s),u.collapsed||(h.appendChild(d),h.appendChild(p),h.appendChild(f),h.appendChild(g),h.appendChild(y),h.appendChild(m)),h.appendChild(c),(r=e.call(this,{element:h,target:u.target})).collapsed=u.collapsed;var v=!1;r.collapseControl=function(t){t&&(t.preventDefault(),t.stopPropagation()),this.collapsed=!this.collapsed,this.collapsed?(h.removeChild(m),h.removeChild(y),h.removeChild(g),h.removeChild(f),h.removeChild(p),h.removeChild(d),c.firstChild.innerHTML="»"):(h.insertBefore(m,h.firstChild),h.insertBefore(y,h.firstChild),h.insertBefore(g,h.firstChild),h.insertBefore(f,h.firstChild),h.insertBefore(p,h.firstChild),h.insertBefore(d,h.firstChild),c.firstChild.innerHTML="«")};return r.pmaViewport=u.pmaViewport,f.addEventListener("input",function(t){v=!0,t.preventDefault(),t.stopPropagation(),d.value=f.value,this.pmaViewport.setPosition({rotation:.0174532925*f.value}),v=!1}.bind(l()(r)),!1),g.addEventListener("click",function(t){t.preventDefault(),t.stopPropagation(),d.value=0,f.value=0,this.pmaViewport.setPosition({rotation:0}),g.blur(),g.hideFocus=!0,g.style.outline="none"}.bind(l()(r)),!1),c.addEventListener("click",r.collapseControl.bind(l()(r)),!1),y.addEventListener("click",function(t){t.preventDefault(),t.stopPropagation(),this.pmaViewport.setFlip(!this.pmaViewport.getFlip().horizontally,this.pmaViewport.getFlip().vertically),this.pmaViewport.getFlip().horizontally?y.classList.add("selected"):y.classList.remove("selected"),y.blur(),y.hideFocus=!0,y.style.outline="none"}.bind(l()(r)),!1),m.addEventListener("click",function(t){t.preventDefault(),t.stopPropagation(),this.pmaViewport.setFlip(this.pmaViewport.getFlip().horizontally,!this.pmaViewport.getFlip().vertically),this.pmaViewport.getFlip().vertically?m.classList.add("selected"):m.classList.remove("selected"),m.blur(),m.hideFocus=!0,m.style.outline="none"}.bind(l()(r)),!1),d.addEventListener("input",function(t){v=!0,t.preventDefault(),t.stopPropagation();var e=d.value.replace(/[^\d-]/g,"");if("-"!=e){""==e&&(e=0);var n=parseInt(e),r=n%360;n=2*r%360-r,d.value=n,f.value=n,this.pmaViewport.setPosition({rotation:.0174532925*n}),v=!1}}.bind(l()(r)),!1),r.pmaViewport.listen("viewchanged",function(t){if(!v){var e=Math.floor(this.pmaViewport.getPosition().rotation/.0174532925),n=e%360;e=2*n%360-n,d.value=e,f.value=e,this.pmaViewport.getFlip().horizontally?y.classList.add("selected"):y.classList.remove("selected"),this.pmaViewport.getFlip().vertically?m.classList.add("selected"):m.classList.remove("selected")}}.bind(l()(r))),r}return a()(n,[{key:"setMap",value:function(t){c()(y()(n.prototype),"setMap",this).call(this,t)}},{key:"getCollapsed",value:function(){return this.collapsed}},{key:"setCollapsed",value:function(t){this.getCollapsed()!=t&&this.collapseControl()}}]),n}(m.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return g})),n.d(e,"b",(function(){return y}));var r=n(24),i=n.n(r),o=n(27),a=n.n(o),s=n(51),l=n.n(s),u=n(53),c=n.n(u),h=n(28),p=n.n(h),d=n(170);function f(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=p()(t);if(e){var i=p()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return c()(this,n)}}var g={normal:"Normal",objectives:"Objectives"},y=function(t){l()(n,t);var e=f(n);function n(t){var r;if(i()(this,n),!(r=e.call(this,t)).hasOwnProperty("deltaPerZoom_"))throw"deltaPerZoom_ not found";return r.deltaPerZoom_=t.deltaPerZoom,r.mode=g.normal,r}return a()(n,[{key:"setMode",value:function(t){var e=this.getMap().getView();t==g.normal?(e.setConstrainResolution(!1),this.constrainResolution_=!1,this.mode=t):(e.setConstrainResolution(!0),this.constrainResolution_=!0,this.mode=t)}}]),n}(d.a)},function(t,e,n){var r,i,o;
/*!
* jquery.fancytree.js
* Tree view control with support for lazy loading and much more.
* https://github.com/mar10/fancytree/
*
* Copyright (c) 2008-2020, Martin Wendt (https://wwWendt.de)
* Released under the MIT license
* https://github.com/mar10/fancytree/wiki/LicenseInfo
*
* @version 2.36.1
* @date 2020-07-25T09:03:47Z
*/i=[n(12),n(254)],void 0===(o="function"==typeof(r=function(t){"use strict";if(!t.ui||!t.ui.fancytree){var e,n,r=null,i=new RegExp(/\.|\//),o=/[&<>"'/]/g,a=/[<>"'/]/g,s={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},l={16:!0,17:!0,18:!0},u={8:"backspace",9:"tab",10:"return",13:"return",19:"pause",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"insert",46:"del",59:";",61:"=",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",144:"numlock",145:"scroll",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},c={16:"shift",17:"ctrl",18:"alt",91:"meta",93:"meta"},h={0:"",1:"left",2:"middle",3:"right"},p="active expanded focus folder lazy radiogroup selected unselectable unselectableIgnore".split(" "),d={},f="columns types".split(" "),g="checkbox expanded extraClasses folder icon iconTooltip key lazy partsel radiogroup refKey selected statusNodeType title tooltip type unselectable unselectableIgnore unselectableStatus".split(" "),y={},m={},v={active:!0,children:!0,data:!0,focus:!0};for(e=0;e<p.length;e++)d[p[e]]=!0;for(e=0;e<g.length;e++)n=g[e],y[n]=!0,n!==n.toLowerCase()&&(m[n.toLowerCase()]=n);return _(t.ui,"Fancytree requires jQuery UI (http://jqueryui.com)"),Date.now||(Date.now=function(){return(new Date).getTime()}),P.prototype={_findDirectChild:function(t){var e,n,r=this.children;if(r)if("string"==typeof t){for(e=0,n=r.length;e<n;e++)if(r[e].key===t)return r[e]}else{if("number"==typeof t)return this.children[t];if(t.parent===this)return t}return null},_setChildren:function(t){_(t&&(!this.children||0===this.children.length),"only init supported"),this.children=[];for(var e=0,n=t.length;e<n;e++)this.children.push(new P(this,t[e]));this.tree._callHook("treeStructureChanged",this.tree,"setChildren")},addChildren:function(e,n){var r,i,o,a,s=this.getFirstChild(),l=this.getLastChild(),u=[];for(t.isPlainObject(e)&&(e=[e]),this.children||(this.children=[]),r=0,i=e.length;r<i;r++)u.push(new P(this,e[r]));if(a=u[0],null==n?this.children=this.children.concat(u):(n=this._findDirectChild(n),_((o=t.inArray(n,this.children))>=0,"insertBefore must be an existing child"),this.children.splice.apply(this.children,[o,0].concat(u))),s&&!n){for(r=0,i=u.length;r<i;r++)u[r].render();s!==this.getFirstChild()&&s.renderStatus(),l!==this.getLastChild()&&l.renderStatus()}else(!this.parent||this.parent.ul||this.tr)&&this.render();return 3===this.tree.options.selectMode&&this.fixSelection3FromEndNodes(),this.triggerModifyChild("add",1===u.length?u[0]:null),a},addClass:function(t){return this.toggleClass(t,!0)},addNode:function(t,e){switch(void 0!==e&&"over"!==e||(e="child"),e){case"after":return this.getParent().addChildren(t,this.getNextSibling());case"before":return this.getParent().addChildren(t,this);case"firstChild":var n=this.children?this.children[0]:null;return this.addChildren(t,n);case"child":case"over":return this.addChildren(t)}_(!1,"Invalid mode: "+e)},addPagingNode:function(e,n){var r,i;if(n=n||"child",!1!==e)return e=t.extend({title:this.tree.options.strings.moreData,statusNodeType:"paging",icon:!1},e),this.partload=!0,this.addNode(e,n);for(r=this.children.length-1;r>=0;r--)"paging"===(i=this.children[r]).statusNodeType&&this.removeChild(i);this.partload=!1},appendSibling:function(t){return this.addNode(t,"after")},applyCommand:function(t,e){return this.tree.applyCommand(t,this,e)},applyPatch:function(e){if(null===e)return this.remove(),S(this);var n,r,i={children:!0,expanded:!0,parent:!0};for(n in e)e.hasOwnProperty(n)&&(r=e[n],i[n]||t.isFunction(r)||(y[n]?this[n]=r:this.data[n]=r));return e.hasOwnProperty("children")&&(this.removeChildren(),e.children&&this._setChildren(e.children)),this.isVisible()&&(this.renderTitle(),this.renderStatus()),e.hasOwnProperty("expanded")?this.setExpanded(e.expanded):S(this)},collapseSiblings:function(){return this.tree._callHook("nodeCollapseSiblings",this)},copyTo:function(t,e,n){return t.addNode(this.toDict(!0,n),e)},countChildren:function(t){var e,n,r,i=this.children;if(!i)return 0;if(r=i.length,!1!==t)for(e=0,n=r;e<n;e++)r+=i[e].countChildren();return r},debug:function(t){this.tree.options.debugLevel>=4&&(Array.prototype.unshift.call(arguments,this.toString()),b("log",arguments))},discard:function(){return this.warn("FancytreeNode.discard() is deprecated since 2014-02-16. Use .resetLazy() instead."),this.resetLazy()},discardMarkup:function(t){var e=t?"nodeRemoveMarkup":"nodeRemoveChildMarkup";this.tree._callHook(e,this)},error:function(t){this.tree.options.debugLevel>=1&&(Array.prototype.unshift.call(arguments,this.toString()),b("error",arguments))},findAll:function(e){e=t.isFunction(e)?e:L(e);var n=[];return this.visit((function(t){e(t)&&n.push(t)})),n},findFirst:function(e){e=t.isFunction(e)?e:L(e);var n=null;return this.visit((function(t){if(e(t))return n=t,!1})),n},findRelatedNode:function(t,e){return this.tree.findRelatedNode(this,t,e)},_changeSelectStatusAttrs:function(t){var e=!1,n=this.tree.options,i=r.evalOption("unselectable",this,this,n,!1),o=r.evalOption("unselectableStatus",this,this,n,void 0);switch(i&&null!=o&&(t=o),t){case!1:e=this.selected||this.partsel,this.selected=!1,this.partsel=!1;break;case!0:e=!this.selected||!this.partsel,this.selected=!0,this.partsel=!0;break;case void 0:e=this.selected||!this.partsel,this.selected=!1,this.partsel=!0;break;default:_(!1,"invalid state: "+t)}return e&&this.renderStatus(),e},fixSelection3AfterClick:function(t){var e=this.isSelected();this.visit((function(t){if(t._changeSelectStatusAttrs(e),t.radiogroup)return"skip"})),this.fixSelection3FromEndNodes(t)},fixSelection3FromEndNodes:function(t){var e=this.tree.options;_(3===e.selectMode,"expected selectMode 3"),function t(n){var i,o,a,s,l,u,c,h,p=n.children;if(p&&p.length){for(u=!0,c=!1,i=0,o=p.length;i<o;i++)s=t(a=p[i]),r.evalOption("unselectableIgnore",a,a,e,!1)||(!1!==s&&(c=!0),!0!==s&&(u=!1));l=!!u||!!c&&void 0}else l=null==(h=r.evalOption("unselectableStatus",n,n,e,void 0))?!!n.selected:!!h;return n.partsel&&!n.selected&&n.lazy&&null==n.children&&(l=void 0),n._changeSelectStatusAttrs(l),l}(this),this.visitParents((function(t){var n,i,o,a,s,l=t.children,u=!0,c=!1;for(n=0,i=l.length;n<i;n++)o=l[n],r.evalOption("unselectableIgnore",o,o,e,!1)||(((a=null==(s=r.evalOption("unselectableStatus",o,o,e,void 0))?!!o.selected:!!s)||o.partsel)&&(c=!0),a||(u=!1));a=!!u||!!c&&void 0,t._changeSelectStatusAttrs(a)}))},fromDict:function(e){for(var n in e)y[n]?this[n]=e[n]:"data"===n?t.extend(this.data,e.data):t.isFunction(e[n])||v[n]||(this.data[n]=e[n]);e.children&&(this.removeChildren(),this.addChildren(e.children)),this.renderTitle()},getChildren:function(){if(void 0!==this.hasChildren())return this.children},getFirstChild:function(){return this.children?this.children[0]:null},getIndex:function(){return t.inArray(this,this.parent.children)},getIndexHier:function(e,n){e=e||".";var r,i=[];return t.each(this.getParentList(!1,!0),(function(t,e){r=""+(e.getIndex()+1),n&&(r=("0000000"+r).substr(-n)),i.push(r)})),i.join(e)},getKeyPath:function(t){var e=this.tree.options.keyPathSeparator;return e+this.getPath(!t,"key",e)},getLastChild:function(){return this.children?this.children[this.children.length-1]:null},getLevel:function(){for(var t=0,e=this.parent;e;)t++,e=e.parent;return t},getNextSibling:function(){if(this.parent){var t,e,n=this.parent.children;for(t=0,e=n.length-1;t<e;t++)if(n[t]===this)return n[t+1]}return null},getParent:function(){return this.parent},getParentList:function(t,e){for(var n=[],r=e?this:this.parent;r;)(t||r.parent)&&n.unshift(r),r=r.parent;return n},getPath:function(e,n,r){e=!1!==e,n=n||"title",r=r||"/";var i,o=[],a=t.isFunction(n);return this.visitParents((function(t){t.parent&&(i=a?n(t):t[n],o.unshift(i))}),e),o.join(r)},getPrevSibling:function(){if(this.parent){var t,e,n=this.parent.children;for(t=1,e=n.length;t<e;t++)if(n[t]===this)return n[t-1]}return null},getSelectedNodes:function(t){var e=[];return this.visit((function(n){if(n.selected&&(e.push(n),!0===t))return"skip"})),e},hasChildren:function(){if(this.lazy){if(null==this.children)return;if(0===this.children.length)return!1;if(1===this.children.length&&this.children[0].isStatusNode())return;return!0}return!(!this.children||!this.children.length)},hasClass:function(t){return(" "+(this.extraClasses||"")+" ").indexOf(" "+t+" ")>=0},hasFocus:function(){return this.tree.hasFocus()&&this.tree.focusNode===this},info:function(t){this.tree.options.debugLevel>=3&&(Array.prototype.unshift.call(arguments,this.toString()),b("info",arguments))},isActive:function(){return this.tree.activeNode===this},isBelowOf:function(t){return this.getIndexHier(".",5)>t.getIndexHier(".",5)},isChildOf:function(t){return this.parent&&this.parent===t},isDescendantOf:function(e){if(!e||e.tree!==this.tree)return!1;for(var n=this.parent;n;){if(n===e)return!0;n===n.parent&&t.error("Recursive parent link: "+n),n=n.parent}return!1},isExpanded:function(){return!!this.expanded},isFirstSibling:function(){var t=this.parent;return!t||t.children[0]===this},isFolder:function(){return!!this.folder},isLastSibling:function(){var t=this.parent;return!t||t.children[t.children.length-1]===this},isLazy:function(){return!!this.lazy},isLoaded:function(){return!this.lazy||void 0!==this.hasChildren()},isLoading:function(){return!!this._isLoading},isRoot:function(){return this.isRootNode()},isPartsel:function(){return!this.selected&&!!this.partsel},isPartload:function(){return!!this.partload},isRootNode:function(){return this.tree.rootNode===this},isSelected:function(){return!!this.selected},isStatusNode:function(){return!!this.statusNodeType},isPagingNode:function(){return"paging"===this.statusNodeType},isTopLevel:function(){return this.tree.rootNode===this.parent},isUndefined:function(){return void 0===this.hasChildren()},isVisible:function(){var t,e,n=this.tree.enableFilter,r=this.getParentList(!1,!1);if(n&&!this.match&&!this.subMatchCount)return!1;for(t=0,e=r.length;t<e;t++)if(!r[t].expanded)return!1;return!0},lazyLoad:function(e){t.error("FancytreeNode.lazyLoad() is deprecated since 2014-02-16. Use .load() instead.")},load:function(t){var e,n,r=this,i=this.isExpanded();return _(this.isLazy(),"load() requires a lazy node"),t||this.isUndefined()?(this.isLoaded()&&this.resetLazy(),!1===(n=this.tree._triggerNodeEvent("lazyLoad",this))?S(this):(_("boolean"!=typeof n,"lazyLoad event must return source in data.result"),e=this.tree._callHook("nodeLoadChildren",this,n),i?(this.expanded=!0,e.always((function(){r.render()}))):e.always((function(){r.renderStatus()})),e)):S(this)},makeVisible:function(e){var n,r=this,i=[],o=new t.Deferred,a=this.getParentList(!1,!1),s=a.length,l=!(e&&!0===e.noAnimation),u=!(e&&!1===e.scrollIntoView);for(n=s-1;n>=0;n--)i.push(a[n].setExpanded(!0,e));return t.when.apply(t,i).done((function(){u?r.scrollIntoView(l).done((function(){o.resolve()})):o.resolve()})),o.promise()},moveTo:function(e,n,r){void 0===n||"over"===n?n="child":"firstChild"===n&&(e.children&&e.children.length?(n="before",e=e.children[0]):n="child");var i,o=this.tree,a=this.parent,s="child"===n?e:e.parent;if(this!==e){if(this.parent?s.isDescendantOf(this)&&t.error("Cannot move a node to its own descendant"):t.error("Cannot move system root"),s!==a&&a.triggerModifyChild("remove",this),1===this.parent.children.length){if(this.parent===s)return;this.parent.children=this.parent.lazy?[]:null,this.parent.expanded=!1}else _((i=t.inArray(this,this.parent.children))>=0,"invalid source parent"),this.parent.children.splice(i,1);if(this.parent=s,s.hasChildren())switch(n){case"child":s.children.push(this);break;case"before":_((i=t.inArray(e,s.children))>=0,"invalid target parent"),s.children.splice(i,0,this);break;case"after":_((i=t.inArray(e,s.children))>=0,"invalid target parent"),s.children.splice(i+1,0,this);break;default:t.error("Invalid mode "+n)}else s.children=[this];r&&e.visit(r,!0),s===a?s.triggerModifyChild("move",this):s.triggerModifyChild("add",this),o!==e.tree&&(this.warn("Cross-tree moveTo is experimental!"),this.visit((function(t){t.tree=e.tree}),!0)),o._callHook("treeStructureChanged",o,"moveTo"),a.isDescendantOf(s)||a.render(),s.isDescendantOf(a)||s===a||s.render()}},navigate:function(e,n){var r,i=t.ui.keyCode;switch(e){case"left":case i.LEFT:if(this.expanded)return this.setExpanded(!1);break;case"right":case i.RIGHT:if(!this.expanded&&(this.children||this.lazy))return this.setExpanded()}if(r=this.findRelatedNode(e)){try{r.makeVisible({scrollIntoView:!1})}catch(t){}return!1===n?(r.setFocus(),S()):r.setActive()}return this.warn("Could not find related node '"+e+"'."),S()},remove:function(){return this.parent.removeChild(this)},removeChild:function(t){return this.tree._callHook("nodeRemoveChild",this,t)},removeChildren:function(){return this.tree._callHook("nodeRemoveChildren",this)},removeClass:function(t){return this.toggleClass(t,!1)},render:function(t,e){return this.tree._callHook("nodeRender",this,t,e)},renderTitle:function(){return this.tree._callHook("nodeRenderTitle",this)},renderStatus:function(){return this.tree._callHook("nodeRenderStatus",this)},replaceWith:function(n){var r,i=this.parent,o=t.inArray(this,i.children),a=this;return _(this.isPagingNode(),"replaceWith() currently requires a paging status node"),(r=this.tree._callHook("nodeLoadChildren",this,n)).done((function(t){var n=a.children;for(e=0;e<n.length;e++)n[e].parent=i;i.children.splice.apply(i.children,[o+1,0].concat(n)),a.children=null,a.remove(),i.render()})).fail((function(){a.setExpanded()})),r},resetLazy:function(){this.removeChildren(),this.expanded=!1,this.lazy=!0,this.children=void 0,this.renderStatus()},scheduleAction:function(e,n){this.tree.timer&&(clearTimeout(this.tree.timer),this.tree.debug("clearTimeout(%o)",this.tree.timer)),this.tree.timer=null;var r=this;switch(e){case"cancel":break;case"expand":this.tree.timer=setTimeout((function(){r.tree.debug("setTimeout: trigger expand"),r.setExpanded(!0)}),n);break;case"activate":this.tree.timer=setTimeout((function(){r.tree.debug("setTimeout: trigger activate"),r.setActive(!0)}),n);break;default:t.error("Invalid mode "+e)}},scrollIntoView:function(e,n){if(void 0!==n&&(r=n).tree&&void 0!==r.statusNodeType)throw Error("scrollIntoView() with 'topNode' option is deprecated since 2014-05-08. Use 'options.topNode' instead.");var r,i=t.extend({effects:!0===e?{duration:200,queue:!1}:e,scrollOfs:this.tree.options.scrollOfs,scrollParent:this.tree.options.scrollParent,topNode:null},n),o=i.scrollParent,a=this.tree.$container,s=a.css("overflow-y");o?o.jquery||(o=t(o)):o=this.tree.tbody?a.scrollParent():"scroll"===s||"auto"===s?a:a.scrollParent(),o[0]!==document&&o[0]!==document.body||(this.debug("scrollIntoView(): normalizing scrollParent to 'window':",o[0]),o=t(window));var l,u,c,h=new t.Deferred,p=this,d=t(this.span).height(),f=i.scrollOfs.top||0,g=i.scrollOfs.bottom||0,y=o.height(),m=o.scrollTop(),v=o,b=o[0]===window,w=i.topNode||null,x=null;return this.isRootNode()||!this.isVisible()?(this.info("scrollIntoView(): node is invisible."),S()):(b?(u=t(this.span).offset().top,l=w&&w.span?t(w.span).offset().top:0,v=t("html,body")):(_(o[0]!==document&&o[0]!==document.body,"scrollParent should be a simple element or `window`, not document or body."),c=o.offset().top,u=t(this.span).offset().top-c+m,l=w?t(w.span).offset().top-c+m:0,y-=Math.max(0,o.innerHeight()-o[0].clientHeight)),u<m+f?x=u-f:u+d>m+y-g&&(x=u+d-y+g,w&&(_(w.isRootNode()||w.isVisible(),"topNode must be visible"),l<x&&(x=l-f))),null===x?h.resolveWith(this):i.effects?(i.effects.complete=function(){h.resolveWith(p)},v.stop(!0).animate({scrollTop:x},i.effects)):(v[0].scrollTop=x,h.resolveWith(this)),h.promise())},setActive:function(t,e){return this.tree._callHook("nodeSetActive",this,t,e)},setExpanded:function(t,e){return this.tree._callHook("nodeSetExpanded",this,t,e)},setFocus:function(t){return this.tree._callHook("nodeSetFocus",this,t)},setSelected:function(t,e){return this.tree._callHook("nodeSetSelected",this,t,e)},setStatus:function(t,e,n){return this.tree._callHook("nodeSetStatus",this,t,e,n)},setTitle:function(t){this.title=t,this.renderTitle(),this.triggerModify("rename")},sortChildren:function(t,e){var n,r,i=this.children;if(i){if(t=t||function(t,e){var n=t.title.toLowerCase(),r=e.title.toLowerCase();return n===r?0:n>r?1:-1},i.sort(t),e)for(n=0,r=i.length;n<r;n++)i[n].children&&i[n].sortChildren(t,"$norender$");"$norender$"!==e&&this.render(),this.triggerModifyChild("sort")}},toDict:function(e,n){var r,i,o,a,s={},l=this;if(t.each(g,(function(t,e){(l[e]||!1===l[e])&&(s[e]=l[e])})),t.isEmptyObject(this.data)||(s.data=t.extend({},this.data),t.isEmptyObject(s.data)&&delete s.data),n){if(!1===(a=n(s,l)))return!1;"skip"===a&&(e=!1)}if(e&&t.isArray(this.children))for(s.children=[],r=0,i=this.children.length;r<i;r++)(o=this.children[r]).isStatusNode()||!1!==(a=o.toDict(!0,n))&&s.children.push(a);return s},toggleClass:function(e,n){var r,i,o=e.match(/\S+/g)||[],a=0,s=!1,l=this[this.tree.statusClassPropName],u=" "+(this.extraClasses||"")+" ";for(l&&t(l).toggleClass(e,n);r=o[a++];)if(i=u.indexOf(" "+r+" ")>=0,n=void 0===n?!i:!!n)i||(u+=r+" ",s=!0);else for(;u.indexOf(" "+r+" ")>-1;)u=u.replace(" "+r+" "," ");return this.extraClasses=t.trim(u),s},toggleExpanded:function(){return this.tree._callHook("nodeToggleExpanded",this)},toggleSelected:function(){return this.tree._callHook("nodeToggleSelected",this)},toString:function(){return"FancytreeNode@"+this.key+"[title='"+this.title+"']"},triggerModifyChild:function(e,n,r){var i,o=this.tree.options.modifyChild;o&&(n&&n.parent!==this&&t.error("childNode "+n+" is not a child of "+this),i={node:this,tree:this.tree,operation:e,childNode:n||null},r&&t.extend(i,r),o({type:"modifyChild"},i))},triggerModify:function(t,e){this.parent.triggerModifyChild(t,this,e)},visit:function(t,e){var n,r,i=!0,o=this.children;if(!0===e&&(!1===(i=t(this))||"skip"===i))return i;if(o)for(n=0,r=o.length;n<r&&!1!==(i=o[n].visit(t,!0));n++);return i},visitAndLoad:function(e,n,r){var i,o,a,s=this;return!e||!0!==n||!1!==(o=e(s))&&"skip"!==o?s.children||s.lazy?(i=new t.Deferred,a=[],s.load().done((function(){for(var n=0,r=s.children.length;n<r;n++){if(!1===(o=s.children[n].visitAndLoad(e,!0,!0))){i.reject();break}"skip"!==o&&a.push(o)}t.when.apply(this,a).then((function(){i.resolve()}))})),i.promise()):S():r?o:S()},visitParents:function(t,e){if(e&&!1===t(this))return!1;for(var n=this.parent;n;){if(!1===t(n))return!1;n=n.parent}return!0},visitSiblings:function(t,e){var n,r,i,o=this.parent.children;for(n=0,r=o.length;n<r;n++)if(i=o[n],(e||i!==this)&&!1===t(i))return!1;return!0},warn:function(t){this.tree.options.debugLevel>=2&&(Array.prototype.unshift.call(arguments,this.toString()),b("warn",arguments))}},R.prototype={_makeHookContext:function(e,n,r){var i,o;return void 0!==e.node?(n&&e.originalEvent!==n&&t.error("invalid args"),i=e):e.tree?i={node:e,tree:o=e.tree,widget:o.widget,options:o.widget.options,originalEvent:n,typeInfo:o.types[e.type]||{}}:e.widget?i={node:null,tree:e,widget:e.widget,options:e.widget.options,originalEvent:n}:t.error("invalid args"),r&&t.extend(i,r),i},_callHook:function(e,n,r){var i=this._makeHookContext(n),o=this[e],a=Array.prototype.slice.call(arguments,2);return t.isFunction(o)||t.error("_callHook('"+e+"') is not a function"),a.unshift(i),o.apply(this,a)},_setExpiringValue:function(t,e,n){this._tempCache[t]={value:e,expire:Date.now()+(+n||50)}},_getExpiringValue:function(t){var e=this._tempCache[t];return e&&e.expire>Date.now()?e.value:(delete this._tempCache[t],null)},_usesExtension:function(e){return t.inArray(e,this.options.extensions)>=0},_requireExtension:function(e,n,r,i){null!=r&&(r=!!r);var o=this._local.name,a=this.options.extensions,s=t.inArray(e,a)<t.inArray(o,a),l=n&&null==this.ext[e],u=!l&&null!=r&&r!==s;return _(o&&o!==e,"invalid or same name '"+o+"' (require yourself?)"),!l&&!u||(i||(l||n?(i="'"+o+"' extension requires '"+e+"'",u&&(i+=" to be registered "+(r?"before":"after")+" itself")):i="If used together, `"+e+"` must be registered "+(r?"before":"after")+" `"+o+"`"),t.error(i),!1)},activateKey:function(t,e){var n=this.getNodeByKey(t);return n?n.setActive(!0,e):this.activeNode&&this.activeNode.setActive(!1,e),n},addPagingNode:function(t,e){return this.rootNode.addPagingNode(t,e)},applyCommand:function(e,n,r){var i;switch(n=n||this.getActiveNode(),e){case"moveUp":(i=n.getPrevSibling())&&(n.moveTo(i,"before"),n.setActive());break;case"moveDown":(i=n.getNextSibling())&&(n.moveTo(i,"after"),n.setActive());break;case"indent":(i=n.getPrevSibling())&&(n.moveTo(i,"child"),i.setExpanded(),n.setActive());break;case"outdent":n.isTopLevel()||(n.moveTo(n.getParent(),"after"),n.setActive());break;case"remove":i=n.getPrevSibling()||n.getParent(),n.remove(),i&&i.setActive();break;case"addChild":n.editCreateNode("child","");break;case"addSibling":n.editCreateNode("after","");break;case"rename":n.editStart();break;case"down":case"first":case"last":case"left":case"parent":case"right":case"up":return n.navigate(e);default:t.error("Unhandled command: '"+e+"'")}},applyPatch:function(e){var n,r,i,o,a,s,l=e.length,u=[];for(r=0;r<l;r++)_(2===(i=e[r]).length,"patchList must be an array of length-2-arrays"),o=i[0],a=i[1],(s=null===o?this.rootNode:this.getNodeByKey(o))?(n=new t.Deferred,u.push(n),s.applyPatch(a).always(C(n,s))):this.warn("could not find node with key '"+o+"'");return t.when.apply(t,u).promise()},clear:function(t){this._callHook("treeClear",this)},count:function(){return this.rootNode.countChildren()},debug:function(t){this.options.debugLevel>=4&&(Array.prototype.unshift.call(arguments,this.toString()),b("log",arguments))},destroy:function(){this.widget.destroy()},enable:function(t){!1===t?this.widget.disable():this.widget.enable()},enableUpdate:function(t){return t=!1!==t,!!this._enableUpdate==!!t?t:(this._enableUpdate=t,t?(this.debug("enableUpdate(true): redraw "),this._callHook("treeStructureChanged",this,"enableUpdate"),this.render()):this.debug("enableUpdate(false)..."),!t)},error:function(t){this.options.debugLevel>=1&&(Array.prototype.unshift.call(arguments,this.toString()),b("error",arguments))},expandAll:function(t,e){var n=this.enableUpdate(!1);t=!1!==t,this.visit((function(n){!1!==n.hasChildren()&&n.isExpanded()!==t&&n.setExpanded(t,e)})),this.enableUpdate(n)},findAll:function(t){return this.rootNode.findAll(t)},findFirst:function(t){return this.rootNode.findFirst(t)},findNextNode:function(t,e){var n,r=null,i=this.getFirstChild();function o(n){if(t(n)&&(r=n),r||n===e)return!1}return t="string"==typeof t?(n=new RegExp("^"+t,"i"),function(t){return n.test(t.title)}):t,e=e||i,this.visitRows(o,{start:e,includeSelf:!1}),r||e===i||this.visitRows(o,{start:i,includeSelf:!0}),r},findRelatedNode:function(e,n,r){var i=null,o=t.ui.keyCode;switch(n){case"parent":case o.BACKSPACE:e.parent&&e.parent.parent&&(i=e.parent);break;case"first":case o.HOME:this.visit((function(t){if(t.isVisible())return i=t,!1}));break;case"last":case o.END:this.visit((function(t){t.isVisible()&&(i=t)}));break;case"left":case o.LEFT:e.expanded?e.setExpanded(!1):e.parent&&e.parent.parent&&(i=e.parent);break;case"right":case o.RIGHT:e.expanded||!e.children&&!e.lazy?e.children&&e.children.length&&(i=e.children[0]):(e.setExpanded(),i=e);break;case"up":case o.UP:this.visitRows((function(t){return i=t,!1}),{start:e,reverse:!0,includeSelf:!1});break;case"down":case o.DOWN:this.visitRows((function(t){return i=t,!1}),{start:e,includeSelf:!1});break;default:this.tree.warn("Unknown relation '"+n+"'.")}return i},generateFormElements:function(e,n,r){r=r||{};var i,o="string"==typeof e?e:"ft_"+this._id+"[]",a="string"==typeof n?n:"ft_"+this._id+"_active",s="fancytree_result_"+this._id,l=t("#"+s),u=3===this.options.selectMode&&!1!==r.stopOnParents;function c(e){l.append(t("<input>",{type:"checkbox",name:o,value:e.key,checked:!0}))}l.length?l.empty():l=t("<div>",{id:s}).hide().insertAfter(this.$container),!1!==n&&this.activeNode&&l.append(t("<input>",{type:"radio",name:a,value:this.activeNode.key,checked:!0})),r.filter?this.visit((function(t){var e=r.filter(t);if("skip"===e)return e;!1!==e&&c(t)})):!1!==e&&(i=this.getSelectedNodes(u),t.each(i,(function(t,e){c(e)})))},getActiveNode:function(){return this.activeNode},getFirstChild:function(){return this.rootNode.getFirstChild()},getFocusNode:function(){return this.focusNode},getOption:function(t){return this.widget.option(t)},getNodeByKey:function(t,e){var n,r;return!e&&(n=document.getElementById(this.options.idPrefix+t))?n.ftnode?n.ftnode:null:(e=e||this.rootNode,r=null,t=""+t,e.visit((function(e){if(e.key===t)return r=e,!1}),!0),r)},getRootNode:function(){return this.rootNode},getSelectedNodes:function(t){return this.rootNode.getSelectedNodes(t)},hasFocus:function(){return!!this._hasFocus},info:function(t){this.options.debugLevel>=3&&(Array.prototype.unshift.call(arguments,this.toString()),b("info",arguments))},isLoading:function(){var t=!1;return this.rootNode.visit((function(e){if(e._isLoading||e._requestId)return t=!0,!1}),!0),t},loadKeyPath:function(e,n){var r,i,o,a=this,s=new t.Deferred,l=this.getRootNode(),u=this.options.keyPathSeparator,c=[],h=t.extend({},n);for("function"==typeof n?r=n:n&&n.callback&&(r=n.callback),h.callback=function(t,e,n){r&&r.call(t,e,n),s.notifyWith(t,[{node:e,status:n}])},null==h.matchKey&&(h.matchKey=function(t,e){return t.key===e}),t.isArray(e)||(e=[e]),i=0;i<e.length;i++)(o=e[i]).charAt(0)===u&&(o=o.substr(1)),c.push(o.split(u));return setTimeout((function(){a._loadKeyPathImpl(s,h,l,c).done((function(){s.resolve()}))}),0),s.promise()},_loadKeyPathImpl:function(e,n,r,i){var o,a,s,l,u,c,h,p,d,f,g=this;function y(t,e){var r,i,o=t.children;if(o)for(r=0,i=o.length;r<i;r++)if(n.matchKey(o[r],e))return o[r];return null}for(h={},a=0;a<i.length;a++)for(d=i[a],p=r;d.length;){if(s=d.shift(),!(l=y(p,s))){this.warn("loadKeyPath: key not found: "+s+" (parent: "+p+")"),n.callback(this,s,"error");break}if(0===d.length){n.callback(this,l,"ok");break}if(l.lazy&&void 0===l.hasChildren()){n.callback(this,l,"loaded"),h[s=l.key]?h[s].pathSegList.push(d):h[s]={parent:l,pathSegList:[d]};break}n.callback(this,l,"loaded"),p=l}function m(t,e,r){n.callback(g,e,"loading"),e.load().done((function(){g._loadKeyPathImpl.call(g,t,n,e,r).always(C(t,g))})).fail((function(r){g.warn("loadKeyPath: error loading lazy "+e),n.callback(g,l,"error"),t.rejectWith(g)}))}for(u in o=[],h)h.hasOwnProperty(u)&&(c=h[u],f=new t.Deferred,o.push(f),m(f,c.parent,c.pathSegList));return t.when.apply(t,o).promise()},reactivate:function(t){var e,n=this.activeNode;return n?(this.activeNode=null,e=n.setActive(!0,{noFocus:!0}),t&&n.setFocus(),e):S()},reload:function(t){return this._callHook("treeClear",this),this._callHook("treeLoad",this,t)},render:function(t,e){return this.rootNode.render(t,e)},selectAll:function(t){this.visit((function(e){e.setSelected(t)}))},setFocus:function(t){return this._callHook("treeSetFocus",this,t)},setOption:function(t,e){return this.widget.option(t,e)},debugTime:function(t){this.options.debugLevel>=4&&window.console.time(this+" - "+t)},debugTimeEnd:function(t){this.options.debugLevel>=4&&window.console.timeEnd(this+" - "+t)},toDict:function(t,e){var n=this.rootNode.toDict(!0,e);return t?n:n.children},toString:function(){return"Fancytree@"+this._id},_triggerNodeEvent:function(t,e,n,r){var i=this._makeHookContext(e,n,r),o=this.widget._trigger(t,n,i);return!1!==o&&void 0!==i.result?i.result:o},_triggerTreeEvent:function(t,e,n){var r=this._makeHookContext(this,e,n),i=this.widget._trigger(t,e,r);return!1!==i&&void 0!==r.result?r.result:i},visit:function(t){return this.rootNode.visit(t,!1)},visitRows:function(t,e){if(!this.rootNode.hasChildren())return!1;if(e&&e.reverse)return delete e.reverse,this._visitRowsUp(t,e);var n,r,i,o=0,a=!1===(e=e||{}).includeSelf,s=!!e.includeHidden,l=!s&&this.enableFilter,u=e.start||this.rootNode.children[0];for(r=u.parent;r;){for(n=(i=r.children).indexOf(u)+o;n<i.length;n++)if(u=i[n],!l||u.match||u.subMatchCount){if(!a&&!1===t(u))return!1;if(a=!1,u.children&&u.children.length&&(s||u.expanded)&&!1===u.visit((function(e){return!l||e.match||e.subMatchCount?!1!==t(e)&&(s||!e.children||e.expanded?void 0:"skip"):"skip"}),!1))return!1}u=r,r=r.parent,o=1}return!0},_visitRowsUp:function(t,e){for(var n,r,i,o=!!e.includeHidden,a=e.start||this.rootNode.children[0];;){if((n=(i=a.parent).children)[0]===a){if(!(a=i).parent)break;n=i.children}else for(r=n.indexOf(a),a=n[r-1];(o||a.expanded)&&a.children&&a.children.length;)i=a,a=(n=a.children)[n.length-1];if((o||a.isVisible())&&!1===t(a))return!1}},warn:function(t){this.options.debugLevel>=2&&(Array.prototype.unshift.call(arguments,this.toString()),b("warn",arguments))}},t.extend(R.prototype,{nodeClick:function(t){var e,n,r=t.targetType,i=t.node;if("expander"===r){if(i.isLoading())return void i.debug("Got 2nd click while loading: ignored");this._callHook("nodeToggleExpanded",t)}else if("checkbox"===r)this._callHook("nodeToggleSelected",t),t.options.focusOnSelect&&this._callHook("nodeSetFocus",t,!0);else{if(n=!1,e=!0,i.folder)switch(t.options.clickFolderMode){case 2:n=!0,e=!1;break;case 3:e=!0,n=!0}e&&(this.nodeSetFocus(t),this._callHook("nodeSetActive",t,!0)),n&&this._callHook("nodeToggleExpanded",t)}},nodeCollapseSiblings:function(t,e){var n,r,i,o=t.node;if(o.parent)for(r=0,i=(n=o.parent.children).length;r<i;r++)n[r]!==o&&n[r].expanded&&this._callHook("nodeSetExpanded",n[r],!1,e)},nodeDblclick:function(t){"title"===t.targetType&&4===t.options.clickFolderMode&&this._callHook("nodeToggleExpanded",t),"title"===t.targetType&&t.originalEvent.preventDefault()},nodeKeydown:function(e){var n,i,o,a=e.originalEvent,s=e.node,l=e.tree,h=e.options,p=a.which,d=a.key||String.fromCharCode(p),f=!!(a.altKey||a.ctrlKey||a.metaKey),g=!c[p]&&!u[p]&&!f,y=t(a.target),m=!0,v=!(a.ctrlKey||!h.autoActivate);if(s||(o=this.getActiveNode()||this.getFirstChild())&&(o.setFocus(),(s=e.node=this.focusNode).debug("Keydown force focus on active node")),h.quicksearch&&g&&!y.is(":input:enabled"))return(i=Date.now())-l.lastQuicksearchTime>500&&(l.lastQuicksearchTerm=""),l.lastQuicksearchTime=i,l.lastQuicksearchTerm+=d,(n=l.findNextNode(l.lastQuicksearchTerm,l.getActiveNode()))&&n.setActive(),void a.preventDefault();switch(r.eventToString(a)){case"+":case"=":l.nodeSetExpanded(e,!0);break;case"-":l.nodeSetExpanded(e,!1);break;case"space":s.isPagingNode()?l._triggerNodeEvent("clickPaging",e,a):r.evalOption("checkbox",s,s,h,!1)?l.nodeToggleSelected(e):l.nodeSetActive(e,!0);break;case"return":l.nodeSetActive(e,!0);break;case"home":case"end":case"backspace":case"left":case"right":case"up":case"down":s.navigate(a.which,v);break;default:m=!1}m&&a.preventDefault()},nodeLoadChildren:function(e,n){var r,i,o,a=null,s=!0,l=e.tree,u=e.node,c=u.parent,h="nodeLoadChildren",p=Date.now();return t.isFunction(n)&&(n=n.call(l,{type:"source"},e),_(!t.isFunction(n),"source callback must not return another function")),t.isFunction(n.then)?a=n:n.url?(r=t.extend({},e.options.ajax,n)).debugDelay?(i=r.debugDelay,delete r.debugDelay,t.isArray(i)&&(i=i[0]+Math.random()*(i[1]-i[0])),u.warn("nodeLoadChildren waiting debugDelay "+Math.round(i)+" ms ..."),a=t.Deferred((function(e){setTimeout((function(){t.ajax(r).done((function(){e.resolveWith(this,arguments)})).fail((function(){e.rejectWith(this,arguments)}))}),i)}))):a=t.ajax(r):t.isPlainObject(n)||t.isArray(n)?(a={then:function(t,e){t(n,null,null)}},s=!1):t.error("Invalid source type: "+n),u._requestId&&(u.warn("Recursive load request #"+p+" while #"+u._requestId+" is pending."),u._requestId=p),s&&(l.debugTime(h),l.nodeSetStatus(e,"loading")),o=new t.Deferred,a.then((function(r,i,a){var s,h;if("json"!==n.dataType&&"jsonp"!==n.dataType||"string"!=typeof r||t.error("Ajax request returned a string (did you get the JSON dataType wrong?)."),u._requestId&&u._requestId>p)o.rejectWith(this,["$recursive_request"]);else if(null!==u.parent||null===c){if(e.options.postProcess){try{(h=l._triggerNodeEvent("postProcess",e,e.originalEvent,{response:r,error:null,dataType:n.dataType})).error&&l.warn("postProcess returned error:",h)}catch(t){h={error:t,message:""+t,details:"postProcess failed"}}if(h.error)return s=t.isPlainObject(h.error)?h.error:{message:h.error},s=l._makeHookContext(u,null,s),void o.rejectWith(this,[s]);(t.isArray(h)||t.isPlainObject(h)&&t.isArray(h.children))&&(r=h)}else r&&r.hasOwnProperty("d")&&e.options.enableAspx&&(42===e.options.enableAspx&&l.warn("The default for enableAspx will change to `false` in the fututure. Pass `enableAspx: true` or implement postProcess to silence this warning."),r="string"==typeof r.d?t.parseJSON(r.d):r.d);o.resolveWith(this,[r])}else o.rejectWith(this,["$request_target_invalid"])}),(function(t,e,n){var r=l._makeHookContext(u,null,{error:t,args:Array.prototype.slice.call(arguments),message:n,details:t.status+": "+n});o.rejectWith(this,[r])})),o.done((function(n){var r,i,o;l.nodeSetStatus(e,"ok"),t.isPlainObject(n)?(_(u.isRootNode(),"source may only be an object for root nodes (expecting an array of child objects otherwise)"),_(t.isArray(n.children),"if an object is passed as source, it must contain a 'children' array (all other properties are added to 'tree.data')"),i=n,r=n.children,delete i.children,t.each(f,(function(t,e){void 0!==i[e]&&(l[e]=i[e],delete i[e])})),t.extend(l.data,i)):r=n,_(t.isArray(r),"expected array of children"),u._setChildren(r),l.options.nodata&&0===r.length&&(t.isFunction(l.options.nodata)?o=l.options.nodata.call(l,{type:"nodata"},e):!0===l.options.nodata&&u.isRootNode()?o=l.options.strings.noData:"string"==typeof l.options.nodata&&u.isRootNode()&&(o=l.options.nodata),o&&u.setStatus("nodata",o)),l._triggerNodeEvent("loadChildren",u)})).fail((function(t){var n;"$recursive_request"!==t?"$request_target_invalid"!==t?(t.node&&t.error&&t.message?n=t:"[object Object]"===(n=l._makeHookContext(u,null,{error:t,args:Array.prototype.slice.call(arguments),message:t?t.message||t.toString():""})).message&&(n.message=""),u.warn("Load children failed ("+n.message+")",n),!1!==l._triggerNodeEvent("loadError",n,null)&&l.nodeSetStatus(e,"error",n.message,n.details)):u.warn("Lazy parent node was removed while loading: discarding response."):u.warn("Ignored response for obsolete load request #"+p+" (expected #"+u._requestId+")")})).always((function(){u._requestId=null,s&&l.debugTimeEnd(h)})),o.promise()},nodeLoadKeyPath:function(t,e){},nodeRemoveChild:function(e,n){var r,i=e.node,o=t.extend({},e,{node:n}),a=i.children;if(1===a.length)return _(n===a[0],"invalid single child"),this.nodeRemoveChildren(e);this.activeNode&&(n===this.activeNode||this.activeNode.isDescendantOf(n))&&this.activeNode.setActive(!1),this.focusNode&&(n===this.focusNode||this.focusNode.isDescendantOf(n))&&(this.focusNode=null),this.nodeRemoveMarkup(o),this.nodeRemoveChildren(o),_((r=t.inArray(n,a))>=0,"invalid child"),i.triggerModifyChild("remove",n),n.visit((function(t){t.parent=null}),!0),this._callHook("treeRegisterNode",this,!1,n),a.splice(r,1)},nodeRemoveChildMarkup:function(e){var n=e.node;n.ul&&(n.isRootNode()?t(n.ul).empty():(t(n.ul).remove(),n.ul=null),n.visit((function(t){t.li=t.ul=null})))},nodeRemoveChildren:function(t){var e=t.tree,n=t.node;n.children&&(this.activeNode&&this.activeNode.isDescendantOf(n)&&this.activeNode.setActive(!1),this.focusNode&&this.focusNode.isDescendantOf(n)&&(this.focusNode=null),this.nodeRemoveChildMarkup(t),n.triggerModifyChild("remove",null),n.visit((function(t){t.parent=null,e._callHook("treeRegisterNode",e,!1,t)})),n.lazy?n.children=[]:n.children=null,n.isRootNode()||(n.expanded=!1),this.nodeRenderStatus(t))},nodeRemoveMarkup:function(e){var n=e.node;n.li&&(t(n.li).remove(),n.li=null),this.nodeRemoveChildMarkup(e)},nodeRender:function(e,n,r,i,o){var a,s,l,u,c,h,p,d=e.node,f=e.tree,g=e.options,y=g.aria,m=!1,v=d.parent,b=!v,w=d.children,x=null;if(!1!==f._enableUpdate&&(b||v.ul)){if(_(b||v.ul,"parent UL must exist"),b||(d.li&&(n||d.li.parentNode!==d.parent.ul)&&(d.li.parentNode===d.parent.ul?x=d.li.nextSibling:this.debug("Unlinking "+d+" (must be child of "+d.parent+")"),this.nodeRemoveMarkup(e)),d.li?this.nodeRenderStatus(e):(m=!0,d.li=document.createElement("li"),d.li.ftnode=d,d.key&&g.generateIds&&(d.li.id=g.idPrefix+d.key),d.span=document.createElement("span"),d.span.className="fancytree-node",y&&!d.tr&&t(d.li).attr("role","treeitem"),d.li.appendChild(d.span),this.nodeRenderTitle(e),g.createNode&&g.createNode.call(f,{type:"createNode"},e)),g.renderNode&&g.renderNode.call(f,{type:"renderNode"},e)),w){if(b||d.expanded||!0===r){for(d.ul||(d.ul=document.createElement("ul"),(!0!==i||o)&&d.expanded||(d.ul.style.display="none"),y&&t(d.ul).attr("role","group"),d.li?d.li.appendChild(d.ul):d.tree.$div.append(d.ul)),u=0,c=w.length;u<c;u++)p=t.extend({},e,{node:w[u]}),this.nodeRender(p,n,r,!1,!0);for(a=d.ul.firstChild;a;)(l=a.ftnode)&&l.parent!==d?(d.debug("_fixParent: remove missing "+l,a),h=a.nextSibling,a.parentNode.removeChild(a),a=h):a=a.nextSibling;for(a=d.ul.firstChild,u=0,c=w.length-1;u<c;u++)(s=w[u])===(l=a.ftnode)?a=a.nextSibling:d.ul.insertBefore(s.li,l.li)}}else d.ul&&(this.warn("remove child markup for "+d),this.nodeRemoveChildMarkup(e));b||m&&v.ul.insertBefore(d.li,x)}},nodeRenderTitle:function(e,n){var o,a,s,l,u,c,h,p=e.node,d=e.tree,f=e.options,g=f.aria,y=p.getLevel(),m=[];void 0!==n&&(p.title=n),p.span&&!1!==d._enableUpdate&&(u=g&&!1!==p.hasChildren()?" role='button'":"",y<f.minExpandLevel?(p.lazy||(p.expanded=!0),y>1&&m.push("<span "+u+" class='fancytree-expander fancytree-expander-fixed'></span>")):m.push("<span "+u+" class='fancytree-expander'></span>"),(o=r.evalOption("checkbox",p,p,f,!1))&&!p.isStatusNode()&&(u=g?" role='checkbox'":"",a="fancytree-checkbox",("radio"===o||p.parent&&p.parent.radiogroup)&&(a+=" fancytree-radio"),m.push("<span "+u+" class='"+a+"'></span>")),void 0!==p.data.iconClass&&(p.icon?t.error("'iconClass' node option is deprecated since v2.14.0: use 'icon' only instead"):(p.warn("'iconClass' node option is deprecated since v2.14.0: use 'icon' instead"),p.icon=p.data.iconClass)),!1!==(s=r.evalOption("icon",p,p,f,!0))&&(u=g?" role='presentation'":"",h=(h=r.evalOption("iconTooltip",p,p,f,null))?" title='"+I(h)+"'":"","string"==typeof s?i.test(s)?(s="/"===s.charAt(0)?s:(f.imagePath||"")+s,m.push("<img src='"+s+"' class='fancytree-icon'"+h+" alt='' />")):m.push("<span "+u+" class='fancytree-custom-icon "+s+"'"+h+"></span>"):s.text?m.push("<span "+u+" class='fancytree-custom-icon "+(s.addClass||"")+"'"+h+">"+r.escapeHtml(s.text)+"</span>"):s.html?m.push("<span "+u+" class='fancytree-custom-icon "+(s.addClass||"")+"'"+h+">"+s.html+"</span>"):m.push("<span "+u+" class='fancytree-icon'"+h+"></span>")),l="",f.renderTitle&&(l=f.renderTitle.call(d,{type:"renderTitle"},e)||""),l||(!0===(c=r.evalOption("tooltip",p,p,f,null))&&(c=p.title),l="<span class='fancytree-title'"+(c=c?" title='"+I(c)+"'":"")+(f.titlesTabbable?" tabindex='0'":"")+">"+(f.escapeTitles?r.escapeHtml(p.title):p.title)+"</span>"),m.push(l),p.span.innerHTML=m.join(""),this.nodeRenderStatus(e),f.enhanceTitle&&(e.$title=t(">span.fancytree-title",p.span),l=f.enhanceTitle.call(d,{type:"enhanceTitle"},e)||""))},nodeRenderStatus:function(e){var n,i=e.node,o=e.tree,a=e.options,s=i.hasChildren(),l=i.isLastSibling(),u=a.aria,c=a._classNames,h=[],p=i[o.statusClassPropName];p&&!1!==o._enableUpdate&&(u&&(n=t(i.tr||i.li)),h.push(c.node),o.activeNode===i&&h.push(c.active),o.focusNode===i&&h.push(c.focused),i.expanded&&h.push(c.expanded),u&&(!1===s?n.removeAttr("aria-expanded"):n.attr("aria-expanded",Boolean(i.expanded))),i.folder&&h.push(c.folder),!1!==s&&h.push(c.hasChildren),l&&h.push(c.lastsib),i.lazy&&null==i.children&&h.push(c.lazy),i.partload&&h.push(c.partload),i.partsel&&h.push(c.partsel),r.evalOption("unselectable",i,i,a,!1)&&h.push(c.unselectable),i._isLoading&&h.push(c.loading),i._error&&h.push(c.error),i.statusNodeType&&h.push(c.statusNodePrefix+i.statusNodeType),i.selected?(h.push(c.selected),u&&n.attr("aria-selected",!0)):u&&n.attr("aria-selected",!1),i.extraClasses&&h.push(i.extraClasses),!1===s?h.push(c.combinedExpanderPrefix+"n"+(l?"l":"")):h.push(c.combinedExpanderPrefix+(i.expanded?"e":"c")+(i.lazy&&null==i.children?"d":"")+(l?"l":"")),h.push(c.combinedIconPrefix+(i.expanded?"e":"c")+(i.folder?"f":"")),p.className=h.join(" "),i.li&&t(i.li).toggleClass(c.lastsib,l))},nodeSetActive:function(e,n,r){r=r||{};var i,o=e.node,a=e.tree,s=e.options,l=!0===r.noEvents,u=!0===r.noFocus,c=!1!==r.scrollIntoView;return o===a.activeNode==(n=!1!==n)?S(o):n&&!l&&!1===this._triggerNodeEvent("beforeActivate",o,e.originalEvent)?O(o,["rejected"]):(n?(a.activeNode&&(_(a.activeNode!==o,"node was active (inconsistency)"),i=t.extend({},e,{node:a.activeNode}),a.nodeSetActive(i,!1),_(null===a.activeNode,"deactivate was out of sync?")),s.activeVisible&&o.makeVisible({scrollIntoView:c}),a.activeNode=o,a.nodeRenderStatus(e),u||a.nodeSetFocus(e),l||a._triggerNodeEvent("activate",o,e.originalEvent)):(_(a.activeNode===o,"node was not active (inconsistency)"),a.activeNode=null,this.nodeRenderStatus(e),l||e.tree._triggerNodeEvent("deactivate",o,e.originalEvent)),S(o))},nodeSetExpanded:function(e,n,r){r=r||{};var i,o,a,s,l,u,c=e.node,h=e.tree,p=e.options,d=!0===r.noAnimation,f=!0===r.noEvents;if(n=!1!==n,c.expanded&&n||!c.expanded&&!n)return S(c);if(n&&!c.lazy&&!c.hasChildren())return S(c);if(!n&&c.getLevel()<p.minExpandLevel)return O(c,["locked"]);if(!f&&!1===this._triggerNodeEvent("beforeExpand",c,e.originalEvent))return O(c,["rejected"]);if(d||c.isVisible()||(d=r.noAnimation=!0),o=new t.Deferred,n&&!c.expanded&&p.autoCollapse){l=c.getParentList(!1,!0),u=p.autoCollapse;try{for(p.autoCollapse=!1,a=0,s=l.length;a<s;a++)this._callHook("nodeCollapseSiblings",l[a],r)}finally{p.autoCollapse=u}}return o.done((function(){var t=c.getLastChild();n&&p.autoScroll&&!d&&t&&h._enableUpdate?t.scrollIntoView(!0,{topNode:c}).always((function(){f||e.tree._triggerNodeEvent(n?"expand":"collapse",e)})):f||e.tree._triggerNodeEvent(n?"expand":"collapse",e)})),i=function(r){var i=p._classNames,o=p.toggleEffect;if(c.expanded=n,h._callHook("treeStructureChanged",e,n?"expand":"collapse"),h._callHook("nodeRender",e,!1,!1,!0),c.ul)if("none"!==c.ul.style.display==!!c.expanded)c.warn("nodeSetExpanded: UL.style.display already set");else{if(o&&!d)return t(c.li).addClass(i.animating),void(t.isFunction(t(c.ul)[o.effect])?t(c.ul)[o.effect]({duration:o.duration,always:function(){t(this).removeClass(i.animating),t(c.li).removeClass(i.animating),r()}}):(t(c.ul).stop(!0,!0),t(c.ul).parent().find(".ui-effects-placeholder").remove(),t(c.ul).toggle(o.effect,o.options,o.duration,(function(){t(this).removeClass(i.animating),t(c.li).removeClass(i.animating),r()}))));c.ul.style.display=c.expanded||!parent?"":"none"}r()},n&&c.lazy&&void 0===c.hasChildren()?c.load().done((function(){o.notifyWith&&o.notifyWith(c,["loaded"]),i((function(){o.resolveWith(c)}))})).fail((function(t){i((function(){o.rejectWith(c,["load failed ("+t+")"])}))})):i((function(){o.resolveWith(c)})),o.promise()},nodeSetFocus:function(e,n){var r,i=e.tree,o=e.node,a=i.options,s=!!e.originalEvent&&t(e.originalEvent.target).is(":input");if(n=!1!==n,i.focusNode){if(i.focusNode===o&&n)return;r=t.extend({},e,{node:i.focusNode}),i.focusNode=null,this._triggerNodeEvent("blur",r),this._callHook("nodeRenderStatus",r)}n&&(this.hasFocus()||(o.debug("nodeSetFocus: forcing container focus"),this._callHook("treeSetFocus",e,!0,{calledByNode:!0})),o.makeVisible({scrollIntoView:!1}),i.focusNode=o,a.titlesTabbable&&(s||t(o.span).find(".fancytree-title").focus()),a.aria&&t(i.$container).attr("aria-activedescendant",t(o.tr||o.li).uniqueId().attr("id")),this._triggerNodeEvent("focus",e),document.activeElement===i.$container.get(0)||t(document.activeElement,i.$container).length>=1||t(i.$container).focus(),a.autoScroll&&o.scrollIntoView(),this._callHook("nodeRenderStatus",e))},nodeSetSelected:function(t,e,n){n=n||{};var i=t.node,o=t.tree,a=t.options,s=!0===n.noEvents,l=i.parent;if(e=!1!==e,!r.evalOption("unselectable",i,i,a,!1)){if(i._lastSelectIntent=e,!!i.selected===e&&(3!==a.selectMode||!i.partsel||e))return e;if(!s&&!1===this._triggerNodeEvent("beforeSelect",i,t.originalEvent))return!!i.selected;e&&1===a.selectMode?(o.lastSelectedNode&&o.lastSelectedNode.setSelected(!1),i.selected=e):3!==a.selectMode||!l||l.radiogroup||i.radiogroup?l&&l.radiogroup?i.visitSiblings((function(t){t._changeSelectStatusAttrs(e&&t===i)}),!0):i.selected=e:(i.selected=e,i.fixSelection3AfterClick(n)),this.nodeRenderStatus(t),o.lastSelectedNode=e?i:null,s||o._triggerNodeEvent("select",t)}},nodeSetStatus:function(e,n,r,i){var o=e.node,a=e.tree;function s(n,r){var i=o.children?o.children[0]:null;return i&&i.isStatusNode()?(t.extend(i,n),i.statusNodeType=r,a._callHook("nodeRenderTitle",i)):(o._setChildren([n]),a._callHook("treeStructureChanged",e,"setStatusNode"),o.children[0].statusNodeType=r,a.render()),o.children[0]}switch(n){case"ok":!function(){var t=o.children?o.children[0]:null;if(t&&t.isStatusNode()){try{o.ul&&(o.ul.removeChild(t.li),t.li=null)}catch(t){}1===o.children.length?o.children=[]:o.children.shift(),a._callHook("treeStructureChanged",e,"clearStatusNode")}}(),o._isLoading=!1,o._error=null,o.renderStatus();break;case"loading":o.parent||s({title:a.options.strings.loading+(r?" ("+r+")":""),checkbox:!1,tooltip:i},n),o._isLoading=!0,o._error=null,o.renderStatus();break;case"error":s({title:a.options.strings.loadError+(r?" ("+r+")":""),checkbox:!1,tooltip:i},n),o._isLoading=!1,o._error={message:r,details:i},o.renderStatus();break;case"nodata":s({title:r||a.options.strings.noData,checkbox:!1,tooltip:i},n),o._isLoading=!1,o._error=null,o.renderStatus();break;default:t.error("invalid node status "+n)}},nodeToggleExpanded:function(t){return this.nodeSetExpanded(t,!t.node.expanded)},nodeToggleSelected:function(t){var e=t.node,n=!e.selected;return e.partsel&&!e.selected&&!0===e._lastSelectIntent&&(n=!1,e.selected=!0),e._lastSelectIntent=n,this.nodeSetSelected(t,n)},treeClear:function(t){var e=t.tree;e.activeNode=null,e.focusNode=null,e.$div.find(">ul.fancytree-container").empty(),e.rootNode.children=null,e._callHook("treeStructureChanged",t,"clear")},treeCreate:function(t){},treeDestroy:function(t){this.$div.find(">ul.fancytree-container").remove(),this.$source&&this.$source.removeClass("fancytree-helper-hidden")},treeInit:function(e){var n=e.tree,r=n.options;n.$container.attr("tabindex",r.tabindex),t.each(f,(function(t,e){void 0!==r[e]&&(n.info("Move option "+e+" to tree"),n[e]=r[e],delete r[e])})),r.checkboxAutoHide&&n.$container.addClass("fancytree-checkbox-auto-hide"),r.rtl?n.$container.attr("DIR","RTL").addClass("fancytree-rtl"):n.$container.removeAttr("DIR").removeClass("fancytree-rtl"),r.aria&&(n.$container.attr("role","tree"),1!==r.selectMode&&n.$container.attr("aria-multiselectable",!0)),this.treeLoad(e)},treeLoad:function(e,n){var i,o,a,s=e.tree,l=e.widget.element,u=t.extend({},e,{node:this.rootNode});if(s.rootNode.children&&this.treeClear(e),n=n||this.options.source)"string"==typeof n&&t.error("Not implemented");else switch(o=l.data("type")||"html"){case"html":(a=l.find(">ul").not(".fancytree-container").first()).length?(a.addClass("ui-fancytree-source fancytree-helper-hidden"),n=t.ui.fancytree.parseHtml(a),this.data=t.extend(this.data,T(a))):(r.warn("No `source` option was passed and container does not contain `<ul>`: assuming `source: []`."),n=[]);break;case"json":n=t.parseJSON(l.text()),l.contents().filter((function(){return 3===this.nodeType})).remove(),t.isPlainObject(n)&&(_(t.isArray(n.children),"if an object is passed as source, it must contain a 'children' array (all other properties are added to 'tree.data')"),i=n,n=n.children,delete i.children,t.each(f,(function(t,e){void 0!==i[e]&&(s[e]=i[e],delete i[e])})),t.extend(s.data,i));break;default:t.error("Invalid data-type: "+o)}return s._triggerTreeEvent("preInit",null),this.nodeLoadChildren(u,n).done((function(){s._callHook("treeStructureChanged",e,"loadChildren"),s.render(),3===e.options.selectMode&&s.rootNode.fixSelection3FromEndNodes(),s.activeNode&&s.options.activeVisible&&s.activeNode.makeVisible(),s._triggerTreeEvent("init",null,{status:!0})})).fail((function(){s.render(),s._triggerTreeEvent("init",null,{status:!1})}))},treeRegisterNode:function(t,e,n){t.tree._callHook("treeStructureChanged",t,e?"addNode":"removeNode")},treeSetFocus:function(e,n,r){var i;(n=!1!==n)!==this.hasFocus()&&(this._hasFocus=n,!n&&this.focusNode?this.focusNode.setFocus(!1):!n||r&&r.calledByNode||t(this.$container).focus(),this.$container.toggleClass("fancytree-treefocus",n),this._triggerTreeEvent(n?"focusTree":"blurTree"),n&&!this.activeNode&&(i=this._lastMousedownNode||this.getFirstChild())&&i.setFocus())},treeSetOption:function(e,n,r){var i=e.tree,o=!0,a=!1,s=!1;switch(n){case"aria":case"checkbox":case"icon":case"minExpandLevel":case"tabindex":a=!0,s=!0;break;case"checkboxAutoHide":i.$container.toggleClass("fancytree-checkbox-auto-hide",!!r);break;case"escapeTitles":case"tooltip":s=!0;break;case"rtl":!1===r?i.$container.removeAttr("DIR").removeClass("fancytree-rtl"):i.$container.attr("DIR","RTL").addClass("fancytree-rtl"),s=!0;break;case"source":o=!1,i._callHook("treeLoad",i,r),s=!0}i.debug("set option "+n+"="+r+" <"+typeof r+">"),o&&(this.widget._super?this.widget._super.call(this.widget,n,r):t.Widget.prototype._setOption.call(this.widget,n,r)),a&&i._callHook("treeCreate",i),s&&i.render(!0,!1)},treeStructureChanged:function(t,e){}}),t.widget("ui.fancytree",{options:{activeVisible:!0,ajax:{type:"GET",cache:!1,dataType:"json"},aria:!0,autoActivate:!0,autoCollapse:!1,autoScroll:!1,checkbox:!1,clickFolderMode:4,copyFunctionsToData:!1,debugLevel:null,disabled:!1,enableAspx:42,escapeTitles:!1,extensions:[],focusOnSelect:!1,generateIds:!1,icon:!0,idPrefix:"ft_",keyboard:!0,keyPathSeparator:"/",minExpandLevel:1,nodata:!0,quicksearch:!1,rtl:!1,scrollOfs:{top:0,bottom:0},scrollParent:null,selectMode:2,strings:{loading:"Loading...",loadError:"Load error!",moreData:"More...",noData:"No data."},tabindex:"0",titlesTabbable:!1,toggleEffect:{effect:"slideToggle",duration:200},tooltip:!1,treeId:null,_classNames:{active:"fancytree-active",animating:"fancytree-animating",combinedExpanderPrefix:"fancytree-exp-",combinedIconPrefix:"fancytree-ico-",error:"fancytree-error",expanded:"fancytree-expanded",focused:"fancytree-focused",folder:"fancytree-folder",hasChildren:"fancytree-has-children",lastsib:"fancytree-lastsib",lazy:"fancytree-lazy",loading:"fancytree-loading",node:"fancytree-node",partload:"fancytree-partload",partsel:"fancytree-partsel",radio:"fancytree-radio",selected:"fancytree-selected",statusNodePrefix:"fancytree-statusnode-",unselectable:"fancytree-unselectable"},lazyLoad:null,postProcess:null},_deprecationWarning:function(t){var e=this.tree;e&&e.options.debugLevel>=3&&e.warn("$().fancytree('"+t+"') is deprecated (see https://wwwendt.de/tech/fancytree/doc/jsdoc/Fancytree_Widget.html")},_create:function(){this.tree=new R(this),this.$source=this.source||"json"===this.element.data("type")?this.element:this.element.find(">ul").first();var e,n,r,i=this.options,o=i.extensions;this.tree;for(r=0;r<o.length;r++)n=o[r],(e=t.ui.fancytree._extensions[n])||t.error("Could not apply extension '"+n+"' (it is not registered, did you forget to include it?)"),this.tree.options[n]=w({},e.options,this.tree.options[n]),_(void 0===this.tree.ext[n],"Extension name must not exist as Fancytree.ext attribute: '"+n+"'"),this.tree.ext[n]={},E(this.tree,0,e,n),e;void 0!==i.icons&&(!0===i.icon?(this.tree.warn("'icons' tree option is deprecated since v2.14.0: use 'icon' instead"),i.icon=i.icons):t.error("'icons' tree option is deprecated since v2.14.0: use 'icon' only instead")),void 0!==i.iconClass&&(i.icon?t.error("'iconClass' tree option is deprecated since v2.14.0: use 'icon' only instead"):(this.tree.warn("'iconClass' tree option is deprecated since v2.14.0: use 'icon' instead"),i.icon=i.iconClass)),void 0!==i.tabbable&&(i.tabindex=i.tabbable?"0":"-1",this.tree.warn("'tabbable' tree option is deprecated since v2.17.0: use 'tabindex='"+i.tabindex+"' instead")),this.tree._callHook("treeCreate",this.tree)},_init:function(){this.tree._callHook("treeInit",this.tree),this._bind()},_setOption:function(t,e){return this.tree._callHook("treeSetOption",this.tree,t,e)},_destroy:function(){this._unbind(),this.tree._callHook("treeDestroy",this.tree)},_unbind:function(){var e=this.tree._ns;this.element.off(e),this.tree.$container.off(e),t(document).off(e)},_bind:function(){var e=this,n=this.options,i=this.tree,o=i._ns;this._unbind(),i.$container.on("focusin"+o+" focusout"+o,(function(e){var n=r.getNode(e),o="focusin"===e.type;if(!o&&n&&t(e.target).is("a"))n.debug("Ignored focusout on embedded <a> element.");else{if(o){if(i._getExpiringValue("focusin"))return void i.debug("Ignored double focusin.");i._setExpiringValue("focusin",!0,50),n||(n=i._getExpiringValue("mouseDownNode"))&&i.debug("Reconstruct mouse target for focusin from recent event.")}n?i._callHook("nodeSetFocus",i._makeHookContext(n,e),o):i.tbody&&t(e.target).parents("table.fancytree-container > thead").length?i.debug("Ignore focus event outside table body.",e):i._callHook("treeSetFocus",i,o)}})).on("selectstart"+o,"span.fancytree-title",(function(t){t.preventDefault()})).on("keydown"+o,(function(t){if(n.disabled||!1===n.keyboard)return!0;var e,r=i.focusNode,o=i._makeHookContext(r||i,t),a=i.phase;try{return i.phase="userEvent","preventNav"===(e=r?i._triggerNodeEvent("keydown",r,t):i._triggerTreeEvent("keydown",t))?e=!0:!1!==e&&(e=i._callHook("nodeKeydown",o)),e}finally{i.phase=a}})).on("mousedown"+o,(function(t){var e=r.getEventTarget(t);i._lastMousedownNode=e?e.node:null,i._setExpiringValue("mouseDownNode",i._lastMousedownNode)})).on("click"+o+" dblclick"+o,(function(t){if(n.disabled)return!0;var i,o=r.getEventTarget(t),a=o.node,s=e.tree,l=s.phase;if(!a)return!0;i=s._makeHookContext(a,t);try{switch(s.phase="userEvent",t.type){case"click":return i.targetType=o.type,a.isPagingNode()?!0===s._triggerNodeEvent("clickPaging",i,t):!1!==s._triggerNodeEvent("click",i,t)&&s._callHook("nodeClick",i);case"dblclick":return i.targetType=o.type,!1!==s._triggerNodeEvent("dblclick",i,t)&&s._callHook("nodeDblclick",i)}}finally{s.phase=l}}))},getActiveNode:function(){return this._deprecationWarning("getActiveNode"),this.tree.activeNode},getNodeByKey:function(t){return this._deprecationWarning("getNodeByKey"),this.tree.getNodeByKey(t)},getRootNode:function(){return this._deprecationWarning("getRootNode"),this.tree.rootNode},getTree:function(){return this._deprecationWarning("getTree"),this.tree}}),r=t.ui.fancytree,t.extend(t.ui.fancytree,{version:"2.36.1",buildType:"production",debugLevel:3,_nextId:1,_nextNodeKey:1,_extensions:{},_FancytreeClass:R,_FancytreeNodeClass:P,jquerySupports:{positionMyOfs:function(e,n,r,i){var o,a,s,l=t.map(t.trim(e).split("."),(function(t){return parseInt(t,10)})),u=t.map(Array.prototype.slice.call(arguments,1),(function(t){return parseInt(t,10)}));for(o=0;o<u.length;o++)if(a=l[o]||0,s=u[o]||0,a!==s)return a>s;return!0}(t.ui.version,1,9)},assert:function(t,e){return _(t,e)},createTree:function(e,n){var i=t(e).fancytree(n);return r.getTree(i)},debounce:function(t,e,n,r){var i;return 3===arguments.length&&"boolean"!=typeof n&&(r=n,n=!1),function(){var o=arguments;r=r||this,n&&!i&&e.apply(r,o),clearTimeout(i),i=setTimeout((function(){n||e.apply(r,o),i=null}),t)}},debug:function(e){t.ui.fancytree.debugLevel>=4&&b("log",arguments)},error:function(e){t.ui.fancytree.debugLevel>=1&&b("error",arguments)},escapeHtml:function(t){return(""+t).replace(o,(function(t){return s[t]}))},fixPositionOptions:function(e){if((e.offset||(""+e.my+e.at).indexOf("%")>=0)&&t.error("expected new position syntax (but '%' is not supported)"),!t.ui.fancytree.jquerySupports.positionMyOfs){var n=/(\w+)([+-]?\d+)?\s+(\w+)([+-]?\d+)?/.exec(e.my),r=/(\w+)([+-]?\d+)?\s+(\w+)([+-]?\d+)?/.exec(e.at),i=(n[2]?+n[2]:0)+(r[2]?+r[2]:0),o=(n[4]?+n[4]:0)+(r[4]?+r[4]:0);e=t.extend({},e,{my:n[1]+" "+n[3],at:r[1]+" "+r[3]}),(i||o)&&(e.offset=i+" "+o)}return e},getEventTarget:function(e){var n,i=e&&e.target?e.target.className:"",o={node:this.getNode(e.target),type:void 0};return/\bfancytree-title\b/.test(i)?o.type="title":/\bfancytree-expander\b/.test(i)?o.type=!1===o.node.hasChildren()?"prefix":"expander":/\bfancytree-checkbox\b/.test(i)?o.type="checkbox":/\bfancytree(-custom)?-icon\b/.test(i)?o.type="icon":/\bfancytree-node\b/.test(i)?o.type="title":e&&e.target&&((n=t(e.target)).is("ul[role=group]")?((o.node&&o.node.tree||r).debug("Ignoring click on outer UL."),o.node=null):n.closest(".fancytree-title").length?o.type="title":n.closest(".fancytree-checkbox").length?o.type="checkbox":n.closest(".fancytree-expander").length&&(o.type="expander")),o},getEventTargetType:function(t){return this.getEventTarget(t).type},getNode:function(e){if(e instanceof P)return e;for(e instanceof t?e=e[0]:void 0!==e.originalEvent&&(e=e.target);e;){if(e.ftnode)return e.ftnode;e=e.parentNode}return null},getTree:function(e){var n,r=e;return e instanceof R?e:(void 0===e&&(e=0),"number"==typeof e?e=t(".fancytree-container").eq(e):"string"==typeof e?(e=t("#ft-id-"+r).eq(0)).length||(e=t(r).eq(0)):e instanceof Element||e instanceof HTMLDocument?e=t(e):e instanceof t?e=e.eq(0):void 0!==e.originalEvent&&(e=t(e.target)),(n=(e=e.closest(":ui-fancytree")).data("ui-fancytree")||e.data("fancytree"))?n.tree:null)},evalOption:function(e,n,r,i,o){var a,s,l=n.tree,u=i[e],c=r[e];return t.isFunction(u)?(a={node:n,tree:l,widget:l.widget,options:l.widget.options,typeInfo:l.types[n.type]||{}},null==(s=u.call(l,{type:e},a))&&(s=c)):s=null==c?u:c,null==s&&(s=o),s},setSpanIcon:function(e,n,r){var i=t(e);"string"==typeof r?i.attr("class",n+" "+r):(r.text?i.text(""+r.text):r.html&&(e.innerHTML=r.html),i.attr("class",n+" "+(r.addClass||"")))},eventToString:function(t){var e=t.which,n=t.type,r=[];return t.altKey&&r.push("alt"),t.ctrlKey&&r.push("ctrl"),t.metaKey&&r.push("meta"),t.shiftKey&&r.push("shift"),"click"===n||"dblclick"===n?r.push(h[t.button]+n):"wheel"===n?r.push(n):l[e]||r.push(u[e]||String.fromCharCode(e).toLowerCase()),r.join("+")},info:function(e){t.ui.fancytree.debugLevel>=3&&b("info",arguments)},keyEventToString:function(t){return this.warn("keyEventToString() is deprecated: use eventToString()"),this.eventToString(t)},overrideMethod:function(e,n,r,i){var o,a=e[n]||t.noop;e[n]=function(){var t=i||this;try{return o=t._super,t._super=a,r.apply(t,arguments)}finally{t._super=o}}},parseHtml:function(e){var n,r,i,o,a,s,l,u,c=e.find(">li"),h=[];return c.each((function(){var c,f,y=t(this),v=y.find(">span",this).first(),_=v.length?null:y.find(">a").first(),b={tooltip:null,data:{}};for(v.length?b.title=v.html():_&&_.length?(b.title=_.html(),b.data.href=_.attr("href"),b.data.target=_.attr("target"),b.tooltip=_.attr("title")):(b.title=y.html(),(a=b.title.search(/<ul/i))>=0&&(b.title=b.title.substring(0,a))),b.title=t.trim(b.title),o=0,s=p.length;o<s;o++)b[p[o]]=void 0;for(n=this.className.split(" "),i=[],o=0,s=n.length;o<s;o++)r=n[o],d[r]?b[r]=!0:i.push(r);if(b.extraClasses=i.join(" "),(l=y.attr("title"))&&(b.tooltip=l),(l=y.attr("id"))&&(b.key=l),y.attr("hideCheckbox")&&(b.checkbox=!1),(c=T(y))&&!t.isEmptyObject(c)){for(f in m)c.hasOwnProperty(f)&&(c[m[f]]=c[f],delete c[f]);for(o=0,s=g.length;o<s;o++)l=g[o],null!=(u=c[l])&&(delete c[l],b[l]=u);t.extend(b.data,c)}(e=y.find(">ul").first()).length?b.children=t.ui.fancytree.parseHtml(e):b.children=b.lazy?void 0:null,h.push(b)})),h},registerExtension:function(e){_(null!=e.name,"extensions must have a `name` property."),_(null!=e.version,"extensions must have a `version` property."),t.ui.fancytree._extensions[e.name]=e},unescapeHtml:function(t){var e=document.createElement("div");return e.innerHTML=t,0===e.childNodes.length?"":e.childNodes[0].nodeValue},warn:function(e){t.ui.fancytree.debugLevel>=2&&b("warn",arguments)}}),t.ui.fancytree}function _(e,n){e||(n=n?": "+n:"",t.error("Fancytree assertion failed"+n))}function b(t,e){var n,r,i=window.console?window.console[t]:null;if(i)try{i.apply(window.console,e)}catch(t){for(r="",n=0;n<e.length;n++)r+=e[n];i(r)}}function w(){var e,n,r,i,o,a=arguments[0]||{},s=1,l=arguments.length;if("object"==typeof a||t.isFunction(a)||(a={}),s===l)throw Error("need at least two args");for(;s<l;s++)if(null!=(e=arguments[s]))for(n in e)if(e.hasOwnProperty(n)){if(r=a[n],a===(i=e[n]))continue;i&&t.isPlainObject(i)?(o=r&&t.isPlainObject(r)?r:{},a[n]=w(o,i)):void 0!==i&&(a[n]=i)}return a}function x(t,e,n,r,i){var o,a,s,l,u;return o=e[t],a=r[t],s=e.ext[i],l=function(){return o.apply(e,arguments)},u=function(t){return o.apply(e,t)},function(){var t=e._local,n=e._super,r=e._superApply;try{return e._local=s,e._super=l,e._superApply=u,a.apply(e,arguments)}finally{e._local=t,e._super=n,e._superApply=r}}}function E(e,n,r,i){for(var o in r)"function"==typeof r[o]?"function"==typeof e[o]?e[o]=x(o,e,0,r,i):"_"===o.charAt(0)?e.ext[i][o]=x(o,e,0,r,i):t.error("Could not override tree."+o+". Use prefix '_' to create tree."+i+"._"+o):"options"!==o&&(e.ext[i][o]=r[o])}function S(e,n){return void 0===e?t.Deferred((function(){this.resolve()})).promise():t.Deferred((function(){this.resolveWith(e,n)})).promise()}function O(e,n){return void 0===e?t.Deferred((function(){this.reject()})).promise():t.Deferred((function(){this.rejectWith(e,n)})).promise()}function C(t,e){return function(){t.resolveWith(e)}}function T(e){var n=t.extend({},e.data()),r=n.json;return delete n.fancytree,delete n.uiFancytree,r&&(delete n.json,n=t.extend(n,r)),n}function I(t){return(""+t).replace(a,(function(t){return s[t]}))}function L(t){return t=t.toLowerCase(),function(e){return e.title.toLowerCase().indexOf(t)>=0}}function P(e,n){var i,o,a,s;for(this.parent=e,this.tree=e.tree,this.ul=null,this.li=null,this.statusNodeType=null,this._isLoading=!1,this._error=null,this.data={},i=0,o=g.length;i<o;i++)this[a=g[i]]=n[a];for(a in null==this.unselectableIgnore&&null==this.unselectableStatus||(this.unselectable=!0),n.hideCheckbox&&t.error("'hideCheckbox' node option was removed in v2.23.0: use 'checkbox: false'"),n.data&&t.extend(this.data,n.data),n)y[a]||!this.tree.options.copyFunctionsToData&&t.isFunction(n[a])||v[a]||(this.data[a]=n[a]);null==this.key?this.tree.options.defaultKey?(this.key=""+this.tree.options.defaultKey(this),_(this.key,"defaultKey() must return a unique key")):this.key="_"+r._nextNodeKey++:this.key=""+this.key,n.active&&(_(null===this.tree.activeNode,"only one active node allowed"),this.tree.activeNode=this),n.selected&&(this.tree.lastSelectedNode=this),(s=n.children)?s.length?this._setChildren(s):this.children=this.lazy?[]:null:this.children=null,this.tree._callHook("treeRegisterNode",this.tree,!0,this)}function R(e){this.widget=e,this.$div=e.element,this.options=e.options,this.options&&(void 0!==this.options.lazyload&&t.error("The 'lazyload' event is deprecated since 2014-02-25. Use 'lazyLoad' (with uppercase L) instead."),void 0!==this.options.loaderror&&t.error("The 'loaderror' event was renamed since 2014-07-03. Use 'loadError' (with uppercase E) instead."),void 0!==this.options.fx&&t.error("The 'fx' option was replaced by 'toggleEffect' since 2014-11-30."),void 0!==this.options.removeNode&&t.error("The 'removeNode' event was replaced by 'modifyChild' since 2.20 (2016-09-10).")),this.ext={},this.types={},this.columns={},this.data=T(this.$div),this._id=""+(this.options.treeId||t.ui.fancytree._nextId++),this._ns=".fancytree-"+this._id,this.activeNode=null,this.focusNode=null,this._hasFocus=null,this._tempCache={},this._lastMousedownNode=null,this._enableUpdate=!0,this.lastSelectedNode=null,this.systemFocusElement=null,this.lastQuicksearchTerm="",this.lastQuicksearchTime=0,this.viewport=null,this.statusClassPropName="span",this.ariaPropName="li",this.nodeContainerAttrName="li",this.$div.find(">ul.fancytree-container").remove();var n,i={tree:this};this.rootNode=new P(i,{title:"root",key:"root_"+this._id,children:null,expanded:!0}),this.rootNode.parent=null,n=t("<ul>",{id:"ft-id-"+this._id,class:"ui-fancytree fancytree-container fancytree-plain"}).appendTo(this.$div),this.$container=n,this.rootNode.ul=n[0],null==this.options.debugLevel&&(this.options.debugLevel=r.debugLevel)}t.ui.fancytree.warn("Fancytree: ignored duplicate include")})?r.apply(e,i):r)||(t.exports=o)},function(t,e,n){"use strict";n.d(e,"a",(function(){return h}));var r=n(24),i=n.n(r),o=n(27),a=n.n(o),s=n(44),l=n(3),u=n(181),c=n(11),h=function(){function t(e){if(i()(this,t),Object(s.b)()){if(!e||"string"!=typeof e.caller)throw"Caller parameter not supplied";for(var n in this.options=e,this.listeners={},l.c)l.c.hasOwnProperty(n)&&(this.listeners[l.c[n]]=[]);this.authenticationProviders=[]}}return a()(t,[{key:"getCaller",value:function(){return this.options.caller}},{key:"registerAuthenticationProvider",value:function(t){"function"!=typeof t.authenticate?console.error("Invalid authentication provider"):this.authenticationProviders.push(t)}},{key:"removeAuthenticationProvider",value:function(t,e){if("function"!=typeof t.authenticate)console.error("Invalid authentication provider");else for(var n=0;n<this.authenticationProviders.length;n++)if(this.authenticationProviders[n]===t){this.authenticationProviders.splice(n,1),!1!==e&&l.f.clear();break}}},{key:"getAuthenticationProviders",value:function(){return this.authenticationProviders}},{key:"pingServers",value:function(t,e,n){(n<=1||!n||void 0===n)&&(n=6);var r=t.map((function(t){return{serverUrl:t,success:!1,times:[],avgTime:null,attempts:0}})),i=function t(i,o,a){if(r[o].attempts++,a&&r[o].attempts>1){var s=performance.now()-i;r[o].times.push(s),r[o].avgTime=null!=r[o].avgTime?(r[o].avgTime*r[o].times.length+s)/(r[o].times.length+1):s,r[o].success=!0}if(r[o].attempts>=n&&o++,o>=r.length)"function"==typeof e&&e(r.sort((function(t,e){return null!=t.avgTime&&null!=e.avgTime?t.avgTime-e.avgTime:null!=t.avgTime?-1e7:1e7})).map((function(t){return t.serverUrl})),r);else{var u=performance.now();Object(l.h)({serverUrl:r[o].serverUrl,method:l.a.GetVersionInfo,success:t.bind(this,u,o,!0),failure:t.bind(this,u,o,!1)})}},o=performance.now();Object(l.h)({serverUrl:r[0].serverUrl,method:l.a.GetVersionInfo,success:i.bind(this,o,0,!0),failure:i.bind(this,o,0,!1)})}},{key:"getUserInfo",value:function(t){for(var e in l.f.get())if(l.f.get().hasOwnProperty(e)&&e===t&&l.f.get()[e])return l.f.get()[e];return null}},{key:"getSession",value:function(t,e,n){for(var r in l.f.get())if(l.f.get().hasOwnProperty(r)&&r===t&&l.f.get()[r])return void e(l.f.get()[r].SessionId);p.call(this,t,e,n)}},{key:"getImageInfo",value:function(t,e,n,r){d.call(this,{attemptCount:0,serverUrl:t,method:l.a.GetImageInfo,data:{pathOrUid:e},httpMethod:"GET",success:n,failure:r})}},{key:"getFiles",value:function(t,e,n,r){console.warn("Context.getFiles is deprecated please use Context.getSlides instead"),d.call(this,{attemptCount:0,serverUrl:t,method:l.a.GetFiles,data:{path:e},httpMethod:"GET",success:n,failure:r})}},{key:"getSlides",value:function(t){d.call(this,{attemptCount:0,serverUrl:t.serverUrl,method:l.a.GetFiles,data:{path:t.path,scope:t.scope?t.scope:0},httpMethod:"GET",success:t.success,failure:t.failure})}},{key:"getDirectories",value:function(t,e,n,r){d.call(this,{attemptCount:0,serverUrl:t,method:l.a.GetDirectories,data:{path:e},httpMethod:"GET",success:n,failure:r})}},{key:"getAnnotations",value:function(t,e,n,r,i){d.call(this,{attemptCount:0,serverUrl:t,method:l.a.GetAnnotations,data:{pathOrUid:e,currentUserOnly:n},httpMethod:"GET",success:r,failure:i})}},{key:"addAnnotation",value:function(t,e,n,r,i,o,a,s,u){d.call(this,{attemptCount:0,serverUrl:t,method:l.a.AddAnnotation,data:{pathOrUid:e,classification:n,layerID:r,notes:i,geometry:o,color:a},httpMethod:"POST",contentType:"application/json",success:s,failure:u})}},{key:"updateAnnotation",value:function(t,e,n,r,i,o,a,s,u){d.call(this,{attemptCount:0,serverUrl:t,method:l.a.UpdateAnnotation,data:{pathOrUid:e,layerID:n,annotationID:r,notes:i,geometry:o,color:a},httpMethod:"POST",contentType:"application/json",success:s,failure:u})}},{key:"saveAnnotations",value:function(t,e,n,r,i,o,a){d.call(this,{attemptCount:0,serverUrl:t,method:l.a.SaveAnnotations,data:{pathOrUid:e,added:n,updated:r,deleted:i},httpMethod:"POST",contentType:"application/json",success:o,failure:a})}},{key:"deleteAnnotation",value:function(t,e,n,r,i,o){d.call(this,{attemptCount:0,serverUrl:t,method:l.a.DeleteAnnotation,data:{pathOrUid:e,layerID:n,annotationID:r},httpMethod:"POST",contentType:"application/json",success:i,failure:o})}},{key:"getFormDefinitions",value:function(t,e,n,r,i){d.call(this,{attemptCount:0,serverUrl:t,method:l.a.GetFormDefinitions,data:{formIDs:e instanceof Array?e.join(","):e,rootDirectoryAlias:n},httpMethod:"GET",success:r,failure:i})}},{key:"getFormSubmissions",value:function(t,e,n,r,i,o){d.call(this,{attemptCount:0,serverUrl:t,method:l.a.GetFormSubmissions,data:{pathOrUids:e instanceof Array?e:[],formIDs:n instanceof Array?n:[],currentUserOnly:r},httpMethod:"POST",contentType:"application/json",success:i,failure:o})}},{key:"saveFormDefinition",value:function(t,e,n,r){d.call(this,{attemptCount:0,serverUrl:t,method:l.a.SaveFormDefinition,apiPath:"admin",contentType:"application/json",data:{definition:e},httpMethod:"POST",success:n,failure:r})}},{key:"deleteFormDefinition",value:function(t,e,n,r){d.call(this,{attemptCount:0,serverUrl:t,method:l.a.DeleteFormDefinition,apiPath:"admin",data:{formID:e},httpMethod:"GET",success:n,failure:r})}},{key:"getVersionInfo",value:function(t,e,n){Object(l.h)({serverUrl:t,method:l.a.GetVersionInfo,success:function(t){if("function"==typeof e){var n=Object(l.o)(t.responseText);e(n)}},failure:function(t){if("function"==typeof n)if(t.responseText&&0!==t.responseText.length){var e=Object(l.o)(t.responseText);n(e)}else n({Message:c.a.translate("Get Version Info failed")})}})}},{key:"getEvents",value:function(t,e,n){d.call(this,{attemptCount:0,serverUrl:t.serverUrl,method:l.a.GetEvents,apiPath:"admin",data:{page:t.page,pageSize:t.pageSize},httpMethod:"GET",success:e,failure:n})}},{key:"deAuthenticate",value:function(t,e,n){var r=null;if(l.f.get().hasOwnProperty(t)&&l.f.get()[t]){if(!(r=l.f.get()[t].SessionId)&&"function"==typeof e)return void e()}else for(var i=function(t){r=t},o=0;o<this.authenticationProviders.length;o++)if(this.authenticationProviders[o]instanceof PMA.UI.Authentication.SessionLogin){if(this.authenticationProviders[o].authenticate(t,i,null))break}else;null!=r&&(l.f.set(t,null),Object(l.h)({serverUrl:t,method:l.a.DeAuthenticate,data:{sessionID:r},success:function(t){"function"==typeof e&&e()},failure:function(t){if("function"==typeof n)if(t.responseText&&0!==t.responseText.length){var e=Object(l.o)(t.responseText);n(e)}else n()}}))}},{key:"queryFilename",value:function(t,e,n,r,i){d.call(this,{attemptCount:0,serverUrl:t,method:l.a.QueryFilename,apiPath:"query",data:{path:e,pattern:n},httpMethod:"GET",success:r,failure:i})}},{key:"distinctValues",value:function(t){d.call(this,{attemptCount:0,serverUrl:t.serverUrl,method:l.a.DistinctValues,apiPath:"query",data:{formID:t.formId,fieldID:t.fieldId},httpMethod:"GET",success:t.success,failure:t.failure})}},{key:"getImagesInfo",value:function(t){d.call(this,{attemptCount:0,serverUrl:t.serverUrl,method:l.a.GetImagesInfo,apiPath:"api",data:{pathOrUids:t.images},contentType:"application/json",httpMethod:"POST",success:t.success,failure:t.failure})}},{key:"metadata",value:function(t){d.call(this,{attemptCount:0,serverUrl:t.serverUrl,method:l.a.Metadata,apiPath:"query",data:{expressions:t.expressions},httpMethod:"POST",contentType:"application/json",success:t.success,failure:t.failure})}},{key:"checkPmaStartServer",value:function(t,e){Object(l.h)({method:l.a.GetVersionInfo,httpMethod:"GET",serverUrl:"http://127.0.0.1:54001/",success:function(){"function"==typeof callback&&t.call(this,!0)},failure:function(){"function"==typeof callback&&e.call(this,!1)}})}},{key:"getPmaStartCorsUrl",value:function(){return"http://127.0.0.1:54001/home/allowdomain/?host="+document.location.origin}},{key:"runScript",value:function(t){d.call(this,{attemptCount:0,serverUrl:t.serverUrl,method:l.a.RunScripts,apiPath:"scripts",webapi:!0,data:Object.assign({name:t.name},t.params),httpMethod:"GET",success:t.success,failure:t.failure})}},{key:"listen",value:function(t,e){this.listeners.hasOwnProperty(t)||console.error(t+" is not a valid event"),this.listeners[t].push(e)}},{key:"fireEvent",value:function(t,e){if(this.listeners.hasOwnProperty(t))for(var n=0,r=this.listeners[t].length;n<r;n++)this.listeners[t][n](e);else console.error(t+" does not exist")}}]),t}();function p(t,e,n){var r=0;for(r=0;r<this.authenticationProviders.length;r++)if(!(this.authenticationProviders[r]instanceof u.a)&&this.authenticationProviders[r].authenticate(t,e,n))return;for(r=0;r<this.authenticationProviders.length;r++)if(this.authenticationProviders[r]instanceof u.a){if(this.authenticationProviders[r].authenticate(t,e,n))return;break}"function"==typeof n&&n({Message:c.a.translate("Authentication failed at server {serverUrl}.",{serverUrl:t})})}function d(t){var e=this;t.apiPath||(t.apiPath="api"),e.getSession(t.serverUrl,(function(n){t.data.sessionID=n,Object(l.h)({serverUrl:t.serverUrl,method:t.method,data:t.data,contentType:t.contentType,httpMethod:t.httpMethod,apiPath:t.apiPath,webapi:t.webapi,success:function(e){if("function"==typeof t.success){var n=Object(l.o)(e.responseText);t.success(t.data.sessionID,n)}},failure:function(n){if(l.f.set(t.serverUrl,null),0==n.status&&0===t.attemptCount)t.attemptCount=1,d.call(e,t);else if("function"==typeof t.failure)if(n.responseText&&0!==n.responseText.length)try{var r=Object(l.o)(n.responseText);t.failure(r),e.fireEvent(l.c.SessionIdLoginFailed,{serverUrl:t.serverUrl})}catch(r){t.failure(n.responseText),e.fireEvent(l.c.SessionIdLoginFailed,{serverUrl:t.serverUrl})}else t.failure({Message:c.a.translate("Authentication failed")}),e.fireEvent(l.c.SessionIdLoginFailed,{serverUrl:t.serverUrl})}})}),(function(n){!n.Message&&n.Reason&&(n.Message=n.Reason),"function"==typeof t.failure&&t.failure(n),e.fireEvent(l.c.SessionIdLoginFailed,{serverUrl:t.serverUrl})}))}h.prototype.GetImagesInfo=h.prototype.getImagesInfo},function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return o}));n(1);var r=n(8);function i(t,e,n){var i=n||6371008.8,o=Object(r.j)(t[1]),a=Object(r.j)(e[1]),s=(a-o)/2,l=Object(r.j)(e[0]-t[0])/2,u=Math.sin(s)*Math.sin(s)+Math.sin(l)*Math.sin(l)*Math.cos(o)*Math.cos(a);return 2*i*Math.atan2(Math.sqrt(u),Math.sqrt(1-u))}function o(t,e,n,i){var o=i||6371008.8,a=Object(r.j)(t[1]),s=Object(r.j)(t[0]),l=e/o,u=Math.asin(Math.sin(a)*Math.cos(l)+Math.cos(a)*Math.sin(l)*Math.cos(n)),c=s+Math.atan2(Math.sin(n)*Math.sin(l)*Math.cos(a),Math.cos(l)-Math.sin(a)*Math.sin(u));return[Object(r.i)(c),Object(r.i)(u)]}},function(t,e,n){"use strict";n.d(e,"a",(function(){return a})),n.d(e,"b",(function(){return s}));var r=n(80),i=n(30),o=!1;function a(t,e,n,i,a,s,l){var u=new XMLHttpRequest;u.open("GET","function"==typeof t?t(n,i,a):t,!0),e.getType()==r.a.ARRAY_BUFFER&&(u.responseType="arraybuffer"),u.withCredentials=o,u.onload=function(t){if(!u.status||u.status>=200&&u.status<300){var i=e.getType(),o=void 0;i==r.a.JSON||i==r.a.TEXT?o=u.responseText:i==r.a.XML?(o=u.responseXML)||(o=(new DOMParser).parseFromString(u.responseText,"application/xml")):i==r.a.ARRAY_BUFFER&&(o=u.response),o?s(e.readFeatures(o,{extent:n,featureProjection:a}),e.readProjection(o)):l()}else l()},u.onerror=l,u.send()}function s(t,e){return function(n,r,o,s,l){var u=this;a(t,e,n,r,o,(function(t,e){u.addFeatures(t),void 0!==s&&s(t)}),l||i.c)}}},function(t,e,n){"use strict";var r,i=n(1),o=n(192),a=n(92),s=n(14),l=n(17),u=n(7),c=n(0),h=n(63),p=n(62),d=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),f=function(t){function e(e,n,r,i,o,a,l){var u=t.call(this)||this;return u.context_=e,u.pixelRatio_=n,u.extent_=r,u.transform_=i,u.viewRotation_=o,u.squaredTolerance_=a,u.userTransform_=l,u.contextFillState_=null,u.contextStrokeState_=null,u.contextTextState_=null,u.fillState_=null,u.strokeState_=null,u.image_=null,u.imageAnchorX_=0,u.imageAnchorY_=0,u.imageHeight_=0,u.imageOpacity_=0,u.imageOriginX_=0,u.imageOriginY_=0,u.imageRotateWithView_=!1,u.imageRotation_=0,u.imageScale_=[0,0],u.imageWidth_=0,u.text_="",u.textOffsetX_=0,u.textOffsetY_=0,u.textRotateWithView_=!1,u.textRotation_=0,u.textScale_=[0,0],u.textFillState_=null,u.textStrokeState_=null,u.textState_=null,u.pixelCoordinates_=[],u.tmpLocalTransform_=Object(s.c)(),u}return d(e,t),e.prototype.drawImages_=function(t,e,n,r){if(this.image_){var i=Object(h.c)(t,e,n,r,this.transform_,this.pixelCoordinates_),o=this.context_,a=this.tmpLocalTransform_,l=o.globalAlpha;1!=this.imageOpacity_&&(o.globalAlpha=l*this.imageOpacity_);var u=this.imageRotation_;this.imageRotateWithView_&&(u+=this.viewRotation_);for(var c=0,p=i.length;c<p;c+=2){var d=i[c]-this.imageAnchorX_,f=i[c+1]-this.imageAnchorY_;if(0!==u||1!=this.imageScale_[0]||1!=this.imageScale_[1]){var g=d+this.imageAnchorX_,y=f+this.imageAnchorY_;Object(s.b)(a,g,y,1,1,u,-g,-y),o.setTransform.apply(o,a),o.translate(g,y),o.scale(this.imageScale_[0],this.imageScale_[1]),o.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,-this.imageAnchorX_,-this.imageAnchorY_,this.imageWidth_,this.imageHeight_),o.setTransform(1,0,0,1,0,0)}else o.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,d,f,this.imageWidth_,this.imageHeight_)}1!=this.imageOpacity_&&(o.globalAlpha=l)}},e.prototype.drawText_=function(t,e,n,r){if(this.textState_&&""!==this.text_){this.textFillState_&&this.setContextFillState_(this.textFillState_),this.textStrokeState_&&this.setContextStrokeState_(this.textStrokeState_),this.setContextTextState_(this.textState_);var i=Object(h.c)(t,e,n,r,this.transform_,this.pixelCoordinates_),o=this.context_,a=this.textRotation_;for(this.textRotateWithView_&&(a+=this.viewRotation_);e<n;e+=r){var l=i[e]+this.textOffsetX_,u=i[e+1]+this.textOffsetY_;if(0!==a||1!=this.textScale_[0]||1!=this.textScale_[1]){var c=Object(s.b)(this.tmpLocalTransform_,l,u,1,1,a,-l,-u);o.setTransform.apply(o,c),o.translate(l,u),o.scale(this.textScale_[0],this.textScale_[1]),this.textStrokeState_&&o.strokeText(this.text_,0,0),this.textFillState_&&o.fillText(this.text_,0,0),o.setTransform(1,0,0,1,0,0)}else this.textStrokeState_&&o.strokeText(this.text_,l,u),this.textFillState_&&o.fillText(this.text_,l,u)}}},e.prototype.moveToLineTo_=function(t,e,n,r,i){var o=this.context_,a=Object(h.c)(t,e,n,r,this.transform_,this.pixelCoordinates_);o.moveTo(a[0],a[1]);var s=a.length;i&&(s-=2);for(var l=2;l<s;l+=2)o.lineTo(a[l],a[l+1]);return i&&o.closePath(),n},e.prototype.drawRings_=function(t,e,n,r){for(var i=0,o=n.length;i<o;++i)e=this.moveToLineTo_(t,e,n[i],r,!0);return e},e.prototype.drawCircle=function(t){if(Object(c.intersects)(this.extent_,t.getExtent())){if(this.fillState_||this.strokeState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var e=Object(p.c)(t,this.transform_,this.pixelCoordinates_),n=e[2]-e[0],r=e[3]-e[1],i=Math.sqrt(n*n+r*r),o=this.context_;o.beginPath(),o.arc(e[0],e[1],i,0,2*Math.PI),this.fillState_&&o.fill(),this.strokeState_&&o.stroke()}""!==this.text_&&this.drawText_(t.getCenter(),0,2,2)}},e.prototype.setStyle=function(t){this.setFillStrokeStyle(t.getFill(),t.getStroke()),this.setImageStyle(t.getImage()),this.setTextStyle(t.getText())},e.prototype.setTransform=function(t){this.transform_=t},e.prototype.drawGeometry=function(t){switch(t.getType()){case i.a.POINT:this.drawPoint(t);break;case i.a.LINE_STRING:this.drawLineString(t);break;case i.a.POLYGON:this.drawPolygon(t);break;case i.a.MULTI_POINT:this.drawMultiPoint(t);break;case i.a.MULTI_LINE_STRING:this.drawMultiLineString(t);break;case i.a.MULTI_POLYGON:this.drawMultiPolygon(t);break;case i.a.GEOMETRY_COLLECTION:this.drawGeometryCollection(t);break;case i.a.CIRCLE:this.drawCircle(t)}},e.prototype.drawFeature=function(t,e){var n=e.getGeometryFunction()(t);n&&Object(c.intersects)(this.extent_,n.getExtent())&&(this.setStyle(e),this.drawGeometry(n))},e.prototype.drawGeometryCollection=function(t){for(var e=t.getGeometriesArray(),n=0,r=e.length;n<r;++n)this.drawGeometry(e[n])},e.prototype.drawPoint=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getFlatCoordinates(),n=t.getStride();this.image_&&this.drawImages_(e,0,e.length,n),""!==this.text_&&this.drawText_(e,0,e.length,n)},e.prototype.drawMultiPoint=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getFlatCoordinates(),n=t.getStride();this.image_&&this.drawImages_(e,0,e.length,n),""!==this.text_&&this.drawText_(e,0,e.length,n)},e.prototype.drawLineString=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),Object(c.intersects)(this.extent_,t.getExtent())){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var e=this.context_,n=t.getFlatCoordinates();e.beginPath(),this.moveToLineTo_(n,0,n.length,t.getStride(),!1),e.stroke()}if(""!==this.text_){var r=t.getFlatMidpoint();this.drawText_(r,0,2,2)}}},e.prototype.drawMultiLineString=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getExtent();if(Object(c.intersects)(this.extent_,e)){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var n=this.context_,r=t.getFlatCoordinates(),i=0,o=t.getEnds(),a=t.getStride();n.beginPath();for(var s=0,l=o.length;s<l;++s)i=this.moveToLineTo_(r,i,o[s],a,!1);n.stroke()}if(""!==this.text_){var u=t.getFlatMidpoints();this.drawText_(u,0,u.length,2)}}},e.prototype.drawPolygon=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),Object(c.intersects)(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var e=this.context_;e.beginPath(),this.drawRings_(t.getOrientedFlatCoordinates(),0,t.getEnds(),t.getStride()),this.fillState_&&e.fill(),this.strokeState_&&e.stroke()}if(""!==this.text_){var n=t.getFlatInteriorPoint();this.drawText_(n,0,2,2)}}},e.prototype.drawMultiPolygon=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),Object(c.intersects)(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var e=this.context_,n=t.getOrientedFlatCoordinates(),r=0,i=t.getEndss(),o=t.getStride();e.beginPath();for(var a=0,s=i.length;a<s;++a){var l=i[a];r=this.drawRings_(n,r,l,o)}this.fillState_&&e.fill(),this.strokeState_&&e.stroke()}if(""!==this.text_){var u=t.getFlatInteriorPoints();this.drawText_(u,0,u.length,2)}}},e.prototype.setContextFillState_=function(t){var e=this.context_,n=this.contextFillState_;n?n.fillStyle!=t.fillStyle&&(n.fillStyle=t.fillStyle,e.fillStyle=t.fillStyle):(e.fillStyle=t.fillStyle,this.contextFillState_={fillStyle:t.fillStyle})},e.prototype.setContextStrokeState_=function(t){var e=this.context_,n=this.contextStrokeState_;n?(n.lineCap!=t.lineCap&&(n.lineCap=t.lineCap,e.lineCap=t.lineCap),e.setLineDash&&(Object(u.b)(n.lineDash,t.lineDash)||e.setLineDash(n.lineDash=t.lineDash),n.lineDashOffset!=t.lineDashOffset&&(n.lineDashOffset=t.lineDashOffset,e.lineDashOffset=t.lineDashOffset)),n.lineJoin!=t.lineJoin&&(n.lineJoin=t.lineJoin,e.lineJoin=t.lineJoin),n.lineWidth!=t.lineWidth&&(n.lineWidth=t.lineWidth,e.lineWidth=t.lineWidth),n.miterLimit!=t.miterLimit&&(n.miterLimit=t.miterLimit,e.miterLimit=t.miterLimit),n.strokeStyle!=t.strokeStyle&&(n.strokeStyle=t.strokeStyle,e.strokeStyle=t.strokeStyle)):(e.lineCap=t.lineCap,e.setLineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineJoin=t.lineJoin,e.lineWidth=t.lineWidth,e.miterLimit=t.miterLimit,e.strokeStyle=t.strokeStyle,this.contextStrokeState_={lineCap:t.lineCap,lineDash:t.lineDash,lineDashOffset:t.lineDashOffset,lineJoin:t.lineJoin,lineWidth:t.lineWidth,miterLimit:t.miterLimit,strokeStyle:t.strokeStyle})},e.prototype.setContextTextState_=function(t){var e=this.context_,n=this.contextTextState_,r=t.textAlign?t.textAlign:l.l;n?(n.font!=t.font&&(n.font=t.font,e.font=t.font),n.textAlign!=r&&(n.textAlign=r,e.textAlign=r),n.textBaseline!=t.textBaseline&&(n.textBaseline=t.textBaseline,e.textBaseline=t.textBaseline)):(e.font=t.font,e.textAlign=r,e.textBaseline=t.textBaseline,this.contextTextState_={font:t.font,textAlign:r,textBaseline:t.textBaseline})},e.prototype.setFillStrokeStyle=function(t,e){var n=this;if(t){var r=t.getColor();this.fillState_={fillStyle:Object(a.a)(r||l.b)}}else this.fillState_=null;if(e){var i=e.getColor(),o=e.getLineCap(),s=e.getLineDash(),u=e.getLineDashOffset(),c=e.getLineJoin(),h=e.getWidth(),p=e.getMiterLimit(),d=s||l.e;this.strokeState_={lineCap:void 0!==o?o:l.d,lineDash:1===this.pixelRatio_?d:d.map((function(t){return t*n.pixelRatio_})),lineDashOffset:(u||l.f)*this.pixelRatio_,lineJoin:void 0!==c?c:l.g,lineWidth:(void 0!==h?h:l.h)*this.pixelRatio_,miterLimit:void 0!==p?p:l.i,strokeStyle:Object(a.a)(i||l.k)}}else this.strokeState_=null},e.prototype.setImageStyle=function(t){var e;if(t&&(e=t.getSize())){var n=t.getAnchor(),r=t.getOrigin();this.image_=t.getImage(this.pixelRatio_),this.imageAnchorX_=n[0]*this.pixelRatio_,this.imageAnchorY_=n[1]*this.pixelRatio_,this.imageHeight_=e[1]*this.pixelRatio_,this.imageOpacity_=t.getOpacity(),this.imageOriginX_=r[0],this.imageOriginY_=r[1],this.imageRotateWithView_=t.getRotateWithView(),this.imageRotation_=t.getRotation(),this.imageScale_=t.getScaleArray(),this.imageWidth_=e[0]*this.pixelRatio_}else this.image_=null},e.prototype.setTextStyle=function(t){if(t){var e=t.getFill();if(e){var n=e.getColor();this.textFillState_={fillStyle:Object(a.a)(n||l.b)}}else this.textFillState_=null;var r=t.getStroke();if(r){var i=r.getColor(),o=r.getLineCap(),s=r.getLineDash(),u=r.getLineDashOffset(),c=r.getLineJoin(),h=r.getWidth(),p=r.getMiterLimit();this.textStrokeState_={lineCap:void 0!==o?o:l.d,lineDash:s||l.e,lineDashOffset:u||l.f,lineJoin:void 0!==c?c:l.g,lineWidth:void 0!==h?h:l.h,miterLimit:void 0!==p?p:l.i,strokeStyle:Object(a.a)(i||l.k)}}else this.textStrokeState_=null;var d=t.getFont(),f=t.getOffsetX(),g=t.getOffsetY(),y=t.getRotateWithView(),m=t.getRotation(),v=t.getScaleArray(),_=t.getText(),b=t.getTextAlign(),w=t.getTextBaseline();this.textState_={font:void 0!==d?d:l.c,textAlign:void 0!==b?b:l.l,textBaseline:void 0!==w?w:l.m},this.text_=void 0!==_?_:"",this.textOffsetX_=void 0!==f?this.pixelRatio_*f:0,this.textOffsetY_=void 0!==g?this.pixelRatio_*g:0,this.textRotateWithView_=void 0!==y&&y,this.textRotation_=void 0!==m?m:0,this.textScale_=[this.pixelRatio_*v[0],this.pixelRatio_*v[1]]}else this.text_=""},e}(o.a);e.a=f},function(t,e,n){"use strict";var r=n(1),i=n(14),o=n(0),a=n(7),s=n(139),l=n(2),u=n(124),c=n(200),h=n(63),p=Object(i.c)(),d=function(){function t(t,e,n,r,i){this.extent_,this.id_=i,this.type_=t,this.flatCoordinates_=e,this.flatInteriorPoints_=null,this.flatMidpoints_=null,this.ends_=n,this.properties_=r}return t.prototype.get=function(t){return this.properties_[t]},t.prototype.getExtent=function(){return this.extent_||(this.extent_=this.type_===r.a.POINT?Object(o.createOrUpdateFromCoordinate)(this.flatCoordinates_):Object(o.createOrUpdateFromFlatCoordinates)(this.flatCoordinates_,0,this.flatCoordinates_.length,2)),this.extent_},t.prototype.getFlatInteriorPoint=function(){if(!this.flatInteriorPoints_){var t=Object(o.getCenter)(this.getExtent());this.flatInteriorPoints_=Object(s.a)(this.flatCoordinates_,0,this.ends_,2,t,0)}return this.flatInteriorPoints_},t.prototype.getFlatInteriorPoints=function(){if(!this.flatInteriorPoints_){var t=Object(c.a)(this.flatCoordinates_,0,this.ends_,2);this.flatInteriorPoints_=Object(s.b)(this.flatCoordinates_,0,this.ends_,2,t)}return this.flatInteriorPoints_},t.prototype.getFlatMidpoint=function(){return this.flatMidpoints_||(this.flatMidpoints_=Object(u.a)(this.flatCoordinates_,0,this.flatCoordinates_.length,2,.5)),this.flatMidpoints_},t.prototype.getFlatMidpoints=function(){if(!this.flatMidpoints_){this.flatMidpoints_=[];for(var t=this.flatCoordinates_,e=0,n=this.ends_,r=0,i=n.length;r<i;++r){var o=n[r],s=Object(u.a)(t,e,o,2,.5);Object(a.c)(this.flatMidpoints_,s),e=o}}return this.flatMidpoints_},t.prototype.getId=function(){return this.id_},t.prototype.getOrientedFlatCoordinates=function(){return this.flatCoordinates_},t.prototype.getGeometry=function(){return this},t.prototype.getSimplifiedGeometry=function(t){return this},t.prototype.simplifyTransformed=function(t,e){return this},t.prototype.getProperties=function(){return this.properties_},t.prototype.getStride=function(){return 2},t.prototype.getStyleFunction=function(){},t.prototype.getType=function(){return this.type_},t.prototype.transform=function(t){var e=(t=Object(l.get)(t)).getExtent(),n=t.getWorldExtent();if(e&&n){var r=Object(o.getHeight)(n)/Object(o.getHeight)(e);Object(i.b)(p,n[0],n[3],r,-r,0,0,0),Object(h.c)(this.flatCoordinates_,0,this.flatCoordinates_.length,2,p,this.flatCoordinates_)}},t.prototype.getEnds=function(){return this.ends_},t}();d.prototype.getEndss=d.prototype.getEnds,d.prototype.getFlatCoordinates=d.prototype.getOrientedFlatCoordinates,e.a=d},function(t,e,n){"use strict";var r=n(60),i=n(56);function o(t){var e,n,r,o,s,l=Object(i.b)(t);if(2===l.length&&(e=l[0],n=l[1],e[0]!==n[0]||e[1]!==n[1]))return l;var u=[],c=l.length-1;u.push(l[0]);for(var h=1;h<c;h++)r=l[h-1],o=l[h],a(r,s=l[h+1],o)||u.push(o);return u.push(s),u}function a(t,e,n){var r=n[0],i=n[1],o=t[0],a=t[1],s=e[0],l=e[1],u=s-o,c=l-a;return 0===(r-o)*c-(i-a)*u&&(Math.abs(u)>=Math.abs(c)?u>0?o<=r&&r<=s:s<=r&&r<=o:c>0?a<=i&&i<=l:l<=i&&i<=a)}e.a=function(t,e){var n="object"==typeof e?e.mutate:e;if(!t)throw new Error("geojson is required");var a=Object(i.d)(t),s=[];switch(a){case"LineString":s=o(t);break;case"MultiLineString":case"Polygon":Object(i.b)(t).forEach((function(t){s.push(o(t))}));break;case"MultiPolygon":Object(i.b)(t).forEach((function(t){var e=[];t.forEach((function(t){e.push(o(t))})),s.push(e)}));break;case"Point":return t;case"MultiPoint":var l={};Object(i.b)(t).forEach((function(t){var e=t.join("-");l.hasOwnProperty(e)||(s.push(t),l[e]=!0)}));break;default:throw new Error(a+" geometry not supported")}return t.coordinates?!0===n?(t.coordinates=s,t):{type:a,coordinates:s}:!0===n?(t.geometry.coordinates=s,t):Object(r.a)({type:a,coordinates:s},t.properties,t.bbox,t.id)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return p}));var r=n(24),i=n.n(r),o=n(51),a=n.n(o),s=n(53),l=n.n(s),u=n(28),c=n.n(u);function h(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=c()(t);if(e){var i=c()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return l()(this,n)}}var p=function(t){a()(n,t);var e=h(n);function n(t){i()(this,n);var r=t||{},o=document.createElement("div");return o.className=(r.className||"ol-attr")+" ol-unselectable",o.innerHTML=r.html||"",e.call(this,{element:o,target:r.target})}return n}(n(47).a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var r=n(24),i=n.n(r),o=n(27),a=n.n(o),s=n(3),l=n(12),u=n.n(l),c=n(11),h=n(44);function p(t,e){var n=this;Object(s.m)(t,u()("div.pma-ui-loginprompt input[type=text]").val(),u()("div.pma-ui-loginprompt input[type=password]").val(),this.context.getCaller(),(function(t){for(var e=0;e<n.successCallbacks.length;e++)n.successCallbacks[e](t);n.active=!1,u()("div.pma-ui-loginprompt").remove()}),(function(t){if(!t.Message&&t.Reason&&(t.Message=t.Reason),e<2)u()("div.pma-ui-loginprompt .error").html(t.Message);else{n.active=!1;for(var r=0;r<n.failureCallbacks.length;r++)n.failureCallbacks[r](t);u()("div.pma-ui-loginprompt").remove()}}))}var d=function(){function t(e,n){i()(this,t),Object(h.b)()&&(this.context=e,this.context.registerAuthenticationProvider(this),this.active=!1,this.serverNameCallback=n)}return a()(t,[{key:"authenticate",value:function(t,e,n){if(this.active)"function"==typeof e&&this.successCallbacks.push(e),"function"==typeof n&&this.failureCallbacks.push(n);else{this.successCallbacks=[],this.failureCallbacks=[],"function"==typeof e&&this.successCallbacks.push(e),"function"==typeof n&&this.failureCallbacks.push(n),this.active=!0;var r=this,i=0,o=t;if("function"==typeof this.serverNameCallback){var a=this.serverNameCallback(t);a&&"string"==typeof a&&(o=a)}u()("body").append("<div class='pma-ui-loginprompt'><div class='login-panel'><div><label>"+o+"</label></div><div><input type='text' placeholder='"+c.a.translate("Username")+"' /></div><div><input type='password' placeholder='"+c.a.translate("Password")+"' /></div><div class='error'></div><div class='controls'><input type='button' class='accept' value='"+c.a.translate("OK")+"' /><input type='button' class='cancel' value='"+c.a.translate("Cancel")+"' /></div></div></div>"),u()("div.pma-ui-loginprompt input[type=text], div.pma-ui-loginprompt input[type=password]").keypress((function(e){13==e.which&&(e.preventDefault(),p.call(r,t,i++))})),u()("div.pma-ui-loginprompt input.accept").click((function(){p.call(r,t,i++)})),u()("div.pma-ui-loginprompt input.cancel").click((function(){r.active=!1;for(var t=0;t<r.failureCallbacks.length;t++)r.failureCallbacks[t]({Message:c.a.translate("Login cancelled")});u()("div.pma-ui-loginprompt").remove()}))}return!0}}]),t}()},function(t,e,n){"use strict";n.d(e,"b",(function(){return h}));var r,i=n(9),o=n(13),a=n(6),s=function(){function t(t,e){this.priorityFunction_=t,this.keyFunction_=e,this.elements_=[],this.priorities_=[],this.queuedElements_={}}return t.prototype.clear=function(){this.elements_.length=0,this.priorities_.length=0,Object(a.b)(this.queuedElements_)},t.prototype.dequeue=function(){var t=this.elements_,e=this.priorities_,n=t[0];1==t.length?(t.length=0,e.length=0):(t[0]=t.pop(),e[0]=e.pop(),this.siftUp_(0));var r=this.keyFunction_(n);return delete this.queuedElements_[r],n},t.prototype.enqueue=function(t){Object(o.a)(!(this.keyFunction_(t)in this.queuedElements_),31);var e=this.priorityFunction_(t);return e!=1/0&&(this.elements_.push(t),this.priorities_.push(e),this.queuedElements_[this.keyFunction_(t)]=!0,this.siftDown_(0,this.elements_.length-1),!0)},t.prototype.getCount=function(){return this.elements_.length},t.prototype.getLeftChildIndex_=function(t){return 2*t+1},t.prototype.getRightChildIndex_=function(t){return 2*t+2},t.prototype.getParentIndex_=function(t){return t-1>>1},t.prototype.heapify_=function(){var t;for(t=(this.elements_.length>>1)-1;t>=0;t--)this.siftUp_(t)},t.prototype.isEmpty=function(){return 0===this.elements_.length},t.prototype.isKeyQueued=function(t){return t in this.queuedElements_},t.prototype.isQueued=function(t){return this.isKeyQueued(this.keyFunction_(t))},t.prototype.siftUp_=function(t){for(var e=this.elements_,n=this.priorities_,r=e.length,i=e[t],o=n[t],a=t;t<r>>1;){var s=this.getLeftChildIndex_(t),l=this.getRightChildIndex_(t),u=l<r&&n[l]<n[s]?l:s;e[t]=e[u],n[t]=n[u],t=u}e[t]=i,n[t]=o,this.siftDown_(a,t)},t.prototype.siftDown_=function(t,e){for(var n=this.elements_,r=this.priorities_,i=n[e],o=r[e];e>t;){var a=this.getParentIndex_(e);if(!(r[a]>o))break;n[e]=n[a],r[e]=r[a],e=a}n[e]=i,r[e]=o},t.prototype.reprioritize=function(){var t,e,n,r=this.priorityFunction_,i=this.elements_,o=this.priorities_,a=0,s=i.length;for(e=0;e<s;++e)(n=r(t=i[e]))==1/0?delete this.queuedElements_[this.keyFunction_(t)]:(o[a]=n,i[a++]=t);i.length=a,o.length=a,this.heapify_()},t}(),l=n(15),u=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),c=function(t){function e(e,n){var r=t.call(this,(function(t){return e.apply(null,t)}),(function(t){return t[0].getKey()}))||this;return r.boundHandleTileChange_=r.handleTileChange.bind(r),r.tileChangeCallback_=n,r.tilesLoading_=0,r.tilesLoadingKeys_={},r}return u(e,t),e.prototype.enqueue=function(e){var n=t.prototype.enqueue.call(this,e);n&&e[0].addEventListener(i.a.CHANGE,this.boundHandleTileChange_);return n},e.prototype.getTilesLoading=function(){return this.tilesLoading_},e.prototype.handleTileChange=function(t){var e=t.target,n=e.getState();if(n===l.a.LOADED||n===l.a.ERROR||n===l.a.EMPTY){e.removeEventListener(i.a.CHANGE,this.boundHandleTileChange_);var r=e.getKey();r in this.tilesLoadingKeys_&&(delete this.tilesLoadingKeys_[r],--this.tilesLoading_),this.tileChangeCallback_()}},e.prototype.loadMoreTiles=function(t,e){for(var n,r,i=0;this.tilesLoading_<t&&i<e&&this.getCount()>0;)r=(n=this.dequeue()[0]).getKey(),n.getState()!==l.a.IDLE||r in this.tilesLoadingKeys_||(this.tilesLoadingKeys_[r]=!0,++this.tilesLoading_,++i,n.load())},e}(s);e.a=c;function h(t,e,n,r,i){if(!t||!(n in t.wantedTiles))return 1/0;if(!t.wantedTiles[n][e.getKey()])return 1/0;var o=t.viewState.center,a=r[0]-o[0],s=r[1]-o[1];return 65536*Math.log(i)+Math.sqrt(a*a+s*s)/i}},function(t,e,n){"use strict";n.d(e,"b",(function(){return f}));var r,i=n(98),o=n(9),a=n(23),s=n(88),l=n(25),u=n(162),c=n(101),h=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),p=null,d=function(t){function e(e,n,r,i,o,a){var s=t.call(this)||this;return s.hitDetectionImage_=null,s.image_=e||new Image,null!==i&&(s.image_.crossOrigin=i),s.canvas_={},s.color_=a,s.unlisten_=null,s.imageState_=o,s.size_=r,s.src_=n,s.tainted_,s}return h(e,t),e.prototype.isTainted_=function(){if(void 0===this.tainted_&&this.imageState_===a.a.LOADED){p||(p=Object(l.a)(1,1)),p.drawImage(this.image_,0,0);try{p.getImageData(0,0,1,1),this.tainted_=!1}catch(t){p=null,this.tainted_=!0}}return!0===this.tainted_},e.prototype.dispatchChangeEvent_=function(){this.dispatchEvent(o.a.CHANGE)},e.prototype.handleImageError_=function(){this.imageState_=a.a.ERROR,this.unlistenImage_(),this.dispatchChangeEvent_()},e.prototype.handleImageLoad_=function(){this.imageState_=a.a.LOADED,this.size_?(this.image_.width=this.size_[0],this.image_.height=this.size_[1]):this.size_=[this.image_.width,this.image_.height],this.unlistenImage_(),this.dispatchChangeEvent_()},e.prototype.getImage=function(t){return this.replaceColor_(t),this.canvas_[t]?this.canvas_[t]:this.image_},e.prototype.getPixelRatio=function(t){return this.replaceColor_(t),this.canvas_[t]?t:1},e.prototype.getImageState=function(){return this.imageState_},e.prototype.getHitDetectionImage=function(){if(!this.hitDetectionImage_)if(this.isTainted_()){var t=this.size_[0],e=this.size_[1],n=Object(l.a)(t,e);n.fillRect(0,0,t,e),this.hitDetectionImage_=n.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_},e.prototype.getSize=function(){return this.size_},e.prototype.getSrc=function(){return this.src_},e.prototype.load=function(){if(this.imageState_==a.a.IDLE){this.imageState_=a.a.LOADING;try{this.image_.src=this.src_}catch(t){this.handleImageError_()}this.unlisten_=Object(c.b)(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this))}},e.prototype.replaceColor_=function(t){if(this.color_&&!this.canvas_[t]){var e=document.createElement("canvas");this.canvas_[t]=e,e.width=Math.ceil(this.image_.width*t),e.height=Math.ceil(this.image_.height*t);var n=e.getContext("2d");if(n.scale(t,t),n.drawImage(this.image_,0,0),n.globalCompositeOperation="multiply","multiply"===n.globalCompositeOperation||this.isTainted_())n.fillStyle=Object(s.b)(this.color_),n.fillRect(0,0,e.width/t,e.height/t),n.globalCompositeOperation="destination-in",n.drawImage(this.image_,0,0);else{for(var r=n.getImageData(0,0,e.width,e.height),i=r.data,o=this.color_[0]/255,a=this.color_[1]/255,l=this.color_[2]/255,u=this.color_[3],c=0,h=i.length;c<h;c+=4)i[c]*=o,i[c+1]*=a,i[c+2]*=l,i[c+3]*=u;n.putImageData(r,0,0)}}},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(i.a);function f(t,e,n,r,i,o){var a=u.a.get(e,r,o);return a||(a=new d(t,e,n,r,i,o),u.a.set(e,r,o,a)),a}e.a=d},function(t,e,n){"use strict";var r,i=n(197),o=n(37),a=n(49),s=n(9),l=n(91),u=n(39),c=n(13),h=n(6),p=n(0),d=n(4),f=n(10),g=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),y="layers",m=function(t){function e(e){var n=this,r=e||{},i=Object(h.a)({},r);delete i.layers;var a=r.layers;return(n=t.call(this,i)||this).layersListenerKeys_=[],n.listenerKeys_={},n.addChangeListener(y,n.handleLayersChanged_),a?Array.isArray(a)?a=new o.a(a.slice(),{unique:!0}):Object(c.a)("function"==typeof a.getArray,43):a=new o.a(void 0,{unique:!0}),n.setLayers(a),n}return g(e,t),e.prototype.handleLayerChange_=function(){this.changed()},e.prototype.handleLayersChanged_=function(){this.layersListenerKeys_.forEach(f.unlistenByKey),this.layersListenerKeys_.length=0;var t=this.getLayers();for(var e in this.layersListenerKeys_.push(Object(f.listen)(t,a.a.ADD,this.handleLayersAdd_,this),Object(f.listen)(t,a.a.REMOVE,this.handleLayersRemove_,this)),this.listenerKeys_)this.listenerKeys_[e].forEach(f.unlistenByKey);Object(h.b)(this.listenerKeys_);for(var n=t.getArray(),r=0,i=n.length;r<i;r++){var o=n[r];this.listenerKeys_[Object(d.c)(o)]=[Object(f.listen)(o,l.a.PROPERTYCHANGE,this.handleLayerChange_,this),Object(f.listen)(o,s.a.CHANGE,this.handleLayerChange_,this)]}this.changed()},e.prototype.handleLayersAdd_=function(t){var e=t.element;this.listenerKeys_[Object(d.c)(e)]=[Object(f.listen)(e,l.a.PROPERTYCHANGE,this.handleLayerChange_,this),Object(f.listen)(e,s.a.CHANGE,this.handleLayerChange_,this)],this.changed()},e.prototype.handleLayersRemove_=function(t){var e=t.element,n=Object(d.c)(e);this.listenerKeys_[n].forEach(f.unlistenByKey),delete this.listenerKeys_[n],this.changed()},e.prototype.getLayers=function(){return this.get(y)},e.prototype.setLayers=function(t){this.set(y,t)},e.prototype.getLayersArray=function(t){var e=void 0!==t?t:[];return this.getLayers().forEach((function(t){t.getLayersArray(e)})),e},e.prototype.getLayerStatesArray=function(t){var e=void 0!==t?t:[],n=e.length;this.getLayers().forEach((function(t){t.getLayerStatesArray(e)}));var r=this.getLayerState(),i=r.zIndex;t||void 0!==r.zIndex||(i=0);for(var o=n,a=e.length;o<a;o++){var s=e[o];s.opacity*=r.opacity,s.visible=s.visible&&r.visible,s.maxResolution=Math.min(s.maxResolution,r.maxResolution),s.minResolution=Math.max(s.minResolution,r.minResolution),s.minZoom=Math.max(s.minZoom,r.minZoom),s.maxZoom=Math.min(s.maxZoom,r.maxZoom),void 0!==r.extent&&(void 0!==s.extent?s.extent=Object(p.getIntersection)(s.extent,r.extent):s.extent=r.extent),void 0===s.zIndex&&(s.zIndex=i)}return e},e.prototype.getSourceState=function(){return u.a.READY},e}(i.a);e.a=m},function(t,e,n){"use strict";var r,i=n(38),o=n(30),a=n(20),s=n(74),l=n(21),u=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),c=function(t){function e(e){var n=t.call(this,{stopDown:o.a})||this,r=e||{};n.kinetic_=r.kinetic,n.lastCentroid=null,n.lastPointersCount_,n.panning_=!1;var i=r.condition?r.condition:Object(a.a)(a.j,a.l);return n.condition_=r.onFocusOnly?Object(a.a)(a.f,i):i,n.noKinetic_=!1,n}return u(e,t),e.prototype.handleDragEvent=function(t){this.panning_||(this.panning_=!0,this.getMap().getView().beginInteraction());var e=this.targetPointers,n=Object(i.a)(e);if(e.length==this.lastPointersCount_){if(this.kinetic_&&this.kinetic_.update(n[0],n[1]),this.lastCentroid){var r=[this.lastCentroid[0]-n[0],n[1]-this.lastCentroid[1]],o=t.map.getView();Object(l.i)(r,o.getResolution()),Object(l.h)(r,o.getRotation()),o.adjustCenterInternal(r)}}else this.kinetic_&&this.kinetic_.begin();this.lastCentroid=n,this.lastPointersCount_=e.length,t.originalEvent.preventDefault()},e.prototype.handleUpEvent=function(t){var e=t.map,n=e.getView();if(0===this.targetPointers.length){if(!this.noKinetic_&&this.kinetic_&&this.kinetic_.end()){var r=this.kinetic_.getDistance(),i=this.kinetic_.getAngle(),o=n.getCenterInternal(),a=e.getPixelFromCoordinateInternal(o),l=e.getCoordinateFromPixelInternal([a[0]-r*Math.cos(i),a[1]-r*Math.sin(i)]);n.animateInternal({center:n.getConstrainedCenter(l),duration:500,easing:s.b})}return this.panning_&&(this.panning_=!1,n.endInteraction()),!1}return this.kinetic_&&this.kinetic_.begin(),this.lastCentroid=null,!0},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>0&&this.condition_(t)){var e=t.map.getView();return this.lastCentroid=null,e.getAnimating()&&e.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}return!1},e}(i.b);e.a=c},function(t,e,n){"use strict";var r,i=n(37),o=n(40),a=n(141),s=n(38),l=n(30),u=n(20),c=n(7),h=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),p="translatestart",d="translating",f="translateend",g=function(t){function e(e,n,r,i,o){var a=t.call(this,e)||this;return a.features=n,a.coordinate=r,a.startCoordinate=i,a.mapBrowserEvent=o,a}return h(e,t),e}(o.a),y=function(t){function e(e){var n,r=this,i=e||{};if((r=t.call(this,i)||this).on,r.once,r.un,r.lastCoordinate_=null,r.startCoordinate_=null,r.features_=void 0!==i.features?i.features:null,i.layers)if("function"==typeof i.layers)n=i.layers;else{var o=i.layers;n=function(t){return Object(c.f)(o,t)}}else n=l.b;return r.layerFilter_=n,r.filter_=i.filter?i.filter:l.b,r.hitTolerance_=i.hitTolerance?i.hitTolerance:0,r.condition_=i.condition?i.condition:u.d,r.lastFeature_=null,r.addChangeListener(a.a.ACTIVE,r.handleActiveChanged_),r}return h(e,t),e.prototype.handleDownEvent=function(t){if(!t.originalEvent||!this.condition_(t))return!1;if(this.lastFeature_=this.featuresAtPixel_(t.pixel,t.map),!this.lastCoordinate_&&this.lastFeature_){this.startCoordinate_=t.coordinate,this.lastCoordinate_=t.coordinate,this.handleMoveEvent(t);var e=this.features_||new i.a([this.lastFeature_]);return this.dispatchEvent(new g(p,e,t.coordinate,this.startCoordinate_,t)),!0}return!1},e.prototype.handleUpEvent=function(t){if(this.lastCoordinate_){this.lastCoordinate_=null,this.handleMoveEvent(t);var e=this.features_||new i.a([this.lastFeature_]);return this.dispatchEvent(new g(f,e,t.coordinate,this.startCoordinate_,t)),this.startCoordinate_=null,!0}return!1},e.prototype.handleDragEvent=function(t){if(this.lastCoordinate_){var e=t.coordinate,n=e[0]-this.lastCoordinate_[0],r=e[1]-this.lastCoordinate_[1],o=this.features_||new i.a([this.lastFeature_]);o.forEach((function(t){var e=t.getGeometry();e.translate(n,r),t.setGeometry(e)})),this.lastCoordinate_=e,this.dispatchEvent(new g(d,o,e,this.startCoordinate_,t))}},e.prototype.handleMoveEvent=function(t){var e=t.map.getViewport();this.featuresAtPixel_(t.pixel,t.map)?(e.classList.remove(this.lastCoordinate_?"ol-grab":"ol-grabbing"),e.classList.add(this.lastCoordinate_?"ol-grabbing":"ol-grab")):e.classList.remove("ol-grab","ol-grabbing")},e.prototype.featuresAtPixel_=function(t,e){return e.forEachFeatureAtPixel(t,function(t,e){if(this.filter_(t,e)&&(!this.features_||Object(c.f)(this.features_.getArray(),t)))return t}.bind(this),{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_})},e.prototype.getHitTolerance=function(){return this.hitTolerance_},e.prototype.setHitTolerance=function(t){this.hitTolerance_=t},e.prototype.setMap=function(e){var n=this.getMap();t.prototype.setMap.call(this,e),this.updateState_(n)},e.prototype.handleActiveChanged_=function(){this.updateState_(null)},e.prototype.updateState_=function(t){var e=this.getMap(),n=this.getActive();e&&n||(e=e||t)&&e.getViewport().classList.remove("ol-grab","ol-grabbing")},e}(s.b);e.a=y},function(t,e,n){"use strict";n.r(e),n.d(e,"EsriJSON",(function(){return L})),n.d(e,"GeoJSON",(function(){return P.a})),n.d(e,"GML",(function(){return Mt})),n.d(e,"GPX",(function(){return we})),n.d(e,"IGC",(function(){return Re})),n.d(e,"IIIFInfo",(function(){return Me.b})),n.d(e,"KML",(function(){return Fr})),n.d(e,"MVT",(function(){return Dr.a})),n.d(e,"OWS",(function(){return ii})),n.d(e,"Polyline",(function(){return ci})),n.d(e,"TopoJSON",(function(){return _i})),n.d(e,"WFS",(function(){return Xo})),n.d(e,"WKT",(function(){return Wo.a})),n.d(e,"WMSCapabilities",(function(){return _a})),n.d(e,"WMSGetFeatureInfo",(function(){return wa})),n.d(e,"WMTSCapabilities",(function(){return Ga}));var r,i=n(26),o=n(16),a=n(1),s=n(156),l=n(43),u=n(114),c=n(58),h=n(69),p=n(68),d=n(31),f=n(22),g=n(13),y=n(6),m=n(0),v=n(77),_=n(2),b=n(105),w=n(33),x=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),E={};E[a.a.POINT]=function(t){var e;e=void 0!==t.m&&void 0!==t.z?new d.a([t.x,t.y,t.z,t.m],o.a.XYZM):void 0!==t.z?new d.a([t.x,t.y,t.z],o.a.XYZ):void 0!==t.m?new d.a([t.x,t.y,t.m],o.a.XYM):new d.a([t.x,t.y]);return e},E[a.a.LINE_STRING]=function(t){var e=C(t);return new l.a(t.paths[0],e)},E[a.a.POLYGON]=function(t){var e=C(t);return new f.a(t.rings,e)},E[a.a.MULTI_POINT]=function(t){var e=C(t);return new h.a(t.points,e)},E[a.a.MULTI_LINE_STRING]=function(t){var e=C(t);return new c.a(t.paths,e)},E[a.a.MULTI_POLYGON]=function(t){var e=C(t);return new p.a(t.rings,e)};var S={};function O(t,e){var n,r,i;if(!t)return null;if("number"==typeof t.x&&"number"==typeof t.y)i=a.a.POINT;else if(t.points)i=a.a.MULTI_POINT;else if(t.paths){i=1===t.paths.length?a.a.LINE_STRING:a.a.MULTI_LINE_STRING}else if(t.rings){var o=t,s=C(o),l=function(t,e){var n,r,i=[],o=[],a=[];for(n=0,r=t.length;n<r;++n){i.length=0,Object(v.b)(i,0,t[n],e.length),Object(b.a)(i,0,i.length,e.length)?o.push([t[n]]):a.push(t[n])}for(;a.length;){var s=a.shift(),l=!1;for(n=o.length-1;n>=0;n--){var c=o[n][0];if(Object(m.containsExtent)(new u.a(c).getExtent(),new u.a(s).getExtent())){o[n].push(s),l=!0;break}}l||o.push([s.reverse()])}return o}(o.rings,s);1===l.length?(i=a.a.POLYGON,t=Object(y.a)({},t,((n={}).rings=l[0],n))):(i=a.a.MULTI_POLYGON,t=Object(y.a)({},t,((r={}).rings=l,r)))}var c=E[i];return Object(w.c)(c(t),!1,e)}function C(t){var e=o.a.XY;return!0===t.hasZ&&!0===t.hasM?e=o.a.XYZM:!0===t.hasZ?e=o.a.XYZ:!0===t.hasM&&(e=o.a.XYM),e}function T(t){var e=t.getLayout();return{hasZ:e===o.a.XYZ||e===o.a.XYZM,hasM:e===o.a.XYM||e===o.a.XYZM}}function I(t,e){return(0,S[t.getType()])(Object(w.c)(t,!0,e),e)}S[a.a.POINT]=function(t,e){var n,r=t.getCoordinates(),i=t.getLayout();i===o.a.XYZ?n={x:r[0],y:r[1],z:r[2]}:i===o.a.XYM?n={x:r[0],y:r[1],m:r[2]}:i===o.a.XYZM?n={x:r[0],y:r[1],z:r[2],m:r[3]}:i===o.a.XY?n={x:r[0],y:r[1]}:Object(g.a)(!1,34);return n},S[a.a.LINE_STRING]=function(t,e){var n=T(t);return{hasZ:n.hasZ,hasM:n.hasM,paths:[t.getCoordinates()]}},S[a.a.POLYGON]=function(t,e){var n=T(t);return{hasZ:n.hasZ,hasM:n.hasM,rings:t.getCoordinates(!1)}},S[a.a.MULTI_POINT]=function(t,e){var n=T(t);return{hasZ:n.hasZ,hasM:n.hasM,points:t.getCoordinates()}},S[a.a.MULTI_LINE_STRING]=function(t,e){var n=T(t);return{hasZ:n.hasZ,hasM:n.hasM,paths:t.getCoordinates()}},S[a.a.MULTI_POLYGON]=function(t,e){for(var n=T(t),r=t.getCoordinates(!1),i=[],o=0;o<r.length;o++)for(var a=r[o].length-1;a>=0;a--)i.push(r[o][a]);return{hasZ:n.hasZ,hasM:n.hasM,rings:i}};var L=function(t){function e(e){var n=this,r=e||{};return(n=t.call(this)||this).geometryName_=r.geometryName,n}return x(e,t),e.prototype.readFeatureFromObject=function(t,e,n){var r=t,o=O(r.geometry,e),a=new i.a;if(this.geometryName_&&a.setGeometryName(this.geometryName_),a.setGeometry(o),r.attributes){a.setProperties(r.attributes,!0);var s=r.attributes[n];void 0!==s&&a.setId(s)}return a},e.prototype.readFeaturesFromObject=function(t,e){var n=e||{};if(t.features){for(var r=[],i=t.features,o=0,a=i.length;o<a;++o)r.push(this.readFeatureFromObject(i[o],n,t.objectIdFieldName));return r}return[this.readFeatureFromObject(t,n)]},e.prototype.readGeometryFromObject=function(t,e){return O(t,e)},e.prototype.readProjectionFromObject=function(t){if(t.spatialReference&&void 0!==t.spatialReference.wkid){var e=t.spatialReference.wkid;return Object(_.get)("EPSG:"+e)}return null},e.prototype.writeGeometryObject=function(t,e){return I(t,this.adaptOptions(e))},e.prototype.writeFeatureObject=function(t,e){e=this.adaptOptions(e);var n={};if(!t.hasProperties())return n.attributes={},n;var r=t.getProperties(),i=t.getGeometry();if(i){n.geometry=I(i,e);var o=e&&(e.dataProjection||e.featureProjection);o&&(n.geometry.spatialReference={wkid:Number(Object(_.get)(o).getCode().split(":").pop())}),delete r[t.getGeometryName()]}return Object(y.d)(r)?n.attributes={}:n.attributes=r,n},e.prototype.writeFeaturesObject=function(t,e){e=this.adaptOptions(e);for(var n=[],r=0,i=t.length;r<i;++r)n.push(this.writeFeatureObject(t[r],e));return{features:n}},e}(s.a),P=n(148),R=n(80),M=n(4),N=n(7),j="http://www.w3.org/2001/XMLSchema-instance";function A(t,e){return nt().createElementNS(t,e)}function k(t,e){return function t(e,n,r){if(e.nodeType==Node.CDATA_SECTION_NODE||e.nodeType==Node.TEXT_NODE)n?r.push(String(e.nodeValue).replace(/(\r\n|\r|\n)/g,"")):r.push(e.nodeValue);else{var i=void 0;for(i=e.firstChild;i;i=i.nextSibling)t(i,n,r)}return r}(t,e,[]).join("")}function F(t){return"documentElement"in t}function D(t){return(new DOMParser).parseFromString(t,"application/xml")}function G(t,e){return function(n,r){var i=t.call(void 0!==e?e:this,n,r);if(void 0!==i){var o=r[r.length-1];Object(N.c)(o,i)}}}function z(t,e){return function(n,r){var i=t.call(void 0!==e?e:this,n,r);void 0!==i&&r[r.length-1].push(i)}}function U(t,e){return function(n,r){var i=t.call(void 0!==e?e:this,n,r);void 0!==i&&(r[r.length-1]=i)}}function B(t,e,n){return function(r,i){var o=t.call(void 0!==n?n:this,r,i);if(void 0!==o){var a=i[i.length-1],s=void 0!==e?e:r.localName,l=void 0;s in a?l=a[s]:(l=[],a[s]=l),l.push(o)}}}function V(t,e,n){return function(r,i){var o=t.call(void 0!==n?n:this,r,i);void 0!==o&&(i[i.length-1][void 0!==e?e:r.localName]=o)}}function q(t,e){return function(n,r,i){t.call(void 0!==e?e:this,n,r,i),i[i.length-1].node.appendChild(n)}}function Y(t,e){var n,r;return function(e,i,o){if(void 0===n){n={};var a={};a[e.localName]=t,n[e.namespaceURI]=a,r=X(e.localName)}J(n,r,i,o)}}function X(t,e){var n=t;return function(t,r,i){var o=r[r.length-1].node,a=n;return void 0===a&&(a=i),A(void 0!==e?e:o.namespaceURI,a)}}var W=X();function H(t,e){for(var n=e.length,r=new Array(n),i=0;i<n;++i)r[i]=t[e[i]];return r}function K(t,e,n){var r,i,o=void 0!==n?n:{};for(r=0,i=t.length;r<i;++r)o[t[r]]=e;return o}function Z(t,e,n,r){var i;for(i=e.firstElementChild;i;i=i.nextElementSibling){var o=t[i.namespaceURI];if(void 0!==o){var a=o[i.localName];void 0!==a&&a.call(r,i,n)}}}function $(t,e,n,r,i){return r.push(t),Z(e,n,r,i),r.pop()}function J(t,e,n,r,i,o){for(var a,s,l=(void 0!==i?i:n).length,u=0;u<l;++u)void 0!==(a=n[u])&&void 0!==(s=e.call(void 0!==o?o:this,a,r,void 0!==i?i[u]:void 0))&&t[s.namespaceURI][s.localName].call(o,s,a,r)}function Q(t,e,n,r,i,o,a){return i.push(t),J(e,n,r,i,o,a),i.pop()}var tt=void 0;var et=void 0;function nt(){return void 0===et&&"undefined"!=typeof document&&(et=document.implementation.createDocument("","",null)),et}var rt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),it=function(t){function e(){var e=t.call(this)||this;return e.xmlSerializer_=(void 0===tt&&"undefined"!=typeof XMLSerializer&&(tt=new XMLSerializer),tt),e}return rt(e,t),e.prototype.getType=function(){return R.a.XML},e.prototype.readFeature=function(t,e){if(t){if("string"==typeof t){var n=D(t);return this.readFeatureFromDocument(n,e)}return F(t)?this.readFeatureFromDocument(t,e):this.readFeatureFromNode(t,e)}return null},e.prototype.readFeatureFromDocument=function(t,e){var n=this.readFeaturesFromDocument(t,e);return n.length>0?n[0]:null},e.prototype.readFeatureFromNode=function(t,e){return null},e.prototype.readFeatures=function(t,e){if(t){if("string"==typeof t){var n=D(t);return this.readFeaturesFromDocument(n,e)}return F(t)?this.readFeaturesFromDocument(t,e):this.readFeaturesFromNode(t,e)}return[]},e.prototype.readFeaturesFromDocument=function(t,e){for(var n=[],r=t.firstChild;r;r=r.nextSibling)r.nodeType==Node.ELEMENT_NODE&&Object(N.c)(n,this.readFeaturesFromNode(r,e));return n},e.prototype.readFeaturesFromNode=function(t,e){return Object(M.b)()},e.prototype.readGeometry=function(t,e){if(t){if("string"==typeof t){var n=D(t);return this.readGeometryFromDocument(n,e)}return F(t)?this.readGeometryFromDocument(t,e):this.readGeometryFromNode(t,e)}return null},e.prototype.readGeometryFromDocument=function(t,e){return null},e.prototype.readGeometryFromNode=function(t,e){return null},e.prototype.readProjection=function(t){if(t){if("string"==typeof t){var e=D(t);return this.readProjectionFromDocument(e)}return F(t)?this.readProjectionFromDocument(t):this.readProjectionFromNode(t)}return null},e.prototype.readProjectionFromDocument=function(t){return this.dataProjection},e.prototype.readProjectionFromNode=function(t){return this.dataProjection},e.prototype.writeFeature=function(t,e){var n=this.writeFeatureNode(t,e);return this.xmlSerializer_.serializeToString(n)},e.prototype.writeFeatureNode=function(t,e){return null},e.prototype.writeFeatures=function(t,e){var n=this.writeFeaturesNode(t,e);return this.xmlSerializer_.serializeToString(n)},e.prototype.writeFeaturesNode=function(t,e){return null},e.prototype.writeGeometry=function(t,e){var n=this.writeGeometryNode(t,e);return this.xmlSerializer_.serializeToString(n)},e.prototype.writeGeometryNode=function(t,e){return null},e}(w.a),ot=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),at="http://www.opengis.net/gml",st=/^[\s\xa0]*$/,lt=function(t){function e(e){var n=t.call(this)||this,r=e||{};return n.featureType=r.featureType,n.featureNS=r.featureNS,n.srsName=r.srsName,n.schemaLocation="",n.FEATURE_COLLECTION_PARSERS={},n.FEATURE_COLLECTION_PARSERS[n.namespace]={featureMember:z(n.readFeaturesInternal),featureMembers:U(n.readFeaturesInternal)},n}return ot(e,t),e.prototype.readFeaturesInternal=function(t,e){var n=t.localName,r=null;if("FeatureCollection"==n)r=$([],this.FEATURE_COLLECTION_PARSERS,t,e,this);else if("featureMembers"==n||"featureMember"==n||"member"==n){var i=e[0],o=i.featureType,a=i.featureNS;if(!o&&t.childNodes){o=[],a={};for(var s=0,l=t.childNodes.length;s<l;++s){var u=t.childNodes[s];if(1===u.nodeType){var c=u.nodeName.split(":").pop();if(-1===o.indexOf(c)){var h="",p=0,d=u.namespaceURI;for(var f in a){if(a[f]===d){h=f;break}++p}h||(a[h="p"+p]=d),o.push(h+":"+c)}}}"featureMember"!=n&&(i.featureType=o,i.featureNS=a)}if("string"==typeof a){var g=a;(a={}).p0=g}var y={},m=Array.isArray(o)?o:[o];for(var v in a){var _={};for(s=0,l=m.length;s<l;++s){(-1===m[s].indexOf(":")?"p0":m[s].split(":")[0])===v&&(_[m[s].split(":").pop()]="featureMembers"==n?z(this.readFeatureElement,this):U(this.readFeatureElement,this))}y[a[v]]=_}r=$("featureMember"==n||"member"==n?void 0:[],y,t,e)}return null===r&&(r=[]),r},e.prototype.readGeometryElement=function(t,e){var n=e[0];n.srsName=t.firstElementChild.getAttribute("srsName"),n.srsDimension=t.firstElementChild.getAttribute("srsDimension");var r=$(null,this.GEOMETRY_PARSERS,t,e,this);return r?Array.isArray(r)?Object(w.b)(r,n):Object(w.c)(r,!1,n):void 0},e.prototype.readFeatureElementInternal=function(t,e,n){for(var r,o={},a=t.firstElementChild;a;a=a.nextElementSibling){var s=void 0,l=a.localName;0===a.childNodes.length||1===a.childNodes.length&&(3===a.firstChild.nodeType||4===a.firstChild.nodeType)?(s=k(a,!1),st.test(s)&&(s=void 0)):(n&&(s=this.readGeometryElement(a,e)),s?"boundedBy"!==l&&(r=l):s=this.readFeatureElementInternal(a,e,!1)),o[l]?(o[l]instanceof Array||(o[l]=[o[l]]),o[l].push(s)):o[l]=s;var u=a.attributes.length;if(u>0){o[l]={_content_:o[l]};for(var c=0;c<u;c++){var h=a.attributes[c].name;o[l][h]=a.attributes[c].value}}}if(n){var p=new i.a(o);r&&p.setGeometryName(r);var d=t.getAttribute("fid")||function(t,e,n){return t.getAttributeNS(e,n)||""}(t,this.namespace,"id");return d&&p.setId(d),p}return o},e.prototype.readFeatureElement=function(t,e){return this.readFeatureElementInternal(t,e,!0)},e.prototype.readPoint=function(t,e){var n=this.readFlatCoordinatesFromNode(t,e);if(n)return new d.a(n,o.a.XYZ)},e.prototype.readMultiPoint=function(t,e){var n=$([],this.MULTIPOINT_PARSERS,t,e,this);return n?new h.a(n):void 0},e.prototype.readMultiLineString=function(t,e){var n=$([],this.MULTILINESTRING_PARSERS,t,e,this);if(n)return new c.a(n)},e.prototype.readMultiPolygon=function(t,e){var n=$([],this.MULTIPOLYGON_PARSERS,t,e,this);if(n)return new p.a(n)},e.prototype.pointMemberParser=function(t,e){Z(this.POINTMEMBER_PARSERS,t,e,this)},e.prototype.lineStringMemberParser=function(t,e){Z(this.LINESTRINGMEMBER_PARSERS,t,e,this)},e.prototype.polygonMemberParser=function(t,e){Z(this.POLYGONMEMBER_PARSERS,t,e,this)},e.prototype.readLineString=function(t,e){var n=this.readFlatCoordinatesFromNode(t,e);return n?new l.a(n,o.a.XYZ):void 0},e.prototype.readFlatLinearRing=function(t,e){var n=$(null,this.GEOMETRY_FLAT_COORDINATES_PARSERS,t,e,this);return n||void 0},e.prototype.readLinearRing=function(t,e){var n=this.readFlatCoordinatesFromNode(t,e);if(n)return new u.a(n,o.a.XYZ)},e.prototype.readPolygon=function(t,e){var n=$([null],this.FLAT_LINEAR_RINGS_PARSERS,t,e,this);if(n&&n[0]){var r,i=n[0],a=[i.length],s=void 0;for(s=1,r=n.length;s<r;++s)Object(N.c)(i,n[s]),a.push(i.length);return new f.a(i,o.a.XYZ,a)}},e.prototype.readFlatCoordinatesFromNode=function(t,e){return $(null,this.GEOMETRY_FLAT_COORDINATES_PARSERS,t,e,this)},e.prototype.readGeometryFromNode=function(t,e){var n=this.readGeometryElement(t,[this.getReadOptions(t,e||{})]);return n||null},e.prototype.readFeaturesFromNode=function(t,e){var n={featureType:this.featureType,featureNS:this.featureNS};return e&&Object(y.a)(n,this.getReadOptions(t,e)),this.readFeaturesInternal(t,[n])||[]},e.prototype.readProjectionFromNode=function(t){return Object(_.get)(this.srsName?this.srsName:t.firstElementChild.getAttribute("srsName"))},e}(it);lt.prototype.namespace=at,lt.prototype.FLAT_LINEAR_RINGS_PARSERS={"http://www.opengis.net/gml":{}},lt.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS={"http://www.opengis.net/gml":{}},lt.prototype.GEOMETRY_PARSERS={"http://www.opengis.net/gml":{}},lt.prototype.MULTIPOINT_PARSERS={"http://www.opengis.net/gml":{pointMember:z(lt.prototype.pointMemberParser),pointMembers:z(lt.prototype.pointMemberParser)}},lt.prototype.MULTILINESTRING_PARSERS={"http://www.opengis.net/gml":{lineStringMember:z(lt.prototype.lineStringMemberParser),lineStringMembers:z(lt.prototype.lineStringMemberParser)}},lt.prototype.MULTIPOLYGON_PARSERS={"http://www.opengis.net/gml":{polygonMember:z(lt.prototype.polygonMemberParser),polygonMembers:z(lt.prototype.polygonMemberParser)}},lt.prototype.POINTMEMBER_PARSERS={"http://www.opengis.net/gml":{Point:z(lt.prototype.readFlatCoordinatesFromNode)}},lt.prototype.LINESTRINGMEMBER_PARSERS={"http://www.opengis.net/gml":{LineString:z(lt.prototype.readLineString)}},lt.prototype.POLYGONMEMBER_PARSERS={"http://www.opengis.net/gml":{Polygon:z(lt.prototype.readPolygon)}},lt.prototype.RING_PARSERS={"http://www.opengis.net/gml":{LinearRing:U(lt.prototype.readFlatLinearRing)}};var ut=lt,ct=n(96);function ht(t){return pt(k(t,!1))}function pt(t){var e=/^\s*(true|1)|(false|0)\s*$/.exec(t);return e?void 0!==e[1]||!1:void 0}function dt(t){var e=k(t,!1),n=Date.parse(e);return isNaN(n)?void 0:n/1e3}function ft(t){return gt(k(t,!1))}function gt(t){var e=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)\s*$/i.exec(t);return e?parseFloat(e[1]):void 0}function yt(t){return mt(k(t,!1))}function mt(t){var e=/^\s*(\d+)\s*$/.exec(t);return e?parseInt(e[1],10):void 0}function vt(t){return k(t,!1).trim()}function _t(t,e){xt(t,e?"1":"0")}function bt(t,e){var n=e.toPrecision();t.appendChild(nt().createTextNode(n))}function wt(t,e){var n=e.toString();t.appendChild(nt().createTextNode(n))}function xt(t,e){t.appendChild(nt().createTextNode(e))}var Et=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),St={MultiLineString:"lineStringMember",MultiCurve:"curveMember",MultiPolygon:"polygonMember",MultiSurface:"surfaceMember"},Ot=function(t){function e(e){var n=this,r=e||{};return(n=t.call(this,r)||this).FEATURE_COLLECTION_PARSERS[at].featureMember=z(n.readFeaturesInternal),n.schemaLocation=r.schemaLocation?r.schemaLocation:"http://www.opengis.net/gml http://schemas.opengis.net/gml/2.1.2/feature.xsd",n}return Et(e,t),e.prototype.readFlatCoordinates=function(t,e){var n=k(t,!1).replace(/^\s*|\s*$/g,""),r=e[0].srsName,i="enu";if(r){var o=Object(_.get)(r);o&&(i=o.getAxisOrientation())}for(var a=n.trim().split(/\s+/),s=[],l=0,u=a.length;l<u;l++){var c=a[l].split(/,+/),h=parseFloat(c[0]),p=parseFloat(c[1]),d=3===c.length?parseFloat(c[2]):0;"en"===i.substr(0,2)?s.push(h,p,d):s.push(p,h,d)}return s},e.prototype.readBox=function(t,e){var n=$([null],this.BOX_PARSERS_,t,e,this);return Object(m.createOrUpdate)(n[1][0],n[1][1],n[1][3],n[1][4])},e.prototype.innerBoundaryIsParser=function(t,e){var n=$(void 0,this.RING_PARSERS,t,e,this);n&&e[e.length-1].push(n)},e.prototype.outerBoundaryIsParser=function(t,e){var n=$(void 0,this.RING_PARSERS,t,e,this);n&&(e[e.length-1][0]=n)},e.prototype.GEOMETRY_NODE_FACTORY_=function(t,e,n){var r,i=e[e.length-1],o=i.multiSurface,a=i.surface,s=i.multiCurve;return Array.isArray(t)?r="Envelope":"MultiPolygon"===(r=t.getType())&&!0===o?r="MultiSurface":"Polygon"===r&&!0===a?r="Surface":"MultiLineString"===r&&!0===s&&(r="MultiCurve"),A("http://www.opengis.net/gml",r)},e.prototype.writeFeatureElement=function(t,e,n){var r=e.getId();r&&t.setAttribute("fid",r);var i=n[n.length-1],o=i.featureNS,a=e.getGeometryName();i.serializers||(i.serializers={},i.serializers[o]={});var s=[],l=[];if(e.hasProperties()){var u=e.getProperties();for(var c in u){var h=u[c];null!==h&&(s.push(c),l.push(h),c==a||"function"==typeof h.getSimplifiedGeometry?c in i.serializers[o]||(i.serializers[o][c]=q(this.writeGeometryElement,this)):c in i.serializers[o]||(i.serializers[o][c]=q(xt)))}}var p=Object(y.a)({},i);p.node=t,Q(p,i.serializers,X(void 0,o),l,n,s)},e.prototype.writeCurveOrLineString=function(t,e,n){var r=n[n.length-1].srsName;if("LineStringSegment"!==t.nodeName&&r&&t.setAttribute("srsName",r),"LineString"===t.nodeName||"LineStringSegment"===t.nodeName){var i=this.createCoordinatesNode_(t.namespaceURI);t.appendChild(i),this.writeCoordinates_(i,e,n)}else if("Curve"===t.nodeName){var o=A(t.namespaceURI,"segments");t.appendChild(o),this.writeCurveSegments_(o,e,n)}},e.prototype.writeLineStringOrCurveMember=function(t,e,n){var r=this.GEOMETRY_NODE_FACTORY_(e,n);r&&(t.appendChild(r),this.writeCurveOrLineString(r,e,n))},e.prototype.writeMultiCurveOrLineString=function(t,e,n){var r=n[n.length-1],i=r.hasZ,o=r.srsName,a=r.curve;o&&t.setAttribute("srsName",o);var s=e.getLineStrings();Q({node:t,hasZ:i,srsName:o,curve:a},this.LINESTRINGORCURVEMEMBER_SERIALIZERS,this.MULTIGEOMETRY_MEMBER_NODE_FACTORY_,s,n,void 0,this)},e.prototype.writeGeometryElement=function(t,e,n){var r,i=n[n.length-1],o=Object(y.a)({},i);o.node=t,r=Array.isArray(e)?Object(w.b)(e,i):Object(w.c)(e,!0,i),Q(o,this.GEOMETRY_SERIALIZERS,this.GEOMETRY_NODE_FACTORY_,[r],n,void 0,this)},e.prototype.createCoordinatesNode_=function(t){var e=A(t,"coordinates");return e.setAttribute("decimal","."),e.setAttribute("cs",","),e.setAttribute("ts"," "),e},e.prototype.writeCoordinates_=function(t,e,n){for(var r=n[n.length-1],i=r.hasZ,o=r.srsName,a=e.getCoordinates(),s=a.length,l=new Array(s),u=0;u<s;++u){var c=a[u];l[u]=this.getCoords_(c,o,i)}xt(t,l.join(" "))},e.prototype.writeCurveSegments_=function(t,e,n){var r=A(t.namespaceURI,"LineStringSegment");t.appendChild(r),this.writeCurveOrLineString(r,e,n)},e.prototype.writeSurfaceOrPolygon=function(t,e,n){var r=n[n.length-1],i=r.hasZ,o=r.srsName;if("PolygonPatch"!==t.nodeName&&o&&t.setAttribute("srsName",o),"Polygon"===t.nodeName||"PolygonPatch"===t.nodeName){var a=e.getLinearRings();Q({node:t,hasZ:i,srsName:o},this.RING_SERIALIZERS,this.RING_NODE_FACTORY_,a,n,void 0,this)}else if("Surface"===t.nodeName){var s=A(t.namespaceURI,"patches");t.appendChild(s),this.writeSurfacePatches_(s,e,n)}},e.prototype.RING_NODE_FACTORY_=function(t,e,n){var r=e[e.length-1],i=r.node,o=r.exteriorWritten;return void 0===o&&(r.exteriorWritten=!0),A(i.namespaceURI,void 0!==o?"innerBoundaryIs":"outerBoundaryIs")},e.prototype.writeSurfacePatches_=function(t,e,n){var r=A(t.namespaceURI,"PolygonPatch");t.appendChild(r),this.writeSurfaceOrPolygon(r,e,n)},e.prototype.writeRing=function(t,e,n){var r=A(t.namespaceURI,"LinearRing");t.appendChild(r),this.writeLinearRing(r,e,n)},e.prototype.getCoords_=function(t,e,n){var r="enu";e&&(r=Object(_.get)(e).getAxisOrientation());var i="en"===r.substr(0,2)?t[0]+","+t[1]:t[1]+","+t[0];n&&(i+=","+(t[2]||0));return i},e.prototype.writePoint=function(t,e,n){var r=n[n.length-1],i=r.hasZ,o=r.srsName;o&&t.setAttribute("srsName",o);var a=this.createCoordinatesNode_(t.namespaceURI);t.appendChild(a);var s=e.getCoordinates();xt(a,this.getCoords_(s,o,i))},e.prototype.writeMultiPoint=function(t,e,n){var r=n[n.length-1],i=r.hasZ,o=r.srsName;o&&t.setAttribute("srsName",o);var a=e.getPoints();Q({node:t,hasZ:i,srsName:o},this.POINTMEMBER_SERIALIZERS,X("pointMember"),a,n,void 0,this)},e.prototype.writePointMember=function(t,e,n){var r=A(t.namespaceURI,"Point");t.appendChild(r),this.writePoint(r,e,n)},e.prototype.writeLinearRing=function(t,e,n){var r=n[n.length-1].srsName;r&&t.setAttribute("srsName",r);var i=this.createCoordinatesNode_(t.namespaceURI);t.appendChild(i),this.writeCoordinates_(i,e,n)},e.prototype.writeMultiSurfaceOrPolygon=function(t,e,n){var r=n[n.length-1],i=r.hasZ,o=r.srsName,a=r.surface;o&&t.setAttribute("srsName",o);var s=e.getPolygons();Q({node:t,hasZ:i,srsName:o,surface:a},this.SURFACEORPOLYGONMEMBER_SERIALIZERS,this.MULTIGEOMETRY_MEMBER_NODE_FACTORY_,s,n,void 0,this)},e.prototype.writeSurfaceOrPolygonMember=function(t,e,n){var r=this.GEOMETRY_NODE_FACTORY_(e,n);r&&(t.appendChild(r),this.writeSurfaceOrPolygon(r,e,n))},e.prototype.writeEnvelope=function(t,e,n){var r=n[n.length-1].srsName;r&&t.setAttribute("srsName",r);var i=[e[0]+" "+e[1],e[2]+" "+e[3]];Q({node:t},this.ENVELOPE_SERIALIZERS,W,i,n,["lowerCorner","upperCorner"],this)},e.prototype.MULTIGEOMETRY_MEMBER_NODE_FACTORY_=function(t,e,n){var r=e[e.length-1].node;return A("http://www.opengis.net/gml",St[r.nodeName])},e}(ut);Ot.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS={"http://www.opengis.net/gml":{coordinates:U(Ot.prototype.readFlatCoordinates)}},Ot.prototype.FLAT_LINEAR_RINGS_PARSERS={"http://www.opengis.net/gml":{innerBoundaryIs:Ot.prototype.innerBoundaryIsParser,outerBoundaryIs:Ot.prototype.outerBoundaryIsParser}},Ot.prototype.BOX_PARSERS_={"http://www.opengis.net/gml":{coordinates:z(Ot.prototype.readFlatCoordinates)}},Ot.prototype.GEOMETRY_PARSERS={"http://www.opengis.net/gml":{Point:U(ut.prototype.readPoint),MultiPoint:U(ut.prototype.readMultiPoint),LineString:U(ut.prototype.readLineString),MultiLineString:U(ut.prototype.readMultiLineString),LinearRing:U(ut.prototype.readLinearRing),Polygon:U(ut.prototype.readPolygon),MultiPolygon:U(ut.prototype.readMultiPolygon),Box:U(Ot.prototype.readBox)}},Ot.prototype.GEOMETRY_SERIALIZERS={"http://www.opengis.net/gml":{Curve:q(Ot.prototype.writeCurveOrLineString),MultiCurve:q(Ot.prototype.writeMultiCurveOrLineString),Point:q(Ot.prototype.writePoint),MultiPoint:q(Ot.prototype.writeMultiPoint),LineString:q(Ot.prototype.writeCurveOrLineString),MultiLineString:q(Ot.prototype.writeMultiCurveOrLineString),LinearRing:q(Ot.prototype.writeLinearRing),Polygon:q(Ot.prototype.writeSurfaceOrPolygon),MultiPolygon:q(Ot.prototype.writeMultiSurfaceOrPolygon),Surface:q(Ot.prototype.writeSurfaceOrPolygon),MultiSurface:q(Ot.prototype.writeMultiSurfaceOrPolygon),Envelope:q(Ot.prototype.writeEnvelope)}},Ot.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS={"http://www.opengis.net/gml":{lineStringMember:q(Ot.prototype.writeLineStringOrCurveMember),curveMember:q(Ot.prototype.writeLineStringOrCurveMember)}},Ot.prototype.RING_SERIALIZERS={"http://www.opengis.net/gml":{outerBoundaryIs:q(Ot.prototype.writeRing),innerBoundaryIs:q(Ot.prototype.writeRing)}},Ot.prototype.POINTMEMBER_SERIALIZERS={"http://www.opengis.net/gml":{pointMember:q(Ot.prototype.writePointMember)}},Ot.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS={"http://www.opengis.net/gml":{surfaceMember:q(Ot.prototype.writeSurfaceOrPolygonMember),polygonMember:q(Ot.prototype.writeSurfaceOrPolygonMember)}},Ot.prototype.ENVELOPE_SERIALIZERS={"http://www.opengis.net/gml":{lowerCorner:q(xt),upperCorner:q(xt)}};var Ct=Ot,Tt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),It={MultiLineString:"lineStringMember",MultiCurve:"curveMember",MultiPolygon:"polygonMember",MultiSurface:"surfaceMember"},Lt=function(t){function e(e){var n=this,r=e||{};return(n=t.call(this,r)||this).surface_=void 0!==r.surface&&r.surface,n.curve_=void 0!==r.curve&&r.curve,n.multiCurve_=void 0===r.multiCurve||r.multiCurve,n.multiSurface_=void 0===r.multiSurface||r.multiSurface,n.schemaLocation=r.schemaLocation?r.schemaLocation:"http://www.opengis.net/gml http://schemas.opengis.net/gml/3.1.1/profiles/gmlsfProfile/1.0.0/gmlsf.xsd",n.hasZ=void 0!==r.hasZ&&r.hasZ,n}return Tt(e,t),e.prototype.readMultiCurve=function(t,e){var n=$([],this.MULTICURVE_PARSERS,t,e,this);return n?new c.a(n):void 0},e.prototype.readMultiSurface=function(t,e){var n=$([],this.MULTISURFACE_PARSERS,t,e,this);if(n)return new p.a(n)},e.prototype.curveMemberParser=function(t,e){Z(this.CURVEMEMBER_PARSERS,t,e,this)},e.prototype.surfaceMemberParser=function(t,e){Z(this.SURFACEMEMBER_PARSERS,t,e,this)},e.prototype.readPatch=function(t,e){return $([null],this.PATCHES_PARSERS,t,e,this)},e.prototype.readSegment=function(t,e){return $([null],this.SEGMENTS_PARSERS,t,e,this)},e.prototype.readPolygonPatch=function(t,e){return $([null],this.FLAT_LINEAR_RINGS_PARSERS,t,e,this)},e.prototype.readLineStringSegment=function(t,e){return $([null],this.GEOMETRY_FLAT_COORDINATES_PARSERS,t,e,this)},e.prototype.interiorParser=function(t,e){var n=$(void 0,this.RING_PARSERS,t,e,this);n&&e[e.length-1].push(n)},e.prototype.exteriorParser=function(t,e){var n=$(void 0,this.RING_PARSERS,t,e,this);n&&(e[e.length-1][0]=n)},e.prototype.readSurface=function(t,e){var n=$([null],this.SURFACE_PARSERS,t,e,this);if(n&&n[0]){var r,i=n[0],a=[i.length],s=void 0;for(s=1,r=n.length;s<r;++s)Object(N.c)(i,n[s]),a.push(i.length);return new f.a(i,o.a.XYZ,a)}},e.prototype.readCurve=function(t,e){var n=$([null],this.CURVE_PARSERS,t,e,this);return n?new l.a(n,o.a.XYZ):void 0},e.prototype.readEnvelope=function(t,e){var n=$([null],this.ENVELOPE_PARSERS,t,e,this);return Object(m.createOrUpdate)(n[1][0],n[1][1],n[2][0],n[2][1])},e.prototype.readFlatPos=function(t,e){for(var n,r=k(t,!1),i=/^\s*([+\-]?\d*\.?\d+(?:[eE][+\-]?\d+)?)\s*/,o=[];n=i.exec(r);)o.push(parseFloat(n[1])),r=r.substr(n[0].length);if(""===r){var a=e[0].srsName,s="enu";if(a)s=Object(_.get)(a).getAxisOrientation();if("neu"===s){var l,u=void 0;for(u=0,l=o.length;u<l;u+=3){var c=o[u],h=o[u+1];o[u]=h,o[u+1]=c}}var p=o.length;if(2==p&&o.push(0),0!==p)return o}},e.prototype.readFlatPosList=function(t,e){var n=k(t,!1).replace(/^\s*|\s*$/g,""),r=e[0],i=r.srsName,o=r.srsDimension,a="enu";i&&(a=Object(_.get)(i).getAxisOrientation());var s,l,u,c=n.split(/\s+/),h=2;t.getAttribute("srsDimension")?h=mt(t.getAttribute("srsDimension")):t.getAttribute("dimension")?h=mt(t.getAttribute("dimension")):t.parentNode.getAttribute("srsDimension")?h=mt(t.parentNode.getAttribute("srsDimension")):o&&(h=mt(o));for(var p=[],d=0,f=c.length;d<f;d+=h)s=parseFloat(c[d]),l=parseFloat(c[d+1]),u=3===h?parseFloat(c[d+2]):0,"en"===a.substr(0,2)?p.push(s,l,u):p.push(l,s,u);return p},e.prototype.writePos_=function(t,e,n){var r=n[n.length-1],i=r.hasZ,o=i?"3":"2";t.setAttribute("srsDimension",o);var a=r.srsName,s="enu";a&&(s=Object(_.get)(a).getAxisOrientation());var l,u=e.getCoordinates();(l="en"===s.substr(0,2)?u[0]+" "+u[1]:u[1]+" "+u[0],i)&&(l+=" "+(u[2]||0));xt(t,l)},e.prototype.getCoords_=function(t,e,n){var r="enu";e&&(r=Object(_.get)(e).getAxisOrientation());var i="en"===r.substr(0,2)?t[0]+" "+t[1]:t[1]+" "+t[0];n&&(i+=" "+(t[2]||0));return i},e.prototype.writePosList_=function(t,e,n){var r=n[n.length-1],i=r.hasZ,o=i?"3":"2";t.setAttribute("srsDimension",o);for(var a,s=r.srsName,l=e.getCoordinates(),u=l.length,c=new Array(u),h=0;h<u;++h)a=l[h],c[h]=this.getCoords_(a,s,i);xt(t,c.join(" "))},e.prototype.writePoint=function(t,e,n){var r=n[n.length-1].srsName;r&&t.setAttribute("srsName",r);var i=A(t.namespaceURI,"pos");t.appendChild(i),this.writePos_(i,e,n)},e.prototype.writeEnvelope=function(t,e,n){var r=n[n.length-1].srsName;r&&t.setAttribute("srsName",r);var i=[e[0]+" "+e[1],e[2]+" "+e[3]];Q({node:t},this.ENVELOPE_SERIALIZERS,W,i,n,["lowerCorner","upperCorner"],this)},e.prototype.writeLinearRing=function(t,e,n){var r=n[n.length-1].srsName;r&&t.setAttribute("srsName",r);var i=A(t.namespaceURI,"posList");t.appendChild(i),this.writePosList_(i,e,n)},e.prototype.RING_NODE_FACTORY_=function(t,e,n){var r=e[e.length-1],i=r.node,o=r.exteriorWritten;return void 0===o&&(r.exteriorWritten=!0),A(i.namespaceURI,void 0!==o?"interior":"exterior")},e.prototype.writeSurfaceOrPolygon=function(t,e,n){var r=n[n.length-1],i=r.hasZ,o=r.srsName;if("PolygonPatch"!==t.nodeName&&o&&t.setAttribute("srsName",o),"Polygon"===t.nodeName||"PolygonPatch"===t.nodeName){var a=e.getLinearRings();Q({node:t,hasZ:i,srsName:o},this.RING_SERIALIZERS,this.RING_NODE_FACTORY_,a,n,void 0,this)}else if("Surface"===t.nodeName){var s=A(t.namespaceURI,"patches");t.appendChild(s),this.writeSurfacePatches_(s,e,n)}},e.prototype.writeCurveOrLineString=function(t,e,n){var r=n[n.length-1].srsName;if("LineStringSegment"!==t.nodeName&&r&&t.setAttribute("srsName",r),"LineString"===t.nodeName||"LineStringSegment"===t.nodeName){var i=A(t.namespaceURI,"posList");t.appendChild(i),this.writePosList_(i,e,n)}else if("Curve"===t.nodeName){var o=A(t.namespaceURI,"segments");t.appendChild(o),this.writeCurveSegments_(o,e,n)}},e.prototype.writeMultiSurfaceOrPolygon=function(t,e,n){var r=n[n.length-1],i=r.hasZ,o=r.srsName,a=r.surface;o&&t.setAttribute("srsName",o);var s=e.getPolygons();Q({node:t,hasZ:i,srsName:o,surface:a},this.SURFACEORPOLYGONMEMBER_SERIALIZERS,this.MULTIGEOMETRY_MEMBER_NODE_FACTORY_,s,n,void 0,this)},e.prototype.writeMultiPoint=function(t,e,n){var r=n[n.length-1],i=r.srsName,o=r.hasZ;i&&t.setAttribute("srsName",i);var a=e.getPoints();Q({node:t,hasZ:o,srsName:i},this.POINTMEMBER_SERIALIZERS,X("pointMember"),a,n,void 0,this)},e.prototype.writeMultiCurveOrLineString=function(t,e,n){var r=n[n.length-1],i=r.hasZ,o=r.srsName,a=r.curve;o&&t.setAttribute("srsName",o);var s=e.getLineStrings();Q({node:t,hasZ:i,srsName:o,curve:a},this.LINESTRINGORCURVEMEMBER_SERIALIZERS,this.MULTIGEOMETRY_MEMBER_NODE_FACTORY_,s,n,void 0,this)},e.prototype.writeRing=function(t,e,n){var r=A(t.namespaceURI,"LinearRing");t.appendChild(r),this.writeLinearRing(r,e,n)},e.prototype.writeSurfaceOrPolygonMember=function(t,e,n){var r=this.GEOMETRY_NODE_FACTORY_(e,n);r&&(t.appendChild(r),this.writeSurfaceOrPolygon(r,e,n))},e.prototype.writePointMember=function(t,e,n){var r=A(t.namespaceURI,"Point");t.appendChild(r),this.writePoint(r,e,n)},e.prototype.writeLineStringOrCurveMember=function(t,e,n){var r=this.GEOMETRY_NODE_FACTORY_(e,n);r&&(t.appendChild(r),this.writeCurveOrLineString(r,e,n))},e.prototype.writeSurfacePatches_=function(t,e,n){var r=A(t.namespaceURI,"PolygonPatch");t.appendChild(r),this.writeSurfaceOrPolygon(r,e,n)},e.prototype.writeCurveSegments_=function(t,e,n){var r=A(t.namespaceURI,"LineStringSegment");t.appendChild(r),this.writeCurveOrLineString(r,e,n)},e.prototype.writeGeometryElement=function(t,e,n){var r,i=n[n.length-1],o=Object(y.a)({},i);o.node=t,r=Array.isArray(e)?Object(w.b)(e,i):Object(w.c)(e,!0,i),Q(o,this.GEOMETRY_SERIALIZERS,this.GEOMETRY_NODE_FACTORY_,[r],n,void 0,this)},e.prototype.writeFeatureElement=function(t,e,n){var r=e.getId();r&&t.setAttribute("fid",r);var i=n[n.length-1],o=i.featureNS,a=e.getGeometryName();i.serializers||(i.serializers={},i.serializers[o]={});var s=[],l=[];if(e.hasProperties()){var u=e.getProperties();for(var c in u){var h=u[c];null!==h&&(s.push(c),l.push(h),c==a||"function"==typeof h.getSimplifiedGeometry?c in i.serializers[o]||(i.serializers[o][c]=q(this.writeGeometryElement,this)):c in i.serializers[o]||(i.serializers[o][c]=q(xt)))}}var p=Object(y.a)({},i);p.node=t,Q(p,i.serializers,X(void 0,o),l,n,s)},e.prototype.writeFeatureMembers_=function(t,e,n){var r=n[n.length-1],i=r.featureType,o=r.featureNS,a={};a[o]={},a[o][i]=q(this.writeFeatureElement,this);var s=Object(y.a)({},r);s.node=t,Q(s,a,X(i,o),e,n)},e.prototype.MULTIGEOMETRY_MEMBER_NODE_FACTORY_=function(t,e,n){var r=e[e.length-1].node;return A(this.namespace,It[r.nodeName])},e.prototype.GEOMETRY_NODE_FACTORY_=function(t,e,n){var r,i=e[e.length-1],o=i.multiSurface,a=i.surface,s=i.curve,l=i.multiCurve;return Array.isArray(t)?r="Envelope":"MultiPolygon"===(r=t.getType())&&!0===o?r="MultiSurface":"Polygon"===r&&!0===a?r="Surface":"LineString"===r&&!0===s?r="Curve":"MultiLineString"===r&&!0===l&&(r="MultiCurve"),A(this.namespace,r)},e.prototype.writeGeometryNode=function(t,e){e=this.adaptOptions(e);var n=A(this.namespace,"geom"),r={node:n,hasZ:this.hasZ,srsName:this.srsName,curve:this.curve_,surface:this.surface_,multiSurface:this.multiSurface_,multiCurve:this.multiCurve_};return e&&Object(y.a)(r,e),this.writeGeometryElement(n,t,[r]),n},e.prototype.writeFeaturesNode=function(t,e){e=this.adaptOptions(e);var n=A(this.namespace,"featureMembers");n.setAttributeNS(j,"xsi:schemaLocation",this.schemaLocation);var r={srsName:this.srsName,hasZ:this.hasZ,curve:this.curve_,surface:this.surface_,multiSurface:this.multiSurface_,multiCurve:this.multiCurve_,featureNS:this.featureNS,featureType:this.featureType};return e&&Object(y.a)(r,e),this.writeFeatureMembers_(n,t,[r]),n},e}(ut);Lt.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS={"http://www.opengis.net/gml":{pos:U(Lt.prototype.readFlatPos),posList:U(Lt.prototype.readFlatPosList),coordinates:U(Ct.prototype.readFlatCoordinates)}},Lt.prototype.FLAT_LINEAR_RINGS_PARSERS={"http://www.opengis.net/gml":{interior:Lt.prototype.interiorParser,exterior:Lt.prototype.exteriorParser}},Lt.prototype.GEOMETRY_PARSERS={"http://www.opengis.net/gml":{Point:U(ut.prototype.readPoint),MultiPoint:U(ut.prototype.readMultiPoint),LineString:U(ut.prototype.readLineString),MultiLineString:U(ut.prototype.readMultiLineString),LinearRing:U(ut.prototype.readLinearRing),Polygon:U(ut.prototype.readPolygon),MultiPolygon:U(ut.prototype.readMultiPolygon),Surface:U(Lt.prototype.readSurface),MultiSurface:U(Lt.prototype.readMultiSurface),Curve:U(Lt.prototype.readCurve),MultiCurve:U(Lt.prototype.readMultiCurve),Envelope:U(Lt.prototype.readEnvelope)}},Lt.prototype.MULTICURVE_PARSERS={"http://www.opengis.net/gml":{curveMember:z(Lt.prototype.curveMemberParser),curveMembers:z(Lt.prototype.curveMemberParser)}},Lt.prototype.MULTISURFACE_PARSERS={"http://www.opengis.net/gml":{surfaceMember:z(Lt.prototype.surfaceMemberParser),surfaceMembers:z(Lt.prototype.surfaceMemberParser)}},Lt.prototype.CURVEMEMBER_PARSERS={"http://www.opengis.net/gml":{LineString:z(ut.prototype.readLineString),Curve:z(Lt.prototype.readCurve)}},Lt.prototype.SURFACEMEMBER_PARSERS={"http://www.opengis.net/gml":{Polygon:z(ut.prototype.readPolygon),Surface:z(Lt.prototype.readSurface)}},Lt.prototype.SURFACE_PARSERS={"http://www.opengis.net/gml":{patches:U(Lt.prototype.readPatch)}},Lt.prototype.CURVE_PARSERS={"http://www.opengis.net/gml":{segments:U(Lt.prototype.readSegment)}},Lt.prototype.ENVELOPE_PARSERS={"http://www.opengis.net/gml":{lowerCorner:z(Lt.prototype.readFlatPosList),upperCorner:z(Lt.prototype.readFlatPosList)}},Lt.prototype.PATCHES_PARSERS={"http://www.opengis.net/gml":{PolygonPatch:U(Lt.prototype.readPolygonPatch)}},Lt.prototype.SEGMENTS_PARSERS={"http://www.opengis.net/gml":{LineStringSegment:U(Lt.prototype.readLineStringSegment)}},Lt.prototype.writeFeatures,Lt.prototype.RING_SERIALIZERS={"http://www.opengis.net/gml":{exterior:q(Lt.prototype.writeRing),interior:q(Lt.prototype.writeRing)}},Lt.prototype.ENVELOPE_SERIALIZERS={"http://www.opengis.net/gml":{lowerCorner:q(xt),upperCorner:q(xt)}},Lt.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS={"http://www.opengis.net/gml":{surfaceMember:q(Lt.prototype.writeSurfaceOrPolygonMember),polygonMember:q(Lt.prototype.writeSurfaceOrPolygonMember)}},Lt.prototype.POINTMEMBER_SERIALIZERS={"http://www.opengis.net/gml":{pointMember:q(Lt.prototype.writePointMember)}},Lt.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS={"http://www.opengis.net/gml":{lineStringMember:q(Lt.prototype.writeLineStringOrCurveMember),curveMember:q(Lt.prototype.writeLineStringOrCurveMember)}},Lt.prototype.GEOMETRY_SERIALIZERS={"http://www.opengis.net/gml":{Curve:q(Lt.prototype.writeCurveOrLineString),MultiCurve:q(Lt.prototype.writeMultiCurveOrLineString),Point:q(Lt.prototype.writePoint),MultiPoint:q(Lt.prototype.writeMultiPoint),LineString:q(Lt.prototype.writeCurveOrLineString),MultiLineString:q(Lt.prototype.writeMultiCurveOrLineString),LinearRing:q(Lt.prototype.writeLinearRing),Polygon:q(Lt.prototype.writeSurfaceOrPolygon),MultiPolygon:q(Lt.prototype.writeMultiSurfaceOrPolygon),Surface:q(Lt.prototype.writeSurfaceOrPolygon),MultiSurface:q(Lt.prototype.writeMultiSurfaceOrPolygon),Envelope:q(Lt.prototype.writeEnvelope)}};var Pt=Lt,Rt=Pt;Rt.prototype.writeFeatures,Rt.prototype.writeFeaturesNode;var Mt=Rt,Nt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),jt=[null,"http://www.topografix.com/GPX/1/0","http://www.topografix.com/GPX/1/1"],At={rte:ue,trk:ce,wpt:he},kt=K(jt,{rte:z(ue),trk:z(ce),wpt:z(he)}),Ft=K(jt,{text:V(vt,"linkText"),type:V(vt,"linkType")}),Dt=K(jt,{rte:q((function(t,e,n){var r=n[0],i=e.getProperties(),o={node:t};o.properties=i;var s=e.getGeometry();if(s.getType()==a.a.LINE_STRING){var l=Object(w.c)(s,!0,r);o.geometryLayout=l.getLayout(),i.rtept=l.getCoordinates()}var u=n[n.length-1].node,c=Ht[u.namespaceURI],h=H(i,c);Q(o,Kt,W,h,n,c)})),trk:q((function(t,e,n){var r=n[0],i=e.getProperties(),o={node:t};o.properties=i;var s=e.getGeometry();if(s.getType()==a.a.MULTI_LINE_STRING){var l=Object(w.c)(s,!0,r);i.trkseg=l.getLineStrings()}var u=n[n.length-1].node,c=$t[u.namespaceURI],h=H(i,c);Q(o,Jt,W,h,n,c)})),wpt:q((function(t,e,n){var r=n[0],i=n[n.length-1];i.properties=e.getProperties();var o=e.getGeometry();if(o.getType()==a.a.POINT){var s=Object(w.c)(o,!0,r);i.geometryLayout=s.getLayout(),de(t,s.getCoordinates(),n)}}))}),Gt=function(t){function e(e){var n=t.call(this)||this,r=e||{};return n.dataProjection=Object(_.get)("EPSG:4326"),n.readExtensions_=r.readExtensions,n}return Nt(e,t),e.prototype.handleReadExtensions_=function(t){t||(t=[]);for(var e=0,n=t.length;e<n;++e){var r=t[e];if(this.readExtensions_){var i=r.get("extensionsNode_")||null;this.readExtensions_(r,i)}r.set("extensionsNode_",void 0)}},e.prototype.readFeatureFromNode=function(t,e){if(!Object(N.f)(jt,t.namespaceURI))return null;var n=At[t.localName];if(!n)return null;var r=n(t,[this.getReadOptions(t,e)]);return r?(this.handleReadExtensions_([r]),r):null},e.prototype.readFeaturesFromNode=function(t,e){if(!Object(N.f)(jt,t.namespaceURI))return[];if("gpx"==t.localName){var n=$([],kt,t,[this.getReadOptions(t,e)]);return n?(this.handleReadExtensions_(n),n):[]}return[]},e.prototype.writeFeaturesNode=function(t,e){e=this.adaptOptions(e);var n=A("http://www.topografix.com/GPX/1/1","gpx");return n.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xsi",j),n.setAttributeNS(j,"xsi:schemaLocation","http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd"),n.setAttribute("version","1.1"),n.setAttribute("creator","OpenLayers"),Q({node:n},Dt,ie,t,[e]),n},e}(it),zt=K(jt,{name:V(vt),cmt:V(vt),desc:V(vt),src:V(vt),link:se,number:V(yt),extensions:le,type:V(vt),rtept:function(t,e){var n=$({},Ut,t,e);if(n){var r=e[e.length-1],i=r.flatCoordinates,o=r.layoutOptions;oe(i,o,t,n)}}}),Ut=K(jt,{ele:V(ft),time:V(dt)}),Bt=K(jt,{name:V(vt),cmt:V(vt),desc:V(vt),src:V(vt),link:se,number:V(yt),type:V(vt),extensions:le,trkseg:function(t,e){var n=e[e.length-1];Z(Vt,t,e);var r=n.flatCoordinates;n.ends.push(r.length)}}),Vt=K(jt,{trkpt:function(t,e){var n=$({},qt,t,e);if(n){var r=e[e.length-1],i=r.flatCoordinates,o=r.layoutOptions;oe(i,o,t,n)}}}),qt=K(jt,{ele:V(ft),time:V(dt)}),Yt=K(jt,{ele:V(ft),time:V(dt),magvar:V(ft),geoidheight:V(ft),name:V(vt),cmt:V(vt),desc:V(vt),src:V(vt),link:se,sym:V(vt),type:V(vt),fix:V(vt),sat:V(yt),hdop:V(ft),vdop:V(ft),pdop:V(ft),ageofdgpsdata:V(ft),dgpsid:V(yt),extensions:le}),Xt=["text","type"],Wt=K(jt,{text:q(xt),type:q(xt)}),Ht=K(jt,["name","cmt","desc","src","link","number","type","rtept"]),Kt=K(jt,{name:q(xt),cmt:q(xt),desc:q(xt),src:q(xt),link:q(pe),number:q(wt),type:q(xt),rtept:Y(q(de))}),Zt=K(jt,["ele","time"]),$t=K(jt,["name","cmt","desc","src","link","number","type","trkseg"]),Jt=K(jt,{name:q(xt),cmt:q(xt),desc:q(xt),src:q(xt),link:q(pe),number:q(wt),type:q(xt),trkseg:Y(q((function(t,e,n){var r={node:t};r.geometryLayout=e.getLayout(),r.properties={},Q(r,te,Qt,e.getCoordinates(),n)})))}),Qt=X("trkpt"),te=K(jt,{trkpt:q(de)}),ee=K(jt,["ele","time","magvar","geoidheight","name","cmt","desc","src","link","sym","type","fix","sat","hdop","vdop","pdop","ageofdgpsdata","dgpsid"]),ne=K(jt,{ele:q(bt),time:q((function(t,e){var n=new Date(1e3*e),r=n.getUTCFullYear()+"-"+Object(ct.b)(n.getUTCMonth()+1,2)+"-"+Object(ct.b)(n.getUTCDate(),2)+"T"+Object(ct.b)(n.getUTCHours(),2)+":"+Object(ct.b)(n.getUTCMinutes(),2)+":"+Object(ct.b)(n.getUTCSeconds(),2)+"Z";t.appendChild(nt().createTextNode(r))})),magvar:q(bt),geoidheight:q(bt),name:q(xt),cmt:q(xt),desc:q(xt),src:q(xt),link:q(pe),sym:q(xt),type:q(xt),fix:q(xt),sat:q(wt),hdop:q(bt),vdop:q(bt),pdop:q(bt),ageofdgpsdata:q(bt),dgpsid:q(wt)}),re={Point:"wpt",LineString:"rte",MultiLineString:"trk"};function ie(t,e,n){var r=t.getGeometry();if(r){var i=re[r.getType()];if(i)return A(e[e.length-1].node.namespaceURI,i)}}function oe(t,e,n,r){return t.push(parseFloat(n.getAttribute("lon")),parseFloat(n.getAttribute("lat"))),"ele"in r?(t.push(r.ele),delete r.ele,e.hasZ=!0):t.push(0),"time"in r?(t.push(r.time),delete r.time,e.hasM=!0):t.push(0),t}function ae(t,e,n){var r=o.a.XY,i=2;if(t.hasZ&&t.hasM?(r=o.a.XYZM,i=4):t.hasZ?(r=o.a.XYZ,i=3):t.hasM&&(r=o.a.XYM,i=3),4!==i){for(var a=0,s=e.length/4;a<s;a++)e[a*i]=e[4*a],e[a*i+1]=e[4*a+1],t.hasZ&&(e[a*i+2]=e[4*a+2]),t.hasM&&(e[a*i+2]=e[4*a+3]);if(e.length=e.length/4*i,n)for(a=0,s=n.length;a<s;a++)n[a]=n[a]/4*i}return r}function se(t,e){var n=e[e.length-1],r=t.getAttribute("href");null!==r&&(n.link=r),Z(Ft,t,e)}function le(t,e){e[e.length-1].extensionsNode_=t}function ue(t,e){var n=e[0],r=$({flatCoordinates:[],layoutOptions:{}},zt,t,e);if(r){var o=r.flatCoordinates;delete r.flatCoordinates;var a=r.layoutOptions;delete r.layoutOptions;var s=ae(a,o),u=new l.a(o,s);Object(w.c)(u,!1,n);var c=new i.a(u);return c.setProperties(r,!0),c}}function ce(t,e){var n=e[0],r=$({flatCoordinates:[],ends:[],layoutOptions:{}},Bt,t,e);if(r){var o=r.flatCoordinates;delete r.flatCoordinates;var a=r.ends;delete r.ends;var s=r.layoutOptions;delete r.layoutOptions;var l=ae(s,o,a),u=new c.a(o,l,a);Object(w.c)(u,!1,n);var h=new i.a(u);return h.setProperties(r,!0),h}}function he(t,e){var n=e[0],r=$({},Yt,t,e);if(r){var o={},a=oe([],o,t,r),s=ae(o,a),l=new d.a(a,s);Object(w.c)(l,!1,n);var u=new i.a(l);return u.setProperties(r,!0),u}}function pe(t,e,n){t.setAttribute("href",e);var r=n[n.length-1].properties,i=[r.linkText,r.linkType];Q({node:t},Wt,W,i,n,Xt)}function de(t,e,n){var r=n[n.length-1],i=r.node.namespaceURI,a=r.properties;switch(t.setAttributeNS(null,"lat",String(e[1])),t.setAttributeNS(null,"lon",String(e[0])),r.geometryLayout){case o.a.XYZM:0!==e[3]&&(a.time=e[3]);case o.a.XYZ:0!==e[2]&&(a.ele=e[2]);break;case o.a.XYM:0!==e[2]&&(a.time=e[2])}var s="rtept"==t.nodeName?Zt[i]:ee[i],l=H(a,s);Q({node:t,properties:a},ne,W,l,n,s)}var fe,ge,ye,me,ve,_e,be,we=Gt,xe=n(158),Ee=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Se="barometric",Oe="gps",Ce="none",Te=/^B(\d{2})(\d{2})(\d{2})(\d{2})(\d{5})([NS])(\d{3})(\d{5})([EW])([AV])(\d{5})(\d{5})/,Ie=/^H.([A-Z]{3}).*?:(.*)/,Le=/^HFDTE(\d{2})(\d{2})(\d{2})/,Pe=/\r\n|\r|\n/,Re=function(t){function e(e){var n=t.call(this)||this,r=e||{};return n.dataProjection=Object(_.get)("EPSG:4326"),n.altitudeMode_=r.altitudeMode?r.altitudeMode:Ce,n}return Ee(e,t),e.prototype.readFeatureFromText=function(t,e){var n,r,a=this.altitudeMode_,s=t.split(Pe),u={},c=[],h=2e3,p=0,d=1,f=-1;for(n=0,r=s.length;n<r;++n){var g=s[n],y=void 0;if("B"==g.charAt(0)){if(y=Te.exec(g)){var m=parseInt(y[1],10),v=parseInt(y[2],10),_=parseInt(y[3],10),b=parseInt(y[4],10)+parseInt(y[5],10)/6e4;"S"==y[6]&&(b=-b);var x=parseInt(y[7],10)+parseInt(y[8],10)/6e4;if("W"==y[9]&&(x=-x),c.push(x,b),a!=Ce){var E=void 0;E=a==Oe?parseInt(y[11],10):a==Se?parseInt(y[12],10):0,c.push(E)}var S=Date.UTC(h,p,d,m,v,_);S<f&&(S=Date.UTC(h,p,d+1,m,v,_)),c.push(S/1e3),f=S}}else"H"==g.charAt(0)&&((y=Le.exec(g))?(d=parseInt(y[1],10),p=parseInt(y[2],10)-1,h=2e3+parseInt(y[3],10)):(y=Ie.exec(g))&&(u[y[1]]=y[2].trim()))}if(0===c.length)return null;var O=a==Ce?o.a.XYM:o.a.XYZM,C=new l.a(c,O),T=new i.a(Object(w.c)(C,!1,e));return T.setProperties(u,!0),T},e.prototype.readFeaturesFromText=function(t,e){var n=this.readFeatureFromText(t,e);return n?[n]:[]},e}(xe.a),Me=n(129),Ne=n(59),je=n(90),Ae=n(122),ke=n(71),Fe=n(67),De=n(61),Ge=n(41),ze=n(99),Ue=n(88),Be=n(8),Ve=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),qe=["http://www.google.com/kml/ext/2.2"],Ye=[null,"http://earth.google.com/kml/2.0","http://earth.google.com/kml/2.1","http://earth.google.com/kml/2.2","http://www.opengis.net/kml/2.2"],Xe={fraction:ke.a.FRACTION,pixels:ke.a.PIXELS,insetPixels:ke.a.PIXELS},We=K(Ye,{ExtendedData:Vn,Region:qn,MultiGeometry:V(jn,"geometry"),LineString:V(Rn,"geometry"),LinearRing:V(Mn,"geometry"),Point:V(An,"geometry"),Polygon:V(Fn,"geometry"),Style:V(Gn),StyleMap:function(t,e){var n=mn.call(this,t,e);if(!n)return;var r=e[e.length-1];Array.isArray(n)?r.Style=n:"string"==typeof n?r.styleUrl=n:Object(g.a)(!1,38)},address:V(vt),description:V(vt),name:V(vt),open:V(ht),phoneNumber:V(vt),styleUrl:V(fn),visibility:V(ht)},K(qe,{MultiTrack:V((function(t,e){var n=$([],Sn,t,e);if(!n)return;return new c.a(n)}),"geometry"),Track:V(Cn,"geometry")})),He=K(Ye,{ExtendedData:Vn,Region:qn,Link:function(t,e){Z(Ke,t,e)},address:V(vt),description:V(vt),name:V(vt),open:V(ht),phoneNumber:V(vt),visibility:V(ht)}),Ke=K(Ye,{href:V(dn)}),Ze=K(Ye,{LatLonAltBox:function(t,e){var n=$({},Wn,t,e);if(!n)return;var r=e[e.length-1],i=[parseFloat(n.west),parseFloat(n.south),parseFloat(n.east),parseFloat(n.north)];r.extent=i,r.altitudeMode=n.altitudeMode,r.minAltitude=parseFloat(n.minAltitude),r.maxAltitude=parseFloat(n.maxAltitude)},Lod:function(t,e){var n=$({},Hn,t,e);if(!n)return;var r=e[e.length-1];r.minLodPixels=parseFloat(n.minLodPixels),r.maxLodPixels=parseFloat(n.maxLodPixels),r.minFadeExtent=parseFloat(n.minFadeExtent),r.maxFadeExtent=parseFloat(n.maxFadeExtent)}}),$e=K(Ye,["Document","Placemark"]),Je=K(Ye,{Document:q((function(t,e,n){Q({node:t},Qn,tr,e,n,void 0,this)})),Placemark:q(Sr)}),Qe=null;var tn,en=null;var nn,rn=null;var on=null;var an=null;var sn,ln=null;function un(t){return t}var cn=function(t){function e(e){var n=t.call(this)||this,r=e||{};return ln||(fe=[255,255,255,1],Qe=new Ne.a({color:fe}),ge=[20,2],ye=ke.a.PIXELS,me=ke.a.PIXELS,ve=[64,64],_e="https://maps.google.com/mapfiles/kml/pushpin/ylw-pushpin.png",be=.5,en=new Ae.a({anchor:ge,anchorOrigin:Fe.a.BOTTOM_LEFT,anchorXUnits:ye,anchorYUnits:me,crossOrigin:"anonymous",rotation:0,scale:be,size:ve,src:_e}),tn="NO_IMAGE",rn=new De.a({color:fe,width:1}),nn=new De.a({color:[51,51,51,1],width:2}),on=new ze.a({font:"bold 16px Helvetica",fill:Qe,stroke:nn,scale:.8}),an=new Ge.c({fill:Qe,image:en,text:on,stroke:rn,zIndex:0}),ln=[an]),n.dataProjection=Object(_.get)("EPSG:4326"),n.defaultStyle_=r.defaultStyle?r.defaultStyle:ln,n.extractStyles_=void 0===r.extractStyles||r.extractStyles,n.writeStyles_=void 0===r.writeStyles||r.writeStyles,n.sharedStyles_={},n.showPointNames_=void 0===r.showPointNames||r.showPointNames,n.crossOrigin_=void 0!==r.crossOrigin?r.crossOrigin:"anonymous",n.iconUrlFunction_=r.iconUrlFunction?r.iconUrlFunction:un,n}return Ve(e,t),e.prototype.readDocumentOrFolder_=function(t,e){var n=$([],K(Ye,{Document:G(this.readDocumentOrFolder_,this),Folder:G(this.readDocumentOrFolder_,this),Placemark:z(this.readPlacemark_,this),Style:this.readSharedStyle_.bind(this),StyleMap:this.readSharedStyleMap_.bind(this)}),t,e,this);return n||void 0},e.prototype.readPlacemark_=function(t,e){var n=$({geometry:null},We,t,e,this);if(n){var r=new i.a,o=t.getAttribute("id");null!==o&&r.setId(o);var s=e[0],l=n.geometry;if(l&&Object(w.c)(l,!1,s),r.setGeometry(l),delete n.geometry,this.extractStyles_){var u=function(t,e,n,r,i){return function(o,s){var l=i,u="",c=[];if(l){var h=o.getGeometry();if(h){var p=h.getType();l=p===a.a.GEOMETRY_COLLECTION?(c=h.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return e===a.a.POINT||e===a.a.MULTI_POINT}))).length>0:p===a.a.POINT||p===a.a.MULTI_POINT}}l&&(u=o.get("name"),(l=l&&!!u)&&u.search(/&[^&]+;/)>-1&&(sn||(sn=document.createElement("textarea")),sn.innerHTML=u,u=sn.value));var d=n;if(t?d=t:e&&(d=function t(e,n,r){return Array.isArray(e)?e:"string"==typeof e?t(r[e],n,r):n}(e,n,r)),l){var f=function(t,e){var n=[0,0],r="start",i=t.getImage();if(i){var o=i.getImageSize();if(null===o&&(o=ve),2==o.length){var a=i.getScaleArray();n[0]=a[0]*o[0]/2,n[1]=-a[1]*o[1]/2,r="left"}}var s=t.getText();s?((s=s.clone()).setFont(s.getFont()||on.getFont()),s.setScale(s.getScale()||on.getScale()),s.setFill(s.getFill()||on.getFill()),s.setStroke(s.getStroke()||nn)):s=on.clone();return s.setText(e),s.setOffsetX(n[0]),s.setOffsetY(n[1]),s.setTextAlign(r),new Ge.c({image:i,text:s})}(d[0],u);return c.length>0?(f.setGeometry(new je.a(c)),[f,new Ge.c({geometry:d[0].getGeometry(),image:null,fill:d[0].getFill(),stroke:d[0].getStroke(),text:null})].concat(d.slice(1))):f}return d}}(n.Style,n.styleUrl,this.defaultStyle_,this.sharedStyles_,this.showPointNames_);r.setStyle(u)}return delete n.Style,r.setProperties(n,!0),r}},e.prototype.readSharedStyle_=function(t,e){var n=t.getAttribute("id");if(null!==n){var r=Gn.call(this,t,e);if(r){var i=void 0,o=t.baseURI;if(o&&"about:blank"!=o||(o=window.location.href),o)i=new URL("#"+n,o).href;else i="#"+n;this.sharedStyles_[i]=r}}},e.prototype.readSharedStyleMap_=function(t,e){var n=t.getAttribute("id");if(null!==n){var r=mn.call(this,t,e);if(r){var i,o=t.baseURI;if(o&&"about:blank"!=o||(o=window.location.href),o)i=new URL("#"+n,o).href;else i="#"+n;this.sharedStyles_[i]=r}}},e.prototype.readFeatureFromNode=function(t,e){if(!Object(N.f)(Ye,t.namespaceURI))return null;var n=this.readPlacemark_(t,[this.getReadOptions(t,e)]);return n||null},e.prototype.readFeaturesFromNode=function(t,e){if(!Object(N.f)(Ye,t.namespaceURI))return[];var n,r=t.localName;if("Document"==r||"Folder"==r)return(n=this.readDocumentOrFolder_(t,[this.getReadOptions(t,e)]))||[];if("Placemark"==r){var i=this.readPlacemark_(t,[this.getReadOptions(t,e)]);return i?[i]:[]}if("kml"==r){n=[];for(var o=t.firstElementChild;o;o=o.nextElementSibling){var a=this.readFeaturesFromNode(o,e);a&&Object(N.c)(n,a)}return n}return[]},e.prototype.readName=function(t){if(t){if("string"==typeof t){var e=D(t);return this.readNameFromDocument(e)}return F(t)?this.readNameFromDocument(t):this.readNameFromNode(t)}},e.prototype.readNameFromDocument=function(t){for(var e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE){var n=this.readNameFromNode(e);if(n)return n}},e.prototype.readNameFromNode=function(t){for(var e=t.firstElementChild;e;e=e.nextElementSibling)if(Object(N.f)(Ye,e.namespaceURI)&&"name"==e.localName)return vt(e);for(e=t.firstElementChild;e;e=e.nextElementSibling){var n=e.localName;if(Object(N.f)(Ye,e.namespaceURI)&&("Document"==n||"Folder"==n||"Placemark"==n||"kml"==n)){var r=this.readNameFromNode(e);if(r)return r}}},e.prototype.readNetworkLinks=function(t){var e=[];if("string"==typeof t){var n=D(t);Object(N.c)(e,this.readNetworkLinksFromDocument(n))}else F(t)?Object(N.c)(e,this.readNetworkLinksFromDocument(t)):Object(N.c)(e,this.readNetworkLinksFromNode(t));return e},e.prototype.readNetworkLinksFromDocument=function(t){for(var e=[],n=t.firstChild;n;n=n.nextSibling)n.nodeType==Node.ELEMENT_NODE&&Object(N.c)(e,this.readNetworkLinksFromNode(n));return e},e.prototype.readNetworkLinksFromNode=function(t){for(var e=[],n=t.firstElementChild;n;n=n.nextElementSibling)if(Object(N.f)(Ye,n.namespaceURI)&&"NetworkLink"==n.localName){var r=$({},He,n,[]);e.push(r)}for(n=t.firstElementChild;n;n=n.nextElementSibling){var i=n.localName;!Object(N.f)(Ye,n.namespaceURI)||"Document"!=i&&"Folder"!=i&&"kml"!=i||Object(N.c)(e,this.readNetworkLinksFromNode(n))}return e},e.prototype.readRegion=function(t){var e=[];if("string"==typeof t){var n=D(t);Object(N.c)(e,this.readRegionFromDocument(n))}else F(t)?Object(N.c)(e,this.readRegionFromDocument(t)):Object(N.c)(e,this.readRegionFromNode(t));return e},e.prototype.readRegionFromDocument=function(t){for(var e=[],n=t.firstChild;n;n=n.nextSibling)n.nodeType==Node.ELEMENT_NODE&&Object(N.c)(e,this.readRegionFromNode(n));return e},e.prototype.readRegionFromNode=function(t){for(var e=[],n=t.firstElementChild;n;n=n.nextElementSibling)if(Object(N.f)(Ye,n.namespaceURI)&&"Region"==n.localName){var r=$({},Ze,n,[]);e.push(r)}for(n=t.firstElementChild;n;n=n.nextElementSibling){var i=n.localName;!Object(N.f)(Ye,n.namespaceURI)||"Document"!=i&&"Folder"!=i&&"kml"!=i||Object(N.c)(e,this.readRegionFromNode(n))}return e},e.prototype.writeFeaturesNode=function(t,e){e=this.adaptOptions(e);var n=A(Ye[4],"kml"),r="http://www.w3.org/2000/xmlns/";n.setAttributeNS(r,"xmlns:gx",qe[0]),n.setAttributeNS(r,"xmlns:xsi",j),n.setAttributeNS(j,"xsi:schemaLocation","http://www.opengis.net/kml/2.2 https://developers.google.com/kml/schema/kml22gx.xsd");var i={node:n},o={};t.length>1?o.Document=t:1==t.length&&(o.Placemark=t[0]);var a=$e[n.namespaceURI],s=H(o,a);return Q(i,Je,W,s,[e],a,this),n},e}(it);function hn(t){var e=k(t,!1),n=/^\s*#?\s*([0-9A-Fa-f]{8})\s*$/.exec(e);if(n){var r=n[1];return[parseInt(r.substr(6,2),16),parseInt(r.substr(4,2),16),parseInt(r.substr(2,2),16),parseInt(r.substr(0,2),16)/255]}}function pn(t){var e=k(t,!1),n=[];e=e.replace(/\s*,\s*/g,",");for(var r,i=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?),([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)(?:\s+|,|$)(?:([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)(?:\s+|$))?\s*/i;r=i.exec(e);){var o=parseFloat(r[1]),a=parseFloat(r[2]),s=r[3]?parseFloat(r[3]):0;n.push(o,a,s),e=e.substr(r[0].length)}if(""===e)return n}function dn(t){var e=k(t,!1).trim(),n=t.baseURI;return n&&"about:blank"!=n||(n=window.location.href),n?new URL(e,n).href:e}function fn(t){var e=k(t,!1).trim().replace(/^(?!.*#)/,"#"),n=t.baseURI;return n&&"about:blank"!=n||(n=window.location.href),n?new URL(e,n).href:e}function gn(t){return ft(t)}var yn=K(Ye,{Pair:function(t,e){var n=$({},Yn,t,e,this);if(!n)return;var r=n.key;if(r&&"normal"==r){var i=n.styleUrl;i&&(e[e.length-1]=i);var o=n.Style;o&&(e[e.length-1]=o)}}});function mn(t,e){return $(void 0,yn,t,e,this)}var vn=K(Ye,{Icon:V((function(t,e){var n=$({},Tn,t,e);return n||null})),color:V(hn),heading:V(ft),hotSpot:V((function(t){var e,n=t.getAttribute("xunits"),r=t.getAttribute("yunits");return e="insetPixels"!==n?"insetPixels"!==r?Fe.a.BOTTOM_LEFT:Fe.a.TOP_LEFT:"insetPixels"!==r?Fe.a.BOTTOM_RIGHT:Fe.a.TOP_RIGHT,{x:parseFloat(t.getAttribute("x")),xunits:Xe[n],y:parseFloat(t.getAttribute("y")),yunits:Xe[r],origin:e}})),scale:V(gn)});var _n=K(Ye,{color:V(hn),scale:V(gn)});var bn=K(Ye,{color:V(hn),width:V(ft)});var wn=K(Ye,{color:V(hn),fill:V(ht),outline:V(ht)});var xn=K(Ye,{coordinates:U(pn)});function En(t,e){return $(null,xn,t,e)}var Sn=K(qe,{Track:z(Cn)});var On=K(Ye,{when:function(t,e){var n=e[e.length-1].whens,r=k(t,!1),i=Date.parse(r);n.push(isNaN(i)?0:i)}},K(qe,{coord:function(t,e){var n=e[e.length-1].coordinates,r=k(t,!1),i=/^\s*([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s+([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s+([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s*$/i.exec(r);if(i){var o=parseFloat(i[1]),a=parseFloat(i[2]),s=parseFloat(i[3]);n.push([o,a,s])}else n.push([])}}));function Cn(t,e){var n=$({coordinates:[],whens:[]},On,t,e);if(n){for(var r=[],i=n.coordinates,a=n.whens,s=0,u=Math.min(i.length,a.length);s<u;++s)3==i[s].length&&r.push(i[s][0],i[s][1],i[s][2],a[s]);return new l.a(r,o.a.XYZM)}}var Tn=K(Ye,{href:V(dn)},K(qe,{x:V(ft),y:V(ft),w:V(ft),h:V(ft)}));var In=K(Ye,{coordinates:U(pn)});function Ln(t,e){return $(null,In,t,e)}var Pn=K(Ye,{extrude:V(ht),tessellate:V(ht),altitudeMode:V(vt)});function Rn(t,e){var n=$({},Pn,t,e),r=Ln(t,e);if(r){var i=new l.a(r,o.a.XYZ);return i.setProperties(n,!0),i}}function Mn(t,e){var n=$({},Pn,t,e),r=Ln(t,e);if(r){var i=new f.a(r,o.a.XYZ,[r.length]);return i.setProperties(n,!0),i}}var Nn=K(Ye,{LineString:z(Rn),LinearRing:z(Mn),MultiGeometry:z(jn),Point:z(An),Polygon:z(Fn)});function jn(t,e){var n,r=$([],Nn,t,e);if(!r)return null;if(0===r.length)return new je.a(r);for(var i,o=!0,s=r[0].getType(),l=1,u=r.length;l<u;++l)if((i=r[l]).getType()!=s){o=!1;break}if(o){var d=void 0,f=void 0;if(s==a.a.POINT){var y=r[0];d=y.getLayout(),f=y.getFlatCoordinates();for(l=1,u=r.length;l<u;++l)i=r[l],Object(N.c)(f,i.getFlatCoordinates());zn(n=new h.a(f,d),r)}else s==a.a.LINE_STRING?zn(n=new c.a(r),r):s==a.a.POLYGON?zn(n=new p.a(r),r):s==a.a.GEOMETRY_COLLECTION?n=new je.a(r):Object(g.a)(!1,37)}else n=new je.a(r);return n}function An(t,e){var n=$({},Pn,t,e),r=Ln(t,e);if(r){var i=new d.a(r,o.a.XYZ);return i.setProperties(n,!0),i}}var kn=K(Ye,{innerBoundaryIs:function(t,e){var n=$([],Kn,t,e);if(n.length>0){var r=e[e.length-1];r.push.apply(r,n)}},outerBoundaryIs:function(t,e){var n=$(void 0,Zn,t,e);if(n){e[e.length-1][0]=n}}});function Fn(t,e){var n=$({},Pn,t,e),r=$([null],kn,t,e);if(r&&r[0]){for(var i=r[0],a=[i.length],s=1,l=r.length;s<l;++s)Object(N.c)(i,r[s]),a.push(i.length);var u=new f.a(i,o.a.XYZ,a);return u.setProperties(n,!0),u}}var Dn=K(Ye,{IconStyle:function(t,e){var n=$({},vn,t,e);if(n){var r,i,o,a,s=e[e.length-1],l="Icon"in n?n.Icon:{},u=!("Icon"in n)||Object.keys(l).length>0,c=l.href;c?r=c:u&&(r=_e);var h,p=Fe.a.BOTTOM_LEFT,d=n.hotSpot;d?(i=[d.x,d.y],o=d.xunits,a=d.yunits,p=d.origin):r===_e?(i=ge,o=ye,a=me):/^http:\/\/maps\.(?:google|gstatic)\.com\//.test(r)&&(i=[.5,0],o=ke.a.FRACTION,a=ke.a.FRACTION);var f,g=l.x,y=l.y;void 0!==g&&void 0!==y&&(h=[g,y]);var m,v=l.w,_=l.h;void 0!==v&&void 0!==_&&(f=[v,_]);var b=n.heading;void 0!==b&&(m=Object(Be.j)(b));var w=n.scale,x=n.color;if(u){r==_e&&(f=ve,void 0===w&&(w=be));var E=new Ae.a({anchor:i,anchorOrigin:p,anchorXUnits:o,anchorYUnits:a,crossOrigin:this.crossOrigin_,offset:h,offsetOrigin:Fe.a.BOTTOM_LEFT,rotation:m,scale:w,size:f,src:this.iconUrlFunction_(r),color:x});s.imageStyle=E}else s.imageStyle=tn}},LabelStyle:function(t,e){var n=$({},_n,t,e);if(n){var r=e[e.length-1],i=new ze.a({fill:new Ne.a({color:"color"in n?n.color:fe}),scale:n.scale});r.textStyle=i}},LineStyle:function(t,e){var n=$({},bn,t,e);if(n){var r=e[e.length-1],i=new De.a({color:"color"in n?n.color:fe,width:"width"in n?n.width:1});r.strokeStyle=i}},PolyStyle:function(t,e){var n=$({},wn,t,e);if(n){var r=e[e.length-1],i=new Ne.a({color:"color"in n?n.color:fe});r.fillStyle=i;var o=n.fill;void 0!==o&&(r.fill=o);var a=n.outline;void 0!==a&&(r.outline=a)}}});function Gn(t,e){var n=$({},Dn,t,e,this);if(!n)return null;var r,i="fillStyle"in n?n.fillStyle:Qe,o=n.fill;void 0===o||o||(i=null),"imageStyle"in n?n.imageStyle!=tn&&(r=n.imageStyle):r=en;var s="textStyle"in n?n.textStyle:on,l="strokeStyle"in n?n.strokeStyle:rn,u=n.outline;return void 0===u||u?[new Ge.c({fill:i,image:r,stroke:l,text:s,zIndex:void 0})]:[new Ge.c({geometry:function(t){var e=t.getGeometry(),n=e.getType();return n===a.a.GEOMETRY_COLLECTION?new je.a(e.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return e!==a.a.POLYGON&&e!==a.a.MULTI_POLYGON}))):n!==a.a.POLYGON&&n!==a.a.MULTI_POLYGON?e:void 0},fill:i,image:r,stroke:l,text:s,zIndex:void 0}),new Ge.c({geometry:function(t){var e=t.getGeometry(),n=e.getType();return n===a.a.GEOMETRY_COLLECTION?new je.a(e.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return e===a.a.POLYGON||e===a.a.MULTI_POLYGON}))):n===a.a.POLYGON||n===a.a.MULTI_POLYGON?e:void 0},fill:i,stroke:null,zIndex:void 0})]}function zn(t,e){var n,r,i,o=e.length,a=new Array(e.length),s=new Array(e.length),l=new Array(e.length);n=!1,r=!1,i=!1;for(var u=0;u<o;++u){var c=e[u];a[u]=c.get("extrude"),s[u]=c.get("tessellate"),l[u]=c.get("altitudeMode"),n=n||void 0!==a[u],r=r||void 0!==s[u],i=i||l[u]}n&&t.set("extrude",a),r&&t.set("tessellate",s),i&&t.set("altitudeMode",l)}var Un=K(Ye,{displayName:V(vt),value:V(vt)});var Bn=K(Ye,{Data:function(t,e){var n=t.getAttribute("name");Z(Un,t,e);var r=e[e.length-1];n&&r.displayName?r[n]={value:r.value,displayName:r.displayName,toString:function(){return r.value}}:null!==n?r[n]=r.value:null!==r.displayName&&(r[r.displayName]=r.value),delete r.value},SchemaData:function(t,e){Z(Xn,t,e)}});function Vn(t,e){Z(Bn,t,e)}function qn(t,e){Z(Ze,t,e)}var Yn=K(Ye,{Style:V(Gn),key:V(vt),styleUrl:V(fn)});var Xn=K(Ye,{SimpleData:function(t,e){var n=t.getAttribute("name");if(null!==n){var r=vt(t);e[e.length-1][n]=r}}});var Wn=K(Ye,{altitudeMode:V(vt),minAltitude:V(ft),maxAltitude:V(ft),north:V(ft),south:V(ft),east:V(ft),west:V(ft)});var Hn=K(Ye,{minLodPixels:V(ft),maxLodPixels:V(ft),minFadeExtent:V(ft),maxFadeExtent:V(ft)});var Kn=K(Ye,{LinearRing:z(En)});var Zn=K(Ye,{LinearRing:U(En)});function $n(t,e){for(var n=Object(Ue.a)(e),r=[255*(4==n.length?n[3]:1),n[2],n[1],n[0]],i=0;i<4;++i){var o=Math.floor(r[i]).toString(16);r[i]=1==o.length?"0"+o:o}xt(t,r.join(""))}var Jn=K(Ye,{Data:q((function(t,e,n){t.setAttribute("name",e.name);var r={node:t},i=e.value;"object"==typeof i?(null!==i&&i.displayName&&Q(r,Jn,W,[i.displayName],n,["displayName"]),null!==i&&i.value&&Q(r,Jn,W,[i.value],n,["value"])):Q(r,Jn,W,[i],n,["value"])})),value:q((function(t,e){xt(t,e)})),displayName:q((function(t,e){!function(t,e){t.appendChild(nt().createCDATASection(e))}(t,e)}))});var Qn=K(Ye,{Placemark:q(Sr)}),tr=function(t,e,n){return A(e[e.length-1].node.namespaceURI,"Placemark")};var er=X("Data");var nr=K(Ye,["href"],K(qe,["x","y","w","h"])),rr=K(Ye,{href:q(xt)},K(qe,{x:q(bt),y:q(bt),w:q(bt),h:q(bt)})),ir=function(t,e,n){return A(qe[0],"gx:"+n)};var or=K(Ye,["scale","heading","Icon","color","hotSpot"]),ar=K(Ye,{Icon:q((function(t,e,n){var r={node:t},i=n[n.length-1].node,o=nr[i.namespaceURI],a=H(e,o);Q(r,rr,W,a,n,o),a=H(e,o=nr[qe[0]]),Q(r,rr,ir,a,n,o)})),color:q($n),heading:q(bt),hotSpot:q((function(t,e){t.setAttribute("x",String(e.x)),t.setAttribute("y",String(e.y)),t.setAttribute("xunits",e.xunits),t.setAttribute("yunits",e.yunits)})),scale:q(jr)});var sr=K(Ye,["color","scale"]),lr=K(Ye,{color:q($n),scale:q(jr)});var ur=K(Ye,["color","width"]),cr=K(Ye,{color:q($n),width:q(bt)});var hr={Point:"Point",LineString:"LineString",LinearRing:"LinearRing",Polygon:"Polygon",MultiPoint:"MultiGeometry",MultiLineString:"MultiGeometry",MultiPolygon:"MultiGeometry",GeometryCollection:"MultiGeometry"},pr=function(t,e,n){if(t)return A(e[e.length-1].node.namespaceURI,hr[t.getType()])},dr=X("Point"),fr=X("LineString"),gr=X("LinearRing"),yr=X("Polygon"),mr=K(Ye,{LineString:q(Tr),Point:q(Tr),Polygon:q(Mr),GeometryCollection:q(vr)});function vr(t,e,n){var r,i={node:t},o=e.getType(),s=[];o===a.a.GEOMETRY_COLLECTION?(e.getGeometriesArrayRecursive().forEach((function(t){var e=t.getType();e===a.a.MULTI_POINT?s=s.concat(t.getPoints()):e===a.a.MULTI_LINE_STRING?s=s.concat(t.getLineStrings()):e===a.a.MULTI_POLYGON?s=s.concat(t.getPolygons()):e===a.a.POINT||e===a.a.LINE_STRING||e===a.a.POLYGON?s.push(t):Object(g.a)(!1,39)})),r=pr):o===a.a.MULTI_POINT?(s=e.getPoints(),r=dr):o===a.a.MULTI_LINE_STRING?(s=e.getLineStrings(),r=fr):o===a.a.MULTI_POLYGON?(s=e.getPolygons(),r=yr):Object(g.a)(!1,39),Q(i,mr,r,s,n)}var _r=K(Ye,{LinearRing:q(Tr)});function br(t,e,n){Q({node:t},_r,gr,[e],n)}var wr=K(Ye,{ExtendedData:q((function(t,e,n){for(var r={node:t},i=e.names,o=e.values,a=i.length,s=0;s<a;s++)Q(r,Jn,er,[{name:i[s],value:o[s]}],n)})),MultiGeometry:q(vr),LineString:q(Tr),LinearRing:q(Tr),Point:q(Tr),Polygon:q(Mr),Style:q((function(t,e,n){var r={node:t},i={};if(e.pointStyles.length){var o=e.pointStyles[0].getText();o&&(i.LabelStyle=o);var a=e.pointStyles[0].getImage();a&&"function"==typeof a.getSrc&&(i.IconStyle=a)}if(e.lineStyles.length){(s=e.lineStyles[0].getStroke())&&(i.LineStyle=s)}if(e.polyStyles.length){var s;(s=e.polyStyles[0].getStroke())&&!i.LineStyle&&(i.LineStyle=s),i.PolyStyle=e.polyStyles[0]}var l=n[n.length-1].node,u=Ar[l.namespaceURI],c=H(i,u);Q(r,kr,W,c,n,u)})),address:q(xt),description:q(xt),name:q(xt),open:q(_t),phoneNumber:q(xt),styleUrl:q(xt),visibility:q(_t)}),xr=K(Ye,["name","open","visibility","address","phoneNumber","description","styleUrl","Style"]),Er=X("ExtendedData");function Sr(t,e,n){var r={node:t};e.getId()&&t.setAttribute("id",e.getId());var i=e.getProperties(),o={address:1,description:1,name:1,open:1,phoneNumber:1,styleUrl:1,visibility:1};o[e.getGeometryName()]=1;var s=Object.keys(i||{}).sort().filter((function(t){return!o[t]})),l=e.getStyleFunction();if(l){var u=l(e,0);if(u){var c=Array.isArray(u)?u:[u],h=c;if(e.getGeometry()&&(h=c.filter((function(t){var n=t.getGeometryFunction()(e);if(n){var r=n.getType();return r===a.a.GEOMETRY_COLLECTION?n.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return e===a.a.POINT||e===a.a.MULTI_POINT})).length:r===a.a.POINT||r===a.a.MULTI_POINT}}))),this.writeStyles_){var p=c,d=c;e.getGeometry()&&(p=c.filter((function(t){var n=t.getGeometryFunction()(e);if(n){var r=n.getType();return r===a.a.GEOMETRY_COLLECTION?n.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return e===a.a.LINE_STRING||e===a.a.MULTI_LINE_STRING})).length:r===a.a.LINE_STRING||r===a.a.MULTI_LINE_STRING}})),d=c.filter((function(t){var n=t.getGeometryFunction()(e);if(n){var r=n.getType();return r===a.a.GEOMETRY_COLLECTION?n.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return e===a.a.POLYGON||e===a.a.MULTI_POLYGON})).length:r===a.a.POLYGON||r===a.a.MULTI_POLYGON}}))),i.Style={pointStyles:h,lineStyles:p,polyStyles:d}}if(h.length&&void 0===i.name){var f=h[0].getText();f&&(i.name=f.getText())}}}var g=n[n.length-1].node,y=xr[g.namespaceURI],m=H(i,y);if(Q(r,wr,W,m,n,y),s.length>0){var v=H(i,s);Q(r,wr,Er,[{names:s,values:v}],n)}var _=n[0],b=e.getGeometry();b&&(b=Object(w.c)(b,!0,_)),Q(r,wr,pr,[b],n)}var Or=K(Ye,["extrude","tessellate","altitudeMode","coordinates"]),Cr=K(Ye,{extrude:q(_t),tessellate:q(_t),altitudeMode:q(xt),coordinates:q((function(t,e,n){var r,i=n[n.length-1],a=i.layout,s=i.stride;a==o.a.XY||a==o.a.XYM?r=2:a==o.a.XYZ||a==o.a.XYZM?r=3:Object(g.a)(!1,34);var l=e.length,u="";if(l>0){u+=e[0];for(var c=1;c<r;++c)u+=","+e[c];for(var h=s;h<l;h+=s){u+=" "+e[h];for(c=1;c<r;++c)u+=","+e[h+c]}}xt(t,u)}))});function Tr(t,e,n){var r=e.getFlatCoordinates(),i={node:t};i.layout=e.getLayout(),i.stride=e.getStride();var o=e.getProperties();o.coordinates=r;var a=n[n.length-1].node,s=Or[a.namespaceURI],l=H(o,s);Q(i,Cr,W,l,n,s)}var Ir=K(Ye,["color","fill","outline"]),Lr=K(Ye,{outerBoundaryIs:q(br),innerBoundaryIs:q(br)}),Pr=X("innerBoundaryIs"),Rr=X("outerBoundaryIs");function Mr(t,e,n){var r=e.getLinearRings(),i=r.shift(),o={node:t};Q(o,Lr,Pr,r,n),Q(o,Lr,Rr,[i],n)}var Nr=K(Ye,{color:q($n),fill:q(_t),outline:q(_t)});function jr(t,e){bt(t,Math.round(1e6*e)/1e6)}var Ar=K(Ye,["IconStyle","LabelStyle","LineStyle","PolyStyle"]),kr=K(Ye,{IconStyle:q((function(t,e,n){var r={node:t},i={},o=e.getSrc(),a=e.getSize(),s=e.getImageSize(),l={href:o};if(a){l.w=a[0],l.h=a[1];var u=e.getAnchor(),c=e.getOrigin();if(c&&s&&0!==c[0]&&c[1]!==a[1]&&(l.x=c[0],l.y=s[1]-(c[1]+a[1])),u&&(u[0]!==a[0]/2||u[1]!==a[1]/2)){var h={x:u[0],xunits:ke.a.PIXELS,y:a[1]-u[1],yunits:ke.a.PIXELS};i.hotSpot=h}}i.Icon=l;var p=e.getScale();1!==p&&(i.scale=p);var d=e.getRotation();0!==d&&(i.heading=d);var f=e.getColor();f&&(i.color=f);var g=n[n.length-1].node,y=or[g.namespaceURI],m=H(i,y);Q(r,ar,W,m,n,y)})),LabelStyle:q((function(t,e,n){var r={node:t},i={},o=e.getFill();o&&(i.color=o.getColor());var a=e.getScale();a&&1!==a&&(i.scale=a);var s=n[n.length-1].node,l=sr[s.namespaceURI],u=H(i,l);Q(r,lr,W,u,n,l)})),LineStyle:q((function(t,e,n){var r={node:t},i={color:e.getColor(),width:Number(e.getWidth())||1},o=n[n.length-1].node,a=ur[o.namespaceURI],s=H(i,a);Q(r,cr,W,s,n,a)})),PolyStyle:q((function(t,e,n){var r={node:t},i=e.getFill(),o=e.getStroke(),a={color:i?i.getColor():void 0,fill:!!i&&void 0,outline:!!o&&void 0},s=n[n.length-1].node,l=Ir[s.namespaceURI],u=H(a,l);Q(r,Nr,W,u,n,l)}))});var Fr=cn,Dr=n(147),Gr=function(){function t(){}return t.prototype.read=function(t){if(t){if("string"==typeof t){var e=D(t);return this.readFromDocument(e)}return F(t)?this.readFromDocument(t):this.readFromNode(t)}return null},t.prototype.readFromDocument=function(t){for(var e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE)return this.readFromNode(e);return null},t.prototype.readFromNode=function(t){},t}();function zr(t){return t.getAttributeNS("http://www.w3.org/1999/xlink","href")}var Ur=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Br=[null,"http://www.opengis.net/ows/1.1"],Vr=K(Br,{ServiceIdentification:V((function(t,e){return $({},ni,t,e)})),ServiceProvider:V((function(t,e){return $({},ri,t,e)})),OperationsMetadata:V((function(t,e){return $({},Jr,t,e)}))}),qr=function(t){function e(){return t.call(this)||this}return Ur(e,t),e.prototype.readFromNode=function(t){var e=$({},Vr,t,[]);return e||null},e}(Gr),Yr=K(Br,{DeliveryPoint:V(vt),City:V(vt),AdministrativeArea:V(vt),PostalCode:V(vt),Country:V(vt),ElectronicMailAddress:V(vt)}),Xr=K(Br,{Value:B((function(t,e){return vt(t)}))}),Wr=K(Br,{AllowedValues:V((function(t,e){return $({},Xr,t,e)}))}),Hr=K(Br,{Phone:V((function(t,e){return $({},Qr,t,e)})),Address:V((function(t,e){return $({},Yr,t,e)}))}),Kr=K(Br,{HTTP:V((function(t,e){return $({},Zr,t,e)}))}),Zr=K(Br,{Get:B((function(t,e){var n=zr(t);if(!n)return;return $({href:n},ti,t,e)})),Post:void 0}),$r=K(Br,{DCP:V((function(t,e){return $({},Kr,t,e)}))}),Jr=K(Br,{Operation:function(t,e){var n=t.getAttribute("name"),r=$({},$r,t,e);if(!r)return;e[e.length-1][n]=r}}),Qr=K(Br,{Voice:V(vt),Facsimile:V(vt)}),ti=K(Br,{Constraint:B((function(t,e){var n=t.getAttribute("name");if(!n)return;return $({name:n},Wr,t,e)}))}),ei=K(Br,{IndividualName:V(vt),PositionName:V(vt),ContactInfo:V((function(t,e){return $({},Hr,t,e)}))}),ni=K(Br,{Abstract:V(vt),AccessConstraints:V(vt),Fees:V(vt),Title:V(vt),ServiceTypeVersion:V(vt),ServiceType:V(vt)}),ri=K(Br,{ProviderName:V(vt),ProviderSite:V(zr),ServiceContact:V((function(t,e){return $({},ei,t,e)}))});var ii=qr;function oi(t,e,n,r,i,o){var a,s;void 0!==i?(a=i,s=void 0!==o?o:0):(a=[],s=0);for(var l=e;l<n;){var u=t[l++];a[s++]=t[l++],a[s++]=u;for(var c=2;c<r;++c)a[s++]=t[l++]}return a.length=s,a}var ai=n(62),si=n(75),li=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();function ui(t){for(var e,n="";t>=32;)e=63+(32|31&t),n+=String.fromCharCode(e),t>>=5;return e=t+63,n+=String.fromCharCode(e)}var ci=function(t){function e(e){var n=t.call(this)||this,r=e||{};return n.dataProjection=Object(_.get)("EPSG:4326"),n.factor_=r.factor?r.factor:1e5,n.geometryLayout_=r.geometryLayout?r.geometryLayout:o.a.XY,n}return li(e,t),e.prototype.readFeatureFromText=function(t,e){var n=this.readGeometryFromText(t,e);return new i.a(n)},e.prototype.readFeaturesFromText=function(t,e){return[this.readFeatureFromText(t,e)]},e.prototype.readGeometryFromText=function(t,e){var n=Object(ai.b)(this.geometryLayout_),r=function(t,e,n){var r,i=n||1e5,o=new Array(e);for(r=0;r<e;++r)o[r]=0;for(var a=function(t,e){for(var n=e||1e5,r=function(t){for(var e=function(t){for(var e=[],n=0,r=0,i=0,o=t.length;i<o;++i){var a=t.charCodeAt(i)-63;n|=(31&a)<<r,a<32?(e.push(n),n=0,r=0):r+=5}return e}(t),n=0,r=e.length;n<r;++n){var i=e[n];e[n]=1&i?~(i>>1):i>>1}return e}(t),i=0,o=r.length;i<o;++i)r[i]/=n;return r}(t,i),s=0,l=a.length;s<l;)for(r=0;r<e;++r,++s)o[r]+=a[s],a[s]=o[r];return a}(t,n,this.factor_);oi(r,0,r.length,n,r);var i=Object(si.a)(r,0,r.length,n),o=new l.a(i,this.geometryLayout_);return Object(w.c)(o,!1,this.adaptOptions(e))},e.prototype.writeFeatureText=function(t,e){var n=t.getGeometry();return n?this.writeGeometryText(n,e):(Object(g.a)(!1,40),"")},e.prototype.writeFeaturesText=function(t,e){return this.writeFeatureText(t[0],e)},e.prototype.writeGeometryText=function(t,e){var n=(t=Object(w.c)(t,!0,this.adaptOptions(e))).getFlatCoordinates(),r=t.getStride();return oi(n,0,n.length,r,n),function(t,e,n){var r,i=n||1e5,o=new Array(e);for(r=0;r<e;++r)o[r]=0;for(var a=0,s=t.length;a<s;)for(r=0;r<e;++r,++a){var l=t[a],u=l-o[r];o[r]=l,t[a]=u}return function(t,e){for(var n=e||1e5,r=0,i=t.length;r<i;++r)t[r]=Math.round(t[r]*n);return function(t){for(var e=0,n=t.length;e<n;++e){var r=t[e];t[e]=r<0?~(r<<1):r<<1}return function(t){for(var e="",n=0,r=t.length;n<r;++n)e+=ui(t[n]);return e}(t)}(t)}(t,i)}(n,r,this.factor_)},e}(xe.a),hi=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),pi=function(t){function e(e){var n=t.call(this)||this,r=e||{};return n.layerName_=r.layerName,n.layers_=r.layers?r.layers:null,n.dataProjection=Object(_.get)(r.dataProjection?r.dataProjection:"EPSG:4326"),n}return hi(e,t),e.prototype.readFeaturesFromObject=function(t,e){if("Topology"==t.type){var n=t,r=void 0,i=null,o=null;n.transform&&(i=(r=n.transform).scale,o=r.translate);var a=n.arcs;r&&function(t,e,n){for(var r=0,i=t.length;r<i;++r)mi(t[r],e,n)}(a,i,o);var s=[],l=n.objects,u=this.layerName_,c=void 0;for(var h in l)this.layers_&&-1==this.layers_.indexOf(h)||("GeometryCollection"===l[h].type?(c=l[h],s.push.apply(s,gi(c,a,i,o,u,h,e))):(c=l[h],s.push(yi(c,a,i,o,u,h,e))));return s}return[]},e.prototype.readProjectionFromObject=function(t){return this.dataProjection},e}(s.a),di={Point:function(t,e,n){var r=t.coordinates;e&&n&&vi(r,e,n);return new d.a(r)},LineString:function(t,e){var n=fi(t.arcs,e);return new l.a(n)},Polygon:function(t,e){for(var n=[],r=0,i=t.arcs.length;r<i;++r)n[r]=fi(t.arcs[r],e);return new f.a(n)},MultiPoint:function(t,e,n){var r=t.coordinates;if(e&&n)for(var i=0,o=r.length;i<o;++i)vi(r[i],e,n);return new h.a(r)},MultiLineString:function(t,e){for(var n=[],r=0,i=t.arcs.length;r<i;++r)n[r]=fi(t.arcs[r],e);return new c.a(n)},MultiPolygon:function(t,e){for(var n=[],r=0,i=t.arcs.length;r<i;++r){for(var o=t.arcs[r],a=[],s=0,l=o.length;s<l;++s)a[s]=fi(o[s],e);n[r]=a}return new p.a(n)}};function fi(t,e){for(var n,r,i=[],o=0,a=t.length;o<a;++o)n=t[o],o>0&&i.pop(),r=n>=0?e[n]:e[~n].slice().reverse(),i.push.apply(i,r);for(var s=0,l=i.length;s<l;++s)i[s]=i[s].slice();return i}function gi(t,e,n,r,i,o,a){for(var s=t.geometries,l=[],u=0,c=s.length;u<c;++u)l[u]=yi(s[u],e,n,r,i,o,a);return l}function yi(t,e,n,r,o,a,s){var l=null,u=t.type;if(u){var c=di[u];l="Point"===u||"MultiPoint"===u?c(t,n,r):c(t,e),l=Object(w.c)(l,!1,s)}var h=new i.a({geometry:l});void 0!==t.id&&h.setId(t.id);var p=t.properties;return o&&(p||(p={}),p[o]=a),p&&h.setProperties(p,!0),h}function mi(t,e,n){for(var r=0,i=0,o=0,a=t.length;o<a;++o){var s=t[o];r+=s[0],i+=s[1],s[0]=r,s[1]=i,vi(s,e,n)}}function vi(t,e,n){t[0]=t[0]*e[0]+n[0],t[1]=t[1]*e[1]+n[1]}var _i=pi,bi=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),wi=function(t){function e(e){var n=this,r=e||{};return(n=t.call(this,r)||this).schemaLocation=r.schemaLocation?r.schemaLocation:n.namespace+" http://schemas.opengis.net/gml/3.2.1/gml.xsd",n}return bi(e,t),e}(Pt);wi.prototype.namespace="http://www.opengis.net/gml/3.2",wi.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS={"http://www.opengis.net/gml/3.2":{pos:U(Pt.prototype.readFlatPos),posList:U(Pt.prototype.readFlatPosList),coordinates:U(Ct.prototype.readFlatCoordinates)}},wi.prototype.FLAT_LINEAR_RINGS_PARSERS={"http://www.opengis.net/gml/3.2":{interior:Pt.prototype.interiorParser,exterior:Pt.prototype.exteriorParser}},wi.prototype.GEOMETRY_PARSERS={"http://www.opengis.net/gml/3.2":{Point:U(ut.prototype.readPoint),MultiPoint:U(ut.prototype.readMultiPoint),LineString:U(ut.prototype.readLineString),MultiLineString:U(ut.prototype.readMultiLineString),LinearRing:U(ut.prototype.readLinearRing),Polygon:U(ut.prototype.readPolygon),MultiPolygon:U(ut.prototype.readMultiPolygon),Surface:U(wi.prototype.readSurface),MultiSurface:U(Pt.prototype.readMultiSurface),Curve:U(wi.prototype.readCurve),MultiCurve:U(Pt.prototype.readMultiCurve),Envelope:U(wi.prototype.readEnvelope)}},wi.prototype.MULTICURVE_PARSERS={"http://www.opengis.net/gml/3.2":{curveMember:z(Pt.prototype.curveMemberParser),curveMembers:z(Pt.prototype.curveMemberParser)}},wi.prototype.MULTISURFACE_PARSERS={"http://www.opengis.net/gml/3.2":{surfaceMember:z(Pt.prototype.surfaceMemberParser),surfaceMembers:z(Pt.prototype.surfaceMemberParser)}},wi.prototype.CURVEMEMBER_PARSERS={"http://www.opengis.net/gml/3.2":{LineString:z(ut.prototype.readLineString),Curve:z(Pt.prototype.readCurve)}},wi.prototype.SURFACEMEMBER_PARSERS={"http://www.opengis.net/gml/3.2":{Polygon:z(ut.prototype.readPolygon),Surface:z(Pt.prototype.readSurface)}},wi.prototype.SURFACE_PARSERS={"http://www.opengis.net/gml/3.2":{patches:U(Pt.prototype.readPatch)}},wi.prototype.CURVE_PARSERS={"http://www.opengis.net/gml/3.2":{segments:U(Pt.prototype.readSegment)}},wi.prototype.ENVELOPE_PARSERS={"http://www.opengis.net/gml/3.2":{lowerCorner:z(Pt.prototype.readFlatPosList),upperCorner:z(Pt.prototype.readFlatPosList)}},wi.prototype.PATCHES_PARSERS={"http://www.opengis.net/gml/3.2":{PolygonPatch:U(Pt.prototype.readPolygonPatch)}},wi.prototype.SEGMENTS_PARSERS={"http://www.opengis.net/gml/3.2":{LineStringSegment:U(Pt.prototype.readLineStringSegment)}},wi.prototype.MULTIPOINT_PARSERS={"http://www.opengis.net/gml/3.2":{pointMember:z(ut.prototype.pointMemberParser),pointMembers:z(ut.prototype.pointMemberParser)}},wi.prototype.MULTILINESTRING_PARSERS={"http://www.opengis.net/gml/3.2":{lineStringMember:z(ut.prototype.lineStringMemberParser),lineStringMembers:z(ut.prototype.lineStringMemberParser)}},wi.prototype.MULTIPOLYGON_PARSERS={"http://www.opengis.net/gml/3.2":{polygonMember:z(ut.prototype.polygonMemberParser),polygonMembers:z(ut.prototype.polygonMemberParser)}},wi.prototype.POINTMEMBER_PARSERS={"http://www.opengis.net/gml/3.2":{Point:z(ut.prototype.readFlatCoordinatesFromNode)}},wi.prototype.LINESTRINGMEMBER_PARSERS={"http://www.opengis.net/gml/3.2":{LineString:z(ut.prototype.readLineString)}},wi.prototype.POLYGONMEMBER_PARSERS={"http://www.opengis.net/gml/3.2":{Polygon:z(ut.prototype.readPolygon)}},wi.prototype.RING_PARSERS={"http://www.opengis.net/gml/3.2":{LinearRing:U(ut.prototype.readFlatLinearRing)}},wi.prototype.RING_SERIALIZERS={"http://www.opengis.net/gml/3.2":{exterior:q(Pt.prototype.writeRing),interior:q(Pt.prototype.writeRing)}},wi.prototype.ENVELOPE_SERIALIZERS={"http://www.opengis.net/gml/3.2":{lowerCorner:q(xt),upperCorner:q(xt)}},wi.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS={"http://www.opengis.net/gml/3.2":{surfaceMember:q(Pt.prototype.writeSurfaceOrPolygonMember),polygonMember:q(Pt.prototype.writeSurfaceOrPolygonMember)}},wi.prototype.POINTMEMBER_SERIALIZERS={"http://www.opengis.net/gml/3.2":{pointMember:q(Pt.prototype.writePointMember)}},wi.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS={"http://www.opengis.net/gml/3.2":{lineStringMember:q(Pt.prototype.writeLineStringOrCurveMember),curveMember:q(Pt.prototype.writeLineStringOrCurveMember)}},wi.prototype.GEOMETRY_SERIALIZERS={"http://www.opengis.net/gml/3.2":{Curve:q(Pt.prototype.writeCurveOrLineString),MultiCurve:q(Pt.prototype.writeMultiCurveOrLineString),Point:q(wi.prototype.writePoint),MultiPoint:q(Pt.prototype.writeMultiPoint),LineString:q(Pt.prototype.writeCurveOrLineString),MultiLineString:q(Pt.prototype.writeMultiCurveOrLineString),LinearRing:q(Pt.prototype.writeLinearRing),Polygon:q(Pt.prototype.writeSurfaceOrPolygon),MultiPolygon:q(Pt.prototype.writeMultiSurfaceOrPolygon),Surface:q(Pt.prototype.writeSurfaceOrPolygon),MultiSurface:q(Pt.prototype.writeMultiSurfaceOrPolygon),Envelope:q(Pt.prototype.writeEnvelope)}};var xi=wi,Ei=function(){function t(t){this.tagName_=t}return t.prototype.getTagName=function(){return this.tagName_},t}(),Si=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Oi=function(t){function e(e,n){var r=t.call(this,e)||this;return r.conditions=n,Object(g.a)(r.conditions.length>=2,57),r}return Si(e,t),e}(Ei),Ci=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ti=function(t){function e(e){return t.call(this,"And",Array.prototype.slice.call(arguments))||this}return Ci(e,t),e}(Oi),Ii=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Li=function(t){function e(e,n,r){var i=t.call(this,"BBOX")||this;if(i.geometryName=e,i.extent=n,4!==n.length)throw new Error("Expected an extent with four values ([minX, minY, maxX, maxY])");return i.srsName=r,i}return Ii(e,t),e}(Ei),Pi=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ri=function(t){function e(e,n,r,i){var o=t.call(this,e)||this;return o.geometryName=n||"the_geom",o.geometry=r,o.srsName=i,o}return Pi(e,t),e}(Ei),Mi=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ni=(function(t){function e(e,n,r){return t.call(this,"Contains",e,n,r)||this}Mi(e,t)}(Ri),function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),ji=(function(t){function e(e,n,r,i,o){var a=t.call(this,"DWithin",e,n,o)||this;return a.distance=r,a.unit=i,a}Ni(e,t)}(Ri),function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),Ai=(function(t){function e(e,n,r){return t.call(this,"Disjoint",e,n,r)||this}ji(e,t)}(Ri),function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),ki=function(t){function e(e,n){var r=t.call(this,e)||this;return r.propertyName=n,r}return Ai(e,t),e}(Ei),Fi=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Di=(function(t){function e(e,n,r){var i=t.call(this,"During",e)||this;return i.begin=n,i.end=r,i}Fi(e,t)}(ki),function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),Gi=function(t){function e(e,n,r,i){var o=t.call(this,e,n)||this;return o.expression=r,o.matchCase=i,o}return Di(e,t),e}(ki),zi=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ui=(function(t){function e(e,n,r){return t.call(this,"PropertyIsEqualTo",e,n,r)||this}zi(e,t)}(Gi),function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),Bi=(function(t){function e(e,n){return t.call(this,"PropertyIsGreaterThan",e,n)||this}Ui(e,t)}(Gi),function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),Vi=(function(t){function e(e,n){return t.call(this,"PropertyIsGreaterThanOrEqualTo",e,n)||this}Bi(e,t)}(Gi),function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),qi=(function(t){function e(e,n,r){return t.call(this,"Intersects",e,n,r)||this}Vi(e,t)}(Ri),function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),Yi=(function(t){function e(e,n,r){var i=t.call(this,"PropertyIsBetween",e)||this;return i.lowerBoundary=n,i.upperBoundary=r,i}qi(e,t)}(ki),function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),Xi=(function(t){function e(e,n,r,i,o,a){var s=t.call(this,"PropertyIsLike",e)||this;return s.pattern=n,s.wildCard=void 0!==r?r:"*",s.singleChar=void 0!==i?i:".",s.escapeChar=void 0!==o?o:"!",s.matchCase=a,s}Yi(e,t)}(ki),function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),Wi=(function(t){function e(e){return t.call(this,"PropertyIsNull",e)||this}Xi(e,t)}(ki),function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),Hi=(function(t){function e(e,n){return t.call(this,"PropertyIsLessThan",e,n)||this}Wi(e,t)}(Gi),function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),Ki=(function(t){function e(e,n){return t.call(this,"PropertyIsLessThanOrEqualTo",e,n)||this}Hi(e,t)}(Gi),function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),Zi=(function(t){function e(e){var n=t.call(this,"Not")||this;return n.condition=e,n}Ki(e,t)}(Ei),function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),$i=(function(t){function e(e,n,r){return t.call(this,"PropertyIsNotEqualTo",e,n,r)||this}Zi(e,t)}(Gi),function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),Ji=(function(t){function e(e){return t.call(this,"Or",Array.prototype.slice.call(arguments))||this}$i(e,t)}(Oi),function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),Qi=(function(t){function e(e){var n=t.call(this,"ResourceId")||this;return n.rid=e,n}Ji(e,t)}(Ei),function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}());!function(t){function e(e,n,r){return t.call(this,"Within",e,n,r)||this}Qi(e,t)}(Ri);var to=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),eo={"http://www.opengis.net/gml":{boundedBy:V(ut.prototype.readGeometryElement,"bounds")},"http://www.opengis.net/wfs/2.0":{member:z(ut.prototype.readFeaturesInternal)}},no={"http://www.opengis.net/wfs":{totalInserted:V(yt),totalUpdated:V(yt),totalDeleted:V(yt)},"http://www.opengis.net/wfs/2.0":{totalInserted:V(yt),totalUpdated:V(yt),totalDeleted:V(yt)}},ro={"http://www.opengis.net/wfs":{TransactionSummary:V(go,"transactionSummary"),InsertResults:V(_o,"insertIds")},"http://www.opengis.net/wfs/2.0":{TransactionSummary:V(go,"transactionSummary"),InsertResults:V(_o,"insertIds")}},io={"http://www.opengis.net/wfs":{PropertyName:q(xt)},"http://www.opengis.net/wfs/2.0":{PropertyName:q(xt)}},oo={"http://www.opengis.net/wfs":{Insert:q(bo),Update:q(So),Delete:q(Eo),Property:q(Oo),Native:q(Co)},"http://www.opengis.net/wfs/2.0":{Insert:q(bo),Update:q(So),Delete:q(Eo),Property:q(Oo),Native:q(Co)}},ao="http://www.w3.org/2000/xmlns/",so={"2.0.0":"http://www.opengis.net/ogc/1.1","1.1.0":"http://www.opengis.net/ogc","1.0.0":"http://www.opengis.net/ogc"},lo={"2.0.0":"http://www.opengis.net/wfs/2.0","1.1.0":"http://www.opengis.net/wfs","1.0.0":"http://www.opengis.net/wfs"},uo={"2.0.0":"http://www.opengis.net/fes/2.0","1.1.0":"http://www.opengis.net/fes","1.0.0":"http://www.opengis.net/fes"},co={"2.0.0":"http://www.opengis.net/wfs/2.0 http://schemas.opengis.net/wfs/2.0/wfs.xsd","1.1.0":"http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd","1.0.0":"http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/wfs.xsd"},ho={"2.0.0":xi,"1.1.0":Pt,"1.0.0":Ct},po=function(t){function e(e){var n=t.call(this)||this,r=e||{};return n.version_=r.version?r.version:"1.1.0",n.featureType_=r.featureType,n.featureNS_=r.featureNS,n.gmlFormat_=r.gmlFormat?r.gmlFormat:new ho[n.version_],n.schemaLocation_=r.schemaLocation?r.schemaLocation:co[n.version_],n}return to(e,t),e.prototype.getFeatureType=function(){return this.featureType_},e.prototype.setFeatureType=function(t){this.featureType_=t},e.prototype.readFeaturesFromNode=function(t,e){var n={node:t};Object(y.a)(n,{featureType:this.featureType_,featureNS:this.featureNS_}),Object(y.a)(n,this.getReadOptions(t,e||{}));var r=[n],i=$([],"2.0.0"===this.version_?eo:this.gmlFormat_.FEATURE_COLLECTION_PARSERS,t,r,this.gmlFormat_);return i||(i=[]),i},e.prototype.readTransactionResponse=function(t){if(t){if("string"==typeof t){var e=D(t);return this.readTransactionResponseFromDocument(e)}return F(t)?this.readTransactionResponseFromDocument(t):this.readTransactionResponseFromNode(t)}},e.prototype.readFeatureCollectionMetadata=function(t){if(t){if("string"==typeof t){var e=D(t);return this.readFeatureCollectionMetadataFromDocument(e)}return F(t)?this.readFeatureCollectionMetadataFromDocument(t):this.readFeatureCollectionMetadataFromNode(t)}},e.prototype.readFeatureCollectionMetadataFromDocument=function(t){for(var e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE)return this.readFeatureCollectionMetadataFromNode(e)},e.prototype.readFeatureCollectionMetadataFromNode=function(t){var e={},n=mt(t.getAttribute("numberOfFeatures"));return e.numberOfFeatures=n,$(e,eo,t,[],this.gmlFormat_)},e.prototype.readTransactionResponseFromDocument=function(t){for(var e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE)return this.readTransactionResponseFromNode(e)},e.prototype.readTransactionResponseFromNode=function(t){return $({},ro,t,[])},e.prototype.writeGetFeature=function(t){var e=this,n=A(lo[this.version_],"GetFeature");n.setAttribute("service","WFS"),n.setAttribute("version",this.version_),t.handle&&n.setAttribute("handle",t.handle),t.outputFormat&&n.setAttribute("outputFormat",t.outputFormat),void 0!==t.maxFeatures&&n.setAttribute("maxFeatures",String(t.maxFeatures)),t.resultType&&n.setAttribute("resultType",t.resultType),void 0!==t.startIndex&&n.setAttribute("startIndex",String(t.startIndex)),void 0!==t.count&&n.setAttribute("count",String(t.count)),void 0!==t.viewParams&&n.setAttribute("viewParams",t.viewParams),n.setAttributeNS(j,"xsi:schemaLocation",this.schemaLocation_);var r={node:n};if(Object(y.a)(r,{version:this.version_,srsName:t.srsName,featureNS:t.featureNS?t.featureNS:this.featureNS_,featurePrefix:t.featurePrefix,propertyNames:t.propertyNames?t.propertyNames:[]}),Object(g.a)(Array.isArray(t.featureTypes),11),"string"==typeof t.featureTypes[0]){var i=t.filter;t.bbox&&(Object(g.a)(t.geometryName,12),i=this.combineBboxAndFilter(t.geometryName,t.bbox,t.srsName,i)),Object(y.a)(r,{geometryName:t.geometryName,filter:i}),qo(n,t.featureTypes,[r])}else t.featureTypes.forEach((function(i){var o=e.combineBboxAndFilter(i.geometryName,i.bbox,t.srsName,t.filter);Object(y.a)(r,{geometryName:i.geometryName,filter:o}),qo(n,[i.name],[r])}));return n},e.prototype.combineBboxAndFilter=function(t,e,n,r){var i=function(t,e,n){return new Li(t,e,n)}(t,e,n);return r?function(t){var e=[null].concat(Array.prototype.slice.call(arguments));return new(Function.prototype.bind.apply(Ti,e))}(r,i):i},e.prototype.writeTransaction=function(t,e,n,r){var i,o=[],a=r.version?r.version:this.version_,s=A(lo[a],"Transaction");s.setAttribute("service","WFS"),s.setAttribute("version",a),r&&(i=r.gmlOptions?r.gmlOptions:{},r.handle&&s.setAttribute("handle",r.handle)),s.setAttributeNS(j,"xsi:schemaLocation",co[a]);var l=function(t,e,n,r){var i,o=r.featurePrefix?r.featurePrefix:"feature";"1.0.0"===n?i=2:"1.1.0"===n?i=3:"2.0.0"===n&&(i=3.2);return Object(y.a)({node:t},{version:n,featureNS:r.featureNS,featureType:r.featureType,featurePrefix:o,gmlVersion:i,hasZ:r.hasZ,srsName:r.srsName},e)}(s,i,a,r);return t&&fo("Insert",t,o,l),e&&fo("Update",e,o,l),n&&fo("Delete",n,o,l),r.nativeElements&&fo("Native",r.nativeElements,o,l),s},e.prototype.readProjectionFromDocument=function(t){for(var e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE)return this.readProjectionFromNode(e);return null},e.prototype.readProjectionFromNode=function(t){if(t.firstElementChild&&t.firstElementChild.firstElementChild)for(var e=(t=t.firstElementChild.firstElementChild).firstElementChild;e;e=e.nextElementSibling)if(0!==e.childNodes.length&&(1!==e.childNodes.length||3!==e.firstChild.nodeType)){var n=[{}];return this.gmlFormat_.readGeometryElement(e,n),Object(_.get)(n.pop().srsName)}return null},e}(it);function fo(t,e,n,r){Q(r,oo,X(t),e,n)}function go(t,e){return $({},no,t,e)}var yo={"http://www.opengis.net/ogc":{FeatureId:z((function(t,e){return t.getAttribute("fid")}))},"http://www.opengis.net/ogc/1.1":{FeatureId:z((function(t,e){return t.getAttribute("fid")}))}};function mo(t,e){Z(yo,t,e)}var vo={"http://www.opengis.net/wfs":{Feature:mo},"http://www.opengis.net/wfs/2.0":{Feature:mo}};function _o(t,e){return $([],vo,t,e)}function bo(t,e,n){var r=n[n.length-1],i=r.featureType,o=r.featureNS,a=r.gmlVersion,s=A(o,i);t.appendChild(s),2===a?Ct.prototype.writeFeatureElement(s,e,n):3===a?Pt.prototype.writeFeatureElement(s,e,n):xi.prototype.writeFeatureElement(s,e,n)}function wo(t,e,n){var r=n[n.length-1].version,i=so[r],o=A(i,"Filter"),a=A(i,"FeatureId");o.appendChild(a),a.setAttribute("fid",e),t.appendChild(o)}function xo(t,e){var n=(t=t||"feature")+":";return 0===e.indexOf(n)?e:n+e}function Eo(t,e,n){var r=n[n.length-1];Object(g.a)(void 0!==e.getId(),26);var i=r.featureType,o=r.featurePrefix,a=r.featureNS,s=xo(o,i);t.setAttribute("typeName",s),t.setAttributeNS(ao,"xmlns:"+o,a);var l=e.getId();void 0!==l&&wo(t,l,n)}function So(t,e,n){var r=n[n.length-1];Object(g.a)(void 0!==e.getId(),27);var i=r.version,o=r.featureType,a=r.featurePrefix,s=r.featureNS,l=xo(a,o),u=e.getGeometryName();t.setAttribute("typeName",l),t.setAttributeNS(ao,"xmlns:"+a,s);var c=e.getId();if(void 0!==c){for(var h=e.getKeys(),p=[],d=0,f=h.length;d<f;d++){var y=e.get(h[d]);if(void 0!==y){var m=h[d];y&&"function"==typeof y.getSimplifiedGeometry&&(m=u),p.push({name:m,value:y})}}Q({version:i,gmlVersion:r.gmlVersion,node:t,hasZ:r.hasZ,srsName:r.srsName},oo,X("Property"),p,n),wo(t,c,n)}}function Oo(t,e,n){var r=n[n.length-1],i=r.version,o=lo[i],a=A(o,"Name"),s=r.gmlVersion;if(t.appendChild(a),xt(a,e.name),void 0!==e.value&&null!==e.value){var l=A(o,"Value");t.appendChild(l),e.value&&"function"==typeof e.value.getSimplifiedGeometry?2===s?Ct.prototype.writeGeometryElement(l,e.value,n):3===s?Pt.prototype.writeGeometryElement(l,e.value,n):xi.prototype.writeGeometryElement(l,e.value,n):xt(l,e.value)}}function Co(t,e,n){e.vendorId&&t.setAttribute("vendorId",e.vendorId),void 0!==e.safeToIgnore&&t.setAttribute("safeToIgnore",String(e.safeToIgnore)),void 0!==e.value&&xt(t,e.value)}var To={"http://www.opengis.net/wfs":{Query:q(Io)},"http://www.opengis.net/wfs/2.0":{Query:q(Io)},"http://www.opengis.net/ogc":{During:q(No),And:q(jo),Or:q(jo),Not:q(Ao),BBOX:q(Po),Contains:q(Ro),Intersects:q(Ro),Within:q(Ro),DWithin:q(Mo),PropertyIsEqualTo:q(ko),PropertyIsNotEqualTo:q(ko),PropertyIsLessThan:q(ko),PropertyIsLessThanOrEqualTo:q(ko),PropertyIsGreaterThan:q(ko),PropertyIsGreaterThanOrEqualTo:q(ko),PropertyIsNull:q(Fo),PropertyIsBetween:q(Do),PropertyIsLike:q(Go)},"http://www.opengis.net/fes/2.0":{During:q(No),And:q(jo),Or:q(jo),Not:q(Ao),BBOX:q(Po),Contains:q(Ro),Disjoint:q(Ro),Intersects:q(Ro),ResourceId:q((function(t,e,n){t.setAttribute("rid",e.rid)})),Within:q(Ro),DWithin:q(Mo),PropertyIsEqualTo:q(ko),PropertyIsNotEqualTo:q(ko),PropertyIsLessThan:q(ko),PropertyIsLessThanOrEqualTo:q(ko),PropertyIsGreaterThan:q(ko),PropertyIsGreaterThanOrEqualTo:q(ko),PropertyIsNull:q(Fo),PropertyIsBetween:q(Do),PropertyIsLike:q(Go)}};function Io(t,e,n){var r,i,o=n[n.length-1],a=o.version,s=o.featurePrefix,l=o.featureNS,u=o.propertyNames,c=o.srsName;r=s?xo(s,e):e,i="2.0.0"===a?"typeNames":"typeName",t.setAttribute(i,r),c&&t.setAttribute("srsName",c),l&&t.setAttributeNS(ao,"xmlns:"+s,l);var h=Object(y.a)({},o);h.node=t,Q(h,io,X("PropertyName"),u,n);var p=o.filter;if(p){var d=A(Yo(a),"Filter");t.appendChild(d),Lo(d,p,n)}}function Lo(t,e,n){var r=n[n.length-1],i={node:t};Object(y.a)(i,{context:r}),Q(i,To,X(e.getTagName()),[e],n)}function Po(t,e,n){var r=n[n.length-1],i=r.context.version;r.srsName=e.srsName;var o=ho[i];Bo(i,t,e.geometryName),o.prototype.writeGeometryElement(t,e.extent,n)}function Ro(t,e,n){var r=n[n.length-1],i=r.context.version;r.srsName=e.srsName;var o=ho[i];Bo(i,t,e.geometryName),o.prototype.writeGeometryElement(t,e.geometry,n)}function Mo(t,e,n){var r=n[n.length-1].context.version;Ro(t,e,n);var i=A(Yo(r),"Distance");xt(i,e.distance.toString()),"2.0.0"===r?i.setAttribute("uom",e.unit):i.setAttribute("units",e.unit),t.appendChild(i)}function No(t,e,n){var r=n[n.length-1].context.version;zo(uo[r],"ValueReference",t,e.propertyName);var i=A(at,"TimePeriod");t.appendChild(i);var o=A(at,"begin");i.appendChild(o),Vo(o,e.begin);var a=A(at,"end");i.appendChild(a),Vo(a,e.end)}function jo(t,e,n){var r=n[n.length-1].context,i={node:t};Object(y.a)(i,{context:r});for(var o=e.conditions,a=0,s=o.length;a<s;++a){var l=o[a];Q(i,To,X(l.getTagName()),[l],n)}}function Ao(t,e,n){var r=n[n.length-1].context,i={node:t};Object(y.a)(i,{context:r});var o=e.condition;Q(i,To,X(o.getTagName()),[o],n)}function ko(t,e,n){var r=n[n.length-1].context.version;void 0!==e.matchCase&&t.setAttribute("matchCase",e.matchCase.toString()),Bo(r,t,e.propertyName),Uo(r,t,""+e.expression)}function Fo(t,e,n){Bo(n[n.length-1].context.version,t,e.propertyName)}function Do(t,e,n){var r=n[n.length-1].context.version,i=Yo(r);Bo(r,t,e.propertyName);var o=A(i,"LowerBoundary");t.appendChild(o),Uo(r,o,""+e.lowerBoundary);var a=A(i,"UpperBoundary");t.appendChild(a),Uo(r,a,""+e.upperBoundary)}function Go(t,e,n){var r=n[n.length-1].context.version;t.setAttribute("wildCard",e.wildCard),t.setAttribute("singleChar",e.singleChar),t.setAttribute("escapeChar",e.escapeChar),void 0!==e.matchCase&&t.setAttribute("matchCase",e.matchCase.toString()),Bo(r,t,e.propertyName),Uo(r,t,""+e.pattern)}function zo(t,e,n,r){var i=A(t,e);xt(i,r),n.appendChild(i)}function Uo(t,e,n){zo(Yo(t),"Literal",e,n)}function Bo(t,e,n){"2.0.0"===t?zo(uo[t],"ValueReference",e,n):zo(so[t],"PropertyName",e,n)}function Vo(t,e){var n=A(at,"TimeInstant");t.appendChild(n);var r=A(at,"timePosition");n.appendChild(r),xt(r,e)}function qo(t,e,n){var r=n[n.length-1],i=Object(y.a)({},r);i.node=t,Q(i,To,X("Query"),e,n)}function Yo(t){return"2.0.0"===t?uo[t]:so[t]}var Xo=po,Wo=n(231),Ho=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ko=[null,"http://www.opengis.net/wms"],Zo=K(Ko,{Service:V((function(t,e){return $({},Qo,t,e)})),Capability:V((function(t,e){return $({},$o,t,e)}))}),$o=K(Ko,{Request:V((function(t,e){return $({},sa,t,e)})),Exception:V((function(t,e){return $([],ra,t,e)})),Layer:V((function(t,e){var n=$({},ia,t,e);if(void 0===n.Layer)return Object.assign(n,fa(t,e));return n}))}),Jo=function(t){function e(){var e=t.call(this)||this;return e.version=void 0,e}return Ho(e,t),e.prototype.readFromNode=function(t){this.version=t.getAttribute("version").trim();var e=$({version:this.version},Zo,t,[]);return e||null},e}(Gr),Qo=K(Ko,{Name:V(vt),Title:V(vt),Abstract:V(vt),KeywordList:V(va),OnlineResource:V(zr),ContactInformation:V((function(t,e){return $({},ta,t,e)})),Fees:V(vt),AccessConstraints:V(vt),LayerLimit:V(yt),MaxWidth:V(yt),MaxHeight:V(yt)}),ta=K(Ko,{ContactPersonPrimary:V((function(t,e){return $({},ea,t,e)})),ContactPosition:V(vt),ContactAddress:V((function(t,e){return $({},na,t,e)})),ContactVoiceTelephone:V(vt),ContactFacsimileTelephone:V(vt),ContactElectronicMailAddress:V(vt)}),ea=K(Ko,{ContactPerson:V(vt),ContactOrganization:V(vt)}),na=K(Ko,{AddressType:V(vt),Address:V(vt),City:V(vt),StateOrProvince:V(vt),PostCode:V(vt),Country:V(vt)}),ra=K(Ko,{Format:z(vt)}),ia=K(Ko,{Name:V(vt),Title:V(vt),Abstract:V(vt),KeywordList:V(va),CRS:B(vt),EX_GeographicBoundingBox:V((function(t,e){var n=$({},aa,t,e);if(!n)return;var r=n.westBoundLongitude,i=n.southBoundLatitude,o=n.eastBoundLongitude,a=n.northBoundLatitude;if(void 0===r||void 0===i||void 0===o||void 0===a)return;return[r,i,o,a]})),BoundingBox:B((function(t,e){var n=[gt(t.getAttribute("minx")),gt(t.getAttribute("miny")),gt(t.getAttribute("maxx")),gt(t.getAttribute("maxy"))],r=[gt(t.getAttribute("resx")),gt(t.getAttribute("resy"))];return{crs:t.getAttribute("CRS"),extent:n,res:r}})),Dimension:B((function(t,e){return{name:t.getAttribute("name"),units:t.getAttribute("units"),unitSymbol:t.getAttribute("unitSymbol"),default:t.getAttribute("default"),multipleValues:pt(t.getAttribute("multipleValues")),nearestValue:pt(t.getAttribute("nearestValue")),current:pt(t.getAttribute("current")),values:vt(t)}})),Attribution:V((function(t,e){return $({},oa,t,e)})),AuthorityURL:B((function(t,e){var n=ga(t,e);if(n)return n.name=t.getAttribute("name"),n;return})),Identifier:B(vt),MetadataURL:B((function(t,e){var n=ga(t,e);if(n)return n.type=t.getAttribute("type"),n;return})),DataURL:B(ga),FeatureListURL:B(ga),Style:B((function(t,e){return $({},ha,t,e)})),MinScaleDenominator:V(ft),MaxScaleDenominator:V(ft),Layer:B(fa)}),oa=K(Ko,{Title:V(vt),OnlineResource:V(zr),LogoURL:V(ma)}),aa=K(Ko,{westBoundLongitude:V(ft),eastBoundLongitude:V(ft),southBoundLatitude:V(ft),northBoundLatitude:V(ft)}),sa=K(Ko,{GetCapabilities:V(ya),GetMap:V(ya),GetFeatureInfo:V(ya)}),la=K(Ko,{Format:B(vt),DCPType:B((function(t,e){return $({},ua,t,e)}))}),ua=K(Ko,{HTTP:V((function(t,e){return $({},ca,t,e)}))}),ca=K(Ko,{Get:V(ga),Post:V(ga)}),ha=K(Ko,{Name:V(vt),Title:V(vt),Abstract:V(vt),LegendURL:B(ma),StyleSheetURL:V(ga),StyleURL:V(ga)}),pa=K(Ko,{Format:V(vt),OnlineResource:V(zr)}),da=K(Ko,{Keyword:z(vt)});function fa(t,e){var n=e[e.length-1],r=$({},ia,t,e);if(r){var i=pt(t.getAttribute("queryable"));void 0===i&&(i=n.queryable),r.queryable=void 0!==i&&i;var o=mt(t.getAttribute("cascaded"));void 0===o&&(o=n.cascaded),r.cascaded=o;var a=pt(t.getAttribute("opaque"));void 0===a&&(a=n.opaque),r.opaque=void 0!==a&&a;var s=pt(t.getAttribute("noSubsets"));void 0===s&&(s=n.noSubsets),r.noSubsets=void 0!==s&&s;var l=gt(t.getAttribute("fixedWidth"));l||(l=n.fixedWidth),r.fixedWidth=l;var u=gt(t.getAttribute("fixedHeight"));u||(u=n.fixedHeight),r.fixedHeight=u;["Style","CRS","AuthorityURL"].forEach((function(t){if(t in n){var e=r[t]||[];r[t]=e.concat(n[t])}}));return["EX_GeographicBoundingBox","BoundingBox","Dimension","Attribution","MinScaleDenominator","MaxScaleDenominator"].forEach((function(t){if(!(t in r)){var e=n[t];r[t]=e}})),r}}function ga(t,e){return $({},pa,t,e)}function ya(t,e){return $({},la,t,e)}function ma(t,e){var n=ga(t,e);if(n){var r=[mt(t.getAttribute("width")),mt(t.getAttribute("height"))];return n.size=r,n}}function va(t,e){return $([],da,t,e)}var _a=Jo,ba=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),wa=function(t){function e(e){var n=t.call(this)||this,r=e||{};return n.featureNS_="http://mapserver.gis.umn.edu/mapserver",n.gmlFormat_=new Ct,n.layers_=r.layers?r.layers:null,n}return ba(e,t),e.prototype.getLayers=function(){return this.layers_},e.prototype.setLayers=function(t){this.layers_=t},e.prototype.readFeatures_=function(t,e){t.setAttribute("namespaceURI",this.featureNS_);var n=t.localName,r=[];if(0===t.childNodes.length)return r;if("msGMLOutput"==n)for(var i=0,o=t.childNodes.length;i<o;i++){var a=t.childNodes[i];if(a.nodeType===Node.ELEMENT_NODE){var s=a,l=e[0],u=s.localName.replace("_layer","");if(!this.layers_||Object(N.f)(this.layers_,u)){var c=u+"_feature";l.featureType=c,l.featureNS=this.featureNS_;var h={};h[c]=z(this.gmlFormat_.readFeatureElement,this.gmlFormat_);var p=K([l.featureNS,null],h);s.setAttribute("namespaceURI",this.featureNS_);var d=$([],p,s,e,this.gmlFormat_);d&&Object(N.c)(r,d)}}}if("FeatureCollection"==n){var f=$([],this.gmlFormat_.FEATURE_COLLECTION_PARSERS,t,[{}],this.gmlFormat_);f&&(r=f)}return r},e.prototype.readFeaturesFromNode=function(t,e){var n={};return e&&Object(y.a)(n,this.getReadOptions(t,e)),this.readFeatures_(t,[n])},e}(it),xa=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ea=[null,"http://www.opengis.net/wmts/1.0"],Sa=[null,"http://www.opengis.net/ows/1.1"],Oa=K(Ea,{Contents:V((function(t,e){return $({},Ta,t,e)}))}),Ca=function(t){function e(){var e=t.call(this)||this;return e.owsParser_=new ii,e}return xa(e,t),e.prototype.readFromNode=function(t){var e=t.getAttribute("version");e&&(e=e.trim());var n=this.owsParser_.readFromNode(t);return n?(n.version=e,(n=$(n,Oa,t,[]))||null):null},e}(Gr),Ta=K(Ea,{Layer:B((function(t,e){return $({},Ia,t,e)})),TileMatrixSet:B((function(t,e){return $({},Aa,t,e)}))}),Ia=K(Ea,{Style:B((function(t,e){var n=$({},La,t,e);if(!n)return;var r="true"===t.getAttribute("isDefault");return n.isDefault=r,n})),Format:B(vt),TileMatrixSetLink:B((function(t,e){return $({},Pa,t,e)})),Dimension:B((function(t,e){return $({},Na,t,e)})),ResourceURL:B((function(t,e){var n=t.getAttribute("format"),r=t.getAttribute("template"),i=t.getAttribute("resourceType"),o={};n&&(o.format=n);r&&(o.template=r);i&&(o.resourceType=i);return o}))},K(Sa,{Title:V(vt),Abstract:V(vt),WGS84BoundingBox:V(Fa),Identifier:V(vt)})),La=K(Ea,{LegendURL:B((function(t,e){var n={};return n.format=t.getAttribute("format"),n.href=zr(t),n}))},K(Sa,{Title:V(vt),Identifier:V(vt)})),Pa=K(Ea,{TileMatrixSet:V(vt),TileMatrixSetLimits:V((function(t,e){return $([],Ra,t,e)}))}),Ra=K(Ea,{TileMatrixLimits:z((function(t,e){return $({},Ma,t,e)}))}),Ma=K(Ea,{TileMatrix:V(vt),MinTileRow:V(yt),MaxTileRow:V(yt),MinTileCol:V(yt),MaxTileCol:V(yt)}),Na=K(Ea,{Default:V(vt),Value:B(vt)},K(Sa,{Identifier:V(vt)})),ja=K(Sa,{LowerCorner:z(Da),UpperCorner:z(Da)}),Aa=K(Ea,{WellKnownScaleSet:V(vt),TileMatrix:B((function(t,e){return $({},ka,t,e)}))},K(Sa,{SupportedCRS:V(vt),Identifier:V(vt),BoundingBox:V(Fa)})),ka=K(Ea,{TopLeftCorner:V(Da),ScaleDenominator:V(ft),TileWidth:V(yt),TileHeight:V(yt),MatrixWidth:V(yt),MatrixHeight:V(yt)},K(Sa,{Identifier:V(vt)}));function Fa(t,e){var n=$([],ja,t,e);if(2==n.length)return Object(m.boundingExtent)(n)}function Da(t,e){var n=vt(t).split(/\s+/);if(n&&2==n.length){var r=+n[0],i=+n[1];if(!isNaN(r)&&!isNaN(i))return[r,i]}}var Ga=Ca},function(t,e,n){"use strict";var r,i=n(79),o=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),a=function(t){function e(e){var n=e||{};return t.call(this,n)||this}return o(e,t),e}(i.a),s=n(198),l=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),u=function(t){function e(e){return t.call(this,e)||this}return l(e,t),e.prototype.createRenderer=function(){return new s.a(this)},e}(a);e.a=u},function(t,e,n){var r=n(244),i=n(245),o=n(246),a=n(247);t.exports=function(t){return r(t)||i(t)||o(t)||a()}},function(t,e,n){"use strict";var r,i=n(4),o=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),a=function(t){function e(e){var n=this,r="Assertion failed. See https://openlayers.org/en/"+("latest"===i.a?i.a:"v"+i.a.split("-")[0])+"/doc/errors/#"+e+" for details.";return(n=t.call(this,r)||this).code=e,n.name="AssertionError",n.message=r,n}return o(e,t),e}(Error);e.a=a},function(t,e,n){"use strict";e.a={POINT:"point",LINE:"line"}},function(t,e,n){"use strict";var r=function(){function t(){}return t.prototype.drawCustom=function(t,e,n){},t.prototype.drawGeometry=function(t){},t.prototype.setStyle=function(t){},t.prototype.drawCircle=function(t,e){},t.prototype.drawFeature=function(t,e){},t.prototype.drawGeometryCollection=function(t,e){},t.prototype.drawLineString=function(t,e){},t.prototype.drawMultiLineString=function(t,e){},t.prototype.drawMultiPoint=function(t,e){},t.prototype.drawMultiPolygon=function(t,e){},t.prototype.drawPoint=function(t,e){},t.prototype.drawPolygon=function(t,e){},t.prototype.drawText=function(t,e){},t.prototype.setFillStrokeStyle=function(t,e){},t.prototype.setImageStyle=function(t,e){},t.prototype.setTextStyle=function(t,e){},t}();e.a=r},function(t,e,n){"use strict";function r(t,e,n,r,i){for(var o,a=[t[e],t[e+1]],s=[];e+r<n;e+=r){if(s[0]=t[e+r],s[1]=t[e+r+1],o=i(a,s))return o;a[0]=s[0],a[1]=s[1]}return!1}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";function r(t,e,n,r){for(var i=t[e],o=t[e+1],a=0,s=e+r;s<n;s+=r){var l=t[s],u=t[s+1];a+=Math.sqrt((l-i)*(l-i)+(u-o)*(u-o)),i=l,o=u}return a}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";var r,i=n(165),o=n(153),a=n(166),s=n(45),l=n(94),u=n(14),c=n(0),h=n(97),p=n(7),d=n(2),f=n(4),g=n(21),y=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),m=function(t){function e(e){var n=t.call(this,e)||this;return n.boundHandleStyleImageChange_=n.handleStyleImageChange_.bind(n),n.animatingOrInteracting_,n.dirty_=!1,n.hitDetectionImageData_=null,n.renderedFeatures_=null,n.renderedRevision_=-1,n.renderedResolution_=NaN,n.renderedExtent_=Object(c.createEmpty)(),n.wrappedRenderedExtent_=Object(c.createEmpty)(),n.renderedRotation_,n.renderedCenter_=null,n.renderedProjection_=null,n.renderedRenderOrder_=null,n.replayGroup_=null,n.replayGroupChanged=!0,n.declutterExecutorGroup=null,n.clipping=!0,n}return y(e,t),e.prototype.useContainer=function(e,n,r){r<1&&(e=null),t.prototype.useContainer.call(this,e,n,r)},e.prototype.renderWorlds=function(t,e,n){var r=e.extent,i=e.viewState,o=i.center,a=i.resolution,l=i.projection,u=i.rotation,h=l.getExtent(),p=this.getLayer().getSource(),d=e.pixelRatio,f=e.viewHints,g=!(f[s.a.ANIMATING]||f[s.a.INTERACTING]),y=this.context,m=Math.round(e.size[0]*d),v=Math.round(e.size[1]*d),_=p.getWrapX()&&l.canWrapX(),b=_?Object(c.getWidth)(h):null,w=_?Math.ceil((r[2]-h[2])/b)+1:1,x=_?Math.floor((r[0]-h[0])/b):0;do{var E=this.getRenderTransform(o,a,u,d,m,v,x*b);t.execute(y,1,E,u,g,void 0,n)}while(++x<w)},e.prototype.renderDeclutter=function(t){this.declutterExecutorGroup&&this.renderWorlds(this.declutterExecutorGroup,t,t.declutterTree)},e.prototype.renderFrame=function(t,e){var n=t.pixelRatio,r=t.layerStatesArray[t.layerIndex];Object(u.e)(this.pixelTransform,1/n,1/n),Object(u.d)(this.inversePixelTransform,this.pixelTransform);var i=Object(u.k)(this.pixelTransform);this.useContainer(e,i,r.opacity);var o=this.context,a=o.canvas,s=this.replayGroup_,l=this.declutterExecutorGroup;if((!s||s.isEmpty())&&(!l||l.isEmpty()))return!this.containerReused&&a.width>0&&(a.width=0),this.container;var h=Math.round(t.size[0]*n),p=Math.round(t.size[1]*n);a.width!=h||a.height!=p?(a.width=h,a.height=p,a.style.transform!==i&&(a.style.transform=i)):this.containerReused||o.clearRect(0,0,h,p),this.preRender(o,t);var f=t.viewState,g=f.projection,y=!1,m=!0;if(r.extent&&this.clipping){var v=Object(d.fromUserExtent)(r.extent,g);(y=(m=Object(c.intersects)(v,t.extent))&&!Object(c.containsExtent)(v,t.extent))&&this.clipUnrotated(o,t,v)}m&&this.renderWorlds(s,t),y&&o.restore(),this.postRender(o,t);var _=r.opacity,b=this.container;return _!==parseFloat(b.style.opacity)&&(b.style.opacity=1===_?"":String(_)),this.renderedRotation_!==f.rotation&&(this.renderedRotation_=f.rotation,this.hitDetectionImageData_=null),this.container},e.prototype.getFeatures=function(t){return new Promise(function(e){if(!this.hitDetectionImageData_&&!this.animatingOrInteracting_){var n=[this.context.canvas.width,this.context.canvas.height];Object(u.a)(this.pixelTransform,n);var r=this.renderedCenter_,i=this.renderedResolution_,o=this.renderedRotation_,a=this.renderedProjection_,s=this.wrappedRenderedExtent_,h=this.getLayer(),p=[],d=n[0]*l.a,f=n[1]*l.a;p.push(this.getRenderTransform(r,i,o,l.a,d,f,0).slice());var g=h.getSource(),y=a.getExtent();if(g.getWrapX()&&a.canWrapX()&&!Object(c.containsExtent)(y,s)){for(var m=s[0],v=Object(c.getWidth)(y),_=0,b=void 0;m<y[0];)b=v*--_,p.push(this.getRenderTransform(r,i,o,l.a,d,f,b).slice()),m+=v;for(_=0,m=s[2];m>y[2];)b=v*++_,p.push(this.getRenderTransform(r,i,o,l.a,d,f,b).slice()),m-=v}this.hitDetectionImageData_=Object(l.b)(n,p,this.renderedFeatures_,h.getStyleFunction(),s,i,o)}e(Object(l.c)(t,this.renderedFeatures_,this.hitDetectionImageData_))}.bind(this))},e.prototype.forEachFeatureAtCoordinate=function(t,e,n,r,i){var o=this;if(this.replayGroup_){var a,s=e.viewState.resolution,l=e.viewState.rotation,u=this.getLayer(),c={},h=function(t,e,n){var o=Object(f.c)(t),a=c[o];if(a){if(!0!==a&&n<a.distanceSq){if(0===n)return c[o]=!0,i.splice(i.lastIndexOf(a),1),r(t,u,e);a.geometry=e,a.distanceSq=n}}else{if(0===n)return c[o]=!0,r(t,u,e);i.push(c[o]={feature:t,layer:u,geometry:e,distanceSq:n,callback:r})}},p=[this.replayGroup_];return this.declutterExecutorGroup&&p.push(this.declutterExecutorGroup),p.some((function(r){return a=r.forEachFeatureAtCoordinate(t,s,l,n,h,r===o.declutterExecutorGroup?e.declutterTree.all().map((function(t){return t.value})):null)})),a}},e.prototype.handleFontsChanged=function(){var t=this.getLayer();t.getVisible()&&this.replayGroup_&&t.changed()},e.prototype.handleStyleImageChange_=function(t){this.renderIfReadyAndVisible()},e.prototype.prepareFrame=function(t){var e=this.getLayer(),n=e.getSource();if(!n)return!1;var r=t.viewHints[s.a.ANIMATING],o=t.viewHints[s.a.INTERACTING],l=e.getUpdateWhileAnimating(),u=e.getUpdateWhileInteracting();if(!this.dirty_&&!l&&r||!u&&o)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;var f=t.extent,y=t.viewState,m=y.projection,v=y.resolution,_=t.pixelRatio,b=e.getRevision(),w=e.getRenderBuffer(),x=e.getRenderOrder();void 0===x&&(x=h.a);var E=y.center.slice(),S=Object(c.buffer)(f,w*v),O=S.slice(),C=[S.slice()],T=m.getExtent();if(n.getWrapX()&&m.canWrapX()&&!Object(c.containsExtent)(T,t.extent)){var I=Object(c.getWidth)(T),L=Math.max(Object(c.getWidth)(S)/2,I);S[0]=T[0]-L,S[2]=T[2]+L,Object(g.l)(E,m);var P=Object(c.wrapX)(C[0],m);P[0]<T[0]&&P[2]<T[2]?C.push([P[0]+I,P[1],P[2]+I,P[3]]):P[0]>T[0]&&P[2]>T[2]&&C.push([P[0]-I,P[1],P[2]-I,P[3]])}if(!this.dirty_&&this.renderedResolution_==v&&this.renderedRevision_==b&&this.renderedRenderOrder_==x&&Object(c.containsExtent)(this.wrappedRenderedExtent_,S))return Object(p.b)(this.renderedExtent_,O)||(this.hitDetectionImageData_=null,this.renderedExtent_=O),this.renderedCenter_=E,this.replayGroupChanged=!1,!0;this.replayGroup_=null,this.dirty_=!1;var R,M=new i.a(Object(h.c)(v,_),S,v,_);this.getLayer().getDeclutter()&&(R=new i.a(Object(h.c)(v,_),S,v,_));var N,j=Object(d.getUserProjection)();if(j){for(var A=0,k=C.length;A<k;++A)n.loadFeatures(Object(d.toUserExtent)(C[A],m),v,j);N=Object(d.getTransformFromProjections)(j,m)}else for(A=0,k=C.length;A<k;++A)n.loadFeatures(C[A],v,m);var F=Object(h.b)(v,_),D=function(t){var n,r=t.getStyleFunction()||e.getStyleFunction();if(r&&(n=r(t,v)),n){var i=this.renderFeature(t,F,n,M,N,R);this.dirty_=this.dirty_||i}}.bind(this),G=Object(d.toUserExtent)(S,m),z=n.getFeaturesInExtent(G);x&&z.sort(x);for(A=0,k=z.length;A<k;++A)D(z[A]);this.renderedFeatures_=z;var U=M.finish(),B=new a.a(S,v,_,n.getOverlaps(),U,e.getRenderBuffer());return R&&(this.declutterExecutorGroup=new a.a(S,v,_,n.getOverlaps(),R.finish(),e.getRenderBuffer())),this.renderedResolution_=v,this.renderedRevision_=b,this.renderedRenderOrder_=x,this.renderedExtent_=O,this.wrappedRenderedExtent_=S,this.renderedCenter_=E,this.renderedProjection_=m,this.replayGroup_=B,this.hitDetectionImageData_=null,this.replayGroupChanged=!0,!0},e.prototype.renderFeature=function(t,e,n,r,i,o){if(!n)return!1;var a=!1;if(Array.isArray(n))for(var s=0,l=n.length;s<l;++s)a=Object(h.d)(r,t,n[s],e,this.boundHandleStyleImageChange_,i,o)||a;else a=Object(h.d)(r,t,n,e,this.boundHandleStyleImageChange_,i,o);return a},e}(o.a);e.a=m},function(t,e,n){"use strict";var r,i=n(9),o=n(23),a=n(46),s=n(39),l=n(4),u=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),c=function(t){function e(e){var n=t.call(this)||this;return n.boundHandleImageChange_=n.handleImageChange_.bind(n),n.layer_=e,n.declutterExecutorGroup=null,n}return u(e,t),e.prototype.getFeatures=function(t){return Object(l.b)()},e.prototype.prepareFrame=function(t){return Object(l.b)()},e.prototype.renderFrame=function(t,e){return Object(l.b)()},e.prototype.loadedTileCallback=function(t,e,n){t[e]||(t[e]={}),t[e][n.tileCoord.toString()]=n},e.prototype.createLoadedTileFinder=function(t,e,n){return function(r,i){var o=this.loadedTileCallback.bind(this,n,r);return t.forEachLoadedTile(e,r,i,o)}.bind(this)},e.prototype.forEachFeatureAtCoordinate=function(t,e,n,r,i){},e.prototype.getDataAtPixel=function(t,e,n){return Object(l.b)()},e.prototype.getLayer=function(){return this.layer_},e.prototype.handleFontsChanged=function(){},e.prototype.handleImageChange_=function(t){t.target.getState()===o.a.LOADED&&this.renderIfReadyAndVisible()},e.prototype.loadImage=function(t){var e=t.getState();return e!=o.a.LOADED&&e!=o.a.ERROR&&t.addEventListener(i.a.CHANGE,this.boundHandleImageChange_),e==o.a.IDLE&&(t.load(),e=t.getState()),e==o.a.LOADED},e.prototype.renderIfReadyAndVisible=function(){var t=this.getLayer();t.getVisible()&&t.getSourceState()==s.a.READY&&t.changed()},e}(a.a);e.a=c},function(t,e,n){"use strict";var r,i=n(54),o=n(50),a=n(4),s=n(13),l=n(6),u=n(8),c=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),h=function(t){function e(e){var n=t.call(this)||this;n.on,n.once,n.un;var r=Object(l.a)({},e);return"object"==typeof e.properties&&(delete r.properties,Object(l.a)(r,e.properties)),r[o.a.OPACITY]=void 0!==e.opacity?e.opacity:1,Object(s.a)("number"==typeof r[o.a.OPACITY],64),r[o.a.VISIBLE]=void 0===e.visible||e.visible,r[o.a.Z_INDEX]=e.zIndex,r[o.a.MAX_RESOLUTION]=void 0!==e.maxResolution?e.maxResolution:1/0,r[o.a.MIN_RESOLUTION]=void 0!==e.minResolution?e.minResolution:0,r[o.a.MIN_ZOOM]=void 0!==e.minZoom?e.minZoom:-1/0,r[o.a.MAX_ZOOM]=void 0!==e.maxZoom?e.maxZoom:1/0,n.className_=void 0!==r.className?e.className:"ol-layer",delete r.className,n.setProperties(r),n.state_=null,n}return c(e,t),e.prototype.getClassName=function(){return this.className_},e.prototype.getLayerState=function(t){var e=this.state_||{layer:this,managed:void 0===t||t},n=this.getZIndex();return e.opacity=Object(u.a)(Math.round(100*this.getOpacity())/100,0,1),e.sourceState=this.getSourceState(),e.visible=this.getVisible(),e.extent=this.getExtent(),e.zIndex=void 0!==n||e.managed?n:1/0,e.maxResolution=this.getMaxResolution(),e.minResolution=Math.max(this.getMinResolution(),0),e.minZoom=this.getMinZoom(),e.maxZoom=this.getMaxZoom(),this.state_=e,e},e.prototype.getLayersArray=function(t){return Object(a.b)()},e.prototype.getLayerStatesArray=function(t){return Object(a.b)()},e.prototype.getExtent=function(){return this.get(o.a.EXTENT)},e.prototype.getMaxResolution=function(){return this.get(o.a.MAX_RESOLUTION)},e.prototype.getMinResolution=function(){return this.get(o.a.MIN_RESOLUTION)},e.prototype.getMinZoom=function(){return this.get(o.a.MIN_ZOOM)},e.prototype.getMaxZoom=function(){return this.get(o.a.MAX_ZOOM)},e.prototype.getOpacity=function(){return this.get(o.a.OPACITY)},e.prototype.getSourceState=function(){return Object(a.b)()},e.prototype.getVisible=function(){return this.get(o.a.VISIBLE)},e.prototype.getZIndex=function(){return this.get(o.a.Z_INDEX)},e.prototype.setExtent=function(t){this.set(o.a.EXTENT,t)},e.prototype.setMaxResolution=function(t){this.set(o.a.MAX_RESOLUTION,t)},e.prototype.setMinResolution=function(t){this.set(o.a.MIN_RESOLUTION,t)},e.prototype.setMaxZoom=function(t){this.set(o.a.MAX_ZOOM,t)},e.prototype.setMinZoom=function(t){this.set(o.a.MIN_ZOOM,t)},e.prototype.setOpacity=function(t){Object(s.a)("number"==typeof t,64),this.set(o.a.OPACITY,t)},e.prototype.setVisible=function(t){this.set(o.a.VISIBLE,t)},e.prototype.setZIndex=function(t){this.set(o.a.Z_INDEX,t)},e.prototype.disposeInternal=function(){this.state_&&(this.state_.layer=null,this.state_=null),t.prototype.disposeInternal.call(this)},e}(i.a);e.a=h},function(t,e,n){"use strict";var r,i=n(153),o=n(45),a=n(78),s=n(6),l=n(14),u=n(0),c=n(2),h=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),p=function(t){function e(e){var n=t.call(this,e)||this;return n.image_=null,n}return h(e,t),e.prototype.getImage=function(){return this.image_?this.image_.getImage():null},e.prototype.prepareFrame=function(t){var e=t.layerStatesArray[t.layerIndex],n=t.pixelRatio,r=t.viewState,i=r.resolution,s=this.getLayer().getSource(),l=t.viewHints,h=t.extent;if(void 0!==e.extent&&(h=Object(u.getIntersection)(h,Object(c.fromUserExtent)(e.extent,r.projection))),!l[o.a.ANIMATING]&&!l[o.a.INTERACTING]&&!Object(u.isEmpty)(h))if(s){var p=r.projection;if(!a.a){var d=s.getProjection();d&&(p=d)}var f=s.getImage(h,i,n,p);f&&this.loadImage(f)&&(this.image_=f)}else this.image_=null;return!!this.image_},e.prototype.renderFrame=function(t,e){var n=this.image_,r=n.getExtent(),i=n.getResolution(),o=n.getPixelRatio(),a=t.layerStatesArray[t.layerIndex],h=t.pixelRatio,p=t.viewState,d=p.center,f=p.resolution,g=t.size,y=h*i/(f*o),m=Math.round(g[0]*h),v=Math.round(g[1]*h),_=p.rotation;if(_){var b=Math.round(Math.sqrt(m*m+v*v));m=b,v=b}Object(l.b)(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/h,1/h,_,-m/2,-v/2),Object(l.d)(this.inversePixelTransform,this.pixelTransform);var w=Object(l.k)(this.pixelTransform);this.useContainer(e,w,a.opacity);var x=this.context,E=x.canvas;E.width!=m||E.height!=v?(E.width=m,E.height=v):this.containerReused||x.clearRect(0,0,m,v);var S=!1,O=!0;if(a.extent){var C=Object(c.fromUserExtent)(a.extent,p.projection);(S=(O=Object(u.intersects)(C,t.extent))&&!Object(u.containsExtent)(C,t.extent))&&this.clipUnrotated(x,t,C)}var T=n.getImage(),I=Object(l.b)(this.tempTransform,m/2,v/2,y,y,0,o*(r[0]-d[0])/i,o*(d[1]-r[3])/i);this.renderedResolution=i*h/o;var L=T.width*I[0],P=T.height*I[3];if(Object(s.a)(x,this.getLayer().getSource().getContextOptions()),this.preRender(x,t),O&&L>=.5&&P>=.5){var R=I[4],M=I[5],N=a.opacity,j=void 0;1!==N&&(j=x.globalAlpha,x.globalAlpha=N),x.drawImage(T,0,0,+T.width,+T.height,Math.round(R),Math.round(M),Math.round(L),Math.round(P)),1!==N&&(x.globalAlpha=j)}return this.postRender(x,t),S&&x.restore(),w!==E.style.transform&&(E.style.transform=w),this.container},e}(i.a);e.a=p},function(t,e){var n={thin:100,hairline:100,"ultra-light":100,"extra-light":100,light:200,book:300,regular:400,normal:400,plain:400,roman:400,standard:400,medium:500,"semi-bold":600,"demi-bold":600,bold:700,heavy:800,black:800,"extra-bold":800,"ultra-black":900,"extra-black":900,"ultra-bold":900,"heavy-black":900,fat:900,poster:900},r=/(italic|oblique)$/i,i={};t.exports=function(t,e,o){var a=i[t];if(!a){Array.isArray(t)||(t=[t]);for(var s=400,l="normal",u=[],c=0,h=t.length;c<h;++c){var p=t[c].split(" "),d=p[p.length-1].toLowerCase();for(var f in"normal"==d||"italic"==d||"oblique"==d?(l=d,p.pop(),d=p[p.length-1].toLowerCase()):r.test(d)&&(d=d.replace(r,""),l=p[p.length-1].replace(d,"")),n)if(d==f||d==f.replace("-","")||d==f.replace("-"," ")){s=n[f],p.pop();break}"number"==typeof d&&(s=d);var g=p.join(" ").replace("Klokantech Noto Sans","Noto Sans");-1!==g.indexOf(" ")&&(g='"'+g+'"'),u.push(g)}a=i[t]=[l,s,u]}return a[0]+" "+a[1]+" "+e+"px"+(o?"/"+o:"")+" "+a[2]}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(0);function i(t,e,n,i){for(var o=[],a=Object(r.createEmpty)(),s=0,l=n.length;s<l;++s){var u=n[s];a=Object(r.createOrUpdateFromFlatCoordinates)(t,e,u[0],i),o.push((a[0]+a[2])/2,(a[1]+a[3])/2),e=u[u.length-1]}return o}},function(t,e,n){"use strict";var r,i=n(153),o=n(119),a=n(15),s=n(14),l=n(6),u=n(0),c=n(2),h=n(4),p=n(7),d=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),f=function(t){function e(e){var n=t.call(this,e)||this;return n.extentChanged=!0,n.renderedExtent_=null,n.renderedPixelRatio,n.renderedProjection=null,n.renderedRevision,n.renderedTiles=[],n.newTiles_=!1,n.tmpExtent=Object(u.createEmpty)(),n.tmpTileRange_=new o.b(0,0,0,0),n}return d(e,t),e.prototype.isDrawableTile=function(t){var e=this.getLayer(),n=t.getState(),r=e.getUseInterimTilesOnError();return n==a.a.LOADED||n==a.a.EMPTY||n==a.a.ERROR&&!r},e.prototype.getTile=function(t,e,n,r){var i=r.pixelRatio,o=r.viewState.projection,s=this.getLayer(),l=s.getSource().getTile(t,e,n,i,o);return l.getState()==a.a.ERROR&&(s.getUseInterimTilesOnError()?s.getPreload()>0&&(this.newTiles_=!0):l.setState(a.a.LOADED)),this.isDrawableTile(l)||(l=l.getInterimTile()),l},e.prototype.loadedTileCallback=function(e,n,r){return!!this.isDrawableTile(r)&&t.prototype.loadedTileCallback.call(this,e,n,r)},e.prototype.prepareFrame=function(t){return!!this.getLayer().getSource()},e.prototype.renderFrame=function(t,e){var n=t.layerStatesArray[t.layerIndex],r=t.viewState,i=r.projection,o=r.resolution,d=r.center,f=r.rotation,g=t.pixelRatio,y=this.getLayer(),m=y.getSource(),v=m.getRevision(),_=m.getTileGridForProjection(i),b=_.getZForResolution(o,m.zDirection),w=_.getResolution(b),x=t.extent,E=n.extent&&Object(c.fromUserExtent)(n.extent,i);E&&(x=Object(u.getIntersection)(x,Object(c.fromUserExtent)(n.extent,i)));var S=m.getTilePixelRatio(g),O=Math.round(t.size[0]*S),C=Math.round(t.size[1]*S);if(f){var T=Math.round(Math.sqrt(O*O+C*C));O=T,C=T}var I=w*O/2/S,L=w*C/2/S,P=[d[0]-I,d[1]-L,d[0]+I,d[1]+L],R=_.getTileRangeForExtentAndZ(x,b),M={};M[b]={};var N=this.createLoadedTileFinder(m,i,M),j=this.tmpExtent,A=this.tmpTileRange_;this.newTiles_=!1;for(var k=R.minX;k<=R.maxX;++k)for(var F=R.minY;F<=R.maxY;++F){var D=this.getTile(b,k,F,t);if(this.isDrawableTile(D)){var G=Object(h.c)(this);if(D.getState()==a.a.LOADED){M[b][D.tileCoord.toString()]=D;var z=D.inTransition(G);this.newTiles_||!z&&-1!==this.renderedTiles.indexOf(D)||(this.newTiles_=!0)}if(1===D.getAlpha(G,t.time))continue}var U=_.getTileCoordChildTileRange(D.tileCoord,A,j),B=!1;U&&(B=N(b+1,U)),B||_.forEachTileCoordParentTileRange(D.tileCoord,N,A,j)}var V=w/o;Object(s.b)(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/S,1/S,f,-O/2,-C/2);var q=Object(s.k)(this.pixelTransform);this.useContainer(e,q,n.opacity);var Y=this.context,X=Y.canvas;Object(s.d)(this.inversePixelTransform,this.pixelTransform),Object(s.b)(this.tempTransform,O/2,C/2,V,V,0,-O/2,-C/2),X.width!=O||X.height!=C?(X.width=O,X.height=C):this.containerReused||Y.clearRect(0,0,O,C),E&&this.clipUnrotated(Y,t,E),Object(l.a)(Y,m.getContextOptions()),this.preRender(Y,t),this.renderedTiles.length=0;var W,H,K,Z=Object.keys(M).map(Number);Z.sort(p.i),1!==n.opacity||this.containerReused&&!m.getOpaque(t.viewState.projection)?(W=[],H=[]):Z=Z.reverse();for(var $=Z.length-1;$>=0;--$){var J=Z[$],Q=m.getTilePixelSize(J,g,i),tt=_.getResolution(J)/w,et=Q[0]*tt*V,nt=Q[1]*tt*V,rt=_.getTileCoordForCoordAndZ(Object(u.getTopLeft)(P),J),it=_.getTileCoordExtent(rt),ot=Object(s.a)(this.tempTransform,[S*(it[0]-P[0])/w,S*(P[3]-it[3])/w]),at=S*m.getGutterForProjection(i),st=M[J];for(var lt in st){var ut=(D=st[lt]).tileCoord,ct=rt[1]-ut[1],ht=Math.round(ot[0]-(ct-1)*et),pt=rt[2]-ut[2],dt=Math.round(ot[1]-(pt-1)*nt),ft=ht-(k=Math.round(ot[0]-ct*et)),gt=dt-(F=Math.round(ot[1]-pt*nt)),yt=b===J;if(!(z=yt&&1!==D.getAlpha(Object(h.c)(this),t.time)))if(W){Y.save(),K=[k,F,k+ft,F,k+ft,F+gt,k,F+gt];for(var mt=0,vt=W.length;mt<vt;++mt)if(b!==J&&J<H[mt]){var _t=W[mt];Y.beginPath(),Y.moveTo(K[0],K[1]),Y.lineTo(K[2],K[3]),Y.lineTo(K[4],K[5]),Y.lineTo(K[6],K[7]),Y.moveTo(_t[6],_t[7]),Y.lineTo(_t[4],_t[5]),Y.lineTo(_t[2],_t[3]),Y.lineTo(_t[0],_t[1]),Y.clip()}W.push(K),H.push(J)}else Y.clearRect(k,F,ft,gt);this.drawTileImage(D,t,k,F,ft,gt,at,yt,n.opacity),W&&!z?(Y.restore(),this.renderedTiles.unshift(D)):this.renderedTiles.push(D),this.updateUsedTiles(t.usedTiles,m,D)}}return this.renderedRevision=v,this.renderedResolution=w,this.extentChanged=!this.renderedExtent_||!Object(u.equals)(this.renderedExtent_,P),this.renderedExtent_=P,this.renderedPixelRatio=g,this.renderedProjection=i,this.manageTilePyramid(t,m,_,g,i,x,b,y.getPreload()),this.scheduleExpireCache(t,m),this.postRender(Y,t),n.extent&&Y.restore(),q!==X.style.transform&&(X.style.transform=q),this.container},e.prototype.drawTileImage=function(t,e,n,r,i,o,a,s,l){var u=this.getTileImage(t);if(u){var c=Object(h.c)(this),p=s?t.getAlpha(c,e.time):1,d=l*p,f=d!==this.context.globalAlpha;f&&(this.context.save(),this.context.globalAlpha=d),this.context.drawImage(u,a,a,u.width-2*a,u.height-2*a,n,r,i,o),f&&this.context.restore(),1!==p?e.animate=!0:s&&t.endTransition(c)}},e.prototype.getImage=function(){var t=this.context;return t?t.canvas:null},e.prototype.getTileImage=function(t){return t.getImage()},e.prototype.scheduleExpireCache=function(t,e){if(e.canExpireCache()){var n=function(t,e,n){var r=Object(h.c)(t);r in n.usedTiles&&t.expireCache(n.viewState.projection,n.usedTiles[r])}.bind(null,e);t.postRenderFunctions.push(n)}},e.prototype.updateUsedTiles=function(t,e,n){var r=Object(h.c)(e);r in t||(t[r]={}),t[r][n.getKey()]=!0},e.prototype.manageTilePyramid=function(t,e,n,r,i,o,s,l,u){var c=Object(h.c)(e);c in t.wantedTiles||(t.wantedTiles[c]={});var p,d,f,g,y,m,v=t.wantedTiles[c],_=t.tileQueue,b=0;for(m=n.getMinZoom();m<=s;++m)for(d=n.getTileRangeForExtentAndZ(o,m,d),f=n.getResolution(m),g=d.minX;g<=d.maxX;++g)for(y=d.minY;y<=d.maxY;++y)s-m<=l?(++b,(p=e.getTile(m,g,y,r,i)).getState()==a.a.IDLE&&(v[p.getKey()]=!0,_.isKeyQueued(p.getKey())||_.enqueue([p,c,n.getTileCoordCenter(p.tileCoord),f])),void 0!==u&&u(p)):e.useTile(m,g,y,i);e.updateCacheSize(b,i)},e}(i.a);f.prototype.getLayer,e.a=f},function(t,e,n){"use strict";var r,i=n(113),o=n(15),a=n(25),s=n(101),l=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),u=function(t){function e(e,n,r,i,o,a){var s=t.call(this,e,n,a)||this;return s.crossOrigin_=i,s.src_=r,s.key=r,s.image_=new Image,null!==i&&(s.image_.crossOrigin=i),s.unlisten_=null,s.tileLoadFunction_=o,s}return l(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.setImage=function(t){this.image_=t,this.state=o.a.LOADED,this.unlistenImage_(),this.changed()},e.prototype.handleImageError_=function(){var t;this.state=o.a.ERROR,this.unlistenImage_(),this.image_=((t=Object(a.a)(1,1)).fillStyle="rgba(0,0,0,0)",t.fillRect(0,0,1,1),t.canvas),this.changed()},e.prototype.handleImageLoad_=function(){var t=this.image_;t.naturalWidth&&t.naturalHeight?this.state=o.a.LOADED:this.state=o.a.EMPTY,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state==o.a.ERROR&&(this.state=o.a.IDLE,this.image_=new Image,null!==this.crossOrigin_&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==o.a.IDLE&&(this.state=o.a.LOADING,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=Object(s.b)(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(i.a);e.a=u},function(t,e,n){"use strict";var r=n(0),i=n(2),o=n(8),a=function(){function t(t,e,n,a,s,l){this.sourceProj_=t,this.targetProj_=e;var u={},c=Object(i.getTransform)(this.targetProj_,this.sourceProj_);this.transformInv_=function(t){var e=t[0]+"/"+t[1];return u[e]||(u[e]=c(t)),u[e]},this.maxSourceExtent_=a,this.errorThresholdSquared_=s*s,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!a&&!!this.sourceProj_.getExtent()&&Object(r.getWidth)(a)==Object(r.getWidth)(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?Object(r.getWidth)(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?Object(r.getWidth)(this.targetProj_.getExtent()):null;var h=Object(r.getTopLeft)(n),p=Object(r.getTopRight)(n),d=Object(r.getBottomRight)(n),f=Object(r.getBottomLeft)(n),g=this.transformInv_(h),y=this.transformInv_(p),m=this.transformInv_(d),v=this.transformInv_(f),_=10+(l?Math.max(0,Math.ceil(Object(o.d)(Object(r.getArea)(n)/(l*l*256*256)))):0);if(this.addQuad_(h,p,d,f,g,y,m,v,_),this.wrapsXInSource_){var b=1/0;this.triangles_.forEach((function(t,e,n){b=Math.min(b,t.source[0][0],t.source[1][0],t.source[2][0])})),this.triangles_.forEach(function(t){if(Math.max(t.source[0][0],t.source[1][0],t.source[2][0])-b>this.sourceWorldWidth_/2){var e=[[t.source[0][0],t.source[0][1]],[t.source[1][0],t.source[1][1]],[t.source[2][0],t.source[2][1]]];e[0][0]-b>this.sourceWorldWidth_/2&&(e[0][0]-=this.sourceWorldWidth_),e[1][0]-b>this.sourceWorldWidth_/2&&(e[1][0]-=this.sourceWorldWidth_),e[2][0]-b>this.sourceWorldWidth_/2&&(e[2][0]-=this.sourceWorldWidth_);var n=Math.min(e[0][0],e[1][0],e[2][0]);Math.max(e[0][0],e[1][0],e[2][0])-n<this.sourceWorldWidth_/2&&(t.source=e)}}.bind(this))}u={}}return t.prototype.addTriangle_=function(t,e,n,r,i,o){this.triangles_.push({source:[r,i,o],target:[t,e,n]})},t.prototype.addQuad_=function(t,e,n,i,a,s,l,u,c){var h=Object(r.boundingExtent)([a,s,l,u]),p=this.sourceWorldWidth_?Object(r.getWidth)(h)/this.sourceWorldWidth_:null,d=this.sourceWorldWidth_,f=this.sourceProj_.canWrapX()&&p>.5&&p<1,g=!1;if(c>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_){var y=Object(r.boundingExtent)([t,e,n,i]);g=Object(r.getWidth)(y)/this.targetWorldWidth_>.25||g}!f&&this.sourceProj_.isGlobal()&&p&&(g=p>.25||g)}if(!(!g&&this.maxSourceExtent_&&isFinite(h[0])&&isFinite(h[1])&&isFinite(h[2])&&isFinite(h[3]))||Object(r.intersects)(h,this.maxSourceExtent_)){var m=0;if(!(g||isFinite(a[0])&&isFinite(a[1])&&isFinite(s[0])&&isFinite(s[1])&&isFinite(l[0])&&isFinite(l[1])&&isFinite(u[0])&&isFinite(u[1])))if(c>0)g=!0;else if(1!=(m=(isFinite(a[0])&&isFinite(a[1])?0:8)+(isFinite(s[0])&&isFinite(s[1])?0:4)+(isFinite(l[0])&&isFinite(l[1])?0:2)+(isFinite(u[0])&&isFinite(u[1])?0:1))&&2!=m&&4!=m&&8!=m)return;if(c>0){if(!g){var v=[(t[0]+n[0])/2,(t[1]+n[1])/2],_=this.transformInv_(v),b=void 0;if(f)b=(Object(o.e)(a[0],d)+Object(o.e)(l[0],d))/2-Object(o.e)(_[0],d);else b=(a[0]+l[0])/2-_[0];var w=(a[1]+l[1])/2-_[1];g=b*b+w*w>this.errorThresholdSquared_}if(g){if(Math.abs(t[0]-n[0])<=Math.abs(t[1]-n[1])){var x=[(e[0]+n[0])/2,(e[1]+n[1])/2],E=this.transformInv_(x),S=[(i[0]+t[0])/2,(i[1]+t[1])/2],O=this.transformInv_(S);this.addQuad_(t,e,x,S,a,s,E,O,c-1),this.addQuad_(S,x,n,i,O,E,l,u,c-1)}else{var C=[(t[0]+e[0])/2,(t[1]+e[1])/2],T=this.transformInv_(C),I=[(n[0]+i[0])/2,(n[1]+i[1])/2],L=this.transformInv_(I);this.addQuad_(t,C,I,i,a,T,L,u,c-1),this.addQuad_(C,e,n,I,T,s,l,L,c-1)}return}}if(f){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}0==(11&m)&&this.addTriangle_(t,n,i,a,l,u),0==(14&m)&&this.addTriangle_(t,n,e,a,l,s),m&&(0==(13&m)&&this.addTriangle_(e,i,t,s,u,a),0==(7&m)&&this.addTriangle_(e,i,n,s,u,l))}},t.prototype.calculateSourceExtent=function(){var t=Object(r.createEmpty)();return this.triangles_.forEach((function(e,n,i){var o=e.source;Object(r.extendCoordinate)(t,o[0]),Object(r.extendCoordinate)(t,o[1]),Object(r.extendCoordinate)(t,o[2])})),t},t.prototype.getTriangles=function(){return this.triangles_},t}();e.a=a},function(t,e,n){"use strict";var r=function(){function t(t,e,n){this.decay_=t,this.minVelocity_=e,this.delay_=n,this.points_=[],this.angle_=0,this.initialVelocity_=0}return t.prototype.begin=function(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0},t.prototype.update=function(t,e){this.points_.push(t,e,Date.now())},t.prototype.end=function(){if(this.points_.length<6)return!1;var t=Date.now()-this.delay_,e=this.points_.length-3;if(this.points_[e+2]<t)return!1;for(var n=e-3;n>0&&this.points_[n+2]>t;)n-=3;var r=this.points_[e+2]-this.points_[n+2];if(r<1e3/60)return!1;var i=this.points_[e]-this.points_[n],o=this.points_[e+1]-this.points_[n+1];return this.angle_=Math.atan2(o,i),this.initialVelocity_=Math.sqrt(i*i+o*o)/r,this.initialVelocity_>this.minVelocity_},t.prototype.getDistance=function(){return(this.minVelocity_-this.initialVelocity_)/this.decay_},t.prototype.getAngle=function(){return this.angle_},t}();e.a=r},function(t,e,n){"use strict";n.d(e,"a",(function(){return _}));var r=n(24),i=n.n(r),o=n(27),a=n.n(o),s=n(32),l=n.n(s),u=n(83),c=n.n(u),h=n(51),p=n.n(h),d=n(53),f=n.n(d),g=n(28),y=n.n(g),m=n(47);n(42);function v(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=y()(t);if(e){var i=y()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return f()(this,n)}}var _=function(t){p()(n,t);var e=v(n);function n(t){var r;i()(this,n);var o=t||{},a=o.dragZoom,s=function(t){t.preventDefault(),t.stopPropagation(),(" "+f.className+" ").indexOf(" disabled ")>-1||(f.className+=" disabled",this.getMap().getView().setResolution(d))},u=o.tipLabel?o.tipLabel:"Previous view",c=o.label?o.label:"←",h=document.createElement("span");h.innerHTML=c;var p=document.createElement("button");p.type="button",p.title=u,p.appendChild(h);var d=1,f=document.createElement("div");return f.className="ol-prevZoom ol-control ol-unselectable disabled",f.appendChild(p),r=e.call(this,{element:f,target:o.target}),a.on("boxstart",function(t){(" "+f.className+" ").indexOf(" disabled ")>-1&&(f.className=f.className.replace(/disabled/g,"")),d=this.getMap().getView().getResolution()}.bind(l()(r))),p.addEventListener("click",s.bind(l()(r)),!1),p.addEventListener("touchstart",s.bind(l()(r)),!1),r}return a()(n,[{key:"setMap",value:function(t){c()(y()(n.prototype),"setMap",this).call(this,t)}}]),n}(m.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return y}));var r=n(24),i=n.n(r),o=n(27),a=n.n(o),s=n(32),l=n.n(s),u=n(51),c=n.n(u),h=n(53),p=n.n(h),d=n(28),f=n.n(d);function g(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=f()(t);if(e){var i=f()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return p()(this,n)}}var y=function(t){c()(n,t);var e=g(n);function n(t){var r;i()(this,n);var o=t||{},a=document.createElement("div");(r=e.call(this,{element:a,target:o.target})).pmaViewport=o.pmaViewport,r.stateManager=o.stateManager?o.stateManager:null,r.stateManager?(r.stateManager.associatedImage||(r.stateManager.associatedImage={},r.stateManager.associatedImage.collapsed=!!o.collapsed&&o.collapsed),r.collapsed_=!0===r.stateManager.associatedImage.collapsed):r.collapsed_=!!o.collapsed&&o.collapsed;var s=o.className?o.className:"ol-associated-image",u=o.tipLabel?o.tipLabel:"Barcode",c=o.collapseLabel?o.collapseLabel:"«";r.collapseLabel_=document.createElement("span"),r.collapseLabel_.innerHTML=c;var h=o.label?o.label:"»";r.label_=document.createElement("span"),r.label_.innerHTML=h;var p=r.collapsed_?r.collapseLabel_:r.label_,d=document.createElement("button");d.type="button",d.title=u,d.appendChild(p),"ontouchstart"in document.documentElement?d.addEventListener("touchstart",r.buttonClk.bind(l()(r)),!1):d.addEventListener("click",r.buttonClk.bind(l()(r)),!1),r.stateManager&&"number"==typeof r.stateManager.associatedImage.rotation?r.rotation=r.stateManager.associatedImage.rotation:r.rotation=t.rotation?t.rotation:0,r.imageType=t.imageType.toLowerCase();var f=document.createElement("img");f.src=r.getImageUrl();var g=document.createElement("div");g.className="ol-associated-image-container",g.appendChild(f);var y=s+" ol-unselectable ol-control "+(r.collapsed_?" ol-collapsed":"");function m(t){t.preventDefault(),t.stopPropagation(),this.rotation=(this.rotation+90)%360,this.stateManager&&(this.stateManager.associatedImage.rotation=this.rotation),f.src=this.getImageUrl()}a.className=y,a.appendChild(d),a.appendChild(g),"ontouchstart"in document.documentElement?f.addEventListener("touchstart",m.bind(l()(r)),!1):f.addEventListener("click",m.bind(l()(r)),!1),r.imageElement=f;var v=document.createElement("button");function _(){window.open(this.getImageUrl(),"_blank")}v.type="button",v.title="Rotate",v.className="size",v.innerHTML="⭮","ontouchstart"in document.documentElement?v.addEventListener("touchstart",m.bind(l()(r)),!1):v.addEventListener("click",m.bind(l()(r)),!1),a.appendChild(v);var b=document.createElement("button");return b.type="button",b.title="zoom out",b.className="size",b.innerHTML="⌕","ontouchstart"in document.documentElement?b.addEventListener("touchstart",_.bind(l()(r)),!1):b.addEventListener("click",_.bind(l()(r)),!1),a.appendChild(b),r}return a()(n,[{key:"getImageUrl",value:function(){return this.pmaViewport.getActiveServerUrl()+this.imageType+"?sessionID="+encodeURIComponent(this.pmaViewport.getSessionID())+"&pathOrUid="+encodeURIComponent(this.pmaViewport.imageInfo.Filename)+"&rotation="+this.rotation}},{key:"setRotation",value:function(t){this.rotation=t,this.stateManager&&(this.stateManager.associatedImage.rotation=this.rotation),this.imageElement.src=this.getImageUrl()}},{key:"getRotation",value:function(){return this.rotation}},{key:"getCollapsed",value:function(){return(" "+this.element.className+" ").indexOf(" ol-collapsed ")>-1}},{key:"setCollapsed",value:function(t){this.getCollapsed()!=t&&this.buttonClk()}},{key:"buttonClk",value:function(t){t&&(t.preventDefault(),t.stopPropagation()),(" "+this.element.className+" ").indexOf(" ol-collapsed ")>-1?this.element.className=this.element.className.replace(/ol-collapsed/g,""):this.element.className+=" ol-collapsed",this.collapsed_?this.collapseLabel_.parentNode.replaceChild(this.label_,this.collapseLabel_):this.label_.parentNode.replaceChild(this.collapseLabel_,this.label_),this.collapsed_=!this.collapsed_,this.stateManager&&(this.stateManager.associatedImage.collapsed=this.collapsed_)}}]),n}(n(47).a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var r=n(24),i=n.n(r),o=n(32),a=n.n(o),s=n(51),l=n.n(s),u=n(53),c=n.n(u),h=n(28),p=n.n(h);function d(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=p()(t);if(e){var i=p()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return c()(this,n)}}var f=function(t){l()(n,t);var e=d(n);function n(t){var r;i()(this,n);var o=t||{},s=document.createElement("div");(r=e.call(this,{element:s,target:o.target})).pmaViewport=o.pmaViewport;var l=document.createElement("a");l.href="#",l.innerHTML=o.tipLabel?o.tipLabel:"Snapshot";var u=a()(r),c=function(t){if(t.preventDefault(),u.pmaViewport){var e=u.pmaViewport.getSnapshotUrl(!1).url;window.open(e,"_blank")}};return l.addEventListener("click",c,!1),l.addEventListener("touchstart",c,!1),s.className="ol-snapshot ol-unselectable",s.appendChild(l),r}return n}(n(47).a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var r=n(24),i=n.n(r),o=n(27),a=n.n(o),s=n(51),l=n.n(s),u=n(53),c=n.n(u),h=n(28),p=n.n(h);function d(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=p()(t);if(e){var i=p()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return c()(this,n)}}var f=function(t){l()(n,t);var e=d(n);function n(t){var r;i()(this,n);var o=t||{},a=document.createElement("div");(r=e.call(this,{element:a,target:o.target})).stateManager=o.stateManager?o.stateManager:null,r.stateManager?(r.stateManager.fileName||(r.stateManager.fileName={},r.stateManager.fileName.collapsed=!!o.collapsed&&o.collapsed),r.collapsed_=!0===r.stateManager.fileName.collapsed):r.collapsed_=!!o.collapsed&&o.collapsed;var s=o.collapseLabel?o.collapseLabel:"«";r.collapseLabel_=document.createElement("a"),r.collapseLabel_.href="#",r.collapseLabel_.innerHTML=s;var l=o.label?o.label:"»";r.label_=document.createElement("a"),r.label_.href="#",r.label_.innerHTML=l;var u=document.createElement("a");u.href="#";var c=document.createElement("span");c.innerHTML=o.filename,u.appendChild(c);var h=function(t){t.preventDefault(),"function"==typeof o.onClick&&o.onClick()};return u.addEventListener("click",h,!1),u.addEventListener("touchstart",h,!1),a.className="ol-filename ol-unselectable"+(r.collapsed_?" ol-collapsed":""),a.appendChild(u),a.appendChild(r.collapseLabel_),a.appendChild(r.label_),r.handleCollapseClick=function(t){t&&t.preventDefault(),(" "+a.className+" ").indexOf(" ol-collapsed ")>-1?a.className=a.className.replace(/ol-collapsed/g,""):a.className+=" ol-collapsed"},r.collapseLabel_.addEventListener("click",r.handleCollapseClick,!1),r.collapseLabel_.addEventListener("touchstart",r.handleCollapseClick,!1),r.label_.addEventListener("click",r.handleCollapseClick,!1),r.label_.addEventListener("touchstart",r.handleCollapseClick,!1),r}return a()(n,[{key:"getCollapsed",value:function(){return(" "+this.element.className+" ").indexOf(" ol-collapsed ")>-1}},{key:"setCollapsed",value:function(t){this.getCollapsed()!=t&&this.handleCollapseClick()}}]),n}(n(47).a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return x}));var r=n(24),i=n.n(r),o=n(27),a=n.n(o),s=n(32),l=n.n(s),u=n(51),c=n.n(u),h=n(53),p=n.n(h),d=n(28),f=n.n(d),g=n(47),y=n(241),m=n.n(y),v=(n(253),n(44)),_=n(11);function b(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=f()(t);if(e){var i=f()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return p()(this,n)}}var w=[{step:1,class:"x1"},{step:.5,class:"x2"},{step:.2,class:"x3"},{step:.1,class:"x4"},{step:.05,class:"x5"}],x=function(t){c()(n,t);var e=b(n);function n(t){var r;i()(this,n);var o=t||{},a=document.createElement("div");(r=e.call(this,{element:a,target:o.target})).pmaViewport=o.pmaViewport,r.stateManager=o.stateManager?o.stateManager:null,r.stateManager?(r.stateManager.dimensionSelector||(r.stateManager.dimensionSelector={},r.stateManager.dimensionSelector.collapsed=!!o.collapsed&&o.collapsed),r.collapsed_=!0===r.stateManager.dimensionSelector.collapsed):r.collapsed_=!!o.collapsed&&o.collapsed,r.sliders=[],r.slidersValues=[],r.currentStep=0;var s=o.className?o.className:"ol-dimension-selector";r.tipLabel=o.tipLabel?o.tipLabel:"Channels";var u=o.collapseLabel?o.collapseLabel:"»";r.collapseLabel_=document.createElement("span"),r.collapseLabel_.innerHTML=u;var c=o.label?o.label:"«";r.label_=document.createElement("span"),r.label_.innerHTML=c;var h=r.collapsed_?r.collapseLabel_:r.label_,p=document.createElement("button");p.type="button",p.title=r.tipLabel,p.appendChild(h),p.className="collapse-button",p.style="float: left",r.btnEventUsed="click","ontouchstart"in document.documentElement&&(r.btnEventUsed="touchstart"),p.addEventListener(r.btnEventUsed,r.buttonClk.bind(l()(r)),!1);var d=s+" ol-unselectable ol-control "+(r.collapsed_?" ol-collapsed":"");r.dimensionsDiv=document.createElement("div"),r.dimensionsDiv.className="ol-dimensions-container",r.renderDimensionsControl(),r.dimensionControlsDiv=document.createElement("div"),r.dimensionControlsDiv.className="ol-dimensions-container",r.renderSelectors(!0),a.className=d,r.dimensionsDiv&&""!==r.dimensionsDiv&&a.appendChild(r.dimensionsDiv),r.dimensionControlsDiv&&""!==r.dimensionControlsDiv&&a.appendChild(r.dimensionControlsDiv),a.appendChild(p);return"Decrease resolution",c='<i class="fa fa-minus" aria-hidden="true"></i>',document.createElement("span").innerHTML=c,r.lastSelection=-1,r.element.addEventListener("wheel",r.wheelEvent.bind(l()(r)),!1),r}return a()(n,[{key:"buttonClk",value:function(t){t&&(t.preventDefault(),t.stopPropagation()),(" "+this.element.className+" ").indexOf(" ol-collapsed ")>-1?this.element.className=this.element.className.replace(/ol-collapsed/g,""):this.element.className+=" ol-collapsed",this.pmaViewport.imageInfo.TimeFrames[0].Layers[0].Channels.length>1&&(this.collapsed_?this.collapseLabel_.parentNode.replaceChild(this.label_,this.collapseLabel_):this.label_.parentNode.replaceChild(this.collapseLabel_,this.label_)),this.collapsed_=!this.collapsed_,this.stateManager&&(this.stateManager.dimensionSelector.collapsed=this.collapsed_)}},{key:"getCollapsed",value:function(){return(" "+this.element.className+" ").indexOf(" ol-collapsed ")>-1}},{key:"setCollapsed",value:function(t){this.getCollapsed()!=t&&this.buttonClk()}},{key:"renderDimensionsControl",value:function(){function t(t){for(var e=[],n=this.dimensionsDiv.querySelectorAll(".ol-dimensions-container ul input[type='checkbox']"),r=0;r<n.length;r++)n[r].checked&&(e.push(r),this.lastSelection=r);0===e.length&&(n[this.lastSelection].checked=!0,e.push(this.lastSelection)),this.pmaViewport.setActiveChannels(e)}if(this.sliders=[],this.pmaViewport.imageInfo.TimeFrames[0].Layers[0].Channels.length>1){for(var e="<div id='channels'>"+this.tipLabel+"</div><div id='step'></div><ul>",n=0;n<this.pmaViewport.imageInfo.TimeFrames[0].Layers[0].Channels.length;n++){var r=this.pmaViewport.imageInfo.TimeFrames[0].Layers[0].Channels[n];if(e+="<li style='background-color: #"+r.Color.substr(2,6)+"'>",e+="<span class='channel-span'><label>"+r.Name+" <input type='checkbox' "+(r.Active?"checked='checked'":"")+" /></label></span>","Default"!==r.Name){var i="".concat(Object(v.c)(),"_slider");this.sliders.push(i),e+="<span class='slider-span' id='"+i+"'></span>"}e+="</li>"}e+="</ul>",this.sliders.length>0&&(e+="<div style='display: block; height: 25px;'>",e+="<button id='increaseButton' type='button' title='Increase resolution' style='float: right;'>",e+="<span><i class='fa fa-plus' aria-hidden='true'></i></span>",e+="</button>",e+="<button id='decreaseButton' type='button' title='Decrease resolution' style='float: right;'>",e+="<span><i class='fa fa-minus' aria-hidden='true'></i></span>",e+="</button>",e+="</div>"),this.dimensionsDiv.innerHTML=e;var o=this.dimensionsDiv.querySelectorAll(".ol-dimensions-container ul input[type='checkbox']");for(n=0;n<o.length;n++)o[n].addEventListener("change",t.bind(this),!1);if(this.sliders.length>0){var a=this;this.dimensionsDiv.querySelector("#increaseButton").addEventListener("click",(function(){a.destroySliders(),a.renderDimensionsControl(),a.renderSelectors(!1),a.currentStep=a.currentStep<4?a.currentStep+1:a.currentStep,a.renderSliders(a.currentStep)}),!1),this.dimensionsDiv.querySelector("#decreaseButton").addEventListener("click",(function(){a.destroySliders(),a.renderDimensionsControl(),a.renderSelectors(!1),a.currentStep=a.currentStep>0?a.currentStep-1:a.currentStep,a.renderSliders(a.currentStep)}),!1)}}}},{key:"renderSelectors",value:function(t){function e(t){"timeframe"==t.target.name?this.pmaViewport.setActiveTimeFrame(t.target.value):"zstack"==t.target.name&&this.pmaViewport.setActiveLayer(t.target.value),document.getElementById("zstackSlider")&&(document.getElementById("zstackLabel").innerHTML=_.a.translate("Z-stack: <br /> {stack} / {total}",{stack:this.pmaViewport.getActiveLayer()+1,total:this.pmaViewport.imageInfo.TimeFrames[this.pmaViewport.getActiveTimeFrame()].Layers.length})),document.getElementById("timeframeSlider")&&(document.getElementById("timeframeLabel").innerHTML=_.a.translate("Time frame: <br /> {frame} / {total}",{frame:this.pmaViewport.getActiveTimeFrame()+1,total:this.pmaViewport.imageInfo.TimeFrames.length}))}function n(t){var e=this.pmaViewport.getActiveTimeFrame(),n=this.pmaViewport.getActiveLayer();"prev-timeframe"==t.target.name?(--e<0&&(e=this.pmaViewport.imageInfo.TimeFrames.length-1),this.pmaViewport.setActiveTimeFrame(e)):"next-timeframe"==t.target.name?(++e>=this.pmaViewport.imageInfo.TimeFrames.length&&(e=0),this.pmaViewport.setActiveTimeFrame(e)):"prev-zstack"==t.target.name?(--n<0&&(n=this.pmaViewport.imageInfo.TimeFrames[e].Layers.length-1),this.pmaViewport.setActiveLayer(n)):"next-zstack"==t.target.name&&(++n>=this.pmaViewport.imageInfo.TimeFrames[e].Layers.length&&(n=0),this.pmaViewport.setActiveLayer(n)),document.getElementById("zstackSlider")&&(document.getElementById("zstackSlider").value=n,document.getElementById("zstackLabel").innerHTML=_.a.translate("Z-stack: <br /> {stack} / {total}",{stack:this.pmaViewport.getActiveLayer()+1,total:this.pmaViewport.imageInfo.TimeFrames[this.pmaViewport.getActiveTimeFrame()].Layers.length})),document.getElementById("timeframeSlider")&&(document.getElementById("timeframeSlider").value=e,document.getElementById("timeframeLabel").innerHTML=_.a.translate("Time frame: <br /> {frame} / {total}",{frame:this.pmaViewport.getActiveTimeFrame()+1,total:this.pmaViewport.imageInfo.TimeFrames.length}))}var r="";this.pmaViewport.imageInfo.TimeFrames.length>1&&(r+='<div id="timeframeLabel">'+_.a.translate("Time frame: <br /> {frame} / {total}",{frame:this.pmaViewport.getActiveTimeFrame()+1,total:this.pmaViewport.imageInfo.TimeFrames.length})+"</div>",r+="<button name='prev-timeframe' class='prev-next-button'><</button>",r+='<input type="range" min="0" max="'+(this.pmaViewport.imageInfo.TimeFrames.length-1)+'" value="'+this.pmaViewport.getActiveTimeFrame()+'" name="timeframe" id="timeframeSlider">',r+="<button name='next-timeframe' class='prev-next-button'>></button>");var i=this.pmaViewport.imageInfo.TimeFrames[this.pmaViewport.getActiveTimeFrame()];if(i.Layers.length>1){t&&this.pmaViewport.setActiveLayer(0|Math.round((i.Layers.length-1)/2));var o=this.pmaViewport.getActiveLayer();r+='<div id="zstackLabel">'+_.a.translate("Z-stack: <br /> {stack} / {total}",{stack:o+1,total:i.Layers.length})+"</div>",r+="<button name='prev-zstack' class='prev-next-button'><</button>",r+='<input type="range" min="0" max="'+(i.Layers.length-1)+'" value="'+o+'" name="zstack" id="zstackSlider">',r+="<button name='next-zstack' class='prev-next-button'>></button>"}if(""!==r){this.dimensionControlsDiv.innerHTML="<div>"+r+"</div>";for(var a=this.dimensionControlsDiv.querySelectorAll(".ol-dimensions-container input[type=range]"),s=0;s<a.length;s++)a[s].addEventListener("input",e.bind(this),!1);var l=this.dimensionControlsDiv.querySelectorAll(".ol-dimensions-container .prev-next-button");for(s=0;s<l.length;s++)l[s].addEventListener(this.btnEventUsed,n.bind(this),!1)}}},{key:"wheelEvent",value:function(t){if(t.preventDefault(),!((" "+this.element.className+" ").indexOf(" ol-collapsed ")>-1)){var e=this.pmaViewport.getActiveTimeFrame(),n=this.pmaViewport.getActiveLayer();t.deltaY&&t.deltaY<0?(--n<0&&(n=0),this.pmaViewport.setActiveLayer(n)):t.deltaY&&t.deltaY>0&&(++n>=this.pmaViewport.imageInfo.TimeFrames[e].Layers.length&&(n=this.pmaViewport.imageInfo.TimeFrames[e].Layers.length-1),this.pmaViewport.setActiveLayer(n)),document.getElementById("zstackSlider")&&(document.getElementById("zstackSlider").value=n,document.getElementById("zstackLabel").innerHTML=_.a.translate("Z-stack: <br /> {stack} / {total}",{stack:this.pmaViewport.getActiveLayer()+1,total:this.pmaViewport.imageInfo.TimeFrames[this.pmaViewport.getActiveTimeFrame()].Layers.length})),document.getElementById("timeframeSlider")&&(document.getElementById("timeframeSlider").value=e,document.getElementById("timeframeLabel").innerHTML=_.a.translate("Time frame: <br /> {frame} / {total}",{frame:this.pmaViewport.getActiveTimeFrame()+1,total:this.pmaViewport.imageInfo.TimeFrames.length}))}}},{key:"round",value:function(t,e){var n=Math.pow(10,e||0);return Math.round(t*n)/n}},{key:"renderSliders",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(0!==this.sliders.length)for(var e=this,n=0;n<this.sliders.length;n++){var r;r=this.slidersValues[n]?this.slidersValues[n]:[0,100];var i=document.getElementById(this.sliders[n]);w.forEach((function(t){i.parentElement.classList.remove(t.class)})),i.parentElement.classList.add(w[t].class),document.getElementById("step").innerText="Step: "+w[t].step,m.a.create(i,{start:r,tooltips:[!0,!0],step:w[t].step,connect:!0,margin:w[t].step,keyboardSupport:!0,range:{min:0,max:100},format:{to:function(t){return e.round(t,2).toFixed(2)},from:function(t){return e.round(t,2).toFixed(2)}}}),i.noUiSlider.channelIndex=n,i.noUiSlider.on("change",(function(t){e.pmaViewport.setChannelRenderingOptions({index:this.channelIndex,clipping:t})}))}}},{key:"destroySliders",value:function(){for(var t=0;t<this.sliders.length;t++){var e=document.getElementById(this.sliders[t]);this.slidersValues[t]=e.noUiSlider.get(),e.noUiSlider.destroy()}this.sliders=[]}}]),n}(g.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return b}));var r=n(24),i=n.n(r),o=n(27),a=n.n(o),s=n(32),l=n.n(s),u=n(83),c=n.n(u),h=n(51),p=n.n(h),d=n(53),f=n.n(d),g=n(28),y=n.n(g),m=n(47),v=n(5);function _(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=y()(t);if(e){var i=y()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return f()(this,n)}}var b=function(t){p()(n,t);var e=_(n);function n(t){var r;i()(this,n);var o=t||{},a=document.createElement("div");(r=e.call(this,{element:a,target:o.target})).pmaViewport=o.pmaViewport,r.stateManager=o.stateManager?o.stateManager:null,r.stateManager?(r.stateManager.layerSwitch||(r.stateManager.layerSwitch={},r.stateManager.layerSwitch.collapsed=!!o.collapsed&&o.collapsed),r.collapsed_=!0===r.stateManager.layerSwitch.collapsed):r.collapsed_=!!o.collapsed&&o.collapsed;var s=o.className?o.className:"ol-layerswitch",u=o.tipLabel?o.tipLabel:"Channels",c=o.collapseLabel?o.collapseLabel:"»";r.collapseLabel_=document.createElement("span"),r.collapseLabel_.innerHTML=c;var h=o.label?o.label:"«";r.label_=document.createElement("span"),r.label_.innerHTML=h;var p=r.collapsed_?r.collapseLabel_:r.label_,d=document.createElement("button");d.type="button",d.title=u,d.appendChild(p),d.className="collapse-button",r.btnEventUsed="click","ontouchstart"in document.documentElement&&(r.btnEventUsed="touchstart"),d.addEventListener(r.btnEventUsed,r.buttonClk.bind(l()(r)),!1);var f=s+" ol-unselectable ol-control "+(r.collapsed_?" ol-collapsed":"");return a.className=f,a.appendChild(d),r.panel_=document.createElement("ul"),r.panel_.className="panel",a.appendChild(r.panel_),r}return a()(n,[{key:"setMap",value:function(t){c()(y()(n.prototype),"setMap",this).call(this,t),this.drawPanel()}},{key:"setLayersVisibility",value:function(t){if(t&&0!=t.length&&this.getMap())for(var e=this.getMap().getLayers().getArray(),n=0;n<t.length;n++){var r=t[n];if(r.name)for(var i=e.length-1;i>=0;i--)if(e[i].getLayers)for(var o=e[i].getLayers().getArray(),a=o.length-1;a>=0;a--){var s=o[a],l=s.get("title")||s.get("name");l==r.name&&(s.setVisible(r.visible),null!=r.opacity&&s.setOpacity(r.opacity));var u=this.panel_.querySelector("li[data-name='".concat(l,"']"));if(u)u.querySelector("input[type=checkbox]").checked=s.getVisible(),u.querySelector("input[type=range]").value=100*s.getOpacity()}}}},{key:"getLayersVisibility",value:function(){if(this.getMap()){for(var t=[],e=this.getMap().getLayers().getArray(),n=e.length-1;n>=0;n--)if(e[n].getLayers)for(var r=e[n].getLayers().getArray(),i=r.length-1;i>=0;i--){var o=r[i],a=o.get("title")||o.get("name");t.push({name:a,visible:o.getVisible(),opacity:o.getOpacity()})}return t}}},{key:"drawPanel",value:function(t){if(this.getMap()){var e=this.getMap().getLayers().getArray();this.panel_.innerHTML="";for(var n=e.length-1;n>=0;n--)if(e[n].getLayers)for(var r=e[n].getLayers().getArray(),i=r.length-1;i>=0;i--){var o=r[i],a=document.createElement("li");a.setAttribute("data-name",o.get("title")||o.get("name")),a.className=o.getVisible()?"visible ":" ",this.panel_.appendChild(a);var s="<input type='checkbox' "+(o.getVisible()?"checked='checked' ":"")+"/>";s+="<label title='"+(o.get("title")||o.get("name"))+"'>"+(o.get("title")||o.get("name"))+"</label>",s+='<input type="range" min="0" max="100" value="'+100*o.getOpacity()+'" name="layer-opacity" >',a.innerHTML=s;var l=a.querySelector("input[type=checkbox]");l.addEventListener("change",c.bind(this,o,l),!1),a.querySelector("label").addEventListener(this.btnEventUsed,c.bind(this,o,l),!1);var u=a.querySelector("input[type=range]");u.addEventListener("change",h.bind(this,o,u),!1)}}function c(t,e){t.setVisible(!t.getVisible()),e.checked=t.getVisible(),this.pmaViewport&&this.pmaViewport.fireEvent(v.g.AnnotationLayerChanged,this.pmaViewport)}function h(t,e){t.setOpacity(e.value/100),this.pmaViewport&&this.pmaViewport.fireEvent(v.g.AnnotationLayerChanged,this.pmaViewport)}}},{key:"getCollapsed",value:function(){return(" "+this.element.className+" ").indexOf(" ol-collapsed ")>-1}},{key:"setCollapsed",value:function(t){this.getCollapsed()!=t&&this.buttonClk()}},{key:"buttonClk",value:function(t){t&&(t.preventDefault(),t.stopPropagation()),(" "+this.element.className+" ").indexOf(" ol-collapsed ")>-1?this.element.className=this.element.className.replace(/ol-collapsed/g,""):this.element.className+=" ol-collapsed",this.collapsed_?this.collapseLabel_.parentNode.replaceChild(this.label_,this.collapseLabel_):this.label_.parentNode.replaceChild(this.collapseLabel_,this.label_),this.collapsed_=!this.collapsed_,this.stateManager&&(this.stateManager.layerSwitch.collapsed=this.collapsed_)}}]),n}(m.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return v}));var r=n(24),i=n.n(r),o=n(27),a=n.n(o),s=n(32),l=n.n(s),u=n(51),c=n.n(u),h=n(53),p=n.n(h),d=n(28),f=n.n(d),g=n(47),y=(n(42),n(11));function m(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=f()(t);if(e){var i=f()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return p()(this,n)}}var v=function(t){c()(n,t);var e=m(n);function n(t){var r;i()(this,n);var o=t||{},a=(o.layer,o.viewer),s=document.createElement("div");(r=e.call(this,{element:s,target:o.target})).brightness=0,r.contrast=1,r.gamma=1;var u=l()(r);function c(){u.btnbicon.innerHTML=u.brightness.toFixed(0),u.btncicon.innerHTML=u.contrast.toFixed(2),u.btncicon.innerHTML=u.gamma.toFixed(2),a.setBrightnessContrastGamma(u.brightness,u.contrast,u.gamma),u.getMap().render()}return r.btnbplus=document.createElement("button"),r.btnbplus.className="ol-brightness-in",r.btnbplus.innerHTML="+",r.btnbicon=document.createElement("button"),r.btnbicon.className="ol-brightness-middle",r.btnbicon.innerHTML="0",r.btnbicon.title=y.a.translate("Adjust brightness"),r.btnbminus=document.createElement("button"),r.btnbminus.className="ol-brightness-out",r.btnbminus.innerHTML="-",r.btncplus=document.createElement("button"),r.btncplus.className="ol-contrast-in",r.btncplus.innerHTML="+",r.btncicon=document.createElement("button"),r.btncicon.className="ol-contrast-middle",r.btncicon.innerHTML="1.00",r.btncicon.title=y.a.translate("Adjust contrast"),r.btncminus=document.createElement("button"),r.btncminus.className="ol-contrast-out",r.btncminus.innerHTML="-",r.btngplus=document.createElement("button"),r.btngplus.className="ol-gamma-in",r.btngplus.innerHTML="+",r.btngicon=document.createElement("button"),r.btngicon.className="ol-gamma-middle",r.btngicon.innerHTML="1.00",r.btngicon.title=y.a.translate("Adjust gamma"),r.btngminus=document.createElement("button"),r.btngminus.className="ol-gamma-out",r.btngminus.innerHTML="-",r.btnbplus.addEventListener("click",(function(){u.brightness+=10,c()}),!1),r.btnbminus.addEventListener("click",(function(){u.brightness-=10,c()}),!1),r.btnbicon.addEventListener("click",(function(){u.brightness=0,c()}),!1),r.btncplus.addEventListener("click",(function(){u.contrast+=.125,c()}),!1),r.btncminus.addEventListener("click",(function(){u.contrast-=.125,c()}),!1),r.btncicon.addEventListener("click",(function(){u.contrast=1,c()}),!1),r.btngplus.addEventListener("click",(function(){u.gamma+=.1,c()}),!1),r.btngminus.addEventListener("click",(function(){u.gamma-=.1,c()}),!1),r.btngicon.addEventListener("click",(function(){u.gamma=1,c()}),!1),s.className="ol-brightness-contrast ol-unselectable ol-control",s.appendChild(r.btnbminus),s.appendChild(r.btnbicon),s.appendChild(r.btnbplus),s.appendChild(r.btncminus),s.appendChild(r.btncicon),s.appendChild(r.btncplus),s.appendChild(r.btngminus),s.appendChild(r.btngicon),s.appendChild(r.btngplus),r}return a()(n,[{key:"update",value:function(t,e,n){this.brightness=t,this.contrast=e,this.gamma=n,this.btnbicon.innerHTML=this.brightness.toFixed(0),this.btncicon.innerHTML=this.contrast.toFixed(2),this.btngicon.innerHTML=this.gamma.toFixed(2)}}]),n}(g.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return E}));var r=n(24),i=n.n(r),o=n(27),a=n.n(o),s=n(32),l=n.n(s),u=n(83),c=n.n(u),h=n(51),p=n.n(h),d=n(53),f=n.n(d),g=n(28),y=n.n(g),m=n(47),v=n(123),_=n(163),b=n(37),w=n(110);function x(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=y()(t);if(e){var i=y()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return f()(this,n)}}var E=function(t){p()(n,t);var e=x(n);function n(t){var r;i()(this,n);var o=t||{},a=document.createElement("div");if((r=e.call(this,{element:a,target:o.target})).collapsed_=!1,!0===o.collapsed&&(r.collapsed_=!0),a.className="ol-control ",o.target)r.magnifierDiv=a;else{a.className+=" ol-magnifier",r.magnifierDiv=document.createElement("div"),r.magnifierDiv.className="magnifier-map-container",a.appendChild(r.magnifierDiv);var s=document.createElement("button");s.type="button",s.title="Enlarge",s.className="size",s.innerHTML="+","ontouchstart"in document.documentElement?s.addEventListener("touchstart",r.enlargeButtonClick.bind(l()(r)),!1):s.addEventListener("click",r.enlargeButtonClick.bind(l()(r)),!1),a.appendChild(s);var u=document.createElement("button");u.type="button",u.title="Shrink",u.className="size",u.innerHTML="-","ontouchstart"in document.documentElement?u.addEventListener("touchstart",r.shrinkButtonClick.bind(l()(r)),!1):u.addEventListener("click",r.shrinkButtonClick.bind(l()(r)),!1),a.appendChild(u)}return r.magnifierMap=null,r.mouseMoveFunc=null,r}return a()(n,[{key:"handleMouseMove",value:function(t){if(!0!==this.getCollapsed()){var e=this.getMap(),n=e.getEventPixel(t),r=e.getCoordinateFromPixel(n);r&&this.magnifierMap.getView().setCenter(r)}}},{key:"getCollapsed",value:function(){return(" "+this.element.className+" ").indexOf(" ol-collapsed ")>-1}},{key:"setCollapsed",value:function(t){this.getCollapsed()!=t&&((" "+this.element.className+" ").indexOf(" ol-collapsed ")>-1?(this.element.className=this.element.className.replace(/ol-collapsed/g,""),this.magnifierMap&&this.magnifierMap.updateSize()):this.element.className+=" ol-collapsed"),this.collapsed_=t}},{key:"changeMagnifierSize",value:function(t){if(this.element){var e=Math.sqrt(this.element.clientHeight*this.element.clientHeight+this.element.clientWidth*this.element.clientWidth);if(e<60||e>600)return;this.element.style.width=this.element.clientWidth*t+"px",this.element.style.height=this.element.clientHeight*t+"px"}this.magnifierMap&&this.magnifierMap.updateSize()}},{key:"setMap",value:function(t){if(t){if(t!==this.getMap()){c()(y()(n.prototype),"setMap",this).call(this,t);var e=t.getView(),r=new v.a({projection:e.getProjection(),center:e.getCenter(),extent:e.getProjection().getExtent(),maxResolution:1,minResolution:1,zoom:0}),i=t.getLayers().item(0);this.magnifierMap=new _.a({controls:new b.a,interactions:new b.a,target:this.magnifierDiv,view:r,layers:[new w.a({source:i.getSource()})]});var o=!1;this.magnifierMap.on("change:size",function(){o||(o=!0,this.magnifierMap.updateSize(),o=!1)}.bind(this)),this.mouseMoveFunc=this.handleMouseMove.bind(this),t.getViewport().addEventListener("mousemove",this.mouseMoveFunc),this.collapsed_!==this.getCollapsed()&&this.setCollapsed(this.collapsed_)}}else{if(this.magnifierMap){var a=this.element;a&&a.parentElement.removeChild(a)}this.getMap()&&this.mouseMoveFunc&&this.getMap().getViewport().removeEventListener("mousemove",this.mouseMoveFunc)}}},{key:"enlargeButtonClick",value:function(t){t&&(t.preventDefault(),t.stopPropagation()),this.changeMagnifierSize(1.25)}},{key:"shrinkButtonClick",value:function(t){t&&(t.preventDefault(),t.stopPropagation()),this.changeMagnifierSize(.75)}}]),n}(m.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var r=n(24),i=n.n(r),o=n(27),a=n.n(o),s=n(44),l=function(){function t(e,n){i()(this,t),Object(s.b)()&&(n instanceof Array?(this.serverSessions=n,this.context=e,this.context.registerAuthenticationProvider(this)):console.error("Expected array of server credentials"))}return a()(t,[{key:"authenticate",value:function(t,e,n){for(var r=0,i=this.serverSessions.length;r<i;r++)if(this.serverSessions[r].serverUrl===t)return e(this.serverSessions[r].sessionId),!0;return!1}},{key:"updateSessionId",value:function(t,e){for(var n=0,r=this.serverSessions.length;n<r;n++)if(this.serverSessions[n].serverUrl===t){this.serverSessions[n].sessionId=e;break}}}]),t}()},function(t,e,n){"use strict";var r,i=n(54),o=n(37),a=n(49),s=n(9),l=n(184),u=n(106),c=n(29),h=n(93),p=n(98),d=n(57),f=n(30),g=n(10),y=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),m=function(t){function e(e,n){var r=t.call(this,e)||this;r.map_=e,r.clickTimeoutId_,r.emulateClicks_=!1,r.dragging_=!1,r.dragListenerKeys_=[],r.moveTolerance_=void 0===n?1:n,r.down_=null;var i=r.map_.getViewport();return r.activePointers_=0,r.trackedTouches_={},r.element_=i,r.pointerdownListenerKey_=Object(g.listen)(i,h.a.POINTERDOWN,r.handlePointerDown_,r),r.originalPointerMoveEvent_,r.relayedListenerKey_=Object(g.listen)(i,h.a.POINTERMOVE,r.relayEvent_,r),r.boundHandleTouchMove_=r.handleTouchMove_.bind(r),r.element_.addEventListener(s.a.TOUCHMOVE,r.boundHandleTouchMove_,!!d.e&&{passive:!1}),r}return y(e,t),e.prototype.emulateClick_=function(t){var e=new u.a(c.a.CLICK,this.map_,t);this.dispatchEvent(e),void 0!==this.clickTimeoutId_?(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=void 0,e=new u.a(c.a.DBLCLICK,this.map_,t),this.dispatchEvent(e)):this.clickTimeoutId_=setTimeout(function(){this.clickTimeoutId_=void 0;var e=new u.a(c.a.SINGLECLICK,this.map_,t);this.dispatchEvent(e)}.bind(this),250)},e.prototype.updateActivePointers_=function(t){var e=t;e.type==c.a.POINTERUP||e.type==c.a.POINTERCANCEL?delete this.trackedTouches_[e.pointerId]:e.type==c.a.POINTERDOWN&&(this.trackedTouches_[e.pointerId]=!0),this.activePointers_=Object.keys(this.trackedTouches_).length},e.prototype.handlePointerUp_=function(t){this.updateActivePointers_(t);var e=new u.a(c.a.POINTERUP,this.map_,t);this.dispatchEvent(e),this.emulateClicks_&&!e.defaultPrevented&&!this.dragging_&&this.isMouseActionButton_(t)&&this.emulateClick_(this.down_),0===this.activePointers_&&(this.dragListenerKeys_.forEach(g.unlistenByKey),this.dragListenerKeys_.length=0,this.dragging_=!1,this.down_=null)},e.prototype.isMouseActionButton_=function(t){return 0===t.button},e.prototype.handlePointerDown_=function(t){this.emulateClicks_=0===this.activePointers_,this.updateActivePointers_(t);var e=new u.a(c.a.POINTERDOWN,this.map_,t);for(var n in this.dispatchEvent(e),this.down_={},t){var r=t[n];this.down_[n]="function"==typeof r?f.c:r}if(0===this.dragListenerKeys_.length){var i=this.map_.getOwnerDocument();this.dragListenerKeys_.push(Object(g.listen)(i,c.a.POINTERMOVE,this.handlePointerMove_,this),Object(g.listen)(i,c.a.POINTERUP,this.handlePointerUp_,this),Object(g.listen)(this.element_,c.a.POINTERCANCEL,this.handlePointerUp_,this)),this.element_.getRootNode&&this.element_.getRootNode()!==i&&this.dragListenerKeys_.push(Object(g.listen)(this.element_.getRootNode(),c.a.POINTERUP,this.handlePointerUp_,this))}},e.prototype.handlePointerMove_=function(t){if(this.isMoving_(t)){this.dragging_=!0;var e=new u.a(c.a.POINTERDRAG,this.map_,t,this.dragging_);this.dispatchEvent(e)}},e.prototype.relayEvent_=function(t){this.originalPointerMoveEvent_=t;var e=!(!this.down_||!this.isMoving_(t));this.dispatchEvent(new u.a(t.type,this.map_,t,e))},e.prototype.handleTouchMove_=function(t){var e=this.originalPointerMoveEvent_;e&&!e.defaultPrevented||"boolean"==typeof t.cancelable&&!0!==t.cancelable||t.preventDefault()},e.prototype.isMoving_=function(t){return this.dragging_||Math.abs(t.clientX-this.down_.clientX)>this.moveTolerance_||Math.abs(t.clientY-this.down_.clientY)>this.moveTolerance_},e.prototype.disposeInternal=function(){this.relayedListenerKey_&&(Object(g.unlistenByKey)(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(s.a.TOUCHMOVE,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(Object(g.unlistenByKey)(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(g.unlistenByKey),this.dragListenerKeys_.length=0,this.element_=null,t.prototype.disposeInternal.call(this)},e}(p.a),v=n(164),_=n(117),b=n(73),w=n(91),x=n(82),E=n(182),S=n(123),O=n(45),C=n(14),T=n(13),I=n(0),L=n(2),P=n(35),R=n(25),M=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),N=function(t){function e(e){var n=t.call(this)||this;n.on,n.once,n.un;var r=function(t){var e=null;void 0!==t.keyboardEventTarget&&(e="string"==typeof t.keyboardEventTarget?document.getElementById(t.keyboardEventTarget):t.keyboardEventTarget);var n,r,i,a={},s=t.layers&&"function"==typeof t.layers.getLayers?t.layers:new l.a({layers:t.layers});a[b.a.LAYERGROUP]=s,a[b.a.TARGET]=t.target,a[b.a.VIEW]=void 0!==t.view?t.view:new S.a,void 0!==t.controls&&(Array.isArray(t.controls)?n=new o.a(t.controls.slice()):(Object(T.a)("function"==typeof t.controls.getArray,47),n=t.controls));void 0!==t.interactions&&(Array.isArray(t.interactions)?r=new o.a(t.interactions.slice()):(Object(T.a)("function"==typeof t.interactions.getArray,48),r=t.interactions));void 0!==t.overlays?Array.isArray(t.overlays)?i=new o.a(t.overlays.slice()):(Object(T.a)("function"==typeof t.overlays.getArray,49),i=t.overlays):i=new o.a;return{controls:n,interactions:r,keyboardEventTarget:e,overlays:i,values:a}}(e);return n.boundHandleBrowserEvent_=n.handleBrowserEvent.bind(n),n.maxTilesLoading_=void 0!==e.maxTilesLoading?e.maxTilesLoading:16,n.pixelRatio_=void 0!==e.pixelRatio?e.pixelRatio:d.a,n.postRenderTimeoutHandle_,n.animationDelayKey_,n.animationDelay_=function(){this.animationDelayKey_=void 0,this.renderFrame_(Date.now())}.bind(n),n.coordinateToPixelTransform_=Object(C.c)(),n.pixelToCoordinateTransform_=Object(C.c)(),n.frameIndex_=0,n.frameState_=null,n.previousExtent_=null,n.viewPropertyListenerKey_=null,n.viewChangeListenerKey_=null,n.layerGroupPropertyListenerKeys_=null,n.viewport_=document.createElement("div"),n.viewport_.className="ol-viewport"+("ontouchstart"in window?" ol-touch":""),n.viewport_.style.position="relative",n.viewport_.style.overflow="hidden",n.viewport_.style.width="100%",n.viewport_.style.height="100%",n.overlayContainer_=document.createElement("div"),n.overlayContainer_.style.position="absolute",n.overlayContainer_.style.zIndex="0",n.overlayContainer_.style.width="100%",n.overlayContainer_.style.height="100%",n.overlayContainer_.style.pointerEvents="none",n.overlayContainer_.className="ol-overlaycontainer",n.viewport_.appendChild(n.overlayContainer_),n.overlayContainerStopEvent_=document.createElement("div"),n.overlayContainerStopEvent_.style.position="absolute",n.overlayContainerStopEvent_.style.zIndex="0",n.overlayContainerStopEvent_.style.width="100%",n.overlayContainerStopEvent_.style.height="100%",n.overlayContainerStopEvent_.style.pointerEvents="none",n.overlayContainerStopEvent_.className="ol-overlaycontainer-stopevent",n.viewport_.appendChild(n.overlayContainerStopEvent_),n.mapBrowserEventHandler_=null,n.moveTolerance_=e.moveTolerance,n.keyboardEventTarget_=r.keyboardEventTarget,n.keyHandlerKeys_=null,n.controls=r.controls||new o.a,n.interactions=r.interactions||new o.a,n.overlays_=r.overlays,n.overlayIdIndex_={},n.renderer_=null,n.handleResize_,n.postRenderFunctions_=[],n.tileQueue_=new E.a(n.getTilePriority.bind(n),n.handleTileChange_.bind(n)),n.addChangeListener(b.a.LAYERGROUP,n.handleLayerGroupChanged_),n.addChangeListener(b.a.VIEW,n.handleViewChanged_),n.addChangeListener(b.a.SIZE,n.handleSizeChanged_),n.addChangeListener(b.a.TARGET,n.handleTargetChanged_),n.setProperties(r.values),n.controls.forEach(function(t){t.setMap(this)}.bind(n)),n.controls.addEventListener(a.a.ADD,function(t){t.element.setMap(this)}.bind(n)),n.controls.addEventListener(a.a.REMOVE,function(t){t.element.setMap(null)}.bind(n)),n.interactions.forEach(function(t){t.setMap(this)}.bind(n)),n.interactions.addEventListener(a.a.ADD,function(t){t.element.setMap(this)}.bind(n)),n.interactions.addEventListener(a.a.REMOVE,function(t){t.element.setMap(null)}.bind(n)),n.overlays_.forEach(n.addOverlayInternal_.bind(n)),n.overlays_.addEventListener(a.a.ADD,function(t){this.addOverlayInternal_(t.element)}.bind(n)),n.overlays_.addEventListener(a.a.REMOVE,function(t){var e=t.element.getId();void 0!==e&&delete this.overlayIdIndex_[e.toString()],t.element.setMap(null)}.bind(n)),n}return M(e,t),e.prototype.createRenderer=function(){throw new Error("Use a map type that has a createRenderer method")},e.prototype.addControl=function(t){this.getControls().push(t)},e.prototype.addInteraction=function(t){this.getInteractions().push(t)},e.prototype.addLayer=function(t){this.getLayerGroup().getLayers().push(t)},e.prototype.addOverlay=function(t){this.getOverlays().push(t)},e.prototype.addOverlayInternal_=function(t){var e=t.getId();void 0!==e&&(this.overlayIdIndex_[e.toString()]=t),t.setMap(this)},e.prototype.disposeInternal=function(){this.setTarget(null),t.prototype.disposeInternal.call(this)},e.prototype.forEachFeatureAtPixel=function(t,e,n){if(this.frameState_){var r=this.getCoordinateFromPixelInternal(t),i=void 0!==(n=void 0!==n?n:{}).hitTolerance?n.hitTolerance:0,o=void 0!==n.layerFilter?n.layerFilter:f.b,a=!1!==n.checkWrapped;return this.renderer_.forEachFeatureAtCoordinate(r,this.frameState_,i,a,e,null,o,null)}},e.prototype.getFeaturesAtPixel=function(t,e){var n=[];return this.forEachFeatureAtPixel(t,(function(t){n.push(t)}),e),n},e.prototype.forEachLayerAtPixel=function(t,e,n){if(this.frameState_){var r=n||{},i=void 0!==r.hitTolerance?r.hitTolerance:0,o=r.layerFilter||f.b;return this.renderer_.forEachLayerAtPixel(t,this.frameState_,i,e,o)}},e.prototype.hasFeatureAtPixel=function(t,e){if(!this.frameState_)return!1;var n=this.getCoordinateFromPixelInternal(t),r=void 0!==(e=void 0!==e?e:{}).layerFilter?e.layerFilter:f.b,i=void 0!==e.hitTolerance?e.hitTolerance:0,o=!1!==e.checkWrapped;return this.renderer_.hasFeatureAtCoordinate(n,this.frameState_,i,o,r,null)},e.prototype.getEventCoordinate=function(t){return this.getCoordinateFromPixel(this.getEventPixel(t))},e.prototype.getEventCoordinateInternal=function(t){return this.getCoordinateFromPixelInternal(this.getEventPixel(t))},e.prototype.getEventPixel=function(t){var e=this.viewport_.getBoundingClientRect(),n="changedTouches"in t?t.changedTouches[0]:t;return[n.clientX-e.left,n.clientY-e.top]},e.prototype.getTarget=function(){return this.get(b.a.TARGET)},e.prototype.getTargetElement=function(){var t=this.getTarget();return void 0!==t?"string"==typeof t?document.getElementById(t):t:null},e.prototype.getCoordinateFromPixel=function(t){return Object(L.toUserCoordinate)(this.getCoordinateFromPixelInternal(t),this.getView().getProjection())},e.prototype.getCoordinateFromPixelInternal=function(t){var e=this.frameState_;return e?Object(C.a)(e.pixelToCoordinateTransform,t.slice()):null},e.prototype.getControls=function(){return this.controls},e.prototype.getOverlays=function(){return this.overlays_},e.prototype.getOverlayById=function(t){var e=this.overlayIdIndex_[t.toString()];return void 0!==e?e:null},e.prototype.getInteractions=function(){return this.interactions},e.prototype.getLayerGroup=function(){return this.get(b.a.LAYERGROUP)},e.prototype.getLayers=function(){return this.getLayerGroup().getLayers()},e.prototype.getLoading=function(){for(var t=this.getLayerGroup().getLayerStatesArray(),e=0,n=t.length;e<n;++e){var r=t[e].layer.getSource();if(r&&r.loading)return!0}return!1},e.prototype.getPixelFromCoordinate=function(t){var e=Object(L.fromUserCoordinate)(t,this.getView().getProjection());return this.getPixelFromCoordinateInternal(e)},e.prototype.getPixelFromCoordinateInternal=function(t){var e=this.frameState_;return e?Object(C.a)(e.coordinateToPixelTransform,t.slice(0,2)):null},e.prototype.getRenderer=function(){return this.renderer_},e.prototype.getSize=function(){return this.get(b.a.SIZE)},e.prototype.getView=function(){return this.get(b.a.VIEW)},e.prototype.getViewport=function(){return this.viewport_},e.prototype.getOverlayContainer=function(){return this.overlayContainer_},e.prototype.getOverlayContainerStopEvent=function(){return this.overlayContainerStopEvent_},e.prototype.getOwnerDocument=function(){var t=this.getTargetElement();return t?t.ownerDocument:document},e.prototype.getTilePriority=function(t,e,n,r){return Object(E.b)(this.frameState_,t,e,n,r)},e.prototype.handleBrowserEvent=function(t,e){var n=e||t.type,r=new u.a(n,this,t);this.handleMapBrowserEvent(r)},e.prototype.handleMapBrowserEvent=function(t){if(this.frameState_){var e=t.originalEvent,n=e.type;if(n===h.a.POINTERDOWN||n===s.a.WHEEL||n===s.a.KEYDOWN){var r=this.getOwnerDocument(),i=this.viewport_.getRootNode?this.viewport_.getRootNode():r,o=e.target;if(this.overlayContainerStopEvent_.contains(o)||!(i===r?r.documentElement:i).contains(o))return}if(t.frameState=this.frameState_,!1!==this.dispatchEvent(t))for(var a=this.getInteractions().getArray().slice(),l=a.length-1;l>=0;l--){var u=a[l];if(u.getMap()===this&&u.getActive()&&this.getTargetElement())if(!u.handleEvent(t)||t.propagationStopped)break}}},e.prototype.handlePostRender=function(){var t=this.frameState_,e=this.tileQueue_;if(!e.isEmpty()){var n=this.maxTilesLoading_,r=n;if(t){var i=t.viewHints;if(i[O.a.ANIMATING]||i[O.a.INTERACTING]){var o=Date.now()-t.time>8;n=o?0:8,r=o?0:2}}e.getTilesLoading()<n&&(e.reprioritize(),e.loadMoreTiles(n,r))}!t||!this.hasListener(x.a.RENDERCOMPLETE)||t.animate||this.tileQueue_.getTilesLoading()||this.getLoading()||this.renderer_.dispatchRenderEvent(x.a.RENDERCOMPLETE,t);for(var a=this.postRenderFunctions_,s=0,l=a.length;s<l;++s)a[s](this,t);a.length=0},e.prototype.handleSizeChanged_=function(){this.getView()&&!this.getView().getAnimating()&&this.getView().resolveConstraints(0),this.render()},e.prototype.handleTargetChanged_=function(){var t;if(this.getTarget()&&(t=this.getTargetElement()),this.mapBrowserEventHandler_){for(var e=0,n=this.keyHandlerKeys_.length;e<n;++e)Object(g.unlistenByKey)(this.keyHandlerKeys_[e]);this.keyHandlerKeys_=null,this.viewport_.removeEventListener(s.a.CONTEXTMENU,this.boundHandleBrowserEvent_),this.viewport_.removeEventListener(s.a.WHEEL,this.boundHandleBrowserEvent_),void 0!==this.handleResize_&&(removeEventListener(s.a.RESIZE,this.handleResize_,!1),this.handleResize_=void 0),this.mapBrowserEventHandler_.dispose(),this.mapBrowserEventHandler_=null,Object(R.e)(this.viewport_)}if(t){for(var r in t.appendChild(this.viewport_),this.renderer_||(this.renderer_=this.createRenderer()),this.mapBrowserEventHandler_=new m(this,this.moveTolerance_),c.a)this.mapBrowserEventHandler_.addEventListener(c.a[r],this.handleMapBrowserEvent.bind(this));this.viewport_.addEventListener(s.a.CONTEXTMENU,this.boundHandleBrowserEvent_,!1),this.viewport_.addEventListener(s.a.WHEEL,this.boundHandleBrowserEvent_,!!d.e&&{passive:!1});var i=this.keyboardEventTarget_?this.keyboardEventTarget_:t;this.keyHandlerKeys_=[Object(g.listen)(i,s.a.KEYDOWN,this.handleBrowserEvent,this),Object(g.listen)(i,s.a.KEYPRESS,this.handleBrowserEvent,this)],this.handleResize_||(this.handleResize_=this.updateSize.bind(this),window.addEventListener(s.a.RESIZE,this.handleResize_,!1))}else this.renderer_&&(clearTimeout(this.postRenderTimeoutHandle_),this.postRenderTimeoutHandle_=void 0,this.postRenderFunctions_.length=0,this.renderer_.dispose(),this.renderer_=null),this.animationDelayKey_&&(cancelAnimationFrame(this.animationDelayKey_),this.animationDelayKey_=void 0);this.updateSize()},e.prototype.handleTileChange_=function(){this.render()},e.prototype.handleViewPropertyChanged_=function(){this.render()},e.prototype.handleViewChanged_=function(){this.viewPropertyListenerKey_&&(Object(g.unlistenByKey)(this.viewPropertyListenerKey_),this.viewPropertyListenerKey_=null),this.viewChangeListenerKey_&&(Object(g.unlistenByKey)(this.viewChangeListenerKey_),this.viewChangeListenerKey_=null);var t=this.getView();t&&(this.updateViewportSize_(),this.viewPropertyListenerKey_=Object(g.listen)(t,w.a.PROPERTYCHANGE,this.handleViewPropertyChanged_,this),this.viewChangeListenerKey_=Object(g.listen)(t,s.a.CHANGE,this.handleViewPropertyChanged_,this),t.resolveConstraints(0)),this.render()},e.prototype.handleLayerGroupChanged_=function(){this.layerGroupPropertyListenerKeys_&&(this.layerGroupPropertyListenerKeys_.forEach(g.unlistenByKey),this.layerGroupPropertyListenerKeys_=null);var t=this.getLayerGroup();t&&(this.layerGroupPropertyListenerKeys_=[Object(g.listen)(t,w.a.PROPERTYCHANGE,this.render,this),Object(g.listen)(t,s.a.CHANGE,this.render,this)]),this.render()},e.prototype.isRendered=function(){return!!this.frameState_},e.prototype.renderSync=function(){this.animationDelayKey_&&cancelAnimationFrame(this.animationDelayKey_),this.animationDelay_()},e.prototype.redrawText=function(){for(var t=this.getLayerGroup().getLayerStatesArray(),e=0,n=t.length;e<n;++e){var r=t[e].layer;r.hasRenderer()&&r.getRenderer().handleFontsChanged()}},e.prototype.render=function(){this.renderer_&&void 0===this.animationDelayKey_&&(this.animationDelayKey_=requestAnimationFrame(this.animationDelay_))},e.prototype.removeControl=function(t){return this.getControls().remove(t)},e.prototype.removeInteraction=function(t){return this.getInteractions().remove(t)},e.prototype.removeLayer=function(t){return this.getLayerGroup().getLayers().remove(t)},e.prototype.removeOverlay=function(t){return this.getOverlays().remove(t)},e.prototype.renderFrame_=function(t){var e=this,n=this.getSize(),r=this.getView(),i=this.frameState_,o=null;if(void 0!==n&&Object(P.b)(n)&&r&&r.isDef()){var a=r.getHints(this.frameState_?this.frameState_.viewHints:void 0),s=r.getState();o={animate:!1,coordinateToPixelTransform:this.coordinateToPixelTransform_,declutterTree:null,extent:Object(I.getForViewAndSize)(s.center,s.resolution,s.rotation,n),index:this.frameIndex_++,layerIndex:0,layerStatesArray:this.getLayerGroup().getLayerStatesArray(),pixelRatio:this.pixelRatio_,pixelToCoordinateTransform:this.pixelToCoordinateTransform_,postRenderFunctions:[],size:n,tileQueue:this.tileQueue_,time:t,usedTiles:{},viewState:s,viewHints:a,wantedTiles:{}}}if(this.frameState_=o,this.renderer_.renderFrame(o),o){if(o.animate&&this.render(),Array.prototype.push.apply(this.postRenderFunctions_,o.postRenderFunctions),i)(!this.previousExtent_||!Object(I.isEmpty)(this.previousExtent_)&&!Object(I.equals)(o.extent,this.previousExtent_))&&(this.dispatchEvent(new v.a(_.a.MOVESTART,this,i)),this.previousExtent_=Object(I.createOrUpdateEmpty)(this.previousExtent_));this.previousExtent_&&!o.viewHints[O.a.ANIMATING]&&!o.viewHints[O.a.INTERACTING]&&!Object(I.equals)(o.extent,this.previousExtent_)&&(this.dispatchEvent(new v.a(_.a.MOVEEND,this,o)),Object(I.clone)(o.extent,this.previousExtent_))}this.dispatchEvent(new v.a(_.a.POSTRENDER,this,o)),this.postRenderTimeoutHandle_||(this.postRenderTimeoutHandle_=setTimeout((function(){e.postRenderTimeoutHandle_=void 0,e.handlePostRender()}),0))},e.prototype.setLayerGroup=function(t){this.set(b.a.LAYERGROUP,t)},e.prototype.setSize=function(t){this.set(b.a.SIZE,t)},e.prototype.setTarget=function(t){this.set(b.a.TARGET,t)},e.prototype.setView=function(t){this.set(b.a.VIEW,t)},e.prototype.updateSize=function(){var t=this.getTargetElement(),e=void 0;if(t){var n=getComputedStyle(t),r=t.offsetWidth-parseFloat(n.borderLeftWidth)-parseFloat(n.paddingLeft)-parseFloat(n.paddingRight)-parseFloat(n.borderRightWidth),i=t.offsetHeight-parseFloat(n.borderTopWidth)-parseFloat(n.paddingTop)-parseFloat(n.paddingBottom)-parseFloat(n.borderBottomWidth);isNaN(r)||isNaN(i)||(e=[r,i],Object(P.b)(e)||console.warn("No map visible because the map container's width or height are 0."))}this.setSize(e),this.updateViewportSize_()},e.prototype.updateViewportSize_=function(){var t=this.getView();if(t){var e=void 0,n=getComputedStyle(this.viewport_);n.width&&n.height&&(e=[parseInt(n.width,10),parseInt(n.height,10)]),t.setViewportSize(e)}},e}(i.a);e.a=N},function(t,e,n){"use strict";var r,i=n(111),o=n(30),a=n(4),s=n(14),l=n(0),u=n(162),c=n(79),h=n(21),p=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});function d(t,e){u.a.expire()}var f=function(t){function e(e){var n=t.call(this)||this;return n.map_=e,n}return p(e,t),e.prototype.dispatchRenderEvent=function(t,e){Object(a.b)()},e.prototype.calculateMatrices2D=function(t){var e=t.viewState,n=t.coordinateToPixelTransform,r=t.pixelToCoordinateTransform;Object(s.b)(n,t.size[0]/2,t.size[1]/2,1/e.resolution,-1/e.resolution,-e.rotation,-e.center[0],-e.center[1]),Object(s.d)(r,n)},e.prototype.forEachFeatureAtCoordinate=function(t,e,n,r,i,o,a,s){var u,p=e.viewState;function d(t,e,n,r){return i.call(o,e,t?n:null,r)}var f=p.projection,g=Object(h.l)(t.slice(),f),y=[[0,0]];if(f.canWrapX()&&r){var m=f.getExtent(),v=Object(l.getWidth)(m);y.push([-v,0],[v,0])}for(var _=e.layerStatesArray,b=_.length,w=[],x=[],E=0;E<y.length;E++)for(var S=b-1;S>=0;--S){var O=_[S],C=O.layer;if(C.hasRenderer()&&Object(c.b)(O,p)&&a.call(s,C)){var T=C.getRenderer(),I=C.getSource();if(T&&I){var L=I.getWrapX()?g:t,P=d.bind(null,O.managed);x[0]=L[0]+y[E][0],x[1]=L[1]+y[E][1],u=T.forEachFeatureAtCoordinate(x,e,n,P,w)}if(u)return u}}if(0!==w.length){var R=1/w.length;return w.forEach((function(t,e){return t.distanceSq+=e*R})),w.sort((function(t,e){return t.distanceSq-e.distanceSq})),w.some((function(t){return u=t.callback(t.feature,t.layer,t.geometry)})),u}},e.prototype.forEachLayerAtPixel=function(t,e,n,r,i){return Object(a.b)()},e.prototype.hasFeatureAtCoordinate=function(t,e,n,r,i,a){return void 0!==this.forEachFeatureAtCoordinate(t,e,n,r,o.b,this,i,a)},e.prototype.getMap=function(){return this.map_},e.prototype.renderFrame=function(t){Object(a.b)()},e.prototype.scheduleExpireIconCache=function(t){u.a.canExpireCache()&&t.postRenderFunctions.push(d)},e}(i.a),g=n(91),y=n(154),m=n(82),v=n(39),_=n(36),b=n(17),w=n(10),x=n(25),E=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),S=function(t){function e(e){var n=t.call(this,e)||this;n.fontChangeListenerKey_=Object(w.listen)(b.a,g.a.PROPERTYCHANGE,e.redrawText.bind(e)),n.element_=document.createElement("div");var r=n.element_.style;r.position="absolute",r.width="100%",r.height="100%",r.zIndex="0",n.element_.className=_.e+" ol-layers";var i=e.getViewport();return i.insertBefore(n.element_,i.firstChild||null),n.children_=[],n.renderedVisible_=!0,n}return E(e,t),e.prototype.dispatchRenderEvent=function(t,e){var n=this.getMap();if(n.hasListener(t)){var r=new y.a(t,void 0,e);n.dispatchEvent(r)}},e.prototype.disposeInternal=function(){Object(w.unlistenByKey)(this.fontChangeListenerKey_),this.element_.parentNode.removeChild(this.element_),t.prototype.disposeInternal.call(this)},e.prototype.renderFrame=function(t){if(t){this.calculateMatrices2D(t),this.dispatchRenderEvent(m.a.PRECOMPOSE,t);var e=t.layerStatesArray.sort((function(t,e){return t.zIndex-e.zIndex})),n=t.viewState;this.children_.length=0;for(var r=[],i=null,o=0,a=e.length;o<a;++o){var s=e[o];if(t.layerIndex=o,Object(c.b)(s,n)&&(s.sourceState==v.a.READY||s.sourceState==v.a.UNDEFINED)){var l=s.layer,u=l.render(t,i);u&&(u!==i&&(this.children_.push(u),i=u),"getDeclutter"in l&&r.push(l))}}for(o=r.length-1;o>=0;--o)r[o].renderDeclutter(t);Object(x.f)(this.element_,this.children_),this.dispatchRenderEvent(m.a.POSTCOMPOSE,t),this.renderedVisible_||(this.element_.style.display="",this.renderedVisible_=!0),this.scheduleExpireIconCache(t)}else this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1)},e.prototype.forEachLayerAtPixel=function(t,e,n,r,i){for(var o=e.viewState,a=e.layerStatesArray,s=a.length-1;s>=0;--s){var l=a[s],u=l.layer;if(u.hasRenderer()&&Object(c.b)(l,o)&&i(u)){var h=u.getRenderer().getDataAtPixel(t,e,n);if(h){var p=r(u,h);if(p)return p}}}},e}(f);e.a=S},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";n.r(e),n.d(e,"Graticule",(function(){return L})),n.d(e,"Group",(function(){return P.a})),n.d(e,"Heatmap",(function(){return Et})),n.d(e,"Image",(function(){return St.a})),n.d(e,"Layer",(function(){return Ot.a})),n.d(e,"MapboxVector",(function(){return We})),n.d(e,"Tile",(function(){return Kt.a})),n.d(e,"Vector",(function(){return d.a})),n.d(e,"VectorImage",(function(){return rn})),n.d(e,"VectorTile",(function(){return Xt})),n.d(e,"WebGLPoints",(function(){return Mn}));var r=n(37),i=n(82),o=n(26),a=n(59),s=n(16),l=n(43),u=n(31),c=n(61),h=n(41),p=n(99),d=n(65),f=n(66),g=n(0),y=n(6),m=n(8),v=n(21),_=n(2),b=n(177),w=(n(57),n(14)),x=n(97);function E(t,e,n){for(var r,i,o,a,s,l,u=[],c=t(0),h=t(1),p=e(c),d=e(h),f=[h,c],g=[d,p],y=[1,0],v={},_=1e5;--_>0&&y.length>0;)o=y.pop(),c=f.pop(),p=g.pop(),(l=o.toString())in v||(u.push(p[0],p[1]),v[l]=!0),a=y.pop(),h=f.pop(),d=g.pop(),i=e(r=t(s=(o+a)/2)),Object(m.h)(i[0],i[1],p[0],p[1],d[0],d[1])<n?(u.push(d[0],d[1]),v[l=a.toString()]=!0):(y.push(a,s,s,o),g.push(d,i,i,p),f.push(h,r,r,c));return u}var S,O,C=(S=function(t,e){return(S=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}S(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),T=new c.a({color:"rgba(0,0,0,0.2)"}),I=[90,45,30,20,10,5,2,1,.5,.2,.1,.05,.01,.005,.002,.001],L=function(t){function e(e){var n=this,o=e||{},s=Object(y.a)({updateWhileAnimating:!0,updateWhileInteracting:!0,renderBuffer:0},o);return delete s.maxLines,delete s.strokeStyle,delete s.targetSize,delete s.showLabels,delete s.lonLabelFormatter,delete s.latLabelFormatter,delete s.lonLabelPosition,delete s.latLabelPosition,delete s.lonLabelStyle,delete s.latLabelStyle,delete s.intervals,(n=t.call(this,s)||this).projection_=null,n.maxLat_=1/0,n.maxLon_=1/0,n.minLat_=-1/0,n.minLon_=-1/0,n.maxX_=1/0,n.maxY_=1/0,n.minX_=-1/0,n.minY_=-1/0,n.targetSize_=void 0!==o.targetSize?o.targetSize:100,n.maxLines_=void 0!==o.maxLines?o.maxLines:100,n.meridians_=[],n.parallels_=[],n.strokeStyle_=void 0!==o.strokeStyle?o.strokeStyle:T,n.fromLonLatTransform_=void 0,n.toLonLatTransform_=void 0,n.projectionCenterLonLat_=null,n.bottomLeft_=null,n.bottomRight_=null,n.topLeft_=null,n.topRight_=null,n.meridiansLabels_=null,n.parallelsLabels_=null,o.showLabels&&(n.lonLabelFormatter_=null==o.lonLabelFormatter?v.d.bind(n,"EW"):o.lonLabelFormatter,n.latLabelFormatter_=null==o.latLabelFormatter?v.d.bind(n,"NS"):o.latLabelFormatter,n.lonLabelPosition_=null==o.lonLabelPosition?0:o.lonLabelPosition,n.latLabelPosition_=null==o.latLabelPosition?1:o.latLabelPosition,n.lonLabelStyleBase_=new h.c({text:void 0!==o.lonLabelStyle?o.lonLabelStyle.clone():new p.a({font:"12px Calibri,sans-serif",textBaseline:"bottom",fill:new a.a({color:"rgba(0,0,0,1)"}),stroke:new c.a({color:"rgba(255,255,255,1)",width:3})})}),n.lonLabelStyle_=function(t){var e=t.get("graticule_label");return this.lonLabelStyleBase_.getText().setText(e),this.lonLabelStyleBase_}.bind(n),n.latLabelStyleBase_=new h.c({text:void 0!==o.latLabelStyle?o.latLabelStyle.clone():new p.a({font:"12px Calibri,sans-serif",textAlign:"right",fill:new a.a({color:"rgba(0,0,0,1)"}),stroke:new c.a({color:"rgba(255,255,255,1)",width:3})})}),n.latLabelStyle_=function(t){var e=t.get("graticule_label");return this.latLabelStyleBase_.getText().setText(e),this.latLabelStyleBase_}.bind(n),n.meridiansLabels_=[],n.parallelsLabels_=[],n.addEventListener(i.a.POSTRENDER,n.drawLabels_.bind(n))),n.intervals_=void 0!==o.intervals?o.intervals:I,n.setSource(new f.a({loader:n.loaderFunction.bind(n),strategy:n.strategyFunction.bind(n),features:new r.a,overlaps:!1,useSpatialIndex:!1,wrapX:o.wrapX})),n.featurePool_=[],n.lineStyle_=new h.c({stroke:n.strokeStyle_}),n.loadedExtent_=null,n.renderedExtent_=null,n.setRenderOrder(null),n}return C(e,t),e.prototype.strategyFunction=function(t,e){var n=t.slice();return this.projection_&&this.getSource().getWrapX()&&Object(g.wrapX)(n,this.projection_),this.loadedExtent_&&(Object(g.approximatelyEquals)(this.loadedExtent_,n,e)?n=this.loadedExtent_.slice():this.getSource().removeLoadedExtent(this.loadedExtent_)),[n]},e.prototype.loaderFunction=function(t,e,n){this.loadedExtent_=t;var r=this.getSource(),i=this.getExtent()||[-1/0,-1/0,1/0,1/0],a=Object(g.getIntersection)(i,t);if(!(this.renderedExtent_&&Object(g.equals)(this.renderedExtent_,a)||(this.renderedExtent_=a,Object(g.isEmpty)(a)))){var s=Object(g.getCenter)(a),l=e*e/4;(!this.projection_||!Object(_.equivalent)(this.projection_,n))&&this.updateProjectionInfo_(n),this.createGraticule_(a,s,e,l);var u,c=this.meridians_.length+this.parallels_.length;for(this.meridiansLabels_&&(c+=this.meridians_.length),this.parallelsLabels_&&(c+=this.parallels_.length);c>this.featurePool_.length;)u=new o.a,this.featurePool_.push(u);var h=r.getFeaturesCollection();h.clear();var p,d,f=0;for(p=0,d=this.meridians_.length;p<d;++p)(u=this.featurePool_[f++]).setGeometry(this.meridians_[p]),u.setStyle(this.lineStyle_),h.push(u);for(p=0,d=this.parallels_.length;p<d;++p)(u=this.featurePool_[f++]).setGeometry(this.parallels_[p]),u.setStyle(this.lineStyle_),h.push(u)}},e.prototype.addMeridian_=function(t,e,n,r,i,o){var a=this.getMeridian_(t,e,n,r,o);if(Object(g.intersects)(a.getExtent(),i)){if(this.meridiansLabels_){var s=this.lonLabelFormatter_(t);o in this.meridiansLabels_?this.meridiansLabels_[o].text=s:this.meridiansLabels_[o]={geom:new u.a([]),text:s}}this.meridians_[o++]=a}return o},e.prototype.addParallel_=function(t,e,n,r,i,o){var a=this.getParallel_(t,e,n,r,o);if(Object(g.intersects)(a.getExtent(),i)){if(this.parallelsLabels_){var s=this.latLabelFormatter_(t);o in this.parallelsLabels_?this.parallelsLabels_[o].text=s:this.parallelsLabels_[o]={geom:new u.a([]),text:s}}this.parallels_[o++]=a}return o},e.prototype.drawLabels_=function(t){var e=t.frameState.viewState.rotation,n=t.frameState.extent,r=Object(g.getCenter)(n),i=n;if(e){var o=Object(g.getWidth)(n),a=Object(g.getHeight)(n),s=Math.abs(Math.cos(e)),l=Math.abs(Math.sin(e)),u=(l*a-s*o)/(l*l-s*s),c=(l*o-s*a)/(l*l-s*s);i=[r[0]-u/2,r[1]-c/2,r[0]+u/2,r[1]+c/2]}var h=0,p=0,d=this.latLabelPosition_<.5,f=this.projection_.getExtent(),y=Object(g.getWidth)(f);this.getSource().getWrapX()&&this.projection_.canWrapX()&&!Object(g.containsExtent)(f,n)&&(h=Math.floor((n[0]-f[0])/y),p=Math.ceil((n[2]-f[2])/y),d=d!==Math.abs(e)>Math.PI/2);for(var m=function(t){var e,n=t.inversePixelTransform[0],r=t.frameState,i=Object(w.f)(t.inversePixelTransform.slice(),r.coordinateToPixelTransform),o=Object(x.b)(r.viewState.resolution,n),a=Object(_.getUserProjection)();return a&&(e=Object(_.getTransformFromProjections)(a,r.viewState.projection)),new b.a(t.context,n,r.extent,i,r.viewState.rotation,o,e)}(t),v=h;v<=p;++v){var E=this.meridians_.length+this.parallels_.length,S=void 0,O=void 0,C=void 0,T=void 0;if(this.meridiansLabels_)for(O=0,C=this.meridiansLabels_.length;O<C;++O){var I=this.meridians_[O];if(e||0!==v)(L=I.clone()).translate(v*y,0),L.rotate(-e,r),(T=this.getMeridianPoint_(L,i,O)).rotate(e,r);else T=this.getMeridianPoint_(I,n,O);(S=this.featurePool_[E++]).setGeometry(T),S.set("graticule_label",this.meridiansLabels_[O].text),m.drawFeature(S,this.lonLabelStyle_(S))}if(this.parallelsLabels_&&(v===h&&d||v===p&&!d))for(O=0,C=this.parallels_.length;O<C;++O){var L;I=this.parallels_[O];if(e||0!==v)(L=I.clone()).translate(v*y,0),L.rotate(-e,r),(T=this.getParallelPoint_(L,i,O)).rotate(e,r);else T=this.getParallelPoint_(I,n,O);(S=this.featurePool_[E++]).setGeometry(T),S.set("graticule_label",this.parallelsLabels_[O].text),m.drawFeature(S,this.latLabelStyle_(S))}}},e.prototype.createGraticule_=function(t,e,n,r){var i=this.getInterval_(n);if(-1==i)return this.meridians_.length=0,this.parallels_.length=0,this.meridiansLabels_&&(this.meridiansLabels_.length=0),void(this.parallelsLabels_&&(this.parallelsLabels_.length=0));var o=!1,a=this.projection_.getExtent(),s=Object(g.getWidth)(a);this.getSource().getWrapX()&&this.projection_.canWrapX()&&!Object(g.containsExtent)(a,t)&&(Object(g.getWidth)(t)>=s?(t[0]=a[0],t[2]=a[2]):o=!0);var l=[Object(m.a)(e[0],this.minX_,this.maxX_),Object(m.a)(e[1],this.minY_,this.maxY_)],u=this.toLonLatTransform_(l);isNaN(u[1])&&(u[1]=Math.abs(this.maxLat_)>=Math.abs(this.minLat_)?this.maxLat_:this.minLat_);var c,h,p,d,f=Object(m.a)(u[0],this.minLon_,this.maxLon_),y=Object(m.a)(u[1],this.minLat_,this.maxLat_),v=this.maxLines_,_=t;o||(_=[Object(m.a)(t[0],this.minX_,this.maxX_),Object(m.a)(t[1],this.minY_,this.maxY_),Object(m.a)(t[2],this.minX_,this.maxX_),Object(m.a)(t[3],this.minY_,this.maxY_)]);var b=Object(g.applyTransform)(_,this.toLonLatTransform_,void 0,8),w=b[3],x=b[2],E=b[1],S=b[0];if(o||(Object(g.containsCoordinate)(_,this.bottomLeft_)&&(S=this.minLon_,E=this.minLat_),Object(g.containsCoordinate)(_,this.bottomRight_)&&(x=this.maxLon_,E=this.minLat_),Object(g.containsCoordinate)(_,this.topLeft_)&&(S=this.minLon_,w=this.maxLat_),Object(g.containsCoordinate)(_,this.topRight_)&&(x=this.maxLon_,w=this.maxLat_),w=Object(m.a)(w,y,this.maxLat_),x=Object(m.a)(x,f,this.maxLon_),E=Object(m.a)(E,this.minLat_,y),S=Object(m.a)(S,this.minLon_,f)),f=Math.floor(f/i)*i,d=Object(m.a)(f,this.minLon_,this.maxLon_),h=this.addMeridian_(d,E,w,r,t,0),c=0,o)for(;(d-=i)>=S&&c++<v;)h=this.addMeridian_(d,E,w,r,t,h);else for(;d!=this.minLon_&&c++<v;)d=Math.max(d-i,this.minLon_),h=this.addMeridian_(d,E,w,r,t,h);if(d=Object(m.a)(f,this.minLon_,this.maxLon_),c=0,o)for(;(d+=i)<=x&&c++<v;)h=this.addMeridian_(d,E,w,r,t,h);else for(;d!=this.maxLon_&&c++<v;)d=Math.min(d+i,this.maxLon_),h=this.addMeridian_(d,E,w,r,t,h);for(this.meridians_.length=h,this.meridiansLabels_&&(this.meridiansLabels_.length=h),y=Math.floor(y/i)*i,p=Object(m.a)(y,this.minLat_,this.maxLat_),h=this.addParallel_(p,S,x,r,t,0),c=0;p!=this.minLat_&&c++<v;)p=Math.max(p-i,this.minLat_),h=this.addParallel_(p,S,x,r,t,h);for(p=Object(m.a)(y,this.minLat_,this.maxLat_),c=0;p!=this.maxLat_&&c++<v;)p=Math.min(p+i,this.maxLat_),h=this.addParallel_(p,S,x,r,t,h);this.parallels_.length=h,this.parallelsLabels_&&(this.parallelsLabels_.length=h)},e.prototype.getInterval_=function(t){for(var e=this.projectionCenterLonLat_[0],n=this.projectionCenterLonLat_[1],r=-1,i=Math.pow(this.targetSize_*t,2),o=[],a=[],s=0,l=this.intervals_.length;s<l;++s){var u=Object(m.a)(this.intervals_[s]/2,0,90),c=Object(m.a)(n,-90+u,90-u);if(o[0]=e-u,o[1]=c-u,a[0]=e+u,a[1]=c+u,this.fromLonLatTransform_(o,o),this.fromLonLatTransform_(a,a),Math.pow(a[0]-o[0],2)+Math.pow(a[1]-o[1],2)<=i)break;r=this.intervals_[s]}return r},e.prototype.getMeridian_=function(t,e,n,r,i){var o=function(t,e,n,r,i){var o=Object(_.get)("EPSG:4326");return E((function(r){return[t,e+(n-e)*r]}),Object(_.getTransform)(o,r),i)}(t,e,n,this.projection_,r),a=this.meridians_[i];return a?(a.setFlatCoordinates(s.a.XY,o),a.changed()):(a=new l.a(o,s.a.XY),this.meridians_[i]=a),a},e.prototype.getMeridianPoint_=function(t,e,n){var r=t.getFlatCoordinates(),i=1,o=r.length-1;r[i]>r[o]&&(i=o,o=1);var a=Math.max(e[1],r[i]),s=Math.min(e[3],r[o]),l=Object(m.a)(e[1]+Math.abs(e[1]-e[3])*this.lonLabelPosition_,a,s),u=[r[i-1]+(r[o-1]-r[i-1])*(l-r[i])/(r[o]-r[i]),l],c=this.meridiansLabels_[n].geom;return c.setCoordinates(u),c},e.prototype.getMeridians=function(){return this.meridians_},e.prototype.getParallel_=function(t,e,n,r,i){var o=function(t,e,n,r,i){var o=Object(_.get)("EPSG:4326");return E((function(r){return[e+(n-e)*r,t]}),Object(_.getTransform)(o,r),i)}(t,e,n,this.projection_,r),a=this.parallels_[i];return a?(a.setFlatCoordinates(s.a.XY,o),a.changed()):a=new l.a(o,s.a.XY),a},e.prototype.getParallelPoint_=function(t,e,n){var r=t.getFlatCoordinates(),i=0,o=r.length-2;r[i]>r[o]&&(i=o,o=0);var a=Math.max(e[0],r[i]),s=Math.min(e[2],r[o]),l=Object(m.a)(e[0]+Math.abs(e[0]-e[2])*this.latLabelPosition_,a,s),u=[l,r[i+1]+(r[o+1]-r[i+1])*(l-r[i])/(r[o]-r[i])],c=this.parallelsLabels_[n].geom;return c.setCoordinates(u),c},e.prototype.getParallels=function(){return this.parallels_},e.prototype.updateProjectionInfo_=function(t){var e=Object(_.get)("EPSG:4326"),n=t.getWorldExtent();this.maxLat_=n[3],this.maxLon_=n[2],this.minLat_=n[1],this.minLon_=n[0];var r=Object(_.getTransform)(t,e);if(this.minLon_<this.maxLon_)this.toLonLatTransform_=r;else{var i=this.minLon_+this.maxLon_/2;this.maxLon_+=360,this.toLonLatTransform_=function(t,e,n){for(var o=n||2,a=r(t,e,o),s=0,l=a.length;s<l;s+=o)a[s]<i&&(a[s]+=360);return a}}this.fromLonLatTransform_=Object(_.getTransform)(e,t);var o=Object(g.applyTransform)([this.minLon_,this.minLat_,this.maxLon_,this.maxLat_],this.fromLonLatTransform_,void 0,8);this.minX_=o[0],this.maxX_=o[2],this.minY_=o[1],this.maxY_=o[3],this.bottomLeft_=this.fromLonLatTransform_([this.minLon_,this.minLat_]),this.bottomRight_=this.fromLonLatTransform_([this.maxLon_,this.minLat_]),this.topLeft_=this.fromLonLatTransform_([this.minLon_,this.maxLat_]),this.topRight_=this.fromLonLatTransform_([this.maxLon_,this.maxLat_]),this.projectionCenterLonLat_=this.toLonLatTransform_(Object(g.getCenter)(t.getExtent())),isNaN(this.projectionCenterLonLat_[1])&&(this.projectionCenterLonLat_[1]=Math.abs(this.maxLat_)>=Math.abs(this.minLat_)?this.maxLat_:this.minLat_),this.projection_=t},e}(d.a),P=n(184),R=n(128),M=n(1),N=n(64),j=n(45),A=["experimental-webgl","webgl","webkit-3d","moz-webgl"];function k(t,e){for(var n=A.length,r=0;r<n;++r)try{var i=t.getContext(A[r],e);if(i)return i}catch(t){}return null}var F=n(13),D=35044;function G(t){switch(t){case 34962:return Float32Array;case 34963:return Uint32Array;default:return Float32Array}}var z=function(){function t(t,e){this.array=null,this.type=t,Object(F.a)(34962===t||34963===t,62),this.usage=void 0!==e?e:D}return t.prototype.ofSize=function(t){this.array=new(G(this.type))(t)},t.prototype.fromArray=function(t){this.array=G(this.type).from(t)},t.prototype.fromArrayBuffer=function(t){this.array=new(G(this.type))(t)},t.prototype.getType=function(){return this.type},t.prototype.getArray=function(){return this.array},t.prototype.getUsage=function(){return this.usage},t.prototype.getSize=function(){return this.array?this.array.length:0},t}(),U=n(196),B=n(154),V="webglcontextlost",q="webglcontextrestored",Y=n(111),X=function(){function t(t){this.gl_=t.webGlContext;var e=this.gl_;this.scaleRatio_=t.scaleRatio||1,this.renderTargetTexture_=e.createTexture(),this.renderTargetTextureSize_=null,this.frameBuffer_=e.createFramebuffer();var n=e.createShader(e.VERTEX_SHADER);e.shaderSource(n,t.vertexShader||"\n precision mediump float;\n \n attribute vec2 a_position;\n varying vec2 v_texCoord;\n varying vec2 v_screenCoord;\n \n uniform vec2 u_screenSize;\n \n void main() {\n v_texCoord = a_position * 0.5 + 0.5;\n v_screenCoord = v_texCoord * u_screenSize;\n gl_Position = vec4(a_position, 0.0, 1.0);\n }\n"),e.compileShader(n);var r=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(r,t.fragmentShader||"\n precision mediump float;\n \n uniform sampler2D u_image;\n \n varying vec2 v_texCoord;\n \n void main() {\n gl_FragColor = texture2D(u_image, v_texCoord);\n }\n"),e.compileShader(r),this.renderTargetProgram_=e.createProgram(),e.attachShader(this.renderTargetProgram_,n),e.attachShader(this.renderTargetProgram_,r),e.linkProgram(this.renderTargetProgram_),this.renderTargetVerticesBuffer_=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,this.renderTargetVerticesBuffer_),e.bufferData(e.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,1,-1,1,1,-1,1]),e.STATIC_DRAW),this.renderTargetAttribLocation_=e.getAttribLocation(this.renderTargetProgram_,"a_position"),this.renderTargetUniformLocation_=e.getUniformLocation(this.renderTargetProgram_,"u_screenSize"),this.renderTargetTextureLocation_=e.getUniformLocation(this.renderTargetProgram_,"u_image"),this.uniforms_=[],t.uniforms&&Object.keys(t.uniforms).forEach(function(n){this.uniforms_.push({value:t.uniforms[n],location:e.getUniformLocation(this.renderTargetProgram_,n)})}.bind(this))}return t.prototype.getGL=function(){return this.gl_},t.prototype.init=function(t){var e=this.getGL(),n=[e.drawingBufferWidth*this.scaleRatio_,e.drawingBufferHeight*this.scaleRatio_];if(e.bindFramebuffer(e.FRAMEBUFFER,this.getFrameBuffer()),e.viewport(0,0,n[0],n[1]),!this.renderTargetTextureSize_||this.renderTargetTextureSize_[0]!==n[0]||this.renderTargetTextureSize_[1]!==n[1]){this.renderTargetTextureSize_=n;var r=e.RGBA,i=e.RGBA,o=e.UNSIGNED_BYTE;e.bindTexture(e.TEXTURE_2D,this.renderTargetTexture_),e.texImage2D(e.TEXTURE_2D,0,r,n[0],n[1],0,i,o,null),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,this.renderTargetTexture_,0)}},t.prototype.apply=function(t,e){var n=this.getGL(),r=t.size;n.bindFramebuffer(n.FRAMEBUFFER,e?e.getFrameBuffer():null),n.activeTexture(n.TEXTURE0),n.bindTexture(n.TEXTURE_2D,this.renderTargetTexture_),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT),n.enable(n.BLEND),n.blendFunc(n.ONE,n.ONE_MINUS_SRC_ALPHA),n.viewport(0,0,n.drawingBufferWidth,n.drawingBufferHeight),n.bindBuffer(n.ARRAY_BUFFER,this.renderTargetVerticesBuffer_),n.useProgram(this.renderTargetProgram_),n.enableVertexAttribArray(this.renderTargetAttribLocation_),n.vertexAttribPointer(this.renderTargetAttribLocation_,2,n.FLOAT,!1,0,0),n.uniform2f(this.renderTargetUniformLocation_,r[0],r[1]),n.uniform1i(this.renderTargetTextureLocation_,0),this.applyUniforms(t),n.drawArrays(n.TRIANGLES,0,6)},t.prototype.getFrameBuffer=function(){return this.frameBuffer_},t.prototype.applyUniforms=function(t){var e,n=this.getGL(),r=1;this.uniforms_.forEach((function(i){if((e="function"==typeof i.value?i.value(t):i.value)instanceof HTMLCanvasElement||e instanceof ImageData)i.texture||(i.texture=n.createTexture()),n.activeTexture(n["TEXTURE"+r]),n.bindTexture(n.TEXTURE_2D,i.texture),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR),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),e instanceof ImageData?n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,e.width,e.height,0,n.UNSIGNED_BYTE,new Uint8Array(e.data)):n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,e),n.uniform1i(i.location,r++);else if(Array.isArray(e))switch(e.length){case 2:return void n.uniform2f(i.location,e[0],e[1]);case 3:return void n.uniform3f(i.location,e[0],e[1],e[2]);case 4:return void n.uniform4f(i.location,e[0],e[1],e[2],e[3]);default:return}else"number"==typeof e&&n.uniform1f(i.location,e)}))},t}();function W(t,e){return t[0]=e[0],t[1]=e[1],t[4]=e[2],t[5]=e[3],t[12]=e[4],t[13]=e[5],t}var H=n(4),K=n(7),Z=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),$="u_projectionMatrix",J="u_offsetScaleMatrix",Q="u_offsetRotateMatrix",tt="u_time",et="u_zoom",nt="u_resolution",rt={UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,UNSIGNED_INT:5125,FLOAT:5126};function it(t){switch(t){case rt.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case rt.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case rt.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case rt.FLOAT:default:return Float32Array.BYTES_PER_ELEMENT}}var ot=function(t){function e(e){var n=t.call(this)||this,r=e||{};n.boundHandleWebGLContextLost_=n.handleWebGLContextLost.bind(n),n.boundHandleWebGLContextRestored_=n.handleWebGLContextRestored.bind(n),n.canvas_=document.createElement("canvas"),n.canvas_.style.position="absolute",n.canvas_.style.left="0",n.gl_=k(n.canvas_);var i=n.getGL();if(n.bufferCache_={},n.currentProgram_=null,Object(F.a)(Object(K.f)(function(){if(!O){var t=k(document.createElement("canvas"));t&&(O=t.getSupportedExtensions())}return O}(),"OES_element_index_uint"),63),i.getExtension("OES_element_index_uint"),n.canvas_.addEventListener(V,n.boundHandleWebGLContextLost_),n.canvas_.addEventListener(q,n.boundHandleWebGLContextRestored_),n.offsetRotateMatrix_=Object(w.c)(),n.offsetScaleMatrix_=Object(w.c)(),n.tmpMat4_=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],n.uniformLocations_={},n.attribLocations_={},n.uniforms_=[],r.uniforms)for(var o in r.uniforms)n.uniforms_.push({name:o,value:r.uniforms[o]});return n.postProcessPasses_=r.postProcesses?r.postProcesses.map((function(t){return new X({webGlContext:i,scaleRatio:t.scaleRatio,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader,uniforms:t.uniforms})})):[new X({webGlContext:i})],n.shaderCompileErrors_=null,n.startTime_=Date.now(),n}return Z(e,t),e.prototype.bindBuffer=function(t){var e=this.getGL(),n=Object(H.c)(t),r=this.bufferCache_[n];r||(r={buffer:t,webGlBuffer:e.createBuffer()},this.bufferCache_[n]=r);e.bindBuffer(t.getType(),r.webGlBuffer)},e.prototype.flushBufferData=function(t){var e=this.getGL();this.bindBuffer(t),e.bufferData(t.getType(),t.getArray(),t.getUsage())},e.prototype.deleteBuffer=function(t){var e=this.getGL(),n=Object(H.c)(t),r=this.bufferCache_[n];r&&!e.isContextLost()&&e.deleteBuffer(r.webGlBuffer),delete this.bufferCache_[n]},e.prototype.disposeInternal=function(){this.canvas_.removeEventListener(V,this.boundHandleWebGLContextLost_),this.canvas_.removeEventListener(q,this.boundHandleWebGLContextRestored_)},e.prototype.prepareDraw=function(t){var e=this.getGL(),n=this.getCanvas(),r=t.size,i=t.pixelRatio;n.width=r[0]*i,n.height=r[1]*i,n.style.width=r[0]+"px",n.style.height=r[1]+"px",e.useProgram(this.currentProgram_);for(var o=this.postProcessPasses_.length-1;o>=0;o--)this.postProcessPasses_[o].init(t);e.bindTexture(e.TEXTURE_2D,null),e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT),e.enable(e.BLEND),e.blendFunc(e.ONE,e.ONE_MINUS_SRC_ALPHA),e.useProgram(this.currentProgram_),this.applyFrameState(t),this.applyUniforms(t)},e.prototype.prepareDrawToRenderTarget=function(t,e,n){var r=this.getGL(),i=e.getSize();r.bindFramebuffer(r.FRAMEBUFFER,e.getFramebuffer()),r.viewport(0,0,i[0],i[1]),r.bindTexture(r.TEXTURE_2D,e.getTexture()),r.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT),r.enable(r.BLEND),r.blendFunc(r.ONE,n?r.ZERO:r.ONE_MINUS_SRC_ALPHA),r.useProgram(this.currentProgram_),this.applyFrameState(t),this.applyUniforms(t)},e.prototype.drawElements=function(t,e){var n=this.getGL(),r=n.UNSIGNED_INT,i=e-t,o=4*t;n.drawElements(n.TRIANGLES,i,r,o)},e.prototype.finalizeDraw=function(t){for(var e=0;e<this.postProcessPasses_.length;e++)this.postProcessPasses_[e].apply(t,this.postProcessPasses_[e+1]||null)},e.prototype.getCanvas=function(){return this.canvas_},e.prototype.getGL=function(){return this.gl_},e.prototype.applyFrameState=function(t){var e=t.size,n=t.viewState.rotation,r=Object(w.g)(this.offsetScaleMatrix_);Object(w.i)(r,2/e[0],2/e[1]);var i=Object(w.g)(this.offsetRotateMatrix_);0!==n&&Object(w.h)(i,-n),this.setUniformMatrixValue(J,W(this.tmpMat4_,r)),this.setUniformMatrixValue(Q,W(this.tmpMat4_,i)),this.setUniformFloatValue(tt,.001*(Date.now()-this.startTime_)),this.setUniformFloatValue(et,t.viewState.zoom),this.setUniformFloatValue(nt,t.viewState.resolution)},e.prototype.applyUniforms=function(t){var e,n=this.getGL(),r=0;this.uniforms_.forEach(function(i){if((e="function"==typeof i.value?i.value(t):i.value)instanceof HTMLCanvasElement||e instanceof HTMLImageElement||e instanceof ImageData)i.texture||(i.prevValue=void 0,i.texture=n.createTexture()),n.activeTexture(n["TEXTURE"+r]),n.bindTexture(n.TEXTURE_2D,i.texture),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR),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),(!(e instanceof HTMLImageElement)||e.complete)&&i.prevValue!==e&&(i.prevValue=e,n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,e)),n.uniform1i(this.getUniformLocation(i.name),r++);else if(Array.isArray(e)&&6===e.length)this.setUniformMatrixValue(i.name,W(this.tmpMat4_,e));else if(Array.isArray(e)&&e.length<=4)switch(e.length){case 2:return void n.uniform2f(this.getUniformLocation(i.name),e[0],e[1]);case 3:return void n.uniform3f(this.getUniformLocation(i.name),e[0],e[1],e[2]);case 4:return void n.uniform4f(this.getUniformLocation(i.name),e[0],e[1],e[2],e[3]);default:return}else"number"==typeof e&&n.uniform1f(this.getUniformLocation(i.name),e)}.bind(this))},e.prototype.useProgram=function(t){return t!=this.currentProgram_&&(this.getGL().useProgram(t),this.currentProgram_=t,this.uniformLocations_={},this.attribLocations_={},!0)},e.prototype.compileShader=function(t,e){var n=this.getGL(),r=n.createShader(e);return n.shaderSource(r,t),n.compileShader(r),r},e.prototype.getProgram=function(t,e){var n=this.getGL(),r=this.compileShader(t,n.FRAGMENT_SHADER),i=this.compileShader(e,n.VERTEX_SHADER),o=n.createProgram();if(n.attachShader(o,r),n.attachShader(o,i),n.linkProgram(o),!n.getShaderParameter(r,n.COMPILE_STATUS)){var a="Fragment shader compliation failed: "+n.getShaderInfoLog(r);throw new Error(a)}if(n.deleteShader(r),!n.getShaderParameter(i,n.COMPILE_STATUS)){a="Vertex shader compilation failed: "+n.getShaderInfoLog(i);throw new Error(a)}if(n.deleteShader(i),!n.getProgramParameter(o,n.LINK_STATUS)){a="GL program linking failed: "+n.getShaderInfoLog(i);throw new Error(a)}return o},e.prototype.getUniformLocation=function(t){return void 0===this.uniformLocations_[t]&&(this.uniformLocations_[t]=this.getGL().getUniformLocation(this.currentProgram_,t)),this.uniformLocations_[t]},e.prototype.getAttributeLocation=function(t){return void 0===this.attribLocations_[t]&&(this.attribLocations_[t]=this.getGL().getAttribLocation(this.currentProgram_,t)),this.attribLocations_[t]},e.prototype.makeProjectionTransform=function(t,e){var n=t.size,r=t.viewState.rotation,i=t.viewState.resolution,o=t.viewState.center;return Object(w.g)(e),Object(w.b)(e,0,0,2/(i*n[0]),2/(i*n[1]),-r,-o[0],-o[1]),e},e.prototype.setUniformFloatValue=function(t,e){this.getGL().uniform1f(this.getUniformLocation(t),e)},e.prototype.setUniformMatrixValue=function(t,e){this.getGL().uniformMatrix4fv(this.getUniformLocation(t),!1,e)},e.prototype.enableAttributeArray_=function(t,e,n,r,i){var o=this.getAttributeLocation(t);o<0||(this.getGL().enableVertexAttribArray(o),this.getGL().vertexAttribPointer(o,e,n,!1,r,i))},e.prototype.enableAttributes=function(t){for(var e=function(t){for(var e=0,n=0;n<t.length;n++){var r=t[n];e+=r.size*it(r.type)}return e}(t),n=0,r=0;r<t.length;r++){var i=t[r];this.enableAttributeArray_(i.name,i.size,i.type||5126,e,n),n+=i.size*it(i.type)}},e.prototype.handleWebGLContextLost=function(){Object(y.b)(this.bufferCache_),this.currentProgram_=null},e.prototype.handleWebGLContextRestored=function(){},e.prototype.createTexture=function(t,e,n){var r=this.getGL(),i=n||r.createTexture(),o=r.RGBA,a=r.RGBA,s=r.UNSIGNED_BYTE;return r.bindTexture(r.TEXTURE_2D,i),e?r.texImage2D(r.TEXTURE_2D,0,o,a,s,e):r.texImage2D(r.TEXTURE_2D,0,o,t[0],t[1],0,a,s,null),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),i},e}(Y.a),at=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),st="GENERATE_BUFFERS",lt=function(t){function e(e,n){var r=t.call(this,e)||this,i=n||{};return r.helper=new ot({postProcesses:i.postProcesses,uniforms:i.uniforms}),void 0!==i.className&&(r.helper.getCanvas().className=i.className),r}return at(e,t),e.prototype.disposeInternal=function(){this.helper.dispose(),t.prototype.disposeInternal.call(this)},e.prototype.dispatchRenderEvent_=function(t,e){var n=this.getLayer();if(n.hasListener(t)){var r=new B.a(t,null,e,null);n.dispatchEvent(r)}},e.prototype.preRender=function(t){this.dispatchRenderEvent_(i.a.PRERENDER,t)},e.prototype.postRender=function(t){this.dispatchRenderEvent_(i.a.POSTRENDER,t)},e}(U.a);var ut=lt,ct=new Uint8Array(4),ht=function(){function t(t,e){this.helper_=t;var n=t.getGL();this.texture_=n.createTexture(),this.framebuffer_=n.createFramebuffer(),this.size_=e||[1,1],this.data_=new Uint8Array(0),this.dataCacheDirty_=!0,this.updateSize_()}return t.prototype.setSize=function(t){Object(K.b)(t,this.size_)||(this.size_[0]=t[0],this.size_[1]=t[1],this.updateSize_())},t.prototype.getSize=function(){return this.size_},t.prototype.clearCachedData=function(){this.dataCacheDirty_=!0},t.prototype.readAll=function(){if(this.dataCacheDirty_){var t=this.size_,e=this.helper_.getGL();e.bindFramebuffer(e.FRAMEBUFFER,this.framebuffer_),e.readPixels(0,0,t[0],t[1],e.RGBA,e.UNSIGNED_BYTE,this.data_),this.dataCacheDirty_=!1}return this.data_},t.prototype.readPixel=function(t,e){if(t<0||e<0||t>this.size_[0]||e>=this.size_[1])return ct[0]=0,ct[1]=0,ct[2]=0,ct[3]=0,ct;this.readAll();var n=Math.floor(t)+(this.size_[1]-Math.floor(e)-1)*this.size_[0];return ct[0]=this.data_[4*n],ct[1]=this.data_[4*n+1],ct[2]=this.data_[4*n+2],ct[3]=this.data_[4*n+3],ct},t.prototype.getTexture=function(){return this.texture_},t.prototype.getFramebuffer=function(){return this.framebuffer_},t.prototype.updateSize_=function(){var t=this.size_,e=this.helper_.getGL();this.texture_=this.helper_.createTexture(t,null,this.texture_),e.bindFramebuffer(e.FRAMEBUFFER,this.framebuffer_),e.viewport(0,0,t[0],t[1]),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,this.texture_,0),this.data_=new Uint8Array(t[0]*t[1]*4)},t}(),pt=new Blob(['var e="function"==typeof Object.assign?Object.assign:function(e,n){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),r=1,o=arguments.length;r<o;++r){var i=arguments[r];if(null!=i)for(var f in i)i.hasOwnProperty(f)&&(t[f]=i[f])}return t},n="GENERATE_BUFFERS",t=[],r={vertexPosition:0,indexPosition:0};function o(e,n,t,r,o){e[n+0]=t,e[n+1]=r,e[n+2]=o}function i(e,n,i,f,s,u){var a=3+s,l=e[n+0],v=e[n+1],c=t;c.length=s;for(var g=0;g<c.length;g++)c[g]=e[n+2+g];var b=u?u.vertexPosition:0,h=u?u.indexPosition:0,d=b/a;return o(i,b,l,v,0),c.length&&i.set(c,b+3),o(i,b+=a,l,v,1),c.length&&i.set(c,b+3),o(i,b+=a,l,v,2),c.length&&i.set(c,b+3),o(i,b+=a,l,v,3),c.length&&i.set(c,b+3),b+=a,f[h++]=d,f[h++]=d+1,f[h++]=d+3,f[h++]=d+1,f[h++]=d+2,f[h++]=d+3,r.vertexPosition=b,r.indexPosition=h,r}var f=self;f.onmessage=function(t){var r=t.data;if(r.type===n){for(var o=r.customAttributesCount,s=2+o,u=new Float32Array(r.renderInstructions),a=u.length/s,l=4*a*(o+3),v=new Uint32Array(6*a),c=new Float32Array(l),g=null,b=0;b<u.length;b+=s)g=i(u,b,c,v,o,g);var h=e({vertexBuffer:c.buffer,indexBuffer:v.buffer,renderInstructions:u.buffer},r);f.postMessage(h,[c.buffer,v.buffer,u.buffer])}};'],{type:"application/javascript"}),dt=URL.createObjectURL(pt);var ft=n(10),gt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),yt=function(t){function e(e,n){var r=this,i=n.uniforms||{},o=Object(w.c)();i[$]=o,(r=t.call(this,e,{className:n.className,uniforms:i,postProcesses:n.postProcesses})||this).sourceRevision_=-1,r.verticesBuffer_=new z(34962,35048),r.hitVerticesBuffer_=new z(34962,35048),r.indicesBuffer_=new z(34963,35048),r.program_=r.helper.getProgram(n.fragmentShader,n.vertexShader),r.hitDetectionEnabled_=!(!n.hitFragmentShader||!n.hitVertexShader),r.hitProgram_=r.hitDetectionEnabled_&&r.helper.getProgram(n.hitFragmentShader,n.hitVertexShader);var a=n.attributes?n.attributes.map((function(t){return{name:"a_"+t.name,size:1,type:rt.FLOAT}})):[];r.attributes=[{name:"a_position",size:2,type:rt.FLOAT},{name:"a_index",size:1,type:rt.FLOAT}].concat(a),r.hitDetectionAttributes=[{name:"a_position",size:2,type:rt.FLOAT},{name:"a_index",size:1,type:rt.FLOAT},{name:"a_hitColor",size:4,type:rt.FLOAT},{name:"a_featureUid",size:1,type:rt.FLOAT}].concat(a),r.customAttributes=n.attributes?n.attributes:[],r.previousExtent_=Object(g.createEmpty)(),r.currentTransform_=o,r.renderTransform_=Object(w.c)(),r.invertRenderTransform_=Object(w.c)(),r.renderInstructions_=new Float32Array(0),r.hitRenderInstructions_=new Float32Array(0),r.hitRenderTarget_=r.hitDetectionEnabled_&&new ht(r.helper),r.worker_=new Worker(dt),r.worker_.addEventListener("message",function(t){var e=t.data;if(e.type===st){var n=e.projectionTransform;e.hitDetection?(this.hitVerticesBuffer_.fromArrayBuffer(e.vertexBuffer),this.helper.flushBufferData(this.hitVerticesBuffer_)):(this.verticesBuffer_.fromArrayBuffer(e.vertexBuffer),this.helper.flushBufferData(this.verticesBuffer_)),this.indicesBuffer_.fromArrayBuffer(e.indexBuffer),this.helper.flushBufferData(this.indicesBuffer_),this.renderTransform_=n,Object(w.d)(this.invertRenderTransform_,this.renderTransform_),e.hitDetection?this.hitRenderInstructions_=new Float32Array(t.data.renderInstructions):this.renderInstructions_=new Float32Array(t.data.renderInstructions),this.getLayer().changed()}}.bind(r)),r.featureCache_={},r.featureCount_=0;var s=r.getLayer().getSource();return r.sourceListenKeys_=[Object(ft.listen)(s,N.a.ADDFEATURE,r.handleSourceFeatureAdded_,r),Object(ft.listen)(s,N.a.CHANGEFEATURE,r.handleSourceFeatureChanged_,r),Object(ft.listen)(s,N.a.REMOVEFEATURE,r.handleSourceFeatureDelete_,r),Object(ft.listen)(s,N.a.CLEAR,r.handleSourceFeatureClear_,r)],s.forEachFeature(function(t){this.featureCache_[Object(H.c)(t)]={feature:t,properties:t.getProperties(),geometry:t.getGeometry()},this.featureCount_++}.bind(r)),r}return gt(e,t),e.prototype.handleSourceFeatureAdded_=function(t){var e=t.feature;this.featureCache_[Object(H.c)(e)]={feature:e,properties:e.getProperties(),geometry:e.getGeometry()},this.featureCount_++},e.prototype.handleSourceFeatureChanged_=function(t){var e=t.feature;this.featureCache_[Object(H.c)(e)]={feature:e,properties:e.getProperties(),geometry:e.getGeometry()}},e.prototype.handleSourceFeatureDelete_=function(t){var e=t.feature;delete this.featureCache_[Object(H.c)(e)],this.featureCount_--},e.prototype.handleSourceFeatureClear_=function(){this.featureCache_={},this.featureCount_=0},e.prototype.renderFrame=function(t){this.preRender(t);var e=this.indicesBuffer_.getSize();this.helper.drawElements(0,e),this.helper.finalizeDraw(t);var n=this.helper.getCanvas(),r=t.layerStatesArray[t.layerIndex].opacity;return r!==parseFloat(n.style.opacity)&&(n.style.opacity=String(r)),this.hitDetectionEnabled_&&(this.renderHitDetection(t),this.hitRenderTarget_.clearCachedData()),this.postRender(t),n},e.prototype.prepareFrame=function(t){var e=this.getLayer(),n=e.getSource(),r=t.viewState,i=!t.viewHints[j.a.ANIMATING]&&!t.viewHints[j.a.INTERACTING],o=!Object(g.equals)(this.previousExtent_,t.extent),a=this.sourceRevision_<n.getRevision();if(a&&(this.sourceRevision_=n.getRevision()),i&&(o||a)){var s=r.projection,l=r.resolution,u=e instanceof R.a?e.getRenderBuffer():0,c=Object(g.buffer)(t.extent,u*l);n.loadFeatures(c,l,s),this.rebuildBuffers_(t),this.previousExtent_=t.extent.slice()}return this.helper.makeProjectionTransform(t,this.currentTransform_),Object(w.f)(this.currentTransform_,this.invertRenderTransform_),this.helper.useProgram(this.program_),this.helper.prepareDraw(t),this.helper.bindBuffer(this.verticesBuffer_),this.helper.bindBuffer(this.indicesBuffer_),this.helper.enableAttributes(this.attributes),!0},e.prototype.rebuildBuffers_=function(t){var e=Object(w.c)();this.helper.makeProjectionTransform(t,e);var n,r,i=(2+this.customAttributes.length)*this.featureCount_;if(this.renderInstructions_&&this.renderInstructions_.length===i||(this.renderInstructions_=new Float32Array(i)),this.hitDetectionEnabled_){var o=(7+this.customAttributes.length)*this.featureCount_;this.hitRenderInstructions_&&this.hitRenderInstructions_.length===o||(this.hitRenderInstructions_=new Float32Array(o))}var a,s,l,u=[],c=[],h=0,p=0;for(var d in this.featureCache_)if((r=(n=this.featureCache_[d]).geometry)&&r.getType()===M.a.POINT){u[0]=r.getFlatCoordinates()[0],u[1]=r.getFlatCoordinates()[1],Object(w.a)(e,u),s=p+6,l=void 0,(l=c||[])[0]=Math.floor(s/256/256/256)/255,l[1]=Math.floor(s/256/256)%256/255,l[2]=Math.floor(s/256)%256/255,l[3]=s%256/255,a=l,this.renderInstructions_[h++]=u[0],this.renderInstructions_[h++]=u[1],this.hitDetectionEnabled_&&(this.hitRenderInstructions_[p++]=u[0],this.hitRenderInstructions_[p++]=u[1],this.hitRenderInstructions_[p++]=a[0],this.hitRenderInstructions_[p++]=a[1],this.hitRenderInstructions_[p++]=a[2],this.hitRenderInstructions_[p++]=a[3],this.hitRenderInstructions_[p++]=Number(d));for(var f=void 0,g=0;g<this.customAttributes.length;g++)f=this.customAttributes[g].callback(n.feature,n.properties),this.renderInstructions_[h++]=f,this.hitDetectionEnabled_&&(this.hitRenderInstructions_[p++]=f)}var y={type:st,renderInstructions:this.renderInstructions_.buffer,customAttributesCount:this.customAttributes.length};if(y.projectionTransform=e,this.worker_.postMessage(y,[this.renderInstructions_.buffer]),this.renderInstructions_=null,this.hitDetectionEnabled_){var m={type:st,renderInstructions:this.hitRenderInstructions_.buffer,customAttributesCount:5+this.customAttributes.length};m.projectionTransform=e,m.hitDetection=!0,this.worker_.postMessage(m,[this.hitRenderInstructions_.buffer]),this.hitRenderInstructions_=null}},e.prototype.forEachFeatureAtCoordinate=function(t,e,n,r,i){if(Object(F.a)(this.hitDetectionEnabled_,66),this.hitRenderInstructions_){var o=Object(w.a)(e.coordinateToPixelTransform,t.slice()),a=this.hitRenderTarget_.readPixel(o[0]/2,o[1]/2),s=function(t){var e=0;return e+=Math.round(256*t[0]*256*256*255),e+=Math.round(256*t[1]*256*255),e+=Math.round(256*t[2]*255),e+=Math.round(255*t[3])}([a[0]/255,a[1]/255,a[2]/255,a[3]/255]),l=this.hitRenderInstructions_[s],u=Math.floor(l).toString(),c=this.getLayer().getSource().getFeatureByUid(u);return c?r(c,this.getLayer(),null):void 0}},e.prototype.renderHitDetection=function(t){if(this.hitVerticesBuffer_.getSize()){this.hitRenderTarget_.setSize([Math.floor(t.size[0]/2),Math.floor(t.size[1]/2)]),this.helper.useProgram(this.hitProgram_),this.helper.prepareDrawToRenderTarget(t,this.hitRenderTarget_,!0),this.helper.bindBuffer(this.hitVerticesBuffer_),this.helper.bindBuffer(this.indicesBuffer_),this.helper.enableAttributes(this.hitDetectionAttributes);var e=this.indicesBuffer_.getSize();this.helper.drawElements(0,e)}},e.prototype.disposeInternal=function(){this.worker_.terminate(),this.layer_=null,this.sourceListenKeys_.forEach((function(t){Object(ft.unlistenByKey)(t)})),this.sourceListenKeys_=null,t.prototype.disposeInternal.call(this)},e}(ut),mt=n(25),vt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),_t="blur",bt="gradient",wt="radius",xt=["#00f","#0ff","#0f0","#ff0","#f00"];var Et=function(t){function e(e){var n=this,r=e||{},i=Object(y.a)({},r);delete i.gradient,delete i.radius,delete i.blur,delete i.weight,(n=t.call(this,i)||this).gradient_=null,n.addChangeListener(bt,n.handleGradientChanged_),n.setGradient(r.gradient?r.gradient:xt),n.setBlur(void 0!==r.blur?r.blur:15),n.setRadius(void 0!==r.radius?r.radius:8);var o=r.weight?r.weight:"weight";return n.weightFunction_="string"==typeof o?function(t){return t.get(o)}:o,n.setRenderOrder(null),n}return vt(e,t),e.prototype.getBlur=function(){return this.get(_t)},e.prototype.getGradient=function(){return this.get(bt)},e.prototype.getRadius=function(){return this.get(wt)},e.prototype.handleGradientChanged_=function(){this.gradient_=function(t){for(var e=Object(mt.a)(1,256),n=e.createLinearGradient(0,0,1,256),r=1/(t.length-1),i=0,o=t.length;i<o;++i)n.addColorStop(i*r,t[i]);return e.fillStyle=n,e.fillRect(0,0,1,256),e.canvas}(this.getGradient())},e.prototype.setBlur=function(t){this.set(_t,t)},e.prototype.setGradient=function(t){this.set(bt,t)},e.prototype.setRadius=function(t){this.set(wt,t)},e.prototype.createRenderer=function(){return new yt(this,{className:this.getClassName(),attributes:[{name:"weight",callback:function(t){var e=this.weightFunction_(t);return void 0!==e?Object(m.a)(e,0,1):1}.bind(this)}],vertexShader:"\n precision mediump float;\n uniform mat4 u_projectionMatrix;\n uniform mat4 u_offsetScaleMatrix;\n uniform float u_size;\n attribute vec2 a_position;\n attribute float a_index;\n attribute float a_weight;\n\n varying vec2 v_texCoord;\n varying float v_weight;\n\n void main(void) {\n mat4 offsetMatrix = u_offsetScaleMatrix;\n float offsetX = a_index == 0.0 || a_index == 3.0 ? -u_size / 2.0 : u_size / 2.0;\n float offsetY = a_index == 0.0 || a_index == 1.0 ? -u_size / 2.0 : u_size / 2.0;\n vec4 offsets = offsetMatrix * vec4(offsetX, offsetY, 0.0, 0.0);\n gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0) + offsets;\n float u = a_index == 0.0 || a_index == 3.0 ? 0.0 : 1.0;\n float v = a_index == 0.0 || a_index == 1.0 ? 0.0 : 1.0;\n v_texCoord = vec2(u, v);\n v_weight = a_weight;\n }",fragmentShader:"\n precision mediump float;\n uniform float u_blurSlope;\n\n varying vec2 v_texCoord;\n varying float v_weight;\n\n void main(void) {\n vec2 texCoord = v_texCoord * 2.0 - vec2(1.0, 1.0);\n float sqRadius = texCoord.x * texCoord.x + texCoord.y * texCoord.y;\n float value = (1.0 - sqrt(sqRadius)) * u_blurSlope;\n float alpha = smoothstep(0.0, 1.0, value) * v_weight;\n gl_FragColor = vec4(alpha, alpha, alpha, alpha);\n }",hitVertexShader:"\n precision mediump float;\n uniform mat4 u_projectionMatrix;\n uniform mat4 u_offsetScaleMatrix;\n uniform float u_size;\n attribute vec2 a_position;\n attribute float a_index;\n attribute float a_weight;\n attribute vec4 a_hitColor;\n\n varying vec2 v_texCoord;\n varying float v_weight;\n varying vec4 v_hitColor;\n\n void main(void) {\n mat4 offsetMatrix = u_offsetScaleMatrix;\n float offsetX = a_index == 0.0 || a_index == 3.0 ? -u_size / 2.0 : u_size / 2.0;\n float offsetY = a_index == 0.0 || a_index == 1.0 ? -u_size / 2.0 : u_size / 2.0;\n vec4 offsets = offsetMatrix * vec4(offsetX, offsetY, 0.0, 0.0);\n gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0) + offsets;\n float u = a_index == 0.0 || a_index == 3.0 ? 0.0 : 1.0;\n float v = a_index == 0.0 || a_index == 1.0 ? 0.0 : 1.0;\n v_texCoord = vec2(u, v);\n v_hitColor = a_hitColor;\n v_weight = a_weight;\n }",hitFragmentShader:"\n precision mediump float;\n uniform float u_blurSlope;\n\n varying vec2 v_texCoord;\n varying float v_weight;\n varying vec4 v_hitColor;\n\n void main(void) {\n vec2 texCoord = v_texCoord * 2.0 - vec2(1.0, 1.0);\n float sqRadius = texCoord.x * texCoord.x + texCoord.y * texCoord.y;\n float value = (1.0 - sqrt(sqRadius)) * u_blurSlope;\n float alpha = smoothstep(0.0, 1.0, value) * v_weight;\n if (alpha < 0.05) {\n discard;\n }\n\n gl_FragColor = v_hitColor;\n }",uniforms:{u_size:function(){return 2*(this.get(wt)+this.get(_t))}.bind(this),u_blurSlope:function(){return this.get(wt)/Math.max(1,this.get(_t))}.bind(this)},postProcesses:[{fragmentShader:"\n precision mediump float;\n\n uniform sampler2D u_image;\n uniform sampler2D u_gradientTexture;\n\n varying vec2 v_texCoord;\n\n void main() {\n vec4 color = texture2D(u_image, v_texCoord);\n gl_FragColor.a = color.a;\n gl_FragColor.rgb = texture2D(u_gradientTexture, vec2(0.5, color.a)).rgb;\n gl_FragColor.rgb *= gl_FragColor.a;\n }",uniforms:{u_gradientTexture:function(){return this.gradient_}.bind(this)}}]})},e.prototype.renderDeclutter=function(){},e}(d.a),St=n(188),Ot=n(79),Ct=n(40),Tt=n(9),It=n(147),Lt=n(39),Pt=n(165),Rt=n(166),Mt=n(201),Nt=n(34),jt=n(15),At="image",kt="hybrid",Ft="vector",Dt=n(94),Gt=n(35),zt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ut={image:[Nt.a.POLYGON,Nt.a.CIRCLE,Nt.a.LINE_STRING,Nt.a.IMAGE,Nt.a.TEXT],hybrid:[Nt.a.POLYGON,Nt.a.LINE_STRING],vector:[]},Bt={hybrid:[Nt.a.IMAGE,Nt.a.TEXT,Nt.a.DEFAULT],vector:[Nt.a.POLYGON,Nt.a.CIRCLE,Nt.a.LINE_STRING,Nt.a.IMAGE,Nt.a.TEXT,Nt.a.DEFAULT]},Vt=function(t){function e(e){var n=t.call(this,e)||this;return n.boundHandleStyleImageChange_=n.handleStyleImageChange_.bind(n),n.dirty_=!1,n.renderedLayerRevision_,n.renderedPixelToCoordinateTransform_=null,n.renderedRotation_,n.renderTileImageQueue_={},n.tileListenerKeys_={},n.tmpTransform_=Object(w.c)(),n}return zt(e,t),e.prototype.prepareTile=function(t,e,n,r){var i,o=Object(H.c)(t),a=t.getState();return a!==jt.a.LOADED&&a!==jt.a.ERROR||!(o in this.tileListenerKeys_)||(Object(ft.unlistenByKey)(this.tileListenerKeys_[o]),delete this.tileListenerKeys_[o]),a!==jt.a.LOADED&&a!==jt.a.ERROR||(this.updateExecutorGroup_(t,e,n),this.tileImageNeedsRender_(t)&&(i=!0,r&&(this.renderTileImageQueue_[o]=t))),i},e.prototype.getTile=function(e,n,r,i){var o=i.pixelRatio,a=i.viewState,s=a.resolution,l=a.projection,u=this.getLayer(),c=u.getSource().getTile(e,n,r,o,l);if(c.getState()<jt.a.LOADED){c.wantedResolution=s;var h=Object(H.c)(c);if(!(h in this.tileListenerKeys_)){var p=Object(ft.listen)(c,Tt.a.CHANGE,this.prepareTile.bind(this,c,o,l,!0));this.tileListenerKeys_[h]=p}}else{var d=i.viewHints;!!(d[j.a.ANIMATING]||d[j.a.INTERACTING])&&c.wantedResolution||(c.wantedResolution=s),this.prepareTile(c,o,l,!1)&&u.getRenderMode()!==Ft&&this.renderTileImage_(c,i)}return t.prototype.getTile.call(this,e,n,r,i)},e.prototype.isDrawableTile=function(e){var n=this.getLayer();return t.prototype.isDrawableTile.call(this,e)&&(n.getRenderMode()===Ft?Object(H.c)(n)in e.executorGroups:e.hasContext(n))},e.prototype.getTileImage=function(t){return t.getImage(this.getLayer())},e.prototype.prepareFrame=function(e){var n=this.getLayer().getRevision();return this.renderedLayerRevision_!=n&&(this.renderedTiles.length=0),this.renderedLayerRevision_=n,t.prototype.prepareFrame.call(this,e)},e.prototype.updateExecutorGroup_=function(t,e,n){var r=this.getLayer(),i=r.getRevision(),o=r.getRenderOrder()||null,a=t.wantedResolution,s=t.getReplayState(r);if(s.dirty||s.renderedResolution!==a||s.renderedRevision!=i||s.renderedRenderOrder!=o){var l=r.getSource(),u=r.getDeclutter(),c=l.getTileGrid(),h=l.getTileGridForProjection(n).getTileCoordExtent(t.wrappedTileCoord),p=l.getSourceTiles(e,n,t),d=Object(H.c)(r);delete t.hitDetectionImageData[d],t.executorGroups[d]=[],u&&(t.declutterExecutorGroups[d]=[]);for(var f=function(n,i){var f=p[n];if(f.getState()!=jt.a.LOADED)return"continue";var m=f.tileCoord,v=c.getTileCoordExtent(m),_=Object(g.getIntersection)(h,v),b=Object(g.buffer)(_,r.getRenderBuffer()*a,y.tmpExtent),w=Object(g.equals)(v,_)?null:b;s.dirty=!1;var E=new Pt.a(0,b,a,e),S=u?new Pt.a(0,_,a,e):void 0,O=Object(x.b)(a,e),C=function(t){var e,n=t.getStyleFunction()||r.getStyleFunction();if(n&&(e=n(t,a)),e){var i=this.renderFeature(t,O,e,E,S);this.dirty_=this.dirty_||i,s.dirty=s.dirty||i}},T=f.getFeatures();o&&o!==s.renderedRenderOrder&&T.sort(o);for(var I=0,L=T.length;I<L;++I){var P=T[I];w&&!Object(g.intersects)(w,P.getGeometry().getExtent())||C.call(y,P)}var R=E.finish(),M=r.getRenderMode()!==Ft&&u&&1===p.length?null:_,N=new Rt.a(M,a,e,l.getOverlaps(),R,r.getRenderBuffer());if(t.executorGroups[d].push(N),S){var j=new Rt.a(null,a,e,l.getOverlaps(),S.finish(),r.getRenderBuffer());t.declutterExecutorGroups[d].push(j)}},y=this,m=0,v=p.length;m<v;++m)f(m);s.renderedRevision=i,s.renderedRenderOrder=o,s.renderedResolution=a}},e.prototype.forEachFeatureAtCoordinate=function(t,e,n,r,i){var o=e.viewState.resolution,a=e.viewState.rotation;n=null==n?0:n;var s=this.getLayer(),l=s.getSource().getTileGridForProjection(e.viewState.projection),u=Object(g.boundingExtent)([t]);Object(g.buffer)(u,o*n,u);for(var c,h={},p=function(t,e,n){var o=t.getId();void 0===o&&(o=Object(H.c)(t));var a=h[o];if(a){if(!0!==a&&n<a.distanceSq){if(0===n)return h[o]=!0,i.splice(i.lastIndexOf(a),1),r(t,s,e);a.geometry=e,a.distanceSq=n}}else{if(0===n)return h[o]=!0,r(t,s,e);i.push(h[o]={feature:t,layer:s,geometry:e,distanceSq:n,callback:r})}},d=this.renderedTiles,f=function(r,i){var h=d[r],f=l.getTileCoordExtent(h.wrappedTileCoord);if(!Object(g.intersects)(f,u))return"continue";var y=Object(H.c)(s),m=[h.executorGroups[y]],v=h.declutterExecutorGroups[y];v&&m.push(v),m.some((function(r){for(var i=r===v?e.declutterTree.all().map((function(t){return t.value})):null,s=0,l=r.length;s<l;++s){var u=r[s];if(c=u.forEachFeatureAtCoordinate(t,o,a,n,p,i))return!0}}))},y=0,m=d.length;!c&&y<m;++y)f(y);return c},e.prototype.getFeatures=function(t){return new Promise(function(e,n){for(var r,i=this.getLayer(),o=Object(H.c)(i),a=i.getSource(),s=this.renderedProjection,l=s.getExtent(),u=this.renderedResolution,c=a.getTileGridForProjection(s),h=Object(w.a)(this.renderedPixelToCoordinateTransform_,t.slice()),p=c.getTileCoordForCoordAndResolution(h,u),d=0,f=this.renderedTiles.length;d<f;++d)if(p.toString()===this.renderedTiles[d].tileCoord.toString()){if((r=this.renderedTiles[d]).getState()===jt.a.LOADED){var y=c.getTileCoordExtent(r.tileCoord);a.getWrapX()&&s.canWrapX()&&!Object(g.containsExtent)(l,y)&&Object(v.l)(h,s);break}r=void 0}if(!r||r.loadingSourceTiles>0)e([]);else{var m=c.getTileCoordExtent(r.wrappedTileCoord),_=Object(g.getTopLeft)(m),b=[(h[0]-_[0])/u,(_[1]-h[1])/u],x=r.getSourceTiles().reduce((function(t,e){return t.concat(e.getFeatures())}),[]),E=r.hitDetectionImageData[o];if(!E&&!this.animatingOrInteracting_){var S=Object(Gt.d)(c.getTileSize(c.getZForResolution(u))),O=this.renderedRotation_,C=[this.getRenderTransform(c.getTileCoordCenter(r.wrappedTileCoord),u,0,Dt.a,S[0]*Dt.a,S[1]*Dt.a,0)];E=Object(Dt.b)(S,C,x,i.getStyleFunction(),c.getTileCoordExtent(r.wrappedTileCoord),r.getReplayState(i).renderedResolution,O),r.hitDetectionImageData[o]=E}e(Object(Dt.c)(b,x,E))}}.bind(this))},e.prototype.handleFontsChanged=function(){Object(y.b)(this.renderTileImageQueue_);var t=this.getLayer();t.getVisible()&&void 0!==this.renderedLayerRevision_&&t.changed()},e.prototype.handleStyleImageChange_=function(t){this.renderIfReadyAndVisible()},e.prototype.renderDeclutter=function(t){var e=this.context,n=e.globalAlpha;e.globalAlpha=this.getLayer().getOpacity();for(var r=t.viewHints,i=!(r[j.a.ANIMATING]||r[j.a.INTERACTING]),o=this.renderedTiles,a=0,s=o.length;a<s;++a){var l=o[a],u=l.declutterExecutorGroups[Object(H.c)(this.getLayer())];if(u)for(var c=u.length-1;c>=0;--c)u[c].execute(this.context,1,this.getTileRenderTransform(l,t),t.viewState.rotation,i,void 0,t.declutterTree)}e.globalAlpha=n},e.prototype.getTileRenderTransform=function(t,e){var n=e.pixelRatio,r=e.viewState,i=r.center,o=r.resolution,a=r.rotation,s=e.size,l=Math.round(s[0]*n),u=Math.round(s[1]*n),c=this.getLayer().getSource().getTileGridForProjection(e.viewState.projection),h=t.tileCoord,p=c.getTileCoordExtent(t.wrappedTileCoord),d=c.getTileCoordExtent(h,this.tmpExtent)[0]-p[0];return Object(w.f)(Object(w.i)(this.inversePixelTransform.slice(),1/n,1/n),this.getRenderTransform(i,o,a,n,l,u,d))},e.prototype.renderFrame=function(e,n){var r=e.viewHints,i=!(r[j.a.ANIMATING]||r[j.a.INTERACTING]);this.renderQueuedTileImages_(i,e),t.prototype.renderFrame.call(this,e,n),this.renderedPixelToCoordinateTransform_=e.pixelToCoordinateTransform.slice(),this.renderedRotation_=e.viewState.rotation;var o=this.getLayer(),a=o.getRenderMode(),s=o.getSource(),l=e.usedTiles[Object(H.c)(s)];for(var u in this.renderTileImageQueue_)l&&u in l||delete this.renderTileImageQueue_[u];var c=this.context,h=c.globalAlpha;c.globalAlpha=o.getOpacity();for(var p=Bt[a],d=e.viewState.rotation,f=this.renderedTiles,g=[],y=[],m=f.length-1;m>=0;--m)for(var v=f[m],_=this.getTileRenderTransform(v,e),b=v.executorGroups[Object(H.c)(o)],w=!1,x=0,E=b.length;x<E;++x){var S=b[x];if(S.hasExecutors(p)){var O=v.tileCoord[0],C=void 0;if(!w&&(C=S.getClipCoords(_))){c.save();for(var T=0,I=g.length;T<I;++T){var L=g[T];O<y[T]&&(c.beginPath(),c.moveTo(C[0],C[1]),c.lineTo(C[2],C[3]),c.lineTo(C[4],C[5]),c.lineTo(C[6],C[7]),c.moveTo(L[6],L[7]),c.lineTo(L[4],L[5]),c.lineTo(L[2],L[3]),c.lineTo(L[0],L[1]),c.clip())}}S.execute(c,1,_,d,i,p),!w&&C&&(c.restore(),g.push(C),y.push(O),w=!0)}}return c.globalAlpha=h,this.container},e.prototype.renderQueuedTileImages_=function(t,e){for(var n in this.renderTileImageQueue_){if(!t&&Date.now()-e.time>8){e.animate=!0;break}var r=this.renderTileImageQueue_[n];delete this.renderTileImageQueue_[n],this.renderTileImage_(r,e)}},e.prototype.renderFeature=function(t,e,n,r,i){if(!n)return!1;var o=!1;if(Array.isArray(n))for(var a=0,s=n.length;a<s;++a)o=Object(x.d)(r,t,n[a],e,this.boundHandleStyleImageChange_,void 0,i)||o;else o=Object(x.d)(r,t,n,e,this.boundHandleStyleImageChange_,void 0,i);return o},e.prototype.tileImageNeedsRender_=function(t){var e=this.getLayer();if(e.getRenderMode()===Ft)return!1;var n=t.getReplayState(e),r=e.getRevision(),i=t.wantedResolution;return n.renderedTileResolution!==i||n.renderedTileRevision!==r},e.prototype.renderTileImage_=function(t,e){var n=this.getLayer(),r=t.getReplayState(n),i=n.getRevision(),o=t.executorGroups[Object(H.c)(n)];r.renderedTileRevision=i;var a=t.wrappedTileCoord,s=a[0],l=n.getSource(),u=e.pixelRatio,c=e.viewState.projection,h=l.getTileGridForProjection(c),p=h.getResolution(t.tileCoord[0]),d=e.pixelRatio/t.wantedResolution*p,f=h.getResolution(s),g=t.getContext(n);u=Math.round(Math.max(u,d/u));var y=l.getTilePixelSize(s,u,c);g.canvas.width=y[0],g.canvas.height=y[1];var m=u/d;if(1!==m){var v=Object(w.g)(this.tmpTransform_);Object(w.i)(v,m,m),g.setTransform.apply(g,v)}var _=h.getTileCoordExtent(a,this.tmpExtent),b=d/f,x=Object(w.g)(this.tmpTransform_);Object(w.i)(x,b,-b),Object(w.l)(x,-_[0],-_[3]);for(var E=0,S=o.length;E<S;++E){o[E].execute(g,m,x,0,!0,Ut[n.getRenderMode()])}r.renderedTileResolution=t.wantedResolution},e}(Mt.a),qt=n(120),Yt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Xt=function(t){function e(e){var n=this,r=e||{},i=Object(y.a)({},r);delete i.preload,delete i.useInterimTilesOnError,(n=t.call(this,i)||this).on,n.once,n.un,r.renderMode===At&&(console.warn('renderMode: "image" is deprecated. Option ignored.'),r.renderMode=void 0);var o=r.renderMode||kt;return Object(F.a)(o==kt||o==Ft,28),n.renderMode_=o,n.setPreload(r.preload?r.preload:0),n.setUseInterimTilesOnError(void 0===r.useInterimTilesOnError||r.useInterimTilesOnError),n}return Yt(e,t),e.prototype.createRenderer=function(){return new Vt(this)},e.prototype.getFeatures=function(e){return t.prototype.getFeatures.call(this,e)},e.prototype.getRenderMode=function(){return this.renderMode_},e.prototype.getPreload=function(){return this.get(qt.a.PRELOAD)},e.prototype.getUseInterimTilesOnError=function(){return this.get(qt.a.USE_INTERIM_TILES_ON_ERROR)},e.prototype.setPreload=function(t){this.set(qt.a.PRELOAD,t)},e.prototype.setUseInterimTilesOnError=function(t){this.set(qt.a.USE_INTERIM_TILES_ON_ERROR,t)},e}(R.a),Wt=n(137),Ht=n(148),Kt=(n(163),n(102),n(168),n(110)),Zt=(n(123),n(134)),$t=n(122),Jt=n(178),Qt=n(199),te=n.n(Qt),ee=n(109),ne=n(17);"function"==typeof Object.assign&&Object.assign;function re(t){return t*Math.PI/180}var ie=function(){for(var t=[],e=78271.51696402048;t.length<=24;e/=2)t.push(e);return t}();function oe(t,e){if("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas)return new OffscreenCanvas(t,e);var n=document.createElement("canvas");return n.width=t,n.height=e,n}var ae,se=Array(256).join(" ");function le(t,e){if(e>=.05){for(var n="",r=t.split("\n"),i=se.slice(0,Math.round(e/.1)),o=0,a=r.length;o<a;++o)o>0&&(n+="\n"),n+=r[o].split("").join(i);return n}return t}function ue(){return ae||(ae=oe(1,1).getContext("2d")),ae}function ce(t,e){return ue().measureText(t).width+(t.length-1)*e}var he={};ne.o&&Object(ft.listen)(ne.o,Tt.a.CLEAR,(function(){he={}}));var pe,de,fe=ee.e.isFunction,ge=ee.e.convertFunction,ye=ee.c.isExpression,me=ee.c.createPropertyExpression,ve={Point:1,MultiPoint:1,LineString:2,MultiLineString:2,Polygon:3,MultiPolygon:3},_e={center:[.5,.5],left:[0,.5],right:[1,.5],top:[.5,0],bottom:[.5,1],"top-left":[0,0],"top-right":[1,0],"bottom-left":[0,1],"bottom-right":[1,1]},be={},we={zoom:0},xe={};function Ee(t,e,n,r,i){var o=t.id;xe[o]||(xe[o]={});var a=xe[o];if(!a[n]){var s=(t[e]||be)[n],l=ee.f[e+"_"+t.type][n];void 0===s&&(s=l.default);var u=ye(s);if(!u&&fe(s)&&(s=ge(s,l),u=!0),u){var c=function(t,e){var n=me(t,e);if("error"===n.result)throw new Error(n.value.map((function(t){return t.key+": "+t.message})).join(", "));return n.value}(s,l);a[n]=c.evaluate.bind(c)}else"color"==l.type&&(s=ee.a.parse(s)),a[n]=function(){return s}}return we.zoom=r,a[n](we,i)}var Se={};function Oe(t,e){if(t){if(0===t.a||0===e)return;var n=t.a;return e=void 0===e?1:e,"rgba("+Math.round(255*t.r/n)+","+Math.round(255*t.g/n)+","+Math.round(255*t.b/n)+","+n*e+")"}return t}var Ce=/^([^]*)\{(.*)\}([^]*)$/;function Te(t,e){var n;do{if(n=t.match(Ce)){var r=e[n[2]]||"";t=n[1]+r+n[3]}}while(n);return t}var Ie=!1;var Le,Pe=function(t,e,n,r,i,o,s){if(void 0===r&&(r=ie),"string"==typeof e&&(e=JSON.parse(e)),8!=e.version)throw new Error("glStyle version 8 required.");var l,u;if(o)if("undefined"!=typeof Image){var d=new Image;d.crossOrigin="anonymous",d.onload=function(){l=d,u=[d.width,d.height],t.changed(),d.onload=null},d.src=o}else if("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope){var f=self;f.postMessage({action:"loadImage",src:o}),f.addEventListener("message",(function(t){"imageLoaded"===t.data.action&&t.data.src===o&&(l=t.data.image,u=[l.width,l.height])}))}for(var g,y=Object(ee.b)(e.layers),m={},v=[],_=0,b=y.length;_<b;++_){var w=y[_],x=w.id;if("string"==typeof n&&w.source==n||-1!==n.indexOf(x)){var E=w["source-layer"];if(!g){g=w.source;var S=e.sources[g];if(!S)throw new Error('Source "'+g+'" is not defined');var O=S.type;if("vector"!==O&&"geojson"!==O)throw new Error('Source "'+g+'" is not of type "vector" or "geojson", but "'+O+'"')}var C=m[E];C||(C=[],m[E]=C),C.push({layer:w,index:_}),v.push(x)}delete xe[x],delete Se[x]}var T=new c.a,I=new a.a,L={},P={},R=[],M=function(t,e){var n=t.getProperties(),o=m[n.layer];if(o){var d=r.indexOf(e);-1==d&&(d=function(t,e){for(var n=0,r=e.length;n<r;++n){if(e[n]<t&&n+1<r){var i=e[n]/e[n+1];return n+Math.log(e[n]/t)/Math.log(i)}}return r-1}(e,r));for(var f,g=ve[t.getGeometry().getType()],y={properties:n,type:g},v=-1,_=function(r,m){var _=o[r],b=_.layer,w=b.id,x=b.layout||be,E=b.paint||be;if("none"===x.visibility||"minzoom"in b&&d<b.minzoom||"maxzoom"in b&&d>=b.maxzoom)return"continue";var S=b.filter;if(!S||function(t,e,n,r){return t in Se||(Se[t]=Object(ee.d)(e).filter),we.zoom=r,Se[t](we,n)}(w,S,y,d)){f=b;var O=void 0,C=void 0,M=void 0,N=void 0,j=void 0,A=void 0,k=_.index;if(3==g&&("fill"==b.type||"fill-extrusion"==b.type))if(C=Ee(b,"paint",b.type+"-opacity",d,y),b.type+"-pattern"in E){var F=Ee(b,"paint",b.type+"-pattern",d,y);if(F){var D="string"==typeof F?Te(F,n):F.toString();if(l&&i&&i[D]){++v,(A=R[v])&&A.getFill()&&!A.getStroke()&&!A.getText()||(A=new h.c({fill:new a.a}),R[v]=A),M=A.getFill(),A.setZIndex(k);var G=P[dt=D+"."+C];if(!G)(yt=(gt=oe((ft=i[D]).width,ft.height)).getContext("2d")).globalAlpha=C,yt.drawImage(l,ft.x,ft.y,ft.width,ft.height,0,0,ft.width,ft.height),G=yt.createPattern(gt,"repeat"),P[dt]=G;M.setColor(G)}}}else(O=Oe(Ee(b,"paint",b.type+"-color",d,y),C))&&(b.type+"-outline-color"in E&&(j=Oe(Ee(b,"paint",b.type+"-outline-color",d,y),C)),j||(j=O),++v,(A=R[v])&&A.getFill()&&A.getStroke()&&!A.getText()||(A=new h.c({fill:new a.a,stroke:new c.a}),R[v]=A),(M=A.getFill()).setColor(O),(N=A.getStroke()).setColor(j),N.setWidth(1),A.setZIndex(k));if(1!=g&&"line"==b.type){O=!("line-pattern"in E)&&"line-color"in E?Oe(Ee(b,"paint","line-color",d,y),Ee(b,"paint","line-opacity",d,y)):void 0;var z=Ee(b,"paint","line-width",d,y);O&&z>0&&(++v,(A=R[v])&&A.getStroke()&&!A.getFill()&&!A.getText()||(A=new h.c({stroke:new c.a}),R[v]=A),(N=A.getStroke()).setLineCap(Ee(b,"layout","line-cap",d,y)),N.setLineJoin(Ee(b,"layout","line-join",d,y)),N.setMiterLimit(Ee(b,"layout","line-miter-limit",d,y)),N.setColor(O),N.setWidth(z),N.setLineDash(E["line-dasharray"]?Ee(b,"paint","line-dasharray",d,y).map((function(t){return t*z})):null),A.setZIndex(k))}var U=!1,B=null,V=0,q=void 0,Y=void 0,X=void 0;if((1==g||2==g)&&"icon-image"in x){var W=Ee(b,"layout","icon-image",d,y);if(W){q="string"==typeof W?Te(W,n):W.toString();var H=void 0;if(l&&i&&i[q]){var K=Ee(b,"layout","icon-rotation-alignment",d,y);if(2==g){var Z=t.getGeometry();if(Z.getFlatMidpoint||Z.getFlatMidpoints){var $=Z.getExtent();if(Math.sqrt(Math.max(Math.pow(($[2]-$[0])/e,2),Math.pow(($[3]-$[1])/e,2)))>150){var J="MultiLineString"===Z.getType()?Z.getFlatMidpoints():Z.getFlatMidpoint();if(de||(pe=[NaN,NaN],de=new Jt.a("Point",pe,[],{},null)),H=de,pe[0]=J[0],pe[1]=J[1],"line"===(kt=Ee(b,"layout","symbol-placement",d,y))&&"map"===K)for(var Q=Z.getStride(),tt=Z.getFlatCoordinates(),et=0,nt=tt.length-Q;et<nt;et+=Q){var rt=tt[et],it=tt[et+1],ot=tt[et+Q],at=tt[et+Q+1],st=Math.min(rt,ot),lt=Math.min(it,at),ut=Math.max(rt,ot),ct=Math.max(it,at);if(J[0]>=st&&J[0]<=ut&&J[1]>=lt&&J[1]<=ct){V=Math.atan2(it-at,ot-rt);break}}}}}if(2!==g||H){var ht=Ee(b,"layout","icon-size",d,y),pt=void 0!==E["icon-color"]?Ee(b,"paint","icon-color",d,y):null;if(!pt||0!==pt.a){var dt=q+"."+ht;if(null!==pt&&(dt+="."+pt),!(Y=L[dt])){var ft=i[q];if(null!==pt){var gt,yt;(yt=(gt=oe(ft.width,ft.height)).getContext("2d")).drawImage(l,ft.x,ft.y,ft.width,ft.height,0,0,ft.width,ft.height);for(var mt=yt.getImageData(0,0,gt.width,gt.height),vt=0,_t=mt.data.length;vt<_t;vt+=4){var bt=pt.a;0!==bt&&(mt.data[vt]=255*pt.r/bt,mt.data[vt+1]=255*pt.g/bt,mt.data[vt+2]=255*pt.b/bt),mt.data[vt+3]=bt}yt.putImageData(mt,0,0),Y=new $t.a({img:gt,imgSize:[gt.width,gt.height],scale:ht/ft.pixelRatio}),L[dt]=Y}else Y=new $t.a({img:l,imgSize:u,size:[ft.width,ft.height],offset:[ft.x,ft.y],rotateWithView:"map"===K,scale:ht/ft.pixelRatio}),L[dt]=Y}}Y&&(++v,(A=R[v])&&A.getImage()&&!A.getFill()&&!A.getStroke()||(A=new h.c,R[v]=A),A.setGeometry(H),Y.setRotation(V+re(Ee(b,"layout","icon-rotate",d,y))),Y.setOpacity(Ee(b,"paint","icon-opacity",d,y)),Y.setAnchor(_e[Ee(b,"layout","icon-anchor",d,y)]),A.setImage(Y),B=A.getText(),A.setText(void 0),A.setZIndex(k),U=!0,X=!1)}else X=!0}}}if(1==g&&"circle-radius"in E){++v,(A=R[v])&&A.getImage()&&!A.getFill()&&!A.getStroke()||(A=new h.c,R[v]=A);var wt=Ee(b,"paint","circle-radius",d,y),xt=Oe(Ee(b,"paint","circle-stroke-color",d,y),Ee(b,"paint","circle-stroke-opacity",d,y)),Et=Oe(Ee(b,"paint","circle-color",d,y),Ee(b,"paint","circle-opacity",d,y)),St=Ee(b,"paint","circle-stroke-width",d,y),Ot=wt+"."+xt+"."+Et+"."+St;(Y=L[Ot])||(Y=new Zt.a({radius:wt,stroke:xt&&St>0?new c.a({width:St,color:xt}):void 0,fill:Et?new a.a({color:Et}):void 0}),L[Ot]=Y),A.setImage(Y),B=A.getText(),A.setText(void 0),A.setGeometry(void 0),A.setZIndex(k),U=!0}var Ct=void 0;if("text-field"in x)Ct=Te(Ee(b,"layout","text-field",d,y).toString(),n).trim(),C=Ee(b,"paint","text-opacity",d,y);if(Ct&&C&&!X){U||(++v,(A=R[v])&&A.getText()&&!A.getFill()&&!A.getStroke()||(A=new h.c,R[v]=A),A.setImage(void 0),A.setGeometry(void 0)),A.getText()||A.setText(B||new p.a({padding:[2,2,2,2]})),B=A.getText();var Tt=Math.round(Ee(b,"layout","text-size",d,y)),It=Ee(b,"layout","text-font",d,y),Lt=Ee(b,"layout","text-line-height",d,y),Pt=te()(s?s(It):It,Tt,Lt),Rt=x["text-transform"];"uppercase"==Rt?Ct=Ct.toUpperCase():"lowercase"==Rt&&(Ct=Ct.toLowerCase());var Mt=Ee(b,"layout","text-max-width",d,y),Nt=Ee(b,"layout","text-letter-spacing",d,y),jt=2==g?le(Ct,Nt):function t(e,n,r,i){if(-1!==e.indexOf("\n")){for(var o=e.split("\n"),a=[],s=0,l=o.length;s<l;++s)a.push(t(o[s],n,r,i));return a.join("\n")}var u=r+","+n+","+e+","+i,c=he[u];if(!c){var h=e.split(" ");if(h.length>1){var p=ue();p.font=n;var d=p.measureText("M").width*r,f="";for(a=[],s=0,l=h.length;s<l;++s){var g=h[s],y=f+(f?" ":"")+g;ce(y,i)<=d?f=y:(f&&a.push(f),f=g)}f&&a.push(f);for(s=0,l=a.length;s<l&&l>1;++s){var m=a[s];if(ce(m,i)<.35*d){var v=s>0?ce(a[s-1],i):1/0,_=s<l-1?ce(a[s+1],i):1/0;a.splice(s,1),l-=1,v<_?(a[s-1]+=" "+m,s-=1):a[s]=m+" "+a[s]}}for(s=0,l=a.length-1;s<l;++s){var b=a[s],w=a[s+1];if(ce(b,i)>.7*d&&ce(w,i)<.6*d){var x=b.split(" "),E=x.pop();ce(E,i)<.2*d&&(a[s]=x.join(" "),a[s+1]=E+" "+w),l-=1}}c=a.join("\n")}else c=e;c=le(c,i),he[u]=c}return c}(Ct,Pt,Mt,Nt);B.setText(jt),B.setFont(Pt),B.setRotation(re(Ee(b,"layout","text-rotate",d,y)));var At=Ee(b,"layout","text-anchor",d,y),kt=U||1==g?"point":Ee(b,"layout","symbol-placement",d,y);B.setPlacement(kt);var Ft=Ee(b,"paint","text-halo-width",d,y),Dt=Ee(b,"layout","text-offset",d,y),Gt=Ee(b,"paint","text-translate",d,y),zt=0,Ut=0;if("point"==kt){var Bt="center";-1!==At.indexOf("left")?(Bt="left",Ut=Ft):-1!==At.indexOf("right")&&(Bt="right",Ut=-Ft),B.setTextAlign(Bt);var Vt=Ee(b,"layout","text-rotation-alignment",d,y);B.setRotateWithView("map"==Vt)}else B.setMaxAngle(re(Ee(b,"layout","text-max-angle",d,y))*Ct.length/jt.length),B.setTextAlign(),B.setRotateWithView(!1);var qt="middle";0==At.indexOf("bottom")?(qt="bottom",zt=-Ft-.5*(Lt-1)*Tt):0==At.indexOf("top")&&(qt="top",zt=Ft+.5*(Lt-1)*Tt),B.setTextBaseline(qt),B.setOffsetX(Dt[0]*Tt+Ut+Gt[0]),B.setOffsetY(Dt[1]*Tt+zt+Gt[1]),I.setColor(Oe(Ee(b,"paint","text-color",d,y),C)),B.setFill(I);var Yt=Oe(Ee(b,"paint","text-halo-color",d,y),C);if(Yt){T.setColor(Yt),Ft*=2;var Xt=.5*Tt;T.setWidth(Ft<=Xt?Ft:Xt),B.setStroke(T)}else B.setStroke(void 0);var Wt=Ee(b,"layout","text-padding",d,y),Ht=B.getPadding();Wt!==Ht[0]&&(Ht[0]=Wt,Ht[1]=Wt,Ht[2]=Wt,Ht[3]=Wt),A.setZIndex(k)}}},b=0,w=o.length;b<w;++b)_(b);return v>-1?(R.length=v+1,Ie&&("function"==typeof t.set?t.set("mapbox-layer",f):t.getProperties()["mapbox-layer"]=f),R):void 0}};return t.setStyle(M),t.set("mapbox-source",g),t.set("mapbox-layers",v),M},Re=n(238),Me=n.n(Re),Ne=(n(55),n(46),/font-family: ?([^;]*);/),je=/("|')/g;function Ae(t){if(!Le){Le={};for(var e=document.styleSheets,n=0,r=e.length;n<r;++n){var i=e[n];try{var o=i.rules||i.cssRules;if(o)for(var a=0,s=o.length;a<s;++a){var l=o[a];if(5==l.type){var u=l.cssText.match(Ne);Le[u[1].replace(je,"")]=!0}}}catch(t){}}}return t in Le}var ke={},Fe=Me.a.getNames();function De(t){var e=t.toString();if(e in ke)return t;for(var n=t.map((function(t){var e=te()(t,1).split(" ");return[e.slice(3).join(" ").replace(/"/g,""),e[1]+e[0]]})),r=0,i=n.length;r<i;++r){var o=n[r],a=o[0];if(!Ae(a)&&-1!==Fe.indexOf(a)){var s="https://fonts.googleapis.com/css?family="+a.replace(/ /g,"+")+":"+o[1];if(!document.querySelector('link[href="'+s+'"]')){var l=document.createElement("link");l.href=s,l.rel="stylesheet",document.head.appendChild(l)}}}return ke[e]=!0,t}var Ge=/^(.*)(\?.*)$/;function ze(t,e){return e&&0===t.indexOf(".")&&(t=e+t),t}function Ue(t,e,n){var r=(t=ze(t,e)).match(Ge);return r?r[1]+n+(r.length>2?r[2]:""):t+n}function Be(t,e,n,r,i){return new Promise((function(o,a){if("object"!=typeof e&&(e=JSON.parse(e)),8!=e.version)return a(new Error("glStyle version 8 required."));if(!(t instanceof d.a||t instanceof Xt))return a(new Error("Can only apply to VectorLayer or VectorTileLayer"));var s,l,u;function c(){u||e.sprite&&!s?u?(t.setStyle(u),o()):a(new Error("Something went wrong trying to apply style.")):(u=Pe(t,e,n,i,s,l,De),t.getStyle()?o():a(new Error("Nothing to show for source ["+n+"]")))}if(e.sprite){var h=.5==(window.devicePixelRatio>=1.5?.5:1)?"@2x":"",p=Ue(e.sprite,r,h+".json");fetch(p,{credentials:"same-origin"}).then((function(t){return t.ok||""===h?t:(p=Ue(e.sprite,r,".json"),fetch(p,{credentials:"same-origin"}))})).then((function(t){if(t.ok)return t.json();a(new Error("Problem fetching sprite from "+p+": "+t.statusText))})).then((function(t){if(void 0===t)return a(new Error("No sprites found."));s=t,l=Ue(e.sprite,r,h+".png"),c()})).catch((function(t){a(new Error("Sprites cannot be loaded: "+p+": "+t.message))}))}else c()}))}new Ht.a;var Ve=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();function qe(t){return 0!==t.indexOf("mapbox://")?"":t.slice("mapbox://".length)}var Ye=function(t){function e(e){var n=t.call(this,Tt.a.ERROR)||this;return n.error=e,n}return Ve(e,t),e}(Ct.a),Xe="vector",We=function(t){function e(e){var n=this,r=!("declutter"in e)||e.declutter,i=new Wt.a({state:Lt.a.LOADING,format:new It.a});return(n=t.call(this,{source:i,declutter:r,className:e.className,opacity:e.opacity,visible:e.visible,zIndex:e.zIndex,minResolution:e.minResolution,maxResolution:e.maxResolution,minZoom:e.minZoom,maxZoom:e.maxZoom,renderOrder:e.renderOrder,renderBuffer:e.renderBuffer,renderMode:e.renderMode,map:e.map,updateWhileAnimating:e.updateWhileAnimating,updateWhileInteracting:e.updateWhileInteracting,preload:e.preload,useInterimTilesOnError:e.useInterimTilesOnError,properties:e.properties})||this).sourceId=e.source,n.layers=e.layers,n.accessToken=e.accessToken,n.fetchStyle(e.styleUrl),n}return Ve(e,t),e.prototype.fetchStyle=function(t){var e=this,n=function(t,e){var n=qe(t);if(!n)return t;if(0!==n.indexOf("styles/"))throw new Error("unexpected style url: "+t);return"https://api.mapbox.com/styles/v1/"+n.slice("styles/".length)+"?&access_token="+e}(t,this.accessToken);fetch(n).then((function(t){if(!t.ok)throw new Error("unexpected response when fetching style: "+t.status);return t.json()})).then((function(t){e.onStyleLoad(t)})).catch((function(t){e.handleError(t)}))},e.prototype.onStyleLoad=function(t){var e,n,r=this;if(this.layers){for(var i={},o=0;o<t.layers.length;++o){var a=t.layers[o];a.source&&(i[a.id]=a.source)}var s=void 0;for(o=0;o<this.layers.length;++o){var l=i[this.layers[o]];if(!l)return void this.handleError(new Error("could not find source for "+this.layers[o]));if(s){if(s!==l)return void this.handleError(new Error("layers can only use a single source, found "+s+" and "+l))}else s=l}e=s,n=this.layers}else n=e=this.sourceId;n||(n=e=Object.keys(t.sources)[0]),t.sprite&&(t.sprite=function(t,e){var n=qe(t);if(!n)return t;if(0!==n.indexOf("sprites/"))throw new Error("unexpected sprites url: "+t);return"https://api.mapbox.com/styles/v1/"+n.slice("sprites/".length)+"/sprite?access_token="+e}(t.sprite,this.accessToken)),t.glyphs&&(t.glyphs=function(t,e){var n=qe(t);if(!n)return t;if(0!==n.indexOf("fonts/"))throw new Error("unexpected fonts url: "+t);return"https://api.mapbox.com/fonts/v1/"+n.slice("fonts/".length)+"/0-255.pbf?access_token="+e}(t.glyphs,this.accessToken));var u=t.sources[e];if(u.type===Xe){var c,h,p,d=this.getSource();d.setUrl((c=u.url,h=this.accessToken,(p=qe(c))?"https://{a-d}.tiles.mapbox.com/v4/"+p+"/{z}/{x}/{y}.vector.pbf?access_token="+h:c)),Be(this,t,n).then((function(){d.setState(Lt.a.READY)})).catch((function(t){r.handleError(t)}))}else this.handleError(new Error("only works for vector sources, found "+u.type))},e.prototype.handleError=function(t){this.dispatchEvent(new Ye(t)),this.getSource().setState(Lt.a.ERROR)},e}(Xt),He=n(198),Ke=n(195),Ze=n(157),$e=n(23),Je=n(151),Qe=n.n(Je),tn=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),en=function(t){function e(e){var n=t.call(this,e)||this;return n.vectorRenderer_=new Ke.a(e),n.layerImageRatio_=e.getImageRatio(),n.coordinateToVectorPixelTransform_=Object(w.c)(),n.renderedPixelToCoordinateTransform_=null,n}return tn(e,t),e.prototype.disposeInternal=function(){this.vectorRenderer_.dispose(),t.prototype.disposeInternal.call(this)},e.prototype.getFeatures=function(t){if(!this.vectorRenderer_)return new Promise((function(t){return t([])}));var e=Object(w.a)(this.coordinateToVectorPixelTransform_,Object(w.a)(this.renderedPixelToCoordinateTransform_,t.slice()));return this.vectorRenderer_.getFeatures(e)},e.prototype.handleFontsChanged=function(){this.vectorRenderer_.handleFontsChanged()},e.prototype.prepareFrame=function(t){var e=t.pixelRatio,n=t.viewState,r=n.resolution,i=t.viewHints,o=this.vectorRenderer_,a=t.extent;1!==this.layerImageRatio_&&(a=a.slice(0),Object(g.scaleFromCenter)(a,this.layerImageRatio_));var s=Object(g.getWidth)(a)/r,l=Object(g.getHeight)(a)/r;if(!i[j.a.ANIMATING]&&!i[j.a.INTERACTING]&&!Object(g.isEmpty)(a)){o.useContainer(null,null,1);var u=o.context,c=Object(y.a)({},t,{declutterTree:new Qe.a(9),extent:a,size:[s,l],viewState:Object(y.a)({},t.viewState,{rotation:0})}),h=new Ze.a(a,r,e,u.canvas,(function(t){o.prepareFrame(c)&&o.replayGroupChanged&&(o.clipping=!1,o.renderFrame(c,null),o.renderDeclutter(c),t())}));h.addEventListener(Tt.a.CHANGE,function(){if(h.getState()===$e.a.LOADED){this.image_=h;var t=h.getResolution(),r=h.getPixelRatio(),i=t*e/r;this.renderedResolution=i,this.coordinateToVectorPixelTransform_=Object(w.b)(this.coordinateToVectorPixelTransform_,s/2,l/2,1/i,-1/i,0,-n.center[0],-n.center[1])}}.bind(this)),h.load()}return this.image_&&(this.renderedPixelToCoordinateTransform_=t.pixelToCoordinateTransform.slice()),!!this.image_},e.prototype.preRender=function(){},e.prototype.postRender=function(){},e.prototype.renderDeclutter=function(){},e.prototype.forEachFeatureAtCoordinate=function(e,n,r,i,o){return this.vectorRenderer_?this.vectorRenderer_.forEachFeatureAtCoordinate(e,n,r,i,o):t.prototype.forEachFeatureAtCoordinate.call(this,e,n,r,i,o)},e}(He.a),nn=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),rn=function(t){function e(e){var n=this,r=e||{},i=Object(y.a)({},r);return delete i.imageRatio,(n=t.call(this,i)||this).imageRatio_=void 0!==r.imageRatio?r.imageRatio:1,n}return nn(e,t),e.prototype.getImageRatio=function(){return this.imageRatio_},e.prototype.createRenderer=function(){return new en(this)},e}(R.a),on=n(88),an=1,sn=2,ln=4,un=8,cn=16,hn=31,pn={};function dn(t){if("number"==typeof t)return an;if("boolean"==typeof t)return un;if("string"==typeof t)return Object(on.c)(t)?ln|sn:sn;if(!Array.isArray(t))throw new Error("Unhandled value type: "+JSON.stringify(t));var e=t;if(e.every((function(t){return"number"==typeof t})))return 3===e.length||4===e.length?ln|cn:cn;if("string"!=typeof e[0])throw new Error("Expected an expression operator but received: "+JSON.stringify(e));var n=pn[e[0]];if(void 0===n)throw new Error("Unrecognized expression operator: "+JSON.stringify(e));return n.getReturnType(e.slice(1))}function fn(t){var e=t.toString();return-1===e.indexOf(".")?e+".0":e}function gn(t){if(t.length<2||t.length>4)throw new Error("`formatArray` can only output `vec2`, `vec3` or `vec4` arrays.");return"vec"+t.length+"("+t.map(fn).join(", ")+")"}function yn(t,e){return void 0===t.stringLiteralsMap[e]&&(t.stringLiteralsMap[e]=Object.keys(t.stringLiteralsMap).length),t.stringLiteralsMap[e]}function mn(t,e,n){if(Array.isArray(e)&&"string"==typeof e[0]){var r=pn[e[0]];if(void 0===r)throw new Error("Unrecognized expression operator: "+JSON.stringify(e));return r.toGlsl(t,e.slice(1),n)}var i,o,a=dn(e);if((a&an)>0)return fn(e);if((a&un)>0)return e.toString();if((a&sn)>0&&(void 0===n||n==sn))return function(t,e){return fn(yn(t,e))}(t,e.toString());if((a&ln)>0&&(void 0===n||n==ln))return i=e,(o=Object(on.a)(i).slice()).length<4&&o.push(1),gn(o.map((function(t,e){return e<3?t/255:t})));if((a&cn)>0)return gn(e);throw new Error("Unexpected expression "+e+" (expected type "+n+")")}function vn(t){if(!(dn(t)&an))throw new Error("A numeric value was expected, got "+JSON.stringify(t)+" instead")}function _n(t){for(var e=0;e<t.length;e++)vn(t[e])}function bn(t){if(!(dn(t)&sn))throw new Error("A string value was expected, got "+JSON.stringify(t)+" instead")}function wn(t){if(!(dn(t)&un))throw new Error("A boolean value was expected, got "+JSON.stringify(t)+" instead")}function xn(t,e){if(t.length!==e)throw new Error("Exactly "+e+" arguments were expected, got "+t.length+" instead")}function En(t,e){if(t.length<e)throw new Error("At least "+e+" arguments were expected, got "+t.length+" instead")}function Sn(t,e){if(t.length>e)throw new Error("At most "+e+" arguments were expected, got "+t.length+" instead")}function On(t){if(t.length%2!=0)throw new Error("An even amount of arguments was expected, got "+t+" instead")}function Cn(t,e){if(n=e,Math.log2(n)%1!=0)throw new Error("Could not infer only one type from the following expression: "+JSON.stringify(t));var n}function Tn(t){return"u_var_"+t}function In(t){return{getReturnType:function(t){return un},toGlsl:function(e,n){xn(n,2);for(var r=hn,i=0;i<n.length;i++)r&=dn(n[i]);if(0===r)throw new Error("All arguments should be of compatible type, got "+JSON.stringify(n)+" instead");return"("+mn(e,n[0],r)+" "+t+" "+mn(e,n[1],r)+")"}}}function Ln(t){return{getReturnType:function(t){return un},toGlsl:function(e,n){En(n,2);for(var r=0;r<n.length;r++)wn(n[r]);return"("+n.map((function(t){return mn(e,t)})).join(" "+t+" ")+")"}}}pn.get={getReturnType:function(t){return hn},toGlsl:function(t,e){xn(e,1),bn(e[0]);var n=e[0].toString();return-1===t.attributes.indexOf(n)&&t.attributes.push(n),(t.inFragmentShader?"v_":"a_")+n}},pn.var={getReturnType:function(t){return hn},toGlsl:function(t,e){xn(e,1),bn(e[0]);var n=e[0].toString();return-1===t.variables.indexOf(n)&&t.variables.push(n),Tn(n)}},pn.time={getReturnType:function(t){return an},toGlsl:function(t,e){return xn(e,0),"u_time"}},pn.zoom={getReturnType:function(t){return an},toGlsl:function(t,e){return xn(e,0),"u_zoom"}},pn.resolution={getReturnType:function(t){return an},toGlsl:function(t,e){return xn(e,0),"u_resolution"}},pn["*"]={getReturnType:function(t){return an},toGlsl:function(t,e){return xn(e,2),_n(e),"("+mn(t,e[0])+" * "+mn(t,e[1])+")"}},pn["/"]={getReturnType:function(t){return an},toGlsl:function(t,e){return xn(e,2),_n(e),"("+mn(t,e[0])+" / "+mn(t,e[1])+")"}},pn["+"]={getReturnType:function(t){return an},toGlsl:function(t,e){return xn(e,2),_n(e),"("+mn(t,e[0])+" + "+mn(t,e[1])+")"}},pn["-"]={getReturnType:function(t){return an},toGlsl:function(t,e){return xn(e,2),_n(e),"("+mn(t,e[0])+" - "+mn(t,e[1])+")"}},pn.clamp={getReturnType:function(t){return an},toGlsl:function(t,e){xn(e,3),_n(e);var n=mn(t,e[1]),r=mn(t,e[2]);return"clamp("+mn(t,e[0])+", "+n+", "+r+")"}},pn["%"]={getReturnType:function(t){return an},toGlsl:function(t,e){return xn(e,2),_n(e),"mod("+mn(t,e[0])+", "+mn(t,e[1])+")"}},pn["^"]={getReturnType:function(t){return an},toGlsl:function(t,e){return xn(e,2),_n(e),"pow("+mn(t,e[0])+", "+mn(t,e[1])+")"}},pn[">"]={getReturnType:function(t){return un},toGlsl:function(t,e){return xn(e,2),_n(e),"("+mn(t,e[0])+" > "+mn(t,e[1])+")"}},pn[">="]={getReturnType:function(t){return un},toGlsl:function(t,e){return xn(e,2),_n(e),"("+mn(t,e[0])+" >= "+mn(t,e[1])+")"}},pn["<"]={getReturnType:function(t){return un},toGlsl:function(t,e){return xn(e,2),_n(e),"("+mn(t,e[0])+" < "+mn(t,e[1])+")"}},pn["<="]={getReturnType:function(t){return un},toGlsl:function(t,e){return xn(e,2),_n(e),"("+mn(t,e[0])+" <= "+mn(t,e[1])+")"}},pn["=="]=In("=="),pn["!="]=In("!="),pn["!"]={getReturnType:function(t){return un},toGlsl:function(t,e){return xn(e,1),wn(e[0]),"(!"+mn(t,e[0])+")"}},pn.all=Ln("&&"),pn.any=Ln("||"),pn.between={getReturnType:function(t){return un},toGlsl:function(t,e){xn(e,3),_n(e);var n=mn(t,e[1]),r=mn(t,e[2]),i=mn(t,e[0]);return"("+i+" >= "+n+" && "+i+" <= "+r+")"}},pn.array={getReturnType:function(t){return cn},toGlsl:function(t,e){En(e,2),Sn(e,4),_n(e);var n=e.map((function(e){return mn(t,e,an)}));return"vec"+e.length+"("+n.join(", ")+")"}},pn.color={getReturnType:function(t){return ln},toGlsl:function(t,e){En(e,3),Sn(e,4),_n(e);var n=e;3===e.length&&n.push(1);var r=e.map((function(e,n){return mn(t,e,an)+(n<3?" / 255.0":"")}));return"vec"+e.length+"("+r.join(", ")+")"}},pn.interpolate={getReturnType:function(t){for(var e=ln|an,n=3;n<t.length;n+=2)e&=dn(t[n]);return e},toGlsl:function(t,e,n){On(e),En(e,6);var r,i=e[0];switch(i[0]){case"linear":r=1;break;case"exponential":r=i[1];break;default:r=null}if(!r)throw new Error('Invalid interpolation type for "interpolate" operator, received: '+JSON.stringify(i));var o=void 0!==n?n:hn,a=pn.interpolate.getReturnType(e)&o;Cn(e,a);for(var s=mn(t,e[1]),l=null,u=2;u<e.length-2;u+=2){var c=mn(t,e[u]),h=mn(t,e[u+1],a),p=mn(t,e[u+2]);l="mix("+(l||h)+", "+mn(t,e[u+3],a)+", pow(clamp(("+s+" - "+c+") / ("+p+" - "+c+"), 0.0, 1.0), "+fn(r)+"))"}return l}},pn.match={getReturnType:function(t){for(var e=hn,n=2;n<t.length;n+=2)e&=dn(t[n]);return e&=dn(t[t.length-1])},toGlsl:function(t,e,n){On(e),En(e,4);var r=void 0!==n?n:hn,i=pn.match.getReturnType(e)&r;Cn(e,i);for(var o=mn(t,e[0]),a=mn(t,e[e.length-1],i),s=null,l=e.length-3;l>=1;l-=2){s="("+o+" == "+mn(t,e[l])+" ? "+mn(t,e[l+1],i)+" : "+(s||a)+")"}return s}},pn.case={getReturnType:function(t){for(var e=hn,n=1;n<t.length;n+=2)e&=dn(t[n]);return e&=dn(t[t.length-1])},toGlsl:function(t,e,n){!function(t){if(t.length%2==0)throw new Error("An odd amount of arguments was expected, got "+t+" instead")}(e),En(e,3);var r=void 0!==n?n:hn,i=pn.case.getReturnType(e)&r;Cn(e,i);for(var o=0;o<e.length-1;o+=2)wn(e[o]);var a=mn(t,e[e.length-1],i),s=null;for(o=e.length-3;o>=0;o-=2){s="("+mn(t,e[o])+" ? "+mn(t,e[o+1],i)+" : "+(s||a)+")"}return s}};var Pn=function(){function t(){this.uniforms=[],this.attributes=[],this.varyings=[],this.sizeExpression="vec2(1.0)",this.rotationExpression="0.0",this.offsetExpression="vec2(0.0)",this.colorExpression="vec4(1.0)",this.texCoordExpression="vec4(0.0, 0.0, 1.0, 1.0)",this.discardExpression="false",this.rotateWithView=!1}return t.prototype.addUniform=function(t){return this.uniforms.push(t),this},t.prototype.addAttribute=function(t){return this.attributes.push(t),this},t.prototype.addVarying=function(t,e,n){return this.varyings.push({name:t,type:e,expression:n}),this},t.prototype.setSizeExpression=function(t){return this.sizeExpression=t,this},t.prototype.setRotationExpression=function(t){return this.rotationExpression=t,this},t.prototype.setSymbolOffsetExpression=function(t){return this.offsetExpression=t,this},t.prototype.setColorExpression=function(t){return this.colorExpression=t,this},t.prototype.setTextureCoordinateExpression=function(t){return this.texCoordExpression=t,this},t.prototype.setFragmentDiscardExpression=function(t){return this.discardExpression=t,this},t.prototype.setSymbolRotateWithView=function(t){return this.rotateWithView=t,this},t.prototype.getSizeExpression=function(){return this.sizeExpression},t.prototype.getOffsetExpression=function(){return this.offsetExpression},t.prototype.getColorExpression=function(){return this.colorExpression},t.prototype.getTextureCoordinateExpression=function(){return this.texCoordExpression},t.prototype.getFragmentDiscardExpression=function(){return this.discardExpression},t.prototype.getSymbolVertexShader=function(t){var e=this.rotateWithView?"u_offsetScaleMatrix * u_offsetRotateMatrix":"u_offsetScaleMatrix",n=this.attributes,r=this.varyings;return t&&(n=n.concat("vec4 a_hitColor"),r=r.concat({name:"v_hitColor",type:"vec4",expression:"a_hitColor"})),"precision mediump float;\nuniform mat4 u_projectionMatrix;\nuniform mat4 u_offsetScaleMatrix;\nuniform mat4 u_offsetRotateMatrix;\nuniform float u_time;\nuniform float u_zoom;\nuniform float u_resolution;\n"+this.uniforms.map((function(t){return"uniform "+t+";"})).join("\n")+"\nattribute vec2 a_position;\nattribute float a_index;\n"+n.map((function(t){return"attribute "+t+";"})).join("\n")+"\nvarying vec2 v_texCoord;\nvarying vec2 v_quadCoord;\n"+r.map((function(t){return"varying "+t.type+" "+t.name+";"})).join("\n")+"\nvoid main(void) {\n mat4 offsetMatrix = "+e+";\n vec2 halfSize = "+this.sizeExpression+" * 0.5;\n vec2 offset = "+this.offsetExpression+";\n float angle = "+this.rotationExpression+";\n float offsetX;\n float offsetY;\n if (a_index == 0.0) {\n offsetX = (offset.x - halfSize.x) * cos(angle) + (offset.y - halfSize.y) * sin(angle);\n offsetY = (offset.y - halfSize.y) * cos(angle) - (offset.x - halfSize.x) * sin(angle);\n } else if (a_index == 1.0) {\n offsetX = (offset.x + halfSize.x) * cos(angle) + (offset.y - halfSize.y) * sin(angle);\n offsetY = (offset.y - halfSize.y) * cos(angle) - (offset.x + halfSize.x) * sin(angle);\n } else if (a_index == 2.0) {\n offsetX = (offset.x + halfSize.x) * cos(angle) + (offset.y + halfSize.y) * sin(angle);\n offsetY = (offset.y + halfSize.y) * cos(angle) - (offset.x + halfSize.x) * sin(angle);\n } else {\n offsetX = (offset.x - halfSize.x) * cos(angle) + (offset.y + halfSize.y) * sin(angle);\n offsetY = (offset.y + halfSize.y) * cos(angle) - (offset.x - halfSize.x) * sin(angle);\n }\n vec4 offsets = offsetMatrix * vec4(offsetX, offsetY, 0.0, 0.0);\n gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0) + offsets;\n vec4 texCoord = "+this.texCoordExpression+";\n float u = a_index == 0.0 || a_index == 3.0 ? texCoord.s : texCoord.p;\n float v = a_index == 2.0 || a_index == 3.0 ? texCoord.t : texCoord.q;\n v_texCoord = vec2(u, v);\n u = a_index == 0.0 || a_index == 3.0 ? 0.0 : 1.0;\n v = a_index == 2.0 || a_index == 3.0 ? 0.0 : 1.0;\n v_quadCoord = vec2(u, v);\n"+r.map((function(t){return" "+t.name+" = "+t.expression+";"})).join("\n")+"\n}"},t.prototype.getSymbolFragmentShader=function(t){var e=t?" if (gl_FragColor.a < 0.1) { discard; } gl_FragColor = v_hitColor;":"",n=this.varyings;return t&&(n=n.concat({name:"v_hitColor",type:"vec4",expression:"a_hitColor"})),"precision mediump float;\nuniform float u_time;\nuniform float u_zoom;\nuniform float u_resolution;\n"+this.uniforms.map((function(t){return"uniform "+t+";"})).join("\n")+"\nvarying vec2 v_texCoord;\nvarying vec2 v_quadCoord;\n"+n.map((function(t){return"varying "+t.type+" "+t.name+";"})).join("\n")+"\nvoid main(void) {\n if ("+this.discardExpression+") { discard; }\n gl_FragColor = "+this.colorExpression+";\n gl_FragColor.rgb *= gl_FragColor.a;\n"+e+"\n}"},t}();var Rn=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Mn=function(t){function e(e){var n=this,r=Object(y.a)({},e);return(n=t.call(this,r)||this).parseResult_=function(t){var e=t.symbol,n=void 0!==e.size?e.size:1,r=e.color||"white",i=e.textureCoord||[0,0,1,1],o=e.offset||[0,0],a=void 0!==e.opacity?e.opacity:1,s=void 0!==e.rotation?e.rotation:0,l={inFragmentShader:!1,variables:[],attributes:[],stringLiteralsMap:{}},u=mn(l,n,cn|an),c=mn(l,o,cn),h=mn(l,i,cn),p=mn(l,s,an),d={inFragmentShader:!0,variables:l.variables,attributes:[],stringLiteralsMap:l.stringLiteralsMap},f=mn(d,r,ln),g=mn(d,a,an),y="1.0",m="vec2("+mn(d,n,cn|an)+").x";switch(e.symbolType){case"square":case"image":break;case"circle":y="(1.0-smoothstep(1.-4./"+m+",1.,dot(v_quadCoord-.5,v_quadCoord-.5)*4.))";break;case"triangle":var v="(v_quadCoord*2.-1.)",_="(atan("+v+".x,"+v+".y))";y="(1.0-smoothstep(.5-3./"+m+",.5,cos(floor(.5+"+_+"/2.094395102)*2.094395102-"+_+")*length("+v+")))";break;default:throw new Error("Unexpected symbol type: "+e.symbolType)}var b=(new Pn).setSizeExpression("vec2("+u+")").setRotationExpression(p).setSymbolOffsetExpression(c).setTextureCoordinateExpression(h).setSymbolRotateWithView(!!e.rotateWithView).setColorExpression("vec4("+f+".rgb, "+f+".a * "+g+" * "+y+")");if(t.filter){var w=mn(d,t.filter,un);b.setFragmentDiscardExpression("!"+w)}var x={};if(d.variables.forEach((function(e){var n=Tn(e);b.addUniform("float "+n),x[n]=function(){if(!t.variables||void 0===t.variables[e])throw new Error("The following variable is missing from the style: "+e);var n=t.variables[e];return"string"==typeof n&&(n=yn(l,n)),void 0!==n?n:-9999999}})),"image"===e.symbolType&&e.src){var E=new Image;E.src=e.src,b.addUniform("sampler2D u_texture").setColorExpression(b.getColorExpression()+" * texture2D(u_texture, v_texCoord)"),x.u_texture=E}return d.attributes.forEach((function(t){-1===l.attributes.indexOf(t)&&l.attributes.push(t),b.addVarying("v_"+t,"float","a_"+t)})),l.attributes.forEach((function(t){b.addAttribute("float a_"+t)})),{builder:b,attributes:l.attributes.map((function(t){return{name:t,callback:function(e,n){var r=n[t];return"string"==typeof r&&(r=yn(l,r)),void 0!==r?r:-9999999}}})),uniforms:x}}(e.style),n.hitDetectionDisabled_=!!e.disableHitDetection,n}return Rn(e,t),e.prototype.createRenderer=function(){return new yt(this,{className:this.getClassName(),vertexShader:this.parseResult_.builder.getSymbolVertexShader(),fragmentShader:this.parseResult_.builder.getSymbolFragmentShader(),hitVertexShader:!this.hitDetectionDisabled_&&this.parseResult_.builder.getSymbolVertexShader(!0),hitFragmentShader:!this.hitDetectionDisabled_&&this.parseResult_.builder.getSymbolFragmentShader(!0),uniforms:this.parseResult_.uniforms,attributes:this.parseResult_.attributes})},e.prototype.disposeInternal=function(){this.getRenderer().disposeInternal(),t.prototype.disposeInternal.call(this)},e}(Ot.a)},function(t,e,n){"use strict";n.r(e),n.d(e,"BingMaps",(function(){return d})),n.d(e,"CartoDB",(function(){return v})),n.d(e,"Cluster",(function(){return I})),n.d(e,"IIIF",(function(){return q})),n.d(e,"Image",(function(){return lt})),n.d(e,"ImageArcGISRest",(function(){return pt})),n.d(e,"ImageCanvas",(function(){return gt})),n.d(e,"ImageMapGuide",(function(){return mt})),n.d(e,"ImageStatic",(function(){return _t})),n.d(e,"ImageWMS",(function(){return Tt})),n.d(e,"OSM",(function(){return Pt})),n.d(e,"Raster",(function(){return Jt})),n.d(e,"Source",(function(){return tt.a})),n.d(e,"Stamen",(function(){return re})),n.d(e,"Tile",(function(){return At.b})),n.d(e,"TileArcGISRest",(function(){return ae})),n.d(e,"TileDebug",(function(){return le})),n.d(e,"TileImage",(function(){return o.a})),n.d(e,"TileJSON",(function(){return ue.a})),n.d(e,"TileWMS",(function(){return he})),n.d(e,"UrlTile",(function(){return pe.a})),n.d(e,"UTFGrid",(function(){return ye})),n.d(e,"Vector",(function(){return E.a})),n.d(e,"VectorTile",(function(){return me.a})),n.d(e,"WMTS",(function(){return we})),n.d(e,"XYZ",(function(){return g})),n.d(e,"Zoomify",(function(){return G}));var r,i=n(39),o=n(76),a=n(0),s=n(81),l=n(48),u=n(55),c=n(2),h=n(140),p=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});var d=function(t){function e(e){var n=this,r=void 0!==e.hidpi&&e.hidpi;(n=t.call(this,{cacheSize:e.cacheSize,crossOrigin:"anonymous",imageSmoothing:e.imageSmoothing,opaque:!0,projection:Object(c.get)("EPSG:3857"),reprojectionErrorThreshold:e.reprojectionErrorThreshold,state:i.a.LOADING,tileLoadFunction:e.tileLoadFunction,tilePixelRatio:r?2:1,wrapX:void 0===e.wrapX||e.wrapX,transition:e.transition,zDirection:e.zDirection})||this).hidpi_=r,n.culture_=void 0!==e.culture?e.culture:"en-us",n.maxZoom_=void 0!==e.maxZoom?e.maxZoom:-1,n.apiKey_=e.key,n.imagerySet_=e.imagerySet;var o="https://dev.virtualearth.net/REST/v1/Imagery/Metadata/"+n.imagerySet_+"?uriScheme=https&include=ImageryProviders&key="+n.apiKey_+"&c="+n.culture_;return Object(h.a)(o,n.handleImageryMetadataResponse.bind(n),void 0,"jsonp"),n}return p(e,t),e.prototype.getApiKey=function(){return this.apiKey_},e.prototype.getImagerySet=function(){return this.imagerySet_},e.prototype.handleImageryMetadataResponse=function(t){if(200==t.statusCode&&"OK"==t.statusDescription&&"ValidCredentials"==t.authenticationResultCode&&1==t.resourceSets.length&&1==t.resourceSets[0].resources.length){var e=t.resourceSets[0].resources[0],n=-1==this.maxZoom_?e.zoomMax:this.maxZoom_,r=this.getProjection(),o=Object(u.extentFromProjection)(r),h=this.hidpi_?2:1,p=e.imageWidth==e.imageHeight?e.imageWidth/h:[e.imageWidth/h,e.imageHeight/h],d=Object(u.createXYZ)({extent:o,minZoom:e.zoomMin,maxZoom:n,tileSize:p});this.tileGrid=d;var f=this.culture_,g=this.hidpi_;if(this.tileUrlFunction=Object(s.b)(e.imageUrlSubdomains.map((function(t){var n=[0,0,0],r=e.imageUrl.replace("{subdomain}",t).replace("{culture}",f);return function(t,e,i){if(t){Object(l.a)(t[0],t[1],t[2],n);var o=r;return g&&(o+="&dpi=d1&device=mobile"),o.replace("{quadkey}",function(t){var e,n,r=t[0],i=new Array(r),o=1<<r-1;for(e=0;e<r;++e)n=48,t[1]&o&&(n+=1),t[2]&o&&(n+=2),i[e]=String.fromCharCode(n),o>>=1;return i.join("")}(n))}}}))),e.imageryProviders){var y=Object(c.getTransformFromProjections)(Object(c.get)("EPSG:4326"),this.getProjection());this.setAttributions(function(t){var n=[],r=t.viewState,i=this.getTileGrid(),o=i.getZForResolution(r.resolution,this.zDirection),s=i.getTileCoordForCoordAndZ(r.center,o)[0];return e.imageryProviders.map((function(e){for(var r=!1,i=e.coverageAreas,o=0,l=i.length;o<l;++o){var u=i[o];if(s>=u.zoomMin&&s<=u.zoomMax){var c=u.bbox,h=[c[1],c[0],c[3],c[2]],p=Object(a.applyTransform)(h,y);if(Object(a.intersects)(p,t.extent)){r=!0;break}}}r&&n.push(e.attribution)})),n.push('<a class="ol-attribution-bing-tos" href="https://www.microsoft.com/maps/product/terms.html" target="_blank">Terms of Use</a>'),n}.bind(this))}this.setState(i.a.READY)}else this.setState(i.a.ERROR)},e}(o.a),f=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),g=function(t){function e(e){var n=e||{},r=void 0!==n.projection?n.projection:"EPSG:3857",i=void 0!==n.tileGrid?n.tileGrid:Object(u.createXYZ)({extent:Object(u.extentFromProjection)(r),maxResolution:n.maxResolution,maxZoom:n.maxZoom,minZoom:n.minZoom,tileSize:n.tileSize});return t.call(this,{attributions:n.attributions,cacheSize:n.cacheSize,crossOrigin:n.crossOrigin,imageSmoothing:n.imageSmoothing,opaque:n.opaque,projection:r,reprojectionErrorThreshold:n.reprojectionErrorThreshold,tileGrid:i,tileLoadFunction:n.tileLoadFunction,tilePixelRatio:n.tilePixelRatio,tileUrlFunction:n.tileUrlFunction,url:n.url,urls:n.urls,wrapX:void 0===n.wrapX||n.wrapX,transition:n.transition,attributionsCollapsible:n.attributionsCollapsible,zDirection:n.zDirection})||this}return f(e,t),e}(o.a),y=n(6),m=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),v=function(t){function e(e){var n=t.call(this,{attributions:e.attributions,cacheSize:e.cacheSize,crossOrigin:e.crossOrigin,maxZoom:void 0!==e.maxZoom?e.maxZoom:18,minZoom:e.minZoom,projection:e.projection,transition:e.transition,wrapX:e.wrapX,zDirection:e.zDirection})||this;return n.account_=e.account,n.mapId_=e.map||"",n.config_=e.config||{},n.templateCache_={},n.initializeMap_(),n}return m(e,t),e.prototype.getConfig=function(){return this.config_},e.prototype.updateConfig=function(t){Object(y.a)(this.config_,t),this.initializeMap_()},e.prototype.setConfig=function(t){this.config_=t||{},this.initializeMap_()},e.prototype.initializeMap_=function(){var t=JSON.stringify(this.config_);if(this.templateCache_[t])this.applyTemplate_(this.templateCache_[t]);else{var e="https://"+this.account_+".carto.com/api/v1/map";this.mapId_&&(e+="/named/"+this.mapId_);var n=new XMLHttpRequest;n.addEventListener("load",this.handleInitResponse_.bind(this,t)),n.addEventListener("error",this.handleInitError_.bind(this)),n.open("POST",e),n.setRequestHeader("Content-type","application/json"),n.send(JSON.stringify(this.config_))}},e.prototype.handleInitResponse_=function(t,e){var n=e.target;if(!n.status||n.status>=200&&n.status<300){var r=void 0;try{r=JSON.parse(n.responseText)}catch(t){return void this.setState(i.a.ERROR)}this.applyTemplate_(r),this.templateCache_[t]=r,this.setState(i.a.READY)}else this.setState(i.a.ERROR)},e.prototype.handleInitError_=function(t){this.setState(i.a.ERROR)},e.prototype.applyTemplate_=function(t){var e="https://"+t.cdn_url.https+"/"+this.account_+"/api/v1/map/"+t.layergroupid+"/{z}/{x}/{y}.png";this.setUrl(e)},e}(g),_=n(9),b=n(26),w=n(1),x=n(31),E=n(66),S=n(21),O=n(13),C=n(4),T=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),I=function(t){function e(e){var n=t.call(this,{attributions:e.attributions,wrapX:e.wrapX})||this;return n.resolution=void 0,n.distance=void 0!==e.distance?e.distance:20,n.minDistance=e.minDistance||0,n.interpolationRatio=0,n.features=[],n.geometryFunction=e.geometryFunction||function(t){var e=t.getGeometry();return Object(O.a)(e.getType()==w.a.POINT,10),e},n.source=null,n.boundRefresh_=n.refresh.bind(n),n.updateDistance(n.distance,n.minDistance),n.setSource(e.source||null),n}return T(e,t),e.prototype.clear=function(e){this.features.length=0,t.prototype.clear.call(this,e)},e.prototype.getDistance=function(){return this.distance},e.prototype.getSource=function(){return this.source},e.prototype.loadFeatures=function(t,e,n){this.source.loadFeatures(t,e,n),e!==this.resolution&&(this.resolution=e,this.refresh())},e.prototype.setDistance=function(t){this.updateDistance(t,this.minDistance)},e.prototype.setMinDistance=function(t){this.updateDistance(this.distance,t)},e.prototype.getMinDistance=function(){return this.minDistance},e.prototype.setSource=function(t){this.source&&this.source.removeEventListener(_.a.CHANGE,this.boundRefresh_),this.source=t,t&&t.addEventListener(_.a.CHANGE,this.boundRefresh_),this.refresh()},e.prototype.refresh=function(){this.clear(),this.cluster(),this.addFeatures(this.features)},e.prototype.updateDistance=function(t,e){var n=0===t?0:Math.min(e,t)/t,r=t!==this.distance||this.interpolationRatio!==n;this.distance=t,this.minDistance=e,this.interpolationRatio=n,r&&this.refresh()},e.prototype.cluster=function(){if(void 0!==this.resolution&&this.source)for(var t=Object(a.createEmpty)(),e=this.distance*this.resolution,n=this.source.getFeatures(),r={},i=0,o=n.length;i<o;i++){var s=n[i];if(!(Object(C.c)(s)in r)){var l=this.geometryFunction(s);if(l){var u=l.getCoordinates();Object(a.createOrUpdateFromCoordinate)(u,t),Object(a.buffer)(t,e,t);var c=this.source.getFeaturesInExtent(t).filter((function(t){var e=Object(C.c)(t);return!(e in r)&&(r[e]=!0,!0)}));this.features.push(this.createCluster(c,t))}}}},e.prototype.createCluster=function(t,e){for(var n=[0,0],r=t.length-1;r>=0;--r){var i=this.geometryFunction(t[r]);i?Object(S.a)(n,i.getCoordinates()):t.splice(r,1)}Object(S.i)(n,1/t.length);var o=Object(a.getCenter)(e),s=this.interpolationRatio,l=new x.a([n[0]*(1-s)+o[0]*s,n[1]*(1-s)+o[1]*s]),u=new b.a(l);return u.set("features",t,!0),u},e}(E.a),L=n(102),P=n(103),R=n(202),M=n(15),N=n(25),j=n(35),A=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),k="default",F="truncated",D=function(t){function e(e,n,r,i,o,a,s){var l=t.call(this,n,r,i,o,a,s)||this;return l.zoomifyImage_=null,l.tileSize_=e,l}return A(e,t),e.prototype.getImage=function(){if(this.zoomifyImage_)return this.zoomifyImage_;var e=t.prototype.getImage.call(this);if(this.state==M.a.LOADED){var n=this.tileSize_;if(e.width==n[0]&&e.height==n[1])return this.zoomifyImage_=e,e;var r=Object(N.a)(n[0],n[1]);return r.drawImage(e,0,0),this.zoomifyImage_=r.canvas,r.canvas}return e},e}(R.a),G=function(t){function e(e){var n=this,r=e,i=r.size,o=void 0!==r.tierSizeCalculation?r.tierSizeCalculation:k,l=r.tilePixelRatio||1,u=i[0],c=i[1],h=[],p=r.tileSize||P.b,d=p*l;switch(o){case k:for(;u>d||c>d;)h.push([Math.ceil(u/d),Math.ceil(c/d)]),d+=d;break;case F:for(var f=u,g=c;f>d||g>d;)h.push([Math.ceil(f/d),Math.ceil(g/d)]),f>>=1,g>>=1;break;default:Object(O.a)(!1,53)}h.push([1,1]),h.reverse();for(var y=[l],m=[0],v=1,_=h.length;v<_;v++)y.push(l<<v),m.push(h[v-1][0]*h[v-1][1]+m[v-1]);y.reverse();var b=new L.a({tileSize:p,extent:r.extent||[0,-c,u,0],resolutions:y}),w=r.url;w&&-1==w.indexOf("{TileGroup}")&&-1==w.indexOf("{tileIndex}")&&(w+="{TileGroup}/{z}-{x}-{y}.jpg");var x=Object(s.c)(w),E=p*l;var S=Object(s.b)(x.map((function(t){return function(e,n,r){if(e){var i=e[0],o=e[1],a=e[2],s=o+a*h[i][0],l={z:i,x:o,y:a,tileIndex:s,TileGroup:"TileGroup"+((s+m[i])/E|0)};return t.replace(/\{(\w+?)\}/g,(function(t,e){return l[e]}))}}}))),C=D.bind(null,Object(j.d)(p*l));(n=t.call(this,{attributions:r.attributions,cacheSize:r.cacheSize,crossOrigin:r.crossOrigin,imageSmoothing:r.imageSmoothing,projection:r.projection,tilePixelRatio:l,reprojectionErrorThreshold:r.reprojectionErrorThreshold,tileClass:C,tileGrid:b,tileUrlFunction:S,transition:r.transition})||this).zDirection=r.zDirection;var T=S(b.getTileCoordForCoordAndResolution(Object(a.getCenter)(b.getExtent()),y[y.length-1]),1,null),I=new Image;return I.addEventListener("error",function(){E=p,this.changed()}.bind(n)),I.src=T,n}return A(e,t),e}(o.a),z=n(129),U=n(7),B=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();function V(t){return t.toLocaleString("en",{maximumFractionDigits:10})}var q=function(t){function e(e){var n=this,r=e||{},i=r.url||"";i+=i.lastIndexOf("/")===i.length-1||""===i?"":"/";var o=r.version||z.a.VERSION2,s=r.sizes||[],l=r.size;Object(O.a)(null!=l&&Array.isArray(l)&&2==l.length&&!isNaN(l[0])&&l[0]>0&&!isNaN(l[1])&&l[1]>0,60);var u,c,h,p=l[0],d=l[1],f=r.tileSize,g=r.tilePixelRatio||1,y=r.format||"jpg",m=r.quality||(r.version==z.a.VERSION1?"native":"default"),v=r.resolutions||[],_=r.supports||[],b=r.extent||[0,-d,p,0],w=null!=s&&Array.isArray(s)&&s.length>0,x=void 0!==f&&("number"==typeof f&&Number.isInteger(f)&&f>0||Array.isArray(f)&&f.length>0),E=null!=_&&Array.isArray(_)&&(Object(U.f)(_,"regionByPx")||Object(U.f)(_,"regionByPct"))&&(Object(U.f)(_,"sizeByWh")||Object(U.f)(_,"sizeByH")||Object(U.f)(_,"sizeByW")||Object(U.f)(_,"sizeByPct"));if(v.sort((function(t,e){return e-t})),x||E)if(null!=f&&("number"==typeof f&&Number.isInteger(f)&&f>0?(u=f,c=f):Array.isArray(f)&&f.length>0&&((1==f.length||null==f[1]&&Number.isInteger(f[0]))&&(u=f[0],c=f[0]),2==f.length&&(Number.isInteger(f[0])&&Number.isInteger(f[1])?(u=f[0],c=f[1]):null==f[0]&&Number.isInteger(f[1])&&(u=f[1],c=f[1])))),void 0!==u&&void 0!==c||(u=P.b,c=P.b),0==v.length)for(var S=h=Math.max(Math.ceil(Math.log(p/u)/Math.LN2),Math.ceil(Math.log(d/c)/Math.LN2));S>=0;S--)v.push(Math.pow(2,S));else{var C=Math.max.apply(Math,v);h=Math.round(Math.log(C)/Math.LN2)}else if(u=p,c=d,v=[],w){s.sort((function(t,e){return t[0]-e[0]})),h=-1;var T=[];for(S=0;S<s.length;S++){var I=p/s[S][0];v.length>0&&v[v.length-1]==I?T.push(S):(v.push(I),h++)}if(T.length>0)for(S=0;S<T.length;S++)s.splice(T[S]-S,1)}else v.push(1),s.push([p,d]),h=0;var R=new L.a({tileSize:[u,c],extent:b,origin:Object(a.getTopLeft)(b),resolutions:v}),M=D.bind(null,Object(j.d)(f||256).map((function(t){return t*g})));return(n=t.call(this,{attributions:r.attributions,attributionsCollapsible:r.attributionsCollapsible,cacheSize:r.cacheSize,crossOrigin:r.crossOrigin,imageSmoothing:r.imageSmoothing,projection:r.projection,reprojectionErrorThreshold:r.reprojectionErrorThreshold,state:r.state,tileClass:M,tileGrid:R,tilePixelRatio:r.tilePixelRatio,tileUrlFunction:function(t,e,n){var r,a,l=t[0];if(!(l>h)){var f=t[1],g=t[2],b=v[l];if(!(void 0===f||void 0===g||void 0===b||f<0||Math.ceil(p/b/u)<=f||g<0||Math.ceil(d/b/c)<=g)){if(E||x){var S=f*u*b,O=g*c*b,C=u*b,T=c*b,I=u,L=c;if(S+C>p&&(C=p-S),O+T>d&&(T=d-O),S+u*b>p&&(I=Math.floor((p-S+b-1)/b)),O+c*b>d&&(L=Math.floor((d-O+b-1)/b)),0==S&&C==p&&0==O&&T==d)r="full";else if(!E||Object(U.f)(_,"regionByPx"))r=S+","+O+","+C+","+T;else if(Object(U.f)(_,"regionByPct")){r="pct:"+V(S/p*100)+","+V(O/d*100)+","+V(C/p*100)+","+V(T/d*100)}o!=z.a.VERSION3||E&&!Object(U.f)(_,"sizeByWh")?!E||Object(U.f)(_,"sizeByW")?a=I+",":Object(U.f)(_,"sizeByH")?a=","+L:Object(U.f)(_,"sizeByWh")?a=I+","+L:Object(U.f)(_,"sizeByPct")&&(a="pct:"+V(100/b)):a=I+","+L}else if(r="full",w){var P=s[l][0],R=s[l][1];a=o==z.a.VERSION3?P==p&&R==d?"max":P+","+R:P==p?"full":P+","}else a=o==z.a.VERSION3?"max":"full";return i+r+"/"+a+"/0/"+m+"."+y}}},transition:r.transition})||this).zDirection=r.zDirection,n}return B(e,t),e}(o.a),Y=n(40),X=n(23),W=n(78),H=n(152),K=n(203),Z=n(116),$=n(10),J=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Q=function(t){function e(e,n,r,i,o,s,l){var u=this,c=e.getExtent(),h=n.getExtent(),p=h?Object(a.getIntersection)(r,h):r,d=Object(a.getCenter)(p),f=Object(Z.b)(e,n,d,i),g=W.b,y=new K.a(e,n,p,c,f*g,i),m=s(y.calculateSourceExtent(),f,o),v=m?X.a.IDLE:X.a.EMPTY,_=m?m.getPixelRatio():1;return(u=t.call(this,r,i,_,v)||this).targetProj_=n,u.maxSourceExtent_=c,u.triangulation_=y,u.targetResolution_=i,u.targetExtent_=r,u.sourceImage_=m,u.sourcePixelRatio_=_,u.contextOptions_=l,u.canvas_=null,u.sourceListenerKey_=null,u}return J(e,t),e.prototype.disposeInternal=function(){this.state==X.a.LOADING&&this.unlistenSource_(),t.prototype.disposeInternal.call(this)},e.prototype.getImage=function(){return this.canvas_},e.prototype.getProjection=function(){return this.targetProj_},e.prototype.reproject_=function(){var t=this.sourceImage_.getState();if(t==X.a.LOADED){var e=Object(a.getWidth)(this.targetExtent_)/this.targetResolution_,n=Object(a.getHeight)(this.targetExtent_)/this.targetResolution_;this.canvas_=Object(Z.c)(e,n,this.sourcePixelRatio_,this.sourceImage_.getResolution(),this.maxSourceExtent_,this.targetResolution_,this.targetExtent_,this.triangulation_,[{extent:this.sourceImage_.getExtent(),image:this.sourceImage_.getImage()}],0,void 0,this.contextOptions_)}this.state=t,this.changed()},e.prototype.load=function(){if(this.state==X.a.IDLE){this.state=X.a.LOADING,this.changed();var t=this.sourceImage_.getState();t==X.a.LOADED||t==X.a.ERROR?this.reproject_():(this.sourceListenerKey_=Object($.listen)(this.sourceImage_,_.a.CHANGE,(function(t){var e=this.sourceImage_.getState();e!=X.a.LOADED&&e!=X.a.ERROR||(this.unlistenSource_(),this.reproject_())}),this),this.sourceImage_.load())}},e.prototype.unlistenSource_=function(){Object($.unlistenByKey)(this.sourceListenerKey_),this.sourceListenerKey_=null},e}(H.a),tt=n(108),et=n(84),nt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),rt="imageloadstart",it="imageloadend",ot="imageloaderror",at=function(t){function e(e,n){var r=t.call(this,e)||this;return r.image=n,r}return nt(e,t),e}(Y.a);function st(t,e){t.getImage().src=e}var lt=function(t){function e(e){var n=t.call(this,{attributions:e.attributions,projection:e.projection,state:e.state})||this;return n.on,n.once,n.un,n.resolutions_=void 0!==e.resolutions?e.resolutions:null,n.reprojectedImage_=null,n.reprojectedRevision_=0,n.contextOptions_=!1===e.imageSmoothing?et.b:void 0,n}return nt(e,t),e.prototype.getResolutions=function(){return this.resolutions_},e.prototype.getContextOptions=function(){return this.contextOptions_},e.prototype.findNearestResolution=function(t){if(this.resolutions_){var e=Object(U.h)(this.resolutions_,t,0);t=this.resolutions_[e]}return t},e.prototype.getImage=function(t,e,n,r){var i=this.getProjection();if(W.a&&i&&r&&!Object(c.equivalent)(i,r)){if(this.reprojectedImage_){if(this.reprojectedRevision_==this.getRevision()&&Object(c.equivalent)(this.reprojectedImage_.getProjection(),r)&&this.reprojectedImage_.getResolution()==e&&Object(a.equals)(this.reprojectedImage_.getExtent(),t))return this.reprojectedImage_;this.reprojectedImage_.dispose(),this.reprojectedImage_=null}return this.reprojectedImage_=new Q(i,r,t,e,n,function(t,e,n){return this.getImageInternal(t,e,n,i)}.bind(this),this.contextOptions_),this.reprojectedRevision_=this.getRevision(),this.reprojectedImage_}return i&&(r=i),this.getImageInternal(t,e,n,r)},e.prototype.getImageInternal=function(t,e,n,r){return Object(C.b)()},e.prototype.handleImageChange=function(t){var e=t.target;switch(e.getState()){case X.a.LOADING:this.loading=!0,this.dispatchEvent(new at(rt,e));break;case X.a.LOADED:this.loading=!1,this.dispatchEvent(new at(it,e));break;case X.a.ERROR:this.loading=!1,this.dispatchEvent(new at(ot,e))}},e}(tt.a),ut=n(101);function ct(t,e){var n=[];Object.keys(e).forEach((function(t){null!==e[t]&&void 0!==e[t]&&n.push(t+"="+encodeURIComponent(e[t]))}));var r=n.join("&");return(t=-1===(t=t.replace(/[?&]$/,"")).indexOf("?")?t+"?":t+"&")+r}var ht=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),pt=function(t){function e(e){var n=this,r=e||{};return(n=t.call(this,{attributions:r.attributions,imageSmoothing:r.imageSmoothing,projection:r.projection,resolutions:r.resolutions})||this).crossOrigin_=void 0!==r.crossOrigin?r.crossOrigin:null,n.hidpi_=void 0===r.hidpi||r.hidpi,n.url_=r.url,n.imageLoadFunction_=void 0!==r.imageLoadFunction?r.imageLoadFunction:st,n.params_=r.params||{},n.image_=null,n.imageSize_=[0,0],n.renderedRevision_=0,n.ratio_=void 0!==r.ratio?r.ratio:1.5,n}return ht(e,t),e.prototype.getParams=function(){return this.params_},e.prototype.getImageInternal=function(t,e,n,r){if(void 0===this.url_)return null;e=this.findNearestResolution(e),n=this.hidpi_?n:1;var i=this.image_;if(i&&this.renderedRevision_==this.getRevision()&&i.getResolution()==e&&i.getPixelRatio()==n&&Object(a.containsExtent)(i.getExtent(),t))return i;var o={F:"image",FORMAT:"PNG32",TRANSPARENT:!0};Object(y.a)(o,this.params_);var s=((t=t.slice())[0]+t[2])/2,l=(t[1]+t[3])/2;if(1!=this.ratio_){var u=this.ratio_*Object(a.getWidth)(t)/2,c=this.ratio_*Object(a.getHeight)(t)/2;t[0]=s-u,t[1]=l-c,t[2]=s+u,t[3]=l+c}var h=e/n,p=Math.ceil(Object(a.getWidth)(t)/h),d=Math.ceil(Object(a.getHeight)(t)/h);t[0]=s-h*p/2,t[2]=s+h*p/2,t[1]=l-h*d/2,t[3]=l+h*d/2,this.imageSize_[0]=p,this.imageSize_[1]=d;var f=this.getRequestUrl_(t,this.imageSize_,n,r,o);return this.image_=new ut.a(t,e,n,f,this.crossOrigin_,this.imageLoadFunction_),this.renderedRevision_=this.getRevision(),this.image_.addEventListener(_.a.CHANGE,this.handleImageChange.bind(this)),this.image_},e.prototype.getImageLoadFunction=function(){return this.imageLoadFunction_},e.prototype.getRequestUrl_=function(t,e,n,r,i){var o=r.getCode().split(/:(?=\d+$)/).pop();i.SIZE=e[0]+","+e[1],i.BBOX=t.join(","),i.BBOXSR=o,i.IMAGESR=o,i.DPI=Math.round(90*n);var a=this.url_,s=a.replace(/MapServer\/?$/,"MapServer/export").replace(/ImageServer\/?$/,"ImageServer/exportImage");return s==a&&Object(O.a)(!1,50),ct(s,i)},e.prototype.getUrl=function(){return this.url_},e.prototype.setImageLoadFunction=function(t){this.image_=null,this.imageLoadFunction_=t,this.changed()},e.prototype.setUrl=function(t){t!=this.url_&&(this.url_=t,this.image_=null,this.changed())},e.prototype.updateParams=function(t){Object(y.a)(this.params_,t),this.image_=null,this.changed()},e}(lt),dt=n(157),ft=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),gt=function(t){function e(e){var n=this,r=e||{};return(n=t.call(this,{attributions:r.attributions,imageSmoothing:r.imageSmoothing,projection:r.projection,resolutions:r.resolutions,state:r.state})||this).canvasFunction_=r.canvasFunction,n.canvas_=null,n.renderedRevision_=0,n.ratio_=void 0!==r.ratio?r.ratio:1.5,n}return ft(e,t),e.prototype.getImageInternal=function(t,e,n,r){e=this.findNearestResolution(e);var i=this.canvas_;if(i&&this.renderedRevision_==this.getRevision()&&i.getResolution()==e&&i.getPixelRatio()==n&&Object(a.containsExtent)(i.getExtent(),t))return i;t=t.slice(),Object(a.scaleFromCenter)(t,this.ratio_);var o=[Object(a.getWidth)(t)/e*n,Object(a.getHeight)(t)/e*n],s=this.canvasFunction_.call(this,t,e,n,o,r);return s&&(i=new dt.a(t,e,n,s)),this.canvas_=i,this.renderedRevision_=this.getRevision(),i},e}(lt),yt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();var mt=function(t){function e(e){var n=t.call(this,{imageSmoothing:e.imageSmoothing,projection:e.projection,resolutions:e.resolutions})||this;return n.crossOrigin_=void 0!==e.crossOrigin?e.crossOrigin:null,n.displayDpi_=void 0!==e.displayDpi?e.displayDpi:96,n.params_=e.params||{},n.url_=e.url,n.imageLoadFunction_=void 0!==e.imageLoadFunction?e.imageLoadFunction:st,n.hidpi_=void 0===e.hidpi||e.hidpi,n.metersPerUnit_=void 0!==e.metersPerUnit?e.metersPerUnit:1,n.ratio_=void 0!==e.ratio?e.ratio:1,n.useOverlay_=void 0!==e.useOverlay&&e.useOverlay,n.image_=null,n.renderedRevision_=0,n}return yt(e,t),e.prototype.getParams=function(){return this.params_},e.prototype.getImageInternal=function(t,e,n,r){e=this.findNearestResolution(e),n=this.hidpi_?n:1;var i=this.image_;if(i&&this.renderedRevision_==this.getRevision()&&i.getResolution()==e&&i.getPixelRatio()==n&&Object(a.containsExtent)(i.getExtent(),t))return i;1!=this.ratio_&&(t=t.slice(),Object(a.scaleFromCenter)(t,this.ratio_));var o=[Object(a.getWidth)(t)/e*n,Object(a.getHeight)(t)/e*n];if(void 0!==this.url_){var s=this.getUrl(this.url_,this.params_,t,o,r);(i=new ut.a(t,e,n,s,this.crossOrigin_,this.imageLoadFunction_)).addEventListener(_.a.CHANGE,this.handleImageChange.bind(this))}else i=null;return this.image_=i,this.renderedRevision_=this.getRevision(),i},e.prototype.getImageLoadFunction=function(){return this.imageLoadFunction_},e.prototype.updateParams=function(t){Object(y.a)(this.params_,t),this.changed()},e.prototype.getUrl=function(t,e,n,r,i){var o=function(t,e,n,r){var i=Object(a.getWidth)(t),o=Object(a.getHeight)(t),s=e[0],l=e[1],u=.0254/r;return l*i>s*o?i*n/(s*u):o*n/(l*u)}(n,r,this.metersPerUnit_,this.displayDpi_),s=Object(a.getCenter)(n),l={OPERATION:this.useOverlay_?"GETDYNAMICMAPOVERLAYIMAGE":"GETMAPIMAGE",VERSION:"2.0.0",LOCALE:"en",CLIENTAGENT:"ol/source/ImageMapGuide source",CLIP:"1",SETDISPLAYDPI:this.displayDpi_,SETDISPLAYWIDTH:Math.round(r[0]),SETDISPLAYHEIGHT:Math.round(r[1]),SETVIEWSCALE:o,SETVIEWCENTERX:s[0],SETVIEWCENTERY:s[1]};return Object(y.a)(l,e),ct(t,l)},e.prototype.setImageLoadFunction=function(t){this.image_=null,this.imageLoadFunction_=t,this.changed()},e}(lt),vt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),_t=function(t){function e(e){var n=this,r=void 0!==e.crossOrigin?e.crossOrigin:null,i=void 0!==e.imageLoadFunction?e.imageLoadFunction:st;return(n=t.call(this,{attributions:e.attributions,imageSmoothing:e.imageSmoothing,projection:Object(c.get)(e.projection)})||this).url_=e.url,n.imageExtent_=e.imageExtent,n.image_=new ut.a(n.imageExtent_,void 0,1,n.url_,r,i),n.imageSize_=e.imageSize?e.imageSize:null,n.image_.addEventListener(_.a.CHANGE,n.handleImageChange.bind(n)),n}return vt(e,t),e.prototype.getImageExtent=function(){return this.imageExtent_},e.prototype.getImageInternal=function(t,e,n,r){return Object(a.intersects)(t,this.image_.getExtent())?this.image_:null},e.prototype.getUrl=function(){return this.url_},e.prototype.handleImageChange=function(e){if(this.image_.getState()==X.a.LOADED){var n=this.image_.getExtent(),r=this.image_.getImage(),i=void 0,o=void 0;this.imageSize_?(i=this.imageSize_[0],o=this.imageSize_[1]):(i=r.width,o=r.height);var s=Object(a.getWidth)(n),l=Object(a.getHeight)(n),u=s/i,c=l/o,h=i,p=o;if(u>c?h=Math.round(s/c):p=Math.round(l/u),h!==i||p!==o){var d=Object(N.a)(h,p);Object(y.a)(d,this.getContextOptions());var f=d.canvas;d.drawImage(r,0,0,i,o,0,0,f.width,f.height),this.image_.setImage(f)}}t.prototype.handleImageChange.call(this,e)},e}(lt),bt="carmentaserver",wt="geoserver",xt="mapserver",Et="qgis",St=n(96),Ot=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ct=[101,101],Tt=function(t){function e(e){var n=this,r=e||{};return(n=t.call(this,{attributions:r.attributions,imageSmoothing:r.imageSmoothing,projection:r.projection,resolutions:r.resolutions})||this).crossOrigin_=void 0!==r.crossOrigin?r.crossOrigin:null,n.url_=r.url,n.imageLoadFunction_=void 0!==r.imageLoadFunction?r.imageLoadFunction:st,n.params_=r.params||{},n.v13_=!0,n.updateV13_(),n.serverType_=r.serverType,n.hidpi_=void 0===r.hidpi||r.hidpi,n.image_=null,n.imageSize_=[0,0],n.renderedRevision_=0,n.ratio_=void 0!==r.ratio?r.ratio:1.5,n}return Ot(e,t),e.prototype.getFeatureInfoUrl=function(t,e,n,r){if(void 0!==this.url_){var i=Object(c.get)(n),o=this.getProjection();o&&o!==i&&(e=Object(Z.b)(o,i,t,e),t=Object(c.transform)(t,i,o));var s=Object(a.getForViewAndSize)(t,e,0,Ct),l={SERVICE:"WMS",VERSION:et.a,REQUEST:"GetFeatureInfo",FORMAT:"image/png",TRANSPARENT:!0,QUERY_LAYERS:this.params_.LAYERS};Object(y.a)(l,this.params_,r);var u=Math.floor((t[0]-s[0])/e),h=Math.floor((s[3]-t[1])/e);return l[this.v13_?"I":"X"]=u,l[this.v13_?"J":"Y"]=h,this.getRequestUrl_(s,Ct,1,o||i,l)}},e.prototype.getLegendUrl=function(t,e){if(void 0!==this.url_){var n={SERVICE:"WMS",VERSION:et.a,REQUEST:"GetLegendGraphic",FORMAT:"image/png"};if(void 0===e||void 0===e.LAYER){var r=this.params_.LAYERS;if(!(!Array.isArray(r)||1===r.length))return;n.LAYER=r}if(void 0!==t){var i=this.getProjection()?this.getProjection().getMetersPerUnit():1;n.SCALE=t*i/28e-5}return Object(y.a)(n,e),ct(this.url_,n)}},e.prototype.getParams=function(){return this.params_},e.prototype.getImageInternal=function(t,e,n,r){if(void 0===this.url_)return null;e=this.findNearestResolution(e),1==n||this.hidpi_&&void 0!==this.serverType_||(n=1);var i=e/n,o=Object(a.getCenter)(t),s=Math.ceil(Object(a.getWidth)(t)/i),l=Math.ceil(Object(a.getHeight)(t)/i),u=Object(a.getForViewAndSize)(o,i,0,[s,l]),c=Math.ceil(this.ratio_*Object(a.getWidth)(t)/i),h=Math.ceil(this.ratio_*Object(a.getHeight)(t)/i),p=Object(a.getForViewAndSize)(o,i,0,[c,h]),d=this.image_;if(d&&this.renderedRevision_==this.getRevision()&&d.getResolution()==e&&d.getPixelRatio()==n&&Object(a.containsExtent)(d.getExtent(),u))return d;var f={SERVICE:"WMS",VERSION:et.a,REQUEST:"GetMap",FORMAT:"image/png",TRANSPARENT:!0};Object(y.a)(f,this.params_),this.imageSize_[0]=Math.round(Object(a.getWidth)(p)/i),this.imageSize_[1]=Math.round(Object(a.getHeight)(p)/i);var g=this.getRequestUrl_(p,this.imageSize_,n,r,f);return this.image_=new ut.a(p,e,n,g,this.crossOrigin_,this.imageLoadFunction_),this.renderedRevision_=this.getRevision(),this.image_.addEventListener(_.a.CHANGE,this.handleImageChange.bind(this)),this.image_},e.prototype.getImageLoadFunction=function(){return this.imageLoadFunction_},e.prototype.getRequestUrl_=function(t,e,n,r,i){if(Object(O.a)(void 0!==this.url_,9),i[this.v13_?"CRS":"SRS"]=r.getCode(),"STYLES"in this.params_||(i.STYLES=""),1!=n)switch(this.serverType_){case wt:var o=90*n+.5|0;"FORMAT_OPTIONS"in i?i.FORMAT_OPTIONS+=";dpi:"+o:i.FORMAT_OPTIONS="dpi:"+o;break;case xt:i.MAP_RESOLUTION=90*n;break;case bt:case Et:i.DPI=90*n;break;default:Object(O.a)(!1,8)}i.WIDTH=e[0],i.HEIGHT=e[1];var a,s=r.getAxisOrientation();return a=this.v13_&&"ne"==s.substr(0,2)?[t[1],t[0],t[3],t[2]]:t,i.BBOX=a.join(","),ct(this.url_,i)},e.prototype.getUrl=function(){return this.url_},e.prototype.setImageLoadFunction=function(t){this.image_=null,this.imageLoadFunction_=t,this.changed()},e.prototype.setUrl=function(t){t!=this.url_&&(this.url_=t,this.image_=null,this.changed())},e.prototype.updateParams=function(t){Object(y.a)(this.params_,t),this.updateV13_(),this.image_=null,this.changed()},e.prototype.updateV13_=function(){var t=this.params_.VERSION||et.a;this.v13_=Object(St.a)(t,"1.3")>=0},e}(lt),It=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Lt='© <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors.',Pt=function(t){function e(e){var n,r=e||{};n=void 0!==r.attributions?r.attributions:[Lt];var i=void 0!==r.crossOrigin?r.crossOrigin:"anonymous",o=void 0!==r.url?r.url:"https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png";return t.call(this,{attributions:n,attributionsCollapsible:!1,cacheSize:r.cacheSize,crossOrigin:i,imageSmoothing:r.imageSmoothing,maxZoom:void 0!==r.maxZoom?r.maxZoom:19,opaque:void 0===r.opaque||r.opaque,reprojectionErrorThreshold:r.reprojectionErrorThreshold,tileLoadFunction:r.tileLoadFunction,transition:r.transition,url:o,wrapX:r.wrapX,zDirection:r.zDirection})||this}return It(e,t),e}(g),Rt=n(111),Mt=n(188),Nt=n(110),jt=n(182),At=n(121),kt=n(14),Ft=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Dt=!0;try{new ImageData(10,10)}catch(t){Dt=!1}var Gt=document.createElement("canvas").getContext("2d");function zt(t){var e=!0;try{new ImageData(10,10)}catch(t){e=!1}function n(t,n,r){return e?new ImageData(t,n,r):{data:t,width:n,height:r}}return function(e){var r,i,o=e.buffers,a=e.meta,s=e.imageOps,l=e.width,u=e.height,c=o.length,h=o[0].byteLength;if(s){var p=new Array(c);for(i=0;i<c;++i)p[i]=n(new Uint8ClampedArray(o[i]),l,u);r=t(p,a).data}else{r=new Uint8ClampedArray(h);var d=new Array(c),f=new Array(c);for(i=0;i<c;++i)d[i]=new Uint8ClampedArray(o[i]),f[i]=[0,0,0,0];for(var g=0;g<h;g+=4){for(var y=0;y<c;++y){var m=d[y];f[y][0]=m[g],f[y][1]=m[g+1],f[y][2]=m[g+2],f[y][3]=m[g+3]}var v=t(f,a);r[g]=v[0],r[g+1]=v[1],r[g+2]=v[2],r[g+3]=v[3]}}return r.buffer}}function Ut(t,e){var n=Object.keys(t.lib||{}).map((function(e){return"var "+e+" = "+t.lib[e].toString()+";"})).concat(["var __minion__ = ("+zt.toString()+")(",t.operation.toString(),");",'self.addEventListener("message", function(event) {'," var buffer = __minion__(event.data);"," self.postMessage({buffer: buffer, meta: event.data.meta}, [buffer]);","});"]),r=new Blob(n,{type:"text/javascript"}),i=URL.createObjectURL(r),o=new Worker(i);return o.addEventListener("message",e),o}var Bt=function(t){function e(e){var n,r=t.call(this)||this;r._imageOps=!!e.imageOps;var i=[];if(n=0===e.threads?0:r._imageOps?1:e.threads||1)for(var o=0;o<n;++o)i[o]=Ut(e,r._onWorkerMessage.bind(r,o));else i[0]=function(t,e){var n=zt(t.operation),r=!1;return{postMessage:function(t){setTimeout((function(){r||e({data:{buffer:n(t),meta:t.meta}})}),0)},terminate:function(){r=!0}}}(e,r._onWorkerMessage.bind(r,0));return r._workers=i,r._queue=[],r._maxQueueLength=e.queue||1/0,r._running=0,r._dataLookup={},r._job=null,r}return Ft(e,t),e.prototype.process=function(t,e,n){this._enqueue({inputs:t,meta:e,callback:n}),this._dispatch()},e.prototype._enqueue=function(t){for(this._queue.push(t);this._queue.length>this._maxQueueLength;)this._queue.shift().callback(null,null)},e.prototype._dispatch=function(){if(0===this._running&&this._queue.length>0){var t=this._queue.shift();this._job=t;var e=t.inputs[0].width,n=t.inputs[0].height,r=t.inputs.map((function(t){return t.data.buffer})),i=this._workers.length;if(this._running=i,1===i)this._workers[0].postMessage({buffers:r,meta:t.meta,imageOps:this._imageOps,width:e,height:n},r);else for(var o=t.inputs[0].data.length,a=4*Math.ceil(o/4/i),s=0;s<i;++s){for(var l=s*a,u=[],c=0,h=r.length;c<h;++c)u.push(r[c].slice(l,l+a));this._workers[s].postMessage({buffers:u,meta:t.meta,imageOps:this._imageOps,width:e,height:n},u)}}},e.prototype._onWorkerMessage=function(t,e){this.disposed||(this._dataLookup[t]=e.data,--this._running,0===this._running&&this._resolveJob())},e.prototype._resolveJob=function(){var t,e,n=this._job,r=this._workers.length;if(1===r)t=new Uint8ClampedArray(this._dataLookup[0].buffer),e=this._dataLookup[0].meta;else{var i=n.inputs[0].data.length;t=new Uint8ClampedArray(i),e=new Array(i);for(var o=4*Math.ceil(i/4/r),a=0;a<r;++a){var s=this._dataLookup[a].buffer,l=a*o;t.set(new Uint8ClampedArray(s),l),e[a]=this._dataLookup[a].meta}}this._job=null,this._dataLookup={},n.callback(null,function(t,e,n){if(Dt)return new ImageData(t,e,n);var r=Gt.createImageData(e,n);return r.data.set(t),r}(t,n.inputs[0].width,n.inputs[0].height),e),this._dispatch()},e.prototype.disposeInternal=function(){for(var t=0;t<this._workers.length;++t)this._workers[t].terminate();this._workers.length=0},e}(Rt.a),Vt="beforeoperations",qt="afteroperations",Yt="pixel",Xt="image",Wt=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.extent=n.extent,i.resolution=n.viewState.resolution/n.pixelRatio,i.data=r,i}return Ft(e,t),e}(Y.a),Ht=function(t){function e(e){var n=t.call(this,{projection:null})||this;n.processor_=null,n.operationType_=void 0!==e.operationType?e.operationType:Yt,n.threads_=void 0!==e.threads?e.threads:1,n.layers_=function(t){for(var e=t.length,n=new Array(e),r=0;r<e;++r)n[r]=$t(t[r]);return n}(e.sources);for(var r,i=n.changed.bind(n),o=0,a=n.layers_.length;o<a;++o)n.layers_[o].addEventListener(_.a.CHANGE,i);return n.tileQueue_=new jt.a((function(){return 1}),n.changed.bind(n)),n.requestedFrameState_,n.renderedImageCanvas_=null,n.renderedRevision_,n.frameState_={animate:!1,coordinateToPixelTransform:Object(kt.c)(),declutterTree:null,extent:null,index:0,layerIndex:0,layerStatesArray:(r=n.layers_,r.map((function(t){return t.getLayerState()}))),pixelRatio:1,pixelToCoordinateTransform:Object(kt.c)(),postRenderFunctions:[],size:[0,0],tileQueue:n.tileQueue_,time:Date.now(),usedTiles:{},viewState:{rotation:0},viewHints:[],wantedTiles:{}},n.setAttributions((function(t){for(var n=[],r=0,i=e.sources.length;r<i;++r){var o=e.sources[r],a=(o instanceof tt.a?o:o.getSource()).getAttributions();if("function"==typeof a){var s=a(t);n.push.apply(n,s)}}return 0!==n.length?n:null})),void 0!==e.operation&&n.setOperation(e.operation,e.lib),n}return Ft(e,t),e.prototype.setOperation=function(t,e){this.processor_&&this.processor_.dispose(),this.processor_=new Bt({operation:t,imageOps:this.operationType_===Xt,queue:1,lib:e,threads:this.threads_}),this.changed()},e.prototype.updateFrameState_=function(t,e,n){var r=Object(y.a)({},this.frameState_);r.viewState=Object(y.a)({},r.viewState);var i=Object(a.getCenter)(t);r.extent=t.slice(),r.size[0]=Math.round(Object(a.getWidth)(t)/e),r.size[1]=Math.round(Object(a.getHeight)(t)/e),r.time=1/0;var o=r.viewState;return o.center=i,o.projection=n,o.resolution=e,r},e.prototype.allSourcesReady_=function(){for(var t=!0,e=0,n=this.layers_.length;e<n;++e)if(this.layers_[e].getSource().getState()!==i.a.READY){t=!1;break}return t},e.prototype.getImage=function(t,e,n,r){if(!this.allSourcesReady_())return null;var i=this.updateFrameState_(t,e,r);if(this.requestedFrameState_=i,this.renderedImageCanvas_){var o=this.renderedImageCanvas_.getResolution(),s=this.renderedImageCanvas_.getExtent();e===o&&Object(a.equals)(t,s)||(this.renderedImageCanvas_=null)}return this.renderedImageCanvas_&&this.getRevision()===this.renderedRevision_||this.processSources_(),i.tileQueue.loadMoreTiles(16,16),i.animate&&requestAnimationFrame(this.changed.bind(this)),this.renderedImageCanvas_},e.prototype.processSources_=function(){for(var t=this.requestedFrameState_,e=this.layers_.length,n=new Array(e),r=0;r<e;++r){t.layerIndex=r;var i=Zt(this.layers_[r],t);if(!i)return;n[r]=i}var o={};this.dispatchEvent(new Wt(Vt,t,o)),this.processor_.process(n,o,this.onWorkerComplete_.bind(this,t))},e.prototype.onWorkerComplete_=function(t,e,n,r){if(!e&&n){var i=t.extent,o=t.viewState.resolution;if(o===this.requestedFrameState_.viewState.resolution&&Object(a.equals)(i,this.requestedFrameState_.extent)){var s;if(this.renderedImageCanvas_)s=this.renderedImageCanvas_.getImage().getContext("2d");else{var l=Math.round(Object(a.getWidth)(i)/o),u=Math.round(Object(a.getHeight)(i)/o);s=Object(N.a)(l,u),this.renderedImageCanvas_=new dt.a(i,o,1,s.canvas)}s.putImageData(n,0,0),this.changed(),this.renderedRevision_=this.getRevision(),this.dispatchEvent(new Wt(qt,t,r))}}},e.prototype.getImageInternal=function(){return null},e.prototype.disposeInternal=function(){this.processor_&&this.processor_.dispose(),t.prototype.disposeInternal.call(this)},e}(lt);Ht.prototype.dispose;var Kt=null;function Zt(t,e){var n=t.getRenderer();if(!n)throw new Error("Unsupported layer type: "+t);if(!n.prepareFrame(e))return null;var r=e.size[0],i=e.size[1];if(0===r||0===i)return null;var o,a=n.renderFrame(e,null);if(a&&(o=a.firstElementChild),!(o instanceof HTMLCanvasElement))throw new Error("Unsupported rendered element: "+o);if(o.width===r&&o.height===i)return o.getContext("2d").getImageData(0,0,r,i);if(Kt){var s=Kt.canvas;s.width!==r||s.height!==i?Kt=Object(N.a)(r,i):Kt.clearRect(0,0,r,i)}else Kt=Object(N.a)(r,i);return Kt.drawImage(o,0,0,r,i),Kt.getImageData(0,0,r,i)}function $t(t){var e;return t instanceof tt.a?t instanceof At.b?e=new Nt.a({source:t}):t instanceof lt&&(e=new Mt.a({source:t})):e=t,e}var Jt=Ht,Qt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),te=['Map tiles by <a href="https://stamen.com/" target="_blank">Stamen Design</a>, under <a href="https://creativecommons.org/licenses/by/3.0/" target="_blank">CC BY 3.0</a>.',Lt],ee={terrain:{extension:"jpg",opaque:!0},"terrain-background":{extension:"jpg",opaque:!0},"terrain-labels":{extension:"png",opaque:!1},"terrain-lines":{extension:"png",opaque:!1},"toner-background":{extension:"png",opaque:!0},toner:{extension:"png",opaque:!0},"toner-hybrid":{extension:"png",opaque:!1},"toner-labels":{extension:"png",opaque:!1},"toner-lines":{extension:"png",opaque:!1},"toner-lite":{extension:"png",opaque:!0},watercolor:{extension:"jpg",opaque:!0}},ne={terrain:{minZoom:0,maxZoom:18},toner:{minZoom:0,maxZoom:20},watercolor:{minZoom:0,maxZoom:18}},re=function(t){function e(e){var n=e.layer.indexOf("-"),r=-1==n?e.layer:e.layer.slice(0,n),i=ne[r],o=ee[e.layer],a=void 0!==e.url?e.url:"https://stamen-tiles-{a-d}.a.ssl.fastly.net/"+e.layer+"/{z}/{x}/{y}."+o.extension;return t.call(this,{attributions:te,cacheSize:e.cacheSize,crossOrigin:"anonymous",imageSmoothing:e.imageSmoothing,maxZoom:null!=e.maxZoom?e.maxZoom:i.maxZoom,minZoom:null!=e.minZoom?e.minZoom:i.minZoom,opaque:o.opaque,reprojectionErrorThreshold:e.reprojectionErrorThreshold,tileLoadFunction:e.tileLoadFunction,transition:e.transition,url:a,wrapX:e.wrapX,zDirection:e.zDirection})||this}return Qt(e,t),e}(g),ie=n(8),oe=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ae=function(t){function e(e){var n=this,r=e||{};return(n=t.call(this,{attributions:r.attributions,cacheSize:r.cacheSize,crossOrigin:r.crossOrigin,imageSmoothing:r.imageSmoothing,projection:r.projection,reprojectionErrorThreshold:r.reprojectionErrorThreshold,tileGrid:r.tileGrid,tileLoadFunction:r.tileLoadFunction,url:r.url,urls:r.urls,wrapX:void 0===r.wrapX||r.wrapX,transition:r.transition,zDirection:r.zDirection})||this).params_=r.params||{},n.hidpi_=void 0===r.hidpi||r.hidpi,n.tmpExtent_=Object(a.createEmpty)(),n.setKey(n.getKeyForParams_()),n}return oe(e,t),e.prototype.getKeyForParams_=function(){var t=0,e=[];for(var n in this.params_)e[t++]=n+"-"+this.params_[n];return e.join("/")},e.prototype.getParams=function(){return this.params_},e.prototype.getRequestUrl_=function(t,e,n,r,i,o){var a=this.urls;if(a){var s,u=i.getCode().split(/:(?=\d+$)/).pop();if(o.SIZE=e[0]+","+e[1],o.BBOX=n.join(","),o.BBOXSR=u,o.IMAGESR=u,o.DPI=Math.round(o.DPI?o.DPI*r:90*r),1==a.length)s=a[0];else s=a[Object(ie.e)(Object(l.f)(t),a.length)];return ct(s.replace(/MapServer\/?$/,"MapServer/export").replace(/ImageServer\/?$/,"ImageServer/exportImage"),o)}},e.prototype.getTilePixelRatio=function(t){return this.hidpi_?t:1},e.prototype.updateParams=function(t){Object(y.a)(this.params_,t),this.setKey(this.getKeyForParams_())},e.prototype.tileUrlFunction=function(t,e,n){var r=this.getTileGrid();if(r||(r=this.getTileGridForProjection(n)),!(r.getResolutions().length<=t[0])){1==e||this.hidpi_||(e=1);var i=r.getTileCoordExtent(t,this.tmpExtent_),o=Object(j.d)(r.getTileSize(t[0]),this.tmpSize);1!=e&&(o=Object(j.c)(o,e,this.tmpSize));var a={F:"image",FORMAT:"PNG32",TRANSPARENT:!0};return Object(y.a)(a,this.params_),this.getRequestUrl_(t,o,i,e,n,a)}},e}(o.a),se=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),le=function(t){function e(e){var n=this,r=e||{};return n=t.call(this,{opaque:!1,projection:r.projection,tileGrid:r.tileGrid,wrapX:void 0===r.wrapX||r.wrapX,zDirection:r.zDirection,url:r.template||"z:{z} x:{x} y:{y}",tileLoadFunction:function(t,e){var r=t.getTileCoord()[0],i=Object(j.d)(n.tileGrid.getTileSize(r)),o=Object(N.a)(i[0],i[1]);o.strokeStyle="grey",o.strokeRect(.5,.5,i[0]+.5,i[1]+.5),o.fillStyle="grey",o.strokeStyle="white",o.textAlign="center",o.textBaseline="middle",o.font="24px sans-serif",o.lineWidth=4,o.strokeText(e,i[0]/2,i[1]/2,i[0]),o.fillText(e,i[0]/2,i[1]/2,i[0]),t.setImage(o.canvas)}})||this}return se(e,t),e}(g),ue=n(168),ce=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),he=function(t){function e(e){var n=this,r=e||{},i=r.params||{},o=!("TRANSPARENT"in i)||i.TRANSPARENT;return(n=t.call(this,{attributions:r.attributions,attributionsCollapsible:r.attributionsCollapsible,cacheSize:r.cacheSize,crossOrigin:r.crossOrigin,imageSmoothing:r.imageSmoothing,opaque:!o,projection:r.projection,reprojectionErrorThreshold:r.reprojectionErrorThreshold,tileClass:r.tileClass,tileGrid:r.tileGrid,tileLoadFunction:r.tileLoadFunction,url:r.url,urls:r.urls,wrapX:void 0===r.wrapX||r.wrapX,transition:r.transition,zDirection:r.zDirection})||this).gutter_=void 0!==r.gutter?r.gutter:0,n.params_=i,n.v13_=!0,n.serverType_=r.serverType,n.hidpi_=void 0===r.hidpi||r.hidpi,n.tmpExtent_=Object(a.createEmpty)(),n.updateV13_(),n.setKey(n.getKeyForParams_()),n}return ce(e,t),e.prototype.getFeatureInfoUrl=function(t,e,n,r){var i=Object(c.get)(n),o=this.getProjection(),s=this.getTileGrid();s||(s=this.getTileGridForProjection(i));var l=s.getZForResolution(e,this.zDirection),u=s.getTileCoordForCoordAndZ(t,l);if(!(s.getResolutions().length<=u[0])){var h=s.getResolution(u[0]),p=s.getTileCoordExtent(u,this.tmpExtent_),d=Object(j.d)(s.getTileSize(u[0]),this.tmpSize),f=this.gutter_;0!==f&&(d=Object(j.a)(d,f,this.tmpSize),p=Object(a.buffer)(p,h*f,p)),o&&o!==i&&(h=Object(Z.b)(o,i,t,h),p=Object(c.transformExtent)(p,i,o),t=Object(c.transform)(t,i,o));var g={SERVICE:"WMS",VERSION:et.a,REQUEST:"GetFeatureInfo",FORMAT:"image/png",TRANSPARENT:!0,QUERY_LAYERS:this.params_.LAYERS};Object(y.a)(g,this.params_,r);var m=Math.floor((t[0]-p[0])/h),v=Math.floor((p[3]-t[1])/h);return g[this.v13_?"I":"X"]=m,g[this.v13_?"J":"Y"]=v,this.getRequestUrl_(u,d,p,1,o||i,g)}},e.prototype.getLegendUrl=function(t,e){if(void 0!==this.urls[0]){var n={SERVICE:"WMS",VERSION:et.a,REQUEST:"GetLegendGraphic",FORMAT:"image/png"};if(void 0===e||void 0===e.LAYER){var r=this.params_.LAYERS;if(!(!Array.isArray(r)||1===r.length))return;n.LAYER=r}if(void 0!==t){var i=this.getProjection()?this.getProjection().getMetersPerUnit():1;n.SCALE=t*i/28e-5}return Object(y.a)(n,e),ct(this.urls[0],n)}},e.prototype.getGutter=function(){return this.gutter_},e.prototype.getParams=function(){return this.params_},e.prototype.getRequestUrl_=function(t,e,n,r,i,o){var a=this.urls;if(a){if(o.WIDTH=e[0],o.HEIGHT=e[1],o[this.v13_?"CRS":"SRS"]=i.getCode(),"STYLES"in this.params_||(o.STYLES=""),1!=r)switch(this.serverType_){case wt:var s=90*r+.5|0;"FORMAT_OPTIONS"in o?o.FORMAT_OPTIONS+=";dpi:"+s:o.FORMAT_OPTIONS="dpi:"+s;break;case xt:o.MAP_RESOLUTION=90*r;break;case bt:case Et:o.DPI=90*r;break;default:Object(O.a)(!1,52)}var u,c=i.getAxisOrientation(),h=n;if(this.v13_&&"ne"==c.substr(0,2)){var p=void 0;p=n[0],h[0]=n[1],h[1]=p,p=n[2],h[2]=n[3],h[3]=p}if(o.BBOX=h.join(","),1==a.length)u=a[0];else u=a[Object(ie.e)(Object(l.f)(t),a.length)];return ct(u,o)}},e.prototype.getTilePixelRatio=function(t){return this.hidpi_&&void 0!==this.serverType_?t:1},e.prototype.getKeyForParams_=function(){var t=0,e=[];for(var n in this.params_)e[t++]=n+"-"+this.params_[n];return e.join("/")},e.prototype.updateParams=function(t){Object(y.a)(this.params_,t),this.updateV13_(),this.setKey(this.getKeyForParams_())},e.prototype.updateV13_=function(){var t=this.params_.VERSION||et.a;this.v13_=Object(St.a)(t,"1.3")>=0},e.prototype.tileUrlFunction=function(t,e,n){var r=this.getTileGrid();if(r||(r=this.getTileGridForProjection(n)),!(r.getResolutions().length<=t[0])){1==e||this.hidpi_&&void 0!==this.serverType_||(e=1);var i=r.getResolution(t[0]),o=r.getTileCoordExtent(t,this.tmpExtent_),s=Object(j.d)(r.getTileSize(t[0]),this.tmpSize),l=this.gutter_;0!==l&&(s=Object(j.a)(s,l,this.tmpSize),o=Object(a.buffer)(o,i*l,o)),1!=e&&(s=Object(j.c)(s,e,this.tmpSize));var u={SERVICE:"WMS",VERSION:et.a,REQUEST:"GetMap",FORMAT:"image/png",TRANSPARENT:!0};return Object(y.a)(u,this.params_),this.getRequestUrl_(t,s,o,e,n,u)}},e}(o.a),pe=n(149),de=n(113),fe=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ge=function(t){function e(e,n,r,i,o,a){var s=t.call(this,e,n)||this;return s.src_=r,s.extent_=i,s.preemptive_=o,s.grid_=null,s.keys_=null,s.data_=null,s.jsonp_=a,s}return fe(e,t),e.prototype.getImage=function(){return null},e.prototype.getData=function(t){if(!this.grid_||!this.keys_)return null;var e=(t[0]-this.extent_[0])/(this.extent_[2]-this.extent_[0]),n=(t[1]-this.extent_[1])/(this.extent_[3]-this.extent_[1]),r=this.grid_[Math.floor((1-n)*this.grid_.length)];if("string"!=typeof r)return null;var i=r.charCodeAt(Math.floor(e*r.length));i>=93&&i--,i>=35&&i--;var o=null;if((i-=32)in this.keys_){var a=this.keys_[i];o=this.data_&&a in this.data_?this.data_[a]:a}return o},e.prototype.forDataAtCoordinate=function(t,e,n){this.state==M.a.EMPTY&&!0===n?(this.state=M.a.IDLE,Object($.listenOnce)(this,_.a.CHANGE,(function(n){e(this.getData(t))}),this),this.loadInternal_()):!0===n?setTimeout(function(){e(this.getData(t))}.bind(this),0):e(this.getData(t))},e.prototype.getKey=function(){return this.src_},e.prototype.handleError_=function(){this.state=M.a.ERROR,this.changed()},e.prototype.handleLoad_=function(t){this.grid_=t.grid,this.keys_=t.keys,this.data_=t.data,this.state=M.a.LOADED,this.changed()},e.prototype.loadInternal_=function(){if(this.state==M.a.IDLE)if(this.state=M.a.LOADING,this.jsonp_)Object(h.a)(this.src_,this.handleLoad_.bind(this),this.handleError_.bind(this));else{var t=new XMLHttpRequest;t.addEventListener("load",this.onXHRLoad_.bind(this)),t.addEventListener("error",this.onXHRError_.bind(this)),t.open("GET",this.src_),t.send()}},e.prototype.onXHRLoad_=function(t){var e=t.target;if(!e.status||e.status>=200&&e.status<300){var n=void 0;try{n=JSON.parse(e.responseText)}catch(t){return void this.handleError_()}this.handleLoad_(n)}else this.handleError_()},e.prototype.onXHRError_=function(t){this.handleError_()},e.prototype.load=function(){this.preemptive_?this.loadInternal_():this.setState(M.a.EMPTY)},e}(de.a),ye=function(t){function e(e){var n=t.call(this,{projection:Object(c.get)("EPSG:3857"),state:i.a.LOADING,zDirection:e.zDirection})||this;if(n.preemptive_=void 0===e.preemptive||e.preemptive,n.tileUrlFunction_=s.d,n.template_=void 0,n.jsonp_=e.jsonp||!1,e.url)if(n.jsonp_)Object(h.a)(e.url,n.handleTileJSONResponse.bind(n),n.handleTileJSONError.bind(n));else{var r=new XMLHttpRequest;r.addEventListener("load",n.onXHRLoad_.bind(n)),r.addEventListener("error",n.onXHRError_.bind(n)),r.open("GET",e.url),r.send()}else e.tileJSON?n.handleTileJSONResponse(e.tileJSON):Object(O.a)(!1,51);return n}return fe(e,t),e.prototype.onXHRLoad_=function(t){var e=t.target;if(!e.status||e.status>=200&&e.status<300){var n=void 0;try{n=JSON.parse(e.responseText)}catch(t){return void this.handleTileJSONError()}this.handleTileJSONResponse(n)}else this.handleTileJSONError()},e.prototype.onXHRError_=function(t){this.handleTileJSONError()},e.prototype.getTemplate=function(){return this.template_},e.prototype.forDataAtCoordinateAndResolution=function(t,e,n,r){if(this.tileGrid){var i=this.tileGrid.getZForResolution(e,this.zDirection),o=this.tileGrid.getTileCoordForCoordAndZ(t,i);this.getTile(o[0],o[1],o[2],1,this.getProjection()).forDataAtCoordinate(t,n,r)}else!0===r?setTimeout((function(){n(null)}),0):n(null)},e.prototype.handleTileJSONError=function(){this.setState(i.a.ERROR)},e.prototype.handleTileJSONResponse=function(t){var e,n=Object(c.get)("EPSG:4326"),r=this.getProjection();if(void 0!==t.bounds){var o=Object(c.getTransformFromProjections)(n,r);e=Object(a.applyTransform)(t.bounds,o)}var l=Object(u.extentFromProjection)(r),h=t.minzoom||0,p=t.maxzoom||22,d=Object(u.createXYZ)({extent:l,maxZoom:p,minZoom:h});this.tileGrid=d,this.template_=t.template;var f=t.grids;if(f){if(this.tileUrlFunction_=Object(s.a)(f,d),void 0!==t.attribution){var g=void 0!==e?e:l;this.setAttributions((function(e){return Object(a.intersects)(g,e.extent)?[t.attribution]:null}))}this.setState(i.a.READY)}else this.setState(i.a.ERROR)},e.prototype.getTile=function(t,e,n,r,i){var o=Object(l.e)(t,e,n);if(this.tileCache.containsKey(o))return this.tileCache.get(o);var a=[t,e,n],s=this.getTileCoordForTileUrlFunction(a,i),u=this.tileUrlFunction_(s,r,i),c=new ge(a,void 0!==u?M.a.IDLE:M.a.EMPTY,void 0!==u?u:"",this.tileGrid.getTileCoordExtent(a),this.preemptive_,this.jsonp_);return this.tileCache.set(o,c),c},e.prototype.useTile=function(t,e,n){var r=Object(l.e)(t,e,n);this.tileCache.containsKey(r)&&this.tileCache.get(r)},e}(At.b),me=n(137),ve="KVP",_e=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();!function(t){function e(e){var n=t.call(this,{extent:e.extent,origin:e.origin,origins:e.origins,resolutions:e.resolutions,tileSize:e.tileSize,tileSizes:e.tileSizes,sizes:e.sizes})||this;return n.matrixIds_=e.matrixIds,n}_e(e,t),e.prototype.getMatrixId=function(t){return this.matrixIds_[t]},e.prototype.getMatrixIds=function(){return this.matrixIds_}}(L.a);var be=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),we=function(t){function e(e){var n=this,r=void 0!==e.requestEncoding?e.requestEncoding:ve,i=e.tileGrid,o=e.urls;return void 0===o&&void 0!==e.url&&(o=Object(s.c)(e.url)),(n=t.call(this,{attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,cacheSize:e.cacheSize,crossOrigin:e.crossOrigin,imageSmoothing:e.imageSmoothing,projection:e.projection,reprojectionErrorThreshold:e.reprojectionErrorThreshold,tileClass:e.tileClass,tileGrid:i,tileLoadFunction:e.tileLoadFunction,tilePixelRatio:e.tilePixelRatio,urls:o,wrapX:void 0!==e.wrapX&&e.wrapX,transition:e.transition,zDirection:e.zDirection})||this).version_=void 0!==e.version?e.version:"1.0.0",n.format_=void 0!==e.format?e.format:"image/jpeg",n.dimensions_=void 0!==e.dimensions?e.dimensions:{},n.layer_=e.layer,n.matrixSet_=e.matrixSet,n.style_=e.style,n.requestEncoding_=r,n.setKey(n.getKeyForDimensions_()),o&&o.length>0&&(n.tileUrlFunction=Object(s.b)(o.map(n.createFromWMTSTemplate.bind(n)))),n}return be(e,t),e.prototype.setUrls=function(t){this.urls=t;var e=t.join("\n");this.setTileUrlFunction(Object(s.b)(t.map(this.createFromWMTSTemplate.bind(this))),e)},e.prototype.getDimensions=function(){return this.dimensions_},e.prototype.getFormat=function(){return this.format_},e.prototype.getLayer=function(){return this.layer_},e.prototype.getMatrixSet=function(){return this.matrixSet_},e.prototype.getRequestEncoding=function(){return this.requestEncoding_},e.prototype.getStyle=function(){return this.style_},e.prototype.getVersion=function(){return this.version_},e.prototype.getKeyForDimensions_=function(){var t=0,e=[];for(var n in this.dimensions_)e[t++]=n+"-"+this.dimensions_[n];return e.join("/")},e.prototype.updateDimensions=function(t){Object(y.a)(this.dimensions_,t),this.setKey(this.getKeyForDimensions_())},e.prototype.createFromWMTSTemplate=function(t){var e=this.requestEncoding_,n={layer:this.layer_,style:this.style_,tilematrixset:this.matrixSet_};e==ve&&Object(y.a)(n,{Service:"WMTS",Request:"GetTile",Version:this.version_,Format:this.format_}),t=e==ve?ct(t,n):t.replace(/\{(\w+?)\}/g,(function(t,e){return e.toLowerCase()in n?n[e.toLowerCase()]:t}));var r=this.tileGrid,i=this.dimensions_;return function(n,o,a){if(n){var s={TileMatrix:r.getMatrixId(n[0]),TileCol:n[1],TileRow:n[2]};Object(y.a)(s,i);var l=t;return l=e==ve?ct(l,s):l.replace(/\{(\w+?)\}/g,(function(t,e){return s[e]}))}}},e}(o.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return g}));var r=n(24),i=n.n(r),o=n(27),a=n.n(o),s=n(11),l=n(213),u=n(44),c=n(3),h=n(12),p=n.n(h),d=n(173),f=(n(233),n(234),n(235),"http://127.0.0.1:54001/"),g=function(){function t(e,n){if(i()(this,t),Object(u.b)()){if(this.element=n.element,"string"==typeof n.element){var r=document.querySelector(n.element);r?this.element=r:console.error("Invalid selector for element")}this.context=e,this.servers=n.servers||[];var o=this;this.navigating=!1,this.lastNavigatePathRequest=null,this.autoExpand=!0===n.autoExpandNodes,this.checkboxes=!0===n.checkboxes,this.lastSearchResults={},this.listeners={},this.listeners[c.c.DirectorySelected]=[],this.listeners[c.c.SlideSelected]=[],this.listeners[c.c.ServerSelected]=[],this.listeners[c.c.MultiSelectionChanged]=[],this.listeners[c.c.TreeNodeDoubleClicked]=[],this.listeners[c.c.ServerExpanded]=[],this.listeners[c.c.DirectoryExpanded]=[],this.listeners[c.c.SearchFinished]=[],this.listeners[c.c.SearchFailed]=[],this.lastSearchHash=0,this.previewEnabled=!1,"function"==typeof n.rootDirSortCb&&(this.rootDirSortCb=n.rootDirSortCb);for(var a=[],l=0;l<this.servers.length;l++)a.push({title:this.servers[l].name,serverNode:!0,key:this.servers[l].url,serverIndex:l,extraClasses:"server",dirPath:this.servers[l].path?this.servers[l].path:"/",lazy:!0,unselectableStatus:!1,unselectable:!0,selected:!1,checkbox:!1}),this.context.getVersionInfo(this.servers[l].url,_.bind(this,this.servers[l]));var h=null;if(!0===n.search){var f=n.searchClass?n.searchClass:"pma-ui-tree-search-box";h=p()("<input type='text' class='"+f+"' placeholder='"+s.a.translate("Search")+"'/><hr />").appendTo(this.element)}this.fancytree=Object(d.createTree)(this.element,{keyPathSeparator:"?",checkbox:!0===n.checkboxes,extensions:["dnd5"],dnd5:{dragStart:function(t,e){return!(!t.data.dirPath||t.data.serverNode)&&(t.data.dragging=!0,t.isActive&&t.setActive(!1),e.dataTransfer.setData("text",JSON.stringify({serverUrl:t.data.serverUrl,path:t.data.dirPath,isFolder:t.isFolder()})),!0)},dragEnd:function(t,e){t.data.dragging=!1}},selectMode:3,toggleEffect:{options:{direction:"left"},duration:400},wide:{iconWidth:"1em",iconSpacing:"0.5em",levelOfs:"1.5em"},icon:function(t,e){return"_searchResults"===e.node.key?e.node.data.searching?"fa fa-spinner fa-spin":"fa fa-search":!0===e.node.data.serverNode?"server":!0===e.node.data.rootDir?"rootdir":e.node.isFolder()?void 0:"image"},renderNode:"function"==typeof n.renderNode?n.renderNode:null,source:a,lazyLoad:y.bind(this),activate:function(t,e){var n=e.node;"_searchResults"==n.key&&!0===o.autoExpand&&n.setExpanded(!0),setTimeout((function(){n.data&&!0===n.data.dragging?t.preventDefault():!0!==n.data.serverNode?"/"!==n.data.dirPath?n.isFolder()?(!0===o.autoExpand&&n.setExpanded(!0),o.fireEvent(c.c.DirectorySelected,{serverUrl:o.servers[n.data.serverIndex].url,path:n.data.dirPath})):o.servers[n.data.serverIndex]&&o.fireEvent(c.c.SlideSelected,{serverUrl:o.servers[n.data.serverIndex].url,path:n.data.dirPath}):!0===o.autoExpand&&n.setExpanded(!0):o.fireEvent(c.c.ServerSelected,{serverUrl:o.servers[n.data.serverIndex].url})}),300)},select:function(t,e){var n=e.tree.getSelectedNodes(),r=[];if(n&&n.length>0)for(var i=0;i<n.length;i++)null===n[i]||!0===n[i].data.serverNode||!0===n[i].data.rootDir||n[i].isFolder()||r.push({serverUrl:o.servers[n[i].data.serverIndex].url,path:n[i].data.dirPath});o.fireEvent(c.c.MultiSelectionChanged,r)},expand:function(t,e){var n=e.node;setTimeout((function(){!0!==n.data.serverNode?"/"!==n.data.dirPath&&n.isFolder()&&o.fireEvent(c.c.DirectoryExpanded,{serverUrl:o.servers[n.data.serverIndex].url,path:n.data.dirPath}):o.fireEvent(c.c.ServerExpanded,{serverUrl:o.servers[n.data.serverIndex].url})}),300)},dblclick:function(t,e){var n=e.node;o.fireEvent(c.c.TreeNodeDoubleClicked,{serverUrl:o.servers[n.data.serverIndex].url,path:n.data.dirPath,isSlide:!(!0===n.data.serverNode||!0===n.data.rootDir||n.isFolder())})}}),!0===n.preview&&E.call(this,this.fancytree),!0===n.autoDetectPmaStart&&this.addPmaStartServer(),!0===n.search&&p()(this.element).find(".ui-fancytree").addClass("ui-fancytree-search");var g=this,m=null,v=this.fancytree;h&&h.on("input propertychange paste",(function(){var t=p()(this).val();if(t&&t.length>3)clearTimeout(m),m=setTimeout((function(){b.call(g,t)}),500);else{var e=v.getNodeByKey("_searchResults");e&&e.remove()}}))}}return a()(t,[{key:"togglePreview",value:function(t){t&&!this.previewEnabled?E.call(this,p()(this.element)):!t&&this.previewEnabled&&x.call(this,p()(this.element))}},{key:"addServer",value:function(t){if(t){this.servers.push(t);var e={title:this.servers[this.servers.length-1].name,serverNode:!0,key:this.servers[this.servers.length-1].url,serverIndex:this.servers.length-1,extraClasses:"server",dirPath:this.servers[this.servers.length-1].path?this.servers[this.servers.length-1].path:"/",lazy:!0,unselectableStatus:!1,unselectable:!0,selected:!1,checkbox:!1};this.context.getVersionInfo(t.url,_.bind(this,t)),this.fancytree.getRootNode().addChildren(e)}}},{key:"removeServer",value:function(t){var e=this.fancytree.getRootNode().getChildren();e&&e.length&&t>=0&&t<e.length?(e[t].data&&this.servers.splice(e[t].data.serverIndex,1),e[t].remove()):console.error("No children found or index out of range")}},{key:"removePmaStartServer",value:function(){for(var t=this.fancytree.getRootNode().getChildren(),e=0;e<t.length;e++)t[e].key==f&&this.removeServer(t[e].data.serverIndex)}},{key:"addPmaStartServer",value:function(t){for(var e=this,n=this.fancytree.getRootNode().getChildren(),r=0;r<n.length;r++)if(n[r].key==f)return;Object(c.h)({method:c.a.GetVersionInfo,httpMethod:"GET",data:{rnd:Math.random()},serverUrl:f,success:function(){new l.a(e.context,[{serverUrl:f,sessionId:"pma.core.lite"}]);e.addServer({name:s.a.translate("Computer"),url:f}),"function"==typeof t&&t.call(this,!0)},failure:function(){"function"==typeof t&&t.call(this,!1)}})}},{key:"getServers",value:function(){return this.servers}},{key:"getSelectedSlide",value:function(){var t=this.fancytree.getActiveNode();return null===t||!0===t.data.serverNode||!0===t.data.rootDir||t.isFolder()?null:{server:this.servers[t.data.serverIndex].url,path:t.data.dirPath}}},{key:"getSelectedDirectory",value:function(){var t=this.fancytree.getActiveNode();return null===t||!0!==t.data.rootDir&&!t.isFolder()?null:{server:this.servers[t.data.serverIndex].url,path:t.data.dirPath}}},{key:"getMultiSelection",value:function(){var t=this.fancytree.getSelectedNodes(),e=[];if(t&&t.length>0)for(var n=0;n<t.length;n++)null===t[n]||!0===t[n].data.serverNode||!0===t[n].data.rootDir||t[n].isFolder()||e.push({serverUrl:this.servers[t[n].data.serverIndex].url,path:t[n].data.dirPath});return e}},{key:"clearMultiSelection",value:function(){this.fancytree.selectAll(!1)}},{key:"navigateTo",value:function(t){var e=this;if(!e.navigating){e.navigating=!0;var n=this.fancytree,r=w.call(this,t,n);return n.loadKeyPath(r,(function(t,n){"ok"===n&&(t.setActive(),t.scrollIntoView(),e.navigating=!1)})).done((function(){if(e.navigating=!1,e.lastNavigatePathRequest){var t=e.lastNavigatePathRequest;e.lastNavigatePathRequest=null,e.navigateTo(t)}}))}e.lastNavigatePathRequest=t}},{key:"refresh",value:function(t){var e=this.fancytree,n=w.call(this,t,e);return e.loadKeyPath(n,(function(t,e){"ok"===e&&t.resetLazy()}))}},{key:"getSearchResults",value:function(){return this.lastSearchResults}},{key:"clearSearchResults",value:function(){var t=this.fancytree.getNodeByKey("_searchResults");t&&t.remove()}},{key:"search",value:function(t){return this.clearSearchResults(),b.call(this,t)}},{key:"listen",value:function(t,e){this.listeners.hasOwnProperty(t)||console.error(t+" is not a valid event"),this.listeners[t].push(e)}},{key:"fireEvent",value:function(t,e){if(this.listeners.hasOwnProperty(t))for(var n=0,r=this.listeners[t].length;n<r;n++)this.listeners[t][n].call(this,e);else console.error(t+" does not exist")}},{key:"getFilesVisibility",value:function(t){for(var e=this.fancytree.getRootNode().getChildren(),n=0;n<e.length;n++)if(e[n].key==t)for(var r=0;r<this.servers.length;r++)if(this.servers[r].url==e[n].key)return this.servers[r].showFiles}},{key:"setFilesVisibility",value:function(t,e){for(var n=this.fancytree.getRootNode().getChildren(),r=0;r<n.length;r++)if(n[r].key==t){for(var i=0;i<this.servers.length;i++)this.servers[i].url==n[r].key&&(this.servers[i].showFiles=e);n[r].resetLazy()}}},{key:"collapseAll",value:function(){for(var t=this.fancytree.getRootNode().getChildren(),e=0;e<t.length;e++)t[e].resetLazy()}},{key:"signOut",value:function(t){for(var e=this.fancytree.getRootNode().getChildren(),n=0;n<e.length;n++)e[n].key==t&&(e[n].resetLazy(),this.context.deAuthenticate(t))}}]),t}();function y(t,e){var n=new p.a.Deferred;e.result=n.promise();var r=e.node,i="/"===r.data.dirPath?"":r.data.dirPath,o=this,a="/"===r.data.dirPath;this.context.getDirectories(o.servers[r.data.serverIndex].url,i,(function(t,e){o.rootDirSortCb&&""===i&&(e=o.rootDirSortCb(e));for(var l=[],u=0;u<e.length;u++)l.push({title:e[u].split("/").pop(),lazy:!0,serverIndex:r.data.serverIndex,serverUrl:o.servers[r.data.serverIndex].url,dirPath:e[u],key:e[u],folder:!0,rootDir:a,extraClasses:a?"rootdir":"subdir",checkbox:o.checkboxes});!1!==o.servers[r.data.serverIndex].showFiles&&i&&""!==i?o.context.getSlides({serverUrl:o.servers[r.data.serverIndex].url,path:i,success:function(t,e){for(var i=0;i<e.length;i++)l.push({title:e[i].split("/").pop(),lazy:!1,serverIndex:r.data.serverIndex,dirPath:e[i],serverUrl:o.servers[r.data.serverIndex].url,key:e[i],folder:!1,extraClasses:"slide"});n.resolve(l)},failure:function(t){n.reject(t.Message?t.Message:s.a.translate("Error loading files"))}}):n.resolve(l)}),(function(t){n.reject(t.Message?t.Message:s.a.translate("Error loading directories"))}))}function m(t,e,n,r,i){if(this.lastSearchHash===n){this.lastSearchResults[this.servers[e].name]=i;for(var o=t.addChildren({title:this.servers[e].name,serverNode:!0,key:"_searchServer_"+this.servers[e].url,serverIndex:e,dirPath:this.servers[e].path?this.servers[e].path:"/",lazy:!1,unselectableStatus:!1,unselectable:!0,selected:!1,checkbox:!1,resultCount:i.length}),a=p()(this.element).fancytree("getTree"),l=0;l<i.length;l++)for(var u=i[l].split("/"),h="",d=o,f=0;f<u.length;f++){h+=f>0?"/"+u[f]:u[f];var g=a.getNodeByKey("_searchResult_"+h,d);null==g?d=d.addChildren({title:h.split("/").pop(),lazy:!1,serverIndex:e,dirPath:h,key:"_searchResult_"+h,folder:f<u.length-1,rootDir:0==f,extraClasses:0==f?"rootdir":"subdir",checkbox:this.checkboxes,resultCount:1}):(d=g,g.data.resultCount+=1)}t.data.resultCount+=i.length,t.visit((function(e){e==t?e.setTitle(s.a.translate('Search results for "{pattern}" ({count})',{pattern:t.data.pattern,count:e.data.resultCount})):(e.isFolder()||e.data.serverNode)&&e==o&&e.setTitle(e.title+" ("+e.data.resultCount+")")}),!0),t.data.serverDone++,t.data.serverDone>=t.data.serversSearched&&(t.data.searching=!1,t.renderTitle()),t.makeVisible(),t.setExpanded(!0),this.fireEvent(c.c.SearchFinished,this.lastSearchResults)}}function v(t,e,n){this.lastSearchHash===n&&(t.data.serverDone++,t.data.serverDone>=t.data.serversSearched&&(t.data.searching=!1,t.renderTitle()),this.fireEvent(c.c.SearchFailed,this.servers[e]))}function _(t,e){t.version=e}function b(t){this.lastSearchResults={};var e=p()(this.element).fancytree("getTree").getNodeByKey("_searchResults");if(null==e){var n={title:s.a.translate('Search results for "{pattern}"',{pattern:t}),key:"_searchResults",lazy:!1,selected:!1,checkbox:!1,resultCount:0,searching:!0,serverDone:0,serversSearched:0,pattern:t};e=this.fancytree.getRootNode().addChildren(n)}else e.resultCount=0,e.removeChildren(),e.data.searching=!0,e.data.serverDone=0,e.data.serversSearched=0,e.data.pattern=t,e.renderTitle();e.makeVisible(),e.setExpanded(!0);this.lastSearchHash=Math.random();for(var r=0;r<this.servers.length;r++)this.servers[r].version&&"1."!==this.servers[r].version.substring(0,"1.".length)&&(e.data.serversSearched++,this.context.queryFilename(this.servers[r].url,"",t,m.bind(this,e,r,this.lastSearchHash),v.bind(this,e,r,this.lastSearchHash)))}function w(t,e){var n=t.split("/").filter((function(t){return null!=t&&""!=t})),r="";if(n.length>0){for(var i=0;i<this.servers.length;i++)if(this.servers[i].name.toLowerCase()==n[0].toLowerCase()){n[0]=this.servers[i].url,r=this.servers[i].path?this.servers[i].path:"";break}for(r&&(n[1]=r+"/"+n[1]),i=2;i<n.length;i++)n[i]=n[i-1]+"/"+n[i]}return n=n.join(e.options.keyPathSeparator)}function x(t){this.previewEnabled&&(p()(this.element).off("mouseenter","span.fancytree-title"),p()(this.element).off("mouseleave","span.fancytree-title"),p()(this.element).off("mousemove","span.fancytree-title"),p()("#fancytree-preview").remove(),this.previewEnabled=!1)}function E(t){if(!this.previewEnabled){var e=null,n=this;p()(this.element).on("mouseenter","span.fancytree-title",(function(t){var r=p.a.ui.fancytree.getNode(t);if(null!==r&&!0!==r.data.serverNode&&!0!==r.data.rootDir&&!r.isFolder()&&void 0!==r.data.serverIndex){var i=n.servers[r.data.serverIndex].url;e=setTimeout((function(){n.context.getSession(i,(function(e){var n=Object(c.l)(i,e,r.data.dirPath,0,150,0),o=p()("#fancytree-preview");o.length>0&&o.remove(),(o=p()("<p id='fancytree-preview' class='fancytree-preview'><i class='fa fa-spinner fa-spin'></i><img/></p>").appendTo("body")).css("position","absolute").css("top",t.pageY+-30+"px").css("left",t.pageX+100+"px").fadeIn("fast"),o.find("img").bind("load",(function(){o.find("i").remove()})).attr("src",n)}))}),250)}})),p()(this.element).on("mouseleave","span.fancytree-title",(function(t){p()("#fancytree-preview").remove(),e&&(clearTimeout(e),e=null)})),p()(this.element).on("mousemove","span.fancytree-title",(function(t){var e=p()("#fancytree-preview");e.length>0&&e.css("top",t.pageY+-30+"px").css("left",t.pageX+100+"px")})),this.previewEnabled=!0}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var r=n(24),i=n.n(r),o=n(27),a=n.n(o),s=n(44),l=n(3),u=function(){function t(e,n){i()(this,t),Object(s.b)()&&(n instanceof Array?(this.serverCredentials=n,this.context=e,this.context.registerAuthenticationProvider(this)):console.error("Expected array of server credentials"))}return a()(t,[{key:"authenticate",value:function(t,e,n){for(var r=0,i=this.serverCredentials.length;r<i;r++)if(this.serverCredentials[r].serverUrl==t)return Object(l.m)(this.serverCredentials[r].serverUrl,this.serverCredentials[r].username,this.serverCredentials[r].password,this.context.getCaller(),e,n),!0;return!1}}]),t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return y}));var r=n(24),i=n.n(r),o=n(27),a=n.n(o),s=n(87),l=n.n(s),u=n(44),c=n(136),h=n(3);function p(t,e,n,r){if(this.lastLoadImageRequest&&(this.lastLoadImageRequest.serverUrl!==t||this.lastLoadImageRequest.path!==e||this.lastLoadImageRequest.doneCb!==n)){var i=this.lastLoadImageRequest;this.lastLoadImageRequest=null,this.load(i.serverUrl,i.path,i.doneCb,i.dropped)}}function d(t){t.preventDefault();var e=t.dataTransfer.types;if(e){var n=!1;if(e.indexOf?n=e.indexOf("application/x-fancytree-node")>-1||e.indexOf(h.b)>-1:e.contains&&(n=e.contains("application/x-fancytree-node")||e.contains(h.b)),n)return void(t.dataTransfer.dropEffect="link")}t.dataTransfer.dropEffect="none"}function f(t){t.preventDefault();var e=Object(h.n)(t.dataTransfer);e&&!e.isFolder&&e.path&&e.serverUrl&&(0==this.fireEvent(h.c.BeforeDrop,{serverUrl:e.serverUrl,path:e.path,node:e}).filter((function(t){return 0==t})).length&&this.load(e.serverUrl,e.path,null,!0))}function g(){this.element&&(this.element.addEventListener("drop",f.bind(this),!1),this.element.addEventListener("dragover",d.bind(this),!1))}var y=function(){function t(e,n){if(i()(this,t),Object(u.b)()){if(this.loadingImage=!1,this.lastLoadImageRequest=null,this.context=e,this.slideLoaderOptions=n||{},this.listeners={},this.listeners[h.c.SlideInfoError]=[],this.listeners[h.c.BeforeSlideLoad]=[],this.listeners[h.c.SlideLoaded]=[],this.listeners[h.c.BeforeDrop]=[],this.mainViewport=null,this.slideLoaderOptions.element)if(this.slideLoaderOptions.element instanceof HTMLElement)this.element=this.slideLoaderOptions.element;else if("string"==typeof this.slideLoaderOptions.element){var r=document.querySelector(this.slideLoaderOptions.element);if(!r)throw"Invalid selector for element";this.element=r}g.call(this)}}return a()(t,[{key:"setOption",value:function(t,e){this.slideLoaderOptions[t]=e}},{key:"getOption",value:function(t){return this.slideLoaderOptions[t]}},{key:"load",value:function(t,e,n,r){if(!0!==this.loadingImage){if(!0!==r&&(r=!1),this.loadingImage=!0,this.mainViewport&&this.mainViewport.map){for(;this.mainViewport.map.getInteractions().getLength()>0;)this.mainViewport.map.removeInteraction(this.mainViewport.map.getInteractions().item(0));for(;this.mainViewport.map.getLayers().getLength()>0;)this.mainViewport.map.removeLayer(this.mainViewport.map.getLayers().item(0));for(;this.mainViewport.map.getControls().getLength()>0;)this.mainViewport.map.removeControl(this.mainViewport.map.getControls().item(0))}var i={serverUrl:t,path:e,cancel:!1};if(this.fireEvent(h.c.BeforeSlideLoad,i),i.cancel)this.loadingImage=!1;else{var o=this;if(!t||!e)return this.mainViewport&&(this.mainViewport.element.innerHTML="",this.mainViewport=null),this.loadingImage=!1,this.fireEvent(h.c.SlideLoaded,{serverUrl:t,path:e,dropped:r}),"function"==typeof n&&n(),void p.call(o,t,e,n,r);this.context.getSession(t,(function(i){var a=function(t){if(null===t||"object"!=l()(t))return t;var e=t.constructor();for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}(o.slideLoaderOptions);a.serverUrls=[t],a.image=e,a.sessionID=i,a.caller=o.context.getCaller(),o.mainViewport=new c.a(a,(function(){o.loadingImage=!1,o.fireEvent(h.c.SlideLoaded,{serverUrl:t,path:e,dropped:r}),"function"==typeof n&&n(),p.call(o,t,e,n,r)}),(function(){o.loadingImage=!1,console.error("Error loading slide")}));var s=0;o.mainViewport.listen("tileserror",(function(){0===s?(s++,h.f.set(t,null),o.context.getSession(t,(function(t){s=-1,o.mainViewport.sessionID=t,o.mainViewport.redraw()}),(function(){o.fireEvent(h.c.SlideInfoError,{})}))):-1===s&&(s=0,o.fireEvent(h.c.SlideInfoError,{}))})),o.mainViewport.listen("SlideLoadError",(function(){o.loadingImage=!1,o.fireEvent(h.c.SlideInfoError,{}),p.call(o,t,e,n,r)}))}),(function(){o.loadingImage=!1,o.fireEvent(h.c.SlideInfoError,{}),p.call(o,t,e,n,r)}))}}else this.lastLoadImageRequest={serverUrl:t,path:e,doneCb:n,dropped:!0===r}}},{key:"getLoadedImageInfo",value:function(){return this.mainViewport&&this.mainViewport.map&&this.mainViewport.imageInfo?this.mainViewport.imageInfo:null}},{key:"reloadAnnotations",value:function(t){this.mainViewport&&this.mainViewport.map&&this.mainViewport.imageInfo?this.mainViewport.reloadAnnotations(t):"function"==typeof t&&t.call(this)}},{key:"listen",value:function(t,e){this.listeners.hasOwnProperty(t)||console.error(t+" is not a valid event"),this.listeners[t].push(e)}},{key:"fireEvent",value:function(t,e){if(this.listeners.hasOwnProperty(t)){for(var n=[],r=0,i=this.listeners[t].length;r<i;r++)n.push(this.listeners[t][r].call(this,e));return n}console.error(t+" does not exist")}}]),t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return ne}));var r=n(24),i=n.n(r),o=n(27),a=n.n(o),s=n(231),l=n(148),u=n(185),c=n(227),h=n(230),p=n(229),d=n(228),f=n(135),g=n(46),y=n(59),m=n(61),v=n(134),_=n(122),b=n(41),w=n(126),x=n(169),E=n(22),S=n(69),O=n(20),C=n(44),T=n(136),I=n(11),L=n(5),P=n(3),R=n(12),M=n.n(R),N=n(243),j=(n(18),n(159)),A=n(142),k=n(107),F=n(115),D=n(60);var G=function(t,e){if(e=e||{},!Object(D.c)(e))throw new Error("options is invalid");var n=e.precision,r=e.coordinates,i=e.mutate;if(n=null==n||isNaN(n)?6:n,r=null==r||isNaN(r)?3:r,!t)throw new Error("<geojson> is required");if("number"!=typeof n)throw new Error("<precision> must be a number");if("number"!=typeof r)throw new Error("<coordinates> must be a number");!1!==i&&void 0!==i||(t=JSON.parse(JSON.stringify(t)));var o=Math.pow(10,n);return Object(F.a)(t,(function(t){!function(t,e,n){t.length>n&&t.splice(n,t.length);for(var r=0;r<t.length;r++)t[r]=Math.round(t[r]*e)/e}(t,o,r)})),t},z=n(56),U=n(179);var B=function(t,e){var n=Object(z.c)(t),r=Object(z.c)(e);if(Object(U.a)(G(r,{precision:4})).coordinates[0].length<4)return null;if(Object(U.a)(G(n,{precision:4})).coordinates[0].length<4)return null;var i=new k.GeoJSONReader,o=i.read(G(n)),a=i.read(G(r)),s=k.OverlayOp.intersection(o,a);if(s.isEmpty())return null;var l=(new k.GeoJSONWriter).write(s);return Object(D.a)(l)},V=n(66),q=n(65),Y=n(31),X=n(26),W=n(37),H=n(38),K=n(0),Z=function(t){t||(t={});var e=this;this.selection_=new W.a,this.handles_=new W.a,this.overlayLayer_=new q.a({source:new V.a({features:this.handles_,useSpatialIndex:!1,wrapX:!1}),name:"Transform overlay",displayInLayerSwitcher:!1,style:function(t){return e.style[(t.get("handle")||"default")+(t.get("constraint")||"")+(t.get("option")||"")]}}),H.b.call(this,{handleDownEvent:this.handleDownEvent_,handleDragEvent:this.handleDragEvent_,handleMoveEvent:this.handleMoveEvent_,handleUpEvent:this.handleUpEvent_}),this.features_=t.features,"function"==typeof t.filter&&(this._filter=t.filter),this.layers_=t.layers?t.layers instanceof Array?t.layers:[t.layers]:null,this._handleEvent=t.condition||function(){return!0},this.addFn_=t.addCondition||function(){return!1},this.set("translateFeature",!1!==t.translateFeature),this.set("translate",!1!==t.translate),this.set("translateBBox",!0===t.translateBBox),this.set("stretch",!1!==t.stretch),this.set("scale",!1!==t.scale),this.set("rotate",!1!==t.rotate),this.set("keepAspectRatio",t.keepAspectRatio||function(t){return t.originalEvent.shiftKey}),this.set("modifyCenter",t.modifyCenter||function(t){return t.originalEvent.metaKey||t.originalEvent.ctrlKey}),this.set("noFlip",t.noFlip||!1),this.set("selection",!1!==t.selection),this.set("hitTolerance",t.hitTolerance||0),this.set("enableRotatedTransform",t.enableRotatedTransform||!1),this.on("propertychange",(function(){this.drawSketch_()})),this.setDefaultStyle()};(Z.prototype=Object.create(H.b.prototype)).constructor=Z,Z.prototype.Cursors={default:"auto",select:"pointer",translate:"move",rotate:"move",rotate0:"move",scale:"nesw-resize",scale1:"nwse-resize",scale2:"nesw-resize",scale3:"nwse-resize",scalev:"ew-resize",scaleh1:"ns-resize",scalev2:"ew-resize",scaleh3:"ns-resize"},Z.prototype.setMap=function(t){var e=this.getMap();if(e){var n=e.getTargetElement();e.removeLayer(this.overlayLayer_),this.previousCursor_&&n&&(n.style.cursor=this.previousCursor_),this.previousCursor_=void 0}H.b.prototype.setMap.call(this,t),this.overlayLayer_.setMap(t),null===t&&this.select(null),null!==t&&(this.isTouch=/touch/.test(t.getViewport().className),this.setDefaultStyle())},Z.prototype.setActive=function(t){this.select(null),this.overlayLayer_.setVisible(t),H.b.prototype.setActive.call(this,t)},Z.prototype.setDefaultStyle=function(){var t=new m.a({color:[255,0,0,1],width:1}),e=new m.a({color:[255,0,0,1],width:1,lineDash:[4,4]}),n=new y.a({color:[255,0,0,.01]}),r=new y.a({color:[255,255,255,.8]}),i=new w.a({fill:r,stroke:t,radius:this.isTouch?12:6,points:15});i.getAnchor()[0]=this.isTouch?-10:-5;var o=new w.a({fill:r,stroke:t,radius:this.isTouch?16:8,points:4,angle:Math.PI/4}),a=new w.a({fill:r,stroke:t,radius:this.isTouch?12:6,points:4,angle:Math.PI/4});function s(t,e,n){return[new b.c({image:t,stroke:e,fill:n})]}this.style={default:s(o,e,n),translate:s(o,t,r),rotate:s(i,t,r),rotate0:s(o,t,r),scale:s(o,t,r),scale1:s(o,t,r),scale2:s(o,t,r),scale3:s(o,t,r),scalev:s(a,t,r),scaleh1:s(a,t,r),scalev2:s(a,t,r),scaleh3:s(a,t,r)},this.drawSketch_()},Z.prototype.setStyle=function(t,e){if(e){this.style[t]=e instanceof Array?e:[e];for(var n=0;n<this.style[t].length;n++){var r=this.style[t][n].getImage();r&&("rotate"==t&&(r.getAnchor()[0]=-5),this.isTouch&&r.setScale(1.8));var i=this.style[t][n].getText();i&&("rotate"==t&&i.setOffsetX(this.isTouch?14:7),this.isTouch&&i.setScale(1.8))}this.drawSketch_()}},Z.prototype.getFeatureAtPixel_=function(t){var e=this;return this.getMap().forEachFeatureAtPixel(t,(function(t,n){var r=!1;if(!n){if(t===e.bbox_)return!!e.get("translateBBox")&&{feature:t,handle:"translate",constraint:"",option:""};if(e.handles_.forEach((function(e){e===t&&(r=!0)})),r)return{feature:t,handle:t.get("handle"),constraint:t.get("constraint"),option:t.get("option")}}if(!e.get("selection"))return e.selection_.getArray().some((function(e){return t===e}))?{feature:t}:null;if(e._filter)return e._filter(t,n)?{feature:t}:null;if(e.layers_){for(var i=0;i<e.layers_.length;i++)if(e.layers_[i]===n)return{feature:t};return null}return e.features_?(e.features_.forEach((function(e){e===t&&(r=!0)})),r?{feature:t}:null):{feature:t}}),{hitTolerance:this.get("hitTolerance")})||{}},Z.prototype.getGeometryRotateToZero_=function(t,e){var n=t.getGeometry(),r=this.getMap().getView().getRotation();if(0===r||!this.get("enableRotatedTransform"))return e?n.clone():n;var i=n.clone();return i.rotate(-1*r,this.getMap().getView().getCenter()),i},Z.prototype.drawSketch_=function(t){var e,n,r;if(this.overlayLayer_.getSource().clear(),this.selection_.getLength()){var i=this.getMap().getView().getRotation(),o=this.getGeometryRotateToZero_(this.selection_.item(0)).getExtent();if(o=Object(K.buffer)(o,0),this.selection_.forEach(function(t){var e=this.getGeometryRotateToZero_(t).getExtent();Object(K.extend)(o,e)}.bind(this)),!0===t)this.ispt_||(this.overlayLayer_.getSource().addFeature(new X.a({geometry:new Y.a(this.center_),handle:"rotate0"})),r=Object(E.c)(o),this.get("enableRotatedTransform")&&0!==i&&r.rotate(i,this.getMap().getView().getCenter()),n=this.bbox_=new X.a(r),this.overlayLayer_.getSource().addFeature(n));else{if(this.ispt_){var a=this.getMap().getPixelFromCoordinate([o[0],o[1]]);o=Object(K.boundingExtent)([this.getMap().getCoordinateFromPixel([a[0]-10,a[1]-10]),this.getMap().getCoordinateFromPixel([a[0]+10,a[1]+10])])}r=Object(E.c)(o),this.get("enableRotatedTransform")&&0!==i&&r.rotate(i,this.getMap().getView().getCenter()),n=this.bbox_=new X.a(r);var s=[],l=r.getCoordinates()[0];if(!this.ispt_){if(s.push(n),!this.iscircle_&&this.get("stretch")&&this.get("scale"))for(e=0;e<l.length-1;e++)n=new X.a({geometry:new Y.a([(l[e][0]+l[e+1][0])/2,(l[e][1]+l[e+1][1])/2]),handle:"scale",constraint:e%2?"h":"v",option:e}),s.push(n);if(this.get("scale"))for(e=0;e<l.length-1;e++)n=new X.a({geometry:new Y.a(l[e]),handle:"scale",option:e}),s.push(n);this.get("translate")&&!this.get("translateFeature")&&(n=new X.a({geometry:new Y.a([(l[0][0]+l[2][0])/2,(l[0][1]+l[2][1])/2]),handle:"translate"}),s.push(n))}!this.iscircle_&&this.get("rotate")&&(n=new X.a({geometry:new Y.a(l[3]),handle:"rotate"}),s.push(n)),this.overlayLayer_.getSource().addFeatures(s)}}},Z.prototype.select=function(t,e){if(!t)return this.selection_.clear(),void this.drawSketch_();if(t.getGeometry&&t.getGeometry()){if(e)this.selection_.push(t);else{var n=this.selection_.getArray().indexOf(t);this.selection_.removeAt(n)}this.ispt_=1===this.selection_.getLength()&&"Point"==this.selection_.item(0).getGeometry().getType(),this.iscircle_=1===this.selection_.getLength()&&"Circle"==this.selection_.item(0).getGeometry().getType(),this.drawSketch_(),this.watchFeatures_(),this.dispatchEvent({type:"select",feature:t,features:this.selection_})}},Z.prototype.setSelection=function(t){this.selection_.clear(),t.forEach(function(t){this.selection_.push(t)}.bind(this)),this.ispt_=1===this.selection_.getLength()&&"Point"==this.selection_.item(0).getGeometry().getType(),this.iscircle_=1===this.selection_.getLength()&&"Circle"==this.selection_.item(0).getGeometry().getType(),this.drawSketch_(),this.watchFeatures_(),this.dispatchEvent({type:"select",features:this.selection_})},Z.prototype.watchFeatures_=function(){this._featureListeners&&this._featureListeners.forEach((function(t){Object(g.b)(t)})),this._featureListeners=[],this.selection_.forEach(function(t){this._featureListeners.push(t.on("change",function(){this.isUpdating_||this.drawSketch_()}.bind(this)))}.bind(this))},Z.prototype.handleDownEvent_=function(t){if(this._handleEvent(t,this.selection_)){var e=this.getFeatureAtPixel_(t.pixel),n=e.feature;if(this.selection_.getLength()&&this.selection_.getArray().indexOf(n)>=0&&(this.ispt_&&this.get("translate")||this.get("translateFeature"))&&(e.handle="translate"),e.handle){this.mode_=e.handle,this.opt_=e.option,this.constraint_=e.constraint;var r=this.getMap().getView().getRotation();this.coordinate_=t.coordinate,this.pixel_=t.pixel,this.geoms_=[],this.rotatedGeoms_=[];for(var i,o=Object(K.createEmpty)(),a=Object(K.createEmpty)(),s=0;i=this.selection_.item(s);s++)if(this.geoms_.push(i.getGeometry().clone()),o=Object(K.extend)(o,i.getGeometry().getExtent()),this.get("enableRotatedTransform")&&0!==r){var l=this.getGeometryRotateToZero_(i,!0);this.rotatedGeoms_.push(l),a=Object(K.extend)(a,l.getExtent())}if(this.extent_=Object(E.c)(o).getCoordinates()[0],this.get("enableRotatedTransform")&&0!==r&&(this.rotatedExtent_=Object(E.c)(a).getCoordinates()[0]),"rotate"===this.mode_){this.center_=this.getCenter()||Object(K.getCenter)(o);var u=t.map.getTargetElement();u.style.cursor=this.Cursors.rotate0,this.previousCursor_=u.style.cursor}else this.center_=Object(K.getCenter)(o);return this.angle_=Math.atan2(this.center_[1]-t.coordinate[1],this.center_[0]-t.coordinate[0]),this.dispatchEvent({type:this.mode_+"start",feature:this.selection_.item(0),features:this.selection_,pixel:t.pixel,coordinate:t.coordinate}),!0}if(this.get("selection")){if(n){this.addFn_(t)||this.selection_.clear();var c=this.selection_.getArray().indexOf(n);c<0?this.selection_.push(n):this.selection_.removeAt(c)}else this.selection_.clear();return this.ispt_=1===this.selection_.getLength()&&"Point"==this.selection_.item(0).getGeometry().getType(),this.iscircle_=1===this.selection_.getLength()&&"Circle"==this.selection_.item(0).getGeometry().getType(),this.drawSketch_(),this.watchFeatures_(),this.dispatchEvent({type:"select",feature:n,features:this.selection_,pixel:t.pixel,coordinate:t.coordinate}),!1}}},Z.prototype.getFeatures=function(){return this.selection_},Z.prototype.getCenter=function(){return this.get("center")},Z.prototype.setCenter=function(t){return this.set("center",t)},Z.prototype.handleDragEvent_=function(t){if(this._handleEvent(t,this.features_)){var e,n,r,i=this.getMap().getView().getRotation(),o=[this.coordinate_[0],this.coordinate_[1]],a=[t.coordinate[0],t.coordinate[1]];switch(this.isUpdating_=!0,this.mode_){case"rotate":var s=Math.atan2(this.center_[1]-a[1],this.center_[0]-a[0]);if(!this.ispt)for(e=0;n=this.selection_.item(e);e++)(r=this.geoms_[e].clone()).rotate(s-this.angle_,this.center_),"Circle"==r.getType()&&r.setCenterAndRadius(r.getCenter(),r.getRadius()),n.setGeometry(r);this.drawSketch_(!0),this.dispatchEvent({type:"rotating",feature:this.selection_.item(0),features:this.selection_,angle:s-this.angle_,pixel:t.pixel,coordinate:t.coordinate});break;case"translate":var l=a[0]-o[0],u=a[1]-o[1];for(e=0;n=this.selection_.item(e);e++)n.getGeometry().translate(l,u);this.handles_.forEach((function(t){t.getGeometry().translate(l,u)})),this.coordinate_=t.coordinate,this.dispatchEvent({type:"translating",feature:this.selection_.item(0),features:this.selection_,delta:[l,u],pixel:t.pixel,coordinate:t.coordinate});break;case"scale":var c=this.center_;if(this.get("modifyCenter")(t)){var h=this.extent_;this.get("enableRotatedTransform")&&0!==i&&(h=this.rotatedExtent_),c=h[(Number(this.opt_)+2)%4]}var p=this.coordinate_,d=t.coordinate;if(this.get("enableRotatedTransform")&&0!==i){var f=new Y.a(this.coordinate_);f.rotate(-1*i,c),p=f.getCoordinates();var g=new Y.a(t.coordinate);g.rotate(-1*i,c),d=g.getCoordinates()}var y=(d[0]-c[0])/(p[0]-c[0]),m=(d[1]-c[1])/(p[1]-c[1]);if(this.get("enableRotatedTransform")&&0!==i){var v=new Y.a(c);v.rotate(-1*i,this.getMap().getView().getCenter()),c=v.getCoordinates()}for(this.get("noFlip")&&(y<0&&(y=-y),m<0&&(m=-m)),this.constraint_?"h"==this.constraint_?y=1:m=1:this.get("keepAspectRatio")(t)&&(y=m=Math.min(y,m)),e=0;n=this.selection_.item(e);e++)(r=0!==i&&this.get("enableRotatedTransform")?this.rotatedGeoms_[e].clone():this.geoms_[e].clone()).applyTransform((function(t,e,n){if(n<2)return e;for(var i=0;i<t.length;i+=n)1!=y&&(e[i]=c[0]+(t[i]-c[0])*y),1!=m&&(e[i+1]=c[1]+(t[i+1]-c[1])*m);return"Circle"==r.getType()&&r.setCenterAndRadius(r.getCenter(),r.getRadius()),e})),this.get("enableRotatedTransform")&&0!==i&&r.rotate(i,this.getMap().getView().getCenter()),n.setGeometry(r);this.drawSketch_(),this.dispatchEvent({type:"scaling",feature:this.selection_.item(0),features:this.selection_,scale:[y,m],pixel:t.pixel,coordinate:t.coordinate})}this.isUpdating_=!1}},Z.prototype.handleMoveEvent_=function(t){if(this._handleEvent(t,this.features_)&&!this.mode_){var e=this.getFeatureAtPixel_(t.pixel),n=t.map.getTargetElement();if(e.feature){var r=e.handle?this.Cursors[(e.handle||"default")+(e.constraint||"")+(e.option||"")]:this.Cursors.select;void 0===this.previousCursor_&&(this.previousCursor_=n.style.cursor),n.style.cursor=r}else void 0!==this.previousCursor_&&(n.style.cursor=this.previousCursor_),this.previousCursor_=void 0}},Z.prototype.handleUpEvent_=function(t){"rotate"===this.mode_&&(t.map.getTargetElement().style.cursor=this.Cursors.default,this.previousCursor_=void 0);return this.dispatchEvent({type:this.mode_+"end",feature:this.selection_.item(0),features:this.selection_,oldgeom:this.geoms_[0],oldgeoms:this.geoms_}),this.drawSketch_(),this.mode_=null,!1},Z.prototype.getFeatures=function(){return this.selection_};var J=Z,Q=n(186);function tt(t,e,n){var r=!1;e[0][0]===e[e.length-1][0]&&e[0][1]===e[e.length-1][1]&&(e=e.slice(0,e.length-1));for(var i=0,o=e.length-1;i<e.length;o=i++){var a=e[i][0],s=e[i][1],l=e[o][0],u=e[o][1];if(t[1]*(a-l)+s*(l-t[0])+u*(t[0]-a)==0&&(a-t[0])*(l-t[0])<=0&&(s-t[1])*(u-t[1])<=0)return!n;s>t[1]!=u>t[1]&&t[0]<(l-a)*(t[1]-s)/(u-s)+a&&(r=!r)}return r}var et=function(t,e,n){if("object"!=typeof(n=n||{}))throw new Error("options is invalid");var r=n.ignoreBoundary;if(!t)throw new Error("point is required");if(!e)throw new Error("polygon is required");var i=Object(z.a)(t),o=Object(z.b)(e),a=e.geometry?e.geometry.type:e.type,s=e.bbox;if(s&&!1===function(t,e){return e[0]<=t[0]&&e[1]<=t[1]&&e[2]>=t[0]&&e[3]>=t[1]}(i,s))return!1;"Polygon"===a&&(o=[o]);for(var l=0,u=!1;l<o.length&&!u;l++)if(tt(i,o[l][0],r)){for(var c=!1,h=1;h<o[l].length&&!c;)tt(i,o[l][h],!r)&&(c=!0),h++;c||(u=!0)}return u};var nt=function(t){var e=[1/0,1/0,-1/0,-1/0];return Object(F.a)(t,(function(t){e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]<t[0]&&(e[2]=t[0]),e[3]<t[1]&&(e[3]=t[1])})),e};function rt(t,e,n,r){var i=n[0],o=n[1],a=t[0],s=t[1],l=e[0],u=e[1],c=l-a,h=u-s;return 0==(n[0]-a)*h-(n[1]-s)*c&&(r?"start"===r?Math.abs(c)>=Math.abs(h)?c>0?a<i&&i<=l:l<=i&&i<a:h>0?s<o&&o<=u:u<=o&&o<s:"end"===r?Math.abs(c)>=Math.abs(h)?c>0?a<=i&&i<l:l<i&&i<=a:h>0?s<=o&&o<u:u<o&&o<=s:"both"===r?Math.abs(c)>=Math.abs(h)?c>0?a<i&&i<l:l<i&&i<a:h>0?s<o&&o<u:u<o&&o<s:void 0:Math.abs(c)>=Math.abs(h)?c>0?a<=i&&i<=l:l<=i&&i<=a:h>0?s<=o&&o<=u:u<=o&&o<=s)}var it=function(t,e,n){var r=(n=n||{}).ignoreEndVertices;if(!Object(D.c)(n))throw new Error("invalid options");if(!t)throw new Error("pt is required");if(!e)throw new Error("line is required");for(var i=Object(z.a)(t),o=Object(z.b)(e),a=0;a<o.length-1;a++){var s=!1;if(r&&(0===a&&(s="start"),a===o.length-2&&(s="end"),0===a&&a+1===o.length-1&&(s="both")),rt(o[a],o[a+1],i,s))return!0}return!1};function ot(t,e){return!(t[0]>e[0])&&(!(t[2]<e[2])&&(!(t[1]>e[1])&&!(t[3]<e[3])))}function at(t,e){return t[0]===e[0]&&t[1]===e[1]}var st=function(t,e){var n=Object(z.d)(t),r=Object(z.d)(e),i=Object(z.c)(t),o=Object(z.c)(e),a=Object(z.b)(t),s=Object(z.b)(e);switch(n){case"Point":switch(r){case"Point":return at(a,s);default:throw new Error("feature2 "+r+" geometry not supported")}case"MultiPoint":switch(r){case"Point":return function(t,e){var n,r=!1;for(n=0;n<t.coordinates.length;n++)if(at(t.coordinates[n],e.coordinates)){r=!0;break}return r}(i,o);case"MultiPoint":return function(t,e){for(var n=0;n<e.coordinates.length;n++){for(var r=!1,i=0;i<t.coordinates.length;i++)if(at(e.coordinates[n],t.coordinates[i])){r=!0;break}if(!r)return!1}return!0}(i,o);default:throw new Error("feature2 "+r+" geometry not supported")}case"LineString":switch(r){case"Point":return it(o,i,{ignoreEndVertices:!0});case"LineString":return function(t,e){for(var n=!1,r=0;r<e.coordinates.length;r++)if(it({type:"Point",coordinates:e.coordinates[r]},t,{ignoreEndVertices:!0})&&(n=!0),!it({type:"Point",coordinates:e.coordinates[r]},t,{ignoreEndVertices:!1}))return!1;return n}(i,o);case"MultiPoint":return function(t,e){for(var n=!1,r=0;r<e.coordinates.length;r++)if(it(e.coordinates[r],t,{ignoreEndVertices:!0})&&(n=!0),!it(e.coordinates[r],t))return!1;if(n)return!0;return!1}(i,o);default:throw new Error("feature2 "+r+" geometry not supported")}case"Polygon":switch(r){case"Point":return et(o,i,{ignoreBoundary:!0});case"LineString":return function(t,e){var n=!1,r=0,i=nt(t),o=nt(e);if(!ot(i,o))return!1;for(;r<e.coordinates.length-1;r++){var a=(s=e.coordinates[r],l=e.coordinates[r+1],[(s[0]+l[0])/2,(s[1]+l[1])/2]);if(et({type:"Point",coordinates:a},t,{ignoreBoundary:!0})){n=!0;break}}var s,l;return n}(i,o);case"Polygon":return function(t,e){var n=nt(t),r=nt(e);if(!ot(n,r))return!1;for(var i=0;i<e.coordinates[0].length;i++)if(!et(e.coordinates[0][i],t))return!1;return!0}(i,o);case"MultiPoint":return function(t,e){for(var n=0;n<e.coordinates.length;n++)if(!et(e.coordinates[n],t,{ignoreBoundary:!0}))return!1;return!0}(i,o);default:throw new Error("feature2 "+r+" geometry not supported")}default:throw new Error("feature1 "+n+" geometry not supported")}},lt=function(t){t||(t={});this.pointer_=null,this.map_=t.map||function(){return!1},this.sel_=t.feature||null,this.feature_=null,this.layer_=t.layer||function(){return!1},this.idToDelete_=null,this.translate_=null,H.b.call(this,{handleDownEvent:this.handleDownEvent_,handleDragEvent:this.handleDragEvent_,handleMoveEvent:this.handleMoveEvent_,handleUpEvent:this.handleUpEvent_}),this.set("brushSize",t.brushSize||500),this.set("brushType",t.brushType||ut.CIRCLE),this.set("brushMode",t.brushMode||ct.BRUSH),this.on("propertychange",(function(){}))};(lt.prototype=Object.create(H.b.prototype)).constructor=lt;var ut={CIRCLE:"circle",SQUARE:"square"},ct={BRUSH:"brush",ERASER:"eraser"};lt.prototype.setActive=function(t){H.b.prototype.setActive.call(this,t)},lt.prototype.setBrushSize=function(t){null==t||null==t||t<=0||this.get("brushSize")!=t&&(this.set("brushSize",t),this.setPointer_())},lt.prototype.getBrushSize=function(){return this.get("brushSize")},lt.prototype.setBrushType=function(t){null!=t&&null!=t&&this.get("brushType")!=t&&(this.set("brushType",t),this.setPointer_())},lt.prototype.getBrushType=function(){return ut[this.get("brushType")]},lt.prototype.setBrushMode=function(t){null!=t&&null!=t&&this.get("brushMode")!=t&&(this.set("brushMode",t),this.setPointer_())},lt.prototype.getBrushMode=function(){return this.get("brushMode")},lt.prototype.setPointer_=function(){null!=this.format_&&null!=this.format_||(this.format_=new l.a),null!=this.formatOptions_&&null!=this.formatOptions_||(this.formatOptions_={featureProjection:this.map_.getView().getProjection()});var t=null;if(this.get("brushType")==ut.CIRCLE&&(t=Object(E.b)(new x.a([0,0],this.get("brushSize")))),this.get("brushType")==ut.SQUARE){var e=this.get("brushSize");t=new E.a([[[-1*e,e],[e,e],[e,-1*e],[-1*e,-1*e],[-1*e,e]]])}var n=new X.a({geometry:t});n.color="#000",n.fillColor="#00000099",n.penSize=1,null!=this.pointer_&&(this.layer_.getSource().removeFeature(this.pointer_),this.map_.removeInteraction(this.translate_)),this.pointer_=n,$(this.map_.getTarget()).find("canvas").css("cursor","none"),this.translate_=new Q.a({features:new W.a([this.pointer_])}),this.layer_.getSource().addFeature(this.pointer_),this.map_.addInteraction(this.translate_)},lt.prototype.handleDownEvent_=function(t){this.get("brushMode")==ct.BRUSH&&this.dispatchEvent("drawingstart"),this.get("brushMode")==ct.ERASER&&this.dispatchEvent("erasingstart")},lt.prototype.handleDragEvent_=function(t){var e=this;t.preventDefault();var n=null;if(this.sel_)n=this.sel_;else try{n=this.getFeatureAtPixel_(t.pixel).feature}catch(t){return}if(null!=n&&null!=n){var r=this.format_,i=this.formatOptions_,o=this.pointer_,a=n.metaData.Notes?n.metaData.Notes:"",s=n.metaData.Color?n.metaData.Color:n.color,l=n.metaData.FillColor?n.metaData.FillColor:n.fillColor,u=n.metaData.LineThickness?n.metaData.LineThickness:n.penSize,c=n.icon;if(this.get("brushMode")!=ct.BRUSH||"Polygon"===n.getGeometry().getType()||"MultiPolygon"===n.getGeometry().getType())if(this.get("brushMode")!=ct.ERASER||"Polygon"===n.getGeometry().getType()){var h=r.writeFeatureObject(n,i),p=r.writeFeatureObject(o,i);if(B(h,p)){var d=null;if(this.get("brushMode")==ct.BRUSH&&(d=this.unify_(h,p)),this.get("brushMode")==ct.ERASER){if(st(p,h))return this.idToDelete_=h.id,this.feature_=null,void this.dispatchEvent("erasing");d=this.differentiate_(h,p)}if(null!=d)if("MultiPolygon"===d.geometry.type)d.geometry.coordinates.forEach((function(t){var n={type:"Polygon",coordinates:t},o=r.readFeature(n,i);o.color=s,o.fillColor=l,o.penSize=u,o.icon=c,o.notes=a||"",e.idToDelete_=h.id,e.feature_=o,e.get("brushMode")==ct.BRUSH&&e.dispatchEvent("drawing"),e.get("brushMode")==ct.ERASER&&e.dispatchEvent("erasing"),e.sel_&&e.stopEditing()}));else{var f=r.readFeature(d,i);n.setGeometry(f.getGeometry()),n.changed(),this.idToDelete_=null,this.feature_=n,this.get("brushMode")==ct.BRUSH&&this.dispatchEvent("drawing"),this.get("brushMode")==ct.ERASER&&this.dispatchEvent("erasing")}}}else console.error("Feature contains non-polygon geometry");else console.error("Feature contains non-polygon geometry")}},lt.prototype.handleMoveEvent_=function(t){null==this.map_&&(this.map_=t.map),null==this.pointer_&&this.setPointer_(),t.dragging&&this.handleDragEvent_(t);var e=this.pointer_.getGeometry().getExtent(),n=K.getCenter(e);this.pointer_.getGeometry().translate(t.coordinate[0]-n[0],t.coordinate[1]-n[1])},lt.prototype.handleUpEvent_=function(t){this.get("brushMode")==ct.BRUSH&&this.dispatchEvent("drawingend"),this.get("brushMode")==ct.ERASER&&this.dispatchEvent("erasingend")},lt.prototype.unify_=function(t,e){var n=Object(j.a)(t,e);if("FeatureCollection"===n.type)throw"Feature collection detected";return"MultiPolygon"===n.geometry.type?null:n},lt.prototype.differentiate_=function(t,e){var n=Object(A.a)(t,e);if(!n)return null;if("FeatureCollection"===n.type)throw"Feature collection detected";return n},lt.prototype.getFeatureAtPixel_=function(t){var e=this,n=this.get("brushSize"),r=new E.a([[[-1*n,n],[n,n],[n,-1*n],[-1*n,-1*n],[-1*n,n]]]).getCoordinates(),i=this.map_.getPixelFromCoordinate(r[0][0]),o=(this.map_.getPixelFromCoordinate(r[0][1])[0]-i[0])/2;return this.map_.forEachFeatureAtPixel(t,(function(t,n){return e.layer_===n&&t!==e.pointer_?{feature:t}:null}),{hitTolerance:o})||null},lt.prototype.getFeature=function(){return this.feature_},lt.prototype.getId=function(){return this.idToDelete_},lt.prototype.stopEditing=function(){$(this.map_.getTarget()).find("canvas").css("cursor",""),this.layer_.getSource().removeFeature(this.pointer_),this.map_.removeInteraction(this.translate_),this.map_.removeInteraction(this),H.b.prototype.setActive.call(this,!1)};var ht=lt,pt=n(83),dt=n.n(pt),ft=n(51),gt=n.n(ft),yt=n(53),mt=n.n(yt),vt=n(28),_t=n.n(vt),bt=n(54),wt=n(130),xt=n.n(wt);function Et(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=_t()(t);if(e){var i=_t()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return mt()(this,n)}}var St=function(t){gt()(n,t);var e=Et(n);function n(t){var r;return i()(this,n),(r=e.call(this)).map=t.map,r.layers=null,r.mask=null,r.border_=null,r.hatchInterval_=null,r.hatchOffset_=0,r.hatchLength=t.hatchLength,r.hatchTimeout=t.hatchTimeout,r.size=null,r.context=null,r.snapshot=null,r.contextWithoutMask=document.createElement("canvas").getContext("2d"),r.bytes=4,r.loading_=!1,r.lock_=!1,r.mapKeys_=null,r.layersKeys_=null,r.mapKeyOnceComplete=null,r.mapKeyOnceRender=null,r.createCanvas(),r.connectToMap(),r.setLayers(t.layers),r.hatchTimeout&&r.hatchTimeout>0&&(r.hatchInterval=setInterval((function(){return r.hatchTick_()}),r.hatchTimeout)),r}return a()(n,[{key:"createCanvas",value:function(){this.context=document.createElement("canvas").getContext("2d"),this.setCanvasSize(),this.clearMask()}},{key:"setCanvasSize",value:function(){var t=this.map.getSize();this.context.canvas.width=t[0],this.context.canvas.height=t[1],this.contextWithoutMask.canvas.width=t[0],this.contextWithoutMask.canvas.height=t[1],this.size={w:t[0],h:t[1]}}},{key:"disposeInternal",value:function(){this.disconnectFromMap(),this.disconnectFromLayers(),this.clearMask(),this.hatchInterval&&clearInterval(this.hatchInterval),this.layers=null,this.contextWithoutMask=null,this.context=null,this.snapshot=null,this.map=null,dt()(_t()(n.prototype),"disposeInternal",this).call(this)}},{key:"connectToMap",value:function(){this.mapKeys_=[this.map.getView().on("change:resolution",this.onViewResChanged_.bind(this)),this.map.on("change:size",this.onMapSizeChanged_.bind(this)),this.map.on("moveend",this.onMapMoved_.bind(this)),this.map.on("postrender",this.onPostRender_.bind(this))]}},{key:"disconnectFromMap",value:function(){this.mapKeys_&&(Object(g.b)(this.mapKeys_),this.mapKeys_=null),this.mapKeyOnceComplete&&(Object(g.b)(this.mapKeyOnceComplete),this.mapKeyOnceComplete=null),this.mapKeyOnceRender&&(Object(g.b)(this.mapKeyOnceRender),this.mapKeyOnceRender=null)}},{key:"onViewResChanged_",value:function(){this.createCanvas(),this.setCanvasSize()}},{key:"onMapSizeChanged_",value:function(){var t=this;this.setCanvasSize(),setTimeout((function(){return t.scan()}),50)}},{key:"onMapMoved_",value:function(){this.scan()}},{key:"setLayers",value:function(t){return!!t&&(this.disconnectFromLayers(),this.layers=Array.isArray(t)?t:[t],this.connectToLayers(),this.scan(),!0)}},{key:"connectToLayers",value:function(){var t=this;this.layersKeys_=[],this.layers.forEach((function(e){t.layersKeys_.push(e.on("change",(function(e){return t.scan()})),e.on("propertychange",(function(e){return t.scan()})))}))}},{key:"disconnectFromLayers",value:function(){this.layersKeys_&&(Object(g.b)(this.layersKeys_),this.layersKeys_=null)}},{key:"isReady",value:function(){return!this.loading_&&null!=this.snapshot}},{key:"scan",value:function(){var t=this;if(!this.loading_&&this.map&&(this.snapshot=null,this.hasVisibleLayers_())){this.dispatchEvent("scanStarted");var e=this.map.getSize();this.size={w:e[0],h:e[1]},this.loading_=!0,this.mapKeyOnceComplete=this.map.once("rendercomplete",(function(){t.lock_||(t.mapKeyOnceRender=t.map.once("postrender",(function(){t.getRenderLayers_().length>0&&(t.snapshot=t.contextWithoutMask.getImageData(0,0,t.size.w,t.size.h).data),t.loading_=!1,t.lock_=!1,t.dispatchEvent("scanFinished")}))),t.lock_=!0,t.map.render()})),this.map.render()}}},{key:"hasVisibleLayers_",value:function(){return null!=this.layers&&this.layers.filter((function(t){return t.getVisible()&&t.getOpacity()>0})).length>0}},{key:"onPostRender_",value:function(){var t=this;this.lock_&&(this.contextWithoutMask.clearRect(0,0,this.size.w,this.size.h),this.getRenderLayers_().forEach((function(e){var n=e.getRenderer().context.canvas;t.contextWithoutMask.drawImage(n,0,0,n.width,n.height,0,0,t.size.w,t.size.h)}))),this.drawBorder()}},{key:"render",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.getRenderLayers_();if(0!=e.length){var n=e[e.length-1].getRenderer().context;if(t){var r=this.contextWithoutMask;n.drawImage(r.canvas,0,0,r.canvas.width,r.canvas.height,0,0,n.canvas.width,n.canvas.height)}var i=this.context;n.drawImage(i.canvas,0,0,i.canvas.width,i.canvas.height,0,0,n.canvas.width,n.canvas.height)}}},{key:"getRenderLayers_",value:function(){return null==this.layers?[]:this.layers.filter((function(t){var e=t.getRenderer().context;return e&&t.getVisible()&&t.getOpacity()>0&&e.canvas.width>0&&e.canvas.height>0})).sort((function(t,e){return t.getZIndex()-e.getZIndex()}))}},{key:"hatchTick_",value:function(){return this.hatchOffset_=(this.hatchOffset_+1)%(2*this.hatchLength),this.drawBorder(!1)}},{key:"clearMask",value:function(){this.mask=null,this.border_=null,this.context&&this.context.clearRect(0,0,this.size.w,this.size.h),this.map.render()}},{key:"setMask",value:function(t){this.mask=t,this.map.render()}},{key:"drawBorder",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(!this.mask)return!1;var e,n,r,i,o,a=this.size.w,s=this.size.h,l=this.size.w-1,u=this.size.h-1,c=this.size.w+2,h=this.size.h+2;if(t){var p,d,f,g,y,m,v,_,b,w,x=Ot.getMainWorldOffset(this.map),E=this.mask.data,S=this.mask.width,O=this.mask.bounds,C=this.mask.globalOffset,T=new Uint8Array(c*h),I=[{x:C.x,y:C.y},{x:C.x-x.width+1,y:C.y},{x:C.x+x.width-1,y:C.y}],L=I.length;for(n=0;n<L;n++)if(p=(w=I[n]).x-x.x,d=w.y-x.y,f=p+O.minX,g=d+O.minY,y=p+O.maxX,m=d+O.maxY,!(y<0||f>l||m<0||g>u))for(o=(y<l+1?y:l+1)-(_=f>-1?f:-1)+1,e=((b=g>-1?g:-1)+1)*c+(_+1),v=((m<u+1?m:u+1)-d)*S+(_-p)+1,r=(b-d)*S+(_-p);r<v;r+=S){for(i=0;i<o;i++)1===E[r+i]&&(T[e+i]=1);e+=c}this.border_=xt.a.getBorderIndices({data:T,width:c,height:h})}this.context.clearRect(0,0,a,s);var P=this.border_;if(!P)return!1;var R,M,N=this.context.createImageData(a,s),j=N.data,A=this.hatchLength,k=2*A,F=this.hatchOffset_;for(o=P.length,n=0;n<o;n++)M=((e=P[n])-(R=e%c))/c,M-=1,(R-=1)<0||R>l||M<0||M>u||(r=4*(M*a+R),(R+M+F)%k<A||(j[r]=255,j[r+1]=255,j[r+2]=255),j[r+3]=255);return this.context.putImageData(N,0,0),this.render(),!0}},{key:"getPixelColor",value:function(t,e){var n=(e*this.size.w+t)*this.bytes;return[this.snapshot[n],this.snapshot[n+1],this.snapshot[n+2],this.snapshot[n+3]]}},{key:"toImageUrl",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"image/png";if(!this.isReady()||!this.size)return null;var e=document.createElement("canvas"),n=e.getContext("2d");n.canvas.width=this.size.w,n.canvas.height=this.size.h;for(var r=n.createImageData(this.size.w,this.size.h),i=0;i<this.snapshot.length;i++)r.data[i]=this.snapshot[i];return n.putImageData(r,0,0),e.toDataURL(t)}}]),n}(bt.a),Ot=function(t){gt()(n,t);var e=Et(n);function n(t){var r;return i()(this,n),(r=e.call(this)).layers=t.layers,r.hatchLength=null==t.hatchLength?4:t.hatchLength,r.hatchTimeout=null==t.hatchTimeout?300:t.hatchTimeout,r.colorThreshold=null==t.colorThreshold?15:t.colorThreshold,r.blurRadius=null==t.blurRadius?5:t.blurRadius,r.includeBorders=null==t.includeBorders||t.includeBorders,r.currentThreshold_=0,r.history=0==t.history?null:new Ct,r.tileMask_=null,r.isMapConnect_=!1,r.allowDraw_=!1,r.addMode_=!1,r.oldMask_=null,r.downPoint_=null,r.mapKeys_=null,r.allowAdd_=null==t.addMode||t.addMode,r.isDebug_=null!=t.debugMode&&t.debugMode,t.waitClass&&(r.waitClass=t.waitClass),t.drawClass&&(r.drawClass=t.drawClass),t.addClass&&(r.addClass=t.addClass),r}return a()(n,[{key:"handleDragEvent",value:function(t){var e=t.originalEvent;if(this.allowDraw_){var n=this.getMap().getEventPixel(e),r=Math.round(n[0]),i=Math.round(n[1]),o=this.downPoint_.x,a=this.downPoint_.y;if(r!=o||i!=a){var s=r-o,l=i-a,u=Math.sqrt(s*s+l*l),c=Math.abs(s),h=Math.abs(l),p=c>h?s/c:l/h;p=p<0?p/5:p/3;var d=Math.min(Math.max(this.colorThreshold+Math.round(p*u),1),255);d!=this.currentThreshold_&&(this.currentThreshold_=d,this.drawMask_(o,a))}}return!this.allowDraw_}},{key:"handleDownEvent",value:function(t){var e=t.originalEvent;if(0!=e.button)return this.allowDraw_=!1,this.oldMask_=null,this.addMode_=!1,!1;if(this.tileMask_&&this.tileMask_.isReady()&&!this.getMap().getView().getAnimating()){var n=this.getMap().getEventPixel(e);return this.downPoint_={x:Math.round(n[0]),y:Math.round(n[1])},this.allowDraw_=!0,this.addMode_=e.ctrlKey,this.drawMask_(this.downPoint_.x,this.downPoint_.y),!0}}},{key:"handleUpEvent",value:function(t){t.originalEvent;return this.allowDraw_&&this.tileMask_&&this.history&&this.history.addMask(this.tileMask_.mask),this.currentThreshold_=this.colorThreshold,this.allowDraw_=!1,this.oldMask_=null,this.addMode_=!1,!1}},{key:"onMapKeyDown_",value:function(t){var e=this.getMap();if(e){var n=e.getTargetElement();17==t.keyCode&&null!=this.addClass&&this.allowAdd_&&n.classList.add(this.addClass)}}},{key:"onMapKeyUp_",value:function(t){var e=this.getMap();if(e){var n=e.getTargetElement(),r=e.getView();if(17==t.keyCode&&this.allowAdd_&&n.classList.remove(this.addClass),83==t.keyCode&&this.isDebug_){if(!this.tileMask_||!this.tileMask_.isReady()||r.getInteracting()||r.getAnimating())return;this.tileMask_.context.clearRect(0,0,this.tileMask_.size.w,this.tileMask_.size.h),this.tileMask_.render(!0)}if(67==t.keyCode&&this.isDebug_){if(!this.tileMask_||!this.tileMask_.isReady()||r.getInteracting()||r.getAnimating())return;var i=this.getContours();if(null==i)return;var o,a,s,l=i.filter((function(t){return!t.inner})),u=i.filter((function(t){return t.inner})),c=this.tileMask_.context;for(c.clearRect(0,0,this.tileMask_.size.w,this.tileMask_.size.h),c.beginPath(),o=0;o<l.length;o++)for(s=l[o].points,c.moveTo(s[0].x,s[0].y),a=1;a<s.length;a++)c.lineTo(s[a].x,s[a].y);for(c.strokeStyle="green",c.stroke(),c.beginPath(),o=0;o<u.length;o++)for(s=u[o].points,c.moveTo(s[0].x,s[0].y),a=1;a<s.length;a++)c.lineTo(s[a].x,s[a].y);c.strokeStyle="red",c.stroke(),this.tileMask_.render(!0)}if(t.ctrlKey&&this.history){var h=null;89==t.keyCode&&(h=this.history.redo()),90==t.keyCode&&(h=this.history.undo()),h&&this.tileMask_&&this.tileMask_.setMask(h)}}}},{key:"setActive",value:function(t){!this.getActive()&&t&&this.onActivate_(),this.getActive()&&!t&&this.onDeactivate_(),dt()(_t()(n.prototype),"setActive",this).call(this,t)}},{key:"stopEditing",value:function(){this.setActive(!1),annotationManager.viewport.annotationsLayer.setVisible(!0)}},{key:"onActivate_",value:function(){var t=this.getMap();t&&(this.connectToMap(t),this.createMask(t))}},{key:"onDeactivate_",value:function(){this.allowDraw_=!1,this.downPoint_=null,this.oldMask_=null,this.addMode_=!1,this.disconnectFromMap(),this.tileMask_&&this.tileMask_.dispose(),this.tileMask_=null,this.clearHistory_()}},{key:"disposeInternal",value:function(){this.onDeactivate_(),this.history&&this.history.dispose(),this.history=null,this.layers=null,dt()(_t()(n.prototype),"disposeInternal",this).call(this)}},{key:"setMap",value:function(t){this.onDeactivate_(),dt()(_t()(n.prototype),"setMap",this).call(this,t),this.getActive()&&this.onActivate_()}},{key:"connectToMap",value:function(t){var e=this;this.mapKeys_=[t.getView().on("change:resolution",this.onViewResChanged_.bind(this))],this.keyDownListener=this.onMapKeyDown_.bind(this),this.keyUpListener=this.onMapKeyUp_.bind(this),document.addEventListener("keydown",this.keyDownListener),document.addEventListener("keyup",this.keyUpListener);var n=t.getTargetElement();this.drawClass&&n.classList.add(this.drawClass),this.onMapContextMenuListener_=function(t){e.getActive()&&t.preventDefault()},n.addEventListener("contextmenu",this.onMapContextMenuListener_)}},{key:"disconnectFromMap",value:function(){this.mapKeys_&&(Object(g.b)(this.mapKeys_),this.mapKeys_=null),document.removeEventListener("keydown",this.keyDownListener),document.removeEventListener("keyup",this.keyUpListener);var t=this.getMap();if(t){var e=t.getTargetElement();e.classList.remove(this.drawClass),e.classList.remove(this.waitClass),e.classList.remove(this.addClass),e.removeEventListener("contextmenu",this.onMapContextMenuListener_)}}},{key:"onViewResChanged_",value:function(){this.clearHistory_()}},{key:"clearHistory_",value:function(){this.history&&this.history.clear()}},{key:"createMask",value:function(t){var e=this,n=t.getTargetElement();this.tileMask_=new St({map:t,layers:this.layers,hatchTimeout:this.hatchTimeout,hatchLength:this.hatchLength}),this.waitClass&&(this.tileMask_.on("scanStarted",(function(){return n.classList.add(e.waitClass)})),this.tileMask_.on("scanFinished",(function(){return n.classList.remove(e.waitClass)})))}},{key:"concatMask_",value:function(t,e){var n,r,i,o,a,s,l=e.data,u=t.data,c=e.width,h=t.width,p=e.globalOffset.x,d=e.globalOffset.y,f=t.globalOffset.x,g=t.globalOffset.y,y=e.bounds,m=t.bounds,v=Math.min(y.minX+p,m.minX+f),_=Math.min(y.minY+d,m.minY+g),b={minX:0,minY:0,maxX:Math.max(y.maxX+p,m.maxX+f)-v,maxY:Math.max(y.maxY+d,m.maxY+g)-_},w=b.maxX+1,x=b.maxY+1,E=new Uint8Array(w*x);for(s=y.maxX-y.minX+1,n=(d-_+y.minY)*w+(p-v+y.minX),o=y.minY*c+y.minX,a=y.maxY*c+y.minX+1,i=o;i<a;i+=c)E.set(l.subarray(i,i+s),n),n+=w;for(s=m.maxX-m.minX+1,n=(g-_+m.minY)*w+(f-v+m.minX),o=m.minY*h+m.minX,a=m.maxY*h+m.minX+1,i=o;i<a;i+=h){for(r=0;r<s;r++)1===u[i+r]&&(E[n+r]=1);n+=w}return{data:E,width:w,height:x,bounds:b,globalOffset:{x:v,y:_}}}},{key:"drawMask_",value:function(t,e){if(!this.tileMask_||!this.tileMask_.isReady())return!1;var r=this.tileMask_.size,i=this.getMap(),o=i.getSize(),a=o[0],s=o[1];if(r.w!=a||r.h!=s)return this.tileMask_.scan(),!1;var l=this.tileMask_,u=n.getMainWorldOffset(i),c={data:this.tileMask_.snapshot,width:r.w,height:r.h,bytes:this.tileMask_.bytes},h=null;if(this.allowAdd_&&this.addMode_&&l.mask){if(!this.oldMask_){var p=l.mask,d=p.bounds;this.oldMask_={data:new Uint8Array(p.data),width:p.width,height:p.height,bounds:{minX:d.minX,maxX:d.maxX,minY:d.minY,maxY:d.maxY},globalOffset:{x:p.globalOffset.x,y:p.globalOffset.y}};var f,g,y,m,v,_,b,w,x,E,S,O,C,T,I=this.oldMask_.globalOffset,L=[{x:I.x,y:I.y}],P=c.width,R=new Uint8Array(P*c.height),M=this.oldMask_.data,N=this.oldMask_.width,j=this.oldMask_.bounds,A=c.width-1,k=c.height-1,F=L.length;for(g=0;g<F;g++)if(S=(_=L[g]).x-u.x,O=_.y-u.y,b=S+j.minX,w=O+j.minY,x=S+j.maxX,E=O+j.maxY,!(x<0||b>A||E<0||w>k))for(v=(x<A?x:A)-(C=b>0?b:0)+1,f=(T=w>0?w:0)*P+C,m=((E<k?E:k)-O)*N+(C-S)+1,y=(T-O)*N+(C-S);y<m;y+=N)R.set(M.subarray(y,y+v),f),f+=P;this.oldMask_.visibleData=R}if(!(h=xt.a.floodFill(c,t,e,this.currentThreshold_,this.oldMask_.visibleData,this.includeBorders)))return!1;this.blurRadius>0&&(h=xt.a.gaussBlurOnlyBorder(h,this.blurRadius,this.oldMask_.visibleData)),h.globalOffset=u;var D=u.x+h.width/2-(this.oldMask_.globalOffset.x+this.oldMask_.width/2);Math.abs(D)>u.width/2&&(h.globalOffset.x=D>0?u.x-u.width:u.x+u.width),h=this.concatMask_(h,this.oldMask_)}else h=xt.a.floodFill(c,t,e,this.currentThreshold_,null,this.includeBorders),this.blurRadius>0&&(h=xt.a.gaussBlurOnlyBorder(h,this.blurRadius)),h.globalOffset=u;return l.setMask(h),!0}},{key:"setLayers",value:function(t){return!!t&&(this.layers=t,!!this.tileMask_&&this.tileMask_.setLayers(t))}},{key:"getContours",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:30;if(!this.tileMask_.mask)return null;var r=n.getMainWorldOffset(this.getMap()),i=this.tileMask_.mask,o=i.globalOffset.x-Math.round(r.x),a=i.globalOffset.y-Math.round(r.y),s=xt.a.traceContours(i);return t>0&&(s=xt.a.simplifyContours(s,t,e)),s.map((function(t){return t.initialCount=t.initialCount||t.points.length,t.points.forEach((function(t){t.x+=o,t.y+=a})),t}))}},{key:"getMask",value:function(){if(this.tileMask_){var t,e,r=this.tileMask_.mask,i=n.getMainWorldOffset(this.getMap()),o=0,a=r.data,s=r.bounds,l=r.width,u=s.maxX-s.minX+1,c=s.maxY-s.minY+1,h=new Uint8Array(u*c);for(e=s.minY;e<=s.maxY;e++)for(t=s.minX;t<=s.maxX;t++)h[o++]=a[e*l+t];return{data:h,size:{w:u,h:c},offset:{x:r.globalOffset.x+s.minX-Math.round(i.x),y:r.globalOffset.y+s.minY-Math.round(i.y)}}}return null}},{key:"clearMask",value:function(){this.tileMask_&&this.tileMask_.clearMask()}}],[{key:"getMainWorldOffset",value:function(t){var e=t.getView().getProjection().getExtent(),n=t.getPixelFromCoordinate([e[0],e[3]]);n={x:Math.round(-n[0]),y:Math.round(-n[1])};var r=t.getPixelFromCoordinate([e[2],e[1]]);r={x:Math.round(-r[0]),y:Math.round(-r[1])};var i=n.x-r.x,o=n.x%i;return{x:o<0?o+i:o,y:n.y,width:i}}}]),n}(H.b),Ct=function(t){gt()(n,t);var e=Et(n);function n(){var t;return i()(this,n),(t=e.call(this)).masks=[],t.current=-1,t}return a()(n,[{key:"disposeInternal",value:function(){this.masks=null,dt()(_t()(n.prototype),"disposeInternal",this).call(this)}},{key:"clear",value:function(){this.masks.length=0,this.current=-1}},{key:"addMask",value:function(t){return!!t&&(this.current++,this.masks.length=this.current,this.masks.push(t),!0)}},{key:"getCurrent",value:function(){return this.current>-1?this.masks[this.current]:null}},{key:"allowUndo",value:function(){return this.current>0}},{key:"allowRedo",value:function(){return this.current<this.masks.length-1}},{key:"undo",value:function(){return this.allowUndo()?(this.current--,this.getCurrent()):null}},{key:"redo",value:function(){return this.allowRedo()?(this.current++,this.getCurrent()):null}}]),n}(bt.a);function Tt(){var t;return"color"===(t=M()('<input type="color" value="!" />')[0]).type&&"!"!==t.value}function It(t,e){t.getInteractions().forEach((function(t,n,r){t instanceof u.a&&t.setActive(e)}))}function Lt(){if(null===this.element)return"#000000";var t=M()(this.element).find("li.draw a.active").data("color");return t||"#000000"}function Pt(){if(null===this.element)return 1;var t=parseInt(M()(this.element).find("li.draw a.active").data("size"));return(isNaN(t)||t<1)&&(t=1),t}function Rt(t,e,n,r,i,o){var a=null;n||(n=L.e),t||(t=Lt.call(this)),e||(e=Pt.call(this));var s=new y.a({color:n}),l=new m.a({color:t,width:e});return a=r?new _.a({anchor:[.5,.5],anchorXUnits:"fraction",anchorYUnits:"fraction",opacity:1,src:this.viewport.options.annotations.imageBaseUrl+r,scale:isNaN(this.viewport.options.annotations.imageScale)?1:this.viewport.options.annotations.imageScale}):new v.a({fill:s,stroke:l,radius:5}),new b.c({image:a,fill:s,stroke:l,text:this.viewport.getAnnotationTextStyle(i),geometry:o})}function Mt(t,e,n){for(var r=0;r<t.length;r+=n){var i=t[r],o=t[r+1];!0!==this.flip.vertically&&(o=this.extent[3]-o),!0===this.flip.horizontally&&(i=this.extent[2]-i),e[r]=i,e[r+1]=o}}function Nt(t){var e=t.getGeometry();return"Point"===e.getType()?new x.a(e.getFirstCoordinate(),this.size[0]/2):e}function jt(t){var e=t.getGeometry();if("Point"===e.getType()){var n=Math.abs(this.size[0]/2),r=Math.abs(this.size[1]/2),i=e.getFirstCoordinate();return new E.a([[[i[0]-n,i[1]-r],[i[0]-n,i[1]+r],[i[0]+n,i[1]+r],[i[0]+n,i[1]-r],[i[0]-n,i[1]-r]]])}return e}function At(t,e){return e?e.setCoordinates(t):e=new S.a(t),e}function kt(t,e){if(this.size){var n=Math.abs(this.size[0]/2),r=Math.abs(this.size[1]/2),i=t;return new E.a([[[i[0]-n,i[1]-r],[i[0]-n,i[1]+r],[i[0]+n,i[1]+r],[i[0]+n,i[1]-r],[i[0]-n,i[1]-r]]])}var o=t[0],a=t[1];if(!o||!a)return null;var s=[[o,[o[0],a[1]],a,[a[0],o[1]],o]];return e?e.setCoordinates(s):e=new E.a(s),e}function Ft(t,e){if(this.size)return new x.a(t,this.size[0]/2);var n=e||new x.a([NaN,NaN]),r=t[0],i=t[0][0]-t[1][0],o=t[0][1]-t[1][1],a=Math.sqrt(i*i+o*o);return n.setCenterAndRadius(r,a),n}function Dt(t,e){var n=t[0],r=t[1];if(!n||!r)return null;for(var i=(n[1]-r[1])/2,o=[n[0],n[1]+i],a=r,s=[(a[0]+o[0])/2,(a[1]+o[1])/2],l=[s[0]-a[0],s[1]-a[1]],u=[],c=2*Math.PI/32,h=0;h<32;h++){var p=h*c,d=[Math.round(s[0]+l[0]*Math.cos(p)),Math.round(s[1]+l[1]*Math.sin(p))];u.push(d)}return u.push(u[0]),e?e.setCoordinates([u]):e=new E.a([u]),e}function Gt(t){return 3===t.length?Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]):Math.sqrt(t[0]*t[0]+t[1]*t[1])}function zt(t,e){var n,r,i=t[1],o=t[0],a=(r=o,3===(n=i).lenth&&3===r.length?[r[0]-n[0],r[1]-n[1],r[2]-n[2]]:[r[0]-n[0],r[1]-n[1]]),s=Gt(a),l=function(t,e){if(2===t.length&&t.push(0),e||(e=Gt(t)),e>1e-5){var n=1/e;t[0]*=n,t[1]*=n,t[2]*=n}return 3===t.length?[t[0],t[1],t[2]]:[t[0],t[1]]}(a,s),u=function(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}(l,[0,0,1]),c=.15*s,h=.75*s,p=.15*s,d=[i[0]-u[0]*c/2,i[1]-u[1]*c/2],f=[i[0]+u[0]*c/2,i[1]+u[1]*c/2],g=[d[0]+l[0]*h,d[1]+l[1]*h],y=[f[0]+l[0]*h,f[1]+l[1]*h],m=[g[0]-u[0]*p/2,g[1]-u[1]*p/2],v=[y[0]+u[0]*p/2,y[1]+u[1]*p/2],_=[[d,g,m,[o[0],o[1]],v,y,f,d]];return e?e.setCoordinates(_):e=new E.a(_),e}function Ut(t,e,n){if(this.drawingControlsContainer&&this.viewport.element.contains(this.drawingControlsContainer)&&this.viewport.element.removeChild(this.drawingControlsContainer),this.drawingControlsContainer=null,this.endDrawingButton=null,this.removeLastButton=null,this.continueDrawingButton=null,this.cancelDrawingButton=null,this.counterButton=null,null!=this.changeFeatureKey&&g.b(this.changeFeatureKey),t){this.changeFeatureKey=null;var r=this;this.drawingControlsContainer=document.createElement("div"),this.drawingControlsContainer.className="ol-control pma-ui-viewport-annotations-drawing",this.cancelDrawingButton=document.createElement("button"),this.cancelDrawingButton.innerHTML=I.a.translate("Cancel"),M()(this.cancelDrawingButton).click((function(t){t.preventDefault(),Ut.call(r,!1,e),r.finishDrawing(!1,e)})),e===L.a.CompoundFreehand&&r.drawing||this.viewport.element.appendChild(this.drawingControlsContainer),e===L.a.MultiPoint?(this.removeLastButton=document.createElement("button"),this.removeLastButton.innerHTML=I.a.translate("Remove last point"),this.drawingControlsContainer.appendChild(this.removeLastButton),M()(this.removeLastButton).click((function(t){t.preventDefault(),r.draw&&r.draw.removeLastPoint()})),this.endDrawingButton=document.createElement("button"),this.endDrawingButton.innerHTML=I.a.translate("Finish"),M()(this.endDrawingButton).click((function(t){t.preventDefault(),Ut.call(r,!1,L.a.MultiPoint),r.finishDrawing(!0)})),this.drawingControlsContainer.appendChild(this.endDrawingButton),this.counterButton=document.createElement("button"),this.counterButton.innerHTML="0",n&&(n.getGeometry()&&n.getGeometry().getCoordinates()&&(this.counterButton.innerHTML=n.getGeometry().getCoordinates().length),this.changeFeatureKey&&g.b(this.changeFeatureKey),this.changeFeatureKey=n.on("change",(function(t){r.counterButton&&(r.counterButton.innerHTML=n.getGeometry().getCoordinates().length-1)}))),this.drawingControlsContainer.insertBefore(this.counterButton,this.removeLastButton)):e===L.a.CompoundFreehand&&(r.drawing||(this.continueDrawingButton=document.createElement("button"),this.continueDrawingButton.innerHTML=I.a.translate("Draw"),this.drawingControlsContainer.appendChild(this.continueDrawingButton),M()(this.continueDrawingButton).click((function(t){t.preventDefault(),r.startDrawing({type:L.a.CompoundFreehand,color:r.lastAnnotationStyle.color,fillColor:r.lastAnnotationStyle.fillColor,penWidth:r.lastAnnotationStyle.penSize,iconRelativePath:r.lastAnnotationStyle.iconPath}),r.continueDrawingButton&&(r.continueDrawingButton.style.display="none")}))),this.removeLastButton=document.createElement("button"),this.removeLastButton.innerHTML=I.a.translate("Remove last"),M()(this.removeLastButton).click((function(t){if(t.preventDefault(),r.compoundFreehandList.length>0){var e=r.compoundFreehandList.pop();r.deleteAnnotation(e.getId())}})),this.endDrawingButton=document.createElement("button"),this.endDrawingButton.innerHTML=I.a.translate("Finish"),M()(this.endDrawingButton).click((function(t){t.preventDefault(),Ut.call(r,!1,L.a.CompoundFreehand),r.finishDrawing(!0),r.compoundFreehandList.length>0&&(r.mergeSelection(r.compoundFreehandList),r.compoundFreehandList=[])})),this.drawingControlsContainer.appendChild(this.endDrawingButton),this.drawingControlsContainer.appendChild(this.removeLastButton)),this.drawingControlsContainer.appendChild(this.cancelDrawingButton)}}function Bt(t,e,n){if(this.editingControlsContainer&&this.viewport.element.contains(this.editingControlsContainer)&&this.viewport.element.removeChild(this.editingControlsContainer),this.editingControlsContainer=null,this.endEditingButton=null,this.cancelEditingButton=null,this.saveEditingButton=null,this.brushSizeIncreaseEditingButton=null,this.brushSizeDecreaseEditingButton=null,this.brushTypeCircleEditingButton=null,this.brushTypeSquareEditingButton=null,t){var r=this;this.editingControlsContainer=document.createElement("div"),this.editingControlsContainer.className="ol-control pma-ui-viewport-annotations-drawing",this.cancelEditingButton=document.createElement("button"),this.cancelEditingButton.innerHTML=I.a.translate("Stop editing"),M()(this.cancelEditingButton).click((function(t){t.preventDefault(),Bt.call(r,!1,e),r.stopEditing()})),this.viewport.element.appendChild(this.editingControlsContainer),e===L.f.Wand&&(this.saveEditingButton=document.createElement("button"),this.saveEditingButton.innerHTML=I.a.translate("Create annotation from selection"),M()(this.saveEditingButton).click((function(t){t.preventDefault(),r.saveMagicWandAnnotation()})),this.editingControlsContainer.appendChild(this.saveEditingButton)),e!==L.f.Brush&&e!==L.f.Eraser||(this.brushSizeIncreaseEditingButton=document.createElement("button"),this.brushSizeIncreaseEditingButton.innerHTML=" + ",this.brushSizeIncreaseEditingButton.title=I.a.translate("Increase brush tip size"),M()(this.brushSizeIncreaseEditingButton).click((function(t){t.preventDefault();var e=r.edit.getBrushSize();e+=r.edit.options.brushStep,r.edit.setBrushSize(e)})),this.editingControlsContainer.appendChild(this.brushSizeIncreaseEditingButton),this.brushSizeDecreaseEditingButton=document.createElement("button"),this.brushSizeDecreaseEditingButton.innerHTML=" - ",this.brushSizeDecreaseEditingButton.title=I.a.translate("Decrease brush tip size"),M()(this.brushSizeDecreaseEditingButton).click((function(t){t.preventDefault();var e=r.edit.getBrushSize();e=(e-=r.edit.options.brushStep)<=0?1:e,r.edit.setBrushSize(e)})),this.editingControlsContainer.appendChild(this.brushSizeDecreaseEditingButton),this.brushTypeCircleEditingButton=document.createElement("button"),this.brushTypeCircleEditingButton.innerHTML=" ○ ",this.brushTypeCircleEditingButton.title=I.a.translate("Change brush tip to circle"),M()(this.brushTypeCircleEditingButton).click((function(t){t.preventDefault(),r.edit.setBrushType("circle")})),this.editingControlsContainer.appendChild(this.brushTypeCircleEditingButton),this.brushTypeSquareEditingButton=document.createElement("button"),this.brushTypeSquareEditingButton.innerHTML=" □ ",this.brushTypeSquareEditingButton.title=I.a.translate("Change brush tip to square"),M()(this.brushTypeSquareEditingButton).click((function(t){t.preventDefault(),r.edit.setBrushType("square")})),this.editingControlsContainer.appendChild(this.brushTypeSquareEditingButton)),this.editingControlsContainer.appendChild(this.cancelEditingButton)}}function Vt(){var t=document.createElement("div");t.className="pma-ui-viewport-tooltip pma-ui-viewport-tooltip-measure";var e=new f.a({element:t,offset:[0,-15],positioning:"bottom-center"});this.viewport.map.addOverlay(e),e.element=t;return e}function qt(t){t.type!==L.a.CompoundFreehand&&(this.compoundFreehandList=[]),Ut.call(this,!1,t.type);var e,n,r,i,o,a=t.type,s=O.j,l=O.m;switch(this.stopDrawingOnMouseUp=!1,this.lastAnnotationStyle={color:t.color,fillColor:t.fillColor,penSize:t.penWidth,iconPath:t.iconRelativePath},!0===this.selectionAdded&&(this.selectionAdded=!1,this.hoverInteraction.getFeatures().clear(),this.viewport.map.removeInteraction(this.hoverInteraction),this.selectInteraction.getFeatures().clear(),this.viewport.map.removeInteraction(this.selectInteraction)),a){case L.a.Rectangle:r=kt.bind(t),t.size?(e=1,a="Point",o=jt.bind(t)):(e=2,a="LineString");break;case L.a.Arrow:r=zt,e=2,a="LineString";break;case L.a.Line:e=2,a="LineString";break;case L.a.Icon:a="Point";break;case L.a.MultiPoint:r=At,a="LineString",i=O.i,n=1;break;case L.a.Freehand:case L.a.CompoundFreehand:It(this.viewport.map,!1),a="LineString",l=O.j,s=O.n,this.stopDrawingOnMouseUp=!0;break;case L.a.ClosedFreehand:It(this.viewport.map,!1),a="Polygon",l=O.j,s=O.n,this.stopDrawingOnMouseUp=!0;break;case L.a.Ellipse:r=Dt.bind(t),e=2,a="LineString";break;case L.a.Circle:t.size&&(e=1,a="Point",o=Nt.bind(t)),r=Ft.bind(t)}var u=Rt.call(this,t.color,t.penWidth,t.fillColor,t.iconRelativePath,null,o);this.draw=new c.a({source:this.viewport.annotationsLayer.getSource(),type:a,geometryFunction:r,maxPoints:e,minPoints:n,style:u,condition:s,finishCondition:i,freehandCondition:l}),this.snapInteraction=new h.a({source:this.viewport.annotationsLayer.getSource()});var p=!1;if(t.feature&&(p=!0,this.draw.extend(t.feature),this.drawing=!0,t.feature.drawingType=t.type,t.feature.color=t.feature.metaData.Color,t.feature.penSize=t.feature.metaData.LineThickness,t.feature.fillColor=t.feature.metaData.FillColor,Ut.call(this,!0,t.type,t.feature),t.feature=null),this.viewport.map.addInteraction(this.draw),this.viewport.map.addInteraction(this.snapInteraction),!0===this.viewport.getAnnotationLabelsVisible())var d=Vt.call(this);var f=this,y=null;this.draw.on("drawstart",(function(e){f.drawing=!0,f.shouldRejectDrawing=!1,Ut.call(f,!0,t.type,e.feature),e.feature.setId(1e4*Math.random()|0);var n=e.coordinate;y=e.feature.on("change",(function(t){var n={temporary:e.feature.temporary,feature:e.feature};f.fireEvent(P.c.AnnotationDrawing,n)})),d&&e.feature.getGeometry().on("change",(function(e){var r,i=e.target;switch(t.type){case L.a.Rectangle:case L.a.Ellipse:case L.a.Polygon:case L.a.ClosedFreehand:r=f.viewport.formatArea(f.viewport.calculateArea(i)),n=i.getInteriorPoint().getCoordinates();break;case L.a.Line:case L.a.LineString:case L.a.Freehand:case L.a.Circle:r=f.viewport.formatLength(f.viewport.calculateLength(i)),n=i.getLastCoordinate()}d.element.innerHTML=r,d.setPosition(n)})),e.feature.notes=t.notes,e.feature.drawingType=t.type,e.feature.temporary=!0,e.feature.penSize=t.penWidth,e.feature.color=t.color,e.feature.fillColor=t.fillColor,e.feature.icon=t.iconRelativePath})),this.draw.on("drawend",(function(t){if(f.drawing=!1,Ut.call(f,t.feature.drawingType===L.a.CompoundFreehand,t.feature.drawingType,t.feature),t.feature.drawingType===L.a.CompoundFreehand&&f.drawingControlsContainer){var e=t.feature.getGeometry().getLastCoordinate(),n=f.viewport.map.getPixelFromCoordinate(e);f.drawingControlsContainer.style.left=n[0]+25+"px",f.drawingControlsContainer.style.top=n[1]-50+"px"}if(!f.getEnabled())return t.preventDefault(),!1;d&&f.viewport.map.removeOverlay(d),f.shouldRejectDrawing?Xt.call(f):setTimeout((function(){Xt.call(f)}),100),t.feature.drawingType===L.a.CompoundFreehand&&f.compoundFreehandList.push(t.feature),g.b(y),Yt.call(f,t.feature,p)}))}function Yt(t,e){var n=this,r=Rt.call(n,t.color,t.penSize,t.fillColor,t.icon,t);void 0===t.getId()&&t.setId(1e4*Math.random()|0),t.setStyle(n.viewport.getAnnotationStyle(r,t)),t.originalStyle=r,t.temporary=!1,null!==n.element&&(M()(n.element).find("li.draw a").removeClass("active"),M()(n.element).find(".color-picker").hide());var i={temporary:t.temporary,feature:t},o={extent:n.viewport.map.getView().getProjection().getExtent(),flip:n.viewport.options.flip},a=t.getGeometry().clone();a.applyTransform(Mt.bind(o));var s="";s="Freehand"===t.drawingType||"ClosedFreehand"===t.drawingType?n.format.writeGeometry(a.simplify(2)):"Circle"===t.drawingType?n.format.writeGeometry(Object(E.b)(a)):n.format.writeGeometry(a);var l=2;switch(t.drawingType){case L.a.Arrow:case L.a.Icon:case L.a.Point:case L.a.MultiPoint:l=0;break;case L.a.Line:case L.a.Freehand:case L.a.CompoundFreehand:case L.a.LineString:l=1;break;case L.a.Rectangle:case L.a.Ellipse:case L.a.Polygon:case L.a.ClosedFreehand:case L.a.Circle:l=2}e?(t.metaData.UpdatedOn=new Date,t.metaData.UpdatedBy=null):t.metaData={AnnotationID:null,Classification:I.a.translate("Generic"),Color:t.icon?t.icon:t.originalStyle.getStroke().getColor(),Image:n.viewport.imageInfo.Filename,LayerID:1,Notes:t.notes?t.notes:"",UpdateInfo:"",State:L.b.Added,FillColor:t.originalStyle.getFill().getColor(),Dimensions:l,LineThickness:t.penSize,CreatedOn:new Date,CreatedBy:null,UpdatedOn:null,UpdatedBy:null};var u=t.getGeometry();if(l>0){var c=n.viewport.calculateLength(u);if(t.metaData.Length=c,t.metaData.FormattedLength=n.viewport.formatLength(c),l>1){var h=n.viewport.calculateArea(u);t.metaData.Area=h,t.metaData.FormattedArea=n.viewport.formatArea(h)}}t.metaData.DrawingType=t.drawingType,t.metaData.DrawingType==L.a.MultiPoint&&(t.metaData.PointCount=u.getCoordinates?u.getCoordinates().length:0),t.metaData.Geometry=s,e&&t.metaData.State!==L.b.Added&&(t.metaData.State=L.b.Modified),setTimeout((function(){-1!==s.indexOf("MULTIPOINT EMPTY")?n.deleteAnnotation(t.getId()):(t.setStyle(n.viewport.getAnnotationStyle(r,t)),e?n.fireEvent(P.c.AnnotationModified,i):!n.shouldRejectDrawing&&t&&t.drawingType!==L.a.CompoundFreehand&&n.fireEvent(P.c.AnnotationAdded,i))}),10)}function Xt(){this.draw&&(It(this.viewport.map,!0),this.viewport.map.removeInteraction(this.draw),this.draw=null),this.edit&&(It(this.viewport.map,!0),this.viewport.map.removeInteraction(this.edit),this.edit=null),!0!==this.selectionAdded&&(this.selectionAdded=!0,this.selectInteraction.getFeatures().clear(),this.viewport.map.addInteraction(this.selectInteraction),this.hoverInteraction.getFeatures().clear(),this.viewport.map.addInteraction(this.hoverInteraction))}function Wt(){if(this.draw&&null!==this.element){var t=M()(this.element).find("li.draw a.active");1===t.length&&(t.removeClass("active"),t.click())}}function Ht(t){if(this.getEnabled())if(this.finishDrawing(!0),t.hasClass("active"))t.removeClass("active");else{var e=t.data("type"),n="";if("Text"!==e||(e="Point",n=prompt(I.a.translate("Enter text")))){var r=this.getSelection();this.startDrawing({type:e,color:t.data("color"),penWidth:t.data("size"),iconRelativePath:t.data("icon"),feature:r&&r.length>0?r[0]:null,fillColor:PMA.UI.View.DefaultFillColor,notes:n}),t.addClass("active"),null!==this.jsColorPicker?this.jsColorPicker.fromString(t.data("color")):M()(this.element).find(".color-picker input[type='color']").val(t.data("color")),M()(this.element).find(".color-picker").show()}}}function Kt(){if(null!==this.element){var t="<ul class='pma-ui-annotations'>";Tt()?t+="<li class='option color-picker'><input type='color' value='#000000' /></li>":t+="<li class='option color-picker'><input type='button' value=' ' /><input type='hidden' value='#000000' /></li>",t+="<li class='option draw'><a data-type='Freehand' data-size='2' data-color='#008000' style='color: #008000' class='size-2' href='#' title='"+I.a.translate("Freehand size 1")+"'><i class='fa fa-circle' aria-hidden='true'></i></a></li>",t+="<li class='option draw'><a data-type='ClosedFreehand' data-size='2' data-color='#008000' style='color: #008000' class='size-2' href='#' title='"+I.a.translate("Closed Freehand size 1")+"'><i class='fa fa-pencil-square' aria-hidden='true'></i></a></li>",t+="<li class='option draw'><a data-type='CompoundFreehand' data-size='2' data-color='#008080' style='color: #008080' class='size-2' href='#' title='"+I.a.translate("Compound Freehand size 2")+"'><i class='fa fa-chain' aria-hidden='true'></i></a></li>",t+="<li class='option draw'><a data-type='Text' data-size='1' data-color='#000000' style='color: #000000' class='size-2' href='#' title='"+I.a.translate("Text")+"'><i class='fa fa-font' aria-hidden='true'></i></a></li>",t+="<li class='option draw'><a data-type='Arrow' data-size='2' data-color='#000000' style='color: #000000' class='size-2' href='#' title='"+I.a.translate("Arrow")+"'><i class='fa fa-arrow-right' aria-hidden='true'></i></a></li>",t+="<li class='option draw'><a data-type='Line' data-size='1' data-color='#F00F00' style='color: #F00F00' class='size-2' href='#' title='"+I.a.translate("Measure")+"'><i class='fa fa-minus' aria-hidden='true'></i></a></li>",t+="</ul>";var e=this,n=M()(this.element);n.html(t),Tt()||(e.jsColorPicker=new N(n.find("li.color-picker input")[0],{valueElement:n.find("li.color-picker input[type=hidden]")[0],hash:!0,closable:!0,closeText:I.a.translate("Close")})),n.find("li.color-picker input").change((function(){var t=M()(this).val();n.find("li.draw a.active").data("color",t),n.find("li.draw a.active").css("color",t),Wt.call(e)})),n.find("li.option.delete a").click((function(t){t.preventDefault();var n=e.getSelection();n&&n.length>0&&e.deleteAnnotation(n[0].getId())})),n.find("li.option.save a").click((function(t){t.preventDefault(),e.saveAnnotations()})),n.find("li.draw a").click((function(t){t.preventDefault();var n=M()(this);Ht.call(e,n)}))}}function Zt(){var t=this,e=Math.sqrt(2),n=function(t,n){var r=5;if(n.originalStyle){var i=n.originalStyle.clone(),o=i.getFill();o||(o=new y.a),o.setColor("rgba(255, 255, 255, 0)"),i.getStroke().setColor(t),i.getStroke().setWidth(i.getStroke().getWidth()+3);var a=i.getImage();if(a&&a.getSize){var s=a.getSize(),l=s[0]>s[1]?s[0]:s[1];r=(e*l/2).toFixed(0)}return i.setImage(new v.a({fill:new y.a({color:"rgba(255, 255, 255, 0.7)"}),stroke:new m.a({color:t,width:4}),radius:r})),i}return new b.c({stroke:new m.a({color:t,width:3}),fill:new y.a({color:"rgba(255, 255, 255, 0.7)"}),image:new w.a({fill:new y.a({color:"rgba(255, 255, 255, 0.7)"}),stroke:new m.a({color:t,width:4}),points:4,radius:5,angle:Math.PI/4})})};this.selectInteraction=new p.a({condition:O.e,layers:[this.viewport.annotationsLayer],style:n.bind(this,"rgba(0, 153, 255, 1)")});var r=this.selectInteraction.getFeatures();this.hoverInteraction=new p.a({condition:O.k,layers:[this.viewport.annotationsLayer],filter:function(t,e){return-1===r.getArray().indexOf(t)},style:n.bind(this,"#ffff00")}),this.selectInteraction.on("select",(function(e){t.fireEvent(P.c.AnnotationsSelectionChanged,r.getArray())})),this.selectionAdded=!0,this.selectInteraction.getFeatures().clear(),this.viewport.map.addInteraction(this.selectInteraction),this.hoverInteraction.getFeatures().clear(),this.viewport.map.addInteraction(this.hoverInteraction)}function $t(t,e){var n,r,i=[];if(t&&t.length)for(n=0;n<t.length;n++)(r=t[n]).metaData.Notes||(r.metaData.Notes=I.a.translate(" ")),r.metaData.Classification||(r.metaData.Classification=I.a.translate("no classification")),null===r.metaData.AnnotationID&&(r.metaData.AnnotationID=0),i.push(r.metaData);var o=e.map((function(t){return t.metaData})),a=[];if(this.deletedAnnotations&&this.deletedAnnotations.length>0)for(n=0;n<this.deletedAnnotations.length;n++)null!==this.deletedAnnotations[n].metaData.AnnotationID&&a.push(this.deletedAnnotations[n].metaData);var s=this;this.context.saveAnnotations(this.serverUrl,this.path,i,o,a,(function(r,i){if(t&&t.length){if(null==i||i.length!=t.length)return void console.error("Annotations saved but cannot update annotation ids");for(n=0;n<i.length;n++)t[n].metaData.AnnotationID=i[n],t[n].setId(i[n]),t[n].metaData.State=L.b.Pristine}if(e&&e.length)for(n=0;n<e.length;n++)e[n].metaData.State=L.b.Pristine;s.deletedAnnotations=[],s.fireEvent(P.c.AnnotationsSaved,{success:!0})}),(function(){s.fireEvent(P.c.AnnotationsSaved,{success:!1}),console.error("Saving annotations failed"),console.log(arguments)}))}function Jt(t,e){if(t&&0!==t.length){var n=t.pop(),r=this;n.metaData.Notes||(n.metaData.Notes=I.a.translate(" ")),n.metaData.Classification||(n.metaData.Classification=I.a.translate("no classification")),r.context.addAnnotation(r.serverUrl,r.path,n.metaData.Classification,n.metaData.LayerID,n.metaData.Notes,n.metaData.Geometry,n.metaData.Color,(function(i,o){n.metaData.AnnotationID=o,n.setId(o),n.metaData.State=L.b.Pristine,Jt.call(r,t,e)}),(function(){r.fireEvent(P.c.AnnotationsSaved,{success:!1}),console.error("Saving annotation (add) failed"),console.log(arguments)}))}else Qt.call(this,e)}function Qt(t){if(t&&0!==t.length){var e=t.pop(),n=this;n.context.updateAnnotation(n.serverUrl,n.path,e.metaData.LayerID,e.metaData.AnnotationID,e.metaData.Notes,e.metaData.Geometry,e.metaData.Color,(function(){e.metaData.State=L.b.Pristine,Qt.call(n,t)}),(function(){n.fireEvent(P.c.AnnotationsSaved,{success:!1}),console.error("Saving annotation (edit) failed"),console.log(arguments)}))}else te.call(this)}function te(){if(this.deletedAnnotations&&0!==this.deletedAnnotations.length){var t=this.deletedAnnotations.pop(),e=this;null!==t.metaData.AnnotationID?e.context.deleteAnnotation(e.serverUrl,e.path,t.metaData.LayerID,t.metaData.AnnotationID,(function(){te.call(e)}),(function(){e.fireEvent(P.c.AnnotationsSaved,{success:!1}),console.error("Saving annotation (delete) failed"),console.log(arguments)})):te.call(e)}else this.fireEvent(P.c.AnnotationsSaved,{success:!0})}function ee(t){var e=this;null===e.isPMACore2?this.context.getVersionInfo(e.serverUrl,(function(n){n&&"1."===n.substring(0,"1.".length)?e.isPMACore2=!1:e.isPMACore2=!0,"function"==typeof t&&t.call(e,e.isPMACore2)}),(function(){console.error("Cannot reach server")})):"function"==typeof t&&t.call(e,e.isPMACore2)}var ne=function(){function t(e){if(i()(this,t),Object(C.b)()){if(e.element instanceof HTMLElement)this.element=e.element;else if("string"==typeof e.element){var n=document.querySelector(e.element);n?this.element=n:console.error("Invalid selector for element")}else this.element=null;if(this.element&&(this.element.style.pointerEvents="auto"),e.viewport instanceof T.a&&e.viewport.map)if(e.viewport.annotationsLayer){this.serverUrl=e.serverUrl,this.path=e.path,this.context=e.context,this.viewport=e.viewport,this.drawing=!1,this.selectionAdded=!1,this.stopDrawingOnMouseUp=!1,this.format=new s.a,this.jsColorPicker=null,this.isPMACore2=null,ee.call(this),this.listeners={},this.listeners[P.c.AnnotationAdded]=[],this.listeners[P.c.AnnotationDrawing]=[],this.listeners[P.c.AnnotationDeleted]=[],this.listeners[P.c.AnnotationModified]=[],this.listeners[P.c.AnnotationsSaved]=[],this.listeners[P.c.AnnotationsSelectionChanged]=[],this.listeners[P.c.AnnotationEditingStarted]=[],this.listeners[P.c.AnnotationEditingEnded]=[],Zt.call(this),Kt.call(this);var r=this;this.viewport.map.on("pointerup",(function(t){r.drawing&&!0===r.stopDrawingOnMouseUp&&r.finishDrawing(!0)})),this.setEnabled(!0===e.enabled),this.compoundFreehandList=[],this.lastAnnotationStyle=null,this.shouldRejectDrawing=!1}else console.error("Annotations must be enabled in the viewport for this to work");else console.error("Invalid viewport instance")}}return a()(t,[{key:"replaceAnnotations",value:function(t){t&&t instanceof Array||(t=[]);for(var e=0;e<t.length;e++)t[e].AnnotationID=null,t[e].Image=this.viewport.image;this.finishDrawing(!0);var n=this.viewport.getAnnotations();this.deletedAnnotations=this.deletedAnnotations||[];for(var r=0;r<n.length;r++)switch(n[r].metaData.State){case L.b.Pristine:case L.b.Modified:this.deletedAnnotations.push(n[r])}var i=this.viewport.annotationsLayer.getSource();i.clear();for(var o=this.viewport.initializeFeatures(t,this.viewport.mainLayer.getSource().getProjection()),a=0;a<o.length;a++)o[a].metaData.State=L.b.Added;i.addFeatures(o),this.viewport.redraw()}},{key:"addAnnotation",value:function(t){t.AnnotationID=null,t.Image=this.viewport.image,this.finishDrawing(!0);for(var e=this.viewport.annotationsLayer.getSource(),n=this.viewport.initializeFeatures([t],this.viewport.mainLayer.getSource().getProjection()),r=0;r<n.length;r++)n[r].metaData.State=L.b.Added;e.addFeatures(n);var i={temporary:!1,feature:n&&n.length?n[0]:null};this.fireEvent(P.c.AnnotationAdded,i)}},{key:"getActive",value:function(){return null!==this.element&&M()(this.element).find("li.draw a.active").length>0}},{key:"getEnabled",value:function(){return this.enabled}},{key:"setEnabled",value:function(t){this.enabled=!0===t,this.getEnabled()?null!==this.element&&M()(this.element).find("li.draw a").removeClass("disabled"):(this.finishDrawing(!1),null!==this.element&&(M()(this.element).find("li.draw a").removeClass("active"),M()(this.element).find("li.draw a").addClass("disabled"),M()(this.element).find(".color-picker").hide()))}},{key:"startDrawing",value:function(t){"string"==typeof t&&(t={type:arguments[0],color:arguments[1],penWidth:arguments[2],iconRelativePath:arguments[3],feature:arguments[4],fillColor:PMA.UI.View.DefaultFillColor,notes:""}),this.getEnabled()&&(this.drawing?console.error("Drawing already in progress. Finish drawing before starting a new one."):(t.fillColor||(t.fillColor=PMA.UI.View.DefaultFillColor),t.size&&(t.size.length&&2==t.size.length?t.size[0]<=0||t.size[1]<=0?t.size=void 0:this.viewport.imageInfo&&this.viewport.imageInfo.MicrometresPerPixelX&&this.viewport.imageInfo.MicrometresPerPixelY?t.size=[t.size[0]/this.viewport.imageInfo.MicrometresPerPixelX,t.size[1]/this.viewport.imageInfo.MicrometresPerPixelY]:t.size=void 0:t.size=void 0),this.finishDrawing(!1),qt.call(this,t)))}},{key:"finishDrawing",value:function(t,e){this.shouldRejectDrawing=!t;var n=!1===t;if(this.drawing?null!=this.draw&&this.draw.finishDrawing():n=!1,Xt.call(this),null!==this.element&&(M()(this.element).find(".color-picker").hide(),M()(this.element).find("li.draw a").removeClass("active")),n||e==L.a.CompoundFreehand){var r=this.viewport.annotationsLayer.getSource(),i=r.getFeatures();if(this.compoundFreehandList.length>0)for(;this.compoundFreehandList.length>0;){var o=this.compoundFreehandList.pop();r.removeFeature(o)}else i.length>0&&r.removeFeature(i[i.length-1])}}},{key:"listen",value:function(t,e){this.listeners.hasOwnProperty(t)||console.error(t+" is not a valid event"),this.listeners[t].push(e)}},{key:"fireEvent",value:function(t,e){if(this.listeners.hasOwnProperty(t))for(var n=0,r=this.listeners[t].length;n<r;n++)this.listeners[t][n].call(this,e);else console.error(t+" does not exist")}},{key:"getSelection",value:function(){return this.selectInteraction.getFeatures().getArray()}},{key:"saveAnnotations",value:function(){for(var t=this.viewport.getAnnotations(),e=[],n=[],r=0;r<t.length;r++)switch(t[r].metaData.State){case L.b.Added:e.push(t[r]);break;case L.b.Pristine:case L.b.Modified:n.push(t[r])}ee.call(this,(function(){this.isPMACore2?$t.call(this,e,n):Jt.call(this,e,n)}))}},{key:"hasChanges",value:function(){if(this.deletedAnnotations&&this.deletedAnnotations.length>0)return!0;for(var t=this.viewport.getAnnotations(),e=0;e<t.length;e++)switch(t[e].metaData.State){case L.b.Added:return!0;case L.b.Pristine:break;case L.b.Modified:return!0}return!1}},{key:"deleteAnnotation",value:function(t){if(null!==t&&!isNaN(t)){var e=this.viewport.annotationsLayer.getSource().getFeatureById(t);e&&(this.clearHighlight(),this.clearSelection(),this.viewport.annotationsLayer.getSource().removeFeature(e),e.metaData.State=L.b.Deleted,this.deletedAnnotations||(this.deletedAnnotations=[]),this.deletedAnnotations.push(e),this.fireEvent(P.c.AnnotationDeleted,{annotationId:t,feature:e}))}}},{key:"highlightAnnotation",value:function(t){if(null!==t&&!isNaN(t)){var e=this.viewport.annotationsLayer.getSource().getFeatureById(t);if(e){var n=this.hoverInteraction.getFeatures();n.clear(),n.push(e)}}}},{key:"clearHighlight",value:function(){this.hoverInteraction.getFeatures().clear()}},{key:"selectAnnotation",value:function(t){if(null!==t&&!isNaN(t)){var e=this.viewport.annotationsLayer.getSource().getFeatureById(t);if(e){var n=this.selectInteraction.getFeatures();n.clear(),n.push(e)}}}},{key:"clearSelection",value:function(){this.selectInteraction.getFeatures().clear()}},{key:"mergeSelection",value:function(t){if(t||(t=this.getSelection()),t&&!(t.length<1)){for(var e=[],n=0;n<t.length;n++){var r=t[n].getGeometry();r.getFirstCoordinate&&e.push({id:t[n].getId(),geometry:r,first:r.getFirstCoordinate(),last:r.getLastCoordinate(),coordinates:r.getCoordinates(),sqDistanceFirst:0,sqDistanceLast:0,sqDistanceFirstFirst:0,sqDistanceLastFirst:0})}for(n=0;n<e.length;n++)this.deleteAnnotation(e[n].id);var i=e[0].coordinates,o=i[0],a=i[i.length-1];for(e.splice(0,1);e.length>0;){var s=-1,l=-1;for(n=0;n<e.length;n++)e[n].sqDistanceFirst=Math.pow(a[0]-e[n].first[0],2)+Math.pow(a[1]-e[n].first[1],2),e[n].sqDistanceLast=Math.pow(a[0]-e[n].last[0],2)+Math.pow(a[1]-e[n].last[1],2),e[n].sqDistanceFirstFirst=Math.pow(o[0]-e[n].first[0],2)+Math.pow(o[1]-e[n].first[1],2),e[n].sqDistanceLastFirst=Math.pow(o[0]-e[n].last[0],2)+Math.pow(o[1]-e[n].last[1],2),(-1==s||e[n].sqDistanceFirst<s)&&(s=e[n].sqDistanceFirst,l=n),(-1==s||e[n].sqDistanceLast<s)&&(s=e[n].sqDistanceLast,l=n);for(var u=e.splice(l,1)[0],c=u.sqDistanceLast<u.sqDistanceFirst,h=0;h<u.coordinates.length;h++)c?i.push(u.coordinates[u.coordinates.length-1-h]):i.push(u.coordinates[h]);o=i[0],a=i[i.length-1]}i.push(i[0]);var p=new E.a([i]),d=new X.a({geometry:p});d.color=this.lastAnnotationStyle.color,d.fillColor=this.lastAnnotationStyle.fillColor,d.penSize=this.lastAnnotationStyle.penSize,d.icon=this.lastAnnotationStyle.iconPath,Yt.call(this,d,!1),this.viewport.annotationsLayer.getSource().addFeatures([d]),this.clearSelection()}}},{key:"booleanUnion",value:function(t){var e=this;if(t)if(t.length<2)console.error("This operation requires at least 2 annotations");else{var n=[],r=[],i=new l.a,o={featureProjection:this.viewport.map.getView().getProjection()},a="";t.forEach((function(t){a+=t.metaData.Notes?t.metaData.Notes+" ":""}));for(var s=t[0].metaData.Color?t[0].metaData.Color:t[0].color,u=t[0].metaData.FillColor?t[0].metaData.FillColor:t[0].fillColor,c=t[0].metaData.LineThickness?t[0].metaData.LineThickness:t[0].penSize,h=t[0].icon,p=0;p<t.length;p++){var d=t[p];if("Polygon"!==d.getGeometry().getType()&&"MultiPolygon"!==d.getGeometry().getType())return void console.error("Selection contains non-polygon geometry");var f=i.writeFeatureObject(d,o);n.push(f),r.push(f)}var g=j.a.apply(void 0,r);if("FeatureCollection"===g.type)throw"Feature collection detected";if("MultiPolygon"===g.geometry.type)g.geometry.coordinates.forEach((function(t){var n={type:"Polygon",coordinates:t},r=i.readFeature(n,o);r.color=s,r.fillColor=u,r.penSize=c,r.icon=h,r.notes=a||"",Yt.call(e,r,!1),e.viewport.annotationsLayer.getSource().addFeatures([r])}));else{var y=i.readFeature(g,o);y.color=s,y.fillColor=u,y.penSize=c,y.icon=h,y.notes=a||"",Yt.call(this,y,!1),this.viewport.annotationsLayer.getSource().addFeatures([y])}n.forEach((function(t){e.deleteAnnotation(t.id)}))}else console.error("No annotations provided")}},{key:"booleanDifference",value:function(t,e){var n=this;if(t&&e){var r=new l.a,i={featureProjection:this.viewport.map.getView().getProjection()},o="";o+=t.metaData.Notes?t.metaData.Notes+" ":"",o+=e.metaData.Notes?e.metaData.Notes+" ":"";var a,s,u=t.metaData.Color?t.metaData.Color:t.color,c=t.metaData.FillColor?t.metaData.FillColor:t.fillColor,h=t.metaData.LineThickness?t.metaData.LineThickness:t.penSize,p=t.icon,d=[],f=[],g=[];if("Polygon"===t.getGeometry().getType()){var y=r.writeFeatureObject(t,i);if(a=y.id,d.push(y),"Polygon"===e.getGeometry().getType()){var m=r.writeFeatureObject(e,i);s=m.id,f.push(m),d.forEach((function(t){f.forEach((function(e){if(B(t,e)){var n=Object(A.a)(t,e);if(n){if("FeatureCollection"===n.type)throw"Feature collection detected";g.push(n)}else console.error("Nullified geometry")}else console.error("Non-intersecting geometry")}))})),g.length>0&&(g.forEach((function(t){if("MultiPolygon"!==t.geometry.type){var e=r.readFeature(t,i);return e.color=u,e.fillColor=c,e.penSize=h,e.icon=p,e.notes=o||"",Yt.call(n,e,!1),n.viewport.annotationsLayer.getSource().addFeatures([e]),e}t.geometry.coordinates.forEach((function(t){var e={type:"Polygon",coordinates:t},a=r.readFeature(e,i);a.color=u,a.fillColor=c,a.penSize=h,a.icon=p,a.notes=o||"",Yt.call(n,a,!1),n.viewport.annotationsLayer.getSource().addFeatures([a])}))})),this.deleteAnnotation(a),this.deleteAnnotation(s))}else console.error("Annotation contains non-polygon geometry")}else console.error("Annotation contains non-polygon geometry")}else console.error("No annotations provided")}},{key:"saveTransformedAnnotations",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e?(t.color=t.metaData.Color,t.penSize=t.metaData.LineThickness,t.fillColor=t.metaData.FillColor,Yt.call(this,t,!0)):Yt.call(this,t,!1)}},{key:"enterTransformMode",value:function(t){var e=t,n=new J({layers:[this.viewport.annotationsLayer],enableRotatedTransform:!1,translateFeature:!0,scale:!0,rotate:!0,keepAspectRatio:!1,translate:!0,stretch:!0});this.edit=n,this.viewport.map.addInteraction(n),e&&n.select(e,!0)}},{key:"enterModifyMode",value:function(t){var e=t,n=new d.a({source:this.viewport.annotationsLayer.getSource()});this.edit=n,this.viewport.map.addInteraction(n),annotationManager.selectInteraction.on("select",(function(t){e&&(annotationManager.saveTransformedAnnotations(e),annotationManager.viewport.map.removeInteraction(n),e=null)}))}},{key:"enterMagicWandMode",value:function(t){if(t){var e=new Ot({layers:[this.viewport.gridLayer],hatchLength:4,hatchTimeout:300,waitClass:"magic-wand-loading",addClass:"magic-wand-add"});this.edit=e,this.edit.options=t,this.viewport.map.addInteraction(e)}else console.error("No style options provided.")}},{key:"saveMagicWandAnnotation",value:function(){var t=annotationManager.edit.getContours(5,50);if(t){var e=t.map((function(t){return t.points.map((function(t){return annotationManager.viewport.map.getCoordinateFromPixel([t.x,t.y])}))})),n=new X.a({geometry:new E.a(e)});n.color=annotationManager.edit.options.color,n.fillColor=annotationManager.edit.options.fillColor,n.penSize=annotationManager.edit.options.penSize,n.icon=annotationManager.edit.options.icon,n.notes=annotationManager.edit.options.notes,annotationManager.saveTransformedAnnotations(n,!1),annotationManager.viewport.annotationsLayer.getSource().addFeatures([n]),annotationManager.viewport.annotationsLayer.setVisible(!0)}}},{key:"enterBrushMode",value:function(t,e,n){var r=this;n||(n={brushSize:500,brushType:"circle",brushStep:50});var i=new ht({map:this.viewport.map,feature:e,layer:this.viewport.annotationsLayer,brushSize:n.brushSize,brushType:n.brushType,brushMode:t?"eraser":"brush"});i.addEventListener("drawing",(function(t){if(null!=t.target.getId())r.deleteAnnotation(t.target.getId()),null!==t.target.getFeature()&&(Yt.call(r,t.target.getFeature(),!1),r.viewport.annotationsLayer.getSource().addFeature(t.target.getFeature()));else if(null!==t.target.getFeature()){var e=t.target.getFeature();Yt.call(r,e,!0),e.color=e.metaData.Color,e.fillColor=e.metaData.FillColor,e.penSize=e.metaData.LineThickness,e.notes=e.metaData.Notes?e.metaData.Notes:"",e.changed()}})),this.edit=i,this.edit.options={brushStep:n.brushStep},this.viewport.map.addInteraction(i)}},{key:"enterEditMode",value:function(t){if(this.getEnabled())if(this.editing)console.error("Editing already in progress. Finish editing before starting a new one.");else switch(this.editing=!0,this.fireEvent(P.c.AnnotationEditingStarted),Bt.call(this,!0,t.type,t.feature),t.type){case L.f.Modify:this.enterModifyMode(t.feature);break;case L.f.Transform:this.enterTransformMode(t.feature);break;case L.f.Wand:if(void 0===t.color||void 0===t.fillColor||void 0===t.penWidth||void 0===t.iconRelativePath||void 0===t.notes){console.error("Required parameters missing!"),this.editing=!1,Bt.call(this,!1,null,null);break}this.enterMagicWandMode({color:t.color,fillColor:t.fillColor,penWidth:t.penWidth,iconRelativePath:t.iconRelativePath,notes:t.notes});break;case L.f.Brush:this.enterBrushMode(!1,t.feature,{brushType:t.brushType,brushSize:t.brushSize,brushStep:t.brushStep});break;case L.f.Eraser:this.enterBrushMode(!0,t.feature,{brushType:t.brushType,brushSize:t.brushSize,brushStep:t.brushStep});break;default:this.editing=!1,Bt.call(this,!1,null,null)}}},{key:"stopEditing",value:function(){this.editing&&null!=this.edit&&(Bt.call(this,!1,null,null),"function"==typeof this.edit.stopEditing&&this.edit.stopEditing(),this.editing=!1),Xt.call(this),this.fireEvent(P.c.AnnotationEditingEnded)}}]),t}()},function(t,e,n){t.exports=n(248)},,function(t,e){t.exports=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}},function(t,e){e.read=function(t,e,n,r,i){var o,a,s=8*i-r-1,l=(1<<s)-1,u=l>>1,c=-7,h=n?i-1:0,p=n?-1:1,d=t[e+h];for(h+=p,o=d&(1<<-c)-1,d>>=-c,c+=s;c>0;o=256*o+t[e+h],h+=p,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=r;c>0;a=256*a+t[e+h],h+=p,c-=8);if(0===o)o=1-u;else{if(o===l)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,r),o-=u}return(d?-1:1)*a*Math.pow(2,o-r)},e.write=function(t,e,n,r,i,o){var a,s,l,u=8*o-i-1,c=(1<<u)-1,h=c>>1,p=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:o-1,f=r?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=c):(a=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-a))<1&&(a--,l*=2),(e+=a+h>=1?p/l:p*Math.pow(2,1-h))*l>=2&&(a++,l/=2),a+h>=c?(s=0,a=c):a+h>=1?(s=(e*l-1)*Math.pow(2,i),a+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;t[n+d]=255&s,d+=f,s/=256,i-=8);for(a=a<<i|s,u+=i;u>0;t[n+d]=255&a,d+=f,a/=256,u-=8);t[n+d-f]|=128*g}},function(t,e,n){"use strict";var r,i=n(169),o=n(40),a=n(9),s=n(26),l=n(1),u=n(141),c=n(43),h=n(106),p=n(29),d=n(58),f=n(69),g=n(68),y=n(31),m=n(38),v=n(22),_=n(65),b=n(66),w=n(30),x=n(20),E=(n(0),n(41)),S=n(2),O=n(21),C=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),T="Point",I="LineString",L="Polygon",P="Circle",R="drawstart",M="drawend",N="drawabort",j=function(t){function e(e,n){var r=t.call(this,e)||this;return r.feature=n,r}return C(e,t),e}(o.a),A=function(t){function e(e){var n=this,r=e;r.stopDown||(r.stopDown=w.a),(n=t.call(this,r)||this).on,n.once,n.un,n.shouldHandle_=!1,n.downPx_=null,n.downTimeout_,n.lastDragTime_,n.pointerType_,n.freehand_=!1,n.source_=e.source?e.source:null,n.features_=e.features?e.features:null,n.snapTolerance_=e.snapTolerance?e.snapTolerance:12,n.type_=e.type,n.mode_=function(t){switch(t){case l.a.POINT:case l.a.MULTI_POINT:return T;case l.a.LINE_STRING:case l.a.MULTI_LINE_STRING:return I;case l.a.POLYGON:case l.a.MULTI_POLYGON:return L;case l.a.CIRCLE:return P;default:throw new Error("Invalid type: "+t)}}(n.type_),n.stopClick_=!!e.stopClick,n.minPoints_=e.minPoints?e.minPoints:n.mode_===L?3:2,n.maxPoints_=n.mode_===P?2:e.maxPoints?e.maxPoints:1/0,n.finishCondition_=e.finishCondition?e.finishCondition:w.b;var o,a=e.geometryFunction;if(!a){var s,h=n.mode_;if(h===P)a=function(t,e,n){var r=e||new i.a([NaN,NaN]),o=Object(S.fromUserCoordinate)(t[0],n),a=Object(O.j)(o,Object(S.fromUserCoordinate)(t[t.length-1],n));r.setCenterAndRadius(o,Math.sqrt(a));var s=Object(S.getUserProjection)();return s&&r.transform(n,s),r};else h===T?s=y.a:h===I?s=c.a:h===L&&(s=v.a),a=function(t,e,n){return e?h===L?t[0].length?e.setCoordinates([t[0].concat([t[0][0]])]):e.setCoordinates([]):e.setCoordinates(t):e=new s(t),e}}return n.geometryFunction_=a,n.dragVertexDelay_=void 0!==e.dragVertexDelay?e.dragVertexDelay:500,n.finishCoordinate_=null,n.sketchFeature_=null,n.sketchPoint_=null,n.sketchCoords_=null,n.sketchLine_=null,n.sketchLineCoords_=null,n.squaredClickTolerance_=e.clickTolerance?e.clickTolerance*e.clickTolerance:36,n.overlay_=new _.a({source:new b.a({useSpatialIndex:!1,wrapX:!!e.wrapX&&e.wrapX}),style:e.style?e.style:(o=Object(E.b)(),function(t,e){return o[t.getGeometry().getType()]}),updateWhileInteracting:!0}),n.geometryName_=e.geometryName,n.condition_=e.condition?e.condition:x.j,n.freehandCondition_,e.freehand?n.freehandCondition_=x.d:n.freehandCondition_=e.freehandCondition?e.freehandCondition:x.m,n.addChangeListener(u.a.ACTIVE,n.updateState_),n}return C(e,t),e.prototype.setMap=function(e){t.prototype.setMap.call(this,e),this.updateState_()},e.prototype.getOverlay=function(){return this.overlay_},e.prototype.handleEvent=function(e){e.originalEvent.type===a.a.CONTEXTMENU&&e.originalEvent.preventDefault(),this.freehand_=this.mode_!==T&&this.freehandCondition_(e);var n=e.type===p.a.POINTERMOVE,r=!0;!this.freehand_&&this.lastDragTime_&&e.type===p.a.POINTERDRAG&&(Date.now()-this.lastDragTime_>=this.dragVertexDelay_?(this.downPx_=e.pixel,this.shouldHandle_=!this.freehand_,n=!0):this.lastDragTime_=void 0,this.shouldHandle_&&void 0!==this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0));return this.freehand_&&e.type===p.a.POINTERDRAG&&null!==this.sketchFeature_?(this.addToDrawing_(e.coordinate),r=!1):this.freehand_&&e.type===p.a.POINTERDOWN?r=!1:n&&this.getPointerCount()<2?(r=e.type===p.a.POINTERMOVE)&&this.freehand_?(this.handlePointerMove_(e),this.shouldHandle_&&e.originalEvent.preventDefault()):("mouse"===e.originalEvent.pointerType||e.type===p.a.POINTERDRAG&&void 0===this.downTimeout_)&&this.handlePointerMove_(e):e.type===p.a.DBLCLICK&&(r=!1),t.prototype.handleEvent.call(this,e)&&r},e.prototype.handleDownEvent=function(t){return this.shouldHandle_=!this.freehand_,this.freehand_?(this.downPx_=t.pixel,this.finishCoordinate_||this.startDrawing_(t.coordinate),!0):this.condition_(t)?(this.lastDragTime_=Date.now(),this.downTimeout_=setTimeout(function(){this.handlePointerMove_(new h.a(p.a.POINTERMOVE,t.map,t.originalEvent,!1,t.frameState))}.bind(this),this.dragVertexDelay_),this.downPx_=t.pixel,!0):(this.lastDragTime_=void 0,!1)},e.prototype.handleUpEvent=function(t){var e=!0;if(0===this.getPointerCount())if(this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0),this.handlePointerMove_(t),this.shouldHandle_){var n=!this.finishCoordinate_;n&&this.startDrawing_(t.coordinate),!n&&this.freehand_?this.finishDrawing():this.freehand_||n&&this.mode_!==T||(this.atFinish_(t.pixel)?this.finishCondition_(t)&&this.finishDrawing():this.addToDrawing_(t.coordinate)),e=!1}else this.freehand_&&this.abortDrawing();return!e&&this.stopClick_&&t.preventDefault(),e},e.prototype.handlePointerMove_=function(t){if(this.pointerType_=t.originalEvent.pointerType,this.downPx_&&(!this.freehand_&&this.shouldHandle_||this.freehand_&&!this.shouldHandle_)){var e=this.downPx_,n=t.pixel,r=e[0]-n[0],i=e[1]-n[1],o=r*r+i*i;if(this.shouldHandle_=this.freehand_?o>this.squaredClickTolerance_:o<=this.squaredClickTolerance_,!this.shouldHandle_)return}this.finishCoordinate_?this.modifyDrawing_(t.coordinate):this.createOrUpdateSketchPoint_(t.coordinate.slice())},e.prototype.atFinish_=function(t){var e=!1;if(this.sketchFeature_){var n=!1,r=[this.finishCoordinate_],i=this.mode_;if(i===T)e=!0;else if(i===P)e=2===this.sketchCoords_.length;else if(i===I)n=this.sketchCoords_.length>this.minPoints_;else if(i===L){var o=this.sketchCoords_;n=o[0].length>this.minPoints_,r=[o[0][0],o[0][o[0].length-2]]}if(n)for(var a=this.getMap(),s=0,l=r.length;s<l;s++){var u=r[s],c=a.getPixelFromCoordinate(u),h=t[0]-c[0],p=t[1]-c[1],d=this.freehand_?1:this.snapTolerance_;if(e=Math.sqrt(h*h+p*p)<=d){this.finishCoordinate_=u;break}}}return e},e.prototype.createOrUpdateSketchPoint_=function(t){this.sketchPoint_?this.sketchPoint_.getGeometry().setCoordinates(t):(this.sketchPoint_=new s.a(new y.a(t)),this.updateSketchFeatures_())},e.prototype.createOrUpdateCustomSketchLine_=function(t){this.sketchLine_||(this.sketchLine_=new s.a);var e=t.getLinearRing(0),n=this.sketchLine_.getGeometry();n?(n.setFlatCoordinates(e.getLayout(),e.getFlatCoordinates()),n.changed()):(n=new c.a(e.getFlatCoordinates(),e.getLayout()),this.sketchLine_.setGeometry(n))},e.prototype.startDrawing_=function(t){var e=this.getMap().getView().getProjection();this.finishCoordinate_=t,this.mode_===T?this.sketchCoords_=t.slice():this.mode_===L?(this.sketchCoords_=[[t.slice(),t.slice()]],this.sketchLineCoords_=this.sketchCoords_[0]):this.sketchCoords_=[t.slice(),t.slice()],this.sketchLineCoords_&&(this.sketchLine_=new s.a(new c.a(this.sketchLineCoords_)));var n=this.geometryFunction_(this.sketchCoords_,void 0,e);this.sketchFeature_=new s.a,this.geometryName_&&this.sketchFeature_.setGeometryName(this.geometryName_),this.sketchFeature_.setGeometry(n),this.updateSketchFeatures_(),this.dispatchEvent(new j(R,this.sketchFeature_))},e.prototype.modifyDrawing_=function(t){var e,n,r=this.getMap(),i=this.sketchFeature_.getGeometry(),o=r.getView().getProjection();(this.mode_===T?n=this.sketchCoords_:this.mode_===L?(n=(e=this.sketchCoords_[0])[e.length-1],this.atFinish_(r.getPixelFromCoordinate(t))&&(t=this.finishCoordinate_.slice())):n=(e=this.sketchCoords_)[e.length-1],n[0]=t[0],n[1]=t[1],this.geometryFunction_(this.sketchCoords_,i,o),this.sketchPoint_)&&this.sketchPoint_.getGeometry().setCoordinates(t);if(i.getType()===l.a.POLYGON&&this.mode_!==L)this.createOrUpdateCustomSketchLine_(i);else if(this.sketchLineCoords_){this.sketchLine_.getGeometry().setCoordinates(this.sketchLineCoords_)}this.updateSketchFeatures_()},e.prototype.addToDrawing_=function(t){var e,n,r=this.sketchFeature_.getGeometry(),i=this.getMap().getView().getProjection(),o=this.mode_;o===I||o===P?(this.finishCoordinate_=t.slice(),(n=this.sketchCoords_).length>=this.maxPoints_&&(this.freehand_?n.pop():e=!0),n.push(t.slice()),this.geometryFunction_(n,r,i)):o===L&&((n=this.sketchCoords_[0]).length>=this.maxPoints_&&(this.freehand_?n.pop():e=!0),n.push(t.slice()),e&&(this.finishCoordinate_=n[0]),this.geometryFunction_(this.sketchCoords_,r,i)),this.createOrUpdateSketchPoint_(t.slice()),this.updateSketchFeatures_(),e&&this.finishDrawing()},e.prototype.removeLastPoint=function(){if(this.sketchFeature_){var t,e=this.sketchFeature_.getGeometry(),n=this.getMap().getView().getProjection(),r=this.mode_;if(r===I||r===P){if((t=this.sketchCoords_).splice(-2,1),t.length>=2){this.finishCoordinate_=t[t.length-2].slice();var i=this.finishCoordinate_.slice();t[t.length-1]=i,this.createOrUpdateSketchPoint_(i)}this.geometryFunction_(t,e,n),e.getType()===l.a.POLYGON&&this.sketchLine_&&this.createOrUpdateCustomSketchLine_(e)}else if(r===L){(t=this.sketchCoords_[0]).splice(-2,1);var o=this.sketchLine_.getGeometry();if(t.length>=2){i=t[t.length-2].slice();t[t.length-1]=i,this.createOrUpdateSketchPoint_(i)}o.setCoordinates(t),this.geometryFunction_(this.sketchCoords_,e,n)}1===t.length&&this.abortDrawing(),this.updateSketchFeatures_()}},e.prototype.finishDrawing=function(){var t=this.abortDrawing_();if(t){var e=this.sketchCoords_,n=t.getGeometry(),r=this.getMap().getView().getProjection();this.mode_===I?(e.pop(),this.geometryFunction_(e,n,r)):this.mode_===L&&(e[0].pop(),this.geometryFunction_(e,n,r),e=n.getCoordinates()),this.type_===l.a.MULTI_POINT?t.setGeometry(new f.a([e])):this.type_===l.a.MULTI_LINE_STRING?t.setGeometry(new d.a([e])):this.type_===l.a.MULTI_POLYGON&&t.setGeometry(new g.a([e])),this.dispatchEvent(new j(M,t)),this.features_&&this.features_.push(t),this.source_&&this.source_.addFeature(t)}},e.prototype.abortDrawing_=function(){this.finishCoordinate_=null;var t=this.sketchFeature_;return this.sketchFeature_=null,this.sketchPoint_=null,this.sketchLine_=null,this.overlay_.getSource().clear(!0),t},e.prototype.abortDrawing=function(){var t=this.abortDrawing_();t&&this.dispatchEvent(new j(N,t))},e.prototype.appendCoordinates=function(t){var e,n=this.mode_,r=!this.sketchFeature_;if(r&&this.startDrawing_(t[0]),n===I||n===P)e=this.sketchCoords_;else{if(n!==L)return;e=this.sketchCoords_&&this.sketchCoords_.length?this.sketchCoords_[0]:[]}r&&e.shift(),e.pop();for(var i=0;i<t.length;i++)this.addToDrawing_(t[i]);var o=t[t.length-1];this.addToDrawing_(o),this.modifyDrawing_(o)},e.prototype.extend=function(t){var e=t.getGeometry();this.sketchFeature_=t,this.sketchCoords_=e.getCoordinates();var n=this.sketchCoords_[this.sketchCoords_.length-1];this.finishCoordinate_=n.slice(),this.sketchCoords_.push(n.slice()),this.sketchPoint_=new s.a(new y.a(n)),this.updateSketchFeatures_(),this.dispatchEvent(new j(R,this.sketchFeature_))},e.prototype.updateSketchFeatures_=function(){var t=[];this.sketchFeature_&&t.push(this.sketchFeature_),this.sketchLine_&&t.push(this.sketchLine_),this.sketchPoint_&&t.push(this.sketchPoint_);var e=this.overlay_.getSource();e.clear(!0),e.addFeatures(t)},e.prototype.updateState_=function(){var t=this.getMap(),e=this.getActive();t&&e||this.abortDrawing(),this.overlay_.setMap(e?t:null)},e}(m.b);e.a=A},function(t,e,n){"use strict";var r,i=n(37),o=n(49),a=n(40),s=n(9),l=n(26),u=n(1),c=n(29),h=n(31),p=n(38),d=n(138),f=n(64),g=n(65),y=n(66),m=n(20),v=n(0),_=n(21),b=n(41),w=n(7),x=n(22),E=n(2),S=n(4),O=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),C=[0,0,0,0],T=[],I="modifystart",L="modifyend",P=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.features=n,i.mapBrowserEvent=r,i}return O(e,t),e}(a.a),R=function(t){function e(e){var n,r,a=t.call(this,e)||this;if(a.on,a.once,a.un,a.boundHandleFeatureChange_=a.handleFeatureChange_.bind(a),a.condition_=e.condition?e.condition:m.l,a.defaultDeleteCondition_=function(t){return Object(m.b)(t)&&Object(m.n)(t)},a.deleteCondition_=e.deleteCondition?e.deleteCondition:a.defaultDeleteCondition_,a.insertVertexCondition_=e.insertVertexCondition?e.insertVertexCondition:m.d,a.vertexFeature_=null,a.vertexSegments_=null,a.lastPixel_=[0,0],a.ignoreNextSingleClick_=!1,a.featuresBeingModified_=null,a.rBush_=new d.a,a.pixelTolerance_=void 0!==e.pixelTolerance?e.pixelTolerance:10,a.snappedToVertex_=!1,a.changingFeature_=!1,a.dragSegments_=[],a.overlay_=new g.a({source:new y.a({useSpatialIndex:!1,wrapX:!!e.wrapX}),style:e.style?e.style:(n=Object(b.b)(),function(t,e){return n[u.a.POINT]}),updateWhileAnimating:!0,updateWhileInteracting:!0}),a.SEGMENT_WRITERS_={Point:a.writePointGeometry_.bind(a),LineString:a.writeLineStringGeometry_.bind(a),LinearRing:a.writeLineStringGeometry_.bind(a),Polygon:a.writePolygonGeometry_.bind(a),MultiPoint:a.writeMultiPointGeometry_.bind(a),MultiLineString:a.writeMultiLineStringGeometry_.bind(a),MultiPolygon:a.writeMultiPolygonGeometry_.bind(a),Circle:a.writeCircleGeometry_.bind(a),GeometryCollection:a.writeGeometryCollectionGeometry_.bind(a)},a.source_=null,a.hitDetection_=null,e.features?r=e.features:e.source&&(a.source_=e.source,r=new i.a(a.source_.getFeatures()),a.source_.addEventListener(f.a.ADDFEATURE,a.handleSourceAdd_.bind(a)),a.source_.addEventListener(f.a.REMOVEFEATURE,a.handleSourceRemove_.bind(a))),!r)throw new Error("The modify interaction requires features, a source or a layer");return e.hitDetection&&(a.hitDetection_=e.hitDetection),a.features_=r,a.features_.forEach(a.addFeature_.bind(a)),a.features_.addEventListener(o.a.ADD,a.handleFeatureAdd_.bind(a)),a.features_.addEventListener(o.a.REMOVE,a.handleFeatureRemove_.bind(a)),a.lastPointerEvent_=null,a.delta_=[0,0],a.snapToPointer_=void 0===e.snapToPointer?!a.hitDetection_:e.snapToPointer,a}return O(e,t),e.prototype.addFeature_=function(t){var e=t.getGeometry();if(e){var n=this.SEGMENT_WRITERS_[e.getType()];n&&n(t,e)}var r=this.getMap();r&&r.isRendered()&&this.getActive()&&this.handlePointerAtPixel_(this.lastPixel_,r),t.addEventListener(s.a.CHANGE,this.boundHandleFeatureChange_)},e.prototype.willModifyFeatures_=function(t,e){if(!this.featuresBeingModified_){this.featuresBeingModified_=new i.a;for(var n=this.featuresBeingModified_.getArray(),r=0,o=e.length;r<o;++r)for(var a=e[r],s=0,l=a.length;s<l;++s){var u=a[s].feature;u&&-1===n.indexOf(u)&&this.featuresBeingModified_.push(u)}0===this.featuresBeingModified_.getLength()?this.featuresBeingModified_=null:this.dispatchEvent(new P(I,this.featuresBeingModified_,t))}},e.prototype.removeFeature_=function(t){this.removeFeatureSegmentData_(t),this.vertexFeature_&&0===this.features_.getLength()&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),t.removeEventListener(s.a.CHANGE,this.boundHandleFeatureChange_)},e.prototype.removeFeatureSegmentData_=function(t){var e=this.rBush_,n=[];e.forEach((function(e){t===e.feature&&n.push(e)}));for(var r=n.length-1;r>=0;--r){for(var i=n[r],o=this.dragSegments_.length-1;o>=0;--o)this.dragSegments_[o][0]===i&&this.dragSegments_.splice(o,1);e.remove(i)}},e.prototype.setActive=function(e){this.vertexFeature_&&!e&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),t.prototype.setActive.call(this,e)},e.prototype.setMap=function(e){this.overlay_.setMap(e),t.prototype.setMap.call(this,e)},e.prototype.getOverlay=function(){return this.overlay_},e.prototype.handleSourceAdd_=function(t){t.feature&&this.features_.push(t.feature)},e.prototype.handleSourceRemove_=function(t){t.feature&&this.features_.remove(t.feature)},e.prototype.handleFeatureAdd_=function(t){this.addFeature_(t.element)},e.prototype.handleFeatureChange_=function(t){if(!this.changingFeature_){var e=t.target;this.removeFeature_(e),this.addFeature_(e)}},e.prototype.handleFeatureRemove_=function(t){var e=t.element;this.removeFeature_(e)},e.prototype.writePointGeometry_=function(t,e){var n=e.getCoordinates(),r={feature:t,geometry:e,segment:[n,n]};this.rBush_.insert(e.getExtent(),r)},e.prototype.writeMultiPointGeometry_=function(t,e){for(var n=e.getCoordinates(),r=0,i=n.length;r<i;++r){var o=n[r],a={feature:t,geometry:e,depth:[r],index:r,segment:[o,o]};this.rBush_.insert(e.getExtent(),a)}},e.prototype.writeLineStringGeometry_=function(t,e){for(var n=e.getCoordinates(),r=0,i=n.length-1;r<i;++r){var o=n.slice(r,r+2),a={feature:t,geometry:e,index:r,segment:o};this.rBush_.insert(Object(v.boundingExtent)(o),a)}},e.prototype.writeMultiLineStringGeometry_=function(t,e){for(var n=e.getCoordinates(),r=0,i=n.length;r<i;++r)for(var o=n[r],a=0,s=o.length-1;a<s;++a){var l=o.slice(a,a+2),u={feature:t,geometry:e,depth:[r],index:a,segment:l};this.rBush_.insert(Object(v.boundingExtent)(l),u)}},e.prototype.writePolygonGeometry_=function(t,e){for(var n=e.getCoordinates(),r=0,i=n.length;r<i;++r)for(var o=n[r],a=0,s=o.length-1;a<s;++a){var l=o.slice(a,a+2),u={feature:t,geometry:e,depth:[r],index:a,segment:l};this.rBush_.insert(Object(v.boundingExtent)(l),u)}},e.prototype.writeMultiPolygonGeometry_=function(t,e){for(var n=e.getCoordinates(),r=0,i=n.length;r<i;++r)for(var o=n[r],a=0,s=o.length;a<s;++a)for(var l=o[a],u=0,c=l.length-1;u<c;++u){var h=l.slice(u,u+2),p={feature:t,geometry:e,depth:[a,r],index:u,segment:h};this.rBush_.insert(Object(v.boundingExtent)(h),p)}},e.prototype.writeCircleGeometry_=function(t,e){var n=e.getCenter(),r={feature:t,geometry:e,index:0,segment:[n,n]},i={feature:t,geometry:e,index:1,segment:[n,n]},o=[r,i];r.featureSegments=o,i.featureSegments=o,this.rBush_.insert(Object(v.createOrUpdateFromCoordinate)(n),r);var a=e,s=Object(E.getUserProjection)();if(s&&this.getMap()){var l=this.getMap().getView().getProjection();a=a.clone().transform(s,l),a=Object(x.b)(a).transform(l,s)}this.rBush_.insert(a.getExtent(),i)},e.prototype.writeGeometryCollectionGeometry_=function(t,e){for(var n=e.getGeometriesArray(),r=0;r<n.length;++r){var i=n[r];(0,this.SEGMENT_WRITERS_[i.getType()])(t,i)}},e.prototype.createOrUpdateVertexFeature_=function(t,e,n){var r=this.vertexFeature_;r?r.getGeometry().setCoordinates(t):(r=new l.a(new h.a(t)),this.vertexFeature_=r,this.overlay_.getSource().addFeature(r));return r.set("features",e),r.set("geometries",n),r},e.prototype.handleEvent=function(e){return!e.originalEvent||(this.lastPointerEvent_=e,e.map.getView().getInteracting()||e.type!=c.a.POINTERMOVE||this.handlingDownUpSequence||this.handlePointerMove_(e),this.vertexFeature_&&this.deleteCondition_(e)&&(n=!(e.type!=c.a.SINGLECLICK||!this.ignoreNextSingleClick_)||this.removePoint()),e.type==c.a.SINGLECLICK&&(this.ignoreNextSingleClick_=!1),t.prototype.handleEvent.call(this,e)&&!n);var n},e.prototype.handleDragEvent=function(t){this.ignoreNextSingleClick_=!1,this.willModifyFeatures_(t,this.dragSegments_);for(var e=[t.coordinate[0]+this.delta_[0],t.coordinate[1]+this.delta_[1]],n=[],r=[],i=0,o=this.dragSegments_.length;i<o;++i){var a=this.dragSegments_[i],s=a[0],l=s.feature;-1===n.indexOf(l)&&n.push(l);var c=s.geometry;-1===r.indexOf(c)&&r.push(c);for(var h=s.depth,p=void 0,d=s.segment,f=a[1];e.length<c.getStride();)e.push(d[f][e.length]);switch(c.getType()){case u.a.POINT:p=e,d[0]=e,d[1]=e;break;case u.a.MULTI_POINT:(p=c.getCoordinates())[s.index]=e,d[0]=e,d[1]=e;break;case u.a.LINE_STRING:(p=c.getCoordinates())[s.index+f]=e,d[f]=e;break;case u.a.MULTI_LINE_STRING:case u.a.POLYGON:(p=c.getCoordinates())[h[0]][s.index+f]=e,d[f]=e;break;case u.a.MULTI_POLYGON:(p=c.getCoordinates())[h[1]][h[0]][s.index+f]=e,d[f]=e;break;case u.a.CIRCLE:if(d[0]=e,d[1]=e,0===s.index)this.changingFeature_=!0,c.setCenter(e),this.changingFeature_=!1;else{this.changingFeature_=!0;var g=t.map.getView().getProjection(),y=Object(_.e)(Object(E.fromUserCoordinate)(c.getCenter(),g),Object(E.fromUserCoordinate)(e,g)),m=Object(E.getUserProjection)();if(m){var v=c.clone().transform(m,g);v.setRadius(y),y=v.transform(g,m).getRadius()}c.setRadius(y),this.changingFeature_=!1}}p&&this.setGeometryCoordinates_(c,p)}this.createOrUpdateVertexFeature_(e,n,r)},e.prototype.handleDownEvent=function(t){if(!this.condition_(t))return!1;var e=t.coordinate;this.handlePointerAtPixel_(t.pixel,t.map,e),this.dragSegments_.length=0,this.featuresBeingModified_=null;var n=this.vertexFeature_;if(n){var r=t.map.getView().getProjection(),i=[],o=n.getGeometry().getCoordinates(),a=Object(v.boundingExtent)([o]),s=this.rBush_.getInExtent(a),l={};s.sort(M);for(var c=0,h=s.length;c<h;++c){var p=s[c],d=p.segment,f=Object(S.c)(p.geometry),g=p.depth;if(g&&(f+="-"+g.join("-")),l[f]||(l[f]=new Array(2)),p.geometry.getType()!==u.a.CIRCLE||1!==p.index)if(!Object(_.f)(d[0],o)||l[f][0])if(!Object(_.f)(d[1],o)||l[f][1])Object(S.c)(d)in this.vertexSegments_&&!l[f][0]&&!l[f][1]&&this.insertVertexCondition_(t)&&i.push(p);else{if((p.geometry.getType()===u.a.LINE_STRING||p.geometry.getType()===u.a.MULTI_LINE_STRING)&&l[f][0]&&0===l[f][0].index)continue;this.dragSegments_.push([p,1]),l[f][1]=p}else this.dragSegments_.push([p,0]),l[f][0]=p;else{var y=j(e,p,r);Object(_.f)(y,o)&&!l[f][0]&&(this.dragSegments_.push([p,0]),l[f][0]=p)}}i.length&&this.willModifyFeatures_(t,[i]);for(var m=i.length-1;m>=0;--m)this.insertVertex_(i[m],o)}return!!this.vertexFeature_},e.prototype.handleUpEvent=function(t){for(var e=this.dragSegments_.length-1;e>=0;--e){var n=this.dragSegments_[e][0],r=n.geometry;if(r.getType()===u.a.CIRCLE){var i=r.getCenter(),o=n.featureSegments[0],a=n.featureSegments[1];o.segment[0]=i,o.segment[1]=i,a.segment[0]=i,a.segment[1]=i,this.rBush_.update(Object(v.createOrUpdateFromCoordinate)(i),o);var s=r,l=Object(E.getUserProjection)();if(l){var c=t.map.getView().getProjection();s=s.clone().transform(l,c),s=Object(x.b)(s).transform(c,l)}this.rBush_.update(s.getExtent(),a)}else this.rBush_.update(Object(v.boundingExtent)(n.segment),n)}return this.featuresBeingModified_&&(this.dispatchEvent(new P(L,this.featuresBeingModified_,t)),this.featuresBeingModified_=null),!1},e.prototype.handlePointerMove_=function(t){this.lastPixel_=t.pixel,this.handlePointerAtPixel_(t.pixel,t.map,t.coordinate)},e.prototype.handlePointerAtPixel_=function(t,e,n){var r,i,o=this,a=n||e.getCoordinateFromPixel(t),s=e.getView().getProjection();if(this.hitDetection_){var l="object"==typeof this.hitDetection_?function(t){return t===o.hitDetection_}:void 0;e.forEachFeatureAtPixel(t,(function(t,e,n){if((n=n||t.getGeometry()).getType()===u.a.POINT&&Object(w.f)(o.features_.getArray(),t)){i=n;var a=n.getFlatCoordinates().slice(0,2);r=[{feature:t,geometry:n,segment:[a,a]}]}return!0}),{layerFilter:l})}if(!r){var c=Object(E.fromUserExtent)(Object(v.createOrUpdateFromCoordinate)(a,C),s),h=e.getView().getResolution()*this.pixelTolerance_,p=Object(E.toUserExtent)(Object(v.buffer)(c,h,C),s);r=this.rBush_.getInExtent(p)}if(r&&r.length>0){var d=r.sort((function(t,e){return N(a,t,s)-N(a,e,s)}))[0],f=d.segment,g=j(a,d,s),y=e.getPixelFromCoordinate(g),m=Object(_.e)(t,y);if(i||m<=this.pixelTolerance_){var b={};if(b[Object(S.c)(f)]=!0,this.snapToPointer_||(this.delta_[0]=g[0]-a[0],this.delta_[1]=g[1]-a[1]),d.geometry.getType()===u.a.CIRCLE&&1===d.index)this.snappedToVertex_=!0,this.createOrUpdateVertexFeature_(g,[d.feature],[d.geometry]);else{var x=e.getPixelFromCoordinate(f[0]),O=e.getPixelFromCoordinate(f[1]),T=Object(_.j)(y,x),I=Object(_.j)(y,O);m=Math.sqrt(Math.min(T,I)),this.snappedToVertex_=m<=this.pixelTolerance_,this.snappedToVertex_&&(g=T>I?f[1]:f[0]),this.createOrUpdateVertexFeature_(g,[d.feature],[d.geometry]);var L={};L[Object(S.c)(d.geometry)]=!0;for(var P=1,R=r.length;P<R;++P){var M=r[P].segment;if(!(Object(_.f)(f[0],M[0])&&Object(_.f)(f[1],M[1])||Object(_.f)(f[0],M[1])&&Object(_.f)(f[1],M[0])))break;var A=Object(S.c)(r[P].geometry);A in L||(L[A]=!0,b[Object(S.c)(M)]=!0)}}return void(this.vertexSegments_=b)}}this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null)},e.prototype.insertVertex_=function(t,e){for(var n,r=t.segment,i=t.feature,o=t.geometry,a=t.depth,s=t.index;e.length<o.getStride();)e.push(0);switch(o.getType()){case u.a.MULTI_LINE_STRING:case u.a.POLYGON:(n=o.getCoordinates())[a[0]].splice(s+1,0,e);break;case u.a.MULTI_POLYGON:(n=o.getCoordinates())[a[1]][a[0]].splice(s+1,0,e);break;case u.a.LINE_STRING:(n=o.getCoordinates()).splice(s+1,0,e);break;default:return}this.setGeometryCoordinates_(o,n);var l=this.rBush_;l.remove(t),this.updateSegmentIndices_(o,s,a,1);var c={segment:[r[0],e],feature:i,geometry:o,depth:a,index:s};l.insert(Object(v.boundingExtent)(c.segment),c),this.dragSegments_.push([c,1]);var h={segment:[e,r[1]],feature:i,geometry:o,depth:a,index:s+1};l.insert(Object(v.boundingExtent)(h.segment),h),this.dragSegments_.push([h,0]),this.ignoreNextSingleClick_=!0},e.prototype.removePoint=function(){if(this.lastPointerEvent_&&this.lastPointerEvent_.type!=c.a.POINTERDRAG){var t=this.lastPointerEvent_;this.willModifyFeatures_(t,this.dragSegments_);var e=this.removeVertex_();return this.dispatchEvent(new P(L,this.featuresBeingModified_,t)),this.featuresBeingModified_=null,e}return!1},e.prototype.removeVertex_=function(){var t,e,n,r,i,o,a,s,l,c,h,p=this.dragSegments_,d={},f=!1;for(i=p.length-1;i>=0;--i)c=(n=p[i])[0],h=Object(S.c)(c.feature),c.depth&&(h+="-"+c.depth.join("-")),h in d||(d[h]={}),0===n[1]?(d[h].right=c,d[h].index=c.index):1==n[1]&&(d[h].left=c,d[h].index=c.index+1);for(h in d){switch(l=d[h].right,a=d[h].left,(s=(o=d[h].index)-1)<0&&(s=0),t=e=(r=(c=void 0!==a?a:l).geometry).getCoordinates(),f=!1,r.getType()){case u.a.MULTI_LINE_STRING:e[c.depth[0]].length>2&&(e[c.depth[0]].splice(o,1),f=!0);break;case u.a.LINE_STRING:e.length>2&&(e.splice(o,1),f=!0);break;case u.a.MULTI_POLYGON:t=t[c.depth[1]];case u.a.POLYGON:(t=t[c.depth[0]]).length>4&&(o==t.length-1&&(o=0),t.splice(o,1),f=!0,0===o&&(t.pop(),t.push(t[0]),s=t.length-1))}if(f){this.setGeometryCoordinates_(r,e);var g=[];if(void 0!==a&&(this.rBush_.remove(a),g.push(a.segment[0])),void 0!==l&&(this.rBush_.remove(l),g.push(l.segment[1])),void 0!==a&&void 0!==l){var y={depth:c.depth,feature:c.feature,geometry:c.geometry,index:s,segment:g};this.rBush_.insert(Object(v.boundingExtent)(y.segment),y)}this.updateSegmentIndices_(r,o,c.depth,-1),this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),p.length=0}}return f},e.prototype.setGeometryCoordinates_=function(t,e){this.changingFeature_=!0,t.setCoordinates(e),this.changingFeature_=!1},e.prototype.updateSegmentIndices_=function(t,e,n,r){this.rBush_.forEachInExtent(t.getExtent(),(function(i){i.geometry===t&&(void 0===n||void 0===i.depth||Object(w.b)(i.depth,n))&&i.index>e&&(i.index+=r)}))},e}(p.b);function M(t,e){return t.index-e.index}function N(t,e,n){var r=e.geometry;if(r.getType()===u.a.CIRCLE){var i=r;if(1===e.index){var o=Object(E.getUserProjection)();o&&(i=i.clone().transform(o,n));var a=Object(_.j)(i.getCenter(),Object(E.fromUserCoordinate)(t,n)),s=Math.sqrt(a)-i.getRadius();return s*s}}var l=Object(E.fromUserCoordinate)(t,n);return T[0]=Object(E.fromUserCoordinate)(e.segment[0],n),T[1]=Object(E.fromUserCoordinate)(e.segment[1],n),Object(_.k)(l,T)}function j(t,e,n){var r=e.geometry;if(r.getType()===u.a.CIRCLE&&1===e.index){var i=r,o=Object(E.getUserProjection)();return o&&(i=i.clone().transform(o,n)),Object(E.toUserCoordinate)(i.getClosestPoint(Object(E.fromUserCoordinate)(t,n)),n)}var a=Object(E.fromUserCoordinate)(t,n);return T[0]=Object(E.fromUserCoordinate)(e.segment[0],n),T[1]=Object(E.fromUserCoordinate)(e.segment[1],n),Object(E.toUserCoordinate)(Object(_.c)(a,T),n)}e.a=R},function(t,e,n){"use strict";var r,i=n(37),o=n(49),a=n(40),s=n(1),l=n(70),u=n(30),c=n(6),h=n(41),p=n(7),d=n(4),f=n(20),g=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),y="select",m=function(t){function e(e,n,r,i){var o=t.call(this,e)||this;return o.selected=n,o.deselected=r,o.mapBrowserEvent=i,o}return g(e,t),e}(a.a),v={},_=function(t){function e(e){var n=t.call(this)||this;n.on,n.once,n.un;var r,o,a=e||{};if(n.boundAddFeature_=n.addFeature_.bind(n),n.boundRemoveFeature_=n.removeFeature_.bind(n),n.condition_=a.condition?a.condition:f.n,n.addCondition_=a.addCondition?a.addCondition:f.i,n.removeCondition_=a.removeCondition?a.removeCondition:f.i,n.toggleCondition_=a.toggleCondition?a.toggleCondition:f.m,n.multi_=!!a.multi&&a.multi,n.filter_=a.filter?a.filter:u.b,n.hitTolerance_=a.hitTolerance?a.hitTolerance:0,n.style_=void 0!==a.style?a.style:(r=Object(h.b)(),Object(p.c)(r[s.a.POLYGON],r[s.a.LINE_STRING]),Object(p.c)(r[s.a.GEOMETRY_COLLECTION],r[s.a.LINE_STRING]),function(t){return t.getGeometry()?r[t.getGeometry().getType()]:null}),n.features_=a.features||new i.a,a.layers)if("function"==typeof a.layers)o=a.layers;else{var l=a.layers;o=function(t){return Object(p.f)(l,t)}}else o=u.b;return n.layerFilter_=o,n.featureLayerAssociation_={},n}return g(e,t),e.prototype.addFeatureLayerAssociation_=function(t,e){this.featureLayerAssociation_[Object(d.c)(t)]=e},e.prototype.getFeatures=function(){return this.features_},e.prototype.getHitTolerance=function(){return this.hitTolerance_},e.prototype.getLayer=function(t){return this.featureLayerAssociation_[Object(d.c)(t)]},e.prototype.setHitTolerance=function(t){this.hitTolerance_=t},e.prototype.setMap=function(e){this.getMap()&&this.style_&&this.features_.forEach(this.restorePreviousStyle_.bind(this)),t.prototype.setMap.call(this,e),e?(this.features_.addEventListener(o.a.ADD,this.boundAddFeature_),this.features_.addEventListener(o.a.REMOVE,this.boundRemoveFeature_),this.style_&&this.features_.forEach(this.applySelectedStyle_.bind(this))):(this.features_.removeEventListener(o.a.ADD,this.boundAddFeature_),this.features_.removeEventListener(o.a.REMOVE,this.boundRemoveFeature_))},e.prototype.addFeature_=function(t){var e=t.element;this.style_&&this.applySelectedStyle_(e)},e.prototype.removeFeature_=function(t){var e=t.element;this.style_&&this.restorePreviousStyle_(e)},e.prototype.getStyle=function(){return this.style_},e.prototype.applySelectedStyle_=function(t){var e=Object(d.c)(t);e in v||(v[e]=t.getStyle()),t.setStyle(this.style_)},e.prototype.restorePreviousStyle_=function(t){for(var n=this.getMap().getInteractions().getArray(),r=n.length-1;r>=0;--r){var i=n[r];if(i!==this&&i instanceof e&&i.getStyle()&&-1!==i.getFeatures().getArray().lastIndexOf(t))return void t.setStyle(i.getStyle())}var o=Object(d.c)(t);t.setStyle(v[o]),delete v[o]},e.prototype.removeFeatureLayerAssociation_=function(t){delete this.featureLayerAssociation_[Object(d.c)(t)]},e.prototype.handleEvent=function(t){if(!this.condition_(t))return!0;var e=this.addCondition_(t),n=this.removeCondition_(t),r=this.toggleCondition_(t),i=!e&&!n&&!r,o=t.map,a=this.getFeatures(),s=[],l=[];if(i){Object(c.b)(this.featureLayerAssociation_),o.forEachFeatureAtPixel(t.pixel,function(t,e){if(this.filter_(t,e))return l.push(t),this.addFeatureLayerAssociation_(t,e),!this.multi_}.bind(this),{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_});for(var u=a.getLength()-1;u>=0;--u){var h=a.item(u),d=l.indexOf(h);d>-1?l.splice(d,1):(a.remove(h),s.push(h))}0!==l.length&&a.extend(l)}else{o.forEachFeatureAtPixel(t.pixel,function(t,i){if(this.filter_(t,i))return!e&&!r||Object(p.f)(a.getArray(),t)?(n||r)&&Object(p.f)(a.getArray(),t)&&(s.push(t),this.removeFeatureLayerAssociation_(t)):(l.push(t),this.addFeatureLayerAssociation_(t,i)),!this.multi_}.bind(this),{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_});for(var f=s.length-1;f>=0;--f)a.remove(s[f]);a.extend(l)}return(l.length>0||s.length>0)&&this.dispatchEvent(new m(y,l,s,t)),!0},e}(l.a);e.a=_},function(t,e,n){"use strict";var r,i=n(49),o=n(9),a=n(1),s=n(38),l=n(138),u=n(64),c=n(30),h=n(0),p=n(21),d=n(22),f=n(2),g=n(4),y=n(6),m=n(10),v=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});function _(t){return t.feature?t.feature:t.element?t.element:void 0}var b=[],w=function(t){function e(e){var n=this,r=e||{},i=r;return i.handleDownEvent||(i.handleDownEvent=c.b),i.stopDown||(i.stopDown=c.a),(n=t.call(this,i)||this).source_=r.source?r.source:null,n.vertex_=void 0===r.vertex||r.vertex,n.edge_=void 0===r.edge||r.edge,n.features_=r.features?r.features:null,n.featuresListenerKeys_=[],n.featureChangeListenerKeys_={},n.indexedFeaturesExtents_={},n.pendingFeatures_={},n.pixelTolerance_=void 0!==r.pixelTolerance?r.pixelTolerance:10,n.rBush_=new l.a,n.SEGMENT_WRITERS_={Point:n.writePointGeometry_.bind(n),LineString:n.writeLineStringGeometry_.bind(n),LinearRing:n.writeLineStringGeometry_.bind(n),Polygon:n.writePolygonGeometry_.bind(n),MultiPoint:n.writeMultiPointGeometry_.bind(n),MultiLineString:n.writeMultiLineStringGeometry_.bind(n),MultiPolygon:n.writeMultiPolygonGeometry_.bind(n),GeometryCollection:n.writeGeometryCollectionGeometry_.bind(n),Circle:n.writeCircleGeometry_.bind(n)},n}return v(e,t),e.prototype.addFeature=function(t,e){var n=void 0===e||e,r=Object(g.c)(t),i=t.getGeometry();if(i){var a=this.SEGMENT_WRITERS_[i.getType()];a&&(this.indexedFeaturesExtents_[r]=i.getExtent(Object(h.createEmpty)()),a(t,i))}n&&(this.featureChangeListenerKeys_[r]=Object(m.listen)(t,o.a.CHANGE,this.handleFeatureChange_,this))},e.prototype.forEachFeatureAdd_=function(t){this.addFeature(t)},e.prototype.forEachFeatureRemove_=function(t){this.removeFeature(t)},e.prototype.getFeatures_=function(){var t;return this.features_?t=this.features_:this.source_&&(t=this.source_.getFeatures()),t},e.prototype.handleEvent=function(e){var n=this.snapTo(e.pixel,e.coordinate,e.map);return n.snapped&&(e.coordinate=n.vertex.slice(0,2),e.pixel=n.vertexPixel),t.prototype.handleEvent.call(this,e)},e.prototype.handleFeatureAdd_=function(t){var e=_(t);this.addFeature(e)},e.prototype.handleFeatureRemove_=function(t){var e=_(t);this.removeFeature(e)},e.prototype.handleFeatureChange_=function(t){var e=t.target;if(this.handlingDownUpSequence){var n=Object(g.c)(e);n in this.pendingFeatures_||(this.pendingFeatures_[n]=e)}else this.updateFeature_(e)},e.prototype.handleUpEvent=function(t){var e=Object(y.c)(this.pendingFeatures_);return e.length&&(e.forEach(this.updateFeature_.bind(this)),this.pendingFeatures_={}),!1},e.prototype.removeFeature=function(t,e){var n=void 0===e||e,r=Object(g.c)(t),i=this.indexedFeaturesExtents_[r];if(i){var o=this.rBush_,a=[];o.forEachInExtent(i,(function(e){t===e.feature&&a.push(e)}));for(var s=a.length-1;s>=0;--s)o.remove(a[s])}n&&(Object(m.unlistenByKey)(this.featureChangeListenerKeys_[r]),delete this.featureChangeListenerKeys_[r])},e.prototype.setMap=function(e){var n=this.getMap(),r=this.featuresListenerKeys_,o=this.getFeatures_();n&&(r.forEach(m.unlistenByKey),r.length=0,o.forEach(this.forEachFeatureRemove_.bind(this))),t.prototype.setMap.call(this,e),e&&(this.features_?r.push(Object(m.listen)(this.features_,i.a.ADD,this.handleFeatureAdd_,this),Object(m.listen)(this.features_,i.a.REMOVE,this.handleFeatureRemove_,this)):this.source_&&r.push(Object(m.listen)(this.source_,u.a.ADDFEATURE,this.handleFeatureAdd_,this),Object(m.listen)(this.source_,u.a.REMOVEFEATURE,this.handleFeatureRemove_,this)),o.forEach(this.forEachFeatureAdd_.bind(this)))},e.prototype.snapTo=function(t,e,n){var r=n.getCoordinateFromPixel([t[0]-this.pixelTolerance_,t[1]+this.pixelTolerance_]),i=n.getCoordinateFromPixel([t[0]+this.pixelTolerance_,t[1]-this.pixelTolerance_]),o=Object(h.boundingExtent)([r,i]),s=this.rBush_.getInExtent(o);this.vertex_&&!this.edge_&&(s=s.filter((function(t){return t.feature.getGeometry().getType()!==a.a.CIRCLE})));var l=!1,u=null,c=null;if(0===s.length)return{snapped:l,vertex:u,vertexPixel:c};for(var d,g=n.getView().getProjection(),y=Object(f.fromUserCoordinate)(e,g),m=1/0,v=0;v<s.length;++v){var _=s[v];b[0]=Object(f.fromUserCoordinate)(_.segment[0],g),b[1]=Object(f.fromUserCoordinate)(_.segment[1],g);var w=Object(p.k)(y,b);w<m&&(d=_,m=w)}var x=d.segment;if(this.vertex_&&!this.edge_){var E=n.getPixelFromCoordinate(x[0]),S=n.getPixelFromCoordinate(x[1]),O=Object(p.j)(t,E),C=Object(p.j)(t,S);Math.sqrt(Math.min(O,C))<=this.pixelTolerance_&&(l=!0,u=O>C?x[1]:x[0],c=n.getPixelFromCoordinate(u))}else if(this.edge_){var T=d.feature.getGeometry().getType()===a.a.CIRCLE;if(T){var I=d.feature.getGeometry(),L=Object(f.getUserProjection)();L&&(I=I.clone().transform(L,g)),u=Object(f.toUserCoordinate)(Object(p.b)(y,I),g)}else b[0]=Object(f.fromUserCoordinate)(x[0],g),b[1]=Object(f.fromUserCoordinate)(x[1],g),u=Object(f.toUserCoordinate)(Object(p.c)(y,b),g);if(c=n.getPixelFromCoordinate(u),Object(p.e)(t,c)<=this.pixelTolerance_&&(l=!0,this.vertex_&&!T)){E=n.getPixelFromCoordinate(x[0]),S=n.getPixelFromCoordinate(x[1]),O=Object(p.j)(c,E),C=Object(p.j)(c,S);Math.sqrt(Math.min(O,C))<=this.pixelTolerance_&&(u=O>C?x[1]:x[0],c=n.getPixelFromCoordinate(u))}}return l&&(c=[Math.round(c[0]),Math.round(c[1])]),{snapped:l,vertex:u,vertexPixel:c}},e.prototype.updateFeature_=function(t){this.removeFeature(t,!1),this.addFeature(t,!1)},e.prototype.writeCircleGeometry_=function(t,e){var n=this.getMap().getView().getProjection(),r=e,i=Object(f.getUserProjection)();i&&(r=r.clone().transform(i,n));var o=Object(d.b)(r);i&&o.transform(n,i);for(var a=o.getCoordinates()[0],s=0,l=a.length-1;s<l;++s){var u=a.slice(s,s+2),c={feature:t,segment:u};this.rBush_.insert(Object(h.boundingExtent)(u),c)}},e.prototype.writeGeometryCollectionGeometry_=function(t,e){for(var n=e.getGeometriesArray(),r=0;r<n.length;++r){var i=this.SEGMENT_WRITERS_[n[r].getType()];i&&i(t,n[r])}},e.prototype.writeLineStringGeometry_=function(t,e){for(var n=e.getCoordinates(),r=0,i=n.length-1;r<i;++r){var o=n.slice(r,r+2),a={feature:t,segment:o};this.rBush_.insert(Object(h.boundingExtent)(o),a)}},e.prototype.writeMultiLineStringGeometry_=function(t,e){for(var n=e.getCoordinates(),r=0,i=n.length;r<i;++r)for(var o=n[r],a=0,s=o.length-1;a<s;++a){var l=o.slice(a,a+2),u={feature:t,segment:l};this.rBush_.insert(Object(h.boundingExtent)(l),u)}},e.prototype.writeMultiPointGeometry_=function(t,e){for(var n=e.getCoordinates(),r=0,i=n.length;r<i;++r){var o=n[r],a={feature:t,segment:[o,o]};this.rBush_.insert(e.getExtent(),a)}},e.prototype.writeMultiPolygonGeometry_=function(t,e){for(var n=e.getCoordinates(),r=0,i=n.length;r<i;++r)for(var o=n[r],a=0,s=o.length;a<s;++a)for(var l=o[a],u=0,c=l.length-1;u<c;++u){var p=l.slice(u,u+2),d={feature:t,segment:p};this.rBush_.insert(Object(h.boundingExtent)(p),d)}},e.prototype.writePointGeometry_=function(t,e){var n=e.getCoordinates(),r={feature:t,segment:[n,n]};this.rBush_.insert(e.getExtent(),r)},e.prototype.writePolygonGeometry_=function(t,e){for(var n=e.getCoordinates(),r=0,i=n.length;r<i;++r)for(var o=n[r],a=0,s=o.length-1;a<s;++a){var l=o.slice(a,a+2),u={feature:t,segment:l};this.rBush_.insert(Object(h.boundingExtent)(l),u)}},e}(s.b);e.a=w},function(t,e,n){"use strict";var r,i=n(26),o=n(90),a=n(16),s=n(1),l=n(43),u=n(58),c=n(69),h=n(68),p=n(31),d=n(22),f=n(158),g=n(33),y=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),m={POINT:p.a,LINESTRING:l.a,POLYGON:d.a,MULTIPOINT:c.a,MULTILINESTRING:u.a,MULTIPOLYGON:h.a},v=0,_=1,b=2,w=3,x=4,E=5,S=6,O={};for(var C in s.a)O[C]=s.a[C].toUpperCase();var T=function(){function t(t){this.wkt=t,this.index_=-1}return t.prototype.isAlpha_=function(t){return t>="a"&&t<="z"||t>="A"&&t<="Z"},t.prototype.isNumeric_=function(t,e){return t>="0"&&t<="9"||"."==t&&!(void 0!==e&&e)},t.prototype.isWhiteSpace_=function(t){return" "==t||"\t"==t||"\r"==t||"\n"==t},t.prototype.nextChar_=function(){return this.wkt.charAt(++this.index_)},t.prototype.nextToken=function(){var t,e=this.nextChar_(),n=this.index_,r=e;if("("==e)t=b;else if(","==e)t=E;else if(")"==e)t=w;else if(this.isNumeric_(e)||"-"==e)t=x,r=this.readNumber_();else if(this.isAlpha_(e))t=_,r=this.readText_();else{if(this.isWhiteSpace_(e))return this.nextToken();if(""!==e)throw new Error("Unexpected character: "+e);t=S}return{position:n,value:r,type:t}},t.prototype.readNumber_=function(){var t,e=this.index_,n=!1,r=!1;do{"."==t?n=!0:"e"!=t&&"E"!=t||(r=!0),t=this.nextChar_()}while(this.isNumeric_(t,n)||!r&&("e"==t||"E"==t)||r&&("-"==t||"+"==t));return parseFloat(this.wkt.substring(e,this.index_--))},t.prototype.readText_=function(){var t,e=this.index_;do{t=this.nextChar_()}while(this.isAlpha_(t));return this.wkt.substring(e,this.index_--).toUpperCase()},t}(),I=function(){function t(t){this.lexer_=t,this.token_={position:0,type:v},this.layout_=a.a.XY}return t.prototype.consume_=function(){this.token_=this.lexer_.nextToken()},t.prototype.isTokenType=function(t){return this.token_.type==t},t.prototype.match=function(t){var e=this.isTokenType(t);return e&&this.consume_(),e},t.prototype.parse=function(){return this.consume_(),this.parseGeometry_()},t.prototype.parseGeometryLayout_=function(){var t=a.a.XY,e=this.token_;if(this.isTokenType(_)){var n=e.value;"Z"===n?t=a.a.XYZ:"M"===n?t=a.a.XYM:"ZM"===n&&(t=a.a.XYZM),t!==a.a.XY&&this.consume_()}return t},t.prototype.parseGeometryCollectionText_=function(){if(this.match(b)){var t=[];do{t.push(this.parseGeometry_())}while(this.match(E));if(this.match(w))return t}throw new Error(this.formatErrorMessage_())},t.prototype.parsePointText_=function(){if(this.match(b)){var t=this.parsePoint_();if(this.match(w))return t}throw new Error(this.formatErrorMessage_())},t.prototype.parseLineStringText_=function(){if(this.match(b)){var t=this.parsePointList_();if(this.match(w))return t}throw new Error(this.formatErrorMessage_())},t.prototype.parsePolygonText_=function(){if(this.match(b)){var t=this.parseLineStringTextList_();if(this.match(w))return t}throw new Error(this.formatErrorMessage_())},t.prototype.parseMultiPointText_=function(){if(this.match(b)){var t=void 0;if(t=this.token_.type==b?this.parsePointTextList_():this.parsePointList_(),this.match(w))return t}throw new Error(this.formatErrorMessage_())},t.prototype.parseMultiLineStringText_=function(){if(this.match(b)){var t=this.parseLineStringTextList_();if(this.match(w))return t}throw new Error(this.formatErrorMessage_())},t.prototype.parseMultiPolygonText_=function(){if(this.match(b)){var t=this.parsePolygonTextList_();if(this.match(w))return t}throw new Error(this.formatErrorMessage_())},t.prototype.parsePoint_=function(){for(var t=[],e=this.layout_.length,n=0;n<e;++n){var r=this.token_;if(!this.match(x))break;t.push(r.value)}if(t.length==e)return t;throw new Error(this.formatErrorMessage_())},t.prototype.parsePointList_=function(){for(var t=[this.parsePoint_()];this.match(E);)t.push(this.parsePoint_());return t},t.prototype.parsePointTextList_=function(){for(var t=[this.parsePointText_()];this.match(E);)t.push(this.parsePointText_());return t},t.prototype.parseLineStringTextList_=function(){for(var t=[this.parseLineStringText_()];this.match(E);)t.push(this.parseLineStringText_());return t},t.prototype.parsePolygonTextList_=function(){for(var t=[this.parsePolygonText_()];this.match(E);)t.push(this.parsePolygonText_());return t},t.prototype.isEmptyGeometry_=function(){var t=this.isTokenType(_)&&"EMPTY"==this.token_.value;return t&&this.consume_(),t},t.prototype.formatErrorMessage_=function(){return"Unexpected `"+this.token_.value+"` at position "+this.token_.position+" in `"+this.lexer_.wkt+"`"},t.prototype.parseGeometry_=function(){var t=this.token_;if(this.match(_)){var e=t.value;this.layout_=this.parseGeometryLayout_();var n=this.isEmptyGeometry_();if("GEOMETRYCOLLECTION"==e){if(n)return new o.a([]);var r=this.parseGeometryCollectionText_();return new o.a(r)}var i=m[e];if(!i)throw new Error("Invalid geometry type: "+e);var a=void 0;if(n)a="POINT"==e?[NaN,NaN]:[];else switch(e){case"POINT":a=this.parsePointText_();break;case"LINESTRING":a=this.parseLineStringText_();break;case"POLYGON":a=this.parsePolygonText_();break;case"MULTIPOINT":a=this.parseMultiPointText_();break;case"MULTILINESTRING":a=this.parseMultiLineStringText_();break;case"MULTIPOLYGON":a=this.parseMultiPolygonText_()}return new i(a,this.layout_)}throw new Error(this.formatErrorMessage_())},t}(),L=function(t){function e(e){var n=t.call(this)||this,r=e||{};return n.splitCollection_=void 0!==r.splitCollection&&r.splitCollection,n}return y(e,t),e.prototype.parse_=function(t){var e=new T(t);return new I(e).parse()},e.prototype.readFeatureFromText=function(t,e){var n=this.readGeometryFromText(t,e),r=new i.a;return r.setGeometry(n),r},e.prototype.readFeaturesFromText=function(t,e){for(var n=[],r=this.readGeometryFromText(t,e),o=[],a=0,l=(n=this.splitCollection_&&r.getType()==s.a.GEOMETRY_COLLECTION?r.getGeometriesArray():[r]).length;a<l;++a){var u=new i.a;u.setGeometry(n[a]),o.push(u)}return o},e.prototype.readGeometryFromText=function(t,e){var n=this.parse_(t);return Object(g.c)(n,!1,e)},e.prototype.writeFeatureText=function(t,e){var n=t.getGeometry();return n?this.writeGeometryText(n,e):""},e.prototype.writeFeaturesText=function(t,e){if(1==t.length)return this.writeFeatureText(t[0],e);for(var n=[],r=0,i=t.length;r<i;++r)n.push(t[r].getGeometry());var a=new o.a(n);return this.writeGeometryText(a,e)},e.prototype.writeGeometryText=function(t,e){return j(Object(g.c)(t,!0,e))},e}(f.a);function P(t){var e=t.getCoordinates();return 0===e.length?"":e.join(" ")}function R(t){for(var e=t.getCoordinates(),n=[],r=0,i=e.length;r<i;++r)n.push(e[r].join(" "));return n.join(",")}function M(t){for(var e=[],n=t.getLinearRings(),r=0,i=n.length;r<i;++r)e.push("("+R(n[r])+")");return e.join(",")}var N={Point:P,LineString:R,Polygon:M,MultiPoint:function(t){for(var e=[],n=t.getPoints(),r=0,i=n.length;r<i;++r)e.push("("+P(n[r])+")");return e.join(",")},MultiLineString:function(t){for(var e=[],n=t.getLineStrings(),r=0,i=n.length;r<i;++r)e.push("("+R(n[r])+")");return e.join(",")},MultiPolygon:function(t){for(var e=[],n=t.getPolygons(),r=0,i=n.length;r<i;++r)e.push("("+M(n[r])+")");return e.join(",")},GeometryCollection:function(t){for(var e=[],n=t.getGeometries(),r=0,i=n.length;r<i;++r)e.push(j(n[r]));return e.join(",")}};function j(t){var e=t.getType(),n=(0,N[e])(t);if(e=e.toUpperCase(),"function"==typeof t.getFlatCoordinates){var r=function(t){var e=t.getLayout(),n="";return e!==a.a.XYZ&&e!==a.a.XYZM||(n+="Z"),e!==a.a.XYM&&e!==a.a.XYZM||(n+="M"),n}(t);r.length>0&&(e+=" "+r)}return 0===n.length?e+" EMPTY":e+"("+n+")"}e.a=L},function(t,e,n){var r=n(28);t.exports=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=r(t)););return t}},function(t,e,n){var r,i,o;
/*!
* jquery.fancytree.dnd5.js
*
* Drag-and-drop support (native HTML5).
* (Extension module for jquery.fancytree.js: https://github.com/mar10/fancytree/)
*
* Copyright (c) 2008-2020, Martin Wendt (https://wwWendt.de)
*
* Released under the MIT license
* https://github.com/mar10/fancytree/wiki/LicenseInfo
*
* @version 2.36.1
* @date 2020-07-25T09:03:47Z
*/i=[n(12),n(173)],void 0===(o="function"==typeof(r=function(t){"use strict";var e,n,r=t.ui.fancytree,i=/Mac/.test(navigator.platform),o="fancytree-drop-over",a="application/x-fancytree-node",s=null,l=null,u=null,c=null,h=null,p=null,d=null,f=null,g=null,y=null;function m(){h=null,y=null,d=null,f=null,p=null,l=null,u=null,c&&c.removeClass("fancytree-drag-source fancytree-drag-remove"),c=null,s&&s.hide(),n&&(n.remove(),n=null)}function v(t){return 0===t?"":t>0?"+"+t:""+t}function _(t,e){var n=e.tree,r=e.dataTransfer;"dragstart"===t.type?(e.effectAllowed=n.options.dnd5.effectAllowed,e.dropEffect=n.options.dnd5.dropEffectDefault):(e.effectAllowed=f,e.dropEffect=d),e.dropEffectSuggested=function(t,e,n){var r=n;return i?e.metaKey&&e.altKey||e.ctrlKey?r="link":e.metaKey?r="move":e.altKey&&(r="copy"):e.ctrlKey?r="copy":e.shiftKey?r="move":e.altKey&&(r="link"),r!==p&&t.info("evalEffectModifiers: "+e.type+" - evalEffectModifiers(): "+p+" -> "+r),p=r,r}(n,t,n.options.dnd5.dropEffectDefault),e.isMove="move"===e.dropEffect,e.files=r.files||[]}function b(t,e,n){var r=e.tree,i=e.dataTransfer;return"dragstart"!==t.type&&f!==e.effectAllowed&&r.warn("effectAllowed should only be changed in dragstart event: "+t.type+": data.effectAllowed changed from "+f+" -> "+e.effectAllowed),!1===n&&(r.info("applyDropEffectCallback: allowDrop === false"),e.effectAllowed="none",e.dropEffect="none"),e.isMove="move"===e.dropEffect,"dragstart"===t.type&&(f=e.effectAllowed,d=e.dropEffect),i.effectAllowed=f,i.dropEffect=d,d}function w(e,n){if(n.options.dnd5.scroll&&function(e,n){var r,i,o=e.options.dnd5,a=e.$scrollParent[0],s=o.scrollSensitivity,l=o.scrollSpeed,u=0;a!==document&&"HTML"!==a.tagName?(r=e.$scrollParent.offset(),i=a.scrollTop,r.top+a.offsetHeight-n.pageY<s?a.scrollHeight-e.$scrollParent.innerHeight()-i>0&&(a.scrollTop=u=i+l):i>0&&n.pageY-r.top<s&&(a.scrollTop=u=i-l)):(i=t(document).scrollTop())>0&&n.pageY-i<s?(u=i-l,t(document).scrollTop(u)):t(window).height()-(n.pageY-i)<s&&(u=i+l,t(document).scrollTop(u)),u&&e.debug("autoScroll: "+u+"px")}(n.tree,e),!n.node)return n.tree.warn("Ignored dragover for non-node"),g;var i,a,l,u,c=null,p=n.tree,d=p.options,f=d.dnd5,y=n.node,m=n.otherNode,w="center",x=t(y.span),E=x.find("span.fancytree-title");if(!1===h)return p.debug("Ignored dragover, since dragenter returned false."),!1;if("string"==typeof h&&t.error("assert failed: dragenter returned string"),a=x.offset(),u=(e.pageY-a.top)/x.height(),void 0===e.pageY&&p.warn("event.pageY is undefined: see issue #1013."),h.after&&u>.75||!h.over&&h.after&&u>.5?c="after":h.before&&u<=.25||!h.over&&h.before&&u<=.5?c="before":h.over&&(c="over"),f.preventVoidMoves&&"move"===n.dropEffect&&(y===m?(y.debug("Drop over source node prevented."),c=null):"before"===c&&m&&y===m.getNextSibling()?(y.debug("Drop after source node prevented."),c=null):"after"===c&&m&&y===m.getPrevSibling()?(y.debug("Drop before source node prevented."),c=null):"over"===c&&m&&m.parent===y&&m.isLastSibling()&&(y.debug("Drop last child over own parent prevented."),c=null)),n.hitMode=c,c&&f.dragOver&&(_(e,n),f.dragOver(y,n),b(e,n,!!c),c=n.hitMode),g=c,"after"===c||"before"===c||"over"===c){switch(i=f.dropMarkerOffsetX||0,c){case"before":w="top",i+=f.dropMarkerInsertOffsetX||0;break;case"after":w="bottom",i+=f.dropMarkerInsertOffsetX||0}l={my:"left"+v(i)+" center",at:"left "+w,of:E},d.rtl&&(l.my="right"+v(-i)+" center",l.at="right "+w),s.toggleClass("fancytree-drop-after","after"===c).toggleClass(o,"over"===c).toggleClass("fancytree-drop-before","before"===c).show().position(r.fixPositionOptions(l))}else s.hide();return t(y.span).toggleClass("fancytree-drop-target","after"===c||"before"===c||"over"===c).toggleClass("fancytree-drop-after","after"===c).toggleClass("fancytree-drop-before","before"===c).toggleClass("fancytree-drop-accept","over"===c).toggleClass("fancytree-drop-reject",!1===c),c}function x(i){var o,s=this.options.dnd5,h=r.getNode(i),p=i.dataTransfer||i.originalEvent.dataTransfer,d={tree:this,node:h,options:this.options,originalEvent:i.originalEvent,widget:this.widget,dataTransfer:p,useDefaultImage:!0,dropEffect:void 0,dropEffectSuggested:void 0,effectAllowed:void 0,files:void 0,isCancelled:void 0,isMove:void 0};switch(i.type){case"dragstart":if(!h)return this.info("Ignored dragstart on a non-node."),!1;l=h,!1===s.multiSource?u=[h]:!0===s.multiSource?(u=this.getSelectedNodes(),h.isSelected()||u.unshift(h)):u=s.multiSource(h,d),(c=t(t.map(u,(function(t){return t.span})))).addClass("fancytree-drag-source");var f=h.toDict();f.treeId=h.tree._id,o=JSON.stringify(f);try{p.setData(a,o),p.setData("text/html",t(h.span).html()),p.setData("text/plain",h.title)}catch(t){this.warn("Could not set data (IE only accepts 'text') - "+t)}return s.setTextTypeJson?p.setData("text",o):p.setData("text",h.title),_(i,d),!1===s.dragStart(h,d)?(m(),!1):(b(i,d),n=null,d.useDefaultImage&&(e=t(h.span).find(".fancytree-title"),u&&u.length>1&&(n=t("<span class='fancytree-childcounter'/>").text("+"+(u.length-1)).appendTo(e)),p.setDragImage&&p.setDragImage(e[0],-10,-10)),!0);case"drag":_(i,d),s.dragDrag(h,d),b(i,d),c.toggleClass("fancytree-drag-remove",d.isMove);break;case"dragend":_(i,d),m(),d.isCancelled=!g,s.dragEnd(h,d,!g)}}function E(e){var n,i,c,p,d=this.options.dnd5,f=null,v=r.getNode(e),x=e.dataTransfer||e.originalEvent.dataTransfer,E={tree:this,node:v,options:this.options,originalEvent:e.originalEvent,widget:this.widget,hitMode:h,dataTransfer:x,otherNode:l||null,otherNodeList:u||null,otherNodeData:null,useDefaultImage:!0,dropEffect:void 0,dropEffectSuggested:void 0,effectAllowed:void 0,files:null,isCancelled:void 0,isMove:void 0};switch(e.type){case"dragenter":if(y=null,!v){this.debug("Ignore non-node "+e.type+": "+e.target.tagName+"."+e.target.className),h=!1;break}if(t(v.span).addClass(o).removeClass("fancytree-drop-accept fancytree-drop-reject"),c=t.inArray(a,x.types)>=0,d.preventNonNodes&&!c){v.debug("Reject dropping a non-node."),h=!1;break}if(d.preventForeignNodes&&(!l||l.tree!==v.tree)){v.debug("Reject dropping a foreign node."),h=!1;break}if(d.preventSameParent&&E.otherNode&&E.otherNode.tree===v.tree&&v.parent===E.otherNode.parent){v.debug("Reject dropping as sibling (same parent)."),h=!1;break}if(d.preventRecursion&&E.otherNode&&E.otherNode.tree===v.tree&&v.isDescendantOf(E.otherNode)){v.debug("Reject dropping below own ancestor."),h=!1;break}if(d.preventLazyParents&&!v.isLoaded()){v.warn("Drop over unloaded target node prevented."),h=!1;break}s.show(),_(e,E),p=function(e){var n;return!!e&&(n=t.isPlainObject(e)?{over:!!e.over,before:!!e.before,after:!!e.after}:t.isArray(e)?{over:t.inArray("over",e)>=0,before:t.inArray("before",e)>=0,after:t.inArray("after",e)>=0}:{over:!0===e||"over"===e,before:!0===e||"before"===e,after:!0===e||"after"===e},0!==Object.keys(n).length&&n)}(d.dragEnter(v,E)),h=p,b(e,E,f=p&&(p.over||p.before||p.after));break;case"dragover":if(!v){this.debug("Ignore non-node "+e.type+": "+e.target.tagName+"."+e.target.className);break}_(e,E),f=!!(g=w(e,E)),"over"!==g&&!1!==g||v.expanded||!1===v.hasChildren()?y=null:y?!(d.autoExpandMS&&Date.now()-y>d.autoExpandMS)||v.isLoading()||d.dragExpand&&!1===d.dragExpand(v,E)||v.setExpanded():y=Date.now();break;case"dragleave":if(!v){this.debug("Ignore non-node "+e.type+": "+e.target.tagName+"."+e.target.className);break}if(!t(v.span).hasClass(o)){v.debug("Ignore dragleave (multi).");break}t(v.span).removeClass(o+" fancytree-drop-accept fancytree-drop-reject"),v.scheduleAction("cancel"),d.dragLeave(v,E),s.hide();break;case"drop":if(t.inArray(a,x.types)>=0&&(i=x.getData(a),this.info(e.type+": getData('application/x-fancytree-node'): '"+i+"'")),i||(i=x.getData("text"),this.info(e.type+": getData('text'): '"+i+"'")),i)try{void 0!==(n=JSON.parse(i)).title&&(E.otherNodeData=n)}catch(t){}this.debug(e.type+": nodeData: '"+i+"', otherNodeData: ",E.otherNodeData),t(v.span).removeClass(o+" fancytree-drop-accept fancytree-drop-reject"),E.hitMode=g,_(e,E),E.isCancelled=!g;var S=l&&l.span,O=l&&l.tree;d.dragDrop(v,E),e.preventDefault(),S&&!document.body.contains(S)&&(O===this?(this.debug("Drop handler removed source element: generating dragEnd."),d.dragEnd(l,E)):this.warn("Drop handler removed source element: dragend event may be lost.")),m()}if(f)return e.preventDefault(),!1}return t.ui.fancytree.getDragNodeList=function(){return u||[]},t.ui.fancytree.getDragNode=function(){return l},t.ui.fancytree.registerExtension({name:"dnd5",version:"2.36.1",options:{autoExpandMS:1500,dropMarkerInsertOffsetX:-16,dropMarkerOffsetX:-24,dropMarkerParent:"body",multiSource:!1,effectAllowed:"all",dropEffectDefault:"move",preventForeignNodes:!1,preventLazyParents:!0,preventNonNodes:!1,preventRecursion:!0,preventSameParent:!1,preventVoidMoves:!0,scroll:!0,scrollSensitivity:20,scrollSpeed:5,setTextTypeJson:!1,dragStart:null,dragDrag:t.noop,dragEnd:t.noop,dragEnter:null,dragOver:t.noop,dragExpand:t.noop,dragDrop:t.noop,dragLeave:t.noop},treeInit:function(e){var n,i=e.tree,o=e.options,a=o.glyph||null,l=o.dnd5;t.inArray("dnd",o.extensions)>=0&&t.error("Extensions 'dnd' and 'dnd5' are mutually exclusive."),l.dragStop&&t.error("dragStop is not used by ext-dnd5. Use dragEnd instead."),null!=l.preventRecursiveMoves&&t.error("preventRecursiveMoves was renamed to preventRecursion."),l.dragStart&&r.overrideMethod(e.options,"createNode",(function(t,e){this._super.apply(this,arguments),e.node.span?e.node.span.draggable=!0:e.node.warn("Cannot add `draggable`: no span tag")})),this._superApply(arguments),this.$container.addClass("fancytree-ext-dnd5"),n=t("<span>").appendTo(this.$container),this.$scrollParent=n.scrollParent(),n.remove(),(s=t("#fancytree-drop-marker")).length||(s=t("<div id='fancytree-drop-marker'></div>").hide().css({"z-index":1e3,"pointer-events":"none"}).prependTo(l.dropMarkerParent),a&&r.setSpanIcon(s[0],a.map._addClass,a.map.dropMarker)),s.toggleClass("fancytree-rtl",!!o.rtl),l.dragStart&&i.$container.on("dragstart drag dragend",x.bind(i)),l.dragEnter&&i.$container.on("dragenter dragover dragleave drop",E.bind(i))}}),t.ui.fancytree})?r.apply(e,i):r)||(t.exports=o)},function(t,e,n){},function(t,e,n){},function(t){t.exports=JSON.parse('{"name":"@pathomation/pma.ui","version":"2.14.0","build":"549","description":"PMA.UI is a Javascript library that provides UI and programmatic components to interact with PMA.core","main":"src/index.js","directories":{"lib":"lib","man":"man"},"dependencies":{"@turf/turf":"^5.1.6","caniuse-lite":"^1.0.30001247","file-saver":"^2.0.2","font-awesome":"^4.7.0","jquery":"^3.5.1","jquery.fancytree":"^2.36.1","nouislider":"^14.6.0","ol":"^6.5.0","ol-magic-wand":"^1.0.5","perfect-scrollbar":"^1.5.0"},"devDependencies":{"@babel/core":"^7.12.13","@babel/plugin-transform-runtime":"^7.13.10","@babel/preset-env":"^7.12.13","@types/nouislider":"^9.0.7","@types/ol":"^6.3.1","babel-loader":"^8.2.2","copy-webpack-plugin":"^6.0.2","css-loader":"^3.5.3","docdash":"^1.2.0","file-loader":"^6.0.0","font-awesome":"^4.7.0","jsdoc":"^3.6.4","jsdoc-template":"git+https://github.com/braintree/jsdoc-template.git","mini-css-extract-plugin":"^0.9.0","node-svn-ultimate":"^1.2.1","null-loader":"^4.0.0","optimize-css-assets-webpack-plugin":"^5.0.3","perfect-scrollbar":"^1.5.0","rimraf":"^3.0.2","ts-loader":"^7.0.5","typescript":"^3.9.5","webpack":"^4.43.0","webpack-cli":"^3.3.11","webpack-dev-server":"^3.11.0","webpack-provide-global-plugin":"0.0.1"},"scripts":{"test":"echo \\"Error: no test specified\\" && exit 1","dev":"webpack --watch","clean":"rimraf dist/* && rimraf build/*","build":"npm run clean && npx webpack --mode=production && compress.bat","build-wordpress":"npm run clean && npx webpack --mode=production --config webpack.wordpress.config.js","documentation":"jsdoc -c jsdoc\\\\conf.json && copy-bundle.bat","publish-npm":"npm publish --access public"},"keywords":["digital pathology","pathology","whole slide image","digital slide"],"author":"Pathomation","license":"ISC"}')},function(t,e){function n(t,e,n,r,i,o,a){try{var s=t[o](a),l=s.value}catch(t){return void n(t)}s.done?e(l):Promise.resolve(l).then(r,i)}t.exports=function(t){return function(){var e=this,r=arguments;return new Promise((function(i,o){var a=t.apply(e,r);function s(t){n(a,i,o,s,l,"next",t)}function l(t){n(a,i,o,s,l,"throw",t)}s(void 0)}))}}},function(t,e){(function(){var e;t.exports={icon:"icons/google.svg",name:"google",title:"Google Fonts",link:"google.com/fonts",getNames:function(){return e},getLink:function(t){return"https://fonts.google.com/specimen/"+t.replace(/( )/g,"+")},normalizeName:function(t){return t}},e=["ABeeZee","Abel","Abril Fatface","Aclonica","Acme","Actor","Adamina","Advent Pro","Aguafina Script","Akronim","Aladin","Aldrich","Alef","Alegreya","Alegreya SC","Alegreya Sans","Alegreya Sans SC","Alex Brush","Alfa Slab One","Alice","Alike","Alike Angular","Allan","Allerta","Allerta Stencil","Allura","Almendra","Almendra Display","Almendra SC","Amarante","Amaranth","Amatic SC","Amethysta","Amiri","Amita","Anaheim","Andada","Andika","Angkor","Annie Use Your Telescope","Anonymous Pro","Antic","Antic Didone","Antic Slab","Anton","Arapey","Arbutus","Arbutus Slab","Architects Daughter","Archivo Black","Archivo Narrow","Arimo","Arizonia","Armata","Artifika","Arvo","Arya","Asap","Asar","Asset","Astloch","Asul","Atomic Age","Aubrey","Audiowide","Autour One","Average","Average Sans","Averia Gruesa Libre","Averia Libre","Averia Sans Libre","Averia Serif Libre","Bad Script","Balthazar","Bangers","Basic","Battambang","Baumans","Bayon","Belgrano","Belleza","BenchNine","Bentham","Berkshire Swash","Bevan","Bigelow Rules","Bigshot One","Bilbo","Bilbo Swash Caps","Biryani","Bitter","Black Ops One","Bokor","Bonbon","Boogaloo","Bowlby One","Bowlby One SC","Brawler","Bree Serif","Bubblegum Sans","Bubbler One","Buda","Buenard","Butcherman","Butterfly Kids","Cabin","Cabin Condensed","Cabin Sketch","Caesar Dressing","Cagliostro","Calligraffitti","Cambay","Cambo","Candal","Cantarell","Cantata One","Cantora One","Capriola","Cardo","Carme","Carrois Gothic","Carrois Gothic SC","Carter One","Catamaran","Caudex","Caveat","Caveat Brush","Cedarville Cursive","Ceviche One","Changa One","Chango","Chau Philomene One","Chela One","Chelsea Market","Chenla","Cherry Cream Soda","Cherry Swash","Chewy","Chicle","Chivo","Chonburi","Cinzel","Cinzel Decorative","Clicker Script","Coda","Coda Caption","Codystar","Combo","Comfortaa","Coming Soon","Concert One","Condiment","Content","Contrail One","Convergence","Cookie","Copse","Corben","Courgette","Cousine","Coustard","Covered By Your Grace","Crafty Girls","Creepster","Crete Round","Crimson Text","Croissant One","Crushed","Cuprum","Cutive","Cutive Mono","Damion","Dancing Script","Dangrek","Dawning of a New Day","Days One","Dekko","Delius","Delius Swash Caps","Delius Unicase","Della Respira","Denk One","Devonshire","Dhurjati","Didact Gothic","Diplomata","Diplomata SC","Domine","Donegal One","Doppio One","Dorsa","Dosis","Dr Sugiyama","Droid Sans","Droid Sans Mono","Droid Serif","Duru Sans","Dynalight","EB Garamond","Eagle Lake","Eater","Economica","Eczar","Ek Mukta","Electrolize","Elsie","Elsie Swash Caps","Emblema One","Emilys Candy","Engagement","Englebert","Enriqueta","Erica One","Esteban","Euphoria Script","Ewert","Exo","Exo 2","Expletus Sans","Fanwood Text","Fascinate","Fascinate Inline","Faster One","Fasthand","Fauna One","Federant","Federo","Felipa","Fenix","Finger Paint","Fira Mono","Fira Sans","Fjalla One","Fjord One","Flamenco","Flavors","Fondamento","Fontdiner Swanky","Forum","Francois One","Freckle Face","Fredericka the Great","Fredoka One","Freehand","Fresca","Frijole","Fruktur","Fugaz One","GFS Didot","GFS Neohellenic","Gabriela","Gafata","Galdeano","Galindo","Gentium Basic","Gentium Book Basic","Geo","Geostar","Geostar Fill","Germania One","Gidugu","Gilda Display","Give You Glory","Glass Antiqua","Glegoo","Gloria Hallelujah","Goblin One","Gochi Hand","Gorditas","Goudy Bookletter 1911","Graduate","Grand Hotel","Gravitas One","Great Vibes","Griffy","Gruppo","Gudea","Gurajada","Habibi","Halant","Hammersmith One","Hanalei","Hanalei Fill","Handlee","Hanuman","Happy Monkey","Headland One","Henny Penny","Herr Von Muellerhoff","Hind","Hind Siliguri","Hind Vadodara","Holtwood One SC","Homemade Apple","Homenaje","IM Fell DW Pica","IM Fell DW Pica SC","IM Fell Double Pica","IM Fell Double Pica SC","IM Fell English","IM Fell English SC","IM Fell French Canon","IM Fell French Canon SC","IM Fell Great Primer","IM Fell Great Primer SC","Iceberg","Iceland","Imprima","Inconsolata","Inder","Indie Flower","Inika","Inknut Antiqua","Irish Grover","Istok Web","Italiana","Italianno","Itim","Jacques Francois","Jacques Francois Shadow","Jaldi","Jim Nightshade","Jockey One","Jolly Lodger","Josefin Sans","Josefin Slab","Joti One","Judson","Julee","Julius Sans One","Junge","Jura","Just Another Hand","Just Me Again Down Here","Kadwa","Kalam","Kameron","Kantumruy","Karla","Karma","Kaushan Script","Kavoon","Kdam Thmor","Keania One","Kelly Slab","Kenia","Khand","Khmer","Khula","Kite One","Knewave","Kotta One","Koulen","Kranky","Kreon","Kristi","Krona One","Kurale","La Belle Aurore","Laila","Lakki Reddy","Lancelot","Lateef","Lato","League Script","Leckerli One","Ledger","Lekton","Lemon","Libre Baskerville","Life Savers","Lilita One","Lily Script One","Limelight","Linden Hill","Lobster","Lobster Two","Londrina Outline","Londrina Shadow","Londrina Sketch","Londrina Solid","Lora","Love Ya Like A Sister","Loved by the King","Lovers Quarrel","Luckiest Guy","Lusitana","Lustria","Macondo","Macondo Swash Caps","Magra","Maiden Orange","Mako","Mallanna","Mandali","Marcellus","Marcellus SC","Marck Script","Margarine","Marko One","Marmelad","Martel","Martel Sans","Marvel","Mate","Mate SC","Maven Pro","McLaren","Meddon","MedievalSharp","Medula One","Megrim","Meie Script","Merienda","Merienda One","Merriweather","Merriweather Sans","Metal","Metal Mania","Metamorphous","Metrophobic","Michroma","Milonga","Miltonian","Miltonian Tattoo","Miniver","Miss Fajardose","Modak","Modern Antiqua","Molengo","Molle","Monda","Monofett","Monoton","Monsieur La Doulaise","Montaga","Montez","Montserrat","Montserrat Alternates","Montserrat Subrayada","Moul","Moulpali","Mountains of Christmas","Mouse Memoirs","Mr Bedfort","Mr Dafoe","Mr De Haviland","Mrs Saint Delafield","Mrs Sheppards","Muli","Mystery Quest","NTR","Neucha","Neuton","New Rocker","News Cycle","Niconne","Nixie One","Nobile","Nokora","Norican","Nosifer","Nothing You Could Do","Noticia Text","Noto Sans","Noto Serif","Nova Cut","Nova Flat","Nova Mono","Nova Oval","Nova Round","Nova Script","Nova Slim","Nova Square","Numans","Nunito","Odor Mean Chey","Offside","Old Standard TT","Oldenburg","Oleo Script","Oleo Script Swash Caps","Open Sans","Open Sans Condensed","Oranienbaum","Orbitron","Oregano","Orienta","Original Surfer","Oswald","Over the Rainbow","Overlock","Overlock SC","Ovo","Oxygen","Oxygen Mono","PT Mono","PT Sans","PT Sans Caption","PT Sans Narrow","PT Serif","PT Serif Caption","Pacifico","Palanquin","Palanquin Dark","Paprika","Parisienne","Passero One","Passion One","Pathway Gothic One","Patrick Hand","Patrick Hand SC","Patua One","Paytone One","Peddana","Peralta","Permanent Marker","Petit Formal Script","Petrona","Philosopher","Piedra","Pinyon Script","Pirata One","Plaster","Play","Playball","Playfair Display","Playfair Display SC","Podkova","Poiret One","Poller One","Poly","Pompiere","Pontano Sans","Poppins","Port Lligat Sans","Port Lligat Slab","Pragati Narrow","Prata","Preahvihear","Press Start 2P","Princess Sofia","Prociono","Prosto One","Puritan","Purple Purse","Quando","Quantico","Quattrocento","Quattrocento Sans","Questrial","Quicksand","Quintessential","Qwigley","Racing Sans One","Radley","Rajdhani","Raleway","Raleway Dots","Ramabhadra","Ramaraja","Rambla","Rammetto One","Ranchers","Rancho","Ranga","Rationale","Ravi Prakash","Redressed","Reenie Beanie","Revalia","Rhodium Libre","Ribeye","Ribeye Marrow","Righteous","Risque","Roboto","Roboto Condensed","Roboto Mono","Roboto Slab","Rochester","Rock Salt","Rokkitt","Romanesco","Ropa Sans","Rosario","Rosarivo","Rouge Script","Rozha One","Rubik","Rubik Mono One","Rubik One","Ruda","Rufina","Ruge Boogie","Ruluko","Rum Raisin","Ruslan Display","Russo One","Ruthie","Rye","Sacramento","Sahitya","Sail","Salsa","Sanchez","Sancreek","Sansita One","Sarala","Sarina","Sarpanch","Satisfy","Scada","Scheherazade","Schoolbell","Seaweed Script","Sevillana","Seymour One","Shadows Into Light","Shadows Into Light Two","Shanti","Share","Share Tech","Share Tech Mono","Shojumaru","Short Stack","Siemreap","Sigmar One","Signika","Signika Negative","Simonetta","Sintony","Sirin Stencil","Six Caps","Skranji","Slabo 13px","Slabo 27px","Slackey","Smokum","Smythe","Sniglet","Snippet","Snowburst One","Sofadi One","Sofia","Sonsie One","Sorts Mill Goudy","Source Code Pro","Source Sans Pro","Source Serif Pro","Special Elite","Spicy Rice","Spinnaker","Spirax","Squada One","Sree Krushnadevaraya","Stalemate","Stalinist One","Stardos Stencil","Stint Ultra Condensed","Stint Ultra Expanded","Stoke","Strait","Sue Ellen Francisco","Sumana","Sunshiney","Supermercado One","Sura","Suranna","Suravaram","Suwannaphum","Swanky and Moo Moo","Syncopate","Tangerine","Taprom","Tauri","Teko","Telex","Tenali Ramakrishna","Tenor Sans","Text Me One","The Girl Next Door","Tienne","Tillana","Timmana","Tinos","Titan One","Titillium Web","Trade Winds","Trocchi","Trochut","Trykker","Tulpen One","Ubuntu","Ubuntu Condensed","Ubuntu Mono","Ultra","Uncial Antiqua","Underdog","Unica One","UnifrakturCook","UnifrakturMaguntia","Unkempt","Unlock","Unna","VT323","Vampiro One","Varela","Varela Round","Vast Shadow","Vesper Libre","Vibur","Vidaloka","Viga","Voces","Volkhov","Vollkorn","Voltaire","Waiting for the Sunrise","Wallpoet","Walter Turncoat","Warnes","Wellfleet","Wendy One","Wire One","Work Sans","Yanone Kaffeesatz","Yantramanav","Yellowtail","Yeseva One","Yesteryear","Zeyada"]}).call(this)},function(t,e,n){"use strict";t.exports=i;var r=n(226);function i(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}i.Varint=0,i.Fixed64=1,i.Bytes=2,i.Fixed32=5;var o="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function a(t){return t.type===i.Bytes?t.readVarint()+t.pos:t.pos+1}function s(t,e,n){return n?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function l(t,e,n){var r=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));n.realloc(r);for(var i=n.pos-1;i>=t;i--)n.buf[i+r]=n.buf[i]}function u(t,e){for(var n=0;n<t.length;n++)e.writeVarint(t[n])}function c(t,e){for(var n=0;n<t.length;n++)e.writeSVarint(t[n])}function h(t,e){for(var n=0;n<t.length;n++)e.writeFloat(t[n])}function p(t,e){for(var n=0;n<t.length;n++)e.writeDouble(t[n])}function d(t,e){for(var n=0;n<t.length;n++)e.writeBoolean(t[n])}function f(t,e){for(var n=0;n<t.length;n++)e.writeFixed32(t[n])}function g(t,e){for(var n=0;n<t.length;n++)e.writeSFixed32(t[n])}function y(t,e){for(var n=0;n<t.length;n++)e.writeFixed64(t[n])}function m(t,e){for(var n=0;n<t.length;n++)e.writeSFixed64(t[n])}function v(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function _(t,e,n){t[n]=e,t[n+1]=e>>>8,t[n+2]=e>>>16,t[n+3]=e>>>24}function b(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}i.prototype={destroy:function(){this.buf=null},readFields:function(t,e,n){for(n=n||this.length;this.pos<n;){var r=this.readVarint(),i=r>>3,o=this.pos;this.type=7&r,t(i,e,this),this.pos===o&&this.skip(r)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=v(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=b(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=v(this.buf,this.pos)+4294967296*v(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=v(this.buf,this.pos)+4294967296*b(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=r.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=r.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,n,r=this.buf;return e=127&(n=r[this.pos++]),n<128?e:(e|=(127&(n=r[this.pos++]))<<7,n<128?e:(e|=(127&(n=r[this.pos++]))<<14,n<128?e:(e|=(127&(n=r[this.pos++]))<<21,n<128?e:function(t,e,n){var r,i,o=n.buf;if(i=o[n.pos++],r=(112&i)>>4,i<128)return s(t,r,e);if(i=o[n.pos++],r|=(127&i)<<3,i<128)return s(t,r,e);if(i=o[n.pos++],r|=(127&i)<<10,i<128)return s(t,r,e);if(i=o[n.pos++],r|=(127&i)<<17,i<128)return s(t,r,e);if(i=o[n.pos++],r|=(127&i)<<24,i<128)return s(t,r,e);if(i=o[n.pos++],r|=(1&i)<<31,i<128)return s(t,r,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(n=r[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&o?function(t,e,n){return o.decode(t.subarray(e,n))}(this.buf,e,t):function(t,e,n){var r="",i=e;for(;i<n;){var o,a,s,l=t[i],u=null,c=l>239?4:l>223?3:l>191?2:1;if(i+c>n)break;1===c?l<128&&(u=l):2===c?128==(192&(o=t[i+1]))&&(u=(31&l)<<6|63&o)<=127&&(u=null):3===c?(o=t[i+1],a=t[i+2],128==(192&o)&&128==(192&a)&&((u=(15&l)<<12|(63&o)<<6|63&a)<=2047||u>=55296&&u<=57343)&&(u=null)):4===c&&(o=t[i+1],a=t[i+2],s=t[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&((u=(15&l)<<18|(63&o)<<12|(63&a)<<6|63&s)<=65535||u>=1114112)&&(u=null)),null===u?(u=65533,c=1):u>65535&&(u-=65536,r+=String.fromCharCode(u>>>10&1023|55296),u=56320|1023&u),r+=String.fromCharCode(u),i+=c}return r}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==i.Bytes)return t.push(this.readVarint(e));var n=a(this);for(t=t||[];this.pos<n;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==i.Bytes)return t.push(this.readSVarint());var e=a(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==i.Bytes)return t.push(this.readBoolean());var e=a(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==i.Bytes)return t.push(this.readFloat());var e=a(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==i.Bytes)return t.push(this.readDouble());var e=a(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==i.Bytes)return t.push(this.readFixed32());var e=a(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==i.Bytes)return t.push(this.readSFixed32());var e=a(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==i.Bytes)return t.push(this.readFixed64());var e=a(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==i.Bytes)return t.push(this.readSFixed64());var e=a(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===i.Varint)for(;this.buf[this.pos++]>127;);else if(e===i.Bytes)this.pos=this.readVarint()+this.pos;else if(e===i.Fixed32)this.pos+=4;else{if(e!==i.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var n=new Uint8Array(e);n.set(this.buf),this.buf=n,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),_(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),_(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),_(this.buf,-1&t,this.pos),_(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),_(this.buf,-1&t,this.pos),_(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,e){var n,r;t>=0?(n=t%4294967296|0,r=t/4294967296|0):(r=~(-t/4294967296),4294967295^(n=~(-t%4294967296))?n=n+1|0:(n=0,r=r+1|0));if(t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,n){n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos]=127&t}(n,0,e),function(t,e){var n=(7&t)<<4;if(e.buf[e.pos++]|=n|((t>>>=3)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;e.buf[e.pos++]=127&t}(r,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,n){for(var r,i,o=0;o<e.length;o++){if((r=e.charCodeAt(o))>55295&&r<57344){if(!i){r>56319||o+1===e.length?(t[n++]=239,t[n++]=191,t[n++]=189):i=r;continue}if(r<56320){t[n++]=239,t[n++]=191,t[n++]=189,i=r;continue}r=i-55296<<10|r-56320|65536,i=null}else i&&(t[n++]=239,t[n++]=191,t[n++]=189,i=null);r<128?t[n++]=r:(r<2048?t[n++]=r>>6|192:(r<65536?t[n++]=r>>12|224:(t[n++]=r>>18|240,t[n++]=r>>12&63|128),t[n++]=r>>6&63|128),t[n++]=63&r|128)}return n}(this.buf,t,this.pos);var n=this.pos-e;n>=128&&l(e,n,this),this.pos=e-1,this.writeVarint(n),this.pos+=n},writeFloat:function(t){this.realloc(4),r.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),r.write(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var n=0;n<e;n++)this.buf[this.pos++]=t[n]},writeRawMessage:function(t,e){this.pos++;var n=this.pos;t(e,this);var r=this.pos-n;r>=128&&l(n,r,this),this.pos=n-1,this.writeVarint(r),this.pos+=r},writeMessage:function(t,e,n){this.writeTag(t,i.Bytes),this.writeRawMessage(e,n)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,u,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,c,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,d,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,h,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,p,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,f,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,g,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,y,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,m,e)},writeBytesField:function(t,e){this.writeTag(t,i.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,i.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,i.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,i.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,i.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,i.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,i.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,i.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,i.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,i.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}}},function(t,e,n){var r=n(232),i=n(133);function o(t,e,n,a){return(o="undefined"!=typeof Reflect&&Reflect.set?Reflect.set:function(t,e,n,o){var a,s=r(t,e);if(s){if((a=Object.getOwnPropertyDescriptor(s,e)).set)return a.set.call(o,n),!0;if(!a.writable)return!1}if(a=Object.getOwnPropertyDescriptor(o,e)){if(!a.writable)return!1;a.value=n,Object.defineProperty(o,e,a)}else i(o,e,n);return!0})(t,e,n,a)}t.exports=function(t,e,n,r,i){if(!o(t,e,n,r||t)&&i)throw new Error("failed to set property");return n}},function(t,e,n){var r,i,o;/*! nouislider - 14.6.0 - 6/27/2020 */i=[],void 0===(o="function"==typeof(r=function(){"use strict";var t="14.6.0";function e(t){t.parentElement.removeChild(t)}function n(t){return null!=t}function r(t){t.preventDefault()}function i(t){return"number"==typeof t&&!isNaN(t)&&isFinite(t)}function o(t,e,n){n>0&&(u(t,e),setTimeout((function(){c(t,e)}),n))}function a(t){return Math.max(Math.min(t,100),0)}function s(t){return Array.isArray(t)?t:[t]}function l(t){var e=(t=String(t)).split(".");return e.length>1?e[1].length:0}function u(t,e){t.classList&&!/\s/.test(e)?t.classList.add(e):t.className+=" "+e}function c(t,e){t.classList&&!/\s/.test(e)?t.classList.remove(e):t.className=t.className.replace(new RegExp("(^|\\b)"+e.split(" ").join("|")+"(\\b|$)","gi")," ")}function h(t){var e=void 0!==window.pageXOffset,n="CSS1Compat"===(t.compatMode||"");return{x:e?window.pageXOffset:n?t.documentElement.scrollLeft:t.body.scrollLeft,y:e?window.pageYOffset:n?t.documentElement.scrollTop:t.body.scrollTop}}function p(t,e){return 100/(e-t)}function d(t,e,n){return 100*e/(t[n+1]-t[n])}function f(t,e){for(var n=1;t>=e[n];)n+=1;return n}function g(t,e,n){if(n>=t.slice(-1)[0])return 100;var r=f(n,t),i=t[r-1],o=t[r],a=e[r-1],s=e[r];return a+function(t,e){return d(t,t[0]<0?e+Math.abs(t[0]):e-t[0],0)}([i,o],n)/p(a,s)}function y(t,e,n,r){if(100===r)return r;var i=f(r,t),o=t[i-1],a=t[i];return n?r-o>(a-o)/2?a:o:e[i-1]?t[i-1]+function(t,e){return Math.round(t/e)*e}(r-t[i-1],e[i-1]):r}function m(t,e,n){var r;if("number"==typeof e&&(e=[e]),!Array.isArray(e))throw new Error("noUiSlider (14.6.0): 'range' contains invalid value.");if(!i(r="min"===t?0:"max"===t?100:parseFloat(t))||!i(e[0]))throw new Error("noUiSlider (14.6.0): 'range' value isn't numeric.");n.xPct.push(r),n.xVal.push(e[0]),r?n.xSteps.push(!isNaN(e[1])&&e[1]):isNaN(e[1])||(n.xSteps[0]=e[1]),n.xHighestCompleteStep.push(0)}function v(t,e,n){if(e)if(n.xVal[t]!==n.xVal[t+1]){n.xSteps[t]=d([n.xVal[t],n.xVal[t+1]],e,0)/p(n.xPct[t],n.xPct[t+1]);var r=(n.xVal[t+1]-n.xVal[t])/n.xNumSteps[t],i=Math.ceil(Number(r.toFixed(3))-1),o=n.xVal[t]+n.xNumSteps[t]*i;n.xHighestCompleteStep[t]=o}else n.xSteps[t]=n.xHighestCompleteStep[t]=n.xVal[t]}function _(t,e,n){var r;this.xPct=[],this.xVal=[],this.xSteps=[n||!1],this.xNumSteps=[!1],this.xHighestCompleteStep=[],this.snap=e;var i=[];for(r in t)t.hasOwnProperty(r)&&i.push([t[r],r]);for(i.length&&"object"==typeof i[0][0]?i.sort((function(t,e){return t[0][0]-e[0][0]})):i.sort((function(t,e){return t[0]-e[0]})),r=0;r<i.length;r++)m(i[r][1],i[r][0],this);for(this.xNumSteps=this.xSteps.slice(0),r=0;r<this.xNumSteps.length;r++)v(r,this.xNumSteps[r],this)}_.prototype.getDistance=function(t){var e,n=[];for(e=0;e<this.xNumSteps.length-1;e++){var r=this.xNumSteps[e];if(r&&t/r%1!=0)throw new Error("noUiSlider (14.6.0): 'limit', 'margin' and 'padding' of "+this.xPct[e]+"% range must be divisible by step.");n[e]=d(this.xVal,t,e)}return n},_.prototype.getAbsoluteDistance=function(t,e,n){var r,i=0;if(t<this.xPct[this.xPct.length-1])for(;t>this.xPct[i+1];)i++;else t===this.xPct[this.xPct.length-1]&&(i=this.xPct.length-2);n||t!==this.xPct[i+1]||i++;var o=1,a=e[i],s=0,l=0,u=0,c=0;for(r=n?(t-this.xPct[i])/(this.xPct[i+1]-this.xPct[i]):(this.xPct[i+1]-t)/(this.xPct[i+1]-this.xPct[i]);a>0;)s=this.xPct[i+1+c]-this.xPct[i+c],e[i+c]*o+100-100*r>100?(l=s*r,o=(a-100*r)/e[i+c],r=1):(l=e[i+c]*s/100*o,o=0),n?(u-=l,this.xPct.length+c>=1&&c--):(u+=l,this.xPct.length-c>=1&&c++),a=e[i+c]*o;return t+u},_.prototype.toStepping=function(t){return t=g(this.xVal,this.xPct,t)},_.prototype.fromStepping=function(t){return function(t,e,n){if(n>=100)return t.slice(-1)[0];var r=f(n,e),i=t[r-1],o=t[r],a=e[r-1];return function(t,e){return e*(t[1]-t[0])/100+t[0]}([i,o],(n-a)*p(a,e[r]))}(this.xVal,this.xPct,t)},_.prototype.getStep=function(t){return t=y(this.xPct,this.xSteps,this.snap,t)},_.prototype.getDefaultStep=function(t,e,n){var r=f(t,this.xPct);return(100===t||e&&t===this.xPct[r-1])&&(r=Math.max(r-1,1)),(this.xVal[r]-this.xVal[r-1])/n},_.prototype.getNearbySteps=function(t){var e=f(t,this.xPct);return{stepBefore:{startValue:this.xVal[e-2],step:this.xNumSteps[e-2],highestStep:this.xHighestCompleteStep[e-2]},thisStep:{startValue:this.xVal[e-1],step:this.xNumSteps[e-1],highestStep:this.xHighestCompleteStep[e-1]},stepAfter:{startValue:this.xVal[e],step:this.xNumSteps[e],highestStep:this.xHighestCompleteStep[e]}}},_.prototype.countStepDecimals=function(){var t=this.xNumSteps.map(l);return Math.max.apply(null,t)},_.prototype.convert=function(t){return this.getStep(this.toStepping(t))};var b={to:function(t){return void 0!==t&&t.toFixed(2)},from:Number},w={target:"target",base:"base",origin:"origin",handle:"handle",handleLower:"handle-lower",handleUpper:"handle-upper",touchArea:"touch-area",horizontal:"horizontal",vertical:"vertical",background:"background",connect:"connect",connects:"connects",ltr:"ltr",rtl:"rtl",textDirectionLtr:"txt-dir-ltr",textDirectionRtl:"txt-dir-rtl",draggable:"draggable",drag:"state-drag",tap:"state-tap",active:"active",tooltip:"tooltip",pips:"pips",pipsHorizontal:"pips-horizontal",pipsVertical:"pips-vertical",marker:"marker",markerHorizontal:"marker-horizontal",markerVertical:"marker-vertical",markerNormal:"marker-normal",markerLarge:"marker-large",markerSub:"marker-sub",value:"value",valueHorizontal:"value-horizontal",valueVertical:"value-vertical",valueNormal:"value-normal",valueLarge:"value-large",valueSub:"value-sub"};function x(t){if(function(t){return"object"==typeof t&&"function"==typeof t.to&&"function"==typeof t.from}(t))return!0;throw new Error("noUiSlider (14.6.0): 'format' requires 'to' and 'from' methods.")}function E(t,e){if(!i(e))throw new Error("noUiSlider (14.6.0): 'step' is not numeric.");t.singleStep=e}function S(t,e){if(!i(e))throw new Error("noUiSlider (14.6.0): 'keyboardPageMultiplier' is not numeric.");t.keyboardPageMultiplier=e}function O(t,e){if(!i(e))throw new Error("noUiSlider (14.6.0): 'keyboardDefaultStep' is not numeric.");t.keyboardDefaultStep=e}function C(t,e){if("object"!=typeof e||Array.isArray(e))throw new Error("noUiSlider (14.6.0): 'range' is not an object.");if(void 0===e.min||void 0===e.max)throw new Error("noUiSlider (14.6.0): Missing 'min' or 'max' in 'range'.");if(e.min===e.max)throw new Error("noUiSlider (14.6.0): 'range' 'min' and 'max' cannot be equal.");t.spectrum=new _(e,t.snap,t.singleStep)}function T(t,e){if(e=s(e),!Array.isArray(e)||!e.length)throw new Error("noUiSlider (14.6.0): 'start' option is incorrect.");t.handles=e.length,t.start=e}function I(t,e){if(t.snap=e,"boolean"!=typeof e)throw new Error("noUiSlider (14.6.0): 'snap' option must be a boolean.")}function L(t,e){if(t.animate=e,"boolean"!=typeof e)throw new Error("noUiSlider (14.6.0): 'animate' option must be a boolean.")}function P(t,e){if(t.animationDuration=e,"number"!=typeof e)throw new Error("noUiSlider (14.6.0): 'animationDuration' option must be a number.")}function R(t,e){var n,r=[!1];if("lower"===e?e=[!0,!1]:"upper"===e&&(e=[!1,!0]),!0===e||!1===e){for(n=1;n<t.handles;n++)r.push(e);r.push(!1)}else{if(!Array.isArray(e)||!e.length||e.length!==t.handles+1)throw new Error("noUiSlider (14.6.0): 'connect' option doesn't match handle count.");r=e}t.connect=r}function M(t,e){switch(e){case"horizontal":t.ort=0;break;case"vertical":t.ort=1;break;default:throw new Error("noUiSlider (14.6.0): 'orientation' option is invalid.")}}function N(t,e){if(!i(e))throw new Error("noUiSlider (14.6.0): 'margin' option must be numeric.");0!==e&&(t.margin=t.spectrum.getDistance(e))}function j(t,e){if(!i(e))throw new Error("noUiSlider (14.6.0): 'limit' option must be numeric.");if(t.limit=t.spectrum.getDistance(e),!t.limit||t.handles<2)throw new Error("noUiSlider (14.6.0): 'limit' option is only supported on linear sliders with 2 or more handles.")}function A(t,e){var n;if(!i(e)&&!Array.isArray(e))throw new Error("noUiSlider (14.6.0): 'padding' option must be numeric or array of exactly 2 numbers.");if(Array.isArray(e)&&2!==e.length&&!i(e[0])&&!i(e[1]))throw new Error("noUiSlider (14.6.0): 'padding' option must be numeric or array of exactly 2 numbers.");if(0!==e){for(Array.isArray(e)||(e=[e,e]),t.padding=[t.spectrum.getDistance(e[0]),t.spectrum.getDistance(e[1])],n=0;n<t.spectrum.xNumSteps.length-1;n++)if(t.padding[0][n]<0||t.padding[1][n]<0)throw new Error("noUiSlider (14.6.0): 'padding' option must be a positive number(s).");var r=e[0]+e[1],o=t.spectrum.xVal[0];if(r/(t.spectrum.xVal[t.spectrum.xVal.length-1]-o)>1)throw new Error("noUiSlider (14.6.0): 'padding' option must not exceed 100% of the range.")}}function k(t,e){switch(e){case"ltr":t.dir=0;break;case"rtl":t.dir=1;break;default:throw new Error("noUiSlider (14.6.0): 'direction' option was not recognized.")}}function F(t,e){if("string"!=typeof e)throw new Error("noUiSlider (14.6.0): 'behaviour' must be a string containing options.");var n=e.indexOf("tap")>=0,r=e.indexOf("drag")>=0,i=e.indexOf("fixed")>=0,o=e.indexOf("snap")>=0,a=e.indexOf("hover")>=0,s=e.indexOf("unconstrained")>=0;if(i){if(2!==t.handles)throw new Error("noUiSlider (14.6.0): 'fixed' behaviour must be used with 2 handles");N(t,t.start[1]-t.start[0])}if(s&&(t.margin||t.limit))throw new Error("noUiSlider (14.6.0): 'unconstrained' behaviour cannot be used with margin or limit");t.events={tap:n||o,drag:r,fixed:i,snap:o,hover:a,unconstrained:s}}function D(t,e){if(!1!==e)if(!0===e){t.tooltips=[];for(var n=0;n<t.handles;n++)t.tooltips.push(!0)}else{if(t.tooltips=s(e),t.tooltips.length!==t.handles)throw new Error("noUiSlider (14.6.0): must pass a formatter for all handles.");t.tooltips.forEach((function(t){if("boolean"!=typeof t&&("object"!=typeof t||"function"!=typeof t.to))throw new Error("noUiSlider (14.6.0): 'tooltips' must be passed a formatter or 'false'.")}))}}function G(t,e){t.ariaFormat=e,x(e)}function z(t,e){t.format=e,x(e)}function U(t,e){if(t.keyboardSupport=e,"boolean"!=typeof e)throw new Error("noUiSlider (14.6.0): 'keyboardSupport' option must be a boolean.")}function B(t,e){t.documentElement=e}function V(t,e){if("string"!=typeof e&&!1!==e)throw new Error("noUiSlider (14.6.0): 'cssPrefix' must be a string or `false`.");t.cssPrefix=e}function q(t,e){if("object"!=typeof e)throw new Error("noUiSlider (14.6.0): 'cssClasses' must be an object.");if("string"==typeof t.cssPrefix)for(var n in t.cssClasses={},e)e.hasOwnProperty(n)&&(t.cssClasses[n]=t.cssPrefix+e[n]);else t.cssClasses=e}function Y(t){var e={margin:0,limit:0,padding:0,animate:!0,animationDuration:300,ariaFormat:b,format:b},r={step:{r:!1,t:E},keyboardPageMultiplier:{r:!1,t:S},keyboardDefaultStep:{r:!1,t:O},start:{r:!0,t:T},connect:{r:!0,t:R},direction:{r:!0,t:k},snap:{r:!1,t:I},animate:{r:!1,t:L},animationDuration:{r:!1,t:P},range:{r:!0,t:C},orientation:{r:!1,t:M},margin:{r:!1,t:N},limit:{r:!1,t:j},padding:{r:!1,t:A},behaviour:{r:!0,t:F},ariaFormat:{r:!1,t:G},format:{r:!1,t:z},tooltips:{r:!1,t:D},keyboardSupport:{r:!0,t:U},documentElement:{r:!1,t:B},cssPrefix:{r:!0,t:V},cssClasses:{r:!0,t:q}},i={connect:!1,direction:"ltr",behaviour:"tap",orientation:"horizontal",keyboardSupport:!0,cssPrefix:"noUi-",cssClasses:w,keyboardPageMultiplier:5,keyboardDefaultStep:10};t.format&&!t.ariaFormat&&(t.ariaFormat=t.format),Object.keys(r).forEach((function(o){if(!n(t[o])&&void 0===i[o]){if(r[o].r)throw new Error("noUiSlider (14.6.0): '"+o+"' is required.");return!0}r[o].t(e,n(t[o])?t[o]:i[o])})),e.pips=t.pips;var o=document.createElement("div"),a=void 0!==o.style.msTransform,s=void 0!==o.style.transform;return e.transformRule=s?"transform":a?"msTransform":"webkitTransform",e.style=[["left","top"],["right","bottom"]][e.dir][e.ort],e}function X(t,n,i){var l,p,d,f,g,y,m,v,_=window.navigator.pointerEnabled?{start:"pointerdown",move:"pointermove",end:"pointerup"}:window.navigator.msPointerEnabled?{start:"MSPointerDown",move:"MSPointerMove",end:"MSPointerUp"}:{start:"mousedown touchstart",move:"mousemove touchmove",end:"mouseup touchend"},b=window.CSS&&CSS.supports&&CSS.supports("touch-action","none")&&function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("test",null,e)}catch(t){}return t}(),w=t,x=n.spectrum,E=[],S=[],O=[],C=0,T={},I=t.ownerDocument,L=n.documentElement||I.documentElement,P=I.body,R="rtl"===I.dir||1===n.ort?0:100;function M(t,e){var n=I.createElement("div");return e&&u(n,e),t.appendChild(n),n}function N(t,e){var r=M(t,n.cssClasses.origin),i=M(r,n.cssClasses.handle);return M(i,n.cssClasses.touchArea),i.setAttribute("data-handle",e),n.keyboardSupport&&(i.setAttribute("tabindex","0"),i.addEventListener("keydown",(function(t){return function(t,e){if(k()||F(e))return!1;var r=["Left","Right"],i=["Down","Up"],o=["PageDown","PageUp"],a=["Home","End"];n.dir&&!n.ort?r.reverse():n.ort&&!n.dir&&(i.reverse(),o.reverse());var s,l=t.key.replace("Arrow",""),u=l===o[0],c=l===o[1],h=l===i[0]||l===r[0]||u,p=l===i[1]||l===r[1]||c,d=l===a[0],f=l===a[1];if(!(h||p||d||f))return!0;if(t.preventDefault(),p||h){var g=n.keyboardPageMultiplier,y=h?0:1,m=pt(e)[y];if(null===m)return!1;!1===m&&(m=x.getDefaultStep(S[e],h,n.keyboardDefaultStep)),(c||u)&&(m*=g),m=Math.max(m,1e-7),m*=h?-1:1,s=E[e]+m}else s=f?n.spectrum.xVal[n.spectrum.xVal.length-1]:n.spectrum.xVal[0];return st(e,x.toStepping(s),!0,!0),et("slide",e),et("update",e),et("change",e),et("set",e),!1}(t,e)}))),i.setAttribute("role","slider"),i.setAttribute("aria-orientation",n.ort?"vertical":"horizontal"),0===e?u(i,n.cssClasses.handleLower):e===n.handles-1&&u(i,n.cssClasses.handleUpper),r}function j(t,e){return!!e&&M(t,n.cssClasses.connect)}function A(t,e){return!!n.tooltips[e]&&M(t.firstChild,n.cssClasses.tooltip)}function k(){return w.hasAttribute("disabled")}function F(t){return p[t].hasAttribute("disabled")}function D(){g&&(tt("update.tooltips"),g.forEach((function(t){t&&e(t)})),g=null)}function G(){D(),g=p.map(A),Q("update.tooltips",(function(t,e,r){if(g[e]){var i=t[e];!0!==n.tooltips[e]&&(i=n.tooltips[e].to(r[e])),g[e].innerHTML=i}}))}function z(t,e,r){var i=I.createElement("div"),o=[];o[0]=n.cssClasses.valueNormal,o[1]=n.cssClasses.valueLarge,o[2]=n.cssClasses.valueSub;var a=[];a[0]=n.cssClasses.markerNormal,a[1]=n.cssClasses.markerLarge,a[2]=n.cssClasses.markerSub;var s=[n.cssClasses.valueHorizontal,n.cssClasses.valueVertical],l=[n.cssClasses.markerHorizontal,n.cssClasses.markerVertical];function c(t,e){var r=e===n.cssClasses.value,i=r?o:a;return e+" "+(r?s:l)[n.ort]+" "+i[t]}return u(i,n.cssClasses.pips),u(i,0===n.ort?n.cssClasses.pipsHorizontal:n.cssClasses.pipsVertical),Object.keys(t).forEach((function(o){!function(t,o,a){if(-1!==(a=e?e(o,a):a)){var s=M(i,!1);s.className=c(a,n.cssClasses.marker),s.style[n.style]=t+"%",a>0&&((s=M(i,!1)).className=c(a,n.cssClasses.value),s.setAttribute("data-value",o),s.style[n.style]=t+"%",s.innerHTML=r.to(o))}}(o,t[o][0],t[o][1])})),i}function U(){f&&(e(f),f=null)}function B(t){U();var e=t.mode,n=t.density||1,r=t.filter||!1,i=function(t,e,n){if("range"===t||"steps"===t)return x.xVal;if("count"===t){if(e<2)throw new Error("noUiSlider (14.6.0): 'values' (>= 2) required for mode 'count'.");var r=e-1,i=100/r;for(e=[];r--;)e[r]=r*i;e.push(100),t="positions"}return"positions"===t?e.map((function(t){return x.fromStepping(n?x.getStep(t):t)})):"values"===t?n?e.map((function(t){return x.fromStepping(x.getStep(x.toStepping(t)))})):e:void 0}(e,t.values||!1,t.stepped||!1),o=function(t,e,n){var r,i={},o=x.xVal[0],a=x.xVal[x.xVal.length-1],s=!1,l=!1,u=0;return r=n.slice().sort((function(t,e){return t-e})),(n=r.filter((function(t){return!this[t]&&(this[t]=!0)}),{}))[0]!==o&&(n.unshift(o),s=!0),n[n.length-1]!==a&&(n.push(a),l=!0),n.forEach((function(r,o){var a,c,h,p,d,f,g,y,m,v,_=r,b=n[o+1],w="steps"===e;if(w&&(a=x.xNumSteps[o]),a||(a=b-_),!1!==_&&void 0!==b)for(a=Math.max(a,1e-7),c=_;c<=b;c=(c+a).toFixed(7)/1){for(y=(d=(p=x.toStepping(c))-u)/t,v=d/(m=Math.round(y)),h=1;h<=m;h+=1)i[(f=u+h*v).toFixed(5)]=[x.fromStepping(f),0];g=n.indexOf(c)>-1?1:w?2:0,!o&&s&&c!==b&&(g=0),c===b&&l||(i[p.toFixed(5)]=[c,g]),u=p}})),i}(n,e,i),a=t.format||{to:Math.round};return f=w.appendChild(z(o,r,a))}function V(){var t=l.getBoundingClientRect(),e="offset"+["Width","Height"][n.ort];return 0===n.ort?t.width||l[e]:t.height||l[e]}function q(t,e,r,i){var o=function(o){return!!(o=function(t,e,n){var r,i,o=0===t.type.indexOf("touch"),a=0===t.type.indexOf("mouse"),s=0===t.type.indexOf("pointer");if(0===t.type.indexOf("MSPointer")&&(s=!0),o){var l=function(t){return t.target===n||n.contains(t.target)||t.target.shadowRoot&&t.target.shadowRoot.contains(n)};if("touchstart"===t.type){var u=Array.prototype.filter.call(t.touches,l);if(u.length>1)return!1;r=u[0].pageX,i=u[0].pageY}else{var c=Array.prototype.find.call(t.changedTouches,l);if(!c)return!1;r=c.pageX,i=c.pageY}}return e=e||h(I),(a||s)&&(r=t.clientX+e.x,i=t.clientY+e.y),t.pageOffset=e,t.points=[r,i],t.cursor=a||s,t}(o,i.pageOffset,i.target||e))&&!(k()&&!i.doNotReject)&&(a=w,s=n.cssClasses.tap,!((a.classList?a.classList.contains(s):new RegExp("\\b"+s+"\\b").test(a.className))&&!i.doNotReject)&&!(t===_.start&&void 0!==o.buttons&&o.buttons>1)&&(!i.hover||!o.buttons)&&(b||o.preventDefault(),o.calcPoint=o.points[n.ort],void r(o,i)));var a,s},a=[];return t.split(" ").forEach((function(t){e.addEventListener(t,o,!!b&&{passive:!0}),a.push([t,o])})),a}function X(t){var e,r,i,o,s,u,c=100*(t-(e=l,r=n.ort,i=e.getBoundingClientRect(),o=e.ownerDocument,s=o.documentElement,u=h(o),/webkit.*Chrome.*Mobile/i.test(navigator.userAgent)&&(u.x=0),r?i.top+u.y-s.clientTop:i.left+u.x-s.clientLeft))/V();return c=a(c),n.dir?100-c:c}function W(t,e){"mouseout"===t.type&&"HTML"===t.target.nodeName&&null===t.relatedTarget&&K(t,e)}function H(t,e){if(-1===navigator.appVersion.indexOf("MSIE 9")&&0===t.buttons&&0!==e.buttonsProperty)return K(t,e);var r=(n.dir?-1:1)*(t.calcPoint-e.startCalcPoint);it(r>0,100*r/e.baseSize,e.locations,e.handleNumbers)}function K(t,e){e.handle&&(c(e.handle,n.cssClasses.active),C-=1),e.listeners.forEach((function(t){L.removeEventListener(t[0],t[1])})),0===C&&(c(w,n.cssClasses.drag),at(),t.cursor&&(P.style.cursor="",P.removeEventListener("selectstart",r))),e.handleNumbers.forEach((function(t){et("change",t),et("set",t),et("end",t)}))}function Z(t,e){if(e.handleNumbers.some(F))return!1;var i;1===e.handleNumbers.length&&(i=p[e.handleNumbers[0]].children[0],C+=1,u(i,n.cssClasses.active)),t.stopPropagation();var o=[],a=q(_.move,L,H,{target:t.target,handle:i,listeners:o,startCalcPoint:t.calcPoint,baseSize:V(),pageOffset:t.pageOffset,handleNumbers:e.handleNumbers,buttonsProperty:t.buttons,locations:S.slice()}),s=q(_.end,L,K,{target:t.target,handle:i,listeners:o,doNotReject:!0,handleNumbers:e.handleNumbers}),l=q("mouseout",L,W,{target:t.target,handle:i,listeners:o,doNotReject:!0,handleNumbers:e.handleNumbers});o.push.apply(o,a.concat(s,l)),t.cursor&&(P.style.cursor=getComputedStyle(t.target).cursor,p.length>1&&u(w,n.cssClasses.drag),P.addEventListener("selectstart",r,!1)),e.handleNumbers.forEach((function(t){et("start",t)}))}function $(t){if(!t.buttons&&!t.touches)return!1;t.stopPropagation();var e=X(t.calcPoint),r=function(t){var e=100,n=!1;return p.forEach((function(r,i){if(!F(i)){var o=S[i],a=Math.abs(o-t);(a<e||a<=e&&t>o||100===a&&100===e)&&(n=i,e=a)}})),n}(e);if(!1===r)return!1;n.events.snap||o(w,n.cssClasses.tap,n.animationDuration),st(r,e,!0,!0),at(),et("slide",r,!0),et("update",r,!0),et("change",r,!0),et("set",r,!0),n.events.snap&&Z(t,{handleNumbers:[r]})}function J(t){var e=X(t.calcPoint),n=x.getStep(e),r=x.fromStepping(n);Object.keys(T).forEach((function(t){"hover"===t.split(".")[0]&&T[t].forEach((function(t){t.call(y,r)}))}))}function Q(t,e){T[t]=T[t]||[],T[t].push(e),"update"===t.split(".")[0]&&p.forEach((function(t,e){et("update",e)}))}function tt(t){var e=t&&t.split(".")[0],n=e&&t.substring(e.length);Object.keys(T).forEach((function(t){var r=t.split(".")[0],i=t.substring(r.length);e&&e!==r||n&&n!==i||delete T[t]}))}function et(t,e,r){Object.keys(T).forEach((function(i){var o=i.split(".")[0];t===o&&T[i].forEach((function(t){t.call(y,E.map(n.format.to),e,E.slice(),r||!1,S.slice(),y)}))}))}function nt(t,e,r,i,o,s){var l;return p.length>1&&!n.events.unconstrained&&(i&&e>0&&(l=x.getAbsoluteDistance(t[e-1],n.margin,0),r=Math.max(r,l)),o&&e<p.length-1&&(l=x.getAbsoluteDistance(t[e+1],n.margin,1),r=Math.min(r,l))),p.length>1&&n.limit&&(i&&e>0&&(l=x.getAbsoluteDistance(t[e-1],n.limit,0),r=Math.min(r,l)),o&&e<p.length-1&&(l=x.getAbsoluteDistance(t[e+1],n.limit,1),r=Math.max(r,l))),n.padding&&(0===e&&(l=x.getAbsoluteDistance(0,n.padding[0],0),r=Math.max(r,l)),e===p.length-1&&(l=x.getAbsoluteDistance(100,n.padding[1],1),r=Math.min(r,l))),!((r=a(r=x.getStep(r)))===t[e]&&!s)&&r}function rt(t,e){var r=n.ort;return(r?e:t)+", "+(r?t:e)}function it(t,e,n,r){var i=n.slice(),o=[!t,t],a=[t,!t];r=r.slice(),t&&r.reverse(),r.length>1?r.forEach((function(t,n){var r=nt(i,t,i[t]+e,o[n],a[n],!1);!1===r?e=0:(e=r-i[t],i[t]=r)})):o=a=[!0];var s=!1;r.forEach((function(t,r){s=st(t,n[t]+e,o[r],a[r])||s})),s&&r.forEach((function(t){et("update",t),et("slide",t)}))}function ot(t,e){return n.dir?100-t-e:t}function at(){O.forEach((function(t){var e=S[t]>50?-1:1,n=3+(p.length+e*t);p[t].style.zIndex=n}))}function st(t,e,r,i){return!1!==(e=nt(S,t,e,r,i,!1))&&(function(t,e){S[t]=e,E[t]=x.fromStepping(e);var r="translate("+rt(10*(ot(e,0)-R)+"%","0")+")";p[t].style[n.transformRule]=r,lt(t),lt(t+1)}(t,e),!0)}function lt(t){if(d[t]){var e=0,r=100;0!==t&&(e=S[t-1]),t!==d.length-1&&(r=S[t]);var i=r-e,o="translate("+rt(ot(e,i)+"%","0")+")",a="scale("+rt(i/100,"1")+")";d[t].style[n.transformRule]=o+" "+a}}function ut(t,e){return null===t||!1===t||void 0===t?S[e]:("number"==typeof t&&(t=String(t)),t=n.format.from(t),!1===(t=x.toStepping(t))||isNaN(t)?S[e]:t)}function ct(t,e){var r=s(t),i=void 0===S[0];e=void 0===e||!!e,n.animate&&!i&&o(w,n.cssClasses.tap,n.animationDuration),O.forEach((function(t){st(t,ut(r[t],t),!0,!1)}));for(var a=1===O.length?0:1;a<O.length;++a)O.forEach((function(t){st(t,S[t],!0,!0)}));at(),O.forEach((function(t){et("update",t),null!==r[t]&&e&&et("set",t)}))}function ht(){var t=E.map(n.format.to);return 1===t.length?t[0]:t}function pt(t){var e=S[t],r=x.getNearbySteps(e),i=E[t],o=r.thisStep.step,a=null;if(n.snap)return[i-r.stepBefore.startValue||null,r.stepAfter.startValue-i||null];!1!==o&&i+o>r.stepAfter.startValue&&(o=r.stepAfter.startValue-i),a=i>r.thisStep.startValue?r.thisStep.step:!1!==r.stepBefore.step&&i-r.stepBefore.highestStep,100===e?o=null:0===e&&(a=null);var s=x.countStepDecimals();return null!==o&&!1!==o&&(o=Number(o.toFixed(s))),null!==a&&!1!==a&&(a=Number(a.toFixed(s))),[a,o]}return u(m=w,n.cssClasses.target),0===n.dir?u(m,n.cssClasses.ltr):u(m,n.cssClasses.rtl),0===n.ort?u(m,n.cssClasses.horizontal):u(m,n.cssClasses.vertical),u(m,"rtl"===getComputedStyle(m).direction?n.cssClasses.textDirectionRtl:n.cssClasses.textDirectionLtr),l=M(m,n.cssClasses.base),function(t,e){var r=M(e,n.cssClasses.connects);p=[],(d=[]).push(j(r,t[0]));for(var i=0;i<n.handles;i++)p.push(N(e,i)),O[i]=i,d.push(j(r,t[i+1]))}(n.connect,l),(v=n.events).fixed||p.forEach((function(t,e){q(_.start,t.children[0],Z,{handleNumbers:[e]})})),v.tap&&q(_.start,l,$,{}),v.hover&&q(_.move,l,J,{hover:!0}),v.drag&&d.forEach((function(t,e){if(!1!==t&&0!==e&&e!==d.length-1){var r=p[e-1],i=p[e],o=[t];u(t,n.cssClasses.draggable),v.fixed&&(o.push(r.children[0]),o.push(i.children[0])),o.forEach((function(t){q(_.start,t,Z,{handles:[r,i],handleNumbers:[e-1,e]})}))}})),ct(n.start),n.pips&&B(n.pips),n.tooltips&&G(),Q("update",(function(t,e,r,i,o){O.forEach((function(t){var e=p[t],i=nt(S,t,0,!0,!0,!0),a=nt(S,t,100,!0,!0,!0),s=o[t],l=n.ariaFormat.to(r[t]);i=x.fromStepping(i).toFixed(1),a=x.fromStepping(a).toFixed(1),s=x.fromStepping(s).toFixed(1),e.children[0].setAttribute("aria-valuemin",i),e.children[0].setAttribute("aria-valuemax",a),e.children[0].setAttribute("aria-valuenow",s),e.children[0].setAttribute("aria-valuetext",l)}))})),y={destroy:function(){for(var t in n.cssClasses)n.cssClasses.hasOwnProperty(t)&&c(w,n.cssClasses[t]);for(;w.firstChild;)w.removeChild(w.firstChild);delete w.noUiSlider},steps:function(){return O.map(pt)},on:Q,off:tt,get:ht,set:ct,setHandle:function(t,e,n){if(!((t=Number(t))>=0&&t<O.length))throw new Error("noUiSlider (14.6.0): invalid handle number, got: "+t);st(t,ut(e,t),!0,!0),et("update",t),n&&et("set",t)},reset:function(t){ct(n.start,t)},__moveHandles:function(t,e,n){it(t,e,S,n)},options:i,updateOptions:function(t,e){var r=ht(),o=["margin","limit","padding","range","animate","snap","step","format","pips","tooltips"];o.forEach((function(e){void 0!==t[e]&&(i[e]=t[e])}));var a=Y(i);o.forEach((function(e){void 0!==t[e]&&(n[e]=a[e])})),x=a.spectrum,n.margin=a.margin,n.limit=a.limit,n.padding=a.padding,n.pips?B(n.pips):U(),n.tooltips?G():D(),S=[],ct(t.start||r,e)},target:w,removePips:U,removeTooltips:D,getTooltips:function(){return g},getOrigins:function(){return p},pips:B}}return{__spectrum:_,version:t,cssClasses:w,create:function(t,e){if(!t||!t.nodeName)throw new Error("noUiSlider (14.6.0): create requires a single element, got: "+t);if(t.noUiSlider)throw new Error("noUiSlider (14.6.0): Slider was already initialized.");var n=X(t,Y(e),e);return t.noUiSlider=n,n}}})?r.apply(e,i):r)||(t.exports=o)},function(t,e,n){(function(n){var r,i,o;i=[],void 0===(o="function"==typeof(r=function(){"use strict";function e(t,e,n){var r=new XMLHttpRequest;r.open("GET",t),r.responseType="blob",r.onload=function(){a(r.response,e,n)},r.onerror=function(){console.error("could not download file")},r.send()}function r(t){var e=new XMLHttpRequest;e.open("HEAD",t,!1);try{e.send()}catch(t){}return 200<=e.status&&299>=e.status}function i(t){try{t.dispatchEvent(new MouseEvent("click"))}catch(n){var e=document.createEvent("MouseEvents");e.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),t.dispatchEvent(e)}}var o="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof n&&n.global===n?n:void 0,a=o.saveAs||("object"!=typeof window||window!==o?function(){}:"download"in HTMLAnchorElement.prototype?function(t,n,a){var s=o.URL||o.webkitURL,l=document.createElement("a");n=n||t.name||"download",l.download=n,l.rel="noopener","string"==typeof t?(l.href=t,l.origin===location.origin?i(l):r(l.href)?e(t,n,a):i(l,l.target="_blank")):(l.href=s.createObjectURL(t),setTimeout((function(){s.revokeObjectURL(l.href)}),4e4),setTimeout((function(){i(l)}),0))}:"msSaveOrOpenBlob"in navigator?function(t,n,o){if(n=n||t.name||"download","string"!=typeof t)navigator.msSaveOrOpenBlob(function(t,e){return void 0===e?e={autoBom:!1}:"object"!=typeof e&&(console.warn("Deprecated: Expected third argument to be a object"),e={autoBom:!e}),e.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(t.type)?new Blob(["\ufeff",t],{type:t.type}):t}(t,o),n);else if(r(t))e(t,n,o);else{var a=document.createElement("a");a.href=t,a.target="_blank",setTimeout((function(){i(a)}))}}:function(t,n,r,i){if((i=i||open("","_blank"))&&(i.document.title=i.document.body.innerText="downloading..."),"string"==typeof t)return e(t,n,r);var a="application/octet-stream"===t.type,s=/constructor/i.test(o.HTMLElement)||o.safari,l=/CriOS\/[\d]+/.test(navigator.userAgent);if((l||a&&s)&&"object"==typeof FileReader){var u=new FileReader;u.onloadend=function(){var t=u.result;t=l?t:t.replace(/^data:[^;]*;/,"data:attachment/file;"),i?i.location.href=t:location=t,i=null},u.readAsDataURL(t)}else{var c=o.URL||o.webkitURL,h=c.createObjectURL(t);i?i.location=h:location.href=h,i=null,setTimeout((function(){c.revokeObjectURL(h)}),4e4)}});o.saveAs=a.saveAs=a,t.exports=a})?r.apply(e,i):r)||(t.exports=o)}).call(this,n(216))},function(t,e,n){"use strict";
/**
* jscolor - JavaScript Color Picker
*
* @link http://jscolor.com
* @license For open source use: GPLv3
* For commercial use: JSColor Commercial License
* @author Jan Odvarko
* @version 2.0.4
*
* See usage examples at http://jscolor.com/examples/
*/var r,i,o,a,s,l;window.jscolor||(window.jscolor=((l={register:function(){l.attachDOMReadyEvent(l.init),l.attachEvent(document,"mousedown",l.onDocumentMouseDown),l.attachEvent(document,"touchstart",l.onDocumentTouchStart),l.attachEvent(window,"resize",l.onWindowResize)},init:function(){l.jscolor.lookupClass&&l.jscolor.installByClassName(l.jscolor.lookupClass)},tryInstallOnElements:function(t,e){for(var n=new RegExp("(^|\\s)("+e+")(\\s*(\\{[^}]*\\})|\\s|$)","i"),r=0;r<t.length;r+=1){var i;if((void 0===t[r].type||"color"!=t[r].type.toLowerCase()||!l.isColorAttrSupported)&&!t[r].jscolor&&t[r].className&&(i=t[r].className.match(n))){var o=t[r],a=null,s=l.getDataAttr(o,"jscolor");null!==s?a=s:i[4]&&(a=i[4]);var u={};if(a)try{u=new Function("return ("+a+")")()}catch(t){l.warn("Error parsing jscolor options: "+t+":\n"+a)}o.jscolor=new l.jscolor(o,u)}}},isColorAttrSupported:(s=document.createElement("input"),!(!s.setAttribute||(s.setAttribute("type","color"),"color"!=s.type.toLowerCase()))),isCanvasSupported:function(){var t=document.createElement("canvas");return!(!t.getContext||!t.getContext("2d"))}(),fetchElement:function(t){return"string"==typeof t?document.getElementById(t):t},isElementType:function(t,e){return t.nodeName.toLowerCase()===e.toLowerCase()},getDataAttr:function(t,e){var n="data-"+e,r=t.getAttribute(n);return null!==r?r:null},attachEvent:function(t,e,n){t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent&&t.attachEvent("on"+e,n)},detachEvent:function(t,e,n){t.removeEventListener?t.removeEventListener(e,n,!1):t.detachEvent&&t.detachEvent("on"+e,n)},_attachedGroupEvents:{},attachGroupEvent:function(t,e,n,r){l._attachedGroupEvents.hasOwnProperty(t)||(l._attachedGroupEvents[t]=[]),l._attachedGroupEvents[t].push([e,n,r]),l.attachEvent(e,n,r)},detachGroupEvents:function(t){if(l._attachedGroupEvents.hasOwnProperty(t)){for(var e=0;e<l._attachedGroupEvents[t].length;e+=1){var n=l._attachedGroupEvents[t][e];l.detachEvent(n[0],n[1],n[2])}delete l._attachedGroupEvents[t]}},attachDOMReadyEvent:function(t){var e=!1,n=function(){e||(e=!0,t())};"complete"!==document.readyState?document.addEventListener?(document.addEventListener("DOMContentLoaded",n,!1),window.addEventListener("load",n,!1)):document.attachEvent&&(document.attachEvent("onreadystatechange",(function(){"complete"===document.readyState&&(document.detachEvent("onreadystatechange",arguments.callee),n())})),window.attachEvent("onload",n),document.documentElement.doScroll&&window==window.top)&&function t(){if(document.body)try{document.documentElement.doScroll("left"),n()}catch(e){setTimeout(t,1)}}():setTimeout(n,1)},warn:function(t){window.console&&window.console.warn&&window.console.warn(t)},preventDefault:function(t){t.preventDefault&&t.preventDefault(),t.returnValue=!1},captureTarget:function(t){t.setCapture&&(l._capturedTarget=t,l._capturedTarget.setCapture())},releaseTarget:function(){l._capturedTarget&&(l._capturedTarget.releaseCapture(),l._capturedTarget=null)},fireEvent:function(t,e){if(t)if(document.createEvent)(n=document.createEvent("HTMLEvents")).initEvent(e,!0,!0),t.dispatchEvent(n);else if(document.createEventObject){var n=document.createEventObject();t.fireEvent("on"+e,n)}else t["on"+e]&&t["on"+e]()},classNameToList:function(t){return t.replace(/^\s+|\s+$/g,"").split(/\s+/)},hasClass:function(t,e){return!!e&&-1!=(" "+t.className.replace(/\s+/g," ")+" ").indexOf(" "+e+" ")},setClass:function(t,e){for(var n=l.classNameToList(e),r=0;r<n.length;r+=1)l.hasClass(t,n[r])||(t.className+=(t.className?" ":"")+n[r])},unsetClass:function(t,e){for(var n=l.classNameToList(e),r=0;r<n.length;r+=1){var i=new RegExp("^\\s*"+n[r]+"\\s*|\\s*"+n[r]+"\\s*$|\\s+"+n[r]+"(\\s+)","g");t.className=t.className.replace(i,"$1")}},getStyle:function(t){return window.getComputedStyle?window.getComputedStyle(t):t.currentStyle},setStyle:(i=document.createElement("div"),o=function(t){for(var e=0;e<t.length;e+=1)if(t[e]in i.style)return t[e]},a={borderRadius:o(["borderRadius","MozBorderRadius","webkitBorderRadius"]),boxShadow:o(["boxShadow","MozBoxShadow","webkitBoxShadow"])},function(t,e,n){switch(e.toLowerCase()){case"opacity":var r=Math.round(100*parseFloat(n));t.style.opacity=n,t.style.filter="alpha(opacity="+r+")";break;default:t.style[a[e]]=n}}),setBorderRadius:function(t,e){l.setStyle(t,"borderRadius",e||"0")},setBoxShadow:function(t,e){l.setStyle(t,"boxShadow",e||"none")},getElementPos:function(t,e){var n=0,r=0,i=t.getBoundingClientRect();if(n=i.left,r=i.top,!e){var o=l.getViewPos();n+=o[0],r+=o[1]}return[n,r]},getElementSize:function(t){return[t.offsetWidth,t.offsetHeight]},getAbsPointerPos:function(t){t||(t=window.event);var e=0,n=0;return void 0!==t.changedTouches&&t.changedTouches.length?(e=t.changedTouches[0].clientX,n=t.changedTouches[0].clientY):"number"==typeof t.clientX&&(e=t.clientX,n=t.clientY),{x:e,y:n}},getRelPointerPos:function(t){t||(t=window.event);var e=(t.target||t.srcElement).getBoundingClientRect(),n=0,r=0;return void 0!==t.changedTouches&&t.changedTouches.length?(n=t.changedTouches[0].clientX,r=t.changedTouches[0].clientY):"number"==typeof t.clientX&&(n=t.clientX,r=t.clientY),{x:n-e.left,y:r-e.top}},getViewPos:function(){var t=document.documentElement;return[(window.pageXOffset||t.scrollLeft)-(t.clientLeft||0),(window.pageYOffset||t.scrollTop)-(t.clientTop||0)]},getViewSize:function(){var t=document.documentElement;return[window.innerWidth||t.clientWidth,window.innerHeight||t.clientHeight]},redrawPosition:function(){if(l.picker&&l.picker.owner){var t,e,n=l.picker.owner;n.fixed?(t=l.getElementPos(n.targetElement,!0),e=[0,0]):(t=l.getElementPos(n.targetElement),e=l.getViewPos());var r,i,o,a=l.getElementSize(n.targetElement),s=l.getViewSize(),u=l.getPickerOuterDims(n);switch(n.position.toLowerCase()){case"left":r=1,i=0,o=-1;break;case"right":r=1,i=0,o=1;break;case"top":r=0,i=1,o=-1;break;default:r=0,i=1,o=1}var c=(a[i]+u[i])/2;if(n.smartPosition)h=[-e[r]+t[r]+u[r]>s[r]&&-e[r]+t[r]+a[r]/2>s[r]/2&&t[r]+a[r]-u[r]>=0?t[r]+a[r]-u[r]:t[r],-e[i]+t[i]+a[i]+u[i]-c+c*o>s[i]?-e[i]+t[i]+a[i]/2>s[i]/2&&t[i]+a[i]-c-c*o>=0?t[i]+a[i]-c-c*o:t[i]+a[i]-c+c*o:t[i]+a[i]-c+c*o>=0?t[i]+a[i]-c+c*o:t[i]+a[i]-c-c*o];else var h=[t[r],t[i]+a[i]-c+c*o];var p=h[r],d=h[i],f=n.fixed?"fixed":"absolute",g=(h[0]+u[0]>t[0]||h[0]<t[0]+a[0])&&h[1]+u[1]<t[1]+a[1];l._drawPosition(n,p,d,f,g)}},_drawPosition:function(t,e,n,r,i){var o=i?0:t.shadowBlur;l.picker.wrap.style.position=r,l.picker.wrap.style.left=e+"px",l.picker.wrap.style.top=n+"px",l.setBoxShadow(l.picker.boxS,t.shadow?new l.BoxShadow(0,o,t.shadowBlur,0,t.shadowColor):null)},getPickerDims:function(t){var e=!!l.getSliderComponent(t);return[2*t.insetWidth+2*t.padding+t.width+(e?2*t.insetWidth+l.getPadToSliderPadding(t)+t.sliderSize:0),2*t.insetWidth+2*t.padding+t.height+(t.closable?2*t.insetWidth+t.padding+t.buttonHeight:0)]},getPickerOuterDims:function(t){var e=l.getPickerDims(t);return[e[0]+2*t.borderWidth,e[1]+2*t.borderWidth]},getPadToSliderPadding:function(t){return Math.max(t.padding,1.5*(2*t.pointerBorderWidth+t.pointerThickness))},getPadYComponent:function(t){switch(t.mode.charAt(1).toLowerCase()){case"v":return"v"}return"s"},getSliderComponent:function(t){if(t.mode.length>2)switch(t.mode.charAt(2).toLowerCase()){case"s":return"s";case"v":return"v"}return null},onDocumentMouseDown:function(t){t||(t=window.event);var e=t.target||t.srcElement;e._jscLinkedInstance?e._jscLinkedInstance.showOnClick&&e._jscLinkedInstance.show():e._jscControlName?l.onControlPointerStart(t,e,e._jscControlName,"mouse"):l.picker&&l.picker.owner&&l.picker.owner.hide()},onDocumentTouchStart:function(t){t||(t=window.event);var e=t.target||t.srcElement;e._jscLinkedInstance?e._jscLinkedInstance.showOnClick&&e._jscLinkedInstance.show():e._jscControlName?l.onControlPointerStart(t,e,e._jscControlName,"touch"):l.picker&&l.picker.owner&&l.picker.owner.hide()},onWindowResize:function(t){l.redrawPosition()},onParentScroll:function(t){l.picker&&l.picker.owner&&l.picker.owner.hide()},_pointerMoveEvent:{mouse:"mousemove",touch:"touchmove"},_pointerEndEvent:{mouse:"mouseup",touch:"touchend"},_pointerOrigin:null,_capturedTarget:null,onControlPointerStart:function(t,e,n,r){var i=e._jscInstance;l.preventDefault(t),l.captureTarget(e);var o=function(i,o){l.attachGroupEvent("drag",i,l._pointerMoveEvent[r],l.onDocumentPointerMove(t,e,n,r,o)),l.attachGroupEvent("drag",i,l._pointerEndEvent[r],l.onDocumentPointerEnd(t,e,n,r))};if(o(document,[0,0]),window.parent&&window.frameElement){var a=window.frameElement.getBoundingClientRect(),s=[-a.left,-a.top];o(window.parent.window.document,s)}var u=l.getAbsPointerPos(t),c=l.getRelPointerPos(t);switch(l._pointerOrigin={x:u.x-c.x,y:u.y-c.y},n){case"pad":switch(l.getSliderComponent(i)){case"s":0===i.hsv[1]&&i.fromHSV(null,100,null);break;case"v":0===i.hsv[2]&&i.fromHSV(null,null,100)}l.setPad(i,t,0,0);break;case"sld":l.setSld(i,t,0)}l.dispatchFineChange(i)},onDocumentPointerMove:function(t,e,n,r,i){return function(t){var r=e._jscInstance;switch(n){case"pad":t||(t=window.event),l.setPad(r,t,i[0],i[1]),l.dispatchFineChange(r);break;case"sld":t||(t=window.event),l.setSld(r,t,i[1]),l.dispatchFineChange(r)}}},onDocumentPointerEnd:function(t,e,n,r){return function(t){var n=e._jscInstance;l.detachGroupEvents("drag"),l.releaseTarget(),l.dispatchChange(n)}},dispatchChange:function(t){t.valueElement&&l.isElementType(t.valueElement,"input")&&l.fireEvent(t.valueElement,"change")},dispatchFineChange:function(t){t.onFineChange&&("string"==typeof t.onFineChange?new Function(t.onFineChange):t.onFineChange).call(t)},setPad:function(t,e,n,r){var i=l.getAbsPointerPos(e),o=n+i.x-l._pointerOrigin.x-t.padding-t.insetWidth,a=r+i.y-l._pointerOrigin.y-t.padding-t.insetWidth,s=o*(360/(t.width-1)),u=100-a*(100/(t.height-1));switch(l.getPadYComponent(t)){case"s":t.fromHSV(s,u,null,l.leaveSld);break;case"v":t.fromHSV(s,null,u,l.leaveSld)}},setSld:function(t,e,n){var r=100-(n+l.getAbsPointerPos(e).y-l._pointerOrigin.y-t.padding-t.insetWidth)*(100/(t.height-1));switch(l.getSliderComponent(t)){case"s":t.fromHSV(null,r,null,l.leavePad);break;case"v":t.fromHSV(null,null,r,l.leavePad)}},_vmlNS:"jsc_vml_",_vmlCSS:"jsc_vml_css_",_vmlReady:!1,initVML:function(){if(!l._vmlReady){var t=document;if(t.namespaces[l._vmlNS]||t.namespaces.add(l._vmlNS,"urn:schemas-microsoft-com:vml"),!t.styleSheets[l._vmlCSS]){var e=["shape","shapetype","group","background","path","formulas","handles","fill","stroke","shadow","textbox","textpath","imagedata","line","polyline","curve","rect","roundrect","oval","arc","image"],n=t.createStyleSheet();n.owningElement.id=l._vmlCSS;for(var r=0;r<e.length;r+=1)n.addRule(l._vmlNS+"\\:"+e[r],"behavior:url(#default#VML);")}l._vmlReady=!0}},createPalette:function(){var t={elm:null,draw:null};if(l.isCanvasSupported){var e=document.createElement("canvas"),n=e.getContext("2d"),r=function(t,r,i){e.width=t,e.height=r,n.clearRect(0,0,e.width,e.height);var o=n.createLinearGradient(0,0,e.width,0);o.addColorStop(0,"#F00"),o.addColorStop(1/6,"#FF0"),o.addColorStop(2/6,"#0F0"),o.addColorStop(.5,"#0FF"),o.addColorStop(4/6,"#00F"),o.addColorStop(5/6,"#F0F"),o.addColorStop(1,"#F00"),n.fillStyle=o,n.fillRect(0,0,e.width,e.height);var a=n.createLinearGradient(0,0,0,e.height);switch(i.toLowerCase()){case"s":a.addColorStop(0,"rgba(255,255,255,0)"),a.addColorStop(1,"rgba(255,255,255,1)");break;case"v":a.addColorStop(0,"rgba(0,0,0,0)"),a.addColorStop(1,"rgba(0,0,0,1)")}n.fillStyle=a,n.fillRect(0,0,e.width,e.height)};t.elm=e,t.draw=r}else{l.initVML();var i=document.createElement("div");i.style.position="relative",i.style.overflow="hidden";var o=document.createElement(l._vmlNS+":fill");o.type="gradient",o.method="linear",o.angle="90",o.colors="16.67% #F0F, 33.33% #00F, 50% #0FF, 66.67% #0F0, 83.33% #FF0";var a=document.createElement(l._vmlNS+":rect");a.style.position="absolute",a.style.left="-1px",a.style.top="-1px",a.stroked=!1,a.appendChild(o),i.appendChild(a);var s=document.createElement(l._vmlNS+":fill");s.type="gradient",s.method="linear",s.angle="180",s.opacity="0";var u=document.createElement(l._vmlNS+":rect");u.style.position="absolute",u.style.left="-1px",u.style.top="-1px",u.stroked=!1,u.appendChild(s),i.appendChild(u),r=function(t,e,n){switch(i.style.width=t+"px",i.style.height=e+"px",a.style.width=u.style.width=t+1+"px",a.style.height=u.style.height=e+1+"px",o.color="#F00",o.color2="#F00",n.toLowerCase()){case"s":s.color=s.color2="#FFF";break;case"v":s.color=s.color2="#000"}},t.elm=i,t.draw=r}return t},createSliderGradient:function(){var t={elm:null,draw:null};if(l.isCanvasSupported){var e=document.createElement("canvas"),n=e.getContext("2d"),r=function(t,r,i,o){e.width=t,e.height=r,n.clearRect(0,0,e.width,e.height);var a=n.createLinearGradient(0,0,0,e.height);a.addColorStop(0,i),a.addColorStop(1,o),n.fillStyle=a,n.fillRect(0,0,e.width,e.height)};t.elm=e,t.draw=r}else{l.initVML();var i=document.createElement("div");i.style.position="relative",i.style.overflow="hidden";var o=document.createElement(l._vmlNS+":fill");o.type="gradient",o.method="linear",o.angle="180";var a=document.createElement(l._vmlNS+":rect");a.style.position="absolute",a.style.left="-1px",a.style.top="-1px",a.stroked=!1,a.appendChild(o),i.appendChild(a),r=function(t,e,n,r){i.style.width=t+"px",i.style.height=e+"px",a.style.width=t+1+"px",a.style.height=e+1+"px",o.color=n,o.color2=r},t.elm=i,t.draw=r}return t},leaveValue:1,leaveStyle:2,leavePad:4,leaveSld:8,BoxShadow:(r=function(t,e,n,r,i,o){this.hShadow=t,this.vShadow=e,this.blur=n,this.spread=r,this.color=i,this.inset=!!o},r.prototype.toString=function(){var t=[Math.round(this.hShadow)+"px",Math.round(this.vShadow)+"px",Math.round(this.blur)+"px",Math.round(this.spread)+"px",this.color];return this.inset&&t.push("inset"),t.join(" ")},r),jscolor:function(t,e){for(var n in this.value=null,this.valueElement=t,this.styleElement=t,this.required=!0,this.refine=!0,this.hash=!1,this.uppercase=!0,this.onFineChange=null,this.activeClass="jscolor-active",this.minS=0,this.maxS=100,this.minV=0,this.maxV=100,this.hsv=[0,0,100],this.rgb=[255,255,255],this.width=181,this.height=101,this.showOnClick=!0,this.mode="HSV",this.position="bottom",this.smartPosition=!0,this.sliderSize=16,this.crossSize=8,this.closable=!1,this.closeText="Close",this.buttonColor="#000000",this.buttonHeight=18,this.padding=12,this.backgroundColor="#FFFFFF",this.borderWidth=1,this.borderColor="#BBBBBB",this.borderRadius=8,this.insetWidth=1,this.insetColor="#BBBBBB",this.shadow=!0,this.shadowBlur=15,this.shadowColor="rgba(0,0,0,0.2)",this.pointerColor="#4C4C4C",this.pointerBorderColor="#FFFFFF",this.pointerBorderWidth=1,this.pointerThickness=2,this.zIndex=1e4,this.container=null,e)e.hasOwnProperty(n)&&(this[n]=e[n]);function r(t,e,n){var r=n/100*255;if(null===t)return[r,r,r];t/=60,e/=100;var i=Math.floor(t),o=r*(1-e),a=r*(1-e*(i%2?t-i:1-(t-i)));switch(i){case 6:case 0:return[r,a,o];case 1:return[a,r,o];case 2:return[o,r,a];case 3:return[o,a,r];case 4:return[a,o,r];case 5:return[r,o,a]}}function i(){h._processParentElementsInDOM(),l.picker||(l.picker={owner:null,wrap:document.createElement("div"),box:document.createElement("div"),boxS:document.createElement("div"),boxB:document.createElement("div"),pad:document.createElement("div"),padB:document.createElement("div"),padM:document.createElement("div"),padPal:l.createPalette(),cross:document.createElement("div"),crossBY:document.createElement("div"),crossBX:document.createElement("div"),crossLY:document.createElement("div"),crossLX:document.createElement("div"),sld:document.createElement("div"),sldB:document.createElement("div"),sldM:document.createElement("div"),sldGrad:l.createSliderGradient(),sldPtrS:document.createElement("div"),sldPtrIB:document.createElement("div"),sldPtrMB:document.createElement("div"),sldPtrOB:document.createElement("div"),btn:document.createElement("div"),btnT:document.createElement("span")},l.picker.pad.appendChild(l.picker.padPal.elm),l.picker.padB.appendChild(l.picker.pad),l.picker.cross.appendChild(l.picker.crossBY),l.picker.cross.appendChild(l.picker.crossBX),l.picker.cross.appendChild(l.picker.crossLY),l.picker.cross.appendChild(l.picker.crossLX),l.picker.padB.appendChild(l.picker.cross),l.picker.box.appendChild(l.picker.padB),l.picker.box.appendChild(l.picker.padM),l.picker.sld.appendChild(l.picker.sldGrad.elm),l.picker.sldB.appendChild(l.picker.sld),l.picker.sldB.appendChild(l.picker.sldPtrOB),l.picker.sldPtrOB.appendChild(l.picker.sldPtrMB),l.picker.sldPtrMB.appendChild(l.picker.sldPtrIB),l.picker.sldPtrIB.appendChild(l.picker.sldPtrS),l.picker.box.appendChild(l.picker.sldB),l.picker.box.appendChild(l.picker.sldM),l.picker.btn.appendChild(l.picker.btnT),l.picker.box.appendChild(l.picker.btn),l.picker.boxB.appendChild(l.picker.box),l.picker.wrap.appendChild(l.picker.boxS),l.picker.wrap.appendChild(l.picker.boxB));var t,e,n=l.picker,r=!!l.getSliderComponent(h),i=l.getPickerDims(h),s=2*h.pointerBorderWidth+h.pointerThickness+2*h.crossSize,u=l.getPadToSliderPadding(h),c=Math.min(h.borderRadius,Math.round(h.padding*Math.PI));n.wrap.style.clear="both",n.wrap.style.width=i[0]+2*h.borderWidth+"px",n.wrap.style.height=i[1]+2*h.borderWidth+"px",n.wrap.style.zIndex=h.zIndex,n.box.style.width=i[0]+"px",n.box.style.height=i[1]+"px",n.boxS.style.position="absolute",n.boxS.style.left="0",n.boxS.style.top="0",n.boxS.style.width="100%",n.boxS.style.height="100%",l.setBorderRadius(n.boxS,c+"px"),n.boxB.style.position="relative",n.boxB.style.border=h.borderWidth+"px solid",n.boxB.style.borderColor=h.borderColor,n.boxB.style.background=h.backgroundColor,l.setBorderRadius(n.boxB,c+"px"),n.padM.style.background=n.sldM.style.background="#FFF",l.setStyle(n.padM,"opacity","0"),l.setStyle(n.sldM,"opacity","0"),n.pad.style.position="relative",n.pad.style.width=h.width+"px",n.pad.style.height=h.height+"px",n.padPal.draw(h.width,h.height,l.getPadYComponent(h)),n.padB.style.position="absolute",n.padB.style.left=h.padding+"px",n.padB.style.top=h.padding+"px",n.padB.style.border=h.insetWidth+"px solid",n.padB.style.borderColor=h.insetColor,n.padM._jscInstance=h,n.padM._jscControlName="pad",n.padM.style.position="absolute",n.padM.style.left="0",n.padM.style.top="0",n.padM.style.width=h.padding+2*h.insetWidth+h.width+u/2+"px",n.padM.style.height=i[1]+"px",n.padM.style.cursor="crosshair",n.cross.style.position="absolute",n.cross.style.left=n.cross.style.top="0",n.cross.style.width=n.cross.style.height=s+"px",n.crossBY.style.position=n.crossBX.style.position="absolute",n.crossBY.style.background=n.crossBX.style.background=h.pointerBorderColor,n.crossBY.style.width=n.crossBX.style.height=2*h.pointerBorderWidth+h.pointerThickness+"px",n.crossBY.style.height=n.crossBX.style.width=s+"px",n.crossBY.style.left=n.crossBX.style.top=Math.floor(s/2)-Math.floor(h.pointerThickness/2)-h.pointerBorderWidth+"px",n.crossBY.style.top=n.crossBX.style.left="0",n.crossLY.style.position=n.crossLX.style.position="absolute",n.crossLY.style.background=n.crossLX.style.background=h.pointerColor,n.crossLY.style.height=n.crossLX.style.width=s-2*h.pointerBorderWidth+"px",n.crossLY.style.width=n.crossLX.style.height=h.pointerThickness+"px",n.crossLY.style.left=n.crossLX.style.top=Math.floor(s/2)-Math.floor(h.pointerThickness/2)+"px",n.crossLY.style.top=n.crossLX.style.left=h.pointerBorderWidth+"px",n.sld.style.overflow="hidden",n.sld.style.width=h.sliderSize+"px",n.sld.style.height=h.height+"px",n.sldGrad.draw(h.sliderSize,h.height,"#000","#000"),n.sldB.style.display=r?"block":"none",n.sldB.style.position="absolute",n.sldB.style.right=h.padding+"px",n.sldB.style.top=h.padding+"px",n.sldB.style.border=h.insetWidth+"px solid",n.sldB.style.borderColor=h.insetColor,n.sldM._jscInstance=h,n.sldM._jscControlName="sld",n.sldM.style.display=r?"block":"none",n.sldM.style.position="absolute",n.sldM.style.right="0",n.sldM.style.top="0",n.sldM.style.width=h.sliderSize+u/2+h.padding+2*h.insetWidth+"px",n.sldM.style.height=i[1]+"px",n.sldM.style.cursor="default",n.sldPtrIB.style.border=n.sldPtrOB.style.border=h.pointerBorderWidth+"px solid "+h.pointerBorderColor,n.sldPtrOB.style.position="absolute",n.sldPtrOB.style.left=-(2*h.pointerBorderWidth+h.pointerThickness)+"px",n.sldPtrOB.style.top="0",n.sldPtrMB.style.border=h.pointerThickness+"px solid "+h.pointerColor,n.sldPtrS.style.width=h.sliderSize+"px",n.sldPtrS.style.height=d+"px",n.btn.style.display=h.closable?"block":"none",n.btn.style.position="absolute",n.btn.style.left=h.padding+"px",n.btn.style.bottom=h.padding+"px",n.btn.style.padding="0 15px",n.btn.style.height=h.buttonHeight+"px",n.btn.style.border=h.insetWidth+"px solid",t=h.insetColor.split(/\s+/),e=t.length<2?t[0]:t[1]+" "+t[0]+" "+t[0]+" "+t[1],n.btn.style.borderColor=e,n.btn.style.color=h.buttonColor,n.btn.style.font="12px sans-serif",n.btn.style.textAlign="center";try{n.btn.style.cursor="pointer"}catch(t){n.btn.style.cursor="hand"}n.btn.onmousedown=function(){h.hide()},n.btnT.style.lineHeight=h.buttonHeight+"px",n.btnT.innerHTML="",n.btnT.appendChild(document.createTextNode(h.closeText)),o(),a(),l.picker.owner&&l.picker.owner!==h&&l.unsetClass(l.picker.owner.targetElement,h.activeClass),l.picker.owner=h,l.isElementType(p,"body")?l.redrawPosition():l._drawPosition(h,0,0,"relative",!1),n.wrap.parentNode!=p&&p.appendChild(n.wrap),l.setClass(h.targetElement,h.activeClass)}function o(){switch(l.getPadYComponent(h)){case"s":var t=1;break;case"v":t=2}var e=Math.round(h.hsv[0]/360*(h.width-1)),n=Math.round((1-h.hsv[t]/100)*(h.height-1)),i=2*h.pointerBorderWidth+h.pointerThickness+2*h.crossSize,o=-Math.floor(i/2);switch(l.picker.cross.style.left=e+o+"px",l.picker.cross.style.top=n+o+"px",l.getSliderComponent(h)){case"s":var a=r(h.hsv[0],100,h.hsv[2]),s=r(h.hsv[0],0,h.hsv[2]),u="rgb("+Math.round(a[0])+","+Math.round(a[1])+","+Math.round(a[2])+")",c="rgb("+Math.round(s[0])+","+Math.round(s[1])+","+Math.round(s[2])+")";l.picker.sldGrad.draw(h.sliderSize,h.height,u,c);break;case"v":var p=r(h.hsv[0],h.hsv[1],100);u="rgb("+Math.round(p[0])+","+Math.round(p[1])+","+Math.round(p[2])+")",c="#000",l.picker.sldGrad.draw(h.sliderSize,h.height,u,c)}}function a(){var t=l.getSliderComponent(h);if(t){switch(t){case"s":var e=1;break;case"v":e=2}var n=Math.round((1-h.hsv[e]/100)*(h.height-1));l.picker.sldPtrOB.style.top=n-(2*h.pointerBorderWidth+h.pointerThickness)-Math.floor(d/2)+"px"}}function s(){return l.picker&&l.picker.owner===h}if(this.hide=function(){s()&&(l.unsetClass(h.targetElement,h.activeClass),l.picker.wrap.parentNode.removeChild(l.picker.wrap),delete l.picker.owner)},this.show=function(){i()},this.redraw=function(){s()&&i()},this.importColor=function(){this.valueElement&&l.isElementType(this.valueElement,"input")?this.refine?!this.required&&/^\s*$/.test(this.valueElement.value)?(this.valueElement.value="",this.styleElement&&(this.styleElement.style.backgroundImage=this.styleElement._jscOrigStyle.backgroundImage,this.styleElement.style.backgroundColor=this.styleElement._jscOrigStyle.backgroundColor,this.styleElement.style.color=this.styleElement._jscOrigStyle.color),this.exportColor(l.leaveValue|l.leaveStyle)):this.fromString(this.valueElement.value)||this.exportColor():this.fromString(this.valueElement.value,l.leaveValue)||(this.styleElement&&(this.styleElement.style.backgroundImage=this.styleElement._jscOrigStyle.backgroundImage,this.styleElement.style.backgroundColor=this.styleElement._jscOrigStyle.backgroundColor,this.styleElement.style.color=this.styleElement._jscOrigStyle.color),this.exportColor(l.leaveValue|l.leaveStyle)):this.exportColor()},this.exportColor=function(t){if(!(t&l.leaveValue)&&this.valueElement){var e=this.toString();this.uppercase&&(e=e.toUpperCase()),this.hash&&(e="#"+e),l.isElementType(this.valueElement,"input")?this.valueElement.value=e:this.valueElement.innerHTML=e}t&l.leaveStyle||this.styleElement&&(this.styleElement.style.backgroundImage="none",this.styleElement.style.backgroundColor="#"+this.toString(),this.styleElement.style.color=this.isLight()?"#000":"#FFF"),t&l.leavePad||!s()||o(),t&l.leaveSld||!s()||a()},this.fromHSV=function(t,e,n,i){if(null!==t){if(isNaN(t))return!1;t=Math.max(0,Math.min(360,t))}if(null!==e){if(isNaN(e))return!1;e=Math.max(0,Math.min(100,this.maxS,e),this.minS)}if(null!==n){if(isNaN(n))return!1;n=Math.max(0,Math.min(100,this.maxV,n),this.minV)}this.rgb=r(null===t?this.hsv[0]:this.hsv[0]=t,null===e?this.hsv[1]:this.hsv[1]=e,null===n?this.hsv[2]:this.hsv[2]=n),this.exportColor(i)},this.fromRGB=function(t,e,n,i){if(null!==t){if(isNaN(t))return!1;t=Math.max(0,Math.min(255,t))}if(null!==e){if(isNaN(e))return!1;e=Math.max(0,Math.min(255,e))}if(null!==n){if(isNaN(n))return!1;n=Math.max(0,Math.min(255,n))}var o=function(t,e,n){t/=255,e/=255,n/=255;var r=Math.min(Math.min(t,e),n),i=Math.max(Math.max(t,e),n),o=i-r;if(0===o)return[null,0,100*i];var a=t===r?3+(n-e)/o:e===r?5+(t-n)/o:1+(e-t)/o;return[60*(6===a?0:a),o/i*100,100*i]}(null===t?this.rgb[0]:t,null===e?this.rgb[1]:e,null===n?this.rgb[2]:n);null!==o[0]&&(this.hsv[0]=Math.max(0,Math.min(360,o[0]))),0!==o[2]&&(this.hsv[1]=null===o[1]?null:Math.max(0,this.minS,Math.min(100,this.maxS,o[1]))),this.hsv[2]=null===o[2]?null:Math.max(0,this.minV,Math.min(100,this.maxV,o[2]));var a=r(this.hsv[0],this.hsv[1],this.hsv[2]);this.rgb[0]=a[0],this.rgb[1]=a[1],this.rgb[2]=a[2],this.exportColor(i)},this.fromString=function(t,e){var n;if(n=t.match(/^\W*([0-9A-F]{3}([0-9A-F]{3})?)\W*$/i))return 6===n[1].length?this.fromRGB(parseInt(n[1].substr(0,2),16),parseInt(n[1].substr(2,2),16),parseInt(n[1].substr(4,2),16),e):this.fromRGB(parseInt(n[1].charAt(0)+n[1].charAt(0),16),parseInt(n[1].charAt(1)+n[1].charAt(1),16),parseInt(n[1].charAt(2)+n[1].charAt(2),16),e),!0;if(n=t.match(/^\W*rgba?\(([^)]*)\)\W*$/i)){var r,i,o,a=n[1].split(","),s=/^\s*(\d*)(\.\d+)?\s*$/;if(a.length>=3&&(r=a[0].match(s))&&(i=a[1].match(s))&&(o=a[2].match(s))){var l=parseFloat((r[1]||"0")+(r[2]||"")),u=parseFloat((i[1]||"0")+(i[2]||"")),c=parseFloat((o[1]||"0")+(o[2]||""));return this.fromRGB(l,u,c,e),!0}}return!1},this.toString=function(){return(256|Math.round(this.rgb[0])).toString(16).substr(1)+(256|Math.round(this.rgb[1])).toString(16).substr(1)+(256|Math.round(this.rgb[2])).toString(16).substr(1)},this.toHEXString=function(){return"#"+this.toString().toUpperCase()},this.toRGBString=function(){return"rgb("+Math.round(this.rgb[0])+","+Math.round(this.rgb[1])+","+Math.round(this.rgb[2])+")"},this.isLight=function(){return.213*this.rgb[0]+.715*this.rgb[1]+.072*this.rgb[2]>127.5},this._processParentElementsInDOM=function(){if(!this._linkedElementsProcessed){this._linkedElementsProcessed=!0;var t=this.targetElement;do{var e=l.getStyle(t);e&&"fixed"===e.position.toLowerCase()&&(this.fixed=!0),t!==this.targetElement&&(t._jscEventsAttached||(l.attachEvent(t,"scroll",l.onParentScroll),t._jscEventsAttached=!0))}while((t=t.parentNode)&&!l.isElementType(t,"body"))}},"string"==typeof t){var u=t,c=document.getElementById(u);c?this.targetElement=c:l.warn("Could not find target element with ID '"+u+"'")}else t?this.targetElement=t:l.warn("Invalid target element: '"+t+"'");if(this.targetElement._jscLinkedInstance)l.warn("Cannot link jscolor twice to the same element. Skipping.");else{this.targetElement._jscLinkedInstance=this,this.valueElement=l.fetchElement(this.valueElement),this.styleElement=l.fetchElement(this.styleElement);var h=this,p=this.container?l.fetchElement(this.container):document.getElementsByTagName("body")[0],d=3;if(l.isElementType(this.targetElement,"button"))if(this.targetElement.onclick){var f=this.targetElement.onclick;this.targetElement.onclick=function(t){return f.call(this,t),!1}}else this.targetElement.onclick=function(){return!1};if(this.valueElement&&l.isElementType(this.valueElement,"input")){var g=function(){h.fromString(h.valueElement.value,l.leaveValue),l.dispatchFineChange(h)};l.attachEvent(this.valueElement,"keyup",g),l.attachEvent(this.valueElement,"input",g),l.attachEvent(this.valueElement,"blur",(function(){h.importColor()})),this.valueElement.setAttribute("autocomplete","off")}this.styleElement&&(this.styleElement._jscOrigStyle={backgroundImage:this.styleElement.style.backgroundImage,backgroundColor:this.styleElement.style.backgroundColor,color:this.styleElement.style.color}),this.value?this.fromString(this.value)||this.exportColor():this.importColor()}}}).jscolor.lookupClass="jscolor",l.jscolor.installByClassName=function(t){var e=document.getElementsByTagName("input"),n=document.getElementsByTagName("button");l.tryInstallOnElements(e,t),l.tryInstallOnElements(n,t)},l.register(),l.jscolor))},function(t,e,n){var r=n(225);t.exports=function(t){if(Array.isArray(t))return r(t)}},function(t,e){t.exports=function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}},function(t,e,n){var r=n(225);t.exports=function(t,e){if(t){if("string"==typeof t)return r(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(t,e):void 0}}},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},function(t,e,n){var r=function(t){"use strict";var e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},i=r.iterator||"@@iterator",o=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function s(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var i=e&&e.prototype instanceof h?e:h,o=Object.create(i.prototype),a=new E(r||[]);return o._invoke=function(t,e,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return O()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=b(a,n);if(s){if(s===c)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=u(t,e,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===c)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}(t,n,a),o}function u(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var c={};function h(){}function p(){}function d(){}var f={};f[i]=function(){return this};var g=Object.getPrototypeOf,y=g&&g(g(S([])));y&&y!==e&&n.call(y,i)&&(f=y);var m=d.prototype=h.prototype=Object.create(f);function v(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function _(t,e){var r;this._invoke=function(i,o){function a(){return new e((function(r,a){!function r(i,o,a,s){var l=u(t[i],t,o);if("throw"!==l.type){var c=l.arg,h=c.value;return h&&"object"==typeof h&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){r("next",t,a,s)}),(function(t){r("throw",t,a,s)})):e.resolve(h).then((function(t){c.value=t,a(c)}),(function(t){return r("throw",t,a,s)}))}s(l.arg)}(i,o,r,a)}))}return r=r?r.then(a,a):a()}}function b(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,b(t,e),"throw"===e.method))return c;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return c}var r=u(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,c;var i=r.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,c):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,c)}function w(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(w,this),this.reset(!0)}function S(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:O}}function O(){return{value:void 0,done:!0}}return p.prototype=m.constructor=d,d.constructor=p,p.displayName=s(d,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,s(t,a,"GeneratorFunction")),t.prototype=Object.create(m),t},t.awrap=function(t){return{__await:t}},v(_.prototype),_.prototype[o]=function(){return this},t.AsyncIterator=_,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var a=new _(l(e,n,r,i),o);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},v(m),s(m,a,"Generator"),m[i]=function(){return this},m.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=S,E.prototype={constructor:E,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),l=n.call(o,"finallyLoc");if(s&&l){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,c):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),c},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),x(n),c}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;x(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:S(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),c}},t}(t.exports);try{regeneratorRuntime=r}catch(t){Function("r","regeneratorRuntime = r")(r)}},function(t,e,n){"use strict";(function(t){
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <http://feross.org>
* @license MIT
*/
var r=n(250),i=n(226),o=n(251);function a(){return l.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(t,e){if(a()<e)throw new RangeError("Invalid typed array length");return l.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=l.prototype:(null===t&&(t=new l(e)),t.length=e),t}function l(t,e,n){if(!(l.TYPED_ARRAY_SUPPORT||this instanceof l))return new l(t,e,n);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return h(this,t)}return u(this,t,e,n)}function u(t,e,n,r){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,n,r){if(e.byteLength,n<0||e.byteLength<n)throw new RangeError("'offset' is out of bounds");if(e.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");e=void 0===n&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,n):new Uint8Array(e,n,r);l.TYPED_ARRAY_SUPPORT?(t=e).__proto__=l.prototype:t=p(t,e);return t}(t,e,n,r):"string"==typeof e?function(t,e,n){"string"==typeof n&&""!==n||(n="utf8");if(!l.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|f(e,n),i=(t=s(t,r)).write(e,n);i!==r&&(t=t.slice(0,i));return t}(t,e,n):function(t,e){if(l.isBuffer(e)){var n=0|d(e.length);return 0===(t=s(t,n)).length||e.copy(t,0,0,n),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(r=e.length)!=r?s(t,0):p(t,e);if("Buffer"===e.type&&o(e.data))return p(t,e.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function c(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function h(t,e){if(c(e),t=s(t,e<0?0:0|d(e)),!l.TYPED_ARRAY_SUPPORT)for(var n=0;n<e;++n)t[n]=0;return t}function p(t,e){var n=e.length<0?0:0|d(e.length);t=s(t,n);for(var r=0;r<n;r+=1)t[r]=255&e[r];return t}function d(t){if(t>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|t}function f(t,e){if(l.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return z(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return U(t).length;default:if(r)return z(t).length;e=(""+e).toLowerCase(),r=!0}}function g(t,e,n){var r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return L(this,e,n);case"utf8":case"utf-8":return C(this,e,n);case"ascii":return T(this,e,n);case"latin1":case"binary":return I(this,e,n);case"base64":return O(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function y(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function m(t,e,n,r,i){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(i)return-1;n=t.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof e&&(e=l.from(e,r)),l.isBuffer(e))return 0===e.length?-1:v(t,e,n,r,i);if("number"==typeof e)return e&=255,l.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):v(t,[e],n,r,i);throw new TypeError("val must be string, number or Buffer")}function v(t,e,n,r,i){var o,a=1,s=t.length,l=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;a=2,s/=2,l/=2,n/=2}function u(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(i){var c=-1;for(o=n;o<s;o++)if(u(t,o)===u(e,-1===c?0:o-c)){if(-1===c&&(c=o),o-c+1===l)return c*a}else-1!==c&&(o-=o-c),c=-1}else for(n+l>s&&(n=s-l),o=n;o>=0;o--){for(var h=!0,p=0;p<l;p++)if(u(t,o+p)!==u(e,p)){h=!1;break}if(h)return o}return-1}function _(t,e,n,r){n=Number(n)||0;var i=t.length-n;r?(r=Number(r))>i&&(r=i):r=i;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var a=0;a<r;++a){var s=parseInt(e.substr(2*a,2),16);if(isNaN(s))return a;t[n+a]=s}return a}function b(t,e,n,r){return B(z(e,t.length-n),t,n,r)}function w(t,e,n,r){return B(function(t){for(var e=[],n=0;n<t.length;++n)e.push(255&t.charCodeAt(n));return e}(e),t,n,r)}function x(t,e,n,r){return w(t,e,n,r)}function E(t,e,n,r){return B(U(e),t,n,r)}function S(t,e,n,r){return B(function(t,e){for(var n,r,i,o=[],a=0;a<t.length&&!((e-=2)<0);++a)n=t.charCodeAt(a),r=n>>8,i=n%256,o.push(i),o.push(r);return o}(e,t.length-n),t,n,r)}function O(t,e,n){return 0===e&&n===t.length?r.fromByteArray(t):r.fromByteArray(t.slice(e,n))}function C(t,e,n){n=Math.min(t.length,n);for(var r=[],i=e;i<n;){var o,a,s,l,u=t[i],c=null,h=u>239?4:u>223?3:u>191?2:1;if(i+h<=n)switch(h){case 1:u<128&&(c=u);break;case 2:128==(192&(o=t[i+1]))&&(l=(31&u)<<6|63&o)>127&&(c=l);break;case 3:o=t[i+1],a=t[i+2],128==(192&o)&&128==(192&a)&&(l=(15&u)<<12|(63&o)<<6|63&a)>2047&&(l<55296||l>57343)&&(c=l);break;case 4:o=t[i+1],a=t[i+2],s=t[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(l=(15&u)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&l<1114112&&(c=l)}null===c?(c=65533,h=1):c>65535&&(c-=65536,r.push(c>>>10&1023|55296),c=56320|1023&c),r.push(c),i+=h}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);var n="",r=0;for(;r<e;)n+=String.fromCharCode.apply(String,t.slice(r,r+=4096));return n}(r)}e.Buffer=l,e.SlowBuffer=function(t){+t!=t&&(t=0);return l.alloc(+t)},e.INSPECT_MAX_BYTES=50,l.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=a(),l.poolSize=8192,l._augment=function(t){return t.__proto__=l.prototype,t},l.from=function(t,e,n){return u(null,t,e,n)},l.TYPED_ARRAY_SUPPORT&&(l.prototype.__proto__=Uint8Array.prototype,l.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&l[Symbol.species]===l&&Object.defineProperty(l,Symbol.species,{value:null,configurable:!0})),l.alloc=function(t,e,n){return function(t,e,n,r){return c(e),e<=0?s(t,e):void 0!==n?"string"==typeof r?s(t,e).fill(n,r):s(t,e).fill(n):s(t,e)}(null,t,e,n)},l.allocUnsafe=function(t){return h(null,t)},l.allocUnsafeSlow=function(t){return h(null,t)},l.isBuffer=function(t){return!(null==t||!t._isBuffer)},l.compare=function(t,e){if(!l.isBuffer(t)||!l.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var n=t.length,r=e.length,i=0,o=Math.min(n,r);i<o;++i)if(t[i]!==e[i]){n=t[i],r=e[i];break}return n<r?-1:r<n?1:0},l.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},l.concat=function(t,e){if(!o(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return l.alloc(0);var n;if(void 0===e)for(e=0,n=0;n<t.length;++n)e+=t[n].length;var r=l.allocUnsafe(e),i=0;for(n=0;n<t.length;++n){var a=t[n];if(!l.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(r,i),i+=a.length}return r},l.byteLength=f,l.prototype._isBuffer=!0,l.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)y(this,e,e+1);return this},l.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)y(this,e,e+3),y(this,e+1,e+2);return this},l.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)y(this,e,e+7),y(this,e+1,e+6),y(this,e+2,e+5),y(this,e+3,e+4);return this},l.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?C(this,0,t):g.apply(this,arguments)},l.prototype.equals=function(t){if(!l.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===l.compare(this,t)},l.prototype.inspect=function(){var t="",n=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(t+=" ... ")),"<Buffer "+t+">"},l.prototype.compare=function(t,e,n,r,i){if(!l.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),e<0||n>t.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&e>=n)return 0;if(r>=i)return-1;if(e>=n)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(r>>>=0),a=(n>>>=0)-(e>>>=0),s=Math.min(o,a),u=this.slice(r,i),c=t.slice(e,n),h=0;h<s;++h)if(u[h]!==c[h]){o=u[h],a=c[h];break}return o<a?-1:a<o?1:0},l.prototype.includes=function(t,e,n){return-1!==this.indexOf(t,e,n)},l.prototype.indexOf=function(t,e,n){return m(this,t,e,n,!0)},l.prototype.lastIndexOf=function(t,e,n){return m(this,t,e,n,!1)},l.prototype.write=function(t,e,n,r){if(void 0===e)r="utf8",n=this.length,e=0;else if(void 0===n&&"string"==typeof e)r=e,n=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-e;if((void 0===n||n>i)&&(n=i),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return _(this,t,e,n);case"utf8":case"utf-8":return b(this,t,e,n);case"ascii":return w(this,t,e,n);case"latin1":case"binary":return x(this,t,e,n);case"base64":return E(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,t,e,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function T(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(127&t[i]);return r}function I(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(t[i]);return r}function L(t,e,n){var r=t.length;(!e||e<0)&&(e=0),(!n||n<0||n>r)&&(n=r);for(var i="",o=e;o<n;++o)i+=G(t[o]);return i}function P(t,e,n){for(var r=t.slice(e,n),i="",o=0;o<r.length;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}function R(t,e,n){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length")}function M(t,e,n,r,i,o){if(!l.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(n+r>t.length)throw new RangeError("Index out of range")}function N(t,e,n,r){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-n,2);i<o;++i)t[n+i]=(e&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function j(t,e,n,r){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-n,4);i<o;++i)t[n+i]=e>>>8*(r?i:3-i)&255}function A(t,e,n,r,i,o){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function k(t,e,n,r,o){return o||A(t,0,n,4),i.write(t,e,n,r,23,4),n+4}function F(t,e,n,r,o){return o||A(t,0,n,8),i.write(t,e,n,r,52,8),n+8}l.prototype.slice=function(t,e){var n,r=this.length;if((t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t),l.TYPED_ARRAY_SUPPORT)(n=this.subarray(t,e)).__proto__=l.prototype;else{var i=e-t;n=new l(i,void 0);for(var o=0;o<i;++o)n[o]=this[o+t]}return n},l.prototype.readUIntLE=function(t,e,n){t|=0,e|=0,n||R(t,e,this.length);for(var r=this[t],i=1,o=0;++o<e&&(i*=256);)r+=this[t+o]*i;return r},l.prototype.readUIntBE=function(t,e,n){t|=0,e|=0,n||R(t,e,this.length);for(var r=this[t+--e],i=1;e>0&&(i*=256);)r+=this[t+--e]*i;return r},l.prototype.readUInt8=function(t,e){return e||R(t,1,this.length),this[t]},l.prototype.readUInt16LE=function(t,e){return e||R(t,2,this.length),this[t]|this[t+1]<<8},l.prototype.readUInt16BE=function(t,e){return e||R(t,2,this.length),this[t]<<8|this[t+1]},l.prototype.readUInt32LE=function(t,e){return e||R(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},l.prototype.readUInt32BE=function(t,e){return e||R(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},l.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||R(t,e,this.length);for(var r=this[t],i=1,o=0;++o<e&&(i*=256);)r+=this[t+o]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*e)),r},l.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||R(t,e,this.length);for(var r=e,i=1,o=this[t+--r];r>0&&(i*=256);)o+=this[t+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},l.prototype.readInt8=function(t,e){return e||R(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},l.prototype.readInt16LE=function(t,e){e||R(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt16BE=function(t,e){e||R(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt32LE=function(t,e){return e||R(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},l.prototype.readInt32BE=function(t,e){return e||R(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},l.prototype.readFloatLE=function(t,e){return e||R(t,4,this.length),i.read(this,t,!0,23,4)},l.prototype.readFloatBE=function(t,e){return e||R(t,4,this.length),i.read(this,t,!1,23,4)},l.prototype.readDoubleLE=function(t,e){return e||R(t,8,this.length),i.read(this,t,!0,52,8)},l.prototype.readDoubleBE=function(t,e){return e||R(t,8,this.length),i.read(this,t,!1,52,8)},l.prototype.writeUIntLE=function(t,e,n,r){(t=+t,e|=0,n|=0,r)||M(this,t,e,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[e]=255&t;++o<n&&(i*=256);)this[e+o]=t/i&255;return e+n},l.prototype.writeUIntBE=function(t,e,n,r){(t=+t,e|=0,n|=0,r)||M(this,t,e,n,Math.pow(2,8*n)-1,0);var i=n-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+n},l.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||M(this,t,e,1,255,0),l.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},l.prototype.writeUInt16LE=function(t,e,n){return t=+t,e|=0,n||M(this,t,e,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):N(this,t,e,!0),e+2},l.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||M(this,t,e,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):N(this,t,e,!1),e+2},l.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||M(this,t,e,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):j(this,t,e,!0),e+4},l.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||M(this,t,e,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):j(this,t,e,!1),e+4},l.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);M(this,t,e,n,i-1,-i)}var o=0,a=1,s=0;for(this[e]=255&t;++o<n&&(a*=256);)t<0&&0===s&&0!==this[e+o-1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+n},l.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);M(this,t,e,n,i-1,-i)}var o=n-1,a=1,s=0;for(this[e+o]=255&t;--o>=0&&(a*=256);)t<0&&0===s&&0!==this[e+o+1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+n},l.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||M(this,t,e,1,127,-128),l.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},l.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||M(this,t,e,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):N(this,t,e,!0),e+2},l.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||M(this,t,e,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):N(this,t,e,!1),e+2},l.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||M(this,t,e,4,2147483647,-2147483648),l.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):j(this,t,e,!0),e+4},l.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||M(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):j(this,t,e,!1),e+4},l.prototype.writeFloatLE=function(t,e,n){return k(this,t,e,!0,n)},l.prototype.writeFloatBE=function(t,e,n){return k(this,t,e,!1,n)},l.prototype.writeDoubleLE=function(t,e,n){return F(this,t,e,!0,n)},l.prototype.writeDoubleBE=function(t,e,n){return F(this,t,e,!1,n)},l.prototype.copy=function(t,e,n,r){if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e<r-n&&(r=t.length-e+n);var i,o=r-n;if(this===t&&n<e&&e<r)for(i=o-1;i>=0;--i)t[i+e]=this[i+n];else if(o<1e3||!l.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)t[i+e]=this[i+n];else Uint8Array.prototype.set.call(t,this.subarray(n,n+o),e);return o},l.prototype.fill=function(t,e,n,r){if("string"==typeof t){if("string"==typeof e?(r=e,e=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!l.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;var o;if(e>>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(o=e;o<n;++o)this[o]=t;else{var a=l.isBuffer(t)?t:z(new l(t,r).toString()),s=a.length;for(o=0;o<n-e;++o)this[o+e]=a[o%s]}return this};var D=/[^+\/0-9A-Za-z-_]/g;function G(t){return t<16?"0"+t.toString(16):t.toString(16)}function z(t,e){var n;e=e||1/0;for(var r=t.length,i=null,o=[],a=0;a<r;++a){if((n=t.charCodeAt(a))>55295&&n<57344){if(!i){if(n>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(e-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(e-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((e-=1)<0)break;o.push(n)}else if(n<2048){if((e-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function U(t){return r.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(D,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function B(t,e,n,r){for(var i=0;i<r&&!(i+n>=e.length||i>=t.length);++i)e[i+n]=t[i];return i}}).call(this,n(216))},function(t,e,n){"use strict";e.byteLength=function(t){var e=u(t),n=e[0],r=e[1];return 3*(n+r)/4-r},e.toByteArray=function(t){var e,n,r=u(t),a=r[0],s=r[1],l=new o(function(t,e,n){return 3*(e+n)/4-n}(0,a,s)),c=0,h=s>0?a-4:a;for(n=0;n<h;n+=4)e=i[t.charCodeAt(n)]<<18|i[t.charCodeAt(n+1)]<<12|i[t.charCodeAt(n+2)]<<6|i[t.charCodeAt(n+3)],l[c++]=e>>16&255,l[c++]=e>>8&255,l[c++]=255&e;2===s&&(e=i[t.charCodeAt(n)]<<2|i[t.charCodeAt(n+1)]>>4,l[c++]=255&e);1===s&&(e=i[t.charCodeAt(n)]<<10|i[t.charCodeAt(n+1)]<<4|i[t.charCodeAt(n+2)]>>2,l[c++]=e>>8&255,l[c++]=255&e);return l},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,o=[],a=0,s=n-i;a<s;a+=16383)o.push(c(t,a,a+16383>s?s:a+16383));1===i?(e=t[n-1],o.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],o.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"="));return o.join("")};for(var r=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,l=a.length;s<l;++s)r[s]=a[s],i[a.charCodeAt(s)]=s;function u(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");return-1===n&&(n=e),[n,n===e?0:4-n%4]}function c(t,e,n){for(var i,o,a=[],s=e;s<n;s+=3)i=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(255&t[s+2]),a.push(r[(o=i)>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return a.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(t,e){var n={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},function(t,e){function n(e,r){return t.exports=n=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},n(e,r)}t.exports=n},function(t,e,n){},function(t,e,n){var r,i,o;
/*! jQuery UI - v1.12.1 - 2018-05-20
* http://jqueryui.com
* Includes: widget.js, position.js, keycode.js, scroll-parent.js, unique-id.js
* Copyright jQuery Foundation and other contributors; Licensed MIT */i=[n(12)],void 0===(o="function"==typeof(r=function(t){t.ui=t.ui||{},t.ui.version="1.12.1";var e,n,r=0,i=Array.prototype.slice;
/*!
* jQuery UI Widget 1.12.1
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*/t.cleanData=t.cleanData||(e=t.cleanData,function(n){var r,i,o;for(o=0;null!=(i=n[o]);o++)try{(r=t._data(i,"events"))&&r.remove&&t(i).triggerHandler("remove")}catch(t){}e(n)}),t.widget=t.widget||function(e,n,r){var i,o,a,s={},l=e.split(".")[0],u=l+"-"+(e=e.split(".")[1]);return r||(r=n,n=t.Widget),t.isArray(r)&&(r=t.extend.apply(null,[{}].concat(r))),t.expr[":"][u.toLowerCase()]=function(e){return!!t.data(e,u)},t[l]=t[l]||{},i=t[l][e],o=t[l][e]=function(t,e){if(!this._createWidget)return new o(t,e);arguments.length&&this._createWidget(t,e)},t.extend(o,i,{version:r.version,_proto:t.extend({},r),_childConstructors:[]}),(a=new n).options=t.widget.extend({},a.options),t.each(r,(function(e,r){t.isFunction(r)?s[e]=function(){function t(){return n.prototype[e].apply(this,arguments)}function i(t){return n.prototype[e].apply(this,t)}return function(){var e,n=this._super,o=this._superApply;return this._super=t,this._superApply=i,e=r.apply(this,arguments),this._super=n,this._superApply=o,e}}():s[e]=r})),o.prototype=t.widget.extend(a,{widgetEventPrefix:i&&a.widgetEventPrefix||e},s,{constructor:o,namespace:l,widgetName:e,widgetFullName:u}),i?(t.each(i._childConstructors,(function(e,n){var r=n.prototype;t.widget(r.namespace+"."+r.widgetName,o,n._proto)})),delete i._childConstructors):n._childConstructors.push(o),t.widget.bridge(e,o),o},t.widget.extend=function(e){for(var n,r,o=i.call(arguments,1),a=0,s=o.length;a<s;a++)for(n in o[a])r=o[a][n],o[a].hasOwnProperty(n)&&void 0!==r&&(t.isPlainObject(r)?e[n]=t.isPlainObject(e[n])?t.widget.extend({},e[n],r):t.widget.extend({},r):e[n]=r);return e},t.widget.bridge=function(e,n){var r=n.prototype.widgetFullName||e;t.fn[e]=function(o){var a="string"==typeof o,s=i.call(arguments,1),l=this;return a?this.length||"instance"!==o?this.each((function(){var n,i=t.data(this,r);return"instance"===o?(l=i,!1):i?t.isFunction(i[o])&&"_"!==o.charAt(0)?(n=i[o].apply(i,s))!==i&&void 0!==n?(l=n&&n.jquery?l.pushStack(n.get()):n,!1):void 0:t.error("no such method '"+o+"' for "+e+" widget instance"):t.error("cannot call methods on "+e+" prior to initialization; attempted to call method '"+o+"'")})):l=void 0:(s.length&&(o=t.widget.extend.apply(null,[o].concat(s))),this.each((function(){var e=t.data(this,r);e?(e.option(o||{}),e._init&&e._init()):t.data(this,r,new n(o,this))}))),l}},t.Widget=t.Widget||function(){},t.Widget._childConstructors=[],t.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{classes:{},disabled:!1,create:null},_createWidget:function(e,n){n=t(n||this.defaultElement||this)[0],this.element=t(n),this.uuid=r++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=t(),this.hoverable=t(),this.focusable=t(),this.classesElementLookup={},n!==this&&(t.data(n,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===n&&this.destroy()}}),this.document=t(n.style?n.ownerDocument:n.document||n),this.window=t(this.document[0].defaultView||this.document[0].parentWindow)),this.options=t.widget.extend({},this.options,this._getCreateOptions(),e),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:t.noop,_create:t.noop,_init:t.noop,destroy:function(){var e=this;this._destroy(),t.each(this.classesElementLookup,(function(t,n){e._removeClass(n,t)})),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:t.noop,widget:function(){return this.element},option:function(e,n){var r,i,o,a=e;if(0===arguments.length)return t.widget.extend({},this.options);if("string"==typeof e)if(a={},r=e.split("."),e=r.shift(),r.length){for(i=a[e]=t.widget.extend({},this.options[e]),o=0;o<r.length-1;o++)i[r[o]]=i[r[o]]||{},i=i[r[o]];if(e=r.pop(),1===arguments.length)return void 0===i[e]?null:i[e];i[e]=n}else{if(1===arguments.length)return void 0===this.options[e]?null:this.options[e];a[e]=n}return this._setOptions(a),this},_setOptions:function(t){var e;for(e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return"classes"===t&&this._setOptionClasses(e),this.options[t]=e,"disabled"===t&&this._setOptionDisabled(e),this},_setOptionClasses:function(e){var n,r,i;for(n in e)i=this.classesElementLookup[n],e[n]!==this.options.classes[n]&&i&&i.length&&(r=t(i.get()),this._removeClass(i,n),r.addClass(this._classes({element:r,keys:n,classes:e,add:!0})))},_setOptionDisabled:function(t){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!t),t&&(this._removeClass(this.hoverable,null,"ui-state-hover"),this._removeClass(this.focusable,null,"ui-state-focus"))},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_classes:function(e){var n=[],r=this;function i(i,o){var a,s;for(s=0;s<i.length;s++)a=r.classesElementLookup[i[s]]||t(),a=e.add?t(t.unique(a.get().concat(e.element.get()))):t(a.not(e.element).get()),r.classesElementLookup[i[s]]=a,n.push(i[s]),o&&e.classes[i[s]]&&n.push(e.classes[i[s]])}return e=t.extend({element:this.element,classes:this.options.classes||{}},e),this._on(e.element,{remove:"_untrackClassesElement"}),e.keys&&i(e.keys.match(/\S+/g)||[],!0),e.extra&&i(e.extra.match(/\S+/g)||[]),n.join(" ")},_untrackClassesElement:function(e){var n=this;t.each(n.classesElementLookup,(function(r,i){-1!==t.inArray(e.target,i)&&(n.classesElementLookup[r]=t(i.not(e.target).get()))}))},_removeClass:function(t,e,n){return this._toggleClass(t,e,n,!1)},_addClass:function(t,e,n){return this._toggleClass(t,e,n,!0)},_toggleClass:function(t,e,n,r){r="boolean"==typeof r?r:n;var i="string"==typeof t||null===t,o={extra:i?e:n,keys:i?t:e,element:i?this.element:t,add:r};return o.element.toggleClass(this._classes(o),r),this},_on:function(e,n,r){var i,o=this;"boolean"!=typeof e&&(r=n,n=e,e=!1),r?(n=i=t(n),this.bindings=this.bindings.add(n)):(r=n,n=this.element,i=this.widget()),t.each(r,(function(r,a){function s(){if(e||!0!==o.options.disabled&&!t(this).hasClass("ui-state-disabled"))return("string"==typeof a?o[a]:a).apply(o,arguments)}"string"!=typeof a&&(s.guid=a.guid=a.guid||s.guid||t.guid++);var l=r.match(/^([\w:-]*)\s*(.*)$/),u=l[1]+o.eventNamespace,c=l[2];c?i.on(u,c,s):n.on(u,s)}))},_off:function(e,n){n=(n||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,e.off(n).off(n),this.bindings=t(this.bindings.not(e).get()),this.focusable=t(this.focusable.not(e).get()),this.hoverable=t(this.hoverable.not(e).get())},_delay:function(t,e){var n=this;return setTimeout((function(){return("string"==typeof t?n[t]:t).apply(n,arguments)}),e||0)},_hoverable:function(e){this.hoverable=this.hoverable.add(e),this._on(e,{mouseenter:function(e){this._addClass(t(e.currentTarget),null,"ui-state-hover")},mouseleave:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-hover")}})},_focusable:function(e){this.focusable=this.focusable.add(e),this._on(e,{focusin:function(e){this._addClass(t(e.currentTarget),null,"ui-state-focus")},focusout:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-focus")}})},_trigger:function(e,n,r){var i,o,a=this.options[e];if(r=r||{},(n=t.Event(n)).type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase(),n.target=this.element[0],o=n.originalEvent)for(i in o)i in n||(n[i]=o[i]);return this.element.trigger(n,r),!(t.isFunction(a)&&!1===a.apply(this.element[0],[n].concat(r))||n.isDefaultPrevented())}},t.each({show:"fadeIn",hide:"fadeOut"},(function(e,n){t.Widget.prototype["_"+e]=function(r,i,o){var a;"string"==typeof i&&(i={effect:i});var s=i?!0===i||"number"==typeof i?n:i.effect||n:e;"number"==typeof(i=i||{})&&(i={duration:i}),a=!t.isEmptyObject(i),i.complete=o,i.delay&&r.delay(i.delay),a&&t.effects&&t.effects.effect[s]?r[e](i):s!==e&&r[s]?r[s](i.duration,i.easing,o):r.queue((function(n){t(this)[e](),o&&o.call(r[0]),n()}))}})),t.widget,
/*!
* jQuery UI Position 1.12.1
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
* http://api.jqueryui.com/position/
*/
function(){var e,n=Math.max,r=Math.abs,i=/left|center|right/,o=/top|center|bottom/,a=/[\+\-]\d+(\.[\d]+)?%?/,s=/^\w+/,l=/%$/,u=t.fn.position;function c(t,e,n){return[parseFloat(t[0])*(l.test(t[0])?e/100:1),parseFloat(t[1])*(l.test(t[1])?n/100:1)]}function h(e,n){return parseInt(t.css(e,n),10)||0}function p(e){var n=e[0];return 9===n.nodeType?{width:e.width(),height:e.height(),offset:{top:0,left:0}}:t.isWindow(n)?{width:e.width(),height:e.height(),offset:{top:e.scrollTop(),left:e.scrollLeft()}}:n.preventDefault?{width:0,height:0,offset:{top:n.pageY,left:n.pageX}}:{width:e.outerWidth(),height:e.outerHeight(),offset:e.offset()}}t.position=t.position||{scrollbarWidth:function(){if(void 0!==e)return e;var n,r,i=t("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),o=i.children()[0];return t("body").append(i),n=o.offsetWidth,i.css("overflow","scroll"),n===(r=o.offsetWidth)&&(r=i[0].clientWidth),i.remove(),e=n-r},getScrollInfo:function(e){var n=e.isWindow||e.isDocument?"":e.element.css("overflow-x"),r=e.isWindow||e.isDocument?"":e.element.css("overflow-y"),i="scroll"===n||"auto"===n&&e.width<e.element[0].scrollWidth;return{width:"scroll"===r||"auto"===r&&e.height<e.element[0].scrollHeight?t.position.scrollbarWidth():0,height:i?t.position.scrollbarWidth():0}},getWithinInfo:function(e){var n=t(e||window),r=t.isWindow(n[0]),i=!!n[0]&&9===n[0].nodeType;return{element:n,isWindow:r,isDocument:i,offset:r||i?{left:0,top:0}:t(e).offset(),scrollLeft:n.scrollLeft(),scrollTop:n.scrollTop(),width:n.outerWidth(),height:n.outerHeight()}}},t.fn.position=function(e){if(!e||!e.of)return u.apply(this,arguments);e=t.extend({},e);var l,d,f,g,y,m,v=t(e.of),_=t.position.getWithinInfo(e.within),b=t.position.getScrollInfo(_),w=(e.collision||"flip").split(" "),x={};return m=p(v),v[0].preventDefault&&(e.at="left top"),d=m.width,f=m.height,g=m.offset,y=t.extend({},g),t.each(["my","at"],(function(){var t,n,r=(e[this]||"").split(" ");1===r.length&&(r=i.test(r[0])?r.concat(["center"]):o.test(r[0])?["center"].concat(r):["center","center"]),r[0]=i.test(r[0])?r[0]:"center",r[1]=o.test(r[1])?r[1]:"center",t=a.exec(r[0]),n=a.exec(r[1]),x[this]=[t?t[0]:0,n?n[0]:0],e[this]=[s.exec(r[0])[0],s.exec(r[1])[0]]})),1===w.length&&(w[1]=w[0]),"right"===e.at[0]?y.left+=d:"center"===e.at[0]&&(y.left+=d/2),"bottom"===e.at[1]?y.top+=f:"center"===e.at[1]&&(y.top+=f/2),l=c(x.at,d,f),y.left+=l[0],y.top+=l[1],this.each((function(){var i,o,a=t(this),s=a.outerWidth(),u=a.outerHeight(),p=h(this,"marginLeft"),m=h(this,"marginTop"),E=s+p+h(this,"marginRight")+b.width,S=u+m+h(this,"marginBottom")+b.height,O=t.extend({},y),C=c(x.my,a.outerWidth(),a.outerHeight());"right"===e.my[0]?O.left-=s:"center"===e.my[0]&&(O.left-=s/2),"bottom"===e.my[1]?O.top-=u:"center"===e.my[1]&&(O.top-=u/2),O.left+=C[0],O.top+=C[1],i={marginLeft:p,marginTop:m},t.each(["left","top"],(function(n,r){t.ui.position[w[n]]&&t.ui.position[w[n]][r](O,{targetWidth:d,targetHeight:f,elemWidth:s,elemHeight:u,collisionPosition:i,collisionWidth:E,collisionHeight:S,offset:[l[0]+C[0],l[1]+C[1]],my:e.my,at:e.at,within:_,elem:a})})),e.using&&(o=function(t){var i=g.left-O.left,o=i+d-s,l=g.top-O.top,c=l+f-u,h={target:{element:v,left:g.left,top:g.top,width:d,height:f},element:{element:a,left:O.left,top:O.top,width:s,height:u},horizontal:o<0?"left":i>0?"right":"center",vertical:c<0?"top":l>0?"bottom":"middle"};d<s&&r(i+o)<d&&(h.horizontal="center"),f<u&&r(l+c)<f&&(h.vertical="middle"),n(r(i),r(o))>n(r(l),r(c))?h.important="horizontal":h.important="vertical",e.using.call(this,t,h)}),a.offset(t.extend(O,{using:o}))}))},t.ui.position={fit:{left:function(t,e){var r,i=e.within,o=i.isWindow?i.scrollLeft:i.offset.left,a=i.width,s=t.left-e.collisionPosition.marginLeft,l=o-s,u=s+e.collisionWidth-a-o;e.collisionWidth>a?l>0&&u<=0?(r=t.left+l+e.collisionWidth-a-o,t.left+=l-r):t.left=u>0&&l<=0?o:l>u?o+a-e.collisionWidth:o:l>0?t.left+=l:u>0?t.left-=u:t.left=n(t.left-s,t.left)},top:function(t,e){var r,i=e.within,o=i.isWindow?i.scrollTop:i.offset.top,a=e.within.height,s=t.top-e.collisionPosition.marginTop,l=o-s,u=s+e.collisionHeight-a-o;e.collisionHeight>a?l>0&&u<=0?(r=t.top+l+e.collisionHeight-a-o,t.top+=l-r):t.top=u>0&&l<=0?o:l>u?o+a-e.collisionHeight:o:l>0?t.top+=l:u>0?t.top-=u:t.top=n(t.top-s,t.top)}},flip:{left:function(t,e){var n,i,o=e.within,a=o.offset.left+o.scrollLeft,s=o.width,l=o.isWindow?o.scrollLeft:o.offset.left,u=t.left-e.collisionPosition.marginLeft,c=u-l,h=u+e.collisionWidth-s-l,p="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,d="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,f=-2*e.offset[0];c<0?((n=t.left+p+d+f+e.collisionWidth-s-a)<0||n<r(c))&&(t.left+=p+d+f):h>0&&((i=t.left-e.collisionPosition.marginLeft+p+d+f-l)>0||r(i)<h)&&(t.left+=p+d+f)},top:function(t,e){var n,i,o=e.within,a=o.offset.top+o.scrollTop,s=o.height,l=o.isWindow?o.scrollTop:o.offset.top,u=t.top-e.collisionPosition.marginTop,c=u-l,h=u+e.collisionHeight-s-l,p="top"===e.my[1]?-e.elemHeight:"bottom"===e.my[1]?e.elemHeight:0,d="top"===e.at[1]?e.targetHeight:"bottom"===e.at[1]?-e.targetHeight:0,f=-2*e.offset[1];c<0?((i=t.top+p+d+f+e.collisionHeight-s-a)<0||i<r(c))&&(t.top+=p+d+f):h>0&&((n=t.top-e.collisionPosition.marginTop+p+d+f-l)>0||r(n)<h)&&(t.top+=p+d+f)}},flipfit:{left:function(){t.ui.position.flip.left.apply(this,arguments),t.ui.position.fit.left.apply(this,arguments)},top:function(){t.ui.position.flip.top.apply(this,arguments),t.ui.position.fit.top.apply(this,arguments)}}}}(),t.ui.position,t.ui.keyCode={BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38},t.fn.scrollParent=function(e){var n=this.css("position"),r="absolute"===n,i=e?/(auto|scroll|hidden)/:/(auto|scroll)/,o=this.parents().filter((function(){var e=t(this);return(!r||"static"!==e.css("position"))&&i.test(e.css("overflow")+e.css("overflow-y")+e.css("overflow-x"))})).eq(0);return"fixed"!==n&&o.length?o:t(this[0].ownerDocument||document)},t.fn.extend({uniqueId:(n=0,function(){return this.each((function(){this.id||(this.id="ui-id-"+ ++n)}))}),removeUniqueId:function(){return this.each((function(){/^ui-id-\d+$/.test(this.id)&&t(this).removeAttr("id")}))}})})?r.apply(e,i):r)||(t.exports=o)},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){"use strict";n.r(e),n.d(e,"UI",(function(){return Qe}));var r=n(150),i=n(11),o=n(136),a=n(5),s=n(219),l=n(174),u=n(220),c=n(181),h=n(213),p=n(24),d=n.n(p),f=n(27),g=n.n(f),y=n(44),m=function(){function t(e,n){d()(this,t),Object(y.b)()&&("function"==typeof n?(this.authenticateCb=n,this.context=e,this.context.registerAuthenticationProvider(this)):console.error("Expected authenticate callback function"))}return g()(t,[{key:"authenticate",value:function(t,e,n){return this.authenticateCb(t,e,n)}}]),t}(),v=n(87),_=n.n(v),b=n(3);
/*!
* perfect-scrollbar v1.5.0
* Copyright 2020 Hyunje Jun, MDBootstrap and Contributors
* Licensed under MIT
*/
function w(t){return getComputedStyle(t)}function x(t,e){for(var n in e){var r=e[n];"number"==typeof r&&(r+="px"),t.style[n]=r}return t}function E(t){var e=document.createElement("div");return e.className=t,e}var S="undefined"!=typeof Element&&(Element.prototype.matches||Element.prototype.webkitMatchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector);function O(t,e){if(!S)throw new Error("No element matching method supported");return S.call(t,e)}function C(t){t.remove?t.remove():t.parentNode&&t.parentNode.removeChild(t)}function T(t,e){return Array.prototype.filter.call(t.children,(function(t){return O(t,e)}))}var I="ps",L="ps__rtl",P={thumb:function(t){return"ps__thumb-"+t},rail:function(t){return"ps__rail-"+t},consuming:"ps__child--consume"},R={focus:"ps--focus",clicking:"ps--clicking",active:function(t){return"ps--active-"+t},scrolling:function(t){return"ps--scrolling-"+t}},M={x:null,y:null};function N(t,e){var n=t.element.classList,r=R.scrolling(e);n.contains(r)?clearTimeout(M[e]):n.add(r)}function j(t,e){M[e]=setTimeout((function(){return t.isAlive&&t.element.classList.remove(R.scrolling(e))}),t.settings.scrollingThreshold)}var A=function(t){this.element=t,this.handlers={}},F={isEmpty:{configurable:!0}};A.prototype.bind=function(t,e){void 0===this.handlers[t]&&(this.handlers[t]=[]),this.handlers[t].push(e),this.element.addEventListener(t,e,!1)},A.prototype.unbind=function(t,e){var n=this;this.handlers[t]=this.handlers[t].filter((function(r){return!(!e||r===e)||(n.element.removeEventListener(t,r,!1),!1)}))},A.prototype.unbindAll=function(){for(var t in this.handlers)this.unbind(t)},F.isEmpty.get=function(){var t=this;return Object.keys(this.handlers).every((function(e){return 0===t.handlers[e].length}))},Object.defineProperties(A.prototype,F);var D=function(){this.eventElements=[]};function G(t){if("function"==typeof window.CustomEvent)return new CustomEvent(t);var e=document.createEvent("CustomEvent");return e.initCustomEvent(t,!1,!1,void 0),e}function z(t,e,n,r,i){var o;if(void 0===r&&(r=!0),void 0===i&&(i=!1),"top"===e)o=["contentHeight","containerHeight","scrollTop","y","up","down"];else{if("left"!==e)throw new Error("A proper axis should be provided");o=["contentWidth","containerWidth","scrollLeft","x","left","right"]}!function(t,e,n,r,i){var o=n[0],a=n[1],s=n[2],l=n[3],u=n[4],c=n[5];void 0===r&&(r=!0);void 0===i&&(i=!1);var h=t.element;t.reach[l]=null,h[s]<1&&(t.reach[l]="start");h[s]>t[o]-t[a]-1&&(t.reach[l]="end");e&&(h.dispatchEvent(G("ps-scroll-"+l)),e<0?h.dispatchEvent(G("ps-scroll-"+u)):e>0&&h.dispatchEvent(G("ps-scroll-"+c)),r&&function(t,e){N(t,e),j(t,e)}(t,l));t.reach[l]&&(e||i)&&h.dispatchEvent(G("ps-"+l+"-reach-"+t.reach[l]))}(t,n,o,r,i)}function U(t){return parseInt(t,10)||0}D.prototype.eventElement=function(t){var e=this.eventElements.filter((function(e){return e.element===t}))[0];return e||(e=new A(t),this.eventElements.push(e)),e},D.prototype.bind=function(t,e,n){this.eventElement(t).bind(e,n)},D.prototype.unbind=function(t,e,n){var r=this.eventElement(t);r.unbind(e,n),r.isEmpty&&this.eventElements.splice(this.eventElements.indexOf(r),1)},D.prototype.unbindAll=function(){this.eventElements.forEach((function(t){return t.unbindAll()})),this.eventElements=[]},D.prototype.once=function(t,e,n){var r=this.eventElement(t),i=function(t){r.unbind(e,i),n(t)};r.bind(e,i)};var B={isWebKit:"undefined"!=typeof document&&"WebkitAppearance"in document.documentElement.style,supportsTouch:"undefined"!=typeof window&&("ontouchstart"in window||"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>0||window.DocumentTouch&&document instanceof window.DocumentTouch),supportsIePointer:"undefined"!=typeof navigator&&navigator.msMaxTouchPoints,isChrome:"undefined"!=typeof navigator&&/Chrome/i.test(navigator&&navigator.userAgent)};function V(t){var e=t.element,n=Math.floor(e.scrollTop),r=e.getBoundingClientRect();t.containerWidth=Math.ceil(r.width),t.containerHeight=Math.ceil(r.height),t.contentWidth=e.scrollWidth,t.contentHeight=e.scrollHeight,e.contains(t.scrollbarXRail)||(T(e,P.rail("x")).forEach((function(t){return C(t)})),e.appendChild(t.scrollbarXRail)),e.contains(t.scrollbarYRail)||(T(e,P.rail("y")).forEach((function(t){return C(t)})),e.appendChild(t.scrollbarYRail)),!t.settings.suppressScrollX&&t.containerWidth+t.settings.scrollXMarginOffset<t.contentWidth?(t.scrollbarXActive=!0,t.railXWidth=t.containerWidth-t.railXMarginWidth,t.railXRatio=t.containerWidth/t.railXWidth,t.scrollbarXWidth=q(t,U(t.railXWidth*t.containerWidth/t.contentWidth)),t.scrollbarXLeft=U((t.negativeScrollAdjustment+e.scrollLeft)*(t.railXWidth-t.scrollbarXWidth)/(t.contentWidth-t.containerWidth))):t.scrollbarXActive=!1,!t.settings.suppressScrollY&&t.containerHeight+t.settings.scrollYMarginOffset<t.contentHeight?(t.scrollbarYActive=!0,t.railYHeight=t.containerHeight-t.railYMarginHeight,t.railYRatio=t.containerHeight/t.railYHeight,t.scrollbarYHeight=q(t,U(t.railYHeight*t.containerHeight/t.contentHeight)),t.scrollbarYTop=U(n*(t.railYHeight-t.scrollbarYHeight)/(t.contentHeight-t.containerHeight))):t.scrollbarYActive=!1,t.scrollbarXLeft>=t.railXWidth-t.scrollbarXWidth&&(t.scrollbarXLeft=t.railXWidth-t.scrollbarXWidth),t.scrollbarYTop>=t.railYHeight-t.scrollbarYHeight&&(t.scrollbarYTop=t.railYHeight-t.scrollbarYHeight),function(t,e){var n={width:e.railXWidth},r=Math.floor(t.scrollTop);e.isRtl?n.left=e.negativeScrollAdjustment+t.scrollLeft+e.containerWidth-e.contentWidth:n.left=t.scrollLeft;e.isScrollbarXUsingBottom?n.bottom=e.scrollbarXBottom-r:n.top=e.scrollbarXTop+r;x(e.scrollbarXRail,n);var i={top:r,height:e.railYHeight};e.isScrollbarYUsingRight?e.isRtl?i.right=e.contentWidth-(e.negativeScrollAdjustment+t.scrollLeft)-e.scrollbarYRight-e.scrollbarYOuterWidth-9:i.right=e.scrollbarYRight-t.scrollLeft:e.isRtl?i.left=e.negativeScrollAdjustment+t.scrollLeft+2*e.containerWidth-e.contentWidth-e.scrollbarYLeft-e.scrollbarYOuterWidth:i.left=e.scrollbarYLeft+t.scrollLeft;x(e.scrollbarYRail,i),x(e.scrollbarX,{left:e.scrollbarXLeft,width:e.scrollbarXWidth-e.railBorderXWidth}),x(e.scrollbarY,{top:e.scrollbarYTop,height:e.scrollbarYHeight-e.railBorderYWidth})}(e,t),t.scrollbarXActive?e.classList.add(R.active("x")):(e.classList.remove(R.active("x")),t.scrollbarXWidth=0,t.scrollbarXLeft=0,e.scrollLeft=!0===t.isRtl?t.contentWidth:0),t.scrollbarYActive?e.classList.add(R.active("y")):(e.classList.remove(R.active("y")),t.scrollbarYHeight=0,t.scrollbarYTop=0,e.scrollTop=0)}function q(t,e){return t.settings.minScrollbarLength&&(e=Math.max(e,t.settings.minScrollbarLength)),t.settings.maxScrollbarLength&&(e=Math.min(e,t.settings.maxScrollbarLength)),e}function Y(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],l=e[6],u=e[7],c=e[8],h=t.element,p=null,d=null,f=null;function g(e){e.touches&&e.touches[0]&&(e[i]=e.touches[0].pageY),h[l]=p+f*(e[i]-d),N(t,u),V(t),e.stopPropagation(),e.preventDefault()}function y(){j(t,u),t[c].classList.remove(R.clicking),t.event.unbind(t.ownerDocument,"mousemove",g)}function m(e,a){p=h[l],a&&e.touches&&(e[i]=e.touches[0].pageY),d=e[i],f=(t[r]-t[n])/(t[o]-t[s]),a?t.event.bind(t.ownerDocument,"touchmove",g):(t.event.bind(t.ownerDocument,"mousemove",g),t.event.once(t.ownerDocument,"mouseup",y),e.preventDefault()),t[c].classList.add(R.clicking),e.stopPropagation()}t.event.bind(t[a],"mousedown",(function(t){m(t)})),t.event.bind(t[a],"touchstart",(function(t){m(t,!0)}))}var X={"click-rail":function(t){t.element,t.event.bind(t.scrollbarY,"mousedown",(function(t){return t.stopPropagation()})),t.event.bind(t.scrollbarYRail,"mousedown",(function(e){var n=e.pageY-window.pageYOffset-t.scrollbarYRail.getBoundingClientRect().top>t.scrollbarYTop?1:-1;t.element.scrollTop+=n*t.containerHeight,V(t),e.stopPropagation()})),t.event.bind(t.scrollbarX,"mousedown",(function(t){return t.stopPropagation()})),t.event.bind(t.scrollbarXRail,"mousedown",(function(e){var n=e.pageX-window.pageXOffset-t.scrollbarXRail.getBoundingClientRect().left>t.scrollbarXLeft?1:-1;t.element.scrollLeft+=n*t.containerWidth,V(t),e.stopPropagation()}))},"drag-thumb":function(t){Y(t,["containerWidth","contentWidth","pageX","railXWidth","scrollbarX","scrollbarXWidth","scrollLeft","x","scrollbarXRail"]),Y(t,["containerHeight","contentHeight","pageY","railYHeight","scrollbarY","scrollbarYHeight","scrollTop","y","scrollbarYRail"])},keyboard:function(t){var e=t.element;t.event.bind(t.ownerDocument,"keydown",(function(n){if(!(n.isDefaultPrevented&&n.isDefaultPrevented()||n.defaultPrevented)&&(O(e,":hover")||O(t.scrollbarX,":focus")||O(t.scrollbarY,":focus"))){var r,i=document.activeElement?document.activeElement:t.ownerDocument.activeElement;if(i){if("IFRAME"===i.tagName)i=i.contentDocument.activeElement;else for(;i.shadowRoot;)i=i.shadowRoot.activeElement;if(O(r=i,"input,[contenteditable]")||O(r,"select,[contenteditable]")||O(r,"textarea,[contenteditable]")||O(r,"button,[contenteditable]"))return}var o=0,a=0;switch(n.which){case 37:o=n.metaKey?-t.contentWidth:n.altKey?-t.containerWidth:-30;break;case 38:a=n.metaKey?t.contentHeight:n.altKey?t.containerHeight:30;break;case 39:o=n.metaKey?t.contentWidth:n.altKey?t.containerWidth:30;break;case 40:a=n.metaKey?-t.contentHeight:n.altKey?-t.containerHeight:-30;break;case 32:a=n.shiftKey?t.containerHeight:-t.containerHeight;break;case 33:a=t.containerHeight;break;case 34:a=-t.containerHeight;break;case 36:a=t.contentHeight;break;case 35:a=-t.contentHeight;break;default:return}t.settings.suppressScrollX&&0!==o||t.settings.suppressScrollY&&0!==a||(e.scrollTop-=a,e.scrollLeft+=o,V(t),function(n,r){var i=Math.floor(e.scrollTop);if(0===n){if(!t.scrollbarYActive)return!1;if(0===i&&r>0||i>=t.contentHeight-t.containerHeight&&r<0)return!t.settings.wheelPropagation}var o=e.scrollLeft;if(0===r){if(!t.scrollbarXActive)return!1;if(0===o&&n<0||o>=t.contentWidth-t.containerWidth&&n>0)return!t.settings.wheelPropagation}return!0}(o,a)&&n.preventDefault())}}))},wheel:function(t){var e=t.element;function n(n){var r=function(t){var e=t.deltaX,n=-1*t.deltaY;return void 0!==e&&void 0!==n||(e=-1*t.wheelDeltaX/6,n=t.wheelDeltaY/6),t.deltaMode&&1===t.deltaMode&&(e*=10,n*=10),e!=e&&n!=n&&(e=0,n=t.wheelDelta),t.shiftKey?[-n,-e]:[e,n]}(n),i=r[0],o=r[1];if(!function(t,n,r){if(!B.isWebKit&&e.querySelector("select:focus"))return!0;if(!e.contains(t))return!1;for(var i=t;i&&i!==e;){if(i.classList.contains(P.consuming))return!0;var o=w(i);if(r&&o.overflowY.match(/(scroll|auto)/)){var a=i.scrollHeight-i.clientHeight;if(a>0&&(i.scrollTop>0&&r<0||i.scrollTop<a&&r>0))return!0}if(n&&o.overflowX.match(/(scroll|auto)/)){var s=i.scrollWidth-i.clientWidth;if(s>0&&(i.scrollLeft>0&&n<0||i.scrollLeft<s&&n>0))return!0}i=i.parentNode}return!1}(n.target,i,o)){var a=!1;t.settings.useBothWheelAxes?t.scrollbarYActive&&!t.scrollbarXActive?(o?e.scrollTop-=o*t.settings.wheelSpeed:e.scrollTop+=i*t.settings.wheelSpeed,a=!0):t.scrollbarXActive&&!t.scrollbarYActive&&(i?e.scrollLeft+=i*t.settings.wheelSpeed:e.scrollLeft-=o*t.settings.wheelSpeed,a=!0):(e.scrollTop-=o*t.settings.wheelSpeed,e.scrollLeft+=i*t.settings.wheelSpeed),V(t),(a=a||function(n,r){var i=Math.floor(e.scrollTop),o=0===e.scrollTop,a=i+e.offsetHeight===e.scrollHeight,s=0===e.scrollLeft,l=e.scrollLeft+e.offsetWidth===e.scrollWidth;return!(Math.abs(r)>Math.abs(n)?o||a:s||l)||!t.settings.wheelPropagation}(i,o))&&!n.ctrlKey&&(n.stopPropagation(),n.preventDefault())}}void 0!==window.onwheel?t.event.bind(e,"wheel",n):void 0!==window.onmousewheel&&t.event.bind(e,"mousewheel",n)},touch:function(t){if(B.supportsTouch||B.supportsIePointer){var e=t.element,n={},r=0,i={},o=null;B.supportsTouch?(t.event.bind(e,"touchstart",u),t.event.bind(e,"touchmove",c),t.event.bind(e,"touchend",h)):B.supportsIePointer&&(window.PointerEvent?(t.event.bind(e,"pointerdown",u),t.event.bind(e,"pointermove",c),t.event.bind(e,"pointerup",h)):window.MSPointerEvent&&(t.event.bind(e,"MSPointerDown",u),t.event.bind(e,"MSPointerMove",c),t.event.bind(e,"MSPointerUp",h)))}function a(n,r){e.scrollTop-=r,e.scrollLeft-=n,V(t)}function s(t){return t.targetTouches?t.targetTouches[0]:t}function l(t){return(!t.pointerType||"pen"!==t.pointerType||0!==t.buttons)&&(!(!t.targetTouches||1!==t.targetTouches.length)||!(!t.pointerType||"mouse"===t.pointerType||t.pointerType===t.MSPOINTER_TYPE_MOUSE))}function u(t){if(l(t)){var e=s(t);n.pageX=e.pageX,n.pageY=e.pageY,r=(new Date).getTime(),null!==o&&clearInterval(o)}}function c(o){if(l(o)){var u=s(o),c={pageX:u.pageX,pageY:u.pageY},h=c.pageX-n.pageX,p=c.pageY-n.pageY;if(function(t,n,r){if(!e.contains(t))return!1;for(var i=t;i&&i!==e;){if(i.classList.contains(P.consuming))return!0;var o=w(i);if(r&&o.overflowY.match(/(scroll|auto)/)){var a=i.scrollHeight-i.clientHeight;if(a>0&&(i.scrollTop>0&&r<0||i.scrollTop<a&&r>0))return!0}if(n&&o.overflowX.match(/(scroll|auto)/)){var s=i.scrollWidth-i.clientWidth;if(s>0&&(i.scrollLeft>0&&n<0||i.scrollLeft<s&&n>0))return!0}i=i.parentNode}return!1}(o.target,h,p))return;a(h,p),n=c;var d=(new Date).getTime(),f=d-r;f>0&&(i.x=h/f,i.y=p/f,r=d),function(n,r){var i=Math.floor(e.scrollTop),o=e.scrollLeft,a=Math.abs(n),s=Math.abs(r);if(s>a){if(r<0&&i===t.contentHeight-t.containerHeight||r>0&&0===i)return 0===window.scrollY&&r>0&&B.isChrome}else if(a>s&&(n<0&&o===t.contentWidth-t.containerWidth||n>0&&0===o))return!0;return!0}(h,p)&&o.preventDefault()}}function h(){t.settings.swipeEasing&&(clearInterval(o),o=setInterval((function(){t.isInitialized?clearInterval(o):i.x||i.y?Math.abs(i.x)<.01&&Math.abs(i.y)<.01?clearInterval(o):(a(30*i.x,30*i.y),i.x*=.8,i.y*=.8):clearInterval(o)}),10))}}},W=function(t,e){var n=this;if(void 0===e&&(e={}),"string"==typeof t&&(t=document.querySelector(t)),!t||!t.nodeName)throw new Error("no element is specified to initialize PerfectScrollbar");for(var r in this.element=t,t.classList.add(I),this.settings={handlers:["click-rail","drag-thumb","keyboard","wheel","touch"],maxScrollbarLength:null,minScrollbarLength:null,scrollingThreshold:1e3,scrollXMarginOffset:0,scrollYMarginOffset:0,suppressScrollX:!1,suppressScrollY:!1,swipeEasing:!0,useBothWheelAxes:!1,wheelPropagation:!0,wheelSpeed:1},e)this.settings[r]=e[r];this.containerWidth=null,this.containerHeight=null,this.contentWidth=null,this.contentHeight=null;var i,o,a=function(){return t.classList.add(R.focus)},s=function(){return t.classList.remove(R.focus)};this.isRtl="rtl"===w(t).direction,!0===this.isRtl&&t.classList.add(L),this.isNegativeScroll=(o=t.scrollLeft,t.scrollLeft=-1,i=t.scrollLeft<0,t.scrollLeft=o,i),this.negativeScrollAdjustment=this.isNegativeScroll?t.scrollWidth-t.clientWidth:0,this.event=new D,this.ownerDocument=t.ownerDocument||document,this.scrollbarXRail=E(P.rail("x")),t.appendChild(this.scrollbarXRail),this.scrollbarX=E(P.thumb("x")),this.scrollbarXRail.appendChild(this.scrollbarX),this.scrollbarX.setAttribute("tabindex",0),this.event.bind(this.scrollbarX,"focus",a),this.event.bind(this.scrollbarX,"blur",s),this.scrollbarXActive=null,this.scrollbarXWidth=null,this.scrollbarXLeft=null;var l=w(this.scrollbarXRail);this.scrollbarXBottom=parseInt(l.bottom,10),isNaN(this.scrollbarXBottom)?(this.isScrollbarXUsingBottom=!1,this.scrollbarXTop=U(l.top)):this.isScrollbarXUsingBottom=!0,this.railBorderXWidth=U(l.borderLeftWidth)+U(l.borderRightWidth),x(this.scrollbarXRail,{display:"block"}),this.railXMarginWidth=U(l.marginLeft)+U(l.marginRight),x(this.scrollbarXRail,{display:""}),this.railXWidth=null,this.railXRatio=null,this.scrollbarYRail=E(P.rail("y")),t.appendChild(this.scrollbarYRail),this.scrollbarY=E(P.thumb("y")),this.scrollbarYRail.appendChild(this.scrollbarY),this.scrollbarY.setAttribute("tabindex",0),this.event.bind(this.scrollbarY,"focus",a),this.event.bind(this.scrollbarY,"blur",s),this.scrollbarYActive=null,this.scrollbarYHeight=null,this.scrollbarYTop=null;var u=w(this.scrollbarYRail);this.scrollbarYRight=parseInt(u.right,10),isNaN(this.scrollbarYRight)?(this.isScrollbarYUsingRight=!1,this.scrollbarYLeft=U(u.left)):this.isScrollbarYUsingRight=!0,this.scrollbarYOuterWidth=this.isRtl?function(t){var e=w(t);return U(e.width)+U(e.paddingLeft)+U(e.paddingRight)+U(e.borderLeftWidth)+U(e.borderRightWidth)}(this.scrollbarY):null,this.railBorderYWidth=U(u.borderTopWidth)+U(u.borderBottomWidth),x(this.scrollbarYRail,{display:"block"}),this.railYMarginHeight=U(u.marginTop)+U(u.marginBottom),x(this.scrollbarYRail,{display:""}),this.railYHeight=null,this.railYRatio=null,this.reach={x:t.scrollLeft<=0?"start":t.scrollLeft>=this.contentWidth-this.containerWidth?"end":null,y:t.scrollTop<=0?"start":t.scrollTop>=this.contentHeight-this.containerHeight?"end":null},this.isAlive=!0,this.settings.handlers.forEach((function(t){return X[t](n)})),this.lastScrollTop=Math.floor(t.scrollTop),this.lastScrollLeft=t.scrollLeft,this.event.bind(this.element,"scroll",(function(t){return n.onScroll(t)})),V(this)};W.prototype.update=function(){this.isAlive&&(this.negativeScrollAdjustment=this.isNegativeScroll?this.element.scrollWidth-this.element.clientWidth:0,x(this.scrollbarXRail,{display:"block"}),x(this.scrollbarYRail,{display:"block"}),this.railXMarginWidth=U(w(this.scrollbarXRail).marginLeft)+U(w(this.scrollbarXRail).marginRight),this.railYMarginHeight=U(w(this.scrollbarYRail).marginTop)+U(w(this.scrollbarYRail).marginBottom),x(this.scrollbarXRail,{display:"none"}),x(this.scrollbarYRail,{display:"none"}),V(this),z(this,"top",0,!1,!0),z(this,"left",0,!1,!0),x(this.scrollbarXRail,{display:""}),x(this.scrollbarYRail,{display:""}))},W.prototype.onScroll=function(t){this.isAlive&&(V(this),z(this,"top",this.element.scrollTop-this.lastScrollTop),z(this,"left",this.element.scrollLeft-this.lastScrollLeft),this.lastScrollTop=Math.floor(this.element.scrollTop),this.lastScrollLeft=this.element.scrollLeft)},W.prototype.destroy=function(){this.isAlive&&(this.event.unbindAll(),C(this.scrollbarX),C(this.scrollbarY),C(this.scrollbarXRail),C(this.scrollbarYRail),this.removePsClasses(),this.element=null,this.scrollbarX=null,this.scrollbarY=null,this.scrollbarXRail=null,this.scrollbarYRail=null,this.isAlive=!1)},W.prototype.removePsClasses=function(){this.element.className=this.element.className.split(" ").filter((function(t){return!t.match(/^ps([-_].+|)$/)})).join(" ")};var H=W,K=(n(255),n(12)),Z=n.n(K);function J(){var t=Z()(this.element).find(".ps-scrollbar-x-rail"),e=-1/0,n=1/0;t&&t.position()&&(e=t.position().left,n=e+t.width()),0===e&&0===n&&(e=-1/0,n=1/0);var r=this;Z()(this.element).find("li.lazy").each((function(){var t=Z()(this),i=t.position().left,o=i+t.width();i>n||o<e||tt.call(r,t)}))}function Q(){var t=Z()(this.element).find(".ps-scrollbar-y-rail"),e=-1/0,n=1/0;t&&t.position()&&(e=t.position().top,n=e+t.height()),e===n&&(e=-1/0,n=1/0);var r=this;Z()(this.element).find("li.lazy").each((function(){var t=Z()(this),i=t.position().top,o=i+t.height();i>n||o<e||tt.call(r,t)}))}function tt(t){var e=this;t.removeClass("lazy");var n=t.find("div[data-img]"),r=n.data("img"),o=n.data("rotation");Z()("<img />").bind("load",(function(){if(t.removeClass("loading"),n.css("background-image",'url("'+r+'")'),"vertical"===e.mode?n.css("width","100%"):n.css("width",e.thumbnailWidth+"px"),n.css("height",e.thumbnailHeight+"px"),n.css("margin","0 auto"),o){var i=this.width,a=this.height,s=o/(180/Math.PI),l=i/(i*Math.abs(Math.cos(s))+a*Math.abs(Math.sin(s))),u=a/(i*Math.abs(Math.sin(s))+a*Math.abs(Math.cos(s)));n.css("transform","rotate("+o+"deg) scale("+Math.min(l,u)+")")}})).bind("error",(function(){t.removeClass("loading"),n.addClass("no-image"),n.html(i.a.translate("Failed to load image")),"vertical"===e.mode?n.css("width","100%"):n.css("width",e.thumbnailWidth+"px"),n.css("height",e.thumbnailHeight+"px"),n.css("margin","0 auto"),n.css("padding-top",e.thumbnailHeight/3+"px");var r=t.find("a"),o=r.data("server"),a=r.data("path");e.fireEvent(b.c.SlideInfoError,{serverUrl:o,path:a})})).attr("src",r);var a=t.find("img.barcode");0!==a.length&&(a.bind("error",(function(){a.hide()})),a.attr("src",a.data("src")),a.css("width",Math.round(.4*e.thumbnailWidth)+"px"),a.css("display","block"))}function et(t,e){var n=Z()(t),r=n.parent().hasClass("selected");r&&(n.parent().removeClass("selected"),this.fireEvent(b.c.SlideDeSelected,{serverUrl:n.data("server"),path:n.data("path"),index:n.parent().index(),userInteraction:!0===e})),this.multiSelect||Z()(this.element).find("ul li").removeClass("selected"),r||(n.parent().addClass("selected"),this.fireEvent(b.c.SlideSelected,{serverUrl:n.data("server"),path:n.data("path"),index:n.parent().index(),userInteraction:!0===e}))}function nt(t){var e=" style=' ";this.thumbnailHeight>0&&(e+="height: "+this.thumbnailHeight+"px!important; "),e+="' ",this.element.innerHTML="<ul><li class='empty-message' "+e+"><span>"+t+"</span></li></ul>"}function rt(t,e,n,r,o){var a=this;if(0===n.length)return nt.call(a,i.a.translate("No images found")),void("function"==typeof r&&r());for(var s=this.renderOptions==b.d.All,l=this.renderOptions==b.d.Barcode,u=[],c=0;c<n.length;c++){var h={path:n[c],hasBarcode:!0,rotation:0};"object"===_()(n[c])&&n[c].hasOwnProperty("path")&&(h.path=n[c].path),"object"===_()(n[c])&&n[c].hasOwnProperty("rotation")&&(h.rotation=n[c].rotation),"object"===_()(n[c])&&n[c].hasOwnProperty("snapshotParameters")&&(h.snapshotParameters=n[c].snapshotParameters),h.hasBarcode=!0,u.push(h)}s||l?this.context.getImagesInfo({serverUrl:t,images:u.map((function(t){return t.path})),success:function(e,n){for(var i=0;i<n.length;i++)for(var s=n[i].AssociatedImageTypes.indexOf("Barcode")>-1,l=0;l<u.length;l++)if(u[l].path==n[i].Filename){u[l].hasBarcode=s;break}it.call(a,t,e,u,r,o)},failure:function(){it.call(a,t,e,u,r,o)}}):it.call(a,t,e,u,r,o)}function it(t,e,n,r,i){var o=this,a=this.renderOptions==b.d.All,s=this.renderOptions==b.d.Barcode,l=Math.floor(o.thumbnailWidth/3),u=Math.floor(o.thumbnailHeight/3),c="margin: "+u+"px "+("horizontal"===o.mode||"grid"===o.mode?l+"px":"auto")+"; width: "+l+"px; height: "+u+"px;",h="",p="",d="",f=o.thumbnailWidth,g=o.thumbnailHeight;"horizontal"===o.mode?(p=" style='width: "+n.length*o.thumbnailWidth+"px; height: "+o.thumbnailHeight+"px; overflow: hidden;' ",h=" style='max-width: "+o.thumbnailWidth+"px;' ",f=0):"vertical"===o.mode?g=0:"grid"===o.mode&&(h=" style='width: auto;height: "+(o.thumbnailHeight+32)+"px;' ",d=" style='width: "+(o.thumbnailWidth+32)+"px;' ",f=0);var y="<ul"+p+">";Z()(o.element).find("ul li.emptyli").remove(),!0===i&&(y="");for(var m=0;m<n.length;m++){var v=n[m].path,_="",w="",x=Object(b.l)(t,e,v,0,f,g);if(n[m].hasOwnProperty("snapshotParameters"))x=Object(b.k)(t,e,v,n[m].snapshotParameters,f,g,"jpg");else if(n[m].hasOwnProperty("rotation")){var E=parseInt(n[m].rotation);isNaN(E)||0==E||(_="transform:rotate("+E+"deg);",w='data-rotation="'+E+'"')}var S=Object(b.j)(t,e,v,o.barcodeRotation?o.barcodeRotation:0);y+="<li draggable='true' class='lazy loading'"+d+"><a "+h+" data-server='"+t+"' data-path='"+v+"' href='#'>",o.showFileName&&("function"==typeof o.filenameCallback?y+="<span>"+o.filenameCallback(t,v)+"</span>":y+="<span>"+v.split("/").pop()+"</span>"),y+="<div "+w+" data-img='"+(s?S:x)+"' style=' "+c+_+"'></div>",a&&n[m].hasBarcode&&(y+='<img class="barcode '+(a?"":"hidden")+' " data-src="'+S+'" />'),y+="</a>","function"==typeof o.additionalHtmlCallback&&(y+=o.additionalHtmlCallback(n[m])),y+="</li>"}if("grid"===this.mode)for(var O=0;O<10;O++)y+="<li class='emptyli' "+d+" ></li>";if(!0!==i&&(y+="</ul>"),!0===i?Z()(o.element).find("ul").append(y):o.element.innerHTML=y,Z()(o.element).find("ul li:not(.emptyli)").each((function(t,e){e.addEventListener("dragstart",ct.bind(this,e),!1)})),"horizontal"===o.mode){var C=Z()(o.element).find("ul"),T=C.outerWidth(!0)-C.width();Z()(o.element).find("ul li").each((function(){T+=Z()(this).outerWidth(!0)+2})),C.css("width",T+"px"),C.css("height",""),C.css("overflow","")}Z()(o.element).find("ul li a").click((function(t){t.preventDefault(),et.call(o,this,!0)})),!0!==i?o.ps=new H(o.element,{useBothWheelAxes:!0,wheelPropagation:!0,swipePropagation:!0}):o.ps.update(),"horizontal"===o.mode?(Z()(document).on("ps-scroll-x",(function(){clearTimeout(o.lazyLoadTimeOut),o.lazyLoadTimeOut=setTimeout(J.bind(o),500)})),J.call(o)):(Z()(document).on("ps-scroll-y",(function(){clearTimeout(o.lazyLoadTimeOut),o.lazyLoadTimeOut=setTimeout(Q.bind(o),500)})),Q.call(o)),"function"==typeof r&&r()}function ot(t,e,n){this.ps&&this.ps.destroy();var r=this;r.context.getSession(t,(function(i){rt.call(r,t,i,e,n)}))}function at(){if(this.lastLoadedImages.length>0)for(var t=0;t<this.lastLoadedImages.length;t++)rt.call(this,this.lastLoadedImages[t].serverUrl,this.lastLoadedImages[t].sessionId,this.lastLoadedImages[t].images,null)}function st(t){t.preventDefault();var e=t.dataTransfer.types,n=!1;if(e){if(e.indexOf?n=e.indexOf("application/x-fancytree-node")>-1||e.indexOf(b.b)>-1:e.contains&&(n=e.contains("application/x-fancytree-node")||e.contains(b.b)),n)return void(t.altKey?t.dataTransfer.dropEffect="move":t.dataTransfer.dropEffect="copy");t.dataTransfer.dropEffect="none"}}function lt(t){t.preventDefault();var e=this,n=Object(b.n)(t.dataTransfer),r=0==t.altKey;if(n&&n.path&&n.serverUrl&&"gallery"!==n.source){if(!n.isFolder){var i=[{serverUrl:n.serverUrl,path:n.path}];return void e.context.getSession(n.serverUrl,(function(t){e.lastLoadedImages.push({serverUrl:n.serverUrl,sessionId:t,images:i}),rt.call(e,n.serverUrl,t,i,(function(){e.fireEvent(b.c.Dropped,{serverUrl:n.serverUrl,path:n.path,isFolder:!1,append:r&&e.lastLoadedImages.length>1})}),r&&e.lastLoadedImages.length>1)}))}this.context.getSlides({serverUrl:n.serverUrl,path:n.path,success:function(t,i){null!=i&&0!=i.length?(e.lastLoadedImages.push([{serverUrl:n.serverUrl,sessionId:t,images:i}]),rt.call(e,n.serverUrl,t,i,(function(){e.fireEvent(b.c.Dropped,{serverUrl:n.serverUrl,path:n.path,isFolder:!0,append:r&&e.lastLoadedImages.length>1})}),r&&e.lastLoadedImages.length>1)):e.fireEvent(b.c.Dropped,{serverUrl:n.serverUrl,path:n.path,isFolder:!0,append:r&&e.lastLoadedImages.length>1})},failure:function(t){console.error("Error loading slides from directory")}})}}function ut(){this.element&&(this.element.addEventListener("drop",lt.bind(this),!1),this.element.addEventListener("dragover",st.bind(this),!1))}function ct(t,e){var n=Z()(t).find("a");if(n){var r=JSON.stringify({serverUrl:n.data("server"),path:n.data("path"),isFolder:!1,source:"gallery"});e.dataTransfer.setData("text",r),e.dataTransfer.setData(b.b,r)}}var ht=function(){function t(e,n){if(d()(this,t),Object(y.b)()){if(n.element instanceof HTMLElement)this.element=n.element;else{if("string"!=typeof n.element)return void console.error("Invalid element");var r=document.querySelector(n.element);r?this.element=r:console.error("Invalid selector for element")}isNaN(n.thumbnailHeight)||isNaN(n.thumbnailWidth)||n.thumbnailHeight<=0||n.thumbnailWidth<=0?console.error("thumbnailWidth & thumbnailHeight must be positive integers"):(this.listeners={},this.listeners[b.c.SlideDeSelected]=[],this.listeners[b.c.SlideSelected]=[],this.listeners[b.c.SlideInfoError]=[],this.listeners[b.c.Dropped]=[],this.filenameCallback=n.filenameCallback,this.additionalHtmlCallback=n.additionalHtmlCallback,this.multiSelect=!0===n.multiSelect,this.lazyLoadTimeOut=0,this.showFileName=!0===n.showFileName,this.barcodeRotation=n.barcodeRotation,this.context=e,this.thumbnailWidth=n.thumbnailWidth,this.thumbnailHeight=n.thumbnailHeight,this.lastLoadedImages=[],"horizontal"!==n.mode&&"vertical"!==n.mode&&"grid"!==n.mode&&(n.mode="horizontal"),this.renderOptions=n.renderOptions?n.renderOptions:b.d.All,!1===n.showBarcode&&(this.renderOptions=b.d.Thumbnail),this.mode=n.mode,Z()(this.element).addClass("pma-ui-gallery"),"vertical"===this.mode?Z()(this.element).addClass("vertical"):"grid"===this.mode&&Z()(this.element).addClass("grid"),nt.call(this,i.a.translate("No images found")),ut.call(this))}}return g()(t,[{key:"listen",value:function(t,e){this.listeners.hasOwnProperty(t)||console.error(t+" is not a valid event"),this.listeners[t].push(e)}},{key:"fireEvent",value:function(t,e){if(this.listeners.hasOwnProperty(t))for(var n=0,r=this.listeners[t].length;n<r;n++)this.listeners[t][n].call(this,e);else console.error(t+" does not exist")}},{key:"loadDirectory",value:function(t,e,n){this.ps&&this.ps.destroy();var r=this;this.lastLoadedImages=[],this.context.getSlides({serverUrl:t,path:e,success:function(e,i){r.lastLoadedImages=[{serverUrl:t,sessionId:e,images:i}],rt.call(r,t,e,i,n)},failure:function(n){r.element.innerHTML=n.Message,r.fireEvent(b.c.SlideInfoError,{serverUrl:t,path:e,message:n.Message})}})}},{key:"loadSlides",value:function(t,e){if("string"!=typeof t){this.ps&&this.ps.destroy();var n={},r=[],i=this;if(t&&0!=t.length){for(var o=0;o<t.length;o++)t[o].serverUrl&&(n.hasOwnProperty(t[o].serverUrl)||(n[t[o].serverUrl]=[],r.push(t[o].serverUrl)),n[t[o].serverUrl].push({path:t[o].path,rotation:t[o].rotation}));i.lastLoadedImages=[];var a=0,s=function(t,e,n,r,o,a){n.context.getSession(t,(function(s){i.lastLoadedImages.push({serverUrl:t,sessionId:s,images:e}),rt.call(n,t,s,e,(function(){a&&"function"==typeof r&&r()}),0!=o)}))};for(o=0;o<r.length;o++)s(r[o],n[r[o]],i,e,a,++a>=r.length)}else rt.call(this,"","",[],e)}else ot.call(this,arguments[0],arguments[1],arguments[2])}},{key:"selectSlide",value:function(t){if(null!=t){var e=Z()(this.element).find("ul li:nth-child("+(t+1)+") a")[0];et.call(this,e,!1)}else Z()(this.element).find("ul li").removeClass("selected")}},{key:"highlightSlide",value:function(t,e){if(null!=t){var n=Z()(this.element).find("ul li:nth-child("+(t+1)+") a");!0===e?n.parent().addClass("selected"):n.parent().removeClass("selected")}else Z()(this.element).find("ul li").removeClass("selected")}},{key:"getSelectedSlide",value:function(){var t=Z()(this.element).find("ul li.selected a:first-child");return 0===t.length?null:{server:t.data("server"),path:t.data("path"),index:t.parent().index()}}},{key:"getSelectedSlides",value:function(){var t=Z()(this.element).find("ul li.selected a:first-child");if(0===t.length)return null;var e=[];return t.each((function(){e.push({server:Z()(this).data("server"),path:Z()(this).data("path"),index:Z()(this).parent().index()})})),e}},{key:"getSlides",value:function(){var t=Z()(this.element).find("ul li a:first-child");if(0===t.length)return null;var e=[];return t.each((function(){e.push({server:Z()(this).data("server"),path:Z()(this).data("path")})})),e}},{key:"setRenderOptions",value:function(t){t&&this.renderOptions!=t&&(this.renderOptions=t,at.call(this))}},{key:"setMode",value:function(t){this.mode!==t&&(this.mode=t,Z()(this.element).removeClass("vertical grid"),"vertical"===this.mode?Z()(this.element).addClass("vertical"):"grid"===this.mode&&Z()(this.element).addClass("grid"),at.call(this))}}]),t}(),pt=(n(256),n(257),n(258),n(259),n(222)),dt=n(221);function ft(t,e){for(var n=0;n<t.length;n++)if(t[n]==e)return!0;return!1}var gt=function(){function t(e,n){d()(this,t),Object(y.b)()&&(this.listeners={},this.listeners[b.c.FormSaved]=[],this.listeners[b.c.FormEditClick]=[],this.context=e)}return g()(t,[{key:"renderReadOnlyField",value:function(e,n,r){var o=(n&&n.FormValue?n.FormValue:"").replace(/"/g,""");0!==o.length&&n&&e.FieldType!=t.FieldType.CheckBox&&e.FormList&&e.FormList.FormListValues&&!n.IsOtherValue&&!n.IsBelowDetectableLimit&&(o=e.FormList.FormListValues[o].Value),n&&n.IsBelowDetectableLimit&&(o=i.a.translate("Below detectable limit"));var a="";switch(e.FieldType){case t.FieldType.Paragraph:a+='<p class="'+r+'">'+o+"</p>";break;case t.FieldType.CheckBox:if(e.FormList&&e.FormList.FormListValues&&n&&!n.IsOtherValue&&0!==o.length&&!n.IsBelowDetectableLimit){var s=o.split("|");for(a+='<ul class="'+r+'">',k=0;k<s.length;k++)a+="<li>"+e.FormList.FormListValues[s[k]].Value+"</li>";a+="</ul>"}else a+='<div class="'+r+'">'+o+"</div>";break;case t.FieldType.Percentage:a+='<div class="'+r+'">'+o+"%</div>";break;case t.FieldType.HyperLink:a+='<a class="link-field" title="'+e.Tooltip+'" href="'+e.Url+'" '+(!0===e.NewWindow?' target="_blank" ':"")+">"+e.Label+"</a>";break;case t.FieldType.Label:break;default:a+='<div class="'+r+'">'+o+"</div>"}return a}},{key:"getForm",value:function(t,e,n,r,i){var o=this;o.context.getSession(t,(function(a){Object(b.h)({serverUrl:t,method:b.a.GetForm,data:{sessionID:a,id:e},success:function(e){var s=Object(b.o)(e.responseText);s?null!=n&&"object"===_()(n)?Pt.call(o,t,a,s,n.path,!0===n.currentUserOnly,n.dataFilter,(function(t){s.FormData=t,"function"==typeof r&&r.call(o,s,t)}),i):"function"==typeof r&&r.call(o,s,null):"function"==typeof i&&i()},failure:i})}),i)}},{key:"getForms",value:function(t,e,n){this.context.getSession(t,(function(r){Object(b.h)({serverUrl:t,method:b.a.GetForms,data:{sessionID:r},success:function(t){var r=Object(b.o)(t.responseText);r&&"function"==typeof e?e(r):"function"==typeof n&&n(r)},failure:n})}),n)}},{key:"displayForm",value:function(t,e,n,r,i,o){var a=this;this.getForm(t,e,r,(function(e,s){a.serverUrl=t,e&&(a.form=e,a.form.enabled=!0,!0===e.ReadOnly&&(r.readOnly=!0)),a.path=r.path,a.originalData=s,Lt.call(a,n,e,r,s,i,o)}),o)}},{key:"renderForm",value:function(t,e,n,r,i,o){e&&(this.form=e,this.form.enabled=!0,!0===e.ReadOnly&&(n.readOnly=!0)),this.path=n.path,this.originalData=r,Lt.call(this,t,e,n,r,i,o)}},{key:"saveForm",value:function(t,e){var n=this;n.setEnabled(!1),$("#"+n.form.ClientID+" button[type='submit']").html(i.a.translate("Saving...")),vt.call(this,(function(e){$("#"+n.form.ClientID+" button[type='submit']").html(i.a.translate("Save")),n.setEnabled(!0),n.fireEvent(b.c.FormSaved,e),"function"==typeof t&&t(e)}),(function(t){$("#"+n.form.ClientID+" button[type='submit']").html(i.a.translate("Save")),n.setEnabled(!0),n.fireEvent(b.c.FormSaved,t),"function"==typeof e&&e(t)}))}},{key:"setEnabled",value:function(t){this.form?(this.form.enabled=!!t,$("#"+this.form.ClientID+" > fieldset").prop("disabled",!this.form.enabled)):console.error("No form")}},{key:"getEnabled",value:function(){if(this.form)return this.form.enabled;console.error("No form")}},{key:"listen",value:function(t,e){this.listeners.hasOwnProperty(t)||console.error(t+" is not a valid event"),this.listeners[t].push(e)}},{key:"fireEvent",value:function(t,e){if(this.listeners.hasOwnProperty(t))for(var n=0,r=this.listeners[t].length;n<r;n++)this.listeners[t][n].call(this,e);else console.error(t+" does not exist")}},{key:"hasChanges",value:function(){return!!this.form&&this.hasChangesProperty}},{key:"reset",value:function(){if(!this.form)return!1;$("#"+this.form.ClientID+" [type='reset']").click()}}]),t}();function yt(t){var e="";return t.each((function(){e.length>0&&(e+="|"),e+=this.value})),e}function mt(t){for(var e=[],n=this.form,r=0;r<this.form.FormFields.length;r++){var i,o,a=n.FormFields[r],s=Ct(this.form,r),l=null,u=!1,c=!1;switch(a.FieldType){case gt.FieldType.Text:case gt.FieldType.Paragraph:case gt.FieldType.DateTime:""!==(i=$("#"+s)).val()&&(l=i.val());break;case gt.FieldType.Integer:case gt.FieldType.Double:case gt.FieldType.Percentage:""!==(i=$("#"+s)).val()?l=i.val():!0===a.AllowBelowDetectableLimit&&1===$("#"+s+"_below:checked").length&&(u=!0);break;case gt.FieldType.ListBox:""!==(i=$("#"+s)).val()?l=i.val():a.AllowOther&&""!==$("#"+s+"_other").val()&&(l=$("#"+s+"_other").val(),c=!0);break;case gt.FieldType.CheckBox:o=$("#"+s+"_other").val(),0!==(i=$("input[name='"+s+"']:checked")).length?l=yt(i):!0===a.AllowOther&&""!==o&&(l=o,c=!0);break;case gt.FieldType.RadioButton:o=$("#"+s+"_other").val(),0!==(i=$("input[name='"+s+"']:not([id$='_other_indicator']):checked")).length?l=i.val():!0===a.AllowOther&&""!==o&&(l=o,c=!0)}e.push({FieldId:a.FieldID,FormValue:l,IsBelowDetectableLimit:u,IsOtherValue:c})}return{sessionID:t,pathOrUid:this.path,formId:this.form.FormID,fieldValues:e}}function vt(t,e){if(bt.call(this)){var n=this;n.context.getSession(n.serverUrl,(function(r){var o=mt.call(n,r);Object(b.h)({serverUrl:n.serverUrl,method:b.a.SaveFormData,httpMethod:"POST",contentType:"application/json",data:o,success:function(e){n.hasChangesProperty=!1,"function"==typeof t&&t({success:!0,message:""})},failure:function(t){var r=i.a.translate("Save failed. Check the form values and try again.");if(t&&t.responseText){var o=JSON.parse(t.responseText);o&&o.Message&&(r=o.Message)}$("#"+n.form.ClientID+"_validation").html(r),"function"==typeof e&&e({success:!1,message:r})}})}),(function(t){"function"==typeof e&&e({success:!1,message:t&&t.Message?t.Message:i.a.translate("Authentication error")})}))}else"function"==typeof e&&e({success:!1,message:i.a.translate("Form validation error")})}function _t(){this.form&&($("#"+this.form.ClientID+" [id$='_validation']").html(""),$("#"+this.form.ClientID+" *").removeClass("invalid"))}function bt(){if(!this.form)return!1;_t.call(this);var t,e,n=this.form;$("#"+n.ClientID+"_validation").html("");for(var r=0;r<this.form.FormFields.length;r++){var o=n.FormFields[r],a=Ct(this.form,r),s=$("#"+a+"_validation");switch(s.html(""),o.FieldType){case gt.FieldType.Text:case gt.FieldType.Paragraph:case gt.FieldType.DateTime:if(t=$("#"+a),!0===o.Required&&""===t.val())return t.addClass("invalid"),t.focus(),s.html(i.a.translate("Please enter a value")),!1;t.removeClass("invalid");break;case gt.FieldType.Integer:case gt.FieldType.Double:case gt.FieldType.Percentage:if(t=$("#"+a),!0===o.Required&&""===t.val()&&(e=!1,!0===o.AllowBelowDetectableLimit&&1===$("#"+a+"_below:checked").length&&(e=!0),!e))return t.addClass("invalid"),t.focus(),s.html(i.a.translate("Please enter a value")),!1;var l=t.val();if(isNaN(l))return t.addClass("invalid"),t.focus(),s.html(i.a.translate("Please enter a valid value")),!1;if("number"!=typeof l&&(l=parseFloat(l)),"number"==typeof o.LowerBound&&l<o.LowerBound)return t.addClass("invalid"),t.focus(),s.html(i.a.translate("Please enter a value larger than or equal to {LowerBound}",{LowerBound:o.LowerBound})),!1;if("number"==typeof o.UpperBound&&l>o.UpperBound)return t.addClass("invalid"),t.focus(),s.html(i.a.translate("Please enter a value less than or equal to {UpperBound}",{UpperBound:o.UpperBound})),!1;t.removeClass("invalid");break;case gt.FieldType.ListBox:if(t=$("#"+a),!0===o.Required&&""===t.val()&&(e=!1,o.AllowOther&&""!==$("#"+a+"_other").val()&&(e=!0),!e))return t.addClass("invalid"),t.focus(),s.html(i.a.translate("Please select a value")),!1;t.removeClass("invalid");break;case gt.FieldType.CheckBox:case gt.FieldType.RadioButton:if(!0===o.Required&&0===$("input[name='"+a+"']:not([id$='_other_indicator']):checked").length&&(!0!==o.AllowOther||""===$("#"+a+"_other").val()))return $("input[name='"+a+"']").first().focus(),s.html(i.a.translate("Please select a value")),!1;break;case gt.FieldType.Label:case gt.FieldType.HyperLink:break;default:return console.error("Unknown field type "+o.FieldType),!1}}return!0}function wt(t,e){$("#"+e+"_below").change((function(){this.checked&&$("#"+e).val("")}))}function xt(t,e){$("#"+e).change((function(){""!==$(this).val()&&$("#"+e+"_below").prop("checked",!1)}))}function Et(t,e){$("#"+e+"_other").change((function(){""!==$(this).val()&&($("#"+e).val(""),$("input[name='"+e+"'").prop("checked",!1),$("#"+e+"_other_indicator").prop("checked",!0))}))}function St(t,e){$("input[name='"+e+"'], #"+e).change((function(){(this.checked||"SELECT"===this.tagName&&""!==this.value)&&$("#"+e+"_other").val("")}))}function Ot(){var t=this;$("#"+this.form.ClientID).submit((function(e){e.preventDefault(),t.saveForm()})).change((function(){t.hasChangesProperty=!0})),$("#"+this.form.ClientID+" legend .edit-button").click((function(e){e.preventDefault(),t.fireEvent(b.c.FormEditClick)})),$("#"+this.form.ClientID+" [type='reset']").click((function(e){_t.call(t),t.hasChangesProperty=!1,$("#"+t.form.ClientID+" select").val(""),$("#"+t.form.ClientID+" input[type='text']").val(""),$("#"+t.form.ClientID+" input[type='number']").val(""),$("#"+t.form.ClientID+" textarea").val(""),$("#"+t.form.ClientID+" input[type='checkbox'], #"+t.form.ClientID+" input[type='radio']").prop("checked",!1),e.preventDefault()}));for(var e=0;e<this.form.FormFields.length;e++){var n=Ct(this.form,e),r=this.form.FormFields[e];r.AllowBelowDetectableLimit&&(wt.call(t,r,n),xt.call(t,r,n)),r.AllowOther&&(Et.call(t,r,n),St.call(t,r,n))}}function Ct(t,e){return t.ClientID+"_field_"+t.FormFields[e].FieldID}function Tt(t){if(this.originalData){for(var e=0;e<this.originalData.length;e++){var n=this.originalData[e];if(n.FieldValues&&n.FieldValues.length)for(var r=0;r<n.FieldValues.length;r++){var i=n.FieldValues[r];if(i.FieldId===t)return i}}return null}}function It(t,e,n){var r,o,a=t.FormFields[e];a.Tooltip=a.Tooltip||"";var s=Ct(t,e),l=Tt.call(this,a.FieldID);if(l||(l={IsOtherValue:!1,IsBelowDetectableLimit:!1,FormValue:null}),"function"==typeof n.fieldCb&&!1===n.fieldCb(t,a,l))return"";var u="";a.ExtraStyle&&(u+=" "+a.ExtraStyle+" "),a.fieldGroupClass&&(u+=" "+a.fieldGroupClass+" ");var c=l&&l.FormValue?l.FormValue:"",h='<div class="form-group '+(!0===a.Required?"required":"")+" "+u+'" title="'+a.Tooltip+'">';a.FieldType!==gt.FieldType.HyperLink&&(h+='<label for="'+s+'">'+a.Label+"</label>"),h+="<div class='field-container "+(n.fieldContainerClass?n.fieldContainerClass:"")+" "+(a.fieldContainerClass?a.fieldContainerClass:"")+" '>";var p="";!0===a.Required&&(p=' required="required" ');var d="";if(n.inputClass&&(d+=" "+n.inputClass+" "),a.fieldClass&&(d+=" "+a.fieldClass+" "),a.FieldType===gt.FieldType.DateTime&&console.warn("PMA.UI.Components.Forms: No proper date time field support yet."),!0===n.readOnly)h+=this.renderReadOnlyField(a,l,d);else{switch(a.FieldType){case gt.FieldType.Text:h+='<input id="'+s+'" name="'+s+'" value="'+c+'" type="text" placeholder="'+a.Tooltip+'" '+p+' class="'+d+'" />';break;case gt.FieldType.DateTime:h+='<input id="'+s+'" name="'+s+'" value="'+c+'" type="text" placeholder="yyyy-MM-dd HH:mm:ss" '+p+' class="'+d+'" />';break;case gt.FieldType.Paragraph:h+='<textarea id="'+s+'" name="'+s+'" placeholder="'+a.Tooltip+'"'+p+' class="'+d+'">'+c+"</textarea>";break;case gt.FieldType.ListBox:if(h+='<select id="'+s+'" name="'+s+'" class="'+d+'">',a.FormList&&a.FormList.FormListValues)for(h+='<option value="" '+(0===c.length?'selected="selected"':"")+">"+a.Tooltip+"</option>",r=a.FormList.FormListValues,o=0;o<r.length;o++)h+='<option value="'+r[o].ValueID+'" '+(0!==c.length&&r[o].ValueID==c?'selected="selected"':"")+">"+r[o].Value+"</option>";h+="</select>";break;case gt.FieldType.CheckBox:h+='<ul class="checkboxlist">';var f=c.split("|");if(a.FormList&&a.FormList.FormListValues)for(r=a.FormList.FormListValues,o=0;o<r.length;o++)h+="<li>",h+='<input type="checkbox" class="'+d+'" id="'+s+"_"+r[o].ValueID+'" name="'+s+'" value="'+r[o].ValueID+'" '+(ft(f,""+r[o].ValueID)?'checked="checked"':"")+"/>",h+='<label for="'+s+"_"+r[o].ValueID+'">'+r[o].Value+"</label>",h+="</li>";h+="</ul>";break;case gt.FieldType.RadioButton:if(h+='<ul class="radiobuttonlist">',a.FormList&&a.FormList.FormListValues){for(r=a.FormList.FormListValues,o=0;o<r.length;o++)h+="<li>",h+='<input type="radio" class="'+d+'" id="'+s+"_"+r[o].ValueID+'" name="'+s+'" value="'+r[o].ValueID+'" '+(""!==c&&r[o].ValueID==c?'checked="checked"':"")+" />",h+='<label for="'+s+"_"+r[o].ValueID+'">'+r[o].Value+"</label>",h+="</li>";!0===a.AllowOther&&(h+="<li>",h+='<input type="radio" class="'+d+'" id="'+s+'_other_indicator" name="'+s+'" '+(l&&l.IsOtherValue?'checked="checked"':"")+' value="other" />',h+='<label for="'+s+'_other_indicator">'+i.a.translate("Other value")+"</label>",h+="</li>")}h+="</ul>";break;case gt.FieldType.Integer:var g=1;a.Interval&&(g=0|a.Interval),h+='<input id="'+s+'" name="'+s+'"'+p+" "+(null!==a.LowerBound?'min="'+a.LowerBound+'"':"")+" "+(null!==a.UpperBound?'max="'+a.UpperBound+'"':"")+' type="number" step="'+g+'" value="'+c+'" placeholder="'+a.Tooltip+'" class="'+d+'"/>';break;case gt.FieldType.Double:h+='<input id="'+s+'" name="'+s+'"'+p+" "+(null!==a.LowerBound?'min="'+a.LowerBound+'"':"")+" "+(null!==a.UpperBound?'max="'+a.UpperBound+'"':"")+' type="number" step="'+(a.Interval?a.Interval:"any")+'" value="'+c+'" placeholder="'+a.Tooltip+'" class="'+d+'" />';break;case gt.FieldType.Percentage:var y=0,m=100;null!==a.LowerBound&&(0|a.LowerBound)>=0&&(y=0|a.LowerBound),null!==a.UpperBound&&(0|a.UpperBound)<=0&&(m=0|a.UpperBound),h+='<input id="'+s+'" name="'+s+'"'+p+' min="'+y+'" max="'+m+'" type="number" step="'+(a.Interval?a.Interval:"any")+'" value="'+c+'" placeholder="'+a.Tooltip+'" class="'+d+'" />';break;case gt.FieldType.Label:break;case gt.FieldType.HyperLink:h+='<a class="link-field" id="'+s+'" title="'+a.Tooltip+'" href="'+a.Url+'" '+(!0===a.NewWindow?' target="_blank" ':"")+">"+a.Label+"</a>"}!0===a.AllowBelowDetectableLimit&&(h+='<div class="below-container">',h+='<input id="'+s+'_below" name="'+s+'_below" type="checkbox" '+(l&&!0===l.IsBelowDetectableLimit?'checked="checked"':"")+' value="below" />',h+='<label for="'+s+'_below">'+i.a.translate("Below detectable limit")+"</label>",h+="<div>"),!0===a.AllowOther&&(h+='<input id="'+s+'_other" class="other '+(n.inputClass?n.inputClass:"")+'" name="'+s+'_other" type="text" value="'+(""!==c&&l&&!0===l.IsOtherValue?c:"")+'" placeholder="'+i.a.translate("Other value")+'" />')}return h+='<span id="'+s+'_validation" class="field-validation '+(n.fieldValidationClass?n.fieldValidationClass:"")+'"></span>',a.additionalHtml&&(h+=a.additionalHtml),h+="</div></div>"}function Lt(t,e,n,r,o,a){this.form.ClientID="frm"+(1e7*Math.random()|0),this.hasChangesProperty=!1;var s="<form class='pma-ui-form "+(n.formClass?n.formClass:"")+"' name='"+e.ClientID+"' id='"+e.ClientID+"' autocomplete='off' novalidate><fieldset>";e.FormName&&(s+="<legend class='form-name'>"+e.FormName+(!0===n.editButton&&!0===n.readOnly?'<span class="edit-button">'+i.a.translate("[Edit]")+"</span>":"")+"</legend>"),e.Instructions&&(s+="<div class='form-instructions'>"+e.Instructions+"</div>"),e.FormFields.sort((function(t,e){return t.DisplayOrder-e.DisplayOrder}));for(var l=0;l<e.FormFields.length;l++)s+=It.call(this,e,l,n);s+="<div id='"+e.ClientID+"_validation' class='form-validation "+(n.validationClass?n.validationClass:"")+"'></div>",!0!==n.readOnly&&(s+="<div class='input-container "+(n.btnContainerClass?n.btnContainerClass:"")+"'>",s+="<button type='submit' value='"+i.a.translate("Save")+"' class='"+(n.btnSaveClass?n.btnSaveClass:"")+"' >"+i.a.translate("Save")+"</button>",s+="<button type='reset' value='"+i.a.translate("Reset")+"' class='"+(n.btnResetClass?n.btnResetClass:"")+"' >"+i.a.translate("Reset")+"</button>"),s+="</div>",s+="</fieldset></form>",$(t).html(s),Ot.call(this),"function"==typeof o&&o.call(this,this.form,null)}function Pt(t,e,n,r,i,o,a,s){var l=this;Object(b.h)({serverUrl:t,method:b.a.GetFormData,data:{sessionID:e,pathOrUid:r,formId:n.FormID,currentUserOnly:i},success:function(t){var e=Object(b.o)(t.responseText);if("function"==typeof a){var n=null;if("string"==typeof o){for(var r=0;r<e.length;r++)if(e[r].Login==o){n=[e[r]];break}}else n="function"==typeof o?o.call(l,e):e;a.call(l,n)}},failure:s})}gt.FieldType={Text:0,Paragraph:1,ListBox:2,CheckBox:3,RadioButton:4,Integer:5,Double:6,DateTime:7,Percentage:8,Label:9,HyperLink:10};var Rt=n(173),Mt=(n(233),n(234),n(235),"servernode"),Nt="formnode",jt="fieldnode",At="valuenode",kt="slidenode";function Ft(t,e){for(var n=[],r=0;r<t.length;r++){for(var i=t[r],o={title:i.FormName,type:Nt,lazy:!1,serverIndex:e,folder:!0,formId:i.FormID,children:[]},a=0;a<i.FormFields.length;a++){var s=i.FormFields[a];(this.showAllFields||null!=s.FormList)&&o.children.push({title:s.Label,type:jt,fieldId:s.FieldID,formId:i.FormID,formListValues:s.FormList?s.FormList.FormListValues:null,lazy:!0,serverIndex:e,folder:!0})}o.children.length>0&&n.push(o)}return n}function Dt(t,e){var n=new Z.a.Deferred;e.result=n.promise();var r=e.node,o=this,a=r.data.serverIndex;r.type==Mt?this.context.getFormDefinitions(o.servers[a].url,[],"",(function(t,e){var r=Ft.call(o,e,a);n.resolve(r)}),(function(t){n.reject(t.Message?t.Message:i.a.translate("Error loading forms"))})):r.type==jt?this.context.distinctValues({serverUrl:o.servers[a].url,formId:r.data.formId,fieldId:r.data.fieldId,success:function(t,e){for(var i=[],o=0;o<e.length;o++){var s=e[o];if(r.data.formListValues)for(var l=0;l<r.data.formListValues.length;l++)if(r.data.formListValues[l].ValueID==s){s=r.data.formListValues[l].Value;break}i.push({title:s,type:At,formId:r.data.formId,fieldId:r.data.fieldId,value:e[o],lazy:!0,serverIndex:a,folder:!0})}n.resolve(i)},failure:function(t){n.reject(t.Message?t.Message:i.a.translate("Error loading field"))}}):r.type==At&&this.context.metadata({serverUrl:o.servers[a].url,expressions:[{FormID:r.data.formId,FieldID:r.data.fieldId,Operator:0,Value:r.data.value}],success:function(t,e){for(var i=[],o=0;o<e.length;o++){var s=e[o];i.push({title:s,type:kt,formId:r.data.formId,fieldId:r.data.fieldId,path:s,lazy:!1,serverIndex:a,folder:!1})}n.resolve(i)},failure:function(t){n.reject(t.Message?t.Message:i.a.translate("Error loading field"))}})}function Gt(t,e){t.version=e}var zt=function(){function t(e,n){if(d()(this,t),Object(y.b)()){if(n.element instanceof HTMLElement)this.element=element;else if("string"==typeof n.element){var r=document.querySelector(n.element);r?this.element=r:console.error("Invalid selector for element")}this.context=e,this.servers=n.servers||[];var i=this;this.autoExpand=!0===n.autoExpandNodes,this.lastSearchResults={},this.showAllFields=!0===n.showAllFields,this.listeners={},this.listeners[b.c.ValueExpanded]=[],this.listeners[b.c.SlideSelected]=[],"function"==typeof n.rootDirSortCb&&(this.rootDirSortCb=n.rootDirSortCb);for(var o=[],a=0;a<this.servers.length;a++)o.push({title:this.servers[a].name,type:Mt,serverNode:!0,key:this.servers[a].url,serverIndex:a,extraClasses:"server",dirPath:"/",lazy:!0,unselectableStatus:!1,unselectable:!0,selected:!1}),this.context.getVersionInfo(this.servers[a].url,Gt.bind(this,this.servers[a]));Object(Rt.createTree)(this.element,{keyPathSeparator:"?",extensions:[],selectMode:3,toggleEffect:{effect:"drop",options:{direction:"left"},duration:400},wide:{iconWidth:"1em",iconSpacing:"0.5em",levelOfs:"1.5em"},icon:function(t,e){switch(e.node.type){case Mt:return"server";case Nt:return"fa fa-table";case kt:return"image";case jt:return"fa fa-tag";case At:return"fa fa-code";default:return"fa fa-table"}},renderNode:"function"==typeof n.renderNode?n.renderNode:null,source:o,lazyLoad:Dt.bind(this),activate:function(t,e){var n=e.node;!0===i.autoExpand&&n.setExpanded(!0),n.type==kt&&i.fireEvent(b.c.SlideSelected,{serverUrl:i.servers[n.data.serverIndex].url,path:n.data.path})},select:function(t,e){e.tree.getSelectedNodes()},expand:function(t,e){var n=e.node;if(n.type==At){var r=[];if(n.children&&n.children.length>0)for(var o=0;o<n.children.length;o++)r.push(n.children[o].data.path);i.fireEvent(b.c.ValueExpanded,{serverUrl:i.servers[n.data.serverIndex].url,slides:r})}},dblclick:function(t,e){e.node}})}}return g()(t,[{key:"addServer",value:function(t){if(t){this.servers.push(t);var e={title:this.servers[this.servers.length-1].name,serverNode:!0,key:this.servers[this.servers.length-1].url,serverIndex:this.servers.length-1,extraClasses:"server",dirPath:"/",lazy:!0,unselectableStatus:!1,unselectable:!0,selected:!1};this.context.getVersionInfo(t.url,Gt.bind(this,t)),Z()(this.element).fancytree("getRootNode").addChildren(e)}}},{key:"removeServer",value:function(t){var e=Z()(this.element).fancytree("getRootNode").getChildren();e&&e.length&&t>=0&&t<e.length?e[t].remove():console.error("No children found or index out of range")}},{key:"listen",value:function(t,e){this.listeners.hasOwnProperty(t)||console.error(t+" is not a valid event"),this.listeners[t].push(e)}},{key:"fireEvent",value:function(t,e){if(this.listeners.hasOwnProperty(t))for(var n=0,r=this.listeners[t].length;n<r;n++)this.listeners[t][n].call(this,e);else console.error(t+" does not exist")}}]),t}(),Ut=function(){function t(e,n){if(d()(this,t),Object(y.b)()){if(n||(n={}),this.context=e,this.servers={},this.currentFocus=null,this.searchTimeout=0,n.element instanceof HTMLElement)this.element=n.element;else if("string"==typeof n.element){var r=document.querySelector(n.element);r?this.element=r:console.error("Invalid selector for element")}else this.element=null;this.listeners={},this.listeners[b.c.SearchStarted]=[],this.listeners[b.c.SearchFinished]=[],this.options=n,this.query="",this.position=0,this.element&&we.call(this),this.retries={}}}return g()(t,[{key:"listen",value:function(t,e){this.listeners.hasOwnProperty(t)||console.error(t+" is not a valid event"),this.listeners[t].push(e)}},{key:"fireEvent",value:function(t,e){if(this.listeners.hasOwnProperty(t))for(var n=0,r=this.listeners[t].length;n<r;n++)this.listeners[t][n].call(this,e);else console.error(t+" does not exist")}},{key:"search",value:function(t,e){var n=this,r=(new Date).getTime();return n.searchToken=r,n.retries.hasOwnProperty(t)&&n.retries[t]>2?Promise.reject():Zt.call(this,t).then((function(){return n.retries[t]=0,te.call(n,e)}),(function(){n.retries[t]=(n.retries[t]||0)+1})).then((function(e){return 0===e.expressions.length?ue.call(n,t,e):ae.call(n,t,e)})).then((function(e){if(!e||n.searchToken!==r)return null;for(var i={sessionID:n.servers[t].sessionId,expressions:[]},o=0;o<e.expressions.length;o++){var a=e.expressions[o];if(ie.call(n,a)){var s=se.call(n,t,a[0].value);if(s){var l=le.call(n,s,a[1].value);l&&i.expressions.push({FormID:s.FormID,FieldID:l.FieldID,Operator:0,Value:l.FormList?pe(l.FormList.FormListValues,a[3].value):a[3].value})}}}if(n.searchToken===r){if(0===i.expressions.length)return{serverUrl:t,query:e,results:[]};var u=JSON.stringify(i);return n.lastSearchTerms==u?{serverUrl:t,query:e,results:n.lastSearchResults.slice()}:(n.lastSearchTerms="",n.lastSearchResults=[],Jt.call(n,t,e,i,r))}}))}}]),t}(),Bt="literal",Vt="equal to",qt="greater than",Yt="greater than or equal to",Xt="less than",Wt="less than or equal to",Ht="different than",Kt="similar to";function Zt(t){var e=this;return e.inputBox&&(e.inputBox.readonly=!0),new Promise((function(n,r){e.context.getVersionInfo(t,(function(i){i&&!i.startsWith("1.")?e.context.getSession(t,(function(i){e.servers[t]=e.servers[t]||{},e.servers[t].sessionId=i,$t.call(e,t,(function(){e.inputBox&&(e.inputBox.readonly=!1),n(i)}),r)}),r):r()}),r)}))}function $t(t,e,n){if(this.servers[t].forms)e();else{var r=this;this.context.getFormDefinitions(t,[],"",(function(n,i){r.servers[t].forms=i,r.servers[t].forms.push({FormID:-1,FormName:"Slide",FormFields:[{FieldID:0,Label:"Path"},{FieldID:1,Label:"Barcode"}]}),e()}),n)}}function Jt(t,e,n,r){var i=this;clearTimeout(i.searchTimeout);var o=JSON.stringify(n),a=n.expressions.filter((function(t){return-1===t.FormID&&0===t.FieldID})),s=a.length>0&&a.length===n.expressions.length,l=n;return new Promise((function(n){i.searchTimeout=setTimeout((function(){i.fireEvent(b.c.SearchStarted,{serverUrl:t,queryString:e.getText()}),s?Qt.call(i,t,a).then((function(a){var s=[];a instanceof Array&&(s=a),i.searchToken===r&&(i.lastSearchTerms=o,i.lastSearchResults=s,i.fireEvent(b.c.SearchFinished,s),n({serverUrl:t,query:e,results:s}))})):fetch(t+"query/json/Metadata",{method:"POST",mode:"cors",credentials:"same-origin",headers:{"Content-Type":"application/json; charset=utf-8"},body:JSON.stringify(l)}).then((function(t){return t.ok?t.json():[]})).then((function(a){i.searchToken===r&&(i.lastSearchTerms=o,i.lastSearchResults=a,i.fireEvent(b.c.SearchFinished,a),n({serverUrl:t,query:e,results:a}))}))}),1e3)}))}function Qt(t,e){var n=this;return e&&0!==e.length?new Promise((function(r,i){var o=e.map((function(t){return t.Value})).join("|");n.context.queryFilename(t,"",o,(function(t,e){r(e)}),i)})):Promise.resolve(null)}function te(t){if("string"!=typeof t)throw"Query must be a string";this.query=t,this.position=0;for(var e=[];ee.call(this);){ye.call(this);var n=_e.call(this);n&&e.push(n)}for(var r={getText:function(){if(!this.expressions||0===this.expressions.length)return"";for(var t="",e=0;e<this.expressions.length;e++){e>0&&(t+=",");for(var n=this.expressions[e],r=0;r<n.length;r++)t.length>0&&(t+=" "),n[r].quoted&&(t+='"'),t+=n[r].value,n[r].quoted&&(t+='"')}return t},getLastToken:function(){if(!this.expressions||0===this.expressions.length)return null;var t=this.expressions[this.expressions.length-1];return 0===t.length?null:t[t.length-1]},expressions:[],suggestions:[]},i=0;i<e.length;)i<=e.length-4&&e[i+0].type===Bt&&e[i+1].type===Bt&&e[i+2].operator&&e[i+3].type===Bt?(r.expressions.push([e[i+0],e[i+1],e[i+2],e[i+3]]),i+=4):i===e.length-3&&e[i+0].type===Bt&&e[i+1].type===Bt&&e[i+2].operator?(r.expressions.push([e[i+0],e[i+1],e[i+2]]),i+=3):i===e.length-2&&e[i+0].type===Bt&&e[i+1].type===Bt?(r.expressions.push([e[i+0],e[i+1]]),i+=2):e[i].type===Bt?(r.expressions.push([e[i]]),i++):i++;return new Promise((function(t,e){t(r)}))}function ee(){return this.position<this.query.length}function ne(){return ee.call(this)?this.query[this.position++]:""}function re(){return ee.call(this)?this.query[this.position]:""}function ie(t){return t&&4===t.length&&t[0].type===Bt&&t[1].type===Bt&&t[2].operator&&t[3].type===Bt}function oe(t){if(!t||!t.quoted&&ge.call(this,this.query[this.query.length-1]))return!0;if(t.quoted){var e=this.query.trimRight();if(e.length>=2&&'"'===e[e.length-1]&&"\\"===e[e.length-1])return!1;if('"'===e[e.length-1])return!0}return!1}function ae(t,e){var n=e.expressions[e.expressions.length-1];return 1===n.length?oe.call(this,n[0])?ce.call(this,t,e,n[0]):ue.call(this,t,e):2===n.length?oe.call(this,n[1])?he.call(this,e):ce.call(this,t,e,n[0]):3===n.length?oe.call(this,n[2])?de.call(this,t,e,n[0],n[1]):he.call(this,e):oe.call(this,n[3])?ue.call(this,t,e):de.call(this,t,e,n[0],n[1])}function se(t,e){return this.servers[t]&&this.servers[t].forms?this.servers[t].forms.find((function(t){return 0===t.FormName.localeCompare(e,{},{sensitivity:"base"})})):null}function le(t,e){return t?t.FormFields.find((function(t){return 0===t.Label.localeCompare(e,{},{sensitivity:"base"})})):null}function ue(t,e){return e.suggestions=this.servers[t].forms.map((function(t){return t.FormName})),new Promise((function(t,n){t(e)}))}function ce(t,e,n){var r=se.call(this,t,n.value);return r&&(e.suggestions=r.FormFields.map((function(t){return t.Label}))),new Promise((function(t,n){t(e)}))}function he(t){var e=this;return new Promise((function(n,r){t.suggestions=fe.call(e),n(t)}))}function pe(t,e){for(var n=0;n<t.length;n++)if(t[n].Value==e)return t[n].ValueID;return""}function de(t,e,n,r){var i=se.call(this,t,n.value);if(!i)return new Promise((function(t,n){t(e)}));var o=i.FormFields.find((function(t){return 0===t.Label.localeCompare(r.value,{},{sensitivity:"base"})}));return o?o.values?(e.suggestions=o.values,new Promise((function(t,n){t(e)}))):fetch(t+"query/json/DistinctValues?formID="+i.FormID+"&fieldID="+o.FieldID+"&sessionID="+this.servers[t].sessionId,{method:"GET",mode:"cors",credentials:"same-origin",headers:{"Content-Type":"application/json; charset=utf-8"}}).then((function(t){return t.ok?t.json():[]})).then((function(t){return o.FormList?o.values=function(t,e){var n,r,i=[];for(n=0;n<e.length;n++)for(r=0;r<t.length;r++)if(t[r].ValueID==e[n]){i.push(t[r].Value);break}return i}(o.FormList.FormListValues,t):o.values=t.map((function(t){return t+""})),e.suggestions=o.values,e})):new Promise((function(t,n){t(e)}))}function fe(){return["="]}function ge(t){return-1!==[" ",","].indexOf(t)}function ye(){for(;ge.call(this,re.call(this));)ne.call(this)}function me(t){return-1!==["=",">","<","~"].indexOf(t)}function ve(t){return!ge.call(this,t)&&!me.call(this,t)}function _e(){if(!ee.call(this))return null;var t=[],e=!1;if('"'===re.call(this))ne.call(this),e=!0;else if(me.call(this,re.call(this)))return be.call(this);for(;ee.call(this);){var n=ne.call(this);if(e){if("\\"===n&&'"'===re.call(this)){t.push(ne.call(this));continue}if('"'===n)break}else if(!ve.call(this,n)){this.position--;break}t.push(n)}return 0===t.length?null:{value:t.join(""),type:Bt,operator:!1,quoted:e}}function be(){for(var t=[];ee.call(this)&&me.call(this,re.call(this));)t.push(ne.call(this));if(0===t.length)return null;var e=t.join(""),n=Bt;switch(e){case"=":n=Vt;break;case"<>":n=Ht;break;case">":n=qt;break;case">=":n=Yt;break;case"<":n=Xt;break;case"<=":n=Wt;break;case"~=":n=Kt;break;default:throw"Unknown operator"}return{value:e,type:n,operator:!0,quoted:!1}}function we(){this.element.classList.add("pma-ui-meta-data-search"),this.inputBox=document.createElement("input",{type:"text",autocomplete:"off"}),this.element.appendChild(this.inputBox),this.inputBox.addEventListener("input",xe.bind(this)),this.inputBox.addEventListener("keydown",Se.bind(this)),this.inputBox.addEventListener("focus",xe.bind(this));var t=this;document.addEventListener("click",(function(e){Oe.call(t,e.target)})),new l.a({caller:""}).getVersionInfo(this.options.serverUrl,(function(t){null!=t&&t.startsWith("2")||(console.log(t),console.warn("Metadata search only works with PMA.core version 2.x. Version reported: "+t))}),(function(){console.warn("Cannot reach PMA.core server. Metadata search only works with PMA.core version 2.x.")}))}function xe(t){var e=this,n=e.inputBox.value;Oe.call(e),e.search(e.options.serverUrl,n).then((function(t){Ee.call(e,t.query)}),(function(){}))}function Ee(t){var e,n,r;(e=document.createElement("DIV")).setAttribute("class","autocomplete-items");var i=this;this.element.appendChild(e);var o,a=t.suggestions,s=t.getLastToken(),l="";function u(){var e=this.getElementsByTagName("input")[0].value;s&&!oe.call(i,s)?(s.value=e,s.quoted=-1!==s.value.indexOf(" "),i.inputBox.value=t.getText()):i.inputBox.value=t.getText()+" "+(-1!==e.indexOf(" ")?'"'+e+'"':e),i.search(i.options.serverUrl,i.inputBox.value),Oe.call(i)}for(s&&!oe.call(i,s)&&(l=s.value),r=0;r<a.length;r++){if(0===l.length)(n=document.createElement("DIV")).innerHTML=a[r];else{if(-1===(o=a[r].toUpperCase().indexOf(l.toUpperCase())))continue;(n=document.createElement("DIV")).innerHTML=a[r].substr(0,o),n.innerHTML+="<strong>"+a[r].substr(o,l.length)+"</strong>",n.innerHTML+=a[r].substr(o+l.length)}n.innerHTML+="<input type='hidden' value='"+a[r]+"'>",n.addEventListener("click",u),e.appendChild(n)}}function Se(t){var e=this.element.querySelectorAll(".autocomplete-items div");if(0!==e.length){var n=this.element.querySelector(".autocomplete-active"),r=-1;if(n){n.classList.remove("autocomplete-active");for(var i=0;i<e.length;i++)if(e[i]===n){r=i;break}}40==t.keyCode?e[r=++r>=e.length?0:r].classList.add("autocomplete-active"):38==t.keyCode?e[r=--r<0?e.length-1:r].classList.add("autocomplete-active"):13==t.keyCode?(t.preventDefault(),-1!==r&&e[r].click(),Oe.call(this)):27==t.keyCode&&Oe.call(this)}}function Oe(t){for(var e=document.getElementsByClassName("autocomplete-items"),n=0;n<e.length;n++)t!=e[n]&&t!=this.inputBox&&e[n].parentNode.removeChild(e[n])}var Ce=n(21),Te=function(){function t(e){if(d()(this,t),e.length){this.slideLoaders=e,this.eventsKeys=[],this.posSync=[],this.overridePosition=!1,this.listeners={},this.listeners[b.c.SyncChanged]=[];for(var n=0;n<this.slideLoaders.length;n++)this.slideLoaders[n].listen(b.c.BeforeSlideLoad,this.disableSync.bind(this))}else console.error("Expected array of PMA.UI.Components.SlideLoader")}return g()(t,[{key:"enableSync",value:function(){this.posSync=[];for(var t=0;t<this.slideLoaders.length;t++){var e=this.slideLoaders[t];if(e.mainViewport&&e.mainViewport.map){this.posSync.push(e.mainViewport.getPosition());var n={index:t,self:this,slideLoaders:this.slideLoaders};this.eventsKeys.push({viewport:e.mainViewport,callback:Le.bind(this,n)}),e.mainViewport.listen(a.g.ViewChanged,this.eventsKeys[this.eventsKeys.length-1].callback)}}this.fireEvent(b.c.SyncChanged,!0)}},{key:"disableSync",value:function(){if(this.eventsKeys)for(;this.eventsKeys.length>0;){var t=this.eventsKeys.pop();t.viewport.unlisten(a.g.ViewChanged,t.callback)}this.posSync=[],this.fireEvent(b.c.SyncChanged,!1)}},{key:"getStatus",value:function(){return this.eventsKeys&&this.eventsKeys.length>0}},{key:"listen",value:function(t,e){this.listeners.hasOwnProperty(t)||console.error(t+" is not a valid event"),this.listeners[t].push(e)}},{key:"fireEvent",value:function(t,e){if(this.listeners.hasOwnProperty(t))for(var n=0,r=this.listeners[t].length;n<r;n++)this.listeners[t][n].call(this,e);else console.error(t+" does not exist")}}]),t}(),Ie=!1;function Le(t){if(t&&!Ie){for(var e=t.self,n=t.slideLoaders[t.index],r=n.mainViewport.getFlip(),i=0;i<t.slideLoaders.length;i++)if(t.index!=i){var o=t.slideLoaders[i],a=o.mainViewport.getFlip();a.horizontally==r.horizontally&&a.vertically==r.vertically||o.mainViewport.setFlip(r.horizontally,r.vertically)}var s=n.mainViewport.getPosition(),l=e.posSync[t.index];if(isNaN(s.zoom))return;if(l){var u={zoom:s.zoom-l.zoom,rotation:s.rotation-l.rotation,center:[s.center[0]-l.center[0],s.center[1]-l.center[1]]};e.posSync[t.index]=s,l=e.posSync[t.index],Ie=!0;for(var c=0;c<t.slideLoaders.length;c++)if(c!=t.index){var h=e.posSync[c];if(h){if(h.zoom+=u.zoom,h.rotation+=u.rotation,h.rotation!=l.rotation){var p=Object(Ce.h)([u.center[0],u.center[1]],h.rotation-l.rotation);h.center[0]+=p[0],h.center[1]+=p[1]}else h.center[0]+=u.center[0],h.center[1]+=u.center[1];t.slideLoaders[c].mainViewport.setPosition(h,!0),t.slideLoaders[c].mainViewport.map.getView().dispatchEvent("change:center")}e.posSync[c]=h}Ie=!1}}}var Pe=n(171),Re=n(160),Me=n(208),Ne=n(205),je=n(209),Ae=n(207),ke=n(206),Fe=n(180),De=n(211),Ge=n(210),ze=n(212),Ue=n(46),Be=n(26),Ve=n(31),qe=n(22),Ye=n(41),Xe=n(122),We=n(99),He=n(59),Ke=n(61),Ze=n(66),$e=n(65),Je=n(172),Qe={getVersion:r.a,Resources:i.a,View:{Viewport:o.a,Themes:a.i,ButtonLocations:a.c,Events:a.g,ObjectiveResolutions:a.h,getThumbnailUrl:b.l,getBarcodeUrl:b.j,Controls:{RotationControl:Pe.a,Overview:Re.a,Filename:Me.a,PrevZoom:Ne.a,DimensionSelector:je.a,AssociatedImage:ke.a,Snapshot:Ae.a,PathomationAttribution:Fe.a,ColorAdjustment:De.a,LayerSwitch:Ge.a,Magnifier:ze.a}},Types:{Controls:a.d,Annotation:a.a,AnnotationState:a.b,MouseWheelZoomMode:Je.a},Components:{Tree:s.a,Context:l.a,Events:b.c,Annotations:pt.a,AnnotationState:a.b,GalleryRenderOptions:b.d,GetSlidesScope:b.e,Gallery:ht,SlideLoader:dt.a,Forms:gt,MetadataTree:zt,MetadataSearch:Ut,SyncView:Te,ApiMethods:b.a,getThumbnailUrl:b.l,login:b.m,getBarcodeUrl:b.j,getSnapshotUrl:b.k,parseDragData:b.n,formify:b.i,ajax:b.g,callApiMethod:b.h,DragDropMimeType:b.b},Authentication:{AutoLogin:u.a,PromptLogin:c.a,SessionLogin:h.a,CustomLogin:m},OpenLayers:{Observable:{unByKey:Ue.b},Feature:Be.a,Geom:{Point:Ve.a,Polygon:qe.a},Style:{Style:Ye.c,Icon:Xe.a,Text:We.a,Fill:He.a,Stroke:Ke.a},Source:{Vector:Ze.a},Layer:{Vector:$e.a}}}}]);
//# sourceMappingURL=pma.ui.js.map