{"version":3,"file":"channel-local.cjs","names":["Channel","uuid"],"sources":["../../../src/common/msg/channel-local.ts"],"sourcesContent":["import { uuid } from '../uuid'\nimport { Channel } from './channel'\n\n/** Very basic channel demonstrating local communication */\nexport class LocalChannel extends Channel {\n  isConnected = true\n\n  other?: LocalChannel\n\n  postMessage(data: any) {\n    void this.other?.emit('message', {\n      data, // : cloneObject(data),\n      origin: 'local',\n      lastEventId: uuid(),\n    })\n  }\n}\n\nexport function createLocalChannelPair(): [LocalChannel, LocalChannel] {\n  const w1 = new LocalChannel()\n  const w2 = new LocalChannel()\n\n  w1.other = w2\n  w2.other = w1\n\n  return [w1, w2]\n}\n"],"mappings":";;;;;;AAIA,IAAa,eAAb,cAAkCA,mCAAQ;CACxC,cAAc;CAEd;CAEA,YAAY,MAAW;AACrB,EAAK,KAAK,OAAO,KAAK,WAAW;GAC/B;GACA,QAAQ;GACR,aAAaC,0BAAM;GACpB,CAAC;;;AAIN,SAAgB,yBAAuD;CACrE,MAAM,KAAK,IAAI,cAAc;CAC7B,MAAM,KAAK,IAAI,cAAc;AAE7B,IAAG,QAAQ;AACX,IAAG,QAAQ;AAEX,QAAO,CAAC,IAAI,GAAG"}