import{_ as d,k as l,j as s,ao as c,b8 as x,r as i,$ as p,b1 as h,ap as m,C as b,bz as u,b as f,cM as y}from"./index-46ma1THH.js";import{V as g}from"./ViewTransformation-BHQuUfcb.js";var w=d(function(e,n){var r=Number(n),t=0,a;if(r<0||isNaN(r))throw new RangeError("n must be a non-negative number");for(a=new Array(r);t<r;)a[t]=e(t),t+=1;return a}),$=d(function(e,n){return w(l(e),n)});const C={bg:"white",p:"10px",borderStyle:"solid",borderWidth:"1px",borderColor:"grayShade1"},v=(o,e=[])=>({table:{whiteSpace:"nowrap","tr:nth-of-type(1)":{position:"sticky",top:"32px",background:o.colors.white,td:{pt:"20px",pb:"10px",boxShadow:`
         inset 0 -2px 0 0 ${o.colors.grayShade2}`}},"tr:nth-of-type(2)":{borderTop:"none"},...e.reduce((n,r)=>({...n,[`tr:nth-of-type(${r+2})`]:{bg:"grayShade2",borderBottom:"1px solid gray"}}),{}),td:{px:"10px"},"td:nth-of-type(1)":{pl:"20px"},"td:nth-of-type(2)":{span:{ml:"initial"}},"td:nth-of-type(6)":{pr:"20px"},"tr:last-of-type":{border:"none"}}}),k=({maxLength:o=40,value:e,...n})=>{const r=String(e).length<=o,t=r?String(e):`${String(e).slice(0,o-3)}...`;return s.jsx(c,{isDisabled:r,mainText:String(e),children:s.jsx(x,{value:t,...n})})},j=({transformations:o=[],name:e,showTFName:n})=>{const[r,t]=i.useState();return s.jsxs(p,{gap:"8px",children:[o.map(a=>s.jsx(i.Fragment,{children:s.jsxs(h,{p:"0 0 0 0px",intent:"inline",onClick:()=>t(a),children:[n?a.hopsworksUdf.name:e,s.jsx(m,{icon:b.arrows_maximize,size:"xs",color:"primary",ml:"5px"})]})},a.id)),s.jsx(u,{size:"7xl",title:`${r==null?void 0:r.hopsworksUdf.name} transformation code preview`,isOpen:!!r,onClose:()=>t(void 0),mainButtonProps:{children:"Done",onClick:()=>t(void 0)},children:s.jsx(g,{...r,featureName:e})})]})},_=i.memo(j),E=({content:o,hasTitle:e=!0,...n})=>s.jsx(f,{...n,children:s.jsx(p,{sx:{gap:"20px",flexDirection:"column"},children:o.map(({title:r,code:t,language:a})=>s.jsx(p,{width:"100%",children:s.jsx(y,{title:r,copyButton:!0,content:t,language:a,padding:"0"})},`${r}-${t}-${a}`))})});export{E as C,k as E,_ as T,C as c,v as f,$ as r,w as t};
