/* harmony default export */

/* harmony export (binding) */

/* harmony import */

/*#__PURE__*/

/**
 * Copyright (c) 2014-present, Facebook, Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

/**
 * Store the last of some value. Tracked via a `Ref` only updating it
 * after the component renders.
 *
 * Helpful if you need to compare a prop value to it's previous value during render.
 *
 * ```ts
 * function Component(props) {
 *   const lastProps = usePrevious(props)
 *
 *   if (lastProps.foo !== props.foo)
 *     resetValueFromProps(props.foo)
 * }
 * ```
 *
 * @param value the value to track
 */

/**
* Copyright (C) 2016-present The ISLE Authors
*
* The isle-dashboard program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program.  If not, see <https://www.gnu.org/licenses/>.
*/

/***/

// "consumed" by the delegate iterator. If context.method was

// "return" to "throw", let that override the TypeError below.

// "return", allow the original .return call to continue in the

// .constructor.prototype properties for functions that return Generator

// .throw, and .return (see defineIteratorMethods).

// .throw, and .return methods.

// @@iterator function is called on it. Some browsers' implementations of the

// A .throw or .return when the delegate iterator has no .throw

// A Generator should always return itself as the iterator object when the

// Assign the result of the finished delegate to the temporary

// AsyncIterator objects; they just return a Promise for the value of

// Avoid propagating failures to Promises returned by later

// Be forgiving, per 25.3.3.3.3 of the spec:

// CSP to forbid Function, and you're not willing to fix either of those

// Call delegate.iterator[context.method](context.arg) and handle the

// Define Generator.prototype.{next,throw,return} in terms of the

// Define the unified helper method that is used to implement .next,

// Deliberately forget the last sent value so that we don't

// Dispatch the exception by looping back around to the

// Dummy constructor functions that we use as the .constructor and

// EXPORTS //

// Exception thrown outside of any try block that could handle

// Exports

// For the native GeneratorFunction constructor, the best we can

// GenStateExecuting and loop back for another invocation.

// Helper for defining the .next, .throw, and .return methods of the

// If a rejected Promise was yielded, throw the rejection back

// If an exception is thrown from innerFn, we leave state ===

// If context.method was "throw" but the delegate handled the

// If enqueue has been called before, then we want to wait until

// If maybeInvokeDelegate(context) changed context.method from

// If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.

// If the delegate iterator has a return method, give it a

// If the dispatched exception was caught by a catch block,

// Ignore the finally entry if control is not jumping to a

// Iterator interface in terms of a single ._invoke method.

// MAIN //

// MODULES //

// Module

// Not sure about the optimal order of these conditions:

// Note that simple async functions are implemented on top of

// Note: ["return"] must be used for ES3 parsing compatibility.

// Rather than returning an object with a next method, we keep

// Regardless of whether this script is executing as a CommonJS module

// Resetting context._sent for legacy support of Babel's

// Resume execution at the desired location (see delegateYield).

// Return an iterator with no values.

// See https://github.com/facebook/regenerator/issues/274 for more details.

// Setting context._sent for legacy support of Babel's

// The ._invoke method unifies the implementations of the .next,

// The context.catch method must only be called with a location

// The delegate iterator is finished, so forget it and continue with

// The root entry object (effectively a try statement without a catch

// This environment has a native %IteratorPrototype%; use it instead

// This is a polyfill for %IteratorPrototype% for environments that

// This module should not be running in strict mode, so the above

// To avoid creating an additional object, we just hang the .value

// Try/catch helper to minimize deoptimizations. Returns a completion

// VARIABLES //

// When a yielded Promise is resolved, its final value becomes

// Within the body of any async function, `await x` is transformed to

// `hasOwn.call(value, "__await")` to determine if the yielded value is

// `yield regeneratorRuntime.awrap(x)`, so that the runtime can test

// accidentally pass it on to the delegate.

// all previous Promises have been resolved before calling invoke,

// already have an existing method we want to call, so there's no need

// also ensures that the minifier will not anonymize the function.

// and .done properties off the next function object itself. This

// any necessary setup in a predictable way. This predictability

// argument that corresponds to a known catch block.

// assignment should always work unless something is misconfigured. Just

// async functions in terms of async generators, it is especially

// call invoke immediately, without waiting on a callback to fire,

// chance to clean up.

// context.dispatchException(context.arg) call above.

// context.method was "next", forget context.arg since it has been

// current iteration.

// delegate iterator, or by modifying context.method and context.arg,

// do is to check its .name property.

// don't natively support it.

// enqueue has not been called before, then it is important to

// exception, let the outer generator proceed normally. If

// execute code before the first await. Since we implement simple

// executor callback, and why async functions synchronously

// function.sent implementation.

// has a stable shape and so hopefully should be cheap to allocate.

// have been (and was previously) designed to take a closure to be

// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume

// if a Content Security Policy forbids using Function, but in that case

// important to get this right, even though it requires care.

// in case runtime.js accidentally runs in strict mode, we can escape

// in every case, so we don't have to touch the arguments object. The

// injected easily by `bin/regenerator --include-runtime script.js`.

// into the async generator function so it can be handled there.

// invocations of the iterator.

// invoked without arguments, but in all the cases we care about we

// is why the Promise constructor synchronously invokes its

// it, so set the completion value of the entire function to

// iterator prototype chain incorrectly implement this, causing the Generator

// location outside the try/catch block.

// locations where there is no enclosing try statement.

// meant to be awaited.

// method always terminates the yield* loop.

// minifier not to mangle the names of these two functions.

// object to not be returned from this call. This ensures that doesn't happen.

// objects. For full spec compliance, you may wish to configure your

// of the polyfill.

// only additional allocation required is the completion record, which

// or a finally block) gives us a place to store values thrown from

// or not, return the runtime object so that we can declare the variable

// outer generator.

// problems, please detail your unique predicament in a GitHub issue.

// record like context.tryEntries[i].completion. This interface could

// regeneratorRuntime in the outer scope, which allows this module to be

// result, either by returning a { value, done } result from the

// setting context.delegate to null, and returning the ContinueSentinel.

// so that results are always delivered in the correct order. If

// so that the async generator function has the opportunity to do

// strict mode using a global Function call. This could conceivably fail

// the .value of the Promise<{value,done}> result for the

// the final result produced by the iterator.

// the method takes exactly one argument, since that happens to be true

// the outer generator.

// the proper solution is to fix the accidental strict mode problem. If

// then let that catch block handle the exception normally.

// things simple and return the next function itself.

// throw the exception.

// to create a new function object. We can even get away with assuming

// unified ._invoke helper method.

// variable specified by delegate.resultName (see delegateYield).

// you've misconfigured your bundler to force strict mode and applied a
