{"version":3,"sources":["/Users/kevin/Dev/OpenSource/iterators/fast-extract/src/streams/transforms/EntryProgress.mjs"],"sourcesContent":["import { Transform } from 'stream';\nimport throttle from 'lodash.throttle';\n\nexport default class EntryProgressTransform extends Transform {\n  constructor(options) {\n    super({ objectMode: true });\n    let done = false;\n    this.progress = function progress(entry) {\n      if (done) return; // throttle can call after done\n      // biome-ignore lint/suspicious/noAssignInExpressions: <explanation>\n      if (!entry) return (done = true);\n      options.progress({ progress: 'extract', ...entry });\n    };\n    if (options.time) this.progress = throttle(this.progress, options.time, { leading: true });\n  }\n\n  _transform(entry, encoding, callback) {\n    this.progress(entry);\n    this.push(entry, encoding);\n    callback();\n  }\n\n  _flush(callback) {\n    this.progress(null);\n    callback();\n  }\n}\n"],"names":["Transform","throttle","EntryProgressTransform","_transform","entry","encoding","callback","progress","push","_flush","constructor","options","objectMode","done","time","leading"],"mappings":"AAAA,SAASA,SAAS,QAAQ,SAAS;AACnC,OAAOC,cAAc,kBAAkB;AAExB,IAAA,AAAMC,yBAAN,MAAMA,+BAA+BF;IAalDG,WAAWC,KAAK,EAAEC,QAAQ,EAAEC,QAAQ,EAAE;QACpC,IAAI,CAACC,QAAQ,CAACH;QACd,IAAI,CAACI,IAAI,CAACJ,OAAOC;QACjBC;IACF;IAEAG,OAAOH,QAAQ,EAAE;QACf,IAAI,CAACC,QAAQ,CAAC;QACdD;IACF;IArBAI,YAAYC,OAAO,CAAE;QACnB,KAAK,CAAC;YAAEC,YAAY;QAAK;QACzB,IAAIC,OAAO;QACX,IAAI,CAACN,QAAQ,GAAG,SAASA,SAASH,KAAK;YACrC,IAAIS,MAAM,QAAQ,+BAA+B;YACjD,oEAAoE;YACpE,IAAI,CAACT,OAAO,OAAQS,OAAO;YAC3BF,QAAQJ,QAAQ,CAAC;gBAAEA,UAAU;gBAAW,GAAGH,KAAK;YAAC;QACnD;QACA,IAAIO,QAAQG,IAAI,EAAE,IAAI,CAACP,QAAQ,GAAGN,SAAS,IAAI,CAACM,QAAQ,EAAEI,QAAQG,IAAI,EAAE;YAAEC,SAAS;QAAK;IAC1F;AAYF;AAvBA,SAAqBb,oCAuBpB"}