{"version":3,"sources":["webpack:///./node_modules/arcgis-js-api/layers/support/WMTSSublayer.js","webpack:///./node_modules/arcgis-js-api/layers/WMTSLayer.js","webpack:///./node_modules/arcgis-js-api/layers/support/WMTSStyle.js","webpack:///./node_modules/arcgis-js-api/layers/support/TileMatrixSet.js","webpack:///./node_modules/arcgis-js-api/layers/support/wmtsUtils.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,iCAAO,CAAC,kCAAS,CAAC,OAAS,CAAC,2BAAO,CAAC,2BAAuB,CAAC,2BAAwB,CAAC,2BAAuC,CAAC,2BAAuB,CAAC,2BAAiB,CAAC,2BAAa,CAAC,mCAAE,4BAA4B,aAAa,mBAAmB,cAAc,2BAA2B,iIAAiI,MAAM,6EAA6E,eAAe,gCAAgC,iBAAiB,2BAA2B,+BAA+B,2CAA2C,0CAA0C,kDAAkD,eAAe,+BAA+B,oFAAoF,iBAAiB,wBAAwB,0MAA0M,+BAA+B,+CAA+C,eAAe,2BAA2B,+EAA+E,iBAAiB,uBAAuB,+BAA+B,6CAA6C,eAAe,0BAA0B,iBAAiB,qBAAqB,+BAA+B,qDAAqD,eAAe,WAAW,iEAAiE,gCAAgC,QAAQ,+BAA+B,+BAA+B,YAAY,4wBAA4wB,4OAA4O,2BAA2B,6DAA6D,MAAM,MAAM,mBAAmB,6KAA6K,qBAAqB,yDAAyD,uBAAuB,MAAM,kBAAkB,0DAA0D,iBAAiB,OAAO,kBAAkB,yHAAyH,0CAA0C,+DAA+D,uBAAuB,MAAM,0BAA0B,6GAA6G,gBAAgB;AAAA,oGAAE,C;;;;;;;ACxBtqH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,iCAAO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AqC,uCAAuC,mBAAmB,GAAG,KAAK,wFAAwF,mBAAmB,GAAG,wBAAwB,qCAAqC,qEAAqE,4GAA4G,KAAK,2FAA2F,4DAA4D,yCAAyC,aAAa,OAAO,2CAA2C,iDAAiD,YAAY,QAAQ,GAAG,MAAM,OAAO,6EAA6E,UAAU,sDAAsD,iCAAiC,qCAAqC,sCAAsC,iBAAiB,yCAAyC,mGAAmG,aAAa,GAAG,KAAK,wDAAwD,iIAAiI,kBAAkB,WAAW,oBAAoB,8BAA8B,gDAAgD,OAAO,kBAAkB,eAAe,kBAAkB,YAAY,kBAAkB,SAAS,qBAAqB,SAAS,qBAAqB,gBAAgB,kBAAkB,iBAAiB,OAAO,SAAS,wDAAwD,mCAAmC,kBAAkB,kGAAkG,2GAA2G,OAAO,mBAAmB,eAAe,mBAAmB,YAAY,MAAM,MAAM,eAAe,SAAS,MAAM,IAAI,eAAe,SAAS,MAAM,IAAI,eAAe,gBAAgB,mBAAmB,iBAAiB,OAAO,UAAU;AAAA,oGAAE,C","file":"js/chunk-7d0f7273.2ef3c8a4.js","sourcesContent":["// COPYRIGHT © 2020 Esri\n//\n// All rights reserved under the copyright laws of the United States\n// and applicable international laws, treaties, and conventions.\n//\n// This material is licensed for use under the Esri Master License\n// Agreement (MLA), and is bound by the terms of that agreement.\n// You may redistribute and use this code without modification,\n// provided you adhere to the terms of the MLA and include this\n// copyright notice.\n//\n// See use restrictions at http://www.esri.com/legal/pdfs/mla_e204_e300/english\n//\n// For additional information, contact:\n// Environmental Systems Research Institute, Inc.\n// Attn: Contracts and Legal Services Department\n// 380 New York Street\n// Redlands, California, USA 92373\n// USA\n//\n// email: contracts@esri.com\n//\n// See http://js.arcgis.com/4.17/esri/copyright.txt for details.\n\ndefine([\"require\",\"exports\",\"tslib\",\"../../core/Collection\",\"../../core/JSONSupport\",\"../../core/accessorSupport/decorators\",\"../../geometry/Extent\",\"./TileMatrixSet\",\"./WMTSStyle\"],(function(t,e,r,i,o,s,l,n,a){\"use strict\";return function(t){function e(e){var r=t.call(this,e)||this;return r.fullExtent=null,r.imageFormats=null,r.id=null,r.layer=null,r.styles=null,r.tileMatrixSetId=null,r.tileMatrixSets=null,r}var o;return r.__extends(e,t),o=e,Object.defineProperty(e.prototype,\"description\",{get:function(){return this._get(\"description\")},set:function(t){this._set(\"description\",t)},enumerable:!1,configurable:!0}),e.prototype.readFullExtent=function(t,e){return(t=e.fullExtent)?l.fromJSON(t):null},Object.defineProperty(e.prototype,\"imageFormat\",{get:function(){var t=this._get(\"imageFormat\");return t||(t=this.imageFormats&&this.imageFormats.length?this.imageFormats[0]:\"\"),t},set:function(t){var e=this.imageFormats;t&&(t.indexOf(\"image/\")>-1||e&&-1===e.indexOf(t))&&(-1===t.indexOf(\"image/\")&&(t=\"image/\"+t),e&&-1===e.indexOf(t))?console.error(\"The layer doesn't support the format of \"+t):this._set(\"imageFormat\",t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,\"styleId\",{get:function(){var t=this._get(\"styleId\");return t||(t=this.styles&&this.styles.length?this.styles.getItemAt(0).id:\"\"),t},set:function(t){this._set(\"styleId\",t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,\"title\",{get:function(){return this._get(\"title\")},set:function(t){this._set(\"title\",t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,\"tileMatrixSet\",{get:function(){var t=this;return this.tileMatrixSets?this.tileMatrixSets.find((function(e){return e.id===t.tileMatrixSetId})):null},enumerable:!1,configurable:!0}),e.prototype.clone=function(){var t=new o;return this.hasOwnProperty(\"description\")&&(t.description=this.description),this.hasOwnProperty(\"imageFormats\")&&(t.imageFormats=this.imageFormats&&this.imageFormats.slice()),this.hasOwnProperty(\"imageFormat\")&&(t.imageFormat=this.imageFormat),this.hasOwnProperty(\"fullExtent\")&&(t.fullExtent=this.fullExtent&&this.fullExtent.clone()),this.hasOwnProperty(\"id\")&&(t.id=this.id),this.hasOwnProperty(\"layer\")&&(t.layer=this.layer),this.hasOwnProperty(\"styleId\")&&(t.styleId=this.styleId),this.hasOwnProperty(\"styles\")&&(t.styles=this.styles&&this.styles.clone()),this.hasOwnProperty(\"tileMatrixSetId\")&&(t.tileMatrixSetId=this.tileMatrixSetId),this.hasOwnProperty(\"tileMatrixSets\")&&(t.tileMatrixSets=this.tileMatrixSets.clone()),this.hasOwnProperty(\"title\")&&(t.title=this.title),t},r.__decorate([s.property()],e.prototype,\"description\",null),r.__decorate([s.property()],e.prototype,\"fullExtent\",void 0),r.__decorate([s.reader(\"fullExtent\",[\"fullExtent\"])],e.prototype,\"readFullExtent\",null),r.__decorate([s.property({dependsOn:[\"imageFormats\"]})],e.prototype,\"imageFormat\",null),r.__decorate([s.property({json:{read:{source:\"formats\"}}})],e.prototype,\"imageFormats\",void 0),r.__decorate([s.property()],e.prototype,\"id\",void 0),r.__decorate([s.property()],e.prototype,\"layer\",void 0),r.__decorate([s.property({dependsOn:[\"styles\"]})],e.prototype,\"styleId\",null),r.__decorate([s.property({type:i.ofType(a),json:{read:{source:\"styles\"}}})],e.prototype,\"styles\",void 0),r.__decorate([s.property({value:null,json:{write:{ignoreOrigin:!0}}})],e.prototype,\"title\",null),r.__decorate([s.property()],e.prototype,\"tileMatrixSetId\",void 0),r.__decorate([s.property({readOnly:!0,dependsOn:[\"tileMatrixSetId\"]})],e.prototype,\"tileMatrixSet\",null),r.__decorate([s.property({type:i.ofType(n),json:{read:{source:\"tileMatrixSets\"}}})],e.prototype,\"tileMatrixSets\",void 0),e=o=r.__decorate([s.subclass(\"esri.layers.support.WMTSSublayer\")],e)}(o.JSONSupport)}));","// COPYRIGHT © 2020 Esri\n//\n// All rights reserved under the copyright laws of the United States\n// and applicable international laws, treaties, and conventions.\n//\n// This material is licensed for use under the Esri Master License\n// Agreement (MLA), and is bound by the terms of that agreement.\n// You may redistribute and use this code without modification,\n// provided you adhere to the terms of the MLA and include this\n// copyright notice.\n//\n// See use restrictions at http://www.esri.com/legal/pdfs/mla_e204_e300/english\n//\n// For additional information, contact:\n// Environmental Systems Research Institute, Inc.\n// Attn: Contracts and Legal Services Department\n// 380 New York Street\n// Redlands, California, USA 92373\n// USA\n//\n// email: contracts@esri.com\n//\n// See http://js.arcgis.com/4.17/esri/copyright.txt for details.\n\ndefine([\"require\",\"exports\",\"tslib\",\"../request\",\"../core/Collection\",\"../core/Error\",\"../core/Handles\",\"../core/lang\",\"../core/MultiOriginJSONSupport\",\"../core/object\",\"../core/promiseUtils\",\"../core/SetUtils\",\"../core/urlUtils\",\"../core/accessorSupport/decorators\",\"../geometry/Extent\",\"./Layer\",\"./WebTileLayer\",\"./mixins/BlendLayer\",\"./mixins/OperationalLayer\",\"./mixins/PortalLayer\",\"./mixins/RefreshableLayer\",\"./mixins/ScaleRangeLayer\",\"./support/TileInfo\",\"./support/WMTSLayerInfo\",\"./support/WMTSSublayer\",\"./support/wmtsUtils\"],(function(e,t,r,a,i,o,s,n,l,u,c,p,y,d,m,f,v,h,g,_,L,I,w,S,b,M){\"use strict\";var P={\"image/png\":\".png\",\"image/png8\":\".png\",\"image/png24\":\".png\",\"image/png32\":\".png\",\"image/jpg\":\".jpg\",\"image/jpeg\":\".jpeg\",\"image/gif\":\".gif\",\"image/bmp\":\".bmp\",\"image/tiff\":\".tif\",\"image/jpgpng\":\"\",\"image/jpegpng\":\"\",\"image/unknown\":\"\"},T=p.SetFromValues([\"version\",\"service\",\"request\",\"layer\",\"style\",\"format\",\"tilematrixset\",\"tilematrix\",\"tilerow\",\"tilecol\"]);return function(e){function t(){for(var t=[],r=0;r-1?\"KVP\":\"RESTful\"},t.prototype.readSublayersFromService=function(e,t,r){return function(e,t){return e.map((function(e){var r=new b;return r.read(e,t),r}))}(t.layers,r)},Object.defineProperty(t.prototype,\"supportedSpatialReferences\",{get:function(){return this.activeLayer.tileMatrixSets.map((function(e){return e.tileInfo.spatialReference})).toArray()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,\"title\",{get:function(){return\"Layer\"===this._get(\"title\")?this.activeLayer&&this.activeLayer.title:this._get(\"title\")},set:function(e){this._set(\"title\",e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,\"url\",{get:function(){return this._get(\"url\")},set:function(e){e&&\"/\"===e.substr(-1)?this._set(\"url\",e.slice(0,-1)):this._set(\"url\",e)},enumerable:!1,configurable:!0}),t.prototype.createWebTileLayer=function(e){var t=this.getUrlTemplate(this.activeLayer.id,this.activeLayer.tileMatrixSetId,this.activeLayer.imageFormat,this.activeLayer.styleId),r=this._getTileMatrixSetById(e.tileMatrixSetId).tileInfo,a=e.fullExtent,i=new S.default({layerIdentifier:e.id,tileMatrixSet:e.tileMatrixSetId,url:this.url});return this.customLayerParameters&&(i.customLayerParameters=this.customLayerParameters),this.customParameters&&(i.customParameters=this.customParameters),new v({fullExtent:a,urlTemplate:t,tileInfo:r,wmtsInfo:i})},t.prototype.fetchTile=function(e,t,r){var i=this.getTileUrl(e,t,r);return a(i,{responseType:\"image\"}).then((function(e){return e.data}))},t.prototype.findSublayerById=function(e){return this.sublayers.find((function(t){return t.id===e}))},t.prototype.getTileUrl=function(e,t,r){var a=this._getTileMatrixSetById(this.activeLayer.tileMatrixSetId).tileInfo.lods[e],i=a?a.levelValue?a.levelValue:\"\"+a.level:\"\"+e,o=this.resourceInfo?\"\":M.getTileUrlFromResourceUrls({dimensionMap:this.dimensionMap,layerMap:this.layerMap},this.activeLayer.id,this.activeLayer.tileMatrixSetId,this.activeLayer.imageFormat,this.activeLayer.styleId,i,t,r);o||(o=this.getUrlTemplate(this.activeLayer.id,this.activeLayer.tileMatrixSetId,this.activeLayer.imageFormat,this.activeLayer.styleId).replace(/\\{level\\}/gi,i).replace(/\\{row\\}/gi,\"\"+t).replace(/\\{col\\}/gi,\"\"+r));return o=this._appendCustomLayerParameters(o)},t.prototype.getUrlTemplate=function(e,t,r,a){if(!this.resourceInfo){var i=M.getTileUrlTemplateFromResourceUrls({dimensionMap:this.dimensionMap,layerMap:this.layerMap},e,t,a);if(i)return i}if(\"KVP\"===this.serviceMode)return this.url+\"?SERVICE=WMTS&VERSION=\"+this.version+\"&REQUEST=GetTile&LAYER=\"+e+\"&STYLE=\"+a+\"&FORMAT=\"+r+\"&TILEMATRIXSET=\"+t+\"&TILEMATRIX={level}&TILEROW={row}&TILECOL={col}\";if(\"RESTful\"===this.serviceMode){var o=\"\";return P[r.toLowerCase()]&&(o=P[r.toLowerCase()]),this.url+e+\"/\"+a+\"/\"+t+\"/{level}/{row}/{col}\"+o}return\"\"},t.prototype._fetchService=function(e){return r.__awaiter(this,void 0,void 0,(function(){var t,i,o;return r.__generator(this,(function(s){switch(s.label){case 0:return this.resourceInfo?(\"KVP\"===this.resourceInfo.serviceMode&&(this.url+=this.url.indexOf(\"?\")>-1?\"\":\"?\"),t={ssl:!1,data:this.resourceInfo},[3,6]):[3,1];case 1:i=this._getCapabilitiesUrl(this.serviceMode),s.label=2;case 2:return s.trys.push([2,4,,6]),[4,a(i,r.__assign(r.__assign({},e),{responseType:\"text\"}))];case 3:return t=s.sent(),[3,6];case 4:return s.sent(),o=\"KVP\"===this.serviceMode?\"RESTful\":\"KVP\",i=this._getCapabilitiesUrl(o),[4,a(i,r.__assign(r.__assign({},e),{responseType:\"text\"}))];case 5:return t=s.sent(),[3,6];case 6:return this.resourceInfo?t.data=M.parseResourceInfo(t.data):t.data=M.parseCapabilities(t.data,{serviceMode:this.serviceMode,url:this.url}),t.data&&this.read(t.data,{origin:\"service\"}),[2]}}))}))},t.prototype._getTileMatrixSetById=function(e){return this.findSublayerById(this.activeLayer.id).tileMatrixSets.find((function(t){return t.id===e}))},t.prototype._appendCustomParameters=function(e){if(this.customParameters)for(var t in this.customParameters)e+=(-1===e.indexOf(\"?\")?\"?\":\"&\")+t+\"=\"+encodeURIComponent(this.customParameters[t]);return e},t.prototype._appendCustomLayerParameters=function(e){if(this.customLayerParameters||this.customParameters){var t=r.__assign(r.__assign({},n.clone(this.customParameters||{})),this.customLayerParameters);for(var a in t)e+=(-1===e.indexOf(\"?\")?\"?\":\"&\")+a+\"=\"+encodeURIComponent(t[a])}return e},t.prototype._getCapabilitiesUrl=function(e){var t;return this.url=this.url.split(\"?\")[0],\"KVP\"===e?t=this.url+\"?request=GetCapabilities&service=WMTS&version=\"+this.version:\"RESTful\"===e&&(t=this.url+\"/\"+this.version+\"/WMTSCapabilities.xml\"),t=this._appendCustomParameters(t)},t.prototype._getLowerCasedUrlParams=function(e){if(!e)return null;var t=y.urlToObject(e).query;if(!t)return null;var r={};return Object.keys(t).forEach((function(e){r[e.toLowerCase()]=t[e]})),r},t.prototype._mergeParams=function(e,t){var r=this._getLowerCasedUrlParams(t);if(r){var a=Object.keys(r);a.length&&(e=e?n.clone(e):{},a.forEach((function(t){e.hasOwnProperty(t)||T.has(t)||(e[t]=r[t])})))}return e},r.__decorate([d.property()],t.prototype,\"dimensionMap\",void 0),r.__decorate([d.property()],t.prototype,\"layerMap\",void 0),r.__decorate([d.property({type:b,dependsOn:[\"sublayers\"],json:{origins:{\"web-document\":{write:{ignoreOrigin:!0}}}}})],t.prototype,\"activeLayer\",null),r.__decorate([d.reader(\"service\",\"activeLayer\",[\"layers\"])],t.prototype,\"readActiveLayerFromService\",null),r.__decorate([d.reader([\"web-document\",\"portal-item\"],\"activeLayer\",[\"wmtsInfo\"])],t.prototype,\"readActiveLayerFromItemOrWebDoc\",null),r.__decorate([d.writer([\"web-document\",\"portal-item\"],\"activeLayer\",{templateUrl:{type:String},tileInfo:{type:w},\"wmtsInfo.layerIdentifier\":{type:String},\"wmtsInfo.tileMatrixSet\":{type:String}})],t.prototype,\"writeActiveLayer\",null),r.__decorate([d.property({type:String,value:\"\",json:{write:!0}})],t.prototype,\"copyright\",void 0),r.__decorate([d.property({type:[\"show\",\"hide\"]})],t.prototype,\"listMode\",void 0),r.__decorate([d.property({json:{origins:{\"web-document\":{read:{source:[\"wmtsInfo.customParameters\",\"wmtsInfo.url\"]},write:{target:\"wmtsInfo.customParameters\"}},\"portal-item\":{read:{source:[\"wmtsInfo.customParameters\",\"wmtsInfo.url\"]},write:{target:\"wmtsInfo.customParameters\"}}}}})],t.prototype,\"customParameters\",void 0),r.__decorate([d.reader(\"web-document\",\"customParameters\"),d.reader(\"portal-item\",\"customParameters\")],t.prototype,\"readCustomParameters\",null),r.__decorate([d.property({json:{origins:{\"web-document\":{read:{source:\"wmtsInfo.customLayerParameters\"},write:{target:\"wmtsInfo.customLayerParameters\"}},\"portal-item\":{read:{source:\"wmtsInfo.customLayerParameters\"},write:{target:\"wmtsInfo.customLayerParameters\"}}}}})],t.prototype,\"customLayerParameters\",void 0),r.__decorate([d.property({type:m,json:{write:{ignoreOrigin:!0},origins:{\"web-document\":{read:{source:\"fullExtent\"}},\"portal-item\":{read:{source:\"fullExtent\"}}}}})],t.prototype,\"fullExtent\",void 0),r.__decorate([d.property({readOnly:!0,dependsOn:[\"activeLayer\"]})],t.prototype,\"fullExtents\",null),r.__decorate([d.property({type:[\"WebTiledLayer\"]})],t.prototype,\"operationalLayerType\",void 0),r.__decorate([d.property()],t.prototype,\"resourceInfo\",void 0),r.__decorate([d.property()],t.prototype,\"serviceMode\",void 0),r.__decorate([d.reader([\"portal-item\",\"web-document\"],\"serviceMode\",[\"templateUrl\"])],t.prototype,\"readServiceMode\",null),r.__decorate([d.property({type:i.ofType(b)})],t.prototype,\"sublayers\",void 0),r.__decorate([d.reader(\"service\",\"sublayers\",[\"layers\"])],t.prototype,\"readSublayersFromService\",null),r.__decorate([d.property({readOnly:!0,dependsOn:[\"activeLayer\"]})],t.prototype,\"supportedSpatialReferences\",null),r.__decorate([d.property({dependsOn:[\"activeLayer\"],json:{read:{source:\"title\"}}})],t.prototype,\"title\",null),r.__decorate([d.property({json:{read:!1},readOnly:!0,value:\"wmts\"})],t.prototype,\"type\",void 0),r.__decorate([d.property({json:{origins:{service:{read:{source:\"tileUrl\"}},\"web-document\":{read:{source:\"wmtsInfo.url\"},write:{target:\"wmtsInfo.url\"}},\"portal-item\":{read:{source:\"wmtsInfo.url\"},write:{target:\"wmtsInfo.url\"}}}}})],t.prototype,\"url\",null),r.__decorate([d.property()],t.prototype,\"version\",void 0),t=r.__decorate([d.subclass(\"esri.layers.WMTSLayer\")],t)}(h.BlendLayer(L.RefreshableLayer(I.ScaleRangeLayer(g.OperationalLayer(_.PortalLayer(l.MultiOriginJSONMixin(f)))))))}));","// COPYRIGHT © 2020 Esri\n//\n// All rights reserved under the copyright laws of the United States\n// and applicable international laws, treaties, and conventions.\n//\n// This material is licensed for use under the Esri Master License\n// Agreement (MLA), and is bound by the terms of that agreement.\n// You may redistribute and use this code without modification,\n// provided you adhere to the terms of the MLA and include this\n// copyright notice.\n//\n// See use restrictions at http://www.esri.com/legal/pdfs/mla_e204_e300/english\n//\n// For additional information, contact:\n// Environmental Systems Research Institute, Inc.\n// Attn: Contracts and Legal Services Department\n// 380 New York Street\n// Redlands, California, USA 92373\n// USA\n//\n// email: contracts@esri.com\n//\n// See http://js.arcgis.com/4.17/esri/copyright.txt for details.\n\ndefine([\"require\",\"exports\",\"tslib\",\"../../core/JSONSupport\",\"../../core/accessorSupport/decorators\"],(function(e,r,t,o,s){\"use strict\";return function(e){function r(r){var t=e.call(this,r)||this;return t.id=null,t.title=null,t.description=null,t.legendUrl=null,t}var o;return t.__extends(r,e),o=r,r.prototype.clone=function(){var e=new o;return this.hasOwnProperty(\"description\")&&(e.description=this.description),this.hasOwnProperty(\"id\")&&(e.id=this.id),this.hasOwnProperty(\"isDefault\")&&(e.isDefault=this.isDefault),this.hasOwnProperty(\"keywords\")&&(e.keywords=this.keywords&&this.keywords.slice()),this.hasOwnProperty(\"legendUrl\")&&(e.legendUrl=this.legendUrl),this.hasOwnProperty(\"title\")&&(e.title=this.title),e},t.__decorate([s.property({json:{read:{source:\"id\"}}})],r.prototype,\"id\",void 0),t.__decorate([s.property({json:{read:{source:\"title\"}}})],r.prototype,\"title\",void 0),t.__decorate([s.property({json:{read:{source:\"abstract\"}}})],r.prototype,\"description\",void 0),t.__decorate([s.property({json:{read:{source:\"legendUrl\"}}})],r.prototype,\"legendUrl\",void 0),t.__decorate([s.property({json:{read:{source:\"isDefault\"}}})],r.prototype,\"isDefault\",void 0),t.__decorate([s.property({json:{read:{source:\"keywords\"}}})],r.prototype,\"keywords\",void 0),r=o=t.__decorate([s.subclass(\"esri.layer.support.WMTSStyle\")],r)}(o.JSONSupport)}));","// COPYRIGHT © 2020 Esri\n//\n// All rights reserved under the copyright laws of the United States\n// and applicable international laws, treaties, and conventions.\n//\n// This material is licensed for use under the Esri Master License\n// Agreement (MLA), and is bound by the terms of that agreement.\n// You may redistribute and use this code without modification,\n// provided you adhere to the terms of the MLA and include this\n// copyright notice.\n//\n// See use restrictions at http://www.esri.com/legal/pdfs/mla_e204_e300/english\n//\n// For additional information, contact:\n// Environmental Systems Research Institute, Inc.\n// Attn: Contracts and Legal Services Department\n// 380 New York Street\n// Redlands, California, USA 92373\n// USA\n//\n// email: contracts@esri.com\n//\n// See http://js.arcgis.com/4.17/esri/copyright.txt for details.\n\ndefine([\"require\",\"exports\",\"tslib\",\"../../core/JSONSupport\",\"../../core/accessorSupport/decorators\",\"../../geometry/Extent\",\"./TileInfo\"],(function(t,e,r,o,n,i,l){\"use strict\";return function(t){function e(e){var r=t.call(this,e)||this;return r.fullExtent=null,r.id=null,r.tileInfo=null,r}var o;return r.__extends(e,t),o=e,e.prototype.clone=function(){var t=new o;return this.hasOwnProperty(\"fullExtent\")&&(t.fullExtent=this.fullExtent&&this.fullExtent.clone()),this.hasOwnProperty(\"id\")&&(t.id=this.id),this.hasOwnProperty(\"tileInfo\")&&(t.tileInfo=this.tileInfo&&this.tileInfo.clone()),t},r.__decorate([n.property({type:i,json:{read:{source:\"fullExtent\"}}})],e.prototype,\"fullExtent\",void 0),r.__decorate([n.property({type:String,json:{read:{source:\"id\"}}})],e.prototype,\"id\",void 0),r.__decorate([n.property({type:l,json:{read:{source:\"tileInfo\"}}})],e.prototype,\"tileInfo\",void 0),e=o=r.__decorate([n.subclass(\"esri.layer.support.TileMatrixSet\")],e)}(o.JSONSupport)}));","// COPYRIGHT © 2020 Esri\n//\n// All rights reserved under the copyright laws of the United States\n// and applicable international laws, treaties, and conventions.\n//\n// This material is licensed for use under the Esri Master License\n// Agreement (MLA), and is bound by the terms of that agreement.\n// You may redistribute and use this code without modification,\n// provided you adhere to the terms of the MLA and include this\n// copyright notice.\n//\n// See use restrictions at http://www.esri.com/legal/pdfs/mla_e204_e300/english\n//\n// For additional information, contact:\n// Environmental Systems Research Institute, Inc.\n// Attn: Contracts and Legal Services Department\n// 380 New York Street\n// Redlands, California, USA 92373\n// USA\n//\n// email: contracts@esri.com\n//\n// See http://js.arcgis.com/4.17/esri/copyright.txt for details.\n\ndefine([\"require\",\"exports\",\"../../core/Error\",\"../../geometry/Extent\",\"../../geometry/Point\",\"../../geometry/SpatialReference\",\"../../geometry/support/geodesicConstants\",\"../../geometry/support/WKIDUnitConversion\",\"./TileInfo\"],(function(e,t,r,i,n,a,l,o,s){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.getTileUrlTemplateFromResourceUrls=t.getTileUrlFromResourceUrls=t.parseResourceInfo=t.parseCapabilities=void 0;var u=[[3819,3819],[3821,3824],[3889,3889],[3906,3906],[4001,4025],[4027,4036],[4039,4047],[4052,4055],[4074,4075],[4080,4081],[4120,4176],[4178,4185],[4188,4216],[4218,4289],[4291,4304],[4306,4319],[4322,4326],[4463,4463],[4470,4470],[4475,4475],[4483,4483],[4490,4490],[4555,4558],[4600,4646],[4657,4765],[4801,4811],[4813,4821],[4823,4824],[4901,4904],[5013,5013],[5132,5132],[5228,5229],[5233,5233],[5246,5246],[5252,5252],[5264,5264],[5324,5340],[5354,5354],[5360,5360],[5365,5365],[5370,5373],[5381,5381],[5393,5393],[5451,5451],[5464,5464],[5467,5467],[5489,5489],[5524,5524],[5527,5527],[5546,5546],[2044,2045],[2081,2083],[2085,2086],[2093,2093],[2096,2098],[2105,2132],[2169,2170],[2176,2180],[2193,2193],[2200,2200],[2206,2212],[2319,2319],[2320,2462],[2523,2549],[2551,2735],[2738,2758],[2935,2941],[2953,2953],[3006,3030],[3034,3035],[3038,3051],[3058,3059],[3068,3068],[3114,3118],[3126,3138],[3150,3151],[3300,3301],[3328,3335],[3346,3346],[3350,3352],[3366,3366],[3389,3390],[3416,3417],[3833,3841],[3844,3850],[3854,3854],[3873,3885],[3907,3910],[4026,4026],[4037,4038],[4417,4417],[4434,4434],[4491,4554],[4839,4839],[5048,5048],[5105,5130],[5253,5259],[5269,5275],[5343,5349],[5479,5482],[5518,5519],[5520,5520],[20004,20032],[20064,20092],[21413,21423],[21473,21483],[21896,21899],[22171,22177],[22181,22187],[22191,22197],[25884,25884],[27205,27232],[27391,27398],[27492,27492],[28402,28432],[28462,28492],[30161,30179],[30800,30800],[31251,31259],[31275,31279],[31281,31290],[31466,31700]];function p(e,t){var r=t.getElementsByTagName(e);return r&&r.length>0?r[0]:null}function c(e,t){return Array.prototype.slice.call(t.getElementsByTagName(e)).map((function(e){return e.textContent}))}function f(e,t){return e.split(\">\").forEach((function(e){t&&(t=p(e,t))})),t&&t.textContent}function g(e,t,r,i){var n;return Array.prototype.slice.call(i.childNodes).some((function(i){if(i.nodeName.indexOf(e)>-1){var a=p(t,i),l=a&&a.textContent;if(l===r||r.split(\":\")&&r.split(\":\")[1]===l)return n=i,!0}return!1})),n}function d(e,t){var r=[],i=e.layerMap.get(t);if(i){var n,a,l,o,s=Array.prototype.slice.call(i.getElementsByTagName(\"ResourceURL\")),u=i.getElementsByTagName(\"Dimension\");return u.length&&(n=f(\"Identifier\",u[0]),a=c(\"Default\",u[0])||c(\"Value\",u[0])),u.length>1&&(l=f(\"Identifier\",u[1]),o=c(\"Default\",u[1])||c(\"Value\",u[1])),e.dimensionMap.set(t,{dimensions:a,dimensions2:o}),s.forEach((function(e){var t=e.getAttribute(\"template\");if(\"tile\"===e.getAttribute(\"resourceType\")){var i;if(n&&a.length)if(t.indexOf(\"{\"+n+\"}\")>-1)t=t.replace(\"{\"+n+\"}\",\"{dimensionValue}\");else(i=t.toLowerCase().indexOf(\"{\"+n.toLowerCase()+\"}\"))>-1&&(t=t.substring(0,i)+\"{dimensionValue}\"+t.substring(i+n.length+2));if(l&&o.length)if(t.indexOf(\"{\"+l+\"}\")>-1)t=t.replace(\"{\"+l+\"}\",\"{dimensionValue2}\");else(i=t.toLowerCase().indexOf(\"{\"+l.toLowerCase()+\"}\"))>-1&&(t=t.substring(0,i)+\"{dimensionValue2}\"+t.substring(i+l.length+2));r.push({template:t,format:e.getAttribute(\"format\"),resourceType:\"tile\"})}})),r}}function m(e,t,r,i){var n,a=f(\"Identifier\",e),l=f(\"ScaleDenominator\",e).split(\"E\").map((function(e){return Number(e)})),o=x(t,n=l.length>1?l[0]*Math.pow(10,l[1]):l[0],i);return{level:r,levelValue:a,scale:n*=1.058267716535433,resolution:o}}function x(e,t,r){return 7*t/25e3/(o.hasOwnProperty(String(e))?o.values[o[e]]:\"default028mm\"===r?6370997*Math.PI/180:l.metersPerDegree)}t.parseCapabilities=function(e,t){e=e.replace(/ows:/gi,\"\");var l=(new DOMParser).parseFromString(e,\"text/xml\").documentElement,o=new Map,d=new Map,x=p(\"Contents\",l);if(!x)throw new r(\"wmtslayer:wmts-capabilities-xml-is-not-valid\");var h,y,v=p(\"OperationsMetadata\",l),T=v&&v.querySelector(\"[name='GetTile']\"),w=T&&T.getElementsByTagName(\"Get\"),M=w&&Array.prototype.slice.call(w),E=t&&t.url&&t.url.indexOf(\"https\")>-1,S=t.serviceMode,b=t&&t.url;if(M&&M.length&&M.some((function(e){var t=p(\"Constraint\",e);return!t||g(\"AllowedValues\",\"Value\",S,t)?(b=e.attributes[0].nodeValue,!0):(!t||g(\"AllowedValues\",\"Value\",\"RESTful\",t)||g(\"AllowedValues\",\"Value\",\"REST\",t)?y=e.attributes[0].nodeValue:t&&!g(\"AllowedValues\",\"Value\",\"KVP\",t)||(h=e.attributes[0].nodeValue),!1)})),!b)if(y)b=y,S=\"RESTful\";else if(h)b=h,S=\"KVP\";else{var V=p(\"ServiceMetadataURL\",l);b=V&&V.getAttribute(\"xlink:href\")}var C=b.indexOf(\"1.0.0/\");return-1===C&&\"RESTful\"===S?b+=\"/\":C>-1&&(b=b.substring(0,C)),\"KVP\"===S&&(b+=C>-1?\"\":\"?\"),E&&(b=b.replace(/^http:/i,\"https:\")),{copyright:f(\"ServiceIdentification>AccessConstraints\",l),layers:Array.prototype.slice.call(x.getElementsByTagName(\"Layer\")).map((function(e){var t=f(\"Identifier\",e);return o.set(t,e),function(e,t,r,l){var o=f(\"Abstract\",t),d=c(\"Format\",t),x=function(e){var t=p(\"WGS84BoundingBox\",e),r=t?f(\"LowerCorner\",t).split(\" \"):[\"-180\",\"-90\"],i=t?f(\"UpperCorner\",t).split(\" \"):[\"180\",\"90\"];return{xmin:parseFloat(r[0]),ymin:parseFloat(r[1]),xmax:parseFloat(i[0]),ymax:parseFloat(i[1]),spatialReference:{wkid:4326}}}(t),h=function(e,t){return Array.prototype.slice.call(e.getElementsByTagName(\"Style\")).map((function(e){var r=p(\"LegendURL\",e),i=p(\"Keywords\",e),n=i&&c(\"Keyword\",i),a=r&&r.getAttribute(\"xlink:href\");return t&&(a=a&&a.replace(/^http:/i,\"https:\")),{abstract:f(\"Abstract\",e),id:f(\"Identifier\",e),isDefault:\"true\"===e.getAttribute(\"isDefault\"),keywords:n,legendUrl:a,title:f(\"Title\",e)}}))}(t,l),y=f(\"Title\",t),v=function(e,t){return c(\"TileMatrixSet\",e).map((function(r){return function(e,t,r){var l=c(\"TileMatrix\",g(\"TileMatrixSetLink\",\"TileMatrixSet\",e,t)),o=g(\"TileMatrixSet\",\"Identifier\",e,r),d=function(e){var t=f(\"SupportedCRS\",e);t&&(t=t.toLowerCase());var r=parseInt(t.split(\":\").pop(),10);900913!==r&&3857!==r||(r=102100);var i=!1;t.indexOf(\"crs84\")>-1||t.indexOf(\"crs:84\")>-1?(r=4326,i=!0):t.indexOf(\"crs83\")>-1||t.indexOf(\"crs:83\")>-1?(r=4269,i=!0):(t.indexOf(\"crs27\")>-1||t.indexOf(\"crs:27\")>-1)&&(r=4267,i=!0);var l,o=new a({wkid:r}),s=f(\"TopLeftCorner\",p(\"TileMatrix\",e)).split(\" \"),c=s[0].split(\"E\").map((function(e){return Number(e)})),g=s[1].split(\"E\").map((function(e){return Number(e)})),d=c[0],m=g[0];c.length>1&&(d=c[0]*Math.pow(10,c[1]));g.length>1&&(m=g[0]*Math.pow(10,g[1]));var x=i&&4326===r&&90===d&&-180===m;return u.some((function(e,a){var s=Number(t.split(\":\").pop());return s>=e[0]&&s<=e[1]||4326===r&&(!i||x)?(l=new n(m,d,o),!0):(a===u.length-1&&(l=new n(d,m,o)),!1)})),l}(o),x=d.spatialReference,h=x.wkid,y=p(\"TileMatrix\",o),v=[parseInt(f(\"TileWidth\",y),10),parseInt(f(\"TileHeight\",y),10)],T=[];if(l.length)l.forEach((function(t,r){var i=g(\"TileMatrix\",\"Identifier\",t,o);T.push(m(i,h,r,e))}));else{Array.prototype.slice.call(o.getElementsByTagName(\"TileMatrix\")).forEach((function(t,r){T.push(m(t,h,r,e))}))}var w=function(e,t,r,n){var a,l,o,s,u,c,g=p(\"BoundingBox\",e);g&&(a=f(\"LowerCorner\",g).split(\" \"),l=f(\"UpperCorner\",g).split(\" \"));if(a&&a.length>1&&l&&l.length>1)o=parseFloat(a[0]),u=parseFloat(a[1]),s=parseFloat(l[0]),c=parseFloat(l[1]);else{var d=p(\"TileMatrix\",e),m=parseFloat(f(\"MatrixWidth\",d)),x=parseFloat(f(\"MatrixHeight\",d));o=t.x,c=t.y,s=o+m*r[0]*n.resolution,u=c-x*r[1]*n.resolution}return new i(o,u,s,c,t.spatialReference)}(o,d,v,T[0]);return{id:e,fullExtent:w.toJSON(),tileInfo:new s({dpi:96,spatialReference:x,size:v,origin:d,lods:T}).toJSON()}}(r,e,t)}))}(t,r);return{id:e,fullExtent:x,description:o,formats:d,styles:h,title:y,tileMatrixSets:v}}(t,e,x,E)})),tileUrl:b,serviceMode:S,layerMap:o,dimensionMap:d}},t.parseResourceInfo=function(e){return e.layers.forEach((function(e){e.tileMatrixSets.forEach((function(e){var t=e.tileInfo;96!==t.dpi&&(t.lods.forEach((function(r){r.scale=96*r.scale/t.dpi,r.resolution=x(t.spatialReference.wkid,90.71428571428571*r.scale/96,e.id)})),t.dpi=96)}))})),e},t.getTileUrlFromResourceUrls=function(e,t,r,i,n,a,l,o){var s=e.dimensionMap,u=d(e,t),p=s.get(t).dimensions&&s.get(t).dimensions[0],c=s.get(t).dimensions2&&s.get(t).dimensions2[0],f=\"\";if(u&&u.length>0){var g=null;u.some((function(e){return e.format===i&&(g=e,!0)})),g||(g=u[l%u.length]),f=g.template.replace(/\\{Style\\}/gi,n).replace(/\\{TileMatrixSet\\}/gi,r).replace(/\\{TileMatrix\\}/gi,a).replace(/\\{TileRow\\}/gi,\"\"+l).replace(/\\{TileCol\\}/gi,\"\"+o).replace(/\\{dimensionValue\\}/gi,p).replace(/\\{dimensionValue2\\}/gi,c)}return f},t.getTileUrlTemplateFromResourceUrls=function(e,t,r,i){var n=e.dimensionMap,a=d(e,t),l=\"\";if(a&&a.length>0){var o=n.get(t).dimensions&&n.get(t).dimensions[0],s=n.get(t).dimensions2&&n.get(t).dimensions2[0];(l=a[0].template).indexOf(\".xxx\")===l.length-4&&(l=l.slice(0,l.length-4)),l=(l=(l=(l=(l=(l=(l=l.replace(/\\{Style\\}/gi,i)).replace(/\\{TileMatrixSet\\}/gi,r)).replace(/\\{TileMatrix\\}/gi,\"{level}\")).replace(/\\{TileRow\\}/gi,\"{row}\")).replace(/\\{TileCol\\}/gi,\"{col}\")).replace(/\\{dimensionValue\\}/gi,o)).replace(/\\{dimensionValue2\\}/gi,s)}return l}}));"],"sourceRoot":""}