{"version":3,"sources":["node_modules/@arcgis/core/core/CollectionFlattener.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 { _ as t } from \"../chunks/tslib.es6.js\";\nimport o from \"./Collection.js\";\nimport \"./asyncUtils.js\";\nimport \"./Error.js\";\nimport \"./Logger.js\";\nimport \"./accessorSupport/watch.js\";\nimport { autorun as s } from \"./accessorSupport/trackingUtils.js\";\nimport { property as e } from \"./accessorSupport/decorators/property.js\";\nimport { subclass as r } from \"./accessorSupport/decorators/subclass.js\";\nlet i = class extends o {\n constructor(t) {\n super(t), this.getCollections = null;\n }\n initialize() {\n this.addHandles(s(() => this._refresh()));\n }\n destroy() {\n this.getCollections = null;\n }\n _refresh() {\n const t = null != this.getCollections ? this.getCollections() : null;\n if (null == t) return void this.removeAll();\n let o = 0;\n for (const s of t) null != s && (o = this._processCollection(o, s));\n this.splice(o, this.length);\n }\n _createNewInstance(t) {\n return new o(t);\n }\n _processCollection(t, o) {\n if (!o) return t;\n const s = this.itemFilterFunction ?? (t => !!t);\n for (const e of o) if (e) {\n if (s(e)) {\n const o = this.indexOf(e, t);\n o >= 0 ? o !== t && this.reorder(e, t) : this.add(e, t), ++t;\n }\n if (this.getChildrenFunction) {\n const o = this.getChildrenFunction(e);\n if (Array.isArray(o)) for (const s of o) t = this._processCollection(t, s);else t = this._processCollection(t, o);\n }\n }\n return t;\n }\n};\nt([e()], i.prototype, \"getCollections\", void 0), t([e()], i.prototype, \"getChildrenFunction\", void 0), t([e()], i.prototype, \"itemFilterFunction\", void 0), i = t([r(\"esri.core.CollectionFlattener\")], i);\nconst l = i;\nexport { l as default };"],"mappings":";;;;;;;;;;;;;;;AAaA,IAAIA,KAAI,cAAc,EAAE;AAAA,EACtB,YAAY,GAAG;AACb,UAAM,CAAC,GAAG,KAAK,iBAAiB;AAAA,EAClC;AAAA,EACA,aAAa;AACX,SAAK,WAAW,EAAE,M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