/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
import{p as U}from"./UG7LOBJE.js";import a from"./AD6GOUND.js";import{a as c,b as u,f as h,h as L,y as S}from"./NKG4FLLR.js";export default $arcgis.t(([,,,,,{substitute:D},,,,,,,,,,{Db:M,Gb:b,Ia:k,Jc:F,Kb:T,Nc:v,Sb:q,Sc:C,T:w,Tc:V,Uc:$,V:A,X:B,Xd:I,ed:P,ka:j,w:O}])=>{function de(i,e,a){let t=i?.axes?.[e];t?.title!==void 0?t.title.content.text=a:t!==void 0&&(t.title=A({text:a,visible:!0,font:w(O.AxisTitle)}))}function xe(i){let{config:e,layerInfo:a,commonStrings:t,numericFields:s,aggregationType:o}=i,r="";if(e)if(M(e)===h.Stacked100)r=t.utilsStrings.statistics.percent;else{let n=k(o,t);if(e.series[0]?.type===c.HeatSeries)r=b(a.layerFieldsInfo,e.series[0].y);else if(s.length===1){let g=b(a.layerFieldsInfo,s[0]),m=v(a.layer).idField;o===u.NoAggregation?r=g:o===u.Count&&m!==void 0&&s[0]===m?r=t.utilsStrings.statistics.count:r=D(t.axisLabels.aggregationOfFieldName,{aggregation:n,fieldName:g})}else s.length>1&&(o===u.NoAggregation?r=t.axisLabels.values:r=D(t.axisLabels.aggregationOfValues,{aggregation:n}))}return r}var W=(i,e,a)=>i.axes?.[e]??j(a,i.type)[e],H=i=>{let{config:e,axis:a,axisIndex:t}=i;e.axes!==void 0&&(e.axes[t]=a)},pe=i=>{let{config:e,axisIndex:a,isMax:t}=i,s=Number.NaN;return t?s=e.axes?.[a]?.maximum:s=e.axes?.[a]?.minimum,s??Number.NaN},E=i=>{let{config:e,value:a,axisIndex:t,isMax:s}=i,o=e?.axes?.[t];o!==void 0&&(s?o.maximum=a:o.minimum=a)},ye=i=>i.axes?.[0]?.valueFormat??B(),be=(i,e,a)=>{let t=W(i,0,e);if(t!==void 0&&a!==void 0){let s={...t,valueFormat:a};H({config:i,axis:s,axisIndex:0})}},Fe=(i,e,a)=>{let t=i.axes?.[e];t!==void 0&&(t.integerOnlyValues=a)},X=i=>{let e=S(i.series);return e===c.BarSeries||e===c.ComboLineAndBarSeries||e===c.LineSeries},Y=i=>{let{axisIndex:e,config:a,isMultiAxis:t}=i,s=!1;return e===0||e===1&&t?s=!0:e===2&&(s=X(a)),s},ve=i=>{let{axisIndex:e,func:a,config:t}=i;return Y({axisIndex:e,config:t,isMultiAxis:!0})?a(e):void 0},R=(i,e)=>{let a,t=e.axes?.[i]?.valueFormat;return(i===0||i>=1&&U(t))&&(a=t),a},Ie=i=>{let{config:e,commonStrings:a,valueFormat:t,axisIndex:s=0}=i,o=W(e,s,a);if(o!==void 0&&t!==void 0){let r={...o,valueFormat:t};H({config:e,axis:r,axisIndex:s})}},Ne=(i,e)=>i.axes?.[e]?.isLogarithmic??!1,he=i=>{let{config:e,isLogarithmic:a,axisIndex:t}=i,s=e.axes?.[t];s&&(s.isLogarithmic=a,E({config:e,value:null,axisIndex:t,isMax:!0}),E({config:e,value:null,axisIndex:t,isMax:!1}))},Le=i=>{let{config:e,scrollbar:a,axisIndex:t}=i;e.axes?.[t]!==void 0&&(e.axes[t].scrollbar=a)};async function Se(i){let{config:e,layer:a,xAxisField:t,splitByField:s,layerFieldsInfo:o,aggregationFields:r,fetchNullValues:n}=i,g=o.filter(y=>y.name===s)[0]?.type,m=n!==!0?`${s} IS NOT NULL`:"",d=t&&n!==!0?`${t} IS NOT NULL`:"",{where:f}=e?.dataFilters??{},K={where:F([f,m,d]),orderByFields:T(s)?[]:[`${s} ${L.Ascending}`],geometry:e?.dataFilters?.geometry},N=a,x="";r.length===0?x=v(N).idField:[x]=r;let p=await I({queryObject:N,category:e?.series[0].x??"",splitByField:s,queryConfig:K});if(e){let y=e?.series.map(l=>P({where:l.query?.where})?.toString()??"").filter(l=>l!==void 0&&l!=="");p=q({arrayA:p,arrayB:y,getKey:l=>l===null?null:l?.toString()})}return{categoriesArray:p,splitByFieldType:g,numericalField:x}}function Oe(i,e){let a=e==="";for(let t of i)if(e===t.name){a=!0;break}return a}function we(i,e){let a=C(i),t=e.length===0,s=0;for(let o of e){for(let r of a)if(o===r&&(s+=1),s===e.length){t=!0;break}if(t)break}return t}function Ae(i,e){e.forEach(a=>{Object.getOwnPropertyNames(a.prototype).forEach(t=>{Object.defineProperty(i.prototype,t,Object.getOwnPropertyDescriptor(a.prototype,t)||Object.create(null))})})}async function Be(i){let{layerInfo:e,config:a,category:t}=i,{layer:s}=e,{where:o}=a?.dataFilters??{},{fetchNullValues:r}=a?.series?.[0]?.query??{},n=r!==!0?`${t} IS NOT NULL`:"",g={where:F([o,n]),orderByFields:[],geometry:a?.dataFilters?.geometry},m=V(s);return(await I({queryObject:s,category:t,queryConfig:g})).map(d=>{let f=String(d);return $({fieldName:t,fieldValueToMatch:f,subtypeInfo:m,fieldList:e.layerFieldsInfo})??f})}function je(i){return i!==void 0&&R(0,i)?.type===c.CategoryAxisFormat&&R(1,i)?.type===c.CategoryAxisFormat}return{a:de,b:xe,c:pe,d:E,e:ye,f:be,g:Fe,h:ve,i:R,j:Ie,k:Ne,l:he,m:Le,n:Se,o:Oe,p:we,q:Ae,r:Be,s:je}},"core/promiseUtils","request","Graphic","renderers/support/jsonUtils","symbols/support/symbolUtils","intl","layers/support/FeatureFilter","smartMapping/statistics/histogram","smartMapping/statistics/summaryStatistics","core/sql","AttributeBinsGraphic","geometry/support/jsonUtils","rest/support/AttributeBinsQuery","rest/support/StatisticDefinition","time/TimeExtent",a)