import{cl as q,_ as v,$ as V,eO as I,eP as D,eQ as F,a0 as z,cp as B,s as N}from"./index.6c049565.js";const $=new q({classBreaksDef:"class-breaks-definition",uniqueValueDef:"unique-value-definition"});let x=class extends B{constructor(){super(...arguments),this.baseSymbol=null,this.colorRamp=null,this.type=null}};v([V({type:I,json:{write:!0}})],x.prototype,"baseSymbol",void 0),v([V({types:D,json:{read:{reader:F},write:!0}})],x.prototype,"colorRamp",void 0),v([V({json:{read:$.read,write:$.write}})],x.prototype,"type",void 0),x=v([z("esri.rest.support.ClassificationDefinition")],x);const T=x,S=new q({esriClassifyEqualInterval:"equal-interval",esriClassifyManual:"manual",esriClassifyNaturalBreaks:"natural-breaks",esriClassifyQuantile:"quantile",esriClassifyStandardDeviation:"standard-deviation",esriClassifyDefinedInterval:"defined-interval"}),C=new q({esriNormalizeByLog:"log",esriNormalizeByPercentOfTotal:"percent-of-total",esriNormalizeByField:"field"});let y=class extends T{constructor(){super(...arguments),this.breakCount=null,this.classificationField=null,this.classificationMethod=null,this.normalizationField=null,this.normalizationType=null,this.type="class-breaks-definition"}set standardDeviationInterval(a){this.classificationMethod==="standard-deviation"&&this._set("standardDeviationInterval",a)}set definedInterval(a){this.classificationMethod==="defined-interval"&&this._set("definedInterval",a)}};v([V({json:{write:!0}})],y.prototype,"breakCount",void 0),v([V({json:{write:!0}})],y.prototype,"classificationField",void 0),v([V({type:String,json:{read:S.read,write:S.write}})],y.prototype,"classificationMethod",void 0),v([V({json:{write:!0}})],y.prototype,"normalizationField",void 0),v([V({json:{read:C.read,write:C.write}})],y.prototype,"normalizationType",void 0),v([V({value:null,json:{write:!0}})],y.prototype,"standardDeviationInterval",null),v([V({value:null,json:{write:!0}})],y.prototype,"definedInterval",null),v([V()],y.prototype,"type",void 0),y=v([z("esri.rest.support.ClassBreaksDefinition")],y);const G=y,E=N.getLogger("esri.rest.support.generateRendererUtils");function M(a,r){return Number(a.toFixed(r))}function H(a){const{normalizationTotal:r}=a;return{classBreaks:_(a),normalizationTotal:r}}function _(a){const r=a.definition,{classificationMethod:n,breakCount:i,normalizationType:u,definedInterval:p}=r,c=[];let l=a.values;if(l.length===0)return[];l=l.sort((s,f)=>s-f);const d=l[0],h=l[l.length-1];if(n==="equal-interval")if(l.length>=i){const s=(h-d)/i;let f=d;for(let t=1;t{c.push({minValue:s,maxValue:s,label:b(s,s,u)})});else if(n==="natural-breaks"){const s=L(l),f=a.valueFrequency||s.valueFrequency,t=R(s.uniqueValues,f,i);let e=d;for(let o=1;oo){const m=M(s.uniqueValues[t[o]],6);c.push({minValue:e,maxValue:m,label:b(e,m,u)}),e=m}c.push({minValue:e,maxValue:h,label:b(e,h,u)})}else if(n==="quantile")if(l.length>=i&&d!==h){let s=d,f=Math.ceil(l.length/i),t=0;for(let e=1;el.length&&(o=l.length-1),o<0&&(o=0),c.push({minValue:s,maxValue:l[o],label:b(s,l[o],u)}),s=l[o],t+=f,f=Math.ceil((l.length-t)/(i-e))}c.push({minValue:s,maxValue:h,label:b(s,h,u)})}else{let s=-1;for(let f=0;f=1;g--){const k=M(s-(g-.5)*t,6);c.push({minValue:o,maxValue:k,label:b(o,k,u)}),o=k,e++}let m=M(s+.5*t,6);c.push({minValue:o,maxValue:m,label:b(o,m,u)}),o=m,e++;for(let g=1;g<=i;g++)m=e===2*i?h:M(s+(g+.5)*t,6),c.push({minValue:o,maxValue:m,label:b(o,m,u)}),o=m,e++}}else if(n==="defined-interval"){if(!p)return c;const s=l[0],f=l[l.length-1],t=Math.ceil((f-s)/p);let e=s;for(let o=1;oi&&(n=i);for(let c=0;c0&&o!==a[e+1]&&Math.abs(s-d[e])>Math.abs(s-d[e-1]))a[e]=o;else if(eMath.abs(s-d[e+1])){a[e+1]=o-1;break}f=l,l=0,p=[],c=[];for(let e=0;ef){for(let e=0;e0;t--)for(;n[t]!==n[t-1]+1;){n[t]=n[t]-1;const e=w(t-1,n,i,u);d=e.sbMean,c=e.sbSdcm;const o=w(t,n,i,u);if(h=o.sbMean,l=o.sbSdcm,!(c+l=1?1:p>=.5?.5:.25,p}function Q(a){let r=0;for(let n=0;n