import{IdentityAssigner as e}from"./identity.assigner";export class CopyMachine{static copy(t){let n={};n.inputs=(t.inputs||[]).map(e=>({name:e.name,type:e.type})),n.internals=t.internals||[],n.name=t.name,n.displayCharacter=t.displayCharacter,n.outputs=(t.outputs||[]).map(e=>({name:e.name,type:e.type})),n.type=t.type,n.position={x:0,y:0},n.size={x:0,y:0};let a=JSON.parse(JSON.stringify(n));return a.id=e.generateIdentity(),a.inputs.forEach(t=>{t.nodeId=a.id,t.id=e.generateIdentity()}),a.outputs.forEach(t=>{t.nodeId=a.id,t.id=e.generateIdentity()}),a}}