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,qBAAsB1N,KAAKkM,SAAUqC,GACjD1J,MAAK,kBAAMiI,QAAQC,MAAM,kBAAmB,0CAAvC,IADjB,OAEkB,SAAA8B,GACL/B,QAAQgC,IAAI,kBAAZ,0BAAkD,EAAK5C,WACvDY,QAAQ/H,MAAM8J,EACf,KAnBrB,gDA3lBwD,2FAinBxD,uGACE/B,QAAQC,MAAM,kBAAmB,qCADnC,SAEwB/M,KAAKmM,OAAO2B,WAAZ,UAA0B9N,KAAKgM,YAA/B,MAFxB,cAEQsC,EAFR,OAGQ9C,EAAUxB,EAAsBsE,GAHxC,SAIwBtO,KAAKmM,OAAO2B,WAAZ,UAA0B9N,KAAKgM,YAA/B,YAA8CR,EAA9C,MAJxB,cAIQ4C,EAJR,OAKQ1C,EAAU1B,EAAsBoE,GALxC,UAMwBpO,KAAKmM,OAAO2B,WAAZ,UAA0B9N,KAAKgM,YAA/B,YAA8CR,EAA9C,YAAsD3B,EAAI6B,GAA1D,MANxB,eAMQsC,EANR,OAOQpC,EAAU5B,EAAsBgE,GAChCe,EARR,UAQsBvD,EARtB,YAQ8B3B,EAAI6B,GARlC,YAQ4C7B,EAAI+B,IAC9CkB,QAAQC,MAAM,kBAAmB,WAAYgC,GAT/C,kBAUSA,GAVT,iDAjnBwD,+EAqoBxD,WAAavC,GAAb,wEACEM,QAAQC,MAAR,sDAA6DP,EAAQU,MAAMP,SAASrG,OAApF,cADF,kBAGStG,KAAKmM,OAAOuB,YAAY,gBAAiB1N,KAAKiM,KAAMO,GAAS3H,MAAK,WAEvE,OADAiI,QAAQC,MAAM,sDACP,CACR,IAAC,SAAShI,GAET,OADA+H,QAAQkC,KAAK,+CAAgDjK,GACtDA,CACR,KATH,gDAroBwD,2HAkpB1D,MAAO,CACLnF,QAAS,CACPiL,aAAAA,EACAL,cAAAA,EACAC,aAAAA,GAGL","sources":["webpack://ChatMessages/webpack/universalModuleDefinition","webpack://ChatMessages/./node_modules/regenerator-runtime/runtime.js","webpack://ChatMessages/webpack/bootstrap","webpack://ChatMessages/webpack/runtime/compat get default export","webpack://ChatMessages/webpack/runtime/define property getters","webpack://ChatMessages/webpack/runtime/hasOwnProperty shorthand","webpack://ChatMessages/./src/chat-messages.js"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"ChatMessages\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"ChatMessages\"] = factory();\n\telse\n\t\troot[\"ChatMessages\"] = factory();\n})(this, () => {\nreturn ","/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar runtime = (function (exports) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n function define(obj, key, value) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n return obj[key];\n }\n try {\n // IE 8 has a broken Object.defineProperty that only works on DOM objects.\n define({}, \"\");\n } catch (err) {\n define = function(obj, key, value) {\n return obj[key] = value;\n };\n }\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n exports.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n define(IteratorPrototype, iteratorSymbol, function () {\n return this;\n });\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = GeneratorFunctionPrototype;\n define(Gp, \"constructor\", GeneratorFunctionPrototype);\n define(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction);\n GeneratorFunction.displayName = define(\n GeneratorFunctionPrototype,\n toStringTagSymbol,\n \"GeneratorFunction\"\n );\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n define(prototype, method, function(arg) {\n return this._invoke(method, arg);\n });\n });\n }\n\n exports.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n exports.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n define(genFun, toStringTagSymbol, \"GeneratorFunction\");\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n exports.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator, PromiseImpl) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return PromiseImpl.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return PromiseImpl.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function(error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n define(AsyncIterator.prototype, asyncIteratorSymbol, function () {\n return this;\n });\n exports.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n if (PromiseImpl === void 0) PromiseImpl = Promise;\n\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList),\n PromiseImpl\n );\n\n return exports.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (delegate.iterator[\"return\"]) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n define(Gp, toStringTagSymbol, \"Generator\");\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n define(Gp, iteratorSymbol, function() {\n return this;\n });\n\n define(Gp, \"toString\", function() {\n return \"[object Generator]\";\n });\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n exports.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n exports.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n\n // Regardless of whether this script is executing as a CommonJS module\n // or not, return the runtime object so that we can declare the variable\n // regeneratorRuntime in the outer scope, which allows this module to be\n // injected easily by `bin/regenerator --include-runtime script.js`.\n return exports;\n\n}(\n // If this script is executing as a CommonJS module, use module.exports\n // as the regeneratorRuntime namespace. Otherwise create a new empty\n // object. Either way, the resulting object will be used to initialize\n // the regeneratorRuntime variable at the top of this file.\n typeof module === \"object\" ? module.exports : {}\n));\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n // This module should not be running in strict mode, so the above\n // assignment should always work unless something is misconfigured. Just\n // in case runtime.js accidentally runs in strict mode, in modern engines\n // we can explicitly access globalThis. In older engines we can escape\n // strict mode using a global Function call. This could conceivably fail\n // if a Content Security Policy forbids using Function, but in that case\n // the proper solution is to fix the accidental strict mode problem. If\n // you've misconfigured your bundler to force strict mode and applied a\n // CSP to forbid Function, and you're not willing to fix either of those\n // problems, please detail your unique predicament in a GitHub issue.\n if (typeof globalThis === \"object\") {\n globalThis.regeneratorRuntime = runtime;\n } else {\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n }\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","import 'regenerator-runtime/runtime';\n\nfunction pad (num) {\n num = String(num);\n if (num.length === 1) { num = \"0\" + num; }\n return num;\n};\n\nfunction parseDate (date) {\n return {\n year: date.getUTCFullYear(),\n month: pad( date.getUTCMonth() + 1 ),\n day: pad( date.getUTCDate() )\n };\n};\n\nfunction lowestNumberInListing(items) {\n const sortedNumbers = Object.keys(items)\n .map(i => parseInt(i))\n .filter(i => !Number.isNaN(i))\n .sort();\n return sortedNumbers[0];\n}\n\nconst ChatMessages = function (privateClient, publicClient) {\n /**\n * Schema: chat-messages/daily-archive\n *\n * Represents one calendar day of chat messages\n *\n * @example\n * {\n * \"@context\": \"https://kosmos.org/ns/v2\",\n * \"@id\": \"chat-messages/irc.libera.chat/channels/kosmos/\",\n * \"@type\": \"ChatChannel\",\n * \"service\": {\n * \"domain\": \"irc.libera.chat\",\n * \"protocol\": \"IRC\",\n * },\n * \"name\": \"#kosmos\",\n * \"type\": \"room\",\n * \"today\": {\n * \"@id\": \"2015/01/01\",\n * \"@type\": \"ChatLog\",\n * \"messageType\": \"InstantMessage\",\n * \"previous\": \"2014/12/31\",\n * \"next\": \"2015/01/02\",\n * \"messages\": [\n * { \"date\": \"2015-06-05T17:35:28.454Z\", \"user\": \"hal8000\", \"text\": \"knock knock\" },\n * { \"date\": \"2015-06-05T17:37:42.123Z\", \"user\": \"raucao\", \"text\": \"who's there?\" },\n * { \"date\": \"2015-06-05T17:55:01.235Z\", \"user\": \"hal8000\", \"text\": \"HAL\" }\n * ]\n * }\n * }\n */\n const archiveSchema = {\n \"type\": \"object\",\n \"properties\": {\n \"@context\": {\n \"type\": \"string\",\n \"default\": \"https://kosmos.org/ns/v2/chat-channel\"\n },\n \"@id\": {\n \"type\": \"string\",\n \"required\": true\n },\n \"@type\": {\n \"type\": \"string\",\n \"default\": \"ChatChannel\",\n \"enum\": [\"ChatChannel\"]\n },\n \"service\": {\n \"type\": \"object\",\n \"properties\": {\n \"domain\": {\n \"type\": \"string\",\n \"required\": true\n },\n \"protocol\": {\n \"type\": \"string\",\n \"required\": true\n }\n }\n },\n \"name\": {\n \"type\": \"string\",\n \"required\": true\n },\n \"type\": {\n \"type\": \"string\",\n \"required\": true,\n \"enum\": [ \"room\", \"person\" ]\n },\n \"today\": {\n \"type\": \"object\",\n \"properties\": {\n \"@id\": {\n \"type\": \"string\",\n \"pattern\": \"^[0-9]{4}\\/[0-9]{2}\\/[0-9]{2}$\",\n \"required\": true\n },\n \"@type\": {\n \"type\": \"string\",\n \"default\": \"ChatLog\",\n \"pattern\": \"^ChatLog$\"\n },\n \"messageType\": {\n \"type\": \"string\",\n \"default\": \"InstantMessage\",\n \"pattern\": \"^InstantMessage$\"\n },\n \"previous\": {\n \"type\": \"string\",\n \"pattern\": \"^[0-9]{4}\\/[0-9]{2}\\/[0-9]{2}$\"\n },\n \"next\": {\n \"type\": \"string\",\n \"pattern\": \"^[0-9]{4}\\/[0-9]{2}\\/[0-9]{2}$\"\n },\n \"messages\": {\n \"type\": \"array\",\n \"required\": true,\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"date\": {\n \"type\": \"string\",\n \"format\": \"date-time\"\n },\n \"user\": {\n \"type\": \"string\"\n },\n \"text\": {\n \"type\": \"string\"\n },\n \"type\": \"string\",\n \"default\": \"text\",\n \"enum\": [\n \"text\",\n \"join\",\n \"leave\",\n \"action\"\n ]\n }\n }\n }\n }\n }\n },\n \"required\": []\n };\n\n privateClient.declareType(\"daily-archive\", \"https://kosmos.org/ns/v2/chat-channel\", archiveSchema);\n publicClient.declareType(\"daily-archive\", \"https://kosmos.org/ns/v2/chat-channel\", archiveSchema);\n\n /**\n * Schema: chat-messages/daily-archive-meta\n *\n * Stores meta information about the daily archives\n *\n * @example\n * {\n * \"@context\": \"https://kosmos.org/ns/v2\",\n * \"@id\": \"chat-messages/irc.libera.chat/channels/kosmos/meta\",\n * \"@type\": \"ChatChannelMeta\",\n * \"first\": \"2009/01/03\",\n * \"last\": \"2021/11/05\"\n * }\n * }\n */\n const archiveMetaSchema = {\n \"type\": \"object\",\n \"properties\": {\n \"@context\": {\n \"type\": \"string\",\n \"default\": \"https://kosmos.org/ns/v2/chat-channel-meta\"\n },\n \"@id\": {\n \"type\": \"string\",\n },\n \"@type\": {\n \"type\": \"string\",\n \"default\": \"ChatChannelMeta\",\n \"enum\": [\"ChatChannelMeta\"]\n },\n \"first\": {\n \"type\": \"string\",\n \"pattern\": \"^[0-9]{4}\\/[0-9]{2}\\/[0-9]{2}$\"\n },\n \"last\": {\n \"type\": \"string\",\n \"pattern\": \"^[0-9]{4}\\/[0-9]{2}\\/[0-9]{2}$\"\n }\n },\n \"required\": [\"@id\", \"first\", \"last\"]\n };\n\n privateClient.declareType(\"daily-archive-meta\", \"https://kosmos.org/ns/v2/chat-channel-meta\", archiveMetaSchema);\n publicClient.declareType(\"daily-archive-meta\", \"https://kosmos.org/ns/v2/chat-channel-meta\", archiveMetaSchema);\n\n /**\n * A daily archive stores chat messages by calendar day.\n *\n * @class\n */\n class DailyArchive {\n /**\n * @param {object} options\n * @param {object} options.service\n * @param {string} options.service.protocol - Type of chat service/protocol (e.g. \"IRC\", \"XMPP\", \"Campfire\", \"Slack\")\n * @param {string} options.service.domain - Domain of the chat service (e.g. \"irc.libera.chat\", \"kosmos.chat\")\n * @param {string} options.channelName - Name of room/channel (e.g. \"#kosmos\")\n * @param {string} [options.channelType] - Type of channel (\"room\" or \"person\")\n * @param {date} options.date - Date of archive day\n * @param {boolean} [options.isPublic] - Store logs in public folder (defaults to false)\n * @param {string} [options.previous] - Date of previous log file as `YYYY/MM/DD`. Looked up automatically when not given\n * @param {string} [options.next] - Date of next log file as `YYYY/MM/DD`. looked up automatically when not given\n *\n * @example\n * // IRC archive:\n * const archive = new chatMessages.DailyArchive({\n * service: {\n * protocol: 'IRC',\n * domain: 'irc.libera.chat',\n * },\n * channelName: '#kosmos-dev',\n * channelType: 'room',\n * date: new Date(),\n * isPublic: true\n * });\n *\n * // XMPP archive:\n * const archive = new chatMessages.DailyArchive({\n * service: {\n * protocol: 'XMPP',\n * domain: 'kosmos.chat',\n * },\n * channelName: 'kosmos-dev',\n * channelType: 'room',\n * date: new Date(),\n * isPublic: false\n * });\n *\n */\n constructor (options) {\n //\n // Defaults\n //\n options.isPublic = options.isPublic || false;\n options.channelType = options.channelType || \"room\";\n\n //\n // Validate options\n //\n if (typeof options !== \"object\") {\n throw \"options must be an object\";\n }\n if (typeof options.service !== \"object\" ||\n typeof options.service.protocol !== \"string\" ||\n typeof options.service.domain !== \"string\") {\n throw \"service must be an object containing at least service \\\"protocol\\\" and \\\"domain\\\"\";\n }\n if (typeof options.channelName !== \"string\") {\n throw \"channelName must be a string\";\n }\n if (!(options.date instanceof Date)) {\n throw \"date must be a date object\";\n }\n if (typeof options.isPublic !== \"boolean\") {\n throw \"isPublic must be a boolean value\";\n }\n\n /**\n * @property {object} service\n * @property {string} service.protocol - Type of chat service/protocol (e.g. \"IRC\", \"XMPP\", \"campfire\", \"slack\")\n * @property {string} service.domain - Domain of the chat service (e.g. \"irc.libera.chat\", \"kosmos.chat\")\n */\n this.service = options.service;\n\n /**\n * @property {string} channelName - Name of channel (e.g. \"#kosmos\")\n */\n this.channelName = options.channelName;\n\n /**\n * @property {string} channelType - Type of channel (\"room\" or \"person\")\n */\n this.channelType = options.channelType;\n\n /**\n * @property {string} date - Gregorian calendar date of the archive's content\n */\n this.date = options.date;\n\n /**\n * @property {boolean} isPublic - `true` for public archives, `false` for private ones\n */\n this.isPublic = options.isPublic || false;\n\n /**\n * @property {object} parsedDate - Contains padded year, month and day of date\n * @property {string} year\n * @property {string} month\n * @property {string} day\n */\n this.parsedDate = parseDate(this.date);\n\n /**\n * @property {string} dateId - Date string in the form of YYYY/MM/DD\n */\n this.dateId = this.parsedDate.year+'/'+this.parsedDate.month+'/'+this.parsedDate.day;\n\n /**\n * @property {string} channelPath - Base directory path of the channel archives\n */\n if (this.channelType === \"room\") {\n // Normal chatroom\n const channelName = this.channelName.replace(/^#/,'');\n this.channelPath = `${this.service.domain}/channels/${channelName}`;\n } else {\n // User direct messages\n this.channelPath = `${this.service.domain}/users/${this.channelName}`;\n }\n\n /**\n * @property {string} path - Path of the archive document\n */\n this.path = `${this.channelPath}/${this.dateId}`;\n\n /**\n * @property {string} metaPath - Path of the channel's metadata document\n */\n this.metaPath = `${this.channelPath}/meta`;\n\n /**\n * @property {object} client - Public or private remoteStorgage.js BaseClient\n */\n this.client = this.isPublic ? publicClient : privateClient;\n\n /**\n * @property {string} previous - Date of previous log file as YYYY/MM/DD\n */\n this.previous = options.previous;\n\n /**\n * @property {string} next - Date of next log file as YYYY/MM/DD\n */\n this.next = options.next;\n }\n\n /*\n * @param {object} message\n * @param {string} message.timestamp - Timestamp of the message\n * @param {string} message.from - The sender of the message\n * @param {string} message.text - The message itself\n * @param {string} message.type - Type of message (one of text, join, leave, action)\n * @param {string} [message.id] - Unique ID of message. TODO implement\n *\n * @returns {Promise}\n */\n addMessage (message) {\n if (this.isPublic && !this.channelName.match(/^#/)) {\n return Promise.resolve(false);\n }\n\n message.type = message.type || 'text';\n\n return this.client.getObject(this.path).then((archive) => {\n if (typeof archive === 'object') {\n return this._updateDocument(archive, message);\n } else {\n return this._createDocument(message);\n }\n });\n }\n\n /*\n * Like <addMessage>, but for multiple messages at once. Useful for bulk\n * imports of messages.\n *\n * @param {Array} messages - Array of message objects (see params for addMessage)\n * @param {boolean} overwrite - If true, creates a new archive file and overwrites the old one. Defaults to false.\n *\n * @returns {Promise}\n */\n addMessages (messages, overwrite) {\n if (this.isPublic && !this.channelName.match(/^#/)) {\n return Promise.resolve(false);\n }\n\n overwrite = overwrite || false;\n\n messages.forEach(function(message) {\n message.type = message.type || 'text';\n });\n\n if (overwrite) {\n return this._createDocument(messages);\n } else {\n return this.client.getObject(this.path).then((archive) => {\n if (typeof archive === 'object') {\n return this._updateDocument(archive, messages);\n } else {\n return this._createDocument(messages);\n }\n });\n }\n }\n\n /*\n * Deletes the entire archive document from storage\n *\n * @returns {Promise}\n */\n remove () {\n // TODO when removing, if previous is set, but not next, it means the\n // removed file is the last archive. Thus, set \"last\" to previous file.\n return this.client.remove(this.path);\n }\n\n /*\n * Updates and writes an existing archive document\n *\n * @returns {Promise}\n *\n * @private\n */\n async _updateDocument (archive, messages) {\n console.debug('[chat-messages] Updating archive document');\n\n if (Array.isArray(messages)) {\n messages.forEach(function(message) {\n archive.today.messages.push(message);\n });\n } else {\n archive.today.messages.push(messages);\n }\n\n return this._sync(archive);\n }\n\n /*\n * Creates and writes a new archive document\n *\n * @returns {Promise}\n *\n * @private\n */\n async _createDocument (messages) {\n console.debug('[chat-messages] Creating new archive document');\n const archive = this._buildArchiveObject();\n\n if (Array.isArray(messages)) {\n messages.forEach(message => {\n archive.today.messages.push(message);\n });\n } else {\n archive.today.messages.push(messages);\n }\n\n if (this.previous || this.next) {\n // The app is handling previous/next keys itself\n // That includes setting 'next' in the previous log file\n if (this.previous) { archive.today.previous = this.previous; }\n if (this.next) { archive.today.next = this.next; }\n } else {\n // Find and update previous archive, set 'previous' on this one\n const previous = await this._updatePreviousArchive();\n if (typeof previous === 'object') {\n archive.today.previous = previous.today['@id'];\n }\n }\n\n await this._sync(archive);\n\n // TODO only write meta doc if argument is set on addMessages. This way\n // we can avoid race conditions when syncing remote chat messages all at\n // once for multiple days\n await this._updateArchiveMetaDocument();\n\n return;\n }\n\n /*\n * Builds the object to be stored in remote storage\n *\n * @returns {object}\n *\n * @private\n */\n _buildArchiveObject () {\n const roomName = this.channelName.replace(/^#/,'');\n\n const archive = {\n \"@id\": \"chat-messages/\"+this.service.domain+\"/channels/\"+roomName+\"/\",\n \"@type\": \"ChatChannel\",\n \"service\": this.service,\n \"name\": this.channelName,\n \"type\": this.channelType,\n \"today\": {\n \"@id\": this.dateId,\n \"@type\": \"ChatLog\",\n \"messageType\": \"InstantMessage\",\n \"messages\": []\n }\n };\n\n switch (this.service.protocol) {\n case 'IRC':\n if (!this.channelName.match(/^#/)) {\n archive[\"@id\"] = \"chat-messages/\"+this.service.domain+\"/users/\"+this.channelName+\"/\";\n }\n break;\n case 'XMPP':\n // XMPP-specific adjustments\n break;\n }\n\n return archive;\n }\n\n /*\n * Finds the previous archive document and updates its today.next value\n *\n * @returns {boolean|Promise}\n *\n * @private\n */\n _updatePreviousArchive () {\n return this._findPreviousArchive().then((archive) => {\n if (typeof archive === 'object' && archive.today) {\n archive.today.next = this.dateId;\n const path = this.path.substring(0, this.path.length-this.dateId.length)+archive.today['@id'];\n\n return this.client.storeObject('daily-archive', path, archive).then(() => {\n console.debug('[chat-messages] Previous archive written to remote storage at', path);\n return archive;\n });\n } else {\n console.debug('[chat-messages] Previous archive not found');\n return false;\n }\n });\n }\n\n /*\n * Returns the previous archive document\n *\n * @returns {Promise}\n *\n * @private\n */\n _findPreviousArchive () {\n const monthPath = this.path.substring(0, this.path.length-2);\n const yearPath = this.path.substring(0, this.path.length-5);\n const basePath = this.path.substring(0, this.path.length-10);\n\n return this.client.getListing(monthPath).then((listing) => {\n const days = Object.keys(listing).map((i) => parseInt(i)).map((i) => {\n return (i < parseInt(this.parsedDate.day)) ? i : null;\n }).filter(function(i){ return i != null; });\n\n if (days.length > 0) {\n const day = pad(Math.max(...days).toString());\n return this.client.getObject(monthPath+day);\n }\n\n // Find last day in previous month\n return this.client.getListing(yearPath).then((listing) => {\n const months = Object.keys(listing).map((i) => parseInt(i.substr(0,2))).map((i) => {\n return (i < parseInt(this.parsedDate.month)) ? i : null;\n }).filter(function(i){ return i != null; });\n\n if (months.length > 0) {\n const month = pad(Math.max(...months).toString());\n\n return this.client.getListing(yearPath+month+'/').then((listing) => {\n const days = Object.keys(listing).map((i) => parseInt(i));\n const day = pad(Math.max(...days).toString());\n return this.client.getObject(yearPath+month+'/'+day);\n });\n } else {\n // Find last month and day in previous year\n return this.client.getListing(basePath).then((listing) => {\n\n const years = Object.keys(listing).map((i) => parseInt(i.substr(0,4))).map((i) => {\n return (i < parseInt(this.parsedDate.year)) ? i : null;\n }).filter(function(i){ return i != null; });\n\n if (years.length > 0) {\n const year = Math.max(...years).toString();\n\n return this.client.getListing(basePath+year+'/').then((listing) => {\n const months = Object.keys(listing).map((i) => parseInt(i.substr(0,2)));\n const month = pad(Math.max(...months).toString());\n\n return this.client.getListing(basePath+year+'/'+month+'/').then((listing) => {\n const days = Object.keys(listing).map((i) => parseInt(i));\n const day = pad(Math.max(...days).toString());\n return this.client.getObject(basePath+year+'/'+month+'/'+day);\n });\n });\n } else {\n return false;\n }\n });\n }\n });\n });\n }\n\n async _updateArchiveMetaDocument () {\n const meta = await this.client.getObject(this.metaPath);\n if (typeof meta !== 'object') {\n return this._createArchiveMetaDocument();\n }\n\n // Only update document if current date is newer than known \"last\"\n if (Date.parse(meta.last.replace(/\\//g,'-')) < Date.parse(this.date)) {\n console.debug('[chat-messages]', 'Updating meta document for channel');\n meta.last = this.dateId;\n await this.client.storeObject('daily-archive-meta', this.metaPath, meta);\n }\n\n return;\n }\n\n async _createArchiveMetaDocument () {\n console.debug('[chat-messages]', 'Creating new meta document for channel');\n // When creating a new meta doc, we need to find the oldest archive,\n // because older versions of the module did not write a meta doc.\n const first = await this._findFirstArchive();\n const roomName = this.channelName.replace(/^#/,'');\n\n const meta = {\n '@id': `chat-messages/${this.service.domain}/channels/${roomName}/meta`,\n '@type': 'ChatChannelMeta',\n first: first,\n last: this.dateId // TODO might have to search for last?\n };\n\n return this.client.storeObject('daily-archive-meta', this.metaPath, meta)\n .then(() => console.debug('[chat-messages]', 'Meta document written to remote storage'))\n .catch(e => {\n console.log('[chat-messages]', `Failed to store ${this.metaPath}`);\n console.error(e);\n });\n }\n\n async _findFirstArchive () {\n console.debug('[chat-messages]', 'Finding first archive for channel');\n const years = await this.client.getListing(`${this.channelPath}/`);\n const year = lowestNumberInListing(years);\n const months = await this.client.getListing(`${this.channelPath}/${year}/`);\n const month = lowestNumberInListing(months);\n const days = await this.client.getListing(`${this.channelPath}/${year}/${pad(month)}/`);\n const day = lowestNumberInListing(days);\n const firstId = `${year}/${pad(month)}/${pad(day)}`;\n console.debug('[chat-messages]', 'First is', firstId);\n return firstId;\n }\n\n /*\n * Write archive document\n *\n * @returns {Promise}\n *\n * @private\n */\n async _sync (archive) {\n console.debug(`[chat-messages] Writing archive object with ${archive.today.messages.length} messages`);\n\n return this.client.storeObject('daily-archive', this.path, archive).then(function(){\n console.debug('[chat-messages] Archive written to remote storage');\n return true;\n },function(error){\n console.warn('[chat-messages] Error trying to store object', error);\n return error;\n });\n }\n };\n\n return {\n exports: {\n DailyArchive,\n privateClient,\n publicClient\n }\n };\n};\n\nexport default { name: 'chat-messages', builder: ChatMessages };\n"],"names":["root","factory","exports","module","define","amd","this","runtime","undefined","Op","Object","prototype","hasOwn","hasOwnProperty","$Symbol","Symbol","iteratorSymbol","iterator","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","toStringTag","obj","key","value","defineProperty","enumerable","configurable","writable","err","wrap","innerFn","outerFn","self","tryLocsList","protoGenerator","Generator","generator","create","context","Context","_invoke","state","GenStateSuspendedStart","method","arg","GenStateExecuting","Error","GenStateCompleted","doneResult","delegate","delegateResult","maybeInvokeDelegate","ContinueSentinel","sent","_sent","dispatchException","abrupt","record","tryCatch","type","done","GenStateSuspendedYield","makeInvokeMethod","fn","call","GeneratorFunction","GeneratorFunctionPrototype","IteratorPrototype","getProto","getPrototypeOf","NativeIteratorPrototype","values","Gp","defineIteratorMethods","forEach","AsyncIterator","PromiseImpl","invoke","resolve","reject","result","__await","then","unwrapped","error","previousPromise","callInvokeWithMethodAndArg","TypeError","info","resultName","next","nextLoc","pushTryEntry","locs","entry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","push","resetTryEntry","completion","reset","iterable","iteratorMethod","isNaN","length","i","displayName","isGeneratorFunction","genFun","ctor","constructor","name","mark","setPrototypeOf","__proto__","awrap","async","Promise","iter","keys","object","reverse","pop","skipTempReset","prev","charAt","slice","stop","rootRecord","rval","exception","handle","loc","caught","hasCatch","hasFinally","finallyEntry","complete","finish","thrown","delegateYield","regeneratorRuntime","accidentalStrictMode","globalThis","Function","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","n","getter","__esModule","d","a","definition","o","get","prop","pad","num","String","lowestNumberInListing","items","map","parseInt","filter","Number","sort","builder","privateClient","publicClient","archiveSchema","declareType","archiveMetaSchema","DailyArchive","options","isPublic","channelType","service","protocol","domain","channelName","date","Date","parsedDate","year","getUTCFullYear","month","getUTCMonth","day","getUTCDate","dateId","replace","channelPath","path","metaPath","client","previous","message","match","getObject","archive","_updateDocument","_createDocument","messages","overwrite","remove","console","debug","Array","isArray","today","_sync","_buildArchiveObject","_updatePreviousArchive","_updateArchiveMetaDocument","roomName","_findPreviousArchive","substring","storeObject","monthPath","yearPath","basePath","getListing","listing","days","Math","max","toString","months","substr","years","meta","_createArchiveMetaDocument","parse","last","_findFirstArchive","first","e","log","firstId","warn"],"sourceRoot":""}