import{_ as d,h as l,j as s,ar as c,bj as x,r as i,B as p,aG as h,as as m,Z as u,bE as f,m as y,aK as b}from"./index-dP1W1_bd.js";import{V as g}from"./ViewTransformation-xgCYfmc6.js";var w=d(function(e,o){var r=Number(o),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}),v=d(function(e,o){return w(l(e),o)});const C={bg:"white",p:"10px",borderStyle:"solid",borderWidth:"1px",borderColor:"grayShade1"},$=(n,e=[])=>({table:{whiteSpace:"nowrap","tr:nth-of-type(1)":{position:"sticky",top:"32px",background:n.colors.white,td:{pt:"20px",pb:"10px",boxShadow:`
         inset 0 -2px 0 0 ${n.colors.grayShade2}`}},"tr:nth-of-type(2)":{borderTop:"none"},...e.reduce((o,r)=>({...o,[`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:n=40,value:e,...o})=>{const r=String(e).length<=n,t=r?String(e):`${String(e).slice(0,n-3)}...`;return s.jsx(c,{isDisabled:r,mainText:String(e),children:s.jsx(x,{value:t,...o})})},j=({transformations:n=[],name:e,showTFName:o})=>{const[r,t]=i.useState();return s.jsxs(p,{gap:"8px",children:[n.map(a=>s.jsx(i.Fragment,{children:s.jsxs(h,{p:"0 0 0 0px",intent:"inline",onClick:()=>t(a),children:[o?a.hopsworksUdf.name:e,s.jsx(m,{icon:u.arrows_maximize,size:"xs",color:"primary",ml:"5px"})]})},a.id)),s.jsx(f,{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})})]})},E=i.memo(j),B=({content:n,hasTitle:e=!0,...o})=>s.jsx(y,{...o,children:s.jsx(p,{sx:{gap:"20px",flexDirection:"column"},children:n.map(({title:r,code:t,language:a})=>s.jsx(p,{width:"100%",children:s.jsx(b,{title:r,copyButton:!0,content:t,language:a,padding:"0"})},`${r}-${t}-${a}`))})});export{B as C,k as E,E as T,C as c,$ as f,v as r};
