{"version":3,"sources":["node_modules/@arcgis/core/layers/support/fromPortalItem.js","node_modules/@arcgis/core/layers/Layer.js"],"sourcesContent":["/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport r from \"../../config.js\";\nimport t from \"../../core/Logger.js\";\nasync function o(o) {\n const a = \"portalItem\" in o ? o : {\n portalItem: o\n },\n {\n fromItem: e\n } = await import(\"../../portal/support/portalLayers.js\");\n try {\n return await e(a);\n } catch (p) {\n const o = a && a.portalItem,\n e = o?.id || \"unset\",\n l = o && o.portal && o.portal.url || r.portalUrl;\n throw t.getLogger(\"esri.layers.support.fromPortalItem\").error(\"#fromPortalItem()\", \"Failed to create layer from portal item (portal: '\" + l + \"', id: '\" + e + \"')\", p), p;\n }\n}\nexport { o as fromPortalItem };","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.28/esri/copyright.txt for details.\n*/\nimport { _ as t } from \"../chunks/tslib.es6.js\";\nimport \"../geometry.js\";\nimport e from \"../request.js\";\nimport r from \"../core/Error.js\";\nimport o from \"../core/Evented.js\";\nimport { IdentifiableMixin as i } from \"../core/Identifiable.js\";\nimport s from \"../core/Loadable.js\";\nimport a from \"../core/Logger.js\";\nimport { isAbortError as l } from \"../core/promiseUtils.js\";\nimport { urlToObject as n } from \"../core/urlUtils.js\";\nimport { property as p } from \"../core/accessorSupport/decorators/property.js\";\nimport \"../core/accessorSupport/ensureType.js\";\nimport \"../core/arrayUtils.js\";\nimport \"../core/has.js\";\nimport { subclass as y } from \"../core/accessorSupport/decorators/subclass.js\";\nimport { fromPortalItem as d } from \"./support/fromPortalItem.js\";\nimport c from \"../geometry/Extent.js\";\nimport u from \"../geometry/SpatialReference.js\";\nlet m = 0,\n h = class extends o.EventedMixin(i(s)) {\n constructor() {\n super(...arguments), this.attributionDataUrl = null, this.fullExtent = new c(-180, -90, 180, 90, u.WGS84), this.id = Date.now().toString(16) + \"-layer-\" + m++, this.legendEnabled = !0, this.listMode = \"show\", this.opacity = 1, this.parent = null, this.persistenceEnabled = !1, this.popupEnabled = !0, this.attributionVisible = !0, this.spatialReference = u.WGS84, this.title = null, this.type = null, this.url = null, this.visible = !0;\n }\n static async fromArcGISServerUrl(t) {\n const e = \"string\" == typeof t ? {\n url: t\n } : t;\n return (await import(\"./support/arcgisLayers.js\")).fromUrl(e);\n }\n static fromPortalItem(t) {\n return d(t);\n }\n initialize() {\n this.when().catch(t => {\n l(t) || a.getLogger(this).error(\"#load()\", `Failed to load layer (title: '${this.title ?? \"no title\"}', id: '${this.id ?? \"no id\"}')`, {\n error: t\n });\n });\n }\n destroy() {\n const t = this.parent;\n if (t) {\n const e = this;\n \"layers\" in t && t.layers.includes(e) ? t.layers.remove(e) : \"tables\" in t && t.tables.includes(e) ? t.tables.remove(e) : \"baseLayers\" in t && t.baseLayers.includes(e) ? t.baseLayers.remove(e) : \"referenceLayers\" in t && t.referenceLayers.includes(e) && t.referenceLayers.remove(e), this._set(\"parent\", null);\n }\n }\n get hasAttributionData() {\n return null != this.attributionDataUrl;\n }\n get parsedUrl() {\n return n(this.url);\n }\n async fetchAttributionData() {\n const t = this.attributionDataUrl;\n if (this.hasAttributionData && t) {\n return (await e(t, {\n query: {\n f: \"json\"\n },\n responseType: \"json\"\n })).data;\n }\n throw new r(\"layer:no-attribution-data\", \"Layer does not have attribution data\");\n }\n };\nt([p({\n type: String\n})], h.prototype, \"attributionDataUrl\", void 0), t([p({\n type: c\n})], h.prototype, \"fullExtent\", void 0), t([p({\n readOnly: !0\n})], h.prototype, \"hasAttributionData\", null), t([p({\n type: String,\n clonable: !1\n})], h.prototype, \"id\", void 0), t([p({\n type: Boolean,\n nonNullable: !0\n})], h.prototype, \"legendEnabled\", void 0), t([p({\n type: [\"show\", \"hide\", \"hide-children\"]\n})], h.prototype, \"listMode\", void 0), t([p({\n type: Number,\n range: {\n min: 0,\n max: 1\n },\n nonNullable: !0\n})], h.prototype, \"opacity\", void 0), t([p({\n clonable: !1\n})], h.prototype, \"parent\", void 0), t([p({\n readOnly: !0\n})], h.prototype, \"parsedUrl\", null), t([p({\n type: Boolean,\n readOnly: !0\n})], h.prototype, \"persistenceEnabled\", void 0), t([p({\n type: Boolean\n})], h.prototype, \"popupEnabled\", void 0), t([p({\n type: Boolean\n})], h.prototype, \"attributionVisible\", void 0), t([p({\n type: u\n})], h.prototype, \"spatialReference\", void 0), t([p({\n type: String\n})], h.prototype, \"title\", void 0), t([p({\n readOnly: !0,\n json: {\n read: !1\n }\n})], h.prototype, \"type\", void 0), t([p()], h.prototype, \"url\", void 0), t([p({\n type: Boolean,\n nonNullable: !0\n})], h.prototype, \"visible\", void 0), h = t([y(\"esri.layers.Layer\")], h);\nconst b = h;\nexport { b as default };"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,SAAeA,GAAEA,IAAG;AAAA;AAClB,UAAM,IAAI,gBAAgBA,KAAIA,KAAI;AAAA,MAC9B,YAAYA;AAAA,IACd,GACA;AAAA,MACE,UAAUC;AAAA,IACZ,IAAI,MAAM,OAAO,qBAAsC;AACzD,QAAI;AACF,aAAO,MAAMA,GAAE,CAAC;AAAA,IAClB,SAAS,GAAG;AACV,YAAMD,KAAI,KAAK,EAAE,YACfC,KAAID,IAAG,MAAM,SACb,IAAIA,MAAKA,GAAE,UAAUA,GAAE,OAAO,OAAO,EAAE;AACzC,YAAME,GAAE,UAAU,oCAAoC,EAAE,MAAM,qBAAqB,uDAAuD,IAAI,aAAaD,KAAI,MAAM,CAAC,GAAG;AAAA,IAC3K;AAAA,EACF;AAAA;;;ACCA,IAAIE,KAAI;AAAR,IACE,IAAI,cAAc,EAAE,aAAaC,GAAE,CAAC,CAAC,EAAE;AAAA,EACrC,cAAc;AACZ,UAAM,GAAG,SAAS,GAAG,KAAK,qBAAqB,MAAM,KAAK,aAAa,IAAI,EAAE,MAAM,KAAK,KAAK,IAAI,EAAE,KAAK,GAA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