(self.webpackChunkRemoteClient = self.webpackChunkRemoteClient || []).push([
  [6078],
  {
    76078: (e, n, t) => {
      'use strict';
      t.r(n), t.d(n, { createLabelFunction: () => f, formatField: () => x });
      var r = t(60991),
        s = t(92143),
        a = t(33921),
        l = t(14249),
        i = t(50203),
        u = t(60217);
      t(76506),
        t(81172),
        t(71552),
        t(31450),
        t(40642),
        t(57251),
        t(3482),
        t(9801),
        t(53523),
        t(34250),
        t(91306),
        t(86656),
        t(22723),
        t(59465),
        t(17533),
        t(74673),
        t(21972),
        t(23639),
        t(91055),
        t(27794),
        t(6906),
        t(50406),
        t(26341),
        t(42911),
        t(46826),
        t(45433),
        t(74569),
        t(21801),
        t(73796),
        t(97714),
        t(60947),
        t(2906),
        t(91597),
        t(86787),
        t(35132),
        t(89623),
        t(84069),
        t(44567),
        t(98380),
        t(92896),
        t(22781),
        t(32422);
      const o = s.L.getLogger('esri.layers.support.labelFormatUtils'),
        c = { type: 'simple', evaluate: () => null },
        p = { getAttribute: (e, n) => e.field(n) };
      async function f(e, n, s) {
        if (!e || !e.symbol) return c;
        const a = e.where,
          l = (0, i.a)(e),
          f = a ? await Promise.resolve().then(t.bind(t, 72274)) : null;
        let d;
        if ('arcade' === l.type) {
          const e = await (0, u.b)(l.expression, s, n);
          d = {
            type: 'arcade',
            evaluate(n) {
              try {
                const t = e.evaluate({
                  $feature: 'attributes' in n ? e.repurposeFeature(n) : e.repurposeAdapter(n),
                });
                if (null != t) return t.toString();
              } catch (e) {
                o.error(
                  new r.Z(
                    'bad-arcade-expression',
                    'Encountered an error when evaluating label expression for feature',
                    { feature: n, expression: l },
                  ),
                );
              }
              return null;
            },
            needsHydrationToEvaluate: () => null == (0, i.g)(l.expression),
          };
        } else
          d = {
            type: 'simple',
            evaluate: (e) =>
              l.expression.replace(/{[^}]*}/g, (t) => {
                const r = t.slice(1, -1),
                  s = n.get(r);
                if (!s) return t;
                let a = null;
                return (
                  'attributes' in e
                    ? e && e.attributes && (a = e.attributes[s.name])
                    : (a = e.field(s.name)),
                  null == a ? '' : x(a, s)
                );
              }),
          };
        if (a) {
          let e;
          try {
            e = f.WhereClause.create(a, n);
          } catch (e) {
            return c;
          }
          const t = d.evaluate;
          d.evaluate = (n) => {
            const r = 'attributes' in n ? void 0 : p;
            return e.testFeature(n, r) ? t(n) : null;
          };
        }
        return d;
      }
      function x(e, n) {
        if (null == e) return '';
        const t = n.domain;
        if (t)
          if ('codedValue' === t.type || 'coded-value' === t.type) {
            const n = e;
            for (const e of t.codedValues) if (e.code === n) return e.name;
          } else if ('range' === t.type) {
            const n = +e,
              r = 'range' in t ? t.range[0] : t.minValue,
              s = 'range' in t ? t.range[1] : t.maxValue;
            if (r <= n && n <= s) return t.name;
          }
        let r = e;
        return (
          'date' === n.type || 'esriFieldTypeDate' === n.type
            ? (r = (0, a.a)(r, (0, a.c)('short-date')))
            : (0, l.H7)(n) && (r = (0, a.f)(+r)),
          r || ''
        );
      }
    },
    50203: (e, n, t) => {
      'use strict';
      t.d(n, { a: () => o, b: () => c, c: () => f, d: () => p, g: () => _, t: () => u });
      var r = t(40642);
      const s = new RegExp('__begin__', 'ig'),
        a = new RegExp('__end__', 'ig'),
        l = new RegExp('^__begin__', 'i'),
        i = new RegExp('__end__$', 'i');
      function u(e) {
        return e.replace(new RegExp('\\{', 'g'), '[').replace(new RegExp('\\}', 'g'), ']');
      }
      function o(e) {
        const n = { expression: '', type: 'none' };
        return (
          e.labelExpressionInfo
            ? e.labelExpressionInfo.value
              ? ((n.expression = e.labelExpressionInfo.value), (n.type = 'conventional'))
              : e.labelExpressionInfo.expression &&
                ((n.expression = e.labelExpressionInfo.expression), (n.type = 'arcade'))
            : null != e.labelExpression &&
              ((n.expression = e.labelExpression
                .replace(new RegExp('\\[', 'g'), '{')
                .replace(new RegExp('\\]', 'g'), '}')),
              (n.type = 'conventional')),
          n
        );
      }
      function c(e) {
        const n = o(e);
        if (!n) return null;
        switch (n.type) {
          case 'conventional':
            return f(n.expression);
          case 'arcade':
            return n.expression;
        }
        return null;
      }
      function p(e) {
        const n = o(e);
        if (!n) return null;
        switch (n.type) {
          case 'conventional':
            return (function (e) {
              const n = e.match(x);
              return (n && n[1].trim()) || null;
            })(n.expression);
          case 'arcade':
            return _(n.expression);
        }
        return null;
      }
      function f(e) {
        let n;
        return (
          e
            ? ((n = (0, r.r)(e, (e) => '__begin__$feature["' + e + '"]__end__')),
              (n = l.test(n) ? n.replace(l, '') : '"' + n),
              (n = i.test(n) ? n.replace(i, '') : n + '"'),
              (n = n.replace(s, '" + ').replace(a, ' + "')))
            : (n = '""'),
          n
        );
      }
      const x = /^\s*\{([^}]+)\}\s*$/i,
        d = /^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])([\w\s]+)(\2)\]));?\s*$/i,
        g = /^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])([\w\s]+)(\2)\]));?\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])(\1|\3)(\5)\s*\));?\s*$/i,
        b = /^\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])([\w\s]+)(\1)\s*\));?\s*$/i;
      function _(e) {
        if (!e) return null;
        let n = d.exec(e) || g.exec(e);
        return n ? n[1] || n[3] : ((n = b.exec(e)), n ? n[2] : null);
      }
    },
  },
]);
