import{_ as d,k as l,j as e,q as o,c7 as x,d as p,c1 as m,c2 as h,an as u,b9 as j,r as c,aJ as f,ao as T,v as b,b4 as g,f as w,bU as v}from"./index-C6OVXshM.js";import{V as y}from"./ViewTransformation--1ki1Z2h.js";var E=d(function(r,n){var s=Number(n),a=0,i;if(s<0||isNaN(s))throw new RangeError("n must be a non-negative number");for(i=new Array(s);a<s;)i[a]=r(a),a+=1;return i}),_=d(function(r,n){return E(l(r),n)});const $=({label:t,date:r,primary:n=!1,...s})=>e.jsxs(o,{flexDirection:"column",...s,children:[e.jsx(x,{mb:"3px",gray:!0,children:t}),e.jsx(p,{primary:n,children:m(r,h.DATE_TIME.DATE_TIME_FULL)})]}),k={bg:"white",p:"10px",borderStyle:"solid",borderWidth:"1px",borderColor:"grayShade1"},M=({maxLength:t=40,value:r,...n})=>{const s=String(r).length<=t,a=s?String(r):`${String(r).slice(0,t-3)}...`;return e.jsx(u,{isDisabled:s,mainText:String(r),children:e.jsx(j,{value:a,...n})})},S=({transformations:t=[],name:r,showTFName:n})=>{const[s,a]=c.useState();return e.jsxs(o,{gap:"8px",children:[t.map(i=>e.jsx(c.Fragment,{children:e.jsxs(f,{p:"0 0 0 0px",intent:"inline",onClick:()=>a(i),children:[n?i.hopsworksUdf.name:r,e.jsx(T,{icon:b.arrows_maximize,size:"xs",color:"primary",ml:"5px"})]})},i.id)),s&&e.jsx(g,{hasCloseButton:!0,size:"7xl",title:`${s==null?void 0:s.hopsworksUdf.name} transformation code preview`,isOpen:!!s,onClose:()=>a(void 0),children:e.jsx(y,{...s,featureName:r})})]})},N=c.memo(S),R=({content:t,hasTitle:r=!0,...n})=>e.jsx(w,{...n,children:e.jsx(o,{sx:{gap:"20px",flexDirection:"column"},children:t.map(({title:s,code:a,language:i})=>e.jsx(o,{width:"100%",children:e.jsx(v,{title:s,copyButton:!0,content:a,language:i,padding:"0"})},`${s}-${a}-${i}`))})});export{R as C,$ as D,M as E,N as T,k as c,_ as r,E as t};
