{"version":3,"sources":["../src/main.ts"],"names":[],"mappings":";;;;;;;AAAM,MAAO,IAAP,CAAW;AAIf,EAAA,WAAA,CAAY,OAAZ,EAAqC;AAH7B,SAAA,MAAA,GAA4B,IAA5B;AAIN,SAAK,OAAL,GAAe,OAAf;AACD;;AAED,MAAI,QAAJ,GAAY;AACV,WAAO,KAAK,OAAL,IAAgB,IAAvB;AACD;;AAED,MAAI,KAAJ,GAAS;AACP,QAAI,KAAK,OAAL,IAAgB,IAApB,EAA0B;AACxB,aAAO,KAAK,MAAZ;AACD;;AAED,UAAM,MAAM,GAAG,KAAK,OAAL,EAAf;AACA,SAAK,KAAL,GAAa,MAAb;AACA,WAAO,MAAP;AACD;;AAED,MAAI,KAAJ,CAAU,KAAV,EAA2B;AACzB,SAAK,MAAL,GAAc,KAAd;AACA,SAAK,OAAL,GAAe,IAAf;AACD;;AAzBc,C","sourcesContent":["export class Lazy {\n private _value: Promise | null = null\n private creator: (() => Promise) | null\n\n constructor(creator: () => Promise) {\n this.creator = creator\n }\n\n get hasValue() {\n return this.creator == null\n }\n\n get value(): Promise {\n if (this.creator == null) {\n return this._value!!\n }\n\n const result = this.creator()\n this.value = result\n return result\n }\n\n set value(value: Promise) {\n this._value = value\n this.creator = null\n }\n}"],"sourceRoot":""}