import { j } from "./chunk-LU5IJZB4.js"; import { d } from "./chunk-SFEFRQCL.js"; import { U } from "./chunk-DVUG3KID.js"; import { F, Ot } from "./chunk-VEGAOVMY.js"; import { w } from "./chunk-V6P2MAQQ.js"; import { s3 as s } from "./chunk-E5O6P5I2.js"; import { has } from "./chunk-SPWQ3AWG.js"; import { r } from "./chunk-YXWMMD76.js"; // node_modules/@arcgis/core/support/featureFlags.js var e = () => !!has("enable-feature:force-wosr"); var t = () => !!has("enable-feature:SceneLayer-editing"); // node_modules/@arcgis/core/symbols/support/styleUtils.js var u = {}; async function f(e2, r2) { try { return { data: (await b(e2, r2)).data, baseUrl: Ot(e2), styleUrl: e2 }; } catch (t2) { return w(t2), null; } } function i(e2, r2, o) { const s2 = r(r2.portal) ? r2.portal : j.getDefault(); let n; const a = `${s2.url} - ${s2.user && s2.user.username} - ${e2}`; return u[a] || (u[a] = y(e2, s2, o).then((e3) => (n = e3, e3.fetchData())).then((r3) => { var _a; return { data: r3, baseUrl: (_a = n.itemUrl) != null ? _a : "", styleName: e2 }; })), u[a]; } function y(e2, t2, o) { return t2.load(o).then(() => { const r2 = new d({ disableExtraQuery: true, query: `owner:${j2} AND type:${h} AND typekeywords:"${e2}"` }); return t2.queryItems(r2, o); }).then(({ results: t3 }) => { var _a; let s2 = null; const n = e2.toLowerCase(); if (t3 && Array.isArray(t3)) for (const e3 of t3) { const r2 = (_a = e3.typeKeywords) == null ? void 0 : _a.some((e4) => e4.toLowerCase() === n); if (r2 && e3.type === h && e3.owner === j2) { s2 = e3; break; } } if (!s2) throw new s("symbolstyleutils:style-not-found", `The style '${e2}' could not be found`, { styleName: e2 }); return s2.load(o); }); } function c(e2, o, s2) { return e2 && r(e2.styleUrl) ? f(e2.styleUrl, s2) : e2 && r(e2.styleName) ? i(e2.styleName, o, s2) : Promise.reject(new s("symbolstyleutils:style-url-and-name-missing", "Either styleUrl or styleName is required to resolve a style")); } function p(e2) { return null === e2 || "CIMSymbolReference" === e2.type ? e2 : { type: "CIMSymbolReference", symbol: e2 }; } function d2(e2, r2) { if ("cimRef" === r2) return e2.cimRef; if (e2.formatInfos && !e()) { for (const t2 of e2.formatInfos) if ("gltf" === t2.type) return t2.href; } return e2.webRef; } function b(r2, t2) { const o = { responseType: "json", query: { f: "json" }, ...t2 }; return U(F(r2), o); } var j2 = "esri_en"; var h = "Style"; var w2 = "https://cdn.arcgis.com/sharing/rest/content/items/220936cc6ed342c9937abd8f180e7d1e/resources/styles/cim/{SymbolName}.json?f=json"; export { t, c, p, d2 as d, b, w2 as w }; //# sourceMappingURL=chunk-HKJ7X3BD.js.map