/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["exports","../../../core/lang","../../../symbols/support/gfxUtils","../../../symbols/support/previewSymbol3D"],(function(t,e,o,l){"use strict";const s={HH:315,HL:45,LL:135,LH:225},r={2:[["HL","HH"],["LL","LH"]],3:[["HL","HM","HH"],["ML","MM","MH"],["LL","LM","LH"]],4:[["HL","HM1","HM2","HH"],["M2L","M2M1","M2M2","M2H"],["M1L","M1M1","M1M2","M1H"],["LL","LM1","LM2","LH"]]};function n(t){if(!t)return;const{type:e}=t;if(e.includes("3d"))return l.getSymbolLayerFill(t.symbolLayers.getItemAt(0));if("simple-line"===e){const e=o.getStroke(t);return e&&e.color}if("simple-marker"===t.type&&("x"===t.style||"cross"===t.style)){const e=o.getStroke(t);return e&&e.color}return o.getFill(t)}function i(t,e){const o=e.HH.label,l=e.LL.label,s=e.HL.label,r=e.LH.label;switch(t){case"HH":default:return{top:o,bottom:l,left:s,right:r};case"HL":return{top:s,bottom:r,left:l,right:o};case"LL":return{top:l,bottom:o,left:r,right:s};case"LH":return{top:r,bottom:s,left:o,right:l}}}function u(t,o){const l=[],s=t.length**.5,r=e.clone(t),n=(o||"HH").split(""),i=n[0],u="H"===n[1];for(;r.length;){const t=[];for(;t.length<s;)t.push(r.shift());u&&t.reverse(),l.push(t)}return"L"===i&&l.reverse(),l}function c(t){const{focus:e,infos:o,numClasses:l}=t,s=r[l],u={};o.forEach((t=>{u[t.value]={label:t.label,fill:n(t.symbol)}}));const c=[];for(let r=0;r<l;r++){const t=[];for(let e=0;e<l;e++){const o=u[s[r][e]];t.push(o.fill)}c.push(t)}return{type:"relationship-ramp",numClasses:l,focus:e,colors:c,labels:i(e,u),rotation:H(e)}}function H(t){let e=s[t];return t&&null==e&&(e=s.HH),e||0}t.getRelationshipRampColors2D=u,t.getRelationshipRampElement=c,t.getRotationAngleForFocus=H,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
