Files
ADHA_mobile_project/assets/webStyleUtils-b7c16dd7.js
2024-02-28 17:06:42 +05:00

2 lines
1.0 KiB
JavaScript

import{c as u,a as b}from"./devEnvironmentUtils-4eab2a99.js";import{s as m,d2 as d,bv as s,db as f,d5 as c,d6 as i,j as p,I as w,d3 as h,dc as g}from"./index-b5c8f851.js";import{getStyleItemFromStyle as S}from"./webStyleSymbolUtils-50c3c237.js";async function M(e,a,t){if(!e.name)throw new m("style-symbol-reference-name-missing","Missing name in style symbol reference");if(e.styleName&&e.styleName==="Esri2DPointSymbolsStyle")return $(e,t);try{return N(await d(e,a,t),e.name,a,t)}catch(n){return s(n),null}}async function $(e,a){const t=f.replaceAll(/\{SymbolName\}/gi,e.name);try{const n=await c(t,a);return i(n.data)}catch(n){return s(n),null}}async function N(e,a,t,n){const y={portal:(t==null?void 0:t.portal)!=null?t.portal:p.getDefault(),url:w(e.baseUrl),origin:"portal-item"},o=S(a,e.data);if(!o)throw new m("symbolstyleutils:symbol-name-not-found",`The symbol name '${a}' could not be found`,{symbolName:a});let r=h(g(o,"cimRef"),y);u()&&(r=b(r));try{const l=await c(r,n);return i(l.data)}catch(l){return s(l),null}}export{M as fetchCIMSymbolReference};