/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["exports","../../../../symbols/support/svgUtils","../../../../symbols/support/utils","../../../support/widgetUtils","../../../support/jsxFactory"],(function(e,a,t,r,s){"use strict";const l="http://www.w3.org/2000/svg",i={diamondContainer:"esri-relationship-ramp--diamond__container",diamondLeftCol:"esri-relationship-ramp--diamond__left-column",diamondRightCol:"esri-relationship-ramp--diamond__right-column",diamondMidCol:"esri-relationship-ramp--diamond__middle-column",diamondMidColLabel:"esri-relationship-ramp--diamond__middle-column--label",diamondMidColRamp:"esri-relationship-ramp--diamond__middle-column--ramp",squareTable:"esri-relationship-ramp--square__table",squareTableRow:"esri-relationship-ramp--square__table-row",squareTableCell:"esri-relationship-ramp--square__table-cell",squareTableLabel:"esri-relationship-ramp--square__table-label",squareTableLabelLeftBottom:"esri-relationship-ramp--square__table-label--left-bottom",squareTableLabelRightBottom:"esri-relationship-ramp--square__table-label--right-bottom",squareTableLabelLeftTop:"esri-relationship-ramp--square__table-label--left-top",squareTableLabelRightTop:"esri-relationship-ramp--square__table-label--right-top"};function o(e,a,t,l){const{focus:o,labels:n}=e,m=!!o,u=d(e,a,t,l),b={justifyContent:"center"},p=r.isRTL();return m?s.tsx("div",{class:i.diamondContainer,styles:b},s.tsx("div",{class:i.diamondLeftCol},p?n.right:n.left),s.tsx("div",{class:i.diamondMidCol},s.tsx("div",{class:i.diamondMidColLabel},n.top),u,s.tsx("div",{class:i.diamondMidColLabel},n.bottom)),s.tsx("div",{class:i.diamondRightCol},p?n.left:n.right)):s.tsx("div",{class:i.squareTable},s.tsx("div",{class:i.squareTableRow},s.tsx("div",{class:r.classes(i.squareTableCell,i.squareTableLabel,i.squareTableLabelRightBottom)},p?n.top:n.left),s.tsx("div",{class:i.squareTableCell}),s.tsx("div",{class:r.classes(i.squareTableCell,i.squareTableLabel,i.squareTableLabelLeftBottom)},p?n.left:n.top)),s.tsx("div",{class:i.squareTableRow},s.tsx("div",{class:i.squareTableCell}),u,s.tsx("div",{class:i.squareTableCell})),s.tsx("div",{class:i.squareTableRow},s.tsx("div",{class:r.classes(i.squareTableCell,i.squareTableLabel,i.squareTableLabelRightTop)},p?n.right:n.bottom),s.tsx("div",{class:i.squareTableCell}),s.tsx("div",{class:r.classes(i.squareTableCell,i.squareTableLabel,i.squareTableLabelLeftTop)},p?n.bottom:n.right)))}function n(e,a,t){const r=`${t}_arrowStart`,s=`${t}_arrowEnd`,l="left"===e,i={markerStart:null,markerEnd:null};switch(a){case"HL":l?i.markerStart=`url(#${s})`:i.markerEnd=`url(#${r})`;break;case"LL":i.markerStart=`url(#${s})`;break;case"LH":l?i.markerEnd=`url(#${r})`:i.markerStart=`url(#${s})`;break;default:i.markerEnd=`url(#${r})`}return i}function d(e,r,o,d,m=60){const{focus:u,numClasses:b,colors:p,rotation:c}=e,h=!!u,f=Math.sqrt(m**2+m**2)+(h?0:5),x=[],k=[],q=[],T=(m||75)/b;for(let t=0;t<b;t++){const e=t*T;for(let r=0;r<b;r++){const s=r*T,l=a.generateFillAttributes(p[t][r]),i=a.generateStrokeAttributes(null),o={type:"rect",x:s,y:e,width:T,height:T};x.push(a.renderDef(l)),k.push(a.renderShape(o,l.fill,i,null)),q.push(a.getBoundingBox(o))}}const g=10,_=15,L=15,C=10;let v=null;h||(v="margin: -15px -15px -18px -15px");const w=n("left",u,r),y=n("right",u,r),R=a.computeBBox(q),S=a.getTransformMatrix(R,f,f,0,!1,c,!1),M=a.getTransformMatrix(R,f,f,0,!1,h?-45:null,!1),$={filter:t.getCSSFilterFromEffectList(d),opacity:null==o?null:`${o}`};return s.tsx("div",{styles:$,class:h?i.diamondMidColRamp:i.squareTableCell},s.tsx("svg",{xmlns:l,width:f,height:f,style:v},s.tsx("defs",null,s.tsx("marker",{id:`${r}_arrowStart`,markerWidth:"10",markerHeight:"10",refX:"5",refY:"5",markerUnits:"strokeWidth",orient:"auto"},s.tsx("polyline",{points:"0,0 5,5 0,10",fill:"none",stroke:"#555555","stroke-width":"1"})),s.tsx("marker",{id:`${r}_arrowEnd`,markerWidth:"10",markerHeight:"10",refX:"0",refY:"5",markerUnits:"strokeWidth",orient:"auto"},s.tsx("polyline",{points:"5,0 0,5 5,10",fill:"none",stroke:"#555555","stroke-width":"1"})),x),s.tsx("g",{transform:S},k),s.tsx("g",{transform:M},s.tsx("line",{fill:"none",stroke:"#555555","stroke-width":"1","marker-start":w.markerStart,"marker-end":w.markerEnd,x1:-g,y1:m-_,x2:-g,y2:_}),s.tsx("line",{fill:"none",stroke:"#555555","stroke-width":"1","marker-start":y.markerStart,"marker-end":y.markerEnd,x1:L,y1:m+C,x2:m-L,y2:m+C}))))}e.renderRelationshipRamp=o,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
