var __awaiter=this&&this.__awaiter||function(e,t,n,o){return new(n||(n=Promise))(function(r,l){function a(e){try{s(o.next(e))}catch(e){l(e)}}function i(e){try{s(o.throw(e))}catch(e){l(e)}}function s(e){e.done?r(e.value):new n(function(t){t(e.value)}).then(a,i)}s((o=o.apply(e,t||[])).next())})},__generator=this&&this.__generator||function(e,t){var n,o,r,l,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return l={next:i(0),throw:i(1),return:i(2)},"function"==typeof Symbol&&(l[Symbol.iterator]=function(){return this}),l;function i(l){return function(i){return function(l){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,o&&(r=2&l[0]?o.return:l[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,l[1])).done)return r;switch(o=0,r&&(l=[2&l[0],r.value]),l[0]){case 0:case 1:r=l;break;case 4:return a.label++,{value:l[1],done:!1};case 5:a.label++,o=l[1],l=[0];continue;case 7:l=a.ops.pop(),a.trys.pop();continue;default:if(!(r=(r=a.trys).length>0&&r[r.length-1])&&(6===l[0]||2===l[0])){a=0;continue}if(3===l[0]&&(!r||l[1]>r[0]&&l[1]<r[3])){a.label=l[1];break}if(6===l[0]&&a.label<r[1]){a.label=r[1],r=l;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(l);break}r[2]&&a.ops.pop(),a.trys.pop();continue}l=t.call(e,a)}catch(e){l=[6,e],o=0}finally{n=r=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,i])}}};webmapgl.loadBundle("6ikvjf4k",["exports","./chunk-f7b7c806.js"],function(e,t){window;var n=0,o=function(){function e(){var e=this;this.handlers={click:function(t){return e.handleClick(t)},mouseenter:function(){return e.handleMouseenter()},mouseleave:function(){return e.handleMouseleave()}},this.basemap=!1,this.clickableLayers=[],this.enabled=!0,this.json={}}return e.prototype.componentWillLoad=function(){void 0===this.id&&(this.id="style-"+n.toString(),n+=1),this.fetchJSON()},e.prototype.componentDidLoad=function(){this.clickableLayers&&this.updateClickable(this.clickableLayers),this.glStyleElementAdded.emit(this)},e.prototype.componentDidUpdate=function(){this.glStyleElementModified.emit(this)},e.prototype.componentDidUnload=function(){this.glStyleElementRemoved.emit(this)},e.prototype.getMap=function(){return this.el.closest("gl-map").map},e.prototype.fetchJSON=function(){return __awaiter(this,void 0,void 0,function(){var e,t,n,o;return __generator(this,function(r){switch(r.label){case 0:return[4,fetch(this.url)];case 1:return e=r.sent(),t=this,[4,e.json()];case 2:if(t.json=r.sent(),this.token&&this.json.sources)for(n in this.json.sources)(o=this.json.sources[n]).data&&(o.data=o.data.replace(/\$\{TOKEN\}/g,this.token));return[2]}})})},e.prototype.updateClickable=function(e,n){var o=this.getMap();e=t.toArray(e),n=t.toArray(n);for(var r=0,l=e;r<l.length;r++){var a=n.indexOf(c=l[r]);-1===a?(o.on("click",u=this.id+":"+c,this.handlers.click),o.on("mouseenter",u,this.handlers.mouseenter),o.on("mouseleave",u,this.handlers.mouseleave)):n.splice(a,1)}for(var i=0,s=n;i<s.length;i++){var c,u;o.off("click",u=this.id+":"+(c=s[i]),this.handlers.click),o.off("mouseenter",u,this.handlers.mouseenter),o.off("mouseleave",u,this.handlers.mouseleave)}},e.prototype.handleClick=function(e){this.glFeatureClick.emit(e)},e.prototype.handleMouseenter=function(){this.getMap().getCanvas().style.cursor="pointer"},e.prototype.handleMouseleave=function(){this.getMap().getCanvas().style.cursor=""},Object.defineProperty(e,"is",{get:function(){return"gl-style"},enumerable:!0,configurable:!0}),Object.defineProperty(e,"properties",{get:function(){return{basemap:{type:Boolean,attr:"basemap"},clickableLayers:{type:String,attr:"clickable-layers",watchCallbacks:["updateClickable"]},el:{elementRef:!0},enabled:{type:Boolean,attr:"enabled"},id:{type:String,attr:"id",reflectToAttr:!0,mutable:!0},json:{type:"Any",attr:"json",mutable:!0},name:{type:String,attr:"name"},thumbnail:{type:String,attr:"thumbnail"},token:{type:String,attr:"token"},url:{type:String,attr:"url"}}},enumerable:!0,configurable:!0}),Object.defineProperty(e,"events",{get:function(){return[{name:"glFeatureClick",method:"glFeatureClick",bubbles:!0,cancelable:!0,composed:!0},{name:"glStyleElementAdded",method:"glStyleElementAdded",bubbles:!0,cancelable:!0,composed:!0},{name:"glStyleElementModified",method:"glStyleElementModified",bubbles:!0,cancelable:!0,composed:!0},{name:"glStyleElementRemoved",method:"glStyleElementRemoved",bubbles:!0,cancelable:!0,composed:!0}]},enumerable:!0,configurable:!0}),e}();e.GlStyle=o,Object.defineProperty(e,"__esModule",{value:!0})});