/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
import "@arcgis/toolkit/type";
import { b as T } from "./series-types.js";
import { substitute as O } from "@arcgis/core/intl.js";
import "@arcgis/toolkit/intl";
import "lodash-es";
import "luxon";
import "d3-array";
import { bu as i, aQ as n, d3 as y, _ as M, bs as m, aY as r } from "./index.js";
import "@arcgis/core/Graphic.js";
import "@arcgis/core/renderers/support/jsonUtils.js";
import "@arcgis/core/symbols/support/symbolUtils.js";
import "@arcgis/core/layers/support/FeatureFilter.js";
import "@arcgis/core/smartMapping/statistics/histogram.js";
import "@arcgis/core/smartMapping/statistics/summaryStatistics.js";
import "simple-statistics";
import "@arcgis/core/request.js";
import "@arcgis/core/core/sql.js";
import "@arcgis/core/AttributeBinsGraphic.js";
import "@arcgis/core/geometry/support/jsonUtils.js";
import "@arcgis/core/rest/support/AttributeBinsQuery.js";
import "@arcgis/core/rest/support/StatisticDefinition.js";
import "@arcgis/core/time/TimeExtent.js";
import "@arcgis/core/core/promiseUtils.js";
import "./runtime.js";
import "@arcgis/toolkit/dom";
import { u as C, s as l } from "./utils.js";
import { g as A } from "./series-length.js";
import { g as h } from "./utils2.js";
const v = (s) => {
  l({ config: s, value: null, axisIndex: 0, isMax: !1 }), l({ config: s, value: null, axisIndex: 0, isMax: !0 }), l({ config: s, value: null, axisIndex: 1, isMax: !1 }), l({ config: s, value: null, axisIndex: 1, isMax: !0 });
};
function u(s, e, a) {
  const { layerFieldsInfo: t } = e, o = y(t, p(s));
  return O(a.titleLabels.distributionOfField, { valueField: o });
}
const p = (s) => s.series[0]?.x ?? "", is = (s) => {
  const { numericField: e, config: a, layerInfo: t, commonStrings: o } = s, { layerFieldsInfo: d } = t, c = u(a, t, o), D = A(a), S = h(0, a), x = y(d, p(a)), b = M(a);
  if (v(a), a?.series?.[0] && (a.series[0].x = e), x === S || b) {
    const f = y(d, e);
    C(a, 0, f);
  }
  a.title && (c === D || b) && (a.title.content.text = u(a, t, o));
}, os = (s) => s.series[0]?.dataTransformationType ?? T.None, ls = (s, e) => {
  v(e), e?.series?.[0] && (e.series[0].dataTransformationType = s);
}, ns = (s) => s.series[0]?.binCount ?? 32, ms = (s, e) => {
  v(e), e?.series?.[0] && (e.series[0].binCount = s);
}, ys = (s) => s.series[0]?.fillSymbol ?? i().fillSymbol, vs = (s, e) => {
  e?.series?.[0] && (e.series[0].fillSymbol = {
    ...e.series[0].fillSymbol,
    ...s
  });
}, F = (s) => s.series[0]?.overlays?.comparisonDistribution?.symbol ?? i().overlays.comparisonDistribution?.symbol ?? n(), ds = (s, e) => {
  e.series[0].overlays ??= m(), e.series[0].overlays.comparisonDistribution ??= r(4), e.series[0].overlays.comparisonDistribution.symbol = {
    ...e.series[0].overlays.comparisonDistribution.symbol,
    ...s
  };
}, I = (s) => s.series[0]?.overlays?.mean?.symbol ?? i().overlays.mean?.symbol ?? n(), bs = (s, e) => {
  e.series[0].overlays ??= m(), e.series[0].overlays.mean ??= r(1), e.series[0].overlays.mean.symbol = {
    ...e.series[0].overlays.mean.symbol,
    ...s
  };
}, N = (s) => s.series[0]?.overlays?.median?.symbol ?? i().overlays.median?.symbol ?? n(), us = (s, e) => {
  e.series[0].overlays ??= m(), e.series[0].overlays.median ??= r(2), e.series[0].overlays.median.symbol = {
    ...e.series[0].overlays.median.symbol,
    ...s
  };
}, B = (s) => s.series[0]?.overlays?.standardDeviation?.symbol ?? i().overlays.standardDeviation?.symbol ?? n(), ps = (s, e) => {
  e.series[0].overlays ??= m(), e.series[0].overlays.standardDeviation ??= r(3), e.series[0].overlays.standardDeviation.symbol = {
    ...e.series[0].overlays.standardDeviation.symbol,
    ...s
  };
}, cs = (s) => (s.series[0]?.overlays?.comparisonDistribution?.created ?? !1) && (s.series[0]?.overlays?.comparisonDistribution?.visible ?? !1), Ds = (s, e) => {
  const a = r(0);
  a.created = s, a.visible = s, a.symbol = F(e), e?.series?.[0]?.overlays && (e.series[0].overlays.comparisonDistribution = a);
}, Ss = (s) => (s.series[0]?.overlays?.mean?.created ?? !1) && (s.series[0]?.overlays?.mean?.visible ?? !1), xs = (s, e) => {
  const a = r(1);
  a.created = s, a.visible = s, a.symbol = I(e), e?.series?.[0]?.overlays && (e.series[0].overlays.mean = a);
}, fs = (s) => (s.series[0]?.overlays?.median?.created ?? !1) && (s.series[0]?.overlays?.median?.visible ?? !1), Ts = (s, e) => {
  const a = r(2);
  a.created = s, a.visible = s, a.symbol = N(e), e?.series?.[0]?.overlays && (e.series[0].overlays.median = a);
}, Os = (s) => (s.series[0]?.overlays?.standardDeviation?.created ?? !1) && (s.series[0]?.overlays?.standardDeviation?.visible ?? !1), Ms = (s, e) => {
  const a = r(3);
  a.created = s, a.visible = s, a.symbol = B(e), e?.series?.[0]?.overlays && (e.series[0].overlays.standardDeviation = a);
}, Cs = (s) => s?.series?.[0]?.overlays, As = (s, e) => {
  e?.series?.[0] !== void 0 && (e.series[0].overlays = s);
};
export {
  u as A,
  ns as a,
  ms as b,
  ys as c,
  vs as d,
  os as e,
  ls as f,
  p as g,
  I as h,
  bs as i,
  N as j,
  us as k,
  F as l,
  ds as m,
  B as n,
  ps as o,
  cs as p,
  Ds as q,
  Ss as r,
  is as s,
  xs as t,
  fs as u,
  Ts as v,
  Os as w,
  Ms as x,
  Cs as y,
  As as z
};
