{"version":3,"file":"index.mjs","sources":["../src/logger.ts","../src/lib/custom-storage/MemoryStorage.ts","../src/lib/custom-storage/utils.ts","../src/lib/custom-storage/index.ts","../../../node_modules/.pnpm/js-cookie@3.0.5/node_modules/js-cookie/dist/js.cookie.mjs","../../../node_modules/.pnpm/uuid@11.0.5/node_modules/uuid/dist/esm-browser/stringify.js","../../../node_modules/.pnpm/uuid@11.0.5/node_modules/uuid/dist/esm-browser/rng.js","../../../node_modules/.pnpm/uuid@11.0.5/node_modules/uuid/dist/esm-browser/native.js","../../../node_modules/.pnpm/uuid@11.0.5/node_modules/uuid/dist/esm-browser/v4.js","../src/lib/fingerprint.ts","../src/lib/format-currency.ts","../src/lib/helpers.ts","../src/lib/product-data-source/data-sources/platformDataSource.ts","../src/lib/vtex/filterAvailableProducts.ts","../src/lib/vtex/fixAddToCartLink.ts","../src/lib/vtex/fixLinkHost.ts","../src/lib/vtex/legacyAddToCart.ts","../src/lib/vtex/legacySetUTM.ts","../../core/src/environments/environment.prod.ts","../src/environments/environment.prod.ts","../src/lib/vtex/utils.ts","../src/lib/vtex/searchUrlBuilder.ts","../src/lib/vtex/setUTM.ts","../../../node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/internal/_isPlaceholder.js","../../../node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/internal/_curry1.js","../../../node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/internal/_curry2.js","../../../node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/internal/_arity.js","../../../node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/internal/_curryN.js","../../../node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/curryN.js","../../../node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/internal/_curry3.js","../../../node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/internal/_isArray.js","../../../node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/internal/_isInteger.js","../../../node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/internal/_isString.js","../../../node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/internal/_nth.js","../../../node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/prop.js","../../../node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/internal/_isArrayLike.js","../../../node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/internal/_createReduce.js","../../../node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/internal/_xArrayReduce.js","../../../node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/bind.js","../../../node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/internal/_xReduce.js","../../../node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/internal/_xwrap.js","../../../node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/reduce.js","../../../node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/always.js","../../../node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/curry.js","../../../node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/nAry.js","../../../node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/internal/_pipe.js","../../../node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/internal/_checkForMethod.js","../../../node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/slice.js","../../../node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/tail.js","../../../node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/pipe.js","../../../node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/constructN.js","../../../node_modules/.pnpm/ramda@0.30.1/node_modules/ramda/es/ifElse.js","../src/lib/variation-code-builder.ts","../src/lib/vtex/omittedVariationsConfig.ts","../src/lib/vtex/to-nizza-product.ts","../src/lib/script-injector.ts","../src/lib/vtex/vtex-io-script-injector.ts","../src/lib/product-data-source/data-sources/vtexDataSource.ts","../../../node_modules/.pnpm/mobx@6.13.1/node_modules/mobx/dist/mobx.esm.js","../src/lib/product-data-source/productDataSourceFactory.ts","../src/lib/react/lazyLoad.tsx","../../../node_modules/.pnpm/jotai@2.10.0_@types+react@18.3.11_react@18.3.1/node_modules/jotai/esm/vanilla.mjs","../../../node_modules/.pnpm/jotai-effect@1.0.3_jotai@2.10.0_@types+react@18.3.11_react@18.3.1_/node_modules/jotai-effect/dist/index.modern.js","../../../node_modules/.pnpm/jotai@2.10.0_@types+react@18.3.11_react@18.3.1/node_modules/jotai/esm/react.mjs","../../../node_modules/.pnpm/use-memo-one@1.1.3_react@18.3.1/node_modules/use-memo-one/dist/use-memo-one.esm.js","../src/lib/react/use-atom-effect.hook.ts","../src/lib/react/useEventBus.ts","../src/lib/react/useEventBusEffect.ts","../src/lib/react/useScript.ts","../../../node_modules/.pnpm/@lit+reactive-element@2.0.4/node_modules/@lit/reactive-element/css-tag.js","../../../node_modules/.pnpm/@lit+reactive-element@2.0.4/node_modules/@lit/reactive-element/reactive-element.js","../../../node_modules/.pnpm/lit-html@3.2.0/node_modules/lit-html/lit-html.js","../../../node_modules/.pnpm/lit-element@4.1.0/node_modules/lit-element/lit-element.js","../../../node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/client.js","../src/lib/waitForElement.ts","../src/lib/runtime-utils.tsx"],"sourcesContent":["import { createNizzaLogger } from '@nizza/core';\n\nconst logger = createNizzaLogger('utils');\n\nexport default logger;\n","type Store = Record<string, string>;\n\nexport class MemoryStorage implements Storage {\n  private store: Store;\n\n  constructor() {\n    this.store = this.getStoreFromWindow();\n  }\n\n  private getStoreFromWindow() {\n    let store: Store = {};\n\n    try {\n      store = JSON.parse(window.self.name);\n    } catch (e) {\n      return {};\n    }\n\n    if (store && typeof store === 'object') return store;\n    return {};\n  }\n\n  private setStoreToWindow(data: Store) {\n    const store = JSON.stringify(data);\n    window.self.name = store;\n  }\n\n  setItem(key: string, value: string): void {\n    this.store[key] = value;\n    this.setStoreToWindow(this.store);\n  }\n\n  getItem(key: string): string | null {\n    return this.store[key] ?? null;\n  }\n\n  removeItem(key: string): void {\n    delete this.store[key];\n    this.setStoreToWindow(this.store);\n  }\n\n  clear(): void {\n    this.setStoreToWindow({});\n  }\n\n  key(index: number): string | null {\n    const keys = Object.keys(this.store);\n    return keys[index] ?? null;\n  }\n\n  get length() {\n    return Object.keys(this.store).length;\n  }\n}\n","type StorageType = 'localStorage' | 'sessionStorage';\n\nexport function isStorageAvailable(type: StorageType) {\n  try {\n    const storage = window[type];\n    const data = '__custom-storage__';\n\n    storage.setItem(data, data);\n    storage.removeItem(data);\n    return true;\n  } catch (e) {\n    return false;\n  }\n}\n\nexport function setProperty(obj: unknown, name: string, value: unknown) {\n  const descriptor: PropertyDescriptor = {\n    configurable: false,\n    enumerable: false,\n    writable: false,\n  };\n  if (typeof value !== 'undefined') {\n    descriptor.value = value;\n  }\n  Object.defineProperty(obj, name, descriptor);\n}\n","import baseLogger from '~logger';\nimport { MemoryStorage } from './MemoryStorage';\nimport { isStorageAvailable, setProperty } from './utils';\n\n// Custom implementation for local and session storage\nexport class CustomStorage {\n  private logger = baseLogger.child('CustomStorage');\n\n  static init() {\n    return new CustomStorage();\n  }\n\n  constructor() {\n    if (window.top === window.self) {\n      this.logger.debug('This is the main window');\n    } else {\n      this.logger.debug('This is NOT the main window');\n    }\n\n    this.replaceStorages();\n  }\n\n  private replaceStorages() {\n    if (!this.isAvailable.localStorage) {\n      const customLocalStorage = new MemoryStorage();\n      setProperty(window, 'localStorage', customLocalStorage);\n      this.logger.debug(\n        'LocalStorage is not available, custom implementation is defined',\n      );\n    }\n\n    if (!this.isAvailable.sessionStorage) {\n      const customSessionStorage = new MemoryStorage();\n      setProperty(window, 'sessionStorage', customSessionStorage);\n      this.logger.debug(\n        'SessionStorage is not available, custom implementation is defined',\n      );\n    }\n  }\n\n  get isAvailable() {\n    return {\n      localStorage: isStorageAvailable('localStorage'),\n      sessionStorage: isStorageAvailable('sessionStorage'),\n    };\n  }\n}\n\n// export default CustomStorage.init();\n","/*! js-cookie v3.0.5 | MIT */\n/* eslint-disable no-var */\nfunction assign (target) {\n  for (var i = 1; i < arguments.length; i++) {\n    var source = arguments[i];\n    for (var key in source) {\n      target[key] = source[key];\n    }\n  }\n  return target\n}\n/* eslint-enable no-var */\n\n/* eslint-disable no-var */\nvar defaultConverter = {\n  read: function (value) {\n    if (value[0] === '\"') {\n      value = value.slice(1, -1);\n    }\n    return value.replace(/(%[\\dA-F]{2})+/gi, decodeURIComponent)\n  },\n  write: function (value) {\n    return encodeURIComponent(value).replace(\n      /%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,\n      decodeURIComponent\n    )\n  }\n};\n/* eslint-enable no-var */\n\n/* eslint-disable no-var */\n\nfunction init (converter, defaultAttributes) {\n  function set (name, value, attributes) {\n    if (typeof document === 'undefined') {\n      return\n    }\n\n    attributes = assign({}, defaultAttributes, attributes);\n\n    if (typeof attributes.expires === 'number') {\n      attributes.expires = new Date(Date.now() + attributes.expires * 864e5);\n    }\n    if (attributes.expires) {\n      attributes.expires = attributes.expires.toUTCString();\n    }\n\n    name = encodeURIComponent(name)\n      .replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent)\n      .replace(/[()]/g, escape);\n\n    var stringifiedAttributes = '';\n    for (var attributeName in attributes) {\n      if (!attributes[attributeName]) {\n        continue\n      }\n\n      stringifiedAttributes += '; ' + attributeName;\n\n      if (attributes[attributeName] === true) {\n        continue\n      }\n\n      // Considers RFC 6265 section 5.2:\n      // ...\n      // 3.  If the remaining unparsed-attributes contains a %x3B (\";\")\n      //     character:\n      // Consume the characters of the unparsed-attributes up to,\n      // not including, the first %x3B (\";\") character.\n      // ...\n      stringifiedAttributes += '=' + attributes[attributeName].split(';')[0];\n    }\n\n    return (document.cookie =\n      name + '=' + converter.write(value, name) + stringifiedAttributes)\n  }\n\n  function get (name) {\n    if (typeof document === 'undefined' || (arguments.length && !name)) {\n      return\n    }\n\n    // To prevent the for loop in the first place assign an empty array\n    // in case there are no cookies at all.\n    var cookies = document.cookie ? document.cookie.split('; ') : [];\n    var jar = {};\n    for (var i = 0; i < cookies.length; i++) {\n      var parts = cookies[i].split('=');\n      var value = parts.slice(1).join('=');\n\n      try {\n        var found = decodeURIComponent(parts[0]);\n        jar[found] = converter.read(value, found);\n\n        if (name === found) {\n          break\n        }\n      } catch (e) {}\n    }\n\n    return name ? jar[name] : jar\n  }\n\n  return Object.create(\n    {\n      set,\n      get,\n      remove: function (name, attributes) {\n        set(\n          name,\n          '',\n          assign({}, attributes, {\n            expires: -1\n          })\n        );\n      },\n      withAttributes: function (attributes) {\n        return init(this.converter, assign({}, this.attributes, attributes))\n      },\n      withConverter: function (converter) {\n        return init(assign({}, this.converter, converter), this.attributes)\n      }\n    },\n    {\n      attributes: { value: Object.freeze(defaultAttributes) },\n      converter: { value: Object.freeze(converter) }\n    }\n  )\n}\n\nvar api = init(defaultConverter, { path: '/' });\n/* eslint-enable no-var */\n\nexport { api as default };\n","import validate from './validate.js';\nconst byteToHex = [];\nfor (let i = 0; i < 256; ++i) {\n    byteToHex.push((i + 0x100).toString(16).slice(1));\n}\nexport function unsafeStringify(arr, offset = 0) {\n    return (byteToHex[arr[offset + 0]] +\n        byteToHex[arr[offset + 1]] +\n        byteToHex[arr[offset + 2]] +\n        byteToHex[arr[offset + 3]] +\n        '-' +\n        byteToHex[arr[offset + 4]] +\n        byteToHex[arr[offset + 5]] +\n        '-' +\n        byteToHex[arr[offset + 6]] +\n        byteToHex[arr[offset + 7]] +\n        '-' +\n        byteToHex[arr[offset + 8]] +\n        byteToHex[arr[offset + 9]] +\n        '-' +\n        byteToHex[arr[offset + 10]] +\n        byteToHex[arr[offset + 11]] +\n        byteToHex[arr[offset + 12]] +\n        byteToHex[arr[offset + 13]] +\n        byteToHex[arr[offset + 14]] +\n        byteToHex[arr[offset + 15]]).toLowerCase();\n}\nfunction stringify(arr, offset = 0) {\n    const uuid = unsafeStringify(arr, offset);\n    if (!validate(uuid)) {\n        throw TypeError('Stringified UUID is invalid');\n    }\n    return uuid;\n}\nexport default stringify;\n","let getRandomValues;\nconst rnds8 = new Uint8Array(16);\nexport default function rng() {\n    if (!getRandomValues) {\n        if (typeof crypto === 'undefined' || !crypto.getRandomValues) {\n            throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');\n        }\n        getRandomValues = crypto.getRandomValues.bind(crypto);\n    }\n    return getRandomValues(rnds8);\n}\n","const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);\nexport default { randomUUID };\n","import native from './native.js';\nimport rng from './rng.js';\nimport { unsafeStringify } from './stringify.js';\nfunction v4(options, buf, offset) {\n    if (native.randomUUID && !buf && !options) {\n        return native.randomUUID();\n    }\n    options = options || {};\n    const rnds = options.random ?? options.rng?.() ?? rng();\n    if (rnds.length < 16) {\n        throw new Error('Random bytes length must be >= 16');\n    }\n    rnds[6] = (rnds[6] & 0x0f) | 0x40;\n    rnds[8] = (rnds[8] & 0x3f) | 0x80;\n    if (buf) {\n        offset = offset || 0;\n        if (offset < 0 || offset + 16 > buf.length) {\n            throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`);\n        }\n        for (let i = 0; i < 16; ++i) {\n            buf[offset + i] = rnds[i];\n        }\n        return buf;\n    }\n    return unsafeStringify(rnds);\n}\nexport default v4;\n","import Cookies from 'js-cookie'\nimport { v4 as uuidv4 } from 'uuid'\n\nconst _FINGERPRINT = 'FINGERPRINT_LIVE_SHOPPING'\n\nexport const getFingerprint = () => {\n  let fingerprint = Cookies.get(_FINGERPRINT)\n\n  if (fingerprint) return fingerprint\n\n  fingerprint = uuidv4()\n  Cookies.set(_FINGERPRINT, fingerprint, { expires: 1 })\n\n  return fingerprint\n}\n","import { AccountCurrencyConfig } from '@nizza/core';\n\n/**\n * Resolves the effective currency formatting configuration by merging\n * default browser settings with optional overrides.\n *\n * @param manualOptions Optional overrides for currency formatting.\n * @returns Complete AccountCurrencyConfig ready for formatting.\n */\nexport const resolveCurrencyConfig = (\n  manualOptions?: Partial<AccountCurrencyConfig>,\n): AccountCurrencyConfig => {\n  const { currencyFormat, currencySymbol } = window as any;\n\n  return {\n    decimalDigits:\n      manualOptions?.decimalDigits ??\n      currencyFormat?.CurrencyDecimalDigits ??\n      2,\n    decimalSeparator:\n      manualOptions?.decimalSeparator ??\n      currencyFormat?.CurrencyDecimalSeparator ??\n      '.',\n    thousandsSeparator:\n      manualOptions?.thousandsSeparator ??\n      currencyFormat?.CurrencyGroupSeparator ??\n      ',',\n    symbol: manualOptions?.symbol ?? currencySymbol ?? '$',\n    startsWithCurrencySymbol:\n      manualOptions?.startsWithCurrencySymbol ??\n      currencyFormat?.StartsWithCurrencySymbol ??\n      true,\n    currencyCode: manualOptions?.currencyCode ?? 'USD',\n    cultureCode: manualOptions?.cultureCode ?? 'en-US',\n  } satisfies AccountCurrencyConfig;\n};\n\n/**\n * Formats a number as a currency string.\n *\n * @param {number} amount - The numeric amount to format.\n * @param {AccountCurrencyConfig} options - The currency formatting options.\n * @returns {string} - The formatted currency string.\n */\nexport const numToCurrency = (\n  amount: number,\n  options: AccountCurrencyConfig,\n): string => {\n  return new Intl.NumberFormat(options.cultureCode, {\n    style: 'currency',\n    currency: options.currencyCode,\n    minimumFractionDigits: options.decimalDigits,\n    maximumFractionDigits: options.decimalDigits,\n  }).format(amount);\n};\n\n/**\n * Deconstructs a formatted currency string into its components.\n *\n * @param {string} formattedNum - The formatted currency string.\n * @param {AccountCurrencyConfig} options - The currency formatting options.\n * @returns {string} - A JSON string representing the deconstructed currency.\n */\nexport const deconstructCurrency = (\n  formattedNum: string,\n  options: AccountCurrencyConfig,\n): string => {\n  const [integerPart, decimalPart] = formattedNum.split(\n    options.decimalSeparator,\n  );\n  return JSON.stringify({\n    integerPart: integerPart.replace(\n      new RegExp(`\\\\${options.thousandsSeparator}`, 'g'),\n      '',\n    ),\n    decimalPart: decimalPart || '',\n    symbol: options.symbol,\n    decimalSeparator: options.decimalSeparator,\n  });\n};\n\n/**\n * Formats a number as a currency string, with an option to deconstruct the result.\n *\n * @param {number} amount - The numeric amount to format.\n * @param {Partial<AccountCurrencyConfig>} [manualOptions] - Optional manual currency options.\n * @param {boolean} [deconstructedIsNeeded] - Whether the result should be deconstructed.\n * @returns {string} - The formatted currency string or deconstructed currency JSON.\n */\nexport const formatCurrency = (\n  amount: number,\n  manualOptions?: Partial<AccountCurrencyConfig>,\n  deconstructedIsNeeded?: boolean,\n): string => {\n  const options = resolveCurrencyConfig(manualOptions);\n  const formattedNum = numToCurrency(amount, options);\n\n  return deconstructedIsNeeded\n    ? deconstructCurrency(formattedNum, options)\n    : formattedNum;\n};\n","import { GlobalStore, shortId } from '@nizza/core';\n\n/**\n * Combines multiple glob style objects into a single object with unique keys.\n * This function is useful for avoiding style conflicts by creating unique\n *\n * @param {Record<string, any>[]} styles - An array of style objects, potentially deeply nested.\n * @returns A record with unique keys, where each key is a string\n * representing the unique class name, and the value is the style content.\n */\nexport function combineGlobStyles(\n  styles: Record<string, any>[],\n): Record<string, string> {\n  const createUniqueKey = (path: string): string => {\n    const parts = path.split('/').filter(Boolean);\n    const fileName = parts.pop()?.split('.')[0] ?? '';\n    const hash = shortId(5);\n    return `${fileName}-${hash}`;\n  };\n\n  return styles\n    .flat(Infinity)\n    .reduce((acc: Record<string, string>, style: Record<string, string>) => {\n      Object.entries(style).forEach(([path, value]) => {\n        const uniqueKey = createUniqueKey(path);\n        acc[uniqueKey] = value;\n      });\n      return acc;\n    }, {});\n}\n\nexport function configureGlobalStore<T extends GlobalStore[]>(\n  stores: T,\n  config: any,\n) {\n  return stores.map(store => {\n    store && store.configure(config);\n    return store;\n  });\n}\n\n/**\n * Waits for a specified condition to become true within a timeout period.\n * It checks the condition at specified intervals.\n *\n * @param conditionFn A function that returns a boolean indicating whether the condition is met.\n * @param timeout The maximum time to wait for the condition to be met, in milliseconds. Defaults to 60,000ms (1 minute).\n * @param interval The interval at which to check the condition, in milliseconds. Defaults to 100ms.\n * @returns A promise that resolves when the condition is met or rejects if the timeout is exceeded.\n */\nexport function waitForCondition(\n  conditionFn: () => boolean,\n  timeout = 60000,\n  interval = 100,\n): Promise<void> {\n  return new Promise((resolve, reject) => {\n    if (conditionFn()) {\n      return resolve();\n    }\n\n    const startTime = Date.now();\n\n    const checkCondition = setInterval(() => {\n      if (conditionFn()) {\n        clearInterval(checkCondition);\n        resolve();\n      } else if (Date.now() - startTime > timeout) {\n        clearInterval(checkCondition);\n        reject(new Error('Timeout waiting for condition.'));\n      }\n    }, interval);\n  });\n}\n\n/**\n * Converts a string to camel case.\n *\n * @param str The string to convert.\n * @returns The camel case version of the string.\n */\nexport const toCamelCase = (str: string) =>\n  str\n    .replace(/([-_ ]\\w)/g, match => match.charAt(1).toUpperCase())\n    .replace(/(^\\w)/, match => match.toLowerCase());\n","import {\n  NizzaGetCollectionHandler,\n  NizzaGetProductHandler,\n  NizzaGetProductListHandler,\n  NizzaProduct,\n  NizzaProductDataSource,\n  NizzaProductDataSourceConfig,\n  getNizza,\n} from '@nizza/core';\nimport {\n  Product,\n  collectionService,\n  productService,\n} from '@nizza/event-products';\n\nexport class PlatformProductDataSource implements NizzaProductDataSource {\n  private accountName: string;\n\n  constructor(readonly config: NizzaProductDataSourceConfig) {\n    const { accountName } = getNizza();\n    if (!accountName) throw new Error('Nizza account is invalid');\n    this.accountName = accountName;\n  }\n\n  getProduct: NizzaGetProductHandler = async input => {\n    const { productId } = input;\n\n    if (!this.accountName) return null;\n\n    try {\n      productService.setAccount(this.accountName);\n      const data = await productService.find(productId);\n      return this.toNizzaProduct(data);\n    } catch (error) {\n      console.error(`Error finding product with id: ${productId}`, error);\n      return null;\n    }\n  };\n\n  getProductList: NizzaGetProductListHandler = async (input = {}) => {\n    const collection = await this.getCollection(input);\n    return collection?.products;\n  };\n\n  getCollection: NizzaGetCollectionHandler = async (input = {}) => {\n    const { collectionId } = input;\n\n    const collectionInfo = {\n      id: input?.collectionId ?? '',\n      name: '',\n      products: [],\n    };\n\n    if (!collectionId) {\n      console.error(new Error(`collectionId '${collectionId}' not valid`));\n      return collectionInfo;\n    }\n\n    if (!this.accountName) {\n      console.error(new Error(`account not valid`));\n      return collectionInfo;\n    }\n\n    collectionService.setAccount(this.accountName);\n    const collection = await collectionService.find(collectionId);\n\n    return {\n      ...collectionInfo,\n      name: collection.name ?? '',\n      products: collection?.products.map(this.toNizzaProduct),\n    };\n  };\n\n  private toNizzaProduct = (product: Product): NizzaProduct => ({\n    id: product.id,\n    name: product.title,\n    price: product.price,\n    priceWithDiscount: product.salesPrice || product.price,\n    imageUrl: product.pictures[0],\n    addToCartLink: product.link,\n    isAvailable: product.status === 'active',\n    variationSelector: [],\n    pdpLink: product.link,\n    skuId: product.id,\n    items: [],\n  });\n}\n","import { VtexProduct } from '@nizza/core';\n\nexport const filterAvailableVtexProducts = (product: VtexProduct) => {\n  const availableItems = product?.items?.filter(item => {\n    const availableSellers = item.sellers.filter(\n      seller => seller.commertialOffer.IsAvailable,\n    );\n    return availableSellers.length > 0;\n  });\n\n  const firstItem = product.items?.[0];\n  const item = availableItems?.[0] ?? firstItem;\n\n  const seller =\n    item?.sellers.find((seller: any) => seller.sellerDefault === true) ??\n    firstItem.sellers[0];\n\n  return {\n    item,\n    seller,\n    isAvailable: !!availableItems?.length,\n  };\n};\n","import { VtexProduct } from '@nizza/core';\n\n/**\n * @deprecated fixLinkHost does this process in a better way and is implemented in vtexToNizzaProduct\n */\nexport const fixVtexAddToCartLink = (\n  data: VtexProduct[],\n  account?: string,\n  host?: string,\n) => {\n  try {\n    for (const element of data) {\n      if (element.items) {\n        const items = element.items;\n        items.map((item: any) => {\n          if (item.sellers[0].addToCartLink) {\n            const seller = item.sellers[0];\n            seller.addToCartLink = item.sellers[0].addToCartLink.replace(\n              `${account}.myvtex.com`,\n              host ? host : '',\n            );\n          }\n          return item;\n        });\n      }\n    }\n  } catch (error) {\n    if (data[0]?.items[0].sellers[0].addToCartLink) {\n      const seller = data[0]?.items[0].sellers[0];\n      seller.addToCartLink = data[0]?.items[0].sellers[0].addToCartLink.replace(\n        `${account}.myvtex.com`,\n        host ? host : '',\n      );\n    }\n  }\n};\n","import { NizzaProduct } from '@nizza/core';\n\nconst addHttp = (url: string) => {\n  const httpRegex = /^https?:\\/\\//i;\n  return httpRegex.test(url) ? url : `https://${url}`;\n};\n\nconst replaceHost = (url: URL, host: string) =>\n  url.href.replace(url.host, host);\n\nexport const fixLinkHost = (data: NizzaProduct, host: string): NizzaProduct => {\n  try {\n    const { pdpLink, addToCartLink } = data;\n\n    const pdpLinkUrl = new URL(pdpLink);\n    const addToCartLinkUrl = new URL(addToCartLink);\n\n    const pdpLinkWithHost = addHttp(replaceHost(pdpLinkUrl, host));\n    const addToCartLinkWithHost = addHttp(replaceHost(addToCartLinkUrl, host));\n\n    return {\n      ...data,\n      pdpLink: pdpLinkWithHost,\n      addToCartLink: addToCartLinkWithHost,\n    };\n  } catch (error) {\n    console.error('[fixHostToPdpLink] Error in setHostToPdpLink: ', error);\n    return data;\n  }\n};\n","import { NizzaAddToCartHandler, NizzaProduct } from '@nizza/core';\nimport { filterAvailableVtexProducts } from './filterAvailableProducts';\n\nexport const vtexLegacyAddToCart: NizzaAddToCartHandler = ({\n  product,\n  quantity = 1,\n}) => {\n  const item = buildVtexCartItem(product, quantity);\n  const vtexjs = (window as any)?.vtexjs;\n\n  if (!vtexjs) throw new Error('vtexLegacyAddToCart: vtexjs is not defined');\n  return vtexjs.checkout.addToCart([item]);\n};\n\nexport function buildVtexCartItem(product: NizzaProduct, quantity?: number) {\n  let sellerId = product.sellerId;\n\n  /**\n   * This is a hopeless fix, usually the sellerId should come ready to use,\n   * but for example the player in some streams mutates the product object,\n   * causing the sellerId to be lost, until a root solution is found,\n   * this fix It's fundamental\n   */\n  if (!sellerId) {\n    try {\n      const result = filterAvailableVtexProducts(product as any);\n      const { seller } = result;\n      sellerId = seller?.sellerId;\n    } catch {\n      /**\n       * FIXME: For the recordings, the products are consulted from our DB but\n       * currently the sellerId is not being saved, therefore while this\n       * scenario is corrected, '1' will be used as the sellerId.\n       */\n      sellerId = '1';\n    }\n  }\n\n  return {\n    id: product.skuId,\n    quantity: quantity || 1,\n    seller: sellerId,\n  };\n}\n","import { NizzaSetUTMHandler, VtexOrderForm } from '@nizza/core';\n\nexport const vtexLegacySetUTM: NizzaSetUTMHandler = utm => {\n  try {\n    const vtexjs = (window as any)?.vtexjs;\n\n    if (vtexjs) throw new Error('setLegacyUTM: vtexjs is not defined');\n    if (!utm) throw new Error('setLegacyUTM: utm is not defined');\n\n    const { getOrderForm, sendAttachment } = vtexjs.checkout;\n\n    return getOrderForm().then((orderForm: VtexOrderForm) => {\n      const marketingData = {\n        ...orderForm.marketingData,\n        utmSource: utm,\n      };\n      return sendAttachment('marketingData', marketingData);\n    });\n  } catch (error) {\n    console.error('setLegacyUTM: error setting UTM: ', error);\n  }\n};\n","import { CoreEnvs } from './types';\n\nconst {\n  NZ_AWS_REGION,\n  NZ_CORE_SERVICES_GRAPHQL_URL,\n  NZ_CORE_SERVICES_REST_URL,\n} = import.meta.env;\n\nexport const environment: CoreEnvs = {\n  AWS: {\n    region: NZ_AWS_REGION,\n    cognito: {\n      userPoolId: 'us-east-1_EZ7wuZ4ig',\n      userPoolWebClientId: '2jok7cst8ebf6ppscrhji57gvr',\n    },\n  },\n\n  //  Back services\n  apiUrls: {\n    restV2:\n      NZ_CORE_SERVICES_REST_URL || 'https://core-services-prod.nizza.com/api',\n    graphql:\n      NZ_CORE_SERVICES_GRAPHQL_URL ||\n      'https://core-services-prod.nizza.com/graphql',\n    corsProxy: 'https://3hvqfl2xcg.execute-api.us-east-1.amazonaws.com',\n  },\n\n  publicUrls: {\n    //  Public app url\n    platformSite: 'https://platform.nizza.com',\n\n    // Nizza CDN\n    nizzaCdn: 'https://cdn.nizza.com',\n\n    //  Bundle\n    bundleSite: 'https://bundle.nizza.com',\n\n    // WSS IVS CHAT\n    wssIVSChat: 'wss://edge.ivschat.us-east-1.amazonaws.com',\n\n    // Global Page\n    globalPage: 'https://live.nizza.com',\n  },\n};\n\nexport default environment;\n","import { Environment } from '@nizza/core';\nimport coreEnvs from '@nizza/core/envs/environment.prod';\n\nconst config = {\n  ...coreEnvs,\n};\n\nexport const environment: Environment<typeof config> = config;\nexport default environment;\n","export function isMyVTEX(url: any): boolean {\n  const regex = /^https:\\/\\/[a-zA-Z0-9-]+\\.myvtex\\.com/;\n  return regex.test(String(url));\n}\n\nexport const getPageUrl = () => window?.location?.href;\n","import { searchParams } from '@nizza/core';\r\nimport env from '~env';\r\nimport { getPageUrl, isMyVTEX } from './utils';\r\n\r\nconst { apiUrls } = env;\r\n\r\nconst BASE_URL = 'api/catalog_system/pub/products/search';\r\nconst CORS_PROXY_URL = apiUrls.corsProxy;\r\nconst DEFAULT_PAGE = 0;\r\nconst DEFAULT_LIMIT = 49;\r\n\r\ntype CatalogParams = {\r\n  account?: string;\r\n  accountHost?: string | null;\r\n  productId?: string;\r\n  collectionId?: string;\r\n  search?: string;\r\n  page?: number;\r\n  limit?: number;\r\n  corsProxy?: boolean;\r\n  corsProxyOrigin?: string;\r\n  salesChannelId?: string;\r\n};\r\n\r\nfunction buildPaginationParams(\r\n  page: number = DEFAULT_PAGE,\r\n  limit: number = DEFAULT_LIMIT,\r\n): string {\r\n  return `&_from=${page}&_to=${limit}`;\r\n}\r\n\r\nfunction buildProductFilter(productId: string) {\r\n  return `?fq=productId:${productId}`;\r\n}\r\n\r\nfunction buildCollectionFilter(collectionId: string, paginationParams: string) {\r\n  return `?fq=productClusterIds:${collectionId}${paginationParams}`;\r\n}\r\n\r\n/**\r\n * This function should work for next scenarios:\r\n *  1. When the environment is local (dev:local) or globalPage\r\n *  2. When the environment is MyVTEX (master or workspace)\r\n *  3. When the environment is VTEX but it use a host (usually vtex store in production)\r\n */\r\nfunction buildBaseUrl(account: string, accountHost?: string | null) {\r\n  const pageUrl = getPageUrl();\r\n\r\n  if (!pageUrl) {\r\n    throw new Error('Unable to retrieve the page URL');\r\n  }\r\n\r\n  const defaultHost = `${account}.myvtex.com`;\r\n  const pageHost = new URL(pageUrl).host;\r\n  const host = isMyVTEX(pageUrl) ? pageHost : accountHost ?? defaultHost;\r\n\r\n  return `https://${host}/${BASE_URL}`;\r\n}\r\n\r\nfunction buildSearchPath(search: string) {\r\n  return search ? `/${encodeURIComponent(search)}` : '';\r\n}\r\n\r\nfunction buildSalesChannelFilter(salesChannel: string) {\r\n  return `&sc=${salesChannel}`;\r\n}\r\n\r\nfunction withCorsProxy(url: string, corsProxyOrigin?: string) {\r\n  let params;\r\n\r\n  if (url.includes('fq=productId:')) {\r\n    params = searchParams({ url, origin: corsProxyOrigin });\r\n  } else {\r\n    const query = {\r\n      brand: true,\r\n      brandId: true,\r\n      brandImageUrl: true,\r\n      categoryId: true,\r\n      description: true,\r\n      link: true,\r\n      linkText: true,\r\n      metaTagDescription: true,\r\n      productId: true,\r\n      productName: true,\r\n      productReference: true,\r\n      productReferenceCode: true,\r\n      productTitle: true,\r\n      releaseDate: true,\r\n      skuSpecifications: true,\r\n      productClusters: true,\r\n      items: {\r\n        Color: true,\r\n        'Color Proveedor': true,\r\n        Talla: true,\r\n        complementName: true,\r\n        ean: true,\r\n        estimatedDateArrival: true,\r\n        images: {\r\n          imageId: true,\r\n          imageLabel: true,\r\n          imageLastModified: true,\r\n          imageTag: true,\r\n          imageText: true,\r\n          imageUrl: true,\r\n        },\r\n        isKit: true,\r\n        itemId: true,\r\n        measurementUnit: true,\r\n        modalType: true,\r\n        name: true,\r\n        nameComplete: true,\r\n        sellers: {\r\n          addToCartLink: true,\r\n          commertialOffer: {\r\n            Price: true,\r\n            ListPrice: true,\r\n            IsAvailable: true,\r\n            Tax: true,\r\n          },\r\n          sellerDefault: true,\r\n          sellerId: true,\r\n          sellerName: true,\r\n        },\r\n      },\r\n    };\r\n\r\n    const q = window.btoa(JSON.stringify(query));\r\n    params = searchParams({ q, url, origin: corsProxyOrigin });\r\n  }\r\n\r\n  return `${CORS_PROXY_URL}${params}`;\r\n}\r\n\r\nexport function buildVtexCatalogUrl(params: CatalogParams = {}): string {\r\n  const {\r\n    account,\r\n    productId,\r\n    collectionId,\r\n    search,\r\n    corsProxy = false,\r\n    corsProxyOrigin,\r\n    page = DEFAULT_PAGE,\r\n    limit = DEFAULT_LIMIT,\r\n    salesChannelId,\r\n  } = params;\r\n\r\n  if (!account) throw new Error('buildVtexCatalogUrl: account is required');\r\n\r\n  const accountHost = corsProxy ? null : params.accountHost;\r\n  const baseUrl = buildBaseUrl(account, accountHost);\r\n  const paginationParams = buildPaginationParams(page, limit);\r\n  let url = baseUrl;\r\n\r\n  if (productId) {\r\n    url = `${baseUrl}${buildProductFilter(productId)}`;\r\n  }\r\n\r\n  if (collectionId) {\r\n    url = `${baseUrl}${buildCollectionFilter(collectionId, paginationParams)}`;\r\n  }\r\n\r\n  if (search) {\r\n    url = `${baseUrl}${buildSearchPath(search)}`;\r\n  }\r\n\r\n  if (salesChannelId) {\r\n    url = `${url}${buildSalesChannelFilter(salesChannelId)}`;\r\n  }\r\n\r\n  return corsProxy ? withCorsProxy(url, corsProxyOrigin) : url;\r\n}\r\n","import { UTM, VtexOrderForm, getNizza, nzApiClient } from '@nizza/core';\n\nexport const setVtexUTM = async (utm: UTM) => {\n  try {\n    const { accountName } = getNizza();\n\n    if (!accountName) throw new Error('Nizza account is invalid');\n\n    const { orderFormId, marketingTags, utmSource } = utm;\n\n    await nzApiClient.rest<VtexOrderForm>({\n      baseURL: `https://${accountName}.myvtex.com`,\n      path: `_v/api/personal-shopper/miniCartMarketing/${orderFormId}`,\n      method: 'POST',\n      body: {\n        marketingTags,\n        utmSource,\n      },\n    });\n  } catch (e) {\n    console.info('Error: ', e);\n  }\n};\n","export default function _isPlaceholder(a) {\n  return a != null && typeof a === 'object' && a['@@functional/placeholder'] === true;\n}","import _isPlaceholder from \"./_isPlaceholder.js\";\n\n/**\n * Optimized internal one-arity curry function.\n *\n * @private\n * @category Function\n * @param {Function} fn The function to curry.\n * @return {Function} The curried function.\n */\nexport default function _curry1(fn) {\n  return function f1(a) {\n    if (arguments.length === 0 || _isPlaceholder(a)) {\n      return f1;\n    } else {\n      return fn.apply(this, arguments);\n    }\n  };\n}","import _curry1 from \"./_curry1.js\";\nimport _isPlaceholder from \"./_isPlaceholder.js\";\n\n/**\n * Optimized internal two-arity curry function.\n *\n * @private\n * @category Function\n * @param {Function} fn The function to curry.\n * @return {Function} The curried function.\n */\nexport default function _curry2(fn) {\n  return function f2(a, b) {\n    switch (arguments.length) {\n      case 0:\n        return f2;\n      case 1:\n        return _isPlaceholder(a) ? f2 : _curry1(function (_b) {\n          return fn(a, _b);\n        });\n      default:\n        return _isPlaceholder(a) && _isPlaceholder(b) ? f2 : _isPlaceholder(a) ? _curry1(function (_a) {\n          return fn(_a, b);\n        }) : _isPlaceholder(b) ? _curry1(function (_b) {\n          return fn(a, _b);\n        }) : fn(a, b);\n    }\n  };\n}","export default function _arity(n, fn) {\n  /* eslint-disable no-unused-vars */\n  switch (n) {\n    case 0:\n      return function () {\n        return fn.apply(this, arguments);\n      };\n    case 1:\n      return function (a0) {\n        return fn.apply(this, arguments);\n      };\n    case 2:\n      return function (a0, a1) {\n        return fn.apply(this, arguments);\n      };\n    case 3:\n      return function (a0, a1, a2) {\n        return fn.apply(this, arguments);\n      };\n    case 4:\n      return function (a0, a1, a2, a3) {\n        return fn.apply(this, arguments);\n      };\n    case 5:\n      return function (a0, a1, a2, a3, a4) {\n        return fn.apply(this, arguments);\n      };\n    case 6:\n      return function (a0, a1, a2, a3, a4, a5) {\n        return fn.apply(this, arguments);\n      };\n    case 7:\n      return function (a0, a1, a2, a3, a4, a5, a6) {\n        return fn.apply(this, arguments);\n      };\n    case 8:\n      return function (a0, a1, a2, a3, a4, a5, a6, a7) {\n        return fn.apply(this, arguments);\n      };\n    case 9:\n      return function (a0, a1, a2, a3, a4, a5, a6, a7, a8) {\n        return fn.apply(this, arguments);\n      };\n    case 10:\n      return function (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9) {\n        return fn.apply(this, arguments);\n      };\n    default:\n      throw new Error('First argument to _arity must be a non-negative integer no greater than ten');\n  }\n}","import _arity from \"./_arity.js\";\nimport _isPlaceholder from \"./_isPlaceholder.js\";\n\n/**\n * Internal curryN function.\n *\n * @private\n * @category Function\n * @param {Number} length The arity of the curried function.\n * @param {Array} received An array of arguments received thus far.\n * @param {Function} fn The function to curry.\n * @return {Function} The curried function.\n */\nexport default function _curryN(length, received, fn) {\n  return function () {\n    var combined = [];\n    var argsIdx = 0;\n    var left = length;\n    var combinedIdx = 0;\n    var hasPlaceholder = false;\n    while (combinedIdx < received.length || argsIdx < arguments.length) {\n      var result;\n      if (combinedIdx < received.length && (!_isPlaceholder(received[combinedIdx]) || argsIdx >= arguments.length)) {\n        result = received[combinedIdx];\n      } else {\n        result = arguments[argsIdx];\n        argsIdx += 1;\n      }\n      combined[combinedIdx] = result;\n      if (!_isPlaceholder(result)) {\n        left -= 1;\n      } else {\n        hasPlaceholder = true;\n      }\n      combinedIdx += 1;\n    }\n    return !hasPlaceholder && left <= 0 ? fn.apply(this, combined) : _arity(Math.max(0, left), _curryN(length, combined, fn));\n  };\n}","import _arity from \"./internal/_arity.js\";\nimport _curry1 from \"./internal/_curry1.js\";\nimport _curry2 from \"./internal/_curry2.js\";\nimport _curryN from \"./internal/_curryN.js\";\n\n/**\n * Returns a curried equivalent of the provided function, with the specified\n * arity. The curried function has two unusual capabilities. First, its\n * arguments needn't be provided one at a time. If `g` is `R.curryN(3, f)`, the\n * following are equivalent:\n *\n *   - `g(1)(2)(3)`\n *   - `g(1)(2, 3)`\n *   - `g(1, 2)(3)`\n *   - `g(1, 2, 3)`\n *\n * Secondly, the special placeholder value [`R.__`](#__) may be used to specify\n * \"gaps\", allowing partial application of any combination of arguments,\n * regardless of their positions. If `g` is as above and `_` is [`R.__`](#__),\n * the following are equivalent:\n *\n *   - `g(1, 2, 3)`\n *   - `g(_, 2, 3)(1)`\n *   - `g(_, _, 3)(1)(2)`\n *   - `g(_, _, 3)(1, 2)`\n *   - `g(_, 2)(1)(3)`\n *   - `g(_, 2)(1, 3)`\n *   - `g(_, 2)(_, 3)(1)`\n *\n * @func\n * @memberOf R\n * @since v0.5.0\n * @category Function\n * @sig Number -> (* -> a) -> (* -> a)\n * @param {Number} length The arity for the returned function.\n * @param {Function} fn The function to curry.\n * @return {Function} A new, curried function.\n * @see R.curry\n * @example\n *\n *      const sumArgs = (...args) => R.sum(args);\n *\n *      const curriedAddFourNumbers = R.curryN(4, sumArgs);\n *      const f = curriedAddFourNumbers(1, 2);\n *      const g = f(3);\n *      g(4); //=> 10\n */\nvar curryN = /*#__PURE__*/_curry2(function curryN(length, fn) {\n  if (length === 1) {\n    return _curry1(fn);\n  }\n  return _arity(length, _curryN(length, [], fn));\n});\nexport default curryN;","import _curry1 from \"./_curry1.js\";\nimport _curry2 from \"./_curry2.js\";\nimport _isPlaceholder from \"./_isPlaceholder.js\";\n\n/**\n * Optimized internal three-arity curry function.\n *\n * @private\n * @category Function\n * @param {Function} fn The function to curry.\n * @return {Function} The curried function.\n */\nexport default function _curry3(fn) {\n  return function f3(a, b, c) {\n    switch (arguments.length) {\n      case 0:\n        return f3;\n      case 1:\n        return _isPlaceholder(a) ? f3 : _curry2(function (_b, _c) {\n          return fn(a, _b, _c);\n        });\n      case 2:\n        return _isPlaceholder(a) && _isPlaceholder(b) ? f3 : _isPlaceholder(a) ? _curry2(function (_a, _c) {\n          return fn(_a, b, _c);\n        }) : _isPlaceholder(b) ? _curry2(function (_b, _c) {\n          return fn(a, _b, _c);\n        }) : _curry1(function (_c) {\n          return fn(a, b, _c);\n        });\n      default:\n        return _isPlaceholder(a) && _isPlaceholder(b) && _isPlaceholder(c) ? f3 : _isPlaceholder(a) && _isPlaceholder(b) ? _curry2(function (_a, _b) {\n          return fn(_a, _b, c);\n        }) : _isPlaceholder(a) && _isPlaceholder(c) ? _curry2(function (_a, _c) {\n          return fn(_a, b, _c);\n        }) : _isPlaceholder(b) && _isPlaceholder(c) ? _curry2(function (_b, _c) {\n          return fn(a, _b, _c);\n        }) : _isPlaceholder(a) ? _curry1(function (_a) {\n          return fn(_a, b, c);\n        }) : _isPlaceholder(b) ? _curry1(function (_b) {\n          return fn(a, _b, c);\n        }) : _isPlaceholder(c) ? _curry1(function (_c) {\n          return fn(a, b, _c);\n        }) : fn(a, b, c);\n    }\n  };\n}","/**\n * Tests whether or not an object is an array.\n *\n * @private\n * @param {*} val The object to test.\n * @return {Boolean} `true` if `val` is an array, `false` otherwise.\n * @example\n *\n *      _isArray([]); //=> true\n *      _isArray(null); //=> false\n *      _isArray({}); //=> false\n */\nexport default Array.isArray || function _isArray(val) {\n  return val != null && val.length >= 0 && Object.prototype.toString.call(val) === '[object Array]';\n};","/**\n * Determine if the passed argument is an integer.\n *\n * @private\n * @param {*} n\n * @category Type\n * @return {Boolean}\n */\nexport default Number.isInteger || function _isInteger(n) {\n  return n << 0 === n;\n};","export default function _isString(x) {\n  return Object.prototype.toString.call(x) === '[object String]';\n}","import _isString from \"./_isString.js\";\nexport default function _nth(offset, list) {\n  var idx = offset < 0 ? list.length + offset : offset;\n  return _isString(list) ? list.charAt(idx) : list[idx];\n}","import _curry2 from \"./internal/_curry2.js\";\nimport _isInteger from \"./internal/_isInteger.js\";\nimport _nth from \"./internal/_nth.js\";\n\n/**\n * Returns a function that when supplied an object returns the indicated\n * property of that object, if it exists.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Object\n * @typedefn Idx = String | Int | Symbol\n * @sig Idx -> {s: a} -> a | Undefined\n * @param {String|Number} p The property name or array index\n * @param {Object} obj The object to query\n * @return {*} The value at `obj.p`.\n * @see R.path, R.props, R.pluck, R.project, R.nth\n * @example\n *\n *      R.prop('x', {x: 100}); //=> 100\n *      R.prop('x', {}); //=> undefined\n *      R.prop(0, [100]); //=> 100\n *      R.compose(R.inc, R.prop('x'))({ x: 3 }) //=> 4\n */\n\nvar prop = /*#__PURE__*/_curry2(function prop(p, obj) {\n  if (obj == null) {\n    return;\n  }\n  return _isInteger(p) ? _nth(p, obj) : obj[p];\n});\nexport default prop;","import _curry1 from \"./_curry1.js\";\nimport _isArray from \"./_isArray.js\";\nimport _isString from \"./_isString.js\";\n\n/**\n * Tests whether or not an object is similar to an array.\n *\n * @private\n * @category Type\n * @category List\n * @sig * -> Boolean\n * @param {*} x The object to test.\n * @return {Boolean} `true` if `x` has a numeric length property and extreme indices defined; `false` otherwise.\n * @example\n *\n *      _isArrayLike([]); //=> true\n *      _isArrayLike(true); //=> false\n *      _isArrayLike({}); //=> false\n *      _isArrayLike({length: 10}); //=> false\n *      _isArrayLike({0: 'zero', 9: 'nine', length: 10}); //=> true\n *      _isArrayLike({nodeType: 1, length: 1}) // => false\n */\nvar _isArrayLike = /*#__PURE__*/_curry1(function isArrayLike(x) {\n  if (_isArray(x)) {\n    return true;\n  }\n  if (!x) {\n    return false;\n  }\n  if (typeof x !== 'object') {\n    return false;\n  }\n  if (_isString(x)) {\n    return false;\n  }\n  if (x.length === 0) {\n    return true;\n  }\n  if (x.length > 0) {\n    return x.hasOwnProperty(0) && x.hasOwnProperty(x.length - 1);\n  }\n  return false;\n});\nexport default _isArrayLike;","import _isArrayLike from \"./_isArrayLike.js\";\nvar symIterator = typeof Symbol !== 'undefined' ? Symbol.iterator : '@@iterator';\nexport default function _createReduce(arrayReduce, methodReduce, iterableReduce) {\n  return function _reduce(xf, acc, list) {\n    if (_isArrayLike(list)) {\n      return arrayReduce(xf, acc, list);\n    }\n    if (list == null) {\n      return acc;\n    }\n    if (typeof list['fantasy-land/reduce'] === 'function') {\n      return methodReduce(xf, acc, list, 'fantasy-land/reduce');\n    }\n    if (list[symIterator] != null) {\n      return iterableReduce(xf, acc, list[symIterator]());\n    }\n    if (typeof list.next === 'function') {\n      return iterableReduce(xf, acc, list);\n    }\n    if (typeof list.reduce === 'function') {\n      return methodReduce(xf, acc, list, 'reduce');\n    }\n    throw new TypeError('reduce: list must be array or iterable');\n  };\n}","export default function _xArrayReduce(xf, acc, list) {\n  var idx = 0;\n  var len = list.length;\n  while (idx < len) {\n    acc = xf['@@transducer/step'](acc, list[idx]);\n    if (acc && acc['@@transducer/reduced']) {\n      acc = acc['@@transducer/value'];\n      break;\n    }\n    idx += 1;\n  }\n  return xf['@@transducer/result'](acc);\n}","import _arity from \"./internal/_arity.js\";\nimport _curry2 from \"./internal/_curry2.js\";\n\n/**\n * Creates a function that is bound to a context.\n * Note: `R.bind` does not provide the additional argument-binding capabilities of\n * [Function.prototype.bind](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind).\n *\n * @func\n * @memberOf R\n * @since v0.6.0\n * @category Function\n * @category Object\n * @sig (* -> *) -> {*} -> (* -> *)\n * @param {Function} fn The function to bind to context\n * @param {Object} thisObj The context to bind `fn` to\n * @return {Function} A function that will execute in the context of `thisObj`.\n * @see R.partial\n * @example\n *\n *      const log = R.bind(console.log, console);\n *      R.pipe(R.assoc('a', 2), R.tap(log), R.assoc('a', 3))({a: 1}); //=> {a: 3}\n *      // logs {a: 2}\n * @symb R.bind(f, o)(a, b) = f.call(o, a, b)\n */\nvar bind = /*#__PURE__*/_curry2(function bind(fn, thisObj) {\n  return _arity(fn.length, function () {\n    return fn.apply(thisObj, arguments);\n  });\n});\nexport default bind;","import _createReduce from \"./_createReduce.js\";\nimport _xArrayReduce from \"./_xArrayReduce.js\";\nimport bind from \"../bind.js\";\nfunction _xIterableReduce(xf, acc, iter) {\n  var step = iter.next();\n  while (!step.done) {\n    acc = xf['@@transducer/step'](acc, step.value);\n    if (acc && acc['@@transducer/reduced']) {\n      acc = acc['@@transducer/value'];\n      break;\n    }\n    step = iter.next();\n  }\n  return xf['@@transducer/result'](acc);\n}\nfunction _xMethodReduce(xf, acc, obj, methodName) {\n  return xf['@@transducer/result'](obj[methodName](bind(xf['@@transducer/step'], xf), acc));\n}\nvar _xReduce = /*#__PURE__*/_createReduce(_xArrayReduce, _xMethodReduce, _xIterableReduce);\nexport default _xReduce;","var XWrap = /*#__PURE__*/function () {\n  function XWrap(fn) {\n    this.f = fn;\n  }\n  XWrap.prototype['@@transducer/init'] = function () {\n    throw new Error('init not implemented on XWrap');\n  };\n  XWrap.prototype['@@transducer/result'] = function (acc) {\n    return acc;\n  };\n  XWrap.prototype['@@transducer/step'] = function (acc, x) {\n    return this.f(acc, x);\n  };\n  return XWrap;\n}();\nexport default function _xwrap(fn) {\n  return new XWrap(fn);\n}","import _curry3 from \"./internal/_curry3.js\";\nimport _xReduce from \"./internal/_xReduce.js\";\nimport _xwrap from \"./internal/_xwrap.js\";\n\n/**\n * Returns a single item by iterating through the list, successively calling\n * the iterator function and passing it an accumulator value and the current\n * value from the array, and then passing the result to the next call.\n *\n * The iterator function receives two values: *(acc, value)*. It may use\n * [`R.reduced`](#reduced) to shortcut the iteration.\n *\n * The arguments' order of [`reduceRight`](#reduceRight)'s iterator function\n * is *(value, acc)*.\n *\n * Note: `R.reduce` does not skip deleted or unassigned indices (sparse\n * arrays), unlike the native `Array.prototype.reduce` method. For more details\n * on this behavior, see:\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce#Description\n *\n * Be cautious of mutating and returning the accumulator. If you reuse it across\n * invocations, it will continue to accumulate onto the same value. The general\n * recommendation is to always return a new value. If you can't do so for\n * performance reasons, then be sure to reinitialize the accumulator on each\n * invocation.\n *\n * Dispatches to the `reduce` method of the third argument, if present. When\n * doing so, it is up to the user to handle the [`R.reduced`](#reduced)\n * shortcuting, as this is not implemented by `reduce`.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category List\n * @sig ((a, b) -> a) -> a -> [b] -> a\n * @param {Function} fn The iterator function. Receives two values, the accumulator and the\n *        current element from the array.\n * @param {*} acc The accumulator value.\n * @param {Array} list The list to iterate over.\n * @return {*} The final, accumulated value.\n * @see R.reduced, R.addIndex, R.reduceRight\n * @example\n *\n *      R.reduce(R.subtract, 0, [1, 2, 3, 4]) // => ((((0 - 1) - 2) - 3) - 4) = -10\n *      //          -               -10\n *      //         / \\              / \\\n *      //        -   4           -6   4\n *      //       / \\              / \\\n *      //      -   3   ==>     -3   3\n *      //     / \\              / \\\n *      //    -   2           -1   2\n *      //   / \\              / \\\n *      //  0   1            0   1\n *\n * @symb R.reduce(f, a, [b, c, d]) = f(f(f(a, b), c), d)\n */\nvar reduce = /*#__PURE__*/_curry3(function (xf, acc, list) {\n  return _xReduce(typeof xf === 'function' ? _xwrap(xf) : xf, acc, list);\n});\nexport default reduce;","import _curry1 from \"./internal/_curry1.js\";\n\n/**\n * Returns a function that always returns the given value. Note that for\n * non-primitives the value returned is a reference to the original value.\n *\n * This function is known as `const`, `constant`, or `K` (for K combinator) in\n * other languages and libraries.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Function\n * @sig a -> (* -> a)\n * @param {*} val The value to wrap in a function\n * @return {Function} A Function :: * -> val.\n * @example\n *\n *      const t = R.always('Tee');\n *      t(); //=> 'Tee'\n */\nvar always = /*#__PURE__*/_curry1(function always(val) {\n  return function () {\n    return val;\n  };\n});\nexport default always;","import _curry1 from \"./internal/_curry1.js\";\nimport curryN from \"./curryN.js\";\n\n/**\n * Returns a curried equivalent of the provided function. The curried function\n * has two unusual capabilities. First, its arguments needn't be provided one\n * at a time. If `f` is a ternary function and `g` is `R.curry(f)`, the\n * following are equivalent:\n *\n *   - `g(1)(2)(3)`\n *   - `g(1)(2, 3)`\n *   - `g(1, 2)(3)`\n *   - `g(1, 2, 3)`\n *\n * Secondly, the special placeholder value [`R.__`](#__) may be used to specify\n * \"gaps\", allowing partial application of any combination of arguments,\n * regardless of their positions. If `g` is as above and `_` is [`R.__`](#__),\n * the following are equivalent:\n *\n *   - `g(1, 2, 3)`\n *   - `g(_, 2, 3)(1)`\n *   - `g(_, _, 3)(1)(2)`\n *   - `g(_, _, 3)(1, 2)`\n *   - `g(_, 2)(1)(3)`\n *   - `g(_, 2)(1, 3)`\n *   - `g(_, 2)(_, 3)(1)`\n *\n * Please note that default parameters don't count towards a [function arity](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/length)\n * and therefore `curry` won't work well with those.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Function\n * @sig (* -> a) -> (* -> a)\n * @param {Function} fn The function to curry.\n * @return {Function} A new, curried function.\n * @see R.curryN, R.partial\n * @example\n *\n *      const addFourNumbers = (a, b, c, d) => a + b + c + d;\n *      const curriedAddFourNumbers = R.curry(addFourNumbers);\n *      const f = curriedAddFourNumbers(1, 2);\n *      const g = f(3);\n *      g(4); //=> 10\n *\n *      // R.curry not working well with default parameters\n *      const h = R.curry((a, b, c = 2) => a + b + c);\n *      h(1)(2)(7); //=> Error! (`3` is not a function!)\n */\nvar curry = /*#__PURE__*/_curry1(function curry(fn) {\n  return curryN(fn.length, fn);\n});\nexport default curry;","import _curry2 from \"./internal/_curry2.js\";\n\n/**\n * Wraps a function of any arity (including nullary) in a function that accepts\n * exactly `n` parameters. Any extraneous parameters will not be passed to the\n * supplied function.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Function\n * @sig Number -> (* -> a) -> (* -> a)\n * @param {Number} n The desired arity of the new function.\n * @param {Function} fn The function to wrap.\n * @return {Function} A new function wrapping `fn`. The new function is guaranteed to be of\n *         arity `n`.\n * @see R.binary, R.unary\n * @example\n *\n *      const takesTwoArgs = (a, b) => [a, b];\n *\n *      takesTwoArgs.length; //=> 2\n *      takesTwoArgs(1, 2); //=> [1, 2]\n *\n *      const takesOneArg = R.nAry(1, takesTwoArgs);\n *      takesOneArg.length; //=> 1\n *      // Only `n` arguments are passed to the wrapped function\n *      takesOneArg(1, 2); //=> [1, undefined]\n * @symb R.nAry(0, f)(a, b) = f()\n * @symb R.nAry(1, f)(a, b) = f(a)\n * @symb R.nAry(2, f)(a, b) = f(a, b)\n */\nvar nAry = /*#__PURE__*/_curry2(function nAry(n, fn) {\n  switch (n) {\n    case 0:\n      return function () {\n        return fn.call(this);\n      };\n    case 1:\n      return function (a0) {\n        return fn.call(this, a0);\n      };\n    case 2:\n      return function (a0, a1) {\n        return fn.call(this, a0, a1);\n      };\n    case 3:\n      return function (a0, a1, a2) {\n        return fn.call(this, a0, a1, a2);\n      };\n    case 4:\n      return function (a0, a1, a2, a3) {\n        return fn.call(this, a0, a1, a2, a3);\n      };\n    case 5:\n      return function (a0, a1, a2, a3, a4) {\n        return fn.call(this, a0, a1, a2, a3, a4);\n      };\n    case 6:\n      return function (a0, a1, a2, a3, a4, a5) {\n        return fn.call(this, a0, a1, a2, a3, a4, a5);\n      };\n    case 7:\n      return function (a0, a1, a2, a3, a4, a5, a6) {\n        return fn.call(this, a0, a1, a2, a3, a4, a5, a6);\n      };\n    case 8:\n      return function (a0, a1, a2, a3, a4, a5, a6, a7) {\n        return fn.call(this, a0, a1, a2, a3, a4, a5, a6, a7);\n      };\n    case 9:\n      return function (a0, a1, a2, a3, a4, a5, a6, a7, a8) {\n        return fn.call(this, a0, a1, a2, a3, a4, a5, a6, a7, a8);\n      };\n    case 10:\n      return function (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9) {\n        return fn.call(this, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9);\n      };\n    default:\n      throw new Error('First argument to nAry must be a non-negative integer no greater than ten');\n  }\n});\nexport default nAry;","export default function _pipe(f, g) {\n  return function () {\n    return g.call(this, f.apply(this, arguments));\n  };\n}","import _isArray from \"./_isArray.js\";\n\n/**\n * This checks whether a function has a [methodname] function. If it isn't an\n * array it will execute that function otherwise it will default to the ramda\n * implementation.\n *\n * @private\n * @param {Function} fn ramda implementation\n * @param {String} methodname property to check for a custom implementation\n * @return {Object} Whatever the return value of the method is.\n */\nexport default function _checkForMethod(methodname, fn) {\n  return function () {\n    var length = arguments.length;\n    if (length === 0) {\n      return fn();\n    }\n    var obj = arguments[length - 1];\n    return _isArray(obj) || typeof obj[methodname] !== 'function' ? fn.apply(this, arguments) : obj[methodname].apply(obj, Array.prototype.slice.call(arguments, 0, length - 1));\n  };\n}","import _checkForMethod from \"./internal/_checkForMethod.js\";\nimport _curry3 from \"./internal/_curry3.js\";\n\n/**\n * Returns the elements of the given list or string (or object with a `slice`\n * method) from `fromIndex` (inclusive) to `toIndex` (exclusive).\n *\n * Dispatches to the `slice` method of the third argument, if present.\n *\n * @func\n * @memberOf R\n * @since v0.1.4\n * @category List\n * @sig Number -> Number -> [a] -> [a]\n * @sig Number -> Number -> String -> String\n * @param {Number} fromIndex The start index (inclusive).\n * @param {Number} toIndex The end index (exclusive).\n * @param {*} list\n * @return {*}\n * @example\n *\n *      R.slice(1, 3, ['a', 'b', 'c', 'd']);        //=> ['b', 'c']\n *      R.slice(1, Infinity, ['a', 'b', 'c', 'd']); //=> ['b', 'c', 'd']\n *      R.slice(0, -1, ['a', 'b', 'c', 'd']);       //=> ['a', 'b', 'c']\n *      R.slice(-3, -1, ['a', 'b', 'c', 'd']);      //=> ['b', 'c']\n *      R.slice(0, 3, 'ramda');                     //=> 'ram'\n */\nvar slice = /*#__PURE__*/_curry3( /*#__PURE__*/_checkForMethod('slice', function slice(fromIndex, toIndex, list) {\n  return Array.prototype.slice.call(list, fromIndex, toIndex);\n}));\nexport default slice;","import _checkForMethod from \"./internal/_checkForMethod.js\";\nimport _curry1 from \"./internal/_curry1.js\";\nimport slice from \"./slice.js\";\n\n/**\n * Returns all but the first element of the given list or string (or object\n * with a `tail` method).\n *\n * Dispatches to the `slice` method of the first argument, if present.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category List\n * @sig [a] -> [a]\n * @sig String -> String\n * @param {*} list\n * @return {*}\n * @see R.head, R.init, R.last\n * @example\n *\n *      R.tail([1, 2, 3]);  //=> [2, 3]\n *      R.tail([1, 2]);     //=> [2]\n *      R.tail([1]);        //=> []\n *      R.tail([]);         //=> []\n *\n *      R.tail('abc');  //=> 'bc'\n *      R.tail('ab');   //=> 'b'\n *      R.tail('a');    //=> ''\n *      R.tail('');     //=> ''\n */\nvar tail = /*#__PURE__*/_curry1( /*#__PURE__*/_checkForMethod('tail', /*#__PURE__*/slice(1, Infinity)));\nexport default tail;","import _arity from \"./internal/_arity.js\";\nimport _pipe from \"./internal/_pipe.js\";\nimport reduce from \"./reduce.js\";\nimport tail from \"./tail.js\";\n\n/**\n * Performs left-to-right function composition. The first argument may have\n * any arity; the remaining arguments must be unary.\n *\n * In some libraries this function is named `sequence`.\n *\n * **Note:** The result of pipe is not automatically curried.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Function\n * @sig (((a, b, ..., n) -> o), (o -> p), ..., (x -> y), (y -> z)) -> ((a, b, ..., n) -> z)\n * @param {...Function} functions\n * @return {Function}\n * @see R.compose\n * @example\n *\n *      const f = R.pipe(Math.pow, R.negate, R.inc);\n *\n *      f(3, 4); // -(3^4) + 1\n * @symb R.pipe(f, g, h)(a, b) = h(g(f(a, b)))\n * @symb R.pipe(f, g, h)(a)(b) = h(g(f(a)))(b)\n */\nexport default function pipe() {\n  if (arguments.length === 0) {\n    throw new Error('pipe requires at least one argument');\n  }\n  return _arity(arguments[0].length, reduce(_pipe, arguments[0], tail(arguments)));\n}","import _curry2 from \"./internal/_curry2.js\";\nimport curry from \"./curry.js\";\nimport nAry from \"./nAry.js\";\n\n/**\n * Wraps a constructor function inside a curried function that can be called\n * with the same arguments and returns the same type. The arity of the function\n * returned is specified to allow using variadic constructor functions.\n *\n * @func\n * @memberOf R\n * @since v0.4.0\n * @category Function\n * @sig Number -> (* -> {*}) -> (* -> {*})\n * @param {Number} n The arity of the constructor function.\n * @param {Function} Fn The constructor function to wrap.\n * @return {Function} A wrapped, curried constructor function.\n * @example\n *\n *      // Variadic Constructor function\n *      function Salad() {\n *        this.ingredients = arguments;\n *      }\n *\n *      Salad.prototype.recipe = function() {\n *        const instructions = R.map(ingredient => 'Add a dollop of ' + ingredient, this.ingredients);\n *        return R.join('\\n', instructions);\n *      };\n *\n *      const ThreeLayerSalad = R.constructN(3, Salad);\n *\n *      // Notice we no longer need the 'new' keyword, and the constructor is curried for 3 arguments.\n *      const salad = ThreeLayerSalad('Mayonnaise')('Potato Chips')('Ketchup');\n *\n *      console.log(salad.recipe());\n *      // Add a dollop of Mayonnaise\n *      // Add a dollop of Potato Chips\n *      // Add a dollop of Ketchup\n */\nvar constructN = /*#__PURE__*/_curry2(function constructN(n, Fn) {\n  if (n > 10) {\n    throw new Error('Constructor with greater than ten arguments');\n  }\n  if (n === 0) {\n    return function () {\n      return new Fn();\n    };\n  }\n  return curry(nAry(n, function ($0, $1, $2, $3, $4, $5, $6, $7, $8, $9) {\n    switch (n) {\n      case 1:\n        return new Fn($0);\n      case 2:\n        return new Fn($0, $1);\n      case 3:\n        return new Fn($0, $1, $2);\n      case 4:\n        return new Fn($0, $1, $2, $3);\n      case 5:\n        return new Fn($0, $1, $2, $3, $4);\n      case 6:\n        return new Fn($0, $1, $2, $3, $4, $5);\n      case 7:\n        return new Fn($0, $1, $2, $3, $4, $5, $6);\n      case 8:\n        return new Fn($0, $1, $2, $3, $4, $5, $6, $7);\n      case 9:\n        return new Fn($0, $1, $2, $3, $4, $5, $6, $7, $8);\n      case 10:\n        return new Fn($0, $1, $2, $3, $4, $5, $6, $7, $8, $9);\n    }\n  }));\n});\nexport default constructN;","import _curry3 from \"./internal/_curry3.js\";\nimport curryN from \"./curryN.js\";\n\n/**\n * Creates a function that will process either the `onTrue` or the `onFalse`\n * function depending upon the result of the `condition` predicate.\n *\n * Note that `ifElse` takes its arity from the longest of the three functions passed to it.\n *\n * @func\n * @memberOf R\n * @since v0.8.0\n * @category Logic\n * @sig (*... -> Boolean) -> (*... -> *) -> (*... -> *) -> (*... -> *)\n * @param {Function} condition A predicate function\n * @param {Function} onTrue A function to invoke when the `condition` evaluates to a truthy value.\n * @param {Function} onFalse A function to invoke when the `condition` evaluates to a falsy value.\n * @return {Function} A new function that will process either the `onTrue` or the `onFalse`\n *                    function depending upon the result of the `condition` predicate.\n * @see R.unless, R.when, R.cond\n * @example\n *\n *      const incCount = R.ifElse(\n *        R.has('count'),\n *        R.over(R.lensProp('count'), R.inc),\n *        R.assoc('count', 1)\n *      );\n *      incCount({ count: 1 }); //=> { count: 2 }\n *      incCount({});           //=> { count: 1 }\n */\nvar ifElse = /*#__PURE__*/_curry3(function ifElse(condition, onTrue, onFalse) {\n  return curryN(Math.max(condition.length, onTrue.length, onFalse.length), function _ifElse() {\n    return condition.apply(this, arguments) ? onTrue.apply(this, arguments) : onFalse.apply(this, arguments);\n  });\n});\nexport default ifElse;","type Item = {\n  variations?: (string | number)[];\n  [key: string]: any;\n};\n\n/**\n * Builds a variation code string from an item object with variations and their names.\n *\n * @param {Item} item - The item object containing variations and their respective values.\n * @returns {string} - A string representing the variation codes, joined by '&'.\n */\nexport function buildVariationCodeWithNames(item: Item): string {\n  if (!item?.variations) return '';\n\n  return item.variations\n    .filter(variation => item[variation])\n    .map(variation => formatOption(String(variation), item[variation]))\n    .join('&');\n}\n\n/**\n * Builds a variation code string from a record of options with their values.\n *\n * @param {Record<string, string>} options - The record containing key-value pairs to be formatted.\n * @returns {string} - A string representing the variation codes, joined by '&'.\n */\nexport function buildVariationCodeWithValues(\n  options: Record<string, string>,\n): string {\n  return formatOptions(options);\n}\n\n/**\n * Formats a given key and its associated values into a string.\n *\n * @param {string} key - The key representing the variation.\n * @param {string[]} values - The array of values associated with the key.\n * @returns {string} - The formatted string in the form \"key:value1&value2&value3\".\n */\nfunction formatOption(key: string, values: string[]): string {\n  return `${key}:${values.join('&')}`;\n}\n\n/**\n * Formats options from a given record of key-value pairs into a string.\n *\n * @param {Record<string, string>} options - The record containing key-value pairs to be formatted.\n * @returns {string} - The formatted string with each key-value pair joined by '&'.\n */\nfunction formatOptions(options: Record<string, string>): string {\n  return Object.entries(options)\n    .map(([key, value]) => `${key}:${value}`)\n    .join('&');\n}\n","import { AccountVariationsConfig, VtexItem, VtexProduct } from '@nizza/core';\n\n// Extend VtexItem to allow dynamic keys and optional variations\ntype Item = VtexItem & {\n  variations?: (string | number)[];\n  [key: string]: any;\n};\n\nexport function omittedVariationsConfig(\n  product: VtexProduct,\n  variationsConfig: AccountVariationsConfig,\n): VtexProduct {\n  const omitted = variationsConfig.omitted;\n\n  // If there are no items or skuSpecifications, return the original product\n  if (\n    (!product.items || product.items.length === 0) &&\n    (!product.skuSpecifications || product.skuSpecifications.length === 0)\n  ) {\n    return product;\n  }\n\n  const omittedVariationsItems =\n    product.items?.map(item => {\n      const extendedItem = { ...item } as Item;\n\n      // Remove omitted properties\n      if (omitted?.length) {\n        omitted.forEach(key => {\n          delete extendedItem[key as keyof Item];\n        });\n\n        // Filter out omitted variations\n        if (extendedItem.variations?.length) {\n          extendedItem.variations = extendedItem.variations.filter(\n            variation => !omitted.includes(String(variation)),\n          );\n        }\n      }\n\n      return extendedItem;\n    }) ?? [];\n\n  const omittedSkuSpecifications =\n    product.skuSpecifications?.filter(\n      spec => !omitted.includes(spec.field.name),\n    ) ?? [];\n\n  return {\n    ...product,\n    items: omittedVariationsItems,\n    skuSpecifications: omittedSkuSpecifications,\n  };\n}\n","import {\n  AccountVariationsConfig,\n  NizzaProduct,\n  NizzaVariationSelector,\n  VtexProduct,\n} from '@nizza/core';\nimport * as R from 'ramda';\nimport { buildVariationCodeWithNames } from '../variation-code-builder';\nimport { filterAvailableVtexProducts } from './filterAvailableProducts';\nimport { fixLinkHost } from './fixLinkHost';\nimport { getPageUrl, isMyVTEX } from './utils';\nimport { omittedVariationsConfig } from './omittedVariationsConfig';\n\nexport function vtexToNizzaProduct(\n  vtexProduct: VtexProduct,\n  accountHost: string | null = null,\n  applyTax = false,\n  variationsConfig?: AccountVariationsConfig,\n): NizzaProduct {\n  let p: VtexProduct = { ...vtexProduct };\n\n  const result = filterAvailableVtexProducts(p);\n  const { item, seller, isAvailable } = result;\n\n  const getPrice = (price: number) =>\n    applyTax ? price + (seller?.commertialOffer?.Tax || 0) : price;\n\n  const getHost = R.ifElse(\n    R.pipe(getPageUrl, isMyVTEX),\n    R.pipe(getPageUrl, R.constructN(1, URL), R.prop('host')),\n    R.always(accountHost!),\n  );\n\n  const priceWithDiscount = getPrice(seller.commertialOffer.Price);\n  const price = getPrice(seller.commertialOffer.ListPrice);\n\n  if (variationsConfig?.omitted?.length) {\n    p = omittedVariationsConfig(p, variationsConfig);\n  }\n\n  const items = p.items.map(item => ({\n    ...item,\n    variationCode: buildVariationCodeWithNames(item),\n  }));\n\n  let product: NizzaProduct = {\n    /**\n     * Some integrations like the add to cart in vtex.io add\n     * additional information in the product object itself,\n     * that's why this is necessary \"...product\"\n     **/\n    ...p,\n\n    items,\n    price,\n    priceWithDiscount,\n    isAvailable,\n\n    id: p.productId,\n    skuId: item?.itemId,\n    sellerId: seller?.sellerId,\n    name: p?.productName,\n    imageUrl: item?.images[0]?.imageUrl,\n    pdpLink: p.link,\n    addToCartLink: seller?.addToCartLink,\n    variationSelector: (p?.skuSpecifications as NizzaVariationSelector[]) || [],\n  };\n\n  if (accountHost) {\n    const host = getHost();\n    product = fixLinkHost(product, host);\n  }\n\n  return product;\n}\n","import logger from '~logger';\n\nexport type ScriptStatus = 'idle' | 'loading' | 'ready' | 'error';\nexport type ScriptEvents = Exclude<ScriptStatus, 'idle'>;\n\nexport type ScriptAttributes = {\n  [key in keyof HTMLScriptElement | string]: string;\n};\n\n/** Configuration options for the script loading behavior. */\nexport type ScriptConfig = {\n  /** Whether the script should be loaded as an ES6 module. */\n  module?: boolean;\n  /** Flag to bypass the cache by appending a timestamp to the script URL. */\n  cache?: boolean;\n  /** Additional HTML attributes to set on the script element. */\n  attrs?: ScriptAttributes;\n};\n\nexport type EventCallback = (data?: any) => void;\n\n/** Attribute name used to track script loading status in the DOM. */\nconst DATA_STATUS_ATTR = 'data-status';\n\n/**\n * Class responsible for dynamically injecting a script element into the DOM,\n * managing its loading state, and providing event hooks for script status changes.\n * This class handles the script's creation, its addition to the document, and\n * monitors the script's loading progress. Users can subscribe to 'loading', 'ready',\n * and 'error' events to execute custom callbacks based on the script's status.\n */\nexport class ScriptInjector {\n  private src: string;\n  private module: boolean;\n  private attrs: ScriptAttributes;\n  private events: Record<ScriptEvents, EventCallback[]>;\n  private script!: HTMLScriptElement;\n  private cache: boolean;\n\n  /**\n   * Creates an instance of ScriptInjector.\n   * @param {string} src - The source URL of the script.\n   * @param {ScriptConfig} [config={}] - Optional configuration options.\n   */\n  constructor(src: string, config: ScriptConfig = {}) {\n    this.src = src;\n    this.cache = config.cache || false;\n    this.module = config.module || false;\n    this.attrs = config.attrs || {};\n    this.events = {\n      loading: [],\n      ready: [],\n      error: [],\n    };\n  }\n\n  /**\n   * Subscribe to script events.\n   * @param {ScriptEvents} event - The event to subscribe to ('loading', 'ready', 'error').\n   * @param {EventCallback} callback - The callback function to execute when the event occurs.\n   */\n  public on(event: ScriptEvents, callback: EventCallback) {\n    this.events[event]?.push(callback);\n  }\n\n  /**\n   * Execute the script injection process.\n   */\n  public execute() {\n    this.script = this.getScript()!;\n\n    if (this.script) {\n      this.handleScript();\n    } else {\n      this.loadScript();\n    }\n  }\n\n  /**\n   * Get an existing script element if it exists in the DOM.\n   * @returns {HTMLScriptElement | null} - The existing script element or null if not found.\n   */\n  private getScript(): HTMLScriptElement | null {\n    return document.querySelector<HTMLScriptElement>(\n      `script[src*=\"${this.src}\"]`,\n    );\n  }\n\n  /**\n   * Handle an existing script element.\n   */\n  private handleScript() {\n    const status =\n      (this.script.getAttribute(DATA_STATUS_ATTR) as ScriptStatus) || 'idle';\n\n    this.updateStatus(status);\n\n    if (status === 'loading' || status === 'idle') {\n      this.addEventListeners();\n    }\n  }\n\n  /**\n   * Create and load a new script element.\n   */\n  private async loadScript() {\n    this.script = document.createElement('script');\n    this.script.setAttribute(DATA_STATUS_ATTR, 'loading');\n    this.triggerEvent('loading');\n\n    if (this.module) {\n      // Use dynamic import via blob URL to bypass Speedy for ESM modules\n      await this.loadModuleViaBlobUrl();\n    } else {\n      // Traditional script loading for non-module scripts\n      this.loadTraditionalScript();\n    }\n  }\n\n  /**\n   * Load ESM module using dynamic import with blob URL to bypass Speedy\n   */\n  private async loadModuleViaBlobUrl() {\n    try {\n      const scriptUrl = this.cache ? this.src : `${this.src}?_c=${Date.now()}`;\n      logger.debug('Fetching ESM module', { scriptUrl });\n\n      const response = await fetch(scriptUrl);\n\n      if (!response.ok) {\n        throw new Error(`Failed to fetch script: ${response.status}`);\n      }\n\n      let code = await response.text();\n\n      // Rewrite relative imports to absolute URLs\n      const baseUrl = new URL(scriptUrl, window.location.href);\n      const baseDir = baseUrl.href.substring(\n        0,\n        baseUrl.href.lastIndexOf('/') + 1,\n      );\n\n      // Replace all types of imports with relative paths\n      code = code.replace(\n        /(['\"])(\\.\\.?\\/[^'\"]+)(['\"])/g,\n        (match, quote1, path, quote2) => {\n          // Check if this is actually an import statement (not just a string)\n          if (path.startsWith('./') || path.startsWith('../')) {\n            const absoluteUrl = new URL(path, baseDir).href;\n            logger.debug('Rewriting import path', {\n              from: path,\n              to: absoluteUrl,\n            });\n            return `${quote1}${absoluteUrl}${quote2}`;\n          }\n          return match;\n        },\n      );\n\n      logger.debug('Creating blob URL for ESM module', { scriptUrl });\n\n      const blob = new Blob([code], { type: 'application/javascript' });\n      const blobUrl = URL.createObjectURL(blob);\n\n      logger.debug('Importing ESM module via blob URL', { blobUrl, scriptUrl });\n      // Dynamic import bypasses Speedy\n      await import(/* @vite-ignore */ blobUrl);\n\n      // Clean up blob URL after import\n      URL.revokeObjectURL(blobUrl);\n      logger.debug('ESM module loaded successfully', { scriptUrl });\n\n      this.updateStatus('ready');\n    } catch (error) {\n      logger.error('Failed to load ESM module via blob URL', error);\n      this.updateStatus('error');\n    }\n  }\n\n  /**\n   * Traditional script loading with src attribute\n   */\n  private loadTraditionalScript() {\n    this.script.src = this.cache ? this.src : `${this.src}?_c=${Date.now()}`;\n    this.script.async = true;\n\n    Object.entries(this.attrs).forEach(([key, value]) =>\n      this.script.setAttribute(key, value),\n    );\n\n    this.addEventListeners();\n    document.body.appendChild(this.script);\n  }\n\n  /**\n   * Add event listeners to the script element.\n   */\n  private addEventListeners() {\n    this.script.addEventListener('load', () => this.updateStatus('ready'));\n    this.script.addEventListener('error', () => this.updateStatus('error'));\n  }\n\n  /**\n   * Update the status of the script element.\n   * @param {ScriptStatus} status - The new status of the script.\n   */\n  private updateStatus(status: ScriptStatus) {\n    this.script.setAttribute(DATA_STATUS_ATTR, status);\n    this.triggerEvent(status);\n  }\n\n  /**\n   * Trigger the callbacks for a given event.\n   * @param {ScriptStatus} status - The event status to trigger.\n   */\n  private triggerEvent(status: ScriptStatus) {\n    const callbacks = this.events[status as ScriptEvents];\n    if (!callbacks) return;\n    callbacks.forEach(callback => callback());\n  }\n}\n","import { ComponentManager, GlobalComponent, shortId, sleep } from '@nizza/core';\nimport baseLogger from '~logger';\nimport {\n  ScriptConfig as BaseScriptConfig,\n  ScriptEvents,\n  ScriptInjector,\n} from '../script-injector';\n\nconst logger = baseLogger.child('VtexIoScriptInjector');\n\nexport interface VtexIoScriptConfig extends BaseScriptConfig {\n  src: string;\n  lazy?: boolean;\n  id?: string;\n  baseId?: string;\n  globalId?: string;\n}\n\ntype EventCallback = (instance: VtexIoScriptInjector, data?: any) => void;\n\nexport class VtexIoScriptInjector {\n  private scriptInjector: ScriptInjector;\n  private lazy: boolean;\n  private id?: string;\n  private baseId?: string;\n  private globalId?: string;\n  private events: Record<ScriptEvents, EventCallback[]>;\n  component?: ComponentManager;\n  fullId: string;\n\n  constructor(config: VtexIoScriptConfig) {\n    this.lazy = config.lazy ?? true;\n    this.id = config.id;\n    this.baseId = config.baseId;\n    this.globalId = config.globalId;\n    this.events = {\n      loading: [],\n      ready: [],\n      error: [],\n    };\n\n    if (!this.id && !this.baseId) {\n      throw new Error(\n        'VtexIoScriptInjector: Either id or baseId must be provided in the config.',\n      );\n    }\n\n    this.fullId = this.generateFullId();\n\n    this.scriptInjector = new ScriptInjector(config.src, {\n      module: config.module,\n      cache: config.cache,\n      attrs: config.attrs,\n    });\n\n    this.scriptInjector.on('loading', () => this.triggerEvent('loading'));\n    this.scriptInjector.on('ready', async () => {\n      await this.loadComponent();\n      this.triggerEvent('ready');\n    });\n    this.scriptInjector.on('error', error => {\n      this.triggerEvent('error', error);\n      logger.error(`Script load error`, error);\n    });\n\n    if (!this.lazy) {\n      this.execute();\n    }\n  }\n\n  on(event: ScriptEvents, callback: EventCallback) {\n    this.events[event]?.push(callback);\n    return this;\n  }\n\n  execute() {\n    this.scriptInjector.execute();\n  }\n\n  async render(props: Record<string, any> = {}) {\n    if (this.component) {\n      try {\n        await this.component.render(props);\n      } catch (error) {\n        logger.error('error render ComponentManager', error);\n      }\n    } else {\n      const errorMsg = `Component not loaded (id: ${this.fullId})`;\n      logger.error(errorMsg);\n    }\n  }\n\n  unmount() {\n    if (this.component) {\n      this.component.unmount();\n    } else {\n      const errorMsg = `Component not loaded (id: ${this.fullId})`;\n      logger.error(errorMsg);\n    }\n  }\n\n  getElement() {\n    return document.getElementById(this.fullId);\n  }\n\n  async loadComponent() {\n    try {\n      this.component = await this.getGlobalComponent();\n    } catch (error) {\n      this.triggerEvent('error', error);\n      logger.error(\n        `VtexIoScriptInjector: Error loading component (id: ${this.fullId})`,\n        error,\n      );\n    }\n  }\n\n  private async getGlobalComponent(): Promise<ComponentManager | undefined> {\n    const baseId = this.fullId\n      .split('__')[0]\n      .replace(/^[a-z]{2}-/, '')\n      .replace(/-./g, x => x[1].toUpperCase());\n    const maxRetries = 20;\n    const initialInterval = 50;\n\n    for (let i = 0; i < maxRetries; i++) {\n      const module = (window as any)[this.globalId!]?.[\n        baseId\n      ] as GlobalComponent;\n      if (module) {\n        return new ComponentManager(this.fullId, module.render, baseLogger);\n      }\n      await sleep(initialInterval * 2 ** i);\n    }\n\n    const errorMsg = `VtexIoScriptInjector: Render function not found after ${maxRetries} attempts.`;\n    logger.error(errorMsg);\n    throw new Error(errorMsg);\n  }\n\n  private triggerEvent(event: ScriptEvents, data?: any) {\n    const callbacks = this.events[event];\n    if (!callbacks) return;\n    callbacks.forEach(callback => callback(this, data));\n  }\n\n  private generateFullId(): string {\n    if (this.baseId) {\n      return `${this.baseId}__${shortId(6)}`;\n    } else if (this.id) {\n      return this.id;\n    }\n    const errorMsg =\n      'VtexIoScriptInjector: Either id or baseId must be provided in the config.';\n    logger.error(errorMsg);\n    throw new Error(errorMsg);\n  }\n}\n","import {\n  getNizza,\n  NizzaGetCollectionHandler,\n  NizzaGetProductHandler,\n  NizzaGetProductHandlerInput,\n  NizzaGetProductListHandler,\n  NizzaGetProductListHandlerInput,\n  NizzaProduct,\n  NizzaProductDataSource,\n  NizzaProductDataSourceConfig,\n  nzApiClient,\n  VtexProduct,\n} from '@nizza/core';\nimport baseLogger from '~logger';\nimport { buildVtexCatalogUrl, vtexToNizzaProduct } from '../../vtex';\n\nconst logger = baseLogger.child('VtexProductDataSource');\n\ntype Config = NizzaProductDataSourceConfig & {\n  corsProxy?: boolean;\n};\n\nexport class VtexProductDataSource implements NizzaProductDataSource {\n  private accountName: string;\n  private accountHost: string | null;\n  private defaultUseProxy = false;\n\n  constructor(readonly config: Config) {\n    const nizza = getNizza();\n    if (!nizza.account) throw new Error('Nizza account is invalid');\n    const { account, host } = nizza.account;\n\n    this.accountName = account;\n    this.accountHost = host;\n    this.defaultUseProxy = config.corsProxy ?? false;\n  }\n\n  getProduct: NizzaGetProductHandler = async input => {\n    const data = await this.fetchProducts(input);\n    return this.convertProductData(data)[0] || null;\n  };\n\n  getProductList: NizzaGetProductListHandler = async input => {\n    const data = await this.fetchProducts(input);\n    return this.convertProductData(data);\n  };\n\n  getCollection: NizzaGetCollectionHandler = async input => {\n    const data = await this.fetchProducts(input);\n    const products = this.convertProductData(data);\n\n    let collectionName = '';\n    const collectionId = input?.collectionId ?? '';\n\n    if (collectionId && data.length > 0) {\n      collectionName = data[0]?.productClusters?.[collectionId] ?? '';\n    }\n\n    return {\n      id: collectionId,\n      name: collectionName,\n      products,\n    };\n  };\n\n  private convertProductData(data: VtexProduct[]): NizzaProduct[] {\n    const { accountApplyTax } = this.config;\n    return data.map(product =>\n      vtexToNizzaProduct(product, this.accountHost, accountApplyTax),\n    );\n  }\n\n  private async fetchProducts(\n    input: NizzaGetProductHandlerInput | NizzaGetProductListHandlerInput = {},\n  ): Promise<VtexProduct[]> {\n    try {\n      // The first attempt uses the proxy default configuration\n      const { _rawData } = await this.tryFetchProducts(\n        input,\n        this.defaultUseProxy,\n      );\n      return _rawData || [];\n    } catch (error: any) {\n      logger.debug('Error fetching products directly. Retrying with proxy.', {\n        originalError: error.message,\n      });\n      // If the first attempt fails, we retry forcing the proxy.\n      return this.retryFetchProductsWithProxy(input, error);\n    }\n  }\n\n  private async retryFetchProductsWithProxy(\n    input: NizzaGetProductHandlerInput | NizzaGetProductListHandlerInput,\n    hostError: Error,\n  ): Promise<VtexProduct[]> {\n    try {\n      const { _rawData } = await this.tryFetchProducts(input, true); // forzarProxyTo `true`\n      return _rawData || [];\n    } catch (proxyError: any) {\n      // Both attempts failed.\n      const errorMessage = `Failed to fetch products. Host error: ${hostError.message}, Proxy error: ${proxyError.message}`;\n      logger.error(errorMessage, { hostError, proxyError });\n      // We launched a new mistake that encapsulates both failures.\n      throw new Error(errorMessage);\n    }\n  }\n\n  private async tryFetchProducts(\n    input: NizzaGetProductHandlerInput | NizzaGetProductListHandlerInput,\n    useProxy: boolean,\n  ) {\n    const corsProxyOrigin = useProxy\n      ? this.defaultUseProxy\n        ? 'ls-default-proxy'\n        : 'ls-products-cors-error'\n      : undefined;\n\n    // `buildVtexCatalogUrl` generates an absolute URL\n    const fullUrl = buildVtexCatalogUrl({\n      limit: this.config.defaultLimit,\n      corsProxy: useProxy,\n      corsProxyOrigin,\n      account: this.accountName,\n      accountHost: this.accountHost,\n      ...input,\n    });\n\n    // Extract the base and path from the absolute URL to pass to ApiClient\n    const urlObject = new URL(fullUrl);\n    const baseURL = urlObject.origin;\n    const path = urlObject.pathname + urlObject.search + urlObject.hash;\n\n    return nzApiClient.rest<VtexProduct[]>({\n      baseURL,\n      path,\n      timeout: 5000,\n    });\n  }\n}\n","var niceErrors = {\n  0: \"Invalid value for configuration 'enforceActions', expected 'never', 'always' or 'observed'\",\n  1: function _(annotationType, key) {\n    return \"Cannot apply '\" + annotationType + \"' to '\" + key.toString() + \"': Field not found.\";\n  },\n  /*\n  2(prop) {\n      return `invalid decorator for '${prop.toString()}'`\n  },\n  3(prop) {\n      return `Cannot decorate '${prop.toString()}': action can only be used on properties with a function value.`\n  },\n  4(prop) {\n      return `Cannot decorate '${prop.toString()}': computed can only be used on getter properties.`\n  },\n  */\n  5: \"'keys()' can only be used on observable objects, arrays, sets and maps\",\n  6: \"'values()' can only be used on observable objects, arrays, sets and maps\",\n  7: \"'entries()' can only be used on observable objects, arrays and maps\",\n  8: \"'set()' can only be used on observable objects, arrays and maps\",\n  9: \"'remove()' can only be used on observable objects, arrays and maps\",\n  10: \"'has()' can only be used on observable objects, arrays and maps\",\n  11: \"'get()' can only be used on observable objects, arrays and maps\",\n  12: \"Invalid annotation\",\n  13: \"Dynamic observable objects cannot be frozen. If you're passing observables to 3rd party component/function that calls Object.freeze, pass copy instead: toJS(observable)\",\n  14: \"Intercept handlers should return nothing or a change object\",\n  15: \"Observable arrays cannot be frozen. If you're passing observables to 3rd party component/function that calls Object.freeze, pass copy instead: toJS(observable)\",\n  16: \"Modification exception: the internal structure of an observable array was changed.\",\n  17: function _(index, length) {\n    return \"[mobx.array] Index out of bounds, \" + index + \" is larger than \" + length;\n  },\n  18: \"mobx.map requires Map polyfill for the current browser. Check babel-polyfill or core-js/es6/map.js\",\n  19: function _(other) {\n    return \"Cannot initialize from classes that inherit from Map: \" + other.constructor.name;\n  },\n  20: function _(other) {\n    return \"Cannot initialize map from \" + other;\n  },\n  21: function _(dataStructure) {\n    return \"Cannot convert to map from '\" + dataStructure + \"'\";\n  },\n  22: \"mobx.set requires Set polyfill for the current browser. Check babel-polyfill or core-js/es6/set.js\",\n  23: \"It is not possible to get index atoms from arrays\",\n  24: function _(thing) {\n    return \"Cannot obtain administration from \" + thing;\n  },\n  25: function _(property, name) {\n    return \"the entry '\" + property + \"' does not exist in the observable map '\" + name + \"'\";\n  },\n  26: \"please specify a property\",\n  27: function _(property, name) {\n    return \"no observable property '\" + property.toString() + \"' found on the observable object '\" + name + \"'\";\n  },\n  28: function _(thing) {\n    return \"Cannot obtain atom from \" + thing;\n  },\n  29: \"Expecting some object\",\n  30: \"invalid action stack. did you forget to finish an action?\",\n  31: \"missing option for computed: get\",\n  32: function _(name, derivation) {\n    return \"Cycle detected in computation \" + name + \": \" + derivation;\n  },\n  33: function _(name) {\n    return \"The setter of computed value '\" + name + \"' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?\";\n  },\n  34: function _(name) {\n    return \"[ComputedValue '\" + name + \"'] It is not possible to assign a new value to a computed value.\";\n  },\n  35: \"There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`\",\n  36: \"isolateGlobalState should be called before MobX is running any reactions\",\n  37: function _(method) {\n    return \"[mobx] `observableArray.\" + method + \"()` mutates the array in-place, which is not allowed inside a derivation. Use `array.slice().\" + method + \"()` instead\";\n  },\n  38: \"'ownKeys()' can only be used on observable objects\",\n  39: \"'defineProperty()' can only be used on observable objects\"\n};\nvar errors = process.env.NODE_ENV !== \"production\" ? niceErrors : {};\nfunction die(error) {\n  for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n    args[_key - 1] = arguments[_key];\n  }\n  if (process.env.NODE_ENV !== \"production\") {\n    var e = typeof error === \"string\" ? error : errors[error];\n    if (typeof e === \"function\") e = e.apply(null, args);\n    throw new Error(\"[MobX] \" + e);\n  }\n  throw new Error(typeof error === \"number\" ? \"[MobX] minified error nr: \" + error + (args.length ? \" \" + args.map(String).join(\",\") : \"\") + \". Find the full error at: https://github.com/mobxjs/mobx/blob/main/packages/mobx/src/errors.ts\" : \"[MobX] \" + error);\n}\n\nvar mockGlobal = {};\nfunction getGlobal() {\n  if (typeof globalThis !== \"undefined\") {\n    return globalThis;\n  }\n  if (typeof window !== \"undefined\") {\n    return window;\n  }\n  if (typeof global !== \"undefined\") {\n    return global;\n  }\n  if (typeof self !== \"undefined\") {\n    return self;\n  }\n  return mockGlobal;\n}\n\n// We shorten anything used > 5 times\nvar assign = Object.assign;\nvar getDescriptor = Object.getOwnPropertyDescriptor;\nvar defineProperty = Object.defineProperty;\nvar objectPrototype = Object.prototype;\nvar EMPTY_ARRAY = [];\nObject.freeze(EMPTY_ARRAY);\nvar EMPTY_OBJECT = {};\nObject.freeze(EMPTY_OBJECT);\nvar hasProxy = typeof Proxy !== \"undefined\";\nvar plainObjectString = /*#__PURE__*/Object.toString();\nfunction assertProxies() {\n  if (!hasProxy) {\n    die(process.env.NODE_ENV !== \"production\" ? \"`Proxy` objects are not available in the current environment. Please configure MobX to enable a fallback implementation.`\" : \"Proxy not available\");\n  }\n}\nfunction warnAboutProxyRequirement(msg) {\n  if (process.env.NODE_ENV !== \"production\" && globalState.verifyProxies) {\n    die(\"MobX is currently configured to be able to run in ES5 mode, but in ES5 MobX won't be able to \" + msg);\n  }\n}\nfunction getNextId() {\n  return ++globalState.mobxGuid;\n}\n/**\n * Makes sure that the provided function is invoked at most once.\n */\nfunction once(func) {\n  var invoked = false;\n  return function () {\n    if (invoked) {\n      return;\n    }\n    invoked = true;\n    return func.apply(this, arguments);\n  };\n}\nvar noop = function noop() {};\nfunction isFunction(fn) {\n  return typeof fn === \"function\";\n}\nfunction isStringish(value) {\n  var t = typeof value;\n  switch (t) {\n    case \"string\":\n    case \"symbol\":\n    case \"number\":\n      return true;\n  }\n  return false;\n}\nfunction isObject(value) {\n  return value !== null && typeof value === \"object\";\n}\nfunction isPlainObject(value) {\n  if (!isObject(value)) {\n    return false;\n  }\n  var proto = Object.getPrototypeOf(value);\n  if (proto == null) {\n    return true;\n  }\n  var protoConstructor = Object.hasOwnProperty.call(proto, \"constructor\") && proto.constructor;\n  return typeof protoConstructor === \"function\" && protoConstructor.toString() === plainObjectString;\n}\n// https://stackoverflow.com/a/37865170\nfunction isGenerator(obj) {\n  var constructor = obj == null ? void 0 : obj.constructor;\n  if (!constructor) {\n    return false;\n  }\n  if (\"GeneratorFunction\" === constructor.name || \"GeneratorFunction\" === constructor.displayName) {\n    return true;\n  }\n  return false;\n}\nfunction addHiddenProp(object, propName, value) {\n  defineProperty(object, propName, {\n    enumerable: false,\n    writable: true,\n    configurable: true,\n    value: value\n  });\n}\nfunction addHiddenFinalProp(object, propName, value) {\n  defineProperty(object, propName, {\n    enumerable: false,\n    writable: false,\n    configurable: true,\n    value: value\n  });\n}\nfunction createInstanceofPredicate(name, theClass) {\n  var propName = \"isMobX\" + name;\n  theClass.prototype[propName] = true;\n  return function (x) {\n    return isObject(x) && x[propName] === true;\n  };\n}\nfunction isES6Map(thing) {\n  return thing != null && Object.prototype.toString.call(thing) === \"[object Map]\";\n}\nfunction isPlainES6Map(thing) {\n  var mapProto = Object.getPrototypeOf(thing);\n  var objectProto = Object.getPrototypeOf(mapProto);\n  var nullProto = Object.getPrototypeOf(objectProto);\n  return nullProto === null;\n}\nfunction isES6Set(thing) {\n  return thing != null && Object.prototype.toString.call(thing) === \"[object Set]\";\n}\nvar hasGetOwnPropertySymbols = typeof Object.getOwnPropertySymbols !== \"undefined\";\n/**\n * Returns the following: own enumerable keys and symbols.\n */\nfunction getPlainObjectKeys(object) {\n  var keys = Object.keys(object);\n  // Not supported in IE, so there are not going to be symbol props anyway...\n  if (!hasGetOwnPropertySymbols) {\n    return keys;\n  }\n  var symbols = Object.getOwnPropertySymbols(object);\n  if (!symbols.length) {\n    return keys;\n  }\n  return [].concat(keys, symbols.filter(function (s) {\n    return objectPrototype.propertyIsEnumerable.call(object, s);\n  }));\n}\n// From Immer utils\n// Returns all own keys, including non-enumerable and symbolic\nvar ownKeys = typeof Reflect !== \"undefined\" && Reflect.ownKeys ? Reflect.ownKeys : hasGetOwnPropertySymbols ? function (obj) {\n  return Object.getOwnPropertyNames(obj).concat(Object.getOwnPropertySymbols(obj));\n} : /* istanbul ignore next */Object.getOwnPropertyNames;\nfunction stringifyKey(key) {\n  if (typeof key === \"string\") {\n    return key;\n  }\n  if (typeof key === \"symbol\") {\n    return key.toString();\n  }\n  return new String(key).toString();\n}\nfunction toPrimitive(value) {\n  return value === null ? null : typeof value === \"object\" ? \"\" + value : value;\n}\nfunction hasProp(target, prop) {\n  return objectPrototype.hasOwnProperty.call(target, prop);\n}\n// From Immer utils\nvar getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors || function getOwnPropertyDescriptors(target) {\n  // Polyfill needed for Hermes and IE, see https://github.com/facebook/hermes/issues/274\n  var res = {};\n  // Note: without polyfill for ownKeys, symbols won't be picked up\n  ownKeys(target).forEach(function (key) {\n    res[key] = getDescriptor(target, key);\n  });\n  return res;\n};\nfunction getFlag(flags, mask) {\n  return !!(flags & mask);\n}\nfunction setFlag(flags, mask, newValue) {\n  if (newValue) {\n    flags |= mask;\n  } else {\n    flags &= ~mask;\n  }\n  return flags;\n}\n\nfunction _arrayLikeToArray(r, a) {\n  (null == a || a > r.length) && (a = r.length);\n  for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];\n  return n;\n}\nfunction _defineProperties(e, r) {\n  for (var t = 0; t < r.length; t++) {\n    var o = r[t];\n    o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o);\n  }\n}\nfunction _createClass(e, r, t) {\n  return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", {\n    writable: !1\n  }), e;\n}\nfunction _createForOfIteratorHelperLoose(r, e) {\n  var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"];\n  if (t) return (t = t.call(r)).next.bind(t);\n  if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && \"number\" == typeof r.length) {\n    t && (r = t);\n    var o = 0;\n    return function () {\n      return o >= r.length ? {\n        done: !0\n      } : {\n        done: !1,\n        value: r[o++]\n      };\n    };\n  }\n  throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\nfunction _extends() {\n  return _extends = Object.assign ? Object.assign.bind() : function (n) {\n    for (var e = 1; e < arguments.length; e++) {\n      var t = arguments[e];\n      for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);\n    }\n    return n;\n  }, _extends.apply(null, arguments);\n}\nfunction _inheritsLoose(t, o) {\n  t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o);\n}\nfunction _setPrototypeOf(t, e) {\n  return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {\n    return t.__proto__ = e, t;\n  }, _setPrototypeOf(t, e);\n}\nfunction _toPrimitive(t, r) {\n  if (\"object\" != typeof t || !t) return t;\n  var e = t[Symbol.toPrimitive];\n  if (void 0 !== e) {\n    var i = e.call(t, r || \"default\");\n    if (\"object\" != typeof i) return i;\n    throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n  }\n  return (\"string\" === r ? String : Number)(t);\n}\nfunction _toPropertyKey(t) {\n  var i = _toPrimitive(t, \"string\");\n  return \"symbol\" == typeof i ? i : i + \"\";\n}\nfunction _unsupportedIterableToArray(r, a) {\n  if (r) {\n    if (\"string\" == typeof r) return _arrayLikeToArray(r, a);\n    var t = {}.toString.call(r).slice(8, -1);\n    return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;\n  }\n}\n\nvar storedAnnotationsSymbol = /*#__PURE__*/Symbol(\"mobx-stored-annotations\");\n/**\n * Creates a function that acts as\n * - decorator\n * - annotation object\n */\nfunction createDecoratorAnnotation(annotation) {\n  function decorator(target, property) {\n    if (is20223Decorator(property)) {\n      return annotation.decorate_20223_(target, property);\n    } else {\n      storeAnnotation(target, property, annotation);\n    }\n  }\n  return Object.assign(decorator, annotation);\n}\n/**\n * Stores annotation to prototype,\n * so it can be inspected later by `makeObservable` called from constructor\n */\nfunction storeAnnotation(prototype, key, annotation) {\n  if (!hasProp(prototype, storedAnnotationsSymbol)) {\n    addHiddenProp(prototype, storedAnnotationsSymbol, _extends({}, prototype[storedAnnotationsSymbol]));\n  }\n  // @override must override something\n  if (process.env.NODE_ENV !== \"production\" && isOverride(annotation) && !hasProp(prototype[storedAnnotationsSymbol], key)) {\n    var fieldName = prototype.constructor.name + \".prototype.\" + key.toString();\n    die(\"'\" + fieldName + \"' is decorated with 'override', \" + \"but no such decorated member was found on prototype.\");\n  }\n  // Cannot re-decorate\n  assertNotDecorated(prototype, annotation, key);\n  // Ignore override\n  if (!isOverride(annotation)) {\n    prototype[storedAnnotationsSymbol][key] = annotation;\n  }\n}\nfunction assertNotDecorated(prototype, annotation, key) {\n  if (process.env.NODE_ENV !== \"production\" && !isOverride(annotation) && hasProp(prototype[storedAnnotationsSymbol], key)) {\n    var fieldName = prototype.constructor.name + \".prototype.\" + key.toString();\n    var currentAnnotationType = prototype[storedAnnotationsSymbol][key].annotationType_;\n    var requestedAnnotationType = annotation.annotationType_;\n    die(\"Cannot apply '@\" + requestedAnnotationType + \"' to '\" + fieldName + \"':\" + (\"\\nThe field is already decorated with '@\" + currentAnnotationType + \"'.\") + \"\\nRe-decorating fields is not allowed.\" + \"\\nUse '@override' decorator for methods overridden by subclass.\");\n  }\n}\n/**\n * Collects annotations from prototypes and stores them on target (instance)\n */\nfunction collectStoredAnnotations(target) {\n  if (!hasProp(target, storedAnnotationsSymbol)) {\n    // if (__DEV__ && !target[storedAnnotationsSymbol]) {\n    //     die(\n    //         `No annotations were passed to makeObservable, but no decorated members have been found either`\n    //     )\n    // }\n    // We need a copy as we will remove annotation from the list once it's applied.\n    addHiddenProp(target, storedAnnotationsSymbol, _extends({}, target[storedAnnotationsSymbol]));\n  }\n  return target[storedAnnotationsSymbol];\n}\nfunction is20223Decorator(context) {\n  return typeof context == \"object\" && typeof context[\"kind\"] == \"string\";\n}\nfunction assert20223DecoratorType(context, types) {\n  if (process.env.NODE_ENV !== \"production\" && !types.includes(context.kind)) {\n    die(\"The decorator applied to '\" + String(context.name) + \"' cannot be used on a \" + context.kind + \" element\");\n  }\n}\n\nvar $mobx = /*#__PURE__*/Symbol(\"mobx administration\");\nvar Atom = /*#__PURE__*/function () {\n  /**\n   * Create a new atom. For debugging purposes it is recommended to give it a name.\n   * The onBecomeObserved and onBecomeUnobserved callbacks can be used for resource management.\n   */\n  function Atom(name_) {\n    if (name_ === void 0) {\n      name_ = process.env.NODE_ENV !== \"production\" ? \"Atom@\" + getNextId() : \"Atom\";\n    }\n    this.name_ = void 0;\n    this.flags_ = 0;\n    this.observers_ = new Set();\n    this.lastAccessedBy_ = 0;\n    this.lowestObserverState_ = IDerivationState_.NOT_TRACKING_;\n    // onBecomeObservedListeners\n    this.onBOL = void 0;\n    // onBecomeUnobservedListeners\n    this.onBUOL = void 0;\n    this.name_ = name_;\n  }\n  // for effective unobserving. BaseAtom has true, for extra optimization, so its onBecomeUnobserved never gets called, because it's not needed\n  var _proto = Atom.prototype;\n  _proto.onBO = function onBO() {\n    if (this.onBOL) {\n      this.onBOL.forEach(function (listener) {\n        return listener();\n      });\n    }\n  };\n  _proto.onBUO = function onBUO() {\n    if (this.onBUOL) {\n      this.onBUOL.forEach(function (listener) {\n        return listener();\n      });\n    }\n  }\n  /**\n   * Invoke this method to notify mobx that your atom has been used somehow.\n   * Returns true if there is currently a reactive context.\n   */;\n  _proto.reportObserved = function reportObserved$1() {\n    return reportObserved(this);\n  }\n  /**\n   * Invoke this method _after_ this method has changed to signal mobx that all its observers should invalidate.\n   */;\n  _proto.reportChanged = function reportChanged() {\n    startBatch();\n    propagateChanged(this);\n    endBatch();\n  };\n  _proto.toString = function toString() {\n    return this.name_;\n  };\n  return _createClass(Atom, [{\n    key: \"isBeingObserved\",\n    get: function get() {\n      return getFlag(this.flags_, Atom.isBeingObservedMask_);\n    },\n    set: function set(newValue) {\n      this.flags_ = setFlag(this.flags_, Atom.isBeingObservedMask_, newValue);\n    }\n  }, {\n    key: \"isPendingUnobservation\",\n    get: function get() {\n      return getFlag(this.flags_, Atom.isPendingUnobservationMask_);\n    },\n    set: function set(newValue) {\n      this.flags_ = setFlag(this.flags_, Atom.isPendingUnobservationMask_, newValue);\n    }\n  }, {\n    key: \"diffValue\",\n    get: function get() {\n      return getFlag(this.flags_, Atom.diffValueMask_) ? 1 : 0;\n    },\n    set: function set(newValue) {\n      this.flags_ = setFlag(this.flags_, Atom.diffValueMask_, newValue === 1 ? true : false);\n    }\n  }]);\n}();\nAtom.isBeingObservedMask_ = 1;\nAtom.isPendingUnobservationMask_ = 2;\nAtom.diffValueMask_ = 4;\nvar isAtom = /*#__PURE__*/createInstanceofPredicate(\"Atom\", Atom);\nfunction createAtom(name, onBecomeObservedHandler, onBecomeUnobservedHandler) {\n  if (onBecomeObservedHandler === void 0) {\n    onBecomeObservedHandler = noop;\n  }\n  if (onBecomeUnobservedHandler === void 0) {\n    onBecomeUnobservedHandler = noop;\n  }\n  var atom = new Atom(name);\n  // default `noop` listener will not initialize the hook Set\n  if (onBecomeObservedHandler !== noop) {\n    onBecomeObserved(atom, onBecomeObservedHandler);\n  }\n  if (onBecomeUnobservedHandler !== noop) {\n    onBecomeUnobserved(atom, onBecomeUnobservedHandler);\n  }\n  return atom;\n}\n\nfunction identityComparer(a, b) {\n  return a === b;\n}\nfunction structuralComparer(a, b) {\n  return deepEqual(a, b);\n}\nfunction shallowComparer(a, b) {\n  return deepEqual(a, b, 1);\n}\nfunction defaultComparer(a, b) {\n  if (Object.is) {\n    return Object.is(a, b);\n  }\n  return a === b ? a !== 0 || 1 / a === 1 / b : a !== a && b !== b;\n}\nvar comparer = {\n  identity: identityComparer,\n  structural: structuralComparer,\n  \"default\": defaultComparer,\n  shallow: shallowComparer\n};\n\nfunction deepEnhancer(v, _, name) {\n  // it is an observable already, done\n  if (isObservable(v)) {\n    return v;\n  }\n  // something that can be converted and mutated?\n  if (Array.isArray(v)) {\n    return observable.array(v, {\n      name: name\n    });\n  }\n  if (isPlainObject(v)) {\n    return observable.object(v, undefined, {\n      name: name\n    });\n  }\n  if (isES6Map(v)) {\n    return observable.map(v, {\n      name: name\n    });\n  }\n  if (isES6Set(v)) {\n    return observable.set(v, {\n      name: name\n    });\n  }\n  if (typeof v === \"function\" && !isAction(v) && !isFlow(v)) {\n    if (isGenerator(v)) {\n      return flow(v);\n    } else {\n      return autoAction(name, v);\n    }\n  }\n  return v;\n}\nfunction shallowEnhancer(v, _, name) {\n  if (v === undefined || v === null) {\n    return v;\n  }\n  if (isObservableObject(v) || isObservableArray(v) || isObservableMap(v) || isObservableSet(v)) {\n    return v;\n  }\n  if (Array.isArray(v)) {\n    return observable.array(v, {\n      name: name,\n      deep: false\n    });\n  }\n  if (isPlainObject(v)) {\n    return observable.object(v, undefined, {\n      name: name,\n      deep: false\n    });\n  }\n  if (isES6Map(v)) {\n    return observable.map(v, {\n      name: name,\n      deep: false\n    });\n  }\n  if (isES6Set(v)) {\n    return observable.set(v, {\n      name: name,\n      deep: false\n    });\n  }\n  if (process.env.NODE_ENV !== \"production\") {\n    die(\"The shallow modifier / decorator can only used in combination with arrays, objects, maps and sets\");\n  }\n}\nfunction referenceEnhancer(newValue) {\n  // never turn into an observable\n  return newValue;\n}\nfunction refStructEnhancer(v, oldValue) {\n  if (process.env.NODE_ENV !== \"production\" && isObservable(v)) {\n    die(\"observable.struct should not be used with observable values\");\n  }\n  if (deepEqual(v, oldValue)) {\n    return oldValue;\n  }\n  return v;\n}\n\nvar OVERRIDE = \"override\";\nvar override = /*#__PURE__*/createDecoratorAnnotation({\n  annotationType_: OVERRIDE,\n  make_: make_,\n  extend_: extend_,\n  decorate_20223_: decorate_20223_\n});\nfunction isOverride(annotation) {\n  return annotation.annotationType_ === OVERRIDE;\n}\nfunction make_(adm, key) {\n  // Must not be plain object\n  if (process.env.NODE_ENV !== \"production\" && adm.isPlainObject_) {\n    die(\"Cannot apply '\" + this.annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + this.annotationType_ + \"' cannot be used on plain objects.\"));\n  }\n  // Must override something\n  if (process.env.NODE_ENV !== \"production\" && !hasProp(adm.appliedAnnotations_, key)) {\n    die(\"'\" + adm.name_ + \".\" + key.toString() + \"' is annotated with '\" + this.annotationType_ + \"', \" + \"but no such annotated member was found on prototype.\");\n  }\n  return 0 /* MakeResult.Cancel */;\n}\nfunction extend_(adm, key, descriptor, proxyTrap) {\n  die(\"'\" + this.annotationType_ + \"' can only be used with 'makeObservable'\");\n}\nfunction decorate_20223_(desc, context) {\n  console.warn(\"'\" + this.annotationType_ + \"' cannot be used with decorators - this is a no-op\");\n}\n\nfunction createActionAnnotation(name, options) {\n  return {\n    annotationType_: name,\n    options_: options,\n    make_: make_$1,\n    extend_: extend_$1,\n    decorate_20223_: decorate_20223_$1\n  };\n}\nfunction make_$1(adm, key, descriptor, source) {\n  var _this$options_;\n  // bound\n  if ((_this$options_ = this.options_) != null && _this$options_.bound) {\n    return this.extend_(adm, key, descriptor, false) === null ? 0 /* MakeResult.Cancel */ : 1 /* MakeResult.Break */;\n  }\n  // own\n  if (source === adm.target_) {\n    return this.extend_(adm, key, descriptor, false) === null ? 0 /* MakeResult.Cancel */ : 2 /* MakeResult.Continue */;\n  }\n  // prototype\n  if (isAction(descriptor.value)) {\n    // A prototype could have been annotated already by other constructor,\n    // rest of the proto chain must be annotated already\n    return 1 /* MakeResult.Break */;\n  }\n  var actionDescriptor = createActionDescriptor(adm, this, key, descriptor, false);\n  defineProperty(source, key, actionDescriptor);\n  return 2 /* MakeResult.Continue */;\n}\nfunction extend_$1(adm, key, descriptor, proxyTrap) {\n  var actionDescriptor = createActionDescriptor(adm, this, key, descriptor);\n  return adm.defineProperty_(key, actionDescriptor, proxyTrap);\n}\nfunction decorate_20223_$1(mthd, context) {\n  if (process.env.NODE_ENV !== \"production\") {\n    assert20223DecoratorType(context, [\"method\", \"field\"]);\n  }\n  var kind = context.kind,\n    name = context.name,\n    addInitializer = context.addInitializer;\n  var ann = this;\n  var _createAction = function _createAction(m) {\n    var _ann$options_$name, _ann$options_, _ann$options_$autoAct, _ann$options_2;\n    return createAction((_ann$options_$name = (_ann$options_ = ann.options_) == null ? void 0 : _ann$options_.name) != null ? _ann$options_$name : name.toString(), m, (_ann$options_$autoAct = (_ann$options_2 = ann.options_) == null ? void 0 : _ann$options_2.autoAction) != null ? _ann$options_$autoAct : false);\n  };\n  // Backwards/Legacy behavior, expects makeObservable(this)\n  if (kind == \"field\") {\n    addInitializer(function () {\n      storeAnnotation(this, name, ann);\n    });\n    return;\n  }\n  if (kind == \"method\") {\n    var _this$options_2;\n    if (!isAction(mthd)) {\n      mthd = _createAction(mthd);\n    }\n    if ((_this$options_2 = this.options_) != null && _this$options_2.bound) {\n      addInitializer(function () {\n        var self = this;\n        var bound = self[name].bind(self);\n        bound.isMobxAction = true;\n        self[name] = bound;\n      });\n    }\n    return mthd;\n  }\n  die(\"Cannot apply '\" + ann.annotationType_ + \"' to '\" + String(name) + \"' (kind: \" + kind + \"):\" + (\"\\n'\" + ann.annotationType_ + \"' can only be used on properties with a function value.\"));\n}\nfunction assertActionDescriptor(adm, _ref, key, _ref2) {\n  var annotationType_ = _ref.annotationType_;\n  var value = _ref2.value;\n  if (process.env.NODE_ENV !== \"production\" && !isFunction(value)) {\n    die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' can only be used on properties with a function value.\"));\n  }\n}\nfunction createActionDescriptor(adm, annotation, key, descriptor,\n// provides ability to disable safeDescriptors for prototypes\nsafeDescriptors) {\n  var _annotation$options_, _annotation$options_$, _annotation$options_2, _annotation$options_$2, _annotation$options_3, _annotation$options_4, _adm$proxy_2;\n  if (safeDescriptors === void 0) {\n    safeDescriptors = globalState.safeDescriptors;\n  }\n  assertActionDescriptor(adm, annotation, key, descriptor);\n  var value = descriptor.value;\n  if ((_annotation$options_ = annotation.options_) != null && _annotation$options_.bound) {\n    var _adm$proxy_;\n    value = value.bind((_adm$proxy_ = adm.proxy_) != null ? _adm$proxy_ : adm.target_);\n  }\n  return {\n    value: createAction((_annotation$options_$ = (_annotation$options_2 = annotation.options_) == null ? void 0 : _annotation$options_2.name) != null ? _annotation$options_$ : key.toString(), value, (_annotation$options_$2 = (_annotation$options_3 = annotation.options_) == null ? void 0 : _annotation$options_3.autoAction) != null ? _annotation$options_$2 : false,\n    // https://github.com/mobxjs/mobx/discussions/3140\n    (_annotation$options_4 = annotation.options_) != null && _annotation$options_4.bound ? (_adm$proxy_2 = adm.proxy_) != null ? _adm$proxy_2 : adm.target_ : undefined),\n    // Non-configurable for classes\n    // prevents accidental field redefinition in subclass\n    configurable: safeDescriptors ? adm.isPlainObject_ : true,\n    // https://github.com/mobxjs/mobx/pull/2641#issuecomment-737292058\n    enumerable: false,\n    // Non-obsevable, therefore non-writable\n    // Also prevents rewriting in subclass constructor\n    writable: safeDescriptors ? false : true\n  };\n}\n\nfunction createFlowAnnotation(name, options) {\n  return {\n    annotationType_: name,\n    options_: options,\n    make_: make_$2,\n    extend_: extend_$2,\n    decorate_20223_: decorate_20223_$2\n  };\n}\nfunction make_$2(adm, key, descriptor, source) {\n  var _this$options_;\n  // own\n  if (source === adm.target_) {\n    return this.extend_(adm, key, descriptor, false) === null ? 0 /* MakeResult.Cancel */ : 2 /* MakeResult.Continue */;\n  }\n  // prototype\n  // bound - must annotate protos to support super.flow()\n  if ((_this$options_ = this.options_) != null && _this$options_.bound && (!hasProp(adm.target_, key) || !isFlow(adm.target_[key]))) {\n    if (this.extend_(adm, key, descriptor, false) === null) {\n      return 0 /* MakeResult.Cancel */;\n    }\n  }\n  if (isFlow(descriptor.value)) {\n    // A prototype could have been annotated already by other constructor,\n    // rest of the proto chain must be annotated already\n    return 1 /* MakeResult.Break */;\n  }\n  var flowDescriptor = createFlowDescriptor(adm, this, key, descriptor, false, false);\n  defineProperty(source, key, flowDescriptor);\n  return 2 /* MakeResult.Continue */;\n}\nfunction extend_$2(adm, key, descriptor, proxyTrap) {\n  var _this$options_2;\n  var flowDescriptor = createFlowDescriptor(adm, this, key, descriptor, (_this$options_2 = this.options_) == null ? void 0 : _this$options_2.bound);\n  return adm.defineProperty_(key, flowDescriptor, proxyTrap);\n}\nfunction decorate_20223_$2(mthd, context) {\n  var _this$options_3;\n  if (process.env.NODE_ENV !== \"production\") {\n    assert20223DecoratorType(context, [\"method\"]);\n  }\n  var name = context.name,\n    addInitializer = context.addInitializer;\n  if (!isFlow(mthd)) {\n    mthd = flow(mthd);\n  }\n  if ((_this$options_3 = this.options_) != null && _this$options_3.bound) {\n    addInitializer(function () {\n      var self = this;\n      var bound = self[name].bind(self);\n      bound.isMobXFlow = true;\n      self[name] = bound;\n    });\n  }\n  return mthd;\n}\nfunction assertFlowDescriptor(adm, _ref, key, _ref2) {\n  var annotationType_ = _ref.annotationType_;\n  var value = _ref2.value;\n  if (process.env.NODE_ENV !== \"production\" && !isFunction(value)) {\n    die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' can only be used on properties with a generator function value.\"));\n  }\n}\nfunction createFlowDescriptor(adm, annotation, key, descriptor, bound,\n// provides ability to disable safeDescriptors for prototypes\nsafeDescriptors) {\n  if (safeDescriptors === void 0) {\n    safeDescriptors = globalState.safeDescriptors;\n  }\n  assertFlowDescriptor(adm, annotation, key, descriptor);\n  var value = descriptor.value;\n  // In case of flow.bound, the descriptor can be from already annotated prototype\n  if (!isFlow(value)) {\n    value = flow(value);\n  }\n  if (bound) {\n    var _adm$proxy_;\n    // We do not keep original function around, so we bind the existing flow\n    value = value.bind((_adm$proxy_ = adm.proxy_) != null ? _adm$proxy_ : adm.target_);\n    // This is normally set by `flow`, but `bind` returns new function...\n    value.isMobXFlow = true;\n  }\n  return {\n    value: value,\n    // Non-configurable for classes\n    // prevents accidental field redefinition in subclass\n    configurable: safeDescriptors ? adm.isPlainObject_ : true,\n    // https://github.com/mobxjs/mobx/pull/2641#issuecomment-737292058\n    enumerable: false,\n    // Non-obsevable, therefore non-writable\n    // Also prevents rewriting in subclass constructor\n    writable: safeDescriptors ? false : true\n  };\n}\n\nfunction createComputedAnnotation(name, options) {\n  return {\n    annotationType_: name,\n    options_: options,\n    make_: make_$3,\n    extend_: extend_$3,\n    decorate_20223_: decorate_20223_$3\n  };\n}\nfunction make_$3(adm, key, descriptor) {\n  return this.extend_(adm, key, descriptor, false) === null ? 0 /* MakeResult.Cancel */ : 1 /* MakeResult.Break */;\n}\nfunction extend_$3(adm, key, descriptor, proxyTrap) {\n  assertComputedDescriptor(adm, this, key, descriptor);\n  return adm.defineComputedProperty_(key, _extends({}, this.options_, {\n    get: descriptor.get,\n    set: descriptor.set\n  }), proxyTrap);\n}\nfunction decorate_20223_$3(get, context) {\n  if (process.env.NODE_ENV !== \"production\") {\n    assert20223DecoratorType(context, [\"getter\"]);\n  }\n  var ann = this;\n  var key = context.name,\n    addInitializer = context.addInitializer;\n  addInitializer(function () {\n    var adm = asObservableObject(this)[$mobx];\n    var options = _extends({}, ann.options_, {\n      get: get,\n      context: this\n    });\n    options.name || (options.name = process.env.NODE_ENV !== \"production\" ? adm.name_ + \".\" + key.toString() : \"ObservableObject.\" + key.toString());\n    adm.values_.set(key, new ComputedValue(options));\n  });\n  return function () {\n    return this[$mobx].getObservablePropValue_(key);\n  };\n}\nfunction assertComputedDescriptor(adm, _ref, key, _ref2) {\n  var annotationType_ = _ref.annotationType_;\n  var get = _ref2.get;\n  if (process.env.NODE_ENV !== \"production\" && !get) {\n    die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' can only be used on getter(+setter) properties.\"));\n  }\n}\n\nfunction createObservableAnnotation(name, options) {\n  return {\n    annotationType_: name,\n    options_: options,\n    make_: make_$4,\n    extend_: extend_$4,\n    decorate_20223_: decorate_20223_$4\n  };\n}\nfunction make_$4(adm, key, descriptor) {\n  return this.extend_(adm, key, descriptor, false) === null ? 0 /* MakeResult.Cancel */ : 1 /* MakeResult.Break */;\n}\nfunction extend_$4(adm, key, descriptor, proxyTrap) {\n  var _this$options_$enhanc, _this$options_;\n  assertObservableDescriptor(adm, this, key, descriptor);\n  return adm.defineObservableProperty_(key, descriptor.value, (_this$options_$enhanc = (_this$options_ = this.options_) == null ? void 0 : _this$options_.enhancer) != null ? _this$options_$enhanc : deepEnhancer, proxyTrap);\n}\nfunction decorate_20223_$4(desc, context) {\n  if (process.env.NODE_ENV !== \"production\") {\n    if (context.kind === \"field\") {\n      throw die(\"Please use `@observable accessor \" + String(context.name) + \"` instead of `@observable \" + String(context.name) + \"`\");\n    }\n    assert20223DecoratorType(context, [\"accessor\"]);\n  }\n  var ann = this;\n  var kind = context.kind,\n    name = context.name;\n  // The laziness here is not ideal... It's a workaround to how 2022.3 Decorators are implemented:\n  //   `addInitializer` callbacks are executed _before_ any accessors are defined (instead of the ideal-for-us right after each).\n  //   This means that, if we were to do our stuff in an `addInitializer`, we'd attempt to read a private slot\n  //   before it has been initialized. The runtime doesn't like that and throws a `Cannot read private member\n  //   from an object whose class did not declare it` error.\n  // TODO: it seems that this will not be required anymore in the final version of the spec\n  // See TODO: link\n  var initializedObjects = new WeakSet();\n  function initializeObservable(target, value) {\n    var _ann$options_$enhance, _ann$options_;\n    var adm = asObservableObject(target)[$mobx];\n    var observable = new ObservableValue(value, (_ann$options_$enhance = (_ann$options_ = ann.options_) == null ? void 0 : _ann$options_.enhancer) != null ? _ann$options_$enhance : deepEnhancer, process.env.NODE_ENV !== \"production\" ? adm.name_ + \".\" + name.toString() : \"ObservableObject.\" + name.toString(), false);\n    adm.values_.set(name, observable);\n    initializedObjects.add(target);\n  }\n  if (kind == \"accessor\") {\n    return {\n      get: function get() {\n        if (!initializedObjects.has(this)) {\n          initializeObservable(this, desc.get.call(this));\n        }\n        return this[$mobx].getObservablePropValue_(name);\n      },\n      set: function set(value) {\n        if (!initializedObjects.has(this)) {\n          initializeObservable(this, value);\n        }\n        return this[$mobx].setObservablePropValue_(name, value);\n      },\n      init: function init(value) {\n        if (!initializedObjects.has(this)) {\n          initializeObservable(this, value);\n        }\n        return value;\n      }\n    };\n  }\n  return;\n}\nfunction assertObservableDescriptor(adm, _ref, key, descriptor) {\n  var annotationType_ = _ref.annotationType_;\n  if (process.env.NODE_ENV !== \"production\" && !(\"value\" in descriptor)) {\n    die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' cannot be used on getter/setter properties\"));\n  }\n}\n\nvar AUTO = \"true\";\nvar autoAnnotation = /*#__PURE__*/createAutoAnnotation();\nfunction createAutoAnnotation(options) {\n  return {\n    annotationType_: AUTO,\n    options_: options,\n    make_: make_$5,\n    extend_: extend_$5,\n    decorate_20223_: decorate_20223_$5\n  };\n}\nfunction make_$5(adm, key, descriptor, source) {\n  var _this$options_3, _this$options_4;\n  // getter -> computed\n  if (descriptor.get) {\n    return computed.make_(adm, key, descriptor, source);\n  }\n  // lone setter -> action setter\n  if (descriptor.set) {\n    // TODO make action applicable to setter and delegate to action.make_\n    var set = createAction(key.toString(), descriptor.set);\n    // own\n    if (source === adm.target_) {\n      return adm.defineProperty_(key, {\n        configurable: globalState.safeDescriptors ? adm.isPlainObject_ : true,\n        set: set\n      }) === null ? 0 /* MakeResult.Cancel */ : 2 /* MakeResult.Continue */;\n    }\n    // proto\n    defineProperty(source, key, {\n      configurable: true,\n      set: set\n    });\n    return 2 /* MakeResult.Continue */;\n  }\n  // function on proto -> autoAction/flow\n  if (source !== adm.target_ && typeof descriptor.value === \"function\") {\n    var _this$options_2;\n    if (isGenerator(descriptor.value)) {\n      var _this$options_;\n      var flowAnnotation = (_this$options_ = this.options_) != null && _this$options_.autoBind ? flow.bound : flow;\n      return flowAnnotation.make_(adm, key, descriptor, source);\n    }\n    var actionAnnotation = (_this$options_2 = this.options_) != null && _this$options_2.autoBind ? autoAction.bound : autoAction;\n    return actionAnnotation.make_(adm, key, descriptor, source);\n  }\n  // other -> observable\n  // Copy props from proto as well, see test:\n  // \"decorate should work with Object.create\"\n  var observableAnnotation = ((_this$options_3 = this.options_) == null ? void 0 : _this$options_3.deep) === false ? observable.ref : observable;\n  // if function respect autoBind option\n  if (typeof descriptor.value === \"function\" && (_this$options_4 = this.options_) != null && _this$options_4.autoBind) {\n    var _adm$proxy_;\n    descriptor.value = descriptor.value.bind((_adm$proxy_ = adm.proxy_) != null ? _adm$proxy_ : adm.target_);\n  }\n  return observableAnnotation.make_(adm, key, descriptor, source);\n}\nfunction extend_$5(adm, key, descriptor, proxyTrap) {\n  var _this$options_5, _this$options_6;\n  // getter -> computed\n  if (descriptor.get) {\n    return computed.extend_(adm, key, descriptor, proxyTrap);\n  }\n  // lone setter -> action setter\n  if (descriptor.set) {\n    // TODO make action applicable to setter and delegate to action.extend_\n    return adm.defineProperty_(key, {\n      configurable: globalState.safeDescriptors ? adm.isPlainObject_ : true,\n      set: createAction(key.toString(), descriptor.set)\n    }, proxyTrap);\n  }\n  // other -> observable\n  // if function respect autoBind option\n  if (typeof descriptor.value === \"function\" && (_this$options_5 = this.options_) != null && _this$options_5.autoBind) {\n    var _adm$proxy_2;\n    descriptor.value = descriptor.value.bind((_adm$proxy_2 = adm.proxy_) != null ? _adm$proxy_2 : adm.target_);\n  }\n  var observableAnnotation = ((_this$options_6 = this.options_) == null ? void 0 : _this$options_6.deep) === false ? observable.ref : observable;\n  return observableAnnotation.extend_(adm, key, descriptor, proxyTrap);\n}\nfunction decorate_20223_$5(desc, context) {\n  die(\"'\" + this.annotationType_ + \"' cannot be used as a decorator\");\n}\n\nvar OBSERVABLE = \"observable\";\nvar OBSERVABLE_REF = \"observable.ref\";\nvar OBSERVABLE_SHALLOW = \"observable.shallow\";\nvar OBSERVABLE_STRUCT = \"observable.struct\";\n// Predefined bags of create observable options, to avoid allocating temporarily option objects\n// in the majority of cases\nvar defaultCreateObservableOptions = {\n  deep: true,\n  name: undefined,\n  defaultDecorator: undefined,\n  proxy: true\n};\nObject.freeze(defaultCreateObservableOptions);\nfunction asCreateObservableOptions(thing) {\n  return thing || defaultCreateObservableOptions;\n}\nvar observableAnnotation = /*#__PURE__*/createObservableAnnotation(OBSERVABLE);\nvar observableRefAnnotation = /*#__PURE__*/createObservableAnnotation(OBSERVABLE_REF, {\n  enhancer: referenceEnhancer\n});\nvar observableShallowAnnotation = /*#__PURE__*/createObservableAnnotation(OBSERVABLE_SHALLOW, {\n  enhancer: shallowEnhancer\n});\nvar observableStructAnnotation = /*#__PURE__*/createObservableAnnotation(OBSERVABLE_STRUCT, {\n  enhancer: refStructEnhancer\n});\nvar observableDecoratorAnnotation = /*#__PURE__*/createDecoratorAnnotation(observableAnnotation);\nfunction getEnhancerFromOptions(options) {\n  return options.deep === true ? deepEnhancer : options.deep === false ? referenceEnhancer : getEnhancerFromAnnotation(options.defaultDecorator);\n}\nfunction getAnnotationFromOptions(options) {\n  var _options$defaultDecor;\n  return options ? (_options$defaultDecor = options.defaultDecorator) != null ? _options$defaultDecor : createAutoAnnotation(options) : undefined;\n}\nfunction getEnhancerFromAnnotation(annotation) {\n  var _annotation$options_$, _annotation$options_;\n  return !annotation ? deepEnhancer : (_annotation$options_$ = (_annotation$options_ = annotation.options_) == null ? void 0 : _annotation$options_.enhancer) != null ? _annotation$options_$ : deepEnhancer;\n}\n/**\n * Turns an object, array or function into a reactive structure.\n * @param v the value which should become observable.\n */\nfunction createObservable(v, arg2, arg3) {\n  // @observable someProp; (2022.3 Decorators)\n  if (is20223Decorator(arg2)) {\n    return observableAnnotation.decorate_20223_(v, arg2);\n  }\n  // @observable someProp;\n  if (isStringish(arg2)) {\n    storeAnnotation(v, arg2, observableAnnotation);\n    return;\n  }\n  // already observable - ignore\n  if (isObservable(v)) {\n    return v;\n  }\n  // plain object\n  if (isPlainObject(v)) {\n    return observable.object(v, arg2, arg3);\n  }\n  // Array\n  if (Array.isArray(v)) {\n    return observable.array(v, arg2);\n  }\n  // Map\n  if (isES6Map(v)) {\n    return observable.map(v, arg2);\n  }\n  // Set\n  if (isES6Set(v)) {\n    return observable.set(v, arg2);\n  }\n  // other object - ignore\n  if (typeof v === \"object\" && v !== null) {\n    return v;\n  }\n  // anything else\n  return observable.box(v, arg2);\n}\nassign(createObservable, observableDecoratorAnnotation);\nvar observableFactories = {\n  box: function box(value, options) {\n    var o = asCreateObservableOptions(options);\n    return new ObservableValue(value, getEnhancerFromOptions(o), o.name, true, o.equals);\n  },\n  array: function array(initialValues, options) {\n    var o = asCreateObservableOptions(options);\n    return (globalState.useProxies === false || o.proxy === false ? createLegacyArray : createObservableArray)(initialValues, getEnhancerFromOptions(o), o.name);\n  },\n  map: function map(initialValues, options) {\n    var o = asCreateObservableOptions(options);\n    return new ObservableMap(initialValues, getEnhancerFromOptions(o), o.name);\n  },\n  set: function set(initialValues, options) {\n    var o = asCreateObservableOptions(options);\n    return new ObservableSet(initialValues, getEnhancerFromOptions(o), o.name);\n  },\n  object: function object(props, decorators, options) {\n    return initObservable(function () {\n      return extendObservable(globalState.useProxies === false || (options == null ? void 0 : options.proxy) === false ? asObservableObject({}, options) : asDynamicObservableObject({}, options), props, decorators);\n    });\n  },\n  ref: /*#__PURE__*/createDecoratorAnnotation(observableRefAnnotation),\n  shallow: /*#__PURE__*/createDecoratorAnnotation(observableShallowAnnotation),\n  deep: observableDecoratorAnnotation,\n  struct: /*#__PURE__*/createDecoratorAnnotation(observableStructAnnotation)\n};\n// eslint-disable-next-line\nvar observable = /*#__PURE__*/assign(createObservable, observableFactories);\n\nvar COMPUTED = \"computed\";\nvar COMPUTED_STRUCT = \"computed.struct\";\nvar computedAnnotation = /*#__PURE__*/createComputedAnnotation(COMPUTED);\nvar computedStructAnnotation = /*#__PURE__*/createComputedAnnotation(COMPUTED_STRUCT, {\n  equals: comparer.structural\n});\n/**\n * Decorator for class properties: @computed get value() { return expr; }.\n * For legacy purposes also invokable as ES5 observable created: `computed(() => expr)`;\n */\nvar computed = function computed(arg1, arg2) {\n  if (is20223Decorator(arg2)) {\n    // @computed (2022.3 Decorators)\n    return computedAnnotation.decorate_20223_(arg1, arg2);\n  }\n  if (isStringish(arg2)) {\n    // @computed\n    return storeAnnotation(arg1, arg2, computedAnnotation);\n  }\n  if (isPlainObject(arg1)) {\n    // @computed({ options })\n    return createDecoratorAnnotation(createComputedAnnotation(COMPUTED, arg1));\n  }\n  // computed(expr, options?)\n  if (process.env.NODE_ENV !== \"production\") {\n    if (!isFunction(arg1)) {\n      die(\"First argument to `computed` should be an expression.\");\n    }\n    if (isFunction(arg2)) {\n      die(\"A setter as second argument is no longer supported, use `{ set: fn }` option instead\");\n    }\n  }\n  var opts = isPlainObject(arg2) ? arg2 : {};\n  opts.get = arg1;\n  opts.name || (opts.name = arg1.name || \"\"); /* for generated name */\n  return new ComputedValue(opts);\n};\nObject.assign(computed, computedAnnotation);\ncomputed.struct = /*#__PURE__*/createDecoratorAnnotation(computedStructAnnotation);\n\nvar _getDescriptor$config, _getDescriptor;\n// we don't use globalState for these in order to avoid possible issues with multiple\n// mobx versions\nvar currentActionId = 0;\nvar nextActionId = 1;\nvar isFunctionNameConfigurable = (_getDescriptor$config = (_getDescriptor = /*#__PURE__*/getDescriptor(function () {}, \"name\")) == null ? void 0 : _getDescriptor.configurable) != null ? _getDescriptor$config : false;\n// we can safely recycle this object\nvar tmpNameDescriptor = {\n  value: \"action\",\n  configurable: true,\n  writable: false,\n  enumerable: false\n};\nfunction createAction(actionName, fn, autoAction, ref) {\n  if (autoAction === void 0) {\n    autoAction = false;\n  }\n  if (process.env.NODE_ENV !== \"production\") {\n    if (!isFunction(fn)) {\n      die(\"`action` can only be invoked on functions\");\n    }\n    if (typeof actionName !== \"string\" || !actionName) {\n      die(\"actions should have valid names, got: '\" + actionName + \"'\");\n    }\n  }\n  function res() {\n    return executeAction(actionName, autoAction, fn, ref || this, arguments);\n  }\n  res.isMobxAction = true;\n  res.toString = function () {\n    return fn.toString();\n  };\n  if (isFunctionNameConfigurable) {\n    tmpNameDescriptor.value = actionName;\n    defineProperty(res, \"name\", tmpNameDescriptor);\n  }\n  return res;\n}\nfunction executeAction(actionName, canRunAsDerivation, fn, scope, args) {\n  var runInfo = _startAction(actionName, canRunAsDerivation, scope, args);\n  try {\n    return fn.apply(scope, args);\n  } catch (err) {\n    runInfo.error_ = err;\n    throw err;\n  } finally {\n    _endAction(runInfo);\n  }\n}\nfunction _startAction(actionName, canRunAsDerivation,\n// true for autoAction\nscope, args) {\n  var notifySpy_ = process.env.NODE_ENV !== \"production\" && isSpyEnabled() && !!actionName;\n  var startTime_ = 0;\n  if (process.env.NODE_ENV !== \"production\" && notifySpy_) {\n    startTime_ = Date.now();\n    var flattenedArgs = args ? Array.from(args) : EMPTY_ARRAY;\n    spyReportStart({\n      type: ACTION,\n      name: actionName,\n      object: scope,\n      arguments: flattenedArgs\n    });\n  }\n  var prevDerivation_ = globalState.trackingDerivation;\n  var runAsAction = !canRunAsDerivation || !prevDerivation_;\n  startBatch();\n  var prevAllowStateChanges_ = globalState.allowStateChanges; // by default preserve previous allow\n  if (runAsAction) {\n    untrackedStart();\n    prevAllowStateChanges_ = allowStateChangesStart(true);\n  }\n  var prevAllowStateReads_ = allowStateReadsStart(true);\n  var runInfo = {\n    runAsAction_: runAsAction,\n    prevDerivation_: prevDerivation_,\n    prevAllowStateChanges_: prevAllowStateChanges_,\n    prevAllowStateReads_: prevAllowStateReads_,\n    notifySpy_: notifySpy_,\n    startTime_: startTime_,\n    actionId_: nextActionId++,\n    parentActionId_: currentActionId\n  };\n  currentActionId = runInfo.actionId_;\n  return runInfo;\n}\nfunction _endAction(runInfo) {\n  if (currentActionId !== runInfo.actionId_) {\n    die(30);\n  }\n  currentActionId = runInfo.parentActionId_;\n  if (runInfo.error_ !== undefined) {\n    globalState.suppressReactionErrors = true;\n  }\n  allowStateChangesEnd(runInfo.prevAllowStateChanges_);\n  allowStateReadsEnd(runInfo.prevAllowStateReads_);\n  endBatch();\n  if (runInfo.runAsAction_) {\n    untrackedEnd(runInfo.prevDerivation_);\n  }\n  if (process.env.NODE_ENV !== \"production\" && runInfo.notifySpy_) {\n    spyReportEnd({\n      time: Date.now() - runInfo.startTime_\n    });\n  }\n  globalState.suppressReactionErrors = false;\n}\nfunction allowStateChanges(allowStateChanges, func) {\n  var prev = allowStateChangesStart(allowStateChanges);\n  try {\n    return func();\n  } finally {\n    allowStateChangesEnd(prev);\n  }\n}\nfunction allowStateChangesStart(allowStateChanges) {\n  var prev = globalState.allowStateChanges;\n  globalState.allowStateChanges = allowStateChanges;\n  return prev;\n}\nfunction allowStateChangesEnd(prev) {\n  globalState.allowStateChanges = prev;\n}\n\nvar CREATE = \"create\";\nvar ObservableValue = /*#__PURE__*/function (_Atom) {\n  function ObservableValue(value, enhancer, name_, notifySpy, equals) {\n    var _this;\n    if (name_ === void 0) {\n      name_ = process.env.NODE_ENV !== \"production\" ? \"ObservableValue@\" + getNextId() : \"ObservableValue\";\n    }\n    if (notifySpy === void 0) {\n      notifySpy = true;\n    }\n    if (equals === void 0) {\n      equals = comparer[\"default\"];\n    }\n    _this = _Atom.call(this, name_) || this;\n    _this.enhancer = void 0;\n    _this.name_ = void 0;\n    _this.equals = void 0;\n    _this.hasUnreportedChange_ = false;\n    _this.interceptors_ = void 0;\n    _this.changeListeners_ = void 0;\n    _this.value_ = void 0;\n    _this.dehancer = void 0;\n    _this.enhancer = enhancer;\n    _this.name_ = name_;\n    _this.equals = equals;\n    _this.value_ = enhancer(value, undefined, name_);\n    if (process.env.NODE_ENV !== \"production\" && notifySpy && isSpyEnabled()) {\n      // only notify spy if this is a stand-alone observable\n      spyReport({\n        type: CREATE,\n        object: _this,\n        observableKind: \"value\",\n        debugObjectName: _this.name_,\n        newValue: \"\" + _this.value_\n      });\n    }\n    return _this;\n  }\n  _inheritsLoose(ObservableValue, _Atom);\n  var _proto = ObservableValue.prototype;\n  _proto.dehanceValue = function dehanceValue(value) {\n    if (this.dehancer !== undefined) {\n      return this.dehancer(value);\n    }\n    return value;\n  };\n  _proto.set = function set(newValue) {\n    var oldValue = this.value_;\n    newValue = this.prepareNewValue_(newValue);\n    if (newValue !== globalState.UNCHANGED) {\n      var notifySpy = isSpyEnabled();\n      if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n        spyReportStart({\n          type: UPDATE,\n          object: this,\n          observableKind: \"value\",\n          debugObjectName: this.name_,\n          newValue: newValue,\n          oldValue: oldValue\n        });\n      }\n      this.setNewValue_(newValue);\n      if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n        spyReportEnd();\n      }\n    }\n  };\n  _proto.prepareNewValue_ = function prepareNewValue_(newValue) {\n    checkIfStateModificationsAreAllowed(this);\n    if (hasInterceptors(this)) {\n      var change = interceptChange(this, {\n        object: this,\n        type: UPDATE,\n        newValue: newValue\n      });\n      if (!change) {\n        return globalState.UNCHANGED;\n      }\n      newValue = change.newValue;\n    }\n    // apply modifier\n    newValue = this.enhancer(newValue, this.value_, this.name_);\n    return this.equals(this.value_, newValue) ? globalState.UNCHANGED : newValue;\n  };\n  _proto.setNewValue_ = function setNewValue_(newValue) {\n    var oldValue = this.value_;\n    this.value_ = newValue;\n    this.reportChanged();\n    if (hasListeners(this)) {\n      notifyListeners(this, {\n        type: UPDATE,\n        object: this,\n        newValue: newValue,\n        oldValue: oldValue\n      });\n    }\n  };\n  _proto.get = function get() {\n    this.reportObserved();\n    return this.dehanceValue(this.value_);\n  };\n  _proto.intercept_ = function intercept_(handler) {\n    return registerInterceptor(this, handler);\n  };\n  _proto.observe_ = function observe_(listener, fireImmediately) {\n    if (fireImmediately) {\n      listener({\n        observableKind: \"value\",\n        debugObjectName: this.name_,\n        object: this,\n        type: UPDATE,\n        newValue: this.value_,\n        oldValue: undefined\n      });\n    }\n    return registerListener(this, listener);\n  };\n  _proto.raw = function raw() {\n    // used by MST ot get undehanced value\n    return this.value_;\n  };\n  _proto.toJSON = function toJSON() {\n    return this.get();\n  };\n  _proto.toString = function toString() {\n    return this.name_ + \"[\" + this.value_ + \"]\";\n  };\n  _proto.valueOf = function valueOf() {\n    return toPrimitive(this.get());\n  };\n  _proto[Symbol.toPrimitive] = function () {\n    return this.valueOf();\n  };\n  return ObservableValue;\n}(Atom);\nvar isObservableValue = /*#__PURE__*/createInstanceofPredicate(\"ObservableValue\", ObservableValue);\n\n/**\n * A node in the state dependency root that observes other nodes, and can be observed itself.\n *\n * ComputedValue will remember the result of the computation for the duration of the batch, or\n * while being observed.\n *\n * During this time it will recompute only when one of its direct dependencies changed,\n * but only when it is being accessed with `ComputedValue.get()`.\n *\n * Implementation description:\n * 1. First time it's being accessed it will compute and remember result\n *    give back remembered result until 2. happens\n * 2. First time any deep dependency change, propagate POSSIBLY_STALE to all observers, wait for 3.\n * 3. When it's being accessed, recompute if any shallow dependency changed.\n *    if result changed: propagate STALE to all observers, that were POSSIBLY_STALE from the last step.\n *    go to step 2. either way\n *\n * If at any point it's outside batch and it isn't observed: reset everything and go to 1.\n */\nvar ComputedValue = /*#__PURE__*/function () {\n  /**\n   * Create a new computed value based on a function expression.\n   *\n   * The `name` property is for debug purposes only.\n   *\n   * The `equals` property specifies the comparer function to use to determine if a newly produced\n   * value differs from the previous value. Two comparers are provided in the library; `defaultComparer`\n   * compares based on identity comparison (===), and `structuralComparer` deeply compares the structure.\n   * Structural comparison can be convenient if you always produce a new aggregated object and\n   * don't want to notify observers if it is structurally the same.\n   * This is useful for working with vectors, mouse coordinates etc.\n   */\n  function ComputedValue(options) {\n    this.dependenciesState_ = IDerivationState_.NOT_TRACKING_;\n    this.observing_ = [];\n    // nodes we are looking at. Our value depends on these nodes\n    this.newObserving_ = null;\n    // during tracking it's an array with new observed observers\n    this.observers_ = new Set();\n    this.runId_ = 0;\n    this.lastAccessedBy_ = 0;\n    this.lowestObserverState_ = IDerivationState_.UP_TO_DATE_;\n    this.unboundDepsCount_ = 0;\n    this.value_ = new CaughtException(null);\n    this.name_ = void 0;\n    this.triggeredBy_ = void 0;\n    this.flags_ = 0;\n    this.derivation = void 0;\n    // N.B: unminified as it is used by MST\n    this.setter_ = void 0;\n    this.isTracing_ = TraceMode.NONE;\n    this.scope_ = void 0;\n    this.equals_ = void 0;\n    this.requiresReaction_ = void 0;\n    this.keepAlive_ = void 0;\n    this.onBOL = void 0;\n    this.onBUOL = void 0;\n    if (!options.get) {\n      die(31);\n    }\n    this.derivation = options.get;\n    this.name_ = options.name || (process.env.NODE_ENV !== \"production\" ? \"ComputedValue@\" + getNextId() : \"ComputedValue\");\n    if (options.set) {\n      this.setter_ = createAction(process.env.NODE_ENV !== \"production\" ? this.name_ + \"-setter\" : \"ComputedValue-setter\", options.set);\n    }\n    this.equals_ = options.equals || (options.compareStructural || options.struct ? comparer.structural : comparer[\"default\"]);\n    this.scope_ = options.context;\n    this.requiresReaction_ = options.requiresReaction;\n    this.keepAlive_ = !!options.keepAlive;\n  }\n  var _proto = ComputedValue.prototype;\n  _proto.onBecomeStale_ = function onBecomeStale_() {\n    propagateMaybeChanged(this);\n  };\n  _proto.onBO = function onBO() {\n    if (this.onBOL) {\n      this.onBOL.forEach(function (listener) {\n        return listener();\n      });\n    }\n  };\n  _proto.onBUO = function onBUO() {\n    if (this.onBUOL) {\n      this.onBUOL.forEach(function (listener) {\n        return listener();\n      });\n    }\n  }\n  // to check for cycles\n  ;\n  /**\n   * Returns the current value of this computed value.\n   * Will evaluate its computation first if needed.\n   */\n  _proto.get = function get() {\n    if (this.isComputing) {\n      die(32, this.name_, this.derivation);\n    }\n    if (globalState.inBatch === 0 &&\n    // !globalState.trackingDerivatpion &&\n    this.observers_.size === 0 && !this.keepAlive_) {\n      if (shouldCompute(this)) {\n        this.warnAboutUntrackedRead_();\n        startBatch(); // See perf test 'computed memoization'\n        this.value_ = this.computeValue_(false);\n        endBatch();\n      }\n    } else {\n      reportObserved(this);\n      if (shouldCompute(this)) {\n        var prevTrackingContext = globalState.trackingContext;\n        if (this.keepAlive_ && !prevTrackingContext) {\n          globalState.trackingContext = this;\n        }\n        if (this.trackAndCompute()) {\n          propagateChangeConfirmed(this);\n        }\n        globalState.trackingContext = prevTrackingContext;\n      }\n    }\n    var result = this.value_;\n    if (isCaughtException(result)) {\n      throw result.cause;\n    }\n    return result;\n  };\n  _proto.set = function set(value) {\n    if (this.setter_) {\n      if (this.isRunningSetter) {\n        die(33, this.name_);\n      }\n      this.isRunningSetter = true;\n      try {\n        this.setter_.call(this.scope_, value);\n      } finally {\n        this.isRunningSetter = false;\n      }\n    } else {\n      die(34, this.name_);\n    }\n  };\n  _proto.trackAndCompute = function trackAndCompute() {\n    // N.B: unminified as it is used by MST\n    var oldValue = this.value_;\n    var wasSuspended = /* see #1208 */this.dependenciesState_ === IDerivationState_.NOT_TRACKING_;\n    var newValue = this.computeValue_(true);\n    var changed = wasSuspended || isCaughtException(oldValue) || isCaughtException(newValue) || !this.equals_(oldValue, newValue);\n    if (changed) {\n      this.value_ = newValue;\n      if (process.env.NODE_ENV !== \"production\" && isSpyEnabled()) {\n        spyReport({\n          observableKind: \"computed\",\n          debugObjectName: this.name_,\n          object: this.scope_,\n          type: \"update\",\n          oldValue: oldValue,\n          newValue: newValue\n        });\n      }\n    }\n    return changed;\n  };\n  _proto.computeValue_ = function computeValue_(track) {\n    this.isComputing = true;\n    // don't allow state changes during computation\n    var prev = allowStateChangesStart(false);\n    var res;\n    if (track) {\n      res = trackDerivedFunction(this, this.derivation, this.scope_);\n    } else {\n      if (globalState.disableErrorBoundaries === true) {\n        res = this.derivation.call(this.scope_);\n      } else {\n        try {\n          res = this.derivation.call(this.scope_);\n        } catch (e) {\n          res = new CaughtException(e);\n        }\n      }\n    }\n    allowStateChangesEnd(prev);\n    this.isComputing = false;\n    return res;\n  };\n  _proto.suspend_ = function suspend_() {\n    if (!this.keepAlive_) {\n      clearObserving(this);\n      this.value_ = undefined; // don't hold on to computed value!\n      if (process.env.NODE_ENV !== \"production\" && this.isTracing_ !== TraceMode.NONE) {\n        console.log(\"[mobx.trace] Computed value '\" + this.name_ + \"' was suspended and it will recompute on the next access.\");\n      }\n    }\n  };\n  _proto.observe_ = function observe_(listener, fireImmediately) {\n    var _this = this;\n    var firstTime = true;\n    var prevValue = undefined;\n    return autorun(function () {\n      // TODO: why is this in a different place than the spyReport() function? in all other observables it's called in the same place\n      var newValue = _this.get();\n      if (!firstTime || fireImmediately) {\n        var prevU = untrackedStart();\n        listener({\n          observableKind: \"computed\",\n          debugObjectName: _this.name_,\n          type: UPDATE,\n          object: _this,\n          newValue: newValue,\n          oldValue: prevValue\n        });\n        untrackedEnd(prevU);\n      }\n      firstTime = false;\n      prevValue = newValue;\n    });\n  };\n  _proto.warnAboutUntrackedRead_ = function warnAboutUntrackedRead_() {\n    if (!(process.env.NODE_ENV !== \"production\")) {\n      return;\n    }\n    if (this.isTracing_ !== TraceMode.NONE) {\n      console.log(\"[mobx.trace] Computed value '\" + this.name_ + \"' is being read outside a reactive context. Doing a full recompute.\");\n    }\n    if (typeof this.requiresReaction_ === \"boolean\" ? this.requiresReaction_ : globalState.computedRequiresReaction) {\n      console.warn(\"[mobx] Computed value '\" + this.name_ + \"' is being read outside a reactive context. Doing a full recompute.\");\n    }\n  };\n  _proto.toString = function toString() {\n    return this.name_ + \"[\" + this.derivation.toString() + \"]\";\n  };\n  _proto.valueOf = function valueOf() {\n    return toPrimitive(this.get());\n  };\n  _proto[Symbol.toPrimitive] = function () {\n    return this.valueOf();\n  };\n  return _createClass(ComputedValue, [{\n    key: \"isComputing\",\n    get: function get() {\n      return getFlag(this.flags_, ComputedValue.isComputingMask_);\n    },\n    set: function set(newValue) {\n      this.flags_ = setFlag(this.flags_, ComputedValue.isComputingMask_, newValue);\n    }\n  }, {\n    key: \"isRunningSetter\",\n    get: function get() {\n      return getFlag(this.flags_, ComputedValue.isRunningSetterMask_);\n    },\n    set: function set(newValue) {\n      this.flags_ = setFlag(this.flags_, ComputedValue.isRunningSetterMask_, newValue);\n    }\n  }, {\n    key: \"isBeingObserved\",\n    get: function get() {\n      return getFlag(this.flags_, ComputedValue.isBeingObservedMask_);\n    },\n    set: function set(newValue) {\n      this.flags_ = setFlag(this.flags_, ComputedValue.isBeingObservedMask_, newValue);\n    }\n  }, {\n    key: \"isPendingUnobservation\",\n    get: function get() {\n      return getFlag(this.flags_, ComputedValue.isPendingUnobservationMask_);\n    },\n    set: function set(newValue) {\n      this.flags_ = setFlag(this.flags_, ComputedValue.isPendingUnobservationMask_, newValue);\n    }\n  }, {\n    key: \"diffValue\",\n    get: function get() {\n      return getFlag(this.flags_, ComputedValue.diffValueMask_) ? 1 : 0;\n    },\n    set: function set(newValue) {\n      this.flags_ = setFlag(this.flags_, ComputedValue.diffValueMask_, newValue === 1 ? true : false);\n    }\n  }]);\n}();\nComputedValue.isComputingMask_ = 1;\nComputedValue.isRunningSetterMask_ = 2;\nComputedValue.isBeingObservedMask_ = 4;\nComputedValue.isPendingUnobservationMask_ = 8;\nComputedValue.diffValueMask_ = 16;\nvar isComputedValue = /*#__PURE__*/createInstanceofPredicate(\"ComputedValue\", ComputedValue);\n\nvar IDerivationState_;\n(function (IDerivationState_) {\n  // before being run or (outside batch and not being observed)\n  // at this point derivation is not holding any data about dependency tree\n  IDerivationState_[IDerivationState_[\"NOT_TRACKING_\"] = -1] = \"NOT_TRACKING_\";\n  // no shallow dependency changed since last computation\n  // won't recalculate derivation\n  // this is what makes mobx fast\n  IDerivationState_[IDerivationState_[\"UP_TO_DATE_\"] = 0] = \"UP_TO_DATE_\";\n  // some deep dependency changed, but don't know if shallow dependency changed\n  // will require to check first if UP_TO_DATE or POSSIBLY_STALE\n  // currently only ComputedValue will propagate POSSIBLY_STALE\n  //\n  // having this state is second big optimization:\n  // don't have to recompute on every dependency change, but only when it's needed\n  IDerivationState_[IDerivationState_[\"POSSIBLY_STALE_\"] = 1] = \"POSSIBLY_STALE_\";\n  // A shallow dependency has changed since last computation and the derivation\n  // will need to recompute when it's needed next.\n  IDerivationState_[IDerivationState_[\"STALE_\"] = 2] = \"STALE_\";\n})(IDerivationState_ || (IDerivationState_ = {}));\nvar TraceMode;\n(function (TraceMode) {\n  TraceMode[TraceMode[\"NONE\"] = 0] = \"NONE\";\n  TraceMode[TraceMode[\"LOG\"] = 1] = \"LOG\";\n  TraceMode[TraceMode[\"BREAK\"] = 2] = \"BREAK\";\n})(TraceMode || (TraceMode = {}));\nvar CaughtException = function CaughtException(cause) {\n  this.cause = void 0;\n  this.cause = cause;\n  // Empty\n};\nfunction isCaughtException(e) {\n  return e instanceof CaughtException;\n}\n/**\n * Finds out whether any dependency of the derivation has actually changed.\n * If dependenciesState is 1 then it will recalculate dependencies,\n * if any dependency changed it will propagate it by changing dependenciesState to 2.\n *\n * By iterating over the dependencies in the same order that they were reported and\n * stopping on the first change, all the recalculations are only called for ComputedValues\n * that will be tracked by derivation. That is because we assume that if the first x\n * dependencies of the derivation doesn't change then the derivation should run the same way\n * up until accessing x-th dependency.\n */\nfunction shouldCompute(derivation) {\n  switch (derivation.dependenciesState_) {\n    case IDerivationState_.UP_TO_DATE_:\n      return false;\n    case IDerivationState_.NOT_TRACKING_:\n    case IDerivationState_.STALE_:\n      return true;\n    case IDerivationState_.POSSIBLY_STALE_:\n      {\n        // state propagation can occur outside of action/reactive context #2195\n        var prevAllowStateReads = allowStateReadsStart(true);\n        var prevUntracked = untrackedStart(); // no need for those computeds to be reported, they will be picked up in trackDerivedFunction.\n        var obs = derivation.observing_,\n          l = obs.length;\n        for (var i = 0; i < l; i++) {\n          var obj = obs[i];\n          if (isComputedValue(obj)) {\n            if (globalState.disableErrorBoundaries) {\n              obj.get();\n            } else {\n              try {\n                obj.get();\n              } catch (e) {\n                // we are not interested in the value *or* exception at this moment, but if there is one, notify all\n                untrackedEnd(prevUntracked);\n                allowStateReadsEnd(prevAllowStateReads);\n                return true;\n              }\n            }\n            // if ComputedValue `obj` actually changed it will be computed and propagated to its observers.\n            // and `derivation` is an observer of `obj`\n            // invariantShouldCompute(derivation)\n            if (derivation.dependenciesState_ === IDerivationState_.STALE_) {\n              untrackedEnd(prevUntracked);\n              allowStateReadsEnd(prevAllowStateReads);\n              return true;\n            }\n          }\n        }\n        changeDependenciesStateTo0(derivation);\n        untrackedEnd(prevUntracked);\n        allowStateReadsEnd(prevAllowStateReads);\n        return false;\n      }\n  }\n}\nfunction isComputingDerivation() {\n  return globalState.trackingDerivation !== null; // filter out actions inside computations\n}\nfunction checkIfStateModificationsAreAllowed(atom) {\n  if (!(process.env.NODE_ENV !== \"production\")) {\n    return;\n  }\n  var hasObservers = atom.observers_.size > 0;\n  // Should not be possible to change observed state outside strict mode, except during initialization, see #563\n  if (!globalState.allowStateChanges && (hasObservers || globalState.enforceActions === \"always\")) {\n    console.warn(\"[MobX] \" + (globalState.enforceActions ? \"Since strict-mode is enabled, changing (observed) observable values without using an action is not allowed. Tried to modify: \" : \"Side effects like changing state are not allowed at this point. Are you trying to modify state from, for example, a computed value or the render function of a React component? You can wrap side effects in 'runInAction' (or decorate functions with 'action') if needed. Tried to modify: \") + atom.name_);\n  }\n}\nfunction checkIfStateReadsAreAllowed(observable) {\n  if (process.env.NODE_ENV !== \"production\" && !globalState.allowStateReads && globalState.observableRequiresReaction) {\n    console.warn(\"[mobx] Observable '\" + observable.name_ + \"' being read outside a reactive context.\");\n  }\n}\n/**\n * Executes the provided function `f` and tracks which observables are being accessed.\n * The tracking information is stored on the `derivation` object and the derivation is registered\n * as observer of any of the accessed observables.\n */\nfunction trackDerivedFunction(derivation, f, context) {\n  var prevAllowStateReads = allowStateReadsStart(true);\n  changeDependenciesStateTo0(derivation);\n  // Preallocate array; will be trimmed by bindDependencies.\n  derivation.newObserving_ = new Array(\n  // Reserve constant space for initial dependencies, dynamic space otherwise.\n  // See https://github.com/mobxjs/mobx/pull/3833\n  derivation.runId_ === 0 ? 100 : derivation.observing_.length);\n  derivation.unboundDepsCount_ = 0;\n  derivation.runId_ = ++globalState.runId;\n  var prevTracking = globalState.trackingDerivation;\n  globalState.trackingDerivation = derivation;\n  globalState.inBatch++;\n  var result;\n  if (globalState.disableErrorBoundaries === true) {\n    result = f.call(context);\n  } else {\n    try {\n      result = f.call(context);\n    } catch (e) {\n      result = new CaughtException(e);\n    }\n  }\n  globalState.inBatch--;\n  globalState.trackingDerivation = prevTracking;\n  bindDependencies(derivation);\n  warnAboutDerivationWithoutDependencies(derivation);\n  allowStateReadsEnd(prevAllowStateReads);\n  return result;\n}\nfunction warnAboutDerivationWithoutDependencies(derivation) {\n  if (!(process.env.NODE_ENV !== \"production\")) {\n    return;\n  }\n  if (derivation.observing_.length !== 0) {\n    return;\n  }\n  if (typeof derivation.requiresObservable_ === \"boolean\" ? derivation.requiresObservable_ : globalState.reactionRequiresObservable) {\n    console.warn(\"[mobx] Derivation '\" + derivation.name_ + \"' is created/updated without reading any observable value.\");\n  }\n}\n/**\n * diffs newObserving with observing.\n * update observing to be newObserving with unique observables\n * notify observers that become observed/unobserved\n */\nfunction bindDependencies(derivation) {\n  // invariant(derivation.dependenciesState !== IDerivationState.NOT_TRACKING, \"INTERNAL ERROR bindDependencies expects derivation.dependenciesState !== -1\");\n  var prevObserving = derivation.observing_;\n  var observing = derivation.observing_ = derivation.newObserving_;\n  var lowestNewObservingDerivationState = IDerivationState_.UP_TO_DATE_;\n  // Go through all new observables and check diffValue: (this list can contain duplicates):\n  //   0: first occurrence, change to 1 and keep it\n  //   1: extra occurrence, drop it\n  var i0 = 0,\n    l = derivation.unboundDepsCount_;\n  for (var i = 0; i < l; i++) {\n    var dep = observing[i];\n    if (dep.diffValue === 0) {\n      dep.diffValue = 1;\n      if (i0 !== i) {\n        observing[i0] = dep;\n      }\n      i0++;\n    }\n    // Upcast is 'safe' here, because if dep is IObservable, `dependenciesState` will be undefined,\n    // not hitting the condition\n    if (dep.dependenciesState_ > lowestNewObservingDerivationState) {\n      lowestNewObservingDerivationState = dep.dependenciesState_;\n    }\n  }\n  observing.length = i0;\n  derivation.newObserving_ = null; // newObserving shouldn't be needed outside tracking (statement moved down to work around FF bug, see #614)\n  // Go through all old observables and check diffValue: (it is unique after last bindDependencies)\n  //   0: it's not in new observables, unobserve it\n  //   1: it keeps being observed, don't want to notify it. change to 0\n  l = prevObserving.length;\n  while (l--) {\n    var _dep = prevObserving[l];\n    if (_dep.diffValue === 0) {\n      removeObserver(_dep, derivation);\n    }\n    _dep.diffValue = 0;\n  }\n  // Go through all new observables and check diffValue: (now it should be unique)\n  //   0: it was set to 0 in last loop. don't need to do anything.\n  //   1: it wasn't observed, let's observe it. set back to 0\n  while (i0--) {\n    var _dep2 = observing[i0];\n    if (_dep2.diffValue === 1) {\n      _dep2.diffValue = 0;\n      addObserver(_dep2, derivation);\n    }\n  }\n  // Some new observed derivations may become stale during this derivation computation\n  // so they have had no chance to propagate staleness (#916)\n  if (lowestNewObservingDerivationState !== IDerivationState_.UP_TO_DATE_) {\n    derivation.dependenciesState_ = lowestNewObservingDerivationState;\n    derivation.onBecomeStale_();\n  }\n}\nfunction clearObserving(derivation) {\n  // invariant(globalState.inBatch > 0, \"INTERNAL ERROR clearObserving should be called only inside batch\");\n  var obs = derivation.observing_;\n  derivation.observing_ = [];\n  var i = obs.length;\n  while (i--) {\n    removeObserver(obs[i], derivation);\n  }\n  derivation.dependenciesState_ = IDerivationState_.NOT_TRACKING_;\n}\nfunction untracked(action) {\n  var prev = untrackedStart();\n  try {\n    return action();\n  } finally {\n    untrackedEnd(prev);\n  }\n}\nfunction untrackedStart() {\n  var prev = globalState.trackingDerivation;\n  globalState.trackingDerivation = null;\n  return prev;\n}\nfunction untrackedEnd(prev) {\n  globalState.trackingDerivation = prev;\n}\nfunction allowStateReadsStart(allowStateReads) {\n  var prev = globalState.allowStateReads;\n  globalState.allowStateReads = allowStateReads;\n  return prev;\n}\nfunction allowStateReadsEnd(prev) {\n  globalState.allowStateReads = prev;\n}\n/**\n * needed to keep `lowestObserverState` correct. when changing from (2 or 1) to 0\n *\n */\nfunction changeDependenciesStateTo0(derivation) {\n  if (derivation.dependenciesState_ === IDerivationState_.UP_TO_DATE_) {\n    return;\n  }\n  derivation.dependenciesState_ = IDerivationState_.UP_TO_DATE_;\n  var obs = derivation.observing_;\n  var i = obs.length;\n  while (i--) {\n    obs[i].lowestObserverState_ = IDerivationState_.UP_TO_DATE_;\n  }\n}\n\n/**\n * These values will persist if global state is reset\n */\nvar persistentKeys = [\"mobxGuid\", \"spyListeners\", \"enforceActions\", \"computedRequiresReaction\", \"reactionRequiresObservable\", \"observableRequiresReaction\", \"allowStateReads\", \"disableErrorBoundaries\", \"runId\", \"UNCHANGED\", \"useProxies\"];\nvar MobXGlobals = function MobXGlobals() {\n  /**\n   * MobXGlobals version.\n   * MobX compatiblity with other versions loaded in memory as long as this version matches.\n   * It indicates that the global state still stores similar information\n   *\n   * N.B: this version is unrelated to the package version of MobX, and is only the version of the\n   * internal state storage of MobX, and can be the same across many different package versions\n   */\n  this.version = 6;\n  /**\n   * globally unique token to signal unchanged\n   */\n  this.UNCHANGED = {};\n  /**\n   * Currently running derivation\n   */\n  this.trackingDerivation = null;\n  /**\n   * Currently running reaction. This determines if we currently have a reactive context.\n   * (Tracking derivation is also set for temporal tracking of computed values inside actions,\n   * but trackingReaction can only be set by a form of Reaction)\n   */\n  this.trackingContext = null;\n  /**\n   * Each time a derivation is tracked, it is assigned a unique run-id\n   */\n  this.runId = 0;\n  /**\n   * 'guid' for general purpose. Will be persisted amongst resets.\n   */\n  this.mobxGuid = 0;\n  /**\n   * Are we in a batch block? (and how many of them)\n   */\n  this.inBatch = 0;\n  /**\n   * Observables that don't have observers anymore, and are about to be\n   * suspended, unless somebody else accesses it in the same batch\n   *\n   * @type {IObservable[]}\n   */\n  this.pendingUnobservations = [];\n  /**\n   * List of scheduled, not yet executed, reactions.\n   */\n  this.pendingReactions = [];\n  /**\n   * Are we currently processing reactions?\n   */\n  this.isRunningReactions = false;\n  /**\n   * Is it allowed to change observables at this point?\n   * In general, MobX doesn't allow that when running computations and React.render.\n   * To ensure that those functions stay pure.\n   */\n  this.allowStateChanges = false;\n  /**\n   * Is it allowed to read observables at this point?\n   * Used to hold the state needed for `observableRequiresReaction`\n   */\n  this.allowStateReads = true;\n  /**\n   * If strict mode is enabled, state changes are by default not allowed\n   */\n  this.enforceActions = true;\n  /**\n   * Spy callbacks\n   */\n  this.spyListeners = [];\n  /**\n   * Globally attached error handlers that react specifically to errors in reactions\n   */\n  this.globalReactionErrorHandlers = [];\n  /**\n   * Warn if computed values are accessed outside a reactive context\n   */\n  this.computedRequiresReaction = false;\n  /**\n   * (Experimental)\n   * Warn if you try to create to derivation / reactive context without accessing any observable.\n   */\n  this.reactionRequiresObservable = false;\n  /**\n   * (Experimental)\n   * Warn if observables are accessed outside a reactive context\n   */\n  this.observableRequiresReaction = false;\n  /*\n   * Don't catch and rethrow exceptions. This is useful for inspecting the state of\n   * the stack when an exception occurs while debugging.\n   */\n  this.disableErrorBoundaries = false;\n  /*\n   * If true, we are already handling an exception in an action. Any errors in reactions should be suppressed, as\n   * they are not the cause, see: https://github.com/mobxjs/mobx/issues/1836\n   */\n  this.suppressReactionErrors = false;\n  this.useProxies = true;\n  /*\n   * print warnings about code that would fail if proxies weren't available\n   */\n  this.verifyProxies = false;\n  /**\n   * False forces all object's descriptors to\n   * writable: true\n   * configurable: true\n   */\n  this.safeDescriptors = true;\n};\nvar canMergeGlobalState = true;\nvar isolateCalled = false;\nvar globalState = /*#__PURE__*/function () {\n  var global = /*#__PURE__*/getGlobal();\n  if (global.__mobxInstanceCount > 0 && !global.__mobxGlobals) {\n    canMergeGlobalState = false;\n  }\n  if (global.__mobxGlobals && global.__mobxGlobals.version !== new MobXGlobals().version) {\n    canMergeGlobalState = false;\n  }\n  if (!canMergeGlobalState) {\n    // Because this is a IIFE we need to let isolateCalled a chance to change\n    // so we run it after the event loop completed at least 1 iteration\n    setTimeout(function () {\n      if (!isolateCalled) {\n        die(35);\n      }\n    }, 1);\n    return new MobXGlobals();\n  } else if (global.__mobxGlobals) {\n    global.__mobxInstanceCount += 1;\n    if (!global.__mobxGlobals.UNCHANGED) {\n      global.__mobxGlobals.UNCHANGED = {};\n    } // make merge backward compatible\n    return global.__mobxGlobals;\n  } else {\n    global.__mobxInstanceCount = 1;\n    return global.__mobxGlobals = /*#__PURE__*/new MobXGlobals();\n  }\n}();\nfunction isolateGlobalState() {\n  if (globalState.pendingReactions.length || globalState.inBatch || globalState.isRunningReactions) {\n    die(36);\n  }\n  isolateCalled = true;\n  if (canMergeGlobalState) {\n    var global = getGlobal();\n    if (--global.__mobxInstanceCount === 0) {\n      global.__mobxGlobals = undefined;\n    }\n    globalState = new MobXGlobals();\n  }\n}\nfunction getGlobalState() {\n  return globalState;\n}\n/**\n * For testing purposes only; this will break the internal state of existing observables,\n * but can be used to get back at a stable state after throwing errors\n */\nfunction resetGlobalState() {\n  var defaultGlobals = new MobXGlobals();\n  for (var key in defaultGlobals) {\n    if (persistentKeys.indexOf(key) === -1) {\n      globalState[key] = defaultGlobals[key];\n    }\n  }\n  globalState.allowStateChanges = !globalState.enforceActions;\n}\n\nfunction hasObservers(observable) {\n  return observable.observers_ && observable.observers_.size > 0;\n}\nfunction getObservers(observable) {\n  return observable.observers_;\n}\n// function invariantObservers(observable: IObservable) {\n//     const list = observable.observers\n//     const map = observable.observersIndexes\n//     const l = list.length\n//     for (let i = 0; i < l; i++) {\n//         const id = list[i].__mapid\n//         if (i) {\n//             invariant(map[id] === i, \"INTERNAL ERROR maps derivation.__mapid to index in list\") // for performance\n//         } else {\n//             invariant(!(id in map), \"INTERNAL ERROR observer on index 0 shouldn't be held in map.\") // for performance\n//         }\n//     }\n//     invariant(\n//         list.length === 0 || Object.keys(map).length === list.length - 1,\n//         \"INTERNAL ERROR there is no junk in map\"\n//     )\n// }\nfunction addObserver(observable, node) {\n  // invariant(node.dependenciesState !== -1, \"INTERNAL ERROR, can add only dependenciesState !== -1\");\n  // invariant(observable._observers.indexOf(node) === -1, \"INTERNAL ERROR add already added node\");\n  // invariantObservers(observable);\n  observable.observers_.add(node);\n  if (observable.lowestObserverState_ > node.dependenciesState_) {\n    observable.lowestObserverState_ = node.dependenciesState_;\n  }\n  // invariantObservers(observable);\n  // invariant(observable._observers.indexOf(node) !== -1, \"INTERNAL ERROR didn't add node\");\n}\nfunction removeObserver(observable, node) {\n  // invariant(globalState.inBatch > 0, \"INTERNAL ERROR, remove should be called only inside batch\");\n  // invariant(observable._observers.indexOf(node) !== -1, \"INTERNAL ERROR remove already removed node\");\n  // invariantObservers(observable);\n  observable.observers_[\"delete\"](node);\n  if (observable.observers_.size === 0) {\n    // deleting last observer\n    queueForUnobservation(observable);\n  }\n  // invariantObservers(observable);\n  // invariant(observable._observers.indexOf(node) === -1, \"INTERNAL ERROR remove already removed node2\");\n}\nfunction queueForUnobservation(observable) {\n  if (observable.isPendingUnobservation === false) {\n    // invariant(observable._observers.length === 0, \"INTERNAL ERROR, should only queue for unobservation unobserved observables\");\n    observable.isPendingUnobservation = true;\n    globalState.pendingUnobservations.push(observable);\n  }\n}\n/**\n * Batch starts a transaction, at least for purposes of memoizing ComputedValues when nothing else does.\n * During a batch `onBecomeUnobserved` will be called at most once per observable.\n * Avoids unnecessary recalculations.\n */\nfunction startBatch() {\n  globalState.inBatch++;\n}\nfunction endBatch() {\n  if (--globalState.inBatch === 0) {\n    runReactions();\n    // the batch is actually about to finish, all unobserving should happen here.\n    var list = globalState.pendingUnobservations;\n    for (var i = 0; i < list.length; i++) {\n      var observable = list[i];\n      observable.isPendingUnobservation = false;\n      if (observable.observers_.size === 0) {\n        if (observable.isBeingObserved) {\n          // if this observable had reactive observers, trigger the hooks\n          observable.isBeingObserved = false;\n          observable.onBUO();\n        }\n        if (observable instanceof ComputedValue) {\n          // computed values are automatically teared down when the last observer leaves\n          // this process happens recursively, this computed might be the last observabe of another, etc..\n          observable.suspend_();\n        }\n      }\n    }\n    globalState.pendingUnobservations = [];\n  }\n}\nfunction reportObserved(observable) {\n  checkIfStateReadsAreAllowed(observable);\n  var derivation = globalState.trackingDerivation;\n  if (derivation !== null) {\n    /**\n     * Simple optimization, give each derivation run an unique id (runId)\n     * Check if last time this observable was accessed the same runId is used\n     * if this is the case, the relation is already known\n     */\n    if (derivation.runId_ !== observable.lastAccessedBy_) {\n      observable.lastAccessedBy_ = derivation.runId_;\n      // Tried storing newObserving, or observing, or both as Set, but performance didn't come close...\n      derivation.newObserving_[derivation.unboundDepsCount_++] = observable;\n      if (!observable.isBeingObserved && globalState.trackingContext) {\n        observable.isBeingObserved = true;\n        observable.onBO();\n      }\n    }\n    return observable.isBeingObserved;\n  } else if (observable.observers_.size === 0 && globalState.inBatch > 0) {\n    queueForUnobservation(observable);\n  }\n  return false;\n}\n// function invariantLOS(observable: IObservable, msg: string) {\n//     // it's expensive so better not run it in produciton. but temporarily helpful for testing\n//     const min = getObservers(observable).reduce((a, b) => Math.min(a, b.dependenciesState), 2)\n//     if (min >= observable.lowestObserverState) return // <- the only assumption about `lowestObserverState`\n//     throw new Error(\n//         \"lowestObserverState is wrong for \" +\n//             msg +\n//             \" because \" +\n//             min +\n//             \" < \" +\n//             observable.lowestObserverState\n//     )\n// }\n/**\n * NOTE: current propagation mechanism will in case of self reruning autoruns behave unexpectedly\n * It will propagate changes to observers from previous run\n * It's hard or maybe impossible (with reasonable perf) to get it right with current approach\n * Hopefully self reruning autoruns aren't a feature people should depend on\n * Also most basic use cases should be ok\n */\n// Called by Atom when its value changes\nfunction propagateChanged(observable) {\n  // invariantLOS(observable, \"changed start\");\n  if (observable.lowestObserverState_ === IDerivationState_.STALE_) {\n    return;\n  }\n  observable.lowestObserverState_ = IDerivationState_.STALE_;\n  // Ideally we use for..of here, but the downcompiled version is really slow...\n  observable.observers_.forEach(function (d) {\n    if (d.dependenciesState_ === IDerivationState_.UP_TO_DATE_) {\n      if (process.env.NODE_ENV !== \"production\" && d.isTracing_ !== TraceMode.NONE) {\n        logTraceInfo(d, observable);\n      }\n      d.onBecomeStale_();\n    }\n    d.dependenciesState_ = IDerivationState_.STALE_;\n  });\n  // invariantLOS(observable, \"changed end\");\n}\n// Called by ComputedValue when it recalculate and its value changed\nfunction propagateChangeConfirmed(observable) {\n  // invariantLOS(observable, \"confirmed start\");\n  if (observable.lowestObserverState_ === IDerivationState_.STALE_) {\n    return;\n  }\n  observable.lowestObserverState_ = IDerivationState_.STALE_;\n  observable.observers_.forEach(function (d) {\n    if (d.dependenciesState_ === IDerivationState_.POSSIBLY_STALE_) {\n      d.dependenciesState_ = IDerivationState_.STALE_;\n      if (process.env.NODE_ENV !== \"production\" && d.isTracing_ !== TraceMode.NONE) {\n        logTraceInfo(d, observable);\n      }\n    } else if (d.dependenciesState_ === IDerivationState_.UP_TO_DATE_ // this happens during computing of `d`, just keep lowestObserverState up to date.\n    ) {\n      observable.lowestObserverState_ = IDerivationState_.UP_TO_DATE_;\n    }\n  });\n  // invariantLOS(observable, \"confirmed end\");\n}\n// Used by computed when its dependency changed, but we don't wan't to immediately recompute.\nfunction propagateMaybeChanged(observable) {\n  // invariantLOS(observable, \"maybe start\");\n  if (observable.lowestObserverState_ !== IDerivationState_.UP_TO_DATE_) {\n    return;\n  }\n  observable.lowestObserverState_ = IDerivationState_.POSSIBLY_STALE_;\n  observable.observers_.forEach(function (d) {\n    if (d.dependenciesState_ === IDerivationState_.UP_TO_DATE_) {\n      d.dependenciesState_ = IDerivationState_.POSSIBLY_STALE_;\n      d.onBecomeStale_();\n    }\n  });\n  // invariantLOS(observable, \"maybe end\");\n}\nfunction logTraceInfo(derivation, observable) {\n  console.log(\"[mobx.trace] '\" + derivation.name_ + \"' is invalidated due to a change in: '\" + observable.name_ + \"'\");\n  if (derivation.isTracing_ === TraceMode.BREAK) {\n    var lines = [];\n    printDepTree(getDependencyTree(derivation), lines, 1);\n    // prettier-ignore\n    new Function(\"debugger;\\n/*\\nTracing '\" + derivation.name_ + \"'\\n\\nYou are entering this break point because derivation '\" + derivation.name_ + \"' is being traced and '\" + observable.name_ + \"' is now forcing it to update.\\nJust follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update\\nThe stackframe you are looking for is at least ~6-8 stack-frames up.\\n\\n\" + (derivation instanceof ComputedValue ? derivation.derivation.toString().replace(/[*]\\//g, \"/\") : \"\") + \"\\n\\nThe dependencies for this derivation are:\\n\\n\" + lines.join(\"\\n\") + \"\\n*/\\n    \")();\n  }\n}\nfunction printDepTree(tree, lines, depth) {\n  if (lines.length >= 1000) {\n    lines.push(\"(and many more)\");\n    return;\n  }\n  lines.push(\"\" + \"\\t\".repeat(depth - 1) + tree.name);\n  if (tree.dependencies) {\n    tree.dependencies.forEach(function (child) {\n      return printDepTree(child, lines, depth + 1);\n    });\n  }\n}\n\nvar Reaction = /*#__PURE__*/function () {\n  function Reaction(name_, onInvalidate_, errorHandler_, requiresObservable_) {\n    if (name_ === void 0) {\n      name_ = process.env.NODE_ENV !== \"production\" ? \"Reaction@\" + getNextId() : \"Reaction\";\n    }\n    this.name_ = void 0;\n    this.onInvalidate_ = void 0;\n    this.errorHandler_ = void 0;\n    this.requiresObservable_ = void 0;\n    this.observing_ = [];\n    // nodes we are looking at. Our value depends on these nodes\n    this.newObserving_ = [];\n    this.dependenciesState_ = IDerivationState_.NOT_TRACKING_;\n    this.runId_ = 0;\n    this.unboundDepsCount_ = 0;\n    this.flags_ = 0;\n    this.isTracing_ = TraceMode.NONE;\n    this.name_ = name_;\n    this.onInvalidate_ = onInvalidate_;\n    this.errorHandler_ = errorHandler_;\n    this.requiresObservable_ = requiresObservable_;\n  }\n  var _proto = Reaction.prototype;\n  _proto.onBecomeStale_ = function onBecomeStale_() {\n    this.schedule_();\n  };\n  _proto.schedule_ = function schedule_() {\n    if (!this.isScheduled) {\n      this.isScheduled = true;\n      globalState.pendingReactions.push(this);\n      runReactions();\n    }\n  }\n  /**\n   * internal, use schedule() if you intend to kick off a reaction\n   */;\n  _proto.runReaction_ = function runReaction_() {\n    if (!this.isDisposed) {\n      startBatch();\n      this.isScheduled = false;\n      var prev = globalState.trackingContext;\n      globalState.trackingContext = this;\n      if (shouldCompute(this)) {\n        this.isTrackPending = true;\n        try {\n          this.onInvalidate_();\n          if (process.env.NODE_ENV !== \"production\" && this.isTrackPending && isSpyEnabled()) {\n            // onInvalidate didn't trigger track right away..\n            spyReport({\n              name: this.name_,\n              type: \"scheduled-reaction\"\n            });\n          }\n        } catch (e) {\n          this.reportExceptionInDerivation_(e);\n        }\n      }\n      globalState.trackingContext = prev;\n      endBatch();\n    }\n  };\n  _proto.track = function track(fn) {\n    if (this.isDisposed) {\n      return;\n      // console.warn(\"Reaction already disposed\") // Note: Not a warning / error in mobx 4 either\n    }\n    startBatch();\n    var notify = isSpyEnabled();\n    var startTime;\n    if (process.env.NODE_ENV !== \"production\" && notify) {\n      startTime = Date.now();\n      spyReportStart({\n        name: this.name_,\n        type: \"reaction\"\n      });\n    }\n    this.isRunning = true;\n    var prevReaction = globalState.trackingContext; // reactions could create reactions...\n    globalState.trackingContext = this;\n    var result = trackDerivedFunction(this, fn, undefined);\n    globalState.trackingContext = prevReaction;\n    this.isRunning = false;\n    this.isTrackPending = false;\n    if (this.isDisposed) {\n      // disposed during last run. Clean up everything that was bound after the dispose call.\n      clearObserving(this);\n    }\n    if (isCaughtException(result)) {\n      this.reportExceptionInDerivation_(result.cause);\n    }\n    if (process.env.NODE_ENV !== \"production\" && notify) {\n      spyReportEnd({\n        time: Date.now() - startTime\n      });\n    }\n    endBatch();\n  };\n  _proto.reportExceptionInDerivation_ = function reportExceptionInDerivation_(error) {\n    var _this = this;\n    if (this.errorHandler_) {\n      this.errorHandler_(error, this);\n      return;\n    }\n    if (globalState.disableErrorBoundaries) {\n      throw error;\n    }\n    var message = process.env.NODE_ENV !== \"production\" ? \"[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '\" + this + \"'\" : \"[mobx] uncaught error in '\" + this + \"'\";\n    if (!globalState.suppressReactionErrors) {\n      console.error(message, error);\n      /** If debugging brought you here, please, read the above message :-). Tnx! */\n    } else if (process.env.NODE_ENV !== \"production\") {\n      console.warn(\"[mobx] (error in reaction '\" + this.name_ + \"' suppressed, fix error of causing action below)\");\n    } // prettier-ignore\n    if (process.env.NODE_ENV !== \"production\" && isSpyEnabled()) {\n      spyReport({\n        type: \"error\",\n        name: this.name_,\n        message: message,\n        error: \"\" + error\n      });\n    }\n    globalState.globalReactionErrorHandlers.forEach(function (f) {\n      return f(error, _this);\n    });\n  };\n  _proto.dispose = function dispose() {\n    if (!this.isDisposed) {\n      this.isDisposed = true;\n      if (!this.isRunning) {\n        // if disposed while running, clean up later. Maybe not optimal, but rare case\n        startBatch();\n        clearObserving(this);\n        endBatch();\n      }\n    }\n  };\n  _proto.getDisposer_ = function getDisposer_(abortSignal) {\n    var _this2 = this;\n    var dispose = function dispose() {\n      _this2.dispose();\n      abortSignal == null || abortSignal.removeEventListener == null || abortSignal.removeEventListener(\"abort\", dispose);\n    };\n    abortSignal == null || abortSignal.addEventListener == null || abortSignal.addEventListener(\"abort\", dispose);\n    dispose[$mobx] = this;\n    return dispose;\n  };\n  _proto.toString = function toString() {\n    return \"Reaction[\" + this.name_ + \"]\";\n  };\n  _proto.trace = function trace$1(enterBreakPoint) {\n    if (enterBreakPoint === void 0) {\n      enterBreakPoint = false;\n    }\n    trace(this, enterBreakPoint);\n  };\n  return _createClass(Reaction, [{\n    key: \"isDisposed\",\n    get: function get() {\n      return getFlag(this.flags_, Reaction.isDisposedMask_);\n    },\n    set: function set(newValue) {\n      this.flags_ = setFlag(this.flags_, Reaction.isDisposedMask_, newValue);\n    }\n  }, {\n    key: \"isScheduled\",\n    get: function get() {\n      return getFlag(this.flags_, Reaction.isScheduledMask_);\n    },\n    set: function set(newValue) {\n      this.flags_ = setFlag(this.flags_, Reaction.isScheduledMask_, newValue);\n    }\n  }, {\n    key: \"isTrackPending\",\n    get: function get() {\n      return getFlag(this.flags_, Reaction.isTrackPendingMask_);\n    },\n    set: function set(newValue) {\n      this.flags_ = setFlag(this.flags_, Reaction.isTrackPendingMask_, newValue);\n    }\n  }, {\n    key: \"isRunning\",\n    get: function get() {\n      return getFlag(this.flags_, Reaction.isRunningMask_);\n    },\n    set: function set(newValue) {\n      this.flags_ = setFlag(this.flags_, Reaction.isRunningMask_, newValue);\n    }\n  }, {\n    key: \"diffValue\",\n    get: function get() {\n      return getFlag(this.flags_, Reaction.diffValueMask_) ? 1 : 0;\n    },\n    set: function set(newValue) {\n      this.flags_ = setFlag(this.flags_, Reaction.diffValueMask_, newValue === 1 ? true : false);\n    }\n  }]);\n}();\nReaction.isDisposedMask_ = 1;\nReaction.isScheduledMask_ = 2;\nReaction.isTrackPendingMask_ = 4;\nReaction.isRunningMask_ = 8;\nReaction.diffValueMask_ = 16;\nfunction onReactionError(handler) {\n  globalState.globalReactionErrorHandlers.push(handler);\n  return function () {\n    var idx = globalState.globalReactionErrorHandlers.indexOf(handler);\n    if (idx >= 0) {\n      globalState.globalReactionErrorHandlers.splice(idx, 1);\n    }\n  };\n}\n/**\n * Magic number alert!\n * Defines within how many times a reaction is allowed to re-trigger itself\n * until it is assumed that this is gonna be a never ending loop...\n */\nvar MAX_REACTION_ITERATIONS = 100;\nvar reactionScheduler = function reactionScheduler(f) {\n  return f();\n};\nfunction runReactions() {\n  // Trampolining, if runReactions are already running, new reactions will be picked up\n  if (globalState.inBatch > 0 || globalState.isRunningReactions) {\n    return;\n  }\n  reactionScheduler(runReactionsHelper);\n}\nfunction runReactionsHelper() {\n  globalState.isRunningReactions = true;\n  var allReactions = globalState.pendingReactions;\n  var iterations = 0;\n  // While running reactions, new reactions might be triggered.\n  // Hence we work with two variables and check whether\n  // we converge to no remaining reactions after a while.\n  while (allReactions.length > 0) {\n    if (++iterations === MAX_REACTION_ITERATIONS) {\n      console.error(process.env.NODE_ENV !== \"production\" ? \"Reaction doesn't converge to a stable state after \" + MAX_REACTION_ITERATIONS + \" iterations.\" + (\" Probably there is a cycle in the reactive function: \" + allReactions[0]) : \"[mobx] cycle in reaction: \" + allReactions[0]);\n      allReactions.splice(0); // clear reactions\n    }\n    var remainingReactions = allReactions.splice(0);\n    for (var i = 0, l = remainingReactions.length; i < l; i++) {\n      remainingReactions[i].runReaction_();\n    }\n  }\n  globalState.isRunningReactions = false;\n}\nvar isReaction = /*#__PURE__*/createInstanceofPredicate(\"Reaction\", Reaction);\nfunction setReactionScheduler(fn) {\n  var baseScheduler = reactionScheduler;\n  reactionScheduler = function reactionScheduler(f) {\n    return fn(function () {\n      return baseScheduler(f);\n    });\n  };\n}\n\nfunction isSpyEnabled() {\n  return process.env.NODE_ENV !== \"production\" && !!globalState.spyListeners.length;\n}\nfunction spyReport(event) {\n  if (!(process.env.NODE_ENV !== \"production\")) {\n    return;\n  } // dead code elimination can do the rest\n  if (!globalState.spyListeners.length) {\n    return;\n  }\n  var listeners = globalState.spyListeners;\n  for (var i = 0, l = listeners.length; i < l; i++) {\n    listeners[i](event);\n  }\n}\nfunction spyReportStart(event) {\n  if (!(process.env.NODE_ENV !== \"production\")) {\n    return;\n  }\n  var change = _extends({}, event, {\n    spyReportStart: true\n  });\n  spyReport(change);\n}\nvar END_EVENT = {\n  type: \"report-end\",\n  spyReportEnd: true\n};\nfunction spyReportEnd(change) {\n  if (!(process.env.NODE_ENV !== \"production\")) {\n    return;\n  }\n  if (change) {\n    spyReport(_extends({}, change, {\n      type: \"report-end\",\n      spyReportEnd: true\n    }));\n  } else {\n    spyReport(END_EVENT);\n  }\n}\nfunction spy(listener) {\n  if (!(process.env.NODE_ENV !== \"production\")) {\n    console.warn(\"[mobx.spy] Is a no-op in production builds\");\n    return function () {};\n  } else {\n    globalState.spyListeners.push(listener);\n    return once(function () {\n      globalState.spyListeners = globalState.spyListeners.filter(function (l) {\n        return l !== listener;\n      });\n    });\n  }\n}\n\nvar ACTION = \"action\";\nvar ACTION_BOUND = \"action.bound\";\nvar AUTOACTION = \"autoAction\";\nvar AUTOACTION_BOUND = \"autoAction.bound\";\nvar DEFAULT_ACTION_NAME = \"<unnamed action>\";\nvar actionAnnotation = /*#__PURE__*/createActionAnnotation(ACTION);\nvar actionBoundAnnotation = /*#__PURE__*/createActionAnnotation(ACTION_BOUND, {\n  bound: true\n});\nvar autoActionAnnotation = /*#__PURE__*/createActionAnnotation(AUTOACTION, {\n  autoAction: true\n});\nvar autoActionBoundAnnotation = /*#__PURE__*/createActionAnnotation(AUTOACTION_BOUND, {\n  autoAction: true,\n  bound: true\n});\nfunction createActionFactory(autoAction) {\n  var res = function action(arg1, arg2) {\n    // action(fn() {})\n    if (isFunction(arg1)) {\n      return createAction(arg1.name || DEFAULT_ACTION_NAME, arg1, autoAction);\n    }\n    // action(\"name\", fn() {})\n    if (isFunction(arg2)) {\n      return createAction(arg1, arg2, autoAction);\n    }\n    // @action (2022.3 Decorators)\n    if (is20223Decorator(arg2)) {\n      return (autoAction ? autoActionAnnotation : actionAnnotation).decorate_20223_(arg1, arg2);\n    }\n    // @action\n    if (isStringish(arg2)) {\n      return storeAnnotation(arg1, arg2, autoAction ? autoActionAnnotation : actionAnnotation);\n    }\n    // action(\"name\") & @action(\"name\")\n    if (isStringish(arg1)) {\n      return createDecoratorAnnotation(createActionAnnotation(autoAction ? AUTOACTION : ACTION, {\n        name: arg1,\n        autoAction: autoAction\n      }));\n    }\n    if (process.env.NODE_ENV !== \"production\") {\n      die(\"Invalid arguments for `action`\");\n    }\n  };\n  return res;\n}\nvar action = /*#__PURE__*/createActionFactory(false);\nObject.assign(action, actionAnnotation);\nvar autoAction = /*#__PURE__*/createActionFactory(true);\nObject.assign(autoAction, autoActionAnnotation);\naction.bound = /*#__PURE__*/createDecoratorAnnotation(actionBoundAnnotation);\nautoAction.bound = /*#__PURE__*/createDecoratorAnnotation(autoActionBoundAnnotation);\nfunction runInAction(fn) {\n  return executeAction(fn.name || DEFAULT_ACTION_NAME, false, fn, this, undefined);\n}\nfunction isAction(thing) {\n  return isFunction(thing) && thing.isMobxAction === true;\n}\n\n/**\n * Creates a named reactive view and keeps it alive, so that the view is always\n * updated if one of the dependencies changes, even when the view is not further used by something else.\n * @param view The reactive view\n * @returns disposer function, which can be used to stop the view from being updated in the future.\n */\nfunction autorun(view, opts) {\n  var _opts$name, _opts, _opts2, _opts3;\n  if (opts === void 0) {\n    opts = EMPTY_OBJECT;\n  }\n  if (process.env.NODE_ENV !== \"production\") {\n    if (!isFunction(view)) {\n      die(\"Autorun expects a function as first argument\");\n    }\n    if (isAction(view)) {\n      die(\"Autorun does not accept actions since actions are untrackable\");\n    }\n  }\n  var name = (_opts$name = (_opts = opts) == null ? void 0 : _opts.name) != null ? _opts$name : process.env.NODE_ENV !== \"production\" ? view.name || \"Autorun@\" + getNextId() : \"Autorun\";\n  var runSync = !opts.scheduler && !opts.delay;\n  var reaction;\n  if (runSync) {\n    // normal autorun\n    reaction = new Reaction(name, function () {\n      this.track(reactionRunner);\n    }, opts.onError, opts.requiresObservable);\n  } else {\n    var scheduler = createSchedulerFromOptions(opts);\n    // debounced autorun\n    var isScheduled = false;\n    reaction = new Reaction(name, function () {\n      if (!isScheduled) {\n        isScheduled = true;\n        scheduler(function () {\n          isScheduled = false;\n          if (!reaction.isDisposed) {\n            reaction.track(reactionRunner);\n          }\n        });\n      }\n    }, opts.onError, opts.requiresObservable);\n  }\n  function reactionRunner() {\n    view(reaction);\n  }\n  if (!((_opts2 = opts) != null && (_opts2 = _opts2.signal) != null && _opts2.aborted)) {\n    reaction.schedule_();\n  }\n  return reaction.getDisposer_((_opts3 = opts) == null ? void 0 : _opts3.signal);\n}\nvar run = function run(f) {\n  return f();\n};\nfunction createSchedulerFromOptions(opts) {\n  return opts.scheduler ? opts.scheduler : opts.delay ? function (f) {\n    return setTimeout(f, opts.delay);\n  } : run;\n}\nfunction reaction(expression, effect, opts) {\n  var _opts$name2, _opts4, _opts5;\n  if (opts === void 0) {\n    opts = EMPTY_OBJECT;\n  }\n  if (process.env.NODE_ENV !== \"production\") {\n    if (!isFunction(expression) || !isFunction(effect)) {\n      die(\"First and second argument to reaction should be functions\");\n    }\n    if (!isPlainObject(opts)) {\n      die(\"Third argument of reactions should be an object\");\n    }\n  }\n  var name = (_opts$name2 = opts.name) != null ? _opts$name2 : process.env.NODE_ENV !== \"production\" ? \"Reaction@\" + getNextId() : \"Reaction\";\n  var effectAction = action(name, opts.onError ? wrapErrorHandler(opts.onError, effect) : effect);\n  var runSync = !opts.scheduler && !opts.delay;\n  var scheduler = createSchedulerFromOptions(opts);\n  var firstTime = true;\n  var isScheduled = false;\n  var value;\n  var equals = opts.compareStructural ? comparer.structural : opts.equals || comparer[\"default\"];\n  var r = new Reaction(name, function () {\n    if (firstTime || runSync) {\n      reactionRunner();\n    } else if (!isScheduled) {\n      isScheduled = true;\n      scheduler(reactionRunner);\n    }\n  }, opts.onError, opts.requiresObservable);\n  function reactionRunner() {\n    isScheduled = false;\n    if (r.isDisposed) {\n      return;\n    }\n    var changed = false;\n    var oldValue = value;\n    r.track(function () {\n      var nextValue = allowStateChanges(false, function () {\n        return expression(r);\n      });\n      changed = firstTime || !equals(value, nextValue);\n      value = nextValue;\n    });\n    if (firstTime && opts.fireImmediately) {\n      effectAction(value, oldValue, r);\n    } else if (!firstTime && changed) {\n      effectAction(value, oldValue, r);\n    }\n    firstTime = false;\n  }\n  if (!((_opts4 = opts) != null && (_opts4 = _opts4.signal) != null && _opts4.aborted)) {\n    r.schedule_();\n  }\n  return r.getDisposer_((_opts5 = opts) == null ? void 0 : _opts5.signal);\n}\nfunction wrapErrorHandler(errorHandler, baseFn) {\n  return function () {\n    try {\n      return baseFn.apply(this, arguments);\n    } catch (e) {\n      errorHandler.call(this, e);\n    }\n  };\n}\n\nvar ON_BECOME_OBSERVED = \"onBO\";\nvar ON_BECOME_UNOBSERVED = \"onBUO\";\nfunction onBecomeObserved(thing, arg2, arg3) {\n  return interceptHook(ON_BECOME_OBSERVED, thing, arg2, arg3);\n}\nfunction onBecomeUnobserved(thing, arg2, arg3) {\n  return interceptHook(ON_BECOME_UNOBSERVED, thing, arg2, arg3);\n}\nfunction interceptHook(hook, thing, arg2, arg3) {\n  var atom = typeof arg3 === \"function\" ? getAtom(thing, arg2) : getAtom(thing);\n  var cb = isFunction(arg3) ? arg3 : arg2;\n  var listenersKey = hook + \"L\";\n  if (atom[listenersKey]) {\n    atom[listenersKey].add(cb);\n  } else {\n    atom[listenersKey] = new Set([cb]);\n  }\n  return function () {\n    var hookListeners = atom[listenersKey];\n    if (hookListeners) {\n      hookListeners[\"delete\"](cb);\n      if (hookListeners.size === 0) {\n        delete atom[listenersKey];\n      }\n    }\n  };\n}\n\nvar NEVER = \"never\";\nvar ALWAYS = \"always\";\nvar OBSERVED = \"observed\";\n// const IF_AVAILABLE = \"ifavailable\"\nfunction configure(options) {\n  if (options.isolateGlobalState === true) {\n    isolateGlobalState();\n  }\n  var useProxies = options.useProxies,\n    enforceActions = options.enforceActions;\n  if (useProxies !== undefined) {\n    globalState.useProxies = useProxies === ALWAYS ? true : useProxies === NEVER ? false : typeof Proxy !== \"undefined\";\n  }\n  if (useProxies === \"ifavailable\") {\n    globalState.verifyProxies = true;\n  }\n  if (enforceActions !== undefined) {\n    var ea = enforceActions === ALWAYS ? ALWAYS : enforceActions === OBSERVED;\n    globalState.enforceActions = ea;\n    globalState.allowStateChanges = ea === true || ea === ALWAYS ? false : true;\n  }\n  [\"computedRequiresReaction\", \"reactionRequiresObservable\", \"observableRequiresReaction\", \"disableErrorBoundaries\", \"safeDescriptors\"].forEach(function (key) {\n    if (key in options) {\n      globalState[key] = !!options[key];\n    }\n  });\n  globalState.allowStateReads = !globalState.observableRequiresReaction;\n  if (process.env.NODE_ENV !== \"production\" && globalState.disableErrorBoundaries === true) {\n    console.warn(\"WARNING: Debug feature only. MobX will NOT recover from errors when `disableErrorBoundaries` is enabled.\");\n  }\n  if (options.reactionScheduler) {\n    setReactionScheduler(options.reactionScheduler);\n  }\n}\n\nfunction extendObservable(target, properties, annotations, options) {\n  if (process.env.NODE_ENV !== \"production\") {\n    if (arguments.length > 4) {\n      die(\"'extendObservable' expected 2-4 arguments\");\n    }\n    if (typeof target !== \"object\") {\n      die(\"'extendObservable' expects an object as first argument\");\n    }\n    if (isObservableMap(target)) {\n      die(\"'extendObservable' should not be used on maps, use map.merge instead\");\n    }\n    if (!isPlainObject(properties)) {\n      die(\"'extendObservable' only accepts plain objects as second argument\");\n    }\n    if (isObservable(properties) || isObservable(annotations)) {\n      die(\"Extending an object with another observable (object) is not supported\");\n    }\n  }\n  // Pull descriptors first, so we don't have to deal with props added by administration ($mobx)\n  var descriptors = getOwnPropertyDescriptors(properties);\n  initObservable(function () {\n    var adm = asObservableObject(target, options)[$mobx];\n    ownKeys(descriptors).forEach(function (key) {\n      adm.extend_(key, descriptors[key],\n      // must pass \"undefined\" for { key: undefined }\n      !annotations ? true : key in annotations ? annotations[key] : true);\n    });\n  });\n  return target;\n}\n\nfunction getDependencyTree(thing, property) {\n  return nodeToDependencyTree(getAtom(thing, property));\n}\nfunction nodeToDependencyTree(node) {\n  var result = {\n    name: node.name_\n  };\n  if (node.observing_ && node.observing_.length > 0) {\n    result.dependencies = unique(node.observing_).map(nodeToDependencyTree);\n  }\n  return result;\n}\nfunction getObserverTree(thing, property) {\n  return nodeToObserverTree(getAtom(thing, property));\n}\nfunction nodeToObserverTree(node) {\n  var result = {\n    name: node.name_\n  };\n  if (hasObservers(node)) {\n    result.observers = Array.from(getObservers(node)).map(nodeToObserverTree);\n  }\n  return result;\n}\nfunction unique(list) {\n  return Array.from(new Set(list));\n}\n\nvar generatorId = 0;\nfunction FlowCancellationError() {\n  this.message = \"FLOW_CANCELLED\";\n}\nFlowCancellationError.prototype = /*#__PURE__*/Object.create(Error.prototype);\nfunction isFlowCancellationError(error) {\n  return error instanceof FlowCancellationError;\n}\nvar flowAnnotation = /*#__PURE__*/createFlowAnnotation(\"flow\");\nvar flowBoundAnnotation = /*#__PURE__*/createFlowAnnotation(\"flow.bound\", {\n  bound: true\n});\nvar flow = /*#__PURE__*/Object.assign(function flow(arg1, arg2) {\n  // @flow (2022.3 Decorators)\n  if (is20223Decorator(arg2)) {\n    return flowAnnotation.decorate_20223_(arg1, arg2);\n  }\n  // @flow\n  if (isStringish(arg2)) {\n    return storeAnnotation(arg1, arg2, flowAnnotation);\n  }\n  // flow(fn)\n  if (process.env.NODE_ENV !== \"production\" && arguments.length !== 1) {\n    die(\"Flow expects single argument with generator function\");\n  }\n  var generator = arg1;\n  var name = generator.name || \"<unnamed flow>\";\n  // Implementation based on https://github.com/tj/co/blob/master/index.js\n  var res = function res() {\n    var ctx = this;\n    var args = arguments;\n    var runId = ++generatorId;\n    var gen = action(name + \" - runid: \" + runId + \" - init\", generator).apply(ctx, args);\n    var rejector;\n    var pendingPromise = undefined;\n    var promise = new Promise(function (resolve, reject) {\n      var stepId = 0;\n      rejector = reject;\n      function onFulfilled(res) {\n        pendingPromise = undefined;\n        var ret;\n        try {\n          ret = action(name + \" - runid: \" + runId + \" - yield \" + stepId++, gen.next).call(gen, res);\n        } catch (e) {\n          return reject(e);\n        }\n        next(ret);\n      }\n      function onRejected(err) {\n        pendingPromise = undefined;\n        var ret;\n        try {\n          ret = action(name + \" - runid: \" + runId + \" - yield \" + stepId++, gen[\"throw\"]).call(gen, err);\n        } catch (e) {\n          return reject(e);\n        }\n        next(ret);\n      }\n      function next(ret) {\n        if (isFunction(ret == null ? void 0 : ret.then)) {\n          // an async iterator\n          ret.then(next, reject);\n          return;\n        }\n        if (ret.done) {\n          return resolve(ret.value);\n        }\n        pendingPromise = Promise.resolve(ret.value);\n        return pendingPromise.then(onFulfilled, onRejected);\n      }\n      onFulfilled(undefined); // kick off the process\n    });\n    promise.cancel = action(name + \" - runid: \" + runId + \" - cancel\", function () {\n      try {\n        if (pendingPromise) {\n          cancelPromise(pendingPromise);\n        }\n        // Finally block can return (or yield) stuff..\n        var _res = gen[\"return\"](undefined);\n        // eat anything that promise would do, it's cancelled!\n        var yieldedPromise = Promise.resolve(_res.value);\n        yieldedPromise.then(noop, noop);\n        cancelPromise(yieldedPromise); // maybe it can be cancelled :)\n        // reject our original promise\n        rejector(new FlowCancellationError());\n      } catch (e) {\n        rejector(e); // there could be a throwing finally block\n      }\n    });\n    return promise;\n  };\n  res.isMobXFlow = true;\n  return res;\n}, flowAnnotation);\nflow.bound = /*#__PURE__*/createDecoratorAnnotation(flowBoundAnnotation);\nfunction cancelPromise(promise) {\n  if (isFunction(promise.cancel)) {\n    promise.cancel();\n  }\n}\nfunction flowResult(result) {\n  return result; // just tricking TypeScript :)\n}\nfunction isFlow(fn) {\n  return (fn == null ? void 0 : fn.isMobXFlow) === true;\n}\n\nfunction interceptReads(thing, propOrHandler, handler) {\n  var target;\n  if (isObservableMap(thing) || isObservableArray(thing) || isObservableValue(thing)) {\n    target = getAdministration(thing);\n  } else if (isObservableObject(thing)) {\n    if (process.env.NODE_ENV !== \"production\" && !isStringish(propOrHandler)) {\n      return die(\"InterceptReads can only be used with a specific property, not with an object in general\");\n    }\n    target = getAdministration(thing, propOrHandler);\n  } else if (process.env.NODE_ENV !== \"production\") {\n    return die(\"Expected observable map, object or array as first array\");\n  }\n  if (process.env.NODE_ENV !== \"production\" && target.dehancer !== undefined) {\n    return die(\"An intercept reader was already established\");\n  }\n  target.dehancer = typeof propOrHandler === \"function\" ? propOrHandler : handler;\n  return function () {\n    target.dehancer = undefined;\n  };\n}\n\nfunction intercept(thing, propOrHandler, handler) {\n  if (isFunction(handler)) {\n    return interceptProperty(thing, propOrHandler, handler);\n  } else {\n    return interceptInterceptable(thing, propOrHandler);\n  }\n}\nfunction interceptInterceptable(thing, handler) {\n  return getAdministration(thing).intercept_(handler);\n}\nfunction interceptProperty(thing, property, handler) {\n  return getAdministration(thing, property).intercept_(handler);\n}\n\nfunction _isComputed(value, property) {\n  if (property === undefined) {\n    return isComputedValue(value);\n  }\n  if (isObservableObject(value) === false) {\n    return false;\n  }\n  if (!value[$mobx].values_.has(property)) {\n    return false;\n  }\n  var atom = getAtom(value, property);\n  return isComputedValue(atom);\n}\nfunction isComputed(value) {\n  if (process.env.NODE_ENV !== \"production\" && arguments.length > 1) {\n    return die(\"isComputed expects only 1 argument. Use isComputedProp to inspect the observability of a property\");\n  }\n  return _isComputed(value);\n}\nfunction isComputedProp(value, propName) {\n  if (process.env.NODE_ENV !== \"production\" && !isStringish(propName)) {\n    return die(\"isComputed expected a property name as second argument\");\n  }\n  return _isComputed(value, propName);\n}\n\nfunction _isObservable(value, property) {\n  if (!value) {\n    return false;\n  }\n  if (property !== undefined) {\n    if (process.env.NODE_ENV !== \"production\" && (isObservableMap(value) || isObservableArray(value))) {\n      return die(\"isObservable(object, propertyName) is not supported for arrays and maps. Use map.has or array.length instead.\");\n    }\n    if (isObservableObject(value)) {\n      return value[$mobx].values_.has(property);\n    }\n    return false;\n  }\n  // For first check, see #701\n  return isObservableObject(value) || !!value[$mobx] || isAtom(value) || isReaction(value) || isComputedValue(value);\n}\nfunction isObservable(value) {\n  if (process.env.NODE_ENV !== \"production\" && arguments.length !== 1) {\n    die(\"isObservable expects only 1 argument. Use isObservableProp to inspect the observability of a property\");\n  }\n  return _isObservable(value);\n}\nfunction isObservableProp(value, propName) {\n  if (process.env.NODE_ENV !== \"production\" && !isStringish(propName)) {\n    return die(\"expected a property name as second argument\");\n  }\n  return _isObservable(value, propName);\n}\n\nfunction keys(obj) {\n  if (isObservableObject(obj)) {\n    return obj[$mobx].keys_();\n  }\n  if (isObservableMap(obj) || isObservableSet(obj)) {\n    return Array.from(obj.keys());\n  }\n  if (isObservableArray(obj)) {\n    return obj.map(function (_, index) {\n      return index;\n    });\n  }\n  die(5);\n}\nfunction values(obj) {\n  if (isObservableObject(obj)) {\n    return keys(obj).map(function (key) {\n      return obj[key];\n    });\n  }\n  if (isObservableMap(obj)) {\n    return keys(obj).map(function (key) {\n      return obj.get(key);\n    });\n  }\n  if (isObservableSet(obj)) {\n    return Array.from(obj.values());\n  }\n  if (isObservableArray(obj)) {\n    return obj.slice();\n  }\n  die(6);\n}\nfunction entries(obj) {\n  if (isObservableObject(obj)) {\n    return keys(obj).map(function (key) {\n      return [key, obj[key]];\n    });\n  }\n  if (isObservableMap(obj)) {\n    return keys(obj).map(function (key) {\n      return [key, obj.get(key)];\n    });\n  }\n  if (isObservableSet(obj)) {\n    return Array.from(obj.entries());\n  }\n  if (isObservableArray(obj)) {\n    return obj.map(function (key, index) {\n      return [index, key];\n    });\n  }\n  die(7);\n}\nfunction set(obj, key, value) {\n  if (arguments.length === 2 && !isObservableSet(obj)) {\n    startBatch();\n    var _values = key;\n    try {\n      for (var _key in _values) {\n        set(obj, _key, _values[_key]);\n      }\n    } finally {\n      endBatch();\n    }\n    return;\n  }\n  if (isObservableObject(obj)) {\n    obj[$mobx].set_(key, value);\n  } else if (isObservableMap(obj)) {\n    obj.set(key, value);\n  } else if (isObservableSet(obj)) {\n    obj.add(key);\n  } else if (isObservableArray(obj)) {\n    if (typeof key !== \"number\") {\n      key = parseInt(key, 10);\n    }\n    if (key < 0) {\n      die(\"Invalid index: '\" + key + \"'\");\n    }\n    startBatch();\n    if (key >= obj.length) {\n      obj.length = key + 1;\n    }\n    obj[key] = value;\n    endBatch();\n  } else {\n    die(8);\n  }\n}\nfunction remove(obj, key) {\n  if (isObservableObject(obj)) {\n    obj[$mobx].delete_(key);\n  } else if (isObservableMap(obj)) {\n    obj[\"delete\"](key);\n  } else if (isObservableSet(obj)) {\n    obj[\"delete\"](key);\n  } else if (isObservableArray(obj)) {\n    if (typeof key !== \"number\") {\n      key = parseInt(key, 10);\n    }\n    obj.splice(key, 1);\n  } else {\n    die(9);\n  }\n}\nfunction has(obj, key) {\n  if (isObservableObject(obj)) {\n    return obj[$mobx].has_(key);\n  } else if (isObservableMap(obj)) {\n    return obj.has(key);\n  } else if (isObservableSet(obj)) {\n    return obj.has(key);\n  } else if (isObservableArray(obj)) {\n    return key >= 0 && key < obj.length;\n  }\n  die(10);\n}\nfunction get(obj, key) {\n  if (!has(obj, key)) {\n    return undefined;\n  }\n  if (isObservableObject(obj)) {\n    return obj[$mobx].get_(key);\n  } else if (isObservableMap(obj)) {\n    return obj.get(key);\n  } else if (isObservableArray(obj)) {\n    return obj[key];\n  }\n  die(11);\n}\nfunction apiDefineProperty(obj, key, descriptor) {\n  if (isObservableObject(obj)) {\n    return obj[$mobx].defineProperty_(key, descriptor);\n  }\n  die(39);\n}\nfunction apiOwnKeys(obj) {\n  if (isObservableObject(obj)) {\n    return obj[$mobx].ownKeys_();\n  }\n  die(38);\n}\n\nfunction observe(thing, propOrCb, cbOrFire, fireImmediately) {\n  if (isFunction(cbOrFire)) {\n    return observeObservableProperty(thing, propOrCb, cbOrFire, fireImmediately);\n  } else {\n    return observeObservable(thing, propOrCb, cbOrFire);\n  }\n}\nfunction observeObservable(thing, listener, fireImmediately) {\n  return getAdministration(thing).observe_(listener, fireImmediately);\n}\nfunction observeObservableProperty(thing, property, listener, fireImmediately) {\n  return getAdministration(thing, property).observe_(listener, fireImmediately);\n}\n\nfunction cache(map, key, value) {\n  map.set(key, value);\n  return value;\n}\nfunction toJSHelper(source, __alreadySeen) {\n  if (source == null || typeof source !== \"object\" || source instanceof Date || !isObservable(source)) {\n    return source;\n  }\n  if (isObservableValue(source) || isComputedValue(source)) {\n    return toJSHelper(source.get(), __alreadySeen);\n  }\n  if (__alreadySeen.has(source)) {\n    return __alreadySeen.get(source);\n  }\n  if (isObservableArray(source)) {\n    var res = cache(__alreadySeen, source, new Array(source.length));\n    source.forEach(function (value, idx) {\n      res[idx] = toJSHelper(value, __alreadySeen);\n    });\n    return res;\n  }\n  if (isObservableSet(source)) {\n    var _res = cache(__alreadySeen, source, new Set());\n    source.forEach(function (value) {\n      _res.add(toJSHelper(value, __alreadySeen));\n    });\n    return _res;\n  }\n  if (isObservableMap(source)) {\n    var _res2 = cache(__alreadySeen, source, new Map());\n    source.forEach(function (value, key) {\n      _res2.set(key, toJSHelper(value, __alreadySeen));\n    });\n    return _res2;\n  } else {\n    // must be observable object\n    var _res3 = cache(__alreadySeen, source, {});\n    apiOwnKeys(source).forEach(function (key) {\n      if (objectPrototype.propertyIsEnumerable.call(source, key)) {\n        _res3[key] = toJSHelper(source[key], __alreadySeen);\n      }\n    });\n    return _res3;\n  }\n}\n/**\n * Recursively converts an observable to it's non-observable native counterpart.\n * It does NOT recurse into non-observables, these are left as they are, even if they contain observables.\n * Computed and other non-enumerable properties are completely ignored.\n * Complex scenarios require custom solution, eg implementing `toJSON` or using `serializr` lib.\n */\nfunction toJS(source, options) {\n  if (process.env.NODE_ENV !== \"production\" && options) {\n    die(\"toJS no longer supports options\");\n  }\n  return toJSHelper(source, new Map());\n}\n\nfunction trace() {\n  if (!(process.env.NODE_ENV !== \"production\")) {\n    return;\n  }\n  var enterBreakPoint = false;\n  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n    args[_key] = arguments[_key];\n  }\n  if (typeof args[args.length - 1] === \"boolean\") {\n    enterBreakPoint = args.pop();\n  }\n  var derivation = getAtomFromArgs(args);\n  if (!derivation) {\n    return die(\"'trace(break?)' can only be used inside a tracked computed value or a Reaction. Consider passing in the computed value or reaction explicitly\");\n  }\n  if (derivation.isTracing_ === TraceMode.NONE) {\n    console.log(\"[mobx.trace] '\" + derivation.name_ + \"' tracing enabled\");\n  }\n  derivation.isTracing_ = enterBreakPoint ? TraceMode.BREAK : TraceMode.LOG;\n}\nfunction getAtomFromArgs(args) {\n  switch (args.length) {\n    case 0:\n      return globalState.trackingDerivation;\n    case 1:\n      return getAtom(args[0]);\n    case 2:\n      return getAtom(args[0], args[1]);\n  }\n}\n\n/**\n * During a transaction no views are updated until the end of the transaction.\n * The transaction will be run synchronously nonetheless.\n *\n * @param action a function that updates some reactive state\n * @returns any value that was returned by the 'action' parameter.\n */\nfunction transaction(action, thisArg) {\n  if (thisArg === void 0) {\n    thisArg = undefined;\n  }\n  startBatch();\n  try {\n    return action.apply(thisArg);\n  } finally {\n    endBatch();\n  }\n}\n\nfunction when(predicate, arg1, arg2) {\n  if (arguments.length === 1 || arg1 && typeof arg1 === \"object\") {\n    return whenPromise(predicate, arg1);\n  }\n  return _when(predicate, arg1, arg2 || {});\n}\nfunction _when(predicate, effect, opts) {\n  var timeoutHandle;\n  if (typeof opts.timeout === \"number\") {\n    var error = new Error(\"WHEN_TIMEOUT\");\n    timeoutHandle = setTimeout(function () {\n      if (!disposer[$mobx].isDisposed) {\n        disposer();\n        if (opts.onError) {\n          opts.onError(error);\n        } else {\n          throw error;\n        }\n      }\n    }, opts.timeout);\n  }\n  opts.name = process.env.NODE_ENV !== \"production\" ? opts.name || \"When@\" + getNextId() : \"When\";\n  var effectAction = createAction(process.env.NODE_ENV !== \"production\" ? opts.name + \"-effect\" : \"When-effect\", effect);\n  // eslint-disable-next-line\n  var disposer = autorun(function (r) {\n    // predicate should not change state\n    var cond = allowStateChanges(false, predicate);\n    if (cond) {\n      r.dispose();\n      if (timeoutHandle) {\n        clearTimeout(timeoutHandle);\n      }\n      effectAction();\n    }\n  }, opts);\n  return disposer;\n}\nfunction whenPromise(predicate, opts) {\n  var _opts$signal;\n  if (process.env.NODE_ENV !== \"production\" && opts && opts.onError) {\n    return die(\"the options 'onError' and 'promise' cannot be combined\");\n  }\n  if (opts != null && (_opts$signal = opts.signal) != null && _opts$signal.aborted) {\n    return Object.assign(Promise.reject(new Error(\"WHEN_ABORTED\")), {\n      cancel: function cancel() {\n        return null;\n      }\n    });\n  }\n  var cancel;\n  var abort;\n  var res = new Promise(function (resolve, reject) {\n    var _opts$signal2;\n    var disposer = _when(predicate, resolve, _extends({}, opts, {\n      onError: reject\n    }));\n    cancel = function cancel() {\n      disposer();\n      reject(new Error(\"WHEN_CANCELLED\"));\n    };\n    abort = function abort() {\n      disposer();\n      reject(new Error(\"WHEN_ABORTED\"));\n    };\n    opts == null || (_opts$signal2 = opts.signal) == null || _opts$signal2.addEventListener == null || _opts$signal2.addEventListener(\"abort\", abort);\n  })[\"finally\"](function () {\n    var _opts$signal3;\n    return opts == null || (_opts$signal3 = opts.signal) == null || _opts$signal3.removeEventListener == null ? void 0 : _opts$signal3.removeEventListener(\"abort\", abort);\n  });\n  res.cancel = cancel;\n  return res;\n}\n\nfunction getAdm(target) {\n  return target[$mobx];\n}\n// Optimization: we don't need the intermediate objects and could have a completely custom administration for DynamicObjects,\n// and skip either the internal values map, or the base object with its property descriptors!\nvar objectProxyTraps = {\n  has: function has(target, name) {\n    if (process.env.NODE_ENV !== \"production\" && globalState.trackingDerivation) {\n      warnAboutProxyRequirement(\"detect new properties using the 'in' operator. Use 'has' from 'mobx' instead.\");\n    }\n    return getAdm(target).has_(name);\n  },\n  get: function get(target, name) {\n    return getAdm(target).get_(name);\n  },\n  set: function set(target, name, value) {\n    var _getAdm$set_;\n    if (!isStringish(name)) {\n      return false;\n    }\n    if (process.env.NODE_ENV !== \"production\" && !getAdm(target).values_.has(name)) {\n      warnAboutProxyRequirement(\"add a new observable property through direct assignment. Use 'set' from 'mobx' instead.\");\n    }\n    // null (intercepted) -> true (success)\n    return (_getAdm$set_ = getAdm(target).set_(name, value, true)) != null ? _getAdm$set_ : true;\n  },\n  deleteProperty: function deleteProperty(target, name) {\n    var _getAdm$delete_;\n    if (process.env.NODE_ENV !== \"production\") {\n      warnAboutProxyRequirement(\"delete properties from an observable object. Use 'remove' from 'mobx' instead.\");\n    }\n    if (!isStringish(name)) {\n      return false;\n    }\n    // null (intercepted) -> true (success)\n    return (_getAdm$delete_ = getAdm(target).delete_(name, true)) != null ? _getAdm$delete_ : true;\n  },\n  defineProperty: function defineProperty(target, name, descriptor) {\n    var _getAdm$definePropert;\n    if (process.env.NODE_ENV !== \"production\") {\n      warnAboutProxyRequirement(\"define property on an observable object. Use 'defineProperty' from 'mobx' instead.\");\n    }\n    // null (intercepted) -> true (success)\n    return (_getAdm$definePropert = getAdm(target).defineProperty_(name, descriptor)) != null ? _getAdm$definePropert : true;\n  },\n  ownKeys: function ownKeys(target) {\n    if (process.env.NODE_ENV !== \"production\" && globalState.trackingDerivation) {\n      warnAboutProxyRequirement(\"iterate keys to detect added / removed properties. Use 'keys' from 'mobx' instead.\");\n    }\n    return getAdm(target).ownKeys_();\n  },\n  preventExtensions: function preventExtensions(target) {\n    die(13);\n  }\n};\nfunction asDynamicObservableObject(target, options) {\n  var _target$$mobx, _target$$mobx$proxy_;\n  assertProxies();\n  target = asObservableObject(target, options);\n  return (_target$$mobx$proxy_ = (_target$$mobx = target[$mobx]).proxy_) != null ? _target$$mobx$proxy_ : _target$$mobx.proxy_ = new Proxy(target, objectProxyTraps);\n}\n\nfunction hasInterceptors(interceptable) {\n  return interceptable.interceptors_ !== undefined && interceptable.interceptors_.length > 0;\n}\nfunction registerInterceptor(interceptable, handler) {\n  var interceptors = interceptable.interceptors_ || (interceptable.interceptors_ = []);\n  interceptors.push(handler);\n  return once(function () {\n    var idx = interceptors.indexOf(handler);\n    if (idx !== -1) {\n      interceptors.splice(idx, 1);\n    }\n  });\n}\nfunction interceptChange(interceptable, change) {\n  var prevU = untrackedStart();\n  try {\n    // Interceptor can modify the array, copy it to avoid concurrent modification, see #1950\n    var interceptors = [].concat(interceptable.interceptors_ || []);\n    for (var i = 0, l = interceptors.length; i < l; i++) {\n      change = interceptors[i](change);\n      if (change && !change.type) {\n        die(14);\n      }\n      if (!change) {\n        break;\n      }\n    }\n    return change;\n  } finally {\n    untrackedEnd(prevU);\n  }\n}\n\nfunction hasListeners(listenable) {\n  return listenable.changeListeners_ !== undefined && listenable.changeListeners_.length > 0;\n}\nfunction registerListener(listenable, handler) {\n  var listeners = listenable.changeListeners_ || (listenable.changeListeners_ = []);\n  listeners.push(handler);\n  return once(function () {\n    var idx = listeners.indexOf(handler);\n    if (idx !== -1) {\n      listeners.splice(idx, 1);\n    }\n  });\n}\nfunction notifyListeners(listenable, change) {\n  var prevU = untrackedStart();\n  var listeners = listenable.changeListeners_;\n  if (!listeners) {\n    return;\n  }\n  listeners = listeners.slice();\n  for (var i = 0, l = listeners.length; i < l; i++) {\n    listeners[i](change);\n  }\n  untrackedEnd(prevU);\n}\n\nfunction makeObservable(target, annotations, options) {\n  initObservable(function () {\n    var _annotations;\n    var adm = asObservableObject(target, options)[$mobx];\n    if (process.env.NODE_ENV !== \"production\" && annotations && target[storedAnnotationsSymbol]) {\n      die(\"makeObservable second arg must be nullish when using decorators. Mixing @decorator syntax with annotations is not supported.\");\n    }\n    // Default to decorators\n    (_annotations = annotations) != null ? _annotations : annotations = collectStoredAnnotations(target);\n    // Annotate\n    ownKeys(annotations).forEach(function (key) {\n      return adm.make_(key, annotations[key]);\n    });\n  });\n  return target;\n}\n// proto[keysSymbol] = new Set<PropertyKey>()\nvar keysSymbol = /*#__PURE__*/Symbol(\"mobx-keys\");\nfunction makeAutoObservable(target, overrides, options) {\n  if (process.env.NODE_ENV !== \"production\") {\n    if (!isPlainObject(target) && !isPlainObject(Object.getPrototypeOf(target))) {\n      die(\"'makeAutoObservable' can only be used for classes that don't have a superclass\");\n    }\n    if (isObservableObject(target)) {\n      die(\"makeAutoObservable can only be used on objects not already made observable\");\n    }\n  }\n  // Optimization: avoid visiting protos\n  // Assumes that annotation.make_/.extend_ works the same for plain objects\n  if (isPlainObject(target)) {\n    return extendObservable(target, target, overrides, options);\n  }\n  initObservable(function () {\n    var adm = asObservableObject(target, options)[$mobx];\n    // Optimization: cache keys on proto\n    // Assumes makeAutoObservable can be called only once per object and can't be used in subclass\n    if (!target[keysSymbol]) {\n      var proto = Object.getPrototypeOf(target);\n      var keys = new Set([].concat(ownKeys(target), ownKeys(proto)));\n      keys[\"delete\"](\"constructor\");\n      keys[\"delete\"]($mobx);\n      addHiddenProp(proto, keysSymbol, keys);\n    }\n    target[keysSymbol].forEach(function (key) {\n      return adm.make_(key,\n      // must pass \"undefined\" for { key: undefined }\n      !overrides ? true : key in overrides ? overrides[key] : true);\n    });\n  });\n  return target;\n}\n\nvar SPLICE = \"splice\";\nvar UPDATE = \"update\";\nvar MAX_SPLICE_SIZE = 10000; // See e.g. https://github.com/mobxjs/mobx/issues/859\nvar arrayTraps = {\n  get: function get(target, name) {\n    var adm = target[$mobx];\n    if (name === $mobx) {\n      return adm;\n    }\n    if (name === \"length\") {\n      return adm.getArrayLength_();\n    }\n    if (typeof name === \"string\" && !isNaN(name)) {\n      return adm.get_(parseInt(name));\n    }\n    if (hasProp(arrayExtensions, name)) {\n      return arrayExtensions[name];\n    }\n    return target[name];\n  },\n  set: function set(target, name, value) {\n    var adm = target[$mobx];\n    if (name === \"length\") {\n      adm.setArrayLength_(value);\n    }\n    if (typeof name === \"symbol\" || isNaN(name)) {\n      target[name] = value;\n    } else {\n      // numeric string\n      adm.set_(parseInt(name), value);\n    }\n    return true;\n  },\n  preventExtensions: function preventExtensions() {\n    die(15);\n  }\n};\nvar ObservableArrayAdministration = /*#__PURE__*/function () {\n  function ObservableArrayAdministration(name, enhancer, owned_, legacyMode_) {\n    if (name === void 0) {\n      name = process.env.NODE_ENV !== \"production\" ? \"ObservableArray@\" + getNextId() : \"ObservableArray\";\n    }\n    this.owned_ = void 0;\n    this.legacyMode_ = void 0;\n    this.atom_ = void 0;\n    this.values_ = [];\n    // this is the prop that gets proxied, so can't replace it!\n    this.interceptors_ = void 0;\n    this.changeListeners_ = void 0;\n    this.enhancer_ = void 0;\n    this.dehancer = void 0;\n    this.proxy_ = void 0;\n    this.lastKnownLength_ = 0;\n    this.owned_ = owned_;\n    this.legacyMode_ = legacyMode_;\n    this.atom_ = new Atom(name);\n    this.enhancer_ = function (newV, oldV) {\n      return enhancer(newV, oldV, process.env.NODE_ENV !== \"production\" ? name + \"[..]\" : \"ObservableArray[..]\");\n    };\n  }\n  var _proto = ObservableArrayAdministration.prototype;\n  _proto.dehanceValue_ = function dehanceValue_(value) {\n    if (this.dehancer !== undefined) {\n      return this.dehancer(value);\n    }\n    return value;\n  };\n  _proto.dehanceValues_ = function dehanceValues_(values) {\n    if (this.dehancer !== undefined && values.length > 0) {\n      return values.map(this.dehancer);\n    }\n    return values;\n  };\n  _proto.intercept_ = function intercept_(handler) {\n    return registerInterceptor(this, handler);\n  };\n  _proto.observe_ = function observe_(listener, fireImmediately) {\n    if (fireImmediately === void 0) {\n      fireImmediately = false;\n    }\n    if (fireImmediately) {\n      listener({\n        observableKind: \"array\",\n        object: this.proxy_,\n        debugObjectName: this.atom_.name_,\n        type: \"splice\",\n        index: 0,\n        added: this.values_.slice(),\n        addedCount: this.values_.length,\n        removed: [],\n        removedCount: 0\n      });\n    }\n    return registerListener(this, listener);\n  };\n  _proto.getArrayLength_ = function getArrayLength_() {\n    this.atom_.reportObserved();\n    return this.values_.length;\n  };\n  _proto.setArrayLength_ = function setArrayLength_(newLength) {\n    if (typeof newLength !== \"number\" || isNaN(newLength) || newLength < 0) {\n      die(\"Out of range: \" + newLength);\n    }\n    var currentLength = this.values_.length;\n    if (newLength === currentLength) {\n      return;\n    } else if (newLength > currentLength) {\n      var newItems = new Array(newLength - currentLength);\n      for (var i = 0; i < newLength - currentLength; i++) {\n        newItems[i] = undefined;\n      } // No Array.fill everywhere...\n      this.spliceWithArray_(currentLength, 0, newItems);\n    } else {\n      this.spliceWithArray_(newLength, currentLength - newLength);\n    }\n  };\n  _proto.updateArrayLength_ = function updateArrayLength_(oldLength, delta) {\n    if (oldLength !== this.lastKnownLength_) {\n      die(16);\n    }\n    this.lastKnownLength_ += delta;\n    if (this.legacyMode_ && delta > 0) {\n      reserveArrayBuffer(oldLength + delta + 1);\n    }\n  };\n  _proto.spliceWithArray_ = function spliceWithArray_(index, deleteCount, newItems) {\n    var _this = this;\n    checkIfStateModificationsAreAllowed(this.atom_);\n    var length = this.values_.length;\n    if (index === undefined) {\n      index = 0;\n    } else if (index > length) {\n      index = length;\n    } else if (index < 0) {\n      index = Math.max(0, length + index);\n    }\n    if (arguments.length === 1) {\n      deleteCount = length - index;\n    } else if (deleteCount === undefined || deleteCount === null) {\n      deleteCount = 0;\n    } else {\n      deleteCount = Math.max(0, Math.min(deleteCount, length - index));\n    }\n    if (newItems === undefined) {\n      newItems = EMPTY_ARRAY;\n    }\n    if (hasInterceptors(this)) {\n      var change = interceptChange(this, {\n        object: this.proxy_,\n        type: SPLICE,\n        index: index,\n        removedCount: deleteCount,\n        added: newItems\n      });\n      if (!change) {\n        return EMPTY_ARRAY;\n      }\n      deleteCount = change.removedCount;\n      newItems = change.added;\n    }\n    newItems = newItems.length === 0 ? newItems : newItems.map(function (v) {\n      return _this.enhancer_(v, undefined);\n    });\n    if (this.legacyMode_ || process.env.NODE_ENV !== \"production\") {\n      var lengthDelta = newItems.length - deleteCount;\n      this.updateArrayLength_(length, lengthDelta); // checks if internal array wasn't modified\n    }\n    var res = this.spliceItemsIntoValues_(index, deleteCount, newItems);\n    if (deleteCount !== 0 || newItems.length !== 0) {\n      this.notifyArraySplice_(index, newItems, res);\n    }\n    return this.dehanceValues_(res);\n  };\n  _proto.spliceItemsIntoValues_ = function spliceItemsIntoValues_(index, deleteCount, newItems) {\n    if (newItems.length < MAX_SPLICE_SIZE) {\n      var _this$values_;\n      return (_this$values_ = this.values_).splice.apply(_this$values_, [index, deleteCount].concat(newItems));\n    } else {\n      // The items removed by the splice\n      var res = this.values_.slice(index, index + deleteCount);\n      // The items that that should remain at the end of the array\n      var oldItems = this.values_.slice(index + deleteCount);\n      // New length is the previous length + addition count - deletion count\n      this.values_.length += newItems.length - deleteCount;\n      for (var i = 0; i < newItems.length; i++) {\n        this.values_[index + i] = newItems[i];\n      }\n      for (var _i = 0; _i < oldItems.length; _i++) {\n        this.values_[index + newItems.length + _i] = oldItems[_i];\n      }\n      return res;\n    }\n  };\n  _proto.notifyArrayChildUpdate_ = function notifyArrayChildUpdate_(index, newValue, oldValue) {\n    var notifySpy = !this.owned_ && isSpyEnabled();\n    var notify = hasListeners(this);\n    var change = notify || notifySpy ? {\n      observableKind: \"array\",\n      object: this.proxy_,\n      type: UPDATE,\n      debugObjectName: this.atom_.name_,\n      index: index,\n      newValue: newValue,\n      oldValue: oldValue\n    } : null;\n    // The reason why this is on right hand side here (and not above), is this way the uglifier will drop it, but it won't\n    // cause any runtime overhead in development mode without NODE_ENV set, unless spying is enabled\n    if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n      spyReportStart(change);\n    }\n    this.atom_.reportChanged();\n    if (notify) {\n      notifyListeners(this, change);\n    }\n    if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n      spyReportEnd();\n    }\n  };\n  _proto.notifyArraySplice_ = function notifyArraySplice_(index, added, removed) {\n    var notifySpy = !this.owned_ && isSpyEnabled();\n    var notify = hasListeners(this);\n    var change = notify || notifySpy ? {\n      observableKind: \"array\",\n      object: this.proxy_,\n      debugObjectName: this.atom_.name_,\n      type: SPLICE,\n      index: index,\n      removed: removed,\n      added: added,\n      removedCount: removed.length,\n      addedCount: added.length\n    } : null;\n    if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n      spyReportStart(change);\n    }\n    this.atom_.reportChanged();\n    // conform: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/observe\n    if (notify) {\n      notifyListeners(this, change);\n    }\n    if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n      spyReportEnd();\n    }\n  };\n  _proto.get_ = function get_(index) {\n    if (this.legacyMode_ && index >= this.values_.length) {\n      console.warn(process.env.NODE_ENV !== \"production\" ? \"[mobx.array] Attempt to read an array index (\" + index + \") that is out of bounds (\" + this.values_.length + \"). Please check length first. Out of bound indices will not be tracked by MobX\" : \"[mobx] Out of bounds read: \" + index);\n      return undefined;\n    }\n    this.atom_.reportObserved();\n    return this.dehanceValue_(this.values_[index]);\n  };\n  _proto.set_ = function set_(index, newValue) {\n    var values = this.values_;\n    if (this.legacyMode_ && index > values.length) {\n      // out of bounds\n      die(17, index, values.length);\n    }\n    if (index < values.length) {\n      // update at index in range\n      checkIfStateModificationsAreAllowed(this.atom_);\n      var oldValue = values[index];\n      if (hasInterceptors(this)) {\n        var change = interceptChange(this, {\n          type: UPDATE,\n          object: this.proxy_,\n          // since \"this\" is the real array we need to pass its proxy\n          index: index,\n          newValue: newValue\n        });\n        if (!change) {\n          return;\n        }\n        newValue = change.newValue;\n      }\n      newValue = this.enhancer_(newValue, oldValue);\n      var changed = newValue !== oldValue;\n      if (changed) {\n        values[index] = newValue;\n        this.notifyArrayChildUpdate_(index, newValue, oldValue);\n      }\n    } else {\n      // For out of bound index, we don't create an actual sparse array,\n      // but rather fill the holes with undefined (same as setArrayLength_).\n      // This could be considered a bug.\n      var newItems = new Array(index + 1 - values.length);\n      for (var i = 0; i < newItems.length - 1; i++) {\n        newItems[i] = undefined;\n      } // No Array.fill everywhere...\n      newItems[newItems.length - 1] = newValue;\n      this.spliceWithArray_(values.length, 0, newItems);\n    }\n  };\n  return ObservableArrayAdministration;\n}();\nfunction createObservableArray(initialValues, enhancer, name, owned) {\n  if (name === void 0) {\n    name = process.env.NODE_ENV !== \"production\" ? \"ObservableArray@\" + getNextId() : \"ObservableArray\";\n  }\n  if (owned === void 0) {\n    owned = false;\n  }\n  assertProxies();\n  return initObservable(function () {\n    var adm = new ObservableArrayAdministration(name, enhancer, owned, false);\n    addHiddenFinalProp(adm.values_, $mobx, adm);\n    var proxy = new Proxy(adm.values_, arrayTraps);\n    adm.proxy_ = proxy;\n    if (initialValues && initialValues.length) {\n      adm.spliceWithArray_(0, 0, initialValues);\n    }\n    return proxy;\n  });\n}\n// eslint-disable-next-line\nvar arrayExtensions = {\n  clear: function clear() {\n    return this.splice(0);\n  },\n  replace: function replace(newItems) {\n    var adm = this[$mobx];\n    return adm.spliceWithArray_(0, adm.values_.length, newItems);\n  },\n  // Used by JSON.stringify\n  toJSON: function toJSON() {\n    return this.slice();\n  },\n  /*\n   * functions that do alter the internal structure of the array, (based on lib.es6.d.ts)\n   * since these functions alter the inner structure of the array, the have side effects.\n   * Because the have side effects, they should not be used in computed function,\n   * and for that reason the do not call dependencyState.notifyObserved\n   */\n  splice: function splice(index, deleteCount) {\n    for (var _len = arguments.length, newItems = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n      newItems[_key - 2] = arguments[_key];\n    }\n    var adm = this[$mobx];\n    switch (arguments.length) {\n      case 0:\n        return [];\n      case 1:\n        return adm.spliceWithArray_(index);\n      case 2:\n        return adm.spliceWithArray_(index, deleteCount);\n    }\n    return adm.spliceWithArray_(index, deleteCount, newItems);\n  },\n  spliceWithArray: function spliceWithArray(index, deleteCount, newItems) {\n    return this[$mobx].spliceWithArray_(index, deleteCount, newItems);\n  },\n  push: function push() {\n    var adm = this[$mobx];\n    for (var _len2 = arguments.length, items = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n      items[_key2] = arguments[_key2];\n    }\n    adm.spliceWithArray_(adm.values_.length, 0, items);\n    return adm.values_.length;\n  },\n  pop: function pop() {\n    return this.splice(Math.max(this[$mobx].values_.length - 1, 0), 1)[0];\n  },\n  shift: function shift() {\n    return this.splice(0, 1)[0];\n  },\n  unshift: function unshift() {\n    var adm = this[$mobx];\n    for (var _len3 = arguments.length, items = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n      items[_key3] = arguments[_key3];\n    }\n    adm.spliceWithArray_(0, 0, items);\n    return adm.values_.length;\n  },\n  reverse: function reverse() {\n    // reverse by default mutates in place before returning the result\n    // which makes it both a 'derivation' and a 'mutation'.\n    if (globalState.trackingDerivation) {\n      die(37, \"reverse\");\n    }\n    this.replace(this.slice().reverse());\n    return this;\n  },\n  sort: function sort() {\n    // sort by default mutates in place before returning the result\n    // which goes against all good practices. Let's not change the array in place!\n    if (globalState.trackingDerivation) {\n      die(37, \"sort\");\n    }\n    var copy = this.slice();\n    copy.sort.apply(copy, arguments);\n    this.replace(copy);\n    return this;\n  },\n  remove: function remove(value) {\n    var adm = this[$mobx];\n    var idx = adm.dehanceValues_(adm.values_).indexOf(value);\n    if (idx > -1) {\n      this.splice(idx, 1);\n      return true;\n    }\n    return false;\n  }\n};\n/**\n * Wrap function from prototype\n * Without this, everything works as well, but this works\n * faster as everything works on unproxied values\n */\naddArrayExtension(\"at\", simpleFunc);\naddArrayExtension(\"concat\", simpleFunc);\naddArrayExtension(\"flat\", simpleFunc);\naddArrayExtension(\"includes\", simpleFunc);\naddArrayExtension(\"indexOf\", simpleFunc);\naddArrayExtension(\"join\", simpleFunc);\naddArrayExtension(\"lastIndexOf\", simpleFunc);\naddArrayExtension(\"slice\", simpleFunc);\naddArrayExtension(\"toString\", simpleFunc);\naddArrayExtension(\"toLocaleString\", simpleFunc);\naddArrayExtension(\"toSorted\", simpleFunc);\naddArrayExtension(\"toSpliced\", simpleFunc);\naddArrayExtension(\"with\", simpleFunc);\n// map\naddArrayExtension(\"every\", mapLikeFunc);\naddArrayExtension(\"filter\", mapLikeFunc);\naddArrayExtension(\"find\", mapLikeFunc);\naddArrayExtension(\"findIndex\", mapLikeFunc);\naddArrayExtension(\"findLast\", mapLikeFunc);\naddArrayExtension(\"findLastIndex\", mapLikeFunc);\naddArrayExtension(\"flatMap\", mapLikeFunc);\naddArrayExtension(\"forEach\", mapLikeFunc);\naddArrayExtension(\"map\", mapLikeFunc);\naddArrayExtension(\"some\", mapLikeFunc);\naddArrayExtension(\"toReversed\", mapLikeFunc);\n// reduce\naddArrayExtension(\"reduce\", reduceLikeFunc);\naddArrayExtension(\"reduceRight\", reduceLikeFunc);\nfunction addArrayExtension(funcName, funcFactory) {\n  if (typeof Array.prototype[funcName] === \"function\") {\n    arrayExtensions[funcName] = funcFactory(funcName);\n  }\n}\n// Report and delegate to dehanced array\nfunction simpleFunc(funcName) {\n  return function () {\n    var adm = this[$mobx];\n    adm.atom_.reportObserved();\n    var dehancedValues = adm.dehanceValues_(adm.values_);\n    return dehancedValues[funcName].apply(dehancedValues, arguments);\n  };\n}\n// Make sure callbacks receive correct array arg #2326\nfunction mapLikeFunc(funcName) {\n  return function (callback, thisArg) {\n    var _this2 = this;\n    var adm = this[$mobx];\n    adm.atom_.reportObserved();\n    var dehancedValues = adm.dehanceValues_(adm.values_);\n    return dehancedValues[funcName](function (element, index) {\n      return callback.call(thisArg, element, index, _this2);\n    });\n  };\n}\n// Make sure callbacks receive correct array arg #2326\nfunction reduceLikeFunc(funcName) {\n  return function () {\n    var _this3 = this;\n    var adm = this[$mobx];\n    adm.atom_.reportObserved();\n    var dehancedValues = adm.dehanceValues_(adm.values_);\n    // #2432 - reduce behavior depends on arguments.length\n    var callback = arguments[0];\n    arguments[0] = function (accumulator, currentValue, index) {\n      return callback(accumulator, currentValue, index, _this3);\n    };\n    return dehancedValues[funcName].apply(dehancedValues, arguments);\n  };\n}\nvar isObservableArrayAdministration = /*#__PURE__*/createInstanceofPredicate(\"ObservableArrayAdministration\", ObservableArrayAdministration);\nfunction isObservableArray(thing) {\n  return isObject(thing) && isObservableArrayAdministration(thing[$mobx]);\n}\n\nvar ObservableMapMarker = {};\nvar ADD = \"add\";\nvar DELETE = \"delete\";\n// just extend Map? See also https://gist.github.com/nestharus/13b4d74f2ef4a2f4357dbd3fc23c1e54\n// But: https://github.com/mobxjs/mobx/issues/1556\nvar ObservableMap = /*#__PURE__*/function () {\n  function ObservableMap(initialData, enhancer_, name_) {\n    var _this = this;\n    if (enhancer_ === void 0) {\n      enhancer_ = deepEnhancer;\n    }\n    if (name_ === void 0) {\n      name_ = process.env.NODE_ENV !== \"production\" ? \"ObservableMap@\" + getNextId() : \"ObservableMap\";\n    }\n    this.enhancer_ = void 0;\n    this.name_ = void 0;\n    this[$mobx] = ObservableMapMarker;\n    this.data_ = void 0;\n    this.hasMap_ = void 0;\n    // hasMap, not hashMap >-).\n    this.keysAtom_ = void 0;\n    this.interceptors_ = void 0;\n    this.changeListeners_ = void 0;\n    this.dehancer = void 0;\n    this.enhancer_ = enhancer_;\n    this.name_ = name_;\n    if (!isFunction(Map)) {\n      die(18);\n    }\n    initObservable(function () {\n      _this.keysAtom_ = createAtom(process.env.NODE_ENV !== \"production\" ? _this.name_ + \".keys()\" : \"ObservableMap.keys()\");\n      _this.data_ = new Map();\n      _this.hasMap_ = new Map();\n      if (initialData) {\n        _this.merge(initialData);\n      }\n    });\n  }\n  var _proto = ObservableMap.prototype;\n  _proto.has_ = function has_(key) {\n    return this.data_.has(key);\n  };\n  _proto.has = function has(key) {\n    var _this2 = this;\n    if (!globalState.trackingDerivation) {\n      return this.has_(key);\n    }\n    var entry = this.hasMap_.get(key);\n    if (!entry) {\n      var newEntry = entry = new ObservableValue(this.has_(key), referenceEnhancer, process.env.NODE_ENV !== \"production\" ? this.name_ + \".\" + stringifyKey(key) + \"?\" : \"ObservableMap.key?\", false);\n      this.hasMap_.set(key, newEntry);\n      onBecomeUnobserved(newEntry, function () {\n        return _this2.hasMap_[\"delete\"](key);\n      });\n    }\n    return entry.get();\n  };\n  _proto.set = function set(key, value) {\n    var hasKey = this.has_(key);\n    if (hasInterceptors(this)) {\n      var change = interceptChange(this, {\n        type: hasKey ? UPDATE : ADD,\n        object: this,\n        newValue: value,\n        name: key\n      });\n      if (!change) {\n        return this;\n      }\n      value = change.newValue;\n    }\n    if (hasKey) {\n      this.updateValue_(key, value);\n    } else {\n      this.addValue_(key, value);\n    }\n    return this;\n  };\n  _proto[\"delete\"] = function _delete(key) {\n    var _this3 = this;\n    checkIfStateModificationsAreAllowed(this.keysAtom_);\n    if (hasInterceptors(this)) {\n      var change = interceptChange(this, {\n        type: DELETE,\n        object: this,\n        name: key\n      });\n      if (!change) {\n        return false;\n      }\n    }\n    if (this.has_(key)) {\n      var notifySpy = isSpyEnabled();\n      var notify = hasListeners(this);\n      var _change = notify || notifySpy ? {\n        observableKind: \"map\",\n        debugObjectName: this.name_,\n        type: DELETE,\n        object: this,\n        oldValue: this.data_.get(key).value_,\n        name: key\n      } : null;\n      if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n        spyReportStart(_change);\n      } // TODO fix type\n      transaction(function () {\n        var _this3$hasMap_$get;\n        _this3.keysAtom_.reportChanged();\n        (_this3$hasMap_$get = _this3.hasMap_.get(key)) == null || _this3$hasMap_$get.setNewValue_(false);\n        var observable = _this3.data_.get(key);\n        observable.setNewValue_(undefined);\n        _this3.data_[\"delete\"](key);\n      });\n      if (notify) {\n        notifyListeners(this, _change);\n      }\n      if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n        spyReportEnd();\n      }\n      return true;\n    }\n    return false;\n  };\n  _proto.updateValue_ = function updateValue_(key, newValue) {\n    var observable = this.data_.get(key);\n    newValue = observable.prepareNewValue_(newValue);\n    if (newValue !== globalState.UNCHANGED) {\n      var notifySpy = isSpyEnabled();\n      var notify = hasListeners(this);\n      var change = notify || notifySpy ? {\n        observableKind: \"map\",\n        debugObjectName: this.name_,\n        type: UPDATE,\n        object: this,\n        oldValue: observable.value_,\n        name: key,\n        newValue: newValue\n      } : null;\n      if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n        spyReportStart(change);\n      } // TODO fix type\n      observable.setNewValue_(newValue);\n      if (notify) {\n        notifyListeners(this, change);\n      }\n      if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n        spyReportEnd();\n      }\n    }\n  };\n  _proto.addValue_ = function addValue_(key, newValue) {\n    var _this4 = this;\n    checkIfStateModificationsAreAllowed(this.keysAtom_);\n    transaction(function () {\n      var _this4$hasMap_$get;\n      var observable = new ObservableValue(newValue, _this4.enhancer_, process.env.NODE_ENV !== \"production\" ? _this4.name_ + \".\" + stringifyKey(key) : \"ObservableMap.key\", false);\n      _this4.data_.set(key, observable);\n      newValue = observable.value_; // value might have been changed\n      (_this4$hasMap_$get = _this4.hasMap_.get(key)) == null || _this4$hasMap_$get.setNewValue_(true);\n      _this4.keysAtom_.reportChanged();\n    });\n    var notifySpy = isSpyEnabled();\n    var notify = hasListeners(this);\n    var change = notify || notifySpy ? {\n      observableKind: \"map\",\n      debugObjectName: this.name_,\n      type: ADD,\n      object: this,\n      name: key,\n      newValue: newValue\n    } : null;\n    if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n      spyReportStart(change);\n    } // TODO fix type\n    if (notify) {\n      notifyListeners(this, change);\n    }\n    if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n      spyReportEnd();\n    }\n  };\n  _proto.get = function get(key) {\n    if (this.has(key)) {\n      return this.dehanceValue_(this.data_.get(key).get());\n    }\n    return this.dehanceValue_(undefined);\n  };\n  _proto.dehanceValue_ = function dehanceValue_(value) {\n    if (this.dehancer !== undefined) {\n      return this.dehancer(value);\n    }\n    return value;\n  };\n  _proto.keys = function keys() {\n    this.keysAtom_.reportObserved();\n    return this.data_.keys();\n  };\n  _proto.values = function values() {\n    var self = this;\n    var keys = this.keys();\n    return makeIterable({\n      next: function next() {\n        var _keys$next = keys.next(),\n          done = _keys$next.done,\n          value = _keys$next.value;\n        return {\n          done: done,\n          value: done ? undefined : self.get(value)\n        };\n      }\n    });\n  };\n  _proto.entries = function entries() {\n    var self = this;\n    var keys = this.keys();\n    return makeIterable({\n      next: function next() {\n        var _keys$next2 = keys.next(),\n          done = _keys$next2.done,\n          value = _keys$next2.value;\n        return {\n          done: done,\n          value: done ? undefined : [value, self.get(value)]\n        };\n      }\n    });\n  };\n  _proto[Symbol.iterator] = function () {\n    return this.entries();\n  };\n  _proto.forEach = function forEach(callback, thisArg) {\n    for (var _iterator = _createForOfIteratorHelperLoose(this), _step; !(_step = _iterator()).done;) {\n      var _step$value = _step.value,\n        key = _step$value[0],\n        value = _step$value[1];\n      callback.call(thisArg, value, key, this);\n    }\n  }\n  /** Merge another object into this object, returns this. */;\n  _proto.merge = function merge(other) {\n    var _this5 = this;\n    if (isObservableMap(other)) {\n      other = new Map(other);\n    }\n    transaction(function () {\n      if (isPlainObject(other)) {\n        getPlainObjectKeys(other).forEach(function (key) {\n          return _this5.set(key, other[key]);\n        });\n      } else if (Array.isArray(other)) {\n        other.forEach(function (_ref) {\n          var key = _ref[0],\n            value = _ref[1];\n          return _this5.set(key, value);\n        });\n      } else if (isES6Map(other)) {\n        if (!isPlainES6Map(other)) {\n          die(19, other);\n        }\n        other.forEach(function (value, key) {\n          return _this5.set(key, value);\n        });\n      } else if (other !== null && other !== undefined) {\n        die(20, other);\n      }\n    });\n    return this;\n  };\n  _proto.clear = function clear() {\n    var _this6 = this;\n    transaction(function () {\n      untracked(function () {\n        for (var _iterator2 = _createForOfIteratorHelperLoose(_this6.keys()), _step2; !(_step2 = _iterator2()).done;) {\n          var key = _step2.value;\n          _this6[\"delete\"](key);\n        }\n      });\n    });\n  };\n  _proto.replace = function replace(values) {\n    var _this7 = this;\n    // Implementation requirements:\n    // - respect ordering of replacement map\n    // - allow interceptors to run and potentially prevent individual operations\n    // - don't recreate observables that already exist in original map (so we don't destroy existing subscriptions)\n    // - don't _keysAtom.reportChanged if the keys of resulting map are indentical (order matters!)\n    // - note that result map may differ from replacement map due to the interceptors\n    transaction(function () {\n      // Convert to map so we can do quick key lookups\n      var replacementMap = convertToMap(values);\n      var orderedData = new Map();\n      // Used for optimization\n      var keysReportChangedCalled = false;\n      // Delete keys that don't exist in replacement map\n      // if the key deletion is prevented by interceptor\n      // add entry at the beginning of the result map\n      for (var _iterator3 = _createForOfIteratorHelperLoose(_this7.data_.keys()), _step3; !(_step3 = _iterator3()).done;) {\n        var key = _step3.value;\n        // Concurrently iterating/deleting keys\n        // iterator should handle this correctly\n        if (!replacementMap.has(key)) {\n          var deleted = _this7[\"delete\"](key);\n          // Was the key removed?\n          if (deleted) {\n            // _keysAtom.reportChanged() was already called\n            keysReportChangedCalled = true;\n          } else {\n            // Delete prevented by interceptor\n            var value = _this7.data_.get(key);\n            orderedData.set(key, value);\n          }\n        }\n      }\n      // Merge entries\n      for (var _iterator4 = _createForOfIteratorHelperLoose(replacementMap.entries()), _step4; !(_step4 = _iterator4()).done;) {\n        var _step4$value = _step4.value,\n          _key = _step4$value[0],\n          _value = _step4$value[1];\n        // We will want to know whether a new key is added\n        var keyExisted = _this7.data_.has(_key);\n        // Add or update value\n        _this7.set(_key, _value);\n        // The addition could have been prevent by interceptor\n        if (_this7.data_.has(_key)) {\n          // The update could have been prevented by interceptor\n          // and also we want to preserve existing values\n          // so use value from _data map (instead of replacement map)\n          var _value2 = _this7.data_.get(_key);\n          orderedData.set(_key, _value2);\n          // Was a new key added?\n          if (!keyExisted) {\n            // _keysAtom.reportChanged() was already called\n            keysReportChangedCalled = true;\n          }\n        }\n      }\n      // Check for possible key order change\n      if (!keysReportChangedCalled) {\n        if (_this7.data_.size !== orderedData.size) {\n          // If size differs, keys are definitely modified\n          _this7.keysAtom_.reportChanged();\n        } else {\n          var iter1 = _this7.data_.keys();\n          var iter2 = orderedData.keys();\n          var next1 = iter1.next();\n          var next2 = iter2.next();\n          while (!next1.done) {\n            if (next1.value !== next2.value) {\n              _this7.keysAtom_.reportChanged();\n              break;\n            }\n            next1 = iter1.next();\n            next2 = iter2.next();\n          }\n        }\n      }\n      // Use correctly ordered map\n      _this7.data_ = orderedData;\n    });\n    return this;\n  };\n  _proto.toString = function toString() {\n    return \"[object ObservableMap]\";\n  };\n  _proto.toJSON = function toJSON() {\n    return Array.from(this);\n  };\n  /**\n   * Observes this object. Triggers for the events 'add', 'update' and 'delete'.\n   * See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/observe\n   * for callback details\n   */\n  _proto.observe_ = function observe_(listener, fireImmediately) {\n    if (process.env.NODE_ENV !== \"production\" && fireImmediately === true) {\n      die(\"`observe` doesn't support fireImmediately=true in combination with maps.\");\n    }\n    return registerListener(this, listener);\n  };\n  _proto.intercept_ = function intercept_(handler) {\n    return registerInterceptor(this, handler);\n  };\n  return _createClass(ObservableMap, [{\n    key: \"size\",\n    get: function get() {\n      this.keysAtom_.reportObserved();\n      return this.data_.size;\n    }\n  }, {\n    key: Symbol.toStringTag,\n    get: function get() {\n      return \"Map\";\n    }\n  }]);\n}();\n// eslint-disable-next-line\nvar isObservableMap = /*#__PURE__*/createInstanceofPredicate(\"ObservableMap\", ObservableMap);\nfunction convertToMap(dataStructure) {\n  if (isES6Map(dataStructure) || isObservableMap(dataStructure)) {\n    return dataStructure;\n  } else if (Array.isArray(dataStructure)) {\n    return new Map(dataStructure);\n  } else if (isPlainObject(dataStructure)) {\n    var map = new Map();\n    for (var key in dataStructure) {\n      map.set(key, dataStructure[key]);\n    }\n    return map;\n  } else {\n    return die(21, dataStructure);\n  }\n}\n\nvar ObservableSetMarker = {};\nvar ObservableSet = /*#__PURE__*/function () {\n  function ObservableSet(initialData, enhancer, name_) {\n    var _this = this;\n    if (enhancer === void 0) {\n      enhancer = deepEnhancer;\n    }\n    if (name_ === void 0) {\n      name_ = process.env.NODE_ENV !== \"production\" ? \"ObservableSet@\" + getNextId() : \"ObservableSet\";\n    }\n    this.name_ = void 0;\n    this[$mobx] = ObservableSetMarker;\n    this.data_ = new Set();\n    this.atom_ = void 0;\n    this.changeListeners_ = void 0;\n    this.interceptors_ = void 0;\n    this.dehancer = void 0;\n    this.enhancer_ = void 0;\n    this.name_ = name_;\n    if (!isFunction(Set)) {\n      die(22);\n    }\n    this.enhancer_ = function (newV, oldV) {\n      return enhancer(newV, oldV, name_);\n    };\n    initObservable(function () {\n      _this.atom_ = createAtom(_this.name_);\n      if (initialData) {\n        _this.replace(initialData);\n      }\n    });\n  }\n  var _proto = ObservableSet.prototype;\n  _proto.dehanceValue_ = function dehanceValue_(value) {\n    if (this.dehancer !== undefined) {\n      return this.dehancer(value);\n    }\n    return value;\n  };\n  _proto.clear = function clear() {\n    var _this2 = this;\n    transaction(function () {\n      untracked(function () {\n        for (var _iterator = _createForOfIteratorHelperLoose(_this2.data_.values()), _step; !(_step = _iterator()).done;) {\n          var value = _step.value;\n          _this2[\"delete\"](value);\n        }\n      });\n    });\n  };\n  _proto.forEach = function forEach(callbackFn, thisArg) {\n    for (var _iterator2 = _createForOfIteratorHelperLoose(this), _step2; !(_step2 = _iterator2()).done;) {\n      var value = _step2.value;\n      callbackFn.call(thisArg, value, value, this);\n    }\n  };\n  _proto.add = function add(value) {\n    var _this3 = this;\n    checkIfStateModificationsAreAllowed(this.atom_);\n    if (hasInterceptors(this)) {\n      var change = interceptChange(this, {\n        type: ADD,\n        object: this,\n        newValue: value\n      });\n      if (!change) {\n        return this;\n      }\n      // ideally, value = change.value would be done here, so that values can be\n      // changed by interceptor. Same applies for other Set and Map api's.\n    }\n    if (!this.has(value)) {\n      transaction(function () {\n        _this3.data_.add(_this3.enhancer_(value, undefined));\n        _this3.atom_.reportChanged();\n      });\n      var notifySpy = process.env.NODE_ENV !== \"production\" && isSpyEnabled();\n      var notify = hasListeners(this);\n      var _change = notify || notifySpy ? {\n        observableKind: \"set\",\n        debugObjectName: this.name_,\n        type: ADD,\n        object: this,\n        newValue: value\n      } : null;\n      if (notifySpy && process.env.NODE_ENV !== \"production\") {\n        spyReportStart(_change);\n      }\n      if (notify) {\n        notifyListeners(this, _change);\n      }\n      if (notifySpy && process.env.NODE_ENV !== \"production\") {\n        spyReportEnd();\n      }\n    }\n    return this;\n  };\n  _proto[\"delete\"] = function _delete(value) {\n    var _this4 = this;\n    if (hasInterceptors(this)) {\n      var change = interceptChange(this, {\n        type: DELETE,\n        object: this,\n        oldValue: value\n      });\n      if (!change) {\n        return false;\n      }\n    }\n    if (this.has(value)) {\n      var notifySpy = process.env.NODE_ENV !== \"production\" && isSpyEnabled();\n      var notify = hasListeners(this);\n      var _change2 = notify || notifySpy ? {\n        observableKind: \"set\",\n        debugObjectName: this.name_,\n        type: DELETE,\n        object: this,\n        oldValue: value\n      } : null;\n      if (notifySpy && process.env.NODE_ENV !== \"production\") {\n        spyReportStart(_change2);\n      }\n      transaction(function () {\n        _this4.atom_.reportChanged();\n        _this4.data_[\"delete\"](value);\n      });\n      if (notify) {\n        notifyListeners(this, _change2);\n      }\n      if (notifySpy && process.env.NODE_ENV !== \"production\") {\n        spyReportEnd();\n      }\n      return true;\n    }\n    return false;\n  };\n  _proto.has = function has(value) {\n    this.atom_.reportObserved();\n    return this.data_.has(this.dehanceValue_(value));\n  };\n  _proto.entries = function entries() {\n    var nextIndex = 0;\n    var keys = Array.from(this.keys());\n    var values = Array.from(this.values());\n    return makeIterable({\n      next: function next() {\n        var index = nextIndex;\n        nextIndex += 1;\n        return index < values.length ? {\n          value: [keys[index], values[index]],\n          done: false\n        } : {\n          done: true\n        };\n      }\n    });\n  };\n  _proto.keys = function keys() {\n    return this.values();\n  };\n  _proto.values = function values() {\n    this.atom_.reportObserved();\n    var self = this;\n    var nextIndex = 0;\n    var observableValues = Array.from(this.data_.values());\n    return makeIterable({\n      next: function next() {\n        return nextIndex < observableValues.length ? {\n          value: self.dehanceValue_(observableValues[nextIndex++]),\n          done: false\n        } : {\n          done: true\n        };\n      }\n    });\n  };\n  _proto.intersection = function intersection(otherSet) {\n    if (isES6Set(otherSet)) {\n      return otherSet.intersection(this);\n    } else {\n      var dehancedSet = new Set(this);\n      return dehancedSet.intersection(otherSet);\n    }\n  };\n  _proto.union = function union(otherSet) {\n    if (isES6Set(otherSet)) {\n      return otherSet.union(this);\n    } else {\n      var dehancedSet = new Set(this);\n      return dehancedSet.union(otherSet);\n    }\n  };\n  _proto.difference = function difference(otherSet) {\n    return new Set(this).difference(otherSet);\n  };\n  _proto.symmetricDifference = function symmetricDifference(otherSet) {\n    if (isES6Set(otherSet)) {\n      return otherSet.symmetricDifference(this);\n    } else {\n      var dehancedSet = new Set(this);\n      return dehancedSet.symmetricDifference(otherSet);\n    }\n  };\n  _proto.isSubsetOf = function isSubsetOf(otherSet) {\n    return new Set(this).isSubsetOf(otherSet);\n  };\n  _proto.isSupersetOf = function isSupersetOf(otherSet) {\n    return new Set(this).isSupersetOf(otherSet);\n  };\n  _proto.isDisjointFrom = function isDisjointFrom(otherSet) {\n    if (isES6Set(otherSet)) {\n      return otherSet.isDisjointFrom(this);\n    } else {\n      var dehancedSet = new Set(this);\n      return dehancedSet.isDisjointFrom(otherSet);\n    }\n  };\n  _proto.replace = function replace(other) {\n    var _this5 = this;\n    if (isObservableSet(other)) {\n      other = new Set(other);\n    }\n    transaction(function () {\n      if (Array.isArray(other)) {\n        _this5.clear();\n        other.forEach(function (value) {\n          return _this5.add(value);\n        });\n      } else if (isES6Set(other)) {\n        _this5.clear();\n        other.forEach(function (value) {\n          return _this5.add(value);\n        });\n      } else if (other !== null && other !== undefined) {\n        die(\"Cannot initialize set from \" + other);\n      }\n    });\n    return this;\n  };\n  _proto.observe_ = function observe_(listener, fireImmediately) {\n    // ... 'fireImmediately' could also be true?\n    if (process.env.NODE_ENV !== \"production\" && fireImmediately === true) {\n      die(\"`observe` doesn't support fireImmediately=true in combination with sets.\");\n    }\n    return registerListener(this, listener);\n  };\n  _proto.intercept_ = function intercept_(handler) {\n    return registerInterceptor(this, handler);\n  };\n  _proto.toJSON = function toJSON() {\n    return Array.from(this);\n  };\n  _proto.toString = function toString() {\n    return \"[object ObservableSet]\";\n  };\n  _proto[Symbol.iterator] = function () {\n    return this.values();\n  };\n  return _createClass(ObservableSet, [{\n    key: \"size\",\n    get: function get() {\n      this.atom_.reportObserved();\n      return this.data_.size;\n    }\n  }, {\n    key: Symbol.toStringTag,\n    get: function get() {\n      return \"Set\";\n    }\n  }]);\n}();\n// eslint-disable-next-line\nvar isObservableSet = /*#__PURE__*/createInstanceofPredicate(\"ObservableSet\", ObservableSet);\n\nvar descriptorCache = /*#__PURE__*/Object.create(null);\nvar REMOVE = \"remove\";\nvar ObservableObjectAdministration = /*#__PURE__*/function () {\n  function ObservableObjectAdministration(target_, values_, name_,\n  // Used anytime annotation is not explicitely provided\n  defaultAnnotation_) {\n    if (values_ === void 0) {\n      values_ = new Map();\n    }\n    if (defaultAnnotation_ === void 0) {\n      defaultAnnotation_ = autoAnnotation;\n    }\n    this.target_ = void 0;\n    this.values_ = void 0;\n    this.name_ = void 0;\n    this.defaultAnnotation_ = void 0;\n    this.keysAtom_ = void 0;\n    this.changeListeners_ = void 0;\n    this.interceptors_ = void 0;\n    this.proxy_ = void 0;\n    this.isPlainObject_ = void 0;\n    this.appliedAnnotations_ = void 0;\n    this.pendingKeys_ = void 0;\n    this.target_ = target_;\n    this.values_ = values_;\n    this.name_ = name_;\n    this.defaultAnnotation_ = defaultAnnotation_;\n    this.keysAtom_ = new Atom(process.env.NODE_ENV !== \"production\" ? this.name_ + \".keys\" : \"ObservableObject.keys\");\n    // Optimization: we use this frequently\n    this.isPlainObject_ = isPlainObject(this.target_);\n    if (process.env.NODE_ENV !== \"production\" && !isAnnotation(this.defaultAnnotation_)) {\n      die(\"defaultAnnotation must be valid annotation\");\n    }\n    if (process.env.NODE_ENV !== \"production\") {\n      // Prepare structure for tracking which fields were already annotated\n      this.appliedAnnotations_ = {};\n    }\n  }\n  var _proto = ObservableObjectAdministration.prototype;\n  _proto.getObservablePropValue_ = function getObservablePropValue_(key) {\n    return this.values_.get(key).get();\n  };\n  _proto.setObservablePropValue_ = function setObservablePropValue_(key, newValue) {\n    var observable = this.values_.get(key);\n    if (observable instanceof ComputedValue) {\n      observable.set(newValue);\n      return true;\n    }\n    // intercept\n    if (hasInterceptors(this)) {\n      var change = interceptChange(this, {\n        type: UPDATE,\n        object: this.proxy_ || this.target_,\n        name: key,\n        newValue: newValue\n      });\n      if (!change) {\n        return null;\n      }\n      newValue = change.newValue;\n    }\n    newValue = observable.prepareNewValue_(newValue);\n    // notify spy & observers\n    if (newValue !== globalState.UNCHANGED) {\n      var notify = hasListeners(this);\n      var notifySpy = process.env.NODE_ENV !== \"production\" && isSpyEnabled();\n      var _change = notify || notifySpy ? {\n        type: UPDATE,\n        observableKind: \"object\",\n        debugObjectName: this.name_,\n        object: this.proxy_ || this.target_,\n        oldValue: observable.value_,\n        name: key,\n        newValue: newValue\n      } : null;\n      if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n        spyReportStart(_change);\n      }\n      observable.setNewValue_(newValue);\n      if (notify) {\n        notifyListeners(this, _change);\n      }\n      if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n        spyReportEnd();\n      }\n    }\n    return true;\n  };\n  _proto.get_ = function get_(key) {\n    if (globalState.trackingDerivation && !hasProp(this.target_, key)) {\n      // Key doesn't exist yet, subscribe for it in case it's added later\n      this.has_(key);\n    }\n    return this.target_[key];\n  }\n  /**\n   * @param {PropertyKey} key\n   * @param {any} value\n   * @param {Annotation|boolean} annotation true - use default annotation, false - copy as is\n   * @param {boolean} proxyTrap whether it's called from proxy trap\n   * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\n   */;\n  _proto.set_ = function set_(key, value, proxyTrap) {\n    if (proxyTrap === void 0) {\n      proxyTrap = false;\n    }\n    // Don't use .has(key) - we care about own\n    if (hasProp(this.target_, key)) {\n      // Existing prop\n      if (this.values_.has(key)) {\n        // Observable (can be intercepted)\n        return this.setObservablePropValue_(key, value);\n      } else if (proxyTrap) {\n        // Non-observable - proxy\n        return Reflect.set(this.target_, key, value);\n      } else {\n        // Non-observable\n        this.target_[key] = value;\n        return true;\n      }\n    } else {\n      // New prop\n      return this.extend_(key, {\n        value: value,\n        enumerable: true,\n        writable: true,\n        configurable: true\n      }, this.defaultAnnotation_, proxyTrap);\n    }\n  }\n  // Trap for \"in\"\n  ;\n  _proto.has_ = function has_(key) {\n    if (!globalState.trackingDerivation) {\n      // Skip key subscription outside derivation\n      return key in this.target_;\n    }\n    this.pendingKeys_ || (this.pendingKeys_ = new Map());\n    var entry = this.pendingKeys_.get(key);\n    if (!entry) {\n      entry = new ObservableValue(key in this.target_, referenceEnhancer, process.env.NODE_ENV !== \"production\" ? this.name_ + \".\" + stringifyKey(key) + \"?\" : \"ObservableObject.key?\", false);\n      this.pendingKeys_.set(key, entry);\n    }\n    return entry.get();\n  }\n  /**\n   * @param {PropertyKey} key\n   * @param {Annotation|boolean} annotation true - use default annotation, false - ignore prop\n   */;\n  _proto.make_ = function make_(key, annotation) {\n    if (annotation === true) {\n      annotation = this.defaultAnnotation_;\n    }\n    if (annotation === false) {\n      return;\n    }\n    assertAnnotable(this, annotation, key);\n    if (!(key in this.target_)) {\n      var _this$target_$storedA;\n      // Throw on missing key, except for decorators:\n      // Decorator annotations are collected from whole prototype chain.\n      // When called from super() some props may not exist yet.\n      // However we don't have to worry about missing prop,\n      // because the decorator must have been applied to something.\n      if ((_this$target_$storedA = this.target_[storedAnnotationsSymbol]) != null && _this$target_$storedA[key]) {\n        return; // will be annotated by subclass constructor\n      } else {\n        die(1, annotation.annotationType_, this.name_ + \".\" + key.toString());\n      }\n    }\n    var source = this.target_;\n    while (source && source !== objectPrototype) {\n      var descriptor = getDescriptor(source, key);\n      if (descriptor) {\n        var outcome = annotation.make_(this, key, descriptor, source);\n        if (outcome === 0 /* MakeResult.Cancel */) {\n          return;\n        }\n        if (outcome === 1 /* MakeResult.Break */) {\n          break;\n        }\n      }\n      source = Object.getPrototypeOf(source);\n    }\n    recordAnnotationApplied(this, annotation, key);\n  }\n  /**\n   * @param {PropertyKey} key\n   * @param {PropertyDescriptor} descriptor\n   * @param {Annotation|boolean} annotation true - use default annotation, false - copy as is\n   * @param {boolean} proxyTrap whether it's called from proxy trap\n   * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\n   */;\n  _proto.extend_ = function extend_(key, descriptor, annotation, proxyTrap) {\n    if (proxyTrap === void 0) {\n      proxyTrap = false;\n    }\n    if (annotation === true) {\n      annotation = this.defaultAnnotation_;\n    }\n    if (annotation === false) {\n      return this.defineProperty_(key, descriptor, proxyTrap);\n    }\n    assertAnnotable(this, annotation, key);\n    var outcome = annotation.extend_(this, key, descriptor, proxyTrap);\n    if (outcome) {\n      recordAnnotationApplied(this, annotation, key);\n    }\n    return outcome;\n  }\n  /**\n   * @param {PropertyKey} key\n   * @param {PropertyDescriptor} descriptor\n   * @param {boolean} proxyTrap whether it's called from proxy trap\n   * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\n   */;\n  _proto.defineProperty_ = function defineProperty_(key, descriptor, proxyTrap) {\n    if (proxyTrap === void 0) {\n      proxyTrap = false;\n    }\n    checkIfStateModificationsAreAllowed(this.keysAtom_);\n    try {\n      startBatch();\n      // Delete\n      var deleteOutcome = this.delete_(key);\n      if (!deleteOutcome) {\n        // Failure or intercepted\n        return deleteOutcome;\n      }\n      // ADD interceptor\n      if (hasInterceptors(this)) {\n        var change = interceptChange(this, {\n          object: this.proxy_ || this.target_,\n          name: key,\n          type: ADD,\n          newValue: descriptor.value\n        });\n        if (!change) {\n          return null;\n        }\n        var newValue = change.newValue;\n        if (descriptor.value !== newValue) {\n          descriptor = _extends({}, descriptor, {\n            value: newValue\n          });\n        }\n      }\n      // Define\n      if (proxyTrap) {\n        if (!Reflect.defineProperty(this.target_, key, descriptor)) {\n          return false;\n        }\n      } else {\n        defineProperty(this.target_, key, descriptor);\n      }\n      // Notify\n      this.notifyPropertyAddition_(key, descriptor.value);\n    } finally {\n      endBatch();\n    }\n    return true;\n  }\n  // If original descriptor becomes relevant, move this to annotation directly\n  ;\n  _proto.defineObservableProperty_ = function defineObservableProperty_(key, value, enhancer, proxyTrap) {\n    if (proxyTrap === void 0) {\n      proxyTrap = false;\n    }\n    checkIfStateModificationsAreAllowed(this.keysAtom_);\n    try {\n      startBatch();\n      // Delete\n      var deleteOutcome = this.delete_(key);\n      if (!deleteOutcome) {\n        // Failure or intercepted\n        return deleteOutcome;\n      }\n      // ADD interceptor\n      if (hasInterceptors(this)) {\n        var change = interceptChange(this, {\n          object: this.proxy_ || this.target_,\n          name: key,\n          type: ADD,\n          newValue: value\n        });\n        if (!change) {\n          return null;\n        }\n        value = change.newValue;\n      }\n      var cachedDescriptor = getCachedObservablePropDescriptor(key);\n      var descriptor = {\n        configurable: globalState.safeDescriptors ? this.isPlainObject_ : true,\n        enumerable: true,\n        get: cachedDescriptor.get,\n        set: cachedDescriptor.set\n      };\n      // Define\n      if (proxyTrap) {\n        if (!Reflect.defineProperty(this.target_, key, descriptor)) {\n          return false;\n        }\n      } else {\n        defineProperty(this.target_, key, descriptor);\n      }\n      var observable = new ObservableValue(value, enhancer, process.env.NODE_ENV !== \"production\" ? this.name_ + \".\" + key.toString() : \"ObservableObject.key\", false);\n      this.values_.set(key, observable);\n      // Notify (value possibly changed by ObservableValue)\n      this.notifyPropertyAddition_(key, observable.value_);\n    } finally {\n      endBatch();\n    }\n    return true;\n  }\n  // If original descriptor becomes relevant, move this to annotation directly\n  ;\n  _proto.defineComputedProperty_ = function defineComputedProperty_(key, options, proxyTrap) {\n    if (proxyTrap === void 0) {\n      proxyTrap = false;\n    }\n    checkIfStateModificationsAreAllowed(this.keysAtom_);\n    try {\n      startBatch();\n      // Delete\n      var deleteOutcome = this.delete_(key);\n      if (!deleteOutcome) {\n        // Failure or intercepted\n        return deleteOutcome;\n      }\n      // ADD interceptor\n      if (hasInterceptors(this)) {\n        var change = interceptChange(this, {\n          object: this.proxy_ || this.target_,\n          name: key,\n          type: ADD,\n          newValue: undefined\n        });\n        if (!change) {\n          return null;\n        }\n      }\n      options.name || (options.name = process.env.NODE_ENV !== \"production\" ? this.name_ + \".\" + key.toString() : \"ObservableObject.key\");\n      options.context = this.proxy_ || this.target_;\n      var cachedDescriptor = getCachedObservablePropDescriptor(key);\n      var descriptor = {\n        configurable: globalState.safeDescriptors ? this.isPlainObject_ : true,\n        enumerable: false,\n        get: cachedDescriptor.get,\n        set: cachedDescriptor.set\n      };\n      // Define\n      if (proxyTrap) {\n        if (!Reflect.defineProperty(this.target_, key, descriptor)) {\n          return false;\n        }\n      } else {\n        defineProperty(this.target_, key, descriptor);\n      }\n      this.values_.set(key, new ComputedValue(options));\n      // Notify\n      this.notifyPropertyAddition_(key, undefined);\n    } finally {\n      endBatch();\n    }\n    return true;\n  }\n  /**\n   * @param {PropertyKey} key\n   * @param {PropertyDescriptor} descriptor\n   * @param {boolean} proxyTrap whether it's called from proxy trap\n   * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\n   */;\n  _proto.delete_ = function delete_(key, proxyTrap) {\n    if (proxyTrap === void 0) {\n      proxyTrap = false;\n    }\n    checkIfStateModificationsAreAllowed(this.keysAtom_);\n    // No such prop\n    if (!hasProp(this.target_, key)) {\n      return true;\n    }\n    // Intercept\n    if (hasInterceptors(this)) {\n      var change = interceptChange(this, {\n        object: this.proxy_ || this.target_,\n        name: key,\n        type: REMOVE\n      });\n      // Cancelled\n      if (!change) {\n        return null;\n      }\n    }\n    // Delete\n    try {\n      var _this$pendingKeys_;\n      startBatch();\n      var notify = hasListeners(this);\n      var notifySpy = process.env.NODE_ENV !== \"production\" && isSpyEnabled();\n      var observable = this.values_.get(key);\n      // Value needed for spies/listeners\n      var value = undefined;\n      // Optimization: don't pull the value unless we will need it\n      if (!observable && (notify || notifySpy)) {\n        var _getDescriptor;\n        value = (_getDescriptor = getDescriptor(this.target_, key)) == null ? void 0 : _getDescriptor.value;\n      }\n      // delete prop (do first, may fail)\n      if (proxyTrap) {\n        if (!Reflect.deleteProperty(this.target_, key)) {\n          return false;\n        }\n      } else {\n        delete this.target_[key];\n      }\n      // Allow re-annotating this field\n      if (process.env.NODE_ENV !== \"production\") {\n        delete this.appliedAnnotations_[key];\n      }\n      // Clear observable\n      if (observable) {\n        this.values_[\"delete\"](key);\n        // for computed, value is undefined\n        if (observable instanceof ObservableValue) {\n          value = observable.value_;\n        }\n        // Notify: autorun(() => obj[key]), see #1796\n        propagateChanged(observable);\n      }\n      // Notify \"keys/entries/values\" observers\n      this.keysAtom_.reportChanged();\n      // Notify \"has\" observers\n      // \"in\" as it may still exist in proto\n      (_this$pendingKeys_ = this.pendingKeys_) == null || (_this$pendingKeys_ = _this$pendingKeys_.get(key)) == null || _this$pendingKeys_.set(key in this.target_);\n      // Notify spies/listeners\n      if (notify || notifySpy) {\n        var _change2 = {\n          type: REMOVE,\n          observableKind: \"object\",\n          object: this.proxy_ || this.target_,\n          debugObjectName: this.name_,\n          oldValue: value,\n          name: key\n        };\n        if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n          spyReportStart(_change2);\n        }\n        if (notify) {\n          notifyListeners(this, _change2);\n        }\n        if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n          spyReportEnd();\n        }\n      }\n    } finally {\n      endBatch();\n    }\n    return true;\n  }\n  /**\n   * Observes this object. Triggers for the events 'add', 'update' and 'delete'.\n   * See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/observe\n   * for callback details\n   */;\n  _proto.observe_ = function observe_(callback, fireImmediately) {\n    if (process.env.NODE_ENV !== \"production\" && fireImmediately === true) {\n      die(\"`observe` doesn't support the fire immediately property for observable objects.\");\n    }\n    return registerListener(this, callback);\n  };\n  _proto.intercept_ = function intercept_(handler) {\n    return registerInterceptor(this, handler);\n  };\n  _proto.notifyPropertyAddition_ = function notifyPropertyAddition_(key, value) {\n    var _this$pendingKeys_2;\n    var notify = hasListeners(this);\n    var notifySpy = process.env.NODE_ENV !== \"production\" && isSpyEnabled();\n    if (notify || notifySpy) {\n      var change = notify || notifySpy ? {\n        type: ADD,\n        observableKind: \"object\",\n        debugObjectName: this.name_,\n        object: this.proxy_ || this.target_,\n        name: key,\n        newValue: value\n      } : null;\n      if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n        spyReportStart(change);\n      }\n      if (notify) {\n        notifyListeners(this, change);\n      }\n      if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n        spyReportEnd();\n      }\n    }\n    (_this$pendingKeys_2 = this.pendingKeys_) == null || (_this$pendingKeys_2 = _this$pendingKeys_2.get(key)) == null || _this$pendingKeys_2.set(true);\n    // Notify \"keys/entries/values\" observers\n    this.keysAtom_.reportChanged();\n  };\n  _proto.ownKeys_ = function ownKeys_() {\n    this.keysAtom_.reportObserved();\n    return ownKeys(this.target_);\n  };\n  _proto.keys_ = function keys_() {\n    // Returns enumerable && own, but unfortunately keysAtom will report on ANY key change.\n    // There is no way to distinguish between Object.keys(object) and Reflect.ownKeys(object) - both are handled by ownKeys trap.\n    // We can either over-report in Object.keys(object) or under-report in Reflect.ownKeys(object)\n    // We choose to over-report in Object.keys(object), because:\n    // - typically it's used with simple data objects\n    // - when symbolic/non-enumerable keys are relevant Reflect.ownKeys works as expected\n    this.keysAtom_.reportObserved();\n    return Object.keys(this.target_);\n  };\n  return ObservableObjectAdministration;\n}();\nfunction asObservableObject(target, options) {\n  var _options$name;\n  if (process.env.NODE_ENV !== \"production\" && options && isObservableObject(target)) {\n    die(\"Options can't be provided for already observable objects.\");\n  }\n  if (hasProp(target, $mobx)) {\n    if (process.env.NODE_ENV !== \"production\" && !(getAdministration(target) instanceof ObservableObjectAdministration)) {\n      die(\"Cannot convert '\" + getDebugName(target) + \"' into observable object:\" + \"\\nThe target is already observable of different type.\" + \"\\nExtending builtins is not supported.\");\n    }\n    return target;\n  }\n  if (process.env.NODE_ENV !== \"production\" && !Object.isExtensible(target)) {\n    die(\"Cannot make the designated object observable; it is not extensible\");\n  }\n  var name = (_options$name = options == null ? void 0 : options.name) != null ? _options$name : process.env.NODE_ENV !== \"production\" ? (isPlainObject(target) ? \"ObservableObject\" : target.constructor.name) + \"@\" + getNextId() : \"ObservableObject\";\n  var adm = new ObservableObjectAdministration(target, new Map(), String(name), getAnnotationFromOptions(options));\n  addHiddenProp(target, $mobx, adm);\n  return target;\n}\nvar isObservableObjectAdministration = /*#__PURE__*/createInstanceofPredicate(\"ObservableObjectAdministration\", ObservableObjectAdministration);\nfunction getCachedObservablePropDescriptor(key) {\n  return descriptorCache[key] || (descriptorCache[key] = {\n    get: function get() {\n      return this[$mobx].getObservablePropValue_(key);\n    },\n    set: function set(value) {\n      return this[$mobx].setObservablePropValue_(key, value);\n    }\n  });\n}\nfunction isObservableObject(thing) {\n  if (isObject(thing)) {\n    return isObservableObjectAdministration(thing[$mobx]);\n  }\n  return false;\n}\nfunction recordAnnotationApplied(adm, annotation, key) {\n  var _adm$target_$storedAn;\n  if (process.env.NODE_ENV !== \"production\") {\n    adm.appliedAnnotations_[key] = annotation;\n  }\n  // Remove applied decorator annotation so we don't try to apply it again in subclass constructor\n  (_adm$target_$storedAn = adm.target_[storedAnnotationsSymbol]) == null || delete _adm$target_$storedAn[key];\n}\nfunction assertAnnotable(adm, annotation, key) {\n  // Valid annotation\n  if (process.env.NODE_ENV !== \"production\" && !isAnnotation(annotation)) {\n    die(\"Cannot annotate '\" + adm.name_ + \".\" + key.toString() + \"': Invalid annotation.\");\n  }\n  /*\n  // Configurable, not sealed, not frozen\n  // Possibly not needed, just a little better error then the one thrown by engine.\n  // Cases where this would be useful the most (subclass field initializer) are not interceptable by this.\n  if (__DEV__) {\n      const configurable = getDescriptor(adm.target_, key)?.configurable\n      const frozen = Object.isFrozen(adm.target_)\n      const sealed = Object.isSealed(adm.target_)\n      if (!configurable || frozen || sealed) {\n          const fieldName = `${adm.name_}.${key.toString()}`\n          const requestedAnnotationType = annotation.annotationType_\n          let error = `Cannot apply '${requestedAnnotationType}' to '${fieldName}':`\n          if (frozen) {\n              error += `\\nObject is frozen.`\n          }\n          if (sealed) {\n              error += `\\nObject is sealed.`\n          }\n          if (!configurable) {\n              error += `\\nproperty is not configurable.`\n              // Mention only if caused by us to avoid confusion\n              if (hasProp(adm.appliedAnnotations!, key)) {\n                  error += `\\nTo prevent accidental re-definition of a field by a subclass, `\n                  error += `all annotated fields of non-plain objects (classes) are not configurable.`\n              }\n          }\n          die(error)\n      }\n  }\n  */\n  // Not annotated\n  if (process.env.NODE_ENV !== \"production\" && !isOverride(annotation) && hasProp(adm.appliedAnnotations_, key)) {\n    var fieldName = adm.name_ + \".\" + key.toString();\n    var currentAnnotationType = adm.appliedAnnotations_[key].annotationType_;\n    var requestedAnnotationType = annotation.annotationType_;\n    die(\"Cannot apply '\" + requestedAnnotationType + \"' to '\" + fieldName + \"':\" + (\"\\nThe field is already annotated with '\" + currentAnnotationType + \"'.\") + \"\\nRe-annotating fields is not allowed.\" + \"\\nUse 'override' annotation for methods overridden by subclass.\");\n  }\n}\n\n// Bug in safari 9.* (or iOS 9 safari mobile). See #364\nvar ENTRY_0 = /*#__PURE__*/createArrayEntryDescriptor(0);\nvar safariPrototypeSetterInheritanceBug = /*#__PURE__*/function () {\n  var v = false;\n  var p = {};\n  Object.defineProperty(p, \"0\", {\n    set: function set() {\n      v = true;\n    }\n  });\n  /*#__PURE__*/Object.create(p)[\"0\"] = 1;\n  return v === false;\n}();\n/**\n * This array buffer contains two lists of properties, so that all arrays\n * can recycle their property definitions, which significantly improves performance of creating\n * properties on the fly.\n */\nvar OBSERVABLE_ARRAY_BUFFER_SIZE = 0;\n// Typescript workaround to make sure ObservableArray extends Array\nvar StubArray = function StubArray() {};\nfunction inherit(ctor, proto) {\n  if (Object.setPrototypeOf) {\n    Object.setPrototypeOf(ctor.prototype, proto);\n  } else if (ctor.prototype.__proto__ !== undefined) {\n    ctor.prototype.__proto__ = proto;\n  } else {\n    ctor.prototype = proto;\n  }\n}\ninherit(StubArray, Array.prototype);\n// Weex proto freeze protection was here,\n// but it is unclear why the hack is need as MobX never changed the prototype\n// anyway, so removed it in V6\nvar LegacyObservableArray = /*#__PURE__*/function (_StubArray) {\n  function LegacyObservableArray(initialValues, enhancer, name, owned) {\n    var _this;\n    if (name === void 0) {\n      name = process.env.NODE_ENV !== \"production\" ? \"ObservableArray@\" + getNextId() : \"ObservableArray\";\n    }\n    if (owned === void 0) {\n      owned = false;\n    }\n    _this = _StubArray.call(this) || this;\n    initObservable(function () {\n      var adm = new ObservableArrayAdministration(name, enhancer, owned, true);\n      adm.proxy_ = _this;\n      addHiddenFinalProp(_this, $mobx, adm);\n      if (initialValues && initialValues.length) {\n        // @ts-ignore\n        _this.spliceWithArray(0, 0, initialValues);\n      }\n      if (safariPrototypeSetterInheritanceBug) {\n        // Seems that Safari won't use numeric prototype setter until any * numeric property is\n        // defined on the instance. After that it works fine, even if this property is deleted.\n        Object.defineProperty(_this, \"0\", ENTRY_0);\n      }\n    });\n    return _this;\n  }\n  _inheritsLoose(LegacyObservableArray, _StubArray);\n  var _proto = LegacyObservableArray.prototype;\n  _proto.concat = function concat() {\n    this[$mobx].atom_.reportObserved();\n    for (var _len = arguments.length, arrays = new Array(_len), _key = 0; _key < _len; _key++) {\n      arrays[_key] = arguments[_key];\n    }\n    return Array.prototype.concat.apply(this.slice(),\n    //@ts-ignore\n    arrays.map(function (a) {\n      return isObservableArray(a) ? a.slice() : a;\n    }));\n  };\n  _proto[Symbol.iterator] = function () {\n    var self = this;\n    var nextIndex = 0;\n    return makeIterable({\n      next: function next() {\n        return nextIndex < self.length ? {\n          value: self[nextIndex++],\n          done: false\n        } : {\n          done: true,\n          value: undefined\n        };\n      }\n    });\n  };\n  return _createClass(LegacyObservableArray, [{\n    key: \"length\",\n    get: function get() {\n      return this[$mobx].getArrayLength_();\n    },\n    set: function set(newLength) {\n      this[$mobx].setArrayLength_(newLength);\n    }\n  }, {\n    key: Symbol.toStringTag,\n    get: function get() {\n      return \"Array\";\n    }\n  }]);\n}(StubArray);\nObject.entries(arrayExtensions).forEach(function (_ref) {\n  var prop = _ref[0],\n    fn = _ref[1];\n  if (prop !== \"concat\") {\n    addHiddenProp(LegacyObservableArray.prototype, prop, fn);\n  }\n});\nfunction createArrayEntryDescriptor(index) {\n  return {\n    enumerable: false,\n    configurable: true,\n    get: function get() {\n      return this[$mobx].get_(index);\n    },\n    set: function set(value) {\n      this[$mobx].set_(index, value);\n    }\n  };\n}\nfunction createArrayBufferItem(index) {\n  defineProperty(LegacyObservableArray.prototype, \"\" + index, createArrayEntryDescriptor(index));\n}\nfunction reserveArrayBuffer(max) {\n  if (max > OBSERVABLE_ARRAY_BUFFER_SIZE) {\n    for (var index = OBSERVABLE_ARRAY_BUFFER_SIZE; index < max + 100; index++) {\n      createArrayBufferItem(index);\n    }\n    OBSERVABLE_ARRAY_BUFFER_SIZE = max;\n  }\n}\nreserveArrayBuffer(1000);\nfunction createLegacyArray(initialValues, enhancer, name) {\n  return new LegacyObservableArray(initialValues, enhancer, name);\n}\n\nfunction getAtom(thing, property) {\n  if (typeof thing === \"object\" && thing !== null) {\n    if (isObservableArray(thing)) {\n      if (property !== undefined) {\n        die(23);\n      }\n      return thing[$mobx].atom_;\n    }\n    if (isObservableSet(thing)) {\n      return thing.atom_;\n    }\n    if (isObservableMap(thing)) {\n      if (property === undefined) {\n        return thing.keysAtom_;\n      }\n      var observable = thing.data_.get(property) || thing.hasMap_.get(property);\n      if (!observable) {\n        die(25, property, getDebugName(thing));\n      }\n      return observable;\n    }\n    if (isObservableObject(thing)) {\n      if (!property) {\n        return die(26);\n      }\n      var _observable = thing[$mobx].values_.get(property);\n      if (!_observable) {\n        die(27, property, getDebugName(thing));\n      }\n      return _observable;\n    }\n    if (isAtom(thing) || isComputedValue(thing) || isReaction(thing)) {\n      return thing;\n    }\n  } else if (isFunction(thing)) {\n    if (isReaction(thing[$mobx])) {\n      // disposer function\n      return thing[$mobx];\n    }\n  }\n  die(28);\n}\nfunction getAdministration(thing, property) {\n  if (!thing) {\n    die(29);\n  }\n  if (property !== undefined) {\n    return getAdministration(getAtom(thing, property));\n  }\n  if (isAtom(thing) || isComputedValue(thing) || isReaction(thing)) {\n    return thing;\n  }\n  if (isObservableMap(thing) || isObservableSet(thing)) {\n    return thing;\n  }\n  if (thing[$mobx]) {\n    return thing[$mobx];\n  }\n  die(24, thing);\n}\nfunction getDebugName(thing, property) {\n  var named;\n  if (property !== undefined) {\n    named = getAtom(thing, property);\n  } else if (isAction(thing)) {\n    return thing.name;\n  } else if (isObservableObject(thing) || isObservableMap(thing) || isObservableSet(thing)) {\n    named = getAdministration(thing);\n  } else {\n    // valid for arrays as well\n    named = getAtom(thing);\n  }\n  return named.name_;\n}\n/**\n * Helper function for initializing observable structures, it applies:\n * 1. allowStateChanges so we don't violate enforceActions.\n * 2. untracked so we don't accidentaly subscribe to anything observable accessed during init in case the observable is created inside derivation.\n * 3. batch to avoid state version updates\n */\nfunction initObservable(cb) {\n  var derivation = untrackedStart();\n  var allowStateChanges = allowStateChangesStart(true);\n  startBatch();\n  try {\n    return cb();\n  } finally {\n    endBatch();\n    allowStateChangesEnd(allowStateChanges);\n    untrackedEnd(derivation);\n  }\n}\n\nvar toString = objectPrototype.toString;\nfunction deepEqual(a, b, depth) {\n  if (depth === void 0) {\n    depth = -1;\n  }\n  return eq(a, b, depth);\n}\n// Copied from https://github.com/jashkenas/underscore/blob/5c237a7c682fb68fd5378203f0bf22dce1624854/underscore.js#L1186-L1289\n// Internal recursive comparison function for `isEqual`.\nfunction eq(a, b, depth, aStack, bStack) {\n  // Identical objects are equal. `0 === -0`, but they aren't identical.\n  // See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal).\n  if (a === b) {\n    return a !== 0 || 1 / a === 1 / b;\n  }\n  // `null` or `undefined` only equal to itself (strict comparison).\n  if (a == null || b == null) {\n    return false;\n  }\n  // `NaN`s are equivalent, but non-reflexive.\n  if (a !== a) {\n    return b !== b;\n  }\n  // Exhaust primitive checks\n  var type = typeof a;\n  if (type !== \"function\" && type !== \"object\" && typeof b != \"object\") {\n    return false;\n  }\n  // Compare `[[Class]]` names.\n  var className = toString.call(a);\n  if (className !== toString.call(b)) {\n    return false;\n  }\n  switch (className) {\n    // Strings, numbers, regular expressions, dates, and booleans are compared by value.\n    case \"[object RegExp]\":\n    // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i')\n    case \"[object String]\":\n      // Primitives and their corresponding object wrappers are equivalent; thus, `\"5\"` is\n      // equivalent to `new String(\"5\")`.\n      return \"\" + a === \"\" + b;\n    case \"[object Number]\":\n      // `NaN`s are equivalent, but non-reflexive.\n      // Object(NaN) is equivalent to NaN.\n      if (+a !== +a) {\n        return +b !== +b;\n      }\n      // An `egal` comparison is performed for other numeric values.\n      return +a === 0 ? 1 / +a === 1 / b : +a === +b;\n    case \"[object Date]\":\n    case \"[object Boolean]\":\n      // Coerce dates and booleans to numeric primitive values. Dates are compared by their\n      // millisecond representations. Note that invalid dates with millisecond representations\n      // of `NaN` are not equivalent.\n      return +a === +b;\n    case \"[object Symbol]\":\n      return typeof Symbol !== \"undefined\" && Symbol.valueOf.call(a) === Symbol.valueOf.call(b);\n    case \"[object Map]\":\n    case \"[object Set]\":\n      // Maps and Sets are unwrapped to arrays of entry-pairs, adding an incidental level.\n      // Hide this extra level by increasing the depth.\n      if (depth >= 0) {\n        depth++;\n      }\n      break;\n  }\n  // Unwrap any wrapped objects.\n  a = unwrap(a);\n  b = unwrap(b);\n  var areArrays = className === \"[object Array]\";\n  if (!areArrays) {\n    if (typeof a != \"object\" || typeof b != \"object\") {\n      return false;\n    }\n    // Objects with different constructors are not equivalent, but `Object`s or `Array`s\n    // from different frames are.\n    var aCtor = a.constructor,\n      bCtor = b.constructor;\n    if (aCtor !== bCtor && !(isFunction(aCtor) && aCtor instanceof aCtor && isFunction(bCtor) && bCtor instanceof bCtor) && \"constructor\" in a && \"constructor\" in b) {\n      return false;\n    }\n  }\n  if (depth === 0) {\n    return false;\n  } else if (depth < 0) {\n    depth = -1;\n  }\n  // Assume equality for cyclic structures. The algorithm for detecting cyclic\n  // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.\n  // Initializing stack of traversed objects.\n  // It's done here since we only need them for objects and arrays comparison.\n  aStack = aStack || [];\n  bStack = bStack || [];\n  var length = aStack.length;\n  while (length--) {\n    // Linear search. Performance is inversely proportional to the number of\n    // unique nested structures.\n    if (aStack[length] === a) {\n      return bStack[length] === b;\n    }\n  }\n  // Add the first object to the stack of traversed objects.\n  aStack.push(a);\n  bStack.push(b);\n  // Recursively compare objects and arrays.\n  if (areArrays) {\n    // Compare array lengths to determine if a deep comparison is necessary.\n    length = a.length;\n    if (length !== b.length) {\n      return false;\n    }\n    // Deep compare the contents, ignoring non-numeric properties.\n    while (length--) {\n      if (!eq(a[length], b[length], depth - 1, aStack, bStack)) {\n        return false;\n      }\n    }\n  } else {\n    // Deep compare objects.\n    var keys = Object.keys(a);\n    var key;\n    length = keys.length;\n    // Ensure that both objects contain the same number of properties before comparing deep equality.\n    if (Object.keys(b).length !== length) {\n      return false;\n    }\n    while (length--) {\n      // Deep compare each member\n      key = keys[length];\n      if (!(hasProp(b, key) && eq(a[key], b[key], depth - 1, aStack, bStack))) {\n        return false;\n      }\n    }\n  }\n  // Remove the first object from the stack of traversed objects.\n  aStack.pop();\n  bStack.pop();\n  return true;\n}\nfunction unwrap(a) {\n  if (isObservableArray(a)) {\n    return a.slice();\n  }\n  if (isES6Map(a) || isObservableMap(a)) {\n    return Array.from(a.entries());\n  }\n  if (isES6Set(a) || isObservableSet(a)) {\n    return Array.from(a.entries());\n  }\n  return a;\n}\n\nfunction makeIterable(iterator) {\n  iterator[Symbol.iterator] = getSelf;\n  return iterator;\n}\nfunction getSelf() {\n  return this;\n}\n\nfunction isAnnotation(thing) {\n  return (\n    // Can be function\n    thing instanceof Object && typeof thing.annotationType_ === \"string\" && isFunction(thing.make_) && isFunction(thing.extend_)\n  );\n}\n\n/**\n * (c) Michel Weststrate 2015 - 2020\n * MIT Licensed\n *\n * Welcome to the mobx sources! To get a global overview of how MobX internally works,\n * this is a good place to start:\n * https://medium.com/@mweststrate/becoming-fully-reactive-an-in-depth-explanation-of-mobservable-55995262a254#.xvbh6qd74\n *\n * Source folders:\n * ===============\n *\n * - api/     Most of the public static methods exposed by the module can be found here.\n * - core/    Implementation of the MobX algorithm; atoms, derivations, reactions, dependency trees, optimizations. Cool stuff can be found here.\n * - types/   All the magic that is need to have observable objects, arrays and values is in this folder. Including the modifiers like `asFlat`.\n * - utils/   Utility stuff.\n *\n */\n[\"Symbol\", \"Map\", \"Set\"].forEach(function (m) {\n  var g = getGlobal();\n  if (typeof g[m] === \"undefined\") {\n    die(\"MobX requires global '\" + m + \"' to be available or polyfilled\");\n  }\n});\nif (typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__ === \"object\") {\n  // See: https://github.com/andykog/mobx-devtools/\n  __MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({\n    spy: spy,\n    extras: {\n      getDebugName: getDebugName\n    },\n    $mobx: $mobx\n  });\n}\n\nexport { $mobx, FlowCancellationError, ObservableMap, ObservableSet, Reaction, allowStateChanges as _allowStateChanges, runInAction as _allowStateChangesInsideComputed, allowStateReadsEnd as _allowStateReadsEnd, allowStateReadsStart as _allowStateReadsStart, autoAction as _autoAction, _endAction, getAdministration as _getAdministration, getGlobalState as _getGlobalState, interceptReads as _interceptReads, isComputingDerivation as _isComputingDerivation, resetGlobalState as _resetGlobalState, _startAction, action, autorun, comparer, computed, configure, createAtom, apiDefineProperty as defineProperty, entries, extendObservable, flow, flowResult, get, getAtom, getDebugName, getDependencyTree, getObserverTree, has, intercept, isAction, isObservableValue as isBoxedObservable, isComputed, isComputedProp, isFlow, isFlowCancellationError, isObservable, isObservableArray, isObservableMap, isObservableObject, isObservableProp, isObservableSet, keys, makeAutoObservable, makeObservable, observable, observe, onBecomeObserved, onBecomeUnobserved, onReactionError, override, apiOwnKeys as ownKeys, reaction, remove, runInAction, set, spy, toJS, trace, transaction, untracked, values, when };\n//# sourceMappingURL=mobx.esm.js.map\n","import {\n  AccountTypes,\n  NizzaProductDataSource,\n  NizzaProductDataSourceConfig,\n  NizzaProductRequestOriginTypes,\n  getNizza,\n} from '@nizza/core';\nimport { reaction, when } from 'mobx';\nimport baseLogger from '~logger';\nimport {\n  PlatformProductDataSource,\n  VtexProductDataSource,\n} from './data-sources';\n\nconst logger = baseLogger.child('productDataSourceFactory');\n\nfunction createDataSource(\n  config: NizzaProductDataSourceConfig,\n): NizzaProductDataSource {\n  const { account } = getNizza();\n  const { accountType } = account!;\n  const { origin } = config;\n\n  const isVtex = [\n    AccountTypes.VTEX,\n    AccountTypes.VTEX_CMS,\n    AccountTypes.VTEX_IO,\n  ].includes(accountType);\n\n  if (accountType === AccountTypes.PLATFORM) {\n    return new PlatformProductDataSource(config);\n  }\n\n  if (\n    [\n      NizzaProductRequestOriginTypes.GLOBAL_PAGE,\n      NizzaProductRequestOriginTypes.UNKNOWN,\n    ].includes(origin as NizzaProductRequestOriginTypes) &&\n    isVtex\n  ) {\n    return new VtexProductDataSource({ ...config, corsProxy: true });\n  }\n\n  return new VtexProductDataSource({ ...config });\n}\n\n/**\n * Synchronously creates a product data source. Assumes that `nizza.account`\n * is already defined.\n *\n * @param {NizzaProductDataSourceConfig} config - The configuration object for creating the data source.\n * @returns {NizzaProductDataSource} The created product data source.\n * @throws {Error} Throws an error if `nizza.account` is not defined.\n */\nexport function createProductDataSource(\n  config: NizzaProductDataSourceConfig,\n): NizzaProductDataSource {\n  const nizza = getNizza();\n  if (!nizza.account) throw new Error('Nizza account is not defined');\n  return createDataSource(config);\n}\n\n/**\n * Asynchronously creates a product data source. Waits until `nizza.account` is defined.\n * While waiting, it monitors `accountStatus` changes and logs an error if the status changes to 'error'.\n *\n * @param {NizzaProductDataSourceConfig} config - The configuration object for creating the data source.\n * @returns {Promise<NizzaProductDataSource>} A promise that resolves with the created product data source.\n */\nexport async function createProductDataSourceAsync(\n  config: NizzaProductDataSourceConfig,\n): Promise<NizzaProductDataSource> {\n  const nizza = getNizza();\n\n  // Monitor accountStatus changes and log error if it becomes 'error'\n  const disposer = reaction(\n    () => nizza.accountStatus,\n    status => {\n      if (status === 'error') {\n        logger.error(\n          `Account status changed to 'error' and product data source could not be created`,\n        );\n      }\n    },\n  );\n\n  await when(() => !!nizza.account);\n  // Dispose the reaction once the account is defined\n  disposer();\n\n  return createDataSource(config);\n}\n","import {\n  ComponentProps,\n  ComponentType,\n  lazy,\n  ReactNode,\n  Suspense,\n} from 'react';\n\ninterface Opts {\n  fallback: ReactNode;\n}\n\ntype Unpromisify<T> = T extends Promise<infer P> ? P : never;\n\nexport const lazyLoad = <T extends Promise<any>, U extends ComponentType<any>>(\n  importFunc: () => T,\n  selectorFunc?: (s: Unpromisify<T>) => U,\n  opts: Opts = { fallback: null },\n) => {\n  let lazyFactory: () => Promise<{ default: U }> = importFunc;\n\n  if (selectorFunc) {\n    lazyFactory = () =>\n      importFunc().then(module => ({ default: selectorFunc(module) }));\n  }\n\n  const LazyComponent = lazy(lazyFactory);\n\n  return (props: ComponentProps<U>) => (\n    <Suspense fallback={opts.fallback!}>\n      <LazyComponent {...props} />\n    </Suspense>\n  );\n};\n","let keyCount = 0;\nfunction atom(read, write) {\n  const key = `atom${++keyCount}`;\n  const config = {\n    toString() {\n      return (import.meta.env ? import.meta.env.MODE : void 0) !== \"production\" && this.debugLabel ? key + \":\" + this.debugLabel : key;\n    }\n  };\n  if (typeof read === \"function\") {\n    config.read = read;\n  } else {\n    config.init = read;\n    config.read = defaultRead;\n    config.write = defaultWrite;\n  }\n  if (write) {\n    config.write = write;\n  }\n  return config;\n}\nfunction defaultRead(get) {\n  return get(this);\n}\nfunction defaultWrite(get, set, arg) {\n  return set(\n    this,\n    typeof arg === \"function\" ? arg(get(this)) : arg\n  );\n}\n\nconst isSelfAtom = (atom, a) => atom.unstable_is ? atom.unstable_is(a) : a === atom;\nconst hasInitialValue = (atom) => \"init\" in atom;\nconst isActuallyWritableAtom = (atom) => !!atom.write;\nconst cancelablePromiseMap = /* @__PURE__ */ new WeakMap();\nconst isPendingPromise = (value) => {\n  var _a;\n  return isPromiseLike(value) && !((_a = cancelablePromiseMap.get(value)) == null ? void 0 : _a[1]);\n};\nconst cancelPromise = (promise, nextValue) => {\n  const promiseState = cancelablePromiseMap.get(promise);\n  if (promiseState) {\n    promiseState[1] = true;\n    promiseState[0].forEach((fn) => fn(nextValue));\n  } else if ((import.meta.env ? import.meta.env.MODE : void 0) !== \"production\") {\n    throw new Error(\"[Bug] cancelable promise not found\");\n  }\n};\nconst patchPromiseForCancelability = (promise) => {\n  if (cancelablePromiseMap.has(promise)) {\n    return;\n  }\n  const promiseState = [/* @__PURE__ */ new Set(), false];\n  cancelablePromiseMap.set(promise, promiseState);\n  const settle = () => {\n    promiseState[1] = true;\n  };\n  promise.then(settle, settle);\n  promise.onCancel = (fn) => {\n    promiseState[0].add(fn);\n  };\n};\nconst isPromiseLike = (x) => typeof (x == null ? void 0 : x.then) === \"function\";\nconst isAtomStateInitialized = (atomState) => \"v\" in atomState || \"e\" in atomState;\nconst returnAtomValue = (atomState) => {\n  if (\"e\" in atomState) {\n    throw atomState.e;\n  }\n  if ((import.meta.env ? import.meta.env.MODE : void 0) !== \"production\" && !(\"v\" in atomState)) {\n    throw new Error(\"[Bug] atom state is not initialized\");\n  }\n  return atomState.v;\n};\nconst addPendingPromiseToDependency = (atom, promise, dependencyAtomState) => {\n  if (!dependencyAtomState.p.has(atom)) {\n    dependencyAtomState.p.add(atom);\n    promise.then(\n      () => {\n        dependencyAtomState.p.delete(atom);\n      },\n      () => {\n        dependencyAtomState.p.delete(atom);\n      }\n    );\n  }\n};\nconst addDependency = (pending, atom, atomState, a, aState) => {\n  var _a;\n  if ((import.meta.env ? import.meta.env.MODE : void 0) !== \"production\" && a === atom) {\n    throw new Error(\"[Bug] atom cannot depend on itself\");\n  }\n  atomState.d.set(a, aState.n);\n  if (isPendingPromise(atomState.v)) {\n    addPendingPromiseToDependency(atom, atomState.v, aState);\n  }\n  (_a = aState.m) == null ? void 0 : _a.t.add(atom);\n  if (pending) {\n    addPendingDependent(pending, a, atom);\n  }\n};\nconst createPending = () => [/* @__PURE__ */ new Map(), /* @__PURE__ */ new Map(), /* @__PURE__ */ new Set()];\nconst addPendingAtom = (pending, atom, atomState) => {\n  if (!pending[0].has(atom)) {\n    pending[0].set(atom, /* @__PURE__ */ new Set());\n  }\n  pending[1].set(atom, atomState);\n};\nconst addPendingDependent = (pending, atom, dependent) => {\n  const dependents = pending[0].get(atom);\n  if (dependents) {\n    dependents.add(dependent);\n  }\n};\nconst getPendingDependents = (pending, atom) => pending[0].get(atom);\nconst addPendingFunction = (pending, fn) => {\n  pending[2].add(fn);\n};\nconst flushPending = (pending) => {\n  while (pending[1].size || pending[2].size) {\n    pending[0].clear();\n    const atomStates = new Set(pending[1].values());\n    pending[1].clear();\n    const functions = new Set(pending[2]);\n    pending[2].clear();\n    atomStates.forEach((atomState) => {\n      var _a;\n      return (_a = atomState.m) == null ? void 0 : _a.l.forEach((l) => l());\n    });\n    functions.forEach((fn) => fn());\n  }\n};\nconst buildStore = (getAtomState) => {\n  let debugMountedAtoms;\n  if ((import.meta.env ? import.meta.env.MODE : void 0) !== \"production\") {\n    debugMountedAtoms = /* @__PURE__ */ new Set();\n  }\n  const setAtomStateValueOrPromise = (atom, atomState, valueOrPromise) => {\n    const hasPrevValue = \"v\" in atomState;\n    const prevValue = atomState.v;\n    const pendingPromise = isPendingPromise(atomState.v) ? atomState.v : null;\n    if (isPromiseLike(valueOrPromise)) {\n      patchPromiseForCancelability(valueOrPromise);\n      for (const a of atomState.d.keys()) {\n        addPendingPromiseToDependency(\n          atom,\n          valueOrPromise,\n          getAtomState(a, atomState)\n        );\n      }\n      atomState.v = valueOrPromise;\n      delete atomState.e;\n    } else {\n      atomState.v = valueOrPromise;\n      delete atomState.e;\n    }\n    if (!hasPrevValue || !Object.is(prevValue, atomState.v)) {\n      ++atomState.n;\n      if (pendingPromise) {\n        cancelPromise(pendingPromise, valueOrPromise);\n      }\n    }\n  };\n  const readAtomState = (pending, atom, atomState, force) => {\n    var _a;\n    if (!(force == null ? void 0 : force(atom)) && isAtomStateInitialized(atomState)) {\n      if (atomState.m) {\n        return atomState;\n      }\n      if (Array.from(atomState.d).every(\n        ([a, n]) => (\n          // Recursively, read the atom state of the dependency, and\n          // check if the atom epoch number is unchanged\n          readAtomState(pending, a, getAtomState(a, atomState), force).n === n\n        )\n      )) {\n        return atomState;\n      }\n    }\n    atomState.d.clear();\n    let isSync = true;\n    const getter = (a) => {\n      if (isSelfAtom(atom, a)) {\n        const aState2 = getAtomState(a, atomState);\n        if (!isAtomStateInitialized(aState2)) {\n          if (hasInitialValue(a)) {\n            setAtomStateValueOrPromise(a, aState2, a.init);\n          } else {\n            throw new Error(\"no atom init\");\n          }\n        }\n        return returnAtomValue(aState2);\n      }\n      const aState = readAtomState(\n        pending,\n        a,\n        getAtomState(a, atomState),\n        force\n      );\n      if (isSync) {\n        addDependency(pending, atom, atomState, a, aState);\n      } else {\n        const pending2 = createPending();\n        addDependency(pending2, atom, atomState, a, aState);\n        mountDependencies(pending2, atom, atomState);\n        flushPending(pending2);\n      }\n      return returnAtomValue(aState);\n    };\n    let controller;\n    let setSelf;\n    const options = {\n      get signal() {\n        if (!controller) {\n          controller = new AbortController();\n        }\n        return controller.signal;\n      },\n      get setSelf() {\n        if ((import.meta.env ? import.meta.env.MODE : void 0) !== \"production\" && !isActuallyWritableAtom(atom)) {\n          console.warn(\"setSelf function cannot be used with read-only atom\");\n        }\n        if (!setSelf && isActuallyWritableAtom(atom)) {\n          setSelf = (...args) => {\n            if ((import.meta.env ? import.meta.env.MODE : void 0) !== \"production\" && isSync) {\n              console.warn(\"setSelf function cannot be called in sync\");\n            }\n            if (!isSync) {\n              return writeAtom(atom, ...args);\n            }\n          };\n        }\n        return setSelf;\n      }\n    };\n    try {\n      const valueOrPromise = atom.read(getter, options);\n      setAtomStateValueOrPromise(atom, atomState, valueOrPromise);\n      if (isPromiseLike(valueOrPromise)) {\n        (_a = valueOrPromise.onCancel) == null ? void 0 : _a.call(valueOrPromise, () => controller == null ? void 0 : controller.abort());\n        const complete = () => {\n          if (atomState.m) {\n            const pending2 = createPending();\n            mountDependencies(pending2, atom, atomState);\n            flushPending(pending2);\n          }\n        };\n        valueOrPromise.then(complete, complete);\n      }\n      return atomState;\n    } catch (error) {\n      delete atomState.v;\n      atomState.e = error;\n      ++atomState.n;\n      return atomState;\n    } finally {\n      isSync = false;\n    }\n  };\n  const readAtom = (atom) => returnAtomValue(readAtomState(void 0, atom, getAtomState(atom)));\n  const getDependents = (pending, atom, atomState) => {\n    var _a, _b;\n    const dependents = /* @__PURE__ */ new Map();\n    for (const a of ((_a = atomState.m) == null ? void 0 : _a.t) || []) {\n      dependents.set(a, getAtomState(a, atomState));\n    }\n    for (const atomWithPendingPromise of atomState.p) {\n      dependents.set(\n        atomWithPendingPromise,\n        getAtomState(atomWithPendingPromise, atomState)\n      );\n    }\n    (_b = getPendingDependents(pending, atom)) == null ? void 0 : _b.forEach((dependent) => {\n      dependents.set(dependent, getAtomState(dependent, atomState));\n    });\n    return dependents;\n  };\n  const recomputeDependents = (pending, atom, atomState) => {\n    const topsortedAtoms = [];\n    const markedAtoms = /* @__PURE__ */ new Set();\n    const visit = (a, aState) => {\n      if (markedAtoms.has(a)) {\n        return;\n      }\n      markedAtoms.add(a);\n      for (const [d, s] of getDependents(pending, a, aState)) {\n        if (a !== d) {\n          visit(d, s);\n        }\n      }\n      topsortedAtoms.push([a, aState, aState.n]);\n    };\n    visit(atom, atomState);\n    const changedAtoms = /* @__PURE__ */ new Set([atom]);\n    const isMarked = (a) => markedAtoms.has(a);\n    for (let i = topsortedAtoms.length - 1; i >= 0; --i) {\n      const [a, aState, prevEpochNumber] = topsortedAtoms[i];\n      let hasChangedDeps = false;\n      for (const dep of aState.d.keys()) {\n        if (dep !== a && changedAtoms.has(dep)) {\n          hasChangedDeps = true;\n          break;\n        }\n      }\n      if (hasChangedDeps) {\n        readAtomState(pending, a, aState, isMarked);\n        mountDependencies(pending, a, aState);\n        if (prevEpochNumber !== aState.n) {\n          addPendingAtom(pending, a, aState);\n          changedAtoms.add(a);\n        }\n      }\n      markedAtoms.delete(a);\n    }\n  };\n  const writeAtomState = (pending, atom, atomState, ...args) => {\n    const getter = (a) => returnAtomValue(readAtomState(pending, a, getAtomState(a, atomState)));\n    const setter = (a, ...args2) => {\n      const aState = getAtomState(a, atomState);\n      let r;\n      if (isSelfAtom(atom, a)) {\n        if (!hasInitialValue(a)) {\n          throw new Error(\"atom not writable\");\n        }\n        const hasPrevValue = \"v\" in aState;\n        const prevValue = aState.v;\n        const v = args2[0];\n        setAtomStateValueOrPromise(a, aState, v);\n        mountDependencies(pending, a, aState);\n        if (!hasPrevValue || !Object.is(prevValue, aState.v)) {\n          addPendingAtom(pending, a, aState);\n          recomputeDependents(pending, a, aState);\n        }\n      } else {\n        r = writeAtomState(pending, a, aState, ...args2);\n      }\n      flushPending(pending);\n      return r;\n    };\n    const result = atom.write(getter, setter, ...args);\n    return result;\n  };\n  const writeAtom = (atom, ...args) => {\n    const pending = createPending();\n    const result = writeAtomState(pending, atom, getAtomState(atom), ...args);\n    flushPending(pending);\n    return result;\n  };\n  const mountDependencies = (pending, atom, atomState) => {\n    if (atomState.m && !isPendingPromise(atomState.v)) {\n      for (const a of atomState.d.keys()) {\n        if (!atomState.m.d.has(a)) {\n          const aMounted = mountAtom(pending, a, getAtomState(a, atomState));\n          aMounted.t.add(atom);\n          atomState.m.d.add(a);\n        }\n      }\n      for (const a of atomState.m.d || []) {\n        if (!atomState.d.has(a)) {\n          atomState.m.d.delete(a);\n          const aMounted = unmountAtom(pending, a, getAtomState(a, atomState));\n          aMounted == null ? void 0 : aMounted.t.delete(atom);\n        }\n      }\n    }\n  };\n  const mountAtom = (pending, atom, atomState) => {\n    if (!atomState.m) {\n      readAtomState(pending, atom, atomState);\n      for (const a of atomState.d.keys()) {\n        const aMounted = mountAtom(pending, a, getAtomState(a, atomState));\n        aMounted.t.add(atom);\n      }\n      atomState.m = {\n        l: /* @__PURE__ */ new Set(),\n        d: new Set(atomState.d.keys()),\n        t: /* @__PURE__ */ new Set()\n      };\n      if ((import.meta.env ? import.meta.env.MODE : void 0) !== \"production\") {\n        debugMountedAtoms.add(atom);\n      }\n      if (isActuallyWritableAtom(atom) && atom.onMount) {\n        const mounted = atomState.m;\n        const { onMount } = atom;\n        addPendingFunction(pending, () => {\n          const onUnmount = onMount(\n            (...args) => writeAtomState(pending, atom, atomState, ...args)\n          );\n          if (onUnmount) {\n            mounted.u = onUnmount;\n          }\n        });\n      }\n    }\n    return atomState.m;\n  };\n  const unmountAtom = (pending, atom, atomState) => {\n    if (atomState.m && !atomState.m.l.size && !Array.from(atomState.m.t).some(\n      (a) => {\n        var _a;\n        return (_a = getAtomState(a, atomState).m) == null ? void 0 : _a.d.has(atom);\n      }\n    )) {\n      const onUnmount = atomState.m.u;\n      if (onUnmount) {\n        addPendingFunction(pending, onUnmount);\n      }\n      delete atomState.m;\n      if ((import.meta.env ? import.meta.env.MODE : void 0) !== \"production\") {\n        debugMountedAtoms.delete(atom);\n      }\n      for (const a of atomState.d.keys()) {\n        const aMounted = unmountAtom(pending, a, getAtomState(a, atomState));\n        aMounted == null ? void 0 : aMounted.t.delete(atom);\n      }\n      return void 0;\n    }\n    return atomState.m;\n  };\n  const subscribeAtom = (atom, listener) => {\n    const pending = createPending();\n    const atomState = getAtomState(atom);\n    const mounted = mountAtom(pending, atom, atomState);\n    flushPending(pending);\n    const listeners = mounted.l;\n    listeners.add(listener);\n    return () => {\n      listeners.delete(listener);\n      const pending2 = createPending();\n      unmountAtom(pending2, atom, atomState);\n      flushPending(pending2);\n    };\n  };\n  const unstable_derive = (fn) => buildStore(...fn(getAtomState));\n  const store = {\n    get: readAtom,\n    set: writeAtom,\n    sub: subscribeAtom,\n    unstable_derive\n  };\n  if ((import.meta.env ? import.meta.env.MODE : void 0) !== \"production\") {\n    const devStore = {\n      // store dev methods (these are tentative and subject to change without notice)\n      dev4_get_internal_weak_map: () => ({\n        get: (atom) => {\n          const atomState = getAtomState(atom);\n          if (atomState.n === 0) {\n            return void 0;\n          }\n          return atomState;\n        }\n      }),\n      dev4_get_mounted_atoms: () => debugMountedAtoms,\n      dev4_restore_atoms: (values) => {\n        const pending = createPending();\n        for (const [atom, value] of values) {\n          if (hasInitialValue(atom)) {\n            const atomState = getAtomState(atom);\n            const hasPrevValue = \"v\" in atomState;\n            const prevValue = atomState.v;\n            setAtomStateValueOrPromise(atom, atomState, value);\n            mountDependencies(pending, atom, atomState);\n            if (!hasPrevValue || !Object.is(prevValue, atomState.v)) {\n              addPendingAtom(pending, atom, atomState);\n              recomputeDependents(pending, atom, atomState);\n            }\n          }\n        }\n        flushPending(pending);\n      }\n    };\n    Object.assign(store, devStore);\n  }\n  return store;\n};\nconst createStore = () => {\n  const atomStateMap = /* @__PURE__ */ new WeakMap();\n  const getAtomState = (atom) => {\n    let atomState = atomStateMap.get(atom);\n    if (!atomState) {\n      atomState = { d: /* @__PURE__ */ new Map(), p: /* @__PURE__ */ new Set(), n: 0 };\n      atomStateMap.set(atom, atomState);\n    }\n    return atomState;\n  };\n  return buildStore(getAtomState);\n};\nlet defaultStore;\nconst getDefaultStore = () => {\n  if (!defaultStore) {\n    defaultStore = createStore();\n    if ((import.meta.env ? import.meta.env.MODE : void 0) !== \"production\") {\n      globalThis.__JOTAI_DEFAULT_STORE__ || (globalThis.__JOTAI_DEFAULT_STORE__ = defaultStore);\n      if (globalThis.__JOTAI_DEFAULT_STORE__ !== defaultStore) {\n        console.warn(\n          \"Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044\"\n        );\n      }\n    }\n  }\n  return defaultStore;\n};\n\nexport { atom, createStore, getDefaultStore };\n","import{atom as r}from\"jotai/vanilla\";function e(e){const o=r(()=>({mounted:!1,inProgress:0,promise:void 0,cleanup:void 0,fromCleanup:!1,recursing:!1,refresh:()=>{},refreshing:!1,get:()=>{},set:()=>{},pendingError:null})),t=r(0),s=r(null,(r,e)=>{const s=r(o);return s.mounted=!0,s.get=r,s.set=e,s.refresh=()=>{try{s.refreshing=!0,e(t,r=>r+1)}finally{s.refreshing=!1}},e(t,r=>r+1),()=>{s.mounted=!1,n(s),null==s.cleanup||s.cleanup(),s.cleanup=void 0}});s.onMount=r=>r();const i=r(r=>{r(t);const s=r(o);if(!s.mounted)return s.promise;if(s.recursing)return s.promise;if(s.inProgress&&!s.refreshing)return s.promise;n(s);const i=new Map,u=e=>{const n=r(e);return i.set(e,n),n};u.peek=r=>s.get(r);const l=(...e)=>{try{return++s.inProgress,s.set(...e)}finally{Array.from(i.keys(),r),--s.inProgress}};l.recurse=(e,...n)=>{if(s.fromCleanup)\"production\"!==process.env.NODE_ENV&&console.warn(\"cannot recurse inside cleanup\");else try{return s.recursing=!0,s.set(e,...n)}finally{s.recursing=!1,Array.from(i).some(([e,n])=>r(e)!==n)&&s.refresh()}},++s.inProgress;const c=()=>{try{if(s.refreshing=!1,!s.mounted)return;try{s.fromCleanup=!0,null==s.cleanup||s.cleanup()}finally{s.fromCleanup=!1}s.cleanup=e(u,l)}catch(r){s.pendingError=r,s.refresh()}finally{s.promise=void 0,--s.inProgress}};return s.refreshing?c():s.promise=Promise.resolve().then(c)});return\"production\"!==process.env.NODE_ENV&&(o.debugPrivate=!0,t.debugPrivate=!0,s.debugPrivate=!0,i.debugPrivate=!0),r(r=>{r(s),r(i)})}function n(r){if(null!==r.pendingError){const e=r.pendingError;throw r.pendingError=null,e}}function o(r,n){const o=e(n),t=Object.getOwnPropertyDescriptors(r);return t.read.value=(e,n)=>{try{return r.read(e,n)}finally{e(o)}},Object.create(Object.getPrototypeOf(r),t)}export{e as atomEffect,o as withAtomEffect};\n//# sourceMappingURL=index.modern.mjs.map\n","'use client';\nimport ReactExports, { createContext, useContext, useRef, createElement, useReducer, useEffect, useDebugValue, useCallback } from 'react';\nimport { getDefaultStore, createStore } from 'jotai/vanilla';\n\nconst StoreContext = createContext(\n  void 0\n);\nconst useStore = (options) => {\n  const store = useContext(StoreContext);\n  return (options == null ? void 0 : options.store) || store || getDefaultStore();\n};\nconst Provider = ({\n  children,\n  store\n}) => {\n  const storeRef = useRef();\n  if (!store && !storeRef.current) {\n    storeRef.current = createStore();\n  }\n  return createElement(\n    StoreContext.Provider,\n    {\n      value: store || storeRef.current\n    },\n    children\n  );\n};\n\nconst isPromiseLike = (x) => typeof (x == null ? void 0 : x.then) === \"function\";\nconst attachPromiseMeta = (promise) => {\n  promise.status = \"pending\";\n  promise.then(\n    (v) => {\n      promise.status = \"fulfilled\";\n      promise.value = v;\n    },\n    (e) => {\n      promise.status = \"rejected\";\n      promise.reason = e;\n    }\n  );\n};\nconst use = ReactExports.use || ((promise) => {\n  if (promise.status === \"pending\") {\n    throw promise;\n  } else if (promise.status === \"fulfilled\") {\n    return promise.value;\n  } else if (promise.status === \"rejected\") {\n    throw promise.reason;\n  } else {\n    attachPromiseMeta(promise);\n    throw promise;\n  }\n});\nconst continuablePromiseMap = /* @__PURE__ */ new WeakMap();\nconst createContinuablePromise = (promise) => {\n  let continuablePromise = continuablePromiseMap.get(promise);\n  if (!continuablePromise) {\n    continuablePromise = new Promise((resolve, reject) => {\n      let curr = promise;\n      const onFulfilled = (me) => (v) => {\n        if (curr === me) {\n          resolve(v);\n        }\n      };\n      const onRejected = (me) => (e) => {\n        if (curr === me) {\n          reject(e);\n        }\n      };\n      const registerCancelHandler = (p) => {\n        if (\"onCancel\" in p && typeof p.onCancel === \"function\") {\n          p.onCancel((nextValue) => {\n            if ((import.meta.env ? import.meta.env.MODE : void 0) !== \"production\" && nextValue === p) {\n              throw new Error(\"[Bug] p is not updated even after cancelation\");\n            }\n            if (isPromiseLike(nextValue)) {\n              continuablePromiseMap.set(nextValue, continuablePromise);\n              curr = nextValue;\n              nextValue.then(onFulfilled(nextValue), onRejected(nextValue));\n              registerCancelHandler(nextValue);\n            } else {\n              resolve(nextValue);\n            }\n          });\n        }\n      };\n      promise.then(onFulfilled(promise), onRejected(promise));\n      registerCancelHandler(promise);\n    });\n    continuablePromiseMap.set(promise, continuablePromise);\n  }\n  return continuablePromise;\n};\nfunction useAtomValue(atom, options) {\n  const store = useStore(options);\n  const [[valueFromReducer, storeFromReducer, atomFromReducer], rerender] = useReducer(\n    (prev) => {\n      const nextValue = store.get(atom);\n      if (Object.is(prev[0], nextValue) && prev[1] === store && prev[2] === atom) {\n        return prev;\n      }\n      return [nextValue, store, atom];\n    },\n    void 0,\n    () => [store.get(atom), store, atom]\n  );\n  let value = valueFromReducer;\n  if (storeFromReducer !== store || atomFromReducer !== atom) {\n    rerender();\n    value = store.get(atom);\n  }\n  const delay = options == null ? void 0 : options.delay;\n  useEffect(() => {\n    const unsub = store.sub(atom, () => {\n      if (typeof delay === \"number\") {\n        const value2 = store.get(atom);\n        if (isPromiseLike(value2)) {\n          attachPromiseMeta(createContinuablePromise(value2));\n        }\n        setTimeout(rerender, delay);\n        return;\n      }\n      rerender();\n    });\n    rerender();\n    return unsub;\n  }, [store, atom, delay]);\n  useDebugValue(value);\n  if (isPromiseLike(value)) {\n    const promise = createContinuablePromise(value);\n    return use(promise);\n  }\n  return value;\n}\n\nfunction useSetAtom(atom, options) {\n  const store = useStore(options);\n  const setAtom = useCallback(\n    (...args) => {\n      if ((import.meta.env ? import.meta.env.MODE : void 0) !== \"production\" && !(\"write\" in atom)) {\n        throw new Error(\"not writable atom\");\n      }\n      return store.set(atom, ...args);\n    },\n    [store, atom]\n  );\n  return setAtom;\n}\n\nfunction useAtom(atom, options) {\n  return [\n    useAtomValue(atom, options),\n    // We do wrong type assertion here, which results in throwing an error.\n    useSetAtom(atom, options)\n  ];\n}\n\nexport { Provider, useAtom, useAtomValue, useSetAtom, useStore };\n","import { useState, useRef, useEffect } from 'react';\n\nfunction areInputsEqual(newInputs, lastInputs) {\n  if (newInputs.length !== lastInputs.length) {\n    return false;\n  }\n\n  for (var i = 0; i < newInputs.length; i++) {\n    if (newInputs[i] !== lastInputs[i]) {\n      return false;\n    }\n  }\n\n  return true;\n}\n\nfunction useMemoOne(getResult, inputs) {\n  var initial = useState(function () {\n    return {\n      inputs: inputs,\n      result: getResult()\n    };\n  })[0];\n  var isFirstRun = useRef(true);\n  var committed = useRef(initial);\n  var useCache = isFirstRun.current || Boolean(inputs && committed.current.inputs && areInputsEqual(inputs, committed.current.inputs));\n  var cache = useCache ? committed.current : {\n    inputs: inputs,\n    result: getResult()\n  };\n  useEffect(function () {\n    isFirstRun.current = false;\n    committed.current = cache;\n  }, [cache]);\n  return cache.result;\n}\nfunction useCallbackOne(callback, inputs) {\n  return useMemoOne(function () {\n    return callback;\n  }, inputs);\n}\nvar useMemo = useMemoOne;\nvar useCallback = useCallbackOne;\n\nexport { useCallback, useCallbackOne, useMemo, useMemoOne };\n","import { atomEffect } from 'jotai-effect';\nimport { useAtomValue } from 'jotai/react';\nimport { useMemoOne } from 'use-memo-one';\n\ntype EffectFn = Parameters<typeof atomEffect>[0];\n\nexport function useAtomEffect(effectFn: EffectFn) {\n  useAtomValue(useMemoOne(() => atomEffect(effectFn), [effectFn]));\n}\n","import { useNZ } from '@nizza/core';\nimport { useCallback } from 'react';\n\n/**\n * Custom hook with write operations for nizza EventBus.\n * @returns {object} EventBus.\n * @returns {object} - Object containing functions for emitting events and more.\n */\nexport function useEventBus() {\n  const { eventBus } = useNZ();\n\n  const emitEvent = useCallback(\n    (event: string, data: any) => {\n      eventBus.emit(event, data);\n    },\n    [eventBus],\n  );\n\n  return {\n    emitEvent,\n  };\n}\n","/* eslint-disable react-hooks/exhaustive-deps */\nimport {\n  EventBusListener,\n  EventBusSubscription,\n  GlobalStore,\n} from '@nizza/core';\nimport { useEffect } from 'react';\n\n/**\n * Custom hook for subscribing to events from an EventBus.\n * @param {string | string[]} events - Events to subscribe to.\n * @param {function} callback - Callback function to handle the events.\n */\nexport function useEventEffect(\n  store: GlobalStore,\n  events: string | string[],\n  callback: EventBusListener,\n) {\n  useEffect(() => {\n    const eventList = Array.isArray(events) ? events : [events];\n    const subscriptions: EventBusSubscription[] = [];\n\n    eventList.forEach(event => {\n      const subscription = store.eventBus.on(event, callback);\n      subscriptions.push(subscription);\n    });\n\n    return () => {\n      // When the component unmounts, remove all subscriptions.\n      subscriptions.forEach(subscription => {\n        subscription.off();\n      });\n    };\n  }, []);\n}\n","/* eslint-disable react-hooks/exhaustive-deps */\nimport { useCallback, useEffect, useMemo, useState } from 'react';\n\nexport type UseScriptStatus = 'idle' | 'loading' | 'ready' | 'error';\n\nexport type UseScriptAttributes = {\n  [key in keyof HTMLScriptElement | string]: string;\n};\n\n/** Configuration options for the script loading behavior. */\nexport type UseScriptConfig = {\n  /** Whether the script should be loaded as an ES6 module. */\n  module?: boolean;\n  /** Flag to bypass the cache by appending a timestamp to the script URL. */\n  cache?: boolean;\n  /** Additional HTML attributes to set on the script element. */\n  attrs?: UseScriptAttributes;\n  /** Whether to enable or disable script injection. */\n  enabled?: boolean;\n};\n\n/** Represents the state of a script element. */\nexport type UseScriptItem = {\n  /** The source URL of the script. */\n  src: string;\n  /** The current status of the script ('idle', 'loading', 'ready', 'error'). */\n  status: UseScriptStatus;\n};\n\ntype ScriptContext = {\n  scripts: UseScriptItem[];\n  setScripts: React.Dispatch<React.SetStateAction<UseScriptItem[]>>;\n  module: boolean;\n  cache: boolean;\n  attrs: UseScriptAttributes;\n};\n\n/**\n * Custom hook to load external scripts and monitor their statuses.\n *\n * @param {string | string[]} sources - The source URL(s) of the script(s) to load.\n * @param {UseScriptConfig} config - Optional configuration options.\n * @returns {UseScriptStatus | UseScriptStatus[]} The status of the loaded script(s).\n */\nexport function useScript<T extends string[] | string>(\n  sources: T,\n  config: UseScriptConfig = {},\n): T extends string ? UseScriptStatus : UseScriptStatus[] {\n  const { module = false, cache = true, attrs = {}, enabled = true } = config;\n\n  const normalizedSources = useMemo(\n    () => normalizeSources(sources, cache),\n    [sources, cache],\n  );\n\n  const [scripts, setScripts] = useState<UseScriptItem[]>(normalizedSources);\n\n  const context = useMemo(\n    () => ({ scripts, setScripts, module, cache, attrs }),\n    [scripts, setScripts, module, cache, attrs],\n  );\n\n  const loadScript = useCallback(\n    (src: string) => {\n      const existingScript = findScript(context, src);\n\n      if (existingScript) {\n        handleExistingScript(context, existingScript);\n      } else {\n        createAndLoadScript(context, src);\n      }\n    },\n    [context],\n  );\n\n  useEffect(() => {\n    if (!enabled) return;\n    normalizedSources.forEach(script => loadScript(script.src));\n  }, [normalizedSources, loadScript, enabled]);\n\n  return useMemo(\n    () => getScriptStatuses(sources, scripts),\n    [scripts, sources],\n  ) as T extends string ? UseScriptStatus : UseScriptStatus[];\n}\n\n/**\n * Get the statuses of the scripts.\n *\n * @param {string | string[]} sources - The source URL(s) of the script(s).\n * @param {UseScriptItem[]} scripts - The array of script items with their statuses.\n * @returns {UseScriptStatus | UseScriptStatus[]} The statuses of the scripts.\n */\nfunction getScriptStatuses(\n  sources: string | string[],\n  scripts: UseScriptItem[],\n): UseScriptStatus | UseScriptStatus[] {\n  return typeof sources === 'string'\n    ? scripts[0]?.status || 'idle'\n    : scripts.map(script => script.status);\n}\n\n/**\n * Normalize the sources into an array of script items with initial status 'idle'.\n *\n * @param {string | string[]} sources - The source URL(s) of the script(s).\n * @param {boolean} cache - Whether to use cache-busting.\n * @returns {UseScriptItem[]} Array of normalized script items.\n */\nfunction normalizeSources(\n  sources: string | string[],\n  cache: boolean,\n): UseScriptItem[] {\n  const srcArray = Array.isArray(sources) ? sources : [sources];\n  return srcArray.map(src => ({\n    src: normalizeSrc(src, cache),\n    status: 'idle',\n  }));\n}\n\n/**\n * Create and load a new script element.\n *\n * @param {ScriptContext} context - The script context containing configuration and state.\n * @param {string} src - The source URL of the script.\n */\nfunction createAndLoadScript(context: ScriptContext, src: string) {\n  const { module, attrs } = context;\n  const script = document.createElement('script');\n\n  script.src = src;\n  script.async = true;\n  if (module) script.type = 'module';\n\n  Object.entries(attrs).forEach(([key, value]) =>\n    script.setAttribute(key, value),\n  );\n\n  document.body.appendChild(script);\n\n  script.addEventListener('load', () =>\n    updateScriptStatus(context, script, 'ready'),\n  );\n  script.addEventListener('error', () =>\n    updateScriptStatus(context, script, 'error'),\n  );\n\n  updateScriptStatus(context, script, 'loading');\n}\n\n/**\n * Handle an existing script element.\n *\n * @param {ScriptContext} context - The script context containing configuration and state.\n * @param {HTMLScriptElement} script - The existing script element.\n */\nfunction handleExistingScript(\n  context: ScriptContext,\n  script: HTMLScriptElement,\n) {\n  const status =\n    (script.getAttribute('data-status') as UseScriptStatus) || 'idle';\n\n  updateScriptStatus(context, script, status);\n\n  if (['loading', 'idle'].includes(status)) {\n    script.addEventListener('load', () =>\n      updateScriptStatus(context, script, 'ready'),\n    );\n    script.addEventListener('error', () =>\n      updateScriptStatus(context, script, 'error'),\n    );\n  }\n}\n\n/**\n * Update the status of a script element.\n *\n * @param {ScriptContext} context - The script context containing configuration and state.\n * @param {HTMLScriptElement} script - The script element to update.\n * @param {UseScriptStatus} status - The new status of the script.\n */\nfunction updateScriptStatus(\n  context: ScriptContext,\n  script: HTMLScriptElement,\n  status: UseScriptStatus,\n) {\n  const { scripts, setScripts, cache } = context;\n  const src = cache ? script.src : script.src.split('?')[0];\n  const localScript = scripts.find(x => x.src.includes(src));\n\n  // Prevent unnecessary updates if the status hasn't changed\n  if (localScript?.status === status) return;\n\n  // Update the script's data-status attribute and the state\n  script.setAttribute('data-status', status);\n  setScripts(p => p.map(x => (x.src.includes(src) ? { ...x, status } : x)));\n}\n\n/**\n * Find an existing script element in the DOM.\n *\n * @param {ScriptContext} context - The script context containing configuration and state.\n * @param {string} src - The source URL of the script.\n * @returns {HTMLScriptElement | null} The existing script element, or null if not found.\n */\nfunction findScript(\n  context: ScriptContext,\n  src: string,\n): HTMLScriptElement | null {\n  const _src = context.cache ? src : src.split('?')[0];\n  return document.querySelector<HTMLScriptElement>(`script[src*=\"${_src}\"]`);\n}\n\n/**\n * Normalize the source URL of a script.\n *\n * @param {string} src - The original source URL.\n * @param {boolean} cache - Whether to use cache-busting.\n * @returns {string} The normalized source URL.\n */\nfunction normalizeSrc(src: string, cache: boolean): string {\n  return cache ? src : `${src}?_c=${Date.now()}`;\n}\n","/**\n * @license\n * Copyright 2019 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nconst t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&\"adoptedStyleSheets\"in Document.prototype&&\"replace\"in CSSStyleSheet.prototype,s=Symbol(),o=new WeakMap;class n{constructor(t,e,o){if(this._$cssResult$=!0,o!==s)throw Error(\"CSSResult is not constructable. Use `unsafeCSS` or `css` instead.\");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const s=this.t;if(e&&void 0===t){const e=void 0!==s&&1===s.length;e&&(t=o.get(s)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&o.set(s,t))}return t}toString(){return this.cssText}}const r=t=>new n(\"string\"==typeof t?t:t+\"\",void 0,s),i=(t,...e)=>{const o=1===t.length?t[0]:e.reduce(((e,s,o)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if(\"number\"==typeof t)return t;throw Error(\"Value passed to 'css' function must be a 'css' function result: \"+t+\". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.\")})(s)+t[o+1]),t[0]);return new n(o,t,s)},S=(s,o)=>{if(e)s.adoptedStyleSheets=o.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const e of o){const o=document.createElement(\"style\"),n=t.litNonce;void 0!==n&&o.setAttribute(\"nonce\",n),o.textContent=e.cssText,s.appendChild(o)}},c=e?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e=\"\";for(const s of t.cssRules)e+=s.cssText;return r(e)})(t):t;export{n as CSSResult,S as adoptStyles,i as css,c as getCompatibleStyle,e as supportsAdoptingStyleSheets,r as unsafeCSS};\n//# sourceMappingURL=css-tag.js.map\n","import{getCompatibleStyle as t,adoptStyles as s}from\"./css-tag.js\";export{CSSResult,adoptStyles,css,getCompatibleStyle,supportsAdoptingStyleSheets,unsafeCSS}from\"./css-tag.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const{is:i,defineProperty:e,getOwnPropertyDescriptor:r,getOwnPropertyNames:h,getOwnPropertySymbols:o,getPrototypeOf:n}=Object,a=globalThis,c=a.trustedTypes,l=c?c.emptyScript:\"\",p=a.reactiveElementPolyfillSupport,d=(t,s)=>t,u={toAttribute(t,s){switch(s){case Boolean:t=t?l:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,s){let i=t;switch(s){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},f=(t,s)=>!i(t,s),y={attribute:!0,type:String,converter:u,reflect:!1,hasChanged:f};Symbol.metadata??=Symbol(\"metadata\"),a.litPropertyMetadata??=new WeakMap;class b extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,s=y){if(s.state&&(s.attribute=!1),this._$Ei(),this.elementProperties.set(t,s),!s.noAccessor){const i=Symbol(),r=this.getPropertyDescriptor(t,i,s);void 0!==r&&e(this.prototype,t,r)}}static getPropertyDescriptor(t,s,i){const{get:e,set:h}=r(this.prototype,t)??{get(){return this[s]},set(t){this[s]=t}};return{get(){return e?.call(this)},set(s){const r=e?.call(this);h.call(this,s),this.requestUpdate(t,r,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??y}static _$Ei(){if(this.hasOwnProperty(d(\"elementProperties\")))return;const t=n(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(d(\"finalized\")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(d(\"properties\"))){const t=this.properties,s=[...h(t),...o(t)];for(const i of s)this.createProperty(i,t[i])}const t=this[Symbol.metadata];if(null!==t){const s=litPropertyMetadata.get(t);if(void 0!==s)for(const[t,i]of s)this.elementProperties.set(t,i)}this._$Eh=new Map;for(const[t,s]of this.elementProperties){const i=this._$Eu(t,s);void 0!==i&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(s){const i=[];if(Array.isArray(s)){const e=new Set(s.flat(1/0).reverse());for(const s of e)i.unshift(t(s))}else void 0!==s&&i.push(t(s));return i}static _$Eu(t,s){const i=s.attribute;return!1===i?void 0:\"string\"==typeof i?i:\"string\"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,s=this.constructor.elementProperties;for(const i of s.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return s(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((t=>t.hostConnected?.()))}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()))}attributeChangedCallback(t,s,i){this._$AK(t,i)}_$EC(t,s){const i=this.constructor.elementProperties.get(t),e=this.constructor._$Eu(t,i);if(void 0!==e&&!0===i.reflect){const r=(void 0!==i.converter?.toAttribute?i.converter:u).toAttribute(s,i.type);this._$Em=t,null==r?this.removeAttribute(e):this.setAttribute(e,r),this._$Em=null}}_$AK(t,s){const i=this.constructor,e=i._$Eh.get(t);if(void 0!==e&&this._$Em!==e){const t=i.getPropertyOptions(e),r=\"function\"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:u;this._$Em=e,this[e]=r.fromAttribute(s,t.type),this._$Em=null}}requestUpdate(t,s,i){if(void 0!==t){if(i??=this.constructor.getPropertyOptions(t),!(i.hasChanged??f)(this[t],s))return;this.P(t,s,i)}!1===this.isUpdatePending&&(this._$ES=this._$ET())}P(t,s,i){this._$AL.has(t)||this._$AL.set(t,s),!0===i.reflect&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,s]of this._$Ep)this[t]=s;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[s,i]of t)!0!==i.wrapped||this._$AL.has(s)||void 0===this[s]||this.P(s,this[s],i)}let t=!1;const s=this._$AL;try{t=this.shouldUpdate(s),t?(this.willUpdate(s),this._$EO?.forEach((t=>t.hostUpdate?.())),this.update(s)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(s)}willUpdate(t){}_$AE(t){this._$EO?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach((t=>this._$EC(t,this[t]))),this._$EU()}updated(t){}firstUpdated(t){}}b.elementStyles=[],b.shadowRootOptions={mode:\"open\"},b[d(\"elementProperties\")]=new Map,b[d(\"finalized\")]=new Map,p?.({ReactiveElement:b}),(a.reactiveElementVersions??=[]).push(\"2.0.4\");export{b as ReactiveElement,u as defaultConverter,f as notEqual};\n//# sourceMappingURL=reactive-element.js.map\n","/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nconst n=globalThis,c=n.trustedTypes,h=c?c.createPolicy(\"lit-html\",{createHTML:t=>t}):void 0,f=\"$lit$\",v=`lit$${Math.random().toFixed(9).slice(2)}$`,m=\"?\"+v,_=`<${m}>`,w=document,lt=()=>w.createComment(\"\"),st=t=>null===t||\"object\"!=typeof t&&\"function\"!=typeof t,g=Array.isArray,$=t=>g(t)||\"function\"==typeof t?.[Symbol.iterator],x=\"[ \\t\\n\\f\\r]\",T=/<(?:(!--|\\/[^a-zA-Z])|(\\/?[a-zA-Z][^>\\s]*)|(\\/?$))/g,E=/-->/g,k=/>/g,O=RegExp(`>|${x}(?:([^\\\\s\"'>=/]+)(${x}*=${x}*(?:[^ \\t\\n\\f\\r\"'\\`<>=]|(\"|')|))|$)`,\"g\"),S=/'/g,j=/\"/g,M=/^(?:script|style|textarea|title)$/i,P=t=>(i,...s)=>({_$litType$:t,strings:i,values:s}),ke=P(1),Oe=P(2),Se=P(3),R=Symbol.for(\"lit-noChange\"),D=Symbol.for(\"lit-nothing\"),V=new WeakMap,I=w.createTreeWalker(w,129);function N(t,i){if(!g(t)||!t.hasOwnProperty(\"raw\"))throw Error(\"invalid template strings array\");return void 0!==h?h.createHTML(i):i}const U=(t,i)=>{const s=t.length-1,e=[];let h,o=2===i?\"<svg>\":3===i?\"<math>\":\"\",n=T;for(let i=0;i<s;i++){const s=t[i];let r,l,c=-1,a=0;for(;a<s.length&&(n.lastIndex=a,l=n.exec(s),null!==l);)a=n.lastIndex,n===T?\"!--\"===l[1]?n=E:void 0!==l[1]?n=k:void 0!==l[2]?(M.test(l[2])&&(h=RegExp(\"</\"+l[2],\"g\")),n=O):void 0!==l[3]&&(n=O):n===O?\">\"===l[0]?(n=h??T,c=-1):void 0===l[1]?c=-2:(c=n.lastIndex-l[2].length,r=l[1],n=void 0===l[3]?O:'\"'===l[3]?j:S):n===j||n===S?n=O:n===E||n===k?n=T:(n=O,h=void 0);const u=n===O&&t[i+1].startsWith(\"/>\")?\" \":\"\";o+=n===T?s+_:c>=0?(e.push(r),s.slice(0,c)+f+s.slice(c)+v+u):s+v+(-2===c?i:u)}return[N(t,o+(t[s]||\"<?>\")+(2===i?\"</svg>\":3===i?\"</math>\":\"\")),e]};class B{constructor({strings:t,_$litType$:i},s){let e;this.parts=[];let h=0,o=0;const n=t.length-1,r=this.parts,[l,a]=U(t,i);if(this.el=B.createElement(l,s),I.currentNode=this.el.content,2===i||3===i){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(e=I.nextNode())&&r.length<n;){if(1===e.nodeType){if(e.hasAttributes())for(const t of e.getAttributeNames())if(t.endsWith(f)){const i=a[o++],s=e.getAttribute(t).split(v),n=/([.?@])?(.*)/.exec(i);r.push({type:1,index:h,name:n[2],strings:s,ctor:\".\"===n[1]?Y:\"?\"===n[1]?Z:\"@\"===n[1]?q:G}),e.removeAttribute(t)}else t.startsWith(v)&&(r.push({type:6,index:h}),e.removeAttribute(t));if(M.test(e.tagName)){const t=e.textContent.split(v),i=t.length-1;if(i>0){e.textContent=c?c.emptyScript:\"\";for(let s=0;s<i;s++)e.append(t[s],lt()),I.nextNode(),r.push({type:2,index:++h});e.append(t[i],lt())}}}else if(8===e.nodeType)if(e.data===m)r.push({type:2,index:h});else{let t=-1;for(;-1!==(t=e.data.indexOf(v,t+1));)r.push({type:7,index:h}),t+=v.length-1}h++}}static createElement(t,i){const s=w.createElement(\"template\");return s.innerHTML=t,s}}function z(t,i,s=t,e){if(i===R)return i;let h=void 0!==e?s.o?.[e]:s.l;const o=st(i)?void 0:i._$litDirective$;return h?.constructor!==o&&(h?._$AO?.(!1),void 0===o?h=void 0:(h=new o(t),h._$AT(t,s,e)),void 0!==e?(s.o??=[])[e]=h:s.l=h),void 0!==h&&(i=z(t,h._$AS(t,i.values),h,e)),i}class F{constructor(t,i){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=i}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:i},parts:s}=this._$AD,e=(t?.creationScope??w).importNode(i,!0);I.currentNode=e;let h=I.nextNode(),o=0,n=0,r=s[0];for(;void 0!==r;){if(o===r.index){let i;2===r.type?i=new et(h,h.nextSibling,this,t):1===r.type?i=new r.ctor(h,r.name,r.strings,this,t):6===r.type&&(i=new K(h,this,t)),this._$AV.push(i),r=s[++n]}o!==r?.index&&(h=I.nextNode(),o++)}return I.currentNode=w,e}p(t){let i=0;for(const s of this._$AV)void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,i),i+=s.strings.length-2):s._$AI(t[i])),i++}}class et{get _$AU(){return this._$AM?._$AU??this.v}constructor(t,i,s,e){this.type=2,this._$AH=D,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=s,this.options=e,this.v=e?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return void 0!==i&&11===t?.nodeType&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=z(this,t,i),st(t)?t===D||null==t||\"\"===t?(this._$AH!==D&&this._$AR(),this._$AH=D):t!==this._$AH&&t!==R&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):$(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==D&&st(this._$AH)?this._$AA.nextSibling.data=t:this.T(w.createTextNode(t)),this._$AH=t}$(t){const{values:i,_$litType$:s}=t,e=\"number\"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=B.createElement(N(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===e)this._$AH.p(i);else{const t=new F(e,this),s=t.u(this.options);t.p(i),this.T(s),this._$AH=t}}_$AC(t){let i=V.get(t.strings);return void 0===i&&V.set(t.strings,i=new B(t)),i}k(t){g(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let s,e=0;for(const h of t)e===i.length?i.push(s=new et(this.O(lt()),this.O(lt()),this,this.options)):s=i[e],s._$AI(h),e++;e<i.length&&(this._$AR(s&&s._$AB.nextSibling,e),i.length=e)}_$AR(t=this._$AA.nextSibling,i){for(this._$AP?.(!1,!0,i);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i}}setConnected(t){void 0===this._$AM&&(this.v=t,this._$AP?.(t))}}class G{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,i,s,e,h){this.type=1,this._$AH=D,this._$AN=void 0,this.element=t,this.name=i,this._$AM=e,this.options=h,s.length>2||\"\"!==s[0]||\"\"!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=D}_$AI(t,i=this,s,e){const h=this.strings;let o=!1;if(void 0===h)t=z(this,t,i,0),o=!st(t)||t!==this._$AH&&t!==R,o&&(this._$AH=t);else{const e=t;let n,r;for(t=h[0],n=0;n<h.length-1;n++)r=z(this,e[s+n],i,n),r===R&&(r=this._$AH[n]),o||=!st(r)||r!==this._$AH[n],r===D?t=D:t!==D&&(t+=(r??\"\")+h[n+1]),this._$AH[n]=r}o&&!e&&this.j(t)}j(t){t===D?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??\"\")}}class Y extends G{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===D?void 0:t}}class Z extends G{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==D)}}class q extends G{constructor(t,i,s,e,h){super(t,i,s,e,h),this.type=5}_$AI(t,i=this){if((t=z(this,t,i,0)??D)===R)return;const s=this._$AH,e=t===D&&s!==D||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,h=t!==D&&(s===D||e);e&&this.element.removeEventListener(this.name,this,s),h&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){\"function\"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class K{constructor(t,i,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){z(this,t)}}const si={M:f,P:v,A:m,C:1,L:U,R:F,D:$,V:z,I:et,H:G,N:Z,U:q,B:Y,F:K},Re=n.litHtmlPolyfillSupport;Re?.(B,et),(n.litHtmlVersions??=[]).push(\"3.2.0\");const Q=(t,i,s)=>{const e=s?.renderBefore??i;let h=e._$litPart$;if(void 0===h){const t=s?.renderBefore??null;e._$litPart$=h=new et(i.insertBefore(lt(),t),t,void 0,s??{})}return h._$AI(t),h};export{si as _$LH,ke as html,Se as mathml,R as noChange,D as nothing,Q as render,Oe as svg};\n//# sourceMappingURL=lit-html.js.map\n","import{ReactiveElement as e}from\"@lit/reactive-element\";export*from\"@lit/reactive-element\";import{render as n,noChange as l}from\"lit-html\";export*from\"lit-html\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */class h extends e{constructor(){super(...arguments),this.renderOptions={host:this},this.o=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this.o=n(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this.o?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this.o?.setConnected(!1)}render(){return l}}h._$litElement$=!0,h[\"finalized\"]=!0,globalThis.litElementHydrateSupport?.({LitElement:h});const f=globalThis.litElementPolyfillSupport;f?.({LitElement:h});const x={_$AK:(t,e,s)=>{t._$AK(e,s)},_$AL:t=>t._$AL};(globalThis.litElementVersions??=[]).push(\"4.1.0\");export{h as LitElement,x as _$LE};\n//# sourceMappingURL=lit-element.js.map\n","'use strict';\n\nvar m = require('react-dom');\nif (process.env.NODE_ENV === 'production') {\n  exports.createRoot = m.createRoot;\n  exports.hydrateRoot = m.hydrateRoot;\n} else {\n  var i = m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;\n  exports.createRoot = function(c, o) {\n    i.usingClientEntryPoint = true;\n    try {\n      return m.createRoot(c, o);\n    } finally {\n      i.usingClientEntryPoint = false;\n    }\n  };\n  exports.hydrateRoot = function(c, h, o) {\n    i.usingClientEntryPoint = true;\n    try {\n      return m.hydrateRoot(c, h, o);\n    } finally {\n      i.usingClientEntryPoint = false;\n    }\n  };\n}\n","type ElementResult = {\n  selector: string;\n  element: HTMLElement | null;\n};\n\ntype WaitForElementReturn = {\n  promise: Promise<ElementResult>;\n  cancel: () => void;\n};\n\n/**\n * Searches for elements matching the given selectors and returns the first match.\n * @param selectors - An array of CSS selectors to search for.\n * @returns The first element matching the selectors, or undefined if none match.\n */\nconst findElement = (selectors: string[]): ElementResult | undefined => {\n  return selectors\n    .map(selector => ({\n      selector,\n      element: document.querySelector<HTMLElement>(selector),\n    }))\n    .find(result => result.element !== null);\n};\n\n/**\n * Sets up a MutationObserver to watch for changes in the DOM and resolve when an element is found.\n * @param selectors - An array of CSS selectors to wait for.\n * @param resolve - The resolve function of the promise to resolve when an element is found.\n * @returns The MutationObserver instance.\n */\nconst startObservation = (\n  selectors: string[],\n  resolve: (value: ElementResult) => void,\n): MutationObserver => {\n  const observer = new MutationObserver(() => {\n    const foundResult = findElement(selectors);\n    if (foundResult) {\n      resolve(foundResult);\n    }\n  });\n\n  observer.observe(document.documentElement, {\n    childList: true,\n    subtree: true,\n  });\n\n  return observer;\n};\n\n/**\n * Waits for any of the provided DOM selectors to appear in the document.\n * Provides a cancel function to stop the search before completion. Supports optional timeout.\n * @param selectors - An array of selector strings to wait for.\n * @param timeout - Optional timeout in milliseconds after which the promise will resolve with null if the element is not found.\n * @returns An object containing a promise and a cancel function.\n */\nexport const waitForElement = (\n  selectors: string[],\n  timeout = 5000,\n): WaitForElementReturn => {\n  let observer: MutationObserver | null = null;\n  let timeoutId: ReturnType<typeof setTimeout> | null = null;\n  let resolve: (value: ElementResult) => void;\n\n  const promise = new Promise<ElementResult>(r => {\n    resolve = r;\n  });\n\n  const cleanUp = (): void => {\n    if (observer) {\n      observer.disconnect();\n      observer = null;\n    }\n    if (timeoutId !== null) {\n      clearTimeout(timeoutId);\n      timeoutId = null;\n    }\n  };\n\n  const immediateResult = findElement(selectors);\n\n  if (immediateResult) {\n    // @ts-expect-error \"resolve\" is defined at the beginning of the function\n    resolve(immediateResult);\n  } else {\n    // @ts-expect-error \"resolve\" is defined at the beginning of the function\n    observer = startObservation(selectors, resolve);\n  }\n\n  if (timeout !== undefined) {\n    timeoutId = setTimeout(() => {\n      resolve({ selector: '', element: null });\n      cleanUp();\n    }, timeout);\n  }\n\n  const cancel = (): void => {\n    cleanUp();\n    resolve({ selector: '', element: null });\n  };\n\n  return { promise, cancel };\n};\n","import {\n  GlobalStore,\n  NizzaProductDataSourceConfig,\n  NizzaProductRequestOriginTypes,\n  NizzaStore,\n  RenderProps,\n  Runtime,\n  RuntimeManagerConfig,\n  RuntimeType,\n  getNizza,\n} from '@nizza/core';\nimport { render as litRender } from 'lit';\nimport {\n  ComponentType,\n  ReactElement,\n  ReactNode,\n  StrictMode,\n  cloneElement,\n  isValidElement,\n} from 'react';\nimport { Root, createRoot } from 'react-dom/client';\nimport baseLogger from '~logger';\nimport { createProductDataSourceAsync } from './product-data-source';\nimport { waitForElement } from './waitForElement';\n\ntype BaseConfig = Omit<\n  RuntimeManagerConfig<NizzaStore>,\n  'globalId' | 'getStore'\n>;\ntype MinimalRuntimeConfig = Partial<BaseConfig> &\n  Required<Pick<RuntimeManagerConfig<NizzaStore>, 'env' | 'logger'>>;\n\nconst logger = baseLogger.child('RuntimeUtils');\n\nexport function initializeNizzaRuntime(\n  config: MinimalRuntimeConfig,\n): Runtime<NizzaStore> {\n  return new Runtime({\n    ...config,\n    globalId: 'nizza',\n    getStore: getNizza,\n    bundler: {\n      isProd: import.meta.env.PROD,\n      stage: import.meta.env.STAGE,\n      ...config.bundler,\n    },\n  });\n}\n\nexport function registerReactComponent<T extends GlobalStore>(\n  runtime: Runtime<T>,\n  rootId: string,\n  components: (ComponentType<any> | ReactElement)[],\n) {\n  logger.debug('Registering React component', { rootId, components });\n  runtime.registerComponent(rootId, async (rootId, props) => {\n    const root = await renderReactComponent(rootId, components, props);\n    if (!root) return;\n\n    return {\n      element: root,\n      updateProps: (newProps: RenderProps) => {\n        reactRender(root, components, newProps);\n        logger.debug('Updated props for React component', { rootId, newProps });\n      },\n      unmount: () => {\n        root.unmount();\n        logger.debug('Unmounted React component', { rootId });\n      },\n    };\n  });\n}\n\nexport function registerLitComponent<T extends GlobalStore>(\n  runtime: Runtime<T>,\n  defaultRootId: string,\n  wcName: string,\n) {\n  logger.debug('Registering Lit component', { defaultRootId, wcName });\n  runtime.registerComponent(defaultRootId, async (rootId, props) => {\n    const element = await renderLitComponent(rootId, wcName, props);\n    if (!element) return;\n\n    return {\n      element,\n      updateProps: (newProps: RenderProps) => {\n        updateLitProps(element, newProps);\n        logger.debug('Updated props for Lit component', { rootId, newProps });\n      },\n      unmount: () => {\n        const container = document.getElementById(rootId);\n        if (container) {\n          litRender(null, container);\n        } else {\n          logger.debug(`Container with ID \"${rootId}\" not found.`);\n        }\n        logger.debug('Unmounted Lit component', { rootId });\n      },\n    };\n  });\n}\n\nexport function reactRender(\n  root: Root,\n  components: (ComponentType<any> | ReactElement)[],\n  props: RenderProps,\n): void {\n  const componentTree = createComponentTree(components, props);\n  logger.debug('Rendering React component tree', { componentTree, props });\n\n  root.render(<StrictMode>{componentTree}</StrictMode>);\n}\n\nfunction createComponentTree(\n  components: (ComponentType<any> | ReactElement)[],\n  props: RenderProps,\n): ReactNode {\n  return components.reduceRight<ReactNode>(\n    (children, ComponentOrElement, index) => {\n      const isLast = index === components.length - 1;\n      const elementProps = isLast ? { ...props, children } : { children };\n\n      if (isValidElement(ComponentOrElement)) {\n        return cloneElement(ComponentOrElement, elementProps as any);\n      }\n\n      const Component = ComponentOrElement as ComponentType<any>;\n      return <Component {...elementProps} />;\n    },\n    null,\n  );\n}\n\nasync function renderReactComponent(\n  rootId: string,\n  components: (ComponentType<any> | ReactElement)[],\n  props: RenderProps,\n): Promise<Root | null> {\n  const container = await getContainer(rootId);\n  if (!container) return null;\n\n  const root = createRoot(container);\n  reactRender(root, components, props);\n  logger.debug('React component rendered', { rootId, components, props });\n  return root;\n}\n\nasync function renderLitComponent(\n  rootId: string,\n  wcName: string,\n  props: RenderProps,\n): Promise<HTMLElement | null> {\n  const container = await getContainer(rootId);\n  if (!container) return null;\n\n  const element = document.createElement(wcName);\n  updateLitProps(element, props);\n  litRender(element, container);\n  logger.debug('Lit component rendered', { rootId, wcName, props });\n  return element;\n}\n\nfunction updateLitProps(element: HTMLElement, props: RenderProps) {\n  Object.entries(props).forEach(([key, value]) => {\n    if (key in element) {\n      (element as any)[key] = value;\n    } else {\n      logger.debug(\n        `Property \"${key}\" does not exist on element \"${element.tagName.toLowerCase()}\"`,\n      );\n    }\n  });\n}\n\nasync function getContainer(rootId: string): Promise<HTMLElement | null> {\n  const { promise } = waitForElement([`#${rootId}`]);\n  try {\n    const result = await promise;\n    if (!result.element) throw new Error('The root element does not exist');\n    return result.element;\n  } catch (error: any) {\n    handleError(error, rootId);\n    return null;\n  }\n}\n\nfunction handleError(error: Error, rootId: string): void {\n  if (error.message.includes('waitForElement')) {\n    logger.debug('waitForElement error', { rootId, error });\n  } else {\n    logger.error('Error finding container', { rootId, error });\n  }\n}\n\nexport const setDefaultProductDataSource = async <T extends GlobalStore>(\n  runtime: Runtime<T>,\n  defaultLimit = 10,\n) => {\n  const runtimeType = runtime.meta.type;\n  let origin: NizzaProductRequestOriginTypes;\n\n  switch (runtimeType) {\n    case RuntimeType.VtexIO:\n    case RuntimeType.VtexLegacy:\n    case RuntimeType.VtexFastStore:\n      origin = NizzaProductRequestOriginTypes.VTEX;\n      break;\n\n    case RuntimeType.Platform:\n      origin = NizzaProductRequestOriginTypes.PLATFORM;\n      break;\n\n    default:\n      origin = NizzaProductRequestOriginTypes.UNKNOWN;\n      break;\n  }\n\n  const config: NizzaProductDataSourceConfig = {\n    origin,\n    defaultLimit,\n  };\n\n  const dataSource = await createProductDataSourceAsync(config);\n  runtime.store.setProductDataSource(dataSource);\n  logger.debug('Default product data source set', { config });\n};\n"],"names":["logger","createNizzaLogger","MemoryStorage","__publicField","store","data","key","value","_a","index","isStorageAvailable","type","storage","setProperty","obj","name","descriptor","CustomStorage","baseLogger","customLocalStorage","customSessionStorage","assign","target","i","source","defaultConverter","init","converter","defaultAttributes","set","attributes","stringifiedAttributes","attributeName","get","cookies","jar","parts","found","api","byteToHex","unsafeStringify","arr","offset","getRandomValues","rnds8","rng","randomUUID","native","v4","options","buf","rnds","_c","_b","_FINGERPRINT","getFingerprint","fingerprint","Cookies","uuidv4","resolveCurrencyConfig","manualOptions","currencyFormat","currencySymbol","_d","_f","_e","_h","_g","_j","_i","_k","_l","numToCurrency","amount","deconstructCurrency","formattedNum","integerPart","decimalPart","formatCurrency","deconstructedIsNeeded","combineGlobStyles","styles","createUniqueKey","path","fileName","hash","shortId","acc","style","uniqueKey","configureGlobalStore","stores","config","waitForCondition","conditionFn","timeout","interval","resolve","reject","startTime","checkCondition","toCamelCase","str","match","PlatformProductDataSource","input","productId","productService","error","collection","collectionId","collectionInfo","collectionService","product","accountName","getNizza","filterAvailableVtexProducts","availableItems","item","seller","firstItem","fixVtexAddToCartLink","account","host","element","addHttp","url","replaceHost","fixLinkHost","pdpLink","addToCartLink","pdpLinkUrl","addToCartLinkUrl","pdpLinkWithHost","addToCartLinkWithHost","vtexLegacyAddToCart","quantity","buildVtexCartItem","vtexjs","sellerId","result","vtexLegacySetUTM","utm","getOrderForm","sendAttachment","orderForm","marketingData","NZ_AWS_REGION","NZ_CORE_SERVICES_GRAPHQL_URL","NZ_CORE_SERVICES_REST_URL","__vite_import_meta_env__","environment","coreEnvs","isMyVTEX","getPageUrl","apiUrls","env","BASE_URL","CORS_PROXY_URL","DEFAULT_PAGE","DEFAULT_LIMIT","buildPaginationParams","page","limit","buildProductFilter","buildCollectionFilter","paginationParams","buildBaseUrl","accountHost","pageUrl","defaultHost","pageHost","buildSearchPath","search","buildSalesChannelFilter","salesChannel","withCorsProxy","corsProxyOrigin","params","searchParams","query","q","buildVtexCatalogUrl","corsProxy","salesChannelId","baseUrl","setVtexUTM","orderFormId","marketingTags","utmSource","nzApiClient","_isPlaceholder","a","_curry1","fn","f1","_curry2","f2","b","_arity","n","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","_curryN","length","received","combined","argsIdx","left","combinedIdx","hasPlaceholder","curryN","_curry3","f3","c","_isArray","val","_isInteger","_isString","x","_nth","list","idx","prop","p","_isArrayLike","symIterator","_createReduce","arrayReduce","methodReduce","iterableReduce","xf","_xArrayReduce","len","bind","thisObj","_xIterableReduce","iter","step","_xMethodReduce","methodName","_xReduce","XWrap","_xwrap","reduce","always","curry","nAry","_pipe","f","g","_checkForMethod","methodname","slice","fromIndex","toIndex","tail","pipe","constructN","Fn","$0","$1","$2","$3","$4","$5","$6","$7","$8","$9","ifElse","condition","onTrue","onFalse","buildVariationCodeWithNames","variation","formatOption","buildVariationCodeWithValues","formatOptions","values","omittedVariationsConfig","variationsConfig","omitted","omittedVariationsItems","extendedItem","omittedSkuSpecifications","spec","vtexToNizzaProduct","vtexProduct","applyTax","isAvailable","getPrice","price","getHost","R.ifElse","R.pipe","R.constructN","R.prop","R.always","priceWithDiscount","items","DATA_STATUS_ATTR","ScriptInjector","src","event","callback","status","scriptUrl","response","code","baseDir","quote1","quote2","absoluteUrl","blob","blobUrl","callbacks","VtexIoScriptInjector","props","errorMsg","baseId","maxRetries","initialInterval","module","ComponentManager","sleep","VtexProductDataSource","products","collectionName","nizza","accountApplyTax","_rawData","hostError","proxyError","errorMessage","useProxy","fullUrl","urlObject","baseURL","die","_len","args","_key","mockGlobal","getGlobal","getDescriptor","defineProperty","objectPrototype","EMPTY_ARRAY","EMPTY_OBJECT","hasProxy","plainObjectString","assertProxies","once","func","invoked","noop","isFunction","isStringish","t","isObject","isPlainObject","proto","protoConstructor","isGenerator","constructor","addHiddenProp","object","propName","addHiddenFinalProp","createInstanceofPredicate","theClass","isES6Map","thing","isPlainES6Map","mapProto","objectProto","nullProto","isES6Set","hasGetOwnPropertySymbols","getPlainObjectKeys","keys","symbols","s","ownKeys","toPrimitive","hasProp","getOwnPropertyDescriptors","res","getFlag","flags","mask","setFlag","newValue","_arrayLikeToArray","r","e","_defineProperties","o","_toPropertyKey","_createClass","_createForOfIteratorHelperLoose","_unsupportedIterableToArray","_extends","_inheritsLoose","_setPrototypeOf","_toPrimitive","storedAnnotationsSymbol","createDecoratorAnnotation","annotation","decorator","property","is20223Decorator","storeAnnotation","prototype","isOverride","context","$mobx","Atom","name_","IDerivationState_","_proto","listener","reportObserved","startBatch","propagateChanged","endBatch","isAtom","createAtom","onBecomeObservedHandler","onBecomeUnobservedHandler","atom","onBecomeObserved","onBecomeUnobserved","structuralComparer","deepEqual","defaultComparer","comparer","deepEnhancer","v","_","isObservable","observable","isAction","isFlow","flow","autoAction","shallowEnhancer","isObservableObject","isObservableArray","isObservableMap","isObservableSet","referenceEnhancer","refStructEnhancer","oldValue","OVERRIDE","createActionAnnotation","make_$1","extend_$1","decorate_20223_$1","adm","_this$options_","actionDescriptor","createActionDescriptor","proxyTrap","mthd","kind","addInitializer","ann","_createAction","m","_ann$options_$name","_ann$options_","_ann$options_$autoAct","_ann$options_2","createAction","_this$options_2","self","bound","assertActionDescriptor","_ref","_ref2","safeDescriptors","_annotation$options_","_annotation$options_$","_annotation$options_2","_annotation$options_$2","_annotation$options_3","_annotation$options_4","_adm$proxy_2","globalState","_adm$proxy_","createFlowAnnotation","make_$2","extend_$2","decorate_20223_$2","flowDescriptor","createFlowDescriptor","_this$options_3","assertFlowDescriptor","createComputedAnnotation","make_$3","extend_$3","decorate_20223_$3","assertComputedDescriptor","asObservableObject","ComputedValue","createObservableAnnotation","make_$4","extend_$4","decorate_20223_$4","_this$options_$enhanc","assertObservableDescriptor","desc","initializedObjects","initializeObservable","_ann$options_$enhance","ObservableValue","AUTO","autoAnnotation","createAutoAnnotation","make_$5","extend_$5","decorate_20223_$5","_this$options_4","computed","flowAnnotation","actionAnnotation","observableAnnotation","_this$options_5","_this$options_6","OBSERVABLE","OBSERVABLE_REF","OBSERVABLE_SHALLOW","OBSERVABLE_STRUCT","defaultCreateObservableOptions","asCreateObservableOptions","observableRefAnnotation","observableShallowAnnotation","observableStructAnnotation","observableDecoratorAnnotation","getEnhancerFromOptions","getEnhancerFromAnnotation","getAnnotationFromOptions","_options$defaultDecor","createObservable","arg2","arg3","observableFactories","initialValues","createLegacyArray","createObservableArray","ObservableMap","ObservableSet","decorators","initObservable","extendObservable","asDynamicObservableObject","COMPUTED","COMPUTED_STRUCT","computedAnnotation","computedStructAnnotation","arg1","opts","_getDescriptor$config","_getDescriptor","currentActionId","nextActionId","isFunctionNameConfigurable","tmpNameDescriptor","actionName","ref","executeAction","canRunAsDerivation","scope","runInfo","_startAction","err","_endAction","notifySpy_","startTime_","prevDerivation_","runAsAction","prevAllowStateChanges_","untrackedStart","allowStateChangesStart","prevAllowStateReads_","allowStateReadsStart","allowStateChangesEnd","allowStateReadsEnd","untrackedEnd","allowStateChanges","prev","_Atom","enhancer","notifySpy","equals","_this","hasInterceptors","change","interceptChange","UPDATE","hasListeners","notifyListeners","handler","registerInterceptor","fireImmediately","registerListener","CaughtException","TraceMode","propagateMaybeChanged","shouldCompute","prevTrackingContext","propagateChangeConfirmed","isCaughtException","wasSuspended","changed","track","trackDerivedFunction","clearObserving","firstTime","prevValue","autorun","prevU","isComputedValue","cause","derivation","prevAllowStateReads","prevUntracked","obs","l","changeDependenciesStateTo0","prevTracking","bindDependencies","prevObserving","observing","lowestNewObservingDerivationState","i0","dep","_dep","removeObserver","_dep2","addObserver","untracked","action","allowStateReads","MobXGlobals","canMergeGlobalState","global","node","queueForUnobservation","runReactions","d","Reaction","onInvalidate_","errorHandler_","requiresObservable_","prevReaction","message","abortSignal","_this2","dispose","enterBreakPoint","MAX_REACTION_ITERATIONS","reactionScheduler","runReactionsHelper","allReactions","iterations","remainingReactions","isReaction","isSpyEnabled","spy","ACTION","ACTION_BOUND","AUTOACTION","AUTOACTION_BOUND","DEFAULT_ACTION_NAME","actionBoundAnnotation","autoActionAnnotation","autoActionBoundAnnotation","createActionFactory","view","_opts$name","_opts","_opts2","_opts3","runSync","reaction","reactionRunner","scheduler","createSchedulerFromOptions","isScheduled","run","expression","effect","_opts$name2","_opts4","_opts5","effectAction","wrapErrorHandler","nextValue","errorHandler","baseFn","ON_BECOME_OBSERVED","ON_BECOME_UNOBSERVED","interceptHook","hook","getAtom","cb","listenersKey","hookListeners","properties","annotations","descriptors","generatorId","FlowCancellationError","flowBoundAnnotation","generator","ctx","runId","gen","rejector","pendingPromise","promise","stepId","onFulfilled","ret","next","onRejected","cancelPromise","_res","yieldedPromise","_isObservable","transaction","thisArg","when","predicate","whenPromise","_when","timeoutHandle","disposer","cond","cancel","getAdm","objectProxyTraps","_getAdm$set_","_getAdm$delete_","_getAdm$definePropert","_target$$mobx","_target$$mobx$proxy_","interceptable","interceptors","listenable","listeners","SPLICE","MAX_SPLICE_SIZE","arrayTraps","arrayExtensions","ObservableArrayAdministration","owned_","legacyMode_","newV","oldV","newLength","currentLength","newItems","oldLength","delta","reserveArrayBuffer","deleteCount","lengthDelta","_this$values_","oldItems","notify","added","removed","owned","proxy","_len2","_key2","_len3","_key3","copy","addArrayExtension","simpleFunc","mapLikeFunc","reduceLikeFunc","funcName","funcFactory","dehancedValues","_this3","accumulator","currentValue","isObservableArrayAdministration","ObservableMapMarker","ADD","DELETE","initialData","enhancer_","entry","newEntry","hasKey","_change","_this3$hasMap_$get","_this4","_this4$hasMap_$get","makeIterable","_keys$next","done","_keys$next2","_iterator","_step","_step$value","other","_this5","_this6","_iterator2","_step2","_this7","replacementMap","convertToMap","orderedData","keysReportChangedCalled","_iterator3","_step3","deleted","_iterator4","_step4","_step4$value","_value","keyExisted","_value2","iter1","iter2","next1","next2","dataStructure","map","ObservableSetMarker","callbackFn","_change2","nextIndex","observableValues","otherSet","dehancedSet","descriptorCache","REMOVE","ObservableObjectAdministration","target_","values_","defaultAnnotation_","_this$target_$storedA","outcome","recordAnnotationApplied","deleteOutcome","cachedDescriptor","getCachedObservablePropDescriptor","_this$pendingKeys_","_this$pendingKeys_2","_options$name","isObservableObjectAdministration","_adm$target_$storedAn","ENTRY_0","safariPrototypeSetterInheritanceBug","OBSERVABLE_ARRAY_BUFFER_SIZE","StubArray","inherit","ctor","LegacyObservableArray","_StubArray","arrays","createArrayEntryDescriptor","createArrayBufferItem","max","getDebugName","_observable","getAdministration","named","toString","depth","eq","aStack","bStack","className","unwrap","areArrays","aCtor","bCtor","iterator","getSelf","createDataSource","accountType","origin","isVtex","AccountTypes","NizzaProductRequestOriginTypes","createProductDataSource","createProductDataSourceAsync","lazyLoad","importFunc","selectorFunc","lazyFactory","LazyComponent","lazy","jsx","Suspense","keyCount","read","write","defaultRead","defaultWrite","arg","isSelfAtom","hasInitialValue","isActuallyWritableAtom","cancelablePromiseMap","isPendingPromise","isPromiseLike","promiseState","patchPromiseForCancelability","settle","isAtomStateInitialized","atomState","returnAtomValue","addPendingPromiseToDependency","dependencyAtomState","addDependency","pending","aState","addPendingDependent","createPending","addPendingAtom","dependent","dependents","getPendingDependents","addPendingFunction","flushPending","atomStates","functions","buildStore","getAtomState","debugMountedAtoms","setAtomStateValueOrPromise","valueOrPromise","hasPrevValue","readAtomState","force","isSync","getter","aState2","pending2","mountDependencies","controller","setSelf","writeAtom","complete","readAtom","getDependents","atomWithPendingPromise","recomputeDependents","topsortedAtoms","markedAtoms","visit","changedAtoms","isMarked","prevEpochNumber","hasChangedDeps","writeAtomState","setter","args2","mountAtom","aMounted","unmountAtom","mounted","onMount","onUnmount","createStore","atomStateMap","defaultStore","getDefaultStore","StoreContext","createContext","useStore","useContext","attachPromiseMeta","use","ReactExports","continuablePromiseMap","createContinuablePromise","continuablePromise","curr","me","registerCancelHandler","useAtomValue","valueFromReducer","storeFromReducer","atomFromReducer","rerender","useReducer","useEffect","unsub","useDebugValue","areInputsEqual","newInputs","lastInputs","useMemoOne","getResult","inputs","initial","useState","isFirstRun","useRef","committed","useCache","cache","useAtomEffect","effectFn","atomEffect","useEventBus","eventBus","useNZ","useCallback","useEventEffect","events","eventList","subscriptions","subscription","useScript","sources","attrs","enabled","normalizedSources","useMemo","normalizeSources","scripts","setScripts","loadScript","existingScript","findScript","handleExistingScript","createAndLoadScript","script","getScriptStatuses","normalizeSrc","updateScriptStatus","localScript","_src","n$2","S","h","u","y","w","lt","st","$","T","E","k","O","j","M","R","D","V","I","N","U","B","Y","Z","G","z","F","et","K","Re","Q","require$$0","client","findElement","selectors","selector","startObservation","observer","foundResult","waitForElement","timeoutId","cleanUp","immediateResult","initializeNizzaRuntime","Runtime","registerReactComponent","runtime","rootId","components","root","renderReactComponent","newProps","reactRender","registerLitComponent","defaultRootId","wcName","renderLitComponent","updateLitProps","container","litRender","componentTree","createComponentTree","StrictMode","children","ComponentOrElement","elementProps","isValidElement","cloneElement","getContainer","createRoot","handleError","setDefaultProductDataSource","defaultLimit","runtimeType","RuntimeType","dataSource"],"mappings":";;;;;;;;AAEA,MAAMA,IAASC,GAAkB,OAAO;ACAjC,MAAMC,GAAiC;AAAA,EAG5C,cAAc;AAFN,IAAAC,EAAA;AAGN,SAAK,QAAQ,KAAK,mBAAA;AAAA,EACpB;AAAA,EAEQ,qBAAqB;AAC3B,QAAIC,IAAe,CAAA;AAEnB,QAAI;AACF,MAAAA,IAAQ,KAAK,MAAM,O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