/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["require","exports"],(function(e,t){"use strict";function r(e){return"function"==typeof e}function n(e,t,n,o){return r(e)?e(t,n,o):e}function o(e){return[e.r,e.g,e.b,e.a]}function i(e,t,r){const n=" /-,\n",o=e=>{let t=e.length;for(;t--;)if(!n.includes(e.charAt(t)))return!1;return!0},i=[];let l=0,u=-1;do{if(u=t.indexOf("[",l),u>=l){if(u>l){const e=t.substr(l,u-l);i.push([e,null,o(e)])}if(l=u+1,u=t.indexOf("]",l),u>=l){if(u>l){const r=e[t.substr(l,u-l)];r&&i.push([null,r,!1])}l=u+1}}}while(-1!==u);if(l<t.length-1){const e=t.substr(l);i.push([e,null,o(e)])}return e=>{let t="",n=null;for(const r of i){const[o,i,a]=r;if(o)a?n=o:(n&&(t+=n,n=null),t+=o);else{const r=e.attributes[i];r&&(n&&(t+=n,n=null),t+=r)}}return a(t,r)}}function a(e,t){switch("string"!=typeof e&&(e=String(e)),t){case"LowerCase":return e.toLowerCase();case"Allcaps":return e.toUpperCase();default:return e}}function l(e,t,r,n,o,i,a=!0){const l=t/o,u=r/i,c=Math.ceil(l/2),s=Math.ceil(u/2);for(let M=0;M<i;M++)for(let r=0;r<o;r++){const f=4*(r+(a?i-M-1:M)*o);let C=0,p=0,y=0,I=0,m=0,k=0,d=0;const h=(M+.5)*u;for(let n=Math.floor(M*u);n<(M+1)*u;n++){const o=Math.abs(h-(n+.5))/s,i=(r+.5)*l,a=o*o;for(let u=Math.floor(r*l);u<(r+1)*l;u++){let r=Math.abs(i-(u+.5))/c;const o=Math.sqrt(a+r*r);o>=-1&&o<=1&&(C=2*o*o*o-3*o*o+1,C>0&&(r=4*(u+n*t),d+=C*e[r+3],y+=C,e[r+3]<255&&(C=C*e[r+3]/250),I+=C*e[r],m+=C*e[r+1],k+=C*e[r+2],p+=C))}}n[f]=I/p,n[f+1]=m/p,n[f+2]=k/p,n[f+3]=d/y}}function u(e){return e?{r:e[0],g:e[1],b:e[2],a:e[3]/255}:{r:0,g:0,b:0,a:0}}function c(e){var t;return null==(t=e.data)?void 0:t.symbol}function s(e){return"CIMVectorMarker"===e.type||"CIMPictureMarker"===e.type||"CIMBarChartMarker"===e.type||"CIMCharacterMarker"===e.type||"CIMPieChartMarker"===e.type||"CIMStackedBarChartMarker"===e.type}function M(e){return"CIMGradientStroke"===e.type||"CIMPictureStroke"===e.type||"CIMSolidStroke"===e.type}function f(e){return"CIMGradientFill"===e.type||"CIMHatchFill"===e.type||"CIMPictureFill"===e.type||"CIMSolidFill"===e.type||"CIMWaterFill"===e.type}function C(e){return"CIMMarkerPlacementAlongLineRandomSize"===e.type||"CIMMarkerPlacementAlongLineSameSize"===e.type||"CIMMarkerPlacementAlongLineVariableSize"===e.type||"CIMMarkerPlacementAtExtremities"===e.type||"CIMMarkerPlacementAtMeasuredUnits"===e.type||"CIMMarkerPlacementAtRatioPositions"===e.type||"CIMMarkerPlacementOnLine"===e.type||"CIMMarkerPlacementOnVertices"===e.type}const p=e=>isNaN(e)||!e?0:e,y=e=>{if(!e)return!1;for(const t of e)switch(t.type){case"CIMGeometricEffectBuffer":case"CIMGeometricEffectOffset":return!0}return!1};function I(){return new Promise(((t,r)=>e(["../../geometry/geometryEngineJSON"],t,r)))}t._adjustTextCase=a,t.colorToArray=o,t.createLabelOverrideFunction=i,t.evaluateValueOrFunction=n,t.fromCIMColor=u,t.getValue=p,t.importGeometryEngine=I,t.isCIMFill=f,t.isCIMMarker=s,t.isCIMMarkerStrokePlacement=C,t.isCIMStroke=M,t.isGeometryEngineRequired=y,t.resampleHermite=l,t.toCIMSymbolJSON=c,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
