import{_ as d,h as l,j as n,am as c,aN as x,r as i,d as p,b6 as h,an as m,T as u,be as b,Q as f,cu as y}from"./index-CK33qGU_.js";import{V as g}from"./ViewTransformation-B_KH3iXm.js";var w=d(function(t,r){var e=Number(r),s=0,a;if(e<0||isNaN(e))throw new RangeError("n must be a non-negative number");for(a=new Array(e);s<e;)a[s]=t(s),s+=1;return a}),v=d(function(t,r){return w(l(t),r)});const C={bg:"white",p:"10px",borderStyle:"solid",borderWidth:"1px",borderColor:"grayShade1"},$=(o,t=[])=>({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"},...t.reduce((r,e)=>({...r,[`tr:nth-of-type(${e+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:t,...r})=>{const e=String(t).length<=o,s=e?String(t):`${String(t).slice(0,o-3)}...`;return n.jsx(c,{isDisabled:e,mainText:String(t),children:n.jsx(x,{value:s,...r})})},j=({transformations:o=[],name:t})=>{const[r,e]=i.useState();return n.jsxs(p,{gap:"8px",children:[o.map(s=>n.jsx(i.Fragment,{children:n.jsxs(h,{p:"0 0 0 0px",intent:"inline",onClick:()=>e(s),children:[s.hopsworksUdf.name,n.jsx(m,{icon:u.arrows_maximize,size:"xs",color:"primary",ml:"5px"})]})},s.id)),n.jsx(b,{size:"7xl",title:`${r==null?void 0:r.hopsworksUdf.name} transformation code preview`,isOpen:!!r,onClose:()=>e(void 0),mainButtonProps:{children:"Done",onClick:()=>e(void 0)},children:n.jsx(g,{...r,featureName:t})})]})},E=i.memo(j),N=({content:o,hasTitle:t=!0,...r})=>n.jsx(f,{...r,children:n.jsx(p,{sx:{gap:"20px",flexDirection:"column"},children:o.map(({title:e,code:s,language:a})=>n.jsx(p,{width:"100%",children:n.jsx(y,{title:e,copyButton:!0,content:s,language:a,padding:"0"})},`${e}-${s}-${a}`))})});export{N as C,k as E,E as T,C as c,$ as f,v as r};
