>3}a--,1===o||2===o?(s+=t.readSVarint(),u+=t.readSVarint(),1===o&&l>h&&(n.push(l),h=l),r.push(s,u),l+=2):7===o?l>h&&(r.push(r[h],r[h+1]),l+=2):K(!1,59)}l>h&&(n.push(l),h=l)},e.prototype.createFeature_=function(t,e,r){var n,i=e.type;if(0===i)return null;var o,a=e.properties;this.idProperty_?(o=a[this.idProperty_],delete a[this.idProperty_]):o=e.id,a[this.layerName_]=e.layer.name;var s=[],u=[];this.readRawGeometry_(t,e,s,u);var l=function(t,e){var r;1===t?r=1===e?Nt.POINT:Nt.MULTI_POINT:2===t?r=1===e?Nt.LINE_STRING:Nt.MULTI_LINE_STRING:3===t&&(r=Nt.POLYGON);return r}(i,u.length);if(this.featureClass_===sv)(n=new this.featureClass_(l,s,u,a,o)).transform(r.dataProjection,r.featureProjection);else{var h=void 0;if(l==Nt.POLYGON){for(var c=[],p=0,f=0,d=0,_=u.length;d<_;++d){var g=u[d];Nr(s,p,g,2)||(c.push(u.slice(f,d)),f=d),p=g}h=c.length>1?new wf(s,At.XY,c):new Br(s,At.XY,u)}else h=l===Nt.POINT?new Or(s,At.XY):l===Nt.LINE_STRING?new Vp(s,At.XY):l===Nt.POLYGON?new Br(s,At.XY,u):l===Nt.MULTI_POINT?new Ef(s,At.XY):l===Nt.MULTI_LINE_STRING?new vf(s,At.XY,u):null;n=new(0,this.featureClass_),this.geometryName_&&n.setGeometryName(this.geometryName_);var y=_d(h,!1,r);n.setGeometry(y),n.setId(o),n.setProperties(a,!0)}return n},e.prototype.getType=function(){return rs.ARRAY_BUFFER},e.prototype.readFeatures=function(t,e){var r=this.layers_,n=this.adaptOptions(e),i=we(n.dataProjection);i.setWorldExtent(n.extent),n.dataProjection=i;var o=new iv.a(t),a=o.readFields(lv,{}),s=[];for(var u in a)if(!r||-1!=r.indexOf(u)){var l=a[u],h=l?[0,0,l.extent,l.extent]:null;i.setExtent(h);for(var c=0,p=l.length;c>1):i>>1}return e}(t),i=0,o=n.length;i=32;)e=63+(32|31&t),r+=String.fromCharCode(e),t>>=5;return e=t+63,r+=String.fromCharCode(e)}var Iv=function(t){function e(e){var r=t.call(this)||this,n=e||{};return r.dataProjection=we("EPSG:4326"),r.factor_=n.factor?n.factor:1e5,r.geometryLayout_=n.geometryLayout?n.geometryLayout:At.XY,r}return wv(e,t),e.prototype.readFeatureFromText=function(t,e){var r=this.readGeometryFromText(t,e);return new q(r)},e.prototype.readFeaturesFromText=function(t,e){return[this.readFeatureFromText(t,e)]},e.prototype.readGeometryFromText=function(t,e){var r=rr(this.geometryLayout_),n=Ov(t,r,this.factor_);Sv(n,0,n.length,r,n);var i=dr(n,0,n.length,r);return _d(new Vp(i,this.geometryLayout_),!1,this.adaptOptions(e))},e.prototype.writeFeatureText=function(t,e){var r=t.getGeometry();return r?this.writeGeometryText(r,e):(K(!1,40),"")},e.prototype.writeFeaturesText=function(t,e){return this.writeFeatureText(t[0],e)},e.prototype.writeGeometryText=function(t,e){var r=(t=_d(t,!0,this.adaptOptions(e))).getFlatCoordinates(),n=t.getStride();return Sv(r,0,r.length,n,r),xv(r,n,this.factor_)},e}(ng),bv=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Lv=function(t){function e(e){var r=t.call(this)||this,n=e||{};return r.layerName_=n.layerName,r.layers_=n.layers?n.layers:null,r.dataProjection=we(n.dataProjection?n.dataProjection:"EPSG:4326"),r}return bv(e,t),e.prototype.readFeaturesFromObject=function(t,e){if("Topology"==t.type){var r=t,n=void 0,i=null,o=null;r.transform&&(i=(n=r.transform).scale,o=n.translate);var a=r.arcs;n&&function(t,e,r){for(var n=0,i=t.length;n0&&i.pop(),n=r>=0?e[r]:e[~r].slice().reverse(),i.push.apply(i,n);for(var s=0,u=i.length;s=2,57),n}return Uv(e,t),e}(kv),Yv=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),zv=function(t){function e(e){return t.call(this,"And",Array.prototype.slice.call(arguments))||this}return Yv(e,t),e}(Bv),Xv=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Vv=function(t){function e(e,r,n){var i=t.call(this,"BBOX")||this;if(i.geometryName=e,i.extent=r,4!==r.length)throw new Error("Expected an extent with four values ([minX, minY, maxX, maxY])");return i.srsName=n,i}return Xv(e,t),e}(kv),Wv=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Zv=function(t){function e(e,r,n,i){var o=t.call(this,e)||this;return o.geometryName=r||"the_geom",o.geometry=n,o.srsName=i,o}return Wv(e,t),e}(kv),Kv=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Hv=function(t){function e(e,r,n){return t.call(this,"Contains",e,r,n)||this}return Kv(e,t),e}(Zv),qv=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Jv=function(t){function e(e,r){var n=t.call(this,e)||this;return n.propertyName=r,n}return qv(e,t),e}(kv),Qv=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),$v=function(t){function e(e,r,n){var i=t.call(this,"During",e)||this;return i.begin=r,i.end=n,i}return Qv(e,t),e}(Jv),tm=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),em=function(t){function e(e,r,n,i){var o=t.call(this,e,r)||this;return o.expression=n,o.matchCase=i,o}return tm(e,t),e}(Jv),rm=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),nm=function(t){function e(e,r,n){return t.call(this,"PropertyIsEqualTo",e,r,n)||this}return rm(e,t),e}(em),im=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),om=function(t){function e(e,r){return t.call(this,"PropertyIsGreaterThan",e,r)||this}return im(e,t),e}(em),am=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),sm=function(t){function e(e,r){return t.call(this,"PropertyIsGreaterThanOrEqualTo",e,r)||this}return am(e,t),e}(em),um=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),lm=function(t){function e(e,r,n){return t.call(this,"Intersects",e,r,n)||this}return um(e,t),e}(Zv),hm=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),cm=function(t){function e(e,r,n){var i=t.call(this,"PropertyIsBetween",e)||this;return i.lowerBoundary=r,i.upperBoundary=n,i}return hm(e,t),e}(Jv),pm=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),fm=function(t){function e(e,r,n,i,o,a){var s=t.call(this,"PropertyIsLike",e)||this;return s.pattern=r,s.wildCard=void 0!==n?n:"*",s.singleChar=void 0!==i?i:".",s.escapeChar=void 0!==o?o:"!",s.matchCase=a,s}return pm(e,t),e}(Jv),dm=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),_m=function(t){function e(e){return t.call(this,"PropertyIsNull",e)||this}return dm(e,t),e}(Jv),gm=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ym=function(t){function e(e,r){return t.call(this,"PropertyIsLessThan",e,r)||this}return gm(e,t),e}(em),vm=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),mm=function(t){function e(e,r){return t.call(this,"PropertyIsLessThanOrEqualTo",e,r)||this}return vm(e,t),e}(em),Em=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Tm=function(t){function e(e){var r=t.call(this,"Not")||this;return r.condition=e,r}return Em(e,t),e}(kv),Sm=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),wm=function(t){function e(e,r,n){return t.call(this,"PropertyIsNotEqualTo",e,r,n)||this}return Sm(e,t),e}(em),xm=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Om=function(t){function e(e){return t.call(this,"Or",Array.prototype.slice.call(arguments))||this}return xm(e,t),e}(Bv),Rm=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Cm=function(t){function e(e,r,n){return t.call(this,"Within",e,r,n)||this}return Rm(e,t),e}(Zv);function Pm(t){var e=[null].concat(Array.prototype.slice.call(arguments));return new(Function.prototype.bind.apply(zv,e))}function Im(t,e,r){return new Vv(t,e,r)}var bm=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Lm={"http://www.opengis.net/gml":{boundedBy:js(Ad.prototype.readGeometryElement,"bounds")}},Mm={"http://www.opengis.net/wfs":{totalInserted:js(Ud),totalUpdated:js(Ud),totalDeleted:js(Ud)}},Fm={"http://www.opengis.net/wfs":{TransactionSummary:js(function(t,e){return Ws({},Mm,t,e)},"transactionSummary"),InsertResults:js(function(t,e){return Ws([],Vm,t,e)},"insertIds")}},Am={"http://www.opengis.net/wfs":{PropertyName:ks(Wd)}},Nm={"http://www.opengis.net/wfs":{Insert:ks(function(t,e,r){var n=r[r.length-1],i=n.featureType,o=n.featureNS,a=n.gmlVersion,s=bs(o,i);t.appendChild(s),2===a?i_.prototype.writeFeatureElement(s,e,r):Jd.prototype.writeFeatureElement(s,e,r)}),Update:ks(function(t,e,r){var n=r[r.length-1];K(void 0!==e.getId(),27);var i=n.featureType,o=n.featurePrefix,a=n.featureNS,s=Zm(o,i),u=e.getGeometryName();t.setAttribute("typeName",s),t.setAttributeNS(Gm,"xmlns:"+o,a);var l=e.getId();if(void 0!==l){for(var h=e.getKeys(),c=[],p=0,f=h.length;p="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_(),r=this.index_,n=e;if("("==e)t=lE;else if(","==e)t=pE;else if(")"==e)t=hE;else if(this.isNumeric_(e)||"-"==e)t=cE,n=this.readNumber_();else if(this.isAlpha_(e))t=uE,n=this.readText_();else{if(this.isWhiteSpace_(e))return this.nextToken();if(""!==e)throw new Error("Unexpected character: "+e);t=fE}return{position:r,value:n,type:t}},t.prototype.readNumber_=function(){var t,e=this.index_,r=!1,n=!1;do{"."==t?r=!0:"e"!=t&&"E"!=t||(n=!0),t=this.nextChar_()}while(this.isNumeric_(t,r)||!n&&("e"==t||"E"==t)||n&&("-"==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}(),yE=function(){function t(t){this.lexer_=t,this.token_,this.layout_=At.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=At.XY,e=this.token_;if(this.isTokenType(uE)){var r=e.value;r===aE?t=At.XYZ:r===sE?t=At.XYM:"ZM"===r&&(t=At.XYZM),t!==At.XY&&this.consume_()}return t},t.prototype.parseGeometryCollectionText_=function(){if(this.match(lE)){var t=[];do{t.push(this.parseGeometry_())}while(this.match(pE));if(this.match(hE))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())},t.prototype.parsePointText_=function(){if(this.match(lE)){var t=this.parsePoint_();if(this.match(hE))return t}else if(this.isEmptyGeometry_())return null;throw new Error(this.formatErrorMessage_())},t.prototype.parseLineStringText_=function(){if(this.match(lE)){var t=this.parsePointList_();if(this.match(hE))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())},t.prototype.parsePolygonText_=function(){if(this.match(lE)){var t=this.parseLineStringTextList_();if(this.match(hE))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())},t.prototype.parseMultiPointText_=function(){if(this.match(lE)){var t=void 0;if(t=this.token_.type==lE?this.parsePointTextList_():this.parsePointList_(),this.match(hE))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())},t.prototype.parseMultiLineStringText_=function(){if(this.match(lE)){var t=this.parseLineStringTextList_();if(this.match(hE))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())},t.prototype.parseMultiPolygonText_=function(){if(this.match(lE)){var t=this.parsePolygonTextList_();if(this.match(hE))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())},t.prototype.parsePoint_=function(){for(var t=[],e=this.layout_.length,r=0;r0&&(e+=" "+n)}return 0===r.length?e+" "+oE:e+"("+r+")"}var xE=vE,OE="http://www.w3.org/1999/xlink";function RE(t){return t.getAttributeNS(OE,"href")}var CE=function(){function t(){}return t.prototype.read=function(t){if(t){if("string"==typeof t){var e=Fs(t);return this.readFromDocument(e)}return Ms(t)?this.readFromDocument(t):this.readFromNode(t)}return null},t.prototype.readFromDocument=function(t){},t.prototype.readFromNode=function(t){},t}(),PE=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),IE=[null,"http://www.opengis.net/wms"],bE=Xs(IE,{Service:js(function(t,e){return Ws({},FE,t,e)}),Capability:js(function(t,e){return Ws({},LE,t,e)})}),LE=Xs(IE,{Request:js(function(t,e){return Ws({},BE,t,e)}),Exception:js(function(t,e){return Ws([],GE,t,e)}),Layer:js(function(t,e){return Ws({},jE,t,e)})}),ME=function(t){function e(){var e=t.call(this)||this;return e.version=void 0,e}return PE(e,t),e.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},e.prototype.readFromNode=function(t){this.version=t.getAttribute("version").trim();var e=Ws({version:this.version},bE,t,[]);return e||null},e}(CE),FE=Xs(IE,{Name:js(Yd),Title:js(Yd),Abstract:js(Yd),KeywordList:js(JE),OnlineResource:js(RE),ContactInformation:js(function(t,e){return Ws({},AE,t,e)}),Fees:js(Yd),AccessConstraints:js(Yd),LayerLimit:js(Ud),MaxWidth:js(Ud),MaxHeight:js(Ud)}),AE=Xs(IE,{ContactPersonPrimary:js(function(t,e){return Ws({},NE,t,e)}),ContactPosition:js(Yd),ContactAddress:js(function(t,e){return Ws({},DE,t,e)}),ContactVoiceTelephone:js(Yd),ContactFacsimileTelephone:js(Yd),ContactElectronicMailAddress:js(Yd)}),NE=Xs(IE,{ContactPerson:js(Yd),ContactOrganization:js(Yd)}),DE=Xs(IE,{AddressType:js(Yd),Address:js(Yd),City:js(Yd),StateOrProvince:js(Yd),PostCode:js(Yd),Country:js(Yd)}),GE=Xs(IE,{Format:Ns(Yd)}),jE=Xs(IE,{Name:js(Yd),Title:js(Yd),Abstract:js(Yd),KeywordList:js(JE),CRS:Gs(Yd),EX_GeographicBoundingBox:js(function(t,e){var r=Ws({},UE,t,e);if(!r)return;var n=r.westBoundLongitude,i=r.southBoundLatitude,o=r.eastBoundLongitude,a=r.northBoundLatitude;if(void 0===n||void 0===i||void 0===o||void 0===a)return;return[n,i,o,a]}),BoundingBox:Gs(function(t,e){var r=[kd(t.getAttribute("minx")),kd(t.getAttribute("miny")),kd(t.getAttribute("maxx")),kd(t.getAttribute("maxy"))],n=[kd(t.getAttribute("resx")),kd(t.getAttribute("resy"))];return{crs:t.getAttribute("CRS"),extent:r,res:n}}),Dimension:Gs(function(t,e){return{name:t.getAttribute("name"),units:t.getAttribute("units"),unitSymbol:t.getAttribute("unitSymbol"),default:t.getAttribute("default"),multipleValues:Dd(t.getAttribute("multipleValues")),nearestValue:Dd(t.getAttribute("nearestValue")),current:Dd(t.getAttribute("current")),values:Yd(t)}}),Attribution:js(function(t,e){return Ws({},kE,t,e)}),AuthorityURL:Gs(function(t,e){var r=KE(t,e);if(r)return r.name=t.getAttribute("name"),r;return}),Identifier:Gs(Yd),MetadataURL:Gs(function(t,e){var r=KE(t,e);if(r)return r.type=t.getAttribute("type"),r;return}),DataURL:Gs(KE),FeatureListURL:Gs(KE),Style:Gs(function(t,e){return Ws({},VE,t,e)}),MinScaleDenominator:js(jd),MaxScaleDenominator:js(jd),Layer:Gs(function(t,e){var r=e[e.length-1],n=Ws({},jE,t,e);if(!n)return;var i=Dd(t.getAttribute("queryable"));void 0===i&&(i=r.queryable);n.queryable=void 0!==i&&i;var o=Bd(t.getAttribute("cascaded"));void 0===o&&(o=r.cascaded);n.cascaded=o;var a=Dd(t.getAttribute("opaque"));void 0===a&&(a=r.opaque);n.opaque=void 0!==a&&a;var s=Dd(t.getAttribute("noSubsets"));void 0===s&&(s=r.noSubsets);n.noSubsets=void 0!==s&&s;var u=kd(t.getAttribute("fixedWidth"));u||(u=r.fixedWidth);n.fixedWidth=u;var l=kd(t.getAttribute("fixedHeight"));l||(l=r.fixedHeight);n.fixedHeight=l,["Style","CRS","AuthorityURL"].forEach(function(t){if(t in r){var e=n[t]||[];n[t]=e.concat(r[t])}});return["EX_GeographicBoundingBox","BoundingBox","Dimension","Attribution","MinScaleDenominator","MaxScaleDenominator"].forEach(function(t){if(!(t in n)){var e=r[t];n[t]=e}}),n})}),kE=Xs(IE,{Title:js(Yd),OnlineResource:js(RE),LogoURL:js(qE)}),UE=Xs(IE,{westBoundLongitude:js(jd),eastBoundLongitude:js(jd),southBoundLatitude:js(jd),northBoundLatitude:js(jd)}),BE=Xs(IE,{GetCapabilities:js(HE),GetMap:js(HE),GetFeatureInfo:js(HE)}),YE=Xs(IE,{Format:Gs(Yd),DCPType:Gs(function(t,e){return Ws({},zE,t,e)})}),zE=Xs(IE,{HTTP:js(function(t,e){return Ws({},XE,t,e)})}),XE=Xs(IE,{Get:js(KE),Post:js(KE)}),VE=Xs(IE,{Name:js(Yd),Title:js(Yd),Abstract:js(Yd),LegendURL:Gs(qE),StyleSheetURL:js(KE),StyleURL:js(KE)}),WE=Xs(IE,{Format:js(Yd),OnlineResource:js(RE)}),ZE=Xs(IE,{Keyword:Ns(Yd)});function KE(t,e){return Ws({},WE,t,e)}function HE(t,e){return Ws({},YE,t,e)}function qE(t,e){var r=KE(t,e);if(r){var n=[Bd(t.getAttribute("width")),Bd(t.getAttribute("height"))];return r.size=n,r}}function JE(t,e){return Ws([],ZE,t,e)}var QE=ME,$E=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),tT=function(t){function e(e){var r=t.call(this)||this,n=e||{};return r.featureNS_="http://mapserver.gis.umn.edu/mapserver",r.gmlFormat_=new i_,r.layers_=n.layers?n.layers:null,r}return $E(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 r=t.localName,n=[];if(0===t.childNodes.length)return n;if("msGMLOutput"==r)for(var i=0,o=t.childNodes.length;i.75*h||l>.75*c?this.resetExtent_():it(o,n)||this.recenter_()}}},e.prototype.resetExtent_=function(){var t=this.getMap(),e=this.ovmap_,r=t.getSize(),n=t.getView().calculateExtentInternal(r),i=e.getView(),o=Math.log(7.5)/Math.LN2;Mt(n,1/(.1*Math.pow(2,o/2))),i.fitInternal(zr(n))},e.prototype.recenter_=function(){var t=this.getMap(),e=this.ovmap_,r=t.getView();e.getView().setCenterInternal(r.getCenterInternal())},e.prototype.updateBox_=function(){var t=this.getMap(),e=this.ovmap_;if(t.isRendered()&&e.isRendered()){var r=t.getSize(),n=t.getView(),i=e.getView(),o=this.rotateWithView_?0:-n.getRotation(),a=this.boxOverlay_,s=this.boxOverlay_.getElement(),u=n.getCenterInternal(),l=n.getResolution(),h=i.getResolution(),c=r[0]*l/h,p=r[1]*l/h;if(a.setPosition(u),s){s.style.width=c+"px",s.style.height=p+"px";var f="rotate("+o+"rad)";s.style.transform=f}}},e.prototype.handleClick_=function(t){t.preventDefault(),this.handleToggle_()},e.prototype.handleToggle_=function(){this.element.classList.toggle(Gi),this.collapsed_?pi(this.collapseLabel_,this.label_):pi(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_(),y(t,dn,function(t){this.updateBox_()},this)}},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}(Li),qT=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),JT="units",QT={DEGREES:"degrees",IMPERIAL:"imperial",NAUTICAL:"nautical",METRIC:"metric",US:"us"},$T=[1,2,5];function tS(t){var e=t.frameState;this.viewState_=e?e.viewState:null,this.updateElement_()}var eS=function(t){function e(e){var r=this,n=e||{},i=void 0!==n.className?n.className:n.bar?"ol-scale-bar":"ol-scale-line";return(r=t.call(this,{element:document.createElement("div"),render:n.render||tS,target:n.target})||this).innerElement_=document.createElement("div"),r.innerElement_.className=i+"-inner",r.element.className=i+" "+Ai,r.element.appendChild(r.innerElement_),r.viewState_=null,r.minWidth_=void 0!==n.minWidth?n.minWidth:64,r.renderedVisible_=!1,r.renderedWidth_=void 0,r.renderedHTML_="",r.addEventListener(Y(JT),r.handleUnitsChanged_),r.setUnits(n.units||QT.METRIC),r.scaleBar_=n.bar||!1,r.scaleBarSteps_=n.steps||4,r.scaleBarText_=n.text||!1,r}return qT(e,t),e.prototype.getUnits=function(){return this.get(JT)},e.prototype.handleUnitsChanged_=function(){this.updateElement_()},e.prototype.setUnits=function(t){this.set(JT,t)},e.prototype.updateElement_=function(){var t=this.viewState_;if(t){var e=t.center,r=t.projection,n=this.getUnits(),i=n==QT.DEGREES?te.DEGREES:te.METERS,o=xe(r,t.resolution,e,i),a=this.minWidth_*o,s="";if(n==QT.DEGREES){var u=$t[te.DEGREES];(a*=u)=this.minWidth_)break;++f}p=this.scaleBar_?this.createScaleBar(h,l,s):l.toFixed(c<0?-c:0)+" "+s,this.renderedHTML_!=p&&(this.innerElement_.innerHTML=p,this.renderedHTML_=p),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,r){for(var n="1 : "+Math.round(this.getScaleForResolution()).toLocaleString(),i=[],o=t/this.scaleBarSteps_,a="#ffffff",s=0;s'+this.createMarker("relative",s)+(s%2==0||2===this.scaleBarSteps_?this.createStepText(s,t,!1,e,r):"")+""),s===this.scaleBarSteps_-1&&i.push(this.createStepText(s+1,t,!0,e,r)),a="#ffffff"===a?"#000000":"#ffffff";return''+(this.scaleBarText_?'
'+n+"
":"")+i.join("")+"
"},e.prototype.createMarker=function(t,e){return''},e.prototype.createStepText=function(t,e,r,n,i){var o=(0===t?0:Math.round(n/this.scaleBarSteps_*t*100)/100)+(0===t?"":" "+i);return''+o+"
"},e.prototype.getScaleForResolution=function(){var t=this.getMap().getView().getResolution(),e=this.viewState_.projection.getMetersPerUnit();return parseFloat(t.toString())*e*39.37*(25.4/.28)},e}(Li),rS=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),nS={VERTICAL:0,HORIZONTAL:1};function iS(t){if(t.frameState){this.sliderInitialized_||this.initSlider_();var e=t.frameState.viewState.resolution;this.currentResolution_=e,this.setThumbPosition_(e)}}var oS=function(t){function e(e){var r=this,n=e||{};(r=t.call(this,{element:document.createElement("div"),render:n.render||iS})||this).dragListenerKeys_=[],r.currentResolution_=void 0,r.direction_=nS.VERTICAL,r.dragging_,r.heightLimit_=0,r.widthLimit_=0,r.startX_,r.startY_,r.thumbSize_=null,r.sliderInitialized_=!1,r.duration_=void 0!==n.duration?n.duration:200;var i=void 0!==n.className?n.className:"ol-zoomslider",o=document.createElement("button");o.setAttribute("type","button"),o.className=i+"-thumb "+Ai;var a=r.element;return a.setAttribute("touch-action","none"),a.className=i+" "+Ai+" "+Di,a.appendChild(o),a.addEventListener(cn.POINTERDOWN,r.handleDraggerStart_.bind(r),!1),a.addEventListener(cn.POINTERMOVE,r.handleDraggerDrag_.bind(r),!1),a.addEventListener(cn.POINTERUP,r.handleDraggerEnd_.bind(r),!1),a.addEventListener(N.CLICK,r.handleContainerClick_.bind(r),!1),o.addEventListener(N.CLICK,L,!1),r}return rS(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,r=t.offsetHeight,n=t.firstElementChild,i=getComputedStyle(n),o=n.offsetWidth+parseFloat(i.marginRight)+parseFloat(i.marginLeft),a=n.offsetHeight+parseFloat(i.marginTop)+parseFloat(i.marginBottom);this.thumbSize_=[o,a],e>r?(this.direction_=nS.HORIZONTAL,this.widthLimit_=e-o):(this.direction_=nS.VERTICAL,this.heightLimit_=r-a),this.sliderInitialized_=!0},e.prototype.handleContainerClick_=function(t){var e=this.getMap().getView(),r=this.getRelativePosition_(t.offsetX-this.thumbSize_[0]/2,t.offsetY-this.thumbSize_[1]/2),n=this.getResolutionForPosition_(r),i=e.getConstrainedZoom(e.getZoomForResolution(n));e.animateInternal({zoom:i,duration:this.duration_,easing:ei})},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 r=this.handleDraggerDrag_,n=this.handleDraggerEnd_;this.dragListenerKeys_.push(g(document,cn.POINTERMOVE,r,this),g(document,cn.POINTERUP,n,this))}}},e.prototype.handleDraggerDrag_=function(t){if(this.dragging_){var e=t.clientX-this.startX_,r=t.clientY-this.startY_,n=this.getRelativePosition_(e,r);this.currentResolution_=this.getResolutionForPosition_(n),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),this.dragListenerKeys_.length=0)},e.prototype.setThumbPosition_=function(t){var e=this.getPositionForResolution_(t),r=this.element.firstElementChild;this.direction_==nS.HORIZONTAL?r.style.left=this.widthLimit_*e+"px":r.style.top=this.heightLimit_*e+"px"},e.prototype.getRelativePosition_=function(t,e){return kt(this.direction_===nS.HORIZONTAL?t/this.widthLimit_:e/this.heightLimit_,0,1)},e.prototype.getResolutionForPosition_=function(t){return this.getMap().getView().getResolutionForValueFunction()(1-t)},e.prototype.getPositionForResolution_=function(t){return kt(1-this.getMap().getView().getValueForResolutionFunction()(t),0,1)},e}(Li),aS=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),sS=function(t){function e(e){var r=this,n=e||{};(r=t.call(this,{element:document.createElement("div"),target:n.target})||this).extent=n.extent?n.extent:null;var i=void 0!==n.className?n.className:"ol-zoom-extent",o=void 0!==n.label?n.label:"E",a=void 0!==n.tipLabel?n.tipLabel:"Fit to extent",s=document.createElement("button");s.setAttribute("type","button"),s.title=a,s.appendChild("string"==typeof o?document.createTextNode(o):o),s.addEventListener(N.CLICK,r.handleClick_.bind(r),!1);var u=i+" "+Ai+" "+Di,l=r.element;return l.className=u,l.appendChild(s),r}return aS(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(zr(e))},e}(Li),uS={array:{},color:{},colorlike:{},control:{},coordinate:{},easing:{},events:{}};uS.events.condition={},uS.extent={},uS.featureloader={},uS.format={},uS.format.filter={},uS.geom={},uS.has={},uS.interaction={},uS.layer={},uS.loadingstrategy={},uS.proj={},uS.proj.Units={},uS.proj.proj4={},uS.render={},uS.render.canvas={},uS.renderer={},uS.renderer.canvas={},uS.renderer.webgl={},uS.size={},uS.source={},uS.sphere={},uS.style={},uS.style.IconImageCache={},uS.tilegrid={},uS.util={},uS.webgl={},uS.xml={},uS.Collection=Z,uS.Feature=q,uS.Geolocation=Hr,uS.Kinetic=qr,uS.Map=Ja,uS.Object=z,uS.Observable=G,uS.Observable.unByKey=function(t){if(Array.isArray(t))for(var e=0,r=t.length;e180)&&(r[0]=Vt(n+180,360)-180),r},uS.proj.transform=Me,uS.proj.transformExtent=Fe,uS.render.VectorContext=fa,uS.render.canvas.labelCache=Ea,uS.render.getRenderPixel=function(t,e){var r=e.slice(0);return Ze(t.inversePixelTransform.slice(),r),r},uS.render.getVectorContext=function(t){var e,r=t.frameState,n=Ve(t.inversePixelTransform.slice(),r.coordinateToPixelTransform),i=Ba(r.viewState.resolution,r.pixelRatio),o=je();return o&&(e=be(o,r.viewState.projection)),new Na(t.context,r.pixelRatio,r.extent,n,r.viewState.rotation,i,e)},uS.render.toContext=function(t,e){var r=t.canvas,n=e||{},i=n.pixelRatio||an,o=n.size;o&&(r.width=o[0]*i,r.height=o[1]*i,r.style.width=o[0]+"px",r.style.height=o[1]+"px");var a=[0,0,r.width,r.height],s=Ke([1,0,0,1,0,0],i,i);return new Na(t,i,a,s,0)},uS.renderer.Composite=Ha,uS.renderer.canvas.ImageLayer=jh,uS.renderer.canvas.TileLayer=Zh,uS.renderer.canvas.VectorImageLayer=Ap,uS.renderer.canvas.VectorLayer=Mp,uS.renderer.canvas.VectorTileLayer=kp,uS.renderer.webgl.PointsLayer=Wc,uS.size.toSize=xi,uS.source.BingMaps=Ol,uS.source.CartoDB=Il,uS.source.Cluster=jl,uS.source.IIIF=Ql,uS.source.Image=sh,uS.source.ImageArcGISRest=hh,uS.source.ImageCanvas=dh,uS.source.ImageMapGuide=gh,uS.source.ImageStatic=vh,uS.source.ImageWMS=Rh,uS.source.OSM=Ih,uS.source.OSM.ATTRIBUTION=Ph,uS.source.Raster=oc,uS.source.Source=cl,uS.source.Stamen=hc,uS.source.Tile=_l,uS.source.TileArcGISRest=fc,uS.source.TileDebug=gc,uS.source.TileImage=wl,uS.source.TileJSON=vc,uS.source.TileWMS=Tc,uS.source.UTFGrid=xc,uS.source.Vector=Dl,uS.source.VectorTile=bc,uS.source.WMTS=Ac,uS.source.WMTS.optionsFromCapabilities=function(t,e){var r=O(t.Contents.Layer,function(t,r,n){return t.Identifier==e.layer});if(null===r)return null;var n,i=t.Contents.TileMatrixSet;(n=r.TileMatrixSetLink.length>1?C(r.TileMatrixSetLink,"projection"in e?function(t,r,n){var o=O(i,function(e){return e.Identifier==t.TileMatrixSet}).SupportedCRS,a=we(o.replace(/urn:ogc:def:crs:(\w+):(.*:)?(\w+)$/,"$1:$3"))||we(o),s=we(e.projection);return a&&s?Ie(a,s):o==e.projection}:function(t,r,n){return t.TileMatrixSet==e.matrixSet}):0)<0&&(n=0);var o=r.TileMatrixSetLink[n].TileMatrixSet,a=r.TileMatrixSetLink[n].TileMatrixSetLimits,s=r.Format[0];"format"in e&&(s=e.format),(n=C(r.Style,function(t,r,n){return"style"in e?t.Title==e.style:t.isDefault}))<0&&(n=0);var u=r.Style[n].Identifier,l={};"Dimension"in r&&r.Dimension.forEach(function(t,e,r){var n=t.Identifier,i=t.Default;void 0===i&&(i=t.Value[0]),l[n]=i});var h,c=O(t.Contents.TileMatrixSet,function(t,e,r){return t.Identifier==o}),p=c.SupportedCRS;if(p&&(h=we(p.replace(/urn:ogc:def:crs:(\w+):(.*:)?(\w+)$/,"$1:$3"))||we(p)),"projection"in e){var f=we(e.projection);f&&(h&&!Ie(f,h)||(h=f))}var d,_,g=r.WGS84BoundingBox;if(void 0!==g){var y=we("EPSG:4326").getExtent();_=g[0]==y[0]&&g[2]==y[2],d=Fe(g,"EPSG:4326",h);var v=h.getExtent();v&&(it(v,d)||(d=void 0))}var m=du(c,d,a),E=[],S=e.requestEncoding;if(S=void 0!==S?S:"","OperationsMetadata"in t&&"GetTile"in t.OperationsMetadata)for(var w=t.OperationsMetadata.GetTile.DCP.HTTP.Get,x=0,R=w.length;xe;){if(a-e>600){var o=a-e+1,s=r-e+1,l=Math.log(o),f=.5*Math.exp(2*l/3),u=.5*Math.sqrt(l*f*(o-f)/o)*(s-o/2<0?-1:1),m=Math.max(e,Math.floor(r-s*f/o+u)),c=Math.min(a,Math.floor(r+(o-s)*f/o+u));t(n,r,m,c,h)}var p=n[r],d=e,x=a;for(i(n,e,r),h(n[a],p)>0&&i(n,e,a);d0;)x--}0===h(n[e],p)?i(n,e,x):i(n,++x,a),x<=r&&(e=x+1),r<=x&&(a=x-1)}}(t,r,e||0,a||t.length-1,h||n)}function i(t,i,n){var r=t[i];t[i]=t[n],t[n]=r}function n(t,i){return ti?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 e(t,i,n){if(!n)return i.indexOf(t);for(var r=0;r=t.minX&&i.maxY>=t.minY}function p(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function d(i,n,r,e,a){for(var h=[n,r];h.length;)if(!((r=h.pop())-(n=h.pop())<=e)){var o=n+Math.ceil((r-n)/e/2)*e;t(i,o,n,r,a),h.push(n,o,o,r)}}return r.prototype.all=function(){return this._all(this.data,[])},r.prototype.search=function(t){var i=this.data,n=[];if(!c(t,i))return n;for(var r=this.toBBox,e=[];i;){for(var a=0;a=0&&e[i].children.length>this._maxEntries;)this._split(e,i),i--;this._adjustParentBBoxes(r,e,i)},r.prototype._split=function(t,i){var n=t[i],r=n.children.length,e=this._minEntries;this._chooseSplitAxis(n,e,r);var h=this._chooseSplitIndex(n,e,r),o=p(n.children.splice(h,n.children.length-h));o.height=n.height,o.leaf=n.leaf,a(n,this.toBBox),a(o,this.toBBox),i?t[i-1].children.push(o):this._splitRoot(n,o)},r.prototype._splitRoot=function(t,i){this.data=p([t,i]),this.data.height=t.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},r.prototype._chooseSplitIndex=function(t,i,n){for(var r,e,a,o,s,l,u,m=1/0,c=1/0,p=i;p<=n-i;p++){var d=h(t,0,p,this.toBBox),x=h(t,p,n,this.toBBox),v=(e=d,a=x,o=void 0,s=void 0,l=void 0,u=void 0,o=Math.max(e.minX,a.minX),s=Math.max(e.minY,a.minY),l=Math.min(e.maxX,a.maxX),u=Math.min(e.maxY,a.maxY),Math.max(0,l-o)*Math.max(0,u-s)),M=f(d)+f(x);v=i;c--){var p=t.children[c];o(s,t.leaf?e(p):p),l+=u(s)}return l},r.prototype._adjustParentBBoxes=function(t,i,n){for(var r=n;r>=0;r--)o(i[r],t)},r.prototype._condense=function(t){for(var i=t.length-1,n=void 0;i>=0;i--)0===t[i].children.length?i>0?(n=t[i-1].children).splice(n.indexOf(t[i]),1):this.clear():a(t[i],this.toBBox)},r});\n","/*!\n * PEP v0.5.3 | https://github.com/jquery/PEP\n * Copyright jQuery Foundation and other contributors | http://jquery.org/license\n */\n\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (global.PointerEventsPolyfill = factory());\n}(this, function () { 'use strict';\n\n /**\n * This is the constructor for new PointerEvents.\n *\n * New Pointer Events must be given a type, and an optional dictionary of\n * initialization properties.\n *\n * Due to certain platform requirements, events returned from the constructor\n * identify as MouseEvents.\n *\n * @constructor\n * @param {String} inType The type of the event to create.\n * @param {Object} [inDict] An optional dictionary of initial event properties.\n * @return {Event} A new PointerEvent of type `inType`, initialized with properties from `inDict`.\n */\n var MOUSE_PROPS = [\n 'bubbles',\n 'cancelable',\n 'view',\n 'screenX',\n 'screenY',\n 'clientX',\n 'clientY',\n 'ctrlKey',\n 'altKey',\n 'shiftKey',\n 'metaKey',\n 'button',\n 'relatedTarget',\n 'pageX',\n 'pageY'\n ];\n\n var MOUSE_DEFAULTS = [\n false,\n false,\n null,\n 0,\n 0,\n 0,\n 0,\n false,\n false,\n false,\n false,\n 0,\n null,\n 0,\n 0\n ];\n\n function PointerEvent(inType, inDict) {\n inDict = inDict || Object.create(null);\n\n var e = document.createEvent('Event');\n e.initEvent(inType, inDict.bubbles || false, inDict.cancelable || false);\n\n // define inherited MouseEvent properties\n // skip bubbles and cancelable since they're set above in initEvent()\n for (var i = 2, p; i < MOUSE_PROPS.length; i++) {\n p = MOUSE_PROPS[i];\n e[p] = inDict[p] || MOUSE_DEFAULTS[i];\n }\n e.buttons = inDict.buttons || 0;\n\n // Spec requires that pointers without pressure specified use 0.5 for down\n // state and 0 for up state.\n var pressure = 0;\n\n if (inDict.pressure !== undefined && e.buttons) {\n pressure = inDict.pressure;\n } else {\n pressure = e.buttons ? 0.5 : 0;\n }\n\n // add x/y properties aliased to clientX/Y\n e.x = e.clientX;\n e.y = e.clientY;\n\n // define the properties of the PointerEvent interface\n e.pointerId = inDict.pointerId || 0;\n e.width = inDict.width || 1;\n e.height = inDict.height || 1;\n e.pressure = pressure;\n e.tiltX = inDict.tiltX || 0;\n e.tiltY = inDict.tiltY || 0;\n e.twist = inDict.twist || 0;\n e.tangentialPressure = inDict.tangentialPressure || 0;\n e.pointerType = inDict.pointerType || '';\n e.hwTimestamp = inDict.hwTimestamp || 0;\n e.isPrimary = inDict.isPrimary || false;\n e.detail = 0;\n return e;\n }\n\n /**\n * This module implements a map of pointer states\n */\n var USE_MAP = window.Map && window.Map.prototype.forEach;\n var PointerMap = USE_MAP ? Map : SparseArrayMap;\n\n function SparseArrayMap() {\n this.array = [];\n this.size = 0;\n }\n\n SparseArrayMap.prototype = {\n set: function(k, v) {\n if (v === undefined) {\n return this.delete(k);\n }\n if (!this.has(k)) {\n this.size++;\n }\n this.array[k] = v;\n },\n has: function(k) {\n return this.array[k] !== undefined;\n },\n delete: function(k) {\n if (this.has(k)) {\n delete this.array[k];\n this.size--;\n }\n },\n get: function(k) {\n return this.array[k];\n },\n clear: function() {\n this.array.length = 0;\n this.size = 0;\n },\n\n // return value, key, map\n forEach: function(callback, thisArg) {\n return this.array.forEach(function(v, k) {\n callback.call(thisArg, v, k, this);\n }, this);\n }\n };\n\n var CLONE_PROPS = [\n\n // MouseEvent\n 'bubbles',\n 'cancelable',\n 'view',\n 'detail',\n 'screenX',\n 'screenY',\n 'clientX',\n 'clientY',\n 'ctrlKey',\n 'altKey',\n 'shiftKey',\n 'metaKey',\n 'button',\n 'relatedTarget',\n\n // DOM Level 3\n 'buttons',\n\n // PointerEvent\n 'pointerId',\n 'width',\n 'height',\n 'pressure',\n 'tiltX',\n 'tiltY',\n 'pointerType',\n 'hwTimestamp',\n 'isPrimary',\n\n // event instance\n 'type',\n 'target',\n 'currentTarget',\n 'which',\n 'pageX',\n 'pageY',\n 'timeStamp'\n ];\n\n var CLONE_DEFAULTS = [\n\n // MouseEvent\n false,\n false,\n null,\n null,\n 0,\n 0,\n 0,\n 0,\n false,\n false,\n false,\n false,\n 0,\n null,\n\n // DOM Level 3\n 0,\n\n // PointerEvent\n 0,\n 0,\n 0,\n 0,\n 0,\n 0,\n '',\n 0,\n false,\n\n // event instance\n '',\n null,\n null,\n 0,\n 0,\n 0,\n 0\n ];\n\n var BOUNDARY_EVENTS = {\n 'pointerover': 1,\n 'pointerout': 1,\n 'pointerenter': 1,\n 'pointerleave': 1\n };\n\n var HAS_SVG_INSTANCE = (typeof SVGElementInstance !== 'undefined');\n\n /**\n * This module is for normalizing events. Mouse and Touch events will be\n * collected here, and fire PointerEvents that have the same semantics, no\n * matter the source.\n * Events fired:\n * - pointerdown: a pointing is added\n * - pointerup: a pointer is removed\n * - pointermove: a pointer is moved\n * - pointerover: a pointer crosses into an element\n * - pointerout: a pointer leaves an element\n * - pointercancel: a pointer will no longer generate events\n */\n var dispatcher = {\n pointermap: new PointerMap(),\n eventMap: Object.create(null),\n captureInfo: Object.create(null),\n\n // Scope objects for native events.\n // This exists for ease of testing.\n eventSources: Object.create(null),\n eventSourceList: [],\n /**\n * Add a new event source that will generate pointer events.\n *\n * `inSource` must contain an array of event names named `events`, and\n * functions with the names specified in the `events` array.\n * @param {string} name A name for the event source\n * @param {Object} source A new source of platform events.\n */\n registerSource: function(name, source) {\n var s = source;\n var newEvents = s.events;\n if (newEvents) {\n newEvents.forEach(function(e) {\n if (s[e]) {\n this.eventMap[e] = s[e].bind(s);\n }\n }, this);\n this.eventSources[name] = s;\n this.eventSourceList.push(s);\n }\n },\n register: function(element) {\n var l = this.eventSourceList.length;\n for (var i = 0, es; (i < l) && (es = this.eventSourceList[i]); i++) {\n\n // call eventsource register\n es.register.call(es, element);\n }\n },\n unregister: function(element) {\n var l = this.eventSourceList.length;\n for (var i = 0, es; (i < l) && (es = this.eventSourceList[i]); i++) {\n\n // call eventsource register\n es.unregister.call(es, element);\n }\n },\n contains: /*scope.external.contains || */function(container, contained) {\n try {\n return container.contains(contained);\n } catch (ex) {\n\n // most likely: https://bugzilla.mozilla.org/show_bug.cgi?id=208427\n return false;\n }\n },\n\n // EVENTS\n down: function(inEvent) {\n inEvent.bubbles = true;\n this.fireEvent('pointerdown', inEvent);\n },\n move: function(inEvent) {\n inEvent.bubbles = true;\n this.fireEvent('pointermove', inEvent);\n },\n up: function(inEvent) {\n inEvent.bubbles = true;\n this.fireEvent('pointerup', inEvent);\n },\n enter: function(inEvent) {\n inEvent.bubbles = false;\n this.fireEvent('pointerenter', inEvent);\n },\n leave: function(inEvent) {\n inEvent.bubbles = false;\n this.fireEvent('pointerleave', inEvent);\n },\n over: function(inEvent) {\n inEvent.bubbles = true;\n this.fireEvent('pointerover', inEvent);\n },\n out: function(inEvent) {\n inEvent.bubbles = true;\n this.fireEvent('pointerout', inEvent);\n },\n cancel: function(inEvent) {\n inEvent.bubbles = true;\n this.fireEvent('pointercancel', inEvent);\n },\n leaveOut: function(event) {\n this.out(event);\n this.propagate(event, this.leave, false);\n },\n enterOver: function(event) {\n this.over(event);\n this.propagate(event, this.enter, true);\n },\n\n // LISTENER LOGIC\n eventHandler: function(inEvent) {\n\n // This is used to prevent multiple dispatch of pointerevents from\n // platform events. This can happen when two elements in different scopes\n // are set up to create pointer events, which is relevant to Shadow DOM.\n if (inEvent._handledByPE) {\n return;\n }\n var type = inEvent.type;\n var fn = this.eventMap && this.eventMap[type];\n if (fn) {\n fn(inEvent);\n }\n inEvent._handledByPE = true;\n },\n\n // set up event listeners\n listen: function(target, events) {\n events.forEach(function(e) {\n this.addEvent(target, e);\n }, this);\n },\n\n // remove event listeners\n unlisten: function(target, events) {\n events.forEach(function(e) {\n this.removeEvent(target, e);\n }, this);\n },\n addEvent: /*scope.external.addEvent || */function(target, eventName) {\n target.addEventListener(eventName, this.boundHandler);\n },\n removeEvent: /*scope.external.removeEvent || */function(target, eventName) {\n target.removeEventListener(eventName, this.boundHandler);\n },\n\n // EVENT CREATION AND TRACKING\n /**\n * Creates a new Event of type `inType`, based on the information in\n * `inEvent`.\n *\n * @param {string} inType A string representing the type of event to create\n * @param {Event} inEvent A platform event with a target\n * @return {Event} A PointerEvent of type `inType`\n */\n makeEvent: function(inType, inEvent) {\n\n // relatedTarget must be null if pointer is captured\n if (this.captureInfo[inEvent.pointerId]) {\n inEvent.relatedTarget = null;\n }\n var e = new PointerEvent(inType, inEvent);\n if (inEvent.preventDefault) {\n e.preventDefault = inEvent.preventDefault;\n }\n e._target = e._target || inEvent.target;\n return e;\n },\n\n // make and dispatch an event in one call\n fireEvent: function(inType, inEvent) {\n var e = this.makeEvent(inType, inEvent);\n return this.dispatchEvent(e);\n },\n /**\n * Returns a snapshot of inEvent, with writable properties.\n *\n * @param {Event} inEvent An event that contains properties to copy.\n * @return {Object} An object containing shallow copies of `inEvent`'s\n * properties.\n */\n cloneEvent: function(inEvent) {\n var eventCopy = Object.create(null);\n var p;\n for (var i = 0; i < CLONE_PROPS.length; i++) {\n p = CLONE_PROPS[i];\n eventCopy[p] = inEvent[p] || CLONE_DEFAULTS[i];\n\n // Work around SVGInstanceElement shadow tree\n // Return the