import{t as F,a as u,n as T,s as X}from"./B2uy2sCz.js";import{p as C,f as k,s as w,a as E,t as j,c as B,r as L,j as _,o as D,q as G,l as H}from"./CXd5mRv3.js";import{p,i as A,b as I}from"./CMPZDoqW.js";import{g as v}from"./pKKESLv8.js";import"./BzArsHZA.js";import{c as e}from"./Bav1VHWD.js";import{S as J}from"./CeTYvXfJ.js";import"./CXw7gMMa.js";var K=F("<!> <!>",1),M=F("<!> <!>",1);function ot(g,t){C(t,!0);const h=p(t,"showLabel",3,!1),{x:s,y:c,width:l,height:o,annotation_label:{annotation_label_name:a}}=t.annotation,f=v(a,1),i=v(a,.8).color,n=v(a,.4).color;var b=M(),m=k(b);{var d=r=>{P(r,{coordinates:[s,c],colorText:f,label:a})};A(m,r=>{h()&&r(d)})}var x=w(m,2);{var q=r=>{var S=K(),y=k(S);J(y,{get segmentation(){return t.annotation.segmentation__binary_mask__rle_row_wise},get width(){return t.imageWidth},colorFill:n});var W=w(y,2);z(W,{bbox:[s,c,l,o],label:a,colorStroke:i,get colorFill(){return v(a,.1).color}}),u(r,S)},R=r=>{z(r,{bbox:[s,c,l,o],label:a,colorStroke:i,colorFill:n})};A(x,r=>{t.annotation.segmentation__binary_mask__rle_row_wise?r(q):r(R,!1)})}u(g,b),E()}var N=T('<rect vector-effect="non-scaling-stroke" stroke-width="2" pointer-events="all"></rect>');function z(g,t){const[h,s,c,l]=t.bbox;var o=N();e(o,"x",h),e(o,"y",s),e(o,"width",c),e(o,"height",l),j(()=>{e(o,"stroke",t.colorStroke),e(o,"fill",t.colorFill),e(o,"aria-label",t.label)}),u(g,o)}var O=T('<g class="unscaled"><rect></rect><text class="annotation-label-text"> </text></g>');function P(g,t){C(t,!0);const h=p(t,"fontSize",3,14),[s,c]=t.coordinates;let l=D(null);const o=H(()=>{if(_(l))return _(l).getBBox()}),a=5;var f=O();e(f,"transform",`translate(${s}, ${c})`);var i=B(f),n=w(i);e(n,"x",a),e(n,"y",-5);var b=B(n,!0);L(n),I(n,m=>G(l,m),()=>_(l)),L(f),j(()=>{var m,d,x;e(i,"y",-((m=_(o))==null?void 0:m.height)),e(i,"width",((d=_(o))==null?void 0:d.width)+a*2),e(i,"height",(x=_(o))==null?void 0:x.height),e(i,"fill",t.colorText.color),e(n,"fill",t.colorText.contrastColor),e(n,"font-size",h()),X(b,t.label)}),u(g,f),E()}export{ot as S};
